libwps_internal.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
11  * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
12  *
13  * For minor contributions see the git repository.
14  *
15  * Alternatively, the contents of this file may be used under the terms
16  * of the GNU Lesser General Public License Version 2.1 or later
17  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18  * applicable instead of those above.
19  *
20  * For further information visit http://libwps.sourceforge.net
21  */
22 
23 #ifndef LIBWPS_INTERNAL_H
24 #define LIBWPS_INTERNAL_H
25 
26 #include <assert.h>
27 #ifdef DEBUG
28 #include <stdio.h>
29 #endif
30 
31 #include <iostream>
32 #include <map>
33 #include <string>
34 
35 #include <libwpd-stream/libwpd-stream.h>
36 #include <libwpd/libwpd.h>
37 
38 class WPXBinaryData;
39 
40 #if defined(_MSC_VER) || defined(__DJGPP__)
41 typedef signed char int8_t;
42 typedef unsigned char uint8_t;
43 typedef signed short int16_t;
44 typedef unsigned short uint16_t;
45 typedef signed int int32_t;
46 typedef unsigned int uint32_t;
47 #else /* !_MSC_VER && !__DJGPP__*/
48 #include <inttypes.h>
49 #endif /* _MSC_VER || __DJGPP__*/
50 
51 /* ---------- memory --------------- */
52 #ifdef HAVE_CONFIG_H
53 #include "config.h"
54 #endif
55 
56 #if defined(SHAREDPTR_TR1)
57 #include <tr1/memory>
58 using std::tr1::shared_ptr;
59 #elif defined(SHAREDPTR_STD)
60 #include <memory>
61 using std::shared_ptr;
62 #else
63 #include <boost/shared_ptr.hpp>
64 using boost::shared_ptr;
65 #endif
66 
68 template <class T>
70 {
71  void operator() (T *) {}
72 };
73 
74 typedef shared_ptr<WPXInputStream> WPXInputStreamPtr;
75 
76 /* ---------- debug --------------- */
77 #ifdef DEBUG
78 #define WPS_DEBUG_MSG(M) printf M
79 #else
80 #define WPS_DEBUG_MSG(M)
81 #endif
82 
83 /* ---------- exception ------------ */
84 namespace libwps
85 {
86 // Various exceptions
88 {
89  // needless to say, we could flesh this class out a bit
90 };
91 
93 {
94  // needless to say, we could flesh this class out a bit
95 };
96 
98 {
99  // needless to say, we could flesh this class out a bit
100 };
101 
103 {
104  // needless to say, we could flesh this class out a bit
105 };
106 }
107 
108 /* ---------- input ----------------- */
109 namespace libwps
110 {
111 uint8_t readU8(WPXInputStream *input);
112 uint16_t readU16(WPXInputStream *input);
113 uint32_t readU32(WPXInputStream *input);
114 
115 int8_t read8(WPXInputStream *input);
116 int16_t read16(WPXInputStream *input);
117 int32_t read32(WPXInputStream *input);
118 
119 inline uint8_t readU8(WPXInputStreamPtr &input)
120 {
121  return readU8(input.get());
122 }
123 inline uint16_t readU16(WPXInputStreamPtr &input)
124 {
125  return readU16(input.get());
126 }
127 inline uint32_t readU32(WPXInputStreamPtr &input)
128 {
129  return readU32(input.get());
130 }
131 
132 inline int8_t read8(WPXInputStreamPtr &input)
133 {
134  return read8(input.get());
135 }
136 inline int16_t read16(WPXInputStreamPtr &input)
137 {
138  return read16(input.get());
139 }
140 inline int32_t read32(WPXInputStreamPtr &input)
141 {
142  return read32(input.get());
143 }
144 
145 bool readData(WPXInputStreamPtr &input, unsigned long sz, WPXBinaryData &data);
146 bool readDataToEnd(WPXInputStreamPtr &input, WPXBinaryData &data);
147 }
148 
149 #define WPS_LE_GET_GUINT16(p) \
150  (uint16_t)((((uint8_t const *)(p))[0] << 0) | \
151  (((uint8_t const *)(p))[1] << 8))
152 #define WPS_LE_GET_GUINT32(p) \
153  (uint32_t)((((uint8_t const *)(p))[0] << 0) | \
154  (((uint8_t const *)(p))[1] << 8) | \
155  (((uint8_t const *)(p))[2] << 16) | \
156  (((uint8_t const *)(p))[3] << 24))
157 
158 // Various helper structures for the parser..
159 /* ---------- small enum/class ------------- */
160 class WPXPropertyListVector;
161 struct WPSFont
162 {
164  WPSFont() : m_name(""), m_size(0), m_attributes(0), m_color(0), m_languageId(-1), m_extra("") {}
166  {
167  WPSFont res;
168  res.m_name = "Courier";
169  res.m_size = 12;
170  return res;
171  }
172 
173  virtual ~WPSFont() {}
175  friend std::ostream &operator<<(std::ostream &o, WPSFont const &ft);
176 
178  bool isSet() const
179  {
180  return !m_name.empty();
181  }
182 
184  bool operator==(WPSFont const &ft) const;
185  bool operator!=(WPSFont const &ft) const
186  {
187  return !operator==(ft);
188  }
189 
191  std::string m_name;
193  int m_size;
195  uint32_t m_attributes;
197  uint32_t m_color;
200 
202  std::string m_extra;
203 };
204 
206 {
208  {
209  }
210  double m_width;
211  double m_leftGutter;
213 };
214 
216 {
218  {
219  }
220  uint32_t m_attributes;
221  uint8_t m_alignment;
222 };
223 
225 struct WPSBorder
226 {
228  enum Pos { Left = 0, Right = 1, Top = 2, Bottom = 3 };
229  enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08 };
230 
234  std::string getPropertyValue() const;
235 
237  bool operator==(WPSBorder const &orig) const
238  {
239  return m_style == orig.m_style && m_width == orig.m_width
240  && m_color == orig.m_color;
241  }
243  bool operator!=(WPSBorder const &orig) const
244  {
245  return !operator==(orig);
246  }
248  int compare(WPSBorder const &orig) const;
249 
251  friend std::ostream &operator<< (std::ostream &o, WPSBorder const &border);
255  int m_width;
257  uint32_t m_color;
258 
259 };
260 
261 namespace libwps
262 {
264 std::string numberingTypeToString(NumberingType type);
268  };
269 enum { NoBreakBit = 0x1, NoBreakWithNextBit=0x2};
270 }
271 
272 // ATTRIBUTE bits
273 #define WPS_EXTRA_LARGE_BIT 1
274 #define WPS_VERY_LARGE_BIT 2
275 #define WPS_LARGE_BIT 4
276 #define WPS_SMALL_PRINT_BIT 8
277 #define WPS_FINE_PRINT_BIT 0x10
278 #define WPS_SUPERSCRIPT_BIT 0x20
279 #define WPS_SUBSCRIPT_BIT 0x40
280 #define WPS_OUTLINE_BIT 0x80
281 #define WPS_ITALICS_BIT 0x100
282 #define WPS_SHADOW_BIT 0x200
283 #define WPS_REDLINE_BIT 0x400
284 #define WPS_DOUBLE_UNDERLINE_BIT 0x800
285 #define WPS_BOLD_BIT 0x1000
286 #define WPS_STRIKEOUT_BIT 0x2000
287 #define WPS_UNDERLINE_BIT 0x4000
288 #define WPS_SMALL_CAPS_BIT 0x8000
289 #define WPS_BLINK_BIT 0x10000L
290 #define WPS_REVERSEVIDEO_BIT 0x20000L
291 #define WPS_ALL_CAPS_BIT 0x40000L
292 #define WPS_EMBOSS_BIT 0x80000L
293 #define WPS_ENGRAVE_BIT 0x100000L
294 #define WPS_OVERLINE_BIT 0x400000L
295 #define WPS_HIDDEN_BIT 0x800000L
296 
297 // BREAK bits
298 #define WPS_PAGE_BREAK 0x00
299 #define WPS_SOFT_PAGE_BREAK 0x01
300 #define WPS_COLUMN_BREAK 0x02
301 
302 // Generic bits
303 #define WPS_LEFT 0x00
304 #define WPS_RIGHT 0x01
305 #define WPS_CENTER 0x02
306 #define WPS_TOP 0x03
307 #define WPS_BOTTOM 0x04
308 
309 /* ---------- vec2/box2f ------------- */
313 template <class T> class Vec2
314 {
315 public:
317  Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
319  template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
320 
322  T x() const
323  {
324  return m_x;
325  }
327  T y() const
328  {
329  return m_y;
330  }
332  T operator[](int c) const
333  {
334  assert(c >= 0 && c <= 1);
335  return (c==0) ? m_x : m_y;
336  }
338  T &operator[](int c)
339  {
340  assert(c >= 0 && c <= 1);
341  return (c==0) ? m_x : m_y;
342  }
343 
345  void set(T xx, T yy)
346  {
347  m_x = xx;
348  m_y = yy;
349  }
351  void setX(T xx)
352  {
353  m_x = xx;
354  }
356  void setY(T yy)
357  {
358  m_y = yy;
359  }
360 
362  void add(T dx, T dy)
363  {
364  m_x += dx;
365  m_y += dy;
366  }
367 
370  {
371  m_x += p.m_x;
372  m_y += p.m_y;
373  return *this;
374  }
377  {
378  m_x -= p.m_x;
379  m_y -= p.m_y;
380  return *this;
381  }
383  template <class U>
384  Vec2<T> &operator*=(U scale)
385  {
386  m_x = T(m_x*scale);
387  m_y = T(m_y*scale);
388  return *this;
389  }
390 
392  friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2)
393  {
394  Vec2<T> p(p1);
395  return p+=p2;
396  }
398  friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2)
399  {
400  Vec2<T> p(p1);
401  return p-=p2;
402  }
404  template <class U>
405  friend Vec2<T> operator*(U scale, Vec2<T> const &p1)
406  {
407  Vec2<T> p(p1);
408  return p *= scale;
409  }
410 
412  bool operator==(Vec2<T> const &p) const
413  {
414  return cmpY(p) == 0;
415  }
417  bool operator!=(Vec2<T> const &p) const
418  {
419  return cmpY(p) != 0;
420  }
422  bool operator<(Vec2<T> const &p) const
423  {
424  return cmpY(p) < 0;
425  }
427  int cmp(Vec2<T> const &p) const
428  {
429  T diff = m_x-p.m_x;
430  if (diff < 0) return -1;
431  if (diff > 0) return 1;
432  diff = m_y-p.m_y;
433  if (diff < 0) return -1;
434  if (diff > 0) return 1;
435  return 0;
436  }
438  int cmpY(Vec2<T> const &p) const
439  {
440  T diff = m_y-p.m_y;
441  if (diff < 0) return -1;
442  if (diff > 0) return 1;
443  diff = m_x-p.m_x;
444  if (diff < 0) return -1;
445  if (diff > 0) return 1;
446  return 0;
447  }
448 
450  friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f)
451  {
452  o << f.m_x << "x" << f.m_y;
453  return o;
454  }
455 
459  struct PosSizeLtX
460  {
462  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
463  {
464  return s1.cmp(s2) < 0;
465  }
466  };
470  typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
471 
475  struct PosSizeLtY
476  {
478  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
479  {
480  return s1.cmpY(s2) < 0;
481  }
482  };
486  typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
487 protected:
488  T m_x, m_y;
489 };
490 
494 typedef Vec2<int> Vec2i;
497 
501 template <class T> class Box2
502 {
503 public:
505  Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>())
506  {
507  m_pt[0] = minPt;
508  m_pt[1] = maxPt;
509  }
511  template <class U> Box2(Box2<U> const &p)
512  {
513  for (int c=0; c < 2; c++) m_pt[c] = p[c];
514  }
515 
517  Vec2<T> const &min() const
518  {
519  return m_pt[0];
520  }
522  Vec2<T> const &max() const
523  {
524  return m_pt[1];
525  }
528  {
529  return m_pt[0];
530  }
533  {
534  return m_pt[1];
535  }
536 
541  Vec2<T> const &operator[](int c) const
542  {
543  assert(c >= 0 && c <= 1);
544  return m_pt[c];
545  }
547  Vec2<T> size() const
548  {
549  return m_pt[1]-m_pt[0];
550  }
552  Vec2<T> center() const
553  {
554  return 0.5*(m_pt[0]+m_pt[1]);
555  }
556 
558  void set(Vec2<T> const &x, Vec2<T> const &y)
559  {
560  m_pt[0] = x;
561  m_pt[1] = y;
562  }
564  void setMin(Vec2<T> const &x)
565  {
566  m_pt[0] = x;
567  }
569  void setMax(Vec2<T> const &y)
570  {
571  m_pt[1] = y;
572  }
573 
575  void resizeFromMin(Vec2<T> const &sz)
576  {
577  m_pt[1] = m_pt[0]+sz;
578  }
580  void resizeFromMax(Vec2<T> const &sz)
581  {
582  m_pt[0] = m_pt[1]-sz;
583  }
585  void resizeFromCenter(Vec2<T> const &sz)
586  {
587  Vec2<T> ctr = 0.5*(m_pt[0]+m_pt[1]);
588  m_pt[0] = ctr - 0.5*sz;
589  m_pt[1] = ctr + (sz - 0.5*sz);
590  }
591 
593  template <class U> void scale(U factor)
594  {
595  m_pt[0] *= factor;
596  m_pt[1] *= factor;
597  }
598 
600  void extend(T val)
601  {
602  m_pt[0] -= Vec2<T>(val/2,val/2);
603  m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
604  }
605 
607  bool operator==(Box2<T> const &p) const
608  {
609  return cmp(p) == 0;
610  }
612  bool operator!=(Box2<T> const &p) const
613  {
614  return cmp(p) != 0;
615  }
617  bool operator<(Box2<T> const &p) const
618  {
619  return cmp(p) < 0;
620  }
621 
623  int cmp(Box2<T> const &p) const
624  {
625  int diff = m_pt[0].cmpY(p.m_pt[0]);
626  if (diff) return diff;
627  diff = m_pt[1].cmpY(p.m_pt[1]);
628  if (diff) return diff;
629  return 0;
630  }
631 
633  friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f)
634  {
635  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
636  return o;
637  }
638 
642  struct PosSizeLt
643  {
645  bool operator()(Box2<T> const &s1, Box2<T> const &s2) const
646  {
647  return s1.cmp(s2) < 0;
648  }
649  };
653  typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
654 
655 protected:
658 };
659 
661 typedef Box2<int> Box2i;
664 
665 #endif /* LIBWPS_INTERNAL_H */
666 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: libwps_internal.h:227
std::string m_name
font name
Definition: libwps_internal.h:191
Definition: libwps_internal.h:263
uint32_t readU32(WPXInputStream *input)
Definition: libwps_internal.cpp:70
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:496
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libwps_internal.h:558
void setY(T yy)
resets the second element
Definition: libwps_internal.h:356
a border list
Definition: libwps_internal.h:225
Definition: libwps_internal.h:227
Definition: libwps_internal.h:215
bool readData(WPXInputStreamPtr &input, unsigned long size, WPXBinaryData &data)
Definition: libwps_internal.cpp:84
Definition: libwps_internal.h:102
T m_x
first element
Definition: libwps_internal.h:488
uint32_t m_color
the font color
Definition: libwps_internal.h:197
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libwps_internal.h:541
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:517
bool operator!=(WPSFont const &ft) const
Definition: libwps_internal.h:185
virtual ~WPSFont()
Definition: libwps_internal.h:173
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libwps_internal.h:612
Definition: libwps_internal.h:227
Definition: libwps_internal.h:161
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libwps_internal.h:623
Definition: libwps_internal.h:269
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libwps_internal.h:398
T & operator[](int c)
operator[]
Definition: libwps_internal.h:338
Definition: libwps_internal.h:228
small class which defines a 2D Box
Definition: libwps_internal.h:501
Definition: libwps_internal.h:229
bool readDataToEnd(WPXInputStreamPtr &input, WPXBinaryData &data)
Definition: libwps_internal.cpp:105
internal struct used to create sorted map, sorted first min then max
Definition: libwps_internal.h:642
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libwps_internal.h:575
double m_leftGutter
Definition: libwps_internal.h:211
Definition: libwps_internal.h:227
internal struct used to create sorted map, sorted by X
Definition: libwps_internal.h:459
uint32_t m_color
the border color
Definition: libwps_internal.h:257
std::map< Vec2< int >, int, struct PosSizeLtY > MapY
Definition: libwps_internal.h:486
WPSFont()
constructor
Definition: libwps_internal.h:164
int m_width
the border width
Definition: libwps_internal.h:255
int16_t read16(WPXInputStream *input)
Definition: libwps_internal.cpp:65
Definition: libwps_internal.h:265
Definition: libwps_internal.h:228
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libwps_internal.h:369
Definition: libwps_internal.h:263
std::string getPropertyValue() const
return the properties
Definition: libwps_internal.cpp:197
void set(T xx, T yy)
resets the two elements
Definition: libwps_internal.h:345
Definition: libwps_internal.h:263
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libwps_internal.h:600
Definition: libwps_internal.h:265
uint32_t m_attributes
Definition: libwps_internal.h:220
Definition: libwps_internal.h:265
Box2< int > Box2i
Box2 of int.
Definition: libwps_internal.h:661
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:532
double m_width
Definition: libwps_internal.h:210
Vec2< T > center() const
the box center
Definition: libwps_internal.h:552
Justification
Definition: libwps_internal.h:266
double m_rightGutter
Definition: libwps_internal.h:212
uint16_t readU16(WPXInputStream *input)
Definition: libwps_internal.cpp:58
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libwps_internal.h:412
Definition: libwps_internal.h:227
Definition: libwps_internal.h:263
int8_t read8(WPXInputStream *input)
Definition: libwps_internal.cpp:53
Definition: libwps_internal.h:228
Definition: libwps_internal.h:265
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libwps_internal.h:417
T y() const
second element
Definition: libwps_internal.h:327
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: libwps_internal.h:195
Vec2(T xx=0, T yy=0)
constructor
Definition: libwps_internal.h:317
Box2< float > Box2f
Box2 of float.
Definition: libwps_internal.h:663
void setX(T xx)
resets the first element
Definition: libwps_internal.h:351
Definition: libwps_internal.h:269
std::map< Box2< float >, float, struct PosSizeLt > Map
Definition: libwps_internal.h:653
WPSBorder()
constructor
Definition: libwps_internal.h:232
Definition: libwps_internal.h:228
SubDocumentType
Definition: libwps_internal.h:265
Definition: libwps_internal.h:263
Definition: libwps_internal.h:266
Definition: libwps_internal.h:265
Definition: libwps_internal.h:97
int m_languageId
the language (simplified locale name id) if known
Definition: libwps_internal.h:199
Definition: libwps_internal.h:267
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:522
bool operator!=(WPSBorder const &orig) const
operator!=
Definition: libwps_internal.h:243
Definition: libwps_internal.h:265
Definition: libwps_internal.h:87
Box2(Box2< U > const &p)
generic constructor
Definition: libwps_internal.h:511
internal struct used to create sorted map, sorted by Y
Definition: libwps_internal.h:475
std::string m_extra
public field use to add a message when the font is printed
Definition: libwps_internal.h:202
Vec2< T > m_pt[2]
the two extremities
Definition: libwps_internal.h:657
T x() const
first element
Definition: libwps_internal.h:322
void operator()(T *)
Definition: libwps_internal.h:71
Definition: libwps_internal.h:227
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libwps_internal.h:362
uint8_t m_alignment
Definition: libwps_internal.h:221
Definition: libwps_internal.h:205
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:478
WPSColumnProperties()
Definition: libwps_internal.h:217
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libwps_internal.h:376
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libwps_internal.h:384
NumberingType
Definition: libwps_internal.h:263
static WPSFont getDefault()
Definition: libwps_internal.h:165
Definition: libwps_internal.h:229
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libwps_internal.h:438
std::map< Vec2< int >, int, struct PosSizeLtX > MapX
Definition: libwps_internal.h:470
bool isSet() const
accessor
Definition: libwps_internal.h:178
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:494
friend std::ostream & operator<<(std::ostream &o, WPSBorder const &border)
operator&lt;&lt;: prints data in form &quot;XxY&quot;
Definition: libwps_internal.cpp:226
Pos
Definition: libwps_internal.h:228
Definition: libwps_internal.h:267
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libwps_internal.h:319
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libwps_internal.h:607
T operator[](int c) const
operator[]
Definition: libwps_internal.h:332
int compare(WPSBorder const &orig) const
compare two cell
Definition: libwps_internal.cpp:186
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libwps_internal.h:580
int m_size
font size
Definition: libwps_internal.h:193
void scale(U factor)
scales all points of the box by factor
Definition: libwps_internal.h:593
std::string numberingTypeToString(NumberingType type)
Definition: libwps_internal.cpp:117
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libwps_internal.h:569
Style
Definition: libwps_internal.h:227
bool operator==(WPSBorder const &orig) const
operator==
Definition: libwps_internal.h:237
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libwps_internal.h:564
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libwps_internal.h:505
uint8_t readU8(WPXInputStream *input)
Definition: libwps_internal.cpp:34
Definition: libwps_internal.h:92
Definition: libwps_internal.h:229
WPSColumnDefinition()
Definition: libwps_internal.h:207
Style m_style
the border style
Definition: libwps_internal.h:253
Definition: libwps_internal.h:266
int32_t read32(WPXInputStream *input)
Definition: libwps_internal.cpp:79
Definition: libwps_internal.h:263
Definition: libwps_internal.h:266
small class which defines a vector with 2 elements
Definition: libwps_internal.h:313
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:462
Definition: libwps_internal.h:263
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libwps_internal.h:405
Vec2< T > size() const
the box size
Definition: libwps_internal.h:547
T m_y
second element
Definition: libwps_internal.h:488
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libwps_internal.h:69
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:645
friend std::ostream & operator<<(std::ostream &o, WPSFont const &ft)
operator&lt;&lt;
Definition: libwps_internal.cpp:141
bool operator==(WPSFont const &ft) const
compares to font
Definition: libwps_internal.cpp:172
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libwps_internal.h:427
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:492
Definition: libwps_internal.h:229
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libwps_internal.h:585
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:527
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libwps_internal.h:392

Generated on Wed Jun 11 2014 02:26:00 for libwps by doxygen 1.8.5