00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef UT_TYPES_H
00023 #define UT_TYPES_H
00024
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028
00029 #include <stdlib.h>
00030 #include <glib.h>
00031
00032
00033
00034
00035 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
00036 # define GNUC_EXTENSION __extension__
00037 #else
00038 # define GNUC_EXTENSION
00039 #endif
00040
00041 typedef guint8 UT_Byte;
00042
00043 typedef gunichar UT_UCS4Char;
00044 typedef guint16 UT_UCS2Char;
00045 typedef gint32 UT_GrowBufElement;
00046
00047
00048
00049 typedef UT_UCS4Char UT_UCSChar;
00050
00051 typedef guint8 UT_uint8;
00052 typedef gint8 UT_sint8;
00053
00054 typedef guint16 UT_uint16;
00055 typedef gint16 UT_sint16;
00056
00057 typedef guint32 UT_uint32;
00058 typedef gint32 UT_sint32;
00059
00060 typedef guint64 UT_uint64;
00061 typedef gint64 UT_sint64;
00062
00064 #define UT_UNUSED(x) (void)(x);
00065
00070 typedef UT_uint8 UT_Confidence_t;
00071
00072 #define UT_CONFIDENCE_PERFECT 255
00073 #define UT_CONFIDENCE_GOOD 170
00074 #define UT_CONFIDENCE_SOSO 127
00075 #define UT_CONFIDENCE_POOR 85
00076 #define UT_CONFIDENCE_ZILCH 0
00077
00078 #if defined(WIN32)
00079 #define ABI_PLUGIN_EXPORT __declspec(dllexport)
00080 #ifdef ABI_DLL
00081
00082 #define ABI_EXPORT __declspec(dllimport)
00083 #else
00084
00085 #define ABI_EXPORT __declspec(dllexport)
00086 #endif
00087 #elif defined (DISABLE_EXPORTS)
00088 #define ABI_PLUGIN_EXPORT
00089 #define ABI_EXPORT __attribute__ ((visibility ("hidden")))
00090 #else
00091 #define ABI_PLUGIN_EXPORT
00092 #define ABI_EXPORT
00093 #endif
00094
00095
00096 #define ABI_FAR_CALL extern "C" ABI_PLUGIN_EXPORT
00097
00098 #define _abi_callonce
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 typedef UT_sint32 UT_Error;
00112 #define UT_OK ((UT_Error) 0)
00113 #define UT_ERROR ((UT_Error) -1)
00114 #define UT_OUTOFMEM ((UT_Error) -100)
00115 #define UT_SAVE_WRITEERROR ((UT_Error) -201)
00116 #define UT_SAVE_NAMEERROR ((UT_Error) -202)
00117 #define UT_SAVE_EXPORTERROR ((UT_Error) -203)
00118 #define UT_EXTENSIONERROR ((UT_Error) -204)
00119 #define UT_SAVE_CANCELLED ((UT_Error) -205)
00120 #define UT_SAVE_OTHERERROR ((UT_Error) -200)
00121 #define UT_IE_FILENOTFOUND ((UT_Error) -301)
00122 #define UT_IE_NOMEMORY ((UT_Error) -302)
00123 #define UT_IE_UNKNOWNTYPE ((UT_Error) -303)
00124 #define UT_IE_BOGUSDOCUMENT ((UT_Error) -304)
00125 #define UT_IE_COULDNOTOPEN ((UT_Error) -305)
00126 #define UT_IE_COULDNOTWRITE ((UT_Error) -306)
00127 #define UT_IE_FAKETYPE ((UT_Error) -307)
00128 #define UT_INVALIDFILENAME ((UT_Error) -308)
00129 #define UT_NOPIECETABLE ((UT_Error) -309)
00130 #define UT_IE_ADDLISTENERERROR ((UT_Error) -310)
00131 #define UT_IE_UNSUPTYPE ((UT_Error) -311)
00132 #define UT_IE_PROTECTED ((UT_Error) -312) // (pass) protected doc
00133 #define UT_IE_SKIPINVALID ((UT_Error) -313) // (pass) protected doc
00134 #define UT_IE_IMPORTERROR ((UT_Error) -300)
00135 #define UT_IE_IMPSTYLEUNSUPPORTED ((UT_Error) -314)
00136 #define UT_IE_XMLNOANGLEBRACKET ((UT_Error) -360)
00137
00138 ABI_EXPORT UT_Error UT_errnoToUTError (void);
00139
00140
00141 ABI_EXPORT void * UT_calloc ( UT_uint32 nmemb, UT_uint32 size );
00142
00143
00144
00145
00146
00147 #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
00148 #include <crtdbg.h>
00149 #define UT_DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
00150 #define new UT_DEBUG_NEW
00151 #endif
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 #define UCS_ABI_OBJECT ((UT_UCSChar)0x0007)
00163
00164 #define UCS_TAB ((UT_UCSChar)0x0009)
00165 #define UCS_LF ((UT_UCSChar)0x000a)
00166 #define UCS_VTAB ((UT_UCSChar)0x000b)
00167 #define UCS_FF ((UT_UCSChar)0x000c)
00168 #define UCS_CR ((UT_UCSChar)0x000d)
00169 #define UCS_SPACE ((UT_UCSChar)0x0020)
00170 #define UCS_NBSP ((UT_UCSChar)0x00a0)
00171 #define UCS_PILCROW ((UT_UCSChar)0x00b6)
00172 #define UCS_LINESEP ((UT_UCSChar)0x2028)
00173 #define UCS_PARASEP ((UT_UCSChar)0x2029)
00174 #define UCS_BOM ((UT_UCSChar)0xFEFF)
00175 #define UCS_REPLACECHAR ((UT_UCSChar)0xFFFD)
00176 #define UCS_HYPHEN ((UT_UCSChar)0x2010)
00177 #define UCS_MINUS ((UT_UCSChar)0x2d)
00178
00179
00180
00181
00182
00183
00184
00185
00186 #define UCS_ABICONTROL_START (UCS_FIELDSTART)
00187 #define UCS_FIELDSTART ((UT_UCSChar)0xF850)
00188 #define UCS_FIELDEND ((UT_UCSChar)0xF851)
00189 #define UCS_BOOKMARKSTART ((UT_UCSChar)0xF852)
00190 #define UCS_BOOKMARKEND ((UT_UCSChar)0xF853)
00191 #define UCS_LIGATURE_PLACEHOLDER ((UT_UCS4Char)0xF854)
00192 #define UCS_ABICONTROL_END (UCS_LIGATURE_PLACEHOLDER)
00193
00194
00195 #if 1
00196 #define UCS_EN_SPACE ((UT_UCSChar)0x2002)
00197 #define UCS_EM_SPACE ((UT_UCSChar)0x2003)
00198 #define UCS_EN_DASH ((UT_UCSChar)0x2013)
00199 #define UCS_EM_DASH ((UT_UCSChar)0x2014)
00200 #define UCS_BULLET ((UT_UCSChar)0x2022)
00201
00202 #define UCS_LQUOTE ((UT_UCSChar)0x2018)
00203 #define UCS_RQUOTE ((UT_UCSChar)0x2019)
00204 #define UCS_LDBLQUOTE ((UT_UCSChar)0x201c)
00205 #define UCS_RDBLQUOTE ((UT_UCSChar)0x201d)
00206
00207
00208 #define UCS_UNKPUNK ((UT_UCSChar)0xFFFF)
00209
00210 #else
00211
00212 #define UCS_EN_SPACE ((UT_UCSChar)0x0020)
00213 #define UCS_EM_SPACE ((UT_UCSChar)0x0020)
00214 #define UCS_EN_DASH ((UT_UCSChar)0x002d)
00215 #define UCS_EM_DASH ((UT_UCSChar)0x002d)
00216 #define UCS_BULLET ((UT_UCSChar)0x0095)
00217 #define UCS_LQUOTE ((UT_UCSChar)0x0027)
00218 #define UCS_RQUOTE ((UT_UCSChar)0x0027)
00219 #define UCS_LDBLQUOTE ((UT_UCSChar)0x0022)
00220 #define UCS_RDBLQUOTE ((UT_UCSChar)0x0022)
00221 #define UCS_UNKPUNK ((UT_UCSChar)0x00FF)
00222
00223 #endif
00224
00225
00226 #define UCS_LRM 0x200E
00227 #define UCS_RLM 0x200F
00228 #define UCS_LRE 0x202a
00229 #define UCS_RLE 0x202b
00230 #define UCS_PDF 0x202c
00231 #define UCS_LRO 0x202d
00232 #define UCS_RLO 0x202e
00233
00234
00235
00236
00237
00238 #define FREEP(p) do { if (p) { g_free((void *)p); (p)=NULL; } } while (0)
00239 #define DELETEP(p) do { if (p) { delete(p); (p)=NULL; } } while (0)
00240 #define DELETEPV(pa) do { if (pa) { delete [] (pa); (pa)=NULL; } } while (0)
00241 #define REPLACEP(p,q) do { if (p) delete p; p = q; } while (0)
00242 #define REFP(p) ((p)->ref(), (p))
00243 #define UNREFP(p) do { if (p) { (p)->unref(); (p)=NULL; } } while (0)
00244 #define CLONEP(p,q) do { FREEP(p); if (q && *q) p = g_strdup(q); } while (0)
00245
00246 #define E2B(err) ((err) == UT_OK)
00247
00248
00249 #define FRIBIDI_TYPE_UNSET -1
00250 #define FRIBIDI_TYPE_IGNORE -2
00251
00252
00253
00254
00255 #define PD_MAX_REVISION 0x0fffffff
00256
00257
00258
00259 typedef const void * PL_ObjectHandle;
00260
00261 #endif