home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / GSSTATE.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  75 lines

  1. /* Copyright (C) 1989, 1992, 1993, 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gsstate.h */
  20. /* Graphics state API for Ghostscript library */
  21.  
  22. #ifndef gsstate_INCLUDED
  23. #  define gsstate_INCLUDED
  24.  
  25. /* Opaque type for a graphics state */
  26. /*typedef struct gs_state_s gs_state;*/    /* in gx.h */
  27.  
  28. /* Allocation, freeing, initialization, and copying */
  29. gs_state *gs_state_alloc(P1(gs_memory_t *)); /* 0 if fails */
  30. int    gs_state_free(P1(gs_state *));
  31. int    gs_gsave(P1(gs_state *)),
  32.     gs_grestore(P1(gs_state *)),
  33.     gs_grestoreall(P1(gs_state *));
  34. gs_state *gs_gstate(P1(gs_state *));
  35. int    gs_copygstate(P2(gs_state * /*to*/, const gs_state * /*from*/)),
  36.     gs_currentgstate(P2(gs_state * /*to*/, const gs_state *    /*from*/)),
  37.     gs_setgstate(P2(gs_state * /*to*/, const gs_state * /*from*/));
  38. gs_memory_t *gs_state_memory(P1(const gs_state *));    /* special for interpreter */
  39. gs_state *gs_state_saved(P1(const gs_state *));        /* special for Level 2 grestore */
  40. gs_state *gs_state_swap_saved(P2(gs_state *, gs_state *));    /* special for save/restore */
  41. gs_memory_t *gs_state_swap_memory(P2(gs_state *, gs_memory_t *)); /* special for interpreter */
  42. int    gs_initgraphics(P1(gs_state *));
  43.  
  44. /* Device control */
  45. #include "gsdevice.h"
  46.  
  47. /* Line parameters and quality */
  48. #include "gsline.h"
  49.  
  50. /* Color and gray */
  51. #include "gscolor.h"
  52.  
  53. /* Halftone screen */
  54. #include "gsht.h"
  55. int    gs_sethalftonephase(P3(gs_state *, int, int));
  56. int    gs_currenthalftonephase(P2(gs_state *, gs_int_point *));
  57.  
  58. /* "Client data" interface for graphics states. */
  59. typedef void *(*gs_state_alloc_proc_t)(P1(gs_memory_t *mem));
  60. typedef int (*gs_state_copy_proc_t)(P2(void *to, const void *from));
  61. typedef void (*gs_state_free_proc_t)(P2(void *old, gs_memory_t *mem));
  62. typedef struct gs_state_client_procs_s {
  63.     gs_state_alloc_proc_t alloc;
  64.     gs_state_copy_proc_t copy;
  65.     gs_state_free_proc_t free;
  66. } gs_state_client_procs;
  67. void    gs_state_set_client(P3(gs_state *, void *, const gs_state_client_procs *));
  68. void *    gs_state_client_data(P1(const gs_state *));
  69. /* gzstate.h redefines the following: */
  70. #ifndef gs_state_client_data_inline
  71. #  define gs_state_client_data_inline(pgs) gs_state_client_data(pgs)
  72. #endif
  73.  
  74. #endif                    /* gsstate_INCLUDED */
  75.