1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
|
/************************************************************************/
/* */
/* Text Buffer: Obects inserted in the text. */
/* Objects are independent entities that are embedded in the text. */
/* */
/************************************************************************/
# ifndef DOC_OBJECT_H
# define DOC_OBJECT_H
# include <utilMemoryBuffer.h>
# include "docDrawingObject.h"
struct BufferDocument;
struct BufferItem;
struct TextParticule;
/************************************************************************/
/* */
/* Kinds of object. */
/* */
/************************************************************************/
typedef enum ObjectKind
{
DOCokUNKNOWN= 0,
DOCokPICTWMETAFILE,
DOCokPICTPNGBLIP,
DOCokPICTJPEGBLIP,
DOCokPICTEMFBLIP,
DOCokMACPICT,
DOCokPMMETAFILE,
DOCokDIBITMAP,
DOCokWBITMAP,
DOCokOLEOBJECT,
DOCokINCLUDEPICTURE,
DOCokEPS_FILE,
DOCokBITMAP_FILE,
DOCokDRAWING_OBJECT,
/************************************************************/
/* To include pictures. In Particular EPS pictures. As */
/* this is different from what 'Word' does when you */
/* include a picture: they are not saved in the RTF file. */
/************************************************************/
DOCok__COUNT
} ObjectKind;
typedef enum ResultKind
{
RESULTkindUNKNOWN= 0,
RESULTkindRTF,
RESULTkindTXT,
RESULTkindPICT,
RESULTkindBMP,
RESULTkindHTML,
RESULTkind_COUNT
} ResultKind;
typedef enum EmbeddedKind
{
EMBEDkindOBJEMB= 0,
EMBEDkindOBJLINK,
EMBEDkindOBJAUTLINK,
EMBEDkindOBJSUB,
EMBEDkindOBJPUB,
EMBEDkindOBJICEMB,
EMBEDkindOBJHTML,
EMBEDkindOBJOCX,
EMBEDkind_COUNT
} EmbeddedKind;
typedef struct InsertedObject
{
int ioKind; /* Kind of object. */
int ioResultKind; /* Kind of object. */
int ioTwipsWide; /* Width of object. */
int ioTwipsHigh; /* Height of object. */
int ioScaleX; /* In %. */
int ioScaleY; /* In %. */
int ioPixelsWide; /* Width of object on screen */
int ioPixelsHigh; /* Height of object on screen */
int io_xWinExt; /* Of metafile picture. */
int io_yWinExt; /* Of metafile picture. */
unsigned int ioRtfResultKind:4; /* From rslt* tags. */
unsigned int ioRtfEmbedKind:4; /* From objemb.. tags. */
int ioTopCropTwips;
int ioBottomCropTwips;
int ioLeftCropTwips;
int ioRightCropTwips;
int ioMetafileIsBitmap;
int ioMetafileBitmapBpp;
int ioBmBitsPerPixel;
int ioBmPlanes;
int ioBmBytessPerRow;
int ioDragWide; /* PixelsWide during resize. */
int ioDragHigh; /* PixelsHigh during resize. */
int ioMapMode;
int ioResultMapMode;
/* Used for metafile pictures */
/* or objects with a result */
/* that is a metafile picture. */
MemoryBuffer ioObjectData;
MemoryBuffer ioResultData;
unsigned char * ioObjectName;
unsigned char * ioObjectClass;
int ioBliptag;
DrawingObject ioDrawingObject;
# ifdef USE_MOTIF
unsigned long ioPixmap;
# endif
# ifdef USE_GTK
void * ioPixmap;
# endif
void * ioPrivate;
} InsertedObject;
typedef enum InsertedObjectProperty
{
IOpropKIND= 0,
IOpropRESULT_KIND,
IOpropEMBED_KIND,
IOpropPICT_RESULT_KIND,
IOpropOBJTWIPS_WIDE,
IOpropOBJTWIPS_HIGH,
IOpropPICTWIPS_WIDE,
IOpropPICTWIPS_HIGH,
IOpropOBJSCALE_X,
IOpropOBJSCALE_Y,
IOpropPICSCALE_X,
IOpropPICSCALE_Y,
IOpropPICX_WIN_EXT,
IOpropPICY_WIN_EXT,
IOpropOBJCROP_TOP,
IOpropOBJCROP_BOTTOM,
IOpropOBJCROP_LEFT,
IOpropOBJCROP_RIGHT,
IOpropPICCROP_TOP,
IOpropPICCROP_BOTTOM,
IOpropPICCROP_LEFT,
IOpropPICCROP_RIGHT,
IOpropWBMBITSPIXEL,
IOpropWBMPLANES,
IOpropWBMWIDTHBYTES,
IOpropBLIPTAG,
IOpropPICBMP,
IOpropPICBPP,
IOprop_UNSUPPORTED,
IOprop_COUNT
} InsertedObjectProperty;
typedef void (*DOC_CLOSE_OBJECT)( struct BufferDocument * bd,
struct BufferItem * bi,
struct TextParticule * tp,
void * voidadd );
/************************************************************************/
/* */
/* Routine declarations. */
/* */
/************************************************************************/
extern int docGetBitmapForObject( InsertedObject * io );
extern int docObjectSetData( InsertedObject * io,
const unsigned char * bytes,
int size );
extern int docSetResultData( InsertedObject * io,
const unsigned char * bytes,
int size );
extern int docSaveObjectTag( InsertedObject * io,
const char * tag,
int arg );
extern int docSaveResultTag( InsertedObject * io,
const char * tag,
int arg );
extern int docSetObjectName( InsertedObject * io,
const unsigned char * name,
int len );
extern int docSetObjectClass( InsertedObject * io,
const unsigned char * name,
int len );
extern void docCleanObject( InsertedObject * io );
# endif /* DOC_OBJECT_H */
|