[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: peer code cleanups

Kaffe CVS cvs-commits at kaffe.org
Tue Jul 26 09:27:08 PDT 2005


PatchSet 6768 
Date: 2005/07/26 16:21:58
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: peer code cleanups

Members: 
	ChangeLog:1.4293->1.4294 
	libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am:1.17->1.18 
	libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in:1.39->1.40 
	libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.8->1.9 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.15->1.16 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:1.16->1.17 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.13->1.14 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.10->1.11 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c:1.3->1.4 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.9->1.10 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.15->1.16 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.11->1.12(DEAD) 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:1.12->1.13 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.7->1.8 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c:1.8->1.9 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c:1.7->1.8 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c:1.8->1.9 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c:1.7->1.8 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c:1.1->1.2 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.7->1.8 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c:1.13->1.14 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.21->1.22 
	libraries/clib/awt/classpath-gtk/gtk-peer/gthread-jni.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gthread-jni.h:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:1.13->1.14 
	libraries/clib/classpath/native_state.c:1.4->1.5 
	libraries/clib/classpath/native_state.h:1.2->1.3 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkChoicePeer.java:1.7->1.8 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.17->1.18 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkGenericPeer.java:1.4->1.5 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkWindowPeer.java:1.10->1.11 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4293 kaffe/ChangeLog:1.4294
--- kaffe/ChangeLog:1.4293	Tue Jul 26 08:58:29 2005
+++ kaffe/ChangeLog	Tue Jul 26 16:21:58 2005
@@ -1,3 +1,78 @@
+2005-07-26 Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
+	2005-07-14  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * gnu/java/awt/peer/gtk/GtkChoicePeer.java (choicePostItemEvent):
+        Rename to postChoiceItemEvent.
+        * gnu/java/awt/peer/gtk/GtkComponentPeer.java (realize): New method.
+        (setNativeEventMask): Likewise.
+        * gnu/java/awt/peer/gtk/GtkGenericPeer.java (printCurrentThread): New method.
+        * gnu/java/awt/peer/gtk/GtkWindowPeer.java (realize): New method.
+        * native/jni/gtk-peer/gtkpeer.h: Move widget-specific macro,
+        variable and function declarations into the widget-specific file.
+        Add cp_gtk_ namespace prefix to external symbols.
+        (cp_gtk_graphics2d_init_jni): New function.
+        (cp_gtk_graphics_init_jni): Likewise.
+        (cp_gtk_button_init_jni): Likewise.
+        (cp_gtk_checkbox_init_jni): Likewise.
+        (cp_gtk_choice_init_jni): Likewise.
+        (cp_gtk_component_init_jni): Likewise.
+        (cp_gtk_list_init_jni): Likewise.
+        (cp_gtk_menuitem_init_jni): Likewise.
+        (cp_gtk_scrollbar_init_jni): Likewise.
+        (cp_gtk_textcomponent_init_jni): Likewise.
+        (cp_gtk_window_init_jni): Likewise.
+        (cp_gtk_component_connect_expose_signals): Likewise.
+        (cp_gtk_component_connect_focus_signals): Likewise.
+        (cp_gtk_component_connect_mouse_signals): Likewise.
+        (cp_gtk_component_connect_signals): Likewise.
+        (cp_gtk_textcomponent_connect_signals): Likewise.
+        (cp_gtk_print_current_thread): Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c: Remove
+        file.  Move widget-specific functions into the widget-specific
+        files.  Break main event handler into multiple widget-specific
+        callbacks.
+        * native/jni/gtk-peer/Makefile.am (libgtkpeer_la_SOURCES): Remove
+        gnu_java_awt_peer_gtk_GtkEvents.c.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c: Add
+        cp_gtk_ namespace prefix to external symbols.  Add widget-specific
+        macros, variables and function declarations from
+        gnu_java_awt_peer_gtk_GtkEvents.c.  Add widget-specific callbacks
+        to replace main event handling loop.
+        * native/jni/classpath/native_state.c: Likewise.
+        * native/jni/classpath/native_state.h: Likewise.
+        * native/jni/gtk-peer/gdkfont.h: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c: Likewise.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c: Likewise.
+        * native/jni/gtk-peer/gthread-jni.c: Likewise.
+        * native/jni/gtk-peer/gthread-jni.h: Likewise.
+
 2005-07-25  Dalibor Topic  <robilad at kaffe.org>
 
 	Resynced with GNU Classpath.
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am:1.17 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am:1.18
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am:1.17	Wed Jul  6 21:04:44 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.am	Tue Jul 26 16:22:01 2005
@@ -26,7 +26,6 @@
 	gnu_java_awt_peer_gtk_GtkChoicePeer.c \
 	gnu_java_awt_peer_gtk_GtkClipboard.c \
 	gnu_java_awt_peer_gtk_GtkComponentPeer.c \
-	gnu_java_awt_peer_gtk_GtkEvents.c \
 	gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
 	gnu_java_awt_peer_gtk_GtkFramePeer.c \
 	gnu_java_awt_peer_gtk_GtkGenericPeer.c	\
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in:1.39 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in:1.40
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in:1.39	Tue Jul 19 01:16:25 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/Makefile.in	Tue Jul 26 16:22:02 2005
@@ -97,7 +97,6 @@
 	gnu_java_awt_peer_gtk_GtkChoicePeer.c \
 	gnu_java_awt_peer_gtk_GtkClipboard.c \
 	gnu_java_awt_peer_gtk_GtkComponentPeer.c \
-	gnu_java_awt_peer_gtk_GtkEvents.c \
 	gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
 	gnu_java_awt_peer_gtk_GtkFramePeer.c \
 	gnu_java_awt_peer_gtk_GtkGenericPeer.c \
@@ -135,7 +134,6 @@
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo \
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkClipboard.lo \
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo \
-	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo \
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo \
 	libgtkpeer_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo \
@@ -478,7 +476,6 @@
 	gnu_java_awt_peer_gtk_GtkChoicePeer.c \
 	gnu_java_awt_peer_gtk_GtkClipboard.c \
 	gnu_java_awt_peer_gtk_GtkComponentPeer.c \
-	gnu_java_awt_peer_gtk_GtkEvents.c \
 	gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
 	gnu_java_awt_peer_gtk_GtkFramePeer.c \
 	gnu_java_awt_peer_gtk_GtkGenericPeer.c	\
@@ -634,7 +631,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkClipboard.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkFramePeer.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Plo at am__quote@
@@ -796,13 +792,6 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gnu_java_awt_peer_gtk_GtkComponentPeer.c' object='libgtkpeer_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgtkpeer_la_CPPFLAGS) $(CPPFLAGS) $(libgtkpeer_la_CFLAGS) $(CFLAGS) -c -o libgtkpeer_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo `test -f 'gnu_java_awt_peer_gtk_GtkComponentPeer.c' || echo '$(srcdir)/'`gnu_java_awt_peer_gtk_GtkComponentPeer.c
-
-libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo: gnu_java_awt_peer_gtk_GtkEvents.c
- at am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgtkpeer_la_CPPFLAGS) $(CPPFLAGS) $(libgtkpeer_la_CFLAGS) $(CFLAGS) -MT libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo -MD -MP -MF "$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo" -c -o libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo `test -f 'gnu_java_awt_peer_gtk_GtkEvents.c' || echo '$(srcdir)/'`gnu_java_awt_peer_gtk_GtkEvents.c; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo" "$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.Plo"; else rm -f "$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo"; exit 1; fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gnu_java_awt_peer_gtk_GtkEvents.c' object='libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgtkpeer_la_CPPFLAGS) $(CPPFLAGS) $(libgtkpeer_la_CFLAGS) $(CFLAGS) -c -o libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEvents.lo `test -f 'gnu_java_awt_peer_gtk_GtkEvents.c' || echo '$(srcdir)/'`gnu_java_awt_peer_gtk_GtkEvents.c
 
 libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo: gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
 @am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgtkpeer_la_CPPFLAGS) $(CPPFLAGS) $(libgtkpeer_la_CFLAGS) $(CFLAGS) -MT libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo -MD -MP -MF "$(DEPDIR)/libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Tpo" -c -o libgtkpeer_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo `test -f 'gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c' || echo '$(srcdir)/'`gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c; \
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h:1.5	Mon Jul  4 00:04:00 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gdkfont.h	Tue Jul 26 16:22:02 2005
@@ -45,47 +45,47 @@
 #include <pango/pango-fontmap.h>
 #include <pango/pangoft2.h>
 
