LibreOffice Module hwpfilter (master) 1
Macros | Typedefs | Enumerations | Functions | Variables
drawing.h File Reference
#include "precompile.h"
#include <math.h>
#include <osl/diagnose.h>
#include <comphelper/newarray.hxx>
#include "hwplib.h"
#include "hwpfile.h"
#include "hiodev.h"
#include "hbox.h"
#include "drawdef.h"
Include dependency graph for drawing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OBJRET_FILE_OK   0
 
#define OBJRET_FILE_ERROR   (-1)
 
#define OBJRET_FILE_NO_PRIVATE_BLOCK   (-2)
 
#define OBJRET_FILE_NO_PRIVATE_BLOCK_2   (-3)
 
#define HWPDOFunc(hdo, cmd, argp, argv)    (HWPDOFuncTbl[(hdo)->type]((hdo)->type, (hdo), (cmd), (argp), (argv)))
 
#define HDOFILE_HEADER_SIZE   (2*4+16)
 
#define HDOFILE_COMMON_SIZE   (7*4+16+44)
 
#define HDOFILE_HAS_NEXT   0x01
 
#define HDOFILE_HAS_CHILD   0x02
 
#define WTMM(x)   ((double)(x) / 1800. * 25.4)
 

Typedefs

typedef int(* HWPDOFuncType) (int, HWPDrawingObject *, int, void *, int)
 

Enumerations

enum  {
  OBJFUNC_LOAD ,
  OBJFUNC_FREE ,
  OBJFUNC_DISPLAY ,
  OBJFUNC_NITEM
}
 
enum  {
  BEGIN_GRADATION = 0 ,
  LINEAR ,
  RADIAL ,
  CONICAL ,
  SQUARE ,
  END_GRADATION ,
  BITMAP_PATTERN
}
 

Functions

