20#ifndef INCLUDED_HWPFILTER_SOURCE_DRAWING_H
21#define INCLUDED_HWPFILTER_SOURCE_DRAWING_H
27#include <osl/diagnose.h>
51#define OBJRET_FILE_OK 0
52#define OBJRET_FILE_ERROR (-1)
53#define OBJRET_FILE_NO_PRIVATE_BLOCK (-2)
54#define OBJRET_FILE_NO_PRIVATE_BLOCK_2 (-3)
58#define HWPDOFunc(hdo, cmd, argp, argv) \
59 (HWPDOFuncTbl[(hdo)->type]((hdo)->type, (hdo), (cmd), (argp), (argv)))
139#define HDOFILE_HEADER_SIZE (2*4+16)
140#define HDOFILE_COMMON_SIZE (7*4+16+44)
142#define HDOFILE_HAS_NEXT 0x01
143#define HDOFILE_HAS_CHILD 0x02
159 unsigned short tmp16;
219 if ((
size >= common_size + 32)
226 for (
int ii = 0; ii < 3; ++ii)
239 if ((
size >= common_size + 28) &&
260 if ((
size >= common_size + 278) && \
280 if (
size - common_size >= 5)
313 if (
size <= common_size)
321 std::unique_ptr<HWPDrawingObject> hdo, head;
323 unsigned short link_info;
358 if (hdo->child ==
nullptr)
365 head = std::move(hdo);
370 prev->
next = std::move(hdo);
371 prev = prev->
next.get();
386 if (hdo->property.pPara)
388 HWPPara* pPara = hdo->property.pPara;
395 hdo->property.pPara =
nullptr;
402 prev->
next =
nullptr;
489int cmd,
void * ,
int )
494#define WTMM(x) ((double)(x) / 1800. * 25.4)
497int cmd,
void * ,
int )
565int cmd,
void * ,
int )
588 ::comphelper::newArray_null<ZZPoint>(hdo->
u.
freeform.
npt);
596 bool bFailure =
false;
642 std::unique_ptr<HIODev> hio = hwpf->
SetIODevice(std::unique_ptr<HIODev>(
hmem));
644 std::vector< HWPPara* > plist;
647 std::unique_ptr<HIODev> orighmem = hwpf->
SetIODevice(std::move(hio));
648 hmem = orighmem.release();
650 return plist.size()? plist.front() :
nullptr;
656int cmd,
void * ,
int )
684int cmd,
void * ,
int )
691 type(0), offset{0, 0}, offset2{0, 0}, extent{0, 0}, vrect{0, 0, 0, 0}
694 memset(&
u, 0,
sizeof u);
hwpio.h (C) 1999 Mizi Research, All rights are reserved
virtual bool read2b(unsigned short &out)=0
virtual bool state() const =0
virtual bool read1b(unsigned char &out)=0
virtual size_t skipBlock(size_t size)=0
virtual bool read4b(unsigned int &out)=0
virtual size_t readBlock(void *ptr, size_t size)=0
The HWPFile class is the main class of hwp for reading file information from stream.
std::unique_ptr< HIODev > SetIODevice(std::unique_ptr< HIODev > hiodev)
Sets current HIODev.
void move_to_failed(std::unique_ptr< HWPPara > rPara)
void ReadParaList(std::vector< std::unique_ptr< HWPPara > > &aplist, unsigned char flag=0)
Reads main paragraph list.
It represents the paragraph.
HWPPara * Next(void)
Returns next paragraph.
#define HWPDO_FLAG_BITMAP
#define HWPDO_FLAG_WATERMARK
#define HWPDO_FLAG_GRADATION
#define HWPDO_FLAG_ROTATION
#define HWPDO_FLAG_AS_TEXTBOX
#define HWPDOFunc(hdo, cmd, argp, argv)
int(* HWPDOFuncType)(int, HWPDrawingObject *, int, void *, int)
static int HWPDOArcFunc(int, HWPDrawingObject *, int, void *, int)
#define HDOFILE_COMMON_SIZE
static void SetHdoParallRgn(HWPDrawingObject *hdo, int width, int height)
static HWPPara * LoadParaList()
static std::unique_ptr< HWPDrawingObject > LoadDrawingObject(HWPFile &hwpf)
static int HWPDORectFunc(int, HWPDrawingObject *, int, void *, int)
static int HWPDOLineFunc(int, HWPDrawingObject *, int, void *, int)
#define OBJRET_FILE_NO_PRIVATE_BLOCK
static bool SkipPrivateBlock(int type)
#define HDOFILE_HEADER_SIZE
static void FreeParaList(HWPPara *para)
static int HWPDODefaultFunc(int cmd)
#define OBJRET_FILE_ERROR
#define OBJRET_FILE_NO_PRIVATE_BLOCK_2
static int HWPDOEllipse2Func(int, HWPDrawingObject *, int, void *, int)
static int HWPDOEllipseFunc(int, HWPDrawingObject *, int, void *, int)
#define HDOFILE_HAS_CHILD
static bool SkipUnusedField(void)
HWPDOFuncType HWPDOFuncTbl[]
static int HWPDOFreeFormFunc(int, HWPDrawingObject *, int, void *, int)
static int HWPDOContainerFunc(int, HWPDrawingObject *, int, void *, int)
static int HWPDOTextBoxFunc(int, HWPDrawingObject *, int, void *, int)
static bool LoadDrawingObjectBlock(Picture *pic, HWPFile &hwpf)
static int HWPDOArc2Func(int, HWPDrawingObject *, int, void *, int)
static bool LoadCommonHeader(HWPDrawingObject *hdo, unsigned short *link_info)
static int ReadSizeField(int size)
HWPFile * GetCurrentDoc()
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
unsigned int pattern_color
char szPatternFile[260+1]
Common header for drawing object.
ZZPoint offset2
offset from origin of drawing object
std::unique_ptr< struct HWPDrawingObject > next
int type
type of drawing object
HWPDOArc arc
extended from hwpw96
ZZRect vrect
rectangle with consideration of line width
union HWPDrawingObject::@0 u
ZZPoint offset
offset from origin of current group
There are four kinds of image.