-extern struct state_table *native_font_state_table;
+extern struct state_table *cp_gtk_native_font_state_table;
 extern struct state_table *native_glyphvector_state_table;
-extern struct state_table *native_text_layout_state_table;
+extern struct state_table *cp_gtk_native_text_layout_state_table;
 
 #define NSA_FONT_INIT(env, clazz) \
-  native_font_state_table = init_state_table (env, clazz)
+  cp_gtk_native_font_state_table = cp_gtk_init_state_table (env, clazz)
 
 #define NSA_GET_FONT_PTR(env, obj) \
-  get_state (env, obj, native_font_state_table)
+  cp_gtk_get_state (env, obj, cp_gtk_native_font_state_table)
 
 #define NSA_SET_FONT_PTR(env, obj, ptr) \
-  set_state (env, obj, native_font_state_table, (void *)ptr)
+  cp_gtk_set_state (env, obj, cp_gtk_native_font_state_table, (void *)ptr)
 
 #define NSA_DEL_FONT_PTR(env, obj) \
-  remove_state_slot (env, obj, native_font_state_table)
+  cp_gtk_remove_state_slot (env, obj, cp_gtk_native_font_state_table)
 
 
 #define NSA_GV_INIT(env, clazz) \
-  native_glyphvector_state_table = init_state_table (env, clazz)
+  native_glyphvector_state_table = cp_gtk_init_state_table (env, clazz)
 
 #define NSA_GET_GV_PTR(env, obj) \