static int HWPDOLineFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDORectFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOEllipseFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOArcFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOFreeFormFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOTextBoxFunc (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOEllipse2Func (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOArc2Func (int, HWPDrawingObject *, int, void *, int)
 
static int HWPDOContainerFunc (int, HWPDrawingObject *, int, void *, int)
 
static HWPParaLoadParaList ()
 
static void SetHdoParallRgn (HWPDrawingObject *hdo, int width, int height)
 
static bool SkipPrivateBlock (int type)
 
static int ReadSizeField (int size)
 
static bool SkipUnusedField (void)
 
static bool LoadCommonHeader (HWPDrawingObject *hdo, unsigned short *link_info)
 
static std::unique_ptr< HWPDrawingObjectLoadDrawingObject (HWPFile &hwpf)
 
static bool LoadDrawingObjectBlock (Picture *pic, HWPFile &hwpf)
 
static int HWPDODefaultFunc (int cmd)
 
static void FreeParaList (HWPPara *para)
 

Variables

HWPDOFuncType HWPDOFuncTbl []
 
static HIODevhmem = nullptr
 
static int count = 0
 
static int SizeExpected
 
static int SizeRead
 

Macro Definition Documentation

◆ HDOFILE_COMMON_SIZE

#define HDOFILE_COMMON_SIZE   (7*4+16+44)

Definition at line 140 of file drawing.h.

◆ HDOFILE_HAS_CHILD

#define HDOFILE_HAS_CHILD   0x02

Definition at line 143 of file drawing.h.

◆ HDOFILE_HAS_NEXT

#define HDOFILE_HAS_NEXT   0x01

Definition at line 142 of file drawing.h.

◆ HDOFILE_HEADER_SIZE

#define HDOFILE_HEADER_SIZE   (2*4+16)

Definition at line 139 of file drawing.h.

◆ HWPDOFunc

#define HWPDOFunc (   hdo,
  cmd,
  argp,
  argv 
)     (HWPDOFuncTbl[(hdo)->type]((hdo)->type, (hdo), (cmd), (argp), (argv)))

Definition at line 58 of file drawing.h.

◆ OBJRET_FILE_ERROR

#define OBJRET_FILE_ERROR   (-1)

Definition at line 52 of file drawing.h.

◆ OBJRET_FILE_NO_PRIVATE_BLOCK

#define OBJRET_FILE_NO_PRIVATE_BLOCK   (-2)

Definition at line 53 of file drawing.h.

◆ OBJRET_FILE_NO_PRIVATE_BLOCK_2

#define OBJRET_FILE_NO_PRIVATE_BLOCK_2   (-3)

Definition at line 54 of file drawing.h.

◆ OBJRET_FILE_OK

#define OBJRET_FILE_OK   0

Definition at line 51 of file drawing.h.

◆ WTMM

#define WTMM (   x)    ((double)(x) / 1800. * 25.4)

Definition at line 494 of file drawing.h.

Typedef Documentation

◆ HWPDOFuncType

typedef int(* HWPDOFuncType) (int, HWPDrawingObject *, int, void *, int)

Definition at line 56 of file drawing.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OBJFUNC_LOAD 
OBJFUNC_FREE 
OBJFUNC_DISPLAY 
OBJFUNC_NITEM 

Definition at line 37 of file drawing.h.

◆ anonymous enum

anonymous enum
Enumerator
BEGIN_GRADATION 
LINEAR 
RADIAL 
CONICAL 
SQUARE 
END_GRADATION 
BITMAP_PATTERN 

Definition at line 45 of file drawing.h.

Function Documentation

◆ FreeParaList()

static void FreeParaList ( HWPPara para)
static

Definition at line 628 of file drawing.h.

References FreeParaList(), and HWPPara::Next().

Referenced by FreeParaList(), HWPDOTextBoxFunc(), and HWPDrawingObject::~HWPDrawingObject().

◆ HWPDOArc2Func()

static int HWPDOArc2Func ( int  ,
HWPDrawingObject ,
int  cmd,
void *  ,
int   
)
static

◆ HWPDOArcFunc()

static int HWPDOArcFunc ( int  ,
HWPDrawingObject hdo,
int  cmd,
void *  ,
int   
)
static

◆ HWPDOContainerFunc()

static int HWPDOContainerFunc ( int  ,
HWPDrawingObject ,
int  cmd,
void *  ,
int   
)
static

Definition at line 683 of file drawing.h.

References HWPDODefaultFunc().

◆ HWPDODefaultFunc()

static int HWPDODefaultFunc ( int  cmd)
static

◆ HWPDOEllipse2Func()

static int HWPDOEllipse2Func ( int  ,
HWPDrawingObject hdo,
int  cmd,
void *  ,
int   
)
static

◆ HWPDOEllipseFunc()

static int HWPDOEllipseFunc ( int  ,
HWPDrawingObject ,
int  cmd,
void *  ,
int   
)
static

Definition at line 488 of file drawing.h.

References HWPDODefaultFunc().

◆ HWPDOFreeFormFunc()

static int HWPDOFreeFormFunc ( int  ,
HWPDrawingObject hdo,
int  cmd,
void *  ,
int   
)
static

◆ HWPDOLineFunc()

static int HWPDOLineFunc ( int  ,
HWPDrawingObject hdo,
int  cmd,
void *  ,
int   
)
static

◆ HWPDORectFunc()

static int HWPDORectFunc ( int  ,
HWPDrawingObject ,
int  cmd,
void *  ,
int   
)
static

Definition at line 479 of file drawing.h.

References HWPDODefaultFunc().

◆ HWPDOTextBoxFunc()

static int HWPDOTextBoxFunc ( int  ,
HWPDrawingObject hdo,
int  cmd,
void *  ,
int   
)
static

◆ LoadCommonHeader()

static bool LoadCommonHeader ( HWPDrawingObject hdo,
unsigned short *  link_info 
)
static

◆ LoadDrawingObject()

static std::unique_ptr< HWPDrawingObject > LoadDrawingObject ( HWPFile hwpf)
static

◆ LoadDrawingObjectBlock()

static bool LoadDrawingObjectBlock ( Picture pic,
HWPFile hwpf 
)
static

◆ LoadParaList()

static HWPPara * LoadParaList ( )
static

Definition at line 636 of file drawing.h.

References GetCurrentDoc(), hmem, HWPFile::ReadParaList(), and HWPFile::SetIODevice().

Referenced by HWPDOTextBoxFunc(), and LoadCommonHeader().

◆ ReadSizeField()

static int ReadSizeField ( int  size)
static

◆ SetHdoParallRgn()

static void SetHdoParallRgn ( HWPDrawingObject hdo,
int  width,
int  height 
)
static

Definition at line 91 of file drawing.h.

References HWPDOProperty::parall, HWPDrawingObject::property, ZZParall::pt, ZZPoint::x, and ZZPoint::y.

Referenced by LoadCommonHeader().

◆ SkipPrivateBlock()

static bool SkipPrivateBlock ( int  type)
static

◆ SkipUnusedField()

static bool SkipUnusedField ( void  )
static

Variable Documentation

◆ count

int count = 0
static

Definition at line 89 of file drawing.h.

Referenced by HWPDrawingObject::HWPDrawingObject().

◆ hmem

HIODev* hmem = nullptr
static

◆ HWPDOFuncTbl

HWPDOFuncType HWPDOFuncTbl[]
Initial value:
=
{
}
static int HWPDOArcFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:525
static int HWPDORectFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:479
static int HWPDOLineFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:452
static int HWPDOEllipse2Func(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:496
static int HWPDOEllipseFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:488
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 HWPDOTextBoxFunc(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:655
static int HWPDOArc2Func(int, HWPDrawingObject *, int, void *, int)
Definition: drawing.h:547

Definition at line 72 of file drawing.h.

◆ SizeExpected

int SizeExpected
static

Definition at line 119 of file drawing.h.

Referenced by ReadSizeField(), and SkipUnusedField().

◆ SizeRead

int SizeRead
static

Definition at line 120 of file drawing.h.

Referenced by ReadSizeField(), and SkipUnusedField().