aboutsummaryrefslogtreecommitdiffstats
path: root/CNativeCode/jawt_misc.h
blob: 9befce9d5313b7814b2140cb3c74bca0cda26663 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#ifndef _JAWT_MISC_H
#define _JAWT_MISC_H

	#include "OpenGL_misc.h"

	#include <jawt_md.h>
	#include <assert.h>

	typedef struct {
		  JAWT_DrawingSurface* ds;
		  JAWT_DrawingSurfaceInfo* dsi;

		  /**
		   * just the java native window handle,
		   * valid, if ds is locked !
		   * but this is just an old copy ..
		   * updated via jawt_lock !
		   */
		  void * dsi_os; 

		  /**
		   * This is, if dsi_win_created != 0,
		   * the:
		   *	- the own created child window, or
		   *    - the GLXPixmap of the offscreenRendering data
		   *
		   * 	This ressource is created manually,
		   * 	so it must be destroyed manually either !
		   *
		   * Otherwise (dsi_win_created==0), 
		   * this is just the backup
		   * of the dsi_os->drawable, of the last lock !
		   */
		  void * dsi_win;
		  int    dsi_win_created;

		  /**
		   * This is, if dsi_display_created != 0,
		   * the:
		   *	- the own fetched display (XopenDisplay)
		   *
		   * 	This ressource is fetched manually !
		   *
		   * Otherwise (dsi_display_created==0), 
		   * this is just the backup
		   * of the dsi_os->display, of the last lock !
		   */
		  void * dsi_display;
		  int    dsi_display_created;

		  jint lock;

		  /* this JAWTDataHolder is a NOT a holder for a true JAWT
		   * component, it is used for an offScreen drawable !
		   */
		  jint offScreen;

		  jboolean result;
	} JAWTDataHolder;
	 
	LIBAPI jboolean LIBAPIENTRY
	jawt_create_offscreen (JNIEnv *env, JAWTDataHolder **ppJData, 
			       jboolean verbose); 

	LIBAPI jboolean LIBAPIENTRY
	jawt_create_open (JNIEnv *env, jobject component, JAWTDataHolder **ppJData, jboolean verbose);

	LIBAPI jboolean LIBAPIENTRY 
	jawt_free_close_unlock (JNIEnv *env, JAWTDataHolder **ppJData, jboolean verbose);

	LIBAPI jboolean LIBAPIENTRY 
	jawt_open (JNIEnv *env, jobject component, JAWTDataHolder *pJData, jboolean verbose);

	LIBAPI jboolean LIBAPIENTRY 
	jawt_close_unlock (JNIEnv *env, JAWTDataHolder *pJData, jboolean verbose);

	LIBAPI jboolean LIBAPIENTRY 
	jawt_lock (JNIEnv *env, JAWTDataHolder *pJData, jboolean ignoreSurfaceChanged, 
	           jboolean verbose);

	LIBAPI jboolean LIBAPIENTRY 
	jawt_unlock (JNIEnv *env, JAWTDataHolder *pJData, jboolean verbose);
#endif