-  get_state (env, obj, native_glyphvector_state_table)
+  cp_gtk_get_state (env, obj, native_glyphvector_state_table)
 
 #define NSA_SET_GV_PTR(env, obj, ptr) \
-  set_state (env, obj, native_glyphvector_state_table, (void *)ptr)
+  cp_gtk_set_state (env, obj, native_glyphvector_state_table, (void *)ptr)
 
 #define NSA_DEL_GV_PTR(env, obj) \
-  remove_state_slot (env, obj, native_glyphvector_state_table)
+  cp_gtk_remove_state_slot (env, obj, native_glyphvector_state_table)
 
 
 #define NSA_TEXT_LAYOUT_INIT(env, clazz) \
-  native_text_layout_state_table = init_state_table (env, clazz)
+  cp_gtk_native_text_layout_state_table = cp_gtk_init_state_table (env, clazz)
 
 #define NSA_GET_TEXT_LAYOUT_PTR(env, obj) \
-  get_state (env, obj, native_text_layout_state_table)
+  cp_gtk_get_state (env, obj, cp_gtk_native_text_layout_state_table)
 
 #define NSA_SET_TEXT_LAYOUT_PTR(env, obj, ptr) \
-  set_state (env, obj, native_text_layout_state_table, (void *)ptr)
+  cp_gtk_set_state (env, obj, cp_gtk_native_text_layout_state_table, (void *)ptr)
 
 #define NSA_DEL_TEXT_LAYOUT_PTR(env, obj) \
-  remove_state_slot (env, obj, native_text_layout_state_table)
+  cp_gtk_remove_state_slot (env, obj, cp_gtk_native_text_layout_state_table)
 
 #define FONT_METRICS_ASCENT      0
 #define FONT_METRICS_MAX_ASCENT  1
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.8 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.9
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.8	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c	Tue Jul 26 16:22:02 2005
@@ -38,7 +38,7 @@
 #include "gdkfont.h"
 #include "gnu_java_awt_peer_gtk_GdkFontPeer.h"
 
-struct state_table *native_font_state_table;
+struct state_table *cp_gtk_native_font_state_table;
 
 enum java_awt_font_style {
   java_awt_font_PLAIN = 0,
@@ -134,7 +134,7 @@
   pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
   g_assert (pfont != NULL);
 
-  len = (*gdk_env())->GetStringUTFLength (env, chars);  
+  len = (*cp_gtk_gdk_env())->GetStringUTFLength (env, chars);  
   str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL);
   g_assert (str != NULL);
 
@@ -150,8 +150,12 @@
 
   if (i == NULL)       
     {
+      gdk_threads_leave ();
+
       java_extents = (*env)->NewDoubleArray (env, 0);
       java_codes = (*env)->NewIntArray (env, 0);
+
+      gdk_threads_enter ();
     }
   else
     { 
@@ -173,8 +177,13 @@
 	  int x = 0;
 	  double scale = ((double) PANGO_SCALE);
 
+          gdk_threads_leave ();
+
 	  java_extents = (*env)->NewDoubleArray (env, glyphs->num_glyphs * NUM_GLYPH_METRICS);
 	  java_codes = (*env)->NewIntArray (env, glyphs->num_glyphs);
+
+          gdk_threads_enter ();
+
 	  native_extents = (*env)->GetDoubleArrayElements (env, java_extents, NULL);
 	  native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
 
@@ -380,8 +389,8 @@
   else
     {
       /* GDK uses a slightly different DPI setting. */
-      pango_font_description_set_size (pfont->desc, 
-				       size * dpi_conversion_factor);
+      pango_font_description_set_size (pfont->desc,
+				   size * cp_gtk_dpi_conversion_factor);
       if (pfont->ctx == NULL)
 	pfont->ctx = gdk_pango_context_get();
     }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.15 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.16
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.15	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c	Tue Jul 26 16:22:02 2005
@@ -41,11 +41,26 @@
 #include <gdk/gdkprivate.h>
 #include <gdk/gdkx.h>
 
+static jmethodID initComponentGraphicsID;
+
+void
+cp_gtk_graphics_init_jni (void)
+{
+  jclass gdkgraphics;
+
+  gdkgraphics = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+                                         "gnu/java/awt/peer/gtk/GdkGraphics");
+
+  initComponentGraphicsID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gdkgraphics,
+                                                       "initComponentGraphics",
+                                                       "()V");
+}
+
 #define GDK_STABLE_IS_PIXMAP(d) (GDK_IS_PIXMAP(d))
 
