1 /*
    2  * << Haru Free PDF Library >> -- hpdf_gstate.h
    3  *
    4  * URL: http://libharu.org
    5  *
    6  * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
    7  * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
    8  *
    9  * Permission to use, copy, modify, distribute and sell this software
   10  * and its documentation for any purpose is hereby granted without fee,
   11  * provided that the above copyright notice appear in all copies and
   12  * that both that copyright notice and this permission notice appear
   13  * in supporting documentation.
   14  * It is provided "as is" without express or implied warranty.
   15  *
   16  */
   17 
   18 #ifndef _HPDF_GSTATE_H
   19 #define _HPDF_GSTATE_H
   20 
   21 #include "hpdf_font.h"
   22 
   23 #ifdef __cplusplus
   24 extern "C" {
   25 #endif
   26 
   27 
   28 /*----------------------------------------------------------------------------*/
   29 /*------ graphic state stack -------------------------------------------------*/
   30 
   31 typedef struct _HPDF_GState_Rec  *HPDF_GState;
   32 
   33 typedef struct _HPDF_GState_Rec {
   34     HPDF_TransMatrix        trans_matrix;
   35     HPDF_REAL               line_width;
   36     HPDF_LineCap            line_cap;
   37     HPDF_LineJoin           line_join;
   38     HPDF_REAL               miter_limit;
   39     HPDF_DashMode           dash_mode;
   40     HPDF_REAL               flatness;
   41 
   42     HPDF_REAL               char_space;
   43     HPDF_REAL               word_space;
   44     HPDF_REAL               h_scalling;
   45     HPDF_REAL               text_leading;
   46     HPDF_TextRenderingMode  rendering_mode;
   47     HPDF_REAL               text_rise;
   48 
   49     HPDF_ColorSpace         cs_fill;
   50     HPDF_ColorSpace         cs_stroke;
   51     HPDF_RGBColor           rgb_fill;
   52     HPDF_RGBColor           rgb_stroke;
   53     HPDF_CMYKColor          cmyk_fill;
   54     HPDF_CMYKColor          cmyk_stroke;
   55     HPDF_REAL               gray_fill;
   56     HPDF_REAL               gray_stroke;
   57 
   58     HPDF_Font               font;
   59     HPDF_REAL               font_size;
   60     HPDF_WritingMode        writing_mode;
   61 
   62     HPDF_GState             prev;
   63     HPDF_UINT               depth;
   64 } HPDF_GState_Rec;
   65 
   66 /*----------------------------------------------------------------------------*/
   67 /*----------------------------------------------------------------------------*/
   68 
   69 HPDF_GState
   70 HPDF_GState_New  (HPDF_MMgr    mmgr,
   71                   HPDF_GState  current);
   72 
   73 
   74 HPDF_GState
   75 HPDF_GState_Free  (HPDF_MMgr    mmgr,
   76                    HPDF_GState  gstate);
   77 
   78 #ifdef __cplusplus
   79 }
   80 #endif /* __cplusplus */
   81 
   82 #endif /* _HPDF_GSTATE_H */
   83