61 |
jmethodID postTextEventID; |
jmethodID postTextEventID; |
62 |
jmethodID postWindowEventID; |
jmethodID postWindowEventID; |
63 |
|
|
64 |
|
jmethodID beginNativeRepaintID; |
65 |
|
jmethodID endNativeRepaintID; |
66 |
|
|
67 |
|
jmethodID initComponentGraphicsID; |
68 |
|
jmethodID initComponentGraphics2DID; |
69 |
|
jmethodID setCursorID; |
70 |
|
|
71 |
JNIEnv *gdk_env; |
JNIEnv *gdk_env; |
72 |
|
|
73 |
GtkWindowGroup *global_gtk_window_group; |
GtkWindowGroup *global_gtk_window_group; |
76 |
|
|
77 |
double dpi_conversion_factor; |
double dpi_conversion_factor; |
78 |
|
|
79 |
static void init_dpi_conversion_factor (); |
static void init_dpi_conversion_factor (void); |
80 |
static void dpi_changed_cb (GtkSettings *settings, |
static void dpi_changed_cb (GtkSettings *settings, |
81 |
GParamSpec *pspec); |
GParamSpec *pspec); |
82 |
|
|
98 |
int argc = 1; |
int argc = 1; |
99 |
char **argv; |
char **argv; |
100 |
char *homedir, *rcpath = NULL; |
char *homedir, *rcpath = NULL; |
|
/* jclass gtkgenericpeer; */ |
|
101 |
jclass gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer, |
jclass gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer, |
102 |
gtkmenuitempeer, gtktextcomponentpeer, window; |
gtkmenuitempeer, gtktextcomponentpeer, window, gdkgraphics, gdkgraphics2d; |
103 |
|
|
104 |
NSA_INIT (env, clazz); |
NSA_INIT (env, clazz); |
105 |
gdk_env = env; |
gdk_env = env; |
147 |
g_free (argv); |
g_free (argv); |
148 |
|
|
149 |
/* setup cached IDs for posting GTK events to Java */ |
/* setup cached IDs for posting GTK events to Java */ |
|
/* gtkgenericpeer = (*env)->FindClass (env, */ |
|
|
/* "gnu/java/awt/peer/gtk/GtkGenericPeer"); */ |
|
150 |
|
|
151 |
window = (*env)->FindClass (env, "java/awt/Window"); |
window = (*env)->FindClass (env, "java/awt/Window"); |
152 |
|
|
163 |
"gnu/java/awt/peer/gtk/GtkMenuItemPeer"); |
"gnu/java/awt/peer/gtk/GtkMenuItemPeer"); |
164 |
gtktextcomponentpeer = (*env)->FindClass (env, |
gtktextcomponentpeer = (*env)->FindClass (env, |
165 |
"gnu/java/awt/peer/gtk/GtkTextComponentPeer"); |
"gnu/java/awt/peer/gtk/GtkTextComponentPeer"); |
166 |
/* gdkColor = (*env)->FindClass (env, */ |
gdkgraphics = (*env)->FindClass (env, |
167 |
/* "gnu/java/awt/peer/gtk/GdkColor"); */ |
"gnu/java/awt/peer/gtk/GdkGraphics"); |
168 |
/* gdkColorID = (*env)->GetMethodID (env, gdkColor, "<init>", "(III)V"); */ |
gdkgraphics2d = (*env)->FindClass (env, |
169 |
/* postActionEventID = (*env)->GetMethodID (env, gtkgenericpeer, */ |
"gnu/java/awt/peer/gtk/GdkGraphics2D"); |
|
/* "postActionEvent", */ |
|
|
/* "(Ljava/lang/String;I)V"); */ |
|
|
|
|
170 |
setBoundsCallbackID = (*env)->GetMethodID (env, window, |
setBoundsCallbackID = (*env)->GetMethodID (env, window, |
171 |
"setBoundsCallback", |
"setBoundsCallback", |
172 |
"(IIII)V"); |
"(IIII)V"); |
176 |
"()V"); |
"()V"); |
177 |
postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer, |
postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer, |
178 |
"postMouseEvent", "(IJIIIIZ)V"); |
"postMouseEvent", "(IJIIIIZ)V"); |
179 |
|
setCursorID = (*env)->GetMethodID (env, gtkcomponentpeer, |
180 |
|
"setCursor", "()V"); |
181 |
|
beginNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer, |
182 |
|
"beginNativeRepaint", "()V"); |
183 |
|
|
184 |
|
endNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer, |
185 |
|
"endNativeRepaint", "()V"); |
186 |
|
|
187 |
postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer, |
postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer, |
188 |
"postConfigureEvent", "(IIII)V"); |
"postConfigureEvent", "(IIII)V"); |
189 |
postWindowEventID = (*env)->GetMethodID (env, gtkwindowpeer, |
postWindowEventID = (*env)->GetMethodID (env, gtkwindowpeer, |
210 |
postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer, |
postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer, |
211 |
"postTextEvent", |
"postTextEvent", |
212 |
"()V"); |
"()V"); |
213 |
|
initComponentGraphicsID = (*env)->GetMethodID (env, gdkgraphics, |
214 |
|
"initComponentGraphics", |
215 |
|
"()V"); |
216 |
|
initComponentGraphics2DID = (*env)->GetMethodID (env, gdkgraphics2d, |
217 |
|
"initComponentGraphics2D", |
218 |
|
"()V"); |
219 |
global_gtk_window_group = gtk_window_group_new (); |
global_gtk_window_group = gtk_window_group_new (); |
220 |
|
|
221 |
init_dpi_conversion_factor (); |
init_dpi_conversion_factor (); |