-GdkPoint *
-translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints, 
-		  jint npoints, jint x_offset, jint y_offset);
+static GdkPoint *translate_points (JNIEnv *env, jintArray xpoints,
+                                   jintArray ypoints, jint npoints,
+                                   jint x_offset, jint y_offset);
 static void realize_cb (GtkWidget *widget, jobject jgraphics);
 
 JNIEXPORT void JNICALL
@@ -108,7 +123,7 @@
 
   gdk_threads_enter ();
 
-  pixmap = gnu_java_awt_peer_gtk_GtkImage_getPixmap(env, source);
+  pixmap = cp_gtk_image_get_pixmap (env, source);
   g_assert(pixmap != NULL);
   gdk_pixmap_ref (pixmap);
 
@@ -441,7 +456,7 @@
   gdk_threads_leave ();
 }  
 
-GdkPoint *
+static GdkPoint *
 translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints, 
 		  jint npoints, jint x_offset, jint y_offset)
 {
@@ -619,9 +634,9 @@
 {
   gdk_threads_leave ();
 
-  (*gdk_env())->CallVoidMethod (gdk_env(), jgraphics, initComponentGraphicsID);
+  (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), jgraphics, initComponentGraphicsID);
 
-  NSA_DEL_GLOBAL_REF (gdk_env(), jgraphics);
+  NSA_DEL_GLOBAL_REF (cp_gtk_gdk_env(), jgraphics);
 
   gdk_threads_enter ();
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:1.16 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:1.17
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:1.16	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c	Tue Jul 26 16:22:02 2005
@@ -52,19 +52,34 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-struct state_table *native_graphics2d_state_table;
+static jmethodID initComponentGraphics2DID;
+
+void
+cp_gtk_graphics2d_init_jni (void)
+{
+  jclass gdkgraphics2d;
+
+  gdkgraphics2d = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+                                           "gnu/java/awt/peer/gtk/GdkGraphics2D");
+
+  initComponentGraphics2DID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gdkgraphics2d,
+                                                         "initComponentGraphics2D",
+                                                         "()V");
+}
+
+static struct state_table *native_graphics2d_state_table;
 
 #define NSA_G2D_INIT(env, clazz) \
-  native_graphics2d_state_table = init_state_table (env, clazz)
+  native_graphics2d_state_table = cp_gtk_init_state_table (env, clazz)
 
 #define NSA_GET_G2D_PTR(env, obj) \
-  get_state (env, obj, native_graphics2d_state_table)
+  cp_gtk_get_state (env, obj, native_graphics2d_state_table)
 
 #define NSA_SET_G2D_PTR(env, obj, ptr) \
-  set_state (env, obj, native_graphics2d_state_table, (void *)ptr)
+  cp_gtk_set_state (env, obj, native_graphics2d_state_table, (void *)ptr)
 
 #define NSA_DEL_G2D_PTR(env, obj) \
-  remove_state_slot (env, obj, native_graphics2d_state_table)
+  cp_gtk_remove_state_slot (env, obj, native_graphics2d_state_table)
 
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initStaticState 
@@ -356,7 +371,7 @@
 {
   gdk_threads_leave ();
 
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer, initComponentGraphics2DID);
+  (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer, initComponentGraphics2DID);
 
   gdk_threads_enter ();
 }
@@ -391,7 +406,7 @@
       g->jarray = (*env)->NewGlobalRef (env, g_old->jarray);
       g->javabuf = (*env)->GetIntArrayElements (env, g->jarray, &g->isCopy);
       g->isCopy = JNI_TRUE;
