/*
 * Copyright (c) 1989,90 Microsoft Corporation
 */
/**********************************************************************
 *
 *      Name:       graphics.def
 *
 *      Purpose:    Definitions of global variables
 *
 *      Developer:  S.C.Chen
 *
 *      History:
 *      Version     Date        Comments
 *                  7/19/88     update data types:
 *                              1) float ==> real32
 *                              2) int
 *                                 short ==> fix16 or fix(don't care the length)
 *                              3) long  ==> fix32, for long integer
 *                                           long32, for parameter
 *                              4) et_info_ii ==> et_info
 *                  8/01/88     @RES: device resolution (Y.C.)
 *      3.0         8/13/88     @SCAN_EHS: scan conversion enhancement
 *                              delete clip_et, clip_xt, fill_et, fill_ht
 *                  10/5/88     add ctm information for seperating files path.c
 *                              and stroke.c
 *                  10/12/88    move circle_sp to "stroke.c", delete stroke_flat
 *                  10/18/88    source file reorganization for saving trapezoids
 *                              in command buffer instead of scanlines, i.e.
 *                              defer scan conversion at lower level graphics
 *                              primitives:
 *                              1. split scanconv.c => savetpzd.c & fillgb.c
 *                                 savetpzd -- save trapezoid in command buffer
 *                                 fillgb   -- perform scan conversion
 *                              2. move fill_info structure to savetpzd.c
 *                              3. add fill_tpzd in fillgs.c
 *                  11/24/88    open global graphics memory parameters
 *                              to up-level of PDL
 *                  11/24/88    scanline_table moves to fillproc.def
 *                  11/29/88    @ET: update edge_table structure
 *                              1) add edge_ptr structure
 *                              2) delete shape_et, shape_xt, shape_ht_first
 **********************************************************************/

/* path table */
struct ph_hdr far * path_table; /*@WIN*/

/* node table */
struct nd_hdr far * node_table; /*@WIN*/
VX_IDX  freenode_list = 0;       /* index of node_table; first free node */

/* edge table @ET */
struct edge_hdr far * edge_table;          /* body of edge_table @WIN */
struct edge_hdr far * far * edge_ptr;   /* index table of edge_table @WIN */

/* adjust gray table */
struct gray_hdr far * gray_table; /*@WIN*/

/* adjust spot order table & usage */
ufix16 far * spot_table;        /* @WIN */
fix16           spot_usage = 0;

/* graphics stack */
/* struct gs_hdr  gs_stack[MAXGSL]; move to init.c for global allocate @WIN*/
struct gs_hdr  FAR * gs_stack;   /* @WIN*/
fix16  current_gs_level = 0;        /* current gsave level */
struct gs_hdr far *  GSptr = 0;   /* pointer to current graphics state */

/* new path and new clipping path */
struct list_hdr  new_path;
struct cp_hdr  new_clip;

/* gray_chain table and sample_list */
struct gray_chain_hdr far * gray_chain;  /*@WIN*/
struct g_sample_hdr  image_info;
struct isp_data FAR *isp_table;     /* 3-13-91, Jack @WIN*/
fix16   last_isp_index;         /* 3-13-91, Jack */

/* destination of filling: (F_TO_PAGE / F_TO_CACHE) */
ufix  fill_destination;

/* active dash pattern */
struct actdp  actdp;

/* resolution of device */
fix     resolution;                                         /* @RES */

/* ctm information */
bool   ctm_flag;       /* property of CTM:
                            *   NORMAL_CTM -- [a 0 0 d e f]
                            *   LEFT_HAND_CTM -- [a b c d e f], a*d < 0
                            *       in left-handed coorinate system
                            *       e.g. default user space; @STKDIR
                            */
real32 inverse_ctm[6];      /* for fast inverse transform */

/* ***********  Definitions from FILLPROC.DEF  11-24-88  ************** */
ufix32      ccb_base;       /* base of character cache pool         */
ufix32      ccb_size;       /* size of character cache pool         */
ufix32      htc_base;       /* size of halftone pattern cache       */
ufix32      htc_size;       /* size of halftone pattern cache       */
ufix32      crc_size;       /* size of circular round cache         */
ufix32      isp_size;       /* size of image seed patterns          */
ufix32      gwb_size;       /* size of graphics working bitmap      */
ufix32      cmb_size;       /* size of clipping mask bitmap         */
