summaryrefslogtreecommitdiff
path: root/base/gslibctx.h
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-06-04 19:27:15 +0100
committerRobin Watts <Robin.Watts@artifex.com>2020-06-25 00:19:12 +0100
commit4438e3e5bc4dfc9e46fc86d86d912171ec582a4e (patch)
treec2cbc61774320346337f2311876f4bc9de46d011 /base/gslibctx.h
parent7e427246abb151cde9154783775acfaa776b502e (diff)
downloadghostpdl-4438e3e5bc4dfc9e46fc86d86d912171ec582a4e.tar.gz
Rework display device "DisplayHandle" passing.
Add gsapi_{,de}register_callout API. This allows integrators to register handlers for "callouts" from gs devices. The first example of such a callout is the display device. Previously, this has relied on the gsapi_set_display_callback API to pass a pointer to a structure into the core, from where it was hackily poked into the display device structure. Instead, we now have the display device "callout" to registered handlers to get the structure and the handle to use. The legacy API is maintained by the API level implementing a handler to return the display callback in response to the devices callout. The code to do the 'poking' of the display device has therefore been removed, and replaced by code that checks to see if an opened device needs reopening after init, if so, opens/closes it.
Diffstat (limited to 'base/gslibctx.h')
-rw-r--r--base/gslibctx.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/base/gslibctx.h b/base/gslibctx.h
index f6ce40a32..173d2dc2a 100644
--- a/base/gslibctx.h
+++ b/base/gslibctx.h
@@ -81,6 +81,14 @@ typedef struct gs_fs_list_s {
struct gs_fs_list_s *next;
} gs_fs_list_t;
+typedef int (*gs_callout_fn)(void *, void *, const char *, int, int, void *);
+
+typedef struct gs_callout_list_s {
+ struct gs_callout_list_s *next;
+ gs_callout_fn callout;
+ void *handle;
+} gs_callout_list_t;
+
typedef struct {
void *monitor;
int refs;
@@ -118,6 +126,8 @@ typedef struct {
* all builds. */
void *cal_ctx;
+ gs_callout_list_t *callouts;
+
/* Stashed args */
int arg_max;
int argc;
@@ -194,6 +204,12 @@ void *gs_lib_ctx_get_cms_context( const gs_memory_t *mem );
void gs_lib_ctx_set_cms_context( const gs_memory_t *mem, void *cms_context );
int gs_lib_ctx_get_act_on_uel( const gs_memory_t *mem );
+int gs_lib_ctx_register_callout(gs_memory_t *mem, gs_callout_fn, void *arg);
+void gs_lib_ctx_deregister_callout(gs_memory_t *mem, gs_callout_fn, void *arg);
+int gs_lib_ctx_callout(gs_memory_t *mem, const char *dev_name,
+ int id, int size, void *data);
+
+
#ifndef GS_THREADSAFE
/* HACK to get at non garbage collection memory pointer
*