-      g->javabuf_copy = (jint *) malloc (size);
+      g->javabuf_copy = (jint *) g_malloc (size);
       memcpy (g->javabuf_copy, g->javabuf, size);
       g->surface = cairo_image_surface_create_for_data ((unsigned char *) g->javabuf,
 						         CAIRO_FORMAT_ARGB32,
@@ -450,7 +465,7 @@
       /* We didn't get direct access to the pixel buffer, so we'll have to
          maintain a separate copy for Cairo. */
       jint size = gr->width * gr->height * 4;
-      gr->javabuf_copy = (jint *) malloc (size);
+      gr->javabuf_copy = (jint *) g_malloc (size);
       memcpy (gr->javabuf_copy, gr->javabuf, size);
       cairobuf = gr->javabuf_copy;
     }
@@ -677,7 +692,7 @@
     {
       (*env)->DeleteGlobalRef (env, gr->jarray);
       if (gr->javabuf_copy)
-        free (gr->javabuf_copy);
+        g_free (gr->javabuf_copy);
     }
 
   if (gr->debug) printf ("disposed of graphics2d\n");
@@ -804,7 +819,7 @@
     cairo_surface_destroy (gr->pattern_surface);
 
   if (gr->pattern_pixels)
-    free (gr->pattern_pixels);
+    g_free (gr->pattern_pixels);
   
   gr->pattern_pixels = NULL;  
   gr->pattern_surface = surf;  
@@ -843,13 +858,13 @@
     cairo_surface_destroy (gr->pattern_surface);
 
   if (gr->pattern_pixels)
-    free (gr->pattern_pixels);
+    g_free (gr->pattern_pixels);
 
   gr->pattern = NULL;
   gr->pattern_surface = NULL;
   gr->pattern_pixels = NULL;
 
-  gr->pattern_pixels = (char *) malloc (h * stride * 4);
+  gr->pattern_pixels = (char *) g_malloc (h * stride * 4);
   g_assert (gr->pattern_pixels != NULL);
 
   jpixels = (*env)->GetIntArrayElements (env, jarr, NULL);
@@ -1183,7 +1198,7 @@
 
   install_font_peer(gr->cr, pfont, gr->debug);
 
-  glyphs = malloc( sizeof(cairo_glyph_t) * n);
+  glyphs = g_malloc( sizeof(cairo_glyph_t) * n);
   g_assert (glyphs != NULL);
 
   native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.13 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.14
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.13	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c	Tue Jul 26 16:22:02 2005
@@ -48,7 +48,19 @@
 #include <string.h>
 #include <stdlib.h>
 
-struct state_table *native_pixbufdecoder_state_table;
+static struct state_table *native_pixbufdecoder_state_table;
+
+#define NSA_PB_INIT(env, clazz) \
+  native_pixbufdecoder_state_table = cp_gtk_init_state_table (env, clazz)
+
+#define NSA_GET_PB_PTR(env, obj) \
+  cp_gtk_get_state (env, obj, native_pixbufdecoder_state_table)
+
+#define NSA_SET_PB_PTR(env, obj, ptr) \
+  cp_gtk_set_state (env, obj, native_pixbufdecoder_state_table, (void *)ptr)
+
+#define NSA_DEL_PB_PTR(env, obj) \
+  cp_gtk_remove_state_slot (env, obj, native_pixbufdecoder_state_table)
 
 /* Union used for type punning. */
 union env_union
@@ -130,7 +142,13 @@
 
   e.jni_env = &env;
   (*vm)->GetEnv (vm, e.void_env, JNI_VERSION_1_1);
+
+  gdk_threads_leave ();
+
   jpixels = (*env)->NewIntArray (env, n_pixels);
