home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxdevcli.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  36.3 KB  |  962 lines

  1. /* Copyright (C) 1997, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxdevcli.h,v 1.3 2000/09/19 19:00:35 lpd Exp $ */
  20. /* Definitions for device clients */
  21.  
  22. #ifndef gxdevcli_INCLUDED
  23. #  define gxdevcli_INCLUDED
  24.  
  25. #include "std.h"        /* for FILE */
  26. #include "gscompt.h"
  27. #include "gsdcolor.h"
  28. #include "gsmatrix.h"
  29. #include "gsiparam.h"        /* requires gsmatrix.h */
  30. #include "gsrefct.h"
  31. #include "gsropt.h"
  32. #include "gsstruct.h"
  33. #include "gsxfont.h"
  34. #include "gxbitmap.h"
  35. #include "gxcindex.h"
  36. #include "gxcvalue.h"
  37. #include "gxfixed.h"
  38. #include "gxtext.h"
  39.  
  40. /* See Drivers.htm for documentation of the driver interface. */
  41.  
  42. #ifndef gx_device_DEFINED
  43. #  define gx_device_DEFINED
  44. typedef struct gx_device_s gx_device;
  45. #endif
  46.  
  47. /* ---------------- Memory management ---------------- */
  48.  
  49. /*
  50.  * NOTE: if you write code that creates device instances (either with
  51.  * gs_copydevice or by allocating them explicitly), allocates device
  52.  * instances as either local or static variables (actual instances, not
  53.  * pointers to instances), or sets the target of forwarding devices, please
  54.  * read the following documentation carefully.  The rules for doing these
  55.  * things changed substantially in release 5.68, in a
  56.  * non-backward-compatible way, and unfortunately we could not find a way to
  57.  * make the compiler give an error at places that need changing.
  58.  */
  59.  
  60. /*
  61.  * Device instances are managed with reference counting: when the last
  62.  * reference to a device from a graphics state or the target field of a
  63.  * forwarding device is removed, the device is normally freed.  However,
  64.  * some device instances are referenced in other ways (for example, from
  65.  * objects in the PostScript interpreter, or from library client code) and
  66.  * will be freed by the garbage collector (if any) or explicitly: they
  67.  * should not be freed by reference counting.  These are called "retained"
  68.  * device instances.  Every device instance remembers whether or not it is
  69.  * retained, and an instance is freed iff its reference count is zero and it
  70.  * is not retained.
  71.  *
  72.  * Normally devices are initialized as not retained.  However, devices
  73.  * initialized by calling gx_device_init(pdev, proto, memory, false), or
  74.  * created by gs_copydevice are marked as retained.  You can also set the
  75.  * retention status of a device explicitly with gx_device_retain(pdev,
  76.  * true-or-false).  Note that if you change a retained device to
  77.  * non-retained, if there are no references to it from graphics states or
  78.  * targets, it will be freed immediately.
  79.  *
  80.  * There are 3 ways that a device structure might be allocated:
  81.  *    1) Allocated dynamically, e.g.,
  82.  *        gx_device *pdev_new;
  83.  *        gs_copydevice(&pdev_new, pdev_old, memory);
  84.  *    2) Declared as a local or static variable, e.g.,
  85.  *        gx_device devv;
  86.  *    or
  87.  *        const gx_device devc = ...;
  88.  *    3) Embedded in an object allocated in one of the above ways.
  89.  * If you allocate a device using #2 or #3, you MUST mark it as retained
  90.  * by calling gx_device_retain(pdev, true).  If you do not do this, an
  91.  * attempt will be made to free the device, corrupting memory.  */
  92.  
  93. /*
  94.  * Do not set the target of a forwarding device with an assignment like
  95.  *    fdev->target = tdev;
  96.  * You must use the procedure
  97.  *    gx_device_set_target(fdev, tdev);
  98.  * Note that the first argument is a gx_device_forward *, not a gx_device *.
  99.  *
  100.  * We could have changed the member name "target" when this became
  101.  * necessary, so the compiler would flag places that needed editing, but
  102.  * there were literally hundreds of places that only read the target member
  103.  * that we would have had to change, so we decided to leave the name alone.
  104.  */
  105.  
  106. /* ---------------- Auxiliary types and structures ---------------- */
  107.  
  108. /* We need at least an abstract type for a graphics state, */
  109. /* which is passed to the page device procedures. */
  110. #ifndef gs_state_DEFINED
  111. #  define gs_state_DEFINED
  112. typedef struct gs_state_s gs_state;
  113. #endif
  114.  
  115. /* We need abstract types for paths and fill/stroke parameters, */
  116. /* for the path-oriented device procedures. */
  117. #ifndef gx_path_DEFINED
  118. #  define gx_path_DEFINED
  119. typedef struct gx_path_s gx_path;
  120. #endif
  121. #ifndef gx_clip_path_DEFINED
  122. #  define gx_clip_path_DEFINED
  123. typedef struct gx_clip_path_s gx_clip_path;
  124. #endif
  125. #ifndef gx_fill_params_DEFINED
  126. #  define gx_fill_params_DEFINED
  127. typedef struct gx_fill_params_s gx_fill_params;
  128. #endif
  129. #ifndef gx_stroke_params_DEFINED
  130. #  define gx_stroke_params_DEFINED
  131. typedef struct gx_stroke_params_s gx_stroke_params;
  132. #endif
  133. #ifndef gs_imager_state_DEFINED
  134. #  define gs_imager_state_DEFINED
  135. typedef struct gs_imager_state_s gs_imager_state;
  136. #endif
  137.  
  138. /* We need an abstract type for the image enumeration state, */
  139. /* for begin[_typed]_image. */
  140. #ifndef gx_image_enum_common_t_DEFINED
  141. #  define gx_image_enum_common_t_DEFINED
  142. typedef struct gx_image_enum_common_s gx_image_enum_common_t;
  143. #endif
  144.  
  145. /* Define the type for colors passed to the higher-level procedures. */
  146. typedef gx_device_color gx_drawing_color;
  147.  
  148. /* Define a type for telling get_alpha_bits what kind of object */
  149. /* is being rendered. */
  150. typedef enum {
  151.     go_text,
  152.     go_graphics
  153. } graphics_object_type;
  154.  
  155. /* Define an edge of a trapezoid.  Requirement: end.y >= start.y. */
  156. typedef struct gs_fixed_edge_s {
  157.     gs_fixed_point start;
  158.     gs_fixed_point end;
  159. } gs_fixed_edge;
  160.  
  161. /* Define the parameters passed to get_bits_rectangle. */
  162. #ifndef gs_get_bits_params_DEFINED
  163. #  define gs_get_bits_params_DEFINED
  164. typedef struct gs_get_bits_params_s gs_get_bits_params_t;
  165. #endif
  166.  
  167. /* Define the structure for device color capabilities. */
  168. typedef struct gx_device_anti_alias_info_s {
  169.     int text_bits;        /* 1,2,4 */
  170.     int graphics_bits;        /* ditto */
  171. } gx_device_anti_alias_info;
  172. typedef struct gx_device_color_info_s {
  173.     int num_components;        /* doesn't include alpha: */
  174.                 /* 0 = alpha only, 1 = gray only, */
  175.                 /* 3 = RGB, 4 = CMYK */
  176.     int depth;            /* # of bits per pixel */
  177.     gx_color_value max_gray;    /* # of distinct gray levels -1 */
  178.     gx_color_value max_color;    /* # of distinct color levels -1 */
  179.                 /* (only relevant if num_comp. > 1) */
  180.     gx_color_value dither_grays;    /* size of gray ramp for dithering */
  181.     gx_color_value dither_colors;    /* size of color cube ditto */
  182.                 /* (only relevant if num_comp. > 1) */
  183.     gx_device_anti_alias_info anti_alias;
  184. } gx_device_color_info;
  185.  
  186. #define dci_alpha_values(nc,depth,mg,mc,dg,dc,ta,ga)\
  187.   { nc, depth, mg, mc, dg, dc, { ta, ga } }
  188. #define dci_values(nc,depth,mg,mc,dg,dc)\
  189.   dci_alpha_values(nc, depth, mg, mc, dg, dc, 1, 1)
  190. #define dci_std_color(color_bits)\
  191.   dci_values(\
  192.     (color_bits == 32 ? 4 : color_bits > 1 ? 3 : 1),\
  193.     ((color_bits > 1) & (color_bits < 8) ? 8 : color_bits),\
  194.     (color_bits >= 8 ? 255 : 1),\
  195.     (color_bits >= 8 ? 255 : color_bits > 1 ? 1 : 0),\
  196.     (color_bits >= 8 ? 5 : 2),\
  197.     (color_bits >= 8 ? 5 : color_bits > 1 ? 2 : 0)\
  198.   )
  199. #define dci_black_and_white dci_std_color(1)
  200. #define dci_black_and_white_() dci_black_and_white
  201. #define dci_color(depth,maxv,dither)\
  202.   dci_values(3, depth, maxv, maxv, dither, dither)
  203. #define gx_device_has_color(dev) ((dev)->color_info.num_components > 1)
  204.  
  205. /* Structure for device procedures. */
  206. typedef struct gx_device_procs_s gx_device_procs;
  207.  
  208. /* Structure for page device procedures. */
  209. /* Note that these take the graphics state as a parameter. */
  210. typedef struct gx_page_device_procs_s {
  211.  
  212. #define dev_page_proc_install(proc)\
  213.   int proc(P2(gx_device *dev, gs_state *pgs))
  214.     dev_page_proc_install((*install));
  215.  
  216. #define dev_page_proc_begin_page(proc)\
  217.   int proc(P2(gx_device *dev, gs_state *pgs))
  218.     dev_page_proc_begin_page((*begin_page));
  219.  
  220. #define dev_page_proc_end_page(proc)\
  221.   int proc(P3(gx_device *dev, int reason, gs_state *pgs))
  222.     dev_page_proc_end_page((*end_page));
  223.  
  224. } gx_page_device_procs;
  225.  
  226. /* Default procedures */
  227. dev_page_proc_install(gx_default_install);
  228. dev_page_proc_begin_page(gx_default_begin_page);
  229. dev_page_proc_end_page(gx_default_end_page);
  230.  
  231. /* ---------------- Device structure ---------------- */
  232.  
  233. /*
  234.  * Define the generic device structure.  The device procedures can
  235.  * have two different configurations:
  236.  * 
  237.  *      - Statically initialized devices predating release 2.8.1
  238.  *      set the static_procs pointer to point to a separate procedure record,
  239.  *      and do not initialize procs.
  240.  *
  241.  *      - Statically initialized devices starting with release 2.8.1,
  242.  *      and all dynamically created device instances,
  243.  *      set the static_procs pointer to 0, and initialize procs.
  244.  *
  245.  * The gx_device_set_procs procedure converts the first of these to
  246.  * the second, which is what all client code starting in 2.8.1 expects
  247.  * (using the procs record, not the static_procs pointer, to call the
  248.  * driver procedures).
  249.  *
  250.  * The choice of the name Margins (rather than, say, HWOffset), and the
  251.  * specification in terms of a default device resolution rather than
  252.  * 1/72" units, are due to Adobe.
  253.  *
  254.  * ****** NOTE: If you define any subclasses of gx_device, you *must* define
  255.  * ****** the finalization procedure as gx_device_finalize.  Finalization
  256.  * ****** procedures are not automatically inherited.
  257.  */
  258. typedef struct gx_device_cached_colors_s {
  259.     gx_color_index black, white;
  260. } gx_device_cached_colors_t;
  261. #define gx_device_common\
  262.     int params_size;        /* OBSOLETE if stype != 0: */\
  263.                     /* size of this structure */\
  264.     const gx_device_procs *static_procs;    /* OBSOLETE */\
  265.                     /* pointer to procs */\
  266.     const char *dname;        /* the device name */\
  267.     gs_memory_t *memory;        /* (0 iff static prototype) */\
  268.     gs_memory_type_ptr_t stype;    /* memory manager structure type, */\
  269.                     /* may be 0 if static prototype */\
  270.     bool stype_is_dynamic;        /* if true, free the stype when */\
  271.                     /* freeing the device */\
  272.     void (*finalize)(P1(gx_device *));  /* finalization to execute */\
  273.                     /* before closing device, if any */\
  274.     rc_header rc;            /* reference count from gstates */\
  275.                     /* and targets, +1 if retained */\
  276.     bool retained;            /* true if retained */\
  277.     bool is_open;            /* true if device has been opened */\
  278.     int max_fill_band;        /* limit on band size for fill, */\
  279.                     /* must be 0 or a power of 2 */\
  280.                     /* (see gdevabuf.c for more info) */\
  281.     gx_device_color_info color_info;    /* color information */\
  282.     gx_device_cached_colors_t cached_colors;\
  283.     int width;            /* width in pixels */\
  284.     int height;            /* height in pixels */\
  285.     float MediaSize[2];        /* media dimensions in points */\
  286.     float ImagingBBox[4];        /* imageable region in points */\
  287.       bool ImagingBBox_set;\
  288.     float HWResolution[2];        /* resolution, dots per inch */\
  289.     float MarginsHWResolution[2];    /* resolution for Margins */\
  290.     float Margins[2];        /* offset of physical page corner */\
  291.                     /* from device coordinate (0,0), */\
  292.                     /* in units given by MarginsHWResolution */\
  293.     float HWMargins[4];        /* margins around imageable area, */\
  294.                     /* in default user units ("points") */\
  295.     long PageCount;            /* number of pages written */\
  296.     long ShowpageCount;        /* number of calls on showpage */\
  297.     int NumCopies;\
  298.       bool NumCopies_set;\
  299.     bool IgnoreNumCopies;        /* if true, force num_copies = 1 */\
  300.     bool UseCIEColor;        /* for PS LL3 */\
  301.     gx_page_device_procs page_procs;    /* must be last */\
  302.         /* end of std_device_body */\
  303.     gx_device_procs procs    /* object procedures */
  304. /*
  305.  * Note: x/y_pixels_per_inch are here only for backward compatibility.
  306.  * They should not be used in new code.
  307.  */
  308. #define x_pixels_per_inch HWResolution[0]
  309. #define y_pixels_per_inch HWResolution[1]
  310. #define offset_margin_values(x, y, left, bot, right, top)\
  311.   {x, y}, {left, bot, right, top}
  312. #define margin_values(left, bot, right, top)\
  313.   offset_margin_values(0, 0, left, bot, right, top)
  314. #define no_margins margin_values(0, 0, 0, 0)
  315. #define no_margins_() no_margins
  316. /* Define macros that give the page offset ("Margins") in inches. */
  317. #define dev_x_offset(dev) ((dev)->Margins[0] / (dev)->MarginsHWResolution[0])
  318. #define dev_y_offset(dev) ((dev)->Margins[1] / (dev)->MarginsHWResolution[1])
  319. #define dev_y_offset_points(dev) (dev_y_offset(dev) * 72.0)
  320. /* Note that left/right/top/bottom are defined relative to */
  321. /* the physical paper, not the coordinate system. */
  322. /* For backward compatibility, we define macros that give */
  323. /* the margins in inches. */
  324. #define dev_l_margin(dev) ((dev)->HWMargins[0] / 72.0)
  325. #define dev_b_margin(dev) ((dev)->HWMargins[1] / 72.0)
  326. #define dev_b_margin_points(dev) ((dev)->HWMargins[1])
  327. #define dev_r_margin(dev) ((dev)->HWMargins[2] / 72.0)
  328. #define dev_t_margin(dev) ((dev)->HWMargins[3] / 72.0)
  329. #define dev_t_margin_points(dev) ((dev)->HWMargins[3])
  330. /* The extra () are to prevent premature expansion. */
  331. #define open_init_closed() 0 /*false*/, 0    /* max_fill_band */
  332. #define open_init_open() 1 /*true*/, 0    /* max_fill_band */
  333. /* Accessors for device procedures */
  334. #define dev_proc(dev, p) ((dev)->procs.p)
  335. #define set_dev_proc(dev, p, proc) ((dev)->procs.p = (proc))
  336. #define fill_dev_proc(dev, p, dproc)\
  337.   if ( dev_proc(dev, p) == 0 ) set_dev_proc(dev, p, dproc)
  338. #define assign_dev_procs(todev, fromdev)\
  339.   ((todev)->procs = (fromdev)->procs)
  340.  
  341. /* ---------------- Device procedures ---------------- */
  342.  
  343. /* Define an opaque type for parameter lists. */
  344. #ifndef gs_param_list_DEFINED
  345. #  define gs_param_list_DEFINED
  346. typedef struct gs_param_list_s gs_param_list;
  347. #endif
  348.  
  349. /*
  350.  * Definition of device procedures.
  351.  * Note that the gx_device * argument is not declared const,
  352.  * because many drivers maintain dynamic state in the device structure.
  353.  * Note also that the structure is defined as a template, so that
  354.  * we can instantiate it with device subclasses.
  355.  * Because C doesn't have real templates, we must do this with macros.
  356.  */
  357.  
  358. /* Define macros for declaring device procedures. */
  359.  
  360. #define dev_t_proc_open_device(proc, dev_t)\
  361.   int proc(P1(dev_t *dev))
  362. #define dev_proc_open_device(proc)\
  363.   dev_t_proc_open_device(proc, gx_device)
  364.  
  365. #define dev_t_proc_get_initial_matrix(proc, dev_t)\
  366.   void proc(P2(dev_t *dev, gs_matrix *pmat))
  367. #define dev_proc_get_initial_matrix(proc)\
  368.   dev_t_proc_get_initial_matrix(proc, gx_device)
  369.  
  370. #define dev_t_proc_sync_output(proc, dev_t)\
  371.   int proc(P1(dev_t *dev))
  372. #define dev_proc_sync_output(proc)\
  373.   dev_t_proc_sync_output(proc, gx_device)
  374.  
  375. #define dev_t_proc_output_page(proc, dev_t)\
  376.   int proc(P3(dev_t *dev, int num_copies, int flush))
  377. #define dev_proc_output_page(proc)\
  378.   dev_t_proc_output_page(proc, gx_device)
  379.  
  380. #define dev_t_proc_close_device(proc, dev_t)\
  381.   int proc(P1(dev_t *dev))
  382. #define dev_proc_close_device(proc)\
  383.   dev_t_proc_close_device(proc, gx_device)
  384.  
  385. #define dev_t_proc_map_rgb_color(proc, dev_t)\
  386.   gx_color_index proc(P4(dev_t *dev,\
  387.     gx_color_value red, gx_color_value green, gx_color_value blue))
  388. #define dev_proc_map_rgb_color(proc)\
  389.   dev_t_proc_map_rgb_color(proc, gx_device)
  390.  
  391. #define dev_t_proc_map_color_rgb(proc, dev_t)\
  392.   int proc(P3(dev_t *dev,\
  393.     gx_color_index color, gx_color_value rgb[3]))
  394. #define dev_proc_map_color_rgb(proc)\
  395.   dev_t_proc_map_color_rgb(proc, gx_device)
  396.  
  397. #define dev_t_proc_fill_rectangle(proc, dev_t)\
  398.   int proc(P6(dev_t *dev,\
  399.     int x, int y, int width, int height, gx_color_index color))
  400. #define dev_proc_fill_rectangle(proc)\
  401.   dev_t_proc_fill_rectangle(proc, gx_device)
  402.  
  403. #define dev_t_proc_tile_rectangle(proc, dev_t)\
  404.   int proc(P10(dev_t *dev,\
  405.     const gx_tile_bitmap *tile, int x, int y, int width, int height,\
  406.     gx_color_index color0, gx_color_index color1,\
  407.     int phase_x, int phase_y))
  408. #define dev_proc_tile_rectangle(proc)\
  409.   dev_t_proc_tile_rectangle(proc, gx_device)
  410.  
  411. #define dev_t_proc_copy_mono(proc, dev_t)\
  412.   int proc(P11(dev_t *dev,\
  413.     const byte *data, int data_x, int raster, gx_bitmap_id id,\
  414.     int x, int y, int width, int height,\
  415.     gx_color_index color0, gx_color_index color1))
  416. #define dev_proc_copy_mono(proc)\
  417.   dev_t_proc_copy_mono(proc, gx_device)
  418.  
  419. #define dev_t_proc_copy_color(proc, dev_t)\
  420.   int proc(P9(dev_t *dev,\
  421.     const byte *data, int data_x, int raster, gx_bitmap_id id,\
  422.     int x, int y, int width, int height))
  423. #define dev_proc_copy_color(proc)\
  424.   dev_t_proc_copy_color(proc, gx_device)
  425.  
  426.         /* OBSOLETED in release 3.66 */
  427.  
  428. #define dev_t_proc_draw_line(proc, dev_t)\
  429.   int proc(P6(dev_t *dev,\
  430.     int x0, int y0, int x1, int y1, gx_color_index color))
  431. #define dev_proc_draw_line(proc)\
  432.   dev_t_proc_draw_line(proc, gx_device)
  433.  
  434.         /* Added in release 2.4 */
  435.  
  436. #define dev_t_proc_get_bits(proc, dev_t)\
  437.   int proc(P4(dev_t *dev,\
  438.     int y, byte *data, byte **actual_data))
  439. #define dev_proc_get_bits(proc)\
  440.   dev_t_proc_get_bits(proc, gx_device)
  441.  
  442.         /* Added in release 2.4, changed in 2.8, */
  443.         /* renamed in 2.9.6 */
  444.  
  445. #define dev_t_proc_get_params(proc, dev_t)\
  446.   int proc(P2(dev_t *dev, gs_param_list *plist))
  447. #define dev_proc_get_params(proc)\
  448.   dev_t_proc_get_params(proc, gx_device)
  449.  
  450. #define dev_t_proc_put_params(proc, dev_t)\
  451.   int proc(P2(dev_t *dev, gs_param_list *plist))
  452. #define dev_proc_put_params(proc)\
  453.   dev_t_proc_put_params(proc, gx_device)
  454.  
  455.         /* Added in release 2.6 */
  456.  
  457. #define dev_t_proc_map_cmyk_color(proc, dev_t)\
  458.   gx_color_index proc(P5(dev_t *dev,\
  459.     gx_color_value cyan, gx_color_value magenta, gx_color_value yellow,\
  460.     gx_color_value black))
  461. #define dev_proc_map_cmyk_color(proc)\
  462.   dev_t_proc_map_cmyk_color(proc, gx_device)
  463.  
  464. #define dev_t_proc_get_xfont_procs(proc, dev_t)\
  465.   const gx_xfont_procs *proc(P1(dev_t *dev))
  466. #define dev_proc_get_xfont_procs(proc)\
  467.   dev_t_proc_get_xfont_procs(proc, gx_device)
  468.  
  469.         /* Added in release 2.6.1 */
  470.  
  471. #define dev_t_proc_get_xfont_device(proc, dev_t)\
  472.   gx_device *proc(P1(dev_t *dev))
  473. #define dev_proc_get_xfont_device(proc)\
  474.   dev_t_proc_get_xfont_device(proc, gx_device)
  475.  
  476.         /* Added in release 2.7.1 */
  477.  
  478. #define dev_t_proc_map_rgb_alpha_color(proc, dev_t)\
  479.   gx_color_index proc(P5(dev_t *dev,\
  480.     gx_color_value red, gx_color_value green, gx_color_value blue,\
  481.     gx_color_value alpha))
  482. #define dev_proc_map_rgb_alpha_color(proc)\
  483.   dev_t_proc_map_rgb_alpha_color(proc, gx_device)
  484.  
  485.         /* Added in release 2.8.1 */
  486.  
  487. #define dev_t_proc_get_page_device(proc, dev_t)\
  488.   gx_device *proc(P1(dev_t *dev))
  489. #define dev_proc_get_page_device(proc)\
  490.   dev_t_proc_get_page_device(proc, gx_device)
  491.  
  492.         /* Added in release 3.20, OBSOLETED in 5.65 */
  493.  
  494. #define dev_t_proc_get_alpha_bits(proc, dev_t)\
  495.   int proc(P2(dev_t *dev, graphics_object_type type))
  496. #define dev_proc_get_alpha_bits(proc)\
  497.   dev_t_proc_get_alpha_bits(proc, gx_device)
  498.  
  499.         /* Added in release 3.20 */
  500.  
  501. #define dev_t_proc_copy_alpha(proc, dev_t)\
  502.   int proc(P11(dev_t *dev, const byte *data, int data_x,\
  503.     int raster, gx_bitmap_id id, int x, int y, int width, int height,\
  504.     gx_color_index color, int depth))
  505. #define dev_proc_copy_alpha(proc)\
  506.   dev_t_proc_copy_alpha(proc, gx_device)
  507.  
  508.         /* Added in release 3.38 */
  509.  
  510. #define dev_t_proc_get_band(proc, dev_t)\
  511.   int proc(P3(dev_t *dev, int y, int *band_start))
  512. #define dev_proc_get_band(proc)\
  513.   dev_t_proc_get_band(proc, gx_device)
  514.  
  515.         /* Added in release 3.44 */
  516.  
  517. #define dev_t_proc_copy_rop(proc, dev_t)\
  518.   int proc(P15(dev_t *dev,\
  519.     const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id,\
  520.     const gx_color_index *scolors,\
  521.     const gx_tile_bitmap *texture, const gx_color_index *tcolors,\
  522.     int x, int y, int width, int height,\
  523.     int phase_x, int phase_y, gs_logical_operation_t lop))
  524. #define dev_proc_copy_rop(proc)\
  525.   dev_t_proc_copy_rop(proc, gx_device)
  526.  
  527.         /* Added in release 3.60, changed in 3.68. */
  528.  
  529. #define dev_t_proc_fill_path(proc, dev_t)\
  530.   int proc(P6(dev_t *dev,\
  531.     const gs_imager_state *pis, gx_path *ppath,\
  532.     const gx_fill_params *params,\
  533.     const gx_drawing_color *pdcolor, const gx_clip_path *pcpath))
  534. #define dev_proc_fill_path(proc)\
  535.   dev_t_proc_fill_path(proc, gx_device)
  536.  
  537. #define dev_t_proc_stroke_path(proc, dev_t)\
  538.   int proc(P6(dev_t *dev,\
  539.     const gs_imager_state *pis, gx_path *ppath,\
  540.     const gx_stroke_params *params,\
  541.     const gx_drawing_color *pdcolor, const gx_clip_path *pcpath))
  542. #define dev_proc_stroke_path(proc)\
  543.   dev_t_proc_stroke_path(proc, gx_device)
  544.  
  545.         /* Added in release 3.60 */
  546.  
  547. #define dev_t_proc_fill_mask(proc, dev_t)\
  548.   int proc(P13(dev_t *dev,\
  549.     const byte *data, int data_x, int raster, gx_bitmap_id id,\
  550.     int x, int y, int width, int height,\
  551.     const gx_drawing_color *pdcolor, int depth,\
  552.     gs_logical_operation_t lop, const gx_clip_path *pcpath))
  553. #define dev_proc_fill_mask(proc)\
  554.   dev_t_proc_fill_mask(proc, gx_device)
  555.  
  556.         /* Added in release 3.66, changed in 3.69 */
  557.  
  558. #define dev_t_proc_fill_trapezoid(proc, dev_t)\
  559.   int proc(P8(dev_t *dev,\
  560.     const gs_fixed_edge *left, const gs_fixed_edge *right,\
  561.     fixed ybot, fixed ytop, bool swap_axes,\
  562.     const gx_drawing_color *pdcolor, gs_logical_operation_t lop))
  563. #define dev_proc_fill_trapezoid(proc)\
  564.   dev_t_proc_fill_trapezoid(proc, gx_device)
  565.  
  566. #define dev_t_proc_fill_parallelogram(proc, dev_t)\
  567.   int proc(P9(dev_t *dev,\
  568.     fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by,\
  569.     const gx_drawing_color *pdcolor, gs_logical_operation_t lop))
  570. #define dev_proc_fill_parallelogram(proc)\
  571.   dev_t_proc_fill_parallelogram(proc, gx_device)
  572.  
  573. #define dev_t_proc_fill_triangle(proc, dev_t)\
  574.   int proc(P9(dev_t *dev,\
  575.     fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by,\
  576.     const gx_drawing_color *pdcolor, gs_logical_operation_t lop))
  577. #define dev_proc_fill_triangle(proc)\
  578.   dev_t_proc_fill_triangle(proc, gx_device)
  579.  
  580. #define dev_t_proc_draw_thin_line(proc, dev_t)\
  581.   int proc(P7(dev_t *dev,\
  582.     fixed fx0, fixed fy0, fixed fx1, fixed fy1,\
  583.     const gx_drawing_color *pdcolor, gs_logical_operation_t lop))
  584. #define dev_proc_draw_thin_line(proc)\
  585.   dev_t_proc_draw_thin_line(proc, gx_device)
  586.  
  587.         /* Added in release 3.66 (as stubs); */
  588.         /* changed in 3.68; */
  589.         /* begin_image and image_data changed in 4.30, */
  590.         /* begin_image changed in 5.23. */
  591.  
  592. #define dev_t_proc_begin_image(proc, dev_t)\
  593.   int proc(P9(dev_t *dev,\
  594.     const gs_imager_state *pis, const gs_image_t *pim,\
  595.     gs_image_format_t format, const gs_int_rect *prect,\
  596.     const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,\
  597.     gs_memory_t *memory, gx_image_enum_common_t **pinfo))
  598. #define dev_proc_begin_image(proc)\
  599.   dev_t_proc_begin_image(proc, gx_device)
  600.  
  601.         /* OBSOLETED in release 5.23 */
  602.  
  603. #define dev_t_proc_image_data(proc, dev_t)\
  604.   int proc(P6(dev_t *dev,\
  605.     gx_image_enum_common_t *info, const byte **planes, int data_x,\
  606.     uint raster, int height))
  607. #define dev_proc_image_data(proc)\
  608.   dev_t_proc_image_data(proc, gx_device)
  609.  
  610.         /* OBSOLETED in release 5.23 */
  611.  
  612. #define dev_t_proc_end_image(proc, dev_t)\
  613.   int proc(P3(dev_t *dev,\
  614.     gx_image_enum_common_t *info, bool draw_last))
  615. #define dev_proc_end_image(proc)\
  616.   dev_t_proc_end_image(proc, gx_device)
  617.  
  618.         /* Added in release 3.68 */
  619.  
  620. #define dev_t_proc_strip_tile_rectangle(proc, dev_t)\
  621.   int proc(P10(dev_t *dev,\
  622.     const gx_strip_bitmap *tiles, int x, int y, int width, int height,\
  623.     gx_color_index color0, gx_color_index color1,\
  624.     int phase_x, int phase_y))
  625. #define dev_proc_strip_tile_rectangle(proc)\
  626.   dev_t_proc_strip_tile_rectangle(proc, gx_device)
  627.  
  628. #define dev_t_proc_strip_copy_rop(proc, dev_t)\
  629.   int proc(P15(dev_t *dev,\
  630.     const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id,\
  631.     const gx_color_index *scolors,\
  632.     const gx_strip_bitmap *textures, const gx_color_index *tcolors,\
  633.     int x, int y, int width, int height,\
  634.     int phase_x, int phase_y, gs_logical_operation_t lop))
  635. #define dev_proc_strip_copy_rop(proc)\
  636.   dev_t_proc_strip_copy_rop(proc, gx_device)
  637.  
  638.         /* Added in release 4.20 */
  639.  
  640. #define dev_t_proc_get_clipping_box(proc, dev_t)\
  641.   void proc(P2(dev_t *dev, gs_fixed_rect *pbox))
  642. #define dev_proc_get_clipping_box(proc)\
  643.   dev_t_proc_get_clipping_box(proc, gx_device)
  644.  
  645.         /* Added in release 5.20, changed in 5.23 */
  646.  
  647. #define dev_t_proc_begin_typed_image(proc, dev_t)\
  648.   int proc(P9(dev_t *dev,\
  649.     const gs_imager_state *pis, const gs_matrix *pmat,\
  650.     const gs_image_common_t *pim, const gs_int_rect *prect,\
  651.     const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,\
  652.     gs_memory_t *memory, gx_image_enum_common_t **pinfo))
  653. #define dev_proc_begin_typed_image(proc)\
  654.   dev_t_proc_begin_typed_image(proc, gx_device)
  655.  
  656.         /* Added in release 5.20 */
  657.  
  658. #define dev_t_proc_get_bits_rectangle(proc, dev_t)\
  659.   int proc(P4(dev_t *dev, const gs_int_rect *prect,\
  660.     gs_get_bits_params_t *params, gs_int_rect **unread))
  661. #define dev_proc_get_bits_rectangle(proc)\
  662.   dev_t_proc_get_bits_rectangle(proc, gx_device)
  663.  
  664. #define dev_t_proc_map_color_rgb_alpha(proc, dev_t)\
  665.   int proc(P3(dev_t *dev,\
  666.     gx_color_index color, gx_color_value rgba[4]))
  667. #define dev_proc_map_color_rgb_alpha(proc)\
  668.   dev_t_proc_map_color_rgb_alpha(proc, gx_device)
  669.  
  670. #define dev_t_proc_create_compositor(proc, dev_t)\
  671.   int proc(P5(dev_t *dev,\
  672.     gx_device **pcdev, const gs_composite_t *pcte,\
  673.     const gs_imager_state *pis, gs_memory_t *memory))
  674. #define dev_proc_create_compositor(proc)\
  675.   dev_t_proc_create_compositor(proc, gx_device)\
  676.  
  677.         /* Added in release 5.23 */
  678.  
  679. #define dev_t_proc_get_hardware_params(proc, dev_t)\
  680.   int proc(P2(dev_t *dev, gs_param_list *plist))
  681. #define dev_proc_get_hardware_params(proc)\
  682.   dev_t_proc_get_hardware_params(proc, gx_device)
  683.  
  684.         /* Added in release 5.24 */
  685.  
  686.      /* ... text_begin ... see gxtext.h for definition */
  687.  
  688.         /* Added in release 6.23 */
  689.  
  690. #define dev_t_proc_finish_copydevice(proc, dev_t)\
  691.   int proc(P2(dev_t *dev, const gx_device *from_dev))
  692. #define dev_proc_finish_copydevice(proc)\
  693.   dev_t_proc_finish_copydevice(proc, gx_device)
  694.  
  695. /* Define the device procedure vector template proper. */
  696.  
  697. #define gx_device_proc_struct(dev_t)\
  698. {    dev_t_proc_open_device((*open_device), dev_t);\
  699.     dev_t_proc_get_initial_matrix((*get_initial_matrix), dev_t);\
  700.     dev_t_proc_sync_output((*sync_output), dev_t);\
  701.     dev_t_proc_output_page((*output_page), dev_t);\
  702.     dev_t_proc_close_device((*close_device), dev_t);\
  703.     dev_t_proc_map_rgb_color((*map_rgb_color), dev_t);\
  704.     dev_t_proc_map_color_rgb((*map_color_rgb), dev_t);\
  705.     dev_t_proc_fill_rectangle((*fill_rectangle), dev_t);\
  706.     dev_t_proc_tile_rectangle((*tile_rectangle), dev_t);\
  707.     dev_t_proc_copy_mono((*copy_mono), dev_t);\
  708.     dev_t_proc_copy_color((*copy_color), dev_t);\
  709.     dev_t_proc_draw_line((*obsolete_draw_line), dev_t);\
  710.     dev_t_proc_get_bits((*get_bits), dev_t);\
  711.     dev_t_proc_get_params((*get_params), dev_t);\
  712.     dev_t_proc_put_params((*put_params), dev_t);\
  713.     dev_t_proc_map_cmyk_color((*map_cmyk_color), dev_t);\
  714.     dev_t_proc_get_xfont_procs((*get_xfont_procs), dev_t);\
  715.     dev_t_proc_get_xfont_device((*get_xfont_device), dev_t);\
  716.     dev_t_proc_map_rgb_alpha_color((*map_rgb_alpha_color), dev_t);\
  717.     dev_t_proc_get_page_device((*get_page_device), dev_t);\
  718.     dev_t_proc_get_alpha_bits((*get_alpha_bits), dev_t);\
  719.     dev_t_proc_copy_alpha((*copy_alpha), dev_t);\
  720.     dev_t_proc_get_band((*get_band), dev_t);\
  721.     dev_t_proc_copy_rop((*copy_rop), dev_t);\
  722.     dev_t_proc_fill_path((*fill_path), dev_t);\
  723.     dev_t_proc_stroke_path((*stroke_path), dev_t);\
  724.     dev_t_proc_fill_mask((*fill_mask), dev_t);\
  725.     dev_t_proc_fill_trapezoid((*fill_trapezoid), dev_t);\
  726.     dev_t_proc_fill_parallelogram((*fill_parallelogram), dev_t);\
  727.     dev_t_proc_fill_triangle((*fill_triangle), dev_t);\
  728.     dev_t_proc_draw_thin_line((*draw_thin_line), dev_t);\
  729.     dev_t_proc_begin_image((*begin_image), dev_t);\
  730.     dev_t_proc_image_data((*image_data), dev_t);\
  731.     dev_t_proc_end_image((*end_image), dev_t);\
  732.     dev_t_proc_strip_tile_rectangle((*strip_tile_rectangle), dev_t);\
  733.     dev_t_proc_strip_copy_rop((*strip_copy_rop), dev_t);\
  734.     dev_t_proc_get_clipping_box((*get_clipping_box), dev_t);\
  735.     dev_t_proc_begin_typed_image((*begin_typed_image), dev_t);\
  736.     dev_t_proc_get_bits_rectangle((*get_bits_rectangle), dev_t);\
  737.     dev_t_proc_map_color_rgb_alpha((*map_color_rgb_alpha), dev_t);\
  738.     dev_t_proc_create_compositor((*create_compositor), dev_t);\
  739.     dev_t_proc_get_hardware_params((*get_hardware_params), dev_t);\
  740.     dev_t_proc_text_begin((*text_begin), dev_t);\
  741.     dev_t_proc_finish_copydevice((*finish_copydevice), dev_t);\
  742. }
  743. /*
  744.  * Provide procedures for passing image data.  image_data and end_image
  745.  * are the equivalents of the obsolete driver procedures.  image_plane_data
  746.  * was originally planned as a driver procedure, but is now associated with
  747.  * the image enumerator, like the other two.
  748.  */
  749.  
  750. typedef struct gx_image_plane_s {
  751.     const byte *data;
  752.     int data_x;
  753.     uint raster;
  754. } gx_image_plane_t;
  755.  
  756. #define gx_device_begin_image(dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo)\
  757.   ((*dev_proc(dev, begin_image))\
  758.    (dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo))
  759. #define gx_device_begin_typed_image(dev, pis, pmat, pim, prect, pdcolor, pcpath, memory, pinfo)\
  760.   ((*dev_proc(dev, begin_typed_image))\
  761.    (dev, pis, pmat, pim, prect, pdcolor, pcpath, memory, pinfo))
  762.  
  763. /*
  764.  * The driver-like procedures gx_device_{image_data, image_plane_data,
  765.  * end_image} are now DEPRECATED and will eventually be removed.
  766.  * Their replacements no longer take an ignored dev argument.
  767.  */
  768. int gx_image_data(P5(gx_image_enum_common_t *info, const byte **planes,
  769.              int data_x, uint raster, int height));
  770. /*
  771.  * Solely for backward compatibility, gx_image_plane_data doesn't return
  772.  * rows_used.
  773.  */
  774. int gx_image_plane_data(P3(gx_image_enum_common_t *info,
  775.                const gx_image_plane_t *planes, int height));
  776. int gx_image_plane_data_rows(P4(gx_image_enum_common_t *info,
  777.                 const gx_image_plane_t *planes, int height,
  778.                 int *rows_used));
  779. int gx_image_flush(P1(gx_image_enum_common_t *info));
  780. bool gx_image_planes_wanted(P2(const gx_image_enum_common_t *info, byte *wanted));
  781. int gx_image_end(P2(gx_image_enum_common_t *info, bool draw_last));
  782.  
  783. #define gx_device_image_data(dev, info, planes, data_x, raster, height)\
  784.   gx_image_data(info, planes, data_x, raster, height)
  785. #define gx_device_image_plane_data(dev, info, planes, height)\
  786.   gx_image_plane_data(info, planes, height)
  787. #define gx_device_end_image(dev, info, draw_last)\
  788.   gx_image_end(info, draw_last)
  789.  
  790. /*
  791.  * Get the anti-aliasing parameters for a device.  This replaces the
  792.  * obsolete get_alpha_bits device procedure.
  793.  */
  794. #define gx_device_get_alpha_bits(dev, type)\
  795.   gx_default_get_alpha_bits(dev, type)
  796.  
  797. /* A generic device procedure record. */
  798. struct gx_device_procs_s gx_device_proc_struct(gx_device);
  799.  
  800. /*
  801.  * Define unaligned analogues of the copy_xxx procedures.
  802.  * These are slower than the standard procedures, which require
  803.  * aligned bitmaps, and also are not portable to non-byte-addressed machines.
  804.  *
  805.  * We allow both unaligned data and unaligned scan line widths;
  806.  * however, we do require that both of these be aligned modulo the largest
  807.  * power of 2 bytes that divides the data depth, i.e.:
  808.  *      depth   alignment
  809.  *      <= 8    1
  810.  *      16      2
  811.  *      24      1
  812.  *      32      4
  813.  */
  814. dev_proc_copy_mono(gx_copy_mono_unaligned);
  815. dev_proc_copy_color(gx_copy_color_unaligned);
  816. dev_proc_copy_alpha(gx_copy_alpha_unaligned);
  817.  
  818. /* A generic device */
  819. struct gx_device_s {
  820.     gx_device_common;
  821. };
  822.  
  823. extern_st(st_device);
  824. struct_proc_finalize(gx_device_finalize);    /* public for subclasses */
  825. /* We use vacuous enum/reloc procedures, rather than 0, so that */
  826. /* gx_device can have subclasses. */
  827. #define public_st_device()    /* in gsdevice.c */\
  828.   gs_public_st_complex_only(st_device, gx_device, "gx_device",\
  829.     0, gs_no_struct_enum_ptrs, gs_no_struct_reloc_ptrs, gx_device_finalize)
  830. #define st_device_max_ptrs 0
  831.  
  832. /* Enumerate or relocate a pointer to a device. */
  833. /* These take the containing space into account properly. */
  834. gx_device *gx_device_enum_ptr(P1(gx_device *));
  835. gx_device *gx_device_reloc_ptr(P2(gx_device *, gc_state_t *));
  836.  
  837. /* Define typedefs for some of the device procedures, because */
  838. /* ansi2knr can't handle dev_proc_xxx((*xxx)) in a formal argument list. */
  839. typedef dev_proc_map_rgb_color((*dev_proc_map_rgb_color_t));
  840. typedef dev_proc_map_color_rgb((*dev_proc_map_color_rgb_t));
  841.  
  842. /*
  843.  * A forwarding device forwards all non-display operations, and possibly
  844.  * some imaging operations (possibly transformed in some way), to another
  845.  * device called the "target".  This is used for many different purposes
  846.  * internally, including clipping, banding, image and pattern accumulation,
  847.  * compositing, halftoning, and the null device.
  848.  */
  849. #define gx_device_forward_common\
  850.     gx_device_common;\
  851.     gx_device *target
  852. /* A generic forwarding device. */
  853. typedef struct gx_device_forward_s {
  854.     gx_device_forward_common;
  855. } gx_device_forward;
  856.  
  857. extern_st(st_device_forward);
  858. #define public_st_device_forward()    /* in gsdevice.c */\
  859.   gs_public_st_complex_only(st_device_forward, gx_device_forward,\
  860.     "gx_device_forward", 0, device_forward_enum_ptrs,\
  861.     device_forward_reloc_ptrs, gx_device_finalize)
  862. #define st_device_forward_max_ptrs (st_device_max_ptrs + 1)
  863.  
  864. /* A null device.  This is used to temporarily disable output. */
  865. #ifndef gx_device_null_DEFINED
  866. #  define gx_device_null_DEFINED
  867. typedef struct gx_device_null_s gx_device_null;
  868. #endif
  869. struct gx_device_null_s {
  870.     gx_device_forward_common;
  871. };
  872. extern const gx_device_null gs_null_device;
  873.  
  874. #define gx_device_is_null(dev)\
  875.   ((dev)->dname == gs_null_device.dname)
  876. extern_st(st_device_null);
  877. #define public_st_device_null()    /* in gsdevice.c */\
  878.   gs_public_st_complex_only(st_device_null, gx_device_null,\
  879.     "gx_device_null", 0, device_forward_enum_ptrs,\
  880.     device_forward_reloc_ptrs, gx_device_finalize)
  881. #define st_device_null_max_ptrs st_device_forward_max_ptrs
  882.  
  883. /*
  884.  * Initialize a just-allocated device from a prototype.  If internal =
  885.  * false, the device is marked retained; if internal = true, the device is
  886.  * not marked retained.  See the beginning of this file for more information
  887.  * about what this means.  Normally, devices created for temporary use have
  888.  * internal = true (retained = false).
  889.  */
  890. void gx_device_init(P4(gx_device * dev, const gx_device * proto,
  891.                gs_memory_t * mem, bool internal));
  892.  
  893. /* Make a null device. */
  894. /* The gs_memory_t argument is 0 if the device is temporary and local, */
  895. /* or the allocator that was used to allocate it if it is a real object. */
  896. void gs_make_null_device(P3(gx_device_null *dev_null, gx_device *target,
  897.                 gs_memory_t *mem));
  898.  
  899. /* Set the target of a (forwarding) device. */
  900. void gx_device_set_target(P2(gx_device_forward *fdev, gx_device *target));
  901.  
  902. /* Mark a device as retained or not retained. */
  903. void gx_device_retain(P2(gx_device *dev, bool retained));
  904.  
  905. /* Calculate the raster (number of bytes in a scan line), */
  906. /* with byte or word padding. */
  907. uint gx_device_raster(P2(const gx_device * dev, bool pad_to_word));
  908.  
  909. /* Adjust the resolution for devices that only have a fixed set of */
  910. /* geometries, so that the apparent size in inches remains constant. */
  911. /* If fit=1, the resolution is adjusted so that the entire image fits; */
  912. /* if fit=0, one dimension fits, but the other one is clipped. */
  913. int gx_device_adjust_resolution(P4(gx_device * dev, int actual_width, int actual_height, int fit));
  914.  
  915. /* Set the HWMargins to values defined in inches. */
  916. /* If move_origin is true, also reset the Margins. */
  917. void gx_device_set_margins(P3(gx_device * dev, const float *margins /*[4] */ ,
  918.                   bool move_origin));
  919.  
  920. /* Set the width and height (in pixels), updating MediaSize. */
  921. void gx_device_set_width_height(P3(gx_device * dev, int width, int height));
  922.  
  923. /* Set the resolution (in pixels per inch), updating width and height. */
  924. void gx_device_set_resolution(P3(gx_device * dev, floatp x_dpi, floatp y_dpi));
  925.  
  926. /* Set the MediaSize (in 1/72" units), updating width and height. */
  927. void gx_device_set_media_size(P3(gx_device * dev, floatp media_width, floatp media_height));
  928.  
  929. /****** BACKWARD COMPATIBILITY ******/
  930. #define gx_device_set_page_size(dev, w, h)\
  931.   gx_device_set_media_size(dev, w, h)
  932.  
  933. /*
  934.  * Temporarily install a null device, or a special device such as
  935.  * a clipping or cache device.
  936.  */
  937. void gx_set_device_only(P2(gs_state *, gx_device *));
  938.  
  939. /* Close a device. */
  940. int gs_closedevice(P1(gx_device *));
  941.  
  942. /* "Free" a device locally allocated on the stack, by finalizing it. */
  943. void gx_device_free_local(P1(gx_device *));
  944.  
  945. /* ------ Device types (an unused concept right now) ------ */
  946.  
  947. #define dev_type_proc_initialize(proc)\
  948.   int proc(P1(gx_device *))
  949.  
  950. typedef struct gx_device_type_s {
  951.     gs_memory_type_ptr_t stype;
  952.                          dev_type_proc_initialize((*initialize));
  953. } gx_device_type;
  954.  
  955. #define device_type(dtname, stype, initproc)\
  956. private dev_type_proc_initialize(initproc);\
  957. const gx_device_type dtname = { &stype, initproc }
  958.  
  959. /*dev_type_proc_initialize(gdev_initialize); */
  960.  
  961. #endif /* gxdevcli_INCLUDED */
  962.