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;
240 #define WPS_EXTRA_LARGE_BIT 1
241 #define WPS_VERY_LARGE_BIT 2
242 #define WPS_LARGE_BIT 4
243 #define WPS_SMALL_PRINT_BIT 8
244 #define WPS_FINE_PRINT_BIT 0x10
245 #define WPS_SUPERSCRIPT_BIT 0x20
246 #define WPS_SUBSCRIPT_BIT 0x40
247 #define WPS_OUTLINE_BIT 0x80
248 #define WPS_ITALICS_BIT 0x100
249 #define WPS_SHADOW_BIT 0x200
250 #define WPS_REDLINE_BIT 0x400
251 #define WPS_DOUBLE_UNDERLINE_BIT 0x800
252 #define WPS_BOLD_BIT 0x1000
253 #define WPS_STRIKEOUT_BIT 0x2000
254 #define WPS_UNDERLINE_BIT 0x4000
255 #define WPS_SMALL_CAPS_BIT 0x8000
256 #define WPS_BLINK_BIT 0x10000L
257 #define WPS_REVERSEVIDEO_BIT 0x20000L
258 #define WPS_ALL_CAPS_BIT 0x40000L
259 #define WPS_EMBOSS_BIT 0x80000L
260 #define WPS_ENGRAVE_BIT 0x100000L
261 #define WPS_OVERLINE_BIT 0x400000L
262 #define WPS_HIDDEN_BIT 0x800000L
265 #define WPS_PAGE_BREAK 0x00
266 #define WPS_SOFT_PAGE_BREAK 0x01
267 #define WPS_COLUMN_BREAK 0x02
270 #define WPS_LEFT 0x00
271 #define WPS_RIGHT 0x01
272 #define WPS_CENTER 0x02
274 #define WPS_BOTTOM 0x04
301 assert(c >= 0 && c <= 1);
302 return (c==0) ?
m_x :
m_y;
307 assert(c >= 0 && c <= 1);
308 return (c==0) ?
m_x :
m_y;
389 bool operator<(Vec2<T>
const &p)
const
397 if (diff)
return (diff < 0) ? -1 : 1;
399 if (diff)
return (diff < 0) ? -1 : 1;
406 if (diff)
return (diff < 0) ? -1 : 1;
408 if (diff)
return (diff < 0) ? -1 : 1;
413 friend std::ostream &operator<< (std::ostream &o, Vec2<T>
const &f)
415 o << f.m_x <<
"x" << f.m_y;
427 return s1.
cmp(s2) < 0;
433 typedef std::map<Vec2<T>, T,
struct PosSizeLtX>
MapX;
443 return s1.
cmpY(s2) < 0;
449 typedef std::map<Vec2<T>, T,
struct PosSizeLtY>
MapY;
476 for (
int c=0; c < 2; c++)
m_pt[c] = p[c];
506 assert(c >= 0 && c <= 1);
551 m_pt[0] = ctr - 0.5*sz;
552 m_pt[1] = ctr + (sz - 0.5*sz);
556 template <
class U>
void scale(U factor)
580 bool operator<(Box2<T>
const &p)
const
589 if (diff)
return diff;
591 if (diff)
return diff;
596 friend std::ostream &operator<< (std::ostream &o, Box2<T>
const &f)
598 o <<
"(" << f.m_pt[0] <<
"<->" << f.m_pt[1] <<
")";
610 return s1.
cmp(s2) < 0;
616 typedef std::map<Box2<T>, T,
struct PosSizeLt>
Map;