File: callbacks.h

package info (click to toggle)
ghostscript 10.0.0~dfsg-11%2Bdeb12u7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 98,252 kB
  • sloc: ansic: 891,828; python: 7,649; cpp: 6,493; cs: 6,209; sh: 6,043; java: 4,028; perl: 2,372; tcl: 1,639; makefile: 521; awk: 66; javascript: 43; yacc: 18
file content (56 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once

#include <jni.h>

#include "instance_data.h"

namespace callbacks
{
	/*!
	Sets the JNIEnv which the callbacks should use. Must be set for any Java
	callbacks to be called.

	@param env A JNIEnv.
	*/
	void setJNIEnv(GSInstanceData *idata, JNIEnv *env);

	void setIOCallbacks(GSInstanceData *idata, jobject stdIn, jobject stdOut, jobject stdErr);
	int stdInFunction(void *callerHandle, char *buf, int len);
	int stdOutFunction(void *callerHandle, const char *str, int len);
	int stdErrFunction(void *callerHandle, const char *str, int len);

	void setPollCallback(GSInstanceData *idata, jobject poll);
	int pollFunction(void *callerHandle);

	void setDisplayCallback(GSInstanceData *idata, jobject displayCallback);

	namespace display
	{
		int displayOpenFunction(void *handle, void *device);
		int displayPrecloseFunction(void *handle, void *device);
		int displayCloseFunction(void *handle, void *device);
		int displayPresizeFunction(void *handle, void *device, int width,
			int height, int raster, unsigned int format);
		int displaySizeFunction(void *handle, void *device, int width,
			int height, int raster, unsigned int format,
			unsigned char *pimage);
		int displaySyncFunction(void *handle, void *device);
		int displayPageFunction(void *handle, void *device, int copies,
			int flush);
		int displayUpdateFunction(void *handle, void *device, int x,
			int y, int w, int h);
		// display_memalloc omitted
		// display_memfree omitted
		int displaySeparationFunction(void *handle, void *device,
			int component, const char *componentName, unsigned short c,
			unsigned short m, unsigned short y, unsigned short k);
		int displayAdjustBandHeightFunction(void *handle, void *device,
			int bandHeight);
		int displayRectangleRequestFunction(void *handle, void *device,
			void **memory, int *ox, int *oy, int *raster, int *plane_raster,
			int *x, int *y, int *w, int *h);
	}

	void setCalloutCallback(GSInstanceData *idata, jobject callout);
	int calloutFunction(void *instance, void *handle, const char *deviceName, int id, int size, void *data);
}