+
+  gdk_threads_enter ();
+
   java_pixels = (*env)->GetIntArrayElements (env, jpixels, NULL);
 
   memcpy (java_pixels, 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c:1.5	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c	Tue Jul 26 16:22:02 2005
@@ -207,7 +207,8 @@
   display = gdk_display_get_default ();
   xdisplay = GDK_DISPLAY_XDISPLAY (display);
 
-  lookup_keyval = awt_keycode_to_keysym (keycode, AWT_KEY_LOCATION_LEFT);
+  lookup_keyval = cp_gtk_awt_keycode_to_keysym (keycode,
+                                                       AWT_KEY_LOCATION_LEFT);
 
   if (!gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
                                           lookup_keyval,
@@ -251,7 +252,8 @@
   display = gdk_display_get_default ();
   xdisplay = GDK_DISPLAY_XDISPLAY (display);
 
-  lookup_keyval = awt_keycode_to_keysym (keycode, AWT_KEY_LOCATION_LEFT);
+  lookup_keyval = cp_gtk_awt_keycode_to_keysym (keycode,
+                                                       AWT_KEY_LOCATION_LEFT);
 
   if (!gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
                                           lookup_keyval,
@@ -311,7 +313,12 @@
   n_pixels = height * stride_pixels;
   gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
 
+  gdk_threads_leave ();
+
   jpixels = (*env)->NewIntArray (env, n_pixels);
+
+  gdk_threads_enter ();
+
   java_pixels = (*env)->GetIntArrayElements (env, jpixels, NULL);
 
   memcpy (java_pixels,
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.6 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.7
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.6	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c	Tue Jul 26 16:22:02 2005
@@ -42,7 +42,7 @@
 #include "gdkfont.h"
 #include "gnu_java_awt_peer_gtk_GdkTextLayout.h"
 
-struct state_table *native_text_layout_state_table;
+struct state_table *cp_gtk_native_text_layout_state_table;
 
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GdkTextLayout_initStaticState 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.10 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.11
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.10	Mon Jul 25 16:03:22 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	Tue Jul 26 16:22:02 2005
@@ -39,12 +39,24 @@
 #include "gtkpeer.h"
 #include "gnu_java_awt_peer_gtk_GtkButtonPeer.h"
 
-static gboolean focus_in_cb (GtkWidget *widget,
-                             GdkEventFocus *event,
-                             jobject peer);
-static gboolean focus_out_cb (GtkWidget *widget,
-                              GdkEventFocus *event,
-                              jobject peer);
+static jmethodID beginNativeRepaintID;
+static jmethodID endNativeRepaintID;
+ 
+void
+cp_gtk_button_init_jni (void)
+{
+  jclass gtkbuttonpeer;
+
+  gtkbuttonpeer = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+                                           "gnu/java/awt/peer/gtk/GtkButtonPeer");
+
+  beginNativeRepaintID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gtkbuttonpeer,
+                                                    "beginNativeRepaint",
+                                                    "()V");
+
+  endNativeRepaintID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gtkbuttonpeer,
+                                                  "endNativeRepaint", "()V");
+}
 
 static void block_expose_event_cb (GtkWidget *widget,
                                    jobject peer);
@@ -89,24 +101,16 @@
 
   button = gtk_bin_get_child (GTK_BIN (ptr));
 
-  g_signal_connect (G_OBJECT (ptr), "event",
-                    G_CALLBACK (pre_event_handler), *gref);
-
-  g_signal_connect (G_OBJECT (button), "event",
-                    G_CALLBACK (pre_event_handler), *gref);
-
-  g_signal_connect (G_OBJECT (button), "focus-in-event",
-                    G_CALLBACK (focus_in_cb), *gref);
-
-  g_signal_connect (G_OBJECT (button), "focus-out-event",
-                    G_CALLBACK (focus_out_cb), *gref);
-
+  /* Button signals */
   g_signal_connect_after (G_OBJECT (button), "pressed",
                           G_CALLBACK (block_expose_event_cb), *gref);
 
   g_signal_connect_after (G_OBJECT (button), "released",
                           G_CALLBACK (block_expose_event_cb), *gref);
 
+  /* Component signals */
+  cp_gtk_component_connect_signals (G_OBJECT (button), gref);
+
   gdk_threads_leave ();
 }
 
@@ -154,7 +158,8 @@
   label = gtk_bin_get_child (GTK_BIN (button));
 
   font_desc = pango_font_description_from_string (font_name);
-  pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
+  pango_font_description_set_size (font_desc,
+                                   size * cp_gtk_dpi_conversion_factor);
 
   if (style & AWT_STYLE_BOLD)
     pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
@@ -312,40 +317,12 @@
   gdk_threads_leave ();
 }
 
-static gboolean
-focus_in_cb (GtkWidget *widget __attribute((unused)),
-             GdkEventFocus *event __attribute((unused)),
-             jobject peer)
-{
-  gdk_threads_leave ();
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
-                                postFocusEventID,
-                                AWT_FOCUS_GAINED,
-                                JNI_FALSE);
-  gdk_threads_enter ();
-  return FALSE;
-}
-
-static gboolean
-focus_out_cb (GtkWidget *widget __attribute((unused)),
-              GdkEventFocus *event __attribute((unused)),
-              jobject peer)
-{
-  gdk_threads_leave ();
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
-                                postFocusEventID,
-                                AWT_FOCUS_LOST,
-                                JNI_FALSE);
-  gdk_threads_enter ();
-  return FALSE;
-}
-
 static void
 block_expose_event_cb (GtkWidget *widget, jobject peer)
 {
   gdk_threads_leave ();
 
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+  (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
                                 beginNativeRepaintID);
 
   gdk_threads_enter ();
@@ -354,7 +331,7 @@
 
   gdk_threads_leave ();
 
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+  (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
                               endNativeRepaintID);
 
   gdk_threads_enter ();
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c:1.3 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c:1.4
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c:1.3	Mon Jul  4 00:04:01 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c	Tue Jul 26 16:22:02 2005
@@ -45,16 +45,14 @@
 {
   gpointer widget;
 
+  gdk_threads_enter ();
+  
   /* Create global reference and save it for future use */
   NSA_SET_GLOBAL_REF (env, obj);
 
-  gdk_threads_enter ();
-  
   widget = gtk_type_new (gtk_drawing_area_get_type ());
 
-  gdk_threads_leave ();
-
   NSA_SET_PTR (env, obj, widget);
-}
-
 
+  gdk_threads_leave ();
+}
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:1.6 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:1.7
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:1.6	Mon Jul 25 16:03:23 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c	Tue Jul 26 16:22:02 2005
@@ -40,6 +40,21 @@
 #include "gnu_java_awt_peer_gtk_GtkCheckboxPeer.h"
 #include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
 
