23 #ifndef LIBWPS_INTERNAL_H
24 #define LIBWPS_INTERNAL_H
35 #include <libwpd-stream/libwpd-stream.h>
36 #include <libwpd/libwpd.h>
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;
56 #if defined(SHAREDPTR_TR1)
58 using std::tr1::shared_ptr;
59 #elif defined(SHAREDPTR_STD)
61 using std::shared_ptr;
63 #include <boost/shared_ptr.hpp>
64 using boost::shared_ptr;
78 #define WPS_DEBUG_MSG(M) printf M
80 #define WPS_DEBUG_MSG(M)
111 uint8_t
readU8(WPXInputStream *input);
112 uint16_t
readU16(WPXInputStream *input);
113 uint32_t
readU32(WPXInputStream *input);
115 int8_t
read8(WPXInputStream *input);
116 int16_t
read16(WPXInputStream *input);
117 int32_t
read32(WPXInputStream *input);
121 return readU8(input.get());
134 return read8(input.get());
138 return read16(input.get());
142 return read32(input.get());
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))
160 class WPXPropertyListVector;
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
298 #define WPS_PAGE_BREAK 0x00
299 #define WPS_SOFT_PAGE_BREAK 0x01
300 #define WPS_COLUMN_BREAK 0x02
303 #define WPS_LEFT 0x00
304 #define WPS_RIGHT 0x01
305 #define WPS_CENTER 0x02
307 #define WPS_BOTTOM 0x04
334 assert(c >= 0 && c <= 1);
335 return (c==0) ?
m_x :
m_y;
340 assert(c >= 0 && c <= 1);
341 return (c==0) ?
m_x :
m_y;
422 bool operator<(Vec2<T>
const &p)
const
430 if (diff < 0)
return -1;
431 if (diff > 0)
return 1;
433 if (diff < 0)
return -1;
434 if (diff > 0)
return 1;
441 if (diff < 0)
return -1;
442 if (diff > 0)
return 1;
444 if (diff < 0)
return -1;
445 if (diff > 0)
return 1;
450 friend std::ostream &operator<< (std::ostream &o, Vec2<T>
const &f)
452 o << f.m_x <<
"x" << f.m_y;
464 return s1.
cmp(s2) < 0;
470 typedef std::map<Vec2<T>, T,
struct PosSizeLtX>
MapX;
480 return s1.
cmpY(s2) < 0;
486 typedef std::map<Vec2<T>, T,
struct PosSizeLtY>
MapY;
513 for (
int c=0; c < 2; c++)
m_pt[c] = p[c];
543 assert(c >= 0 && c <= 1);
588 m_pt[0] = ctr - 0.5*sz;
589 m_pt[1] = ctr + (sz - 0.5*sz);
593 template <
class U>
void scale(U factor)
617 bool operator<(Box2<T>
const &p)
const
626 if (diff)
return diff;
628 if (diff)
return diff;
633 friend std::ostream &operator<< (std::ostream &o, Box2<T>
const &f)
635 o <<
"(" << f.m_pt[0] <<
"<->" << f.m_pt[1] <<
")";
647 return s1.
cmp(s2) < 0;
653 typedef std::map<Box2<T>, T,
struct PosSizeLt>
Map;