LibreOffice Module hwpfilter (master) 1
drawing.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_HWPFILTER_SOURCE_DRAWING_H
21#define INCLUDED_HWPFILTER_SOURCE_DRAWING_H
22
23#include "precompile.h"
24
25#include <math.h>
26
27#include <osl/diagnose.h>
28
30
31#include "hwplib.h"
32#include "hwpfile.h"
33#include "hiodev.h"
34#include "hbox.h"
35#include "drawdef.h"
36
37enum
38{
43};
44
45enum
46{
49};
50
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)
55
56typedef int (*HWPDOFuncType) (int, HWPDrawingObject *, int, void *, int);
57
58#define HWPDOFunc(hdo, cmd, argp, argv) \
59 (HWPDOFuncTbl[(hdo)->type]((hdo)->type, (hdo), (cmd), (argp), (argv)))
60
61static int HWPDOLineFunc(int, HWPDrawingObject *, int, void *, int);
62static int HWPDORectFunc(int, HWPDrawingObject *, int, void *, int);
63static int HWPDOEllipseFunc(int, HWPDrawingObject *, int, void *, int);
64static int HWPDOArcFunc(int, HWPDrawingObject *, int, void *, int);
65static int HWPDOFreeFormFunc(int, HWPDrawingObject *, int, void *, int);
66static int HWPDOTextBoxFunc(int, HWPDrawingObject *, int, void *, int);
67static int HWPDOEllipse2Func(int, HWPDrawingObject *, int, void *, int);
68static int HWPDOArc2Func(int, HWPDrawingObject *, int, void *, int);
69static int HWPDOContainerFunc(int, HWPDrawingObject *, int, void *, int);
70static HWPPara *LoadParaList();
71
73{
85};
86
87static HIODev *hmem = nullptr;
88
89static int count = 0;
90
91static void SetHdoParallRgn(HWPDrawingObject * hdo, int width, int height)
92{
93 hdo->property.parall.pt[0].x = 0;
94 hdo->property.parall.pt[0].y = 0;
95 hdo->property.parall.pt[1].x = width;
96 hdo->property.parall.pt[1].y = 0;
97 hdo->property.parall.pt[2].x = width;
98 hdo->property.parall.pt[2].y = height;
99}
100
101static bool SkipPrivateBlock(int type)
102{
103 int n;
104
106 {
107 if (!hmem->read4b(n))
108 return false;
109 if (hmem->state() || hmem->skipBlock(n) != static_cast<size_t>(n))
110 return false;
111 }
112 if (!hmem->read4b(n))
113 return false;
114 if (hmem->state())
115 return false;
116 return hmem->skipBlock(n) == static_cast<size_t>(n);
117}
118
119static int SizeExpected;
120static int SizeRead;
121
122static int ReadSizeField(int size)
123{
125 if (!hmem->read4b(SizeRead))
126 return -1;
127 if (hmem->state())
128 return -1;
129 return SizeRead;
130}
131
132static bool SkipUnusedField(void)
133{
134 return (SizeExpected >= SizeRead) &&
136}
137
138
139#define HDOFILE_HEADER_SIZE (2*4+16) // 16=sizeof(ZZRect)
140#define HDOFILE_COMMON_SIZE (7*4+16+44)
141
142#define HDOFILE_HAS_NEXT 0x01
143#define HDOFILE_HAS_CHILD 0x02
144
145static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
146{
147 uint size, common_size;
148
149 if (!hmem)
150 return false;
151 if (!hmem->read4b(size))
152 return false;
153 if (hmem->state())
154 return false;
156 return false;
157
158 common_size = HDOFILE_COMMON_SIZE;
159 unsigned short tmp16;
160 if (!hmem->read2b(tmp16))
161 return false;
162 hdo->type = tmp16;
163 if (!hmem->read2b(tmp16))
164 return false;
165 *link_info = tmp16;
166 if (!hmem->read4b(hdo->offset.x))
167 return false;
168 if (!hmem->read4b(hdo->offset.y))
169 return false;
170 if (!hmem->read4b(hdo->extent.w))
171 return false;
172 if (!hmem->read4b(hdo->extent.h))
173 return false;
174 if (!hmem->read4b(hdo->offset2.x))
175 return false;
176 if (!hmem->read4b(hdo->offset2.y))
177 return false;
178
179 if (hmem->state())
180 return false;
181
182 if (!hmem->read4b(hdo->vrect.x))
183 return false;
184 if (!hmem->read4b(hdo->vrect.y))
185 return false;
186 if (!hmem->read4b(hdo->vrect.w))
187 return false;
188 if (!hmem->read4b(hdo->vrect.h))
189 return false;
190
191// read bare property 44 bytes
192 if (!hmem->read4b(hdo->property.line_pstyle))
193 return false;
194 if (!hmem->read4b(hdo->property.line_hstyle))
195 return false;
196 if (!hmem->read4b(hdo->property.line_tstyle))
197 return false;
198 if (!hmem->read4b(hdo->property.line_color))
199 return false;
200 unsigned int tmp32;
201 if (!hmem->read4b(tmp32))
202 return false;
203 hdo->property.line_width = static_cast<hunit>(tmp32);
204 if (!hmem->read4b(hdo->property.fill_color))
205 return false;
206 if (!hmem->read4b(hdo->property.pattern_type))
207 return false;
208 if (!hmem->read4b(hdo->property.pattern_color))
209 return false;
210 if (!hmem->read4b(tmp32))
211 return false;
212 hdo->property.hmargin = static_cast<hunit>(tmp32);
213 if (!hmem->read4b(tmp32))
214 return false;
215 hdo->property.vmargin = static_cast<hunit>(tmp32);
216 if (!hmem->read4b(hdo->property.flag))
217 return false;
218// read rotation property 32 bytes
219 if ((size >= common_size + 32)
221 {
222 if (!hmem->read4b(hdo->property.rot_originx))
223 return false;
224 if (!hmem->read4b(hdo->property.rot_originy))
225 return false;
226 for (int ii = 0; ii < 3; ++ii)
227 {
228 if (!hmem->read4b(hdo->property.parall.pt[ii].x))
229 return false;
230 if (!hmem->read4b(hdo->property.parall.pt[ii].y))
231 return false;
232 }
233 common_size += 32;
234 }
235 else
236 SetHdoParallRgn(hdo, hdo->extent.w, hdo->extent.h);
237
238// read gradient property 28 bytes
239 if ((size >= common_size + 28) &&
241 {
242 if (!hmem->read4b(hdo->property.fromcolor))
243 return false;
244 if (!hmem->read4b(hdo->property.tocolor))
245 return false;
246 if (!hmem->read4b(hdo->property.gstyle))
247 return false;
248 if (!hmem->read4b(hdo->property.angle))
249 return false;
250 if (!hmem->read4b(hdo->property.center_x))
251 return false;
252 if (!hmem->read4b(hdo->property.center_y))
253 return false;
254 if (!hmem->read4b(hdo->property.nstep))
255 return false;
256 common_size += 28;
257 }
258
259// read bitmap property 278 bytes
260 if ((size >= common_size + 278) && \
262 {
263 if (!hmem->read4b(hdo->property.offset1.x))
264 return false;
265 if (!hmem->read4b(hdo->property.offset1.y))
266 return false;
267 if (!hmem->read4b(hdo->property.offset2.x))
268 return false;
269 if (!hmem->read4b(hdo->property.offset2.y))
270 return false;
271 if (!hmem->readBlock(hdo->property.szPatternFile, 261))
272 return false;
273 if (!hmem->read1b(hdo->property.pictype))
274 return false;
275 common_size += 278;
276 }
277 if( ( size >= common_size + 3 ) && ( hdo->property.flag & HWPDO_FLAG_WATERMARK ) )
278 //if( ( size >= common_size ) && ( hdo->property.flag >> 20 & 0x01 ) )
279 {
280 if (size - common_size >= 5)
281 hmem->skipBlock(2);
282 unsigned char tmp8;
283 if (!hmem->read1b(tmp8))
284 return false;
285 hdo->property.luminance = tmp8;
286 if (!hmem->read1b(tmp8))
287 return false;
288 hdo->property.contrast = tmp8;
289 if (!hmem->read1b(tmp8))
290 return false;
291 hdo->property.greyscale = tmp8;
292
293 common_size += 5;
294 }
295 else
296 {
297 hdo->property.luminance = 0;
298 hdo->property.contrast = 0;
299 hdo->property.greyscale = 0;
300 }
301 hdo->property.pPara = nullptr;
302
303 if( ( size > common_size ) && (hdo->property.flag & HWPDO_FLAG_AS_TEXTBOX) )
304 {
305 hmem->skipBlock(8);
306 hdo->property.pPara = LoadParaList();
307 if( hdo->property.pPara )
308 return true;
309 else
310 return false;
311 }
312
313 if (size <= common_size)
314 return true;
315 return hmem->skipBlock(size - common_size ) != 0;
316}
317
318static std::unique_ptr<HWPDrawingObject> LoadDrawingObject(HWPFile& hwpf)
319{
320 HWPDrawingObject *prev = nullptr;
321 std::unique_ptr<HWPDrawingObject> hdo, head;
322
323 unsigned short link_info;
324
325 do
326 {
327 hdo.reset(new HWPDrawingObject);
328 if (!LoadCommonHeader(hdo.get(), &link_info))
329 {
330 goto error;
331 }
332 if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
333 {
334 hdo->type = HWPDO_RECT;
336 {
337 goto error;
338 }
339 }
340 else
341 {
342 switch (int res = HWPDOFunc(hdo.get(), OBJFUNC_LOAD, nullptr, 0))
343 {
345 goto error;
346 case OBJRET_FILE_OK:
347 break;
350 if (!SkipPrivateBlock(res))
351 goto error;
352 break;
353 }
354 }
355 if (link_info & HDOFILE_HAS_CHILD)
356 {
357 hdo->child = LoadDrawingObject(hwpf);
358 if (hdo->child == nullptr)
359 {
360 goto error;
361 }
362 }
363 if (prev == nullptr)
364 {
365 head = std::move(hdo);
366 prev = head.get();
367 }
368 else
369 {
370 prev->next = std::move(hdo);
371 prev = prev->next.get();
372 }
373 }
374 while (link_info & HDOFILE_HAS_NEXT);
375
376 return head;
377
378error:
379// drawing object can be list.
380// hdo = current item, head = list;
381
382 if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
383 {
384 hdo->type = HWPDO_RECT;
385 }
386 if (hdo->property.pPara)
387 {
388 HWPPara* pPara = hdo->property.pPara;
389 while (pPara)
390 {
391 HWPPara* pNextPara = pPara->Next();
392 hwpf.move_to_failed(std::unique_ptr<HWPPara>(pPara));
393 pPara = pNextPara;
394 }
395 hdo->property.pPara = nullptr;
396 }
397 HWPDOFunc(hdo.get(), OBJFUNC_FREE, nullptr, 0);
398 hdo.reset();
399
400 if( prev )
401 {
402 prev->next = nullptr;
403 return head;
404 }
405 else
406 return nullptr;
407}
408
409
410static bool LoadDrawingObjectBlock(Picture * pic, HWPFile& hwpf)
411{
412 int size;
413 if (!hmem->read4b(size))
414 return false;
415
417 return false;
418
419 if (!hmem->read4b(pic->picinfo.picdraw.zorder))
420 return false;
421 if (!hmem->read4b(pic->picinfo.picdraw.mbrcnt))
422 return false;
423 if (!hmem->read4b(pic->picinfo.picdraw.vrect.x))
424 return false;
425 if (!hmem->read4b(pic->picinfo.picdraw.vrect.y))
426 return false;
427 if (!hmem->read4b(pic->picinfo.picdraw.vrect.w))
428 return false;
429 if (!hmem->read4b(pic->picinfo.picdraw.vrect.h))
430 return false;
431
434 return false;
435
436 pic->picinfo.picdraw.hdo = LoadDrawingObject(hwpf).release();
437 if (pic->picinfo.picdraw.hdo == nullptr)
438 return false;
439 return true;
440}
441
442// object manipulation function
443static int
445{
446 if (cmd == OBJFUNC_LOAD)
448 return OBJRET_FILE_OK;
449}
450
451static int
452HWPDOLineFunc(int /*type*/, HWPDrawingObject * hdo, int cmd, void * /*argp*/, int /*argv*/)
453{
454 int ret = OBJRET_FILE_OK;
455 switch (cmd)
456 {
457 case OBJFUNC_LOAD:
458 if (ReadSizeField(4) < 4)
459 return OBJRET_FILE_ERROR;
460 if (!hmem->read4b(hdo->u.line_arc.flip))
461 return OBJRET_FILE_ERROR;
462 if (hmem->state())
463 return OBJRET_FILE_ERROR;
464 if (!SkipUnusedField())
465 return OBJRET_FILE_ERROR;
467 break;
468 default:
469 ret = HWPDODefaultFunc(cmd);
470 break;
471 }
472 return ret;
473}
474
475
476// rectangle
477
478static int
479HWPDORectFunc(int /*type*/, HWPDrawingObject * /*hdo*/, int cmd, void * /*argp*/, int /*argv*/)
480{
481 return HWPDODefaultFunc(cmd);
482}
483
484
485// ellipse
486
487static int
488HWPDOEllipseFunc(int /*type*/, HWPDrawingObject * /*hdo*/,
489int cmd, void * /*argp*/, int /*argv*/)
490{
491 return HWPDODefaultFunc(cmd);
492}
493
494#define WTMM(x) ((double)(x) / 1800. * 25.4)
495static int
497int cmd, void * /*argp*/, int /*argv*/)
498{
499 switch (cmd)
500 {
501 case OBJFUNC_LOAD:
502 if (ReadSizeField(16) < 16)
503 return OBJRET_FILE_ERROR;
504 if (!hmem->read4b(hdo->u.arc.radial[0].x))
505 return OBJRET_FILE_ERROR;
506 if (!hmem->read4b(hdo->u.arc.radial[0].y))
507 return OBJRET_FILE_ERROR;
508 if (!hmem->read4b(hdo->u.arc.radial[1].x))
509 return OBJRET_FILE_ERROR;
510 if (!hmem->read4b(hdo->u.arc.radial[1].y))
511 return OBJRET_FILE_ERROR;
512 if (ReadSizeField(0) < 0)
513 return OBJRET_FILE_ERROR;
514 break;
515 default:
516 return HWPDODefaultFunc(cmd);
517 }
518 return OBJRET_FILE_OK;
519}
520
521
522// arc
523
524static int
525HWPDOArcFunc(int /*type*/, HWPDrawingObject * hdo, int cmd, void * /*argp*/, int /*argv*/)
526{
527 switch (cmd)
528 {
529 case OBJFUNC_LOAD:
530 if (ReadSizeField(4) < 4)
531 return OBJRET_FILE_ERROR;
532 if (!hmem->read4b(hdo->u.line_arc.flip))
533 return OBJRET_FILE_ERROR;
534 if (hmem->state())
535 return OBJRET_FILE_ERROR;
536 if (!SkipUnusedField())
537 return OBJRET_FILE_ERROR;
538 break;
539 default:
540 return HWPDODefaultFunc(cmd);
541 }
542 return OBJRET_FILE_OK;
543}
544
545
546static int
547HWPDOArc2Func(int /*type*/, HWPDrawingObject * /*hdo*/, int cmd, void * /*argp*/, int /*argv*/)
548{
549 int ret = OBJRET_FILE_OK;
550 switch (cmd)
551 {
552 case OBJFUNC_LOAD:
554 break;
555 default:
556 ret = HWPDODefaultFunc(cmd);
557 break;
558 }
559 return ret;
560}
561
562
563static int
565int cmd, void * /*argp*/, int /*argv*/)
566{
567 switch (cmd)
568 {
569 case OBJFUNC_LOAD:
570 {
571 hdo->u.freeform.pt = nullptr;
572 if (ReadSizeField(4) < 4)
573 return OBJRET_FILE_ERROR;
574 if (!hmem->read4b(hdo->u.freeform.npt))
575 return OBJRET_FILE_ERROR;
576 if (hmem->state())
577 return OBJRET_FILE_ERROR;
578 if (!SkipUnusedField())
579 return OBJRET_FILE_ERROR;
580
581 int size = hdo->u.freeform.npt * sizeof(ZZPoint);
582
583 if (ReadSizeField(size) < size)
584 return OBJRET_FILE_ERROR;
585 if (hdo->u.freeform.npt)
586 {
587 hdo->u.freeform.pt =
588 ::comphelper::newArray_null<ZZPoint>(hdo->u.freeform.npt);
589 if (hdo->u.freeform.pt == nullptr)
590 {
591 hdo->u.freeform.npt = 0;
592 return OBJRET_FILE_ERROR;
593 }
594 for (int ii = 0; ii < hdo->u.freeform.npt; ++ii)
595 {
596 bool bFailure = false;
597 if (!hmem->read4b(hdo->u.freeform.pt[ii].x))
598 bFailure = true;
599 if (!hmem->read4b(hdo->u.freeform.pt[ii].y))
600 bFailure = true;
601 if (hmem->state())
602 bFailure = true;
603 if (bFailure)
604 {
605 delete[]hdo->u.freeform.pt;
606 hdo->u.freeform.npt = 0;
607 return OBJRET_FILE_ERROR;
608 }
609 }
610 }
611 if (!SkipUnusedField())
612 return OBJRET_FILE_ERROR;
613 return OBJRET_FILE_OK;
614 }
615 case OBJFUNC_FREE:
616 if (hdo->u.freeform.pt)
617 delete[]hdo->u.freeform.pt;
618 break;
619 default:
620 return HWPDODefaultFunc(cmd);
621 }
622 return OBJRET_FILE_OK;
623}
624
625
626// text box
627
628static void FreeParaList(HWPPara * para)
629{
630 if (para->Next())
631 FreeParaList(para->Next());
632 delete para;
633}
634
635
637{
638 if (!hmem)
639 return nullptr;
640
641 HWPFile *hwpf = GetCurrentDoc();
642 std::unique_ptr<HIODev> hio = hwpf->SetIODevice(std::unique_ptr<HIODev>(hmem));
643
644 std::vector< HWPPara* > plist;
645
646 hwpf->ReadParaList(plist);
647 std::unique_ptr<HIODev> orighmem = hwpf->SetIODevice(std::move(hio));
648 hmem = orighmem.release();
649
650 return plist.size()? plist.front() : nullptr;
651}
652
653
654static int
656int cmd, void * /*argp*/, int /*argv*/)
657{
658 switch (cmd)
659 {
660 case OBJFUNC_LOAD:
661 if (ReadSizeField(0) < 0 || !SkipUnusedField())
662 return OBJRET_FILE_ERROR;
663 if (ReadSizeField(0) < 0)
664 return OBJRET_FILE_ERROR;
665 hdo->u.textbox.h = LoadParaList();
667 case OBJFUNC_FREE:
668 if (hdo->u.textbox.h)
669 {
670 FreeParaList(hdo->u.textbox.h);
671 hdo->u.textbox.h = nullptr;
672 }
673 break;
674 default:
675 return HWPDODefaultFunc(cmd);
676 }
677 return OBJRET_FILE_OK;
678}
679
680
681
682static int
683HWPDOContainerFunc(int /*type*/, HWPDrawingObject * /*hdo*/,
684int cmd, void * /*argp*/, int /*argv*/)
685{
686 return HWPDODefaultFunc(cmd);
687}
688
689
691 type(0), offset{0, 0}, offset2{0, 0}, extent{0, 0}, vrect{0, 0, 0, 0}
692{
693 memset(&property, 0, sizeof property);
694 memset(&u, 0, sizeof u);
695 index = ++count;
696}
697
698
700{
701 if (property.pPara)
702 FreeParaList(property.pPara);
703
704 HWPDOFunc(this, OBJFUNC_FREE, nullptr, 0);
705}
706#endif
707
708/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unsigned int uint
hwpio.h (C) 1999 Mizi Research, All rights are reserved
Definition: hiodev.h:40
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.
Definition: hwpfile.h:98
std::unique_ptr< HIODev > SetIODevice(std::unique_ptr< HIODev > hiodev)
Sets current HIODev.
Definition: hwpfile.cxx:188
void move_to_failed(std::unique_ptr< HWPPara > rPara)
Definition: hwpfile.cxx:288
void ReadParaList(std::vector< std::unique_ptr< HWPPara > > &aplist, unsigned char flag=0)
Reads main paragraph list.
Definition: hwpfile.cxx:254
It represents the paragraph.
Definition: hpara.h:69
HWPPara * Next(void)
Returns next paragraph.
Definition: hpara.h:126
#define HWPDO_FLAG_BITMAP
Definition: drawdef.h:58
#define HWPDO_FLAG_WATERMARK
Definition: drawdef.h:60
#define HWPDO_FLAG_GRADATION
Definition: drawdef.h:56
#define HWPDO_FLAG_ROTATION
Definition: drawdef.h:57
@ HWPDO_RECT
Definition: drawdef.h:35
@ HWPDO_NITEMS
Definition: drawdef.h:44
#define HWPDO_FLAG_AS_TEXTBOX
Definition: drawdef.h:59
static int SizeExpected
Definition: drawing.h:119
#define HWPDOFunc(hdo, cmd, argp, argv)
Definition: drawing.h:58
#define HDOFILE_HAS_NEXT
Definition: drawing.h:142
int(* HWPDOFuncType)(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:56
static int HWPDOArcFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:525
#define HDOFILE_COMMON_SIZE
Definition: drawing.h:140
static void SetHdoParallRgn(HWPDrawingObject *hdo, int width, int height)
Definition: drawing.h:91
static HIODev * hmem
Definition: drawing.h:87
static HWPPara * LoadParaList()
Definition: drawing.h:636
static std::unique_ptr< HWPDrawingObject > LoadDrawingObject(HWPFile &hwpf)
Definition: drawing.h:318
static int HWPDORectFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:479
static int HWPDOLineFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:452
#define OBJRET_FILE_NO_PRIVATE_BLOCK
Definition: drawing.h:53
static bool SkipPrivateBlock(int type)
Definition: drawing.h:101
#define HDOFILE_HEADER_SIZE
Definition: drawing.h:139
static void FreeParaList(HWPPara *para)
Definition: drawing.h:628
static int HWPDODefaultFunc(int cmd)
Definition: drawing.h:444
#define OBJRET_FILE_ERROR
Definition: drawing.h:52
#define OBJRET_FILE_NO_PRIVATE_BLOCK_2
Definition: drawing.h:54
static int SizeRead
Definition: drawing.h:120
static int HWPDOEllipse2Func(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:496
static int HWPDOEllipseFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:488
#define HDOFILE_HAS_CHILD
Definition: drawing.h:143
@ SQUARE
Definition: drawing.h:47
@ RADIAL
Definition: drawing.h:47
@ CONICAL
Definition: drawing.h:47
@ BEGIN_GRADATION
Definition: drawing.h:47
@ END_GRADATION
Definition: drawing.h:48
@ BITMAP_PATTERN
Definition: drawing.h:48
@ LINEAR
Definition: drawing.h:47
static bool SkipUnusedField(void)
Definition: drawing.h:132
#define OBJRET_FILE_OK
Definition: drawing.h:51
HWPDOFuncType HWPDOFuncTbl[]
Definition: drawing.h:72
static int HWPDOFreeFormFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:564
static int HWPDOContainerFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:683
static int count
Definition: drawing.h:89
@ OBJFUNC_DISPLAY
Definition: drawing.h:41
@ OBJFUNC_LOAD
Definition: drawing.h:39
@ OBJFUNC_FREE
Definition: drawing.h:40
@ OBJFUNC_NITEM
Definition: drawing.h:42
static int HWPDOTextBoxFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:655
static bool LoadDrawingObjectBlock(Picture *pic, HWPFile &hwpf)
Definition: drawing.h:410
static int HWPDOArc2Func(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:547
static bool LoadCommonHeader(HWPDrawingObject *hdo, unsigned short *link_info)
Definition: drawing.h:145
static int ReadSizeField(int size)
Definition: drawing.h:122
HWPFile * GetCurrentDoc()
Definition: hwpfile.cxx:667
int hunit
Definition: hwplib.h:37
sal_Int64 n
size
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
ZZPoint radial[2]
Definition: drawdef.h:195
ZZPoint * pt
Definition: drawdef.h:179
uint flip
Definition: drawdef.h:170
int center_y
Definition: drawdef.h:147
unsigned int fill_color
Definition: drawdef.h:128
int fromcolor
Definition: drawdef.h:142
uint pattern_type
Definition: drawdef.h:129
hunit line_width
Definition: drawdef.h:127
int line_pstyle
Definition: drawdef.h:123
unsigned int pattern_color
Definition: drawdef.h:130
int contrast
Definition: drawdef.h:152
int luminance
Definition: drawdef.h:151
HWPPara * pPara
Definition: drawdef.h:156
int greyscale
Definition: drawdef.h:153
ZZPoint offset1
Definition: drawdef.h:159
char pictype
Definition: drawdef.h:162
unsigned int line_color
Definition: drawdef.h:126
ZZPoint offset2
Definition: drawdef.h:160
hunit hmargin
Definition: drawdef.h:131
int rot_originy
Definition: drawdef.h:137
int center_x
Definition: drawdef.h:146
int line_tstyle
Definition: drawdef.h:125
int rot_originx
Definition: drawdef.h:136
hunit vmargin
Definition: drawdef.h:132
char szPatternFile[260+1]
Definition: drawdef.h:161
int line_hstyle
Definition: drawdef.h:124
ZZParall parall
Definition: drawdef.h:138
HWPPara * h
Definition: drawdef.h:187
Common header for drawing object.
Definition: drawdef.h:202
ZZPoint offset2
offset from origin of drawing object
Definition: drawdef.h:214
std::unique_ptr< struct HWPDrawingObject > next
Definition: drawdef.h:232
HWPDOProperty property
Definition: drawdef.h:220
HWPDOFreeForm freeform
Definition: drawdef.h:224
int type
type of drawing object
Definition: drawdef.h:206
HWPDOLine line_arc
Definition: drawdef.h:223
HWPDOArc arc
extended from hwpw96
Definition: drawdef.h:229
ZZRect vrect
rectangle with consideration of line width
Definition: drawdef.h:219
ZZSize extent
Definition: drawdef.h:215
union HWPDrawingObject::@0 u
ZZPoint offset
offset from origin of current group
Definition: drawdef.h:210
HWPDOTextBox textbox
Definition: drawdef.h:225
HWPDrawingObject * hdo
Definition: hbox.h:560
ZZRect vrect
Definition: hbox.h:562
uint zorder
Definition: hbox.h:561
int mbrcnt
Definition: hbox.h:563
There are four kinds of image.
Definition: hbox.h:593
PicDef picinfo
Definition: hbox.h:623
ZZPoint pt[3]
Definition: hwplib.h:83
Point.
Definition: hwplib.h:57
int y
Definition: hwplib.h:58
int x
Definition: hwplib.h:58
int h
Definition: hwplib.h:75
int x
Definition: hwplib.h:74
int w
Definition: hwplib.h:75
int y
Definition: hwplib.h:74
int h
Definition: hwplib.h:66
int w
Definition: hwplib.h:66
ResultType type
PicDefDraw picdraw
Definition: hbox.h:579