+static jmethodID postItemEventID;
+
+void
+cp_gtk_checkbox_init_jni (void)
+{
+  jclass gtkcheckboxpeer;
+
+  gtkcheckboxpeer = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+                                             "gnu/java/awt/peer/gtk/GtkCheckboxPeer");
+
+  postItemEventID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gtkcheckboxpeer,
+                                               "postItemEvent", 
+                                               "(Ljava/lang/Object;I)V");
+}
+
 static void item_toggled_cb (GtkToggleButton *item, jobject peer);
 
 JNIEXPORT void JNICALL
@@ -83,13 +98,14 @@
   ptr = NSA_GET_PTR (env, obj);
   gref = NSA_GET_GLOBAL_REF (env, obj);
 
+  /* Checkbox signals */
   g_signal_connect (G_OBJECT (ptr), "toggled",
                     G_CALLBACK (item_toggled_cb), *gref);
 
-  gdk_threads_leave ();
+  /* Component signals */
+  cp_gtk_component_connect_signals (G_OBJECT (ptr), gref);
 
-  /* Connect the superclass signals.  */
-  Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
+  gdk_threads_leave ();
 }
 
 JNIEXPORT void JNICALL 
@@ -168,7 +184,8 @@
   font_name = (*env)->GetStringUTFChars (env, name, NULL);
 
   font_desc = pango_font_description_from_string (font_name);
-  pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
+  pango_font_description_set_size (font_desc,
+                                   size * cp_gtk_dpi_conversion_factor);
 
   if (style & AWT_STYLE_BOLD)
     pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
@@ -212,7 +229,7 @@
 {
   gdk_threads_leave ();
 
-  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+  (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
                                 postItemEventID,
                                 peer,
                                 item->active ?
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.9 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.10
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.9	Mon Jul 25 16:03:23 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c	Tue Jul 26 16:22:02 2005
@@ -39,6 +39,21 @@
 #include "gtkpeer.h"
 #include "gnu_java_awt_peer_gtk_GtkChoicePeer.h"
 
+static jmethodID postChoiceItemEventID;
+
+void
+cp_gtk_choice_init_jni (void)
+{
+  jclass gtkchoicepeer;
+
+  gtkchoicepeer = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+                                        "gnu/java/awt/peer/gtk/GtkChoicePeer");
+
+  postChoiceItemEventID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gtkchoicepeer,
+                                               "postChoiceItemEvent",
+                                               "(Ljava/lang/String;I)V");
+}
+
 static void selection_changed_cb (GtkComboBox *combobox, jobject peer);
 
 JNIEXPORT void JNICALL 
@@ -72,9 +87,13 @@
   ptr = NSA_GET_PTR (env, obj);
   gref = NSA_GET_GLOBAL_REF (env, obj);
 
+  /* Choice signals */
   g_signal_connect (G_OBJECT (ptr), "changed",
                     G_CALLBACK (selection_changed_cb), *gref);
 
+  /* Component signals */
+  cp_gtk_component_connect_signals (G_OBJECT (ptr), gref);
+
   gdk_threads_leave ();
 }
 
