Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/ghostscr...
File: gdevdsp.h
/* Copyright (C) 2001-2019 Artifex Software, Inc.
[0] Fix | Delete
All Rights Reserved.
[1] Fix | Delete
[2] Fix | Delete
This software is provided AS-IS with no warranty, either express or
[3] Fix | Delete
implied.
[4] Fix | Delete
[5] Fix | Delete
This software is distributed under license and may not be copied,
[6] Fix | Delete
modified or distributed except as expressly authorized under the terms
[7] Fix | Delete
of the license contained in the file LICENSE in this distribution.
[8] Fix | Delete
[9] Fix | Delete
Refer to licensing information at http://www.artifex.com or contact
[10] Fix | Delete
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
[11] Fix | Delete
CA 94945, U.S.A., +1(415)492-9861, for further information.
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
/* gdevdsp.h - callback structure for DLL based display device */
[15] Fix | Delete
[16] Fix | Delete
#ifndef gdevdsp_INCLUDED
[17] Fix | Delete
# define gdevdsp_INCLUDED
[18] Fix | Delete
[19] Fix | Delete
/*
[20] Fix | Delete
* The callback structure must be provided by calling the
[21] Fix | Delete
* Ghostscript APIs in the following order:
[22] Fix | Delete
* gsapi_new_instance(&minst);
[23] Fix | Delete
* gsapi_set_display_callback(minst, callback);
[24] Fix | Delete
* gsapi_init_with_args(minst, argc, argv);
[25] Fix | Delete
*
[26] Fix | Delete
* Supported parameters and default values are:
[27] Fix | Delete
* -sDisplayHandle=16#04d2 or 1234 string
[28] Fix | Delete
* Caller supplied handle as a decimal or hexadecimal number
[29] Fix | Delete
* in a string. On 32-bit platforms, it may be set
[30] Fix | Delete
* using -dDisplayHandle=1234 for backward compatibility.
[31] Fix | Delete
* Included as first parameter of all callback functions.
[32] Fix | Delete
*
[33] Fix | Delete
* -dDisplayFormat=0 long
[34] Fix | Delete
* Color format specified using bitfields below.
[35] Fix | Delete
* Included as argument of display_size() and display_presize()
[36] Fix | Delete
* These can only be changed when the device is closed.
[37] Fix | Delete
*
[38] Fix | Delete
* The second parameter of all callback functions "void *device"
[39] Fix | Delete
* is the address of the Ghostscript display device instance.
[40] Fix | Delete
* The arguments "void *handle" and "void *device" together
[41] Fix | Delete
* uniquely identify an instance of the display device.
[42] Fix | Delete
*
[43] Fix | Delete
* A typical sequence of callbacks would be
[44] Fix | Delete
* open, presize, memalloc, size, sync, page
[45] Fix | Delete
* presize, memfree, memalloc, size, sync, page
[46] Fix | Delete
* preclose, memfree, close
[47] Fix | Delete
* The caller should not access the image buffer:
[48] Fix | Delete
* - before the first sync
[49] Fix | Delete
* - between presize and size
[50] Fix | Delete
* - after preclose
[51] Fix | Delete
* If opening the device fails, you might see the following:
[52] Fix | Delete
* open, presize, memalloc, memfree, close
[53] Fix | Delete
*
[54] Fix | Delete
*/
[55] Fix | Delete
[56] Fix | Delete
#define DISPLAY_VERSION_MAJOR 2
[57] Fix | Delete
#define DISPLAY_VERSION_MINOR 0
[58] Fix | Delete
[59] Fix | Delete
#define DISPLAY_VERSION_MAJOR_V1 1 /* before separation format was added */
[60] Fix | Delete
#define DISPLAY_VERSION_MINOR_V1 0
[61] Fix | Delete
[62] Fix | Delete
/* The display format is set by a combination of the following bitfields */
[63] Fix | Delete
[64] Fix | Delete
/* Define the color space alternatives */
[65] Fix | Delete
typedef enum {
[66] Fix | Delete
DISPLAY_COLORS_NATIVE = (1<<0),
[67] Fix | Delete
DISPLAY_COLORS_GRAY = (1<<1),
[68] Fix | Delete
DISPLAY_COLORS_RGB = (1<<2),
[69] Fix | Delete
DISPLAY_COLORS_CMYK = (1<<3),
[70] Fix | Delete
DISPLAY_COLORS_SEPARATION = (1<<19)
[71] Fix | Delete
} DISPLAY_FORMAT_COLOR;
[72] Fix | Delete
#define DISPLAY_COLORS_MASK 0x8000fL
[73] Fix | Delete
[74] Fix | Delete
/* Define whether alpha information, or an extra unused bytes is included */
[75] Fix | Delete
/* DISPLAY_ALPHA_FIRST and DISPLAY_ALPHA_LAST are not implemented */
[76] Fix | Delete
typedef enum {
[77] Fix | Delete
DISPLAY_ALPHA_NONE = (0<<4),
[78] Fix | Delete
DISPLAY_ALPHA_FIRST = (1<<4),
[79] Fix | Delete
DISPLAY_ALPHA_LAST = (1<<5),
[80] Fix | Delete
DISPLAY_UNUSED_FIRST = (1<<6), /* e.g. Mac xRGB */
[81] Fix | Delete
DISPLAY_UNUSED_LAST = (1<<7) /* e.g. Windows BGRx */
[82] Fix | Delete
} DISPLAY_FORMAT_ALPHA;
[83] Fix | Delete
#define DISPLAY_ALPHA_MASK 0x00f0L
[84] Fix | Delete
[85] Fix | Delete
/* Define the depth per component for DISPLAY_COLORS_GRAY,
[86] Fix | Delete
* DISPLAY_COLORS_RGB and DISPLAY_COLORS_CMYK,
[87] Fix | Delete
* or the depth per pixel for DISPLAY_COLORS_NATIVE
[88] Fix | Delete
* DISPLAY_DEPTH_2 and DISPLAY_DEPTH_12 have not been tested.
[89] Fix | Delete
*/
[90] Fix | Delete
typedef enum {
[91] Fix | Delete
DISPLAY_DEPTH_1 = (1<<8),
[92] Fix | Delete
DISPLAY_DEPTH_2 = (1<<9),
[93] Fix | Delete
DISPLAY_DEPTH_4 = (1<<10),
[94] Fix | Delete
DISPLAY_DEPTH_8 = (1<<11),
[95] Fix | Delete
DISPLAY_DEPTH_12 = (1<<12),
[96] Fix | Delete
DISPLAY_DEPTH_16 = (1<<13)
[97] Fix | Delete
/* unused (1<<14) */
[98] Fix | Delete
/* unused (1<<15) */
[99] Fix | Delete
} DISPLAY_FORMAT_DEPTH;
[100] Fix | Delete
#define DISPLAY_DEPTH_MASK 0xff00L
[101] Fix | Delete
[102] Fix | Delete
/* Define whether Red/Cyan should come first,
[103] Fix | Delete
* or whether Blue/Black should come first
[104] Fix | Delete
*/
[105] Fix | Delete
typedef enum {
[106] Fix | Delete
DISPLAY_BIGENDIAN = (0<<16), /* Red/Cyan first */
[107] Fix | Delete
DISPLAY_LITTLEENDIAN = (1<<16) /* Blue/Black first */
[108] Fix | Delete
} DISPLAY_FORMAT_ENDIAN;
[109] Fix | Delete
#define DISPLAY_ENDIAN_MASK 0x00010000L
[110] Fix | Delete
[111] Fix | Delete
/* Define whether the raster starts at the top or bottom of the bitmap */
[112] Fix | Delete
typedef enum {
[113] Fix | Delete
DISPLAY_TOPFIRST = (0<<17), /* Unix, Mac */
[114] Fix | Delete
DISPLAY_BOTTOMFIRST = (1<<17) /* Windows */
[115] Fix | Delete
} DISPLAY_FORMAT_FIRSTROW;
[116] Fix | Delete
#define DISPLAY_FIRSTROW_MASK 0x00020000L
[117] Fix | Delete
[118] Fix | Delete
/* Define whether packing RGB in 16-bits should use 555
[119] Fix | Delete
* or 565 (extra bit for green)
[120] Fix | Delete
*/
[121] Fix | Delete
typedef enum {
[122] Fix | Delete
DISPLAY_NATIVE_555 = (0<<18),
[123] Fix | Delete
DISPLAY_NATIVE_565 = (1<<18)
[124] Fix | Delete
} DISPLAY_FORMAT_555;
[125] Fix | Delete
#define DISPLAY_555_MASK 0x00040000L
[126] Fix | Delete
[127] Fix | Delete
/* Define the row alignment, which must be equal to or greater than
[128] Fix | Delete
* the size of a pointer.
[129] Fix | Delete
* The default (DISPLAY_ROW_ALIGN_DEFAULT) is the size of a pointer,
[130] Fix | Delete
* 4 bytes (DISPLAY_ROW_ALIGN_4) on 32-bit systems or 8 bytes
[131] Fix | Delete
* (DISPLAY_ROW_ALIGN_8) on 64-bit systems.
[132] Fix | Delete
*/
[133] Fix | Delete
typedef enum {
[134] Fix | Delete
DISPLAY_ROW_ALIGN_DEFAULT = (0<<20),
[135] Fix | Delete
/* DISPLAY_ROW_ALIGN_1 = (1<<20), */ /* not currently possible */
[136] Fix | Delete
/* DISPLAY_ROW_ALIGN_2 = (2<<20), */ /* not currently possible */
[137] Fix | Delete
DISPLAY_ROW_ALIGN_4 = (3<<20),
[138] Fix | Delete
DISPLAY_ROW_ALIGN_8 = (4<<20),
[139] Fix | Delete
DISPLAY_ROW_ALIGN_16 = (5<<20),
[140] Fix | Delete
DISPLAY_ROW_ALIGN_32 = (6<<20),
[141] Fix | Delete
DISPLAY_ROW_ALIGN_64 = (7<<20)
[142] Fix | Delete
} DISPLAY_FORMAT_ROW_ALIGN;
[143] Fix | Delete
#define DISPLAY_ROW_ALIGN_MASK 0x00700000L
[144] Fix | Delete
[145] Fix | Delete
#ifndef display_callback_DEFINED
[146] Fix | Delete
#define display_callback_DEFINED
[147] Fix | Delete
typedef struct display_callback_s display_callback;
[148] Fix | Delete
#endif
[149] Fix | Delete
[150] Fix | Delete
/*
[151] Fix | Delete
* Note that for Windows, the display callback functions are
[152] Fix | Delete
* cdecl, not stdcall. This differs from those in iapi.h.
[153] Fix | Delete
*/
[154] Fix | Delete
[155] Fix | Delete
struct display_callback_s {
[156] Fix | Delete
/* Size of this structure */
[157] Fix | Delete
/* Used for checking if we have been handed a valid structure */
[158] Fix | Delete
int size;
[159] Fix | Delete
[160] Fix | Delete
/* Major version of this structure */
[161] Fix | Delete
/* The major version number will change if this structure changes. */
[162] Fix | Delete
int version_major;
[163] Fix | Delete
[164] Fix | Delete
/* Minor version of this structure */
[165] Fix | Delete
/* The minor version number will change if new features are added
[166] Fix | Delete
* without changes to this structure. For example, a new color
[167] Fix | Delete
* format.
[168] Fix | Delete
*/
[169] Fix | Delete
int version_minor;
[170] Fix | Delete
[171] Fix | Delete
/* New device has been opened */
[172] Fix | Delete
/* This is the first event from this device. */
[173] Fix | Delete
int (*display_open)(void *handle, void *device);
[174] Fix | Delete
[175] Fix | Delete
/* Device is about to be closed. */
[176] Fix | Delete
/* Device will not be closed until this function returns. */
[177] Fix | Delete
int (*display_preclose)(void *handle, void *device);
[178] Fix | Delete
[179] Fix | Delete
/* Device has been closed. */
[180] Fix | Delete
/* This is the last event from this device. */
[181] Fix | Delete
int (*display_close)(void *handle, void *device);
[182] Fix | Delete
[183] Fix | Delete
/* Device is about to be resized. */
[184] Fix | Delete
/* Resize will only occur if this function returns 0. */
[185] Fix | Delete
/* raster is byte count of a row. */
[186] Fix | Delete
int (*display_presize)(void *handle, void *device,
[187] Fix | Delete
int width, int height, int raster, unsigned int format);
[188] Fix | Delete
[189] Fix | Delete
/* Device has been resized. */
[190] Fix | Delete
/* New pointer to raster returned in pimage */
[191] Fix | Delete
int (*display_size)(void *handle, void *device, int width, int height,
[192] Fix | Delete
int raster, unsigned int format, unsigned char *pimage);
[193] Fix | Delete
[194] Fix | Delete
/* flushpage */
[195] Fix | Delete
int (*display_sync)(void *handle, void *device);
[196] Fix | Delete
[197] Fix | Delete
/* showpage */
[198] Fix | Delete
/* If you want to pause on showpage, then don't return immediately */
[199] Fix | Delete
int (*display_page)(void *handle, void *device, int copies, int flush);
[200] Fix | Delete
[201] Fix | Delete
/* Notify the caller whenever a portion of the raster is updated. */
[202] Fix | Delete
/* This can be used for cooperative multitasking or for
[203] Fix | Delete
* progressive update of the display.
[204] Fix | Delete
* This function pointer may be set to NULL if not required.
[205] Fix | Delete
*/
[206] Fix | Delete
int (*display_update)(void *handle, void *device, int x, int y,
[207] Fix | Delete
int w, int h);
[208] Fix | Delete
[209] Fix | Delete
/* Allocate memory for bitmap */
[210] Fix | Delete
/* This is provided in case you need to create memory in a special
[211] Fix | Delete
* way, e.g. shared. If this is NULL, the Ghostscript memory device
[212] Fix | Delete
* allocates the bitmap. This will only called to allocate the
[213] Fix | Delete
* image buffer. The first row will be placed at the address
[214] Fix | Delete
* returned by display_memalloc.
[215] Fix | Delete
*/
[216] Fix | Delete
void *(*display_memalloc)(void *handle, void *device, unsigned long size);
[217] Fix | Delete
[218] Fix | Delete
/* Free memory for bitmap */
[219] Fix | Delete
/* If this is NULL, the Ghostscript memory device will free the bitmap */
[220] Fix | Delete
int (*display_memfree)(void *handle, void *device, void *mem);
[221] Fix | Delete
[222] Fix | Delete
/* Added in V2 */
[223] Fix | Delete
/* When using separation color space (DISPLAY_COLORS_SEPARATION),
[224] Fix | Delete
* give a mapping for one separation component.
[225] Fix | Delete
* This is called for each new component found.
[226] Fix | Delete
* It may be called multiple times for each component.
[227] Fix | Delete
* It may be called at any time between display_size
[228] Fix | Delete
* and display_close.
[229] Fix | Delete
* The client uses this to map from the separations to CMYK
[230] Fix | Delete
* and hence to RGB for display.
[231] Fix | Delete
* GS must only use this callback if version_major >= 2.
[232] Fix | Delete
* The unsigned short c,m,y,k values are 65535 = 1.0.
[233] Fix | Delete
* This function pointer may be set to NULL if not required.
[234] Fix | Delete
*/
[235] Fix | Delete
int (*display_separation)(void *handle, void *device,
[236] Fix | Delete
int component, const char *component_name,
[237] Fix | Delete
unsigned short c, unsigned short m,
[238] Fix | Delete
unsigned short y, unsigned short k);
[239] Fix | Delete
};
[240] Fix | Delete
[241] Fix | Delete
/* This is the V1 structure, before separation format was added */
[242] Fix | Delete
struct display_callback_v1_s {
[243] Fix | Delete
int size;
[244] Fix | Delete
int version_major;
[245] Fix | Delete
int version_minor;
[246] Fix | Delete
int (*display_open)(void *handle, void *device);
[247] Fix | Delete
int (*display_preclose)(void *handle, void *device);
[248] Fix | Delete
int (*display_close)(void *handle, void *device);
[249] Fix | Delete
int (*display_presize)(void *handle, void *device,
[250] Fix | Delete
int width, int height, int raster, unsigned int format);
[251] Fix | Delete
int (*display_size)(void *handle, void *device, int width, int height,
[252] Fix | Delete
int raster, unsigned int format, unsigned char *pimage);
[253] Fix | Delete
int (*display_sync)(void *handle, void *device);
[254] Fix | Delete
int (*display_page)(void *handle, void *device, int copies, int flush);
[255] Fix | Delete
int (*display_update)(void *handle, void *device, int x, int y,
[256] Fix | Delete
int w, int h);
[257] Fix | Delete
void *(*display_memalloc)(void *handle, void *device, unsigned long size);
[258] Fix | Delete
int (*display_memfree)(void *handle, void *device, void *mem);
[259] Fix | Delete
};
[260] Fix | Delete
[261] Fix | Delete
#define DISPLAY_CALLBACK_V1_SIZEOF sizeof(struct display_callback_v1_s)
[262] Fix | Delete
[263] Fix | Delete
#endif /* gdevdsp_INCLUDED */
[264] Fix | Delete
[265] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function