gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c

510 lines
13 KiB
C
Raw Normal View History

Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
/* gtktextcomponentpeer.c -- Native implementation of GtkTextComponentPeer
Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc.
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
#include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h"
static void textcomponent_commit_cb (GtkIMContext *context,
const gchar *str,
jobject peer);
static void textcomponent_changed_cb (GtkEditable *editable,
jobject peer);
JNIEXPORT void JNICALL
gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. 2003-12-08 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. (pre_event_handler): New function. Called on the Gtk "event" signal. Do not retrieve the jobject from the window property as it is already available as user data in the signal. Do not try and find the grab widget as it is already done by Gtk at this point. Do not search for Window ancestor as Gtk already sends the signal to it. Do not meddle with the activation state of peer widgets on each key press or release. Add CList to the special handling when looking for the focused widget. * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject): New function. (connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks): Rename to... (connectSignals): New name. Get rid of NewGlobalRef call. Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (connect_choice_item_selectable_hook): Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead code. (item_select): Remove indirection. (item_unselect): Ditto. (connect_selectable_hook): Folded into connectSignals. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and connectSignals. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals and not connectHooks. * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject and not connectHooks. * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto. From-SVN: r74536
2003-12-11 14:50:51 +01:00
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals
(JNIEnv *env, jobject obj)
{
GtkTextView *text = NULL;
GtkTextBuffer *buf;
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
gdk_threads_enter ();
if (GTK_IS_ENTRY(ptr))
{
g_signal_connect (GTK_ENTRY (ptr)->im_context, "commit",
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
G_CALLBACK (textcomponent_commit_cb), *gref);
g_signal_connect (GTK_EDITABLE (ptr), "changed",
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
G_CALLBACK (textcomponent_changed_cb), *gref);
gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. 2003-12-08 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. (pre_event_handler): New function. Called on the Gtk "event" signal. Do not retrieve the jobject from the window property as it is already available as user data in the signal. Do not try and find the grab widget as it is already done by Gtk at this point. Do not search for Window ancestor as Gtk already sends the signal to it. Do not meddle with the activation state of peer widgets on each key press or release. Add CList to the special handling when looking for the focused widget. * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject): New function. (connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks): Rename to... (connectSignals): New name. Get rid of NewGlobalRef call. Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (connect_choice_item_selectable_hook): Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead code. (item_select): Remove indirection. (item_unselect): Ditto. (connect_selectable_hook): Folded into connectSignals. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and connectSignals. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals and not connectHooks. * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject and not connectHooks. * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto. From-SVN: r74536
2003-12-11 14:50:51 +01:00
gdk_threads_leave ();
/* Connect the superclass signals. */
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, *gref);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child);
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_TEXT_VIEW (ptr);
}
if (text)
{
g_signal_connect (text->im_context, "commit",
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
G_CALLBACK (textcomponent_commit_cb), *gref);
buf = gtk_text_view_get_buffer (text);
if (buf)
g_signal_connect (buf, "changed",
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
G_CALLBACK (textcomponent_changed_cb), *gref);
gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. 2003-12-08 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. (pre_event_handler): New function. Called on the Gtk "event" signal. Do not retrieve the jobject from the window property as it is already available as user data in the signal. Do not try and find the grab widget as it is already done by Gtk at this point. Do not search for Window ancestor as Gtk already sends the signal to it. Do not meddle with the activation state of peer widgets on each key press or release. Add CList to the special handling when looking for the focused widget. * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject): New function. (connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks): Rename to... (connectSignals): New name. Get rid of NewGlobalRef call. Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (connect_choice_item_selectable_hook): Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead code. (item_select): Remove indirection. (item_unselect): Ditto. (connect_selectable_hook): Folded into connectSignals. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and connectSignals. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals and not connectHooks. * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject and not connectHooks. * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto. From-SVN: r74536
2003-12-11 14:50:51 +01:00
/* Connect the superclass signals. */
/* FIXME: Cannot do that here or it will get the sw and not the list.
We must a generic way of doing this. */
/* Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env,
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
obj); */
gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. 2003-12-08 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. (pre_event_handler): New function. Called on the Gtk "event" signal. Do not retrieve the jobject from the window property as it is already available as user data in the signal. Do not try and find the grab widget as it is already done by Gtk at this point. Do not search for Window ancestor as Gtk already sends the signal to it. Do not meddle with the activation state of peer widgets on each key press or release. Add CList to the special handling when looking for the focused widget. * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject): New function. (connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks): Rename to... (connectSignals): New name. Get rid of NewGlobalRef call. Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (connect_choice_item_selectable_hook): Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead code. (item_select): Remove indirection. (item_unselect): Ditto. (connect_selectable_hook): Folded into connectSignals. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and connectSignals. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals and not connectHooks. * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject and not connectHooks. * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto. From-SVN: r74536
2003-12-11 14:50:51 +01:00
g_signal_connect (GTK_OBJECT (text), "event",
gtkpeer.h: Extend NSA set of macros to handle a second native state table --... 2003-12-12 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second native state table -- native_global_ref_table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define native_global_ref_table pointer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI global reference is deleted and memory allocated for pointer freed. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove compilation warning. (connect_awt_hook): Use saved JNI global reference instead of creating a new one. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove unused variable declaration and add comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto. (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_toggled): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global reference to the Java object. (connect_choice_item_selectable_hook): Use saved JNI global references instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global reference to the Java object. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto. (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. (item_selected): Add debug statement. (item_unselected): Add debug statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global reference to the Java object. Connect "activate" signal handler using global JNI reference. (connect_activate_hook): Removed in favor of inline code. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. Add FIXME comment. (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global reference to the Java object. Add FIXME comment. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global reference to the Java object. (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved JNI global reference instead of JNI local reference. From-SVN: r74593
2003-12-13 02:15:47 +01:00
G_CALLBACK (pre_event_handler), *gref);
gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. 2003-12-08 Fernando Nasser <fnasser@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Most coded moved to pre_event_handler, with the modifications mentioned below. (pre_event_handler): New function. Called on the Gtk "event" signal. Do not retrieve the jobject from the window property as it is already available as user data in the signal. Do not try and find the grab widget as it is already done by Gtk at this point. Do not search for Window ancestor as Gtk already sends the signal to it. Do not meddle with the activation state of peer widgets on each key press or release. Add CList to the special handling when looking for the focused widget. * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject): New function. (connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks): Rename to... (connectSignals): New name. Get rid of NewGlobalRef call. Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (connect_choice_item_selectable_hook): Use g_signal_connect instead of deprecated gtk_signal_connect. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead code. (item_select): Remove indirection. (item_unselect): Ditto. (connect_selectable_hook): Folded into connectSignals. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New function. * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and connectSignals. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals and not connectHooks. * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject and not connectHooks. * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and connectSignals instead of connectHooks. * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto. * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto. From-SVN: r74536
2003-12-11 14:50:51 +01:00
gdk_threads_leave ();
}
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition
(JNIEnv *env, jobject obj)
{
void *ptr;
int pos = 0;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextMark *mark;
GtkTextIter iter;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
pos = gtk_editable_get_position (editable);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
mark = gtk_text_buffer_get_insert (buf);
gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
pos = gtk_text_iter_get_offset (&iter);
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
return pos;
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setCaretPosition
(JNIEnv *env, jobject obj, jint pos)
{
void *ptr;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextIter iter;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
gtk_editable_set_position (editable, pos);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
gtk_text_buffer_get_iter_at_offset (buf, &iter, pos);
gtk_text_buffer_place_cursor (buf, &iter);
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
}
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart
(JNIEnv *env, jobject obj)
{
void *ptr;
int pos = 0;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextIter start;
GtkTextIter end;
int starti, endi;
GtkTextMark *mark;
GtkTextIter iter;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
pos = starti;
else
pos = gtk_editable_get_position (editable);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
pos = gtk_text_iter_get_offset (&start);
else
{
mark = gtk_text_buffer_get_insert (buf);
gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
pos = gtk_text_iter_get_offset (&iter);
}
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
return pos;
}
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd
(JNIEnv *env, jobject obj)
{
void *ptr;
int pos = 0;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextIter start;
GtkTextIter end;
int starti, endi;
GtkTextMark *mark;
GtkTextIter iter;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
pos = endi;
else
pos = gtk_editable_get_position (editable);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
pos = gtk_text_iter_get_offset (&end);
else
{
mark = gtk_text_buffer_get_insert (buf);
gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
pos = gtk_text_iter_get_offset (&iter);
}
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
return pos;
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_select
(JNIEnv *env, jobject obj, jint start, jint end)
{
void *ptr;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextIter iter;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
gtk_editable_select_region (editable, start, end);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
gtk_text_buffer_get_iter_at_offset (buf, &iter, start);
/* quickly move both 'insert' and 'selection_bound' to the
same position */
gtk_text_buffer_place_cursor (buf, &iter);
gtk_text_buffer_get_iter_at_offset (buf, &iter, end);
gtk_text_buffer_move_mark_by_name (buf, "selection_bound", &iter);
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setEditable
(JNIEnv *env, jobject obj, jboolean state)
{
void *ptr;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
gtk_editable_set_editable (editable, state);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
gtk_text_view_set_editable (GTK_TEXT_VIEW (text), state);
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
}
JNIEXPORT jstring JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getText
(JNIEnv *env, jobject obj)
{
void *ptr;
char *contents = NULL;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
jstring jcontents;
GtkEditable *editable; /* type of GtkEntry (TextField) */
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
GtkTextIter start, end;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
editable = GTK_EDITABLE (ptr);
contents = gtk_editable_get_chars (editable, 0, -1);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
gtk_text_buffer_get_start_iter (buf, &start);
gtk_text_buffer_get_end_iter (buf, &end);
contents = gtk_text_buffer_get_text (buf, &start, &end, FALSE);
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
jcontents = (*env)->NewStringUTF (env, contents);
g_free (contents);
return jcontents;
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
(JNIEnv *env, jobject obj, jstring contents)
{
void *ptr;
const char *str;
GtkWidget *text = NULL; /* type of GtkTextView (TextArea) */
GtkTextBuffer *buf;
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
ptr = NSA_GET_PTR (env, obj);
str = (*env)->GetStringUTFChars (env, contents, NULL);
gdk_threads_enter ();
if (GTK_IS_EDITABLE (ptr))
{
gtk_entry_set_text (GTK_ENTRY (ptr), str);
}
else
{
if (GTK_IS_SCROLLED_WINDOW (ptr))
{
text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
}
else if (GTK_IS_TEXT_VIEW (ptr))
{
text = GTK_WIDGET (ptr);
}
if (text)
{
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
gtk_text_buffer_set_text (buf, str, strlen (str));
}
}
Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration. * java/awt/Toolkit.java (default_toolkit_name): Use new Configuration entry. * gnu/classpath/Configuration.java.in (default_awt_peer_toolkit): New global. * configure: Rebuilt. * configure.in (TOOLKIT): New subst. (--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required. Do AWT tests much earlier. Run Gtk tests. Make jniinclude directory. Make output directories for .c files. * Makefile.in: Rebuilt. * Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro. (toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary. (all_java_source_files): Added new sources. ($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target. (gtk_c_files): New macro. (gtk_c_source_files): New macro. (cond_gtk_ltlibrary): New macro. ($(gtk_c_files)): New target. (lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro. (gtk_awt_peer_sources): New macro. (gtk_c_headers): New macro. ($(gtk_c_headers)): New target. (ACLOCAL_AMFLAGS): New macro. * gtk.m4, glib.m4, libart.m4: New files. * gnu/java/awt/peer/gtk/GdkFontMetrics.java, gnu/java/awt/peer/gtk/GdkGraphics.java, gnu/java/awt/peer/gtk/GtkArg.java, gnu/java/awt/peer/gtk/GtkArgList.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkCanvasPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, gnu/java/awt/peer/gtk/GtkChoicePeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkComponentPeer.java, gnu/java/awt/peer/gtk/GtkContainerPeer.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkFramePeer.java, gnu/java/awt/peer/gtk/GtkGenericPeer.java, gnu/java/awt/peer/gtk/GtkImage.java, gnu/java/awt/peer/gtk/GtkImagePainter.java, gnu/java/awt/peer/gtk/GtkLabelPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMainThread.java, gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkMenuPeer.java, gnu/java/awt/peer/gtk/GtkOffScreenImage.java, gnu/java/awt/peer/gtk/GtkPanelPeer.java, gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java, gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java, gnu/java/awt/peer/gtk/TestAWT.java, gnu/java/awt/peer/gtk/Test.java: New files from Classpath. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h, jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h, jni/classpath/jnilink.c, jni/classpath/jnilink.h, jni/classpath/native_state.c, jni/classpath/native_state.h, jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise. From-SVN: r62187
2003-01-31 18:54:14 +01:00
gdk_threads_leave ();
(*env)->ReleaseStringUTFChars (env, contents, str);
}
static void
GtkMenuItemPeer.java (setEnabled): Stub out. 2003-10-08 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java (setEnabled): Stub out. * jni/classpath/jcl.c [!__GNUC__]: Elide __attribute__. (JCL_free): Attach "unused" attribute to env parameter. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c: Attach "unused" attribute to unused parameters. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c: (initNativeState): Pass 0 as info argument to gtk_selection_add_target. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: (setVisible, gtkFixedNew, gtkFixedPut, gtkFixedMove): Remove unused method implementations. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Add break statement after default label. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c (drawPixels): Remove unused variable i. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (setEnabled): Remove method implementation. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (accel_attach): Call _gtk_accel_group_attach with G_OBJECT argument. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (sr): Remove unused function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c (menu_pos): Assign TRUE to push_in. (setupAccelGroup): Call _gtk_accel_group_attach with G_OBJECT argument. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (create): Remove unused variable layout. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create): Pass window_widget, rather than window, to gtk_widget_set_size_request. * jni/gtk-peer/gthread-jni.c (g_thread_jni_functions): Fill out structure initialization with NULL values. * jni/gtk-peer/gtkpeer.h [!__GNUC__]: Elide __attribute__. From-SVN: r72231
2003-10-08 17:49:33 +02:00
textcomponent_commit_cb (GtkIMContext *context __attribute__((unused)),
const gchar *str,
jobject peer)
{
/* str is a \0-terminated UTF-8 encoded character. */
gunichar2 *jc = g_utf8_to_utf16 (str, -1, NULL, NULL, NULL);
GdkEvent *event = gtk_get_current_event ();
if (jc)
(*gdk_env)->CallVoidMethod (gdk_env, peer,
postKeyEventID,
(jint) AWT_KEY_TYPED,
(jlong) event->key.time,
keyevent_state_to_awt_mods (event),
VK_UNDEFINED,
(jchar) jc[0],
AWT_KEY_LOCATION_UNKNOWN);
g_free (jc);
gdk_event_free (event);
}
static void
GtkMenuItemPeer.java (setEnabled): Stub out. 2003-10-08 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java (setEnabled): Stub out. * jni/classpath/jcl.c [!__GNUC__]: Elide __attribute__. (JCL_free): Attach "unused" attribute to env parameter. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c: Attach "unused" attribute to unused parameters. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c: (initNativeState): Pass 0 as info argument to gtk_selection_add_target. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: (setVisible, gtkFixedNew, gtkFixedPut, gtkFixedMove): Remove unused method implementations. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler): Add break statement after default label. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c (drawPixels): Remove unused variable i. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (setEnabled): Remove method implementation. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (accel_attach): Call _gtk_accel_group_attach with G_OBJECT argument. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (sr): Remove unused function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c (menu_pos): Assign TRUE to push_in. (setupAccelGroup): Call _gtk_accel_group_attach with G_OBJECT argument. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c (create): Remove unused variable layout. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create): Pass window_widget, rather than window, to gtk_widget_set_size_request. * jni/gtk-peer/gthread-jni.c (g_thread_jni_functions): Fill out structure initialization with NULL values. * jni/gtk-peer/gtkpeer.h [!__GNUC__]: Elide __attribute__. From-SVN: r72231
2003-10-08 17:49:33 +02:00
textcomponent_changed_cb (GtkEditable *editable __attribute__((unused)),
jobject peer)
{
(*gdk_env)->CallVoidMethod (gdk_env, peer, postTextEventID);
}