@@ -109,32 +128,36 @@
 
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeAdd 
-  (JNIEnv *env, jobject obj, jstring item, jint i)
+  (JNIEnv *env, jobject obj, jstring item, jint index)
 {
   void *ptr;
   const char *label;
 
+  gdk_threads_enter ();
+
   ptr = NSA_GET_PTR (env, obj);
   
-  label = (*env)->GetStringUTFChars (env, item, NULL);      
+  label = (*env)->GetStringUTFChars (env, item, 0);      
 
-  gdk_threads_enter ();
-  gtk_combo_box_insert_text (GTK_COMBO_BOX (ptr), i, label);
-  gdk_threads_leave ();
+  gtk_combo_box_insert_text (GTK_COMBO_BOX (ptr), index, label);
 
   (*env)->ReleaseStringUTFChars (env, item, label);
+
+  gdk_threads_leave ();
 }
 
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove 
-  (JNIEnv *env, jobject obj, jint i)
+  (JNIEnv *env, jobject obj, jint index)
 {
   void *ptr;
 
+  gdk_threads_enter ();
+
   ptr = NSA_GET_PTR (env, obj);
 
-  gdk_threads_enter ();
-  gtk_combo_box_remove_text (GTK_COMBO_BOX (ptr), i);
+  gtk_combo_box_remove_text (GTK_COMBO_BOX (ptr), index);
+
   gdk_threads_leave ();
 }
 
@@ -165,14 +188,16 @@
 
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkChoicePeer_select 
-  (JNIEnv *env, jobject obj, jint i)
+  (JNIEnv *env, jobject obj, jint index)
 {
   void *ptr;
 
+  gdk_threads_enter ();
+
   ptr = NSA_GET_PTR (env, obj);
 
-  gdk_threads_enter ();
-  gtk_combo_box_set_active (GTK_COMBO_BOX (ptr), i);
+  gtk_combo_box_set_active (GTK_COMBO_BOX (ptr), index);
+
   gdk_threads_leave ();
 }
 
@@ -181,40 +206,42 @@
   (JNIEnv *env, jobject obj)
 {
   void *ptr;
-  int i;
+  int index;
+
+  gdk_threads_enter ();
 
   ptr = NSA_GET_PTR (env, obj);
 
-  gdk_threads_enter ();
-  i = gtk_combo_box_get_active (GTK_COMBO_BOX (ptr));
+  index = gtk_combo_box_get_active (GTK_COMBO_BOX (ptr));
+
   gdk_threads_leave ();
 
-  return i;
+  return index;
 }
 
-static void selection_changed (GtkComboBox *combobox, jobject peer)
+static void selection_changed_cb (GtkComboBox *combobox, jobject peer)
 {
   jstring label;
   GtkTreeModel *model;
   GtkTreeIter iter;
   gchar *selected;
-  gint i;
+  gint index;
 
-  i = gtk_combo_box_get_active(combobox);
+  index = gtk_combo_box_get_active(combobox);
 
-  if (i >= 0)
+  if (index >= 0)
     {
       model = gtk_combo_box_get_model (combobox);
       gtk_combo_box_get_active_iter (combobox, &iter);
       gtk_tree_model_get (model, &iter, 0, &selected, -1);
-      label = (*gdk_env())->NewStringUTF (gdk_env(), selected);
+      label = (*cp_gtk_gdk_env())->NewStringUTF (cp_gtk_gdk_env(), selected);
 
       gdk_threads_leave ();
 
-      (*gdk_env())->CallVoidMethod (gdk_env(), peer,
-			          choicePostItemEventID,
-			          label,
-			          (jint) AWT_ITEM_SELECTED);
+      (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
+                                    postChoiceItemEventID,
+                                    label,
+                                    (jint) AWT_ITEM_SELECTED);
 
       gdk_threads_enter ();
     }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.5	Mon Jul 25 16:03:23 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c	Tue Jul 26 16:22:02 2005
@@ -39,16 +39,18 @@
 #include "gtkpeer.h"
 #include "gnu_java_awt_peer_gtk_GtkClipboard.h"
 
-jmethodID stringSelectionReceivedID;
-jmethodID stringSelectionHandlerID;
-jmethodID selectionClearID;
-
-void selection_received_cb (GtkWidget *, GtkSelectionData *, guint, gpointer);
-void selection_get_cb (GtkWidget *, GtkSelectionData *, guint, guint, gpointer);
-gint selection_clear_cb (GtkWidget *, GdkEventSelection *);
+static jmethodID stringSelectionReceivedID;
+static jmethodID stringSelectionHandlerID;
+static jmethodID selectionClearID;
+
+static void selection_received_cb (GtkWidget *, GtkSelectionData *,
+                                   guint, gpointer);
+static void selection_get_cb (GtkWidget *, GtkSelectionData *, guint,
+                              guint, gpointer);
+static gint selection_clear_cb (GtkWidget *, GdkEventSelection *);
 
-GtkWidget *clipboard;
-jobject cb_obj;
+static GtkWidget *clipboard;
+static jobject cb_obj;
 
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env, 
@@ -77,16 +79,16 @@
   clipboard = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
   g_signal_connect (G_OBJECT(clipboard), "selection_received",

*** Patch too long, truncated ***




More information about the kaffe mailing list