27 #ifndef LIBWPD_INTERNAL_H
28 #define LIBWPD_INTERNAL_H
41 #define LIBWPD_MIN min
42 #define LIBWPD_MAX max
44 #define LIBWPD_MIN std::min
45 #define LIBWPD_MAX std::max
48 #define WPD_CHECK_FILE_ERROR(v) if (v==EOF) { WPD_DEBUG_MSG(("X_CheckFileError: %d\n", __LINE__)); throw FileException(); }
49 #define WPD_CHECK_FILE_SEEK_ERROR(v) if (v) { WPD_DEBUG_MSG(("X_CheckFileSeekError: %d\n", __LINE__)); throw FileException(); }
50 #define WPD_CHECK_FILE_READ_ERROR(v,num_elements) if (v != num_elements) {\
51 WPD_DEBUG_MSG(("X_CheckFileReadElementError: %d\n", __LINE__)); throw FileException(); }
53 #define DELETEP(m) if (m) { delete m; m = 0; }
56 #define WPD_DEBUG_MSG(M) printf M
58 #define WPD_DEBUG_MSG(M)
61 #define WPD_LE_GET_GUINT8(p) (*(uint8_t const *)(p))
62 #define WPD_LE_GET_GUINT16(p) \
63 (uint16_t)((((uint8_t const *)(p))[0] << 0) | \
64 (((uint8_t const *)(p))[1] << 8))
65 #define WPD_LE_GET_GUINT32(p) \
66 (uint32_t)((((uint8_t const *)(p))[0] << 0) | \
67 (((uint8_t const *)(p))[1] << 8) | \
68 (((uint8_t const *)(p))[2] << 16) | \
69 (((uint8_t const *)(p))[3] << 24))
71 #define WPD_BE_GET_GUINT8(p) (*(uint8_t const *)(p))
72 #define WPD_BE_GET_GUINT16(p) \
73 (uint16_t)((((uint8_t const *)(p))[1] << 0) | \
74 (((uint8_t const *)(p))[0] << 8))
75 #define WPD_BE_GET_GUINT32(p) \
76 (uint32_t)((((uint8_t const *)(p))[3] << 0) | \
77 (((uint8_t const *)(p))[2] << 8) | \
78 (((uint8_t const *)(p))[1] << 16) | \
79 (((uint8_t const *)(p))[0] << 24))
81 #define WPD_NUM_ELEMENTS(array) sizeof(array)/sizeof(array[0])
97 const uint32_t **chars);
100 const uint32_t **chars);
133 #define WPX_EXTRA_LARGE_BIT 1
134 #define WPX_VERY_LARGE_BIT 2
135 #define WPX_LARGE_BIT 4
136 #define WPX_SMALL_PRINT_BIT 8
137 #define WPX_FINE_PRINT_BIT 16
138 #define WPX_SUPERSCRIPT_BIT 32
139 #define WPX_SUBSCRIPT_BIT 64
140 #define WPX_OUTLINE_BIT 128
141 #define WPX_ITALICS_BIT 256
142 #define WPX_SHADOW_BIT 512
143 #define WPX_REDLINE_BIT 1024
144 #define WPX_DOUBLE_UNDERLINE_BIT 2048
145 #define WPX_BOLD_BIT 4096
146 #define WPX_STRIKEOUT_BIT 8192
147 #define WPX_UNDERLINE_BIT 16384
148 #define WPX_SMALL_CAPS_BIT 32768
149 #define WPX_BLINK_BIT 65536
150 #define WPX_REVERSEVIDEO_BIT 131072
153 #define WPX_PARAGRAPH_JUSTIFICATION_LEFT 0x00
154 #define WPX_PARAGRAPH_JUSTIFICATION_FULL 0x01
155 #define WPX_PARAGRAPH_JUSTIFICATION_CENTER 0x02
156 #define WPX_PARAGRAPH_JUSTIFICATION_RIGHT 0x03
157 #define WPX_PARAGRAPH_JUSTIFICATION_FULL_ALL_LINES 0x04
158 #define WPX_PARAGRAPH_JUSTIFICATION_DECIMAL_ALIGNED 0x05
161 #define WPX_TABLE_POSITION_ALIGN_WITH_LEFT_MARGIN 0x00
162 #define WPX_TABLE_POSITION_ALIGN_WITH_RIGHT_MARGIN 0x01
163 #define WPX_TABLE_POSITION_CENTER_BETWEEN_MARGINS 0x02
164 #define WPX_TABLE_POSITION_FULL 0x03
165 #define WPX_TABLE_POSITION_ABSOLUTE_FROM_LEFT_MARGIN 0x04
174 #define WPX_PAGE_BREAK 0x00
175 #define WPX_SOFT_PAGE_BREAK 0x01
176 #define WPX_COLUMN_BREAK 0x02
179 #define WPX_LEFT 0x00
180 #define WPX_RIGHT 0x01
181 #define WPX_CENTER 0x02
183 #define WPX_BOTTOM 0x04
188 _RGBSColor(uint8_t r, uint8_t g, uint8_t b, uint8_t s);
189 _RGBSColor(uint16_t red, uint16_t green, uint16_t blue);