From 1942f64e0b774317e0a8e6ec44902bb736bb7790 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Thu, 14 Mar 2002 18:49:06 +0000 Subject: Merge to GTK2 stream --- .../Eclipse SWT PI/gtk/library/eclipsefixed.c | 910 +++ .../Eclipse SWT PI/gtk/library/eclipsefixed.h | 84 + .../Eclipse SWT PI/gtk/library/make_gtk.mak | 149 +- .../Eclipse SWT PI/gtk/library/pixbuf.c | 235 - .../Eclipse SWT PI/gtk/library/structs.c | 1275 +--- .../Eclipse SWT PI/gtk/library/structs.h | 399 +- .../Eclipse SWT PI/gtk/library/swt-gdk.c | 1077 +++ .../Eclipse SWT PI/gtk/library/swt-gdkpixbuf.c | 241 + .../Eclipse SWT PI/gtk/library/swt-gtkcontainers.c | 141 + .../Eclipse SWT PI/gtk/library/swt-gtkcontrols.c | 488 ++ .../Eclipse SWT PI/gtk/library/swt-gtklists.c | 845 +++ .../Eclipse SWT PI/gtk/library/swt-gtkmenu.c | 100 + .../Eclipse SWT PI/gtk/library/swt-gtkwidget.c | 283 + .../Eclipse SWT PI/gtk/library/swt-gtkwindow.c | 357 + .../Eclipse SWT PI/gtk/library/swt-memmove.c | 261 + .../Eclipse SWT PI/gtk/library/swt-pango.c | 218 + .../Eclipse SWT PI/gtk/library/swt.c | 7551 ++------------------ .../org/eclipse/swt/internal/gtk/GDKPIXBUF.java | 9 +- .../gtk/org/eclipse/swt/internal/gtk/GdkEvent.java | 21 - .../eclipse/swt/internal/gtk/GdkEventButton.java | 29 - .../eclipse/swt/internal/gtk/GdkEventExpose.java | 8 +- .../org/eclipse/swt/internal/gtk/GdkEventKey.java | 22 - .../eclipse/swt/internal/gtk/GdkEventMotion.java | 29 - .../org/eclipse/swt/internal/gtk/GdkVisual.java | 6 +- .../eclipse/swt/internal/gtk/GtkAdjustment.java | 20 +- .../gtk/org/eclipse/swt/internal/gtk/GtkBin.java | 19 - .../gtk/org/eclipse/swt/internal/gtk/GtkBox.java | 21 - .../gtk/org/eclipse/swt/internal/gtk/GtkCList.java | 8 +- .../eclipse/swt/internal/gtk/GtkCListColumn.java | 5 + .../org/eclipse/swt/internal/gtk/GtkCListRow.java | 6 +- .../gtk/org/eclipse/swt/internal/gtk/GtkCTree.java | 8 +- .../org/eclipse/swt/internal/gtk/GtkCTreeRow.java | 9 +- .../eclipse/swt/internal/gtk/GtkCheckMenuItem.java | 20 - .../swt/internal/gtk/GtkColorSelectionDialog.java | 24 - .../gtk/org/eclipse/swt/internal/gtk/GtkCombo.java | 20 +- .../org/eclipse/swt/internal/gtk/GtkContainer.java | 23 - .../org/eclipse/swt/internal/gtk/GtkDialog.java | 21 - .../org/eclipse/swt/internal/gtk/GtkEditable.java | 8 +- .../eclipse/swt/internal/gtk/GtkFileSelection.java | 38 - .../swt/internal/gtk/GtkFontSelectionDialog.java | 26 - .../gtk/org/eclipse/swt/internal/gtk/GtkFrame.java | 24 - .../gtk/org/eclipse/swt/internal/gtk/GtkHBox.java | 18 - .../gtk/org/eclipse/swt/internal/gtk/GtkItem.java | 18 - .../org/eclipse/swt/internal/gtk/GtkMenuItem.java | 28 - .../org/eclipse/swt/internal/gtk/GtkObject.java | 22 - .../eclipse/swt/internal/gtk/GtkRequisition.java | 3 +- .../gtk/org/eclipse/swt/internal/gtk/GtkStyle.java | 22 +- .../eclipse/swt/internal/gtk/GtkStyleClass.java | 6 +- .../gtk/org/eclipse/swt/internal/gtk/GtkText.java | 8 +- .../org/eclipse/swt/internal/gtk/GtkWidget.java | 31 - .../org/eclipse/swt/internal/gtk/GtkWindow.java | 33 - .../gtk/org/eclipse/swt/internal/gtk/OS.java | 299 +- .../gtk/org/eclipse/swt/graphics/Color.java | 12 +- .../org/eclipse/swt/graphics/DefaultGtkStyle.java | 116 - .../gtk/org/eclipse/swt/graphics/Device.java | 65 +- .../gtk/org/eclipse/swt/graphics/Font.java | 70 +- .../gtk/org/eclipse/swt/graphics/FontData.java | 7 +- .../gtk/org/eclipse/swt/graphics/FontMetrics.java | 11 +- .../gtk/org/eclipse/swt/graphics/GC.java | 45 +- .../gtk/org/eclipse/swt/graphics/Image.java | 44 +- .../gtk/org/eclipse/swt/graphics/Pixbuffer.java | 26 +- .../gtk/org/eclipse/swt/widgets/Button.java | 10 +- .../gtk/org/eclipse/swt/widgets/Canvas.java | 11 +- .../gtk/org/eclipse/swt/widgets/Caret.java | 4 +- .../gtk/org/eclipse/swt/widgets/ColorDialog.java | 14 +- .../gtk/org/eclipse/swt/widgets/Combo.java | 200 +- .../gtk/org/eclipse/swt/widgets/Composite.java | 198 +- .../gtk/org/eclipse/swt/widgets/Control.java | 521 +- .../gtk/org/eclipse/swt/widgets/Decorations.java | 5 +- .../gtk/org/eclipse/swt/widgets/Display.java | 117 +- .../gtk/org/eclipse/swt/widgets/FileDialog.java | 129 +- .../gtk/org/eclipse/swt/widgets/FontDialog.java | 12 +- .../gtk/org/eclipse/swt/widgets/Group.java | 141 +- .../gtk/org/eclipse/swt/widgets/Label.java | 33 +- .../gtk/org/eclipse/swt/widgets/List.java | 60 +- .../gtk/org/eclipse/swt/widgets/Menu.java | 17 +- .../gtk/org/eclipse/swt/widgets/MenuItem.java | 20 +- .../gtk/org/eclipse/swt/widgets/MessageBox.java | 18 +- .../gtk/org/eclipse/swt/widgets/Sash.java | 62 +- .../gtk/org/eclipse/swt/widgets/Scale.java | 38 +- .../gtk/org/eclipse/swt/widgets/ScrollBar.java | 61 +- .../gtk/org/eclipse/swt/widgets/Scrollable.java | 31 +- .../gtk/org/eclipse/swt/widgets/Shell.java | 228 +- .../gtk/org/eclipse/swt/widgets/Slider.java | 78 +- .../gtk/org/eclipse/swt/widgets/TabFolder.java | 147 +- .../gtk/org/eclipse/swt/widgets/Table.java | 164 +- .../gtk/org/eclipse/swt/widgets/TableColumn.java | 12 +- .../gtk/org/eclipse/swt/widgets/TableItem.java | 100 +- .../gtk/org/eclipse/swt/widgets/Text.java | 196 +- .../gtk/org/eclipse/swt/widgets/ToolBar.java | 132 +- .../gtk/org/eclipse/swt/widgets/ToolItem.java | 218 +- .../gtk/org/eclipse/swt/widgets/Tracker.java | 8 +- .../gtk/org/eclipse/swt/widgets/Tree.java | 141 +- .../gtk/org/eclipse/swt/widgets/TreeItem.java | 115 +- .../gtk/org/eclipse/swt/widgets/UtilFuncs.java | 103 +- .../gtk/org/eclipse/swt/widgets/Widget.java | 14 +- 96 files changed, 7595 insertions(+), 11685 deletions(-) create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.h delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/pixbuf.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdk.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdkpixbuf.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontainers.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontrols.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtklists.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkmenu.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwidget.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwindow.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-memmove.c create mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-pango.c delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventButton.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventMotion.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBin.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBox.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCheckMenuItem.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkColorSelectionDialog.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkContainer.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkDialog.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFontSelectionDialog.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFrame.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkHBox.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkItem.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkMenuItem.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkObject.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWidget.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWindow.java delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/DefaultGtkStyle.java (limited to 'bundles/org.eclipse.swt') diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.c new file mode 100644 index 0000000000..780c1bf40d --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.c @@ -0,0 +1,910 @@ +/* Copyright 2001, Havoc Pennington and others */ + +/* Contributors: + * Havoc Pennington - the original version + * Boris Shingarov (OTI) - minor modifications for GTK2; JNI layer + */ + +/* Derived from EclipseFixed in GTK+: + * GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#include "eclipsefixed.h" +#include "swt.h" + +static void eclipse_fixed_class_init (EclipseFixedClass *klass); +static void eclipse_fixed_init (EclipseFixed *fixed); +static void eclipse_fixed_map (GtkWidget *widget); +static void eclipse_fixed_realize (GtkWidget *widget); +static void eclipse_fixed_size_request (GtkWidget *widget, + GtkRequisition *requisition); +static void eclipse_fixed_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); +static void eclipse_fixed_paint (GtkWidget *widget, + GdkRectangle *area); +static void eclipse_fixed_draw (GtkWidget *widget, + GdkRectangle *area); +static gint eclipse_fixed_expose (GtkWidget *widget, + GdkEventExpose *event); +static void eclipse_fixed_add (GtkContainer *container, + GtkWidget *widget); +static void eclipse_fixed_remove (GtkContainer *container, + GtkWidget *widget); +static void eclipse_fixed_forall (GtkContainer *container, + gboolean include_internals, + GtkCallback callback, + gpointer callback_data); +static GtkType eclipse_fixed_child_type (GtkContainer *container); + +static void move_gdk_window_above (GdkWindow *window, + GdkWindow *sibling); + +static void move_gdk_window_below (GdkWindow *window, + GdkWindow *sibling); + +static GtkContainerClass *parent_class = NULL; + + + + + +GtkType +eclipse_fixed_get_type (void) +{ + static GtkType fixed_type = 0; + + if (!fixed_type) + { + static const GtkTypeInfo fixed_info = + { + "EclipseFixed", + sizeof (EclipseFixed), + sizeof (EclipseFixedClass), + (GtkClassInitFunc) eclipse_fixed_class_init, + (GtkObjectInitFunc) eclipse_fixed_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + fixed_type = gtk_type_unique (GTK_TYPE_CONTAINER, &fixed_info); + } + + return fixed_type; +} + +static void +eclipse_fixed_class_init (EclipseFixedClass *class) +{ + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + object_class = (GtkObjectClass*) class; + widget_class = (GtkWidgetClass*) class; + container_class = (GtkContainerClass*) class; + + parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + + widget_class->realize = eclipse_fixed_realize; + widget_class->size_request = eclipse_fixed_size_request; + widget_class->size_allocate = eclipse_fixed_size_allocate; + + container_class->add = eclipse_fixed_add; + container_class->remove = eclipse_fixed_remove; + container_class->forall = eclipse_fixed_forall; + container_class->child_type = eclipse_fixed_child_type; + +/* container_class->set_child_property = eclipse_fixed_set_child_property; + container_class->get_child_property = eclipse_fixed_get_child_property;*/ +} + +static GtkType +eclipse_fixed_child_type (GtkContainer *container) +{ + return GTK_TYPE_WIDGET; +} + +static void +eclipse_fixed_init (EclipseFixed *fixed) +{ + GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW); + + fixed->children = NULL; +} + +static void +eclipse_fixed_realize (GtkWidget *widget) +{ + GdkWindowAttr attributes; + gint attributes_mask; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (widget)); + + if (GTK_WIDGET_NO_WINDOW (widget)) + GTK_WIDGET_CLASS (parent_class)->realize (widget); + else + { + GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); + + attributes.window_type = GDK_WINDOW_CHILD; + attributes.x = widget->allocation.x; + attributes.y = widget->allocation.y; + attributes.width = widget->allocation.width; + attributes.height = widget->allocation.height; + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.visual = gtk_widget_get_visual (widget); + attributes.colormap = gtk_widget_get_colormap (widget); + attributes.event_mask = gtk_widget_get_events (widget); + attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK; + + attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; + + widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, + attributes_mask); + gdk_window_set_user_data (widget->window, widget); + + widget->style = gtk_style_attach (widget->style, widget->window); + gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); + } +} + +GtkWidget* +eclipse_fixed_new (void) +{ + EclipseFixed *fixed; + + fixed = gtk_type_new (ECLIPSE_TYPE_FIXED); + return GTK_WIDGET (fixed); +} + +static EclipseFixedChild* +get_child_info (EclipseFixed *fixed, + GtkWidget *widget) +{ + GList *children; + EclipseFixedChild *child_info; + + children = fixed->children; + while (children) + { + child_info = children->data; + children = children->next; + + if (child_info->widget == widget) + return child_info; + } + + return NULL; +} + +void +eclipse_fixed_set_location (EclipseFixed *fixed, + GtkWidget *widget, + int x, + int y) +{ + EclipseFixedChild *child_info; + + g_return_if_fail (fixed != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (fixed)); + g_return_if_fail (widget != NULL); + g_return_if_fail (widget->parent == GTK_WIDGET (fixed)); + + child_info = get_child_info (fixed, widget); + + if (child_info->x == x && child_info->y == y) + return; /* nothing to do */ + + child_info->x = x; + child_info->y = y; + + if (GTK_WIDGET_VISIBLE (fixed) && GTK_WIDGET_VISIBLE (widget)) + gtk_widget_queue_resize (GTK_WIDGET (fixed)); +} + +/* set size to -1 to use natural size */ +void +eclipse_fixed_set_size (EclipseFixed *fixed, + GtkWidget *widget, + int width, + int height) +{ + EclipseFixedChild *child_info; + + g_return_if_fail (fixed != NULL); +if (!GTK_IS_ECLIPSE_FIXED (fixed)) { printf("hey, %s\n", -1); } + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (fixed)); + g_return_if_fail (widget != NULL); + g_return_if_fail (widget->parent == GTK_WIDGET (fixed)); + + child_info = get_child_info (fixed, widget); + + if (child_info->width == width && child_info->height == height) + return; /* nothing to do */ + + child_info->width = width; + child_info->height = height; + + if (GTK_WIDGET_VISIBLE (fixed) && GTK_WIDGET_VISIBLE (widget)) + gtk_widget_queue_resize (GTK_WIDGET (fixed)); +} + + +static GList* +find_link (EclipseFixed *fixed, + GtkWidget *widget) +{ + GList *tmp; + + tmp = fixed->children; + + while (tmp != NULL) + { + if (((EclipseFixedChild*)tmp->data)->widget == widget) + return tmp; + + tmp = tmp->next; + } + + return NULL; +} + +static void +find_sibling_windows (EclipseFixed *fixed, + GtkWidget *widget, + GdkWindow **above, + GdkWindow **below) +{ + GList *tmp; + gboolean seen_ourselves; + + seen_ourselves = FALSE; + + if (below) + *below = NULL; + if (above) + *above = NULL; + + tmp = fixed->children; + while (tmp != NULL) + { + EclipseFixedChild *child = tmp->data; + + if (child->widget == widget) + { + seen_ourselves = TRUE; + } + else if (below && !seen_ourselves) + { + if (*below == NULL && + !GTK_WIDGET_NO_WINDOW (child->widget) && + GTK_WIDGET_REALIZED (child->widget)) + *below = child->widget->window; + } + else if (above && seen_ourselves) + { + if (*above == NULL && + !GTK_WIDGET_NO_WINDOW (child->widget) && + GTK_WIDGET_REALIZED (child->widget)) + *above = child->widget->window; + } + + tmp = tmp->next; + } +} + +/* sibling == NULL means raise to top */ +void +eclipse_fixed_move_above (EclipseFixed *fixed, + GtkWidget *widget, + GtkWidget *sibling) +{ + GList *sibling_link; + GList *widget_link; + + g_return_if_fail (fixed != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (fixed)); + g_return_if_fail (widget != sibling); + g_return_if_fail (widget->parent == GTK_WIDGET (fixed)); + g_return_if_fail (sibling == NULL || sibling->parent == GTK_WIDGET (fixed)); + + sibling_link = find_link (fixed, sibling); + widget_link = find_link (fixed, widget); + + g_assert (widget_link); + + /* remove widget link */ + fixed->children = g_list_remove_link (fixed->children, widget_link); + + if (sibling_link) + { + GdkWindow *above, *below; + + widget_link->prev = sibling_link; + widget_link->next = sibling_link->next; + if (widget_link->next) + widget_link->next->prev = widget_link; + sibling_link->next = widget_link; + + if (!GTK_WIDGET_NO_WINDOW (widget) && GTK_WIDGET_REALIZED (widget)) + { + find_sibling_windows (fixed, widget, &above, &below); + if (below) + move_gdk_window_above (widget->window, below); + else if (above) + move_gdk_window_below (widget->window, above); + } + } + else + { + if (!GTK_WIDGET_NO_WINDOW (widget) && GTK_WIDGET_REALIZED (widget)) + gdk_window_raise (widget->window); + + fixed->children = g_list_append (fixed->children, widget_link->data); + g_list_free_1 (widget_link); + } + + /* Redraw no-window widgets, window widgets will do fine + * on their own + */ + if (GTK_WIDGET_NO_WINDOW (widget)) + gtk_widget_queue_draw (widget); + if (sibling && GTK_WIDGET_NO_WINDOW (sibling)) + gtk_widget_queue_draw (sibling); +} + +/* sibling == NULL means lower to bottom */ +void +eclipse_fixed_move_below (EclipseFixed *fixed, + GtkWidget *widget, + GtkWidget *sibling) +{ + GList *sibling_link; + GList *widget_link; + + g_return_if_fail (fixed != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (fixed)); + g_return_if_fail (widget != sibling); + g_return_if_fail (widget->parent == GTK_WIDGET (fixed)); + g_return_if_fail (sibling == NULL || sibling->parent == GTK_WIDGET (fixed)); + + sibling_link = find_link (fixed, sibling); + widget_link = find_link (fixed, widget); + + g_assert (widget_link); + + /* remove widget link */ + fixed->children = g_list_remove_link (fixed->children, widget_link); + + if (sibling_link) + { + GdkWindow *above, *below; + + widget_link->next = sibling_link; + widget_link->prev = sibling_link->prev; + if (widget_link->prev) + widget_link->prev->next = widget_link; + sibling_link->prev = widget_link; + if (widget_link->prev == NULL) + fixed->children = widget_link; + + if (!GTK_WIDGET_NO_WINDOW (widget) && GTK_WIDGET_REALIZED (widget)) + { + find_sibling_windows (fixed, widget, &above, &below); + if (above) + move_gdk_window_below (widget->window, above); + else if (below) + move_gdk_window_above (widget->window, below); + } + } + else + { + if (!GTK_WIDGET_NO_WINDOW (widget) & GTK_WIDGET_REALIZED (widget)) + gdk_window_lower (widget->window); + + fixed->children = g_list_prepend (fixed->children, widget_link->data); + g_list_free_1 (widget_link); + } + + /* Redraw no-window widgets, window widgets will do fine + * on their own + */ + if (GTK_WIDGET_NO_WINDOW (widget)) + gtk_widget_queue_draw (widget); + if (sibling && GTK_WIDGET_NO_WINDOW (sibling)) + gtk_widget_queue_draw (sibling); +} + +static void +eclipse_fixed_map (GtkWidget *widget) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GList *children; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (widget)); + + GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); + fixed = ECLIPSE_FIXED (widget); + + /* First we need to realize all children and fix their + * stacking order, before we map them + */ + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget) && + !GTK_WIDGET_REALIZED (child->widget)) + gtk_widget_realize (child->widget); + + if (!GTK_WIDGET_NO_WINDOW (child->widget)) + gdk_window_raise (child->widget->window); + } + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget) && + !GTK_WIDGET_MAPPED (child->widget)) + gtk_widget_map (child->widget); + } +} + +static void +eclipse_fixed_size_request (GtkWidget *widget, + GtkRequisition *requisition) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GList *children; + GtkRequisition child_requisition; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (widget)); + g_return_if_fail (requisition != NULL); + + fixed = ECLIPSE_FIXED (widget); + requisition->width = 0; + requisition->height = 0; + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget)) + { + int w, h; + + gtk_widget_size_request (child->widget, &child_requisition); + + w = child->width < 0 ? child_requisition.width : child->width; + h = child->height < 0 ? child_requisition.height : child->height; + + requisition->height = MAX (requisition->height, + child->y + h); + requisition->width = MAX (requisition->width, + child->x + w); + } + } + + requisition->height += GTK_CONTAINER (fixed)->border_width * 2; + requisition->width += GTK_CONTAINER (fixed)->border_width * 2; +} + +static void +eclipse_fixed_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GtkAllocation child_allocation; + GtkRequisition child_requisition; + GList *children; + int border_width; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED(widget)); + g_return_if_fail (allocation != NULL); + + fixed = ECLIPSE_FIXED (widget); + + widget->allocation = *allocation; + + border_width = GTK_CONTAINER (fixed)->border_width; + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget)) + { + gtk_widget_get_child_requisition (child->widget, &child_requisition); + + child_allocation.x = child->x + border_width; + child_allocation.y = child->y + border_width; + child_allocation.width = child->width < 0 ? child_requisition.width : child->width; + child_allocation.height = child->height < 0 ? child_requisition.height : child->height; + gtk_widget_size_allocate (child->widget, &child_allocation); + } + } +} + +static void +eclipse_fixed_paint (GtkWidget *widget, + GdkRectangle *area) +{ + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (widget)); + g_return_if_fail (area != NULL); + + if (GTK_WIDGET_DRAWABLE (widget)) + gdk_window_clear_area (widget->window, + area->x, area->y, + area->width, area->height); +} + +static void +eclipse_fixed_draw (GtkWidget *widget, + GdkRectangle *area) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GdkRectangle child_area; + GList *children; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (widget)); + + /* Note that we draw from front of fixed->children to back + * which means the stacking order is supposed to be that + */ + if (GTK_WIDGET_DRAWABLE (widget)) + { + fixed = ECLIPSE_FIXED (widget); + eclipse_fixed_paint (widget, area); + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (gtk_widget_intersect (child->widget, area, &child_area)) + gtk_widget_draw (child->widget, &child_area); + } + } +} + +static gint +eclipse_fixed_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GdkEventExpose child_event; + GList *children; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (GTK_IS_ECLIPSE_FIXED (widget), FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + if (GTK_WIDGET_DRAWABLE (widget)) + { + fixed = ECLIPSE_FIXED (widget); + + child_event = *event; + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_NO_WINDOW (child->widget) & + gtk_widget_intersect (child->widget, &event->area, + &child_event.area)) + gtk_widget_event (child->widget, (GdkEvent*) &child_event); + } + } + + return FALSE; +} + +static void +eclipse_fixed_add (GtkContainer *container, + GtkWidget *widget) +{ + EclipseFixedChild *child_info; + EclipseFixed *fixed; + + g_return_if_fail (container != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (container)); + g_return_if_fail (widget != NULL); + + fixed = ECLIPSE_FIXED (container); + + child_info = g_new (EclipseFixedChild, 1); + child_info->widget = widget; + child_info->x = 0; + child_info->y = 0; + child_info->width = -1; + child_info->height = -1; + + gtk_widget_set_parent (widget, GTK_WIDGET (fixed)); + + /* Add at top of stacking order (append) */ + fixed->children = g_list_append (fixed->children, child_info); + + if (GTK_WIDGET_REALIZED (fixed)) + gtk_widget_realize (widget); + + if (GTK_WIDGET_VISIBLE (fixed) && GTK_WIDGET_VISIBLE (widget)) + { + if (GTK_WIDGET_MAPPED (fixed)) + gtk_widget_map (widget); + + gtk_widget_queue_resize (GTK_WIDGET (fixed)); + } +} + +static void +eclipse_fixed_remove (GtkContainer *container, + GtkWidget *widget) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GList *children; + + g_return_if_fail (container != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (container)); + g_return_if_fail (widget != NULL); + + fixed = ECLIPSE_FIXED (container); + + children = fixed->children; + while (children) + { + child = children->data; + + if (child->widget == widget) + { + gboolean was_visible = GTK_WIDGET_VISIBLE (widget); + + gtk_widget_unparent (widget); + + fixed->children = g_list_remove_link (fixed->children, children); + g_list_free (children); + g_free (child); + + if (was_visible && GTK_WIDGET_VISIBLE (container)) + gtk_widget_queue_resize (GTK_WIDGET (container)); + + break; + } + + children = children->next; + } +} + +static void +eclipse_fixed_forall (GtkContainer *container, + gboolean include_internals, + GtkCallback callback, + gpointer callback_data) +{ + EclipseFixed *fixed; + EclipseFixedChild *child; + GList *children; + + g_return_if_fail (container != NULL); + g_return_if_fail (GTK_IS_ECLIPSE_FIXED (container)); + g_return_if_fail (callback != NULL); + + fixed = ECLIPSE_FIXED (container); + + children = fixed->children; + while (children) + { + child = children->data; + children = children->next; + + (* callback) (child->widget, callback_data); + } +} + +#include + +static void +move_gdk_window_above (GdkWindow *window, + GdkWindow *sibling) +{ + + XWindowChanges changes; + + changes.sibling = GDK_WINDOW_XWINDOW (sibling); + changes.stack_mode = Above; + + XConfigureWindow (gdk_display, + GDK_WINDOW_XWINDOW (window), + CWSibling | CWStackMode, + &changes); +} + +static void +move_gdk_window_below (GdkWindow *window, + GdkWindow *sibling) +{ + + XWindowChanges changes; + + changes.sibling = GDK_WINDOW_XWINDOW (sibling); + changes.stack_mode = Below; + + XConfigureWindow (gdk_display, + GDK_WINDOW_XWINDOW (window), + CWSibling | CWStackMode, + &changes); +} + + +#if 1 +/* Test program + * Compile with: + * gcc `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` -I/opt/IBMvame1.4/ive/bin/include eclipsefixed.c + */ + +#include + +static void +raise_to_top (GtkWidget *button, + GtkWidget *fixed) +{ + eclipse_fixed_move_above (ECLIPSE_FIXED (fixed), button, NULL); +} + +int +main (int argc, char **argv) +{ + GtkWidget *window; + GtkWidget *frame; + GtkWidget *fixed; + GtkWidget *button1; + + gtk_init (&argc, &argv); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + frame = gtk_frame_new ("Frame"); + + fixed = eclipse_fixed_new (); + + /* Add them in upside-down order */ + button1 = gtk_button_new_with_label ("On Top"); + gtk_container_add (GTK_CONTAINER (fixed), button1); + + eclipse_fixed_set_location (ECLIPSE_FIXED (fixed), button1, 5, 5); + eclipse_fixed_set_size (ECLIPSE_FIXED (fixed), button1, 100, 30); + + /* Make clicking buttons restack them */ + gtk_signal_connect (GTK_OBJECT (button1), "clicked", + GTK_SIGNAL_FUNC (raise_to_top), + fixed); + + gtk_container_add (GTK_CONTAINER (window), frame); + gtk_container_add (GTK_CONTAINER (frame), fixed); + + gtk_widget_show_all (window); + + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (gtk_main_quit), + NULL); + + gtk_main (); + + return 0; +} + +#endif + + +/* + * SWT JNI Exports + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1new + (JNIEnv *env, jclass that) +{ + return (jint)eclipse_fixed_new(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1get_1location + (JNIEnv *env, jclass that, jint fixed, jint child, jintArray loc) +{ + EclipseFixedChild *childInfo; + jint *loc1 = NULL; + if (loc) { + loc1 = (*env)->GetIntArrayElements(env, loc, NULL); + childInfo = get_child_info ((EclipseFixed*)fixed, (GtkWidget*) child); + loc1[0] = childInfo->x; + loc1[1] = childInfo->y; + (*env)->ReleaseIntArrayElements(env, loc, loc1, 0); + } +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1get_1size + (JNIEnv *env, jclass that, jint fixed, jint child, jintArray sz) +{ + EclipseFixedChild *childInfo; + jint *sz1 = NULL; + if (sz) { + sz1 = (*env)->GetIntArrayElements(env, sz, NULL); + childInfo = get_child_info ((EclipseFixed*)fixed, (GtkWidget*) child); + if (childInfo) { + sz1[0] = childInfo->width; + sz1[1] = childInfo->height; + } + (*env)->ReleaseIntArrayElements(env, sz, sz1, 0); + return (jboolean)(childInfo != 0); + } +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1set_1location + (JNIEnv *env, jclass that, jint fixed, jint child, jint x, jint y) +{ + eclipse_fixed_set_location((EclipseFixed*)fixed, (GtkWidget*) child, x, y); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1set_1size + (JNIEnv *env, jclass that, jint fixed, jint child, jint x, jint y) +{ + eclipse_fixed_set_size((EclipseFixed*)fixed, (GtkWidget*) child, x, y); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1move_1above + (JNIEnv *env, jclass that, jint fixed, jint child, jint sibling) +{ + eclipse_fixed_move_above ((EclipseFixed*)fixed, (GtkWidget*) child, (GtkWidget*) sibling); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_eclipse_1fixed_1move_1below + (JNIEnv *env, jclass that, jint fixed, jint child, jint sibling) +{ + eclipse_fixed_move_below ((EclipseFixed*)fixed, (GtkWidget*) child, (GtkWidget*) sibling); +} + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.h new file mode 100644 index 0000000000..0cb59eb892 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/eclipsefixed.h @@ -0,0 +1,84 @@ +/* Copyright 2001, Havoc Pennington and others */ + +/* Contributors: + * Havoc Pennington - the original version + * Boris Shingarov (OTI) - minor modifications for GTK2; JNI layer + */ + +/* Derived from GtkFixed from GTK+: + * GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#include +#include + +#define ECLIPSE_TYPE_FIXED (eclipse_fixed_get_type ()) +#define ECLIPSE_FIXED(obj) (GTK_CHECK_CAST ((obj), ECLIPSE_TYPE_FIXED, EclipseFixed)) +#define ECLIPSE_FIXED_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), ECLIPSE_TYPE_FIXED, EclipseFixedClass)) +#define GTK_IS_ECLIPSE_FIXED(obj) (GTK_CHECK_TYPE ((obj), ECLIPSE_TYPE_FIXED)) +#define GTK_IS_FIXED_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), ECLIPSE_TYPE_FIXED)) + +typedef struct _EclipseFixed EclipseFixed; +typedef struct _EclipseFixedClass EclipseFixedClass; +typedef struct _EclipseFixedChild EclipseFixedChild; + +struct _EclipseFixed +{ + GtkContainer container; + + GList *children; +}; + +struct _EclipseFixedClass +{ + GtkContainerClass parent_class; +}; + +struct _EclipseFixedChild +{ + GtkWidget *widget; + int x; + int y; + int width; + int height; +}; + +GtkType eclipse_fixed_get_type (void) G_GNUC_CONST; +GtkWidget* eclipse_fixed_new (void); +void eclipse_fixed_set_location (EclipseFixed *fixed, + GtkWidget *widget, + int x, + int y); +void eclipse_fixed_set_size (EclipseFixed *fixed, + GtkWidget *widget, + int width, + int height); +void eclipse_fixed_move_above (EclipseFixed *fixed, + GtkWidget *widget, + GtkWidget *sibling); +void eclipse_fixed_move_below (EclipseFixed *fixed, + GtkWidget *widget, + GtkWidget *sibling); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_gtk.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_gtk.mak index 3a2bfaa43e..ff88124cdb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_gtk.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_gtk.mak @@ -11,126 +11,133 @@ # # Makefile for creating SWT libraries on Linux -include make_common.mak - -SWT_VERSION=$(maj_ver)$(min_ver) - +# User configuration # Define the installation directories for various products. # Your system may have these in a different place. -# IVE_HOME - IBM's version of Java (J9) -IVE_HOME = /bluebird/teamswt/swt-builddir/ive -#IVE_HOME = /opt/IBMvame1.4/ive -JAVA_JNI=$(IVE_HOME)/bin/include -JAVAH=$(IVE_HOME)/bin/javah -LD_LIBRARY_PATH=$(IVE_HOME)/bin +# JAVA_JNI - Depending on your version of JDK, and where +# it is installed, your jni.h may be located differently. +#JAVA_JNI = /bluebird/teamswt/swt-builddir/ive/bin/include +JAVA_JNI = /opt/IBMvame1.4/ive/bin/include + +# Whether we want GTK over X or FB +GTKTARGET = gtk+-2.0 +#GTKTARGET = gtk+-linux-fb-2.0 + +CC = gcc +LD = ld + +include make_common.mak + +SWT_VERSION=$(maj_ver)$(min_ver) # Define the various DLL (shared) libraries to be made. SWT_PREFIX = swt -WS_PREFIX = gtk -SWT_DLL = lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so +OS_PREFIX = linux +SWT_DLL = lib$(SWT_PREFIX)-$(OS_PREFIX)-$(SWT_VERSION).so +SWTPI_DLL = lib$(SWT_PREFIX)-pi-$(OS_PREFIX)-$(SWT_VERSION).so -PI_PREFIX = swt-pi -SWTPI_DLL = lib$(PI_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so +#GNOME_PREFIX = swt-gnome +#GNOME_DLL = lib$(GNOME_PREFIX)-$(OS_PREFIX)-$(SWT_VERSION).so +#GNOME_LIB = -x -shared \ +# -L/usr/lib \ +# -lgnome -lglib \ +# -lm -ldl -GNOME_PREFIX = swt-gnome -GNOME_DLL = lib$(GNOME_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so -GNOME_LIB = -x -shared \ - -L/usr/lib \ - -lgnome -lglib \ - -lm -ldl -PIXBUF_PREFIX = swt-pixbuf -PIXBUF_DLL = lib$(PIXBUF_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so +# Compile and link options from pkg-config +GTKCFLAGS = `pkg-config --cflags $(GTKTARGET)` `pkg-config --cflags pango` +GTKLIBS = `pkg-config --libs $(GTKTARGET)` # # Target Rules # -all: make_swt make_pixbuf # make_gnome +all: make_swt # make_gnome make_swt: $(SWT_DLL) $(SWTPI_DLL) #make_gnome: $(GNOME_DLL) -make_pixbuf: $(PIXBUF_DLL) - # All about Linking -LD=ld +PI_OBJECTS = swt.o swt-gdk.o swt-gdkpixbuf.o \ + swt-gtkcontainers.o swt-gtkcontrols.o swt-gtklists.o swt-gtkmenu.o \ + swt-gtkwidget.o swt-gtkwindow.o swt-pango.o swt-memmove.o \ + eclipsefixed.o + $(SWT_DLL): callback.o $(LD) -x -shared \ -o $(SWT_DLL) callback.o -# Note: your setup may be different. Consult `gtk-config --libs` -$(SWTPI_DLL): swt.o structs.o +$(SWTPI_DLL): $(PI_OBJECTS) structs.o $(LD) -x -shared \ - -L/usr/lib -L/usr/X11R6/lib \ - -lgtk -lgdk -lgmodule -lglib \ - -ldl -lXi -lXext -lX11 -lm -lc \ - -o $(SWTPI_DLL) swt.o structs.o + $(GTKLIBS) \ + -o $(SWTPI_DLL) $(PI_OBJECTS) structs.o #$(GNOME_DLL): gnome.o # $(LD) -o $@ gnome.o $(GNOME_LIB) -$(PIXBUF_DLL): pixbuf.o - $(LD) -x -shared \ - -L/usr/lib -L/usr/X11R6/lib \ - -lgdk_pixbuf \ - -lgtk -lgdk -lgmodule -lglib \ - -ldl -lXi -lXext -lX11 -lm -lc \ - -o $(PIXBUF_DLL) pixbuf.o - # All about Compiling -CC=gcc -SWT_C_FLAGS = -c -O -s \ +CFLAGS = -c -O -s \ -DSWT_VERSION=$(SWT_VERSION) \ -DLINUX -DGTK \ - -fpic \ - -I$(JAVA_JNI) \ - `gtk-config --cflags` + -fpic -fPIC \ + $(GTKCFLAGS) \ + -I$(JAVA_JNI) -SWT_PIXBUF_FLAGS = -c -O -s \ - -DSWT_VERSION=$(SWT_VERSION) \ - -DLINUX -DGTK \ - -fpic \ - -I$(JAVA_JNI) \ - -I/usr/include/gdk-pixbuf \ - `gtk-config --cflags` +callback.o: callback.c + $(CC) $(CFLAGS) callback.c -SWT_GNOME_FLAGS = -c -O -s \ - -DSWT_VERSION=$(SWT_VERSION) \ - -DLINUX -DGTK \ - -fpic \ - -I$(JAVA_JNI) \ - `gnome-config --cflags gnome` +library.o: library.c + $(CC) $(CFLAGS) library.c swt.o: swt.c swt.h - $(CC) $(SWT_C_FLAGS) swt.c + $(CC) $(CFLAGS) $(GTKCFLAGS) swt.c -structs.o: structs.c - $(CC) $(SWT_C_FLAGS) structs.c +swt-gdk.o: swt-gdk.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gdk.c -callback.o: callback.c - $(CC) $(SWT_C_FLAGS) callback.c +swt-gdkpixbuf.o: swt-gdkpixbuf.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gdkpixbuf.c -globals.o: globals.c - $(CC) $(SWT_C_FLAGS) globals.c +swt-gtkcontainers.o: swt-gtkcontainers.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtkcontainers.c -library.o: library.c - $(CC) $(SWT_C_FLAGS) library.c +swt-gtkcontrols.o: swt-gtkcontrols.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtkcontrols.c + +swt-gtklists.o: swt-gtklists.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtklists.c + +swt-gtkmenu.o: swt-gtkmenu.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtkmenu.c + +swt-gtkwidget.o: swt-gtkwidget.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtkwidget.c + +swt-gtkwindow.o: swt-gtkwindow.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-gtkwindow.c + +swt-memmove.o: swt-memmove.c swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) swt-memmove.c + +eclipsefixed.o: eclipsefixed.c eclipsefixed.h swt.h + $(CC) $(CFLAGS) $(GTKCFLAGS) eclipsefixed.c + +structs.o: structs.c + $(CC) $(CFLAGS) $(GTKCFLAGS) structs.c + +globals.o: globals.c + g$(CC)cc $(CFLAGS) $(GTKCFLAGS) globals.c -pixbuf.o: pixbuf.c - $(CC) $(SWT_PIXBUF_FLAGS) pixbuf.c -#gnome.o: gnome.c -# $(CC) $(SWT_GNOME_FLAGS) gnome.c clean: rm -f *.o *.so diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/pixbuf.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/pixbuf.c deleted file mode 100644 index f624fe3577..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/pixbuf.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -#include "swt.h" -#include -#include - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_colorspace - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1colorspace - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_colorspace((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_n_channels - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1n_1channels - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_n_channels((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_has_alpha - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1has_1alpha - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jboolean) gdk_pixbuf_get_has_alpha((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_bits_per_sample - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1bits_1per_1sample - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_bits_per_sample((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_pixels - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1pixels - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_pixels((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_width - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1width - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_width((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_height - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1height - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_height((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_rowstride - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1rowstride - (JNIEnv *env, jclass cl, jint pixbuf) -{ - return (jint) gdk_pixbuf_get_rowstride((GdkPixbuf*)pixbuf); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_new - * Signature: (IZIII)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1new - (JNIEnv *env, jclass cl, - jint colorspace, - jboolean hasAlpha, - jint bpc, - jint width, jint height) -{ - return (jint) gdk_pixbuf_new ( - colorspace, - (gboolean) hasAlpha, - bpc, - width, height - ); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_copy - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1copy - (JNIEnv *env, jclass cl, jint source) { - return (jint)gdk_pixbuf_copy ((GdkPixbuf*) source); -} - - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_render_to_drawable - * Signature: (IIIIIIIIIIII)V - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1render_1to_1drawable - (JNIEnv *env, jclass cl, - jint pixbuf, - jint drawable, - jint gc, - jint src_x, jint src_y, - jint dest_x, jint dest_y, - jint width, jint height, - jint dithering, - jint x_dither, jint y_dither) { - gdk_pixbuf_render_to_drawable ( - (GdkPixbuf*) pixbuf, - (GdkDrawable*) drawable, - (GdkGC*) gc, - src_x, src_y, - dest_x, dest_y, - width, height, - dithering, - x_dither, y_dither - ); -} - - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_render_to_drawable_alpha - * Signature: (IIIIIIIIIIIII)V - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1render_1to_1drawable_1alpha - (JNIEnv *env, jclass cl, - jint pixbuf, - jint drawable, - jint src_x, jint src_y, jint dest_x, jint dest_y, - jint width, jint height, - jint alphaMode, - jint alphaThreshold, - jint dithering, - jint x_dither, jint y_dither) -{ - gdk_pixbuf_render_to_drawable_alpha ( - (GdkPixbuf*) pixbuf, - (GdkDrawable*) drawable, - src_x, src_y, - dest_x, dest_y, - width, height, - alphaMode, - alphaThreshold, - dithering, - x_dither, y_dither - ); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_scale - * Signature: (IIIIIIDDDDI)V - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1scale - (JNIEnv *env, jclass cl, - jint source, jint dest, - jint dest_x, jint dest_y, - jint dest_width, jint dest_height, - jdouble offset_x, jdouble offset_y, - jdouble scale_x, jdouble scale_y, - jint interp_type) { - gdk_pixbuf_scale ((GdkPixbuf*)source, (GdkPixbuf*)dest, - dest_x, dest_y, - dest_width, dest_height, - offset_x, offset_y, - scale_x, scale_y, - interp_type - ); -} - -/* - * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF - * Method: gdk_pixbuf_get_from_drawable - * Signature: (IIIIIIIII)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1from_1drawable - (JNIEnv *env, jclass cl, - jint dest, jint src, jint cmap, - jint src_x, jint src_y, - jint dest_x, jint dest_y, - jint width, jint height) -{ - gdk_pixbuf_get_from_drawable ( - (GdkPixbuf*) dest, - (GdkDrawable*) src, - (GdkColormap*) cmap, - src_x, src_y, - dest_x, dest_y, - width, height); -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.c index 321855b550..fdda81656b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.c @@ -20,43 +20,16 @@ /* Globals */ GdkColor_FID_CACHE GdkColorFc; -GdkEventKey_FID_CACHE GdkEventKeyFc; -GdkEventButton_FID_CACHE GdkEventButtonFc; -GdkEventMotion_FID_CACHE GdkEventMotionFc; GdkEventExpose_FID_CACHE GdkEventExposeFc; GdkFont_FID_CACHE GdkFontFc; GdkGCValues_FID_CACHE GdkGCValuesFc; -GdkImage_FID_CACHE GdkImageFc; -GdkPoint_FID_CACHE GdkPointFc; GdkRectangle_FID_CACHE GdkRectangleFc; GdkVisual_FID_CACHE GdkVisualFc; -GtkObject_FID_CACHE GtkObjectFc; -GtkData_FID_CACHE GtkDataFc; + GtkAdjustment_FID_CACHE GtkAdjustmentFc; GtkAllocation_FID_CACHE GtkAllocationFc; -GtkWidget_FID_CACHE GtkWidgetFc; -GtkContainer_FID_CACHE GtkContainerFc; -GtkBin_FID_CACHE GtkBinFc; -GtkMenu_FID_CACHE GtkMenuFc; -GtkItem_FID_CACHE GtkItemFc; -GtkMenuShell_FID_CACHE GtkMenuShellFc; -GtkMenuItem_FID_CACHE GtkMenuItemFc; -GtkCheckMenuItem_FID_CACHE GtkCheckMenuItemFc; -GtkWindow_FID_CACHE GtkWindowFc; -GtkDialog_FID_CACHE GtkDialogFc; -GtkColorSelectionDialog_FID_CACHE GtkColorSelectionDialogFc;\ -GtkBox_FID_CACHE GtkBoxFc; -GtkHBox_FID_CACHE GtkHBoxFc; GtkCombo_FID_CACHE GtkComboFc; -GtkFileSelection_FID_CACHE GtkFileSelectionFc; -GtkFrame_FID_CACHE GtkFrameFc; -GtkFontSelectionDialog_FID_CACHE GtkFontSelectionDialogFc; GtkCList_FID_CACHE GtkCListFc; -GtkEditable_FID_CACHE GtkEditableFc; -GtkText_FID_CACHE GtkTextFc; -GtkProgress_FID_CACHE GtkProgressFc; -GtkProgressBar_FID_CACHE GtkProgressBarFc; -GtkArg_FID_CACHE GtkArgFc; GtkRequisition_FID_CACHE GtkRequisitionFc; GtkStyle_FID_CACHE GtkStyleFc; GtkStyleClass_FID_CACHE GtkStyleClassFc; @@ -91,83 +64,16 @@ void cacheGdkColorFids(JNIEnv *env, jobject lpGdkColor, PGdkColor_FID_CACHE lpCa lpCache->cached = 1; }; -void cacheGdkEventKeyFids(JNIEnv *env, jobject lpGdkEventKey, PGdkEventKey_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GdkEventKeyClass = (*env)->GetObjectClass(env, lpGdkEventKey); - - lpCache->type = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "type", "I"); - lpCache->window = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "window", "I"); - lpCache->send_event = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "send_event", "B"); - lpCache->time = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "time", "I"); - lpCache->state = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "state", "I"); - lpCache->keyval = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "keyval", "I"); - lpCache->length = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "length", "I"); - lpCache->string = (*env)->GetFieldID(env, lpCache->GdkEventKeyClass, "string", "I"); - lpCache->cached = 1; -}; - -void cacheGdkEventButtonFids(JNIEnv *env, jobject lpGdkEventButton, PGdkEventButton_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GdkEventButtonClass = (*env)->GetObjectClass(env, lpGdkEventButton); - lpCache->type = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "type", "I"); - lpCache->window = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "window", "I"); - lpCache->send_event = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "send_event", "B"); - lpCache->time = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "time", "I"); - lpCache->x = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "x", "J"); - lpCache->y = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "y", "J"); - lpCache->pressure = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "pressure", "J"); - lpCache->xtilt = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "xtilt", "J"); - lpCache->ytilt = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "ytilt", "J"); - lpCache->state = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "state", "I"); - lpCache->button = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "button", "I"); - lpCache->source = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "source", "I"); - lpCache->deviceid = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "deviceid", "I"); - lpCache->x_root = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "x_root", "J"); - lpCache->y_root = (*env)->GetFieldID(env, lpCache->GdkEventButtonClass, "y_root", "J"); - - lpCache->cached = 1; -}; - -void cacheGdkEventMotionFids(JNIEnv *env, jobject lpGdkEventMotion, PGdkEventMotion_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GdkEventMotionClass = (*env)->GetObjectClass(env, lpGdkEventMotion); - lpCache->type = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "type", "I"); - lpCache->window = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "window", "I"); - lpCache->send_event = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "send_event", "B"); - lpCache->time = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "time", "I"); - lpCache->x = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "x", "J"); - lpCache->y = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "y", "J"); - lpCache->pressure = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "pressure", "J"); - lpCache->xtilt = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "xtilt", "J"); - lpCache->ytilt = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "ytilt", "J"); - lpCache->state = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "state", "I"); - lpCache->is_hint = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "is_hint", "I"); - lpCache->source = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "source", "I"); - lpCache->deviceid = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "deviceid", "I"); - lpCache->x_root = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "x_root", "J"); - lpCache->y_root = (*env)->GetFieldID(env, lpCache->GdkEventMotionClass, "y_root", "J"); - - lpCache->cached = 1; -}; - void cacheGdkEventExposeFids(JNIEnv *env, jobject lpGdkEventExpose, PGdkEventExpose_FID_CACHE lpCache) { if (lpCache->cached) return; lpCache->GdkEventExposeClass = (*env)->GetObjectClass(env, lpGdkEventExpose); - lpCache->type = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "type", "I"); - lpCache->window = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "window", "I"); - lpCache->send_event = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "send_event", "B"); lpCache->x = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "x", "S"); lpCache->y = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "y", "S"); lpCache->width = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "width", "S"); lpCache->height = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "height", "S"); + lpCache->region = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "region", "I"); lpCache->count = (*env)->GetFieldID(env, lpCache->GdkEventExposeClass, "count", "I"); lpCache->cached = 1; @@ -219,35 +125,6 @@ void cacheGdkGCValuesFids(JNIEnv *env, jobject lpGdkGCValues, PGdkGCValues_FID_C lpCache->cached = 1; }; -void cacheGdkImageFids(JNIEnv *env, jobject lpGdkImage, PGdkImage_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GdkImageClass = (*env)->GetObjectClass(env, lpGdkImage); - lpCache->type = (*env)->GetFieldID(env, lpCache->GdkImageClass, "type", "I"); - lpCache->visual = (*env)->GetFieldID(env, lpCache->GdkImageClass, "visual", "I"); - lpCache->byte_order = (*env)->GetFieldID(env, lpCache->GdkImageClass, "byte_order", "I"); - lpCache->width = (*env)->GetFieldID(env, lpCache->GdkImageClass, "width", "S"); - lpCache->height = (*env)->GetFieldID(env, lpCache->GdkImageClass, "height", "S"); - lpCache->depth = (*env)->GetFieldID(env, lpCache->GdkImageClass, "depth", "S"); - lpCache->bpp = (*env)->GetFieldID(env, lpCache->GdkImageClass, "bpp", "S"); - lpCache->bpl = (*env)->GetFieldID(env, lpCache->GdkImageClass, "bpl", "S"); - lpCache->mem = (*env)->GetFieldID(env, lpCache->GdkImageClass, "mem", "I"); - - lpCache->cached = 1; -}; - -void cacheGdkPointFids(JNIEnv *env, jobject lpGdkPoint, PGdkPoint_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GdkPointClass = (*env)->GetObjectClass(env, lpGdkPoint); - lpCache->x = (*env)->GetFieldID(env, lpCache->GdkPointClass, "x", "S"); - lpCache->y = (*env)->GetFieldID(env, lpCache->GdkPointClass, "y", "S"); - - lpCache->cached = 1; -}; - void cacheGdkRectangleFids(JNIEnv *env, jobject lpGdkRectangle, PGdkRectangle_FID_CACHE lpCache) { if (lpCache->cached) return; @@ -297,35 +174,12 @@ void cacheGtkAllocationFids(JNIEnv *env, jobject lpGtkAllocation, PGtkAllocation lpCache->cached = 1; }; -void cacheGtkArgFids(JNIEnv *env, jobject lpGtkArg, PGtkArg_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GtkArgClass = (*env)->GetObjectClass(env, lpGtkArg); - - fprintf(stderr, "WARNING: Unimplemented method cacheGtkArgFids.\n"); - lpCache->cached = 1; -}; - -void cacheGtkBinFids(JNIEnv *env, jobject lpGtkBin, PGtkBin_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkBinClass = (*env)->GetObjectClass(env, lpGtkBin); - cacheGtkContainerFids(env, lpGtkBin, &PGLOB(GtkContainerFc)); - lpCache->child = (*env)->GetFieldID(env, lpCache->GtkBinClass, "child", "I"); - - lpCache->cached = 1; -}; - void cacheGtkCListFids(JNIEnv *env, jobject lpGtkCList, PGtkCList_FID_CACHE lpCache) { DECL_GLOB(pGlob) if (lpCache->cached) return; lpCache->GtkCListClass = (*env)->GetObjectClass(env, lpGtkCList); - cacheGtkContainerFids(env, lpGtkCList, &PGLOB(GtkContainerFc)); lpCache->clist_flags = (*env)->GetFieldID(env, lpCache->GtkCListClass, "clist_flags", "S"); lpCache->row_mem_chunk = (*env)->GetFieldID(env, lpCache->GtkCListClass, "row_mem_chunk", "I"); lpCache->cell_mem_chunk = (*env)->GetFieldID(env, lpCache->GtkCListClass, "cell_mem_chunk", "I"); @@ -335,7 +189,6 @@ void cacheGtkCListFids(JNIEnv *env, jobject lpGtkCList, PGtkCList_FID_CACHE lpCa lpCache->internal_allocation_width = (*env)->GetFieldID(env, lpCache->GtkCListClass, "internal_allocation_width", "S"); lpCache->internal_allocation_height = (*env)->GetFieldID(env, lpCache->GtkCListClass, "internal_allocation_height", "S"); lpCache->rows = (*env)->GetFieldID(env, lpCache->GtkCListClass, "rows", "I"); - lpCache->row_center_offset = (*env)->GetFieldID(env, lpCache->GtkCListClass, "row_center_offset", "I"); lpCache->row_height = (*env)->GetFieldID(env, lpCache->GtkCListClass, "row_height", "I"); lpCache->row_list = (*env)->GetFieldID(env, lpCache->GtkCListClass, "row_list", "I"); lpCache->row_list_end = (*env)->GetFieldID(env, lpCache->GtkCListClass, "row_list_end", "I"); @@ -386,203 +239,14 @@ void cacheGtkCListFids(JNIEnv *env, jobject lpGtkCList, PGtkCList_FID_CACHE lpCa lpCache->cached = 1; }; - -void cacheGtkColorSelectionDialogFids(JNIEnv *env, jobject lpGtkColorSelectionDialog, PGtkColorSelectionDialog_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkColorSelectionDialogClass = (*env)->GetObjectClass(env, lpGtkColorSelectionDialog); - cacheGtkWindowFids(env, lpGtkColorSelectionDialog, &PGLOB(GtkWindowFc)); - lpCache->colorsel = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "colorsel", "I"); - lpCache->main_vbox = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "main_vbox", "I"); - lpCache->ok_button = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "ok_button", "I"); - lpCache->reset_button = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "reset_button", "I"); - lpCache->cancel_button = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "cancel_button", "I"); - lpCache->help_button = (*env)->GetFieldID(env, lpCache->GtkColorSelectionDialogClass, "help_button", "I"); - - lpCache->cached = 1; -}; - void cacheGtkComboFids(JNIEnv *env, jobject lpGtkCombo, PGtkCombo_FID_CACHE lpCache) { DECL_GLOB(pGlob) if (lpCache->cached) return; lpCache->GtkComboClass = (*env)->GetObjectClass(env, lpGtkCombo); - cacheGtkHBoxFids(env, lpGtkCombo, &PGLOB(GtkHBoxFc)); lpCache->entry = (*env)->GetFieldID(env, lpCache->GtkComboClass, "entry", "I"); - lpCache->button = (*env)->GetFieldID(env, lpCache->GtkComboClass, "button", "I"); - lpCache->popup = (*env)->GetFieldID(env, lpCache->GtkComboClass, "popup", "I"); - lpCache->popwin = (*env)->GetFieldID(env, lpCache->GtkComboClass, "popwin", "I"); lpCache->list = (*env)->GetFieldID(env, lpCache->GtkComboClass, "list", "I"); - lpCache->entry_change_id = (*env)->GetFieldID(env, lpCache->GtkComboClass, "entry_change_id", "I"); - lpCache->list_change_id = (*env)->GetFieldID(env, lpCache->GtkComboClass, "list_change_id", "I"); - lpCache->value_in_list = (*env)->GetFieldID(env, lpCache->GtkComboClass, "value_in_list", "I"); - lpCache->ok_if_empty = (*env)->GetFieldID(env, lpCache->GtkComboClass, "ok_if_empty", "I"); - lpCache->case_sensitive = (*env)->GetFieldID(env, lpCache->GtkComboClass, "case_sensitive", "I"); - lpCache->use_arrows = (*env)->GetFieldID(env, lpCache->GtkComboClass, "use_arrows", "I"); - lpCache->use_arrows_always = (*env)->GetFieldID(env, lpCache->GtkComboClass, "use_arrows_always", "I"); - lpCache->current_button = (*env)->GetFieldID(env, lpCache->GtkComboClass, "current_button", "S"); - lpCache->activate_id = (*env)->GetFieldID(env, lpCache->GtkComboClass, "activate_id", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkContainerFids(JNIEnv *env, jobject lpGtkContainer, PGtkContainer_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkContainerClass = (*env)->GetObjectClass(env, lpGtkContainer); - cacheGtkWidgetFids(env, lpGtkContainer, &PGLOB(GtkWidgetFc)); - lpCache->focus_child = (*env)->GetFieldID(env, lpCache->GtkContainerClass, "focus_child", "I"); - lpCache->border_width = (*env)->GetFieldID(env, lpCache->GtkContainerClass, "border_width", "I"); - lpCache->need_resize = (*env)->GetFieldID(env, lpCache->GtkContainerClass, "need_resize", "I"); - lpCache->resize_mode = (*env)->GetFieldID(env, lpCache->GtkContainerClass, "resize_mode", "I"); - lpCache->resize_widgets = (*env)->GetFieldID(env, lpCache->GtkContainerClass, "resize_widgets", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkDataFids(JNIEnv *env, jobject lpGtkData, PGtkData_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkDataClass = (*env)->GetObjectClass(env, lpGtkData); - cacheGtkObjectFids(env, lpGtkData, &PGLOB(GtkObjectFc)); - - lpCache->cached = 1; -}; - -void cacheGtkEditableFids(JNIEnv *env, jobject lpGtkEditable, PGtkEditable_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkEditableClass = (*env)->GetObjectClass(env, lpGtkEditable); - cacheGtkWidgetFids(env, lpGtkEditable, &PGLOB(GtkWidgetFc)); - lpCache->current_pos = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "current_pos", "I"); - lpCache->selection_start_pos = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "selection_start_pos", "I"); - lpCache->selection_end_pos = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "selection_end_pos", "I"); - lpCache->has_selection = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "has_selection", "I"); - lpCache->editable = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "editable", "I"); - lpCache->visible = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "visible", "I"); - lpCache->ic = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "ic", "I"); - lpCache->ic_attr = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "ic_attr", "I"); - lpCache->clipboard_text = (*env)->GetFieldID(env, lpCache->GtkEditableClass, "clipboard_text", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkTextFids(JNIEnv *env, jobject lpGtkText, PGtkText_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkTextClass = (*env)->GetObjectClass(env, lpGtkText); - cacheGtkEditableFids(env, lpGtkText, &PGLOB(GtkEditableFc)); - - lpCache->first_line_start_index = (*env)->GetFieldID(env, lpCache->GtkTextClass, "first_line_start_index", "I"); - lpCache->first_onscreen_hor_pixel = (*env)->GetFieldID(env, lpCache->GtkTextClass, "first_onscreen_hor_pixel", "I"); - lpCache->first_onscreen_ver_pixel = (*env)->GetFieldID(env, lpCache->GtkTextClass, "first_onscreen_ver_pixel", "I"); - lpCache->default_tab_width = (*env)->GetFieldID(env, lpCache->GtkTextClass, "default_tab_width", "I"); - lpCache->cursor_pos_x = (*env)->GetFieldID(env, lpCache->GtkTextClass, "cursor_pos_x", "I"); - lpCache->cursor_pos_y = (*env)->GetFieldID(env, lpCache->GtkTextClass, "cursor_pos_y", "I"); - lpCache->cursor_virtual_x = (*env)->GetFieldID(env, lpCache->GtkTextClass, "cursor_virtual_x", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkFileSelectionFids(JNIEnv *env, jobject lpGtkFileSelection, PGtkFileSelection_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkFileSelectionClass = (*env)->GetObjectClass(env, lpGtkFileSelection); - cacheGtkWindowFids(env, lpGtkFileSelection, &PGLOB(GtkWindowFc)); - lpCache->dir_list = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "dir_list", "I"); - lpCache->file_list = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "file_list", "I"); - lpCache->selection_entry = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "selection_entry", "I"); - lpCache->selection_text = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "selection_text", "I"); - lpCache->main_vbox = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "main_vbox", "I"); - lpCache->ok_button = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "ok_button", "I"); - lpCache->cancel_button = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "cancel_button", "I"); - lpCache->help_button = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "help_button", "I"); - lpCache->history_pulldown = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "history_pulldown", "I"); - lpCache->history_menu = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "history_menu", "I"); - lpCache->history_list = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "history_list", "I"); - lpCache->fileop_dialog = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_dialog", "I"); - lpCache->fileop_entry = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_entry", "I"); - lpCache->fileop_file = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_file", "I"); - lpCache->cmpl_state = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "cmpl_state", "I"); - lpCache->fileop_c_dir = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_c_dir", "I"); - lpCache->fileop_del_file = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_del_file", "I"); - lpCache->fileop_ren_file = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "fileop_ren_file", "I"); - lpCache->button_area = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "button_area", "I"); - lpCache->action_area = (*env)->GetFieldID(env, lpCache->GtkFileSelectionClass, "action_area", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkFontSelectionDialogFids(JNIEnv *env, jobject lpGtkFontSelectionDialog, PGtkFontSelectionDialog_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkFontSelectionDialogClass = (*env)->GetObjectClass(env, lpGtkFontSelectionDialog); - cacheGtkWindowFids(env, lpGtkFontSelectionDialog, &PGLOB(GtkWindowFc)); - lpCache->fontsel = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "fontsel", "I"); - lpCache->main_vbox = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "main_vbox", "I"); - lpCache->action_area = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "action_area", "I"); - lpCache->ok_button = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "ok_button", "I"); - lpCache->apply_button = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "apply_button", "I"); - lpCache->cancel_button = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "cancel_button", "I"); - lpCache->dialog_width = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "dialog_width", "I"); - lpCache->auto_resize = (*env)->GetFieldID(env, lpCache->GtkFontSelectionDialogClass, "auto_resize", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkObjectFids(JNIEnv *env, jobject lpGtkObject, PGtkObject_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GtkObjectClass = (*env)->GetObjectClass(env, lpGtkObject); - lpCache->klass = (*env)->GetFieldID(env, lpCache->GtkObjectClass, "klass", "I"); - lpCache->flags = (*env)->GetFieldID(env, lpCache->GtkObjectClass, "flags", "I"); - lpCache->ref_count = (*env)->GetFieldID(env, lpCache->GtkObjectClass, "ref_count", "I"); - lpCache->object_data = (*env)->GetFieldID(env, lpCache->GtkObjectClass, "object_data", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkProgressFids(JNIEnv *env, jobject lpGtkProgress, PGtkProgress_FID_CACHE lpCache) -{ - if (lpCache->cached) return; - - lpCache->GtkProgressClass = (*env)->GetObjectClass(env, lpGtkProgress); - - fprintf(stderr, "WARNING: Unimplemented method cacheGtkProgressFids.\n"); - lpCache->cached = 1; -}; - -void cacheGtkProgressBarFids(JNIEnv *env, jobject lpGtkProgressBar, PGtkProgressBar_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkProgressBarClass = (*env)->GetObjectClass(env, lpGtkProgressBar); - cacheGtkProgressFids(env, lpGtkProgressBar, &PGLOB(GtkProgressFc)); - lpCache->bar_style = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "bar_style", "I"); - lpCache->orientation = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "orientation", "I"); - lpCache->blocks = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "blocks", "I"); - lpCache->in_block = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "in_block", "I"); - lpCache->activity_pos = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "activity_pos", "I"); - lpCache->activity_step = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "activity_step", "I"); - lpCache->activity_blocks = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "activity_blocks", "I"); - lpCache->activity_dir = (*env)->GetFieldID(env, lpCache->GtkProgressBarClass, "activity_dir", "I"); lpCache->cached = 1; }; @@ -603,7 +267,6 @@ void cacheGtkStyleFids(JNIEnv *env, jobject lpGtkStyle, PGtkStyle_FID_CACHE lpCa if (lpCache->cached) return; lpCache->GtkStyleClazz = (*env)->GetObjectClass(env, lpGtkStyle); - lpCache->klass = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "klass", "I"); lpCache->fg0_pixel = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg0_pixel", "I"); lpCache->fg0_red = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg0_red", "S"); lpCache->fg0_green = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg0_green", "S"); @@ -744,6 +407,7 @@ void cacheGtkStyleFids(JNIEnv *env, jobject lpGtkStyle, PGtkStyle_FID_CACHE lpCa lpCache->base4_red = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base4_red", "S"); lpCache->base4_green = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base4_green", "S"); lpCache->base4_blue = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base4_blue", "S"); + lpCache->black_pixel = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "black_pixel", "I"); lpCache->black_red = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "black_red", "S"); lpCache->black_green = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "black_green", "S"); @@ -752,7 +416,9 @@ void cacheGtkStyleFids(JNIEnv *env, jobject lpGtkStyle, PGtkStyle_FID_CACHE lpCa lpCache->white_red = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "white_red", "S"); lpCache->white_green = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "white_green", "S"); lpCache->white_blue = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "white_blue", "S"); - lpCache->font = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "font", "I"); + + lpCache->font_desc = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "font_desc", "I"); + lpCache->fg_gc0 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg_gc0", "I"); lpCache->fg_gc1 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg_gc1", "I"); lpCache->fg_gc2 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "fg_gc2", "I"); @@ -788,21 +454,15 @@ void cacheGtkStyleFids(JNIEnv *env, jobject lpGtkStyle, PGtkStyle_FID_CACHE lpCa lpCache->base_gc2 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base_gc2", "I"); lpCache->base_gc3 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base_gc3", "I"); lpCache->base_gc4 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "base_gc4", "I"); + lpCache->black_gc = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "black_gc", "I"); lpCache->white_gc = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "white_gc", "I"); + lpCache->bg_pixmap0 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "bg_pixmap0", "I"); lpCache->bg_pixmap1 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "bg_pixmap1", "I"); lpCache->bg_pixmap2 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "bg_pixmap2", "I"); lpCache->bg_pixmap3 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "bg_pixmap3", "I"); lpCache->bg_pixmap4 = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "bg_pixmap4", "I"); - lpCache->ref_count = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "ref_count", "I"); - lpCache->attach_count = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "attach_count", "I"); - lpCache->depth = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "depth", "I"); - lpCache->colormap = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "colormap", "I"); - lpCache->engine = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "engine", "I"); - lpCache->engine_data = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "engine_data", "I"); - lpCache->rc_style = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "rc_style", "I"); - lpCache->styles = (*env)->GetFieldID(env, lpCache->GtkStyleClazz, "styles", "I"); lpCache->cached = 1; }; @@ -818,200 +478,18 @@ void cacheGtkStyleClassFids(JNIEnv *env, jobject lpGtkStyleClass, PGtkStyleClass lpCache->cached = 1; }; -void cacheGtkWidgetFids(JNIEnv *env, jobject lpGtkWidget, PGtkWidget_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkWidgetClass = (*env)->GetObjectClass(env, lpGtkWidget); - cacheGtkObjectFids(env, lpGtkWidget, &PGLOB(GtkObjectFc)); - lpCache->private_flags = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "private_flags", "S"); - lpCache->state = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "state", "B"); - lpCache->saved_state = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "saved_state", "B"); - lpCache->name = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "name", "I"); - lpCache->style = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "style", "I"); - lpCache->req_width = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "req_width", "S"); - lpCache->req_height = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "req_height", "S"); - lpCache->alloc_x = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "alloc_x", "S"); - lpCache->alloc_y = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "alloc_y", "S"); - lpCache->alloc_width = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "alloc_width", "S"); - lpCache->alloc_height = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "alloc_height", "S"); - lpCache->window = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "window", "I"); - lpCache->parent = (*env)->GetFieldID(env, lpCache->GtkWidgetClass, "parent", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkFrameFids(JNIEnv *env, jobject lpGtkFrame, PGtkFrame_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkFrameClass = (*env)->GetObjectClass(env, lpGtkFrame); - cacheGtkBinFids(env, lpGtkFrame, &PGLOB(GtkBinFc)); - lpCache->label = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "label", "I"); - lpCache->shadow_type = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "shadow_type", "S"); - lpCache->label_width = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "label_width", "S"); - lpCache->label_height = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "label_height", "S"); - lpCache->label_xalign = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "label_xalign", "F"); - lpCache->label_yalign = (*env)->GetFieldID(env, lpCache->GtkFrameClass, "label_yalign", "F"); - - lpCache->cached = 1; -}; - -void cacheGtkWindowFids(JNIEnv *env, jobject lpGtkWindow, PGtkWindow_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkWindowClass = (*env)->GetObjectClass(env, lpGtkWindow); - cacheGtkBinFids(env, lpGtkWindow, &PGLOB(GtkBinFc)); - lpCache->title = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "title", "I"); - lpCache->wmclass_name = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "wmclass_name", "I"); - lpCache->wmclass_class = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "wmclass_class", "I"); - lpCache->type = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "type", "I"); - lpCache->focus_widget = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "focus_widget", "I"); - lpCache->default_widget = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "default_widget", "I"); - lpCache->transient_parent = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "transient_parent", "I"); - lpCache->resize_count = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "resize_count", "S"); - lpCache->allow_shrink = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "allow_shrink", "I"); - lpCache->allow_grow = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "allow_grow", "I"); - lpCache->auto_shrink = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "auto_shrink", "I"); - lpCache->handling_resize = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "handling_resize", "I"); - lpCache->position = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "position", "I"); - lpCache->use_uposition = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "use_uposition", "I"); - lpCache->modal = (*env)->GetFieldID(env, lpCache->GtkWindowClass, "modal", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkDialogFids(JNIEnv *env, jobject lpGtkDialog, PGtkDialog_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkDialogClass = (*env)->GetObjectClass(env, lpGtkDialog); - cacheGtkWindowFids(env, lpGtkDialog, &PGLOB(GtkWindowFc)); - lpCache->vbox = (*env)->GetFieldID(env, lpCache->GtkDialogClass, "vbox", "I"); - lpCache->action_area = (*env)->GetFieldID(env, lpCache->GtkDialogClass, "action_area", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkCheckMenuItemFids(JNIEnv *env, jobject lpGtkCheckMenuItem, PGtkCheckMenuItem_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkCheckMenuItemClass = (*env)->GetObjectClass(env, lpGtkCheckMenuItem); - cacheGtkMenuItemFids(env, lpGtkCheckMenuItem, &PGLOB(GtkMenuItemFc)); - lpCache->active = (*env)->GetFieldID(env, lpCache->GtkCheckMenuItemClass, "active", "I"); - lpCache->always_show_toggle = (*env)->GetFieldID(env, lpCache->GtkCheckMenuItemClass, "always_show_toggle", "I"); - - lpCache->cached = 1; -}; - void cacheGtkAdjustmentFids(JNIEnv *env, jobject lpGtkAdjustment, PGtkAdjustment_FID_CACHE lpCache) { DECL_GLOB(pGlob) if (lpCache->cached) return; lpCache->GtkAdjustmentClass = (*env)->GetObjectClass(env, lpGtkAdjustment); - cacheGtkDataFids(env, lpGtkAdjustment, &PGLOB(GtkDataFc)); - lpCache->lower = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "lower", "F"); - lpCache->upper = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "upper", "F"); - lpCache->value = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "value", "F"); - lpCache->step_increment = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "step_increment", "F"); - lpCache->page_increment = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "page_increment", "F"); - lpCache->page_size = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "page_size", "F"); - - lpCache->cached = 1; -}; - -void cacheGtkBoxFids(JNIEnv *env, jobject lpGtkBox, PGtkBox_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkBoxClass = (*env)->GetObjectClass(env, lpGtkBox); - cacheGtkContainerFids(env, lpGtkBox, &PGLOB(GtkContainerFc)); - lpCache->children = (*env)->GetFieldID(env, lpCache->GtkBoxClass, "children", "I"); - lpCache->spacing = (*env)->GetFieldID(env, lpCache->GtkBoxClass, "spacing", "S"); - lpCache->homogeneous = (*env)->GetFieldID(env, lpCache->GtkBoxClass, "homogeneous", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkHBoxFids(JNIEnv *env, jobject lpGtkHBox, PGtkHBox_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkHBoxClass = (*env)->GetObjectClass(env, lpGtkHBox); - cacheGtkBoxFids(env, lpGtkHBox, &PGLOB(GtkBoxFc)); - - lpCache->cached = 1; -}; - -void cacheGtkMenuFids(JNIEnv *env, jobject lpGtkMenu, PGtkMenu_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkMenuClass = (*env)->GetObjectClass(env, lpGtkMenu); - cacheGtkMenuShellFids(env, lpGtkMenu, &PGLOB(GtkMenuShellFc)); - lpCache->parent_menu_item = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "parent_menu_item", "I"); - lpCache->old_active_menu_item = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "old_active_menu_item", "I"); - lpCache->accel_group = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "accel_group", "I"); - lpCache->position_func = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "position_func", "I"); - lpCache->position_func_data = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "position_func_data", "I"); - lpCache->toplevel = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "toplevel", "I"); - lpCache->tearoff_window = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "tearoff_window", "I"); - lpCache->torn_off = (*env)->GetFieldID(env, lpCache->GtkMenuClass, "torn_off", "I"); - - lpCache->cached = 1; -}; - -void cacheGtkMenuShellFids(JNIEnv *env, jobject lpGtkMenuShell, PGtkMenuShell_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkMenuShellClass = (*env)->GetObjectClass(env, lpGtkMenuShell); - cacheGtkContainerFids(env, lpGtkMenuShell, &PGLOB(GtkContainerFc)); - lpCache->active = (*env)->GetFieldID(env, lpCache->GtkMenuShellClass, "active", "I"); - lpCache->cached = 1; - -}; - -void cacheGtkItemFids(JNIEnv *env, jobject lpGtkItem, PGtkItem_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkItemClass = (*env)->GetObjectClass(env, lpGtkItem); - cacheGtkBinFids(env, lpGtkItem, &PGLOB(GtkBinFc)); - - lpCache->cached = 1; -} - -void cacheGtkMenuItemFids(JNIEnv *env, jobject lpGtkMenuItem, PGtkMenuItem_FID_CACHE lpCache) -{ - DECL_GLOB(pGlob) - if (lpCache->cached) return; - - lpCache->GtkMenuItemClass = (*env)->GetObjectClass(env, lpGtkMenuItem); - cacheGtkItemFids(env, lpGtkMenuItem, &PGLOB(GtkItemFc)); - lpCache->submenu = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "submenu", "I"); - lpCache->accelerator_signal = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "accelerator_signal", "I"); - lpCache->toggle_size = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "toggle_size", "I"); - lpCache->accelerator_width = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "accelerator_width", "I"); - lpCache->show_toggle_indicator = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "show_toggle_indicator", "I"); - lpCache->show_submenu_indicator = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "show_submenu_indicator", "I"); - lpCache->submenu_placement = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "submenu_placement", "I"); - lpCache->submenu_direction = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "submenu_direction", "I"); - lpCache->right_justify = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "right_justify", "I"); - lpCache->timer = (*env)->GetFieldID(env, lpCache->GtkMenuItemClass, "timer", "I"); + lpCache->lower = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "lower", "D"); + lpCache->upper = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "upper", "D"); + lpCache->value = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "value", "D"); + lpCache->step_increment = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "step_increment", "D"); + lpCache->page_increment = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "page_increment", "D"); + lpCache->page_size = (*env)->GetFieldID(env, lpCache->GtkAdjustmentClass, "page_size", "D"); lpCache->cached = 1; }; @@ -1122,112 +600,6 @@ void setGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpGdkColor, GdkC (*env)->SetShortField(env, lpObject, lpGdkColorFc->blue, (jshort)lpGdkColor->blue); } -void getGdkEventKeyFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventKey_FID_CACHE *lpGdkEventKeyFc) -{ - GdkEventKey *lpGdkEventKey = (GdkEventKey*)lpGdkEvent; - lpGdkEventKey->type = (*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->type); - lpGdkEventKey->window = (GdkWindow*)(*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->window); - lpGdkEventKey->send_event = (*env)->GetByteField(env, lpObject, lpGdkEventKeyFc->send_event); - lpGdkEventKey->time = (*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->time); - lpGdkEventKey->state = (*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->state); - lpGdkEventKey->keyval = (*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->keyval); - lpGdkEventKey->length = (*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->length); - lpGdkEventKey->string = (char*)(*env)->GetIntField(env, lpObject, lpGdkEventKeyFc->string); -} - -void setGdkEventKeyFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventKey_FID_CACHE *lpGdkEventKeyFc) -{ - GdkEventKey *lpGdkEventKey = (GdkEventKey*)lpGdkEvent; - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->type, (jint)lpGdkEventKey->type); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->window, (jint)lpGdkEventKey->window); - (*env)->SetByteField(env, lpObject, lpGdkEventKeyFc->send_event, (jbyte)lpGdkEventKey->send_event); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->time, (jint)lpGdkEventKey->time); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->state, (jint)lpGdkEventKey->state); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->keyval, (jint)lpGdkEventKey->keyval); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->length, (jint)lpGdkEventKey->length); - (*env)->SetIntField(env, lpObject, lpGdkEventKeyFc->string, (jint)lpGdkEventKey->string); -} - -void getGdkEventButtonFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventButton_FID_CACHE *lpGdkEventButtonFc) -{ - GdkEventButton *lpGdkEventButton = (GdkEventButton*)lpGdkEvent; - lpGdkEventButton->type = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->type); - lpGdkEventButton->window = (GdkWindow*)(*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->window); - lpGdkEventButton->send_event = (*env)->GetByteField(env, lpObject, lpGdkEventButtonFc->send_event); - lpGdkEventButton->time = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->time); - lpGdkEventButton->x = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->x); - lpGdkEventButton->y = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->y); - lpGdkEventButton->pressure = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->pressure); - lpGdkEventButton->xtilt = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->xtilt); - lpGdkEventButton->ytilt = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->ytilt); - lpGdkEventButton->state = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->state); - lpGdkEventButton->button = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->button); - lpGdkEventButton->source = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->source); - lpGdkEventButton->deviceid = (*env)->GetIntField(env, lpObject, lpGdkEventButtonFc->deviceid); - lpGdkEventButton->x_root = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->x_root); - lpGdkEventButton->y_root = (*env)->GetLongField(env, lpObject, lpGdkEventButtonFc->y_root); -} - -void setGdkEventButtonFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventButton_FID_CACHE *lpGdkEventButtonFc) -{ - GdkEventButton *lpGdkEventButton = (GdkEventButton*)lpGdkEvent; - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->type, (jint)lpGdkEventButton->type); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->window, (jint)lpGdkEventButton->window); - (*env)->SetByteField(env, lpObject, lpGdkEventButtonFc->send_event, (jbyte)lpGdkEventButton->send_event); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->time, (jint)lpGdkEventButton->time); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->x, (jlong)lpGdkEventButton->x); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->y, (jlong)lpGdkEventButton->y); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->pressure, (jlong)lpGdkEventButton->pressure); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->xtilt, (jlong)lpGdkEventButton->xtilt); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->ytilt, (jlong)lpGdkEventButton->ytilt); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->state, (jint)lpGdkEventButton->state); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->button, (jint)lpGdkEventButton->button); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->source, (jint)lpGdkEventButton->source); - (*env)->SetIntField(env, lpObject, lpGdkEventButtonFc->deviceid, (jint)lpGdkEventButton->deviceid); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->x_root, (jlong)lpGdkEventButton->x_root); - (*env)->SetLongField(env, lpObject, lpGdkEventButtonFc->y_root, (jlong)lpGdkEventButton->y_root); -} - -void getGdkEventMotionFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventMotion_FID_CACHE *lpGdkEventMotionFc) -{ - GdkEventMotion *lpGdkEventMotion = (GdkEventMotion*)lpGdkEvent; - lpGdkEventMotion->type = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->type); - lpGdkEventMotion->window = (GdkWindow*)(*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->window); - lpGdkEventMotion->send_event = (*env)->GetByteField(env, lpObject, lpGdkEventMotionFc->send_event); - lpGdkEventMotion->time = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->time); - lpGdkEventMotion->x = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->x); - lpGdkEventMotion->y = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->y); - lpGdkEventMotion->pressure = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->pressure); - lpGdkEventMotion->xtilt = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->xtilt); - lpGdkEventMotion->ytilt = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->ytilt); - lpGdkEventMotion->state = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->state); - lpGdkEventMotion->is_hint = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->is_hint); - lpGdkEventMotion->source = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->source); - lpGdkEventMotion->deviceid = (*env)->GetIntField(env, lpObject, lpGdkEventMotionFc->deviceid); - lpGdkEventMotion->x_root = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->x_root); - lpGdkEventMotion->y_root = (*env)->GetLongField(env, lpObject, lpGdkEventMotionFc->y_root); -} - -void setGdkEventMotionFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventMotion_FID_CACHE *lpGdkEventMotionFc) -{ - GdkEventMotion *lpGdkEventMotion = (GdkEventMotion*)lpGdkEvent; - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->type, lpGdkEventMotion->type); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->window, (jint)lpGdkEventMotion->window); - (*env)->SetByteField(env, lpObject, lpGdkEventMotionFc->send_event, lpGdkEventMotion->send_event); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->time, (jint)lpGdkEventMotion->time); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->x, (jlong)lpGdkEventMotion->x); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->y, (jlong)lpGdkEventMotion->y); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->pressure, (jlong)lpGdkEventMotion->pressure); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->xtilt, (jlong)lpGdkEventMotion->xtilt); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->ytilt, (jlong)lpGdkEventMotion->ytilt); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->state, (jint)lpGdkEventMotion->state); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->is_hint, (jint)lpGdkEventMotion->is_hint); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->source, (jint)lpGdkEventMotion->source); - (*env)->SetIntField(env, lpObject, lpGdkEventMotionFc->deviceid, (jint)lpGdkEventMotion->deviceid); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->x_root, (jlong)lpGdkEventMotion->x_root); - (*env)->SetLongField(env, lpObject, lpGdkEventMotionFc->y_root, (jlong)lpGdkEventMotion->y_root); -} - void getGdkEventExposeFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventExpose_FID_CACHE *lpGdkEventExposeFc) { GdkEventExpose *lpGdkEventExpose = (GdkEventExpose*)lpGdkEvent; @@ -1235,6 +607,7 @@ void getGdkEventExposeFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent lpGdkEventExpose->area.y = (*env)->GetShortField(env, lpObject, lpGdkEventExposeFc->y); lpGdkEventExpose->area.width = (*env)->GetShortField(env, lpObject, lpGdkEventExposeFc->width); lpGdkEventExpose->area.height = (*env)->GetShortField(env, lpObject, lpGdkEventExposeFc->height); + lpGdkEventExpose->region = (*env)->GetIntField(env, lpObject, lpGdkEventExposeFc->region); lpGdkEventExpose->count = (*env)->GetIntField(env, lpObject, lpGdkEventExposeFc->count); } @@ -1318,44 +691,6 @@ void setGdkGCValuesFields(JNIEnv *env, jobject lpObject, GdkGCValues *lpGdkGCVal (*env)->SetIntField(env, lpObject, lpGdkGCValuesFc->join_style, (jint)lpGdkGCValues->join_style); } -void getGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpGdkImage, GdkImage_FID_CACHE *lpGdkImageFc) -{ - lpGdkImage->type = (*env)->GetIntField(env, lpObject, lpGdkImageFc->type); - lpGdkImage->visual = (GdkVisual*)(*env)->GetIntField(env, lpObject, lpGdkImageFc->visual); - lpGdkImage->byte_order = (*env)->GetIntField(env, lpObject, lpGdkImageFc->byte_order); - lpGdkImage->width = (*env)->GetShortField(env, lpObject, lpGdkImageFc->width); - lpGdkImage->height = (*env)->GetShortField(env, lpObject, lpGdkImageFc->height); - lpGdkImage->depth = (*env)->GetShortField(env, lpObject, lpGdkImageFc->depth); - lpGdkImage->bpp = (*env)->GetShortField(env, lpObject, lpGdkImageFc->bpp); - lpGdkImage->bpl = (*env)->GetShortField(env, lpObject, lpGdkImageFc->bpl); - lpGdkImage->mem = (gpointer)(*env)->GetIntField(env, lpObject, lpGdkImageFc->mem); -} - -void setGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpGdkImage, GdkImage_FID_CACHE *lpGdkImageFc) -{ - (*env)->SetIntField(env, lpObject, lpGdkImageFc->type, (jint)lpGdkImage->type); - (*env)->SetIntField(env, lpObject, lpGdkImageFc->visual, (jint)lpGdkImage->visual); - (*env)->SetIntField(env, lpObject, lpGdkImageFc->byte_order, (jint)lpGdkImage->byte_order); - (*env)->SetShortField(env, lpObject, lpGdkImageFc->width, (jshort)lpGdkImage->width); - (*env)->SetShortField(env, lpObject, lpGdkImageFc->height, (jshort)lpGdkImage->height); - (*env)->SetShortField(env, lpObject, lpGdkImageFc->depth, (jshort)lpGdkImage->depth); - (*env)->SetShortField(env, lpObject, lpGdkImageFc->bpp, (jshort)lpGdkImage->bpp); - (*env)->SetShortField(env, lpObject, lpGdkImageFc->bpl, (jshort)lpGdkImage->bpl); - (*env)->SetIntField(env, lpObject, lpGdkImageFc->mem, (jint)lpGdkImage->mem); -} - -void getGdkPointFields(JNIEnv *env, jobject lpObject, GdkPoint *lpGdkPoint, GdkPoint_FID_CACHE *lpGdkPointFc) -{ - lpGdkPoint->x = (*env)->GetShortField(env, lpObject, lpGdkPointFc->x); - lpGdkPoint->y = (*env)->GetShortField(env, lpObject, lpGdkPointFc->y); -} - -void setGdkPointFields(JNIEnv *env, jobject lpObject, GdkPoint *lpGdkPoint, GdkPoint_FID_CACHE *lpGdkPointFc) -{ - (*env)->SetShortField(env, lpObject, lpGdkPointFc->x, (jshort)lpGdkPoint->x); - (*env)->SetShortField(env, lpObject, lpGdkPointFc->y, (jshort)lpGdkPoint->y); -} - void getGdkRectangleFields(JNIEnv *env, jobject lpObject, GdkRectangle *lpGdkRectangle, GdkRectangle_FID_CACHE *lpGdkRectangleFc) { lpGdkRectangle->x = (*env)->GetShortField(env, lpObject, lpGdkRectangleFc->x); @@ -1424,52 +759,9 @@ void setGtkAllocationFields(JNIEnv *env, jobject lpObject, GtkAllocation *lpGtkA (*env)->SetShortField(env, lpObject, lpGtkAllocationFc->height, lpGtkAllocation->height); } -void getGtkArgFields(JNIEnv *env, jobject lpObject, GtkArg *lpGtkArg, GtkArg_FID_CACHE *lpGtkArgFc) -{ - fprintf(stderr, "WARNING: Unimplemented method getGtkArgFields.\n"); -} - -void setGtkArgFields(JNIEnv *env, jobject lpObject, GtkArg *lpGtkArg, GtkArg_FID_CACHE *lpGtkArgFc) -{ - fprintf(stderr, "WARNING: Unimplemented method setGtkArgFields.\n"); -} - -void getGtkBinFields(JNIEnv *env, jobject lpObject, GtkBin *lpGtkBin, GtkBin_FID_CACHE *lpGtkBinFc) -{ - DECL_GLOB(pGlob) - getGtkContainerFields(env, lpObject, &lpGtkBin->container, &PGLOB(GtkContainerFc)); - lpGtkBin->child = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkBinFc->child); -} - -void setGtkBinFields(JNIEnv *env, jobject lpObject, GtkBin *lpGtkBin, GtkBin_FID_CACHE *lpGtkBinFc) -{ - DECL_GLOB(pGlob) - setGtkContainerFields(env, lpObject, &lpGtkBin->container, &PGLOB(GtkContainerFc)); - (*env)->SetIntField(env, lpObject, lpGtkBinFc->child, (jint)lpGtkBin->child); -} - -void getGtkBoxFields(JNIEnv *env, jobject lpObject, GtkBox *lpGtkBox, GtkBox_FID_CACHE *lpGtkBoxFc) -{ - DECL_GLOB(pGlob) - getGtkContainerFields(env, lpObject, &lpGtkBox->container, &PGLOB(GtkContainerFc)); - lpGtkBox->children = (GList*)(*env)->GetIntField(env, lpObject, lpGtkBoxFc->children); - lpGtkBox->spacing = (*env)->GetShortField(env, lpObject, lpGtkBoxFc->spacing); - lpGtkBox->homogeneous = (*env)->GetIntField(env, lpObject, lpGtkBoxFc->homogeneous); -} - -void setGtkBoxFields(JNIEnv *env, jobject lpObject, GtkBox *lpGtkBox, GtkBox_FID_CACHE *lpGtkBoxFc) -{ - DECL_GLOB(pGlob) - setGtkContainerFields(env, lpObject, &lpGtkBox->container, &PGLOB(GtkContainerFc)); - (*env)->SetIntField(env, lpObject, lpGtkBoxFc->children, (jint)lpGtkBox->children); - (*env)->SetShortField(env, lpObject, lpGtkBoxFc->spacing, (jshort)lpGtkBox->spacing); - (*env)->SetIntField(env, lpObject, lpGtkBoxFc->homogeneous, (jint)lpGtkBox->homogeneous); -} - void getGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkCList_FID_CACHE *lpGtkCListFc) { DECL_GLOB(pGlob) - getGtkContainerFields(env, lpObject, &lpGtkCList->container, &PGLOB(GtkContainerFc)); lpGtkCList->flags = (*env)->GetShortField(env, lpObject, lpGtkCListFc->clist_flags); lpGtkCList->row_mem_chunk = (GMemChunk*)(*env)->GetIntField(env, lpObject, lpGtkCListFc->row_mem_chunk); lpGtkCList->cell_mem_chunk = (GMemChunk*)(*env)->GetIntField(env, lpObject, lpGtkCListFc->cell_mem_chunk); @@ -1479,7 +771,6 @@ void getGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkC lpGtkCList->internal_allocation.width = (*env)->GetShortField(env, lpObject, lpGtkCListFc->internal_allocation_width); lpGtkCList->internal_allocation.height = (*env)->GetShortField(env, lpObject, lpGtkCListFc->internal_allocation_height); lpGtkCList->rows = (*env)->GetIntField(env, lpObject, lpGtkCListFc->rows); - lpGtkCList->row_center_offset = (*env)->GetIntField(env, lpObject, lpGtkCListFc->row_center_offset); lpGtkCList->row_height = (*env)->GetIntField(env, lpObject, lpGtkCListFc->row_height); lpGtkCList->row_list = (GList*)(*env)->GetIntField(env, lpObject, lpGtkCListFc->row_list); lpGtkCList->row_list_end = (GList*)(*env)->GetIntField(env, lpObject, lpGtkCListFc->row_list_end); @@ -1531,7 +822,6 @@ void getGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkC void setGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkCList_FID_CACHE *lpGtkCListFc) { DECL_GLOB(pGlob) - setGtkContainerFields(env, lpObject, &lpGtkCList->container, &PGLOB(GtkContainerFc)); (*env)->SetShortField(env, lpObject, lpGtkCListFc->clist_flags, (jshort)lpGtkCList->flags); (*env)->SetIntField(env, lpObject, lpGtkCListFc->row_mem_chunk, (jint)lpGtkCList->row_mem_chunk); (*env)->SetIntField(env, lpObject, lpGtkCListFc->cell_mem_chunk, (jint)lpGtkCList->cell_mem_chunk); @@ -1541,7 +831,6 @@ void setGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkC (*env)->SetShortField(env, lpObject, lpGtkCListFc->internal_allocation_width, (jshort)lpGtkCList->internal_allocation.width); (*env)->SetShortField(env, lpObject, lpGtkCListFc->internal_allocation_height, (jshort)lpGtkCList->internal_allocation.height); (*env)->SetIntField(env, lpObject, lpGtkCListFc->rows, (jint)lpGtkCList->rows); - (*env)->SetIntField(env, lpObject, lpGtkCListFc->row_center_offset, (jint)lpGtkCList->row_center_offset); (*env)->SetIntField(env, lpObject, lpGtkCListFc->row_height, (jint)lpGtkCList->row_height); (*env)->SetIntField(env, lpObject, lpGtkCListFc->row_list, (jint)lpGtkCList->row_list); (*env)->SetIntField(env, lpObject, lpGtkCListFc->row_list_end, (jint)lpGtkCList->row_list_end); @@ -1590,309 +879,18 @@ void setGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkC (*env)->SetIntField(env, lpObject, lpGtkCListFc->sort_column, (jint)lpGtkCList->sort_column); } -void getGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSelectionDialog *lpGtkColorSelectionDialog, GtkColorSelectionDialog_FID_CACHE *lpGtkColorSelectionDialogFc) -{ - DECL_GLOB(pGlob) - getGtkWindowFields(env, lpObject, &lpGtkColorSelectionDialog->window, &PGLOB(GtkWindowFc)); - lpGtkColorSelectionDialog->colorsel = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->colorsel); - lpGtkColorSelectionDialog->main_vbox = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->main_vbox); - lpGtkColorSelectionDialog->ok_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->ok_button); - lpGtkColorSelectionDialog->reset_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->reset_button); - lpGtkColorSelectionDialog->cancel_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->cancel_button); - lpGtkColorSelectionDialog->help_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkColorSelectionDialogFc->help_button); -} - -void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSelectionDialog *lpGtkColorSelectionDialog, GtkColorSelectionDialog_FID_CACHE *lpGtkColorSelectionDialogFc) -{ - DECL_GLOB(pGlob) - setGtkWindowFields(env, lpObject, &lpGtkColorSelectionDialog->window, &PGLOB(GtkWindowFc)); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->colorsel, (jint)lpGtkColorSelectionDialog->colorsel); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->main_vbox, (jint)lpGtkColorSelectionDialog->main_vbox); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->ok_button, (jint)lpGtkColorSelectionDialog->ok_button); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->reset_button, (jint)lpGtkColorSelectionDialog->reset_button); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->cancel_button, (jint)lpGtkColorSelectionDialog->cancel_button); - (*env)->SetIntField(env, lpObject, lpGtkColorSelectionDialogFc->help_button, (jint)lpGtkColorSelectionDialog->help_button); -} - void getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpGtkCombo, GtkCombo_FID_CACHE *lpGtkComboFc) { DECL_GLOB(pGlob) - getGtkHBoxFields(env, lpObject, &lpGtkCombo->hbox, &PGLOB(GtkHBoxFc)); lpGtkCombo->entry = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkComboFc->entry); - lpGtkCombo->button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkComboFc->button); - lpGtkCombo->popup = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkComboFc->popup); - lpGtkCombo->popwin = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkComboFc->popwin); lpGtkCombo->list = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkComboFc->list); - lpGtkCombo->entry_change_id = (*env)->GetIntField(env, lpObject, lpGtkComboFc->entry_change_id); - lpGtkCombo->list_change_id = (*env)->GetIntField(env, lpObject, lpGtkComboFc->list_change_id); - lpGtkCombo->value_in_list = (*env)->GetIntField(env, lpObject, lpGtkComboFc->value_in_list); - lpGtkCombo->ok_if_empty = (*env)->GetIntField(env, lpObject, lpGtkComboFc->ok_if_empty); - lpGtkCombo->case_sensitive = (*env)->GetIntField(env, lpObject, lpGtkComboFc->case_sensitive); - lpGtkCombo->use_arrows = (*env)->GetIntField(env, lpObject, lpGtkComboFc->use_arrows); - lpGtkCombo->use_arrows_always = (*env)->GetIntField(env, lpObject, lpGtkComboFc->use_arrows_always); - lpGtkCombo->current_button = (*env)->GetShortField(env, lpObject, lpGtkComboFc->current_button); - lpGtkCombo->activate_id = (*env)->GetIntField(env, lpObject, lpGtkComboFc->activate_id); } void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpGtkCombo, GtkCombo_FID_CACHE *lpGtkComboFc) { DECL_GLOB(pGlob) - setGtkHBoxFields(env, lpObject, &lpGtkCombo->hbox, &PGLOB(GtkHBoxFc)); (*env)->SetIntField(env, lpObject, lpGtkComboFc->entry, (jint)lpGtkCombo->entry); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->button, (jint)lpGtkCombo->button); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->popup, (jint)lpGtkCombo->popup); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->popwin, (jint)lpGtkCombo->popwin); (*env)->SetIntField(env, lpObject, lpGtkComboFc->list, (jint)lpGtkCombo->list); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->entry_change_id, (jint)lpGtkCombo->entry_change_id); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->list_change_id, (jint)lpGtkCombo->list_change_id); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->value_in_list, (jint)lpGtkCombo->value_in_list); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->ok_if_empty, (jint)lpGtkCombo->ok_if_empty); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->case_sensitive, (jint)lpGtkCombo->case_sensitive); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->use_arrows, (jint)lpGtkCombo->use_arrows); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->use_arrows_always, (jint)lpGtkCombo->use_arrows_always); - (*env)->SetShortField(env, lpObject, lpGtkComboFc->current_button, (jshort)lpGtkCombo->current_button); - (*env)->SetIntField(env, lpObject, lpGtkComboFc->activate_id, (jint)lpGtkCombo->activate_id); -} - -void getGtkContainerFields(JNIEnv *env, jobject lpObject, GtkContainer *lpGtkContainer, GtkContainer_FID_CACHE *lpGtkContainerFc) -{ - DECL_GLOB(pGlob) - getGtkWidgetFields(env, lpObject, &lpGtkContainer->widget, &PGLOB(GtkWidgetFc)); - lpGtkContainer->focus_child = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkContainerFc->focus_child); - lpGtkContainer->border_width = (*env)->GetIntField(env, lpObject, lpGtkContainerFc->border_width); - lpGtkContainer->need_resize = (*env)->GetIntField(env, lpObject, lpGtkContainerFc->need_resize); - lpGtkContainer->resize_mode = (*env)->GetIntField(env, lpObject, lpGtkContainerFc->resize_mode); - lpGtkContainer->resize_widgets = (GSList*)(*env)->GetIntField(env, lpObject, lpGtkContainerFc->resize_widgets); -} - -void setGtkContainerFields(JNIEnv *env, jobject lpObject, GtkContainer *lpGtkContainer, GtkContainer_FID_CACHE *lpGtkContainerFc) -{ - DECL_GLOB(pGlob) - setGtkWidgetFields(env, lpObject, &lpGtkContainer->widget, &PGLOB(GtkWidgetFc)); - (*env)->SetIntField(env, lpObject, lpGtkContainerFc->focus_child, (jint)lpGtkContainer->focus_child); - (*env)->SetIntField(env, lpObject, lpGtkContainerFc->border_width, (jint)lpGtkContainer->border_width); - (*env)->SetIntField(env, lpObject, lpGtkContainerFc->need_resize, (jint)lpGtkContainer->need_resize); - (*env)->SetIntField(env, lpObject, lpGtkContainerFc->resize_mode, (jint)lpGtkContainer->resize_mode); - (*env)->SetIntField(env, lpObject, lpGtkContainerFc->resize_widgets, (jint)lpGtkContainer->resize_widgets); -} - -void getGtkEditableFields(JNIEnv *env, jobject lpObject, GtkEditable *lpGtkEditable, GtkEditable_FID_CACHE *lpGtkEditableFc) -{ - DECL_GLOB(pGlob) - getGtkWidgetFields(env, lpObject, &lpGtkEditable->widget, &PGLOB(GtkWidgetFc)); - lpGtkEditable->current_pos = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->current_pos); - lpGtkEditable->selection_start_pos = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->selection_start_pos); - lpGtkEditable->selection_end_pos = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->selection_end_pos); - lpGtkEditable->has_selection = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->has_selection); - lpGtkEditable->editable = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->editable); - lpGtkEditable->visible = (*env)->GetIntField(env, lpObject, lpGtkEditableFc->visible); - lpGtkEditable->ic = (GdkIC*)(*env)->GetIntField(env, lpObject, lpGtkEditableFc->ic); - lpGtkEditable->ic_attr = (GdkICAttr*)(*env)->GetIntField(env, lpObject, lpGtkEditableFc->ic_attr); - lpGtkEditable->clipboard_text = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkEditableFc->clipboard_text); -} - -void setGtkEditableFields(JNIEnv *env, jobject lpObject, GtkEditable *lpGtkEditable, GtkEditable_FID_CACHE *lpGtkEditableFc) -{ - DECL_GLOB(pGlob) - setGtkWidgetFields(env, lpObject, &lpGtkEditable->widget, &PGLOB(GtkWidgetFc)); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->current_pos, (jint)lpGtkEditable->current_pos); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->selection_start_pos, (jint)lpGtkEditable->selection_start_pos); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->selection_end_pos, (jint)lpGtkEditable->selection_end_pos); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->has_selection, (jint)lpGtkEditable->has_selection); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->editable, (jint)lpGtkEditable->editable); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->visible, (jint)lpGtkEditable->visible); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->ic, (jint)lpGtkEditable->ic); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->ic_attr, (jint)lpGtkEditable->ic_attr); - (*env)->SetIntField(env, lpObject, lpGtkEditableFc->clipboard_text, (jint)lpGtkEditable->clipboard_text); -} - -void getGtkTextFields(JNIEnv *env, jobject lpObject, GtkText *lpGtkText, GtkText_FID_CACHE *lpGtkTextFc) -{ - DECL_GLOB(pGlob) - getGtkEditableFields(env, lpObject, &lpGtkText->editable, &PGLOB(GtkEditableFc)); - - lpGtkText->first_line_start_index = (*env)->GetIntField(env, lpObject, lpGtkTextFc->first_line_start_index); - lpGtkText->first_onscreen_hor_pixel = (*env)->GetIntField(env, lpObject, lpGtkTextFc->first_onscreen_hor_pixel); - lpGtkText->first_onscreen_ver_pixel = (*env)->GetIntField(env, lpObject, lpGtkTextFc->first_onscreen_ver_pixel); - lpGtkText->default_tab_width = (*env)->GetIntField(env, lpObject, lpGtkTextFc->default_tab_width); - lpGtkText->cursor_pos_x = (*env)->GetIntField(env, lpObject, lpGtkTextFc->cursor_pos_x); - lpGtkText->cursor_pos_y = (*env)->GetIntField(env, lpObject, lpGtkTextFc->cursor_pos_y); - lpGtkText->cursor_virtual_x = (*env)->GetIntField(env, lpObject, lpGtkTextFc->cursor_virtual_x); -} - -void setGtkTextFields(JNIEnv *env, jobject lpObject, GtkText *lpGtkText, GtkText_FID_CACHE *lpGtkTextFc) -{ - DECL_GLOB(pGlob) - setGtkEditableFields(env, lpObject, &lpGtkText->editable, &PGLOB(GtkEditableFc)); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->first_line_start_index, (jint)lpGtkText->first_line_start_index); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->first_onscreen_hor_pixel, (jint)lpGtkText->first_onscreen_hor_pixel); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->first_onscreen_ver_pixel, (jint)lpGtkText->first_onscreen_ver_pixel); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->default_tab_width, (jint)lpGtkText->default_tab_width); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->cursor_pos_x, (jint)lpGtkText->cursor_pos_x); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->cursor_pos_y, (jint)lpGtkText->cursor_pos_y); - (*env)->SetIntField(env, lpObject, lpGtkTextFc->cursor_virtual_x, (jint)lpGtkText->cursor_virtual_x); -} - -void getGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpGtkFileSelection, GtkFileSelection_FID_CACHE *lpGtkFileSelectionFc) -{ - DECL_GLOB(pGlob) - getGtkWindowFields(env, lpObject, &lpGtkFileSelection->window, &PGLOB(GtkWindowFc)); - lpGtkFileSelection->dir_list = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->dir_list); - lpGtkFileSelection->file_list = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->file_list); - lpGtkFileSelection->selection_entry = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->selection_entry); - lpGtkFileSelection->selection_text = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->selection_text); - lpGtkFileSelection->main_vbox = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->main_vbox); - lpGtkFileSelection->ok_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->ok_button); - lpGtkFileSelection->cancel_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->cancel_button); - lpGtkFileSelection->help_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->help_button); - lpGtkFileSelection->history_pulldown = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->history_pulldown); - lpGtkFileSelection->history_menu = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->history_menu); - lpGtkFileSelection->history_list = (GList*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->history_list); - lpGtkFileSelection->fileop_dialog = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_dialog); - lpGtkFileSelection->fileop_entry = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_entry); - lpGtkFileSelection->fileop_file = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_file); - lpGtkFileSelection->cmpl_state = (gpointer)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->cmpl_state); - lpGtkFileSelection->fileop_c_dir = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_c_dir); - lpGtkFileSelection->fileop_del_file = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_del_file); - lpGtkFileSelection->fileop_ren_file = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_ren_file); - lpGtkFileSelection->button_area = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->button_area); - lpGtkFileSelection->action_area = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFileSelectionFc->action_area); -} - -void setGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpGtkFileSelection, GtkFileSelection_FID_CACHE *lpGtkFileSelectionFc) -{ - DECL_GLOB(pGlob) - setGtkWindowFields(env, lpObject, &lpGtkFileSelection->window, &PGLOB(GtkWindowFc)); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->dir_list, (jint)lpGtkFileSelection->dir_list); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->file_list, (jint)lpGtkFileSelection->file_list); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->selection_entry, (jint)lpGtkFileSelection->selection_entry); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->selection_text, (jint)lpGtkFileSelection->selection_text); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->main_vbox, (jint)lpGtkFileSelection->main_vbox); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->ok_button, (jint)lpGtkFileSelection->ok_button); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->cancel_button, (jint)lpGtkFileSelection->cancel_button); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->help_button, (jint)lpGtkFileSelection->help_button); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->history_pulldown, (jint)lpGtkFileSelection->history_pulldown); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->history_menu, (jint)lpGtkFileSelection->history_menu); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->history_list, (jint)lpGtkFileSelection->history_list); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_dialog, (jint)lpGtkFileSelection->fileop_dialog); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_entry, (jint)lpGtkFileSelection->fileop_entry); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_file, (jint)lpGtkFileSelection->fileop_file); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->cmpl_state, (jint)lpGtkFileSelection->cmpl_state); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_c_dir, (jint)lpGtkFileSelection->fileop_c_dir); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_del_file, (jint)lpGtkFileSelection->fileop_del_file); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->fileop_ren_file, (jint)lpGtkFileSelection->fileop_ren_file); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->button_area, (jint)lpGtkFileSelection->button_area); - (*env)->SetIntField(env, lpObject, lpGtkFileSelectionFc->action_area, (jint)lpGtkFileSelection->action_area); -} - -void getGtkFontSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkFontSelectionDialog *lpGtkFontSelectionDialog, GtkFontSelectionDialog_FID_CACHE *lpGtkFontSelectionDialogFc) -{ - DECL_GLOB(pGlob) - getGtkWindowFields(env, lpObject, &lpGtkFontSelectionDialog->window, &PGLOB(GtkWindowFc)); - lpGtkFontSelectionDialog->fontsel = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->fontsel); - lpGtkFontSelectionDialog->main_vbox = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->main_vbox); - lpGtkFontSelectionDialog->action_area = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->action_area); - lpGtkFontSelectionDialog->ok_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->ok_button); - lpGtkFontSelectionDialog->apply_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->apply_button); - lpGtkFontSelectionDialog->cancel_button = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->cancel_button); - lpGtkFontSelectionDialog->dialog_width = (*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->dialog_width); - lpGtkFontSelectionDialog->auto_resize = (*env)->GetIntField(env, lpObject, lpGtkFontSelectionDialogFc->auto_resize); -} - -void setGtkFontSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkFontSelectionDialog *lpGtkFontSelectionDialog, GtkFontSelectionDialog_FID_CACHE *lpGtkFontSelectionDialogFc) -{ - DECL_GLOB(pGlob) - setGtkWindowFields(env, lpObject, &lpGtkFontSelectionDialog->window, &PGLOB(GtkWindowFc)); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->fontsel, (jint)lpGtkFontSelectionDialog->fontsel); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->main_vbox, (jint)lpGtkFontSelectionDialog->main_vbox); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->action_area, (jint)lpGtkFontSelectionDialog->action_area); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->ok_button, (jint)lpGtkFontSelectionDialog->ok_button); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->apply_button, (jint)lpGtkFontSelectionDialog->apply_button); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->cancel_button, (jint)lpGtkFontSelectionDialog->cancel_button); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->dialog_width, (jint)lpGtkFontSelectionDialog->dialog_width); - (*env)->SetIntField(env, lpObject, lpGtkFontSelectionDialogFc->auto_resize, (jint)lpGtkFontSelectionDialog->auto_resize); -} - -void getGtkHBoxFields(JNIEnv *env, jobject lpObject, GtkHBox *lpGtkHBox, GtkHBox_FID_CACHE *lpGtkHBoxFc) -{ - DECL_GLOB(pGlob) - getGtkBoxFields(env, lpObject, &lpGtkHBox->box, &PGLOB(GtkBoxFc)); -} - -void setGtkHBoxFields(JNIEnv *env, jobject lpObject, GtkHBox *lpGtkHBox, GtkHBox_FID_CACHE *lpGtkHBoxFc) -{ - DECL_GLOB(pGlob) - setGtkBoxFields(env, lpObject, &lpGtkHBox->box, &PGLOB(GtkBoxFc)); -} - -void getGtkObjectFields(JNIEnv *env, jobject lpObject, GtkObject *lpGtkObject, GtkObject_FID_CACHE *lpGtkObjectFc) -{ - lpGtkObject->klass = (GtkObjectClass*)(*env)->GetIntField(env, lpObject, lpGtkObjectFc->klass); - lpGtkObject->flags = (*env)->GetIntField(env, lpObject, lpGtkObjectFc->flags); - lpGtkObject->ref_count = (*env)->GetIntField(env, lpObject, lpGtkObjectFc->ref_count); - lpGtkObject->object_data = (GData*)(*env)->GetIntField(env, lpObject, lpGtkObjectFc->object_data); -} - -void setGtkObjectFields(JNIEnv *env, jobject lpObject, GtkObject *lpGtkObject, GtkObject_FID_CACHE *lpGtkObjectFc) -{ - (*env)->SetIntField(env, lpObject, lpGtkObjectFc->klass, (jint)lpGtkObject->klass); - (*env)->SetIntField(env, lpObject, lpGtkObjectFc->flags, (jint)lpGtkObject->flags); - (*env)->SetIntField(env, lpObject, lpGtkObjectFc->ref_count, (jint)lpGtkObject->ref_count); - (*env)->SetIntField(env, lpObject, lpGtkObjectFc->object_data, (jint)lpGtkObject->object_data); -} - -void getGtkProgressFields(JNIEnv *env, jobject lpObject, GtkProgress *lpGtkProgress, GtkProgress_FID_CACHE *lpGtkProgressFc) -{ - DECL_GLOB(pGlob) - getGtkWidgetFields(env, lpObject, &lpGtkProgress->widget, &PGLOB(GtkWidgetFc)); - lpGtkProgress->adjustment = (GtkAdjustment*)(*env)->GetIntField(env, lpObject, lpGtkProgressFc->adjustment); - lpGtkProgress->offscreen_pixmap = (GdkPixmap*)(*env)->GetIntField(env, lpObject, lpGtkProgressFc->offscreen_pixmap); - lpGtkProgress->format = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkProgressFc->format); - lpGtkProgress->x_align = (*env)->GetFloatField(env, lpObject, lpGtkProgressFc->x_align); - lpGtkProgress->y_align = (*env)->GetFloatField(env, lpObject, lpGtkProgressFc->y_align); - lpGtkProgress->show_text = (*env)->GetIntField(env, lpObject, lpGtkProgressFc->show_text); - lpGtkProgress->activity_mode = (*env)->GetIntField(env, lpObject, lpGtkProgressFc->activity_mode); -} - -void setGtkProgressFields(JNIEnv *env, jobject lpObject, GtkProgress *lpGtkProgress, GtkProgress_FID_CACHE *lpGtkProgressFc) -{ - DECL_GLOB(pGlob) - setGtkWidgetFields(env, lpObject, &lpGtkProgress->widget, &PGLOB(GtkWidgetFc)); - (*env)->SetIntField(env, lpObject, lpGtkProgressFc->adjustment, (jint)lpGtkProgress->adjustment); - (*env)->SetIntField(env, lpObject, lpGtkProgressFc->offscreen_pixmap, (jint)lpGtkProgress->offscreen_pixmap); - (*env)->SetIntField(env, lpObject, lpGtkProgressFc->format, (jint)lpGtkProgress->format); - (*env)->SetFloatField(env, lpObject, lpGtkProgressFc->x_align, (jfloat)lpGtkProgress->x_align); - (*env)->SetFloatField(env, lpObject, lpGtkProgressFc->y_align, (jfloat)lpGtkProgress->y_align); - (*env)->SetIntField(env, lpObject, lpGtkProgressFc->show_text, (jint)lpGtkProgress->show_text); - (*env)->SetIntField(env, lpObject, lpGtkProgressFc->activity_mode, (jint)lpGtkProgress->activity_mode); -} - -void getGtkProgressBarFields(JNIEnv *env, jobject lpObject, GtkProgressBar *lpGtkProgressBar, GtkProgressBar_FID_CACHE *lpGtkProgressBarFc) -{ - DECL_GLOB(pGlob) - getGtkProgressFields(env, lpObject, &lpGtkProgressBar->progress, &PGLOB(GtkProgressFc)); - lpGtkProgressBar->bar_style = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->bar_style); - lpGtkProgressBar->orientation = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->orientation); - lpGtkProgressBar->blocks = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->blocks); - lpGtkProgressBar->in_block = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->in_block); - lpGtkProgressBar->activity_pos = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->activity_pos); - lpGtkProgressBar->activity_step = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->activity_step); - lpGtkProgressBar->activity_blocks = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->activity_blocks); - lpGtkProgressBar->activity_dir = (*env)->GetIntField(env, lpObject, lpGtkProgressBarFc->activity_dir); -} - -void setGtkProgressBarFields(JNIEnv *env, jobject lpObject, GtkProgressBar *lpGtkProgressBar, GtkProgressBar_FID_CACHE *lpGtkProgressBarFc) -{ - DECL_GLOB(pGlob) - setGtkProgressFields(env, lpObject, &lpGtkProgressBar->progress, &PGLOB(GtkProgressFc)); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->bar_style, (jint)lpGtkProgressBar->bar_style); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->orientation, (jint)lpGtkProgressBar->orientation); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->blocks, (jint)lpGtkProgressBar->blocks); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->in_block, (jint)lpGtkProgressBar->in_block); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->activity_pos, (jint)lpGtkProgressBar->activity_pos); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->activity_step, (jint)lpGtkProgressBar->activity_step); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->activity_blocks, (jint)lpGtkProgressBar->activity_blocks); - (*env)->SetIntField(env, lpObject, lpGtkProgressBarFc->activity_dir, (jint)lpGtkProgressBar->activity_dir); } void getGtkRequisitionFields(JNIEnv *env, jobject lpObject, GtkRequisition *lpGtkRequisition, GtkRequisition_FID_CACHE *lpGtkRequisitionFc) @@ -1909,7 +907,6 @@ void setGtkRequisitionFields(JNIEnv *env, jobject lpObject, GtkRequisition *lpGt void getGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkStyle_FID_CACHE *lpGtkStyleFc) { - lpGtkStyle->klass = (GtkStyleClass*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->klass); lpGtkStyle->fg[0].pixel = (*env)->GetIntField(env, lpObject, lpGtkStyleFc->fg0_pixel); lpGtkStyle->fg[0].red = (*env)->GetShortField(env, lpObject, lpGtkStyleFc->fg0_red); lpGtkStyle->fg[0].green = (*env)->GetShortField(env, lpObject, lpGtkStyleFc->fg0_green); @@ -2058,7 +1055,6 @@ void getGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkS lpGtkStyle->white.red = (*env)->GetShortField(env, lpObject, lpGtkStyleFc->white_red); lpGtkStyle->white.green = (*env)->GetShortField(env, lpObject, lpGtkStyleFc->white_green); lpGtkStyle->white.blue = (*env)->GetShortField(env, lpObject, lpGtkStyleFc->white_blue); - lpGtkStyle->font = (GdkFont*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->font); lpGtkStyle->fg_gc[0] = (GdkGC*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->fg_gc0); lpGtkStyle->fg_gc[1] = (GdkGC*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->fg_gc1); lpGtkStyle->fg_gc[2] = (GdkGC*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->fg_gc2); @@ -2101,19 +1097,10 @@ void getGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkS lpGtkStyle->bg_pixmap[2] = (GdkPixmap*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap2); lpGtkStyle->bg_pixmap[3] = (GdkPixmap*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap3); lpGtkStyle->bg_pixmap[4] = (GdkPixmap*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap4); - lpGtkStyle->ref_count = (*env)->GetIntField(env, lpObject, lpGtkStyleFc->ref_count); - lpGtkStyle->attach_count = (*env)->GetIntField(env, lpObject, lpGtkStyleFc->attach_count); - lpGtkStyle->depth = (*env)->GetIntField(env, lpObject, lpGtkStyleFc->depth); - lpGtkStyle->colormap = (GdkColormap*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->colormap); - lpGtkStyle->engine = (GtkThemeEngine*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->engine); - lpGtkStyle->engine_data = (gpointer)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->engine_data); - lpGtkStyle->rc_style = (GtkRcStyle*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->rc_style); - lpGtkStyle->styles = (GSList*)(*env)->GetIntField(env, lpObject, lpGtkStyleFc->styles); } void setGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkStyle_FID_CACHE *lpGtkStyleFc) { - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->klass, (jint)lpGtkStyle->klass); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->fg0_pixel, (jint)lpGtkStyle->fg[0].pixel); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->fg0_red, (jshort)lpGtkStyle->fg[0].red); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->fg0_green, (jshort)lpGtkStyle->fg[0].green); @@ -2254,6 +1241,7 @@ void setGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkS (*env)->SetShortField(env, lpObject, lpGtkStyleFc->base4_red, (jshort)lpGtkStyle->base[4].red); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->base4_green, (jshort)lpGtkStyle->base[4].green); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->base4_blue, (jshort)lpGtkStyle->base[4].blue); + (*env)->SetIntField(env, lpObject, lpGtkStyleFc->black_pixel, (jint)lpGtkStyle->black.pixel); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->black_red, (jshort)lpGtkStyle->black.red); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->black_green, (jshort)lpGtkStyle->black.green); @@ -2262,7 +1250,7 @@ void setGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkS (*env)->SetShortField(env, lpObject, lpGtkStyleFc->white_red, (jshort)lpGtkStyle->white.red); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->white_green, (jshort)lpGtkStyle->white.green); (*env)->SetShortField(env, lpObject, lpGtkStyleFc->white_blue, (jshort)lpGtkStyle->white.blue); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->font, (jint)lpGtkStyle->font); + (*env)->SetIntField(env, lpObject, lpGtkStyleFc->fg_gc0, (jint)lpGtkStyle->fg_gc[0]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->fg_gc1, (jint)lpGtkStyle->fg_gc[1]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->fg_gc2, (jint)lpGtkStyle->fg_gc[2]); @@ -2298,252 +1286,28 @@ void setGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkS (*env)->SetIntField(env, lpObject, lpGtkStyleFc->base_gc2, (jint)lpGtkStyle->base_gc[2]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->base_gc3, (jint)lpGtkStyle->base_gc[3]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->base_gc4, (jint)lpGtkStyle->base_gc[4]); + (*env)->SetIntField(env, lpObject, lpGtkStyleFc->black_gc, (jint)lpGtkStyle->black_gc); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->white_gc, (jint)lpGtkStyle->white_gc); + (*env)->SetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap0, (jint)lpGtkStyle->bg_pixmap[0]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap1, (jint)lpGtkStyle->bg_pixmap[1]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap2, (jint)lpGtkStyle->bg_pixmap[2]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap3, (jint)lpGtkStyle->bg_pixmap[3]); (*env)->SetIntField(env, lpObject, lpGtkStyleFc->bg_pixmap4, (jint)lpGtkStyle->bg_pixmap[4]); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->ref_count, (jint)lpGtkStyle->ref_count); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->attach_count, (jint)lpGtkStyle->attach_count); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->depth, (jint)lpGtkStyle->depth); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->colormap, (jint)lpGtkStyle->colormap); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->engine, (jint)lpGtkStyle->engine); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->engine_data, (jint)lpGtkStyle->engine_data); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->rc_style, (jint)lpGtkStyle->rc_style); - (*env)->SetIntField(env, lpObject, lpGtkStyleFc->styles, (jint)lpGtkStyle->styles); } void getGtkStyleClassFields(JNIEnv *env, jobject lpObject, GtkStyleClass *lpGtkStyleClass, GtkStyleClass_FID_CACHE *lpGtkStyleClassFc) { - lpGtkStyleClass->xthickness = (*env)->GetIntField(env, lpObject, lpGtkStyleClassFc->xthickness); - lpGtkStyleClass->ythickness = (*env)->GetIntField(env, lpObject, lpGtkStyleClassFc->ythickness); } void setGtkStyleClassFields(JNIEnv *env, jobject lpObject, GtkStyleClass *lpGtkStyleClass, GtkStyleClass_FID_CACHE *lpGtkStyleClassFc) { - (*env)->SetIntField(env, lpObject, lpGtkStyleClassFc->xthickness, (jint)lpGtkStyleClass->xthickness); - (*env)->SetIntField(env, lpObject, lpGtkStyleClassFc->ythickness, (jint)lpGtkStyleClass->ythickness); -} - -void getGtkWidgetFields(JNIEnv *env, jobject lpObject, GtkWidget *lpGtkWidget, GtkWidget_FID_CACHE *lpGtkWidgetFc) -{ - DECL_GLOB(pGlob) - getGtkObjectFields(env, lpObject, &lpGtkWidget->object, &PGLOB(GtkObjectFc)); - lpGtkWidget->private_flags = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->private_flags); - lpGtkWidget->state = (*env)->GetByteField(env, lpObject, lpGtkWidgetFc->state); - lpGtkWidget->saved_state = (*env)->GetByteField(env, lpObject, lpGtkWidgetFc->saved_state); - lpGtkWidget->name = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkWidgetFc->name); - lpGtkWidget->style = (GtkStyle*)(*env)->GetIntField(env, lpObject, lpGtkWidgetFc->style); - lpGtkWidget->requisition.width = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->req_width); - lpGtkWidget->requisition.height = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->req_height); - lpGtkWidget->allocation.x = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->alloc_x); - lpGtkWidget->allocation.y = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->alloc_y); - lpGtkWidget->allocation.width = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->alloc_width); - lpGtkWidget->allocation.height = (*env)->GetShortField(env, lpObject, lpGtkWidgetFc->alloc_height); - lpGtkWidget->window = (GdkWindow*)(*env)->GetIntField(env, lpObject, lpGtkWidgetFc->window); - lpGtkWidget->parent = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkWidgetFc->parent); -} - -void getGtkFrameFields(JNIEnv *env, jobject lpObject, GtkFrame *lpGtkFrame, GtkFrame_FID_CACHE *lpGtkFrameFc) -{ - DECL_GLOB(pGlob) - getGtkBinFields(env, lpObject, &lpGtkFrame->bin, &PGLOB(GtkBinFc)); - lpGtkFrame->label = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkFrameFc->label); - lpGtkFrame->shadow_type = (*env)->GetShortField(env, lpObject, lpGtkFrameFc->shadow_type); - lpGtkFrame->label_width = (*env)->GetShortField(env, lpObject, lpGtkFrameFc->label_width); - lpGtkFrame->label_height = (*env)->GetShortField(env, lpObject, lpGtkFrameFc->label_height); - lpGtkFrame->label_xalign = (*env)->GetFloatField(env, lpObject, lpGtkFrameFc->label_xalign); - lpGtkFrame->label_yalign = (*env)->GetFloatField(env, lpObject, lpGtkFrameFc->label_yalign); -} - -void setGtkWidgetFields(JNIEnv *env, jobject lpObject, GtkWidget *lpGtkWidget, GtkWidget_FID_CACHE *lpGtkWidgetFc) -{ - DECL_GLOB(pGlob) - setGtkObjectFields(env, lpObject, &lpGtkWidget->object, &PGLOB(GtkObjectFc)); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->private_flags, (jshort)lpGtkWidget->private_flags); - (*env)->SetByteField(env, lpObject, lpGtkWidgetFc->state, (jbyte)lpGtkWidget->state); - (*env)->SetByteField(env, lpObject, lpGtkWidgetFc->saved_state, (jbyte)lpGtkWidget->saved_state); - (*env)->SetIntField(env, lpObject, lpGtkWidgetFc->name, (jint)lpGtkWidget->name); - (*env)->SetIntField(env, lpObject, lpGtkWidgetFc->style, (jint)lpGtkWidget->style); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->req_width, (jshort)lpGtkWidget->requisition.width); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->req_height, (jshort)lpGtkWidget->requisition.height); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->alloc_x, (jshort)lpGtkWidget->allocation.x); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->alloc_y, (jshort)lpGtkWidget->allocation.y); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->alloc_width, (jshort)lpGtkWidget->allocation.width); - (*env)->SetShortField(env, lpObject, lpGtkWidgetFc->alloc_height, (jshort)lpGtkWidget->allocation.height); - (*env)->SetIntField(env, lpObject, lpGtkWidgetFc->window, (jint)lpGtkWidget->window); - (*env)->SetIntField(env, lpObject, lpGtkWidgetFc->parent, (jint)lpGtkWidget->parent); -} - -void setGtkFrameFields(JNIEnv *env, jobject lpObject, GtkFrame *lpGtkFrame, GtkFrame_FID_CACHE *lpGtkFrameFc) -{ - DECL_GLOB(pGlob) - setGtkBinFields(env, lpObject, &lpGtkFrame->bin, &PGLOB(GtkBinFc)); - (*env)->SetIntField (env, lpObject, lpGtkFrameFc->label, (jint)lpGtkFrame->label); - (*env)->SetShortField(env, lpObject, lpGtkFrameFc->label_width, (jshort)lpGtkFrame->label_width); - (*env)->SetShortField(env, lpObject, lpGtkFrameFc->label_height, (jshort)lpGtkFrame->label_height); - (*env)->SetFloatField(env, lpObject, lpGtkFrameFc->label_xalign, (jfloat)lpGtkFrame->label_xalign); - (*env)->SetFloatField(env, lpObject, lpGtkFrameFc->label_yalign, (jfloat)lpGtkFrame->label_yalign); -} - -void getGtkWindowFields(JNIEnv *env, jobject lpObject, GtkWindow *lpGtkWindow, GtkWindow_FID_CACHE *lpGtkWindowFc) -{ - DECL_GLOB(pGlob) - getGtkBinFields(env, lpObject, &lpGtkWindow->bin, &PGLOB(GtkBinFc)); - lpGtkWindow->title = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->title); - lpGtkWindow->wmclass_name = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->wmclass_name); - lpGtkWindow->wmclass_class = (gchar*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->wmclass_class); - lpGtkWindow->type = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->type); - lpGtkWindow->focus_widget = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->focus_widget); - lpGtkWindow->default_widget = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->default_widget); - lpGtkWindow->transient_parent = (GtkWindow*)(*env)->GetIntField(env, lpObject, lpGtkWindowFc->transient_parent); - lpGtkWindow->resize_count = (*env)->GetShortField(env, lpObject, lpGtkWindowFc->resize_count); - lpGtkWindow->allow_shrink = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->allow_shrink); - lpGtkWindow->allow_grow = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->allow_grow); - lpGtkWindow->auto_shrink = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->auto_shrink); - lpGtkWindow->handling_resize = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->handling_resize); - lpGtkWindow->position = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->position); - lpGtkWindow->use_uposition = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->use_uposition); - lpGtkWindow->modal = (*env)->GetIntField(env, lpObject, lpGtkWindowFc->title); -} - -void setGtkWindowFields(JNIEnv *env, jobject lpObject, GtkWindow *lpGtkWindow, GtkWindow_FID_CACHE *lpGtkWindowFc) -{ - DECL_GLOB(pGlob) - setGtkBinFields(env, lpObject, &lpGtkWindow->bin, &PGLOB(GtkBinFc)); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->title, (jint)lpGtkWindow->title); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->wmclass_name, (jint)lpGtkWindow->wmclass_name); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->wmclass_class, (jint)lpGtkWindow->wmclass_class); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->type, (jint)lpGtkWindow->type); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->focus_widget, (jint)lpGtkWindow->focus_widget); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->default_widget, (jint)lpGtkWindow->default_widget); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->transient_parent, (jint)lpGtkWindow->title); - (*env)->SetShortField(env, lpObject, lpGtkWindowFc->resize_count, (jshort)lpGtkWindow->resize_count); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->allow_shrink, (jint)lpGtkWindow->allow_shrink); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->allow_grow, (jint)lpGtkWindow->allow_grow); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->auto_shrink, (jint)lpGtkWindow->auto_shrink); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->handling_resize, (jint)lpGtkWindow->handling_resize); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->position, (jint)lpGtkWindow->position); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->use_uposition, (jint)lpGtkWindow->use_uposition); - (*env)->SetIntField(env, lpObject, lpGtkWindowFc->modal, (jint)lpGtkWindow->modal); -} - -void getGtkDialogFields(JNIEnv *env, jobject lpObject, GtkDialog *lpGtkDialog, GtkDialog_FID_CACHE *lpGtkDialogFc) -{ - DECL_GLOB(pGlob) - getGtkWindowFields(env, lpObject, &lpGtkDialog->window, &PGLOB(GtkWindowFc)); - lpGtkDialog->vbox = (GtkWidget*) (*env)->GetIntField(env, lpObject, lpGtkDialogFc->vbox); - lpGtkDialog->action_area = (GtkWidget*) (*env)->GetIntField(env, lpObject, lpGtkDialogFc->action_area); -} - -void setGtkDialogFields(JNIEnv *env, jobject lpObject, GtkDialog *lpGtkDialog, GtkDialog_FID_CACHE *lpGtkDialogFc) -{ - DECL_GLOB(pGlob) - setGtkWindowFields(env, lpObject, &lpGtkDialog->window, &PGLOB(GtkWindowFc)); - (*env)->SetIntField(env, lpObject, lpGtkDialogFc->vbox, (jint)lpGtkDialog->vbox); - (*env)->SetIntField(env, lpObject, lpGtkDialogFc->action_area, (jint)lpGtkDialog->action_area); -} - -void getGtkMenuFields(JNIEnv *env, jobject lpObject, GtkMenu *lpGtkMenu, GtkMenu_FID_CACHE *lpGtkMenuFc) -{ - DECL_GLOB(pGlob) - getGtkMenuShellFields(env, lpObject, &lpGtkMenu->menu_shell, &PGLOB(GtkMenuShellFc)); - lpGtkMenu->parent_menu_item = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->parent_menu_item); - lpGtkMenu->old_active_menu_item = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->old_active_menu_item); - lpGtkMenu->accel_group = (GtkAccelGroup*)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->accel_group); - lpGtkMenu->position_func = (GtkMenuPositionFunc)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->position_func); - lpGtkMenu->position_func_data = (gpointer)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->position_func_data); - lpGtkMenu->toplevel = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->toplevel); - lpGtkMenu->tearoff_window = (GtkWidget*)(*env)->GetIntField(env, lpObject, lpGtkMenuFc->tearoff_window); - lpGtkMenu->torn_off = (*env)->GetIntField(env, lpObject, lpGtkMenuFc->torn_off); -} - -void setGtkMenuFields(JNIEnv *env, jobject lpObject, GtkMenu *lpGtkMenu, GtkMenu_FID_CACHE *lpGtkMenuFc) -{ - DECL_GLOB(pGlob) - setGtkMenuShellFields(env, lpObject, &lpGtkMenu->menu_shell, &PGLOB(GtkMenuShellFc)); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->parent_menu_item, (jint)lpGtkMenu->parent_menu_item); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->old_active_menu_item, (jint)lpGtkMenu->old_active_menu_item); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->accel_group, (jint)lpGtkMenu->accel_group); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->position_func, (jint)lpGtkMenu->position_func); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->position_func_data, (jint)lpGtkMenu->position_func_data); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->toplevel, (jint)lpGtkMenu->toplevel); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->tearoff_window, (jint)lpGtkMenu->tearoff_window); - (*env)->SetIntField(env, lpObject, lpGtkMenuFc->torn_off, (jint)lpGtkMenu->torn_off); -} - -void getGtkMenuShellFields(JNIEnv *env, jobject lpObject, GtkMenuShell *lpGtkMenuShell, GtkMenuShell_FID_CACHE *lpGtkMenuShellFc) -{ - DECL_GLOB(pGlob) - getGtkContainerFields(env, lpObject, &lpGtkMenuShell->container, &PGLOB(GtkContainerFc)); - lpGtkMenuShell->active = (*env)->GetIntField(env, lpObject, lpGtkMenuShellFc->active); -} - -void setGtkMenuShellFields(JNIEnv *env, jobject lpObject, GtkMenuShell *lpGtkMenuShell, GtkMenuShell_FID_CACHE *lpGtkMenuShellFc) -{ - DECL_GLOB(pGlob) - setGtkContainerFields(env, lpObject, &lpGtkMenuShell->container, &PGLOB(GtkContainerFc)); - (*env)->SetIntField(env, lpObject, lpGtkMenuShellFc->active, (jint)lpGtkMenuShell->active); -} - -void getGtkItemFields(JNIEnv *env, jobject lpObject, GtkItem *lpGtkItem, GtkItem_FID_CACHE *lpGtkItemFc) -{ - DECL_GLOB(pGlob) - getGtkBinFields(env, lpObject, &lpGtkItem->bin, &PGLOB(GtkBinFc)); -} - -void setGtkItemFields(JNIEnv *env, jobject lpObject, GtkItem *lpGtkItem, GtkItem_FID_CACHE *lpGtkItemFc) -{ - DECL_GLOB(pGlob) - setGtkBinFields(env, lpObject, &lpGtkItem->bin, &PGLOB(GtkBinFc)); -} - -void getGtkMenuItemFields(JNIEnv *env, jobject lpObject, GtkMenuItem *lpGtkMenuItem, GtkMenuItem_FID_CACHE *lpGtkMenuItemFc) -{ - DECL_GLOB(pGlob) - getGtkItemFields(env, lpObject, &lpGtkMenuItem->item, &PGLOB(GtkItemFc)); -} - -void setGtkMenuItemFields(JNIEnv *env, jobject lpObject, GtkMenuItem *lpGtkMenuItem, GtkMenuItem_FID_CACHE *lpGtkMenuItemFc) -{ - DECL_GLOB(pGlob) - setGtkItemFields(env, lpObject, &lpGtkMenuItem->item, &PGLOB(GtkItemFc)); -} - -void getGtkCheckMenuItemFields(JNIEnv *env, jobject lpObject, GtkCheckMenuItem *lpGtkCheckMenuItem, GtkCheckMenuItem_FID_CACHE *lpGtkCheckMenuItemFc) -{ - DECL_GLOB(pGlob) - getGtkMenuItemFields(env, lpObject, &lpGtkCheckMenuItem->menu_item, &PGLOB(GtkMenuItemFc)); - lpGtkCheckMenuItem->active = (*env)->GetIntField(env, lpObject, lpGtkCheckMenuItemFc->active); - lpGtkCheckMenuItem->always_show_toggle = (*env)->GetIntField(env, lpObject, lpGtkCheckMenuItemFc->always_show_toggle); -} - -void setGtkCheckMenuItemFields(JNIEnv *env, jobject lpObject, GtkCheckMenuItem *lpGtkCheckMenuItem, GtkCheckMenuItem_FID_CACHE *lpGtkCheckMenuItemFc) -{ - DECL_GLOB(pGlob) - setGtkMenuItemFields(env, lpObject, &lpGtkCheckMenuItem->menu_item, &PGLOB(GtkMenuItemFc)); - (*env)->SetIntField(env, lpObject, lpGtkCheckMenuItemFc->active, (jint)lpGtkCheckMenuItem->active); - (*env)->SetIntField(env, lpObject, lpGtkCheckMenuItemFc->always_show_toggle, (jint)lpGtkCheckMenuItem->always_show_toggle); -} - -void getGtkDataFields(JNIEnv *env, jobject lpObject, GtkData *lpGtkData, GtkData_FID_CACHE *lpGtkDataFc) -{ - DECL_GLOB(pGlob) - getGtkObjectFields(env, lpObject, &lpGtkData->object, &PGLOB(GtkObjectFc)); -} - -void setGtkDataFields(JNIEnv *env, jobject lpObject, GtkData *lpGtkData, GtkData_FID_CACHE *lpGtkDataFc) -{ - DECL_GLOB(pGlob) - setGtkObjectFields(env, lpObject, &lpGtkData->object, &PGLOB(GtkObjectFc)); } void getGtkAdjustmentFields(JNIEnv *env, jobject lpObject, GtkAdjustment *lpGtkAdjustment, GtkAdjustment_FID_CACHE *lpGtkAdjustmentFc) { DECL_GLOB(pGlob) - getGtkDataFields(env, lpObject, &lpGtkAdjustment->data, &PGLOB(GtkDataFc)); lpGtkAdjustment->lower = (*env)->GetFloatField(env, lpObject, lpGtkAdjustmentFc->lower); lpGtkAdjustment->upper = (*env)->GetFloatField(env, lpObject, lpGtkAdjustmentFc->upper); lpGtkAdjustment->value = (*env)->GetFloatField(env, lpObject, lpGtkAdjustmentFc->value); @@ -2555,7 +1319,6 @@ void getGtkAdjustmentFields(JNIEnv *env, jobject lpObject, GtkAdjustment *lpGtkA void setGtkAdjustmentFields(JNIEnv *env, jobject lpObject, GtkAdjustment *lpGtkAdjustment, GtkAdjustment_FID_CACHE *lpGtkAdjustmentFc) { DECL_GLOB(pGlob) - setGtkDataFields(env, lpObject, &lpGtkAdjustment->data, &PGLOB(GtkDataFc)); (*env)->SetFloatField(env, lpObject, lpGtkAdjustmentFc->lower, (jfloat)lpGtkAdjustment->lower); (*env)->SetFloatField(env, lpObject, lpGtkAdjustmentFc->upper, (jfloat)lpGtkAdjustment->upper); (*env)->SetFloatField(env, lpObject, lpGtkAdjustmentFc->value, (jfloat)lpGtkAdjustment->value); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.h index c746b0d630..ce88e231aa 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/structs.h @@ -18,6 +18,8 @@ #ifndef INC_structs_H #define INC_structs_H +#define GTK_ENABLE_BROKEN 1 + #include #include @@ -37,6 +39,8 @@ /* ----------- fid cache structures ----------- */ +/* GDK */ + typedef struct GdkColor_FID_CACHE { int cached; jclass GdkColorClass; @@ -45,38 +49,16 @@ typedef struct GdkColor_FID_CACHE { typedef GdkColor_FID_CACHE *PGdkColor_FID_CACHE; -typedef struct GdkEventKey_FID_CACHE { - int cached; - jclass GdkEventKeyClass; - jfieldID type, window, send_event, time, state, keyval, length, string; -} GdkEventKey_FID_CACHE; - -typedef GdkEventKey_FID_CACHE *PGdkEventKey_FID_CACHE; - -typedef struct GdkEventButton_FID_CACHE { - int cached; - jclass GdkEventButtonClass; - jfieldID type, window, send_event, time, x, y, pressure, xtilt, ytilt, state, button, source, deviceid, x_root, y_root; -} GdkEventButton_FID_CACHE; - -typedef GdkEventButton_FID_CACHE *PGdkEventButton_FID_CACHE; - -typedef struct GdkEventMotion_FID_CACHE { - int cached; - jclass GdkEventMotionClass; - jfieldID type, window, send_event, time, x, y, pressure, xtilt, ytilt, state, is_hint, source, deviceid, x_root, y_root; -} GdkEventMotion_FID_CACHE; - -typedef GdkEventMotion_FID_CACHE *PGdkEventMotion_FID_CACHE; typedef struct GdkEventExpose_FID_CACHE { int cached; jclass GdkEventExposeClass; - jfieldID type, window, send_event, x, y, width, height, count; + jfieldID x, y, width, height, region, count; } GdkEventExpose_FID_CACHE; typedef GdkEventExpose_FID_CACHE *PGdkEventExpose_FID_CACHE; +/* FIXME */ typedef struct GdkFont_FID_CACHE { int cached; jclass GdkFontClass; @@ -93,22 +75,6 @@ typedef struct GdkGCValues_FID_CACHE { typedef GdkGCValues_FID_CACHE *PGdkGCValues_FID_CACHE; -typedef struct GdkImage_FID_CACHE { - int cached; - jclass GdkImageClass; - jfieldID type, visual, byte_order, width, height, depth, bpp, bpl, mem; -} GdkImage_FID_CACHE; - -typedef GdkImage_FID_CACHE *PGdkImage_FID_CACHE; - -typedef struct GdkPoint_FID_CACHE { - int cached; - jclass GdkPointClass; - jfieldID x, y; -} GdkPoint_FID_CACHE; - -typedef GdkPoint_FID_CACHE *PGdkPoint_FID_CACHE; - typedef struct GdkRectangle_FID_CACHE { int cached; jclass GdkRectangleClass; @@ -125,20 +91,7 @@ typedef struct GdkVisual_FID_CACHE { typedef GdkVisual_FID_CACHE *PGdkVisual_FID_CACHE; -typedef struct GtkObject_FID_CACHE { - int cached; - jclass GtkObjectClass; - jfieldID klass, flags, ref_count, object_data; -} GtkObject_FID_CACHE; - -typedef GtkObject_FID_CACHE *PGtkObject_FID_CACHE; - -typedef struct GtkData_FID_CACHE { - int cached; - jclass GtkDataClass; -} GtkData_FID_CACHE; - -typedef GtkData_FID_CACHE *PGtkData_FID_CACHE; +/* GTK */ typedef struct GtkAdjustment_FID_CACHE { int cached; @@ -156,190 +109,22 @@ typedef struct GtkAllocation_FID_CACHE { typedef GtkAllocation_FID_CACHE *PGtkAllocation_FID_CACHE; -typedef struct GtkWidget_FID_CACHE { - int cached; - jclass GtkWidgetClass; - jfieldID private_flags, state, saved_state, name, style, req_width, req_height, alloc_x, alloc_y, alloc_width, alloc_height, window, parent; -} GtkWidget_FID_CACHE; - -typedef GtkWidget_FID_CACHE *PGtkWidget_FID_CACHE; - -typedef struct GtkContainer_FID_CACHE { - int cached; - jclass GtkContainerClass; - jfieldID focus_child, border_width, need_resize, resize_mode, resize_widgets; -} GtkContainer_FID_CACHE; - -typedef GtkContainer_FID_CACHE *PGtkContainer_FID_CACHE; - -typedef struct GtkBin_FID_CACHE { - int cached; - jclass GtkBinClass; - jfieldID child; -} GtkBin_FID_CACHE; - -typedef GtkBin_FID_CACHE *PGtkBin_FID_CACHE; - -typedef struct GtkFrame_FID_CACHE { - int cached; - jclass GtkFrameClass; - jfieldID label, shadow_type, - label_width, label_height, - label_xalign, label_yalign; -} GtkFrame_FID_CACHE; - -typedef GtkFrame_FID_CACHE *PGtkFrame_FID_CACHE; - -typedef struct GtkMenu_FID_CACHE { - int cached; - jclass GtkMenuClass; - jfieldID parent_menu_item, old_active_menu_item, accel_group, position_func, position_func_data, toplevel, tearoff_window, torn_off; -} GtkMenu_FID_CACHE; - -typedef GtkMenu_FID_CACHE *PGtkMenu_FID_CACHE; - -typedef struct GtkMenuShell_FID_CACHE { - int cached; - jclass GtkMenuShellClass; - jfieldID active; -} GtkMenuShell_FID_CACHE; - -typedef GtkMenuShell_FID_CACHE *PGtkMenuShell_FID_CACHE; - -typedef struct GtkItem_FID_CACHE { - int cached; - jclass GtkItemClass; -} GtkItem_FID_CACHE; - -typedef GtkItem_FID_CACHE *PGtkItem_FID_CACHE; - -typedef struct GtkMenuItem_FID_CACHE { - int cached; - jclass GtkMenuItemClass; - jfieldID submenu, accelerator_signal, toggle_size, accelerator_width, show_toggle_indicator, show_submenu_indicator, submenu_placement, submenu_direction, right_justify, timer; -} GtkMenuItem_FID_CACHE; - -typedef GtkMenuItem_FID_CACHE *PGtkMenuItem_FID_CACHE; - -typedef struct GtkCheckMenuItem_FID_CACHE { - int cached; - jclass GtkCheckMenuItemClass; - jfieldID active, always_show_toggle; -} GtkCheckMenuItem_FID_CACHE; - -typedef GtkCheckMenuItem_FID_CACHE *PGtkCheckMenuItem_FID_CACHE; - -typedef struct GtkWindow_FID_CACHE { - int cached; - jclass GtkWindowClass; - jfieldID title, wmclass_name, wmclass_class, type, focus_widget, default_widget, transient_parent, resize_count, allow_shrink, allow_grow, auto_shrink, handling_resize, position, use_uposition, modal; -} GtkWindow_FID_CACHE; - -typedef GtkWindow_FID_CACHE *PGtkWindow_FID_CACHE; - -typedef struct GtkDialog_FID_CACHE { - int cached; - jclass GtkDialogClass; - jfieldID title, wmclass_name, wmclass_class, type, focus_widget, default_widget, transient_parent, resize_count, allow_shrink, allow_grow, auto_shrink, handling_resize, position, use_uposition, modal, vbox, action_area; -} GtkDialog_FID_CACHE; - -typedef GtkDialog_FID_CACHE *PGtkDialog_FID_CACHE; - -typedef struct GtkColorSelectionDialog_FID_CACHE { - int cached; - jclass GtkColorSelectionDialogClass; - jfieldID colorsel, main_vbox, ok_button, reset_button, cancel_button, help_button; -} GtkColorSelectionDialog_FID_CACHE; - -typedef GtkColorSelectionDialog_FID_CACHE *PGtkColorSelectionDialog_FID_CACHE; - -typedef struct GtkBox_FID_CACHE { - int cached; - jclass GtkBoxClass; - jfieldID children, spacing, homogeneous; -} GtkBox_FID_CACHE; - -typedef GtkBox_FID_CACHE *PGtkBox_FID_CACHE; - -typedef struct GtkHBox_FID_CACHE { - int cached; - jclass GtkHBoxClass; -} GtkHBox_FID_CACHE; - -typedef GtkHBox_FID_CACHE *PGtkHBox_FID_CACHE; - typedef struct GtkCombo_FID_CACHE { int cached; jclass GtkComboClass; - jfieldID entry, button, popup, popwin, list, entry_change_id, list_change_id, value_in_list, ok_if_empty, case_sensitive, use_arrows, use_arrows_always, current_button, activate_id; + jfieldID entry, list; } GtkCombo_FID_CACHE; typedef GtkCombo_FID_CACHE *PGtkCombo_FID_CACHE; -typedef struct GtkFileSelection_FID_CACHE { - int cached; - jclass GtkFileSelectionClass; - jfieldID dir_list, file_list, selection_entry, selection_text, main_vbox, ok_button, cancel_button, help_button, history_pulldown, history_menu, history_list, fileop_dialog, fileop_entry, fileop_file, cmpl_state, fileop_c_dir, fileop_del_file, fileop_ren_file, button_area, action_area; -} GtkFileSelection_FID_CACHE; - -typedef GtkFileSelection_FID_CACHE *PGtkFileSelection_FID_CACHE; - -typedef struct GtkFontSelectionDialog_FID_CACHE { - int cached; - jclass GtkFontSelectionDialogClass; - jfieldID fontsel, main_vbox, action_area, ok_button, apply_button, cancel_button, dialog_width, auto_resize; -} GtkFontSelectionDialog_FID_CACHE; - -typedef GtkFontSelectionDialog_FID_CACHE *PGtkFontSelectionDialog_FID_CACHE; - typedef struct GtkCList_FID_CACHE { int cached; jclass GtkCListClass; - jfieldID clist_flags, row_mem_chunk, cell_mem_chunk, freeze_count, internal_allocation_x, internal_allocation_y, internal_allocation_width, internal_allocation_height, rows, row_center_offset, row_height, row_list, row_list_end, columns, column_title_area_x, column_title_area_y, column_title_area_width, column_title_area_height, title_window, column, clist_window, clist_window_width, clist_window_height, hoffset, voffset, shadow_type, selection_mode, selection, selection_end, undo_selection, undo_unselection, undo_anchor, button_actions0, button_actions1, button_actions2, button_actions3, button_actions4, drag_button, click_cell_row, click_cell_column, hadjustment, vadjustment, xor_gc, fg_gc, bg_gc, cursor_drag, x_drag, focus_row, anchor, anchor_state, drag_pos, htimer, vtimer, sort_type, compare, sort_column; + jfieldID clist_flags, row_mem_chunk, cell_mem_chunk, freeze_count, internal_allocation_x, internal_allocation_y, internal_allocation_width, internal_allocation_height, rows, row_height, row_list, row_list_end, columns, column_title_area_x, column_title_area_y, column_title_area_width, column_title_area_height, title_window, column, clist_window, clist_window_width, clist_window_height, hoffset, voffset, shadow_type, selection_mode, selection, selection_end, undo_selection, undo_unselection, undo_anchor, button_actions0, button_actions1, button_actions2, button_actions3, button_actions4, drag_button, click_cell_row, click_cell_column, hadjustment, vadjustment, xor_gc, fg_gc, bg_gc, cursor_drag, x_drag, focus_row, anchor, anchor_state, drag_pos, htimer, vtimer, sort_type, compare, sort_column; } GtkCList_FID_CACHE; typedef GtkCList_FID_CACHE *PGtkCList_FID_CACHE; -typedef struct GtkEditable_FID_CACHE { - int cached; - jclass GtkEditableClass; - jfieldID current_pos, selection_start_pos, selection_end_pos, has_selection, editable, visible, ic, ic_attr, clipboard_text; -} GtkEditable_FID_CACHE; - -typedef GtkEditable_FID_CACHE *PGtkEditable_FID_CACHE; - -typedef struct GtkText_FID_CACHE { - int cached; - jclass GtkTextClass; - jfieldID first_line_start_index,first_onscreen_hor_pixel,first_onscreen_ver_pixel,default_tab_width,cursor_pos_x,cursor_pos_y,cursor_virtual_x; -} GtkText_FID_CACHE; - -typedef GtkText_FID_CACHE *PGtkText_FID_CACHE; - -typedef struct GtkProgress_FID_CACHE { - int cached; - jclass GtkProgressClass; - jfieldID adjustment, offscreen_pixmap, format, x_align, y_align, show_text, activity_mode; -} GtkProgress_FID_CACHE; - -typedef GtkProgress_FID_CACHE *PGtkProgress_FID_CACHE; - -typedef struct GtkProgressBar_FID_CACHE { - int cached; - jclass GtkProgressBarClass; - jfieldID bar_style, orientation, blocks, in_block, activity_pos, activity_step, activity_blocks, activity_dir; -} GtkProgressBar_FID_CACHE; - -typedef GtkProgressBar_FID_CACHE *PGtkProgressBar_FID_CACHE; - -typedef struct GtkArg_FID_CACHE { - int cached; - jclass GtkArgClass; - jfieldID type, name, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11; -} GtkArg_FID_CACHE; - -typedef GtkArg_FID_CACHE *PGtkArg_FID_CACHE; - typedef struct GtkRequisition_FID_CACHE { int cached; jclass GtkRequisitionClass; @@ -351,8 +136,61 @@ typedef GtkRequisition_FID_CACHE *PGtkRequisition_FID_CACHE; typedef struct GtkStyle_FID_CACHE { int cached; jclass GtkStyleClazz; - jfieldID klass, fg0_pixel, fg0_red, fg0_green, fg0_blue, fg1_pixel, fg1_red, fg1_green, fg1_blue, fg2_pixel, fg2_red, fg2_green, fg2_blue, fg3_pixel, fg3_red, fg3_green, fg3_blue, fg4_pixel, fg4_red, fg4_green, fg4_blue, bg0_pixel, bg0_red, bg0_green, bg0_blue, bg1_pixel, bg1_red, bg1_green, bg1_blue, bg2_pixel, bg2_red, bg2_green, bg2_blue, bg3_pixel, bg3_red, bg3_green, bg3_blue, bg4_pixel, bg4_red, bg4_green, bg4_blue, light0_pixel, light0_red, light0_green, light0_blue, light1_pixel, light1_red, light1_green, light1_blue, light2_pixel, light2_red, light2_green, light2_blue, light3_pixel, light3_red, light3_green, light3_blue, light4_pixel, light4_red, light4_green, light4_blue, dark0_pixel, dark0_red, dark0_green, dark0_blue, dark1_pixel, dark1_red, dark1_green, dark1_blue, dark2_pixel, dark2_red, dark2_green, dark2_blue, dark3_pixel, dark3_red, dark3_green, dark3_blue, dark4_pixel, dark4_red, dark4_green, dark4_blue, mid0_pixel, mid0_red, mid0_green, mid0_blue, mid1_pixel, mid1_red, mid1_green, mid1_blue, mid2_pixel, mid2_red, mid2_green, mid2_blue, mid3_pixel, mid3_red, mid3_green, mid3_blue, mid4_pixel, mid4_red, mid4_green, mid4_blue, text0_pixel, text0_red, text0_green, text0_blue, text1_pixel, text1_red, text1_green, text1_blue, text2_pixel, text2_red, text2_green, text2_blue, text3_pixel, text3_red, text3_green, text3_blue, text4_pixel, text4_red, text4_green, text4_blue, base0_pixel, base0_red, base0_green, base0_blue, base1_pixel, base1_red, base1_green, base1_blue, base2_pixel, base2_red, base2_green, base2_blue, base3_pixel, base3_red, base3_green, base3_blue, base4_pixel, base4_red, base4_green, base4_blue, black_pixel, black_red, black_green, black_blue, white_pixel, white_red, white_green, white_blue, font, fg_gc0, fg_gc1, fg_gc2, fg_gc3, fg_gc4, bg_gc0, bg_gc1, bg_gc2, bg_gc3, bg_gc4, light_gc0, light_gc1, light_gc2, light_gc3, light_gc4, dark_gc0, dark_gc1, dark_gc2, dark_gc3, dark_gc4, mid_gc0, mid_gc1, mid_gc2, mid_gc3, mid_gc4, text_gc0, text_gc1, text_gc2, text_gc3, text_gc4, base_gc0, base_gc1, base_gc2, base_gc3, base_gc4, black_gc, white_gc, bg_pixmap0, bg_pixmap1, bg_pixmap2, bg_pixmap3, bg_pixmap4, bg_pixmap5; - jfieldID ref_count, attach_count, depth, colormap, engine, engine_data, rc_style, styles; + jfieldID klass, + fg0_pixel, fg0_red, fg0_green, fg0_blue, + fg1_pixel, fg1_red, fg1_green, fg1_blue, + fg2_pixel, fg2_red, fg2_green, fg2_blue, + fg3_pixel, fg3_red, fg3_green, fg3_blue, + fg4_pixel, fg4_red, fg4_green, fg4_blue, + bg0_pixel, bg0_red, bg0_green, bg0_blue, + bg1_pixel, bg1_red, bg1_green, bg1_blue, + bg2_pixel, bg2_red, bg2_green, bg2_blue, + bg3_pixel, bg3_red, bg3_green, bg3_blue, + bg4_pixel, bg4_red, bg4_green, bg4_blue, + light0_pixel, light0_red, light0_green, + light0_blue, light1_pixel, light1_red, + light1_green, light1_blue, light2_pixel, + light2_red, light2_green, light2_blue, + light3_pixel, light3_red, light3_green, + light3_blue, light4_pixel, light4_red, + light4_green, light4_blue, + dark0_pixel, dark0_red, dark0_green, dark0_blue, + dark1_pixel, dark1_red, dark1_green, dark1_blue, + dark2_pixel, dark2_red, dark2_green, dark2_blue, + dark3_pixel, dark3_red, dark3_green, dark3_blue, + dark4_pixel, dark4_red, dark4_green, dark4_blue, + mid0_pixel, mid0_red, mid0_green, mid0_blue, + mid1_pixel, mid1_red, mid1_green, mid1_blue, + mid2_pixel, mid2_red, mid2_green, mid2_blue, + mid3_pixel, mid3_red, mid3_green, mid3_blue, + mid4_pixel, mid4_red, mid4_green, mid4_blue, + text0_pixel, text0_red, text0_green, text0_blue, + text1_pixel, text1_red, text1_green, text1_blue, + text2_pixel, text2_red, text2_green, text2_blue, + text3_pixel, text3_red, text3_green, text3_blue, + text4_pixel, text4_red, text4_green, text4_blue, + base0_pixel, base0_red, base0_green, base0_blue, + base1_pixel, base1_red, base1_green, base1_blue, + base2_pixel, base2_red, base2_green, base2_blue, + base3_pixel, base3_red, base3_green, base3_blue, + base4_pixel, base4_red, base4_green, base4_blue, + + black_pixel, black_red, black_green, black_blue, + white_pixel, white_red, white_green, white_blue, + + font_desc, + + fg_gc0, fg_gc1, fg_gc2, fg_gc3, fg_gc4, + bg_gc0, bg_gc1, bg_gc2, bg_gc3, bg_gc4, + light_gc0, light_gc1, light_gc2, light_gc3, light_gc4, + dark_gc0, dark_gc1, dark_gc2, dark_gc3, dark_gc4, + mid_gc0, mid_gc1, mid_gc2, mid_gc3, mid_gc4, + text_gc0, text_gc1, text_gc2, text_gc3, text_gc4, + base_gc0, base_gc1, base_gc2, base_gc3, base_gc4, + + black_gc, white_gc, + + bg_pixmap0, bg_pixmap1, bg_pixmap2, bg_pixmap3, bg_pixmap4, bg_pixmap5; } GtkStyle_FID_CACHE; typedef GtkStyle_FID_CACHE *PGtkStyle_FID_CACHE; @@ -401,44 +239,17 @@ typedef GtkCTree_FID_CACHE *PGtkCTree_FID_CACHE; /* ----------- cache function prototypes ----------- */ void cacheGdkColorFids(JNIEnv *env, jobject lpGdkColor, PGdkColor_FID_CACHE lpCache); -void cacheGdkEventKeyFids(JNIEnv *env, jobject lpGdkEventKey, PGdkEventKey_FID_CACHE lpCache); -void cacheGdkEventButtonFids(JNIEnv *env, jobject lpGdkEventButton, PGdkEventButton_FID_CACHE lpCache); -void cacheGdkEventMotionFids(JNIEnv *env, jobject lpGdkEventMotion, PGdkEventMotion_FID_CACHE lpCache); void cacheGdkEventExposeFids(JNIEnv *env, jobject lpGdkEventExpose, PGdkEventExpose_FID_CACHE lpCache); void cacheGdkFontFids(JNIEnv *env, jobject lpGdkFont, PGdkFont_FID_CACHE lpCache); void cacheGdkGCValuesFids(JNIEnv *env, jobject lpGdkGCValues, PGdkGCValues_FID_CACHE lpCache); -void cacheGdkImageFids(JNIEnv *env, jobject lpGdkImage, PGdkImage_FID_CACHE lpCache); -void cacheGdkPointFids(JNIEnv *env, jobject lpGdkPoint, PGdkPoint_FID_CACHE lpCache); void cacheGdkRectangleFids(JNIEnv *env, jobject lpGdkRectangle, PGdkRectangle_FID_CACHE lpCache); void cacheGdkVisualFids(JNIEnv *env, jobject lpGdkVisual, PGdkVisual_FID_CACHE lpCache); -void cacheGtkObjectFids(JNIEnv *env, jobject lpGtkObject, PGtkObject_FID_CACHE lpCache); -void cacheGtkDataFids(JNIEnv *env, jobject lpGtkData, PGtkData_FID_CACHE lpCache); void cacheGtkAdjustmentFids(JNIEnv *env, jobject lpGtkAdjustment, PGtkAdjustment_FID_CACHE lpCache); -void cacheGtkWidgetFids(JNIEnv *env, jobject lpGtkWidget, PGtkWidget_FID_CACHE lpCache); -void cacheGtkContainerFids(JNIEnv *env, jobject lpGtkContainer, PGtkContainer_FID_CACHE lpCache); -void cacheGtkBinFids(JNIEnv *env, jobject lpGtkBin, PGtkBin_FID_CACHE lpCache); -void cacheGtkMenuFids(JNIEnv *env, jobject lpGtkMenu, PGtkMenu_FID_CACHE lpCache); -void cacheGtkMenuShellFids(JNIEnv *env, jobject lpGtkMenuShell, PGtkMenuShell_FID_CACHE lpCache); -void cacheGtkItemFids(JNIEnv *env, jobject lpGtkItem, PGtkItem_FID_CACHE lpCache); -void cacheGtkMenuItemFids(JNIEnv *env, jobject lpGtkMenuItem, PGtkMenuItem_FID_CACHE lpCache); -void cacheGtkCheckMenuItemFids(JNIEnv *env, jobject lpGtkCheckMenuItem, PGtkCheckMenuItem_FID_CACHE lpCache); -void cacheGtkWindowFids(JNIEnv *env, jobject lpGtkWindow, PGtkWindow_FID_CACHE lpCache); -void cacheGtkDialogFids(JNIEnv *env, jobject lpGtkDialog, PGtkDialog_FID_CACHE lpCache); -void cacheGtkColorSelectionDialogFids(JNIEnv *env, jobject lpGtkColorSelectionDialog, PGtkColorSelectionDialog_FID_CACHE lpCache); -void cacheGtkFileSelectionFids(JNIEnv *env, jobject lpGtkFileSelection, PGtkFileSelection_FID_CACHE lpCache); -void cacheGtkFontSelectionDialogFids(JNIEnv *env, jobject lpGtkFontSelectionDialog, PGtkFontSelectionDialog_FID_CACHE lpCache); -void cacheGtkBoxFids(JNIEnv *env, jobject lpGtkBox, PGtkBox_FID_CACHE lpCache); -void cacheGtkHBoxFids(JNIEnv *env, jobject lpGtkHBox, PGtkHBox_FID_CACHE lpCache); void cacheGtkComboFids(JNIEnv *env, jobject lpGtkCombo, PGtkCombo_FID_CACHE lpCache); void cacheGtkCListFids(JNIEnv *env, jobject lpGtkCList, PGtkCList_FID_CACHE lpCache); -void cacheGtkEditableFids(JNIEnv *env, jobject lpGtkEditable, PGtkEditable_FID_CACHE lpCache); -void cacheGtkTextFids(JNIEnv *env, jobject lpGtkText, PGtkText_FID_CACHE lpCache); -void cacheGtkProgressFids(JNIEnv *env, jobject lpGtkProgress, PGtkProgress_FID_CACHE lpCache); -void cacheGtkProgressBarFids(JNIEnv *env, jobject lpGtkProgressBar, PGtkProgressBar_FID_CACHE lpCache); void cacheGtkAllocationFids(JNIEnv *env, jobject lpGtkAllocation, PGtkAllocation_FID_CACHE lpCache); -void cacheGtkArgFids(JNIEnv *env, jobject lpGtkArg, PGtkArg_FID_CACHE lpCache); void cacheGtkRequisitionFids(JNIEnv *env, jobject lpGtkRequisition, PGtkRequisition_FID_CACHE lpCache); void cacheGtkStyleFids(JNIEnv *env, jobject lpGtkStyle, PGtkStyle_FID_CACHE lpCache); void cacheGtkStyleClassFids(JNIEnv *env, jobject lpGtkStyleClass, PGtkStyleClass_FID_CACHE lpCache); @@ -456,32 +267,18 @@ void cacheGtkCTreeFids(JNIEnv *env, jobject lpGtkCTree, PGtkCTree_FID_CACHE lpCa */ void getGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpGdkColor, GdkColor_FID_CACHE *lpGdkColorFc); void setGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpGdkColor, GdkColor_FID_CACHE *lpGdkColorFc); -void getGdkEventKeyFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventKey_FID_CACHE *lpGdkEventKeyFc); -void setGdkEventKeyFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventKey_FID_CACHE *lpGdkEventKeyFc); -void getGdkEventButtonFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventButton_FID_CACHE *lpGdkEventButtonFc); -void setGdkEventButtonFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventButton_FID_CACHE *lpGdkEventButtonFc); -void getGdkEventMotionFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventMotion_FID_CACHE *lpGdkEventMotionFc); -void setGdkEventMotionFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventMotion_FID_CACHE *lpGdkEventMotionFc); void getGdkEventExposeFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventExpose_FID_CACHE *lpGdkEventExposeFc); void setGdkEventExposeFields(JNIEnv *env, jobject lpObject, GdkEvent *lpGdkEvent, GdkEventExpose_FID_CACHE *lpGdkEventExposeFc); void getGdkFontFields(JNIEnv *env, jobject lpObject, GdkFont *lpGdkFont, GdkFont_FID_CACHE *lpGdkFontFc); void setGdkFontFields(JNIEnv *env, jobject lpObject, GdkFont *lpGdkFont, GdkFont_FID_CACHE *lpGdkFontFc); void getGdkGCValuesFields(JNIEnv *env, jobject lpObject, GdkGCValues *lpGdkGCValues, GdkGCValues_FID_CACHE *lpGdkGCValuesFc); void setGdkGCValuesFields(JNIEnv *env, jobject lpObject, GdkGCValues *lpGdkGCValues, GdkGCValues_FID_CACHE *lpGdkGCValuesFc); -void getGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpGdkImage, GdkImage_FID_CACHE *lpGdkImageFc); -void setGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpGdkImage, GdkImage_FID_CACHE *lpGdkImageFc); -void getGdkPointFields(JNIEnv *env, jobject lpObject, GdkPoint *lpGdkPoint, GdkPoint_FID_CACHE *lpGdkPointFc); -void setGdkPointFields(JNIEnv *env, jobject lpObject, GdkPoint *lpGdkPoint, GdkPoint_FID_CACHE *lpGdkPointFc); void getGdkRectangleFields(JNIEnv *env, jobject lpObject, GdkRectangle *lpGdkRectangle, GdkRectangle_FID_CACHE *lpGdkRectangleFc); void setGdkRectangleFields(JNIEnv *env, jobject lpObject, GdkRectangle *lpGdkRectangle, GdkRectangle_FID_CACHE *lpGdkRectangleFc); void getGdkVisualFields(JNIEnv *env, jobject lpObject, GdkVisual *lpGdkVisual, GdkVisual_FID_CACHE *lpGdkVisualFc); void setGdkVisualFields(JNIEnv *env, jobject lpObject, GdkVisual *lpGdkVisual, GdkVisual_FID_CACHE *lpGdkVisualFc); void getGtkAllocationFields(JNIEnv *env, jobject lpObject, GtkAllocation *lpGtkAllocation, GtkAllocation_FID_CACHE *lpGtkAllocationFc); void setGtkAllocationFields(JNIEnv *env, jobject lpObject, GtkAllocation *lpGtkAllocation, GtkAllocation_FID_CACHE *lpGtkAllocationFc); -void getGtkArgFields(JNIEnv *env, jobject lpObject, GtkArg *lpGtkArg, GtkArg_FID_CACHE *lpGtkArgFc); -void setGtkArgFields(JNIEnv *env, jobject lpObject, GtkArg *lpGtkArg, GtkArg_FID_CACHE *lpGtkArgFc); -void getGtkBinFields(JNIEnv *env, jobject lpObject, GtkBin *lpGtkBin, GtkBin_FID_CACHE *lpGtkBinFc); -void setGtkBinFields(JNIEnv *env, jobject lpObject, GtkBin *lpGtkBin, GtkBin_FID_CACHE *lpGtkBinFc); void getGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkCList_FID_CACHE *lpGtkCListFc); void setGtkCListFields(JNIEnv *env, jobject lpObject, GtkCList *lpGtkCList, GtkCList_FID_CACHE *lpGtkCListFc); void getGtkCListRowFields(JNIEnv *env, jobject lpObject, GtkCListRow *lpGtkCListRow, GtkCListRow_FID_CACHE *lpGtkCListRowFc); @@ -490,102 +287,34 @@ void getGtkCListColumnFields(JNIEnv *env, jobject lpObject, GtkCListColumn *lpGt void setGtkCListColumnFields(JNIEnv *env, jobject lpObject, GtkCListColumn *lpGtkCListColumn, GtkCListColumn_FID_CACHE *lpGtkCListColumnFc); void getGtkCTreeRowFields(JNIEnv *env, jobject lpObject, GtkCTreeRow *lpGtkCTreeRow, GtkCTreeRow_FID_CACHE *lpGtkCTreeRowFc); void setGtkCTreeRowFields(JNIEnv *env, jobject lpObject, GtkCTreeRow *lpGtkCTreeRow, GtkCTreeRow_FID_CACHE *lpGtkCTreeRowFc); -void getGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSelectionDialog *lpGtkColorSelectionDialog, GtkColorSelectionDialog_FID_CACHE *lpGtkColorSelectionDialogFc); -void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSelectionDialog *lpGtkColorSelectionDialog, GtkColorSelectionDialog_FID_CACHE *lpGtkColorSelectionDialogFc); void getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpGtkCombo, GtkCombo_FID_CACHE *lpGtkComboFc); void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpGtkCombo, GtkCombo_FID_CACHE *lpGtkComboFc); -void getGtkContainerFields(JNIEnv *env, jobject lpObject, GtkContainer *lpGtkContainer, GtkContainer_FID_CACHE *lpGtkContainerFc); -void setGtkContainerFields(JNIEnv *env, jobject lpObject, GtkContainer *lpGtkContainer, GtkContainer_FID_CACHE *lpGtkContainerFc); -void getGtkDataFields(JNIEnv *env, jobject lpObject, GtkData *lpGtkData, GtkData_FID_CACHE *lpGtkDataFc); -void setGtkDataFields(JNIEnv *env, jobject lpObject, GtkData *lpGtkData, GtkData_FID_CACHE *lpGtkDataFc); -void getGtkEditableFields(JNIEnv *env, jobject lpObject, GtkEditable *lpGtkEditable, GtkEditable_FID_CACHE *lpGtkEditableFc); -void setGtkEditableFields(JNIEnv *env, jobject lpObject, GtkEditable *lpGtkEditable, GtkEditable_FID_CACHE *lpGtkEditableFc); -void getGtkFrameFields(JNIEnv *env, jobject lpObject, GtkFrame *lpGtkFrame, GtkFrame_FID_CACHE *lpGtkFrameFc); -void setGtkFrameFields(JNIEnv *env, jobject lpObject, GtkFrame *lpGtkFrame, GtkFrame_FID_CACHE *lpGtkFrameFc); -void getGtkTextFields(JNIEnv *env, jobject lpObject, GtkText *lpGtkText, GtkText_FID_CACHE *lpGtkTextFc); -void setGtkTextFields(JNIEnv *env, jobject lpObject, GtkText *lpGtkText, GtkText_FID_CACHE *lpGtkTextFc); -void getGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpGtkFileSelection, GtkFileSelection_FID_CACHE *lpGtkFileSelectionFc); -void setGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpGtkFileSelection, GtkFileSelection_FID_CACHE *lpGtkFileSelectionFc); -void getGtkFontSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkFontSelectionDialog *lpGtkFontSelectionDialog, GtkFontSelectionDialog_FID_CACHE *lpGtkFontSelectionDialogFc); -void setGtkFontSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkFontSelectionDialog *lpGtkFontSelectionDialog, GtkFontSelectionDialog_FID_CACHE *lpGtkFontSelectionDialogFc); -void getGtkObjectFields(JNIEnv *env, jobject lpObject, GtkObject *lpGtkObject, GtkObject_FID_CACHE *lpGtkObjectFc); -void setGtkObjectFields(JNIEnv *env, jobject lpObject, GtkObject *lpGtkObject, GtkObject_FID_CACHE *lpGtkObjectFc); -void getGtkProgressFields(JNIEnv *env, jobject lpObject, GtkProgress *lpGtkProgress, GtkProgress_FID_CACHE *lpGtkProgressFc); -void setGtkProgressFields(JNIEnv *env, jobject lpObject, GtkProgress *lpGtkProgress, GtkProgress_FID_CACHE *lpGtkProgressFc); -void getGtkProgressBarFields(JNIEnv *env, jobject lpObject, GtkProgressBar *lpGtkProgressBar, GtkProgressBar_FID_CACHE *lpGtkProgressBarFc); -void setGtkProgressBarFields(JNIEnv *env, jobject lpObject, GtkProgressBar *lpGtkProgressBar, GtkProgressBar_FID_CACHE *lpGtkProgressBarFc); void getGtkRequisitionFields(JNIEnv *env, jobject lpObject, GtkRequisition *lpGtkRequisition, GtkRequisition_FID_CACHE *lpGtkRequisitionFc); void setGtkRequisitionFields(JNIEnv *env, jobject lpObject, GtkRequisition *lpGtkRequisition, GtkRequisition_FID_CACHE *lpGtkRequisitionFc); void getGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkStyle_FID_CACHE *lpGtkStyleFc); void setGtkStyleFields(JNIEnv *env, jobject lpObject, GtkStyle *lpGtkStyle, GtkStyle_FID_CACHE *lpGtkStyleFc); void getGtkStyleClassFields(JNIEnv *env, jobject lpObject, GtkStyleClass *lpGtkStyleClass, GtkStyleClass_FID_CACHE *lpGtkStyleClassFc); void setGtkStyleClassFields(JNIEnv *env, jobject lpObject, GtkStyleClass *lpGtkStyleClass, GtkStyleClass_FID_CACHE *lpGtkStyleClassFc); -void getGtkWidgetFields(JNIEnv *env, jobject lpObject, GtkWidget *lpGtkWidget, GtkWidget_FID_CACHE *lpGtkWidgetFc); -void setGtkWidgetFields(JNIEnv *env, jobject lpObject, GtkWidget *lpGtkWidget, GtkWidget_FID_CACHE *lpGtkWidgetFc); -void getGtkWindowFields(JNIEnv *env, jobject lpObject, GtkWindow *lpGtkWindow, GtkWindow_FID_CACHE *lpGtkWindowFc); -void setGtkWindowFields(JNIEnv *env, jobject lpObject, GtkWindow *lpGtkWindow, GtkWindow_FID_CACHE *lpGtkWindowFc); -void getGtkDialogFields(JNIEnv *env, jobject lpObject, GtkDialog *lpGtkDialog, GtkDialog_FID_CACHE *lpGtkDialogFc); -void setGtkDialogFields(JNIEnv *env, jobject lpObject, GtkDialog *lpGtkDialog, GtkDialog_FID_CACHE *lpGtkDialogFc); -void getGtkCheckMenuItemFields(JNIEnv *env, jobject lpObject, GtkCheckMenuItem *lpGtkCheckMenuItem, GtkCheckMenuItem_FID_CACHE *lpGtkCheckMenuItemFc); -void setGtkCheckMenuItemFields(JNIEnv *env, jobject lpObject, GtkCheckMenuItem *lpGtkCheckMenuItem, GtkCheckMenuItem_FID_CACHE *lpGtkCheckMenuItemFc); void getGtkAdjustmentFields(JNIEnv *env, jobject lpObject, GtkAdjustment *lpGtkAdjustment, GtkAdjustment_FID_CACHE *lpGtkAdjustmentFc); void setGtkAdjustmentFields(JNIEnv *env, jobject lpObject, GtkAdjustment *lpGtkAdjustment, GtkAdjustment_FID_CACHE *lpGtkAdjustmentFc); -void getGtkBoxFields(JNIEnv *env, jobject lpObject, GtkBox *lpGtkBox, GtkBox_FID_CACHE *lpGtkBoxFc); -void setGtkBoxFields(JNIEnv *env, jobject lpObject, GtkBox *lpGtkBox, GtkBox_FID_CACHE *lpGtkBoxFc); -void getGtkHBoxFields(JNIEnv *env, jobject lpObject, GtkHBox *lpGtkHBox, GtkHBox_FID_CACHE *lpGtkHBoxFc); -void setGtkHBoxFields(JNIEnv *env, jobject lpObject, GtkHBox *lpGtkHBox, GtkHBox_FID_CACHE *lpGtkHBoxFc); -void getGtkMenuFields(JNIEnv *env, jobject lpObject, GtkMenu *lpGtkMenu, GtkMenu_FID_CACHE *lpGtkMenuFc); -void setGtkMenuFields(JNIEnv *env, jobject lpObject, GtkMenu *lpGtkMenu, GtkMenu_FID_CACHE *lpGtkMenuFc); -void getGtkMenuShellFields(JNIEnv *env, jobject lpObject, GtkMenuShell *lpGtkMenuShell, GtkMenuShell_FID_CACHE *lpGtkMenuShellFc); -void setGtkMenuShellFields(JNIEnv *env, jobject lpObject, GtkMenuShell *lpGtkMenuShell, GtkMenuShell_FID_CACHE *lpGtkMenuShellFc); -void getGtkMenuItemFields(JNIEnv *env, jobject lpObject, GtkMenuItem *lpGtkMenuItem, GtkMenuItem_FID_CACHE *lpGtkMenuItemFc); -void setGtkMenuItemFields(JNIEnv *env, jobject lpObject, GtkMenuItem *lpGtkMenuItem, GtkMenuItem_FID_CACHE *lpGtkMenuItemFc); void getGtkCTreeFields(JNIEnv *env, jobject lpObject, GtkCTree *lpGtkCTree, GtkCTree_FID_CACHE *lpGtkCTreeFc); void setGtkCTreeFields(JNIEnv *env, jobject lpObject, GtkCTree *lpGtkCTree, GtkCTree_FID_CACHE *lpGtkCTreeFc); extern GdkColor_FID_CACHE GdkColorFc; -extern GdkEventKey_FID_CACHE GdkEventKeyFc; -extern GdkEventButton_FID_CACHE GdkEventButtonFc; -extern GdkEventMotion_FID_CACHE GdkEventMotionFc; extern GdkEventExpose_FID_CACHE GdkEventExposeFc; extern GdkFont_FID_CACHE GdkFontFc; extern GdkGCValues_FID_CACHE GdkGCValuesFc; -extern GdkImage_FID_CACHE GdkImageFc; -extern GdkPoint_FID_CACHE GdkPointFc; extern GdkRectangle_FID_CACHE GdkRectangleFc; extern GdkVisual_FID_CACHE GdkVisualFc; extern GtkAdjustment_FID_CACHE GtkAdjustmentFc; extern GtkAllocation_FID_CACHE GtkAllocationFc; -extern GtkBin_FID_CACHE GtkBinFc; -extern GtkCheckMenuItem_FID_CACHE GtkCheckMenuItemFc; -extern GtkContainer_FID_CACHE GtkContainerFc; extern GtkCListRow_FID_CACHE GtkCListRowFc; extern GtkCListColumn_FID_CACHE GtkCListColumnFc; extern GtkCTreeRow_FID_CACHE GtkCTreeRowFc; extern GtkCTree_FID_CACHE GtkCTreeFc; -extern GtkColorSelectionDialog_FID_CACHE GtkColorSelectionDialogFc;\ extern GtkCList_FID_CACHE GtkCListFc; -extern GtkData_FID_CACHE GtkDataFc; -extern GtkEditable_FID_CACHE GtkEditableFc; -extern GtkItem_FID_CACHE GtkItemFc; -extern GtkMenu_FID_CACHE GtkMenuFc; -extern GtkMenuShell_FID_CACHE GtkMenuShellFc; -extern GtkMenuItem_FID_CACHE GtkMenuItemFc; -extern GtkObject_FID_CACHE GtkObjectFc; -extern GtkWidget_FID_CACHE GtkWidgetFc; -extern GtkWindow_FID_CACHE GtkWindowFc; -extern GtkDialog_FID_CACHE GtkDialogFc; -extern GtkBox_FID_CACHE GtkBoxFc; -extern GtkHBox_FID_CACHE GtkHBoxFc; extern GtkCombo_FID_CACHE GtkComboFc; -extern GtkFileSelection_FID_CACHE GtkFileSelectionFc; -extern GtkFrame_FID_CACHE GtkFrameFc; -extern GtkFontSelectionDialog_FID_CACHE GtkFontSelectionDialogFc; -extern GtkText_FID_CACHE GtkTextFc; -extern GtkProgress_FID_CACHE GtkProgressFc; -extern GtkProgressBar_FID_CACHE GtkProgressBarFc; -extern GtkArg_FID_CACHE GtkArgFc; extern GtkRequisition_FID_CACHE GtkRequisitionFc; extern GtkStyle_FID_CACHE GtkStyleFc; extern GtkStyleClass_FID_CACHE GtkStyleClassFc; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdk.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdk.c new file mode 100644 index 0000000000..7e4441b7eb --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdk.c @@ -0,0 +1,1077 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +/* + * This file is logically part of swt.c, and will be eventually merged back. + */ + +/** + * SWT natives for the GTK Drawing Toolkit. + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + +/* ***** General ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1width + (JNIEnv *env, jclass that) +{ + return (jint)gdk_screen_width(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1height + (JNIEnv *env, jclass that) +{ + return (jint)gdk_screen_height(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1width_1mm + (JNIEnv *env, jclass that) +{ + return (jint)gdk_screen_width_mm(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1flush + (JNIEnv *env, jclass that) +{ + gdk_flush(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1beep + (JNIEnv *env, jclass that) +{ + gdk_beep(); +} + + +/* ***** Points, Rectangles and Regions ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1new + (JNIEnv *env, jclass that) +{ + return (jint)gdk_region_new(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1destroy + (JNIEnv *env, jclass that, jint region) +{ + gdk_region_destroy((GdkRegion*)region); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1get_1clipbox + (JNIEnv *env, jclass that, jint region, jobject rectangle) +{ + DECL_GLOB(pGlob) + GdkRectangle rectangle_struct, *rectangle1 = NULL; + if (rectangle) { + rectangle1 = &rectangle_struct; + cacheGdkRectangleFids(env, rectangle, &PGLOB(GdkRectangleFc)); + getGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); + } + gdk_region_get_clipbox((GdkRegion*)region, (GdkRectangle*)rectangle1); + if (rectangle) { + setGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); + } +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1empty + (JNIEnv *env, jclass that, jint region) +{ + return (jboolean)gdk_region_empty((GdkRegion*)region); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1equal + (JNIEnv *env, jclass that, jint region1, jint region2) +{ + return (jboolean)gdk_region_equal((GdkRegion*)region1, (GdkRegion*)region2); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1point_1in + (JNIEnv *env, jclass that, jint region, jint x, jint y) +{ + return (jboolean)gdk_region_point_in((GdkRegion*)region, (int)x, (int)y); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1rect_1in + (JNIEnv *env, jclass that, jint region, jobject rect) +{ + DECL_GLOB(pGlob) + jint rc; + GdkRectangle rect_struct, *rect1 = NULL; + if (rect) { + rect1 = &rect_struct; + cacheGdkRectangleFids(env, rect, &PGLOB(GdkRectangleFc)); + getGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); + } + rc = (jint)gdk_region_rect_in((GdkRegion*)region, (GdkRectangle*)rect1); + if (rect) { + setGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1union_1with_1rect + (JNIEnv *env, jclass that, jint region, jobject rect) +{ + DECL_GLOB(pGlob) + jint rc; + GdkRectangle rect_struct, *rect1 = NULL; + if (rect) { + rect1 = &rect_struct; + cacheGdkRectangleFids(env, rect, &PGLOB(GdkRectangleFc)); + getGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); + } + gdk_region_union_with_rect((GdkRegion*)region, (GdkRectangle*)rect1); + if (rect) { + setGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); + } + return 0; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1regions_1union + (JNIEnv *env, jclass that, jint source1, jint source2) +{ + return (jint)gdk_regions_union((GdkRegion*)source1, (GdkRegion*)source2); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1regions_1subtract + (JNIEnv *env, jclass that, jint source1, jint source2) +{ + return (jint)gdk_regions_subtract((GdkRegion*)source1, (GdkRegion*)source2); +} + + +/* ***** Graphics Contexts ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1new + (JNIEnv *env, jclass that, jint window) +{ + return (jint)gdk_gc_new((GdkWindow*)window); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1unref + (JNIEnv *env, jclass that, jint gc) +{ + gdk_gc_unref((GdkGC*)gc); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1destroy + (JNIEnv *env, jclass that, jint gc) +{ + gdk_gc_destroy((GdkGC*)gc); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1get_1values + (JNIEnv *env, jclass that, jint gc, jobject values) +{ + DECL_GLOB(pGlob) + GdkGCValues values_struct, *values1 = NULL; + if (values) { + values1 = &values_struct; + cacheGdkGCValuesFids(env, values, &PGLOB(GdkGCValuesFc)); + getGdkGCValuesFields(env, values, values1, &PGLOB(GdkGCValuesFc)); + } + gdk_gc_get_values((GdkGC*)gc, (GdkGCValues*)values1); + if (values) { + setGdkGCValuesFields(env, values, values1, &PGLOB(GdkGCValuesFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1foreground + (JNIEnv *env, jclass that, jint gc, jobject color) +{ + DECL_GLOB(pGlob) + GdkColor color_struct, *color1 = NULL; + if (color) { + color1 = &color_struct; + cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); + getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + gdk_gc_set_foreground((GdkGC*)gc, (GdkColor*)color1); + if (color) { + setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1background + (JNIEnv *env, jclass that, jint gc, jobject color) +{ + DECL_GLOB(pGlob) + GdkColor color_struct, *color1 = NULL; + if (color) { + color1 = &color_struct; + cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); + getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + gdk_gc_set_background((GdkGC*)gc, (GdkColor*)color1); + if (color) { + setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1font + (JNIEnv *env, jclass that, jint gc, jint font) +{ + gdk_gc_set_font((GdkGC*)gc, (GdkFont*)font); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1function + (JNIEnv *env, jclass that, jint gc, jint function) +{ + gdk_gc_set_function((GdkGC*)gc, (GdkFunction)function); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1fill + (JNIEnv *env, jclass that, jint gc, jint fill) +{ + gdk_gc_set_fill((GdkGC*)gc, (GdkFill)fill); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1stipple + (JNIEnv *env, jclass that, jint gc, jint stipple) +{ + gdk_gc_set_stipple((GdkGC*)gc, (GdkPixmap*)stipple); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1mask + (JNIEnv *env, jclass that, jint gc, jint mask) +{ + gdk_gc_set_clip_mask((GdkGC*)gc, (GdkBitmap*)mask); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1rectangle + (JNIEnv *env, jclass that, jint gc, jobject rectangle) +{ + DECL_GLOB(pGlob) + GdkRectangle rectangle_struct, *rectangle1 = NULL; + if (rectangle) { + rectangle1 = &rectangle_struct; + cacheGdkRectangleFids(env, rectangle, &PGLOB(GdkRectangleFc)); + getGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); + } + gdk_gc_set_clip_rectangle((GdkGC*)gc, (GdkRectangle*)rectangle1); + if (rectangle) { + setGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1region + (JNIEnv *env, jclass that, jint gc, jint region) +{ + gdk_gc_set_clip_region((GdkGC*)gc, (GdkRegion*)region); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1subwindow + (JNIEnv *env, jclass that, jint gc, jint mode) +{ + gdk_gc_set_subwindow((GdkGC*)gc, (GdkSubwindowMode)mode); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1exposures + (JNIEnv *env, jclass that, jint gc, jboolean exposures) +{ + gdk_gc_set_exposures((GdkGC*)gc, (gboolean)exposures); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1line_1attributes + (JNIEnv *env, jclass that, jint gc, jint line_width, jint line_style, jint cap_style, jint join_style) +{ + gdk_gc_set_line_attributes((GdkGC*)gc, (gint)line_width, (GdkLineStyle)line_style, (GdkCapStyle)cap_style, (GdkJoinStyle)join_style); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1dashes + (JNIEnv *env, jclass that, jint gc, jint dash_offset, jbyteArray dash_list, jint n) +{ + jbyte *dash_list1 = NULL; + if (dash_list) { + dash_list1 = (*env)->GetByteArrayElements(env, dash_list, NULL); + } + gdk_gc_set_dashes((GdkGC*)gc, (gint)dash_offset, (gint8*)dash_list1, (gint)n); + if (dash_list) { + (*env)->ReleaseByteArrayElements(env, dash_list, dash_list1, 0); + } +} + + +/* ***** Drawing Primitives ***** */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1line + (JNIEnv *env, jclass that, jint drawable, jint gc, jint x1, jint y1, jint x2, jint y2) +{ + gdk_draw_line((GdkDrawable*)drawable, (GdkGC*)gc, (gint)x1, (gint)y1, (gint)x2, (gint)y2); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1rectangle + (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jint x, jint y, jint width, jint height) +{ + gdk_draw_rectangle((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (gint)x, (gint)y, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1arc + (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jint x, jint y, jint width, jint height, jint angle1, jint angle2) +{ + gdk_draw_arc((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (gint)x, (gint)y, (gint)width, (gint)height, (gint)angle1, (gint)angle2); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1polygon + (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jshortArray points, jint npoints) +{ + jshort *points1 = NULL; + if (points) { + points1 = (*env)->GetShortArrayElements(env, points, NULL); + } + gdk_draw_polygon((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (GdkPoint*)points1, (gint)npoints); + if (points) { + (*env)->ReleaseShortArrayElements(env, points, points1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1string + (JNIEnv *env, jclass that, jint drawable, jint font, jint gc, jint x, jint y, jbyteArray string) +{ + jbyte *string1 = NULL; + if (string) { + string1 = (*env)->GetByteArrayElements(env, string, NULL); + } + gdk_draw_string((GdkDrawable*)drawable, (GdkFont*)font, (GdkGC*)gc, (gint)x, (gint)y, (gchar*)string1); + if (string) { + (*env)->ReleaseByteArrayElements(env, string, string1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1pixmap + (JNIEnv *env, jclass that, jint drawable, jint gc, jint src, jint xsrc, jint ysrc, jint xdest, jint ydest, jint width, jint height) +{ + gdk_draw_pixmap((GdkDrawable*)drawable, (GdkGC*)gc, (GdkDrawable*)src, (gint)xsrc, (gint)ysrc, (gint)xdest, (gint)ydest, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1lines + (JNIEnv *env, jclass that, jint drawable, jint gc, jshortArray points, jint npoints) +{ + jshort *points1 = NULL; + if (points) { + points1 = (*env)->GetShortArrayElements(env, points, NULL); + } + gdk_draw_lines((GdkDrawable*)drawable, (GdkGC*)gc, (GdkPoint*)points1, (gint)npoints); + if (points) { + (*env)->ReleaseShortArrayElements(env, points, points1, 0); + } +} + + +/* ***** Bitmaps and Pixmaps ***** */ + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1pixmap_1new + (JNIEnv *env, jclass that, jint window, jint width, jint height, jint depth) +{ + return (jint)gdk_pixmap_new((GdkWindow*)window, (gint)width, (gint)height, (gint)depth); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1bitmap_1create_1from_1data + (JNIEnv *env, jclass that, jint window, jbyteArray data, jint width, jint height) +{ + jint rc; + jbyte *data1 = NULL; + if (data) { + data1 = (*env)->GetByteArrayElements(env, data, NULL); + } + rc = (jint)gdk_bitmap_create_from_data((GdkWindow*)window, (gchar*)data1, (gint)width, (gint)height); + if (data) { + (*env)->ReleaseByteArrayElements(env, data, data1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1pixmap_1unref + (JNIEnv *env, jclass that, jint pixmap) +{ + gdk_pixmap_unref((GdkPixmap*)pixmap); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1bitmap_1unref + (JNIEnv *env, jclass that, jint pixmap) +{ + gdk_bitmap_unref((GdkBitmap*)pixmap); +} + + +/* ***** GdkRGB ***** */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1rgb_1init + (JNIEnv *env, jclass cl) +{ + gdk_rgb_init(); +} + + +/* ***** Images ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1image_1get + (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) +{ + return (jint)gdk_image_get((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1image_1get_1pixel + (JNIEnv *env, jclass that, jint image, jint x, jint y) +{ + return (jint)gdk_image_get_pixel((GdkImage*)image, (gint)x, (gint)y); +} + + +/* ***** Pixbufs ***** */ + + +/* ***** Colormaps and Colors ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1colormap_1get_1system + (JNIEnv *env, jclass that) +{ + return (jint)gdk_colormap_get_system(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1free + (JNIEnv *env, jclass that, jobject color) +{ + DECL_GLOB(pGlob) + GdkColor color_struct, *color1 = NULL; + if (color) { + color1 = &color_struct; + cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); + getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + gdk_color_free((GdkColor*)color1); + if (color) { + setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1colors_1free + (JNIEnv *env, jclass that, jint colormap, jintArray pixels, jint npixels, jint planes) +{ + jint *pixels1 = NULL; + if (pixels) { + pixels1 = (*env)->GetIntArrayElements(env, pixels, NULL); + } + gdk_colors_free((GdkColormap*)colormap, (gulong*)pixels1, (gint)npixels, (gulong)planes); + if (pixels) { + (*env)->ReleaseIntArrayElements(env, pixels, pixels1, 0); + } +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1white + (JNIEnv *env, jclass that, jint colormap, jobject color) +{ + DECL_GLOB(pGlob) + jboolean rc; + GdkColor color_struct, *color1 = NULL; + if (color) { + color1 = &color_struct; + cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); + getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + rc = (jboolean)gdk_color_white((GdkColormap*)colormap, (GdkColor*)color1); + if (color) { + setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + return rc; +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1alloc + (JNIEnv *env, jclass that, jint colormap, jobject color) +{ + DECL_GLOB(pGlob) + jboolean rc; + GdkColor color_struct, *color1 = NULL; + if (color) { + color1 = &color_struct; + cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); + getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + rc = (jboolean)gdk_color_alloc((GdkColormap*)colormap, (GdkColor*)color1); + if (color) { + setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); + } + return rc; +} + + +/* ***** Visuals ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1visual_1get_1system + (JNIEnv *env, jclass that) +{ + return (jint)gdk_visual_get_system(); +} + + +/* ***** Fonts ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1from_1description + (JNIEnv *env, jclass that, jint desc) +{ + return (jint) gdk_font_from_description((PangoFontDescription*) desc); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1FONT_1ASCENT + (JNIEnv *env, jclass that, jint font) +{ + return (jint) (((GdkFont*) font) -> ascent); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1FONT_1DESCENT + (JNIEnv *env, jclass that, jint font) +{ + return (jint) (((GdkFont*) font) -> descent); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1load + (JNIEnv *env, jclass that, jbyteArray font_name) +{ + jint rc; + jbyte *font_name1 = NULL; + if (font_name) { + font_name1 = (*env)->GetByteArrayElements(env, font_name, NULL); + } + rc = (jint)gdk_font_load((gchar*)font_name1); + if (font_name) { + (*env)->ReleaseByteArrayElements(env, font_name, font_name1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1ref + (JNIEnv *env, jclass that, jint font) +{ + return (jint)gdk_font_ref((GdkFont*)font); +} + +JNIEXPORT jstring JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1full_1name_1get + (JNIEnv *env, jclass that, jint font) +{ + gchar *name = gdk_font_full_name_get ((GdkFont*)font); + return NewStringUTF (env, name); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1unref + (JNIEnv *env, jclass that, jint font) +{ + gdk_font_unref((GdkFont*)font); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1equal + (JNIEnv *env, jclass that, jint fonta, jint fontb) +{ + return (jboolean)gdk_font_equal((GdkFont*)fonta, (GdkFont*)fontb); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1width + (JNIEnv *env, jclass that, jint font, jbyteArray string) +{ + jint rc; + jbyte *string1 = NULL; + if (string) { + string1 = (*env)->GetByteArrayElements(env, string, NULL); + } + rc = (jint)gdk_string_width((GdkFont*)font, (gchar*)string1); + if (string) { + (*env)->ReleaseByteArrayElements(env, string, string1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1char_1width + (JNIEnv *env, jclass that, jint font, jbyte character) +{ + return (jint)gdk_char_width((GdkFont*)font, (gchar)character); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1height + (JNIEnv *env, jclass that, jint font, jbyteArray string) +{ + jint rc; + jbyte *string1 = NULL; + if (string) { + string1 = (*env)->GetByteArrayElements(env, string, NULL); + } + rc = (jint)gdk_string_height((GdkFont*)font, (gchar*)string1); + if (string) { + (*env)->ReleaseByteArrayElements(env, string, string1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1extents + (JNIEnv *env, jclass that, jint font, jbyteArray string, jintArray lbearing, jintArray rbearing, jintArray width, jintArray ascent, jintArray descent) +{ + jbyte *string1 = NULL; + jint *lbearing1 = NULL; + jint *rbearing1 = NULL; + jint *width1 = NULL; + jint *ascent1 = NULL; + jint *descent1 = NULL; + if (string) { + string1 = (*env)->GetByteArrayElements(env, string, NULL); + } + if (lbearing) { + lbearing1 = (*env)->GetIntArrayElements(env, lbearing, NULL); + } + if (rbearing) { + rbearing1 = (*env)->GetIntArrayElements(env, rbearing, NULL); + } + if (width) { + width1 = (*env)->GetIntArrayElements(env, width, NULL); + } + if (ascent) { + ascent1 = (*env)->GetIntArrayElements(env, ascent, NULL); + } + if (descent) { + descent1 = (*env)->GetIntArrayElements(env, descent, NULL); + } + gdk_string_extents((GdkFont*)font, (gchar*)string1, (gint*)lbearing1, (gint*)rbearing1, (gint*)width1, (gint*)ascent1, (gint*)descent1); + if (string) { + (*env)->ReleaseByteArrayElements(env, string, string1, 0); + } + if (lbearing) { + (*env)->ReleaseIntArrayElements(env, lbearing, lbearing1, 0); + } + if (rbearing) { + (*env)->ReleaseIntArrayElements(env, rbearing, rbearing1, 0); + } + if (width) { + (*env)->ReleaseIntArrayElements(env, width, width1, 0); + } + if (ascent) { + (*env)->ReleaseIntArrayElements(env, ascent, ascent1, 0); + } + if (descent) { + (*env)->ReleaseIntArrayElements(env, descent, descent1, 0); + } +} + + +/* ***** Cursors ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1new + (JNIEnv *env, jclass that, jint cursor_type) +{ + return (jint)gdk_cursor_new((GdkCursorType)cursor_type); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1new_1from_1pixmap + (JNIEnv *env, jclass that, jint source, jint mask, jobject fg, jobject bg, jint x, jint y) +{ + DECL_GLOB(pGlob) + jint rc; + GdkColor fg_struct, *fg1 = NULL; + GdkColor bg_struct, *bg1 = NULL; + if (fg) { + fg1 = &fg_struct; + cacheGdkColorFids(env, fg, &PGLOB(GdkColorFc)); + getGdkColorFields(env, fg, fg1, &PGLOB(GdkColorFc)); + } + if (bg) { + bg1 = &bg_struct; + cacheGdkColorFids(env, bg, &PGLOB(GdkColorFc)); + getGdkColorFields(env, bg, bg1, &PGLOB(GdkColorFc)); + } + rc = (jint)gdk_cursor_new_from_pixmap((GdkPixmap*)source, (GdkPixmap*)mask, (GdkColor*)fg1, (GdkColor*)bg1, (gint)x, (gint)y); + if (fg) { + setGdkColorFields(env, fg, fg1, &PGLOB(GdkColorFc)); + } + if (bg) { + setGdkColorFields(env, bg, bg1, &PGLOB(GdkColorFc)); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1destroy + (JNIEnv *env, jclass that, jint cursor) +{ + gdk_cursor_destroy((GdkCursor*)cursor); +} + + +/* ***** Windows ***** */ + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1at_1pointer + (JNIEnv *env, jclass that, jintArray win_x, jintArray win_y) +{ + jint rc; + jint *win_x1 = NULL; + jint *win_y1 = NULL; + if (win_x) { + win_x1 = (*env)->GetIntArrayElements(env, win_x, NULL); + } + if (win_y) { + win_y1 = (*env)->GetIntArrayElements(env, win_y, NULL); + } + rc = (jint)gdk_window_at_pointer((gint*)win_x1, (gint*)win_y1); + if (win_x) { + (*env)->ReleaseIntArrayElements(env, win_x, win_x1, 0); + } + if (win_y) { + (*env)->ReleaseIntArrayElements(env, win_y, win_y1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1clear_1area + (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) +{ + gdk_window_clear_area((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1resize + (JNIEnv *env, jclass that, jint window, jint width, jint height) +{ + gdk_window_resize((GdkWindow*)window, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1move + (JNIEnv *env, jclass that, jint window, jint x, jint y) +{ + gdk_window_move((GdkWindow*)window, (gint)x, (gint)y); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1clear_1area_1e + (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) +{ + gdk_window_clear_area_e((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1copy_1area + (JNIEnv *env, jclass that, jint window, jint gc, jint x, jint y, jint source_window, jint source_x, jint source_y, jint width, jint height) +{ + gdk_window_copy_area((GdkWindow*)window, (GdkGC*)gc, (gint)x, (gint)y, (GdkWindow*)source_window, (gint)source_x, (gint)source_y, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1raise + (JNIEnv *env, jclass that, jint window) +{ + gdk_window_raise((GdkWindow*)window); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1lower + (JNIEnv *env, jclass that, jint window) +{ + gdk_window_lower((GdkWindow*)window); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1user_1data + (JNIEnv *env, jclass that, jint window, jint user_data) +{ + gdk_window_set_user_data((GdkWindow*)window, (gpointer)user_data); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1cursor + (JNIEnv *env, jclass that, jint window, jint cursor) +{ + gdk_window_set_cursor((GdkWindow*)window, (GdkCursor*)cursor); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1user_1data + (JNIEnv *env, jclass that, jint window, jintArray data) +{ + jint *data1 = NULL; + if (data) { + data1 = (*env)->GetIntArrayElements(env, data, NULL); + } + gdk_window_get_user_data((GdkWindow*)window, (gpointer*)data1); + if (data) { + (*env)->ReleaseIntArrayElements(env, data, data1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1geometry + (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y, jintArray width, jintArray height, jintArray depth) +{ + jint *x1 = NULL; + jint *y1 = NULL; + jint *width1 = NULL; + jint *height1 = NULL; + jint *depth1 = NULL; + if (x) { + x1 = (*env)->GetIntArrayElements(env, x, NULL); + } + if (y) { + y1 = (*env)->GetIntArrayElements(env, y, NULL); + } + if (width) { + width1 = (*env)->GetIntArrayElements(env, width, NULL); + } + if (height) { + height1 = (*env)->GetIntArrayElements(env, height, NULL); + } + if (depth) { + depth1 = (*env)->GetIntArrayElements(env, depth, NULL); + } + gdk_window_get_geometry((GdkWindow*)window, (gint*)x1, (gint*)y1, (gint*)width1, (gint*)height1, (gint*)depth1); + if (x) { + (*env)->ReleaseIntArrayElements(env, x, x1, 0); + } + if (y) { + (*env)->ReleaseIntArrayElements(env, y, y1, 0); + } + if (width) { + (*env)->ReleaseIntArrayElements(env, width, width1, 0); + } + if (height) { + (*env)->ReleaseIntArrayElements(env, height, height1, 0); + } + if (depth) { + (*env)->ReleaseIntArrayElements(env, depth, depth1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1drawable_1get_1size + (JNIEnv *env, jclass that, jint drawable, jintArray width, jintArray height) +{ + jint *width1 = NULL; + jint *height1 = NULL; + if (width) { + width1 = (*env)->GetIntArrayElements(env, width, NULL); + } + if (height) { + height1 = (*env)->GetIntArrayElements(env, height, NULL); + } + gdk_drawable_get_size((GdkDrawable*)drawable, (gint*)width1, (gint*)height1); + if (width) { + (*env)->ReleaseIntArrayElements(env, width, width1, 0); + } + if (height) { + (*env)->ReleaseIntArrayElements(env, height, height1, 0); + } +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1drawable_1get_1depth + (JNIEnv *env, jclass that, jint drawable) +{ + return (jint)gdk_drawable_get_depth((GdkDrawable*)drawable); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1origin + (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y) +{ + jint rc; + jint *x1 = NULL; + jint *y1 = NULL; + if (x) { + x1 = (*env)->GetIntArrayElements(env, x, NULL); + } + if (y) { + y1 = (*env)->GetIntArrayElements(env, y, NULL); + } + rc = (jint)gdk_window_get_origin((GdkWindow*)window, (gint*)x1, (gint*)y1); + if (x) { + (*env)->ReleaseIntArrayElements(env, x, x1, 0); + } + if (y) { + (*env)->ReleaseIntArrayElements(env, y, y1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1pointer + (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y, jint mask) +{ + jint rc; + jint *x1 = NULL; + jint *y1 = NULL; + if (x) { + x1 = (*env)->GetIntArrayElements(env, x, NULL); + } + if (y) { + y1 = (*env)->GetIntArrayElements(env, y, NULL); + } + rc = (jint)gdk_window_get_pointer((GdkWindow*)window, (gint*)x1, (gint*)y1, (GdkModifierType*)mask); + if (x) { + (*env)->ReleaseIntArrayElements(env, x, x1, 0); + } + if (y) { + (*env)->ReleaseIntArrayElements(env, y, y1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1icon + (JNIEnv *env, jclass that, jint window, jint icon_window, jint pixmap, jint mask) +{ + gdk_window_set_icon((GdkWindow*)window, (GdkWindow*)icon_window, (GdkPixmap*)pixmap, (GdkBitmap*)mask); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1decorations + (JNIEnv *env, jclass that, jint window, jint decorations) +{ + gdk_window_set_decorations((GdkWindow*)window, (GdkWMDecoration)decorations); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1show + (JNIEnv *env, jclass that, jint window) +{ + gdk_window_show((GdkWindow*)window); +} + + +/* ***** Events ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get + (JNIEnv *env, jclass that) +{ + return (jint)gdk_event_get(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1button_1get_1button + (JNIEnv *env, jclass that, jint event) +{ + return (jint) (((GdkEventButton*)event) -> button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1key_1get_1keyval + (JNIEnv *env, jclass that, jint event) +{ + return (jint) (((GdkEventKey*)event) -> keyval); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1key_1get_1length + (JNIEnv *env, jclass that, jint event) +{ + return (jint) (((GdkEventKey*)event) -> length); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1EVENT_1TYPE + (JNIEnv *env, jclass that, jint event) +{ + GdkEventType type = ((GdkEventAny*)event) -> type; + return (jint) type; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1time + (JNIEnv *env, jclass that, jint event) +{ + return (jint) gdk_event_get_time((GdkEvent*) event); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1state + (JNIEnv *env, jclass that, jint event, jintArray state) +{ + gboolean result; + jint *state1 = NULL; + if (state) { + state1 = (*env)->GetIntArrayElements(env, state, NULL); + } + result = gdk_event_get_state((GdkEvent*)event, (GdkModifierType*)state1); + if (state) { + (*env)->ReleaseIntArrayElements(env, state, state1, 0); + } + return (jboolean) result; +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1coords + (JNIEnv *env, jclass that, jint event, jdoubleArray win_x, jdoubleArray win_y) +{ + gboolean rc; + jdouble *win_x1 = NULL; + jdouble *win_y1 = NULL; + if (win_x) { + win_x1 = (*env)->GetDoubleArrayElements(env, win_x, NULL); + } + if (win_y) { + win_y1 = (*env)->GetDoubleArrayElements(env, win_y, NULL); + } + rc = gdk_event_get_coords((GdkEvent*)event, (gdouble*)win_x1, (gdouble*)win_y1); + if (win_x) { + (*env)->ReleaseDoubleArrayElements(env, win_x, win_x1, 0); + } + if (win_y) { + (*env)->ReleaseDoubleArrayElements(env, win_y, win_y1, 0); + } + return (jboolean)rc; +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1root_1coords + (JNIEnv *env, jclass that, jint event, jdoubleArray win_x, jdoubleArray win_y) +{ + gboolean rc; + jdouble *win_x1 = NULL; + jdouble *win_y1 = NULL; + if (win_x) { + win_x1 = (*env)->GetDoubleArrayElements(env, win_x, NULL); + } + if (win_y) { + win_y1 = (*env)->GetDoubleArrayElements(env, win_y, NULL); + } + rc = gdk_event_get_root_coords((GdkEvent*)event, (gdouble*)win_x1, (gdouble*)win_y1); + if (win_x) { + (*env)->ReleaseDoubleArrayElements(env, win_x, win_x1, 0); + } + if (win_y) { + (*env)->ReleaseDoubleArrayElements(env, win_y, win_y1, 0); + } + return (jboolean)rc; +} + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1graphics_1expose + (JNIEnv *env, jclass that, jint window) +{ + return (jint)gdk_event_get_graphics_expose((GdkWindow*)window); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1free + (JNIEnv *env, jclass that, jint event) +{ + gdk_event_free((GdkEvent*)event); +} + + +/* ***** Properties and Atoms ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1atom_1intern + (JNIEnv *env, jclass that, jbyteArray atom_name, jint only_if_exists) +{ + jint rc; + jbyte *atom_name1 = NULL; + if (atom_name) { + atom_name1 = (*env)->GetByteArrayElements(env, atom_name, NULL); + } + rc = (jint)gdk_atom_intern((gchar*)atom_name1, (gint)only_if_exists); + if (atom_name) { + (*env)->ReleaseByteArrayElements(env, atom_name, atom_name1, 0); + } + return rc; +} + + +/* ***** X Window System Interaction ***** */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1ROOT_1PARENT + (JNIEnv *env, jclass that) +{ + return (jint) GDK_ROOT_PARENT(); +} + + +/* Misc */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1CURRENT_1TIME + (JNIEnv *env, jclass that) +{ + return (jint) GDK_CURRENT_TIME; +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdkpixbuf.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdkpixbuf.c new file mode 100644 index 0000000000..d62cf3a524 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gdkpixbuf.c @@ -0,0 +1,241 @@ +/* + * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +#include "swt.h" +#include +#include + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_colorspace + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1colorspace + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_colorspace((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_n_channels + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1n_1channels + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_n_channels((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_has_alpha + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1has_1alpha + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jboolean) gdk_pixbuf_get_has_alpha((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_bits_per_sample + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1bits_1per_1sample + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_bits_per_sample((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_pixels + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1pixels + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_pixels((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_width + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1width + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_width((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_height + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1height + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_height((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_rowstride + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1rowstride + (JNIEnv *env, jclass cl, jint pixbuf) +{ + return (jint) gdk_pixbuf_get_rowstride((GdkPixbuf*)pixbuf); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_new + * Signature: (IZIII)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1new + (JNIEnv *env, jclass cl, + jint colorspace, + jboolean hasAlpha, + jint bpc, + jint width, jint height) +{ + return (jint) gdk_pixbuf_new ( + colorspace, + (gboolean) hasAlpha, + bpc, + width, height + ); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_copy + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1copy + (JNIEnv *env, jclass cl, jint source) { + return (jint)gdk_pixbuf_copy ((GdkPixbuf*) source); +} + + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_render_to_drawable + * Signature: (IIIIIIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1render_1to_1drawable + (JNIEnv *env, jclass cl, + jint pixbuf, + jint drawable, + jint gc, + jint src_x, jint src_y, + jint dest_x, jint dest_y, + jint width, jint height, + jint dithering, + jint x_dither, jint y_dither) { + gdk_pixbuf_render_to_drawable ( + (GdkPixbuf*) pixbuf, + (GdkDrawable*) drawable, + (GdkGC*) gc, + src_x, src_y, + dest_x, dest_y, + width, height, + dithering, + x_dither, y_dither + ); +} + + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_render_to_drawable_alpha + * Signature: (IIIIIIIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1render_1to_1drawable_1alpha + (JNIEnv *env, jclass cl, + jint pixbuf, + jint drawable, + jint src_x, jint src_y, jint dest_x, jint dest_y, + jint width, jint height, + jint alphaMode, + jint alphaThreshold, + jint dithering, + jint x_dither, jint y_dither) +{ + gdk_pixbuf_render_to_drawable_alpha ( + (GdkPixbuf*) pixbuf, + (GdkDrawable*) drawable, + src_x, src_y, + dest_x, dest_y, + width, height, + alphaMode, + alphaThreshold, + dithering, + x_dither, y_dither + ); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_scale + * Signature: (IIIIIIDDDDI)V + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1scale + (JNIEnv *env, jclass cl, + jint source, jint dest, + jint dest_x, jint dest_y, + jint dest_width, jint dest_height, + jdouble offset_x, jdouble offset_y, + jdouble scale_x, jdouble scale_y, + jint interp_type) { + gdk_pixbuf_scale ((GdkPixbuf*)source, (GdkPixbuf*)dest, + dest_x, dest_y, + dest_width, dest_height, + offset_x, offset_y, + scale_x, scale_y, + interp_type + ); +} + +/* + * Class: org_eclipse_swt_internal_gtk_GDKPIXBUF + * Method: gdk_pixbuf_get_from_drawable + * Signature: (IIIIIIIII)I + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_gdk_1pixbuf_1get_1from_1drawable + (JNIEnv *env, jclass cl, + jint dest, jint src, jint cmap, + jint src_x, jint src_y, + jint dest_x, jint dest_y, + jint width, jint height) +{ + gdk_pixbuf_get_from_drawable ( + (GdkPixbuf*) dest, + (GdkDrawable*) src, + (GdkColormap*) cmap, + src_x, src_y, + dest_x, dest_y, + width, height); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_GDKPIXBUF_GDK_1COLORSPACE_1RGB + (JNIEnv *env, jclass cl) +{ + return (jint)GDK_COLORSPACE_RGB; +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontainers.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontainers.c new file mode 100644 index 0000000000..eec4eb1ae2 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontainers.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +/* + * This file is logically part of swt.c, and will be eventually merged back. + */ + +/** + * SWT natives for GTK container widgets. + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + + +/* gtk_box */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1box_1pack_1start + (JNIEnv *env, jclass that, jint box, jint child, jboolean expand, jboolean fill, jint padding) +{ + gtk_box_pack_start((GtkBox*)box, (GtkWidget*)child, (gboolean)expand, (gboolean)fill, padding); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1box_1pack_1end + (JNIEnv *env, jclass that, jint box, jint child, jboolean expand, jboolean fill, jint padding) +{ + gtk_box_pack_end((GtkBox*)box, (GtkWidget*)child, (gboolean)expand, (gboolean)fill, padding); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hbox_1new + (JNIEnv *env, jclass that, jboolean homogeneous, jint spacing) +{ + return (jint)gtk_hbox_new((gboolean)homogeneous, (gint)spacing); +} + +/* gtk_container */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1add + (JNIEnv *env, jclass that, jint container, jint widget) +{ + gtk_container_add((GtkContainer*)container, (GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1remove + (JNIEnv *env, jclass that, jint container, jint widget) +{ + gtk_container_remove((GtkContainer*)container, (GtkWidget*)widget); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1children + (JNIEnv *env, jclass that, jint container) +{ + return (jint)gtk_container_children((GtkContainer*)container); +} + +/* gtk_event_box */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1event_1box_1new + (JNIEnv *env, jclass that) +{ + return (jint)gtk_event_box_new(); +} + +/* gtk_frame */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1new + (JNIEnv *env, jclass that, jbyteArray label) +{ + jint rc; + jbyte *label1 = NULL; + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); + } + rc = (jint)gtk_frame_new((gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1set_1label + (JNIEnv *env, jclass that, jint frame, jbyteArray label) +{ + jbyte *label1 = NULL; + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); + } + gtk_frame_set_label((GtkFrame*)frame, (gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1set_1shadow_1type + (JNIEnv *env, jclass that, jint frame, jint type) +{ + gtk_frame_set_shadow_type((GtkFrame*)frame, (GtkShadowType)type); +} + +/* temporary code */ +JNIEXPORT void JNICALL +Java_org_eclipse_swt_internal_gtk_OS_swt_1frame_1get_1trim + (JNIEnv *env, jclass that, jint handle, jintArray trims) +{ + int border, top_margin; + GtkWidget *widget; GtkFrame *frame; + GtkRequisition requisition; + int *ctrims; + if (trims==NULL) return; + ctrims = (*env)->GetIntArrayElements(env, trims, NULL); + if (ctrims==NULL) return; + /* calculate the trims */ + widget = GTK_WIDGET (handle); + frame = GTK_FRAME (handle); + if (frame->label_widget) { + /* careful: not child_requisition, because it may not be up to date */ + gtk_widget_size_request (frame->label_widget, &requisition); + top_margin = MAX (requisition.height, widget->style->ythickness); + } else top_margin = widget->style->ythickness; + border = GTK_CONTAINER(frame)->border_width; + + ctrims[0] = border + top_margin; + ctrims[1] = border + widget->style->xthickness; + ctrims[2] = border + widget->style->xthickness; + ctrims[3] = border + widget->style->ythickness; + + (*env)->ReleaseIntArrayElements(env, trims, ctrims, 0); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontrols.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontrols.c new file mode 100644 index 0000000000..ec8f9504fd --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkcontrols.c @@ -0,0 +1,488 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + + +/* + * Labels + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1get_1type + (JNIEnv *env, jclass that) +{ + return gtk_label_get_type (); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1new + (JNIEnv *env, jclass that, jstring str) +{ + jint rc; + const jbyte *str1 = NULL; + + if (str!=NULL) { + str1 = (*env)->GetStringUTFChars(env, str, NULL); + if (str1==NULL) return 0; + } + rc = (jint) gtk_label_new((gchar*)str1); + if (str!=NULL) (*env)->ReleaseStringUTFChars(env, str, str1); + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1text + (JNIEnv *env, jclass that, jint label, jbyteArray str) +{ + jbyte *str1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_label_set_text"); +#endif + + if (str) { + str1 = (*env)->GetByteArrayElements(env, str, NULL); + } + gtk_label_set_text((GtkLabel*)label, (gchar*)str1); + if (str) { + (*env)->ReleaseByteArrayElements(env, str, str1, 0); + } +} + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_label_set_justify + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1justify + (JNIEnv *env, jclass that, jint label, jint jtype) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_label_set_justify"); +#endif + + gtk_label_set_justify((GtkLabel*)label, (GtkJustification)jtype); +} + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_label_set_pattern + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1pattern + (JNIEnv *env, jclass that, jint label, jbyteArray pattern) +{ + jbyte *pattern1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_label_set_pattern"); +#endif + + if (pattern) { + pattern1 = (*env)->GetByteArrayElements(env, pattern, NULL); + } + gtk_label_set_pattern((GtkLabel*)label, (gchar*)pattern1); + if (pattern) { + (*env)->ReleaseByteArrayElements(env, pattern, pattern1, 0); + } +} + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_label_set_line_wrap + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1line_1wrap + (JNIEnv *env, jclass that, jint label, jboolean wrap) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_label_set_line_wrap"); +#endif + + gtk_label_set_line_wrap((GtkLabel*)label, (gboolean)wrap); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_label_parse_uline + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1parse_1uline + (JNIEnv *env, jclass that, jint label, jbyteArray string) +{ + jint rc; + jbyte *string1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_label_parse_uline"); +#endif + + if (string) { + string1 = (*env)->GetByteArrayElements(env, string, NULL); + } + rc = (jint)gtk_label_parse_uline((GtkLabel*)label, (gchar*)string1); + if (string) { + (*env)->ReleaseByteArrayElements(env, string, string1, 0); + } + return rc; +} + + + + +/* + * Buttons + */ + + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_button_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1button_1new + (JNIEnv *env, jclass that) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_button_new"); +#endif + + return (jint)gtk_button_new(); +} + + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1button_1new_1with_1label + (JNIEnv *env, jclass that, jbyteArray label) +{ + jint rc; + jbyte *label1 = NULL; + + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); + } + rc = (jint)gtk_button_new_with_label((gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1button_1new + (JNIEnv *env, jclass that) +{ + + return (jint)gtk_check_button_new(); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1new + (JNIEnv *env, jclass that) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_new"); +#endif + + return (jint)gtk_entry_new(); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_set_text + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1text + (JNIEnv *env, jclass that, jint entry, jbyteArray text) +{ + jbyte *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_set_text"); +#endif + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + gtk_entry_set_text((GtkEntry*)entry, (gchar*)text1); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_append_text + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1append_1text + (JNIEnv *env, jclass that, jint entry, jbyteArray text) +{ + jbyte *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_append_text"); +#endif + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + gtk_entry_append_text((GtkEntry*)entry, (gchar*)text1); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_get_text + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1get_1text + (JNIEnv *env, jclass that, jint entry) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_get_text"); +#endif + + return (jint)gtk_entry_get_text((GtkEntry*)entry); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_set_visibility + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1visibility + (JNIEnv *env, jclass that, jint entry, jboolean visible) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_set_visibility"); +#endif + + gtk_entry_set_visibility((GtkEntry*)entry, (gboolean)visible); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_set_editable + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1editable + (JNIEnv *env, jclass that, jint entry, jboolean editable) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_set_editable"); +#endif + + gtk_entry_set_editable((GtkEntry*)entry, (gboolean)editable); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_entry_set_max_length + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1max_1length + (JNIEnv *env, jclass that, jint entry, jshort max) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_entry_set_max_length"); +#endif + + gtk_entry_set_max_length((GtkEntry*)entry, (guint16)max); +} + + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_combo_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1combo_1new + (JNIEnv *env, jclass that) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_combo_new"); +#endif + + return (jint)gtk_combo_new(); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_combo_set_popdown_strings + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1combo_1set_1popdown_1strings + (JNIEnv *env, jclass that, jint combo, jint strings) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_combo_set_popdown_strings"); +#endif + + gtk_combo_set_popdown_strings((GtkCombo*)combo, (GList*)strings); +} + + + + + + + + + + + +/* + * Others + */ + + + + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1new + (JNIEnv *env, jclass that, jfloat value, jfloat lower, jfloat upper, jfloat step_increment, jfloat page_increment, jfloat page_size) +{ + return (jint)gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1changed + (JNIEnv *env, jclass that, jint adjustment) +{ + gtk_adjustment_changed((GtkAdjustment*)adjustment); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_adjustment_value_changed + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1value_1changed + (JNIEnv *env, jclass that, jint adjustment) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_adjustment_value_changed"); +#endif + + gtk_adjustment_value_changed((GtkAdjustment*)adjustment); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_adjustment_set_value + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1set_1value + (JNIEnv *env, jclass that, jint adjustment, jfloat value) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_adjustment_set_value"); +#endif + + gtk_adjustment_set_value((GtkAdjustment*)adjustment, value); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_arrow_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1arrow_1new + (JNIEnv *env, jclass that, jint arrow_type, jint shadow_type) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_arrow_new"); +#endif + + return (jint)gtk_arrow_new((GtkArrowType)arrow_type, (GtkShadowType)shadow_type); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_arrow_set + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1arrow_1set + (JNIEnv *env, jclass that, jint arrow, jint arrow_type, jint shadow_type) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_arrow_set"); +#endif + + gtk_arrow_set((GtkArrow*)arrow, (GtkArrowType)arrow_type, (GtkShadowType)shadow_type); +} + + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_hscale_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hscale_1new + (JNIEnv *env, jclass that, jint adjustment) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_hscale_new"); +#endif + + return (jint)gtk_hscale_new((GtkAdjustment*)adjustment); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_hscrollbar_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hscrollbar_1new + (JNIEnv *env, jclass that, jint adjustment) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_hscrollbar_new"); +#endif + + return (jint)gtk_hscrollbar_new((GtkAdjustment*)adjustment); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_hseparator_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hseparator_1new + (JNIEnv *env, jclass that) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_hseparator_new"); +#endif + + return (jint)gtk_hseparator_new(); +} + + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtklists.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtklists.c new file mode 100644 index 0000000000..6fb18ee93a --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtklists.c @@ -0,0 +1,845 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + + +#include "swt.h" +#include "structs.h" + +#include +#include + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1post_1recursive_1to_1depth + (JNIEnv *env, jclass that, jint ctree, jint node, jint depth, jint func, jint data) +{ + gtk_ctree_post_recursive_to_depth((GtkCTree*)ctree, (GtkCTreeNode*)node, (jint)depth, (GtkCTreeFunc)func, (gpointer)data); +} + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1pixtext + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jintArray text, jintArray spacing, jintArray pixmap, jintArray mask) +{ + jint *text1 = NULL; + jint *spacing1 = NULL; + jint *pixmap1 = NULL; + jint *mask1 = NULL; + int rc; + + if (text) text1 = (*env)->GetIntArrayElements(env, text, NULL); + if (spacing) spacing1 = (*env)->GetIntArrayElements(env, spacing, NULL); + if (pixmap) pixmap1 = (*env)->GetIntArrayElements(env, pixmap, NULL); + if (mask) mask1 = (*env)->GetIntArrayElements(env, mask, NULL); + rc = gtk_clist_get_pixtext((GtkCList*)clist, row, column, (gchar**)text1, (guint8*)spacing1, (GdkPixmap**)pixmap1, (GdkBitmap**)mask1); + if (text) (*env)->ReleaseIntArrayElements(env, text, text1, 0); + if (spacing) (*env)->ReleaseIntArrayElements(env, spacing, spacing1, 0); + if (pixmap) (*env)->ReleaseIntArrayElements(env, pixmap, pixmap1, 0); + if (mask) (*env)->ReleaseIntArrayElements(env, mask, mask1, 0); + + return (jint) rc; +} + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_row_is_visible + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1row_1is_1visible + (JNIEnv *env, jclass that, jint clist, jint row) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_row_is_visible"); +#endif + + return gtk_clist_row_is_visible((GtkCList *)clist, (gint)row); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_post_recursive + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1post_1recursive + (JNIEnv *env, jclass that, jint ctree, jint node, jint func, jint data) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_post_recursive"); +#endif + + gtk_ctree_post_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node, (GtkCTreeFunc)func, (gpointer)data); +} + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_nth + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1nth + (JNIEnv *env, jclass that, jint ctree, jint row) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_nth"); +#endif + + return (jint)gtk_ctree_node_nth((GtkCTree*)ctree, row); +} + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_remove_node + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1remove_1node + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_remove_node"); +#endif + + gtk_ctree_remove_node((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_is_viewable + * Signature: + */ +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1is_1viewable + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_is_viewable"); +#endif + + return (jboolean)gtk_ctree_is_viewable((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_is_hot_spot + * Signature: + */ +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1is_1hot_1spot + (JNIEnv *env, jclass that, jint ctree, jint x, jint y) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_is_hot_spot"); +#endif + + return (jboolean)gtk_ctree_is_hot_spot((GtkCTree*)ctree, (gint)x, (gint)y); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_expand + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1expand + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_expand"); +#endif + + gtk_ctree_expand((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_collapse + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1collapse + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_collapse"); +#endif + + gtk_ctree_collapse((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_select + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1select + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_select"); +#endif + + gtk_ctree_select((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_select_recursive + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1select_1recursive + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_select_recursive"); +#endif + + gtk_ctree_select_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_unselect_recursive + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1unselect_1recursive + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_unselect_recursive"); +#endif + + gtk_ctree_unselect_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_set_node_info + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1set_1node_1info + (JNIEnv *env, jclass that, jint ctree, jint node, jbyteArray text, jbyte spacing, jint pixmap_closed, jint mask_closed, jint pixmap_opened, jint mask_opened, jboolean is_leaf, jboolean expanded) +{ + jbyte *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_set_node_info"); +#endif + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + gtk_ctree_set_node_info((GtkCTree*)ctree, (GtkCTreeNode*)node, (gchar*)text1, (guint8)spacing, (GdkPixmap*)pixmap_closed, (GdkBitmap*)mask_closed, (GdkPixmap*)pixmap_opened, (GdkBitmap*)mask_opened, (gboolean)is_leaf, (gboolean)expanded); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_get_node_info + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1get_1node_1info + (JNIEnv *env, jclass that, jint ctree, jint node, jintArray text, jbyteArray spacing, jintArray pixmap_closed, jintArray mask_closed, jintArray pixmap_opened, jintArray mask_opened, jbooleanArray is_leaf, jbooleanArray expanded) +{ + jint rc; + jint *text1 = NULL; + jbyte *spacing1 = NULL; + jint *pixmap_closed1 = NULL; + jint *mask_closed1 = NULL; + jint *pixmap_opened1 = NULL; + jint *mask_opened1 = NULL; + jboolean *is_leaf1 = NULL; + jboolean *expanded1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_get_node_info"); +#endif + + if (text) { + text1 = (*env)->GetIntArrayElements(env, text, NULL); + } + if (spacing) { + spacing1 = (*env)->GetByteArrayElements(env, spacing, NULL); + } + if (pixmap_closed) { + pixmap_closed1 = (*env)->GetIntArrayElements(env, pixmap_closed, NULL); + } + if (mask_closed) { + mask_closed1 = (*env)->GetIntArrayElements(env, mask_closed, NULL); + } + if (pixmap_opened) { + pixmap_opened1 = (*env)->GetIntArrayElements(env, pixmap_opened, NULL); + } + if (mask_opened) { + mask_opened1 = (*env)->GetIntArrayElements(env, mask_opened, NULL); + } + if (is_leaf) { + is_leaf1 = (*env)->GetBooleanArrayElements(env, is_leaf, NULL); + } + if (expanded) { + expanded1 = (*env)->GetBooleanArrayElements(env, expanded, NULL); + } + rc = (jint)gtk_ctree_get_node_info((GtkCTree*)ctree, (GtkCTreeNode*)node, (gchar**)text1, (guint8*)spacing1, (GdkPixmap**)pixmap_closed1, (GdkBitmap**)mask_closed1, (GdkPixmap**)pixmap_opened1, (GdkBitmap**)mask_opened1, (gboolean*)is_leaf1, (gboolean*)expanded1); + if (text) { + (*env)->ReleaseIntArrayElements(env, text, text1, 0); + } + if (spacing) { + (*env)->ReleaseByteArrayElements(env, spacing, spacing1, 0); + } + if (pixmap_closed) { + (*env)->ReleaseIntArrayElements(env, pixmap_closed, pixmap_closed1, 0); + } + if (mask_closed) { + (*env)->ReleaseIntArrayElements(env, mask_closed, mask_closed1, 0); + } + if (pixmap_opened) { + (*env)->ReleaseIntArrayElements(env, pixmap_opened, pixmap_opened1, 0); + } + if (mask_opened) { + (*env)->ReleaseIntArrayElements(env, mask_opened, mask_opened1, 0); + } + if (is_leaf) { + (*env)->ReleaseBooleanArrayElements(env, is_leaf, is_leaf1, 0); + } + if (expanded) { + (*env)->ReleaseBooleanArrayElements(env, expanded, expanded1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_get_row_style + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1get_1row_1style + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_get_row_style"); +#endif + + return (jint)gtk_ctree_node_get_row_style((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_set_row_data + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1set_1row_1data + (JNIEnv *env, jclass that, jint ctree, jint node, jint data) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_set_row_data"); +#endif + + gtk_ctree_node_set_row_data((GtkCTree*)ctree, (GtkCTreeNode*)node, (gpointer)data); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_get_row_data + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1get_1row_1data + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_get_row_data"); +#endif + + return (jint)gtk_ctree_node_get_row_data((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_moveto + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1moveto + (JNIEnv *env, jclass that, jint ctree, jint node, jint column, jfloat row_align, jfloat col_align) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_moveto"); +#endif + + gtk_ctree_node_moveto((GtkCTree*)ctree, (GtkCTreeNode*)node, (gint)column, row_align, col_align); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_node_is_visible + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1is_1visible + (JNIEnv *env, jclass that, jint ctree, jint node) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_node_is_visible"); +#endif + + return (jint)gtk_ctree_node_is_visible((GtkCTree*)ctree, (GtkCTreeNode*)node); +} + + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1new + (JNIEnv *env, jclass that, jint columns) +{ + return (jint)gtk_clist_new((gint)columns); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1shadow_1type + (JNIEnv *env, jclass that, jint clist, jint type) +{ + gtk_clist_set_shadow_type((GtkCList*)clist, (GtkShadowType)type); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1selection_1mode + (JNIEnv *env, jclass that, jint clist, jint mode) +{ + gtk_clist_set_selection_mode((GtkCList*)clist, (GtkSelectionMode)mode); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1freeze + (JNIEnv *env, jclass that, jint clist) +{ + gtk_clist_freeze((GtkCList*)clist); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1thaw + (JNIEnv *env, jclass that, jint clist) +{ + gtk_clist_thaw((GtkCList*)clist); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1show + (JNIEnv *env, jclass that, jint clist) +{ + gtk_clist_column_titles_show((GtkCList*)clist); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1hide + (JNIEnv *env, jclass that, jint clist) +{ + gtk_clist_column_titles_hide((GtkCList*)clist); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1title_1passive + (JNIEnv *env, jclass that, jint clist, jint column) +{ + gtk_clist_column_title_passive((GtkCList*)clist, (gint)column); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1passive + (JNIEnv *env, jclass that, jint clist) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_column_titles_passive"); +#endif + + gtk_clist_column_titles_passive((GtkCList*)clist); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_column_title + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1title + (JNIEnv *env, jclass that, jint clist, jint column, jbyteArray title) +{ + jbyte *title1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_column_title"); +#endif + + if (title) { + title1 = (*env)->GetByteArrayElements(env, title, NULL); + } + gtk_clist_set_column_title((GtkCList*)clist, (gint)column, (gchar*)title1); + if (title) { + (*env)->ReleaseByteArrayElements(env, title, title1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_column_justification + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1justification + (JNIEnv *env, jclass that, jint clist, jint column, jint justification) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_column_justification"); +#endif + + gtk_clist_set_column_justification((GtkCList*)clist, (gint)column, (GtkJustification)justification); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_column_visibility + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1visibility + (JNIEnv *env, jclass that, jint clist, jint column, jboolean visible) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_column_visibility"); +#endif + + gtk_clist_set_column_visibility((GtkCList*)clist, (gint)column, (gboolean)visible); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_column_resizeable + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1resizeable + (JNIEnv *env, jclass that, jint clist, jint column, jboolean resizeable) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_column_resizeable"); +#endif + + gtk_clist_set_column_resizeable((GtkCList*)clist, (gint)column, (gboolean)resizeable); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_column_width + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1width + (JNIEnv *env, jclass that, jint clist, jint column, jint width) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_column_width"); +#endif + + gtk_clist_set_column_width((GtkCList*)clist, (gint)column, (gint)width); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_moveto + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1moveto + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jfloat row_align, jfloat col_align) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_moveto"); +#endif + + gtk_clist_moveto((GtkCList*)clist, (gint)row, (gint)column, row_align, col_align); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_text + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1text + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jbyteArray text) +{ + jbyte *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_text"); +#endif + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + gtk_clist_set_text((GtkCList*)clist, (gint)row, (gint)column, (gchar*)text1); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_get_text + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1text + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jintArray text) +{ + jint rc; + jint *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_get_text"); +#endif + + if (text) { + text1 = (*env)->GetIntArrayElements(env, text, NULL); + } + rc = (jint)gtk_clist_get_text((GtkCList*)clist, (gint)row, (gint)column, (gchar**)text1); + if (text) { + (*env)->ReleaseIntArrayElements(env, text, text1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_pixmap + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1pixmap + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jint pixmap, jint mask) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_pixmap"); +#endif + + gtk_clist_set_pixmap((GtkCList*)clist, (gint)row, (gint)column, (GdkPixmap*)pixmap, (GdkBitmap*)mask); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_set_pixtext + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1pixtext + (JNIEnv *env, jclass that, jint clist, jint row, jint column, jbyteArray text, jbyte spacing, jint pixmap, jint mask) +{ + jbyte *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_set_pixtext"); +#endif + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + gtk_clist_set_pixtext((GtkCList*)clist, (gint)row, (gint)column, (gchar*)text1, (guint8)spacing, (GdkPixmap*)pixmap, (GdkBitmap*)mask); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_append + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1append + (JNIEnv *env, jclass that, jint clist, jintArray text) +{ + jint rc; + jint *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_append"); +#endif + + if (text) { + text1 = (*env)->GetIntArrayElements(env, text, NULL); + } + rc = (jint)gtk_clist_append((GtkCList*)clist, (gchar**)text1); + if (text) { + (*env)->ReleaseIntArrayElements(env, text, text1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_insert + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1insert + (JNIEnv *env, jclass that, jint clist, jint row, jintArray text) +{ + jint rc; + jint *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_insert"); +#endif + + if (text) { + text1 = (*env)->GetIntArrayElements(env, text, NULL); + } + rc = (jint)gtk_clist_insert((GtkCList*)clist, (gint)row, (gchar**)text1); + if (text) { + (*env)->ReleaseIntArrayElements(env, text, text1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_remove + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1remove + (JNIEnv *env, jclass that, jint clist, jint row) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_remove"); +#endif + + gtk_clist_remove((GtkCList*)clist, (gint)row); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_select_row + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1select_1row + (JNIEnv *env, jclass that, jint clist, jint row, jint column) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_select_row"); +#endif + + gtk_clist_select_row((GtkCList*)clist, (gint)row, (gint)column); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_unselect_row + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1unselect_1row + (JNIEnv *env, jclass that, jint clist, jint row, jint column) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_unselect_row"); +#endif + + gtk_clist_unselect_row((GtkCList*)clist, (gint)row, (gint)column); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_clear + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1clear + (JNIEnv *env, jclass that, jint clist) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_clear"); +#endif + + gtk_clist_clear((GtkCList*)clist); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_get_selection_info + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1selection_1info + (JNIEnv *env, jclass that, jint clist, jint x, jint y, jintArray row, jintArray column) +{ + jint rc; + jint *row1 = NULL; + jint *column1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_get_selection_info"); +#endif + + if (row) { + row1 = (*env)->GetIntArrayElements(env, row, NULL); + } + if (column) { + column1 = (*env)->GetIntArrayElements(env, column, NULL); + } + rc = (jint)gtk_clist_get_selection_info((GtkCList*)clist, (gint)x, (gint)y, (gint*)row1, (gint*)column1); + if (row) { + (*env)->ReleaseIntArrayElements(env, row, row1, 0); + } + if (column) { + (*env)->ReleaseIntArrayElements(env, column, column1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_select_all + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1select_1all + (JNIEnv *env, jclass that, jint clist) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_select_all"); +#endif + + gtk_clist_select_all((GtkCList*)clist); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_clist_unselect_all + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1unselect_1all + (JNIEnv *env, jclass that, jint clist) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_clist_unselect_all"); +#endif + + gtk_clist_unselect_all((GtkCList*)clist); +} + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_new + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1new + (JNIEnv *env, jclass that, jint columns, jint tree_column) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_new"); +#endif + + return (jint)gtk_ctree_new((gint)columns, (gint)tree_column); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_ctree_insert_node + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1insert_1node + (JNIEnv *env, jclass that, jint ctree, jint parent, jint sibling, jintArray text, jbyte spacing, jint pixmap_closed, jint mask_closed, jint pixmap_opened, jint mask_opened, jboolean is_leaf, jboolean expanded) +{ + jint rc; + jint *text1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_ctree_insert_node"); +#endif + + if (text) { + text1 = (*env)->GetIntArrayElements(env, text, NULL); + } + rc = (jint)gtk_ctree_insert_node((GtkCTree*)ctree, (GtkCTreeNode*)parent, (GtkCTreeNode*)sibling, (gchar**)text1, (guint8)spacing, (GdkPixmap*)pixmap_closed, (GdkBitmap*)mask_closed, (GdkPixmap*)pixmap_opened, (GdkBitmap*)mask_opened, (gboolean)is_leaf, (gboolean)expanded); + if (text) { + (*env)->ReleaseIntArrayElements(env, text, text1, 0); + } + return rc; +} + + + + + + + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkmenu.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkmenu.c new file mode 100644 index 0000000000..345d400592 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkmenu.c @@ -0,0 +1,100 @@ + +#include "swt.h" +#include "structs.h" + +#include +#include + +/* + * Accelerators + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1group_1new + (JNIEnv *env, jclass that) +{ + return (jint)gtk_accel_group_new(); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1group_1unref + (JNIEnv *env, jclass that, jint accel_group) +{ + gtk_accel_group_unref((GtkAccelGroup*)accel_group); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1groups_1activate + (JNIEnv *env, jclass that, jint accel_group, jint accel_key, jint accel_mods) +{ + return (jboolean) gtk_accel_groups_activate(GTK_OBJECT((GtkWindow*)accel_group), + accel_key, + accel_mods); +} + + + + + + + + + + + + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_check_menu_item_new_with_label + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1new_1with_1label + (JNIEnv *env, jclass that, jbyteArray label) +{ + jint rc; + jbyte *label1 = NULL; +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_check_menu_item_new_with_label"); +#endif + + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); + } + rc = (jint)gtk_check_menu_item_new_with_label((gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } + return rc; +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_check_menu_item_set_active + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1set_1active + (JNIEnv *env, jclass that, jint check_menu_item, jboolean is_active) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_check_menu_item_set_active"); +#endif + + gtk_check_menu_item_set_active((GtkCheckMenuItem*)check_menu_item, (gboolean)is_active); +} + +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: gtk_check_menu_item_set_show_toggle + * Signature: + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1set_1show_1toggle + (JNIEnv *env, jclass that, jint menu_item, jboolean always) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_check_menu_item_set_show_toggle"); +#endif + + gtk_check_menu_item_set_show_toggle((GtkCheckMenuItem*)menu_item, (gboolean)always); +} + + + + + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwidget.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwidget.c new file mode 100644 index 0000000000..e5a63c1951 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwidget.c @@ -0,0 +1,283 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +/** + * SWT OS natives implementation: gtk_widget_* functions. + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + +/* MACROS */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1TYPE + (JNIEnv *env, jclass that, jint wid) +{ + return GTK_WIDGET_TYPE((GtkWidget*)wid); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1FLAGS + (JNIEnv *env, jclass that, jint wid) +{ + return (jint) GTK_WIDGET_FLAGS((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1HAS_1FOCUS + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_HAS_FOCUS((GtkWidget*)wid); +} + +/* Temporary code. These private fields should not be accessed at all. */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1WINDOW + (JNIEnv *env, jclass that, jint wid) +{ + return (jint) ((GtkWidget*)wid)->window; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1PARENT + (JNIEnv *env, jclass that, jint wid) +{ + return (jint) ((GtkWidget*)wid)->parent; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1SET_1FLAGS + (JNIEnv *env, jclass that, jint wid, jint flag) +{ + GTK_WIDGET_SET_FLAGS((GtkWidget*)wid, flag); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1UNSET_1FLAGS + (JNIEnv *env, jclass that, jint wid, jint flag) +{ + GTK_WIDGET_UNSET_FLAGS((GtkWidget*)wid, flag); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1NO_1WINDOW + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_NO_WINDOW((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1SENSITIVE + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_SENSITIVE((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1IS_1SENSITIVE + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_IS_SENSITIVE((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1TOPLEVEL + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_TOPLEVEL((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1REALISED + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_REALISED((GtkWidget*)wid); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1VISIBLE + (JNIEnv *env, jclass that, jint wid) +{ + return (jboolean) GTK_WIDGET_VISIBLE((GtkWidget*)wid); +} + +/* Functions */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1destroy + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_destroy((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_show((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show_1now + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_show_now((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show_1all + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_show_all((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1hide + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_hide((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1realize + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_realize((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1queue_1draw + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_queue_draw((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1size_1request + (JNIEnv *env, jclass that, jint widget, jobject requisition) +{ + DECL_GLOB(pGlob) + GtkRequisition requisition_struct, *requisition1 = NULL; + if (requisition) { + requisition1 = &requisition_struct; + cacheGtkRequisitionFids(env, requisition, &PGLOB(GtkRequisitionFc)); + getGtkRequisitionFields(env, requisition, requisition1, &PGLOB(GtkRequisitionFc)); + } + gtk_widget_size_request((GtkWidget*)widget, (GtkRequisition*)requisition1); + if (requisition) { + setGtkRequisitionFields(env, requisition, requisition1, &PGLOB(GtkRequisitionFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1size_1allocate + (JNIEnv *env, jclass that, jint widget, jobject allocation) +{ + DECL_GLOB(pGlob) + GtkAllocation allocation_struct, *allocation1 = NULL; + if (allocation) { + allocation1 = &allocation_struct; + cacheGtkAllocationFids(env, allocation, &PGLOB(GtkAllocationFc)); + getGtkAllocationFields(env, allocation, allocation1, &PGLOB(GtkAllocationFc)); + } + gtk_widget_size_allocate((GtkWidget*)widget, (GtkAllocation*)allocation1); + if (allocation) { + setGtkAllocationFields(env, allocation, allocation1, &PGLOB(GtkAllocationFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1add_1accelerator + (JNIEnv *env, jclass that, jint widget, jbyteArray accel_signal, jint accel_group, jint accel_key, jint accel_mods, jint accel_flags) +{ + jbyte *accel_signal1 = NULL; + if (accel_signal) { + accel_signal1 = (*env)->GetByteArrayElements(env, accel_signal, NULL); + } + gtk_widget_add_accelerator((GtkWidget*)widget, (gchar*)accel_signal1, (GtkAccelGroup*)accel_group, accel_key, accel_mods, (GtkAccelFlags)accel_flags); + if (accel_signal) { + (*env)->ReleaseByteArrayElements(env, accel_signal, accel_signal1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1remove_1accelerator + (JNIEnv *env, jclass that, jint widget, jint accel_group, jint accel_key, jint accel_mods) +{ + gtk_widget_remove_accelerator((GtkWidget*)widget, (GtkAccelGroup*)accel_group, accel_key, accel_mods); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1event + (JNIEnv *env, jclass that, jint widget, jint event) +{ + return (jint)gtk_widget_event((GtkWidget*)widget, (GdkEvent*)event); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1reparent + (JNIEnv *env, jclass that, jint widget, jint new_parent) +{ + gtk_widget_reparent((GtkWidget*)widget, (GtkWidget*)new_parent); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1grab_1focus + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_grab_focus((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1state + (JNIEnv *env, jclass that, jint widget, jint state) +{ + gtk_widget_set_state((GtkWidget*)widget, (GtkStateType)state); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1sensitive + (JNIEnv *env, jclass that, jint widget, jboolean sensitive) +{ + gtk_widget_set_sensitive((GtkWidget*)widget, (gboolean)sensitive); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1parent + (JNIEnv *env, jclass that, jint widget, jint parent) +{ + gtk_widget_set_parent((GtkWidget*)widget, (GtkWidget*)parent); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1uposition + (JNIEnv *env, jclass that, jint widget, jint x, jint y) +{ + gtk_widget_set_uposition((GtkWidget*)widget, (gint)x, (gint)y); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1usize + (JNIEnv *env, jclass that, jint widget, jint width, jint height) +{ + gtk_widget_set_usize((GtkWidget*)widget, (gint)width, (gint)height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1add_1events + (JNIEnv *env, jclass that, jint widget, jint events) +{ + gtk_widget_add_events((GtkWidget*)widget, (gint)events); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1style + (JNIEnv *env, jclass that, jint widget, jint style) +{ + gtk_widget_set_style((GtkWidget*)widget, (GtkStyle*)style); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1ensure_1style + (JNIEnv *env, jclass that, jint widget) +{ + gtk_widget_ensure_style((GtkWidget*)widget); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1modify_1font + (JNIEnv *env, jclass that, jint widget, jint font) +{ + gtk_widget_modify_font((GtkWidget*)widget, (PangoFontDescription*)font); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1get_1style + (JNIEnv *env, jclass that, jint widget) +{ + return (jint)gtk_widget_get_style((GtkWidget*)widget); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1get_1default_1style + (JNIEnv *env, jclass that) +{ + return (jint)gtk_widget_get_default_style(); +} + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwindow.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwindow.c new file mode 100644 index 0000000000..f52afd19e3 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-gtkwindow.c @@ -0,0 +1,357 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +/** + * SWT OS natives implementation: gtk_window_* functions. + * This file also contains all dialog functions (e.g., + * gtk_color_selection_*). + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + + +/* + * gtk_window_* + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1new + (JNIEnv *env, jclass that, jint type) +{ + return (jint)gtk_window_new((GtkWindowType)type); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1title + (JNIEnv *env, jclass that, jint window, jbyteArray title) +{ + jbyte *title1 = NULL; + if (title) { + title1 = (*env)->GetByteArrayElements(env, title, NULL); + } + gtk_window_set_title((GtkWindow*)window, (gchar*)title1); + if (title) { + (*env)->ReleaseByteArrayElements(env, title, title1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1policy + (JNIEnv *env, jclass that, jint window, jint allow_shrink, jint allow_grow, jint auto_shrink) +{ + gtk_window_set_policy((GtkWindow*)window, (gint)allow_shrink, (gint)allow_grow, (gint)auto_shrink); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1resizable + (JNIEnv *env, jclass that, jint window, jboolean resizable) +{ + gtk_window_set_resizable((GtkWindow*)window, (gboolean)resizable); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1get_1position + (JNIEnv *env, jclass that, jint window, jintArray px, jintArray py) +{ + jint *px1 = NULL; + jint *py1 = NULL; + if (px) px1 = (*env)->GetIntArrayElements(env, px, NULL); + if (py) py1 = (*env)->GetIntArrayElements(env, py, NULL); + gtk_window_get_position((GtkWindow*)window, (gint*)px1, (gint*)py1); + if (px) (*env)->ReleaseIntArrayElements(env, px, px1, 0); + if (py) (*env)->ReleaseIntArrayElements(env, py, py1, 0); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1get_1size + (JNIEnv *env, jclass that, jint window, jintArray px, jintArray py) +{ + jint *px1 = NULL; + jint *py1 = NULL; + if (px) px1 = (*env)->GetIntArrayElements(env, px, NULL); + if (py) py1 = (*env)->GetIntArrayElements(env, py, NULL); + gtk_window_get_size((GtkWindow*)window, (gint*)px1, (gint*)py1); + if (px) (*env)->ReleaseByteArrayElements(env, px, px1, 0); + if (py) (*env)->ReleaseByteArrayElements(env, py, py1, 0); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1move + (JNIEnv *env, jclass that, jint window, jint x, jint y) +{ + gtk_window_move((GtkWindow*)window, x, y); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1resize + (JNIEnv *env, jclass that, jint window, jint width, jint height) +{ + gtk_window_resize((GtkWindow*)window, width, height); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1transient_1for + (JNIEnv *env, jclass that, jint window, jint parent) +{ + gtk_window_set_transient_for((GtkWindow*)window, (GtkWindow*)parent); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1modal + (JNIEnv *env, jclass that, jint window, jboolean modal) +{ + gtk_window_set_modal((GtkWindow*)window, modal); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1add_1accel_1group + (JNIEnv *env, jclass that, jint window, jint accel_group) +{ + gtk_window_add_accel_group((GtkWindow*)window, (GtkAccelGroup*)accel_group); +} + + + + + + +/* + * DIALOGS + */ + +/* + * Color selection + */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1set_1color + (JNIEnv *env, jclass that, jint colorsel, jdoubleArray color) +{ + jdouble *color1 = NULL; + if (color) { + color1 = (*env)->GetDoubleArrayElements(env, color, NULL); + } + gtk_color_selection_set_color((GtkColorSelection*)colorsel, (gdouble*)color1); + if (color) { + (*env)->ReleaseDoubleArrayElements(env, color, color1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1get_1color + (JNIEnv *env, jclass that, jint colorsel, jdoubleArray color) +{ + jdouble *color1 = NULL; + if (color) { + color1 = (*env)->GetDoubleArrayElements(env, color, NULL); + } + gtk_color_selection_get_color((GtkColorSelection*)colorsel, (gdouble*)color1); + if (color) { + (*env)->ReleaseDoubleArrayElements(env, color, color1, 0); + } +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1dialog_1new + (JNIEnv *env, jclass that, jbyteArray title) +{ + jint rc; + jbyte *title1 = NULL; + if (title) { + title1 = (*env)->GetByteArrayElements(env, title, NULL); + } + rc = (jint)gtk_color_selection_dialog_new((gchar*)title1); + if (title) { + (*env)->ReleaseByteArrayElements(env, title, title1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1COLOR_1SELECTION_1DIALOG_1OK_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkColorSelectionDialog*)fsd)->ok_button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1COLOR_1SELECTION_1DIALOG_1CANCEL_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkColorSelectionDialog*)fsd)->cancel_button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1COLOR_1SELECTION_1DIALOG_1HELP_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkColorSelectionDialog*)fsd)->help_button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1COLOR_1SELECTION_1DIALOG_1COLORSEL + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkColorSelectionDialog*)fsd)->colorsel); +} + + +/* + * gtk_dialog_* + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1dialog_1new + (JNIEnv *env, jclass that) +{ + return (jint)gtk_dialog_new(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1DIALOG_1VBOX + (JNIEnv *env, jclass that, jint fsd) +{ + return (jint) (((GtkDialog*)fsd)->vbox); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1DIALOG_1ACTION_1AREA + (JNIEnv *env, jclass that, jint fsd) +{ + return (jint) (((GtkDialog*)fsd)->action_area); +} + + +/* + * gtk_file_selection_* + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1new + (JNIEnv *env, jclass that, jbyteArray title) +{ + jint rc; + jbyte *title1 = NULL; + if (title) { + title1 = (*env)->GetByteArrayElements(env, title, NULL); + } + rc = (jint)gtk_file_selection_new((gchar*)title1); + if (title) { + (*env)->ReleaseByteArrayElements(env, title, title1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1set_1filename + (JNIEnv *env, jclass that, jint filesel, jbyteArray filename) +{ + jbyte *filename1 = NULL; + if (filename) { + filename1 = (*env)->GetByteArrayElements(env, filename, NULL); + } + gtk_file_selection_set_filename((GtkFileSelection*)filesel, (gchar*)filename1); + if (filename) { + (*env)->ReleaseByteArrayElements(env, filename, filename1, 0); + } +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1get_1filename + (JNIEnv *env, jclass that, jint filesel) +{ + return (jint)gtk_file_selection_get_filename((GtkFileSelection*)filesel); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1complete + (JNIEnv *env, jclass that, jint filesel, jbyteArray pattern) +{ + jbyte *pattern1 = NULL; + if (pattern) { + pattern1 = (*env)->GetByteArrayElements(env, pattern, NULL); + } + gtk_file_selection_complete((GtkFileSelection*)filesel, (gchar*)pattern1); + if (pattern) { + (*env)->ReleaseByteArrayElements(env, pattern, pattern1, 0); + } +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1FILE_1SELECTION_1OK_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkFileSelection*)fsd)->ok_button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1FILE_1SELECTION_1CANCEL_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bug 70745 + */ + return (jint) (((GtkFileSelection*)fsd)->cancel_button); +} + + + +/* + * gtk_font_selection_* + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1new + (JNIEnv *env, jclass that, jbyteArray title) +{ + jint rc; + jbyte *title1 = NULL; + if (title) { + title1 = (*env)->GetByteArrayElements(env, title, NULL); + } + rc = (jint)gtk_font_selection_dialog_new((gchar*)title1); + if (title) { + (*env)->ReleaseByteArrayElements(env, title, title1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1get_1font_1name + (JNIEnv *env, jclass that, jint fsd) +{ + return (jint)gtk_font_selection_dialog_get_font_name((GtkFontSelectionDialog*)fsd); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1set_1font_1name + (JNIEnv *env, jclass that, jint fsd, jbyteArray fontname) +{ + jboolean rc; + jbyte *fontname1 = NULL; + if (fontname) { + fontname1 = (*env)->GetByteArrayElements(env, fontname, NULL); + } + rc = (jboolean)gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog*)fsd, (gchar*)fontname1); + if (fontname) { + (*env)->ReleaseByteArrayElements(env, fontname, fontname1, 0); + } + return rc; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1FONT_1SELECTION_1DIALOG_1OK_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bugs 70742, 70745 + */ + return (jint) (((GtkFontSelectionDialog*)fsd)->ok_button); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1FONT_1SELECTION_1DIALOG_1CANCEL_1BUTTON + (JNIEnv *env, jclass that, jint fsd) +{ + /* + * GTK bugs 70742, 70745 + */ + return (jint) (((GtkFontSelectionDialog*)fsd)->cancel_button); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-memmove.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-memmove.c new file mode 100644 index 0000000000..e89f082ee2 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-memmove.c @@ -0,0 +1,261 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +/** + * SWT OS natives implementation: OS.memmove(...) + */ + +#include "swt.h" +#include "structs.h" + +#include +#include + +/* Read */ +/* GDK */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGdkColorFids(env, dest, &PGLOB(GdkColorFc)); + setGdkColorFields(env, dest, src, &PGLOB(GdkColorFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventExpose_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGdkEventExposeFids(env, dest, &PGLOB(GdkEventExposeFc)); + setGdkEventExposeFields(env, dest, src, &PGLOB(GdkEventExposeFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkVisual_2I + (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGdkVisualFids(env, dest, &PGLOB(GdkVisualFc)); + setGdkVisualFields(env, dest, src, &PGLOB(GdkVisualFc)); + } +} + +/* GTK */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkStyleClass_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkStyleClassFids(env, dest, &PGLOB(GtkStyleClassFc)); + setGtkStyleClassFields(env, dest, src, &PGLOB(GtkStyleClassFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkAllocation_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkAllocationFids(env, dest, &PGLOB(GtkAllocationFc)); + setGtkAllocationFields(env, dest, src, &PGLOB(GtkAllocationFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkComboFids(env, dest, &PGLOB(GtkComboFc)); + setGtkComboFields(env, dest, src, &PGLOB(GtkComboFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCList_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkCListFids(env, dest, &PGLOB(GtkCListFc)); + setGtkCListFields(env, dest, src, &PGLOB(GtkCListFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCTree_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkCTreeFids(env, dest, &PGLOB(GtkCTreeFc)); + setGtkCTreeFields(env, dest, src, &PGLOB(GtkCTreeFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkRequisition_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkRequisitionFids(env, dest, &PGLOB(GtkRequisitionFc)); + setGtkRequisitionFields(env, dest, src, &PGLOB(GtkRequisitionFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkStyle_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkStyleFids(env, dest, &PGLOB(GtkStyleFc)); + setGtkStyleFields(env, dest, src, &PGLOB(GtkStyleFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkAdjustment_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkAdjustmentFids(env, dest, &PGLOB(GtkAdjustmentFc)); + setGtkAdjustmentFields(env, dest, src, &PGLOB(GtkAdjustmentFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCListRow_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkCListRowFids(env, dest, &PGLOB(GtkCListRowFc)); + setGtkCListRowFields(env, dest, src, &PGLOB(GtkCListRowFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCListColumn_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkCListColumnFids(env, dest, &PGLOB(GtkCListColumnFc)); + setGtkCListColumnFields(env, dest, src, &PGLOB(GtkCListColumnFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCTreeRow_2I + (JNIEnv *env, jclass that, jobject dest, jint src) +{ + DECL_GLOB(pGlob) + if (dest) { + cacheGtkCTreeRowFids(env, dest, &PGLOB(GtkCTreeRowFc)); + setGtkCTreeRowFields(env, dest, src, &PGLOB(GtkCTreeRowFc)); + } +} + +/* Write */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkAdjustment_2 + (JNIEnv *env, jclass that, jint dest, jobject src) +{ + DECL_GLOB(pGlob) + if (src) { + cacheGtkAdjustmentFids(env, src, &PGLOB(GtkAdjustmentFc)); + getGtkAdjustmentFields(env, src, dest, &PGLOB(GtkAdjustmentFc)); + } +} + + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCListColumn_2 + (JNIEnv *env, jclass that, jint dest, jobject src) +{ + DECL_GLOB(pGlob) + if (src) { + cacheGtkCListColumnFids(env, src, &PGLOB(GtkCListColumnFc)); + getGtkCListColumnFields(env, src, dest, &PGLOB(GtkCListColumnFc)); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkStyle_2 + (JNIEnv *env, jclass that, jint dest, jobject src) +{ + DECL_GLOB(pGlob) + if (src) { + cacheGtkStyleFids(env, src, &PGLOB(GtkStyleFc)); + getGtkStyleFields(env, src, dest, &PGLOB(GtkStyleFc)); + } +} + + +/* Primitive memmoves */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__I_3BI + (JNIEnv *env, jclass that, jint dest, jbyteArray src, jint count) +{ + jbyte *src1; + if (src) { + src1 = (*env)->GetByteArrayElements(env, src, NULL); + memmove((void*)dest, (void*)src1, count); + (*env)->ReleaseByteArrayElements(env, src, src1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__I_3II + (JNIEnv *env, jclass that, jint dest, jintArray src, jint count) +{ + jint *src1; + if (src) { + src1 = (*env)->GetIntArrayElements(env, src, NULL); + memmove((void*)dest, (void*)src1, count); + (*env)->ReleaseIntArrayElements(env, src, src1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3III + (JNIEnv *env, jclass that, jintArray dest, jint src, jint count) +{ + jint *dest1; + if (dest) { + dest1 = (*env)->GetIntArrayElements(env, dest, NULL); + memmove((void*)dest1, (void*)src, count); + (*env)->ReleaseIntArrayElements(env, dest, dest1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3BII + (JNIEnv *env, jclass that, jbyteArray dest, jint src, jint count) +{ + jbyte *dest1; + if (dest) { + dest1 = (*env)->GetByteArrayElements(env, dest, NULL); + memmove((void*)dest1, (void*)src, count); + (*env)->ReleaseByteArrayElements(env, dest, dest1, 0); + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3I_3BI + (JNIEnv *env, jclass that, jintArray dest, jbyteArray src, jint count) +{ + jint *dest1; + jbyte *src1; + if (src && dest) { + dest1 = (*env)->GetIntArrayElements(env, dest, NULL); + src1 = (*env)->GetByteArrayElements(env, dest, NULL); + memmove((void*)dest1, (void*)src1, count); + (*env)->ReleaseIntArrayElements(env, dest, dest1, 0); + (*env)->ReleaseByteArrayElements(env, src, src1, 0); + } +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-pango.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-pango.c new file mode 100644 index 0000000000..396f7b23c1 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt-pango.c @@ -0,0 +1,218 @@ +/* + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. + * + * The contents of this file are made available under the terms + * of the GNU Lesser General Public License (LGPL) Version 2.1 that + * accompanies this distribution (lgpl-v21.txt). The LGPL is also + * available at http://www.gnu.org/licenses/lgpl.html. If the version + * of the LGPL at http://www.gnu.org is different to the version of + * the LGPL accompanying this distribution and there is any conflict + * between the two license versions, the terms of the LGPL accompanying + * this distribution shall govern. + */ + +#include "swt.h" +#include + +/* + * macros + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1WEIGHT_1NORMAL + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_WEIGHT_NORMAL; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1WEIGHT_1BOLD + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_WEIGHT_BOLD; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1STYLE_1NORMAL + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_STYLE_NORMAL; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1STYLE_1ITALIC + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_STYLE_ITALIC; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1STYLE_1OBLIQUE + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_STYLE_OBLIQUE; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1SCALE + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_SCALE; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_PANGO_1STRETCH_1NORMAL + (JNIEnv *env, jclass that) +{ + return (jint)PANGO_STRETCH_NORMAL; +} + + +/* + * functions + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1new + (JNIEnv *env, jclass that) +{ + return (jint)pango_font_description_new(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1from_1string + (JNIEnv *env, jclass that, jstring str) +{ + const jbyte *str1; + jint answer; + str1 = (*env)->GetStringUTFChars(env, str, NULL); + if (str1==NULL) return (jint)0; + answer = (jint)pango_font_description_from_string(str1); + (*env)->ReleaseStringUTFChars(env, str, str1); + return answer; +} + + +JNIEXPORT jstring JNICALL +Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1to_1string + (JNIEnv *env, jclass that, jint descr) +{ + jstring answer; + char *canswer = pango_font_description_to_string((PangoFontDescription*)descr); + answer = (*env)->NewStringUTF(env, canswer); + g_free(canswer); + return answer; +} + +JNIEXPORT jboolean JNICALL +Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1equal + (JNIEnv *env, jclass that, jint descr1, jint descr2) +{ + return (jboolean) pango_font_description_equal ((PangoFontDescription*)descr1, (PangoFontDescription*)descr2); +} + +JNIEXPORT void JNICALL +Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1free + (JNIEnv *env, jclass that, jint descr) +{ + pango_font_description_free((PangoFontDescription*)descr); +} + +JNIEXPORT jstring JNICALL +Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1get_1family + (JNIEnv *env, jclass that, jint descr) +{ + const char *canswer = pango_font_description_get_family((PangoFontDescription*)descr); + return (*env)->NewStringUTF(env, canswer); + /* don't free */ +} + +JNIEXPORT void JNICALL +Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1set_1family + (JNIEnv *env, jclass that, jint descr, jstring family) +{ + const jbyte *family1 = (*env)->GetStringUTFChars(env, family, NULL); + if (family1==NULL) return; + pango_font_description_set_family((PangoFontDescription*)descr, family1); + (*env)->ReleaseStringUTFChars(env, family, family1); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1get_1size + (JNIEnv *env, jclass that, jint descr) +{ + return (jint)pango_font_description_get_size((PangoFontDescription*)descr); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1get_1style + (JNIEnv *env, jclass that, jint descr) +{ + return (jint)pango_font_description_get_style((PangoFontDescription*)descr); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1get_1weight + (JNIEnv *env, jclass that, jint descr) +{ + return (jint)pango_font_description_get_weight((PangoFontDescription*)descr); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1set_1size + (JNIEnv *env, jclass that, jint descr, jint size) +{ + pango_font_description_set_size((PangoFontDescription*)descr, size); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1set_1stretch + (JNIEnv *env, jclass that, jint descr, jint stretch) +{ + pango_font_description_set_weight((PangoFontDescription*)descr, stretch); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1set_1style + (JNIEnv *env, jclass that, jint descr, jint style) +{ + pango_font_description_set_weight((PangoFontDescription*)descr, style); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1description_1set_1weight + (JNIEnv *env, jclass that, jint descr, jint weight) +{ + pango_font_description_set_weight((PangoFontDescription*)descr, weight); +} + +/* contexts */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1context_1new + (JNIEnv *env, jclass that) +{ + return (jint)pango_context_new(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1context_1get_1font_1description + (JNIEnv *env, jclass that, jint context) +{ + return (jint)pango_context_get_font_description((PangoContext*)context); +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1context_1set_1font_1description + (JNIEnv *env, jclass that, jint context, jint descr) +{ + pango_context_set_font_description((PangoContext*)context, (PangoFontDescription*)descr); +} + +JNIEXPORT int JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1context_1get_1metrics + (JNIEnv *env, jclass that, jint context, jint descr) +{ + return (jint)pango_context_get_metrics((PangoContext*)context, (PangoFontDescription*)descr, NULL); +} + +/* metrics */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1metrics_1get_1ascent + (JNIEnv *env, jclass that, jint metrics) +{ + return (jint)pango_font_metrics_get_ascent((PangoFontMetrics*)metrics); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1metrics_1get_1descent + (JNIEnv *env, jclass that, jint metrics) +{ + return (jint)pango_font_metrics_get_descent((PangoFontMetrics*)metrics); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_pango_1font_1metrics_1get_1approximate_1char_1width + (JNIEnv *env, jclass that, jint metrics) +{ + return (jint)pango_font_metrics_get_approximate_char_width((PangoFontMetrics*)metrics); +} + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt.c index a9f8db8414..f3f2f622d3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/swt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. + * Copyright (c) IBM Corp. 2000, 2002. All rights reserved. * * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that @@ -15,180 +15,256 @@ * SWT OS natives implementation. */ -/*#define PRINT_FAILED_RCODES*/ -#define NDEBUG - #include "swt.h" #include "structs.h" #include #include + /* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_draw_check - * Signature: + * General */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1draw_1check - (JNIEnv *env, jclass that, jint style, jint window, jint state_type, jint shadow_type, jint x, jint y, jint width, jint height) + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1version + (JNIEnv *env, jclass that, jint required_major, jint required_minor, jint required_micro) { -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_post_recursive_to_depth"); -#endif + return (jint)gtk_check_version(required_major, required_minor, required_micro); +} - gtk_draw_check((GtkStyle*)style, (GdkWindow *) window, (GtkStateType)state_type, (GtkShadowType)shadow_type, (gint) x, (gint) y, (gint) width, (gint) height); +/* + * Main loop + */ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1set_1locale + (JNIEnv *env, jclass that) +{ + return (jint)gtk_set_locale(); +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1init_1check + (JNIEnv *env, jclass that, jintArray argc, jintArray argv) +{ + /* + * Temporary code, pending resolution of GTK bug 70984. + */ + static char* targs[2]; + static char** targv; + static int targc = 1; + static char *targv0 = "swt"; + static char *targv1 = (char*)0; + targs[0] = targv0; targs[1] = targv1; + targv = &targs; + return gtk_init_check(&targc, &targv); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_post_recursive + * Method: gtk_events_pending * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1post_1recursive_1to_1depth - (JNIEnv *env, jclass that, jint ctree, jint node, jint depth, jint func, jint data) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1events_1pending + (JNIEnv *env, jclass that) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_post_recursive_to_depth"); + fprintf(stderr, "gtk_events_pending"); #endif - gtk_ctree_post_recursive_to_depth((GtkCTree*)ctree, (GtkCTreeNode*)node, (jint)depth, (GtkCTreeFunc)func, (gpointer)data); + return (jint)gtk_events_pending(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_row_is_visible + * Method: gtk_main * Signature: */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1row_1is_1visible - (JNIEnv *env, jclass that, jint clist, jint row) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main + (JNIEnv *env, jclass that) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_row_is_visible"); + fprintf(stderr, "gtk_main"); #endif - return gtk_clist_row_is_visible((GtkCList *)clist, (gint)row); + gtk_main(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_log_default_handler + * Method: gtk_main_quit * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1default_1handler - (JNIEnv *env, jclass that, jint log_domain, jint log_levels, jint message, jint unused_data) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main_1quit + (JNIEnv *env, jclass that) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_log_default_handler"); + fprintf(stderr, "gtk_main_quit"); #endif - g_log_default_handler((gchar *)log_domain, (GLogLevelFlags)log_levels, (gchar *)message, (gpointer)unused_data); + gtk_main_quit(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main_1iteration + (JNIEnv *env, jclass that) +{ + return (jint)gtk_main_iteration(); } + /* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_log_set_handler - * Signature: + * GLIB */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1set_1handler - (JNIEnv *env, jclass that, jbyteArray log_domain, jint log_levels, jint log_func, jint user_data) + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1signal_1connect + (JNIEnv *env, jclass that, jint instance, jstring signel, jint handler, jint data) +{ + jbyte *signal1; + signal1 = (*env)->GetStringUTFChars(env, signal, NULL); + g_signal_connect(instance, signal, handler, data); + (*env)->ReleaseStringUTFChars(env, signal, signal1); +} + + + + + + +/* + * Others - FIXME: please classify + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1add + (JNIEnv *env, jclass that, jint widget) { - jint rc; - jbyte *log_domain1 = NULL; - #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_log_set_handler"); + fprintf(stderr, "gtk_grab_add"); #endif - if (log_domain) { - log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); - } - rc = (jint) g_log_set_handler((gchar *)log_domain1, (GLogLevelFlags)log_levels, (GLogFunc) log_func, (gpointer) user_data); - if (log_domain) { - (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); - } - return rc; + gtk_grab_add((GtkWidget*)widget); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_log_remove_handler + * Method: gtk_grab_get_current * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1remove_1handler - (JNIEnv *env, jclass that, jbyteArray log_domain, jint handler_id) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1get_1current + (JNIEnv *env, jclass that) { - jbyte *log_domain1 = NULL; - #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_log_remove_handler"); + fprintf(stderr, "gtk_grab_get_current"); #endif - if (log_domain) { - log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); - } - g_log_remove_handler((gchar *)log_domain1, handler_id); - if (log_domain) { - (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); - } + return (jint)gtk_grab_get_current(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: GTK_WIDGET_TYPE + * Method: gtk_grab_remove * Signature: */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1TYPE - (JNIEnv *env, jclass that, jint wid) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1remove + (JNIEnv *env, jclass that, jint widget) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_TYPE"); + fprintf(stderr, "gtk_grab_remove"); #endif - return GTK_WIDGET_TYPE((GtkWidget*)wid); + gtk_grab_remove((GtkWidget*)widget); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_get_type + * Method: gtk_timeout_add * Signature: */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1get_1type - (JNIEnv *env, jclass that) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1timeout_1add + (JNIEnv *env, jclass that, jint interval, jint function, jint data) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_get_type"); + fprintf(stderr, "gtk_timeout_add"); #endif - return gtk_label_get_type (); + return (jint)gtk_timeout_add((guint32)interval, (GtkFunction)function, (gpointer)data); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_object_unref + * Method: gtk_timeout_remove * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1unref - (JNIEnv *env, jclass that, jint object) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1timeout_1remove + (JNIEnv *env, jclass that, jint timeout_handler_id) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_unref"); + fprintf(stderr, "gtk_timeout_remove"); #endif - gtk_object_unref((GtkObject*)object); + gtk_timeout_remove(timeout_handler_id); } /* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_object_ref - * Signature: + * Styles */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1destroy + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1draw_1check + (JNIEnv *env, jclass that, jint style, jint window, jint state_type, jint shadow_type, jint x, jint y, jint width, jint height) +{ + gtk_draw_check((GtkStyle*)style, (GdkWindow *) window, (GtkStateType)state_type, (GtkShadowType)shadow_type, (gint) x, (gint) y, (gint) width, (gint) height); +} + + +/* + * Logging + */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1default_1handler + (JNIEnv *env, jclass that, jint log_domain, jint log_levels, jint message, jint unused_data) +{ + g_log_default_handler((gchar *)log_domain, (GLogLevelFlags)log_levels, (gchar *)message, (gpointer)unused_data); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1set_1handler + (JNIEnv *env, jclass that, jbyteArray log_domain, jint log_levels, jint log_func, jint user_data) +{ + jint rc; + jbyte *log_domain1 = NULL; + if (log_domain) { + log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); + } + rc = (jint) g_log_set_handler((gchar *)log_domain1, (GLogLevelFlags)log_levels, (GLogFunc) log_func, (gpointer) user_data); + if (log_domain) { + (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1remove_1handler + (JNIEnv *env, jclass that, jbyteArray log_domain, jint handler_id) +{ + jbyte *log_domain1 = NULL; + + if (log_domain) { + log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); + } + g_log_remove_handler((gchar *)log_domain1, handler_id); + if (log_domain) { + (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); + } +} + + +/* + * GtkObject + */ + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1unref (JNIEnv *env, jclass that, jint object) { -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_destroy"); -#endif + gtk_object_unref((GtkObject*)object); +} +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1destroy + (JNIEnv *env, jclass that, jint object) +{ gtk_object_destroy((GtkObject*)object); } @@ -196,20 +272,12 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1get_1da (JNIEnv *env, jclass that, jint object, jint data_id) { jint result; - -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_get_data_by_id"); -#endif return (jint) gtk_object_get_data_by_id((GtkObject*)object, (GQuark) data_id); } JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1set_1data_1by_1id (JNIEnv *env, jclass that, jint object, jint data_id, jint data) { -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_set_data_by_id"); -#endif - gtk_object_set_data_by_id ((GtkObject*)object, (GQuark) data_id, (gpointer) data); } @@ -218,11 +286,6 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1quark_1from_1stri { jint result; jbyte *string1 = NULL; - -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_quark_from_string"); -#endif - if (string) { string1 = (*env)->GetByteArrayElements(env, string, NULL); } @@ -233,7599 +296,1392 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1quark_1from_1stri return result; } + + + +/* + * Signals + */ + JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1block_1by_1data (JNIEnv *env, jclass that, jint object, jint data) { -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_handler_block_by_data"); -#endif - gtk_signal_handler_block_by_data((GtkObject*)object, (gpointer) data); } JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1unblock_1by_1data (JNIEnv *env, jclass that, jint object, jint data) { -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_handler_unblock_by_data"); -#endif - gtk_signal_handler_unblock_by_data((GtkObject*)object, (gpointer) data); } -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1rgb_1init - (JNIEnv *env, jclass cl) -{ - gdk_rgb_init(); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1FLAGS - (JNIEnv *env, jclass that, jint wid) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_FLAGS"); -#endif - return (jint) GTK_WIDGET_FLAGS((GtkWidget*)wid); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1SET_1FLAGS - (JNIEnv *env, jclass that, jint wid, jint flag) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_SET_FLAGS"); -#endif - GTK_WIDGET_SET_FLAGS((GtkWidget*)wid, flag); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1UNSET_1FLAGS - (JNIEnv *env, jclass that, jint wid, jint flag) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_UNSET_FLAGS"); -#endif - GTK_WIDGET_UNSET_FLAGS((GtkWidget*)wid, flag); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1NO_1WINDOW - (JNIEnv *env, jclass that, jint wid) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_NO_WINDOW"); -#endif - return (jboolean) GTK_WIDGET_NO_WINDOW((GtkWidget*)wid); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: GDK_ROOT_PARENT - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GDK_1ROOT_1PARENT - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GDK_ROOT_PARENT"); -#endif - return (jint) GDK_ROOT_PARENT(); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1SENSITIVE - (JNIEnv *env, jclass that, jint wid) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_SENSITIVE"); -#endif - return (jboolean) GTK_WIDGET_SENSITIVE((GtkWidget*)wid); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1WIDGET_1IS_1SENSITIVE - (JNIEnv *env, jclass that, jint wid) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "GTK_WIDGET_IS_SENSITIVE"); -#endif - return (jboolean) GTK_WIDGET_IS_SENSITIVE((GtkWidget*)wid); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_accel_group_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1group_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_accel_group_new"); -#endif - - return (jint)gtk_accel_group_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_accel_group_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1group_1unref - (JNIEnv *env, jclass that, jint accel_group) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_accel_group_unref"); -#endif - - gtk_accel_group_unref((GtkAccelGroup*)accel_group); -} - -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1accel_1groups_1activate - (JNIEnv *env, jclass that, jint accel_group, jint accel_key, jint accel_mods) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_accel_groups_activate"); -#endif - - return (jboolean) gtk_accel_groups_activate(GTK_OBJECT((GtkWindow*)accel_group), - accel_key, - accel_mods); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_adjustment_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1new - (JNIEnv *env, jclass that, jfloat value, jfloat lower, jfloat upper, jfloat step_increment, jfloat page_increment, jfloat page_size) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_adjustment_new"); -#endif - - return (jint)gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_adjustment_changed - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1changed - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_adjustment_changed"); -#endif - - gtk_adjustment_changed((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_adjustment_value_changed - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1value_1changed - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_adjustment_value_changed"); -#endif - - gtk_adjustment_value_changed((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_adjustment_set_value - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1adjustment_1set_1value - (JNIEnv *env, jclass that, jint adjustment, jfloat value) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_adjustment_set_value"); -#endif - - gtk_adjustment_set_value((GtkAdjustment*)adjustment, value); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_arrow_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1arrow_1new - (JNIEnv *env, jclass that, jint arrow_type, jint shadow_type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_arrow_new"); -#endif - - return (jint)gtk_arrow_new((GtkArrowType)arrow_type, (GtkShadowType)shadow_type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_arrow_set - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1arrow_1set - (JNIEnv *env, jclass that, jint arrow, jint arrow_type, jint shadow_type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_arrow_set"); -#endif - - gtk_arrow_set((GtkArrow*)arrow, (GtkArrowType)arrow_type, (GtkShadowType)shadow_type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_box_pack_start - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1box_1pack_1start - (JNIEnv *env, jclass that, jint box, jint child, jboolean expand, jboolean fill, jint padding) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_box_pack_start"); -#endif - - gtk_box_pack_start((GtkBox*)box, (GtkWidget*)child, (gboolean)expand, (gboolean)fill, padding); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_box_pack_end - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1box_1pack_1end - (JNIEnv *env, jclass that, jint box, jint child, jboolean expand, jboolean fill, jint padding) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_box_pack_end"); -#endif - - gtk_box_pack_end((GtkBox*)box, (GtkWidget*)child, (gboolean)expand, (gboolean)fill, padding); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_button_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1button_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_button_new"); -#endif - - return (jint)gtk_button_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_button_new_with_label - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1button_1new_1with_1label - (JNIEnv *env, jclass that, jbyteArray label) -{ - jint rc; - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_button_new_with_label"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - rc = (jint)gtk_button_new_with_label((gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_check_button_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1button_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_check_button_new"); -#endif - - return (jint)gtk_check_button_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_check_menu_item_new_with_label - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1new_1with_1label - (JNIEnv *env, jclass that, jbyteArray label) -{ - jint rc; - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_check_menu_item_new_with_label"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - rc = (jint)gtk_check_menu_item_new_with_label((gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_check_menu_item_set_active - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1set_1active - (JNIEnv *env, jclass that, jint check_menu_item, jboolean is_active) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_check_menu_item_set_active"); -#endif - - gtk_check_menu_item_set_active((GtkCheckMenuItem*)check_menu_item, (gboolean)is_active); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_check_menu_item_set_show_toggle - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1menu_1item_1set_1show_1toggle - (JNIEnv *env, jclass that, jint menu_item, jboolean always) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_check_menu_item_set_show_toggle"); -#endif - - gtk_check_menu_item_set_show_toggle((GtkCheckMenuItem*)menu_item, (gboolean)always); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_color_selection_set_color - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1set_1color - (JNIEnv *env, jclass that, jint colorsel, jdoubleArray color) -{ - jdouble *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_color_selection_set_color"); -#endif - - if (color) { - color1 = (*env)->GetDoubleArrayElements(env, color, NULL); - } - gtk_color_selection_set_color((GtkColorSelection*)colorsel, (gdouble*)color1); - if (color) { - (*env)->ReleaseDoubleArrayElements(env, color, color1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_color_selection_get_color - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1get_1color - (JNIEnv *env, jclass that, jint colorsel, jdoubleArray color) -{ - jdouble *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_color_selection_get_color"); -#endif - - if (color) { - color1 = (*env)->GetDoubleArrayElements(env, color, NULL); - } - gtk_color_selection_get_color((GtkColorSelection*)colorsel, (gdouble*)color1); - if (color) { - (*env)->ReleaseDoubleArrayElements(env, color, color1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_color_selection_dialog_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1color_1selection_1dialog_1new - (JNIEnv *env, jclass that, jbyteArray title) -{ - jint rc; - jbyte *title1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_color_selection_dialog_new"); -#endif - - if (title) { - title1 = (*env)->GetByteArrayElements(env, title, NULL); - } - rc = (jint)gtk_color_selection_dialog_new((gchar*)title1); - if (title) { - (*env)->ReleaseByteArrayElements(env, title, title1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_combo_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1combo_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_combo_new"); -#endif - - return (jint)gtk_combo_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_combo_set_popdown_strings - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1combo_1set_1popdown_1strings - (JNIEnv *env, jclass that, jint combo, jint strings) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_combo_set_popdown_strings"); -#endif - - gtk_combo_set_popdown_strings((GtkCombo*)combo, (GList*)strings); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_container_add - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1add - (JNIEnv *env, jclass that, jint container, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_container_add"); -#endif - - gtk_container_add((GtkContainer*)container, (GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_container_remove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1remove - (JNIEnv *env, jclass that, jint container, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_container_remove"); -#endif - - gtk_container_remove((GtkContainer*)container, (GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_container_children - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1container_1children - (JNIEnv *env, jclass that, jint container) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_container_children"); -#endif - - return (jint)gtk_container_children((GtkContainer*)container); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1new - (JNIEnv *env, jclass that, jint columns, jint tree_column) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_new"); -#endif - - return (jint)gtk_ctree_new((gint)columns, (gint)tree_column); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_insert_node - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1insert_1node - (JNIEnv *env, jclass that, jint ctree, jint parent, jint sibling, jintArray text, jbyte spacing, jint pixmap_closed, jint mask_closed, jint pixmap_opened, jint mask_opened, jboolean is_leaf, jboolean expanded) -{ - jint rc; - jint *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_insert_node"); -#endif - - if (text) { - text1 = (*env)->GetIntArrayElements(env, text, NULL); - } - rc = (jint)gtk_ctree_insert_node((GtkCTree*)ctree, (GtkCTreeNode*)parent, (GtkCTreeNode*)sibling, (gchar**)text1, (guint8)spacing, (GdkPixmap*)pixmap_closed, (GdkBitmap*)mask_closed, (GdkPixmap*)pixmap_opened, (GdkBitmap*)mask_opened, (gboolean)is_leaf, (gboolean)expanded); - if (text) { - (*env)->ReleaseIntArrayElements(env, text, text1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_remove_node - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1remove_1node - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_remove_node"); -#endif - - gtk_ctree_remove_node((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_post_recursive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1post_1recursive - (JNIEnv *env, jclass that, jint ctree, jint node, jint func, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_post_recursive"); -#endif - - gtk_ctree_post_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node, (GtkCTreeFunc)func, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_is_viewable - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1is_1viewable - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_is_viewable"); -#endif - - return (jboolean)gtk_ctree_is_viewable((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_nth - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1nth - (JNIEnv *env, jclass that, jint ctree, jint row) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_nth"); -#endif - - return (jint)gtk_ctree_node_nth((GtkCTree*)ctree, row); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_is_hot_spot - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1is_1hot_1spot - (JNIEnv *env, jclass that, jint ctree, jint x, jint y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_is_hot_spot"); -#endif - - return (jboolean)gtk_ctree_is_hot_spot((GtkCTree*)ctree, (gint)x, (gint)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_expand - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1expand - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_expand"); -#endif - - gtk_ctree_expand((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_collapse - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1collapse - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_collapse"); -#endif - - gtk_ctree_collapse((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_select - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1select - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_select"); -#endif - - gtk_ctree_select((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_select_recursive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1select_1recursive - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_select_recursive"); -#endif - - gtk_ctree_select_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_unselect_recursive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1unselect_1recursive - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_unselect_recursive"); -#endif - - gtk_ctree_unselect_recursive((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_set_node_info - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1set_1node_1info - (JNIEnv *env, jclass that, jint ctree, jint node, jbyteArray text, jbyte spacing, jint pixmap_closed, jint mask_closed, jint pixmap_opened, jint mask_opened, jboolean is_leaf, jboolean expanded) -{ - jbyte *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_set_node_info"); -#endif - - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - gtk_ctree_set_node_info((GtkCTree*)ctree, (GtkCTreeNode*)node, (gchar*)text1, (guint8)spacing, (GdkPixmap*)pixmap_closed, (GdkBitmap*)mask_closed, (GdkPixmap*)pixmap_opened, (GdkBitmap*)mask_opened, (gboolean)is_leaf, (gboolean)expanded); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_get_node_info - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1get_1node_1info - (JNIEnv *env, jclass that, jint ctree, jint node, jintArray text, jbyteArray spacing, jintArray pixmap_closed, jintArray mask_closed, jintArray pixmap_opened, jintArray mask_opened, jbooleanArray is_leaf, jbooleanArray expanded) -{ - jint rc; - jint *text1 = NULL; - jbyte *spacing1 = NULL; - jint *pixmap_closed1 = NULL; - jint *mask_closed1 = NULL; - jint *pixmap_opened1 = NULL; - jint *mask_opened1 = NULL; - jboolean *is_leaf1 = NULL; - jboolean *expanded1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_get_node_info"); -#endif - - if (text) { - text1 = (*env)->GetIntArrayElements(env, text, NULL); - } - if (spacing) { - spacing1 = (*env)->GetByteArrayElements(env, spacing, NULL); - } - if (pixmap_closed) { - pixmap_closed1 = (*env)->GetIntArrayElements(env, pixmap_closed, NULL); - } - if (mask_closed) { - mask_closed1 = (*env)->GetIntArrayElements(env, mask_closed, NULL); - } - if (pixmap_opened) { - pixmap_opened1 = (*env)->GetIntArrayElements(env, pixmap_opened, NULL); - } - if (mask_opened) { - mask_opened1 = (*env)->GetIntArrayElements(env, mask_opened, NULL); - } - if (is_leaf) { - is_leaf1 = (*env)->GetBooleanArrayElements(env, is_leaf, NULL); - } - if (expanded) { - expanded1 = (*env)->GetBooleanArrayElements(env, expanded, NULL); - } - rc = (jint)gtk_ctree_get_node_info((GtkCTree*)ctree, (GtkCTreeNode*)node, (gchar**)text1, (guint8*)spacing1, (GdkPixmap**)pixmap_closed1, (GdkBitmap**)mask_closed1, (GdkPixmap**)pixmap_opened1, (GdkBitmap**)mask_opened1, (gboolean*)is_leaf1, (gboolean*)expanded1); - if (text) { - (*env)->ReleaseIntArrayElements(env, text, text1, 0); - } - if (spacing) { - (*env)->ReleaseByteArrayElements(env, spacing, spacing1, 0); - } - if (pixmap_closed) { - (*env)->ReleaseIntArrayElements(env, pixmap_closed, pixmap_closed1, 0); - } - if (mask_closed) { - (*env)->ReleaseIntArrayElements(env, mask_closed, mask_closed1, 0); - } - if (pixmap_opened) { - (*env)->ReleaseIntArrayElements(env, pixmap_opened, pixmap_opened1, 0); - } - if (mask_opened) { - (*env)->ReleaseIntArrayElements(env, mask_opened, mask_opened1, 0); - } - if (is_leaf) { - (*env)->ReleaseBooleanArrayElements(env, is_leaf, is_leaf1, 0); - } - if (expanded) { - (*env)->ReleaseBooleanArrayElements(env, expanded, expanded1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_get_row_style - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1get_1row_1style - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_get_row_style"); -#endif - - return (jint)gtk_ctree_node_get_row_style((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_set_row_data - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1set_1row_1data - (JNIEnv *env, jclass that, jint ctree, jint node, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_set_row_data"); -#endif - - gtk_ctree_node_set_row_data((GtkCTree*)ctree, (GtkCTreeNode*)node, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_get_row_data - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1get_1row_1data - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_get_row_data"); -#endif - - return (jint)gtk_ctree_node_get_row_data((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_moveto - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1moveto - (JNIEnv *env, jclass that, jint ctree, jint node, jint column, jfloat row_align, jfloat col_align) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_moveto"); -#endif - - gtk_ctree_node_moveto((GtkCTree*)ctree, (GtkCTreeNode*)node, (gint)column, row_align, col_align); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_ctree_node_is_visible - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1ctree_1node_1is_1visible - (JNIEnv *env, jclass that, jint ctree, jint node) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_ctree_node_is_visible"); -#endif - - return (jint)gtk_ctree_node_is_visible((GtkCTree*)ctree, (GtkCTreeNode*)node); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_dialog_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1dialog_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_dialog_new"); -#endif - - return (jint)gtk_dialog_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_drawing_area_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1drawing_1area_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_drawing_area_new"); -#endif - - return (jint)gtk_drawing_area_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_drawing_area_size - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1drawing_1area_1size - (JNIEnv *env, jclass that, jint darea, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_drawing_area_size"); -#endif - - gtk_drawing_area_size((GtkDrawingArea*)darea, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_select_region - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1select_1region - (JNIEnv *env, jclass that, jint editable, jint start, jint end) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_select_region"); -#endif - - gtk_editable_select_region((GtkEditable*)editable, (gint)start, (gint)end); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_insert_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1insert_1text - (JNIEnv *env, jclass that, jint editable, jbyteArray new_text, jint new_text_length, jintArray position) -{ - jbyte *new_text1 = NULL; - jint *position1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_insert_text"); -#endif - - if (new_text) { - new_text1 = (*env)->GetByteArrayElements(env, new_text, NULL); - } - if (position) { - position1 = (*env)->GetIntArrayElements(env, position, NULL); - } - gtk_editable_insert_text((GtkEditable*)editable, (gchar*)new_text1, (gint)new_text_length, (gint*)position1); - if (new_text) { - (*env)->ReleaseByteArrayElements(env, new_text, new_text1, 0); - } - if (position) { - (*env)->ReleaseIntArrayElements(env, position, position1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_delete_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1delete_1text - (JNIEnv *env, jclass that, jint editable, jint start_pos, jint end_pos) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_delete_text"); -#endif - - gtk_editable_delete_text((GtkEditable*)editable, (gint)start_pos, (gint)end_pos); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_get_chars - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1get_1chars - (JNIEnv *env, jclass that, jint editable, jint start_pos, jint end_pos) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_get_chars"); -#endif - - return (jint)gtk_editable_get_chars((GtkEditable*)editable, (gint)start_pos, (gint)end_pos); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_delete_selection - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1delete_1selection - (JNIEnv *env, jclass that, jint editable) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_delete_selection"); -#endif - - gtk_editable_delete_selection((GtkEditable*)editable); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_set_position - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1set_1position - (JNIEnv *env, jclass that, jint editable, jint position) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_set_position"); -#endif - - gtk_editable_set_position((GtkEditable*)editable, (gint)position); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_get_position - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1get_1position - (JNIEnv *env, jclass that, jint editable) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_get_position"); -#endif - - return (jint)gtk_editable_get_position((GtkEditable*)editable); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_editable_set_editable - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1editable_1set_1editable - (JNIEnv *env, jclass that, jint editable, jboolean is_editable) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_editable_set_editable"); -#endif - - gtk_editable_set_editable((GtkEditable*)editable, (gboolean)is_editable); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_new"); -#endif - - return (jint)gtk_entry_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_set_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1text - (JNIEnv *env, jclass that, jint entry, jbyteArray text) -{ - jbyte *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_set_text"); -#endif - - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - gtk_entry_set_text((GtkEntry*)entry, (gchar*)text1); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_append_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1append_1text - (JNIEnv *env, jclass that, jint entry, jbyteArray text) -{ - jbyte *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_append_text"); -#endif - - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - gtk_entry_append_text((GtkEntry*)entry, (gchar*)text1); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_get_text - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1get_1text - (JNIEnv *env, jclass that, jint entry) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_get_text"); -#endif - - return (jint)gtk_entry_get_text((GtkEntry*)entry); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_set_visibility - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1visibility - (JNIEnv *env, jclass that, jint entry, jboolean visible) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_set_visibility"); -#endif - - gtk_entry_set_visibility((GtkEntry*)entry, (gboolean)visible); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_set_editable - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1editable - (JNIEnv *env, jclass that, jint entry, jboolean editable) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_set_editable"); -#endif - - gtk_entry_set_editable((GtkEntry*)entry, (gboolean)editable); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_entry_set_max_length - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1entry_1set_1max_1length - (JNIEnv *env, jclass that, jint entry, jshort max) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_entry_set_max_length"); -#endif - - gtk_entry_set_max_length((GtkEntry*)entry, (guint16)max); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_event_box_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1event_1box_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_event_box_new"); -#endif - - return (jint)gtk_event_box_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_file_selection_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1new - (JNIEnv *env, jclass that, jbyteArray title) -{ - jint rc; - jbyte *title1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_file_selection_new"); -#endif - - if (title) { - title1 = (*env)->GetByteArrayElements(env, title, NULL); - } - rc = (jint)gtk_file_selection_new((gchar*)title1); - if (title) { - (*env)->ReleaseByteArrayElements(env, title, title1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_file_selection_set_filename - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1set_1filename - (JNIEnv *env, jclass that, jint filesel, jbyteArray filename) -{ - jbyte *filename1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_file_selection_set_filename"); -#endif - - if (filename) { - filename1 = (*env)->GetByteArrayElements(env, filename, NULL); - } - gtk_file_selection_set_filename((GtkFileSelection*)filesel, (gchar*)filename1); - if (filename) { - (*env)->ReleaseByteArrayElements(env, filename, filename1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_file_selection_get_filename - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1get_1filename - (JNIEnv *env, jclass that, jint filesel) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_file_selection_get_filename"); -#endif - - return (jint)gtk_file_selection_get_filename((GtkFileSelection*)filesel); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_file_selection_complete - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1file_1selection_1complete - (JNIEnv *env, jclass that, jint filesel, jbyteArray pattern) -{ - jbyte *pattern1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_file_selection_complete"); -#endif - - if (pattern) { - pattern1 = (*env)->GetByteArrayElements(env, pattern, NULL); - } - gtk_file_selection_complete((GtkFileSelection*)filesel, (gchar*)pattern1); - if (pattern) { - (*env)->ReleaseByteArrayElements(env, pattern, pattern1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_fixed_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1fixed_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_fixed_new"); -#endif - - return (jint)gtk_fixed_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_fixed_put - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1fixed_1put - (JNIEnv *env, jclass that, jint fixed, jint widget, jshort x, jshort y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_fixed_put"); -#endif - - gtk_fixed_put((GtkFixed*)fixed, (GtkWidget*)widget, (gint16)x, (gint16)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_fixed_move - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1fixed_1move - (JNIEnv *env, jclass that, jint fixed, jint widget, jshort x, jshort y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_fixed_move"); -#endif - - gtk_fixed_move((GtkFixed*)fixed, (GtkWidget*)widget, (gint16)x, (gint16)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_font_selection_set_font_name - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1set_1font_1name - (JNIEnv *env, jclass that, jint fontsel, jbyteArray fontname) -{ - jboolean rc; - jbyte *fontname1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_font_selection_set_font_name"); -#endif - - if (fontname) { - fontname1 = (*env)->GetByteArrayElements(env, fontname, NULL); - } - rc = (jboolean)gtk_font_selection_set_font_name((GtkFontSelection*)fontsel, (gchar*)fontname1); - if (fontname) { - (*env)->ReleaseByteArrayElements(env, fontname, fontname1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_font_selection_dialog_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1new - (JNIEnv *env, jclass that, jbyteArray title) -{ - jint rc; - jbyte *title1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_font_selection_dialog_new"); -#endif - - if (title) { - title1 = (*env)->GetByteArrayElements(env, title, NULL); - } - rc = (jint)gtk_font_selection_dialog_new((gchar*)title1); - if (title) { - (*env)->ReleaseByteArrayElements(env, title, title1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_font_selection_dialog_get_font_name - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1get_1font_1name - (JNIEnv *env, jclass that, jint fsd) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_font_selection_dialog_get_font_name"); -#endif - - return (jint)gtk_font_selection_dialog_get_font_name((GtkFontSelectionDialog*)fsd); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_font_selection_dialog_set_font_name - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1font_1selection_1dialog_1set_1font_1name - (JNIEnv *env, jclass that, jint fsd, jbyteArray fontname) -{ - jboolean rc; - jbyte *fontname1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_font_selection_dialog_set_font_name"); -#endif - - if (fontname) { - fontname1 = (*env)->GetByteArrayElements(env, fontname, NULL); - } - rc = (jboolean)gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog*)fsd, (gchar*)fontname1); - if (fontname) { - (*env)->ReleaseByteArrayElements(env, fontname, fontname1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_frame_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1new - (JNIEnv *env, jclass that, jbyteArray label) -{ - jint rc; - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_frame_new"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - rc = (jint)gtk_frame_new((gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_frame_set_label - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1set_1label - (JNIEnv *env, jclass that, jint frame, jbyteArray label) -{ - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_frame_set_label"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - gtk_frame_set_label((GtkFrame*)frame, (gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_frame_set_shadow_type - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1frame_1set_1shadow_1type - (JNIEnv *env, jclass that, jint frame, jint type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_frame_set_shadow_type"); -#endif - - gtk_frame_set_shadow_type((GtkFrame*)frame, (GtkShadowType)type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_hbox_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hbox_1new - (JNIEnv *env, jclass that, jboolean homogeneous, jint spacing) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_hbox_new"); -#endif - - return (jint)gtk_hbox_new((gboolean)homogeneous, (gint)spacing); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_hscale_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hscale_1new - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_hscale_new"); -#endif - - return (jint)gtk_hscale_new((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_hscrollbar_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hscrollbar_1new - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_hscrollbar_new"); -#endif - - return (jint)gtk_hscrollbar_new((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_hseparator_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1hseparator_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_hseparator_new"); -#endif - - return (jint)gtk_hseparator_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1new - (JNIEnv *env, jclass that, jbyteArray str) -{ - jint rc; - jbyte *str1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_new"); -#endif - - if (str) { - str1 = (*env)->GetByteArrayElements(env, str, NULL); - } - rc = (jint)gtk_label_new((gchar*)str1); - if (str) { - (*env)->ReleaseByteArrayElements(env, str, str1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_set_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1text - (JNIEnv *env, jclass that, jint label, jbyteArray str) -{ - jbyte *str1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_set_text"); -#endif - - if (str) { - str1 = (*env)->GetByteArrayElements(env, str, NULL); - } - gtk_label_set_text((GtkLabel*)label, (gchar*)str1); - if (str) { - (*env)->ReleaseByteArrayElements(env, str, str1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_set_justify - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1justify - (JNIEnv *env, jclass that, jint label, jint jtype) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_set_justify"); -#endif - - gtk_label_set_justify((GtkLabel*)label, (GtkJustification)jtype); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_set_pattern - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1pattern - (JNIEnv *env, jclass that, jint label, jbyteArray pattern) -{ - jbyte *pattern1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_set_pattern"); -#endif - - if (pattern) { - pattern1 = (*env)->GetByteArrayElements(env, pattern, NULL); - } - gtk_label_set_pattern((GtkLabel*)label, (gchar*)pattern1); - if (pattern) { - (*env)->ReleaseByteArrayElements(env, pattern, pattern1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_set_line_wrap - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1set_1line_1wrap - (JNIEnv *env, jclass that, jint label, jboolean wrap) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_set_line_wrap"); -#endif - - gtk_label_set_line_wrap((GtkLabel*)label, (gboolean)wrap); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_label_parse_uline - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1label_1parse_1uline - (JNIEnv *env, jclass that, jint label, jbyteArray string) -{ - jint rc; - jbyte *string1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_label_parse_uline"); -#endif - - if (string) { - string1 = (*env)->GetByteArrayElements(env, string, NULL); - } - rc = (jint)gtk_label_parse_uline((GtkLabel*)label, (gchar*)string1); - if (string) { - (*env)->ReleaseByteArrayElements(env, string, string1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_list_clear_items - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1list_1clear_1items - (JNIEnv *env, jclass that, jint list, jint start, jint end) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_list_clear_items"); -#endif - - gtk_list_clear_items((GtkList*)list, (gint)start, (gint)end); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_list_select_item - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1list_1select_1item - (JNIEnv *env, jclass that, jint list, jint item) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_list_select_item"); -#endif - - gtk_list_select_item((GtkList*)list, (gint)item); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_check_version - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1check_1version - (JNIEnv *env, jclass that, jint required_major, jint required_minor, jint required_micro) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_check_version"); -#endif - - return (jint)gtk_check_version(required_major, required_minor, required_micro); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_init_check - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1init_1check - (JNIEnv *env, jclass that, jintArray argc, jintArray argv) -{ - jboolean rc; - jint *argc1 = NULL; - jint *argv1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_init_check"); -#endif - - if (argc) { - argc1 = (*env)->GetIntArrayElements(env, argc, NULL); - } - if (argv) { - argv1 = (*env)->GetIntArrayElements(env, argv, NULL); - } - rc = (jboolean)gtk_init_check((int*)argc1, (char***)argv1); - if (argc) { - (*env)->ReleaseIntArrayElements(env, argc, argc1, 0); - } - if (argv) { - (*env)->ReleaseIntArrayElements(env, argv, argv1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_events_pending - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1events_1pending - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_events_pending"); -#endif - - return (jint)gtk_events_pending(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_main - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_main"); -#endif - - gtk_main(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_main_quit - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main_1quit - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_main_quit"); -#endif - - gtk_main_quit(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_main_iteration - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1main_1iteration - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_main_iteration"); -#endif - - return (jint)gtk_main_iteration(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_grab_add - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1add - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_grab_add"); -#endif - - gtk_grab_add((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_grab_get_current - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1get_1current - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_grab_get_current"); -#endif - - return (jint)gtk_grab_get_current(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_grab_remove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1grab_1remove - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_grab_remove"); -#endif - - gtk_grab_remove((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_timeout_add - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1timeout_1add - (JNIEnv *env, jclass that, jint interval, jint function, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_timeout_add"); -#endif - - return (jint)gtk_timeout_add((guint32)interval, (GtkFunction)function, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_timeout_remove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1timeout_1remove - (JNIEnv *env, jclass that, jint timeout_handler_id) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_timeout_remove"); -#endif - - gtk_timeout_remove(timeout_handler_id); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_new"); -#endif - - return (jint)gtk_menu_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_insert - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1insert - (JNIEnv *env, jclass that, jint menu, jint child, jint position) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_insert"); -#endif - - gtk_menu_insert((GtkMenu*)menu, (GtkWidget*)child, (gint)position); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_popup - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1popup - (JNIEnv *env, jclass that, jint menu, jint parent_menu_shell, jint parent_menu_item, jint func, jint data, jint button, jint activate_time) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_popup"); -#endif - - gtk_menu_popup((GtkMenu*)menu, (GtkWidget*)parent_menu_shell, (GtkWidget*)parent_menu_item, (GtkMenuPositionFunc)func, (gpointer)data, button, (guint32)activate_time); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_popdown - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1popdown - (JNIEnv *env, jclass that, jint menu) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_popdown"); -#endif - - gtk_menu_popdown((GtkMenu*)menu); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_bar_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1bar_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_bar_new"); -#endif - - return (jint)gtk_menu_bar_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_bar_insert - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1bar_1insert - (JNIEnv *env, jclass that, jint menu_bar, jint child, jint position) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_bar_insert"); -#endif - - gtk_menu_bar_insert((GtkMenuBar*)menu_bar, (GtkWidget*)child, (gint)position); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_item_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_item_new"); -#endif - - return (jint)gtk_menu_item_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_item_new_with_label - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1new_1with_1label - (JNIEnv *env, jclass that, jbyteArray label) -{ - jint rc; - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_item_new_with_label"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - rc = (jint)gtk_menu_item_new_with_label((gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_item_set_submenu - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1set_1submenu - (JNIEnv *env, jclass that, jint menu_item, jint submenu) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_item_set_submenu"); -#endif - - gtk_menu_item_set_submenu((GtkMenuItem*)menu_item, (GtkWidget*)submenu); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_menu_item_remove_submenu - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1remove_1submenu - (JNIEnv *env, jclass that, jint menu_item) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_menu_item_remove_submenu"); -#endif - - gtk_menu_item_remove_submenu((GtkMenuItem*)menu_item); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_misc_set_alignment - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1misc_1set_1alignment - (JNIEnv *env, jclass that, jint misc, jfloat xalign, jfloat yalign) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_misc_set_alignment"); -#endif - - gtk_misc_set_alignment((GtkMisc*)misc, xalign, yalign); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_new"); -#endif - - return (jint)gtk_notebook_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_append_page - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1append_1page - (JNIEnv *env, jclass that, jint notebook, jint child, jint tab_label) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_append_page"); -#endif - - gtk_notebook_append_page((GtkNotebook*)notebook, (GtkWidget*)child, (GtkWidget*)tab_label); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_remove_page - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1remove_1page - (JNIEnv *env, jclass that, jint notebook, jint page_num) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_remove_page"); -#endif - - gtk_notebook_remove_page((GtkNotebook*)notebook, (gint)page_num); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_get_current_page - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1get_1current_1page - (JNIEnv *env, jclass that, jint notebook) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_get_current_page"); -#endif - - return (jint)gtk_notebook_get_current_page((GtkNotebook*)notebook); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_set_page - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1set_1page - (JNIEnv *env, jclass that, jint notebook, jint page_num) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_set_page"); -#endif - - gtk_notebook_set_page((GtkNotebook*)notebook, (gint)page_num); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_notebook_set_show_tabs - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1set_1show_1tabs - (JNIEnv *env, jclass that, jint notebook, jboolean show_tabs) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_notebook_set_show_tabs"); -#endif - - gtk_notebook_set_show_tabs((GtkNotebook*)notebook, (gboolean)show_tabs); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_object_ref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1ref - (JNIEnv *env, jclass that, jint object) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_ref"); -#endif - - gtk_object_ref((GtkObject*)object); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_object_set_user_data - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1set_1user_1data - (JNIEnv *env, jclass that, jint object, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_set_user_data"); -#endif - - gtk_object_set_user_data((GtkObject*)object, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_object_get_user_data - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1get_1user_1data - (JNIEnv *env, jclass that, jint object) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_object_get_user_data"); -#endif - - return (jint)gtk_object_get_user_data((GtkObject*)object); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_pixmap_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1pixmap_1new - (JNIEnv *env, jclass that, jint pixmap, jint mask) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_pixmap_new"); -#endif - - return (jint)gtk_pixmap_new((GdkPixmap*)pixmap, (GdkBitmap*)mask); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_pixmap_set - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1pixmap_1set - (JNIEnv *env, jclass that, jint pixmap, jint val, jint mask) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_pixmap_set"); -#endif - - gtk_pixmap_set((GtkPixmap*)pixmap, (GdkPixmap*)val, (GdkBitmap*)mask); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_progress_configure - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1configure - (JNIEnv *env, jclass that, jint progress, jfloat value, jfloat min, jfloat max) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_progress_configure"); -#endif - - gtk_progress_configure((GtkProgress*)progress, value, min, max); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_progress_bar_new_with_adjustment - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_progress_bar_new"); -#endif - - return (jint)gtk_progress_bar_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_progress_bar_set_bar_style - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1set_1bar_1style - (JNIEnv *env, jclass that, jint pbar, jint style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_progress_bar_set_bar_style"); -#endif - - gtk_progress_bar_set_bar_style((GtkProgressBar*)pbar, (GtkProgressBarStyle)style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_progress_bar_set_orientation - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1set_1orientation - (JNIEnv *env, jclass that, jint pbar, jint orientation) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_progress_bar_set_orientation"); -#endif - - gtk_progress_bar_set_orientation((GtkProgressBar*)pbar, (GtkProgressBarOrientation)orientation); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_radio_button_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1button_1new - (JNIEnv *env, jclass that, jint group) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_radio_button_new"); -#endif - - return (jint)gtk_radio_button_new((GSList*)group); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_radio_button_group - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1button_1group - (JNIEnv *env, jclass that, jint radio_button) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_radio_button_group"); -#endif - - return (jint)gtk_radio_button_group((GtkRadioButton*)radio_button); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_radio_menu_item_new_with_label - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1menu_1item_1new_1with_1label - (JNIEnv *env, jclass that, jint group, jbyteArray label) -{ - jint rc; - jbyte *label1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_radio_menu_item_new_with_label"); -#endif - - if (label) { - label1 = (*env)->GetByteArrayElements(env, label, NULL); - } - rc = (jint)gtk_radio_menu_item_new_with_label((GSList*)group, (gchar*)label1); - if (label) { - (*env)->ReleaseByteArrayElements(env, label, label1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_range_get_adjustment - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1range_1get_1adjustment - (JNIEnv *env, jclass that, jint range) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_range_get_adjustment"); -#endif - - return (jint)gtk_range_get_adjustment((GtkRange*)range); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scale_set_digits - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1digits - (JNIEnv *env, jclass that, jint scale, jint digits) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scale_set_digits"); -#endif - - gtk_scale_set_digits((GtkScale*)scale, (gint)digits); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scale_set_draw_value - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1draw_1value - (JNIEnv *env, jclass that, jint scale, jboolean draw_value) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scale_set_draw_value"); -#endif - - gtk_scale_set_draw_value((GtkScale*)scale, (gboolean)draw_value); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scale_set_value_pos - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1value_1pos - (JNIEnv *env, jclass that, jint scale, jint pos) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scale_set_value_pos"); -#endif - - gtk_scale_set_value_pos((GtkScale*)scale, (GtkPositionType)pos); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scrolled_window_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1new - (JNIEnv *env, jclass that, jint hadjustment, jint vadjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scrolled_window_new"); -#endif - - return (jint)gtk_scrolled_window_new((GtkAdjustment*)hadjustment, (GtkAdjustment*)vadjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scrolled_window_get_hadjustment - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1get_1hadjustment - (JNIEnv *env, jclass that, jint scrolled_window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scrolled_window_get_hadjustment"); -#endif - - return (jint)gtk_scrolled_window_get_hadjustment((GtkScrolledWindow*)scrolled_window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scrolled_window_get_vadjustment - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1get_1vadjustment - (JNIEnv *env, jclass that, jint scrolled_window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scrolled_window_get_vadjustment"); -#endif - - return (jint)gtk_scrolled_window_get_vadjustment((GtkScrolledWindow*)scrolled_window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_scrolled_window_set_policy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1set_1policy - (JNIEnv *env, jclass that, jint scrolled_window, jint hscrollbar_policy, jint vscrollbar_policy) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_scrolled_window_set_policy"); -#endif - - gtk_scrolled_window_set_policy((GtkScrolledWindow*)scrolled_window, (GtkPolicyType)hscrollbar_policy, (GtkPolicyType)vscrollbar_policy); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_selection_owner_set - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1selection_1owner_1set - (JNIEnv *env, jclass that, jint widget, jint selection, jint time) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_selection_owner_set"); -#endif - - return (jint)gtk_selection_owner_set((GtkWidget*)widget, (GdkAtom)selection, (guint32)time); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_selection_convert - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1selection_1convert - (JNIEnv *env, jclass that, jint widget, jint selection, jint target, jint time) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_selection_convert"); -#endif - - return (jint)gtk_selection_convert((GtkWidget*)widget, (GdkAtom)selection, (GdkAtom)target, (guint32)time); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_signal_emit_stop_by_name - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1emit_1stop_1by_1name - (JNIEnv *env, jclass that, jint object, jbyteArray name) -{ - jbyte *name1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_emit_stop_by_name"); -#endif - - if (name) { - name1 = (*env)->GetByteArrayElements(env, name, NULL); - } - gtk_signal_emit_stop_by_name((GtkObject*)object, (gchar*)name1); - if (name) { - (*env)->ReleaseByteArrayElements(env, name, name1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_signal_connect - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1connect - (JNIEnv *env, jclass that, jint object, jbyteArray name, jint func, jint func_data) -{ - jint rc; - jbyte *name1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_connect"); -#endif - - if (name) { - name1 = (*env)->GetByteArrayElements(env, name, NULL); - } - rc = (jint)gtk_signal_connect((GtkObject*)object, (gchar*)name1, (GtkSignalFunc)func, (gpointer)func_data); - if (name) { - (*env)->ReleaseByteArrayElements(env, name, name1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_signal_connect_after - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1connect_1after - (JNIEnv *env, jclass that, jint object, jbyteArray name, jint func, jint func_data) -{ - jint rc; - jbyte *name1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_connect_after"); -#endif - - if (name) { - name1 = (*env)->GetByteArrayElements(env, name, NULL); - } - rc = (jint)gtk_signal_connect_after((GtkObject*)object, (gchar*)name1, (GtkSignalFunc)func, (gpointer)func_data); - if (name) { - (*env)->ReleaseByteArrayElements(env, name, name1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_signal_handler_block_by_func - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1block_1by_1func - (JNIEnv *env, jclass that, jint object, jint func, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_handler_block_by_func"); -#endif - - gtk_signal_handler_block_by_func((GtkObject*)object, (GtkSignalFunc)func, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_signal_handler_unblock_by_func - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1unblock_1by_1func - (JNIEnv *env, jclass that, jint object, jint func, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_signal_handler_unblock_by_func"); -#endif - - gtk_signal_handler_unblock_by_func((GtkObject*)object, (GtkSignalFunc)func, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_style_copy - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1style_1copy - (JNIEnv *env, jclass that, jint style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_style_copy"); -#endif - - return (jint)gtk_style_copy((GtkStyle*)style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_style_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1style_1unref - (JNIEnv *env, jclass that, jint style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_style_unref"); -#endif - - gtk_style_unref((GtkStyle*)style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_text_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1new - (JNIEnv *env, jclass that, jint hadj, jint vadj) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_text_new"); -#endif - - return (jint)gtk_text_new((GtkAdjustment*)hadj, (GtkAdjustment*)vadj); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_text_set_word_wrap - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1set_1word_1wrap - (JNIEnv *env, jclass that, jint text, jint word_wrap) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_text_set_word_wrap"); -#endif - - gtk_text_set_word_wrap((GtkText*)text, (gint)word_wrap); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_text_get_length - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1get_1length - (JNIEnv *env, jclass that, jint text) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_text_get_length"); -#endif - - return (jint)gtk_text_get_length((GtkText*)text); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toggle_button_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toggle_button_new"); -#endif - - return (jint)gtk_toggle_button_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toggle_button_set_active - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1set_1active - (JNIEnv *env, jclass that, jint toggle_button, jboolean is_active) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toggle_button_set_active"); -#endif - - gtk_toggle_button_set_active((GtkToggleButton*)toggle_button, (gboolean)is_active); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toggle_button_get_active - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1get_1active - (JNIEnv *env, jclass that, jint toggle_button) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toggle_button_get_active"); -#endif - - return (jboolean)gtk_toggle_button_get_active((GtkToggleButton*)toggle_button); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toolbar_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1new - (JNIEnv *env, jclass that, jint orientation, jint style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toolbar_new"); -#endif - - return (jint)gtk_toolbar_new((GtkOrientation)orientation, (GtkToolbarStyle)style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toolbar_insert_element - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1insert_1element - (JNIEnv *env, jclass that, jint toolbar, jint type, jint widget, jbyteArray text, jbyteArray tooltip_text, jbyteArray tooltip_private_text, jint icon, jint callback, jint user_data, jint position) -{ - jint rc; - jbyte *text1 = NULL; - jbyte *tooltip_text1 = NULL; - jbyte *tooltip_private_text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toolbar_insert_element"); -#endif - - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - if (tooltip_text) { - tooltip_text1 = (*env)->GetByteArrayElements(env, tooltip_text, NULL); - } - if (tooltip_private_text) { - tooltip_private_text1 = (*env)->GetByteArrayElements(env, tooltip_private_text, NULL); - } - rc = (jint)gtk_toolbar_insert_element((GtkToolbar*)toolbar, (GtkToolbarChildType)type, (GtkWidget*)widget, (char*)text1, (char*)tooltip_text1, (char*)tooltip_private_text1, (GtkWidget*)icon, (GtkSignalFunc)callback, (gpointer)user_data, (gint)position); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } - if (tooltip_text) { - (*env)->ReleaseByteArrayElements(env, tooltip_text, tooltip_text1, 0); - } - if (tooltip_private_text) { - (*env)->ReleaseByteArrayElements(env, tooltip_private_text, tooltip_private_text1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toolbar_insert_widget - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1insert_1widget - (JNIEnv *env, jclass that, jint toolbar, jint widget, jbyteArray tooltip_text, jbyteArray tooltip_private_text, jint position) -{ - jbyte *tooltip_text1 = NULL; - jbyte *tooltip_private_text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toolbar_insert_widget"); -#endif - - if (tooltip_text) { - tooltip_text1 = (*env)->GetByteArrayElements(env, tooltip_text, NULL); - } - if (tooltip_private_text) { - tooltip_private_text1 = (*env)->GetByteArrayElements(env, tooltip_private_text, NULL); - } - gtk_toolbar_insert_widget((GtkToolbar*)toolbar, (GtkWidget*)widget, (char*)tooltip_text1, (char*)tooltip_private_text1, (gint)position); - if (tooltip_text) { - (*env)->ReleaseByteArrayElements(env, tooltip_text, tooltip_text1, 0); - } - if (tooltip_private_text) { - (*env)->ReleaseByteArrayElements(env, tooltip_private_text, tooltip_private_text1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toolbar_set_orientation - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1set_1orientation - (JNIEnv *env, jclass that, jint toolbar, jint orientation) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toolbar_set_orientation"); -#endif - - gtk_toolbar_set_orientation((GtkToolbar*)toolbar, (GtkOrientation)orientation); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_toolbar_set_button_relief - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1set_1button_1relief - (JNIEnv *env, jclass that, jint toolbar, jint relief) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_toolbar_set_button_relief"); -#endif - - gtk_toolbar_set_button_relief((GtkToolbar*)toolbar, (GtkReliefStyle)relief); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_tooltips_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1tooltips_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_tooltips_new"); -#endif - - return (jint)gtk_tooltips_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_tooltips_set_tip - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1tooltips_1set_1tip - (JNIEnv *env, jclass that, jint tooltips, jint widget, jbyteArray tip_text, jbyteArray tip_private) -{ - jbyte *tip_text1 = NULL; - jbyte *tip_private1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_tooltips_set_tip"); -#endif - - if (tip_text) { - tip_text1 = (*env)->GetByteArrayElements(env, tip_text, NULL); - } - if (tip_private) { - tip_private1 = (*env)->GetByteArrayElements(env, tip_private, NULL); - } - gtk_tooltips_set_tip((GtkTooltips*)tooltips, (GtkWidget*)widget, (gchar*)tip_text1, (gchar*)tip_private1); - if (tip_text) { - (*env)->ReleaseByteArrayElements(env, tip_text, tip_text1, 0); - } - if (tip_private) { - (*env)->ReleaseByteArrayElements(env, tip_private, tip_private1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_vbox_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vbox_1new - (JNIEnv *env, jclass that, jboolean homogeneous, jint spacing) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_vbox_new"); -#endif - - return (jint)gtk_vbox_new((gboolean)homogeneous, (gint)spacing); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_vscale_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vscale_1new - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_vscale_new"); -#endif - - return (jint)gtk_vscale_new((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_vscrollbar_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vscrollbar_1new - (JNIEnv *env, jclass that, jint adjustment) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_vscrollbar_new"); -#endif - - return (jint)gtk_vscrollbar_new((GtkAdjustment*)adjustment); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_vseparator_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vseparator_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_vseparator_new"); -#endif - - return (jint)gtk_vseparator_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_destroy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1destroy - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_destroy"); -#endif - - gtk_widget_destroy((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_show - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_show"); -#endif - - gtk_widget_show((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_show_now - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show_1now - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_show_now"); -#endif - - gtk_widget_show_now((GtkWidget*)widget); -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1show_1all - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_show_all"); -#endif - - gtk_widget_show_all((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_hide - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1hide - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_hide"); -#endif - - gtk_widget_hide((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_realize - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1realize - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_realize"); -#endif - - gtk_widget_realize((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_queue_draw - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1queue_1draw - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_queue_draw"); -#endif - - gtk_widget_queue_draw((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_size_request - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1size_1request - (JNIEnv *env, jclass that, jint widget, jobject requisition) -{ - DECL_GLOB(pGlob) - GtkRequisition requisition_struct, *requisition1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_size_request"); -#endif - - if (requisition) { - requisition1 = &requisition_struct; - cacheGtkRequisitionFids(env, requisition, &PGLOB(GtkRequisitionFc)); - getGtkRequisitionFields(env, requisition, requisition1, &PGLOB(GtkRequisitionFc)); - } - gtk_widget_size_request((GtkWidget*)widget, (GtkRequisition*)requisition1); - if (requisition) { - setGtkRequisitionFields(env, requisition, requisition1, &PGLOB(GtkRequisitionFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_size_allocate - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1size_1allocate - (JNIEnv *env, jclass that, jint widget, jobject allocation) -{ - DECL_GLOB(pGlob) - GtkAllocation allocation_struct, *allocation1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_size_allocate"); -#endif - - if (allocation) { - allocation1 = &allocation_struct; - cacheGtkAllocationFids(env, allocation, &PGLOB(GtkAllocationFc)); - getGtkAllocationFields(env, allocation, allocation1, &PGLOB(GtkAllocationFc)); - } - gtk_widget_size_allocate((GtkWidget*)widget, (GtkAllocation*)allocation1); - if (allocation) { - setGtkAllocationFields(env, allocation, allocation1, &PGLOB(GtkAllocationFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_add_accelerator - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1add_1accelerator - (JNIEnv *env, jclass that, jint widget, jbyteArray accel_signal, jint accel_group, jint accel_key, jint accel_mods, jint accel_flags) -{ - jbyte *accel_signal1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_add_accelerator"); -#endif - - if (accel_signal) { - accel_signal1 = (*env)->GetByteArrayElements(env, accel_signal, NULL); - } - gtk_widget_add_accelerator((GtkWidget*)widget, (gchar*)accel_signal1, (GtkAccelGroup*)accel_group, accel_key, accel_mods, (GtkAccelFlags)accel_flags); - if (accel_signal) { - (*env)->ReleaseByteArrayElements(env, accel_signal, accel_signal1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_remove_accelerator - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1remove_1accelerator - (JNIEnv *env, jclass that, jint widget, jint accel_group, jint accel_key, jint accel_mods) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_remove_accelerator"); -#endif - - gtk_widget_remove_accelerator((GtkWidget*)widget, (GtkAccelGroup*)accel_group, accel_key, accel_mods); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_event - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1event - (JNIEnv *env, jclass that, jint widget, jint event) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_event"); -#endif - - return (jint)gtk_widget_event((GtkWidget*)widget, (GdkEvent*)event); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_reparent - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1reparent - (JNIEnv *env, jclass that, jint widget, jint new_parent) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_reparent"); -#endif - - gtk_widget_reparent((GtkWidget*)widget, (GtkWidget*)new_parent); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_grab_focus - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1grab_1focus - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_grab_focus"); -#endif - - gtk_widget_grab_focus((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_state - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1state - (JNIEnv *env, jclass that, jint widget, jint state) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_state"); -#endif - - gtk_widget_set_state((GtkWidget*)widget, (GtkStateType)state); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_sensitive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1sensitive - (JNIEnv *env, jclass that, jint widget, jboolean sensitive) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_sensitive"); -#endif - - gtk_widget_set_sensitive((GtkWidget*)widget, (gboolean)sensitive); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_parent - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1parent - (JNIEnv *env, jclass that, jint widget, jint parent) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_parent"); -#endif - - gtk_widget_set_parent((GtkWidget*)widget, (GtkWidget*)parent); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_uposition - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1uposition - (JNIEnv *env, jclass that, jint widget, jint x, jint y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_uposition"); -#endif - - gtk_widget_set_uposition((GtkWidget*)widget, (gint)x, (gint)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_usize - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1usize - (JNIEnv *env, jclass that, jint widget, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_usize"); -#endif - - gtk_widget_set_usize((GtkWidget*)widget, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_add_events - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1add_1events - (JNIEnv *env, jclass that, jint widget, jint events) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_add_events"); -#endif - - gtk_widget_add_events((GtkWidget*)widget, (gint)events); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_set_style - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1set_1style - (JNIEnv *env, jclass that, jint widget, jint style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_set_style"); -#endif - - gtk_widget_set_style((GtkWidget*)widget, (GtkStyle*)style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_ensure_style - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1ensure_1style - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_ensure_style"); -#endif - - gtk_widget_ensure_style((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_get_style - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1get_1style - (JNIEnv *env, jclass that, jint widget) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_get_style"); -#endif - - return (jint)gtk_widget_get_style((GtkWidget*)widget); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_widget_get_default_style - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1widget_1get_1default_1style - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_widget_get_default_style"); -#endif - - return (jint)gtk_widget_get_default_style(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_window_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1new - (JNIEnv *env, jclass that, jint type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_new"); -#endif - - return (jint)gtk_window_new((GtkWindowType)type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_window_set_title - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1title - (JNIEnv *env, jclass that, jint window, jbyteArray title) -{ - jbyte *title1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_set_title"); -#endif - - if (title) { - title1 = (*env)->GetByteArrayElements(env, title, NULL); - } - gtk_window_set_title((GtkWindow*)window, (gchar*)title1); - if (title) { - (*env)->ReleaseByteArrayElements(env, title, title1, 0); - } -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1transient_1for - (JNIEnv *env, jclass that, jint window, jint parent) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_set_transient_for"); -#endif - gtk_window_set_transient_for((GtkWindow*)window, (GtkWindow*)parent); -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1modal - (JNIEnv *env, jclass that, jint window, jboolean modal) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_set_modal"); -#endif - gtk_window_set_modal((GtkWindow*)window, modal); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_window_set_policy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1set_1policy - (JNIEnv *env, jclass that, jint window, jint allow_shrink, jint allow_grow, jint auto_shrink) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_set_policy"); -#endif - - gtk_window_set_policy((GtkWindow*)window, (gint)allow_shrink, (gint)allow_grow, (gint)auto_shrink); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_window_add_accel_group - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1window_1add_1accel_1group - (JNIEnv *env, jclass that, jint window, jint accel_group) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_window_add_accel_group"); -#endif - - gtk_window_add_accel_group((GtkWindow*)window, (GtkAccelGroup*)accel_group); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_event_get - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_event_get"); -#endif - - return (jint)gdk_event_get(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_event_get_graphics_expose - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1get_1graphics_1expose - (JNIEnv *env, jclass that, jint window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_event_get_graphics_expose"); -#endif - - return (jint)gdk_event_get_graphics_expose((GdkWindow*)window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_event_free - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1event_1free - (JNIEnv *env, jclass that, jint event) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_event_free"); -#endif - - gdk_event_free((GdkEvent*)event); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_time_get - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1time_1get - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_time_get"); -#endif - - return (jint)gdk_time_get(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_screen_width - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1width - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_screen_width"); -#endif - - return (jint)gdk_screen_width(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_screen_height - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1height - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_screen_height"); -#endif - - return (jint)gdk_screen_height(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_screen_width_mm - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1screen_1width_1mm - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_screen_width_mm"); -#endif - - return (jint)gdk_screen_width_mm(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_flush - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1flush - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_flush"); -#endif - - gdk_flush(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_beep - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1beep - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_beep"); -#endif - - gdk_beep(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_visual_get_system - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1visual_1get_1system - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_visual_get_system"); -#endif - - return (jint)gdk_visual_get_system(); -} - - -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1pixtext - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jintArray text, jintArray spacing, jintArray pixmap, jintArray mask) -{ - jint *text1 = NULL; - jint *spacing1 = NULL; - jint *pixmap1 = NULL; - jint *mask1 = NULL; - int rc; - - if (text) text1 = (*env)->GetIntArrayElements(env, text, NULL); - if (spacing) spacing1 = (*env)->GetIntArrayElements(env, spacing, NULL); - if (pixmap) pixmap1 = (*env)->GetIntArrayElements(env, pixmap, NULL); - if (mask) mask1 = (*env)->GetIntArrayElements(env, mask, NULL); - rc = gtk_clist_get_pixtext((GtkCList*)clist, row, column, (gchar**)text1, (guint8*)spacing1, (GdkPixmap**)pixmap1, (GdkBitmap**)mask1); - if (text) (*env)->ReleaseIntArrayElements(env, text, text1, 0); - if (spacing) (*env)->ReleaseIntArrayElements(env, spacing, spacing1, 0); - if (pixmap) (*env)->ReleaseIntArrayElements(env, pixmap, pixmap1, 0); - if (mask) (*env)->ReleaseIntArrayElements(env, mask, mask1, 0); - - return (jint) rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_at_pointer - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1at_1pointer - (JNIEnv *env, jclass that, jintArray win_x, jintArray win_y) -{ - jint rc; - jint *win_x1 = NULL; - jint *win_y1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_at_pointer"); -#endif - - if (win_x) { - win_x1 = (*env)->GetIntArrayElements(env, win_x, NULL); - } - if (win_y) { - win_y1 = (*env)->GetIntArrayElements(env, win_y, NULL); - } - rc = (jint)gdk_window_at_pointer((gint*)win_x1, (gint*)win_y1); - if (win_x) { - (*env)->ReleaseIntArrayElements(env, win_x, win_x1, 0); - } - if (win_y) { - (*env)->ReleaseIntArrayElements(env, win_y, win_y1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_clear_area - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1clear_1area - (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_clear_area"); -#endif - - gdk_window_clear_area((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1resize - (JNIEnv *env, jclass that, jint window, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_resize"); -#endif - - gdk_window_resize((GdkWindow*)window, (gint)width, (gint)height); -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1move - (JNIEnv *env, jclass that, jint window, jint x, jint y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_move"); -#endif - - gdk_window_move((GdkWindow*)window, (gint)x, (gint)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_clear_area_e - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1clear_1area_1e - (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_clear_area_e"); -#endif - - gdk_window_clear_area_e((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_copy_area - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1copy_1area - (JNIEnv *env, jclass that, jint window, jint gc, jint x, jint y, jint source_window, jint source_x, jint source_y, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_copy_area"); -#endif - - gdk_window_copy_area((GdkWindow*)window, (GdkGC*)gc, (gint)x, (gint)y, (GdkWindow*)source_window, (gint)source_x, (gint)source_y, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_raise - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1raise - (JNIEnv *env, jclass that, jint window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_raise"); -#endif - - gdk_window_raise((GdkWindow*)window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_lower - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1lower - (JNIEnv *env, jclass that, jint window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_lower"); -#endif - - gdk_window_lower((GdkWindow*)window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_set_user_data - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1user_1data - (JNIEnv *env, jclass that, jint window, jint user_data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_set_user_data"); -#endif - - gdk_window_set_user_data((GdkWindow*)window, (gpointer)user_data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_set_cursor - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1cursor - (JNIEnv *env, jclass that, jint window, jint cursor) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_set_cursor"); -#endif - - gdk_window_set_cursor((GdkWindow*)window, (GdkCursor*)cursor); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_get_user_data - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1user_1data - (JNIEnv *env, jclass that, jint window, jintArray data) -{ - jint *data1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_get_user_data"); -#endif - - if (data) { - data1 = (*env)->GetIntArrayElements(env, data, NULL); - } - gdk_window_get_user_data((GdkWindow*)window, (gpointer*)data1); - if (data) { - (*env)->ReleaseIntArrayElements(env, data, data1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_get_geometry - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1geometry - (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y, jintArray width, jintArray height, jintArray depth) -{ - jint *x1 = NULL; - jint *y1 = NULL; - jint *width1 = NULL; - jint *height1 = NULL; - jint *depth1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_get_geometry"); -#endif - - if (x) { - x1 = (*env)->GetIntArrayElements(env, x, NULL); - } - if (y) { - y1 = (*env)->GetIntArrayElements(env, y, NULL); - } - if (width) { - width1 = (*env)->GetIntArrayElements(env, width, NULL); - } - if (height) { - height1 = (*env)->GetIntArrayElements(env, height, NULL); - } - if (depth) { - depth1 = (*env)->GetIntArrayElements(env, depth, NULL); - } - gdk_window_get_geometry((GdkWindow*)window, (gint*)x1, (gint*)y1, (gint*)width1, (gint*)height1, (gint*)depth1); - if (x) { - (*env)->ReleaseIntArrayElements(env, x, x1, 0); - } - if (y) { - (*env)->ReleaseIntArrayElements(env, y, y1, 0); - } - if (width) { - (*env)->ReleaseIntArrayElements(env, width, width1, 0); - } - if (height) { - (*env)->ReleaseIntArrayElements(env, height, height1, 0); - } - if (depth) { - (*env)->ReleaseIntArrayElements(env, depth, depth1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_get_origin - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1origin - (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y) -{ - jint rc; - jint *x1 = NULL; - jint *y1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_get_origin"); -#endif - - if (x) { - x1 = (*env)->GetIntArrayElements(env, x, NULL); - } - if (y) { - y1 = (*env)->GetIntArrayElements(env, y, NULL); - } - rc = (jint)gdk_window_get_origin((GdkWindow*)window, (gint*)x1, (gint*)y1); - if (x) { - (*env)->ReleaseIntArrayElements(env, x, x1, 0); - } - if (y) { - (*env)->ReleaseIntArrayElements(env, y, y1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_get_pointer - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1get_1pointer - (JNIEnv *env, jclass that, jint window, jintArray x, jintArray y, jint mask) -{ - jint rc; - jint *x1 = NULL; - jint *y1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_get_pointer"); -#endif - - if (x) { - x1 = (*env)->GetIntArrayElements(env, x, NULL); - } - if (y) { - y1 = (*env)->GetIntArrayElements(env, y, NULL); - } - rc = (jint)gdk_window_get_pointer((GdkWindow*)window, (gint*)x1, (gint*)y1, (GdkModifierType*)mask); - if (x) { - (*env)->ReleaseIntArrayElements(env, x, x1, 0); - } - if (y) { - (*env)->ReleaseIntArrayElements(env, y, y1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_set_icon - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1icon - (JNIEnv *env, jclass that, jint window, jint icon_window, jint pixmap, jint mask) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_set_icon"); -#endif - - gdk_window_set_icon((GdkWindow*)window, (GdkWindow*)icon_window, (GdkPixmap*)pixmap, (GdkBitmap*)mask); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_window_set_decorations - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1set_1decorations - (JNIEnv *env, jclass that, jint window, jint decorations) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_set_decorations"); -#endif - - gdk_window_set_decorations((GdkWindow*)window, (GdkWMDecoration)decorations); -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1window_1show - (JNIEnv *env, jclass that, jint window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_window_show"); -#endif - - gdk_window_show((GdkWindow*)window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_cursor_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1new - (JNIEnv *env, jclass that, jint cursor_type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_cursor_new"); -#endif - - return (jint)gdk_cursor_new((GdkCursorType)cursor_type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_cursor_new_from_pixmap - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1new_1from_1pixmap - (JNIEnv *env, jclass that, jint source, jint mask, jobject fg, jobject bg, jint x, jint y) -{ - DECL_GLOB(pGlob) - jint rc; - GdkColor fg_struct, *fg1 = NULL; - GdkColor bg_struct, *bg1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_cursor_new_from_pixmap"); -#endif - - if (fg) { - fg1 = &fg_struct; - cacheGdkColorFids(env, fg, &PGLOB(GdkColorFc)); - getGdkColorFields(env, fg, fg1, &PGLOB(GdkColorFc)); - } - if (bg) { - bg1 = &bg_struct; - cacheGdkColorFids(env, bg, &PGLOB(GdkColorFc)); - getGdkColorFields(env, bg, bg1, &PGLOB(GdkColorFc)); - } - rc = (jint)gdk_cursor_new_from_pixmap((GdkPixmap*)source, (GdkPixmap*)mask, (GdkColor*)fg1, (GdkColor*)bg1, (gint)x, (gint)y); - if (fg) { - setGdkColorFields(env, fg, fg1, &PGLOB(GdkColorFc)); - } - if (bg) { - setGdkColorFields(env, bg, bg1, &PGLOB(GdkColorFc)); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_cursor_destroy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1cursor_1destroy - (JNIEnv *env, jclass that, jint cursor) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_cursor_destroy"); -#endif - - gdk_cursor_destroy((GdkCursor*)cursor); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1new - (JNIEnv *env, jclass that, jint window) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_new"); -#endif - - return (jint)gdk_gc_new((GdkWindow*)window); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1unref - (JNIEnv *env, jclass that, jint gc) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_unref"); -#endif - - gdk_gc_unref((GdkGC*)gc); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_destroy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1destroy - (JNIEnv *env, jclass that, jint gc) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_destroy"); -#endif - - gdk_gc_destroy((GdkGC*)gc); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_get_values - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1get_1values - (JNIEnv *env, jclass that, jint gc, jobject values) -{ - DECL_GLOB(pGlob) - GdkGCValues values_struct, *values1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_get_values"); -#endif - - if (values) { - values1 = &values_struct; - cacheGdkGCValuesFids(env, values, &PGLOB(GdkGCValuesFc)); - getGdkGCValuesFields(env, values, values1, &PGLOB(GdkGCValuesFc)); - } - gdk_gc_get_values((GdkGC*)gc, (GdkGCValues*)values1); - if (values) { - setGdkGCValuesFields(env, values, values1, &PGLOB(GdkGCValuesFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_foreground - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1foreground - (JNIEnv *env, jclass that, jint gc, jobject color) -{ - DECL_GLOB(pGlob) - GdkColor color_struct, *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_foreground"); -#endif - - if (color) { - color1 = &color_struct; - cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); - getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - gdk_gc_set_foreground((GdkGC*)gc, (GdkColor*)color1); - if (color) { - setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_background - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1background - (JNIEnv *env, jclass that, jint gc, jobject color) -{ - DECL_GLOB(pGlob) - GdkColor color_struct, *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_background"); -#endif - - if (color) { - color1 = &color_struct; - cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); - getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - gdk_gc_set_background((GdkGC*)gc, (GdkColor*)color1); - if (color) { - setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_font - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1font - (JNIEnv *env, jclass that, jint gc, jint font) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_font"); -#endif - - gdk_gc_set_font((GdkGC*)gc, (GdkFont*)font); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_function - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1function - (JNIEnv *env, jclass that, jint gc, jint function) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_function"); -#endif - - gdk_gc_set_function((GdkGC*)gc, (GdkFunction)function); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_fill - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1fill - (JNIEnv *env, jclass that, jint gc, jint fill) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_fill"); -#endif - - gdk_gc_set_fill((GdkGC*)gc, (GdkFill)fill); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_stipple - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1stipple - (JNIEnv *env, jclass that, jint gc, jint stipple) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_stipple"); -#endif - - gdk_gc_set_stipple((GdkGC*)gc, (GdkPixmap*)stipple); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_clip_mask - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1mask - (JNIEnv *env, jclass that, jint gc, jint mask) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_clip_mask"); -#endif - - gdk_gc_set_clip_mask((GdkGC*)gc, (GdkBitmap*)mask); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_clip_rectangle - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1rectangle - (JNIEnv *env, jclass that, jint gc, jobject rectangle) -{ - DECL_GLOB(pGlob) - GdkRectangle rectangle_struct, *rectangle1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_clip_rectangle"); -#endif - - if (rectangle) { - rectangle1 = &rectangle_struct; - cacheGdkRectangleFids(env, rectangle, &PGLOB(GdkRectangleFc)); - getGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); - } - gdk_gc_set_clip_rectangle((GdkGC*)gc, (GdkRectangle*)rectangle1); - if (rectangle) { - setGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_clip_region - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1clip_1region - (JNIEnv *env, jclass that, jint gc, jint region) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_clip_region"); -#endif - - gdk_gc_set_clip_region((GdkGC*)gc, (GdkRegion*)region); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_subwindow - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1subwindow - (JNIEnv *env, jclass that, jint gc, jint mode) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_subwindow"); -#endif - - gdk_gc_set_subwindow((GdkGC*)gc, (GdkSubwindowMode)mode); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_exposures - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1exposures - (JNIEnv *env, jclass that, jint gc, jboolean exposures) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_exposures"); -#endif - - gdk_gc_set_exposures((GdkGC*)gc, (gboolean)exposures); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_line_attributes - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1line_1attributes - (JNIEnv *env, jclass that, jint gc, jint line_width, jint line_style, jint cap_style, jint join_style) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_line_attributes"); -#endif - - gdk_gc_set_line_attributes((GdkGC*)gc, (gint)line_width, (GdkLineStyle)line_style, (GdkCapStyle)cap_style, (GdkJoinStyle)join_style); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_gc_set_dashes - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1gc_1set_1dashes - (JNIEnv *env, jclass that, jint gc, jint dash_offset, jbyteArray dash_list, jint n) -{ - jbyte *dash_list1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_gc_set_dashes"); -#endif - - if (dash_list) { - dash_list1 = (*env)->GetByteArrayElements(env, dash_list, NULL); - } - gdk_gc_set_dashes((GdkGC*)gc, (gint)dash_offset, (gint8*)dash_list1, (gint)n); - if (dash_list) { - (*env)->ReleaseByteArrayElements(env, dash_list, dash_list1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_pixmap_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1pixmap_1new - (JNIEnv *env, jclass that, jint window, jint width, jint height, jint depth) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_pixmap_new"); -#endif - - return (jint)gdk_pixmap_new((GdkWindow*)window, (gint)width, (gint)height, (gint)depth); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_bitmap_create_from_data - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1bitmap_1create_1from_1data - (JNIEnv *env, jclass that, jint window, jbyteArray data, jint width, jint height) -{ - jint rc; - jbyte *data1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_bitmap_create_from_data"); -#endif - - if (data) { - data1 = (*env)->GetByteArrayElements(env, data, NULL); - } - rc = (jint)gdk_bitmap_create_from_data((GdkWindow*)window, (gchar*)data1, (gint)width, (gint)height); - if (data) { - (*env)->ReleaseByteArrayElements(env, data, data1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_pixmap_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1pixmap_1unref - (JNIEnv *env, jclass that, jint pixmap) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_pixmap_unref"); -#endif - - gdk_pixmap_unref((GdkPixmap*)pixmap); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_bitmap_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1bitmap_1unref - (JNIEnv *env, jclass that, jint pixmap) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_bitmap_unref"); -#endif - - gdk_bitmap_unref((GdkBitmap*)pixmap); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_image_get - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1image_1get - (JNIEnv *env, jclass that, jint window, jint x, jint y, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_image_get"); -#endif - - return (jint)gdk_image_get((GdkWindow*)window, (gint)x, (gint)y, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_image_get_pixel - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1image_1get_1pixel - (JNIEnv *env, jclass that, jint image, jint x, jint y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_image_get_pixel"); -#endif - - return (jint)gdk_image_get_pixel((GdkImage*)image, (gint)x, (gint)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_colormap_get_system - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1colormap_1get_1system - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_colormap_get_system"); -#endif - - return (jint)gdk_colormap_get_system(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_color_free - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1free - (JNIEnv *env, jclass that, jobject color) -{ - DECL_GLOB(pGlob) - GdkColor color_struct, *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_color_free"); -#endif - - if (color) { - color1 = &color_struct; - cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); - getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - gdk_color_free((GdkColor*)color1); - if (color) { - setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_colors_free - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1colors_1free - (JNIEnv *env, jclass that, jint colormap, jintArray pixels, jint npixels, jint planes) -{ - jint *pixels1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_colors_free"); -#endif - - if (pixels) { - pixels1 = (*env)->GetIntArrayElements(env, pixels, NULL); - } - gdk_colors_free((GdkColormap*)colormap, (gulong*)pixels1, (gint)npixels, (gulong)planes); - if (pixels) { - (*env)->ReleaseIntArrayElements(env, pixels, pixels1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_color_white - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1white - (JNIEnv *env, jclass that, jint colormap, jobject color) -{ - DECL_GLOB(pGlob) - jboolean rc; - GdkColor color_struct, *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_color_white"); -#endif - - if (color) { - color1 = &color_struct; - cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); - getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - rc = (jboolean)gdk_color_white((GdkColormap*)colormap, (GdkColor*)color1); - if (color) { - setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_color_alloc - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1color_1alloc - (JNIEnv *env, jclass that, jint colormap, jobject color) -{ - DECL_GLOB(pGlob) - jboolean rc; - GdkColor color_struct, *color1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_color_alloc"); -#endif - - if (color) { - color1 = &color_struct; - cacheGdkColorFids(env, color, &PGLOB(GdkColorFc)); - getGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - rc = (jboolean)gdk_color_alloc((GdkColormap*)colormap, (GdkColor*)color1); - if (color) { - setGdkColorFields(env, color, color1, &PGLOB(GdkColorFc)); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_font_load - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1load - (JNIEnv *env, jclass that, jbyteArray font_name) -{ - jint rc; - jbyte *font_name1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_font_load"); -#endif - - if (font_name) { - font_name1 = (*env)->GetByteArrayElements(env, font_name, NULL); - } - rc = (jint)gdk_font_load((gchar*)font_name1); - if (font_name) { - (*env)->ReleaseByteArrayElements(env, font_name, font_name1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_font_ref - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1ref - (JNIEnv *env, jclass that, jint font) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_font_ref"); -#endif - - return (jint)gdk_font_ref((GdkFont*)font); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_font_unref - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1unref - (JNIEnv *env, jclass that, jint font) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_font_unref"); -#endif - - gdk_font_unref((GdkFont*)font); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_font_equal - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1font_1equal - (JNIEnv *env, jclass that, jint fonta, jint fontb) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_font_equal"); -#endif - - return (jboolean)gdk_font_equal((GdkFont*)fonta, (GdkFont*)fontb); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_string_width - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1width - (JNIEnv *env, jclass that, jint font, jbyteArray string) -{ - jint rc; - jbyte *string1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_string_width"); -#endif - - if (string) { - string1 = (*env)->GetByteArrayElements(env, string, NULL); - } - rc = (jint)gdk_string_width((GdkFont*)font, (gchar*)string1); - if (string) { - (*env)->ReleaseByteArrayElements(env, string, string1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_char_width - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1char_1width - (JNIEnv *env, jclass that, jint font, jbyte character) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_char_width"); -#endif - - return (jint)gdk_char_width((GdkFont*)font, (gchar)character); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_string_height - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1height - (JNIEnv *env, jclass that, jint font, jbyteArray string) -{ - jint rc; - jbyte *string1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_string_height"); -#endif - - if (string) { - string1 = (*env)->GetByteArrayElements(env, string, NULL); - } - rc = (jint)gdk_string_height((GdkFont*)font, (gchar*)string1); - if (string) { - (*env)->ReleaseByteArrayElements(env, string, string1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_string_extents - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1string_1extents - (JNIEnv *env, jclass that, jint font, jbyteArray string, jintArray lbearing, jintArray rbearing, jintArray width, jintArray ascent, jintArray descent) -{ - jbyte *string1 = NULL; - jint *lbearing1 = NULL; - jint *rbearing1 = NULL; - jint *width1 = NULL; - jint *ascent1 = NULL; - jint *descent1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_string_extents"); -#endif - - if (string) { - string1 = (*env)->GetByteArrayElements(env, string, NULL); - } - if (lbearing) { - lbearing1 = (*env)->GetIntArrayElements(env, lbearing, NULL); - } - if (rbearing) { - rbearing1 = (*env)->GetIntArrayElements(env, rbearing, NULL); - } - if (width) { - width1 = (*env)->GetIntArrayElements(env, width, NULL); - } - if (ascent) { - ascent1 = (*env)->GetIntArrayElements(env, ascent, NULL); - } - if (descent) { - descent1 = (*env)->GetIntArrayElements(env, descent, NULL); - } - gdk_string_extents((GdkFont*)font, (gchar*)string1, (gint*)lbearing1, (gint*)rbearing1, (gint*)width1, (gint*)ascent1, (gint*)descent1); - if (string) { - (*env)->ReleaseByteArrayElements(env, string, string1, 0); - } - if (lbearing) { - (*env)->ReleaseIntArrayElements(env, lbearing, lbearing1, 0); - } - if (rbearing) { - (*env)->ReleaseIntArrayElements(env, rbearing, rbearing1, 0); - } - if (width) { - (*env)->ReleaseIntArrayElements(env, width, width1, 0); - } - if (ascent) { - (*env)->ReleaseIntArrayElements(env, ascent, ascent1, 0); - } - if (descent) { - (*env)->ReleaseIntArrayElements(env, descent, descent1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_line - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1line - (JNIEnv *env, jclass that, jint drawable, jint gc, jint x1, jint y1, jint x2, jint y2) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_line"); -#endif - - gdk_draw_line((GdkDrawable*)drawable, (GdkGC*)gc, (gint)x1, (gint)y1, (gint)x2, (gint)y2); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_rectangle - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1rectangle - (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jint x, jint y, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_rectangle"); -#endif - - gdk_draw_rectangle((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (gint)x, (gint)y, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_arc - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1arc - (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jint x, jint y, jint width, jint height, jint angle1, jint angle2) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_arc"); -#endif - - gdk_draw_arc((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (gint)x, (gint)y, (gint)width, (gint)height, (gint)angle1, (gint)angle2); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_polygon - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1polygon - (JNIEnv *env, jclass that, jint drawable, jint gc, jint filled, jshortArray points, jint npoints) -{ - jshort *points1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_polygon"); -#endif - - if (points) { - points1 = (*env)->GetShortArrayElements(env, points, NULL); - } - gdk_draw_polygon((GdkDrawable*)drawable, (GdkGC*)gc, (gint)filled, (GdkPoint*)points1, (gint)npoints); - if (points) { - (*env)->ReleaseShortArrayElements(env, points, points1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_string - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1string - (JNIEnv *env, jclass that, jint drawable, jint font, jint gc, jint x, jint y, jbyteArray string) -{ - jbyte *string1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_string"); -#endif - - if (string) { - string1 = (*env)->GetByteArrayElements(env, string, NULL); - } - gdk_draw_string((GdkDrawable*)drawable, (GdkFont*)font, (GdkGC*)gc, (gint)x, (gint)y, (gchar*)string1); - if (string) { - (*env)->ReleaseByteArrayElements(env, string, string1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_pixmap - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1pixmap - (JNIEnv *env, jclass that, jint drawable, jint gc, jint src, jint xsrc, jint ysrc, jint xdest, jint ydest, jint width, jint height) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_pixmap"); -#endif - - gdk_draw_pixmap((GdkDrawable*)drawable, (GdkGC*)gc, (GdkDrawable*)src, (gint)xsrc, (gint)ysrc, (gint)xdest, (gint)ydest, (gint)width, (gint)height); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_draw_lines - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1draw_1lines - (JNIEnv *env, jclass that, jint drawable, jint gc, jshortArray points, jint npoints) -{ - jshort *points1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_draw_lines"); -#endif - - if (points) { - points1 = (*env)->GetShortArrayElements(env, points, NULL); - } - gdk_draw_lines((GdkDrawable*)drawable, (GdkGC*)gc, (GdkPoint*)points1, (gint)npoints); - if (points) { - (*env)->ReleaseShortArrayElements(env, points, points1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_atom_intern - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1atom_1intern - (JNIEnv *env, jclass that, jbyteArray atom_name, jint only_if_exists) -{ - jint rc; - jbyte *atom_name1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_atom_intern"); -#endif - - if (atom_name) { - atom_name1 = (*env)->GetByteArrayElements(env, atom_name, NULL); - } - rc = (jint)gdk_atom_intern((gchar*)atom_name1, (gint)only_if_exists); - if (atom_name) { - (*env)->ReleaseByteArrayElements(env, atom_name, atom_name1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1new - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_new"); -#endif - - return (jint)gdk_region_new(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_destroy - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1destroy - (JNIEnv *env, jclass that, jint region) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_destroy"); -#endif - - gdk_region_destroy((GdkRegion*)region); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_get_clipbox - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1get_1clipbox - (JNIEnv *env, jclass that, jint region, jobject rectangle) -{ - DECL_GLOB(pGlob) - GdkRectangle rectangle_struct, *rectangle1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_get_clipbox"); -#endif - - if (rectangle) { - rectangle1 = &rectangle_struct; - cacheGdkRectangleFids(env, rectangle, &PGLOB(GdkRectangleFc)); - getGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); - } - gdk_region_get_clipbox((GdkRegion*)region, (GdkRectangle*)rectangle1); - if (rectangle) { - setGdkRectangleFields(env, rectangle, rectangle1, &PGLOB(GdkRectangleFc)); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_empty - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1empty - (JNIEnv *env, jclass that, jint region) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_empty"); -#endif - - return (jboolean)gdk_region_empty((GdkRegion*)region); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_equal - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1equal - (JNIEnv *env, jclass that, jint region1, jint region2) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_equal"); -#endif - - return (jboolean)gdk_region_equal((GdkRegion*)region1, (GdkRegion*)region2); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_point_in - * Signature: - */ -JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1point_1in - (JNIEnv *env, jclass that, jint region, jint x, jint y) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_point_in"); -#endif - - return (jboolean)gdk_region_point_in((GdkRegion*)region, (int)x, (int)y); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_rect_in - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1rect_1in - (JNIEnv *env, jclass that, jint region, jobject rect) -{ - DECL_GLOB(pGlob) - jint rc; - GdkRectangle rect_struct, *rect1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_rect_in"); -#endif - - if (rect) { - rect1 = &rect_struct; - cacheGdkRectangleFids(env, rect, &PGLOB(GdkRectangleFc)); - getGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); - } - rc = (jint)gdk_region_rect_in((GdkRegion*)region, (GdkRectangle*)rect1); - if (rect) { - setGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_region_union_with_rect - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1region_1union_1with_1rect - (JNIEnv *env, jclass that, jint region, jobject rect) -{ - DECL_GLOB(pGlob) - jint rc; - GdkRectangle rect_struct, *rect1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_region_union_with_rect"); -#endif - - if (rect) { - rect1 = &rect_struct; - cacheGdkRectangleFids(env, rect, &PGLOB(GdkRectangleFc)); - getGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); - } - rc = (jint)gdk_region_union_with_rect((GdkRegion*)region, (GdkRectangle*)rect1); - if (rect) { - setGdkRectangleFields(env, rect, rect1, &PGLOB(GdkRectangleFc)); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_regions_union - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1regions_1union - (JNIEnv *env, jclass that, jint source1, jint source2) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_regions_union"); -#endif - - return (jint)gdk_regions_union((GdkRegion*)source1, (GdkRegion*)source2); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gdk_regions_subtract - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gdk_1regions_1subtract - (JNIEnv *env, jclass that, jint source1, jint source2) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gdk_regions_subtract"); -#endif - - return (jint)gdk_regions_subtract((GdkRegion*)source1, (GdkRegion*)source2); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_list_free - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1free - (JNIEnv *env, jclass that, jint list) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_list_free"); -#endif - - g_list_free((GList*)list); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_list_append - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1append - (JNIEnv *env, jclass that, jint list, jint data) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_list_append"); -#endif - - return (jint)g_list_append((GList*)list, (gpointer)data); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_list_nth - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1nth - (JNIEnv *env, jclass that, jint list, jint n) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_list_nth"); -#endif - - return (jint)g_list_nth((GList*)list, n); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_list_length - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1length - (JNIEnv *env, jclass that, jint list) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_list_length"); -#endif - - return (jint)g_list_length((GList*)list); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_list_nth_data - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1nth_1data - (JNIEnv *env, jclass that, jint list, jint n) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_list_nth_data"); -#endif - - return (jint)g_list_nth_data((GList*)list, n); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_slist_nth - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1nth - (JNIEnv *env, jclass that, jint list, jint n) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_slist_nth"); -#endif - - return (jint)g_slist_nth((GSList*)list, n); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_slist_length - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1length - (JNIEnv *env, jclass that, jint list) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_slist_length"); -#endif - - return (jint)g_slist_length((GSList*)list); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_slist_nth_data - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1nth_1data - (JNIEnv *env, jclass that, jint list, jint n) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_slist_nth_data"); -#endif - - return (jint)g_slist_nth_data((GSList*)list, n); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_malloc - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1malloc - (JNIEnv *env, jclass that, jint size) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_malloc"); -#endif - - return (jint)g_malloc((gulong)size); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_free - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1free - (JNIEnv *env, jclass that, jint mem) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_free"); -#endif - - g_free((gpointer)mem); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_strdup - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1strdup - (JNIEnv *env, jclass that, jbyteArray str) -{ - jint rc; - jbyte *str1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_strdup"); -#endif - - if (str) { - str1 = (*env)->GetByteArrayElements(env, str, NULL); - } - rc = (jint)g_strdup((gchar*)str1); - if (str) { - (*env)->ReleaseByteArrayElements(env, str, str1, 0); - } - return rc; -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: g_get_home_dir - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1get_1home_1dir - (JNIEnv *env, jclass that) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "g_get_home_dir"); -#endif - - return (jint)g_get_home_dir(); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_new - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1new - (JNIEnv *env, jclass that, jint columns) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_new"); -#endif - - return (jint)gtk_clist_new((gint)columns); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_shadow_type - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1shadow_1type - (JNIEnv *env, jclass that, jint clist, jint type) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_shadow_type"); -#endif - - gtk_clist_set_shadow_type((GtkCList*)clist, (GtkShadowType)type); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_selection_mode - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1selection_1mode - (JNIEnv *env, jclass that, jint clist, jint mode) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_selection_mode"); -#endif - - gtk_clist_set_selection_mode((GtkCList*)clist, (GtkSelectionMode)mode); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_freeze - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1freeze - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_freeze"); -#endif - - gtk_clist_freeze((GtkCList*)clist); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_thaw - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1thaw - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_thaw"); -#endif - - gtk_clist_thaw((GtkCList*)clist); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_column_titles_show - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1show - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_column_titles_show"); -#endif - - gtk_clist_column_titles_show((GtkCList*)clist); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_column_titles_hide - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1hide - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_column_titles_hide"); -#endif - - gtk_clist_column_titles_hide((GtkCList*)clist); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_column_title_passive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1title_1passive - (JNIEnv *env, jclass that, jint clist, jint column) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_column_title_passive"); -#endif - - gtk_clist_column_title_passive((GtkCList*)clist, (gint)column); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_column_titles_passive - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1column_1titles_1passive - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_column_titles_passive"); -#endif - - gtk_clist_column_titles_passive((GtkCList*)clist); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_column_title - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1title - (JNIEnv *env, jclass that, jint clist, jint column, jbyteArray title) -{ - jbyte *title1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_column_title"); -#endif - if (title) { - title1 = (*env)->GetByteArrayElements(env, title, NULL); - } - gtk_clist_set_column_title((GtkCList*)clist, (gint)column, (gchar*)title1); - if (title) { - (*env)->ReleaseByteArrayElements(env, title, title1, 0); - } -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_column_justification - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1justification - (JNIEnv *env, jclass that, jint clist, jint column, jint justification) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_column_justification"); -#endif - - gtk_clist_set_column_justification((GtkCList*)clist, (gint)column, (GtkJustification)justification); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_column_visibility - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1visibility - (JNIEnv *env, jclass that, jint clist, jint column, jboolean visible) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_column_visibility"); -#endif - - gtk_clist_set_column_visibility((GtkCList*)clist, (gint)column, (gboolean)visible); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_column_resizeable - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1resizeable - (JNIEnv *env, jclass that, jint clist, jint column, jboolean resizeable) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_column_resizeable"); -#endif - - gtk_clist_set_column_resizeable((GtkCList*)clist, (gint)column, (gboolean)resizeable); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_column_width - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1column_1width - (JNIEnv *env, jclass that, jint clist, jint column, jint width) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_column_width"); -#endif - - gtk_clist_set_column_width((GtkCList*)clist, (gint)column, (gint)width); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_moveto - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1moveto - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jfloat row_align, jfloat col_align) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_moveto"); -#endif - - gtk_clist_moveto((GtkCList*)clist, (gint)row, (gint)column, row_align, col_align); -} - -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_text - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1text - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jbyteArray text) -{ - jbyte *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_text"); -#endif - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - gtk_clist_set_text((GtkCList*)clist, (gint)row, (gint)column, (gchar*)text1); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_get_text - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1text - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jintArray text) -{ - jint rc; - jint *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_get_text"); -#endif - if (text) { - text1 = (*env)->GetIntArrayElements(env, text, NULL); - } - rc = (jint)gtk_clist_get_text((GtkCList*)clist, (gint)row, (gint)column, (gchar**)text1); - if (text) { - (*env)->ReleaseIntArrayElements(env, text, text1, 0); - } - return rc; -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_pixmap - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1pixmap - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jint pixmap, jint mask) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_pixmap"); -#endif - gtk_clist_set_pixmap((GtkCList*)clist, (gint)row, (gint)column, (GdkPixmap*)pixmap, (GdkBitmap*)mask); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_set_pixtext - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1set_1pixtext - (JNIEnv *env, jclass that, jint clist, jint row, jint column, jbyteArray text, jbyte spacing, jint pixmap, jint mask) -{ - jbyte *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_set_pixtext"); -#endif - if (text) { - text1 = (*env)->GetByteArrayElements(env, text, NULL); - } - gtk_clist_set_pixtext((GtkCList*)clist, (gint)row, (gint)column, (gchar*)text1, (guint8)spacing, (GdkPixmap*)pixmap, (GdkBitmap*)mask); - if (text) { - (*env)->ReleaseByteArrayElements(env, text, text1, 0); - } -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_append - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1append - (JNIEnv *env, jclass that, jint clist, jintArray text) -{ - jint rc; - jint *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_append"); -#endif - if (text) { - text1 = (*env)->GetIntArrayElements(env, text, NULL); - } - rc = (jint)gtk_clist_append((GtkCList*)clist, (gchar**)text1); - if (text) { - (*env)->ReleaseIntArrayElements(env, text, text1, 0); - } - return rc; -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_insert - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1insert - (JNIEnv *env, jclass that, jint clist, jint row, jintArray text) -{ - jint rc; - jint *text1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_insert"); -#endif - if (text) { - text1 = (*env)->GetIntArrayElements(env, text, NULL); - } - rc = (jint)gtk_clist_insert((GtkCList*)clist, (gint)row, (gchar**)text1); - if (text) { - (*env)->ReleaseIntArrayElements(env, text, text1, 0); - } - return rc; -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_remove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1remove - (JNIEnv *env, jclass that, jint clist, jint row) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_remove"); -#endif - gtk_clist_remove((GtkCList*)clist, (gint)row); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_select_row - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1select_1row - (JNIEnv *env, jclass that, jint clist, jint row, jint column) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_select_row"); -#endif - gtk_clist_select_row((GtkCList*)clist, (gint)row, (gint)column); -} + /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_unselect_row + * Method: gtk_drawing_area_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1unselect_1row - (JNIEnv *env, jclass that, jint clist, jint row, jint column) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1drawing_1area_1new + (JNIEnv *env, jclass that) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_unselect_row"); + fprintf(stderr, "gtk_drawing_area_new"); #endif - gtk_clist_unselect_row((GtkCList*)clist, (gint)row, (gint)column); + return (jint)gtk_drawing_area_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_clear + * Method: gtk_drawing_area_size * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1clear - (JNIEnv *env, jclass that, jint clist) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1drawing_1area_1size + (JNIEnv *env, jclass that, jint darea, jint width, jint height) { #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_clear"); + fprintf(stderr, "gtk_drawing_area_size"); #endif - gtk_clist_clear((GtkCList*)clist); + gtk_drawing_area_size((GtkDrawingArea*)darea, (gint)width, (gint)height); } -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_get_selection_info - * Signature: - */ -JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1get_1selection_1info - (JNIEnv *env, jclass that, jint clist, jint x, jint y, jintArray row, jintArray column) -{ - jint rc; - jint *row1 = NULL; - jint *column1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_get_selection_info"); -#endif - if (row) { - row1 = (*env)->GetIntArrayElements(env, row, NULL); - } - if (column) { - column1 = (*env)->GetIntArrayElements(env, column, NULL); - } - rc = (jint)gtk_clist_get_selection_info((GtkCList*)clist, (gint)x, (gint)y, (gint*)row1, (gint*)column1); - if (row) { - (*env)->ReleaseIntArrayElements(env, row, row1, 0); - } - if (column) { - (*env)->ReleaseIntArrayElements(env, column, column1, 0); - } - return rc; -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_select_all - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1select_1all - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_select_all"); -#endif - gtk_clist_select_all((GtkCList*)clist); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_clist_unselect_all - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1clist_1unselect_1all - (JNIEnv *env, jclass that, jint clist) -{ -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "gtk_clist_unselect_all"); -#endif - gtk_clist_unselect_all((GtkCList*)clist); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) -{ - DECL_GLOB(pGlob) - GdkColor src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkColorFids(env, src, &PGLOB(GdkColorFc)); - getGdkColorFields(env, src, src1, &PGLOB(GdkColorFc)); - } -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I\n"); -#endif - memmove((void*)dest, (void*)src1, count); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GdkColor dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkColorFids(env, dest, &PGLOB(GdkColorFc)); - setGdkColorFields(env, dest, dest1, &PGLOB(GdkColorFc)); - } -} -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkDialog_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GtkDialog dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkDialog_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkDialogFids(env, dest, &PGLOB(GtkDialogFc)); - setGtkDialogFields(env, dest, dest1, &PGLOB(GtkDialogFc)); - } -} -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkStyleClass_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GtkStyleClass dest_struct, *dest1 = NULL; - - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkStyleClassFids(env, dest, &PGLOB(GtkStyleClassFc)); - setGtkStyleClassFields(env, dest, dest1, &PGLOB(GtkStyleClassFc)); - } -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkEventKey_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkEventKeyFids(env, src, &PGLOB(GdkEventKeyFc)); - getGdkEventKeyFields(env, src, src1, &PGLOB(GdkEventKeyFc)); - } -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkEventKey_2I\n"); -#endif - memmove((void*)dest, (void*)src1, count); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventKey_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventKey_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkEventKeyFids(env, dest, &PGLOB(GdkEventKeyFc)); - setGdkEventKeyFields(env, dest, dest1, &PGLOB(GdkEventKeyFc)); - } -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkEventButtonFids(env, src, &PGLOB(GdkEventButtonFc)); - getGdkEventButtonFields(env, src, src1, &PGLOB(GdkEventButtonFc)); - } -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I\n"); -#endif - memmove((void*)dest, (void*)src1, count); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventButton_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventButton_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkEventButtonFids(env, dest, &PGLOB(GdkEventButtonFc)); - setGdkEventButtonFields(env, dest, dest1, &PGLOB(GdkEventButtonFc)); - } -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkEventMotion_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkEventMotionFids(env, src, &PGLOB(GdkEventMotionFc)); - getGdkEventMotionFields(env, src, src1, &PGLOB(GdkEventMotionFc)); - } -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkEventMotion_2I\n"); -#endif - memmove((void*)dest, (void*)src1, count); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventMotion_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GdkEvent dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventMotion_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkEventMotionFids(env, dest, &PGLOB(GdkEventMotionFc)); - setGdkEventMotionFields(env, dest, dest1, &PGLOB(GdkEventMotionFc)); - } -} /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_list_clear_items * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkEventExpose_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1list_1clear_1items + (JNIEnv *env, jclass that, jint list, jint start, jint end) { - DECL_GLOB(pGlob) - GdkEvent src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkEventExposeFids(env, src, &PGLOB(GdkEventExposeFc)); - getGdkEventExposeFields(env, src, src1, &PGLOB(GdkEventExposeFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkEventExpose_2I\n"); + fprintf(stderr, "gtk_list_clear_items"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_list_clear_items((GtkList*)list, (gint)start, (gint)end); } + /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_list_select_item * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventExpose_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1list_1select_1item + (JNIEnv *env, jclass that, jint list, jint item) { - DECL_GLOB(pGlob) - GdkEvent dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventExpose_2II\n"); + fprintf(stderr, "gtk_list_select_item"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkEventExposeFids(env, dest, &PGLOB(GdkEventExposeFc)); - setGdkEventExposeFields(env, dest, dest1, &PGLOB(GdkEventExposeFc)); - } + gtk_list_select_item((GtkList*)list, (gint)item); } -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkFont_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) -{ - DECL_GLOB(pGlob) - GdkFont src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkFontFids(env, src, &PGLOB(GdkFontFc)); - getGdkFontFields(env, src, src1, &PGLOB(GdkFontFc)); - } -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkFont_2I\n"); -#endif - memmove((void*)dest, (void*)src1, count); -} -/* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: - */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkFont_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) -{ - DECL_GLOB(pGlob) - GdkFont dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkFont_2II\n"); -#endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkFontFids(env, dest, &PGLOB(GdkFontFc)); - setGdkFontFields(env, dest, dest1, &PGLOB(GdkFontFc)); - } -} /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkGCValues_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GdkGCValues src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkGCValuesFids(env, src, &PGLOB(GdkGCValuesFc)); - getGdkGCValuesFields(env, src, src1, &PGLOB(GdkGCValuesFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkGCValues_2I\n"); + fprintf(stderr, "gtk_menu_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_menu_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_insert * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkGCValues_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1insert + (JNIEnv *env, jclass that, jint menu, jint child, jint position) { - DECL_GLOB(pGlob) - GdkGCValues dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkGCValues_2II\n"); + fprintf(stderr, "gtk_menu_insert"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkGCValuesFids(env, dest, &PGLOB(GdkGCValuesFc)); - setGdkGCValuesFields(env, dest, dest1, &PGLOB(GdkGCValuesFc)); - } + gtk_menu_insert((GtkMenu*)menu, (GtkWidget*)child, (gint)position); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_popup * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkImage_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1popup + (JNIEnv *env, jclass that, jint menu, jint parent_menu_shell, jint parent_menu_item, jint func, jint data, jint button, jint activate_time) { - DECL_GLOB(pGlob) - GdkImage src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkImageFids(env, src, &PGLOB(GdkImageFc)); - getGdkImageFields(env, src, src1, &PGLOB(GdkImageFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkImage_2I\n"); + fprintf(stderr, "gtk_menu_popup"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_menu_popup((GtkMenu*)menu, (GtkWidget*)parent_menu_shell, (GtkWidget*)parent_menu_item, (GtkMenuPositionFunc)func, (gpointer)data, button, (guint32)activate_time); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_popdown * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1popdown + (JNIEnv *env, jclass that, jint menu) { - DECL_GLOB(pGlob) - GdkImage dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2II\n"); + fprintf(stderr, "gtk_menu_popdown"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkImageFids(env, dest, &PGLOB(GdkImageFc)); - setGdkImageFields(env, dest, dest1, &PGLOB(GdkImageFc)); - } + gtk_menu_popdown((GtkMenu*)menu); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_bar_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkPoint_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1bar_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GdkPoint src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkPointFids(env, src, &PGLOB(GdkPointFc)); - getGdkPointFields(env, src, src1, &PGLOB(GdkPointFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkPoint_2I\n"); + fprintf(stderr, "gtk_menu_bar_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_menu_bar_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_bar_insert * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkPoint_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1bar_1insert + (JNIEnv *env, jclass that, jint menu_bar, jint child, jint position) { - DECL_GLOB(pGlob) - GdkPoint dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkPoint_2II\n"); + fprintf(stderr, "gtk_menu_bar_insert"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkPointFids(env, dest, &PGLOB(GdkPointFc)); - setGdkPointFields(env, dest, dest1, &PGLOB(GdkPointFc)); - } + gtk_menu_bar_insert((GtkMenuBar*)menu_bar, (GtkWidget*)child, (gint)position); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_item_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkRectangle_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GdkRectangle src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkRectangleFids(env, src, &PGLOB(GdkRectangleFc)); - getGdkRectangleFields(env, src, src1, &PGLOB(GdkRectangleFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkRectangle_2I\n"); + fprintf(stderr, "gtk_menu_item_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_menu_item_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_item_new_with_label * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkRectangle_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1new_1with_1label + (JNIEnv *env, jclass that, jbyteArray label) { - DECL_GLOB(pGlob) - GdkRectangle dest_struct={0}, *dest1 = NULL; + jint rc; + jbyte *label1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkRectangle_2II\n"); + fprintf(stderr, "gtk_menu_item_new_with_label"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkRectangleFids(env, dest, &PGLOB(GdkRectangleFc)); - setGdkRectangleFields(env, dest, dest1, &PGLOB(GdkRectangleFc)); + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); } + rc = (jint)gtk_menu_item_new_with_label((gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } + return rc; } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_item_set_submenu * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GdkVisual_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1set_1submenu + (JNIEnv *env, jclass that, jint menu_item, jint submenu) { - DECL_GLOB(pGlob) - GdkVisual src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGdkVisualFids(env, src, &PGLOB(GdkVisualFc)); - getGdkVisualFields(env, src, src1, &PGLOB(GdkVisualFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GdkVisual_2I\n"); + fprintf(stderr, "gtk_menu_item_set_submenu"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_menu_item_set_submenu((GtkMenuItem*)menu_item, (GtkWidget*)submenu); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_menu_item_remove_submenu * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GdkVisual_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1menu_1item_1remove_1submenu + (JNIEnv *env, jclass that, jint menu_item) { - DECL_GLOB(pGlob) - GdkVisual dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GdkVisual_2II\n"); + fprintf(stderr, "gtk_menu_item_remove_submenu"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGdkVisualFids(env, dest, &PGLOB(GdkVisualFc)); - setGdkVisualFields(env, dest, dest1, &PGLOB(GdkVisualFc)); - } + gtk_menu_item_remove_submenu((GtkMenuItem*)menu_item); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_misc_set_alignment * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkAllocation_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1misc_1set_1alignment + (JNIEnv *env, jclass that, jint misc, jfloat xalign, jfloat yalign) { - DECL_GLOB(pGlob) - GtkAllocation src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkAllocationFids(env, src, &PGLOB(GtkAllocationFc)); - getGtkAllocationFields(env, src, src1, &PGLOB(GtkAllocationFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkAllocation_2I\n"); + fprintf(stderr, "gtk_misc_set_alignment"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_misc_set_alignment((GtkMisc*)misc, xalign, yalign); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkAllocation_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkAllocation dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkAllocation_2II\n"); + fprintf(stderr, "gtk_notebook_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkAllocationFids(env, dest, &PGLOB(GtkAllocationFc)); - setGtkAllocationFields(env, dest, dest1, &PGLOB(GtkAllocationFc)); - } + return (jint)gtk_notebook_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_append_page * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkArg_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1append_1page + (JNIEnv *env, jclass that, jint notebook, jint child, jint tab_label) { - DECL_GLOB(pGlob) - GtkArg src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkArgFids(env, src, &PGLOB(GtkArgFc)); - getGtkArgFields(env, src, src1, &PGLOB(GtkArgFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkArg_2I\n"); + fprintf(stderr, "gtk_notebook_append_page"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_notebook_append_page((GtkNotebook*)notebook, (GtkWidget*)child, (GtkWidget*)tab_label); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_remove_page * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkArg_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1remove_1page + (JNIEnv *env, jclass that, jint notebook, jint page_num) { - DECL_GLOB(pGlob) - GtkArg dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkArg_2II\n"); + fprintf(stderr, "gtk_notebook_remove_page"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkArgFids(env, dest, &PGLOB(GtkArgFc)); - setGtkArgFields(env, dest, dest1, &PGLOB(GtkArgFc)); - } + gtk_notebook_remove_page((GtkNotebook*)notebook, (gint)page_num); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_get_current_page * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkBin_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1get_1current_1page + (JNIEnv *env, jclass that, jint notebook) { - DECL_GLOB(pGlob) - GtkBin src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkBinFids(env, src, &PGLOB(GtkBinFc)); - getGtkBinFields(env, src, src1, &PGLOB(GtkBinFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkBin_2I\n"); + fprintf(stderr, "gtk_notebook_get_current_page"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_notebook_get_current_page((GtkNotebook*)notebook); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_set_page * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkBin_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1set_1page + (JNIEnv *env, jclass that, jint notebook, jint page_num) { - DECL_GLOB(pGlob) - GtkBin dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkBin_2II\n"); + fprintf(stderr, "gtk_notebook_set_page"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkBinFids(env, dest, &PGLOB(GtkBinFc)); - setGtkBinFields(env, dest, dest1, &PGLOB(GtkBinFc)); - } + gtk_notebook_set_page((GtkNotebook*)notebook, (gint)page_num); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_notebook_set_show_tabs * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCList_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1notebook_1set_1show_1tabs + (JNIEnv *env, jclass that, jint notebook, jboolean show_tabs) { - DECL_GLOB(pGlob) - GtkCList src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCListFids(env, src, &PGLOB(GtkCListFc)); - getGtkCListFields(env, src, src1, &PGLOB(GtkCListFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCList_2I\n"); + fprintf(stderr, "gtk_notebook_set_show_tabs"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_notebook_set_show_tabs((GtkNotebook*)notebook, (gboolean)show_tabs); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_object_ref * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCList_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1ref + (JNIEnv *env, jclass that, jint object) { - DECL_GLOB(pGlob) - GtkCList dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCList_2II\n"); + fprintf(stderr, "gtk_object_ref"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCListFids(env, dest, &PGLOB(GtkCListFc)); - setGtkCListFields(env, dest, dest1, &PGLOB(GtkCListFc)); - } + gtk_object_ref((GtkObject*)object); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_object_set_user_data * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkMenu_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1set_1user_1data + (JNIEnv *env, jclass that, jint object, jint data) { - DECL_GLOB(pGlob) - GtkMenu src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkMenuFids(env, src, &PGLOB(GtkMenuFc)); - getGtkMenuFields(env, src, src1, &PGLOB(GtkMenuFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkMenu_2I\n"); + fprintf(stderr, "gtk_object_set_user_data"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_object_set_user_data((GtkObject*)object, (gpointer)data); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_object_get_user_data * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkMenu_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1object_1get_1user_1data + (JNIEnv *env, jclass that, jint object) { - DECL_GLOB(pGlob) - GtkMenu dest_struct={0}, *dest1 = NULL; - #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkMenu_2II\n"); + fprintf(stderr, "gtk_object_get_user_data"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkMenuFids(env, dest, &PGLOB(GtkMenuFc)); - setGtkMenuFields(env, dest, dest1, &PGLOB(GtkMenuFc)); - } + return (jint)gtk_object_get_user_data((GtkObject*)object); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_pixmap_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCTree_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1pixmap_1new + (JNIEnv *env, jclass that, jint pixmap, jint mask) { - DECL_GLOB(pGlob) - GtkCTree src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCTreeFids(env, src, &PGLOB(GtkCTreeFc)); - getGtkCTreeFields(env, src, src1, &PGLOB(GtkCTreeFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCTree_2I\n"); + fprintf(stderr, "gtk_pixmap_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_pixmap_new((GdkPixmap*)pixmap, (GdkBitmap*)mask); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_pixmap_set * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCTree_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1pixmap_1set + (JNIEnv *env, jclass that, jint pixmap, jint val, jint mask) { - DECL_GLOB(pGlob) - GtkCTree dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCTree_2II\n"); + fprintf(stderr, "gtk_pixmap_set"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCTreeFids(env, dest, &PGLOB(GtkCTreeFc)); - setGtkCTreeFields(env, dest, dest1, &PGLOB(GtkCTreeFc)); - } + gtk_pixmap_set((GtkPixmap*)pixmap, (GdkPixmap*)val, (GdkBitmap*)mask); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_progress_configure * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1configure + (JNIEnv *env, jclass that, jint progress, jfloat value, jfloat min, jfloat max) { - DECL_GLOB(pGlob) - GtkColorSelectionDialog src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkColorSelectionDialogFids(env, src, &PGLOB(GtkColorSelectionDialogFc)); - getGtkColorSelectionDialogFields(env, src, src1, &PGLOB(GtkColorSelectionDialogFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2I\n"); + fprintf(stderr, "gtk_progress_configure"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_progress_configure((GtkProgress*)progress, value, min, max); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_progress_bar_new_with_adjustment * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkColorSelectionDialog dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2II\n"); + fprintf(stderr, "gtk_progress_bar_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkColorSelectionDialogFids(env, dest, &PGLOB(GtkColorSelectionDialogFc)); - setGtkColorSelectionDialogFields(env, dest, dest1, &PGLOB(GtkColorSelectionDialogFc)); - } + return (jint)gtk_progress_bar_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_progress_bar_set_bar_style * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCombo_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1set_1bar_1style + (JNIEnv *env, jclass that, jint pbar, jint style) { - DECL_GLOB(pGlob) - GtkCombo src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkComboFids(env, src, &PGLOB(GtkComboFc)); - getGtkComboFields(env, src, src1, &PGLOB(GtkComboFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCombo_2I\n"); + fprintf(stderr, "gtk_progress_bar_set_bar_style"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_progress_bar_set_bar_style((GtkProgressBar*)pbar, (GtkProgressBarStyle)style); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_progress_bar_set_orientation * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1progress_1bar_1set_1orientation + (JNIEnv *env, jclass that, jint pbar, jint orientation) { - DECL_GLOB(pGlob) - GtkCombo dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2II\n"); + fprintf(stderr, "gtk_progress_bar_set_orientation"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkComboFids(env, dest, &PGLOB(GtkComboFc)); - setGtkComboFields(env, dest, dest1, &PGLOB(GtkComboFc)); - } + gtk_progress_bar_set_orientation((GtkProgressBar*)pbar, (GtkProgressBarOrientation)orientation); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_radio_button_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkContainer_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1button_1new + (JNIEnv *env, jclass that, jint group) { - DECL_GLOB(pGlob) - GtkContainer src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkContainerFids(env, src, &PGLOB(GtkContainerFc)); - getGtkContainerFields(env, src, src1, &PGLOB(GtkContainerFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkContainer_2I\n"); + fprintf(stderr, "gtk_radio_button_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_radio_button_new((GSList*)group); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_radio_button_group * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkContainer_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1button_1group + (JNIEnv *env, jclass that, jint radio_button) { - DECL_GLOB(pGlob) - GtkContainer dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkContainer_2II\n"); + fprintf(stderr, "gtk_radio_button_group"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkContainerFids(env, dest, &PGLOB(GtkContainerFc)); - setGtkContainerFields(env, dest, dest1, &PGLOB(GtkContainerFc)); - } + return (jint)gtk_radio_button_group((GtkRadioButton*)radio_button); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_radio_menu_item_new_with_label * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkData_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1radio_1menu_1item_1new_1with_1label + (JNIEnv *env, jclass that, jint group, jbyteArray label) { - DECL_GLOB(pGlob) - GtkData src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkDataFids(env, src, &PGLOB(GtkDataFc)); - getGtkDataFields(env, src, src1, &PGLOB(GtkDataFc)); - } + jint rc; + jbyte *label1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkData_2I\n"); + fprintf(stderr, "gtk_radio_menu_item_new_with_label"); #endif - memmove((void*)dest, (void*)src1, count); + if (label) { + label1 = (*env)->GetByteArrayElements(env, label, NULL); + } + rc = (jint)gtk_radio_menu_item_new_with_label((GSList*)group, (gchar*)label1); + if (label) { + (*env)->ReleaseByteArrayElements(env, label, label1, 0); + } + return rc; } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_range_get_adjustment * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkData_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1range_1get_1adjustment + (JNIEnv *env, jclass that, jint range) { - DECL_GLOB(pGlob) - GtkData dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkData_2II\n"); + fprintf(stderr, "gtk_range_get_adjustment"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkDataFids(env, dest, &PGLOB(GtkDataFc)); - setGtkDataFields(env, dest, dest1, &PGLOB(GtkDataFc)); - } + return (jint)gtk_range_get_adjustment((GtkRange*)range); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scale_set_digits * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkEditable_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1digits + (JNIEnv *env, jclass that, jint scale, jint digits) { - DECL_GLOB(pGlob) - GtkEditable src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkEditableFids(env, src, &PGLOB(GtkEditableFc)); - getGtkEditableFields(env, src, src1, &PGLOB(GtkEditableFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkEditable_2I\n"); + fprintf(stderr, "gtk_scale_set_digits"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_scale_set_digits((GtkScale*)scale, (gint)digits); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scale_set_draw_value * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkEditable_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1draw_1value + (JNIEnv *env, jclass that, jint scale, jboolean draw_value) { - DECL_GLOB(pGlob) - GtkEditable dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkEditable_2II\n"); + fprintf(stderr, "gtk_scale_set_draw_value"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkEditableFids(env, dest, &PGLOB(GtkEditableFc)); - setGtkEditableFields(env, dest, dest1, &PGLOB(GtkEditableFc)); - } + gtk_scale_set_draw_value((GtkScale*)scale, (gboolean)draw_value); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scale_set_value_pos * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkText_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scale_1set_1value_1pos + (JNIEnv *env, jclass that, jint scale, jint pos) { - DECL_GLOB(pGlob) - GtkText src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkTextFids(env, src, &PGLOB(GtkTextFc)); - getGtkTextFields(env, src, src1, &PGLOB(GtkTextFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkText_2I\n"); + fprintf(stderr, "gtk_scale_set_value_pos"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_scale_set_value_pos((GtkScale*)scale, (GtkPositionType)pos); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scrolled_window_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkText_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1new + (JNIEnv *env, jclass that, jint hadjustment, jint vadjustment) { - DECL_GLOB(pGlob) - GtkText dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkText_2II\n"); + fprintf(stderr, "gtk_scrolled_window_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkTextFids(env, dest, &PGLOB(GtkTextFc)); - setGtkTextFields(env, dest, dest1, &PGLOB(GtkTextFc)); - } + return (jint)gtk_scrolled_window_new((GtkAdjustment*)hadjustment, (GtkAdjustment*)vadjustment); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: gtk_text_inquiry + * Method: gtk_scrolled_window_get_hadjustment * Signature: - * Not implemented yet; */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_text_inquiry__Lorg_eclipse_swt_internal_gtk_GtkText_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1get_1hadjustment + (JNIEnv *env, jclass that, jint scrolled_window) { +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "gtk_scrolled_window_get_hadjustment"); +#endif + return (jint)gtk_scrolled_window_get_hadjustment((GtkScrolledWindow*)scrolled_window); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scrolled_window_get_vadjustment * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkFileSelection_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1get_1vadjustment + (JNIEnv *env, jclass that, jint scrolled_window) { - DECL_GLOB(pGlob) - GtkFileSelection src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkFileSelectionFids(env, src, &PGLOB(GtkFileSelectionFc)); - getGtkFileSelectionFields(env, src, src1, &PGLOB(GtkFileSelectionFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkFileSelection_2I\n"); + fprintf(stderr, "gtk_scrolled_window_get_vadjustment"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_scrolled_window_get_vadjustment((GtkScrolledWindow*)scrolled_window); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_scrolled_window_set_policy * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1scrolled_1window_1set_1policy + (JNIEnv *env, jclass that, jint scrolled_window, jint hscrollbar_policy, jint vscrollbar_policy) { - DECL_GLOB(pGlob) - GtkFileSelection dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2II\n"); + fprintf(stderr, "gtk_scrolled_window_set_policy"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkFileSelectionFids(env, dest, &PGLOB(GtkFileSelectionFc)); - setGtkFileSelectionFields(env, dest, dest1, &PGLOB(GtkFileSelectionFc)); - } + gtk_scrolled_window_set_policy((GtkScrolledWindow*)scrolled_window, (GtkPolicyType)hscrollbar_policy, (GtkPolicyType)vscrollbar_policy); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_selection_owner_set * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkFontSelectionDialog_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1selection_1owner_1set + (JNIEnv *env, jclass that, jint widget, jint selection, jint time) { - DECL_GLOB(pGlob) - GtkFontSelectionDialog src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkFontSelectionDialogFids(env, src, &PGLOB(GtkFontSelectionDialogFc)); - getGtkFontSelectionDialogFields(env, src, src1, &PGLOB(GtkFontSelectionDialogFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkFontSelectionDialog_2I\n"); + fprintf(stderr, "gtk_selection_owner_set"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_selection_owner_set((GtkWidget*)widget, (GdkAtom)selection, (guint32)time); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_selection_convert * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkFontSelectionDialog_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1selection_1convert + (JNIEnv *env, jclass that, jint widget, jint selection, jint target, jint time) { - DECL_GLOB(pGlob) - GtkFontSelectionDialog dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkFontSelectionDialog_2II\n"); + fprintf(stderr, "gtk_selection_convert"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkFontSelectionDialogFids(env, dest, &PGLOB(GtkFontSelectionDialogFc)); - setGtkFontSelectionDialogFields(env, dest, dest1, &PGLOB(GtkFontSelectionDialogFc)); - } + return (jint)gtk_selection_convert((GtkWidget*)widget, (GdkAtom)selection, (GdkAtom)target, (guint32)time); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_signal_emit_stop_by_name * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkObject_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1emit_1stop_1by_1name + (JNIEnv *env, jclass that, jint object, jbyteArray name) { - DECL_GLOB(pGlob) - GtkObject src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkObjectFids(env, src, &PGLOB(GtkObjectFc)); - getGtkObjectFields(env, src, src1, &PGLOB(GtkObjectFc)); - } + jbyte *name1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkObject_2I\n"); + fprintf(stderr, "gtk_signal_emit_stop_by_name"); #endif - memmove((void*)dest, (void*)src1, count); + if (name) { + name1 = (*env)->GetByteArrayElements(env, name, NULL); + } + gtk_signal_emit_stop_by_name((GtkObject*)object, (gchar*)name1); + if (name) { + (*env)->ReleaseByteArrayElements(env, name, name1, 0); + } } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_signal_connect * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkObject_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1connect + (JNIEnv *env, jclass that, jint object, jbyteArray name, jint func, jint func_data) { - DECL_GLOB(pGlob) - GtkObject dest_struct={0}, *dest1 = NULL; + jint rc; + jbyte *name1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkObject_2II\n"); + fprintf(stderr, "gtk_signal_connect"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkObjectFids(env, dest, &PGLOB(GtkObjectFc)); - setGtkObjectFields(env, dest, dest1, &PGLOB(GtkObjectFc)); + if (name) { + name1 = (*env)->GetByteArrayElements(env, name, NULL); + } + rc = (jint)gtk_signal_connect((GtkObject*)object, (gchar*)name1, (GtkSignalFunc)func, (gpointer)func_data); + if (name) { + (*env)->ReleaseByteArrayElements(env, name, name1, 0); } + return rc; } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_signal_connect_after * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkProgress_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1connect_1after + (JNIEnv *env, jclass that, jint object, jbyteArray name, jint func, jint func_data) { - DECL_GLOB(pGlob) - GtkProgress src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkProgressFids(env, src, &PGLOB(GtkProgressFc)); - getGtkProgressFields(env, src, src1, &PGLOB(GtkProgressFc)); - } + jint rc; + jbyte *name1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkProgress_2I\n"); + fprintf(stderr, "gtk_signal_connect_after"); #endif - memmove((void*)dest, (void*)src1, count); + if (name) { + name1 = (*env)->GetByteArrayElements(env, name, NULL); + } + rc = (jint)gtk_signal_connect_after((GtkObject*)object, (gchar*)name1, (GtkSignalFunc)func, (gpointer)func_data); + if (name) { + (*env)->ReleaseByteArrayElements(env, name, name1, 0); + } + return rc; } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_signal_handler_block_by_func * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkProgress_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1block_1by_1func + (JNIEnv *env, jclass that, jint object, jint func, jint data) { - DECL_GLOB(pGlob) - GtkProgress dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkProgress_2II\n"); + fprintf(stderr, "gtk_signal_handler_block_by_func"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkProgressFids(env, dest, &PGLOB(GtkProgressFc)); - setGtkProgressFields(env, dest, dest1, &PGLOB(GtkProgressFc)); - } + gtk_signal_handler_block_by_func((GtkObject*)object, (GtkSignalFunc)func, (gpointer)data); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_signal_handler_unblock_by_func * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkProgressBar_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1signal_1handler_1unblock_1by_1func + (JNIEnv *env, jclass that, jint object, jint func, jint data) { - DECL_GLOB(pGlob) - GtkProgressBar src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkProgressBarFids(env, src, &PGLOB(GtkProgressBarFc)); - getGtkProgressBarFields(env, src, src1, &PGLOB(GtkProgressBarFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkProgressBar_2I\n"); + fprintf(stderr, "gtk_signal_handler_unblock_by_func"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_signal_handler_unblock_by_func((GtkObject*)object, (GtkSignalFunc)func, (gpointer)data); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_style_copy * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkProgressBar_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1style_1copy + (JNIEnv *env, jclass that, jint style) { - DECL_GLOB(pGlob) - GtkProgressBar dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkProgressBar_2II\n"); + fprintf(stderr, "gtk_style_copy"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkProgressBarFids(env, dest, &PGLOB(GtkProgressBarFc)); - setGtkProgressBarFields(env, dest, dest1, &PGLOB(GtkProgressBarFc)); - } + return (jint)gtk_style_copy((GtkStyle*)style); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_style_unref * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkRequisition_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1style_1unref + (JNIEnv *env, jclass that, jint style) { - DECL_GLOB(pGlob) - GtkRequisition src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkRequisitionFids(env, src, &PGLOB(GtkRequisitionFc)); - getGtkRequisitionFields(env, src, src1, &PGLOB(GtkRequisitionFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkRequisition_2I\n"); + fprintf(stderr, "gtk_style_unref"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_style_unref((GtkStyle*)style); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_text_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkRequisition_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1new + (JNIEnv *env, jclass that, jint hadj, jint vadj) { - DECL_GLOB(pGlob) - GtkRequisition dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkRequisition_2II\n"); + fprintf(stderr, "gtk_text_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkRequisitionFids(env, dest, &PGLOB(GtkRequisitionFc)); - setGtkRequisitionFields(env, dest, dest1, &PGLOB(GtkRequisitionFc)); - } + return (jint)gtk_text_new((GtkAdjustment*)hadj, (GtkAdjustment*)vadj); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_text_set_word_wrap * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkStyle_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1set_1word_1wrap + (JNIEnv *env, jclass that, jint text, jint word_wrap) { - DECL_GLOB(pGlob) - GtkStyle src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkStyleFids(env, src, &PGLOB(GtkStyleFc)); - getGtkStyleFields(env, src, src1, &PGLOB(GtkStyleFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkStyle_2I\n"); + fprintf(stderr, "gtk_text_set_word_wrap"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_text_set_word_wrap((GtkText*)text, (gint)word_wrap); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_text_get_length * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkStyle_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1get_1length + (JNIEnv *env, jclass that, jint text) { - DECL_GLOB(pGlob) - GtkStyle dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkStyle_2II\n"); + fprintf(stderr, "gtk_text_get_length"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkStyleFids(env, dest, &PGLOB(GtkStyleFc)); - setGtkStyleFields(env, dest, dest1, &PGLOB(GtkStyleFc)); - } + return (jint)gtk_text_get_length((GtkText*)text); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_toggle_button_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkWidget_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkWidget src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkWidgetFids(env, src, &PGLOB(GtkWidgetFc)); - getGtkWidgetFields(env, src, src1, &PGLOB(GtkWidgetFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkWidget_2I\n"); + fprintf(stderr, "gtk_toggle_button_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_toggle_button_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_toggle_button_set_active * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkWidget_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1set_1active + (JNIEnv *env, jclass that, jint toggle_button, jboolean is_active) { - DECL_GLOB(pGlob) - GtkWidget dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkWidget_2II\n"); + fprintf(stderr, "gtk_toggle_button_set_active"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkWidgetFids(env, dest, &PGLOB(GtkWidgetFc)); - setGtkWidgetFields(env, dest, dest1, &PGLOB(GtkWidgetFc)); - } + gtk_toggle_button_set_active((GtkToggleButton*)toggle_button, (gboolean)is_active); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_toggle_button_get_active * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkFrame_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toggle_1button_1get_1active + (JNIEnv *env, jclass that, jint toggle_button) { - DECL_GLOB(pGlob) - GtkFrame src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkFrameFids(env, src, &PGLOB(GtkFrameFc)); - getGtkFrameFields(env, src, src1, &PGLOB(GtkFrameFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkFrame_2I\n"); + fprintf(stderr, "gtk_toggle_button_get_active"); #endif - memmove((void*)dest, (void*)src1, count); + return (jboolean)gtk_toggle_button_get_active((GtkToggleButton*)toggle_button); } + /* - * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove - * Signature: + * Toolbar */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkFrame_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1TOOLBAR_1CHILD_1SPACE + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkFrame dest_struct={0}, *dest1 = NULL; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkFrame_2II\n"); -#endif + return (jint)GTK_TOOLBAR_CHILD_SPACE; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1TOOLBAR_1CHILD_1BUTTON + (JNIEnv *env, jclass that) +{ + return (jint)GTK_TOOLBAR_CHILD_BUTTON; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1TOOLBAR_1CHILD_1TOGGLEBUTTON + (JNIEnv *env, jclass that) +{ + return (jint)GTK_TOOLBAR_CHILD_TOGGLEBUTTON; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1TOOLBAR_1CHILD_1RADIOBUTTON + (JNIEnv *env, jclass that) +{ + return (jint)GTK_TOOLBAR_CHILD_RADIOBUTTON; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_GTK_1TOOLBAR_1CHILD_1WIDGET + (JNIEnv *env, jclass that) +{ + return (jint)GTK_TOOLBAR_CHILD_WIDGET; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1new + (JNIEnv *env, jclass that) +{ + return (jint)gtk_toolbar_new(); +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1insert_1element + (JNIEnv *env, jclass that, jint toolbar, jint type, jint widget, jbyteArray text, jbyteArray tooltip_text, jbyteArray tooltip_private_text, jint icon, jint callback, jint user_data, jint position) +{ + jint rc; + jbyte *text1 = NULL; + jbyte *tooltip_text1 = NULL; + jbyte *tooltip_private_text1 = NULL; + + if (text) { + text1 = (*env)->GetByteArrayElements(env, text, NULL); + } + if (tooltip_text) { + tooltip_text1 = (*env)->GetByteArrayElements(env, tooltip_text, NULL); + } + if (tooltip_private_text) { + tooltip_private_text1 = (*env)->GetByteArrayElements(env, tooltip_private_text, NULL); + } + rc = (jint)gtk_toolbar_insert_element((GtkToolbar*)toolbar, (GtkToolbarChildType)type, (GtkWidget*)widget, (char*)text1, (char*)tooltip_text1, (char*)tooltip_private_text1, (GtkWidget*)icon, (GtkSignalFunc)callback, (gpointer)user_data, (gint)position); + if (text) { + (*env)->ReleaseByteArrayElements(env, text, text1, 0); + } + if (tooltip_text) { + (*env)->ReleaseByteArrayElements(env, tooltip_text, tooltip_text1, 0); + } + if (tooltip_private_text) { + (*env)->ReleaseByteArrayElements(env, tooltip_private_text, tooltip_private_text1, 0); + } + return rc; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1insert_1widget + (JNIEnv *env, jclass that, jint toolbar, jint widget, jbyteArray tooltip_text, jbyteArray tooltip_private_text, jint position) +{ + jbyte *tooltip_text1 = NULL; + jbyte *tooltip_private_text1 = NULL; - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkFrameFids(env, dest, &PGLOB(GtkFrameFc)); - setGtkFrameFields(env, dest, dest1, &PGLOB(GtkFrameFc)); + if (tooltip_text) { + tooltip_text1 = (*env)->GetByteArrayElements(env, tooltip_text, NULL); + } + if (tooltip_private_text) { + tooltip_private_text1 = (*env)->GetByteArrayElements(env, tooltip_private_text, NULL); + } + gtk_toolbar_insert_widget((GtkToolbar*)toolbar, (GtkWidget*)widget, (char*)tooltip_text1, (char*)tooltip_private_text1, (gint)position); + if (tooltip_text) { + (*env)->ReleaseByteArrayElements(env, tooltip_text, tooltip_text1, 0); + } + if (tooltip_private_text) { + (*env)->ReleaseByteArrayElements(env, tooltip_private_text, tooltip_private_text1, 0); } } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_toolbar_set_orientation * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkWindow_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1set_1orientation + (JNIEnv *env, jclass that, jint toolbar, jint orientation) { - DECL_GLOB(pGlob) - GtkWindow src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkWindowFids(env, src, &PGLOB(GtkWindowFc)); - getGtkWindowFields(env, src, src1, &PGLOB(GtkWindowFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkWindow_2I\n"); + fprintf(stderr, "gtk_toolbar_set_orientation"); #endif - memmove((void*)dest, (void*)src1, count); + gtk_toolbar_set_orientation((GtkToolbar*)toolbar, (GtkOrientation)orientation); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_toolbar_set_button_relief * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkWindow_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1toolbar_1set_1button_1relief + (JNIEnv *env, jclass that, jint toolbar, jint relief) { - DECL_GLOB(pGlob) - GtkWindow dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkWindow_2II\n"); + fprintf(stderr, "gtk_toolbar_set_button_relief"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkWindowFids(env, dest, &PGLOB(GtkWindowFc)); - setGtkWindowFields(env, dest, dest1, &PGLOB(GtkWindowFc)); - } + gtk_toolbar_set_button_relief((GtkToolbar*)toolbar, (GtkReliefStyle)relief); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_tooltips_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCheckMenuItem_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1tooltips_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkCheckMenuItem src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCheckMenuItemFids(env, src, &PGLOB(GtkCheckMenuItemFc)); - getGtkCheckMenuItemFields(env, src, src1, &PGLOB(GtkCheckMenuItemFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCheckMenuItem_2I\n"); + fprintf(stderr, "gtk_tooltips_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_tooltips_new(); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_tooltips_set_tip * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCheckMenuItem_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1tooltips_1set_1tip + (JNIEnv *env, jclass that, jint tooltips, jint widget, jbyteArray tip_text, jbyteArray tip_private) { - DECL_GLOB(pGlob) - GtkCheckMenuItem dest_struct={0}, *dest1 = NULL; + jbyte *tip_text1 = NULL; + jbyte *tip_private1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCheckMenuItem_2II\n"); + fprintf(stderr, "gtk_tooltips_set_tip"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCheckMenuItemFids(env, dest, &PGLOB(GtkCheckMenuItemFc)); - setGtkCheckMenuItemFields(env, dest, dest1, &PGLOB(GtkCheckMenuItemFc)); + if (tip_text) { + tip_text1 = (*env)->GetByteArrayElements(env, tip_text, NULL); + } + if (tip_private) { + tip_private1 = (*env)->GetByteArrayElements(env, tip_private, NULL); + } + gtk_tooltips_set_tip((GtkTooltips*)tooltips, (GtkWidget*)widget, (gchar*)tip_text1, (gchar*)tip_private1); + if (tip_text) { + (*env)->ReleaseByteArrayElements(env, tip_text, tip_text1, 0); + } + if (tip_private) { + (*env)->ReleaseByteArrayElements(env, tip_private, tip_private1, 0); } } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_vbox_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkAdjustment_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vbox_1new + (JNIEnv *env, jclass that, jboolean homogeneous, jint spacing) { - DECL_GLOB(pGlob) - GtkAdjustment src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkAdjustmentFids(env, src, &PGLOB(GtkAdjustmentFc)); - getGtkAdjustmentFields(env, src, src1, &PGLOB(GtkAdjustmentFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkAdjustment_2I\n"); + fprintf(stderr, "gtk_vbox_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_vbox_new((gboolean)homogeneous, (gint)spacing); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_vscale_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkAdjustment_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vscale_1new + (JNIEnv *env, jclass that, jint adjustment) { - DECL_GLOB(pGlob) - GtkAdjustment dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkAdjustment_2II\n"); + fprintf(stderr, "gtk_vscale_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkAdjustmentFids(env, dest, &PGLOB(GtkAdjustmentFc)); - setGtkAdjustmentFields(env, dest, dest1, &PGLOB(GtkAdjustmentFc)); - } + return (jint)gtk_vscale_new((GtkAdjustment*)adjustment); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_vscrollbar_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkBox_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vscrollbar_1new + (JNIEnv *env, jclass that, jint adjustment) { - DECL_GLOB(pGlob) - GtkBox src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkBoxFids(env, src, &PGLOB(GtkBoxFc)); - getGtkBoxFields(env, src, src1, &PGLOB(GtkBoxFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkBox_2I\n"); + fprintf(stderr, "gtk_vscrollbar_new"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)gtk_vscrollbar_new((GtkAdjustment*)adjustment); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: gtk_vseparator_new * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkBox_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1vseparator_1new + (JNIEnv *env, jclass that) { - DECL_GLOB(pGlob) - GtkBox dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkBox_2II\n"); + fprintf(stderr, "gtk_vseparator_new"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkBoxFids(env, dest, &PGLOB(GtkBoxFc)); - setGtkBoxFields(env, dest, dest1, &PGLOB(GtkBoxFc)); - } + return (jint)gtk_vseparator_new(); } + + /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_list_free * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkHBox_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1free + (JNIEnv *env, jclass that, jint list) { - DECL_GLOB(pGlob) - GtkHBox src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkHBoxFids(env, src, &PGLOB(GtkHBoxFc)); - getGtkHBoxFields(env, src, src1, &PGLOB(GtkHBoxFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkHBox_2I\n"); + fprintf(stderr, "g_list_free"); #endif - memmove((void*)dest, (void*)src1, count); + g_list_free((GList*)list); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_list_append * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkHBox_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1append + (JNIEnv *env, jclass that, jint list, jint data) { - DECL_GLOB(pGlob) - GtkHBox dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkHBox_2II\n"); + fprintf(stderr, "g_list_append"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkHBoxFids(env, dest, &PGLOB(GtkHBoxFc)); - setGtkHBoxFields(env, dest, dest1, &PGLOB(GtkHBoxFc)); - } + return (jint)g_list_append((GList*)list, (gpointer)data); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_list_nth * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkMenuItem_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1nth + (JNIEnv *env, jclass that, jint list, jint n) { - DECL_GLOB(pGlob) - GtkMenuItem src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkMenuItemFids(env, src, &PGLOB(GtkMenuItemFc)); - getGtkMenuItemFields(env, src, src1, &PGLOB(GtkMenuItemFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkMenuItem_2I\n"); + fprintf(stderr, "g_list_nth"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)g_list_nth((GList*)list, n); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_list_length * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkMenuItem_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1length + (JNIEnv *env, jclass that, jint list) { - DECL_GLOB(pGlob) - GtkMenuItem dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkMenuItem_2II\n"); + fprintf(stderr, "g_list_length"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkMenuItemFids(env, dest, &PGLOB(GtkMenuItemFc)); - setGtkMenuItemFields(env, dest, dest1, &PGLOB(GtkMenuItemFc)); - } + return (jint)g_list_length((GList*)list); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_list_nth_data * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCListRow_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1list_1nth_1data + (JNIEnv *env, jclass that, jint list, jint n) { - DECL_GLOB(pGlob) - GtkCListRow src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCListRowFids(env, src, &PGLOB(GtkCListRowFc)); - getGtkCListRowFields(env, src, src1, &PGLOB(GtkCListRowFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCListRow_2I\n"); + fprintf(stderr, "g_list_nth_data"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)g_list_nth_data((GList*)list, n); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_slist_nth * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCListRow_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1nth + (JNIEnv *env, jclass that, jint list, jint n) { - DECL_GLOB(pGlob) - GtkCListRow dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCListRow_2II\n"); + fprintf(stderr, "g_slist_nth"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCListRowFids(env, dest, &PGLOB(GtkCListRowFc)); - setGtkCListRowFields(env, dest, dest1, &PGLOB(GtkCListRowFc)); - } + return (jint)g_slist_nth((GSList*)list, n); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_slist_length * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCListColumn_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1length + (JNIEnv *env, jclass that, jint list) { - DECL_GLOB(pGlob) - GtkCListColumn src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCListColumnFids(env, src, &PGLOB(GtkCListColumnFc)); - getGtkCListColumnFields(env, src, src1, &PGLOB(GtkCListColumnFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCListColumn_2I\n"); + fprintf(stderr, "g_slist_length"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)g_slist_length((GSList*)list); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_slist_nth_data * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCListColumn_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1slist_1nth_1data + (JNIEnv *env, jclass that, jint list, jint n) { - DECL_GLOB(pGlob) - GtkCListColumn dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCListColumn_2II\n"); + fprintf(stderr, "g_slist_nth_data"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCListColumnFids(env, dest, &PGLOB(GtkCListColumnFc)); - setGtkCListColumnFields(env, dest, dest1, &PGLOB(GtkCListColumnFc)); - } + return (jint)g_slist_nth_data((GSList*)list, n); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_malloc * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__ILorg_eclipse_swt_internal_gtk_GtkCTreeRow_2I - (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1malloc + (JNIEnv *env, jclass that, jint size) { - DECL_GLOB(pGlob) - GtkCTreeRow src_struct={0}, *src1 = NULL; - if (src) { - src1 = &src_struct; - cacheGtkCTreeRowFids(env, src, &PGLOB(GtkCTreeRowFc)); - getGtkCTreeRowFields(env, src, src1, &PGLOB(GtkCTreeRowFc)); - } #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_gtk_GtkCTreeRow_2I\n"); + fprintf(stderr, "g_malloc"); #endif - memmove((void*)dest, (void*)src1, count); + return (jint)g_malloc((gulong)size); } /* * Class: org_eclipse_swt_internal_gtk_OS - * Method: memmove + * Method: g_free * Signature: */ -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__Lorg_eclipse_swt_internal_gtk_GtkCTreeRow_2II - (JNIEnv *env, jclass that, jobject dest, jint src, jint count) +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1free + (JNIEnv *env, jclass that, jint mem) { - DECL_GLOB(pGlob) - GtkCTreeRow dest_struct={0}, *dest1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_gtk_GtkCTreeRow_2II\n"); + fprintf(stderr, "g_free"); #endif - memmove((void*)&dest_struct, (void*)src, count); - if (dest) { - dest1 = &dest_struct; - cacheGtkCTreeRowFids(env, dest, &PGLOB(GtkCTreeRowFc)); - setGtkCTreeRowFields(env, dest, dest1, &PGLOB(GtkCTreeRowFc)); - } + g_free((gpointer)mem); } -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__I_3BI - (JNIEnv *env, jclass that, jint dest, jbyteArray src, jint count) +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: g_strdup + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1strdup + (JNIEnv *env, jclass that, jbyteArray str) { - jbyte *src1; + jint rc; + jbyte *str1 = NULL; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__I_3BI\n"); + fprintf(stderr, "g_strdup"); #endif - if (src) { - src1 = (*env)->GetByteArrayElements(env, src, NULL); - memmove((void*)dest, (void*)src1, count); - (*env)->ReleaseByteArrayElements(env, src, src1, 0); + if (str) { + str1 = (*env)->GetByteArrayElements(env, str, NULL); } -} - -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove__I_3II - (JNIEnv *env, jclass that, jint dest, jintArray src, jint count) -{ - jint *src1; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__I_3II\n"); -#endif - - if (src) { - src1 = (*env)->GetIntArrayElements(env, src, NULL); - memmove((void*)dest, (void*)src1, count); - (*env)->ReleaseIntArrayElements(env, src, src1, 0); + rc = (jint)g_strdup((gchar*)str1); + if (str) { + (*env)->ReleaseByteArrayElements(env, str, str1, 0); } + return rc; } -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3III - (JNIEnv *env, jclass that, jintArray dest, jint src, jint count) +/* + * Class: org_eclipse_swt_internal_gtk_OS + * Method: g_get_home_dir + * Signature: + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1get_1home_1dir + (JNIEnv *env, jclass that) { - jint *dest1; #ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove__III\n"); + fprintf(stderr, "g_get_home_dir"); #endif - if (dest) { - dest1 = (*env)->GetIntArrayElements(env, dest, NULL); - memmove((void*)dest1, (void*)src, count); - (*env)->ReleaseIntArrayElements(env, dest, dest1, 0); - } + return (jint)g_get_home_dir(); } -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3BII - (JNIEnv *env, jclass that, jbyteArray dest, jint src, jint count) -{ - jbyte *dest1; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove___3BII\n"); -#endif - if (dest) { - dest1 = (*env)->GetByteArrayElements(env, dest, NULL); - memmove((void*)dest1, (void*)src, count); - (*env)->ReleaseByteArrayElements(env, dest, dest1, 0); - } -} -JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_memmove___3I_3BI - (JNIEnv *env, jclass that, jintArray dest, jbyteArray src, jint count) -{ - jint *dest1; - jbyte *src1; -#ifdef DEBUG_CALL_PRINTS - fprintf(stderr, "memmove___3I_3BI\n"); -#endif - if (src && dest) { - dest1 = (*env)->GetIntArrayElements(env, dest, NULL); - src1 = (*env)->GetByteArrayElements(env, dest, NULL); - memmove((void*)dest1, (void*)src1, count); - (*env)->ReleaseIntArrayElements(env, dest, dest1, 0); - (*env)->ReleaseByteArrayElements(env, src, src1, 0); - } -} +/* ***NON-GTK*** */ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_strlen (JNIEnv *env, jclass that, jint string) @@ -7837,6 +1693,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_strlen return (jint)strlen((char*)string); } + /* * Class: org_eclipse_swt_internal_gtk_OS * Method: XListFonts diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDKPIXBUF.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDKPIXBUF.java index 713ba8d723..d84a0bec18 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDKPIXBUF.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDKPIXBUF.java @@ -19,7 +19,7 @@ public class GDKPIXBUF extends OS { /* GdkColorspace enumeration */ /* R/G/B additive color space */ - public final static int GDK_COLORSPACE_RGB = 0; + public static final native int GDK_COLORSPACE_RGB(); /* GIF-like animation overlay modes for frames */ public final static int GDK_PIXBUF_FRAME_RETAIN = 0; @@ -215,11 +215,4 @@ public static final native int gdk_pixbuf_get_from_drawable ( int width, int height); - - -/* LOAD THE DLL */ - -static { - Library.loadLibrary ("swt-pixbuf"); -} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java deleted file mode 100644 index 6da6571c0a..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GdkEvent { - public int type; - public int window; - public byte send_event; - public static final int sizeof = 88; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventButton.java deleted file mode 100644 index 17d1febbcf..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventButton.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GdkEventButton extends GdkEvent { - public int time; - public long x; - public long y; - public long pressure; - public long xtilt; - public long ytilt; - public int state; - public int button; - public int source; - public int deviceid; - public long x_root; - public long y_root; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventExpose.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventExpose.java index 6fd9920e97..33dca749ec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventExpose.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventExpose.java @@ -13,10 +13,16 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GdkEventExpose extends GdkEvent { +public class GdkEventExpose { public short x; public short y; public short width; public short height; + public int region; public int count; + + GdkEventExpose() {}; + public GdkEventExpose(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java deleted file mode 100644 index 6e4acded51..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GdkEventKey extends GdkEvent { - public int time; - public int state; - public int keyval; - public int length; - public int string; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventMotion.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventMotion.java deleted file mode 100644 index 5a8d5b9c16..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventMotion.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GdkEventMotion extends GdkEvent { - public int time; - public long x; - public long y; - public long pressure; - public long xtilt; - public long ytilt; - public int state; - public int is_hint; - public int source; - public int deviceid; - public long x_root; - public long y_root; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkVisual.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkVisual.java index 3b0630a614..d95eccbd2e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkVisual.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkVisual.java @@ -28,5 +28,9 @@ public class GdkVisual { public int blue_mask; public int blue_shift; public int blue_prec; - public static final int sizeof = 56; + + private GdkVisual () {} + public GdkVisual (int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAdjustment.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAdjustment.java index b1a55987f6..fd982995cd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAdjustment.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAdjustment.java @@ -13,12 +13,16 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkAdjustment extends GtkObject { - public float lower; - public float upper; - public float value; - public float step_increment; - public float page_increment; - public float page_size; - public static final int sizeof = 40; +public class GtkAdjustment { + public double lower; + public double upper; + public double value; + public double step_increment; + public double page_increment; + public double page_size; + + private GtkAdjustment() {} + public GtkAdjustment (int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBin.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBin.java deleted file mode 100644 index d408fc5b42..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBin.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkBin extends GtkContainer { - public int child; - public static final int sizeof = 64; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBox.java deleted file mode 100644 index f948c7e4fd..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkBox.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkBox extends GtkContainer { - public int children; - public short spacing; - public int homogeneous; - public static final int sizeof = 68; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCList.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCList.java index cb4843b18c..5f9f19d6ac 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCList.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCList.java @@ -13,7 +13,7 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkCList extends GtkContainer { +public class GtkCList { public short clist_flags; public int row_mem_chunk; public int cell_mem_chunk; @@ -70,5 +70,9 @@ public class GtkCList extends GtkContainer { public int sort_type; public int compare; public int sort_column; - public static final int sizeof = 252; + + private GtkCList() {} + public GtkCList(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListColumn.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListColumn.java index 818924d046..d7548d1204 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListColumn.java @@ -31,4 +31,9 @@ public class GtkCListColumn { public int auto_resize; public int button_passive; public static final int sizeof = 40; + + private GtkCListColumn() {} + public GtkCListColumn(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListRow.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListRow.java index 73c9063ebd..fae41809eb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListRow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCListRow.java @@ -30,5 +30,9 @@ public class GtkCListRow { public int fg_set; // bitfield: 1 public int bg_set; // bitfield: 1 public int selectable; // bitfield: 1 - public static final int sizeof = 48; + + private GtkCListRow() {} + public GtkCListRow(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTree.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTree.java index 7f6bb8ef21..219af8611d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTree.java @@ -13,8 +13,12 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkCTree extends GtkCList { +public class GtkCTree { public int tree_indent; public int tree_column; - public static final int sizeof = 276; + + private GtkCTree() {} + public GtkCTree(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTreeRow.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTreeRow.java index ce9e4d6b4f..73ccc86315 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTreeRow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCTreeRow.java @@ -13,7 +13,7 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkCTreeRow extends GtkCListRow { +public class GtkCTreeRow { public int parent; public int sibling; public int children; @@ -24,5 +24,10 @@ public class GtkCTreeRow extends GtkCListRow { public short level; public int is_leaf; // bitfield: 1 public int expanded; // bitfield: 1 - public static final int sizeof = 80; + + + private GtkCTreeRow() {} + public GtkCTreeRow(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCheckMenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCheckMenuItem.java deleted file mode 100644 index ce3c4db9b3..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCheckMenuItem.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkCheckMenuItem extends GtkMenuItem { - public int active; - public int always_show_toggle; - public static final int sizeof = 88; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkColorSelectionDialog.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkColorSelectionDialog.java deleted file mode 100644 index b677e23d94..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkColorSelectionDialog.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkColorSelectionDialog extends GtkWindow { - public int colorsel; - public int main_vbox; - public int ok_button; - public int reset_button; - public int cancel_button; - public int help_button; - public static final int sizeof = 120; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java index 2b44b570d1..0389cf2480 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java @@ -13,20 +13,12 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkCombo extends GtkHBox { +public class GtkCombo { public int entry; - public int button; - public int popup; - public int popwin; public int list; - public int entry_change_id; - public int list_change_id; - public int value_in_list; // bitfield : 1 - public int ok_if_empty; // bitfield : 1 - public int case_sensitive; // bitfield : 1 - public int use_arrows; // bitfield : 1 - public int use_arrows_always; // bitfield : 1 - public short current_button; - public int activate_id; - public static final int sizeof = 104; + + private GtkCombo () {} + public GtkCombo (int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkContainer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkContainer.java deleted file mode 100644 index 52cb47acf2..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkContainer extends GtkWidget { - public int focus_child; - public int border_width; - public int need_resize; - public int resize_mode; - public int resize_widgets; - public static final int sizeof = 60; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkDialog.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkDialog.java deleted file mode 100644 index d4f2ddf603..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkDialog.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkDialog extends GtkWindow { - public int vbox; - public int action_area; - public static final int sizeof = 104; -} - diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkEditable.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkEditable.java index 8f2b772924..7ef967488f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkEditable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkEditable.java @@ -13,7 +13,7 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkEditable extends GtkWidget { +public class GtkEditable { public int current_pos; public int selection_start_pos; public int selection_end_pos; @@ -23,5 +23,9 @@ public class GtkEditable extends GtkWidget { public int ic; public int ic_attr; public int clipboard_text; - public static final int sizeof = 76; + + private GtkEditable() {} + public GtkEditable(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java deleted file mode 100644 index ebaf37d250..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkFileSelection extends GtkWindow { - public int dir_list; - public int file_list; - public int selection_entry; - public int selection_text; - public int main_vbox; - public int ok_button; - public int cancel_button; - public int help_button; - public int history_pulldown; - public int history_menu; - public int history_list; - public int fileop_dialog; - public int fileop_entry; - public int fileop_file; - public int cmpl_state; - public int fileop_c_dir; - public int fileop_del_file; - public int fileop_ren_file; - public int button_area; - public int action_area; - public static final int sizeof = 176; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFontSelectionDialog.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFontSelectionDialog.java deleted file mode 100644 index 09ee75981c..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFontSelectionDialog.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkFontSelectionDialog extends GtkWindow { - public int fontsel; - public int main_vbox; - public int action_area; - public int ok_button; - public int apply_button; - public int cancel_button; - public int dialog_width; - public int auto_resize; - public static final int sizeof = 132; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFrame.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFrame.java deleted file mode 100644 index 0541461e5b..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFrame.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkFrame extends GtkBin { - public int label; - public short shadow_type; - public short label_width; - public short label_height; - public float label_xalign; - public float label_yalign; - public static final int sizeof = 84; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkHBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkHBox.java deleted file mode 100644 index 656601480a..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkHBox.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkHBox extends GtkBox { - public static final int sizeof = 68; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkItem.java deleted file mode 100644 index 80db35e791..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkItem.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkItem extends GtkBin { - public static final int sizeof = 64; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkMenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkMenuItem.java deleted file mode 100644 index ed4542029e..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkMenuItem.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkMenuItem extends GtkItem { - public int submenu; - public int accelerator_signal; - public int toggle_size; - public int accelerator_width; - public int show_toggle_indicator; - public int show_submenu_indicator; - public int submenu_placement; - public int submenu_direction; - public int right_justify; - public int timer; - public static final int sizeof = 84; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkObject.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkObject.java deleted file mode 100644 index 226d4a7d0c..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkObject.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkObject { - public int klass; - public int flags; - public int ref_count; - public int object_data; - public static final int sizeof = 16; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkRequisition.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkRequisition.java index 0c12fe44f0..d9134d4369 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkRequisition.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkRequisition.java @@ -16,5 +16,6 @@ package org.eclipse.swt.internal.gtk; public class GtkRequisition { public short width; public short height; - public static final int sizeof = 4; + + public GtkRequisition() {} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyle.java index a07067261a..e92aad2bb1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyle.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyle.java @@ -14,7 +14,6 @@ package org.eclipse.swt.internal.gtk; */ public class GtkStyle { - public int klass; public int fg0_pixel; public short fg0_red, fg0_green, fg0_blue; public int fg1_pixel; @@ -85,11 +84,16 @@ public class GtkStyle { public short base3_red, base3_green, base3_blue; public int base4_pixel; public short base4_red, base4_green, base4_blue; + public int black_pixel; public short black_red, black_green, black_blue; public int white_pixel; public short white_red, white_green, white_blue; - public int font; + + public int font_desc; + + public int xthickness, ythickness; + public int fg_gc0, fg_gc1, fg_gc2, fg_gc3, fg_gc4; public int bg_gc0, bg_gc1, bg_gc2, bg_gc3, bg_gc4; public int light_gc0, light_gc1, light_gc2, light_gc3, light_gc4; @@ -100,13 +104,9 @@ public class GtkStyle { public int black_gc; public int white_gc; public int bg_pixmap0, bg_pixmap1, bg_pixmap2, bg_pixmap3, bg_pixmap4, bg_pixmap5; - public int ref_count; - public int attach_count; - public int depth; - public int colormap; - public int engine; - public int engine_data; - public int rc_style; - public int styles; - public static final int sizeof = 652; + + private GtkStyle() {} + public GtkStyle(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyleClass.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyleClass.java index a086ab46fd..445f494e8d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyleClass.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkStyleClass.java @@ -16,5 +16,9 @@ package org.eclipse.swt.internal.gtk; public class GtkStyleClass { public int xthickness; public int ythickness; - public static final int sizeof = 8; + + private GtkStyleClass() {} + public GtkStyleClass(int ptr) { + OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkText.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkText.java index fda4196346..005e7e62e9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkText.java @@ -13,7 +13,7 @@ package org.eclipse.swt.internal.gtk; * this distribution shall govern. */ -public class GtkText extends GtkEditable { +public class GtkText { public int first_line_start_index; public int first_onscreen_hor_pixel; public int first_onscreen_ver_pixel; @@ -21,5 +21,9 @@ public class GtkText extends GtkEditable { public int cursor_pos_x; public int cursor_pos_y; public int cursor_virtual_x; - public static final int sizeof = 244; + + private GtkText() {} + public GtkText(int ptr) { +// OS.memmove(this, ptr); + } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWidget.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWidget.java deleted file mode 100644 index 405fbeb6b2..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWidget.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkWidget extends GtkObject { - public short private_flags; - public byte state; - public byte saved_state; - public int name; - public int style; - public short req_width; - public short req_height; - public short alloc_x; - public short alloc_y; - public short alloc_width; - public short alloc_height; - public int window; - public int parent; - public static final int sizeof = 48; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWindow.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWindow.java deleted file mode 100644 index 152dc729f1..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkWindow.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.swt.internal.gtk; - -/* - * Copyright (c) IBM Corp. 2000, 2001. All rights reserved. - * - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - */ - -public class GtkWindow extends GtkBin { - public int title; - public int wmclass_name; - public int wmclass_class; - public int type; - public int focus_widget; - public int default_widget; - public int transient_parent; - public short resize_count; - public int allow_shrink; - public int allow_grow; - public int auto_shrink; - public int handling_resize; - public int position; - public int use_uposition; - public int modal; - public static final int sizeof = 96; -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 2433905716..2823c06148 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -208,11 +208,12 @@ public class OS { public static final int GTK_PROGRESS_RIGHT_TO_LEFT = 1; public static final int GTK_PROGRESS_BOTTOM_TO_TOP = 2; public static final int GTK_PROGRESS_TOP_TO_BOTTOM = 3; - public static final int GTK_TOOLBAR_CHILD_SPACE = 0; - public static final int GTK_TOOLBAR_CHILD_BUTTON = 1; - public static final int GTK_TOOLBAR_CHILD_TOGGLEBUTTON = 2; - public static final int GTK_TOOLBAR_CHILD_RADIOBUTTON = 3; - public static final int GTK_TOOLBAR_CHILD_WIDGET = 4; + +public static final native int GTK_TOOLBAR_CHILD_SPACE(); +public static final native int GTK_TOOLBAR_CHILD_BUTTON(); +public static final native int GTK_TOOLBAR_CHILD_TOGGLEBUTTON(); +public static final native int GTK_TOOLBAR_CHILD_RADIOBUTTON(); +public static final native int GTK_TOOLBAR_CHILD_WIDGET(); public static final int G_LOG_FLAG_RECURSION = 1 << 0; public static final int G_LOG_FLAG_FATAL = 1 << 1; @@ -223,15 +224,95 @@ public class OS { // public static final int G_LOG_LEVEL_INFO = 1 << 6; // public static final int G_LOG_LEVEL_DEBUG = 1 << 7; public static final int G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL); - + + + + +/* + * Native methods. + */ + +/* GLIB */ + +public static final native void g_signal_connect (int handle, String eventName, int proc, int swtEvent); +public static final native void g_signal_connect_after (int handle, String eventName, int proc, int swtEvent); + + +/* + * Main loop + */ + +public static final native int gtk_set_locale(); +public static final native boolean gtk_init_check(int[] argc, int[] argv); + + + + +/* GtkWidget */ public static final native int GTK_WIDGET_FLAGS(int wid); public static final native void GTK_WIDGET_SET_FLAGS(int wid,int flag); public static final native void GTK_WIDGET_UNSET_FLAGS(int wid,int flag); +public static final native int GTK_WIDGET_WINDOW(int wid); +public static final native int GTK_WIDGET_PARENT(int wid); public static final native boolean GTK_WIDGET_NO_WINDOW(int wid); -public static final native void gdk_rgb_init(); public static final native boolean GTK_WIDGET_SENSITIVE(int wid); public static final native boolean GTK_WIDGET_IS_SENSITIVE(int wid); -public static final native void memmove(GtkStyleClass dest, int src, int size); +public static final native boolean GTK_WIDGET_TOPLEVEL(int wid); +public static final native boolean GTK_WIDGET_REALISED(int wid); +public static final native boolean GTK_WIDGET_MAPPED(int wid); +public static final native boolean GTK_WIDGET_VISIBLE(int wid); +public static final native boolean GTK_WIDGET_DRAWABLE(int wid); +public static final native boolean GTK_WIDGET_CAN_FOCUS(int wid); +public static final native boolean GTK_WIDGET_HAS_FOCUS(int wid); +public static final native boolean GTK_WIDGET_HAS_GRAB(int wid); + + +/* GtkWindow and Dialogs */ + +public static final native int GTK_FONT_SELECTION_DIALOG_OK_BUTTON(int handle); +public static final native int GTK_FONT_SELECTION_DIALOG_CANCEL_BUTTON(int handle); +public static final native int GTK_FILE_SELECTION_OK_BUTTON(int handle); +public static final native int GTK_FILE_SELECTION_CANCEL_BUTTON(int handle); +public static final native int GTK_COLOR_SELECTION_OK_BUTTON(int handle); +public static final native int GTK_COLOR_SELECTION_CANCEL_BUTTON(int handle); +public static final native int GTK_COLOR_SELECTION_HELP_BUTTON(int handle); +public static final native int GTK_COLOR_SELECTION_COLORSEL(int handle); +public static final native int GTK_DIALOG_ACTION_AREA(int handle); +public static final native int GTK_DIALOG_VBOX(int handle); +public static final native void gtk_window_get_position(int handle, int[] x, int[] y); +public static final native void gtk_window_get_size(int handle, int[] x, int[] y); +public static final native void gtk_window_move(int handle, int x, int y); +public static final native void gtk_window_resize(int handle, int x, int y); +public static final native void gtk_window_iconify(int handle); +public static final native void gtk_window_deiconify(int handle); +public static final native void gtk_window_maximize(int handle); +public static final native void gtk_window_unmaximize(int handle); + + + +/* Menus */ + +public static final native boolean gtk_check_menu_item_get_active(int wid); +public static final native void gtk_check_menu_item_set_active(int wid, boolean active); + +/* Containers */ + +public static final native int eclipse_fixed_new(); +public static final native void eclipse_fixed_get_location(int fixed, int child, int[] loc); +public static final native boolean eclipse_fixed_get_size(int fixed, int child, int[] sz); +public static final native void eclipse_fixed_set_location(int fixed, int child, int x, int y); +public static final native void eclipse_fixed_set_size(int fixed, int child, int width, int height); +public static final native void eclipse_fixed_move_above(int fixed, int child, int sibling); +public static final native void eclipse_fixed_move_below(int fixed, int child, int sibling); + + +/* GDK */ + +public static final native void gdk_rgb_init(); +public static final native int gdk_font_from_description(int desc); + + + public static final native void gtk_signal_handler_block_by_data(int object, int data); public static final native void gtk_signal_handler_unblock_by_data(int object, int data); public static final native int gtk_object_get_data_by_id(int object, int data_id); @@ -267,6 +348,8 @@ public static final native int gdk_cursor_new(int cursor_type); public static final native int gdk_bitmap_create_from_data(int window, byte[] data, int width, int height); public static final native int gdk_cursor_new_from_pixmap(int source, int mask, GdkColor fg, GdkColor bg, int x, int y); public static final native void gdk_cursor_destroy(int cursor); +public static final native int GDK_FONT_ASCENT(int font); +public static final native int GDK_FONT_DESCENT(int font); public static final native int gdk_font_load(byte[] font_name); public static final native int gdk_font_ref(int font); public static final native void gdk_font_unref(int font); @@ -297,12 +380,29 @@ public static final native boolean gdk_color_white(int colormap, GdkColor color) public static final native int gdk_image_get(int window, int x, int y, int width, int height); public static final native int gdk_image_get_pixel(int image, int x, int y); public static final native void gdk_gc_set_exposures(int gc, boolean exposures); + + +/* + * GdkEvents + */ public static final native int gdk_event_get_graphics_expose(int window); public static final native void gdk_event_free(int event); +public static final native int gdk_event_get_time(int event); +public static final native boolean gdk_event_get_state(int event, int[] pmod); +public static final native boolean gdk_event_get_coords(int event, double[] px, double[] py); +public static final native boolean gdk_event_get_root_coords(int event, double[] px, double[] py); +public static final native int gdk_event_key_get_keyval(int event); +public static final native int gdk_event_key_get_length(int event); +public static final native String gdk_event_key_get_string(int event); +public static final native int gdk_event_button_get_button(int event); + + + public static final native void gdk_flush(); public static final native void gdk_beep(); public static final native void gdk_color_free(GdkColor color); public static final native int GDK_ROOT_PARENT(); +public static final native int GDK_EVENT_TYPE(int event); public static final native void gdk_gc_set_stipple(int gc, int stipple); public static final native void gdk_gc_set_subwindow(int gc, int mode); public static final native void gdk_gc_set_fill(int gc, int fill); @@ -332,9 +432,10 @@ public static final native void gdk_window_clear_area_e(int window, int x, int y public static final native void gdk_window_resize(int window, int width, int height); public static final native void gdk_window_move (int window, int x, int y); public static final native int gdk_window_at_pointer(int[] win_x, int[] win_y); -public static final native int gdk_time_get(); +public static final native int GDK_CURRENT_TIME(); public static final native int gdk_screen_width_mm(); -public static final native void gdk_window_get_geometry(int window, int[] x, int[] y, int[] width, int[] height, int[] depth); +public static final native void gdk_drawable_get_size(int drawable, int[] width, int[] height); +public static final native int gdk_drawable_get_depth(int drawable); public static final native void gdk_window_raise(int window); public static final native void gdk_window_lower(int window); public static final native int gdk_window_get_origin(int window, int[] x, int[] y); @@ -370,7 +471,6 @@ public static final native void gtk_clist_freeze(int clist); public static final native void gtk_clist_get_pixtext(int clist, int row, int column, int[] text, int[] spacing, int[] pixmap, int[] mask); public static final native void gtk_check_menu_item_set_show_toggle(int menu_item, boolean always); public static final native void gtk_clist_column_titles_passive(int clist); -public static final native void gtk_check_menu_item_set_active(int check_menu_item, boolean is_active); public static final native int gtk_clist_insert(int clist, int row, int[] text); public static final native int gtk_clist_new(int columns); public static final native void gtk_clist_set_selection_mode(int clist, int mode); @@ -424,9 +524,7 @@ public static final native int gtk_dialog_new(); public static final native int gtk_event_box_new(); public static final native int gtk_editable_get_position(int editable); public static final native void gtk_editable_set_position(int editable, int position); -public static final native int gtk_fixed_new(); public static final native void gtk_entry_set_editable(int entry, boolean editable); -public static final native void gtk_fixed_put(int fixed, int widget, short x, short y); public static final native int gtk_entry_get_text(int entry); public static final native void gtk_entry_set_text(int entry, byte[] text); public static final native void gtk_editable_select_region(int editable, int start, int end); @@ -442,18 +540,18 @@ public static final native int gtk_font_selection_dialog_get_font_name(int fsd); public static final native int gtk_font_selection_dialog_new(byte[] title); public static final native boolean gtk_font_selection_dialog_set_font_name(int fsd, byte[] fontname); public static final native void gtk_editable_set_editable(int editable, boolean is_editable); -public static final native boolean gtk_font_selection_set_font_name(int fontsel, byte[] fontname); public static final native int gtk_entry_new(); public static final native void gtk_entry_append_text(int entry, byte[] text); public static final native void gtk_editable_delete_selection(int editable); public static final native int gtk_editable_get_chars(int editable, int start_pos, int end_pos); public static final native void gtk_entry_set_visibility(int entry, boolean visible); public static final native void gtk_entry_set_max_length(int entry, short max); -public static final native void gtk_fixed_move(int fixed, int widget, short x, short y); -public static final native boolean gtk_init_check(int[] argc, int[] argv); +/* frame */ public static final native int gtk_frame_new(byte[] label); public static final native void gtk_frame_set_shadow_type(int frame, int type); public static final native void gtk_frame_set_label(int frame, byte[] label); +public static final native void swt_frame_get_trim(int handle, int[] trims); + public static final native int gtk_hseparator_new(); public static final native int gtk_hbox_new(boolean homogeneous, int spacing); public static final native void gtk_grab_add(int widget); @@ -462,7 +560,7 @@ public static final native void gtk_grab_remove(int widget); public static final native int gtk_hscale_new(int adjustment); public static final native int gtk_hscrollbar_new(int adjustment); public static final native void gtk_label_set_justify(int label, int jtype); -public static final native int gtk_label_new(byte[] str); +public static final native int gtk_label_new(String label); public static final native void gtk_label_set_pattern(int label, byte[] pattern); public static final native void gtk_main_quit(); public static final native void gtk_main(); @@ -493,6 +591,7 @@ public static final native void gtk_notebook_set_page(int notebook, int page_num public static final native void gtk_object_set_user_data(int object, int data); public static final native int gtk_object_get_user_data(int object); public static final native int gtk_pixmap_new(int pixmap, int mask); +public static final native double gtk_adjustment_get_value(int adj); public static final native int gtk_progress_bar_new(); public static final native void gtk_progress_bar_set_orientation(int pbar, int orientation); public static final native void gtk_progress_bar_set_bar_style(int pbar, int style); @@ -526,7 +625,7 @@ public static final native void gtk_timeout_remove(int timeout_handler_id); public static final native int gtk_text_new(int hadj, int vadj); public static final native void gtk_text_set_word_wrap(int text, int word_wrap); public static final native int gtk_text_get_length(int text); -public static final native int gtk_toolbar_new(int orientation, int style); +public static final native int gtk_toolbar_new(); public static final native void gtk_toolbar_set_button_relief(int toolbar, int relief); public static final native void gtk_toolbar_insert_widget(int toolbar, int widget, byte[] tooltip_text, byte[] tooltip_private_text, int position); public static final native void gtk_toolbar_set_orientation(int toolbar, int orientation); @@ -565,99 +664,107 @@ public static final native void gtk_widget_queue_draw(int widget); public static final native void gtk_widget_set_style(int widget, int style); public static final native void gtk_widget_set_sensitive(int widget, boolean sensitive); public static final native void gtk_widget_set_state(int widget, int state); -public static final native int gtk_window_new(int type); public static final native void gtk_widget_size_request(int widget, GtkRequisition requisition); public static final native void gtk_widget_set_uposition(int widget, int x, int y); public static final native void gtk_widget_set_usize(int widget, int width, int height); public static final native void gtk_widget_remove_accelerator(int widget, int accel_group, int accel_key, int accel_mods); public static final native void gtk_widget_set_parent(int widget, int parent); -public static final native void gtk_window_add_accel_group(int window, int accel_group); +public static final native void gtk_widget_modify_font(int widget, int pango_font_descr); +public static final native void gtk_widget_reparent(int widget, int new_parent); +public static final native void gtk_widget_size_allocate(int widget, GtkAllocation allocation); + + +/* gtk_window_* */ +public static final native int gtk_window_new(int type); +public static final native void gtk_window_set_title(int window, byte[] title); public static final native void gtk_window_set_policy(int window, int allow_shrink, int allow_grow, int auto_shrink); +public static final native void gtk_window_set_resizable(int window, boolean resizable); +public static final native int gtk_window_get_focus(int window); + + public static final native void gtk_window_set_modal(int window, boolean modal); -public static final native void gtk_window_set_title(int window, byte[] title); +public static final native void gtk_window_add_accel_group(int window, int accel_group); public static final native void gtk_window_set_transient_for(int window, int parent); -public static final native void gtk_widget_reparent(int widget, int new_parent); -public static final native void gtk_widget_size_allocate(int widget, GtkAllocation allocation); + + + +/* Pango */ +public static final native int PANGO_WEIGHT_NORMAL(); +public static final native int PANGO_WEIGHT_BOLD(); +public static final native int PANGO_STYLE_NORMAL(); +public static final native int PANGO_STYLE_ITALIC(); +public static final native int PANGO_STYLE_OBLIQUE(); +public static final native int PANGO_SCALE(); +public static final native int PANGO_STRETCH_NORMAL(); + +public static final native int PANGO_PIXELS(int dimension); + +public static final native int pango_context_new(); +public static final native int pango_context_get_font_description(int context); +public static final native void pango_context_set_font_description(int context, int descr); +public static final native int pango_context_get_metrics(int context, int desc, String language); + + +public static final native int pango_font_description_new(); +public static final native int pango_font_description_from_string(String str); +public static final native String pango_font_description_to_string(int desc); +public static final native boolean pango_font_description_equal(int desc1, int desc2); +public static final native void pango_font_description_free(int desc); +public static final native String pango_font_description_get_family(int desc); +public static final native void pango_font_description_set_family(int desc, String style); +public static final native int pango_font_description_get_size(int desc); +public static final native void pango_font_description_set_size(int desc, int size); +public static final native void pango_font_description_set_stretch(int desc, int stretch); +public static final native int pango_font_description_get_style(int desc); +public static final native void pango_font_description_set_style(int desc, int weight); +public static final native int pango_font_description_get_weight(int desc); +public static final native void pango_font_description_set_weight(int desc, int weight); + +public static final native int pango_font_metrics_get_ascent(int metrics); +public static final native int pango_font_metrics_get_descent(int metrics); +public static final native int pango_font_metrics_get_approximate_char_width(int metrics); + + + + + + +/* Other */ + public static final native int XListFonts(byte[] pattern, int maxFonts, int[] pnum_fonts); -public static final native void memmove(int[] dest, int src, int size); public static final native int strlen (int str); -/* NEW MEMMOVES - doesn't work because of inheritance of natives */ + + +/* Primitive memmoves */ +public static final native void memmove(int[] dest, int src, int size); public static final native void memmove(byte[] dest, int src, int size); -public static final native void memmove(int dest, GtkStyle src, int size); -public static final native void memmove(GdkFont dest, int src, int size); -public static final native void memmove(GtkStyle dest, int src, int size); public static final native void memmove(int[] dest, byte[] src, int size); public static final native void memmove(int dest, byte[] src, int size); -public static final native void memmove(GdkColor dest, int src, int size); -public static final native void memmove(GdkEventButton dest, int src, int size); -public static final native void memmove(GdkEventExpose dest, int src, int size); -public static final native void memmove(GdkEventKey dest, int src, int size); -public static final native void memmove(GdkEventMotion dest, int src, int size); public static final native void memmove(int dest, int[] src, int size); -public static final native void memmove(GdkVisual dest, int src, int size); -public static final native void memmove(GtkAdjustment dest, int src, int size); -public static final native void memmove(GtkBin dest, int src, int size); -public static final native void memmove(GtkCList dest, int src, int size); -public static final native void memmove(GtkCombo dest, int src, int size); -public static final native void memmove(GtkContainer dest, int src, int size); -public static final native void memmove(GtkCTreeRow dest, int src, int size); -public static final native void memmove(GtkEditable dest, int src, int size); -public static final native void memmove(GtkDialog dest, int src, int size); -public static final native void memmove(GtkObject dest, int src, int size); -public static final native void memmove(GtkWidget dest, int src, int size); -public static final native void memmove(int dest, GtkAdjustment src, int size); -public static final native void memmove(int dest, GtkBin src, int size); -public static final native void memmove(int dest, GtkCListColumn src, int size); -public static final native void memmove(GtkCListRow dest, int src, int size); -public static final native void memmove(GtkCListColumn dest, int src, int size); + + +/* Read memmoves */ +static final native void memmove(GdkVisual dest, int src); +static final native void memmove(GdkFont dest, int src); +static final native void memmove(GdkColor dest, int src); +static final native void memmove(GdkEventExpose dest, int src); +static final native void memmove(GtkAdjustment dest, int src); +static final native void memmove(GtkCombo dest, int src); +static final native void memmove(GtkEditable dest, int src); +static final native void memmove(GtkStyle dest, int src); +static final native void memmove(GtkStyleClass dest, int src); +static final native void memmove(GtkCListRow dest, int src); +static final native void memmove(GtkCListColumn dest, int src); +static final native void memmove(GtkCList dest, int src); +static final native void memmove(GtkCTreeRow dest, int src); +static final native void memmove(GtkCTree dest, int src); + +/* Write memmoves */ public static final native void memmove(int dest, GtkEditable src, int size); public static final native void memmove(int dest, GtkText src, int size); -public static final native void memmove(int dest, GtkObject src, int size); - -/* OLD MEMMOVES - these need to be pruned */ -public static final native void memmove(int dest, GdkColor src, int size); -public static final native void memmove(int dest, GdkEventButton src, int size); -public static final native void memmove(int dest, GdkEventExpose src, int size); -public static final native void memmove(int dest, GdkEventKey src, int size); -public static final native void memmove(int dest, GdkEventMotion src, int size); -public static final native void memmove(int dest, GdkGCValues src, int size); -public static final native void memmove(int dest, GdkRectangle src, int size); -public static final native void memmove(int dest, GdkVisual src, int size); -public static final native void memmove(int dest, GtkAllocation src, int size); -//public static final native void memmove(int dest, GtkArg src, int size); -public static final native void memmove(int dest, GtkBox src, int size); -public static final native void memmove(int dest, GtkCList src, int size); -public static final native void memmove(int dest, GtkCListRow src, int size); -public static final native void memmove(int dest, GtkCTreeRow src, int size); -public static final native void memmove(int dest, GtkCheckMenuItem src, int size); -public static final native void memmove(int dest, GtkColorSelectionDialog src, int size); -public static final native void memmove(int dest, GtkCombo src, int size); -public static final native void memmove(int dest, GtkContainer src, int size); -//public static final native void memmove(int dest, GtkData src, int size); -public static final native void memmove(int dest, GtkFileSelection src, int size); -public static final native void memmove(int dest, GtkFontSelectionDialog src, int size); -public static final native void memmove(int dest, GtkHBox src, int size); -public static final native void memmove(int dest, GtkMenuItem src, int size); -public static final native void memmove(int dest, GtkRequisition src, int size); -public static final native void memmove(int dest, GtkWidget src, int size); -public static final native void memmove(int dest, GtkWindow src, int size); -public static final native void memmove(int dest, GtkCTree src, int size); -public static final native void memmove(GdkGCValues dest, int src, int size); -public static final native void memmove(GdkRectangle dest, int src, int size); -public static final native void memmove(GtkAllocation dest, int src, int size); -//public static final native void memmove(GtkArg dest, int src, int size); -public static final native void memmove(GtkBox dest, int src, int size); -public static final native void memmove(GtkCheckMenuItem dest, int src, int size); -public static final native void memmove(GtkColorSelectionDialog dest, int src, int size); -//public static final native void memmove(GtkData dest, int src, int size); -public static final native void memmove(GtkFrame dest, int src, int size); -public static final native void memmove(GtkFileSelection dest, int src, int size); -public static final native void memmove(GtkFontSelectionDialog dest, int src, int size); -public static final native void memmove(GtkHBox dest, int src, int size); -public static final native void memmove(GtkMenuItem dest, int src, int size); -public static final native void memmove(GtkRequisition dest, int src, int size); -public static final native void memmove(GtkText dest, int src, int size); -public static final native void memmove(GtkWindow dest, int src, int size); -public static final native void memmove(GtkCTree dest, int src, int size); +public static final native void memmove(int dest, GtkStyle src, int size); +public static final native void memmove(int dest, GtkAdjustment src); // sure needed +public static final native void memmove(int dest, GtkCListColumn src, int size); + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java index 9d479b0265..f7ed467d1d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java @@ -29,8 +29,6 @@ public final class Color { */ public GdkColor handle; Device display; - boolean isSystem; - Color() { } /** @@ -90,7 +88,6 @@ public Color(Device display, RGB rgb) { * they allocate. */ public void dispose() { - if (isSystem) return; /** * If this is a palette-based display, * Decrease the reference count for this color. @@ -235,20 +232,13 @@ public static Color gtk_new(GdkColor gdkColor) { Color color = new Color(null, gtk_getRGBIntensities(gdkColor)); return color; } -public static Color gtk_new_system(GdkColor gdkColor) { - Color color = new Color(null, gtk_getRGBIntensities(gdkColor)); - color.isSystem = true; - return color; -} static RGB gtk_getRGBIntensities(GdkColor gdkColor) { boolean intensitiesAreZero = (gdkColor.red==0) && (gdkColor.green==0) && (gdkColor.blue==0); if (!intensitiesAreZero) return new RGB ((gdkColor.red&0xFF00)>>8, (gdkColor.green&0xFF00)>>8, (gdkColor.blue&0xFF00)>>8 ); - GdkVisual visual = new GdkVisual(); - OS.memmove(visual, OS.gdk_visual_get_system(), GdkVisual.sizeof); - + GdkVisual visual = new GdkVisual(OS.gdk_visual_get_system()); int r = (gdkColor.pixel&visual.red_mask) >> visual.red_shift; if (visual.red_prec<8) r = r << (8 - visual.red_prec); else r = r >> (visual.red_prec - 8); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/DefaultGtkStyle.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/DefaultGtkStyle.java deleted file mode 100644 index 952fa9d404..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/DefaultGtkStyle.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.eclipse.swt.graphics; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.internal.gtk.*; - -class DefaultGtkStyle { - - private static DefaultGtkStyle instance = null; - private GtkStyle style = null; - private int defaultFont; - - public Color foregroundColorNORMAL() { - return new Color(null, - ((short)0xFF00 & style.fg0_red)>>8, - ((short)0xFF00 & style.fg0_green)>>8, - ((short)0xFF00 & style.fg0_blue)>>8); - } - - public Color backgroundColorNORMAL() { - return new Color(null, - ((short)0xFF00 & style.bg0_red)>>8, - ((short)0xFF00 & style.bg0_green)>>8, - ((short)0xFF00 & style.bg0_blue)>>8); - } - - public Color foregroundColorACTIVE() { - return new Color(null, - ((short)0xFF00 & style.fg1_red)>>8, - ((short)0xFF00 & style.fg1_green)>>8, - ((short)0xFF00 & style.fg1_blue)>>8); - } - - public Color backgroundColorACTIVE() { - return new Color(null, - ((short)0xFF00 & style.bg1_red)>>8, - ((short)0xFF00 & style.bg1_green)>>8, - ((short)0xFF00 & style.bg1_blue)>>8); - } - - public Color foregroundColorPRELIGHT() { - return new Color(null, - ((short)0xFF00 & style.fg2_red)>>8, - ((short)0xFF00 & style.fg2_green)>>8, - ((short)0xFF00 & style.fg2_blue)>>8); - } - - public Color backgroundColorPRELIGHT() { - return new Color(null, - ((short)0xFF00 & style.bg2_red)>>8, - ((short)0xFF00 & style.bg2_green)>>8, - ((short)0xFF00 & style.bg2_blue)>>8); - } - - public Color foregroundColorSELECTED() { - return new Color(null, - ((short)0xFF00 & style.fg3_red)>>8, - ((short)0xFF00 & style.fg3_green)>>8, - ((short)0xFF00 & style.fg3_blue)>>8); - } - - public Color backgroundColorSELECTED() { - return new Color(null, - ((short)0xFF00 & style.bg3_red)>>8, - ((short)0xFF00 & style.bg3_green)>>8, - ((short)0xFF00 & style.bg3_blue)>>8); - } - - public Color foregroundColorINSENSITIVE() { - return new Color(null, - ((short)0xFF00 & style.fg4_red)>>8, - ((short)0xFF00 & style.fg4_green)>>8, - ((short)0xFF00 & style.fg4_blue)>>8); - } - - public Color backgroundColorINSENSITIVE() { - return new Color(null, - ((short)0xFF00 & style.bg4_red)>>8, - ((short)0xFF00 & style.bg4_green)>>8, - ((short)0xFF00 & style.bg4_blue)>>8); - } - - public int loadDefaultFont() { - if (defaultFont == 0) { - int fnames = Font.getFontNameList(style.font); - int slength = OS.g_slist_length(fnames); - if (slength < 1) SWT.error(SWT.ERROR_UNSPECIFIED); - int name1 = OS.g_slist_nth_data(fnames, 0); - int length = OS.strlen(name1); - byte [] buffer1 = new byte[length]; - OS.memmove(buffer1, name1, length); - defaultFont = OS.gdk_font_load(buffer1); - if (defaultFont==0) SWT.error(SWT.ERROR_UNSPECIFIED); - GdkFont gdkFont = new GdkFont(); - OS.memmove(gdkFont, defaultFont, GdkFont.sizeof); - if (gdkFont.type != OS.GDK_FONT_FONT) SWT.error(SWT.ERROR_UNSPECIFIED); - } - return defaultFont; - } - - public static DefaultGtkStyle instance() { - if (instance==null) instance = new DefaultGtkStyle(); - return instance; - } - - private DefaultGtkStyle() { - style = new GtkStyle(); - OS.memmove(style, OS.gtk_widget_get_default_style(), GtkStyle.sizeof); - } - -} - diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java index 5140074d6d..a7953b3750 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java @@ -254,48 +254,31 @@ public Point getDPI () { *
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed
  • * */ -public FontData [] getFontList (String faceName, boolean scalable) { +public FontData[] getFontList (String faceName, boolean scalable) { checkDevice (); - String xlfd; - if (faceName == null) { - xlfd = "-*"; - } else { - int dashIndex = faceName.indexOf('-'); - if (dashIndex < 0) { - xlfd = "-*-" + faceName + "-*"; - } else { - xlfd = "-" + faceName + "-*"; - } - } - /* Use the character encoding for the default locale */ - byte [] buffer1 = Converter.wcsToMbcs (null, xlfd, true); - int [] ret = new int [1]; - int listPtr = OS.XListFonts (buffer1, 65535, ret); - int ptr = listPtr; - int [] intBuf = new int [1]; - FontData [] fd = new FontData [ret [0]]; - int fdIndex = 0; - for (int i = 0; i < ret [0]; i++) { - OS.memmove (intBuf, ptr, 4); - int charPtr = intBuf [0]; - int length = OS.strlen (charPtr); - byte [] buffer2 = new byte [length]; - OS.memmove (buffer2, charPtr, length); - /* Use the character encoding for the default locale */ - char [] chars = Converter.mbcsToWcs (null, buffer2); - FontData data = FontData.gtk_new (new String (chars)); - boolean isScalable = data.averageWidth == 0 && data.pixels == 0 && data.points == 0; - if (isScalable == scalable) { - fd [fdIndex++] = data; - } - ptr += 4; - } - // FIXME, leaking font list -// OS.XFreeFontNames (listPtr); - if (fdIndex == ret [0]) return fd; - FontData [] result = new FontData [fdIndex]; - System.arraycopy (fd, 0, result, 0, fdIndex); - return result; + + /* Temporary code. + * For now, we know that on Pango at least three font families are guaranteed + * to be present: Sans, Serif, and Monspace. + */ + if (scalable) return getScalableFontList(faceName); + return getNonScalableFontList(faceName); +} +FontData[] getScalableFontList(String faceName) { + FontData[] answer; +// if (faceName==null) { + answer = new FontData[2]; + answer[0] = new FontData("helvetica", 12, SWT.ROMAN); +// } + return answer; +} +FontData[] getNonScalableFontList(String faceName) { + FontData[] answer; +// if (faceName==null) { + answer = new FontData[1]; + answer[0] = new FontData("fixed", 12, SWT.ROMAN); +// } + return answer; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java index b5a0c1e158..c2fcb65fa6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java @@ -50,15 +50,13 @@ Font() { */ public Font(Device display, FontData fd) { if (fd == null) error(SWT.ERROR_NULL_ARGUMENT); - + /* FIXME */ String xlfd = fd.getXlfd(); byte[] buffer = Converter.wcsToMbcs(null, xlfd, true); handle = OS.gdk_font_load(buffer); if (handle == 0) { - int hStyle = OS.gtk_widget_get_default_style(); - GtkStyle gtkStyle = new GtkStyle(); - OS.memmove(gtkStyle, hStyle, GtkStyle.sizeof); - handle = OS.gdk_font_ref(gtkStyle.font); + handle = OS.gdk_font_load(Converter.wcsToMbcs(null, "fixed", true)); + if (handle == 0) error(SWT.ERROR_NO_HANDLES); } } /** @@ -88,10 +86,10 @@ public Font(Device display, String fontFamily, int height, int style) { byte[] buffer = Converter.wcsToMbcs(null, fd.getXlfd(), true); handle = OS.gdk_font_load(buffer); if (handle == 0) { - int hStyle = OS.gtk_widget_get_default_style(); - GtkStyle gtkStyle = new GtkStyle(); - OS.memmove(gtkStyle, hStyle, GtkStyle.sizeof); - handle = OS.gdk_font_ref(gtkStyle.font); + /* Temporary, FIXME */ + buffer = Converter.wcsToMbcs(null, "fixed", true); + handle = OS.gdk_font_load(buffer); + if (handle == 0) error(SWT.ERROR_NO_HANDLES); } } /** @@ -135,47 +133,25 @@ void error(int code) { * */ public FontData[] getFontData() { - int index=0; - int fnames = getFontNameList(handle); - int nfonts = OS.g_slist_length(fnames); - FontData[] answer = new FontData[nfonts]; - for (int i=0; i */ public void setClipping(int x, int y, int width, int height) { - if (data.clipRgn == 0) data.clipRgn = OS.gdk_region_new(); +/* if (data.clipRgn == 0) data.clipRgn = OS.gdk_region_new(); GdkRectangle rect = new GdkRectangle(); rect.x = (short)x; rect.y = (short)y; rect.width = (short)width; rect.height = (short)height; OS.gdk_gc_set_clip_rectangle(handle, rect); data.clipRgn = OS.gdk_regions_subtract(data.clipRgn, data.clipRgn); - data.clipRgn = OS.gdk_region_union_with_rect(data.clipRgn, rect); + data.clipRgn = OS.gdk_region_union_with_rect(data.clipRgn, rect);*/ } /** * Sets the area of the receiver which can be changed @@ -435,7 +430,7 @@ public void setClipping(Rectangle rect) { * */ public void setClipping(Region region) { - if (data.clipRgn == 0) data.clipRgn = OS.gdk_region_new(); +/* if (data.clipRgn == 0) data.clipRgn = OS.gdk_region_new(); if (region == null) { data.clipRgn = OS.gdk_regions_subtract(data.clipRgn, data.clipRgn); OS.gdk_gc_set_clip_mask(handle, OS.GDK_NONE); @@ -443,7 +438,7 @@ public void setClipping(Region region) { data.clipRgn = OS.gdk_regions_subtract(data.clipRgn, data.clipRgn); data.clipRgn = OS.gdk_regions_union(region.handle, data.clipRgn); OS.gdk_gc_set_clip_region(handle, region.handle); - } + }*/ } /** * Sets the font which will be used by the receiver @@ -461,7 +456,7 @@ public void setClipping(Region region) { * */ public void setFont(Font font) { - int fontHandle = 0; +/* int fontHandle = 0; if (font == null) { GtkStyle gtkStyle = new GtkStyle(); int style = OS.gtk_widget_get_default_style(); @@ -470,7 +465,7 @@ public void setFont(Font font) { } else { fontHandle = font.handle; } - OS.gdk_gc_set_font(handle, fontHandle); + OS.gdk_gc_set_font(handle, fontHandle);*/ } /** @@ -634,7 +629,8 @@ private GdkColor _getBackgroundGdkColor() { private int _getGCFont() { GdkGCValues values = _getGCValues(); if (values.font==0) { - SWT.error(SWT.ERROR_UNSPECIFIED); + values.font = OS.gdk_font_load(Converter.wcsToMbcs(null, "fixed", true)); + if (values.font == 0) SWT.error(SWT.ERROR_NO_HANDLES); } return values.font; } @@ -778,9 +774,7 @@ public void drawArc(int x, int y, int width, int height, int startAngle, int end * @see #drawRectangle */ public void drawFocus(int x, int y, int width, int height) { - GtkStyle style = new GtkStyle(); - int hStyle = OS.gtk_widget_get_default_style(); - OS.memmove(style, hStyle, GtkStyle.sizeof); + GtkStyle style = new GtkStyle(OS.gtk_widget_get_default_style()); GdkColor color = new GdkColor(); color.pixel = style.fg0_pixel; color.red = style.fg0_red; @@ -818,8 +812,8 @@ public void drawFocus(int x, int y, int width, int height) { public void drawImage(Image image, int x, int y) { if (image == null) error(SWT.ERROR_NULL_ARGUMENT); int pixmap = image.pixmap; - int [] unused = new int [1]; int [] width = new int [1]; int [] height = new int [1]; - OS.gdk_window_get_geometry(pixmap, unused, unused, width, height, unused); + int [] width = new int [1]; int [] height = new int [1]; + OS.gdk_drawable_get_size(pixmap, width, height); drawImage(image, 0, 0, width[0], height[0], x, y, width[0], height[0]); } @@ -866,8 +860,7 @@ public void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcH /* source image properties */ int[] width = new int[1]; int[] height = new int[1]; - int[] unused = new int[1]; - OS.gdk_window_get_geometry(srcImage.pixmap, unused, unused, width, height, unused); + OS.gdk_drawable_get_size(srcImage.pixmap, width, height); if ((srcY + srcWidth > width[0]) || (srcY + srcHeight > height[0])) { error(SWT.ERROR_INVALID_ARGUMENT); @@ -899,7 +892,7 @@ public void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcH double offset_y = - srcY * scale_y; int destSizePixbuf = GDKPIXBUF.gdk_pixbuf_new ( - GDKPIXBUF.GDK_COLORSPACE_RGB, + GDKPIXBUF.GDK_COLORSPACE_RGB(), true, 8, destWidth, destHeight); GDKPIXBUF.gdk_pixbuf_scale( pixbuf.handle, // src, @@ -1390,6 +1383,8 @@ public void fillArc(int x, int y, int width, int height, int startAngle, int end public void fillGradientRectangle(int x, int y, int width, int height, boolean vertical) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if ((width == 0) || (height == 0)) return; + + /* Rewrite this to use GdkPixbuf */ GdkGCValues values = new GdkGCValues(); OS.gdk_gc_get_values(handle, values); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index 8d768231fe..b95ab8104d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -132,12 +132,6 @@ Image() { * gc.drawRectangle(0, 0, 50, 50); * gc.dispose(); * - *

    - * Note: Some platforms may have a limitation on the size - * of image that can be created (size depends on width, height, - * and depth). For example, Windows 95, 98, and ME do not allow - * images larger than 16M. - *

    * * @param device the device on which to create the image * @param width the width of the new image @@ -149,6 +143,8 @@ Image() { */ public Image(Device display, int width, int height) { init(display, width, height); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -198,18 +194,18 @@ public Image(Device device, Image srcImage, int flag) { this.alphaData = srcImage.alphaData; this.alpha = srcImage.alpha; this.transparentPixel = srcImage.transparentPixel; - // bogus - are we sure about memGC? + // FIXME - are we sure about memGC? /* Special case: * If all we want is just a clone of the existing pixmap, it can * be done entirely in the X server, without copying across the net. */ if (flag == SWT.IMAGE_COPY) { - int[] unused = new int[1]; int[] width = new int[1]; int[] height = new int[1]; - int[] depth = new int[1]; - OS.gdk_window_get_geometry(pixmap, unused, unused, width, height, depth); - pixmap = OS.gdk_pixmap_new (0, width[0], height[0], depth[0]); + OS.gdk_drawable_get_size(srcImage.pixmap, width, height); + int depth = OS.gdk_drawable_get_depth(srcImage.pixmap); + pixmap = OS.gdk_pixmap_new (0, width[0], height[0], depth); + int gc = OS.gdk_gc_new (pixmap); OS.gdk_draw_pixmap(pixmap, gc, srcImage.pixmap, 0,0,0,0, width[0], height[0]); @@ -234,6 +230,8 @@ public Image(Device device, Image srcImage, int flag) { if (srcImage.transparentPixel != -1 && srcImage.memGC != null) srcImage.destroyMask(); } + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); return; } @@ -259,12 +257,6 @@ public Image(Device device, Image srcImage, int flag) { * gc.drawRectangle(0, 0, 50, 50); * gc.dispose(); * - *

    - * Note: Some platforms may have a limitation on the size - * of image that can be created (size depends on width, height, - * and depth). For example, Windows 95, 98, and ME do not allow - * images larger than 16M. - *

    * * @param device the device on which to create the image * @param bounds a rectangle specifying the image's width and height (must not be null) @@ -277,6 +269,8 @@ public Image(Device device, Image srcImage, int flag) { public Image(Device display, Rectangle bounds) { if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); init(display, bounds.width, bounds.height); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -294,6 +288,8 @@ public Image(Device display, ImageData image) { if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (display == null) display = Display.getDefault(); init(display, image); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -343,6 +339,8 @@ public Image(Device display, ImageData source, ImageData mask) { image.maskPad = mask.scanlinePad; image.maskData = mask.data; init(display, image); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -374,6 +372,8 @@ public Image(Device display, InputStream stream) { if (stream == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (display == null) display = Display.getDefault(); init(display, new ImageData(stream)); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -398,6 +398,8 @@ public Image(Device display, String filename) { if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (display == null) display = Display.getDefault(); init(display, new ImageData(filename)); + + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); } /** @@ -510,8 +512,8 @@ public void setBackground(Color color) { * */ public Rectangle getBounds() { - int[] unused = new int[1]; int[] width = new int[1]; int[] height = new int[1]; - OS.gdk_window_get_geometry(pixmap, unused, unused, width, height, unused); + int[] width = new int[1]; int[] height = new int[1]; + OS.gdk_drawable_get_size(pixmap, width, height); return new Rectangle(0, 0, width[0], height[0]); } @@ -535,6 +537,7 @@ public ImageData getImageData() { public static Image gtk_new(int type, int pixmap, int mask) { Image image = new Image(); + if (pixmap==0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO); // FIXME remove this, this is for debugging only image.type = type; image.pixmap = pixmap; image.mask = mask; @@ -601,8 +604,7 @@ public void internal_dispose_GC (int gc, GCData data) { void init(Device display, int width, int height) { device = display; - GdkVisual visual = new GdkVisual (); - OS.memmove(visual, OS.gdk_visual_get_system(), GdkVisual.sizeof); + GdkVisual visual = new GdkVisual (OS.gdk_visual_get_system()); this.pixmap = OS.gdk_pixmap_new(0, width, height, visual.depth); if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); /* Fill the bitmap with white */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Pixbuffer.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Pixbuffer.java index 460a3bbb6c..69e519f74b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Pixbuffer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Pixbuffer.java @@ -47,12 +47,9 @@ final class Pixbuffer { Pixbuffer (Image src) { if (src == null || src.pixmap == 0) SWT.error(SWT.ERROR_NULL_ARGUMENT); - // get the geometry - int[] unused = new int[1]; int[] w = new int[1]; int[] h = new int[1]; - int[] d = new int[1]; - OS.gdk_window_get_geometry(src.pixmap, unused, unused, w, h, unused); + OS.gdk_drawable_get_size(src.pixmap, w, h); int width = w[0]; int height = h[0]; @@ -178,8 +175,7 @@ final class Pixbuffer { if (dest==null) SWT.error(SWT.ERROR_NULL_ARGUMENT); int w = getWidth(); int h = getHeight(); - GdkVisual visual = new GdkVisual(); - OS.memmove(visual, OS.gdk_visual_get_system(), GdkVisual.sizeof); + GdkVisual visual = new GdkVisual(OS.gdk_visual_get_system()); dest.pixmap = OS.gdk_pixmap_new (0, w, h, visual.depth); dest.mask = 0; // for now; we fill it later in this method GDKPIXBUF.gdk_pixbuf_render_to_drawable_alpha(handle, // src @@ -274,24 +270,22 @@ final class Pixbuffer { * an alpha channel. */ private void createHandle(int width, int height) { - handle = GDKPIXBUF.gdk_pixbuf_new(GDKPIXBUF.GDK_COLORSPACE_RGB, + handle = GDKPIXBUF.gdk_pixbuf_new(GDKPIXBUF.GDK_COLORSPACE_RGB(), true, 8, width, height); - if (this.handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); + if (this.handle == 0) { + SWT.error(SWT.ERROR_NO_HANDLES); + } data = GDKPIXBUF.gdk_pixbuf_get_pixels(handle); } private void fillAlphaFromPixmapMask(int mask) { hasMask = true; - /* pull the mask data from the X Server */ - // get the geometry - int[] unused = new int[1]; int[] w = new int[1]; int[] h = new int[1]; - int[] d = new int[1]; - OS.gdk_window_get_geometry(mask, unused, unused, w, h, unused); + OS.gdk_drawable_get_size(mask, w, h); int width = Math.min(w[0], getWidth()); int height = Math.min(h[0], getHeight()); /* Get the data */ @@ -315,13 +309,9 @@ final class Pixbuffer { private void fillAlphaFromTransparentPixel(int pm, int pixel) { transparentPixel = pixel; - /* pull the data from the X Server */ - // get the geometry - int[] unused = new int[1]; int[] w = new int[1]; int[] h = new int[1]; - int[] d = new int[1]; - OS.gdk_window_get_geometry(pm, unused, unused, w, h, unused); + OS.gdk_drawable_get_size(pm, w, h); int width = Math.min(w[0], getWidth()); int height = Math.min(h[0], getHeight()); /* Get the data */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java index c08b892a20..514ceb9819 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java @@ -142,7 +142,7 @@ void createHandle (int index) { void setHandleStyle() {} void configure() { - _connectParent(); + parent._connectChild(topHandle()); OS.gtk_container_add (boxHandle, handle); } @@ -461,10 +461,10 @@ public void setText (String string) { int widget = OS.g_list_nth_data (list, 0); if (widget != 0) OS.gtk_widget_destroy (widget); } - byte [] buffer1 = Converter.wcsToMbcs (null, text); - int label = OS.gtk_label_new (buffer1); - byte [] buffer2 = Converter.wcsToMbcs (null, pattern); - OS.gtk_label_set_pattern (label, buffer2); + /* FIXME - accels */ + int label = OS.gtk_label_new (string); +/* byte [] buffer2 = Converter.wcsToMbcs (null, pattern); + OS.gtk_label_set_pattern (label, buffer2);*/ OS.gtk_container_add (handle, label); OS.gtk_widget_show (label); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java index 3374e5cc65..ae94ecf618 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java @@ -117,8 +117,7 @@ public Caret getCaret () { * */ public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (width <= 0 || height <= 0) return; int deltaX = destX - x, deltaY = destY - y; @@ -129,10 +128,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b boolean isVisible = (caret != null) && (caret.isVisible ()); if (isVisible) caret.hideCaret (); - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, paintHandle(), GtkWidget.sizeof); - int window = widget.window; - if (window == 0) return; + int window = OS.GTK_WIDGET_WINDOW(paintHandle()); /* Emit a NoExpose Event */ int gc = OS.gdk_gc_new (window); @@ -243,8 +239,7 @@ int processMouseUp (int callData, int arg1, int int2) { int processPaint (int callData, int arg1, int int2) { //if (!hooks (SWT.Paint)) return 0; - GdkEventExpose gdkEvent = new GdkEventExpose (); - OS.memmove (gdkEvent, callData, GdkEventExpose.sizeof); + GdkEventExpose gdkEvent = new GdkEventExpose (callData); Event event = new Event (); event.count = gdkEvent.count; event.x = gdkEvent.x; event.y = gdkEvent.y; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java index 85c62c27b7..68a74a8f3f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java @@ -88,9 +88,7 @@ boolean drawCaret () { /* The parent is a Canvas; its handle is a GtkDrawingArea. * Get the DA's GDK window to draw on. */ - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, parent.handle, GtkWidget.sizeof); - int window = widget.window; + int window = OS.GTK_WIDGET_WINDOW(parent.handle); /* Create the GC, and set the working color and rop. */ int gc = OS.gdk_gc_new(window); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java index ebe8093461..8a6baadf45 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java @@ -97,10 +97,8 @@ public RGB getRGB () { return rgb; } int okFunc (int widget, int callData) { - GtkColorSelectionDialog dialog = new GtkColorSelectionDialog (); - OS.memmove (dialog, callData, GtkColorSelectionDialog.sizeof); double [] color = new double [4]; - OS.gtk_color_selection_get_color (dialog.colorsel, color); + OS.gtk_color_selection_get_color (OS.GTK_COLOR_SELECTION_COLORSEL(callData), color); rgb = new RGB ((int)(color [0] * 256), (int)(color [1] * 256), (int)(color [2] * 256)); OS.gtk_widget_destroy (callData); return 0; @@ -123,15 +121,13 @@ public RGB open () { byte [] titleBytes; titleBytes = Converter.wcsToMbcs (null, title, true); handle = OS.gtk_color_selection_dialog_new (titleBytes); - GtkColorSelectionDialog dialog = new GtkColorSelectionDialog (); - OS.memmove (dialog, handle, GtkColorSelectionDialog.sizeof); - OS.gtk_widget_hide (dialog.help_button); + OS.gtk_widget_hide (OS.GTK_COLOR_SELECTION_OK_BUTTON(handle)); if (rgb != null) { double [] color = new double [4]; color [0] = (double)rgb.red / 256; color [1] = (double)rgb.green / 256; color [2] = (double)rgb.blue / 256; - OS.gtk_color_selection_set_color (dialog.colorsel, color); + OS.gtk_color_selection_set_color (OS.GTK_COLOR_SELECTION_COLORSEL(handle), color); } Callback destroyCallback = new Callback (this, "destroyFunc", 2); int destroyFunc = destroyCallback.getAddress (); @@ -142,8 +138,8 @@ public RGB open () { int okFunc = okCallback.getAddress (); Callback cancelCallback = new Callback (this, "cancelFunc", 2); int cancelFunc = cancelCallback.getAddress (); - OS.gtk_signal_connect (dialog.ok_button, clicked, okFunc, handle); - OS.gtk_signal_connect (dialog.cancel_button, clicked, cancelFunc, handle); + OS.gtk_signal_connect (OS.GTK_COLOR_SELECTION_OK_BUTTON(handle), clicked, okFunc, handle); + OS.gtk_signal_connect (OS.GTK_COLOR_SELECTION_CANCEL_BUTTON(handle), clicked, cancelFunc, handle); rgb = null; OS.gtk_widget_show_now (handle); OS.gtk_main (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index b192c92336..f11e1ca89f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -46,7 +46,9 @@ import org.eclipse.swt.events.*; */ public class Combo extends Composite { - int padHandle, glist; + int fixedHandle; + int entryHandle, listHandle; + int glist; int textLimit = LIMIT; public final static int LIMIT; @@ -263,46 +265,31 @@ static int checkStyle (int style) { */ public void clearSelection () { checkWidget(); - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); - int position = OS.gtk_editable_get_position (combo.entry); - OS.gtk_editable_set_position (combo.entry, position); + /*int position = OS.gtk_editable_get_position (entryHandle); + OS.gtk_editable_set_position (entryHandle, position);*/ } void createHandle (int index) { state |= HANDLE; - eventBoxHandle = OS.gtk_event_box_new (); - if (eventBoxHandle == 0) error (SWT.ERROR_NO_HANDLES); - padHandle = OS.gtk_fixed_new (); - if (padHandle == 0) error (SWT.ERROR_NO_HANDLES); + fixedHandle = OS.eclipse_fixed_new(); + if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); handle = OS.gtk_combo_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - fixedHandle = OS.gtk_fixed_new(); - if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); + GtkCombo combo = new GtkCombo (handle); + entryHandle = combo.entry; + listHandle = combo.list; } - void setHandleStyle() { - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); boolean isEditable = (style & SWT.READ_ONLY) == 0; - OS.gtk_entry_set_editable (combo.entry, isEditable); + OS.gtk_entry_set_editable (entryHandle, isEditable); } void configure () { - _connectParent(); - OS.gtk_container_add(eventBoxHandle, padHandle); - OS.gtk_fixed_put (padHandle, fixedHandle, (short)0, (short)0); - OS.gtk_fixed_put (padHandle, handle, (short)0, (short)0); -} - -public Point computeSize (int wHint, int hHint, boolean changed) { - checkWidget (); - return _computeSize(wHint, hHint, changed); + parent._connectChild(topHandle()); + OS.gtk_container_add(fixedHandle, handle); } void showHandle() { - OS.gtk_widget_show(eventBoxHandle); - OS.gtk_widget_show(padHandle); OS.gtk_widget_show(fixedHandle); OS.gtk_widget_show(handle); OS.gtk_widget_realize (handle); @@ -310,68 +297,69 @@ void showHandle() { void deregister () { super.deregister (); - WidgetTable.remove (padHandle); - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); - WidgetTable.remove (combo.entry); - WidgetTable.remove (combo.list); - WidgetTable.remove (combo.button); + WidgetTable.remove (fixedHandle); + WidgetTable.remove (entryHandle); + WidgetTable.remove (listHandle); } void hookEvents () { // TO DO - expose, enter/exit, focus in/out super.hookEvents (); - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); // TO DO - fix multiple selection events for one user action - signal_connect (combo.list, "select_child", SWT.Selection, 3); - signal_connect_after (combo.entry, "changed", SWT.Modify, 2); + signal_connect (listHandle, "select_child", SWT.Selection, 3); + signal_connect_after (entryHandle, "changed", SWT.Modify, 2); int mask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK | OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK; - int [] handles = new int [] {combo.entry, combo.list, combo.button}; - for (int i=0; i= items.length) return; String selectedText = items [index]; - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); - OS.gtk_signal_handler_block_by_data (combo.entry, SWT.Modify); - OS.gtk_signal_handler_block_by_data (combo.list, SWT.Selection); - OS.gtk_list_select_item (combo.list, index); - OS.gtk_entry_set_text (combo.entry, Converter.wcsToMbcs (null, selectedText, true)); - OS.gtk_signal_handler_unblock_by_data (combo.entry, SWT.Modify); - OS.gtk_signal_handler_unblock_by_data (combo.list, SWT.Selection); + OS.gtk_signal_handler_block_by_data (entryHandle, SWT.Modify); + OS.gtk_signal_handler_block_by_data (listHandle, SWT.Selection); + OS.gtk_list_select_item (listHandle, index); + OS.gtk_entry_set_text (entryHandle, Converter.wcsToMbcs (null, selectedText, true)); + OS.gtk_signal_handler_unblock_by_data (entryHandle, SWT.Modify); + OS.gtk_signal_handler_unblock_by_data (listHandle, SWT.Selection); } /** @@ -948,11 +928,9 @@ public void setItem (int index, String string) { */ public void setItems (String [] items) { checkWidget(); - if (items == null) error (SWT.ERROR_NULL_ARGUMENT); - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle, GtkCombo.sizeof); + /*if (items == null) error (SWT.ERROR_NULL_ARGUMENT); if (items.length == 0) { - OS.gtk_list_clear_items (combo.list, 0, -1); + OS.gtk_list_clear_items (listHandle, 0, -1); //LEAK glist = 0; } else { @@ -966,11 +944,11 @@ public void setItems (String [] items) { OS.memmove (data, buffer, buffer.length); new_glist = OS.g_list_append (new_glist, data); } - OS.gtk_signal_handler_block_by_data (combo.entry, SWT.Modify); - OS.gtk_signal_handler_block_by_data (combo.list, SWT.Selection); + OS.gtk_signal_handler_block_by_data (entryHandle, SWT.Modify); + OS.gtk_signal_handler_block_by_data (listHandle, SWT.Selection); OS.gtk_combo_set_popdown_strings (handle, new_glist); - OS.gtk_signal_handler_unblock_by_data (combo.entry, SWT.Modify); - OS.gtk_signal_handler_unblock_by_data (combo.list, SWT.Selection); + OS.gtk_signal_handler_unblock_by_data (entryHandle, SWT.Modify); + OS.gtk_signal_handler_unblock_by_data (listHandle, SWT.Selection); if (glist != 0) { int count = OS.g_list_length (glist); for (int i=0; i */ public void setLayout (Layout layout) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); this.layout = layout; } -int _gdkWindow() { - int windowHandle = _gdkWindow(handle); - if (windowHandle==0) error(SWT.ERROR_UNSPECIFIED); - return windowHandle; -} - /** * Returns an array containing the receiver's children. *

    @@ -294,10 +252,6 @@ int _gdkWindow() { */ public Control [] getChildren () { checkWidget(); - return _getChildren(); -} - -Control [] _getChildren () { return _getChildren(parentingHandle()); } @@ -336,19 +290,16 @@ Control _childFromHandle(int h) { } public Rectangle getClientArea () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - - return _getClientArea (); -} - -public Rectangle _getClientArea () { - Point size = _getClientAreaSize (); - return new Rectangle (0, 0, size.x, size.y); -} - -Point _getClientAreaSize () { - return UtilFuncs.getSize(handle); + checkWidget(); + /* We can not measure the actual size of the client area, + * because it may not have propagated down yet. + */ + Point size = _getSize(); + /* FIXME - this code assumes the scrollbars are to the right */ + /* FIXME - I just measured the size on one particular theme. */ + if ((style & SWT.V_SCROLL) != 0) size.x -= 18; + if ((style & SWT.H_SCROLL) != 0) size.y -= 18; + return new Rectangle(0,0, size.x, size.y); } @@ -386,14 +337,13 @@ public void layout () { * */ public void layout (boolean changed) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (layout == null) return; layout.layout (this, changed); } Point minimumSize () { - Control [] children = _getChildren (); + Control [] children = _getChildren (parentingHandle()); int width = 0, height = 0; for (int i=0; i */ void hookEvents () { - signal_connect (handle, "expose_event", SWT.Paint, 3); + signal_connect_after (handle, "expose_event", SWT.Paint, 3); int mask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK | OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK | OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK | OS.GDK_FOCUS_CHANGE_MASK; - int eventHandle = eventHandle (); - if (!OS.GTK_WIDGET_NO_WINDOW (eventHandle)) { - OS.gtk_widget_add_events (eventHandle, mask); + if (!OS.GTK_WIDGET_NO_WINDOW (handle)) { + OS.gtk_widget_add_events (handle, mask); } - signal_connect_after (eventHandle, "motion_notify_event", SWT.MouseMove, 3); - signal_connect_after (eventHandle, "button_press_event", SWT.MouseDown, 3); - signal_connect_after (eventHandle, "button_release_event", SWT.MouseUp, 3); - signal_connect_after (eventHandle, "enter_notify_event", SWT.MouseEnter, 3); - signal_connect_after (eventHandle, "leave_notify_event", SWT.MouseExit, 3); - signal_connect_after (eventHandle, "key_press_event", SWT.KeyDown, 3); - signal_connect_after (eventHandle, "key_release_event", SWT.KeyUp, 3); - signal_connect_after (eventHandle, "focus_in_event", SWT.FocusIn, 3); - signal_connect_after (eventHandle, "focus_out_event", SWT.FocusOut, 3); + signal_connect_after (handle, "motion_notify_event", SWT.MouseMove, 3); + signal_connect_after (handle, "button_press_event", SWT.MouseDown, 3); + signal_connect_after (handle, "button_release_event", SWT.MouseUp, 3); + signal_connect_after (handle, "enter_notify_event", SWT.MouseEnter, 3); + signal_connect_after (handle, "leave_notify_event", SWT.MouseExit, 3); + signal_connect_after (handle, "key_press_event", SWT.KeyDown, 3); + signal_connect_after (handle, "key_release_event", SWT.KeyUp, 3); + signal_connect_after (handle, "focus_in_event", SWT.FocusIn, 3); + signal_connect_after (handle, "focus_out_event", SWT.FocusOut, 3); } abstract void setHandleStyle (); -void setInitialSize() { UtilFuncs.setZeroSize(topHandle()); } +void setInitialSize() { _setSize(5,5); } void configure () { - // Do NOT directly use gtk_fixed_put in configure(), - // because not all composites have GtkFixed as their - // parenting (bottom) handle. - _connectParent(); -} -void _connectParent() { + // Do NOT directly use fixed_put in configure(): + // surprisingly, not all composites have Fixed as their + // parenting (bottom) handle. Should investigate further. parent._connectChild(topHandle()); } + /** * Every Control must implement this to map the gtk widgets, * and also realize those that have to be realized - this means @@ -160,36 +153,25 @@ void _connectParent() { * An exception to this is the Shell, which we do NOT realize * at this point. */ -abstract void showHandle(); - -int topHandle() { - return handle; -} - -int paintHandle() { - return handle; +void showHandle() { + OS.gtk_widget_show (handle); + OS.gtk_widget_realize (handle); } +/** + * This is the handle by which our parent holds us + */ +int topHandle() { return handle; } +/** + * This is where we draw. Every widget must guarantee + * that its paint handle has a Gdk window associated with it. + */ +public int paintHandle() { return handle; } /* REALLY BROKEN, PENDING PANGO */ +boolean isMyHandle(int h) { return h==handle; } /* * === GEOMETRY === */ -int computeHandle () { - return handle; -} - -Point _computeSize (int wHint, int hHint, boolean changed) { - int handle = computeHandle (); - int aux_info = OS.gtk_object_get_data_by_id (handle, aux_info_quark); - OS.gtk_object_set_data_by_id (handle, aux_info_quark, 0); - GtkRequisition requisition = new GtkRequisition (); - OS.gtk_widget_size_request (handle, requisition); - OS.gtk_object_set_data_by_id (handle, aux_info_quark, aux_info); - int width = wHint == SWT.DEFAULT ? requisition.width : wHint; - int height = hHint == SWT.DEFAULT ? requisition.height : hHint; - return new Point (width, height); -} - /** * Returns the preferred size of the receiver. *

    @@ -247,33 +229,16 @@ public Point computeSize (int wHint, int hHint) { */ public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); - return _computeSize (wHint, hHint, changed); + return computeNativeSize (handle, wHint, hHint, changed); } -/* Start ACCESSIBILITY */ -/** - * Returns the accessible object for the receiver. - * If this is the first time this object is requested, - * then the object is created and returned. - * - * @return the accessible object - * - * @exception SWTException

      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @see addAccessibleListener - * @see addAccessibleControlListener - */ -public Accessible getAccessible () { - checkWidget (); - if (accessible == null) { - accessible = Accessible.internal_new_Accessible (this); - } - return accessible; +Point computeNativeSize (int h, int wHint, int hHint, boolean changed) { + GtkRequisition requisition = new GtkRequisition (); + OS.gtk_widget_size_request (h, requisition); + int width = wHint == SWT.DEFAULT ? requisition.width : wHint; + int height = hHint == SWT.DEFAULT ? requisition.height : hHint; + return new Point (width, height); } -/* End ACCESSIBILITY */ /** * Returns a rectangle describing the receiver's size and location @@ -288,18 +253,10 @@ public Accessible getAccessible () { */ public Rectangle getBounds () { checkWidget(); - return _getBounds(); -} - -/** - * The actual implementation for getBounds(). - * Concrete controls implement their means to answer the location - * and size by overriding _getLocation() and _getSize(). - */ -final Rectangle _getBounds() { Point location = _getLocation(); Point size = _getSize(); return new Rectangle(location.x, location.y, size.x, size.y); + } /** @@ -348,10 +305,12 @@ public void setBounds (Rectangle rect) { */ public void setBounds (int x, int y, int width, int height) { checkWidget(); - boolean differentOrigin = _setLocation(x,y); - boolean differentExtent = _setSize (width,height); - if (differentOrigin) sendEvent (SWT.Move); - if (differentExtent) sendEvent (SWT.Resize); + Point old_location = _getLocation(); + Point old_size = _getSize(); + _setLocation (x, y); + _setSize (width, height); + if ((x!=old_location.x) || (y!=old_location.y)) sendEvent (SWT.Move); + if ((width!=old_size.x) || (height!=old_size.y)) sendEvent (SWT.Resize); } /** @@ -369,9 +328,10 @@ public Point getLocation () { checkWidget(); return _getLocation(); } - Point _getLocation () { - return UtilFuncs.getLocation(topHandle()); + int[] loc = new int[2]; + OS.eclipse_fixed_get_location(parent.parentingHandle(), topHandle(), loc); + return new Point(loc[0], loc[1]); } /** @@ -406,15 +366,13 @@ public void setLocation (Point location) { */ public void setLocation(int x, int y) { checkWidget(); - if (_setLocation(x,y)) sendEvent(SWT.Move); + Point old_location = _getLocation(); + if ((x==old_location.x) && (y==old_location.y)) return; + _setLocation(x,y); + sendEvent(SWT.Move); } - -boolean _setLocation(int x, int y) { - Point old_loc = _getLocation(); - if ( (x != old_loc.x) || (y != old_loc.y) ) { - UtilFuncs.setLocation(parent.parentingHandle(), topHandle(), x,y); - return true; - } else return false; +void _setLocation(int x, int y) { + OS.eclipse_fixed_set_location(parent.parentingHandle(), topHandle(), x,y); } /** @@ -435,7 +393,9 @@ public Point getSize () { return _getSize(); } Point _getSize() { - return UtilFuncs.getSize(topHandle()); + int[] sz = new int[2]; + OS.eclipse_fixed_get_size(parent.parentingHandle(), topHandle(), sz); + return new Point(sz[0], sz[1]); } /** @@ -480,17 +440,15 @@ public void setSize (Point size) { */ public void setSize (int width, int height) { checkWidget(); - // Even though GTK+ will not let any widget be smaller - // than 3@3, we don't care about it here, as this kind - // of platform weirdness is handled in UtilFuncs. width = Math.max(width, 0); height = Math.max(height, 0); - if (_setSize(width, height)) sendEvent(SWT.Resize); -} -boolean _setSize(int width, int height) { Point old_size = _getSize(); - if ( (width==old_size.x) && (height==old_size.y) ) return false; - return UtilFuncs.setSize(topHandle(), width, height); + if ( (width==old_size.x) && (height==old_size.y) ) return; + _setSize(width, height); + sendEvent(SWT.Resize); +} +void _setSize(int width, int height) { + OS.eclipse_fixed_set_size(parent.parentingHandle(), topHandle(), width, height); } /** @@ -512,10 +470,9 @@ boolean _setSize(int width, int height) { */ public void moveAbove (Control control) { checkWidget(); - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, topHandle(), GtkWidget.sizeof); - int topGdkWindow = widget.window; - if (topGdkWindow!=0) OS.gdk_window_raise (topGdkWindow); + int siblingHandle = 0; + if (control != null) siblingHandle = control.topHandle(); + OS.eclipse_fixed_move_above(parent.parentingHandle(), topHandle(), siblingHandle); } /** @@ -537,10 +494,9 @@ public void moveAbove (Control control) { */ public void moveBelow (Control control) { checkWidget(); - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, topHandle(), GtkWidget.sizeof); - int topGdkWindow = widget.window; - if (topGdkWindow!=0) OS.gdk_window_lower (topGdkWindow); + int siblingHandle = 0; + if (control != null) siblingHandle = control.topHandle(); + OS.eclipse_fixed_move_below(parent.parentingHandle(), topHandle(), siblingHandle); } /** @@ -579,7 +535,6 @@ public void pack () { * @see #computeSize */ public void pack (boolean changed) { - checkWidget(); setSize (computeSize (SWT.DEFAULT, SWT.DEFAULT, changed)); } @@ -615,11 +570,12 @@ public void setLayoutData (Object layoutData) { */ public Point toControl (Point point) { checkWidget(); - int[] x = new int[1], y = new int[1]; +/* int[] x = new int[1], y = new int[1]; OS.gdk_window_get_origin(_gdkWindow(), x,y); int ctlX = point.x - x[0]; - int ctlY = point.y - y[0]; - return new Point (ctlX, ctlY); + int ctlY = point.y - y[0];*/ + /* FIXME */ + return new Point (0, 0); } /** * Returns a point which is the result of converting the @@ -637,11 +593,14 @@ public Point toControl (Point point) { * */ public Point toDisplay (Point point) { - checkWidget(); + checkWidget();/* int[] x = new int[1], y = new int[1]; OS.gdk_window_get_origin(_gdkWindow(), x,y); - return new Point (x[0]+point.x, y[0]+point.y); + return new Point (x[0]+point.x, y[0]+point.y);*/ + /* FIXME */ + return new Point (0,0); } + // === End of GEOMETRY Category === @@ -908,8 +867,7 @@ public void addTraverseListener (TraverseListener listener) { * @see #addControlListener */ public void removeControlListener (ControlListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Move, listener); @@ -933,8 +891,7 @@ public void removeControlListener (ControlListener listener) { * @see #addFocusListener */ public void removeFocusListener(FocusListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.FocusIn, listener); @@ -958,8 +915,7 @@ public void removeFocusListener(FocusListener listener) { * @see #addHelpListener */ public void removeHelpListener (HelpListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Help, listener); @@ -982,8 +938,7 @@ public void removeHelpListener (HelpListener listener) { * @see #addKeyListener */ public void removeKeyListener(KeyListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.KeyUp, listener); @@ -1007,8 +962,7 @@ public void removeKeyListener(KeyListener listener) { * @see #addMouseListener */ public void removeMouseListener (MouseListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.MouseDown, listener); @@ -1033,8 +987,7 @@ public void removeMouseListener (MouseListener listener) { * @see #addMouseMoveListener */ public void removeMouseMoveListener(MouseMoveListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.MouseMove, listener); @@ -1058,8 +1011,7 @@ public void removeMouseMoveListener(MouseMoveListener listener) { * @see #addMouseTrackListener */ public void removeMouseTrackListener(MouseTrackListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.MouseEnter, listener); @@ -1085,8 +1037,7 @@ public void removeMouseTrackListener(MouseTrackListener listener) { * @see #addPaintListener */ public void removePaintListener(PaintListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook(SWT.Paint, listener); @@ -1117,27 +1068,6 @@ public void removeTraverseListener(TraverseListener listener) { } -/* - * Return (GTKWIDGET)h->window. - */ -final int _gdkWindow(int h) { - /* Temporary code. - * This check is not necessary as the (internal) callers - * always make sure h!=0. - */ - if (h==0) error(SWT.ERROR_CANNOT_BE_ZERO); - - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, h, GtkWidget.sizeof); - return widget.window; -} - -int _gdkWindow() { - int windowHandle = _gdkWindow(handle); - if (windowHandle==0) error(SWT.ERROR_NO_HANDLES); - return windowHandle; -} - /** * Forces the receiver to have the keyboard focus, causing * all keyboard events to be delivered to it. @@ -1152,8 +1082,7 @@ int _gdkWindow() { * @see #setFocus */ public boolean forceFocus () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); OS.gtk_widget_grab_focus (handle); return true; } @@ -1181,8 +1110,7 @@ GdkColor _getBackgroundGdkColor() { int h = paintHandle(); int hStyle = OS.gtk_widget_get_style (handle); - GtkStyle style = new GtkStyle (); - OS.memmove (style, hStyle, GtkStyle.sizeof); + GtkStyle style = new GtkStyle (hStyle); GdkColor color = new GdkColor (); color.pixel = style.bg0_pixel; color.red = style.bg0_red; @@ -1202,8 +1130,7 @@ GdkColor _getBackgroundGdkColor() { * */ public int getBorderWidth () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return (style & SWT.BORDER) == 0 ? 0 : 1; } @@ -1238,8 +1165,7 @@ public Display getDisplay () { */ public boolean getEnabled () { checkWidget (); - int topHandle = topHandle (); - return OS.GTK_WIDGET_SENSITIVE (topHandle); + return OS.GTK_WIDGET_SENSITIVE (handle); } /** @@ -1286,8 +1212,7 @@ GdkColor _getForegroundGdkColor() { int h = paintHandle(); int hStyle = OS.gtk_widget_get_style (handle); - GtkStyle style = new GtkStyle (); - OS.memmove (style, hStyle, GtkStyle.sizeof); + GtkStyle style = new GtkStyle (hStyle); GdkColor color = new GdkColor (); color.pixel = style.fg0_pixel; color.red = style.fg0_red; @@ -1307,8 +1232,7 @@ GdkColor _getForegroundGdkColor() { * */ public Object getLayoutData () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return layoutData; } @@ -1328,8 +1252,7 @@ public Object getLayoutData () { * */ public Menu getMenu () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return menu; } /** @@ -1345,8 +1268,7 @@ public Menu getMenu () { * */ public Composite getParent () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return parent; } @@ -1366,8 +1288,7 @@ public Composite getParent () { * @see #getParent */ public Shell getShell() { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return _getShell(); } Shell _getShell() { @@ -1386,8 +1307,7 @@ Shell _getShell() { * */ public String getToolTipText () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return toolTipText; } /** @@ -1409,13 +1329,7 @@ public String getToolTipText () { */ public boolean getVisible () { checkWidget(); - return _getVisible(); -} -boolean _getVisible() { - return _getVisible(topHandle()); -} -boolean _getVisible(int h) { - return (OS.GTK_WIDGET_FLAGS(h) & OS.GTK_VISIBLE) != 0; + return OS.GTK_WIDGET_VISIBLE(topHandle()); } /** @@ -1438,17 +1352,15 @@ public int internal_new_GC (GCData data) { if (paintHandle() == 0) error(SWT.ERROR_UNSPECIFIED); // Create the GC with default values for this control - GtkWidget w = new GtkWidget(); - OS.memmove (w, paintHandle(), GtkWidget.sizeof); - if (w.window == 0) error(SWT.ERROR_UNSPECIFIED); - int gc = OS.gdk_gc_new(w.window); + int window = OS.GTK_WIDGET_WINDOW(paintHandle()); + int gc = OS.gdk_gc_new(window); OS.gdk_gc_set_font(gc, _getFontHandle()); OS.gdk_gc_set_background(gc, _getBackgroundGdkColor()); OS.gdk_gc_set_foreground(gc, _getForegroundGdkColor()); - data.drawable = w.window; + data.drawable = window; return gc; } @@ -1503,8 +1415,7 @@ public boolean isReparentable () { */ public boolean isEnabled () { checkWidget (); - int topHandle = topHandle (); - return OS.GTK_WIDGET_IS_SENSITIVE (topHandle); + return OS.GTK_WIDGET_IS_SENSITIVE (handle); } /** @@ -1519,10 +1430,10 @@ public boolean isEnabled () { * */ public boolean isFocusControl () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - return (OS.GTK_WIDGET_FLAGS(handle)&OS.GTK_HAS_FOCUS)!=0; + checkWidget(); + return OS.GTK_WIDGET_HAS_FOCUS(handle); } + /** * Returns true if the receiver is visible, and * false otherwise. @@ -1541,42 +1452,45 @@ public boolean isFocusControl () { * */ public boolean isVisible () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); boolean result = getVisible (); - if (parent != null) - result = result && parent.isVisible(); + if (parent != null) result = result && parent.isVisible(); return result; } + Decorations menuShell () { return parent.menuShell (); } int processKeyDown (int callData, int arg1, int int2) { - GdkEventKey gdkEvent = new GdkEventKey (); - OS.memmove (gdkEvent, callData, GdkEventKey.sizeof); - boolean accelResult = OS.gtk_accel_groups_activate(_getShell().topHandle, gdkEvent.keyval, gdkEvent.state); - if (!accelResult) sendKeyEvent (SWT.KeyDown, gdkEvent); + int keyval = OS.gdk_event_key_get_keyval(callData); + int[] pMods = new int[1]; + OS.gdk_event_get_state(callData, pMods); + boolean accelResult = OS.gtk_accel_groups_activate(_getShell().topHandle(), + keyval, + pMods[0]); + if (!accelResult) sendKeyEvent (SWT.KeyDown, callData); return 1; } int processKeyUp (int callData, int arg1, int int2) { - GdkEventKey gdkEvent = new GdkEventKey (); - OS.memmove (gdkEvent, callData, GdkEventKey.sizeof); - sendKeyEvent (SWT.KeyUp, gdkEvent); + sendKeyEvent (SWT.KeyUp, callData); return 1; } int processMouseDown (int callData, int arg1, int int2) { OS.gtk_widget_grab_focus(handle); - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); int eventType = SWT.MouseDown; - if (gdkEvent.type == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; - sendMouseEvent (eventType, gdkEvent.button, gdkEvent.state, gdkEvent.time, (int)gdkEvent.x, (int)gdkEvent.y); - if (gdkEvent.button == 3 && menu != null) { - menu.setVisible (true); - } + if (OS.GDK_EVENT_TYPE(callData) == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; + int[] pMod = new int[1]; + OS.gdk_event_get_state(callData, pMod); + int time = OS.gdk_event_get_time(callData); + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int button = OS.gdk_event_button_get_button(callData); + sendMouseEvent (eventType, button, pMod[0], time, (int)(px[0]), (int)(py[0])); + if (button == 3 && menu != null) menu.setVisible (true); return 1; } @@ -1592,24 +1506,29 @@ int processMouseExit (int arg0, int arg1, int int2) { } int processMouseUp (int callData, int arg1, int int2) { - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - sendMouseEvent (SWT.MouseUp, gdkEvent.button, gdkEvent.state, gdkEvent.time, (int)gdkEvent.x, (int)gdkEvent.y); + int[] pMod = new int[1]; + OS.gdk_event_get_state(callData, pMod); + int time = OS.gdk_event_get_time(callData); + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int button = OS.gdk_event_button_get_button(callData); + sendMouseEvent (SWT.MouseUp, button, pMod[0], time, (int)(px[0]), (int)(py[0])); return 1; } int processMouseMove (int callData, int arg1, int int2) { - GdkEventMotion gdkEvent = new GdkEventMotion (); - OS.memmove (gdkEvent, callData, GdkEventMotion.sizeof); - Point where = _gdkWindowGetPointer(); - sendMouseEvent (SWT.MouseMove, 0, gdkEvent.state, gdkEvent.time, where.x, where.y); - return 1; -} -Point _gdkWindowGetPointer() { + /* + GdkEvent gdkEvent = new GdkEvent (callData); int[] px = new int[1], py = new int[1]; - OS.gdk_window_get_pointer(_gdkWindow(), px, py, 0); - return new Point(px[0], py[0]); + OS.gdk_window_get_pointer(_gdkWindow(), px, py, 0); + int time = OS.gdk_event_get_time(callData); + int[] pMods = new int[1]; + OS.gdk_event_get_state(callData, pMods); + sendMouseEvent (SWT.MouseMove, 0, pMods[0], time, px[0], py[0]);*/ + return 1; } + int processFocusIn(int int0, int int1, int int2) { postEvent(SWT.FocusIn); return 0; @@ -1622,8 +1541,7 @@ int processFocusOut(int int0, int int1, int int2) { int processPaint (int callData, int int2, int int3) { if (!hooks (SWT.Paint)) return 1; - GdkEventExpose gdkEvent = new GdkEventExpose (); - OS.memmove (gdkEvent, callData, GdkEventExpose.sizeof); + GdkEventExpose gdkEvent = new GdkEventExpose (callData); Event event = new Event (); event.count = gdkEvent.count; event.x = gdkEvent.x; event.y = gdkEvent.y; @@ -1653,11 +1571,9 @@ int processPaint (int callData, int int2, int int3) { * @see #update */ public void redraw () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); Point size = _getSize(); _redraw(0, 0, size.x, size.y, true); -//OS.gtk_widget_queue_draw(handle); } /** * Causes the rectangular area of the receiver specified by @@ -1683,11 +1599,12 @@ public void redraw () { * @see #update */ public void redraw (int x, int y, int width, int height, boolean all) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); _redraw(x, y, width, height, all); } protected void _redraw(int x, int y, int width, int height, boolean all) { + /* FIXME */ + /* OS.gdk_window_clear_area_e (_gdkWindow(), x, y, width, height); GdkRectangle rect = new GdkRectangle(); @@ -1695,10 +1612,8 @@ rect.x = (short)x; rect.y = (short)y; rect.width = (short)width; rect.height =(short) height; -//OS.gtk_widget_draw(handle, rect); -OS.gtk_widget_queue_draw(handle); +OS.gtk_widget_queue_draw(handle);*/ -// OS.gtk_widget_queue_draw_area (handle, x, y, width, height); } void releaseWidget () { @@ -1708,46 +1623,53 @@ void releaseWidget () { menu = null; layoutData = null; } -void sendKeyEvent (int type, GdkEventKey gdkEvent) { - /* Look up the keysym and character(s) */ - int size = gdkEvent.length; - if (gdkEvent.keyval == 0 && size == 0) return; - - /* If there is no composed string input by keypress, only send the keyvalue */ - if (size == 0 ) { - Event event = new Event (); - event.time = gdkEvent.time; -// event.character = (char) 0; //no character sent - event.keyCode = Display.translateKey (gdkEvent.keyval); + +void sendKeyEvent (int type, int pEventKey) { + Event event = new Event(); + event.time = OS.gdk_event_get_time(pEventKey); + + int size = OS.gdk_event_key_get_length(pEventKey); + if (size==0) { /* No composed string - send the keyvalue */ + int keyval = OS.gdk_event_key_get_keyval(pEventKey) ; + if (keyval==0) return; + event.keyCode = Display.translateKey (keyval); event.character = (char) event.keyCode; //no character sent - if ((gdkEvent.state & OS.GDK_MOD1_MASK) != 0) event.stateMask |= SWT.ALT; - if ((gdkEvent.state & OS.GDK_SHIFT_MASK) != 0) event.stateMask |= SWT.SHIFT; - if ((gdkEvent.state & OS.GDK_CONTROL_MASK) != 0) event.stateMask |= SWT.CONTROL; - if ((gdkEvent.state & OS.GDK_BUTTON1_MASK) != 0) event.stateMask |= SWT.BUTTON1; - if ((gdkEvent.state & OS.GDK_BUTTON2_MASK) != 0) event.stateMask |= SWT.BUTTON2; - if ((gdkEvent.state & OS.GDK_BUTTON3_MASK) != 0) event.stateMask |= SWT.BUTTON3; + int[] pModifier = new int[1]; + OS.gdk_event_get_state(pEventKey, pModifier); + int state = pModifier[0]; + if ((state & OS.GDK_MOD1_MASK) != 0) event.stateMask |= SWT.ALT; + if ((state & OS.GDK_SHIFT_MASK) != 0) event.stateMask |= SWT.SHIFT; + if ((state & OS.GDK_CONTROL_MASK) != 0) event.stateMask |= SWT.CONTROL; + if ((state & OS.GDK_BUTTON1_MASK) != 0) event.stateMask |= SWT.BUTTON1; + if ((state & OS.GDK_BUTTON2_MASK) != 0) event.stateMask |= SWT.BUTTON2; + if ((state & OS.GDK_BUTTON3_MASK) != 0) event.stateMask |= SWT.BUTTON3; postEvent (type, event); + return; } - else { - byte [] buffer = new byte [size]; - OS.memmove (buffer, gdkEvent.string, size); - /* Convert from MBCS to UNICODE and send the event */ - char [] result = Converter.mbcsToWcs (null, buffer); - for (int i=0; i */ public void setCapture (boolean capture) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); + /* FIXME !!!!! */ /* if (capture) { OS.gtk_widget_grab_focus (handle); @@ -1882,9 +1804,7 @@ public void setCapture (boolean capture) { */ public void setCursor (Cursor cursor) { checkWidget(); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, paintHandle(), GtkWidget.sizeof); - int window = widget.window; + int window = OS.GTK_WIDGET_WINDOW(paintHandle()); if (window == 0) return; int hCursor = 0; if (cursor != null) hCursor = cursor.handle; @@ -1904,8 +1824,7 @@ public void setCursor (Cursor cursor) { * */ public void setEnabled (boolean enabled) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); int topHandle = topHandle (); OS.gtk_widget_set_sensitive (topHandle, enabled); /* @@ -1932,8 +1851,7 @@ public void setEnabled (boolean enabled) { * @see #forceFocus */ public boolean setFocus () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return forceFocus (); } @@ -1964,18 +1882,13 @@ public void setFont (Font font) { } /* The font argument is null, revert to default font */ - GtkStyle style = new GtkStyle(); + /* FIXME */ +/* GtkStyle style = new GtkStyle(); OS.memmove (style, OS.gtk_widget_get_default_style(), GtkStyle.sizeof); int fontHandle = OS.gdk_font_ref(style.font); if (fontHandle==0) error(SWT.ERROR_NO_HANDLES); - _setFontHandle(fontHandle); + _setFontHandle(fontHandle);*/ } - -/** - * Actually set the receiver's font in the OS. - * Concrete subclasses may override this method to operate - * on a different handle. - */ void _setFontHandle (int f) { UtilFuncs.setFont(handle, f); } @@ -1996,16 +1909,13 @@ void _setFontHandle (int f) { * */ public void setForeground (Color color) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); int hStyle = OS.gtk_widget_get_style (handle); hStyle = OS.gtk_style_copy (hStyle); - GtkStyle style = new GtkStyle (); - OS.memmove (style, hStyle, GtkStyle.sizeof); + GtkStyle style = new GtkStyle (hStyle); if (color == null) { int hDefaultStyle = OS.gtk_widget_get_default_style (); - GtkStyle defaultStyle = new GtkStyle (); - OS.memmove (defaultStyle, hDefaultStyle, GtkStyle.sizeof); + GtkStyle defaultStyle = new GtkStyle (hDefaultStyle); style.fg0_pixel = defaultStyle.fg0_pixel; style.fg0_red = defaultStyle.fg0_red; style.fg0_green = defaultStyle.fg0_green; @@ -2048,8 +1958,10 @@ public void setForeground (Color color) { style.fg4_green = color.handle.green; style.fg4_blue = color.handle.blue; } - OS.memmove (hStyle, style, GtkStyle.sizeof); - OS.gtk_widget_set_style (handle, hStyle); + /* FIXME */ + /* I believe there is now something like set_color? */ + /*OS.memmove (hStyle, style, GtkStyle.sizeof); + OS.gtk_widget_set_style (handle, hStyle);*/ } /** @@ -2073,8 +1985,7 @@ public void setForeground (Color color) { * */ public void setMenu (Menu menu) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (menu != null) { if ((menu.style & SWT.POP_UP) == 0) { error (SWT.ERROR_MENU_NOT_POP_UP); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java index 1df146eab7..ab475d0904 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java @@ -344,9 +344,8 @@ public void setImage (Image image) { pixmap = image.pixmap; mask = image.mask; } - GtkWidget widget = new GtkWidget (); - OS.memmove(widget, topHandle(), GtkWidget.sizeof); - OS.gdk_window_set_icon (widget.window, 0, pixmap, mask); + int window = OS.GTK_WIDGET_WINDOW(topHandle()); + OS.gdk_window_set_icon (window, 0, pixmap, mask); } /** * Sets the maximized state of the receiver. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index af330a3f7e..dacd5b361f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -107,11 +107,16 @@ public class Display extends Device { Caret currentCaret; Callback caretCallback; int caretID, caretProc; + + Font systemFont; + int textHighlightThickness = 1; /* for emulated widgets */ /* Colors */ Color NORMAL_fg, NORMAL_bg, NORMAL_dark, NORMAL_mid, NORMAL_light, NORMAL_text, NORMAL_base; - Color SELECTED_bg, SELECTED_dark, SELECTED_light, SELECTED_text, SELECTED_base; - Color INSENSITIVE_fg, INSENSITIVE_bg, INSENSITIVE_dark, INSENSITIVE_mid, INSENSITIVE_light, INSENSITIVE_text; + Color ACTIVE_fg, ACTIVE_bg, ACTIVE_dark, ACTIVE_mid, ACTIVE_light, ACTIVE_text, ACTIVE_base; + Color PRELIGHT_fg, PRELIGHT_bg, PRELIGHT_dark, PRELIGHT_mid, PRELIGHT_light, PRELIGHT_text, PRELIGHT_base; + Color SELECTED_fg, SELECTED_bg, SELECTED_dark, SELECTED_mid, SELECTED_light, SELECTED_text, SELECTED_base; + Color INSENSITIVE_fg, INSENSITIVE_bg, INSENSITIVE_dark, INSENSITIVE_mid, INSENSITIVE_light, INSENSITIVE_text, INSENSITIVE_base; /* Key Mappings */ static final int [] [] KeyTable = { @@ -312,18 +317,14 @@ protected void create (DeviceData data) { } synchronized void createDisplay (DeviceData data) { + OS.gtk_set_locale(); if (!OS.gtk_init_check (new int [] {0}, null)) { - /* - * This code is intentionally commented. - */ -// disposed = true; -// SWT.error (SWT.ERROR_DEVICE_DISPOSED); + SWT.error (SWT.ERROR_DEVICE_DISPOSED); return; } OS.gdk_rgb_init (); - int ptr = OS.gtk_check_version (1, 2, 8); + int ptr = OS.gtk_check_version (2, 0, 0); if (ptr != 0) { - System.out.println ("***WARNING: SWT requires GTK version 1.2.8 or greater"); int length = OS.strlen (ptr); byte [] buffer = new byte [length]; OS.memmove (buffer, ptr, length); @@ -511,11 +512,9 @@ Control findControl(int h) { Widget w = findWidget(h); if (w==null) return null; if (w instanceof Control) return (Control)w; - // w is something like an Item. Go for the parent - - GtkWidget widget = new GtkWidget(); - OS.memmove(widget, h, GtkWidget.sizeof); - return findControl(widget.parent); + + /* w is something like an Item. Go for the parent */ + return findControl(OS.GTK_WIDGET_PARENT(h)); } /** @@ -595,6 +594,7 @@ public Object getData () { checkDevice (); return data; } + /** * Returns a point whose x coordinate is the horizontal * dots per inch of the display, and whose y coordinate @@ -608,9 +608,9 @@ public Object getData () { */ public Point getDPI () { checkDevice (); + /* Apparently, SWT believes pixels are always square */ int widthMM = OS.gdk_screen_width_mm (); int width = OS.gdk_screen_width (); - // compute round(25.4 * width / widthMM) int dpi = Compatibility.round(254 * width, widthMM * 10); return new Point (dpi, dpi); } @@ -670,8 +670,7 @@ public Control getFocusControl () { public int getDepth () { checkDevice (); - GdkVisual visual = new GdkVisual (); - OS.memmove(visual, OS.gdk_visual_get_system(), GdkVisual.sizeof); + GdkVisual visual = new GdkVisual (OS.gdk_visual_get_system()); return visual.depth; } @@ -785,139 +784,116 @@ public Color getSystemColor (int id) { return super.getSystemColor (id); } -void initializeSystemColors() { +final void initializeSystemColors() { /* Get the theme colors */ - GtkStyle defaultStyle = new GtkStyle(); - OS.memmove (defaultStyle, OS.gtk_widget_get_default_style(), GtkStyle.sizeof); + GtkStyle defaultStyle = new GtkStyle(OS.gtk_widget_get_default_style()); GdkColor gdk_NORMAL_dark = new GdkColor(); gdk_NORMAL_dark.pixel = defaultStyle.dark0_pixel; gdk_NORMAL_dark.red = defaultStyle.dark0_red; gdk_NORMAL_dark.green = defaultStyle.dark0_green; gdk_NORMAL_dark.blue = defaultStyle.dark0_blue; - NORMAL_dark = Color.gtk_new_system(gdk_NORMAL_dark); + NORMAL_dark = Color.gtk_new(gdk_NORMAL_dark); GdkColor gdk_NORMAL_mid = new GdkColor(); gdk_NORMAL_mid.pixel = defaultStyle.mid0_pixel; gdk_NORMAL_mid.red = defaultStyle.mid0_red; gdk_NORMAL_mid.green = defaultStyle.mid0_green; gdk_NORMAL_mid.blue = defaultStyle.mid0_blue; - NORMAL_mid = Color.gtk_new_system(gdk_NORMAL_mid); + NORMAL_mid = Color.gtk_new(gdk_NORMAL_mid); GdkColor gdk_NORMAL_light = new GdkColor(); gdk_NORMAL_light.pixel = defaultStyle.light0_pixel; gdk_NORMAL_light.red = defaultStyle.light0_red; gdk_NORMAL_light.green = defaultStyle.light0_green; gdk_NORMAL_light.blue = defaultStyle.light0_blue; - NORMAL_light = Color.gtk_new_system(gdk_NORMAL_light); + NORMAL_light = Color.gtk_new(gdk_NORMAL_light); GdkColor gdk_NORMAL_fg = new GdkColor(); gdk_NORMAL_fg.pixel = defaultStyle.fg0_pixel; gdk_NORMAL_fg.red = defaultStyle.fg0_red; gdk_NORMAL_fg.green = defaultStyle.fg0_green; gdk_NORMAL_fg.blue = defaultStyle.fg0_blue; - NORMAL_fg = Color.gtk_new_system(gdk_NORMAL_fg); + NORMAL_fg = Color.gtk_new(gdk_NORMAL_fg); GdkColor gdk_NORMAL_bg = new GdkColor(); gdk_NORMAL_bg.pixel = defaultStyle.bg0_pixel; gdk_NORMAL_bg.red = defaultStyle.bg0_red; gdk_NORMAL_bg.green = defaultStyle.bg0_green; gdk_NORMAL_bg.blue = defaultStyle.bg0_blue; - NORMAL_bg = Color.gtk_new_system(gdk_NORMAL_bg); + NORMAL_bg = Color.gtk_new(gdk_NORMAL_bg); GdkColor gdk_NORMAL_text = new GdkColor(); gdk_NORMAL_text.pixel = defaultStyle.text0_pixel; gdk_NORMAL_text.red = defaultStyle.text0_red; gdk_NORMAL_text.green = defaultStyle.text0_green; gdk_NORMAL_text.blue = defaultStyle.text0_blue; - NORMAL_text = Color.gtk_new_system(gdk_NORMAL_text); + NORMAL_text = Color.gtk_new(gdk_NORMAL_text); GdkColor gdk_NORMAL_base = new GdkColor(); gdk_NORMAL_base.pixel = defaultStyle.base0_pixel; gdk_NORMAL_base.red = defaultStyle.base0_red; gdk_NORMAL_base.green = defaultStyle.base0_green; gdk_NORMAL_base.blue = defaultStyle.base0_blue; - NORMAL_base = Color.gtk_new_system(gdk_NORMAL_base); + NORMAL_base = Color.gtk_new(gdk_NORMAL_base); GdkColor gdk_SELECTED_text = new GdkColor(); gdk_SELECTED_text.pixel = defaultStyle.text3_pixel; gdk_SELECTED_text.red = defaultStyle.text3_red; gdk_SELECTED_text.green = defaultStyle.text3_green; gdk_SELECTED_text.blue = defaultStyle.text3_blue; - SELECTED_text = Color.gtk_new_system(gdk_SELECTED_text); + SELECTED_text = Color.gtk_new(gdk_SELECTED_text); GdkColor gdk_SELECTED_bg = new GdkColor(); gdk_SELECTED_bg.pixel = defaultStyle.bg3_pixel; gdk_SELECTED_bg.red = defaultStyle.bg3_red; gdk_SELECTED_bg.green = defaultStyle.bg3_green; gdk_SELECTED_bg.blue = defaultStyle.bg3_blue; - SELECTED_bg = Color.gtk_new_system(gdk_SELECTED_bg); + SELECTED_bg = Color.gtk_new(gdk_SELECTED_bg); GdkColor gdk_SELECTED_base = new GdkColor(); gdk_SELECTED_base.pixel = defaultStyle.base3_pixel; gdk_SELECTED_base.red = defaultStyle.base3_red; gdk_SELECTED_base.green = defaultStyle.base3_green; gdk_SELECTED_base.blue = defaultStyle.base3_blue; - SELECTED_base = Color.gtk_new_system(gdk_SELECTED_base); + SELECTED_base = Color.gtk_new(gdk_SELECTED_base); GdkColor gdk_SELECTED_light = new GdkColor(); gdk_SELECTED_light.pixel = defaultStyle.light3_pixel; gdk_SELECTED_light.red = defaultStyle.light3_red; gdk_SELECTED_light.green = defaultStyle.light3_green; gdk_SELECTED_light.blue = defaultStyle.light3_blue; - SELECTED_light = Color.gtk_new_system(gdk_SELECTED_light); - - GdkColor gdk_SELECTED_dark = new GdkColor(); - gdk_SELECTED_dark.pixel = defaultStyle.dark3_pixel; - gdk_SELECTED_dark.red = defaultStyle.dark3_red; - gdk_SELECTED_dark.green = defaultStyle.dark3_green; - gdk_SELECTED_dark.blue = defaultStyle.dark3_blue; - SELECTED_dark = Color.gtk_new_system(gdk_SELECTED_dark); + SELECTED_light = Color.gtk_new(gdk_SELECTED_light); + GdkColor gdk_PRELIGHT_light = new GdkColor(); + gdk_PRELIGHT_light.pixel = defaultStyle.light2_pixel; + gdk_PRELIGHT_light.red = defaultStyle.light2_red; + gdk_PRELIGHT_light.green = defaultStyle.light2_green; + gdk_PRELIGHT_light.blue = defaultStyle.light2_blue; + PRELIGHT_light = Color.gtk_new(gdk_PRELIGHT_light); + GdkColor gdk_INSENSITIVE_light = new GdkColor(); gdk_INSENSITIVE_light.pixel = defaultStyle.light4_pixel; gdk_INSENSITIVE_light.red = defaultStyle.light4_red; gdk_INSENSITIVE_light.green = defaultStyle.light4_green; gdk_INSENSITIVE_light.blue = defaultStyle.light4_blue; - INSENSITIVE_light = Color.gtk_new_system(gdk_INSENSITIVE_light); - - GdkColor gdk_INSENSITIVE_dark = new GdkColor(); - gdk_INSENSITIVE_dark.pixel = defaultStyle.light4_pixel; - gdk_INSENSITIVE_dark.red = defaultStyle.light4_red; - gdk_INSENSITIVE_dark.green = defaultStyle.light4_green; - gdk_INSENSITIVE_dark.blue = defaultStyle.light4_blue; - INSENSITIVE_dark = Color.gtk_new_system(gdk_INSENSITIVE_dark); + INSENSITIVE_light = Color.gtk_new(gdk_INSENSITIVE_light); GdkColor gdk_INSENSITIVE_fg = new GdkColor(); gdk_INSENSITIVE_fg.pixel = defaultStyle.fg4_pixel; gdk_INSENSITIVE_fg.red = defaultStyle.fg4_red; gdk_INSENSITIVE_fg.green = defaultStyle.fg4_green; gdk_INSENSITIVE_fg.blue = defaultStyle.fg4_blue; - INSENSITIVE_fg = Color.gtk_new_system(gdk_INSENSITIVE_fg); + INSENSITIVE_fg = Color.gtk_new(gdk_INSENSITIVE_fg); GdkColor gdk_INSENSITIVE_bg = new GdkColor(); gdk_INSENSITIVE_bg.pixel = defaultStyle.bg4_pixel; gdk_INSENSITIVE_bg.red = defaultStyle.bg4_red; gdk_INSENSITIVE_bg.green = defaultStyle.bg4_green; gdk_INSENSITIVE_bg.blue = defaultStyle.bg4_blue; - INSENSITIVE_bg = Color.gtk_new_system(gdk_INSENSITIVE_bg); - - GdkColor gdk_INSENSITIVE_mid = new GdkColor(); - gdk_INSENSITIVE_mid.pixel = defaultStyle.bg4_pixel; - gdk_INSENSITIVE_mid.red = defaultStyle.bg4_red; - gdk_INSENSITIVE_mid.green = defaultStyle.bg4_green; - gdk_INSENSITIVE_mid.blue = defaultStyle.bg4_blue; - INSENSITIVE_mid = Color.gtk_new_system(gdk_INSENSITIVE_mid); - - GdkColor gdk_INSENSITIVE_text = new GdkColor(); - gdk_INSENSITIVE_text.pixel = defaultStyle.bg4_pixel; - gdk_INSENSITIVE_text.red = defaultStyle.bg4_red; - gdk_INSENSITIVE_text.green = defaultStyle.bg4_green; - gdk_INSENSITIVE_text.blue = defaultStyle.bg4_blue; - INSENSITIVE_text = Color.gtk_new_system(gdk_INSENSITIVE_text); - + INSENSITIVE_bg = Color.gtk_new(gdk_INSENSITIVE_bg); } /** @@ -942,10 +918,8 @@ void initializeSystemColors() { */ public Font getSystemFont () { checkDevice (); - GtkStyle style = new GtkStyle(); - OS.memmove (style, OS.gtk_widget_get_default_style(), GtkStyle.sizeof); - int gdkFont = style.font; // gives a GdkFont* - return Font.gtk_new (gdkFont); + if (systemFont==null) systemFont = new Font(this, new FontData("fixed", 12, 0)); + return systemFont; } /** @@ -1032,7 +1006,7 @@ public int internal_new_GC (GCData data) { return gc; } -final boolean isValidThread () { +boolean isValidThread () { return thread == Thread.currentThread (); } @@ -1170,8 +1144,11 @@ void releaseDisplay () { messagesSize = windowProc2 = windowProc3 = windowProc4 = windowProc5 = 0; NORMAL_fg = NORMAL_bg = NORMAL_dark = NORMAL_mid = NORMAL_light = NORMAL_text = NORMAL_base = - SELECTED_bg = SELECTED_dark = SELECTED_light = SELECTED_text = SELECTED_base = - INSENSITIVE_fg = INSENSITIVE_bg = INSENSITIVE_dark = INSENSITIVE_mid = INSENSITIVE_light = INSENSITIVE_text =null; + ACTIVE_fg = ACTIVE_bg = ACTIVE_dark = ACTIVE_mid = ACTIVE_light = ACTIVE_text = ACTIVE_base = + PRELIGHT_fg = PRELIGHT_bg = PRELIGHT_dark = PRELIGHT_mid = PRELIGHT_light = PRELIGHT_text = PRELIGHT_base = + SELECTED_fg = SELECTED_bg = SELECTED_dark = SELECTED_mid = SELECTED_light = SELECTED_text = SELECTED_base = + INSENSITIVE_fg = INSENSITIVE_bg = INSENSITIVE_dark = INSENSITIVE_mid = INSENSITIVE_light = INSENSITIVE_text = + INSENSITIVE_base = null; } RunnableLock removeFirst () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java index 940b7427f4..18f68b3f3e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java @@ -6,6 +6,8 @@ package org.eclipse.swt.widgets; */ import org.eclipse.swt.*; +import org.eclipse.swt.internal.*; +import org.eclipse.swt.internal.gtk.*; /** * Instances of this class allow the user to navigate @@ -21,10 +23,12 @@ import org.eclipse.swt.*; * within the SWT implementation. *

    */ -public class FileDialog extends GtkFileDialog { - - String fullPath, fileName, filterPath; - String[] filterNames, filterExtensions; +public class FileDialog extends Dialog { + String [] filterNames = new String [0]; + String [] filterExtensions = new String [0]; + String filterPath = "", fileName = ""; + String fullPath = ""; + boolean cancel = true; /** * Constructs a new instance of this class given only its @@ -85,7 +89,15 @@ public FileDialog (Shell parent, int style) { super (parent, style); checkSubclass (); } - +int cancelFunc (int widget, int callData) { + cancel = true; + OS.gtk_widget_destroy (callData); + return 0; +} +int destroyFunc (int widget, int callData) { + OS.gtk_main_quit (); + return 0; +} /** * Returns the path of the first file that was * selected in the dialog relative to the filter path, @@ -133,7 +145,104 @@ public String [] getFilterNames () { public String getFilterPath () { return filterPath; } +int okFunc (int widget, int callData) { + cancel = false; + char separator = System.getProperty ("file.separator").charAt (0); + int lpFilename = OS.gtk_file_selection_get_filename (callData); + int filenameLength = OS.strlen (lpFilename); + byte [] filenameBytes = new byte [filenameLength]; + OS.memmove (filenameBytes, lpFilename, filenameLength); + fullPath = new String (Converter.mbcsToWcs (null, filenameBytes)); + + /* Calculate fileName and filterPath */ + int separatorIndex = fullPath.indexOf (separator); + int index = separatorIndex; + while (index != -1) { + separatorIndex = index; + index = fullPath.indexOf (separator, index + 1); + } + fileName = fullPath.substring (separatorIndex + 1, fullPath.length ()); + filterPath = fullPath.substring (0, separatorIndex); + OS.gtk_widget_destroy (callData); + return 0; +} +/** + * Makes the dialog visible and brings it to the front + * of the display. + * + * @return a string describing the absolute path of the first selected file, + * or null if the dialog was cancelled or an error occurred + * + * @exception SWTException
      + *
    • ERROR_WIDGET_DISPOSED - if the dialog has been disposed
    • + *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog
    • + *
    + */ +public String open () { + byte [] titleBytes = Converter.wcsToMbcs (null, title, true); + int handle = OS.gtk_file_selection_new (titleBytes); + + /* Calculate the fully-specified file name and convert to bytes */ + StringBuffer stringBuffer = new StringBuffer (); + char separator = System.getProperty ("file.separator").charAt (0); + if (filterPath == null) { + filterPath = ""; + } else { + if (filterPath.length () > 0) { + stringBuffer.append (filterPath); + if (filterPath.charAt (filterPath.length () - 1) != separator) { + stringBuffer.append (separator); + } + } + } + if (fileName == null) { + fileName = ""; + } else { + stringBuffer.append (fileName); + } + fullPath = stringBuffer.toString (); + byte [] fullPathBytes = Converter.wcsToMbcs (null, fullPath, true); + OS.gtk_file_selection_set_filename (handle, fullPathBytes); + + /* Set the extension */ + if (filterNames == null) filterNames = new String [0]; + if (filterExtensions == null) filterExtensions = new String [0]; + if (filterExtensions.length == 1) { + String ext = filterExtensions [0]; + byte [] extBytes = Converter.wcsToMbcs (null, ext, true); + OS.gtk_file_selection_complete (handle, extBytes); + } + + /* Hook callbacks */ + Callback destroyCallback = new Callback (this, "destroyFunc", 2); + int destroyFunc = destroyCallback.getAddress (); + byte [] destroy = Converter.wcsToMbcs (null, "destroy", true); + OS.gtk_signal_connect (handle, destroy, destroyFunc, handle); + byte [] clicked = Converter.wcsToMbcs (null, "clicked", true); + Callback okCallback = new Callback (this, "okFunc", 2); + int okFunc = okCallback.getAddress (); + Callback cancelCallback = new Callback (this, "cancelFunc", 2); + int cancelFunc = cancelCallback.getAddress (); + OS.gtk_signal_connect (OS.GTK_FILE_SELECTION_OK_BUTTON(handle), clicked, okFunc, handle); + OS.gtk_signal_connect (OS.GTK_FILE_SELECTION_CANCEL_BUTTON(handle), clicked, cancelFunc, handle); + + fileName = null; + fullPath = null; + filterPath = null; + + /* Show the dialog */ + cancel = true; + OS.gtk_widget_show_now (handle); + OS.gtk_main (); + destroyCallback.dispose (); + okCallback.dispose (); + cancelCallback.dispose (); + + /* Return the full path or null */ + if (cancel) return null; + return fullPath; +} /** * Set the initial filename which the dialog will * select by default when opened to the argument, @@ -175,14 +284,4 @@ public void setFilterNames (String [] names) { public void setFilterPath (String string) { filterPath = string; } - -boolean getAnswer() { - String fileNameFromOS = getFileNameFromOS(); - int separatorIndex = calculateLastSeparatorIndex(fileNameFromOS); - if (separatorIndex+1 == fileNameFromOS.length()) return false; // the user selected a directory - fullPath = answer = fileNameFromOS; - fileName = fullPath.substring (separatorIndex + 1, fullPath.length ()); - filterPath = fullPath.substring (0, separatorIndex); - return true; -} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java index 8f3a57f991..7f9a64ee09 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java @@ -103,7 +103,7 @@ int okFunc (int widget, int callData) { byte [] buffer = new byte [fontSize]; OS.memmove (buffer, hFontName, fontSize); char [] fontName = Converter.mbcsToWcs (null, buffer); - fontData = FontData.gtk_new(new String (fontName)); + //fontData = FontData.gtk_new(new String (fontName)); OS.gtk_widget_destroy (callData); return 0; } @@ -124,15 +124,13 @@ public FontData open () { byte [] titleBytes; titleBytes = Converter.wcsToMbcs (null, title, true); handle = OS.gtk_font_selection_dialog_new (titleBytes); - GtkFontSelectionDialog dialog = new GtkFontSelectionDialog (); - OS.memmove (dialog, handle, GtkFontSelectionDialog.sizeof); if (parent!=null) { OS.gtk_window_set_modal(handle, true); - OS.gtk_window_set_transient_for(handle, parent.topHandle); + OS.gtk_window_set_transient_for(handle, parent.topHandle()); } if (fontData != null) { byte[] buffer = Converter.wcsToMbcs(null, fontData.gtk_getXlfd(), true); - OS.gtk_font_selection_set_font_name(dialog.fontsel, buffer); + OS.gtk_font_selection_dialog_set_font_name(handle, buffer); } Callback destroyCallback = new Callback (this, "destroyFunc", 2); int destroyFunc = destroyCallback.getAddress (); @@ -143,8 +141,8 @@ public FontData open () { int okFunc = okCallback.getAddress (); Callback cancelCallback = new Callback (this, "cancelFunc", 2); int cancelFunc = cancelCallback.getAddress (); - OS.gtk_signal_connect (dialog.ok_button, clicked, okFunc, handle); - OS.gtk_signal_connect (dialog.cancel_button, clicked, cancelFunc, handle); + OS.gtk_signal_connect (OS.GTK_FONT_SELECTION_DIALOG_OK_BUTTON(handle), clicked, okFunc, handle); + OS.gtk_signal_connect (OS.GTK_FONT_SELECTION_DIALOG_CANCEL_BUTTON(handle), clicked, cancelFunc, handle); fontData = null; OS.gtk_widget_show_now (handle); OS.gtk_main (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java index 93cc92e46b..4aaa0ff0fd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java @@ -30,8 +30,7 @@ import org.eclipse.swt.graphics.*; */ public class Group extends Composite { int frameHandle; - String text=""; - byte[] TestString = string2bytesConvertMnemonic("Test String"); + String text=""; int bogus; /** * Constructs a new instance of this class given its parent @@ -78,13 +77,13 @@ static int checkStyle (int style) { void createHandle(int index) { state |= HANDLE; - eventBoxHandle = OS.gtk_event_box_new (); - if (eventBoxHandle == 0) error (SWT.ERROR_NO_HANDLES); - frameHandle = OS.gtk_frame_new(null); if (frameHandle == 0) error (SWT.ERROR_NO_HANDLES); - handle = OS.gtk_fixed_new(); + boxHandle = OS.gtk_event_box_new(); + if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); + + handle = OS.eclipse_fixed_new(); if (handle == 0) error (SWT.ERROR_NO_HANDLES); } @@ -98,35 +97,14 @@ void _setHandleStyle() { } void configure() { - _connectParent(); - OS.gtk_container_add(eventBoxHandle, frameHandle); - OS.gtk_container_add(frameHandle, handle); -} - -public Point computeSize (int wHint, int hHint, boolean changed) { - checkWidget (); - int width = _computeSize(wHint, hHint, changed).x; - int height = 0; - Point size; - if (layout != null) { - size = layout.computeSize (this, wHint, hHint, changed); - } else { - size = minimumSize (); - } - if (size.x == 0) size.x = DEFAULT_WIDTH; - if (size.y == 0) size.y = DEFAULT_HEIGHT; - if (wHint != SWT.DEFAULT) size.x = wHint; - if (hHint != SWT.DEFAULT) size.y = hHint; - width = Math.max (width, size.x); - height = Math.max (height, size.y); - Rectangle trim = computeTrim (0, 0, width, height); - width = trim.width; height = trim.height; - return new Point (width, height); + parent._connectChild(frameHandle); + OS.gtk_container_add(frameHandle, boxHandle); + OS.gtk_container_add(boxHandle, handle); } void showHandle() { - OS.gtk_widget_show (eventBoxHandle); OS.gtk_widget_show (frameHandle); + OS.gtk_widget_show (boxHandle); OS.gtk_widget_show (handle); OS.gtk_widget_realize (handle); } @@ -151,60 +129,69 @@ void deregister () { WidgetTable.remove (frameHandle); } -int topHandle () { return eventBoxHandle; } +int topHandle () { return frameHandle; } int parentingHandle() { return handle; } + /* * === GEOMETRY === */ -public Rectangle _getClientArea () { - /* - * The Group coordinates originate at the client area - */ - int width, height; - Point size = _getSize(); - Trim trim = _getTrim(); - width = size.x - trim.left - trim.right; - height = size.y - trim.top - trim.bottom; - return new Rectangle(0,0, width, height); + +public Point computeSize (int wHint, int hHint, boolean changed) { + checkWidget (); + if (layout==null) return computeNativeSize(handle, wHint, hHint, changed); + + Point size = layout.computeSize (this, wHint, hHint, changed); + if (size.x == 0) size.x = DEFAULT_WIDTH; + if (size.y == 0) size.y = DEFAULT_HEIGHT; + if (wHint != SWT.DEFAULT) size.x = wHint; + if (hHint != SWT.DEFAULT) size.y = hHint; + Rectangle trim = computeTrim (0, 0, size.x, size.y); + return new Point (trim.width, trim.height); } -Trim _getTrim() { - trim = new Trim(); - - // set up the test widgets - int testWindowHandle = OS.gtk_window_new(0); - int testHandle = OS.gtk_frame_new(TestString); - OS.gtk_container_add(testWindowHandle, testHandle); - OS.gtk_widget_realize(testHandle); - - // get info - GtkFrame frame = new GtkFrame(); - OS.memmove (frame, testHandle, GtkFrame.sizeof); - GtkStyle groupStyle = new GtkStyle(); - OS.memmove (groupStyle, frame.style, GtkStyle.sizeof); - GtkStyleClass styleClass = new GtkStyleClass(); - OS.memmove (styleClass, groupStyle.klass, GtkStyleClass.sizeof); - - // see gtk_frame_size_allocate() - trim.left = trim.right = frame.border_width + styleClass.xthickness; - trim.top = frame.border_width + Math.max(frame.label_height, styleClass.ythickness); - trim.bottom = frame.border_width + styleClass.ythickness; - - // clean up - OS.gtk_widget_destroy(testHandle); - OS.gtk_widget_destroy(testWindowHandle); - return trim; +/** + * Given a desired client area for the receiver + * (as described by the arguments), returns the bounding + * rectangle which would be required to produce that client + * area. + *

    + * In other words, it returns a rectangle such that, if the + * receiver's bounds were set to that rectangle, the area + * of the receiver which is capable of displaying data + * (that is, not covered by the "trimmings") would be the + * rectangle described by the arguments (relative to the + * receiver's parent). + *

    + * + * @return the required bounds to produce the given client area + * + * @exception SWTException
      + *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • + *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • + *
    + * + * @see #getClientArea + */ +public Rectangle computeTrim (int x, int y, int width, int height) { + checkWidget(); + int[] trims = new int[4]; + OS.swt_frame_get_trim(frameHandle, trims); + return new Rectangle (x-trims[1], y-trims[0], width+trims[1]+trims[2], height+trims[0]+trims[3]); } -boolean _setSize(int width, int height) { - boolean differentExtent = UtilFuncs.setSize (topHandle(), width,height); - Point clientSize = UtilFuncs.getSize(frameHandle); - // WRONG but it's quite safe - the frame clips it - UtilFuncs.setSize (handle, clientSize.x, clientSize.y); - return differentExtent; +public Rectangle getClientArea () { + checkWidget(); + /* The Group coordinates originate at the client area */ + int width, height; + Point size = _getSize(); + int[] trims = new int[4]; + OS.swt_frame_get_trim(frameHandle, trims); + return new Rectangle(0,0, size.x - trims[1] - trims[2], size.y - trims[0] - trims[3]); } + + /* ========= Model Logic ========= */ String getNameText () { @@ -223,8 +210,7 @@ String getNameText () { * */ public String getText () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return text; } @@ -245,8 +231,7 @@ public String getText () { * */ public void setText (String string) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); OS.gtk_frame_set_label (frameHandle, string2bytesConvertMnemonic(string)); text=string; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java index 84f872b4a8..93f70839f5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java @@ -29,7 +29,7 @@ import org.eclipse.swt.graphics.*; */ public class Label extends Control { - int boxHandle, frameHandle; + int frameHandle; Image image; String text; @@ -72,16 +72,13 @@ static int checkStyle (int style) { void createHandle (int index) { state |= HANDLE; - - boxHandle = OS.gtk_event_box_new (); - if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); - + frameHandle = OS.gtk_frame_new(null); if (frameHandle == 0) error (SWT.ERROR_NO_HANDLES); handle = ((style&SWT.SEPARATOR) != 0)? (((style&SWT.HORIZONTAL)!= 0)? OS.gtk_hseparator_new() : OS.gtk_vseparator_new()): - OS.gtk_label_new (new byte [1]); + OS.gtk_label_new (null); if (handle == 0) error (SWT.ERROR_NO_HANDLES); } @@ -113,13 +110,11 @@ void setHandleStyle () { } void configure() { - _connectParent(); - OS.gtk_container_add(boxHandle, frameHandle); + parent._connectChild(topHandle()); OS.gtk_container_add(frameHandle, handle); } void showHandle() { - OS.gtk_widget_show (boxHandle); OS.gtk_widget_show (frameHandle); OS.gtk_widget_show (handle); OS.gtk_widget_realize (handle); @@ -127,20 +122,14 @@ void showHandle() { void register () { super.register (); - WidgetTable.put (boxHandle, this); WidgetTable.put (frameHandle, this); } void deregister () { super.deregister (); - WidgetTable.remove (boxHandle); WidgetTable.remove (frameHandle); } -int eventHandle () { - return boxHandle; -} - void releaseWidget () { super.releaseWidget (); image = null; @@ -149,16 +138,10 @@ void releaseWidget () { void releaseHandle () { super.releaseHandle (); - boxHandle = frameHandle = 0; -} - -int topHandle () { - return boxHandle; + frameHandle = 0; } -int computeHandle () { - return frameHandle; -} +int topHandle () { return frameHandle; } public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); @@ -298,7 +281,7 @@ public void setImage (Image image) { WidgetTable.remove (handle); OS.gtk_widget_destroy (handle); if (image == null) { - handle = OS.gtk_label_new (new byte [1]); + handle = OS.gtk_label_new (null); } else { handle = OS.gtk_pixmap_new (image.pixmap, image.mask); } @@ -340,7 +323,7 @@ public void setText (String string) { //NOT IMPLEMENTED - events and state of handle lost WidgetTable.remove (handle); OS.gtk_widget_destroy (handle); - handle = OS.gtk_label_new (new byte [1]); + handle = OS.gtk_label_new (null); OS.gtk_container_add (frameHandle, handle); WidgetTable.put (handle, this); int alignment = style & (SWT.LEFT | SWT.RIGHT | SWT.CENTER); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 053ba6cc28..054e369425 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -195,7 +195,7 @@ void setHandleStyle() { } void configure() { - _connectParent(); + parent._connectChild(topHandle()); OS.gtk_container_add (scrolledHandle, handle); } @@ -316,8 +316,7 @@ public void deselectAll () { */ public int getFocusIndex () { checkWidget(); - GtkCList clist = new GtkCList(); - OS.memmove(clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList(handle); return clist.focus_row; } @@ -365,8 +364,7 @@ public String getItem (int index) { */ public int getItemCount () { checkWidget(); - GtkCList widget = new GtkCList (); - OS.memmove (widget, handle, GtkCList.sizeof); + GtkCList widget = new GtkCList (handle); return widget.rows; } @@ -386,8 +384,7 @@ public int getItemCount () { */ public int getItemHeight () { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); return clist.row_height; } @@ -441,8 +438,7 @@ public String [] getItems () { */ public String [] getSelection () { checkWidget(); - GtkCList widget = new GtkCList (); - OS.memmove (widget, handle, GtkCList.sizeof); + GtkCList widget = new GtkCList (handle); int list = widget.selection; if (list==0) return new String[0]; int length = OS.g_list_length (list); @@ -475,8 +471,7 @@ public String [] getSelection () { */ public int getSelectionCount () { checkWidget(); - GtkCList widget = new GtkCList (); - OS.memmove (widget, handle, GtkCList.sizeof); + GtkCList widget = new GtkCList (handle); return OS.g_list_length (widget.selection); } @@ -496,8 +491,7 @@ public int getSelectionCount () { */ public int getSelectionIndex () { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove(clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); int list = clist.selection; if (OS.g_list_length (list) == 0) return -1; return OS.g_list_nth_data (list, 0); @@ -523,8 +517,7 @@ public int getSelectionIndex () { */ public int [] getSelectionIndices () { checkWidget(); - GtkCList widget = new GtkCList (); - OS.memmove (widget, handle, GtkCList.sizeof); + GtkCList widget = new GtkCList (handle); int list = widget.selection; int length = OS.g_list_length (list); int [] indices = new int [length]; @@ -548,8 +541,7 @@ public int [] getSelectionIndices () { */ public int getTopIndex () { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove(clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); return -clist.voffset / (clist.row_height + 1); } @@ -624,8 +616,7 @@ public int indexOf (String string, int start) { */ public boolean isSelected (int index) { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); int list = clist.selection; if (list == 0) return false; int length = OS.g_list_length (list); @@ -650,14 +641,14 @@ int processMouseUp (int callData, int arg1, int int2) { * no selection signal was set and issue a fake selection * event. */ - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - int x = (int) gdkEvent.x, y = (int) gdkEvent.y; + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int x = (int) (px[0]), y = (int) (py[0]); int [] row = new int [1], column = new int [1]; int code = OS.gtk_clist_get_selection_info (handle, x, y, row, column); if (code != 0) { - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); if (selected && clist.selection != 0) { int list = clist.selection; int length = OS.g_list_length (list); @@ -674,21 +665,13 @@ int processMouseUp (int callData, int arg1, int int2) { } int processSelection (int int0, int int1, int int2) { - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); if (int0 != clist.focus_row) return 0; if ((style & SWT.MULTI) != 0) selected = false; - boolean single = true; - if (int2 != 0) { - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, int2, GdkEventButton.sizeof); - single = gdkEvent.type != OS.GDK_2BUTTON_PRESS; - } - if (single) { - postEvent (SWT.Selection); - } else { - postEvent (SWT.DefaultSelection); - } + int type = SWT.Selection; + if (int2 != 0) + if (OS.GDK_EVENT_TYPE(int2) == OS.GDK_2BUTTON_PRESS) type = SWT.DefaultSelection; + postEvent (type); return 0; } @@ -1124,8 +1107,7 @@ public void setTopIndex (int index) { */ public void showSelection () { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove(clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); int list = clist.selection; if (OS.g_list_length (list) == 0) return; int index = OS.g_list_nth_data (list, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 7a77f50dc2..34e9f1e38e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -164,11 +164,11 @@ public Display getDisplay () { * */ public boolean getEnabled () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return (widget.flags & OS.GTK_SENSITIVE) != 0; + checkWidget(); + /* FIXME - this just checks for the SENSITIVE flag in the widget. + * SN: Should we look at the effective sensitivity instead? + */ + return OS.GTK_WIDGET_SENSITIVE(handle); } /** * Returns the item at the given, zero-relative index in the @@ -325,11 +325,8 @@ public Shell getShell () { * */ public boolean getVisible () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return (widget.flags & OS.GTK_MAPPED) != 0; + checkWidget(); + return OS.GTK_WIDGET_MAPPED(handle); } /** * Searches the receiver's list starting at the first item diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java index 1de7188b22..44306c6006 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java @@ -277,11 +277,8 @@ public Display getDisplay () { * */ public boolean getEnabled () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return (widget.flags & OS.GTK_SENSITIVE) != 0; + checkWidget(); + return OS.GTK_WIDGET_SENSITIVE(handle); } /** * Returns the receiver's cascade menu if it has one or null @@ -332,12 +329,9 @@ public Menu getParent () { * */ public boolean getSelection () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false; - GtkCheckMenuItem menuItem = new GtkCheckMenuItem (); - OS.memmove (menuItem, handle, GtkCheckMenuItem.sizeof); - return menuItem.active != 0; + return OS.gtk_check_menu_item_get_active(handle); } void hookEvents () { super.hookEvents (); @@ -586,16 +580,14 @@ public void setMenu (Menu menu) { * */ public void setSelection (boolean selected) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return; OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_check_menu_item_set_active (handle, selected); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); } public void setText (String string) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; text = string; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java index ed3a745f1c..28bc6ad91f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java @@ -171,11 +171,9 @@ private void createHandle() { } } private void createMessage() { - byte[] bytes = Converter.wcsToMbcs (null, getMessage(), true); - label = OS.gtk_label_new (bytes); - GtkDialog dialog = new GtkDialog(); - OS.memmove (dialog, handle, GtkDialog.sizeof); - OS.gtk_box_pack_start (dialog.vbox, label, true, true, 5); // FIXME should we use container_add?? + label = OS.gtk_label_new (message); + if (label==0) error(SWT.ERROR_NO_HANDLES); + OS.gtk_box_pack_start (OS.GTK_DIALOG_VBOX(handle), label, true, true, 5); // FIXME should we use container_add?? } private void createActionButtons() { if ((style & SWT.OK) != 0) buttonOK = createButton("OK"); @@ -197,9 +195,7 @@ private void showHandle() { int decor = 0; if (hasTitle) decor |= OS.GDK_DECOR_TITLE; - GtkWidget widget = new GtkWidget(); - OS.memmove(widget, handle, GtkWidget.sizeof); - int gdkWindow = widget.window; + int gdkWindow = OS.GTK_WIDGET_WINDOW(handle); OS.gdk_window_set_decorations(gdkWindow, decor); if (hasTitle) { byte[] bytes = Converter.wcsToMbcs (null, title, true); @@ -207,12 +203,9 @@ private void showHandle() { } } int createButton(String buttonName) { - System.out.println("Creating button "+buttonName); byte[] bytes = Converter.wcsToMbcs (null, buttonName, true); int buttonHandle = OS.gtk_button_new_with_label(bytes); - GtkDialog dialog = new GtkDialog(); - OS.memmove (dialog, handle, GtkDialog.sizeof); - OS.gtk_box_pack_start (dialog.action_area, buttonHandle, true, true, 0); + OS.gtk_box_pack_start (OS.GTK_DIALOG_ACTION_AREA(handle), buttonHandle, true, true, 0); hookSelection(buttonHandle); return buttonHandle; } @@ -222,7 +215,6 @@ private void hookSelection(int h) { Callback okCallback = new Callback (this, "activateFunc", 2); int okFunc = okCallback.getAddress (); OS.gtk_signal_connect (h, clicked, okFunc, h); - } private static int checkStyle (int style) { int mask = (SWT.YES | SWT.NO | SWT.OK | SWT.CANCEL | SWT.ABORT | SWT.RETRY | SWT.IGNORE); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java index cad77f4868..c779a425f4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java @@ -83,9 +83,7 @@ private void createCursor() { int cursorType = ((style&SWT.VERTICAL)!=0)? OS.GDK_SB_H_DOUBLE_ARROW:OS.GDK_SB_V_DOUBLE_ARROW; cursor = OS.gdk_cursor_new(cursorType); - GtkWidget widget = new GtkWidget (); - OS.memmove(widget, handle, GtkWidget.sizeof); - OS.gdk_window_set_cursor(widget.window, cursor); + OS.gdk_window_set_cursor(OS.GTK_WIDGET_WINDOW(handle), cursor); } public Point computeSize (int wHint, int hHint, boolean changed) { @@ -165,13 +163,16 @@ public void removeSelectionListener(SelectionListener listener) { } int processMouseDown (int callData, int arg1, int int2) { - OS.gtk_grab_add(handle); +/* OS.gtk_grab_add(handle); dragging = true; - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - if (gdkEvent.button != 1) return 0; - startX = (int)gdkEvent.x; startY = (int)gdkEvent.y; - start_root_x=(int)gdkEvent.x_root; start_root_y=(int)gdkEvent.y_root; + int button = OS.gdk_event_button_get_button(callData); + if (button != 1) return 0; + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + startX = (int)(px[0]); startY = (int)(py[0]); + OS.gdk_event_get_root_coords(callData, px, py); + start_root_x=(int)(px[0]); start_root_y=(int)(py[0]); drawX=startX; drawY=startY; GtkWidget gtkwidget = new GtkWidget(); OS.memmove(gtkwidget, handle, GtkWidget.sizeof); @@ -179,25 +180,27 @@ int processMouseDown (int callData, int arg1, int int2) { lastX = gtkwidget.alloc_x - border; lastY = gtkwidget.alloc_y - border; Event event = new Event (); event.detail = SWT.DRAG; - event.time = gdkEvent.time; + event.time = OS.gdk_event_get_time(callData); event.x = lastX; event.y = lastY; event.width = width; event.height = height; - sendEvent (SWT.MouseDown, event); + sendEvent (SWT.MouseDown, event);*/ return 0; } int processMouseMove (int callData, int arg1, int int2) { - GdkEventMotion gdkEvent = new GdkEventMotion (); - OS.memmove (gdkEvent, callData, GdkEventMotion.sizeof); if (!dragging) return 0; - GtkWidget gtkwidget = new GtkWidget(); +/* GtkWidget gtkwidget = new GtkWidget(); OS.memmove(gtkwidget, handle, GtkWidget.sizeof); int border = 0, width = gtkwidget.alloc_width+border*2, height = gtkwidget.alloc_height+border*2; int x = gtkwidget.alloc_x - border, y = gtkwidget.alloc_y - border; Rectangle rect = parent.getClientArea(); int parentWidth = rect.width - 2; int parentHeight = rect.height - 2; - last_root_x=(int)gdkEvent.x_root; last_root_y=(int)gdkEvent.y_root; + + double px[] = new double[1]; + double py[] = new double[1]; + OS.gdk_event_get_root_coords(callData, px, py); + last_root_x=(int)(px[0]); last_root_y=(int)(py[0]); int newX = lastX, newY = lastY; if ((style & SWT.VERTICAL) != 0) { if (last_root_x<=start_root_x) @@ -211,13 +214,13 @@ int processMouseMove (int callData, int arg1, int int2) { newY = Math.min (Math.max (0, y + (last_root_y-start_root_y) - startY ), parentHeight - height); } if ((newX == lastX) && (newY == lastY)) return 0; - drawBand(newX, newY, width, height); + drawBand(newX, newY, width, height);*/ return 0; } + int processMouseUp (int callData, int arg1, int int2) { - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - if (gdkEvent.button != 1) return 0; +/* int button = OS.gdk_event_button_get_button(callData); + if (button != 1) return 0; if (!dragging) return 0; GtkWidget gtkwidget = new GtkWidget(); OS.memmove(gtkwidget, handle, GtkWidget.sizeof); @@ -226,7 +229,10 @@ int processMouseUp (int callData, int arg1, int int2) { Rectangle rect = parent.getClientArea(); int parentWidth = rect.width - 2; int parentHeight = rect.height - 2; - last_root_x=(int)gdkEvent.x_root; last_root_y=(int)gdkEvent.y_root; + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + last_root_x=(int)(px[0]); last_root_y=(int)(py[0]); int newX = lastX, newY = lastY; if ((style & SWT.VERTICAL) != 0) { if (last_root_x<=start_root_x) @@ -242,14 +248,14 @@ int processMouseUp (int callData, int arg1, int int2) { if ((newX == lastX) && (newY == lastY)) return 0; Event event = new Event (); - event.time = gdkEvent.time; + event.time = OS.gdk_event_get_time(callData); event.x = newX; event.y = newY; event.width = width; event.height = height; dragging = false; drawBand(newX, newY, width, height); drawing = false; OS.gtk_grab_remove(handle); - sendEvent (SWT.Selection, event); + sendEvent (SWT.Selection, event);*/ return 0; } /* @@ -277,16 +283,14 @@ int processMouseEnter (int callData, int arg1, int int2) { } */ int processMouseExit (int callData, int arg1, int int2) { - GdkEventMotion gdkEvent = new GdkEventMotion (); - OS.memmove (gdkEvent, callData, GdkEventMotion.sizeof); - GtkWidget gtkwidget = new GtkWidget(); +/* GtkWidget gtkwidget = new GtkWidget(); OS.memmove(gtkwidget, handle, GtkWidget.sizeof); int border = 0, width = gtkwidget.alloc_width+border*2, height = gtkwidget.alloc_height+border*2; Event event = new Event (); - event.time = gdkEvent.time; + event.time = OS.gdk_event_get_time(callData); event.x = lastX; event.y = lastY; event.width = width; event.height = height; - sendEvent (SWT.MouseExit, event); + sendEvent (SWT.MouseExit, event);*/ return 0; } @@ -295,9 +299,7 @@ void drawBand (int x, int y, int width, int height) { if (x == drawX && y == drawY) return; Display display= parent.getDisplay (); if (display == null) return; - GtkWidget gtkwidget = new GtkWidget(); - OS.memmove(gtkwidget, parent.topHandle(), GtkWidget.sizeof); - int window = gtkwidget.window; + int window = OS.GTK_WIDGET_WINDOW(parent.topHandle()); if (window == 0) return; byte [] bits = {-86, 0, 85, 0, -86, 0, 85, 0, -86, 0, 85, 0, -86, 0, 85, 0}; int stipplePixmap = OS.gdk_bitmap_create_from_data (window, bits, 8, 8); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java index 7baf8ad787..f0357f25cb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java @@ -117,8 +117,7 @@ void showHandle() { void hookEvents () { super.hookEvents (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); signal_connect (hAdjustment, "value_changed", SWT.Selection, 2); } @@ -154,8 +153,7 @@ void deregister () { public int getIncrement () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.step_increment; } @@ -172,8 +170,7 @@ public int getIncrement () { public int getMaximum () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.upper; } @@ -190,8 +187,7 @@ public int getMaximum () { public int getMinimum () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.lower; } @@ -210,8 +206,7 @@ public int getMinimum () { public int getPageIncrement () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.page_increment; } @@ -228,8 +223,7 @@ public int getPageIncrement () { public int getSelection () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.value; } @@ -280,10 +274,9 @@ public void setIncrement (int value) { checkWidget (); if (value < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); adjustment.step_increment = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -305,10 +298,9 @@ public void setMaximum (int value) { checkWidget (); if (value < 0) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); adjustment.upper = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -330,10 +322,9 @@ public void setMinimum (int value) { checkWidget (); if (value < 0) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); adjustment.lower = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -356,10 +347,9 @@ public void setPageIncrement (int value) { checkWidget (); if (value < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); adjustment.page_increment = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java index 861a36e564..e612fc7fba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java @@ -30,10 +30,10 @@ import org.eclipse.swt.events.*; *
  • an arrow button for incrementing the value
  • * * Based on their style, scroll bars are either HORIZONTAL - * (which have a left facing button for decrementing the value and a - * right facing button for incrementing it) or VERTICAL - * (which have an upward facing button for decrementing the value - * and a downward facing buttons for incrementing it). + * (which have left and right facing buttons for incrementing and + * decrementing the value) or VERTICAL (which have + * up and down facing buttons for incrementing and decrementing + * the value). *

    * On some platforms, the size of the scroll bar's thumb can be * varied relative to the magnitude of the range of values it @@ -169,8 +169,7 @@ public boolean getEnabled () { */ public int getIncrement () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.step_increment; } @@ -186,8 +185,7 @@ public int getIncrement () { */ public int getMaximum () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.upper; } @@ -203,8 +201,7 @@ public int getMaximum () { */ public int getMinimum () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.lower; } @@ -222,8 +219,7 @@ public int getMinimum () { */ public int getPageIncrement () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.page_increment; } @@ -254,8 +250,7 @@ public Scrollable getParent () { */ public int getSelection () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.value; } @@ -273,9 +268,8 @@ public int getSelection () { */ public Point getSize () { checkWidget (); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return new Point (widget.alloc_width, widget.alloc_height); + /* FIXME - NOT_IMPLEMENTED. We can no longer look at the allocation. */ + return new Point (10,10); } /** @@ -293,8 +287,7 @@ public Point getSize () { */ public int getThumb () { checkWidget (); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); return (int) adjustment.page_size; } @@ -443,10 +436,9 @@ public void setEnabled (boolean enabled) { public void setIncrement (int value) { checkWidget (); if (value < 1) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.step_increment = (float) value; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); @@ -467,10 +459,9 @@ public void setIncrement (int value) { public void setMaximum (int value) { checkWidget (); if (value < 0) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.upper = (float) value; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); @@ -491,10 +482,9 @@ public void setMaximum (int value) { public void setMinimum (int value) { checkWidget (); if (value < 0) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.lower = (float) value; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); @@ -516,10 +506,9 @@ public void setMinimum (int value) { public void setPageIncrement (int value) { checkWidget (); if (value < 1) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.page_increment = (float) value; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); @@ -562,10 +551,9 @@ public void setSelection (int value) { public void setThumb (int value) { checkWidget (); if (value < 1) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.page_size = (float) value; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); @@ -601,15 +589,14 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i if (maximum - minimum - thumb < 0) return; if (increment < 1) return; if (pageIncrement < 1) return; - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, handle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (handle); adjustment.lower = minimum; adjustment.upper = maximum; adjustment.step_increment = increment; adjustment.page_increment = pageIncrement; adjustment.page_size = thumb; adjustment.value = selection; - OS.memmove (handle, adjustment, GtkAdjustment.sizeof); + OS.memmove (handle, adjustment); OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); OS.gtk_adjustment_changed (handle); OS.gtk_adjustment_value_changed (handle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index a2405fca32..289ddb8553 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -28,7 +28,6 @@ public abstract class Scrollable extends Control { int scrolledHandle; ScrollBar horizontalBar, verticalBar; - static Trim trim; /** * Prevents uninitialized instances from being created outside the package. @@ -91,27 +90,23 @@ public Scrollable (Composite parent, int style) { * @see #getClientArea */ public Rectangle computeTrim (int x, int y, int width, int height) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - - Trim t = _getTrim(); - return new Rectangle (x-t.left, y-t.top, width+t.left+t.right, height+t.top+t.bottom); -} - -Trim _getTrim() { - if (trim==null) initializeTrim(); - return trim; + checkWidget(); + int hs=0, vs=0; + /* FIXME - just measured the width on one particular theme */ + if ((style&SWT.H_SCROLL)!=0) hs=18; + if ((style&SWT.V_SCROLL)!=0) vs=18; + return new Rectangle (x, y, width+vs, height+hs); } -void initializeTrim() { trim = new Trim(); } - void _fillBin(int binHandle, int childHandle) { + /* GtkBin bin = new GtkBin(); OS.memmove(bin, binHandle, GtkBin.sizeof); bin.child = childHandle; OS.memmove(binHandle, bin, GtkBin.sizeof); OS.gtk_widget_set_parent(childHandle, binHandle); -} + */ + OS.gtk_container_add(binHandle, childHandle);} /* * Subclasses must only use super.configure() @@ -162,11 +157,9 @@ void deregister () { * @see #computeTrim */ public Rectangle getClientArea () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return new Rectangle (0, 0, widget.alloc_width, widget.alloc_height); + checkWidget(); + /* FIXME. Why do we do it here, in the first place? Scrollable is abstract... */ + return new Rectangle (0, 0, 10, 10); } /** * Returns the receiver's horizontal scroll bar if it has diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index d93c35d2f6..8f2cd3c97f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -92,10 +92,9 @@ import org.eclipse.swt.events.*; */ public class Shell extends Decorations { Display display; - int vboxHandle; + int shellHandle, vboxHandle; int modal; int accelGroup; - Rectangle lastClientArea; boolean hasFocus; /* @@ -294,9 +293,7 @@ public void addShellListener (ShellListener listener) { addListener (SWT.Activate, typedListener); addListener (SWT.Deactivate, typedListener); } -void bringToTop () { -// OS.gtk_window_activate_focus (shellHandle); -} + /** * Requests that the window manager close the receiver in * the same way it would be closed when the user clicks on @@ -315,7 +312,7 @@ public void close () { } void closeWidget () { Event event = new Event (); - event.time = OS.gdk_time_get (); + event.time = OS.GDK_CURRENT_TIME(); sendEvent (SWT.Close, event); if (event.doit && !isDisposed ()) dispose (); } @@ -327,58 +324,60 @@ void closeWidget () { void createHandle (int index) { state |= HANDLE; - topHandle = OS.gtk_window_new((parent==null)? OS.GTK_WINDOW_TOPLEVEL:OS.GTK_WINDOW_DIALOG); - if (topHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); - if (parent!=null) OS.gtk_window_set_transient_for(topHandle, parent.topHandle()); + shellHandle = OS.gtk_window_new((parent==null)? OS.GTK_WINDOW_TOPLEVEL:OS.GTK_WINDOW_DIALOG); + if (shellHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); + if (parent!=null) OS.gtk_window_set_transient_for(shellHandle, parent.topHandle()); vboxHandle = OS.gtk_vbox_new(false,0); if (vboxHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); - eventBoxHandle = OS.gtk_event_box_new (); - if (eventBoxHandle == 0) error (SWT.ERROR_NO_HANDLES); - fixedHandle = OS.gtk_fixed_new (); + + boxHandle = OS.gtk_event_box_new(); + if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); + + fixedHandle = OS.eclipse_fixed_new(); if (fixedHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); + handle = OS.gtk_drawing_area_new(); if (handle == 0) SWT.error (SWT.ERROR_NO_HANDLES); + accelGroup = OS.gtk_accel_group_new (); - OS.gtk_window_add_accel_group (topHandle, accelGroup); - OS.gtk_window_set_title (topHandle, new byte [1]); + OS.gtk_window_add_accel_group (shellHandle, accelGroup); + OS.gtk_window_set_title (shellHandle, new byte [1]); } void configure () { - OS.gtk_container_add (topHandle, vboxHandle); - OS.gtk_box_pack_end(vboxHandle, eventBoxHandle, true,true,0); - OS.gtk_container_add (eventBoxHandle, fixedHandle); - OS.gtk_fixed_put(fixedHandle, handle, (short)0,(short)0); + OS.gtk_container_add (shellHandle, vboxHandle); + OS.gtk_box_pack_end(vboxHandle, boxHandle, true,true,0); + OS.gtk_container_add(boxHandle, fixedHandle); + OS.gtk_container_add(fixedHandle, handle); } void showHandle() { - OS.gtk_widget_realize (topHandle); // careful: NOT show + OS.gtk_widget_realize (shellHandle); // careful: NOT show _setStyle(); OS.gtk_widget_realize (vboxHandle); OS.gtk_widget_show_now (vboxHandle); - - OS.gtk_widget_realize (eventBoxHandle); - OS.gtk_widget_show_now (eventBoxHandle); - - OS.gtk_widget_realize (fixedHandle); + OS.gtk_widget_realize (boxHandle); + OS.gtk_widget_show_now (boxHandle); + OS.gtk_widget_realize (fixedHandle); OS.gtk_widget_show_now (fixedHandle); - OS.gtk_widget_realize (handle); OS.gtk_widget_show_now (handle); } void hookEvents () { super.hookEvents (); - signal_connect(topHandle, "map_event", SWT.Deiconify, 3); - signal_connect(topHandle, "unmap_event", SWT.Iconify, 3); - signal_connect(topHandle, "size_allocate", SWT.Resize, 3); - signal_connect(topHandle, "delete_event", SWT.Dispose, 3); + signal_connect_after(shellHandle, "map-event", SWT.Deiconify, 3); + signal_connect_after(shellHandle, "unmap-event", SWT.Iconify, 3); + signal_connect(shellHandle, "size-allocate", SWT.Resize, 3); + signal_connect(shellHandle, "delete-event", SWT.Dispose, 3); } void register () { super.register (); WidgetTable.put (vboxHandle, this); + WidgetTable.put (shellHandle, this); } private void _setStyle() { @@ -386,7 +385,7 @@ private void _setStyle() { ((style&SWT.PRIMARY_MODAL) != 0) || ((style&SWT.APPLICATION_MODAL) != 0) || ((style&SWT.SYSTEM_MODAL) != 0)); - OS.gtk_window_set_modal(topHandle, modal); + OS.gtk_window_set_modal(shellHandle, modal); int decorations = 0; if ((style & SWT.NO_TRIM) == 0) { @@ -404,33 +403,15 @@ private void _setStyle() { */ if ((style & SWT.RESIZE) != 0) decorations |= OS.GDK_DECOR_BORDER; } - GtkWidget widget = new GtkWidget(); - OS.memmove(widget, topHandle, GtkWidget.sizeof); - int w = widget.window; - // PANIC - this must absolutely never happen, so it's not NO_HANDLES actually - if (w == 0) error(SWT.ERROR_NO_HANDLES); - OS.gdk_window_set_decorations(w, decorations); -} - -void _connectChild (int h) { - OS.gtk_fixed_put (fixedHandle, h, (short)0, (short)0); -} - -int topHandle () { - return topHandle; -} - -int parentingHandle() { - return fixedHandle; + OS.gdk_window_set_decorations(OS.GTK_WIDGET_WINDOW(shellHandle), decorations); } +int topHandle () { return shellHandle; } +int parentingHandle() { return fixedHandle; } boolean isMyHandle(int h) { - if (h == topHandle) return true; + if (h == shellHandle) return true; if (h == vboxHandle) return true; - if (h == eventBoxHandle) return true; - if (h == fixedHandle) return true; - if (h == handle) return true; - return false; + return super.isMyHandle(h); } @@ -438,56 +419,46 @@ boolean isMyHandle(int h) { * === GEOMETRY === */ -public Point _getLocation() { - GtkWidget widget = new GtkWidget(); - OS.memmove (widget, topHandle, GtkWidget.sizeof); +Point _getLocation() { int [] x = new int [1], y = new int [1]; - OS.gdk_window_get_origin(widget.window, x,y); + OS.gtk_window_get_position(shellHandle, x,y); return new Point(x[0], y[0]); } -public Point _getSize() { - return UtilFuncs.getSize(vboxHandle); -} - -public Rectangle _getClientArea () { - Point clientSize = UtilFuncs.getSize(eventBoxHandle); - return new Rectangle (0, 0, clientSize.x, clientSize.y); +Point _getSize() { + int[] x = new int[1]; int[] y = new int[1]; + OS.gtk_window_get_size(shellHandle, x, y); + return new Point(x[0], y[0]); } -boolean _setSize(int width, int height) { - /* - * API deficiency in GTK 1.2 - lacking gtk_window_resize. - * We work around this by directly resizing the X window. - * - * First, we find out the GDK handle. - */ - GtkWidget gtkWidget = new GtkWidget(); - OS.memmove(gtkWidget, topHandle, GtkWidget.sizeof); - - OS.gtk_signal_handler_block_by_data (topHandle, SWT.Resize); - OS.gdk_window_resize(gtkWidget.window, width, height); - UtilFuncs.setSize(vboxHandle, width, height); - Point sz = UtilFuncs.getSize(eventBoxHandle); - UtilFuncs.setSize(fixedHandle, sz.x, sz.y); - UtilFuncs.setSize(handle, sz.x, sz.y); - OS.gtk_signal_handler_unblock_by_data (topHandle, SWT.Resize); - - return true; +public Rectangle getClientArea () { + checkWidget(); + Point totalSize = _getSize(); + /* FIXME - subtract trim */ + return new Rectangle (0, 0, totalSize.x, totalSize.y); +} + +void _setSize(int width, int height) { + OS.gtk_signal_handler_block_by_data (shellHandle, SWT.Resize); + OS.gtk_window_resize(shellHandle, width, height); + boolean done = false; + Point s = _getSize(); + while ((s.x!=width) || (s.y!=height)) { + OS.gtk_main_iteration(); + s = _getSize(); + } + OS.gtk_signal_handler_unblock_by_data (shellHandle, SWT.Resize); } -boolean _setLocation (int x, int y) { - GtkWidget gtkWidget = new GtkWidget(); - OS.memmove(gtkWidget, topHandle, GtkWidget.sizeof); - OS.gdk_window_move(gtkWidget.window, x, y); - return true; +void _setLocation (int x, int y) { + OS.gtk_window_move(shellHandle, x, y); } void setInitialSize() { int width = OS.gdk_screen_width () * 5 / 8; int height = OS.gdk_screen_height () * 5 / 8; _setSize(width, height); - OS.gtk_window_set_policy (topHandle, 1,1,0); + OS.gtk_window_set_policy (shellHandle, 1,1,0); } /* @@ -518,11 +489,9 @@ public Display getDisplay () { * but the user clicked in a no-entry widget (like Label). */ Control getFocusControl() { - GtkWindow shell = new GtkWindow(); - OS.memmove(shell, topHandle, GtkWindow.sizeof); - int focusHandle = shell.focus_widget; - if (focusHandle==0) return null; - return (Control)this.getDisplay().findWidget(focusHandle); + checkWidget(); + int answer = OS.gtk_window_get_focus(shellHandle); + return (Control)this.getDisplay().findWidget(answer); } /** @@ -602,19 +571,10 @@ public Shell [] getShells () { public void layout (boolean changed) { checkWidget(); -// if (!resizedSinceLastLayout()) return; - lastClientArea=getClientArea(); if (layout == null) return; layout.layout (this, changed); } -/* - * Returns whether the shell has been resized since the last layout() - */ -boolean resizedSinceLastLayout() { - return !getClientArea().equals(lastClientArea); -} - /** * Moves the receiver to the top of the drawing order for * the display on which it was created (so that all other @@ -637,7 +597,7 @@ public void open () { int processDispose (int int0, int int1, int int2) { closeWidget (); - return 1; + return 0; } int processFocusIn(int int0, int int1, int int2) { @@ -653,10 +613,7 @@ int processFocusOut(int int0, int int1, int int2) { } int processPaint (int callData, int int2, int int3) { - //if (!hooks (SWT.Paint)) return 1; - - GdkEventExpose gdkEvent = new GdkEventExpose (); - OS.memmove (gdkEvent, callData, GdkEventExpose.sizeof); +/* GdkEventExpose gdkEvent = new GdkEventExpose (callData); Event event = new Event (); event.count = gdkEvent.count; event.x = gdkEvent.x; event.y = gdkEvent.y; @@ -669,22 +626,14 @@ int processPaint (int callData, int int2, int int3) { gc.fillRectangle(rect.x, rect.y, rect.width, rect.height); sendEvent (SWT.Paint, event); gc.dispose (); - event.gc = null; - return 1; -/*}else{ - GdkRectangle gdkEvent = new GdkRectangle (); - OS.memmove (gdkEvent, callData, GdkRectangle.sizeof); - Event event = new Event (); -// event.count = gdkEvent.count; - event.x = gdkEvent.x; event.y = gdkEvent.y; - event.width = gdkEvent.width; event.height = gdkEvent.height; - GC gc = event.gc = new GC (this); - OS.gdk_gc_set_clip_rectangle (gc.handle, gdkEvent); - sendEvent (SWT.Paint, event); - gc.dispose (); - event.gc = null; - return 1; -} */ + event.gc = null;*/ + return 0; +} + +int processResize (int int0, int int1, int int2) { + sendEvent (SWT.Resize); + layout(); + return 0; } /** @@ -737,10 +686,8 @@ public void setImeInputMode (int mode) { public void setMaximized (boolean maximized) { checkWidget(); - - /* - * Out of luck on curent GDK. - */ + if (maximized) OS.gtk_window_maximize(shellHandle); + else OS.gtk_window_unmaximize(shellHandle); } public void setMenuBar (Menu menu) { @@ -766,20 +713,8 @@ public void setMenuBar (Menu menu) { public void setMinimized (boolean minimized) { checkWidget(); - - /* - * In GDK, there is no way to iconify a shell. - * If we wanted it really badly, on pure X this is done - * by sending a client message - see ICCCM L.4.1.4. - */ - if (minimized) return; - - /* - * At least we can force a deiconify - */ - GtkWidget w = new GtkWidget(); - OS.memmove(w, topHandle, w.sizeof); - OS.gdk_window_show(w.window); + if (minimized) OS.gtk_window_iconify(shellHandle); + else OS.gtk_window_deiconify(shellHandle); } /** @@ -798,21 +733,20 @@ public void setModal (int modal) { } public void setText (String string) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); super.setText (string); byte [] buffer = Converter.wcsToMbcs (null, string, true); - OS.gtk_window_set_title (topHandle, buffer); + OS.gtk_window_set_title (shellHandle, buffer); } public void setVisible (boolean visible) { checkWidget(); if (visible) { - OS.gtk_widget_show_now (topHandle); + OS.gtk_widget_show_now (shellHandle); display.update(); sendEvent (SWT.Show); } else { - OS.gtk_widget_hide (topHandle); + OS.gtk_widget_hide (shellHandle); sendEvent (SWT.Hide); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java index f01f6e5ce6..91d2a5fd16 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java @@ -30,10 +30,10 @@ import org.eclipse.swt.events.*; *

  • an arrow button for incrementing the value
  • * * Based on their style, sliders are either HORIZONTAL - * (which have a left facing button for decrementing the value and a - * right facing button for incrementing it) or VERTICAL - * (which have an upward facing button for decrementing the value - * and a downward facing buttons for incrementing it). + * (which have left and right facing buttons for incrementing and + * decrementing the value) or VERTICAL (which have + * up and down facing buttons for incrementing and decrementing + * the value). *

    * On some platforms, the size of the slider's thumb can be * varied relative to the magnitude of the range of values it @@ -212,8 +212,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) { public int getIncrement () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.step_increment; } @@ -230,8 +229,7 @@ public int getIncrement () { public int getMaximum () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.upper; } @@ -248,8 +246,7 @@ public int getMaximum () { public int getMinimum () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.lower; } @@ -268,8 +265,7 @@ public int getMinimum () { public int getPageIncrement () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.page_increment; } @@ -286,8 +282,7 @@ public int getPageIncrement () { public int getSelection () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.value; } @@ -305,8 +300,7 @@ public int getSelection () { public int getThumb () { checkWidget (); int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); return (int) adjustment.page_size; } @@ -357,10 +351,9 @@ public void setIncrement (int value) { checkWidget(); if (value < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.step_increment = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.step_increment = (double) value; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -382,10 +375,9 @@ public void setMaximum (int value) { checkWidget (); if (value < 0) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.upper = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.upper = (double) value; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -407,10 +399,9 @@ public void setMinimum (int value) { checkWidget (); if (value < 0) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.lower = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.lower = (double) value; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -433,10 +424,9 @@ public void setPageIncrement (int value) { checkWidget (); if (value < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.page_increment = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.page_increment = (double) value; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -481,10 +471,9 @@ public void setThumb (int value) { checkWidget (); if (value < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.page_size = (float) value; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.page_size = (double) value; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_signal_handler_unblock_by_data (hAdjustment, SWT.Selection); @@ -521,15 +510,14 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i if (increment < 1) return; if (pageIncrement < 1) return; int hAdjustment = OS.gtk_range_get_adjustment (handle); - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, hAdjustment, GtkAdjustment.sizeof); - adjustment.value = (float) selection; - adjustment.lower = (float) minimum; - adjustment.upper = (float) maximum; - adjustment.page_size = (float) thumb; - adjustment.step_increment = (float) increment; - adjustment.page_increment = (float) pageIncrement; - OS.memmove (hAdjustment, adjustment, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment (hAdjustment); + adjustment.value = (double) selection; + adjustment.lower = (double) minimum; + adjustment.upper = (double) maximum; + adjustment.page_size = (double) thumb; + adjustment.step_increment = (double) increment; + adjustment.page_increment = (double) pageIncrement; + OS.memmove (hAdjustment, adjustment); OS.gtk_signal_handler_block_by_data (hAdjustment, SWT.Selection); OS.gtk_adjustment_changed (hAdjustment); OS.gtk_adjustment_value_changed (hAdjustment); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java index 4338e7e92e..d4ea81235a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java @@ -34,10 +34,10 @@ import org.eclipse.swt.events.*; *

    */ public class TabFolder extends Composite { - int notebookHandle; + + int topHandle; TabItem [] items; - /* * == CONSTRUCTORS == */ @@ -75,42 +75,40 @@ public TabFolder (Composite parent, int style) { } /* - * == HANDLE DANCES, FIRST SPECIES == + * == Handle code == */ void createHandle (int index) { state |= HANDLE; - eventBoxHandle = OS.gtk_event_box_new(); - fixedHandle = OS.gtk_fixed_new (); - notebookHandle = OS.gtk_notebook_new (); - handle = OS.gtk_fixed_new(); + topHandle = OS.eclipse_fixed_new(); + handle = OS.gtk_notebook_new (); + boxHandle = OS.gtk_event_box_new(); + fixedHandle = OS.eclipse_fixed_new (); } void configure () { - _connectParent(); - OS.gtk_container_add(eventBoxHandle, fixedHandle); - OS.gtk_fixed_put (fixedHandle, notebookHandle, (short)0, (short)0); - OS.gtk_fixed_put (fixedHandle, handle, (short)2, (short)33); + parent._connectChild(topHandle); + OS.gtk_container_add(topHandle, handle); + OS.gtk_container_add(topHandle, boxHandle); + OS.gtk_container_add(boxHandle, fixedHandle); + OS.eclipse_fixed_set_location(topHandle, boxHandle, 2, 33); /* FIXME */ } void showHandle() { - OS.gtk_widget_show(eventBoxHandle); - OS.gtk_widget_show(fixedHandle); - OS.gtk_widget_show(notebookHandle); + OS.gtk_widget_show(topHandle); OS.gtk_widget_show(handle); - OS.gtk_widget_realize (notebookHandle); - OS.gtk_widget_realize (handle); + OS.gtk_widget_show(boxHandle); + OS.gtk_widget_show(fixedHandle); } void register () { super.register (); - WidgetTable.put (notebookHandle, this); + WidgetTable.put (topHandle, this); } void hookEvents () { super.hookEvents (); - signal_connect (notebookHandle, "size_allocate", SWT.Resize, 3); - signal_connect (notebookHandle, "switch_page", SWT.Selection, 4); + signal_connect (handle, "switch_page", SWT.Selection, 4); } void createWidget (int index) { @@ -118,21 +116,18 @@ void createWidget (int index) { items = new TabItem [4]; } -int topHandle () { return eventBoxHandle; } -int paintHandle () { return notebookHandle; } -int parentingHandle () { return handle; } +int topHandle () { return topHandle; } +public int paintHandle () { return boxHandle; } /* can't do much :-( */ +int parentingHandle () { return fixedHandle; } boolean isMyHandle(int h) { - if (h==eventBoxHandle) return true; - if (h==notebookHandle) return true; - if (h==fixedHandle) return true; - if (h==handle) return true; - return false; + if (h==topHandle) return true; + return super.isMyHandle(h); } public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); //notebookHandle - int width = _computeSize(wHint, hHint, changed).x; +/* int width = _computeSize(wHint, hHint, changed).x; int height = 0; Point size; if (layout != null) { @@ -148,35 +143,37 @@ public Point computeSize (int wHint, int hHint, boolean changed) { height = Math.max (height, size.y); Rectangle trim = computeTrim (0, 0, width, height); width = trim.width; height = trim.height; - return new Point (width, height); + return new Point (width, height);*/ + /* FIXME */ + return new Point(300,300); } /** -* Computes the widget trim. -*/ + * Computes the widget trim. + */ public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget(); return new Rectangle(x-2, y-33, width+4, height+35); } /* - **** Layout code **** + * === Layout code === */ -boolean _setSize(int width, int height) { - boolean differentExtent = UtilFuncs.setSize(eventBoxHandle, width,height); - UtilFuncs.setSize (fixedHandle, width,height); - UtilFuncs.setSize (notebookHandle, width,height); - UtilFuncs.setSize (handle, width-4, height-35); +void _setSize(int width, int height) { + OS.eclipse_fixed_set_size(parent.parentingHandle(), topHandle(), width, height); + /* FIXME */ + int w = Math.max(width - 4, 1); + int h = Math.max(height - 35, 1); + OS.eclipse_fixed_set_size(topHandle, handle, w, h); layoutCurrent(); - return differentExtent; } -public Rectangle _getClientArea () { - org.eclipse.swt.graphics.Point size = _getSize(); - int x = Math.max(size.x-4, 3); - int y = Math.max(size.y-35, 3); - return new Rectangle(0,0, x, y); +public Rectangle getClientArea () { + checkWidget(); + int[] sz = new int[2]; + OS.eclipse_fixed_get_size(topHandle, boxHandle, sz); + return new Rectangle(0,0, sz[0], sz[1]); } void layoutCurrent() { @@ -189,7 +186,7 @@ void layoutCurrent() { } void createItem (TabItem item, int index) { - int list = OS.gtk_container_children (notebookHandle); + int list = OS.gtk_container_children (handle); int itemCount = OS.g_list_length (list); if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_ITEM_NOT_ADDED); if (itemCount == items.length) { @@ -199,16 +196,15 @@ void createItem (TabItem item, int index) { } // create a new label - byte [] buffer = new byte [] {0}; - int labelHandle = OS.gtk_label_new (buffer); + int labelHandle = OS.gtk_label_new (""); // create a new fake page - int stubPage = OS.gtk_fixed_new(); + int stubPage = OS.eclipse_fixed_new(); // put the label and the fake page inside the notebook - OS.gtk_signal_handler_block_by_data (notebookHandle, SWT.Selection); - OS.gtk_notebook_append_page(notebookHandle, stubPage, labelHandle); - OS.gtk_signal_handler_unblock_by_data (notebookHandle, SWT.Selection); + OS.gtk_signal_handler_block_by_data (handle, SWT.Selection); + OS.gtk_notebook_append_page(handle, stubPage, labelHandle); + OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); OS.gtk_widget_show(labelHandle); OS.gtk_widget_show(stubPage); @@ -217,7 +213,7 @@ void createItem (TabItem item, int index) { item.handle = labelHandle; System.arraycopy (items, index, items, index + 1, itemCount++ - index); items [index] = item; - OS.gtk_notebook_set_show_tabs (notebookHandle, true); + OS.gtk_notebook_set_show_tabs (handle, true); } /** @@ -261,7 +257,7 @@ void destroyItem (TabItem item) { index++; } if (index == itemCount) error (SWT.ERROR_ITEM_NOT_REMOVED); - OS.gtk_notebook_remove_page (notebookHandle, index); + OS.gtk_notebook_remove_page (handle, index); System.arraycopy (items, index + 1, items, index, --itemCount - index); items [itemCount] = null; item.handle = 0; @@ -283,9 +279,8 @@ void destroyItem (TabItem item) { */ public TabItem getItem (int index) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - int list = OS.gtk_container_children (notebookHandle); + checkWidget(); + int list = OS.gtk_container_children (handle); int itemCount = OS.g_list_length (list); if (!(0 <= index && index < itemCount)) error (SWT.ERROR_CANNOT_GET_ITEM); return items [index]; @@ -301,10 +296,9 @@ public TabItem getItem (int index) { * */ public int getItemCount () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); //return itemCount; - int list = OS.gtk_container_children (notebookHandle); + int list = OS.gtk_container_children (handle); return OS.g_list_length (list); } /** @@ -324,9 +318,8 @@ public int getItemCount () { * */ public TabItem [] getItems () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - int list = OS.gtk_container_children (notebookHandle); + checkWidget(); + int list = OS.gtk_container_children (handle); int itemCount = OS.g_list_length (list); TabItem [] result = new TabItem [itemCount]; System.arraycopy (items, 0, result, 0, itemCount); @@ -349,9 +342,8 @@ public TabItem [] getItems () { * */ public TabItem [] getSelection () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - int index = OS.gtk_notebook_get_current_page (notebookHandle); + checkWidget(); + int index = OS.gtk_notebook_get_current_page (handle); if (index == -1) return new TabItem [0]; return new TabItem [] {items [index]}; } @@ -367,9 +359,8 @@ public TabItem [] getSelection () { * */ public int getSelectionIndex () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - return OS.gtk_notebook_get_current_page (notebookHandle); + checkWidget(); + return OS.gtk_notebook_get_current_page (handle); } /** @@ -390,10 +381,9 @@ public int getSelectionIndex () { * */ public int indexOf (TabItem item) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); - int list = OS.gtk_container_children (notebookHandle); + int list = OS.gtk_container_children (handle); int itemCount = OS.g_list_length (list); for (int i=0; i */ public void setSelection (TabItem [] items) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (items == null) error (SWT.ERROR_NULL_ARGUMENT); if (items.length == 0) { setSelection (-1); @@ -498,11 +487,11 @@ public void setSelection (TabItem [] items) { void deregister () { super.deregister (); - WidgetTable.remove (notebookHandle); + WidgetTable.remove (topHandle); } void releaseChildren() { - int list = OS.gtk_container_children (notebookHandle); + int list = OS.gtk_container_children (handle); int itemCount = OS.g_list_length (list); for (int i=0; itrue if the receiver's lines are visible, @@ -1362,33 +1331,37 @@ int processMouseDown (int callData, int arg1, int int2) { OS.gtk_widget_grab_focus(handle); // First, see if we have a single or double click - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - boolean isDoubleClick = (gdkEvent.type == OS.GDK_2BUTTON_PRESS); + boolean isDoubleClick = (OS.gdk_event_button_get_button(callData)==2); // We can't just use the x and y coordinates from the Gdk event, // because the actual items are drawn on a special X window - Point where = _gdkWindowGetPointer(); + int[] ppx = new int[1], ppy = new int[1]; + OS.gdk_window_get_pointer(OS.GTK_WIDGET_WINDOW(handle), ppx, ppy, 0); int eventType; if (isDoubleClick) { eventType = SWT.MouseDoubleClick; Event event = new Event (); event.item=itemBeingSelected; - event.x = where.x; event.y = where.y; + event.x = ppx[0]; event.y = ppy[0]; sendEvent (SWT.DefaultSelection, event); return 1; } eventType = SWT.MouseDown; - sendMouseEvent (eventType, gdkEvent.button, gdkEvent.state, gdkEvent.time, where.x, where.y); - if (gdkEvent.button == 3 && menu != null) menu.setVisible (true); - + int[] pMod = new int[1]; + OS.gdk_event_get_state(callData, pMod); + int time = OS.gdk_event_get_time(callData); + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int button = OS.gdk_event_button_get_button(callData); + sendMouseEvent (eventType, button, pMod[0], time, (int)(px[0]), (int)(py[0])); + if (button == 3 && menu != null) menu.setVisible (true); if ((style&SWT.CHECK) != 0) { - GtkCList clist = new GtkCList (); - OS.memmove(clist, handle, GtkCList.sizeof); - int clientX = where.x; - int clientY = where.y - clist.column_title_area_height; + GtkCList clist = new GtkCList (handle); + int clientX = ppx[0]; + int clientY = ppy[0] - clist.column_title_area_height; if (clientY <= 0) return 1; int[] row = new int[1], column = new int[1]; row[0] = -1; @@ -1408,4 +1381,13 @@ int processMouseDown (int callData, int arg1, int int2) { return 1; } +static int checkStyle (int style) { + /* + * To be compatible with Windows, force the H_SCROLL + * and V_SCROLL style bits. On Windows, it is not + * possible to create a table without scroll bars. + */ + style |= SWT.H_SCROLL | SWT.V_SCROLL; + return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0); +} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java index eab13dbec9..ab90cadaa8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java @@ -220,11 +220,9 @@ public boolean getResizable () { if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); int index = parent.indexOf (this); if (index == -1) return false; - GtkCList gtkclist = new GtkCList(); - OS.memmove(gtkclist, parent.handle, GtkCList.sizeof); + GtkCList gtkclist = new GtkCList(parent.handle); int chandle=gtkclist.column; - GtkCListColumn gtkcolumn = new GtkCListColumn(); - OS.memmove(gtkcolumn, chandle+index*GtkCListColumn.sizeof, GtkCListColumn.sizeof); + GtkCListColumn gtkcolumn = new GtkCListColumn(chandle+index*GtkCListColumn.sizeof); return (gtkcolumn.resizeable == 1) ? true : false; } /** @@ -242,11 +240,9 @@ public int getWidth () { if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); int index = parent.indexOf (this); if (index == -1) return 0; - GtkCList gtkclist = new GtkCList(); - OS.memmove(gtkclist, parent.handle, GtkCList.sizeof); + GtkCList gtkclist = new GtkCList(parent.handle); int chandle=gtkclist.column; - GtkCListColumn gtkcolumn = new GtkCListColumn(); - OS.memmove(gtkcolumn, chandle+index*GtkCListColumn.sizeof, GtkCListColumn.sizeof); + GtkCListColumn gtkcolumn = new GtkCListColumn(chandle+index*GtkCListColumn.sizeof); return gtkcolumn.width; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java index 79b36708ce..3bc6be852e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java @@ -100,24 +100,6 @@ public TableItem (Table parent, int style, int index) { parent.createItem (this, index); _setChecked(false); } -/** - * Returns the receiver's background color. - * - * @return the background color - * - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public Color getBackground () { - checkWidget (); - Table parent = getParent(); - return parent.getBackground(); -} /** * Returns a rectangle describing the receiver's size and location * relative to its parent at a column in the table. @@ -131,20 +113,15 @@ public Color getBackground () { * */ public Rectangle getBounds (int index) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); int CELL_SPACING=1; - GtkCList table = new GtkCList(); - OS.memmove(table, parent.handle, GtkCList.sizeof); + GtkCList table = new GtkCList(parent.handle); int columnHandle = table.column; columnHandle= columnHandle+index*GtkCListColumn.sizeof; - GtkCListColumn column=new GtkCListColumn(); - OS.memmove(column, columnHandle, GtkCListColumn.sizeof); - GtkAdjustment adjustment=new GtkAdjustment(); - OS.memmove(adjustment, table.vadjustment, GtkAdjustment.sizeof); - float vaj = adjustment.value; - OS.memmove(adjustment, table.hadjustment, GtkAdjustment.sizeof); - float haj = adjustment.value; + GtkCListColumn column=new GtkCListColumn(columnHandle); + + double haj = OS.gtk_adjustment_get_value(table.hadjustment); + double vaj = OS.gtk_adjustment_get_value(table.vadjustment); int x=(short)column.area_x+table.hoffset; int width=(short)column.area_width; int height=parent.getItemHeight(); @@ -198,24 +175,6 @@ public Display getDisplay () { if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED); return parent.getDisplay (); } -/** - * Returns the foreground color that the receiver will use to draw. - * - * @return the receiver's foreground color - * - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public Color getForeground () { - checkWidget (); - Table parent = getParent(); - return parent.getForeground(); -} /** * Returns true if the receiver is grayed, * and false otherwise. When the parent does not have @@ -337,29 +296,6 @@ void releaseWidget () { super.releaseWidget (); parent = null; } -/** - * Sets the receiver's background color to the color specified - * by the argument, or to the default system color for the item - * if the argument is null. - * - * @param color the new color (or null) - * - * @exception IllegalArgumentException
      - *
    • ERROR_INVALID_ARGUMENT - if the argument has been disposed
    • - *
    - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public void setBackground (Color color) { - checkWidget (); - if (color != null && color.isDisposed ()) - SWT.error (SWT.ERROR_INVALID_ARGUMENT); -} /** * Sets the checked state of the receiver. * @@ -385,30 +321,6 @@ void _setChecked (boolean checked) { else OS.gtk_clist_set_pixtext (ctable, row, 0, buffer, (byte) 2, parent.uncheck, 0); } -/** - * Sets the receiver's foreground color to the color specified - * by the argument, or to the default system color for the item - * if the argument is null. - * - * @param color the new color (or null) - * - * @exception IllegalArgumentException
      - *
    • ERROR_INVALID_ARGUMENT - if the argument has been disposed
    • - *
    - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public void setForeground (Color color){ - checkWidget (); - if (color != null && color.isDisposed ()) - SWT.error (SWT.ERROR_INVALID_ARGUMENT); -} - /** * Sets the grayed state of the receiver. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index b6f5f5c74e..f9169e60e7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -86,19 +86,17 @@ void createHandle (int index) { } void setHandleStyle() { - OS.gtk_editable_set_editable (handle, (style & SWT.READ_ONLY) == 0); + /*OS.gtk_editable_set_editable (handle, (style & SWT.READ_ONLY) == 0); if ((style & SWT.SINGLE) == 0) OS.gtk_text_set_word_wrap (handle, (style & SWT.WRAP) != 0 ? 1 : 0); if (scrolledHandle!=0) setScrollingPolicy(); - // When 2.0 arrives, we'll be able to set the flat appearance + // When 2.0 arrives, we'll be able to set the flat appearance*/ } void configure() { - _connectParent(); - if (scrolledHandle != 0) { - OS.gtk_container_add (scrolledHandle, handle); - } + parent._connectChild(topHandle()); + if (scrolledHandle != 0) OS.gtk_container_add (scrolledHandle, handle); } void showHandle() { @@ -109,11 +107,11 @@ void showHandle() { void hookEvents () { //TO DO - get rid of enter/exit for mouse crossing border - super.hookEvents(); +/* super.hookEvents(); signal_connect_after (handle, "changed", SWT.Modify, 2); - signal_connect (handle, "insert_text", SWT.Verify, 5); - signal_connect (handle, "delete_text", SWT.Verify, 4); - signal_connect (handle, "activate", SWT.Selection, 2); + signal_connect (handle, "insert-text", SWT.Verify, 5); + signal_connect (handle, "delete-text", SWT.Verify, 4); + signal_connect (handle, "activate", SWT.Selection, 2);*/ } /** @@ -192,8 +190,7 @@ public void addSelectionListener(SelectionListener listener) { * @see #removeVerifyListener */ public void addVerifyListener (VerifyListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Verify, typedListener); @@ -218,7 +215,7 @@ public void addVerifyListener (VerifyListener listener) { */ public void append (String string) { checkWidget (); - if (string == null) error (SWT.ERROR_NULL_ARGUMENT); + /*if (string == null) error (SWT.ERROR_NULL_ARGUMENT); byte [] buffer = Converter.wcsToMbcs (null, string); if ((style & SWT.SINGLE) != 0) { OS.gtk_entry_append_text(handle, buffer); @@ -227,17 +224,9 @@ public void append (String string) { int [] position = new int [] {length}; OS.gtk_editable_insert_text (handle, buffer, buffer.length, position); OS.gtk_editable_set_position (handle, position [0]); - } + }*/ } -static int checkStyle (int style) { - if ((style & SWT.SINGLE) != 0) style &= ~(SWT.H_SCROLL | SWT.V_SCROLL); - if ((style & (SWT.SINGLE | SWT.MULTI)) != 0) return style; - if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) != 0) { - return style | SWT.MULTI; - } - return style | SWT.SINGLE; -} /** * Clears the selection. * @@ -248,9 +237,9 @@ static int checkStyle (int style) { */ public void clearSelection () { checkWidget (); - int position = OS.gtk_editable_get_position (handle); + /*int position = OS.gtk_editable_get_position (handle); OS.gtk_editable_delete_selection(handle); - OS.gtk_editable_set_position (handle, position); + OS.gtk_editable_set_position (handle, position);*/ } /** @@ -266,14 +255,14 @@ public void clearSelection () { */ public void copy () { checkWidget (); - byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); + /*byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); OS.gtk_selection_owner_set(handle, OS.gdk_atom_intern(clipboard, 0), 0); GtkEditable widget = new GtkEditable (); OS.memmove(widget, handle, GtkEditable.sizeof); int start = Math.min(widget.selection_start_pos, widget.selection_end_pos); int end = Math.max(widget.selection_start_pos, widget.selection_end_pos); widget.clipboard_text = OS.gtk_editable_get_chars(handle, start, end); - OS.memmove (handle, widget, GtkEditable.sizeof); + OS.memmove (handle, widget, GtkEditable.sizeof);*/ } /** * Cuts the selected text. @@ -292,7 +281,7 @@ public void copy () { */ public void cut () { checkWidget (); - byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); + /*byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); OS.gtk_selection_owner_set(handle, OS.gdk_atom_intern(clipboard, 0), 0); GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); @@ -300,7 +289,7 @@ public void cut () { int end = Math.max(widget.selection_start_pos, widget.selection_end_pos); widget.clipboard_text = OS.gtk_editable_get_chars(handle, start, end); OS.memmove (handle, widget, GtkEditable.sizeof); - OS.gtk_editable_delete_text(handle, start, end); + OS.gtk_editable_delete_text(handle, start, end);*/ } /** @@ -321,9 +310,10 @@ public void cut () { */ public int getCaretLineNumber () { checkWidget (); - int addr_index=getCaretPosition(); + /*int addr_index=getCaretPosition(); String tmpString= new String(getText(0,addr_index)); - return getLineNumberInString(tmpString,'\n'); + return getLineNumberInString(tmpString,'\n');*/ + return 0; } /** @@ -341,9 +331,10 @@ public int getCaretLineNumber () { */ public Point getCaretLocation () { checkWidget (); - GtkText gtktext = new GtkText (); + /*GtkText gtktext = new GtkText (); OS.memmove (gtktext, handle, GtkText.sizeof); - return new Point (gtktext.cursor_pos_x, gtktext.cursor_pos_y); + return new Point (gtktext.cursor_pos_x, gtktext.cursor_pos_y);*/ + return new Point (0,0); } /** @@ -361,8 +352,8 @@ public Point getCaretLocation () { */ public int getCaretPosition () { checkWidget (); - //return OS.gtk_text_get_point (handle); - return OS.gtk_editable_get_position (handle); +// return OS.gtk_editable_get_position (handle); +return 0; } @@ -378,13 +369,14 @@ public int getCaretPosition () { */ public int getCharCount () { checkWidget (); - if ((style & SWT.SINGLE) != 0) { + /*if ((style & SWT.SINGLE) != 0) { int address = OS.gtk_editable_get_chars (handle, 0, -1); int length = OS.strlen (address); OS.g_free (address); return length; } - return OS.gtk_text_get_length (handle); + return OS.gtk_text_get_length (handle);*/ + return 0; } /** @@ -446,9 +438,10 @@ public char getEchoChar () { */ public boolean getEditable () { checkWidget (); - GtkEditable widget = new GtkEditable (); + /*GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); - return widget.editable!=0; + return widget.editable!=0;*/ + return true; } /** @@ -463,7 +456,8 @@ public boolean getEditable () { */ public int getLineCount () { checkWidget (); - return getLineNumberInString(new String(getText()),'\n') + 1; + /*return getLineNumberInString(new String(getText()),'\n') + 1;*/ + return 0; } /** * Gets the height of a line. @@ -476,12 +470,13 @@ public int getLineCount () { * */ public int getLineHeight () { - checkWidget (); + checkWidget ();/* Font font = getFont(); GdkFont gdkfont = new GdkFont(); int fontHandle = font.handle; OS.memmove(gdkfont, fontHandle, GdkFont.sizeof); - return gdkfont.ascent + gdkfont.descent; + return gdkfont.ascent + gdkfont.descent;*/ + return 10; } /** @@ -501,9 +496,10 @@ public int getLineHeight () { */ public Point getSelection () { checkWidget (); - GtkEditable widget = new GtkEditable (); + /*GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); - return new Point (widget.selection_start_pos, widget.selection_end_pos); + return new Point (widget.selection_start_pos, widget.selection_end_pos);*/ + return new Point(0,0); } /** * Gets the number of selected characters. @@ -517,11 +513,12 @@ public Point getSelection () { */ public int getSelectionCount () { checkWidget (); - GtkEditable widget = new GtkEditable (); + /*GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); int start = Math.min(widget.selection_start_pos, widget.selection_end_pos); int end = Math.max(widget.selection_start_pos, widget.selection_end_pos); - return end - start; + return end - start;*/ + return 0; } /** * Gets the selected text. @@ -535,7 +532,7 @@ public int getSelectionCount () { */ public String getSelectionText () { checkWidget (); - GtkEditable widget = new GtkEditable (); + /*GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); int start = Math.min(widget.selection_start_pos,widget.selection_end_pos); int end = Math.max(widget.selection_start_pos,widget.selection_end_pos); @@ -545,7 +542,8 @@ public String getSelectionText () { OS.memmove (buffer1, address, length); OS.g_free (address); char [] buffer2 = Converter.mbcsToWcs (null, buffer1); - return new String (buffer2, 0, buffer2.length); + return new String (buffer2, 0, buffer2.length);*/ + return ""; } /** @@ -565,9 +563,10 @@ public String getSelectionText () { */ public int getTabs () { checkWidget (); - GtkText widget= new GtkText(); + /*GtkText widget= new GtkText(); OS.memmove(widget, handle, GtkText.sizeof); - return widget.default_tab_width; + return widget.default_tab_width;*/ + return 8; } /** @@ -585,13 +584,17 @@ public int getTabs () { */ public String getText () { checkWidget (); - int address = OS.gtk_editable_get_chars (handle, 0, -1); - int length = OS.strlen (address); - byte [] buffer1 = new byte [length]; - OS.memmove (buffer1, address, length); - OS.g_free (address); - char [] buffer2 = Converter.mbcsToWcs (null, buffer1); - return new String (buffer2, 0, buffer2.length); + if ((style & SWT.SINGLE) != 0) { + /* FIXME - MIXING LENGTH WITH SIZE! */ + int address = OS.gtk_entry_get_text (handle); + int length = OS.strlen (address); + byte [] buffer1 = new byte [length]; + OS.memmove (buffer1, address, length); + OS.g_free (address); + char [] buffer2 = Converter.mbcsToWcs (null, buffer1); + return new String (buffer2, 0, buffer2.length); + } + return ""; } /** @@ -659,12 +662,13 @@ public int getTextLimit () { */ public int getTopIndex () { checkWidget (); - if ((style & SWT.SINGLE) != 0) return 0; + /*if ((style & SWT.SINGLE) != 0) return 0; GtkText widget = new GtkText (); OS.memmove (widget, handle, GtkText.sizeof); int topCharIndex=widget.first_line_start_index; return (getLineNumberInString(getText(0,topCharIndex), '\n')); - //Since getText uses substring (start, end + 1),so topCharIndex-1 + //Since getText uses substring (start, end + 1),so topCharIndex-1*/ + return 0; } /** @@ -689,10 +693,11 @@ public int getTopIndex () { */ public int getTopPixel () { checkWidget (); - if ((style & SWT.SINGLE) != 0) return 0; + /*if ((style & SWT.SINGLE) != 0) return 0; GtkText widget= new GtkText(); OS.memmove(widget, handle, GtkText.sizeof); - return widget.first_onscreen_ver_pixel; + return widget.first_onscreen_ver_pixel;*/ + return 0; } boolean getWrap () { @@ -715,7 +720,7 @@ boolean getWrap () { */ public void insert (String string) { checkWidget (); - if (string == null) error (SWT.ERROR_NULL_ARGUMENT); + /*if (string == null) error (SWT.ERROR_NULL_ARGUMENT); byte [] buffer = Converter.wcsToMbcs (null, string); GtkEditable widget = new GtkEditable (); OS.memmove (widget, handle, GtkEditable.sizeof); @@ -723,7 +728,7 @@ public void insert (String string) { int end = Math.max(widget.selection_start_pos, widget.selection_end_pos); OS.gtk_editable_delete_text (handle, start, end); int [] position = new int [] {start}; - OS.gtk_editable_insert_text (handle, buffer, buffer.length, position); + OS.gtk_editable_insert_text (handle, buffer, buffer.length, position);*/ } /** @@ -740,11 +745,11 @@ public void insert (String string) { */ public void paste () { checkWidget (); - byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); + /*byte [] clipboard = Converter.wcsToMbcs (null, "CLIPBOARD", true); byte [] compound = Converter.wcsToMbcs (null, "COMPOUND_TEXT", true); int clipboard_atom = OS.gdk_atom_intern (clipboard, 0); int compound_atom = OS.gdk_atom_intern (compound, 0); - OS.gtk_selection_convert(handle, clipboard_atom, compound_atom, 0); + OS.gtk_selection_convert(handle, clipboard_atom, compound_atom, 0);*/ } int processModify (int arg0, int arg1, int int2) { @@ -753,7 +758,7 @@ int processModify (int arg0, int arg1, int int2) { } int processVerify (int int0, int int1, int int2) { - if (!hooks (SWT.Verify)) return 0; + /*if (!hooks (SWT.Verify)) return 0; if (int2 != 0) { // Insert if (int0 == 0 || int1==0){ @@ -798,7 +803,7 @@ int processVerify (int int0, int int1, int int2) { OS.gtk_signal_emit_stop_by_name (handle, delete_text); return 0; } - } + }*/ return 0; } @@ -890,7 +895,7 @@ public void removeVerifyListener (VerifyListener listener) { */ public void selectAll () { checkWidget (); - OS.gtk_editable_select_region (handle, 0, -1); + /*OS.gtk_editable_select_region (handle, 0, -1);*/ } /** @@ -929,9 +934,9 @@ public void setDoubleClickEnabled (boolean doubleClick) { */ public void setEchoChar (char echo) { checkWidget (); - if ((style & SWT.SINGLE) != 0) { + /*if ((style & SWT.SINGLE) != 0) { OS.gtk_entry_set_visibility (handle, visibility = echo == '\0'); - } + }*/ } /** @@ -946,7 +951,7 @@ public void setEchoChar (char echo) { */ public void setEditable (boolean editable) { checkWidget (); - OS.gtk_editable_set_editable (handle, editable); + /*OS.gtk_editable_set_editable (handle, editable);*/ } /** @@ -977,7 +982,7 @@ public void setEditable (boolean editable) { */ public void setSelection (int start) { checkWidget (); - OS.gtk_editable_set_position (handle, start); + /*OS.gtk_editable_set_position (handle, start);*/ } /** @@ -1009,8 +1014,8 @@ public void setSelection (int start) { */ public void setSelection (int start, int end) { checkWidget (); - OS.gtk_editable_set_position (handle, start); - OS.gtk_editable_select_region (handle, start, end); + /*OS.gtk_editable_set_position (handle, start); + OS.gtk_editable_select_region (handle, start, end);*/ } /** @@ -1042,8 +1047,8 @@ public void setSelection (int start, int end) { public void setSelection (Point selection) { checkWidget (); if (selection == null) error (SWT.ERROR_NULL_ARGUMENT); - OS.gtk_editable_set_position (handle, selection.x); - OS.gtk_editable_select_region (handle, selection.x, selection.y); + /*OS.gtk_editable_set_position (handle, selection.x); + OS.gtk_editable_select_region (handle, selection.x, selection.y);*/ } /** @@ -1064,9 +1069,9 @@ public void setSelection (Point selection) { */ public void setTabs (int tabs) { checkWidget (); - GtkText widget= new GtkText(); + /*GtkText widget= new GtkText(); widget.default_tab_width=tabs; - OS.memmove(handle, widget, GtkText.sizeof); + OS.memmove(handle, widget, GtkText.sizeof);*/ } /** @@ -1084,12 +1089,12 @@ public void setTabs (int tabs) { */ public void setText (String string) { checkWidget (); - if (string == null) error (SWT.ERROR_NULL_ARGUMENT); + /*if (string == null) error (SWT.ERROR_NULL_ARGUMENT); OS.gtk_editable_delete_text (handle, 0, -1); int [] position = new int [1]; byte [] buffer = Converter.wcsToMbcs (null, string); OS.gtk_editable_insert_text (handle, buffer, buffer.length, position); - OS.gtk_editable_set_position (handle, 0); + OS.gtk_editable_set_position (handle, 0);*/ } /** @@ -1108,11 +1113,11 @@ public void setText (String string) { */ public void setTextLimit (int limit) { checkWidget (); - if (limit == 0) error (SWT.ERROR_CANNOT_BE_ZERO); + /*if (limit == 0) error (SWT.ERROR_CANNOT_BE_ZERO); if ((style & SWT.SINGLE) != 0) { textLimit = (short) limit; OS.gtk_entry_set_max_length (handle, (short) limit); - } + }*/ } /** @@ -1129,11 +1134,10 @@ public void setTextLimit (int limit) { */ public void setTopIndex (int index) { checkWidget (); - if ((style & SWT.SINGLE) != 0) return; + /*if ((style & SWT.SINGLE) != 0) return; if (index > getLineCount()) return; - GtkAdjustment adjustment = new GtkAdjustment(); int adjustmentHandle = OS.gtk_scrolled_window_get_vadjustment(scrolledHandle); - OS.memmove(adjustment, adjustmentHandle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment(adjustmentHandle); int adjust = (int)(index*adjustment.upper/getLineCount()); if (adjust <= 0) { adjust = 0; @@ -1149,12 +1153,12 @@ public void setTopIndex (int index) { verticalBar.setSelection(adjust+lineheight); OS.gtk_adjustment_value_changed(verticalBar.handle); topindex=getTopIndex(); - } + } */ } void setWrap (boolean wrap) { checkWidget (); - OS.gtk_text_set_word_wrap(handle, wrap ? 1 : 0); + /*OS.gtk_text_set_word_wrap(handle, wrap ? 1 : 0);*/ } /** @@ -1175,7 +1179,7 @@ void setWrap (boolean wrap) { */ public void showSelection () { checkWidget (); - if ((style & SWT.SINGLE) != 0) return; + /*if ((style & SWT.SINGLE) != 0) return; int start_pos, end_pos, pos; pos = OS.gtk_editable_get_position (handle); GtkEditable widget = new GtkEditable (); @@ -1188,9 +1192,8 @@ public void showSelection () { if ( (topCharIndex > start_pos && topCharIndex < end_pos) || topCharIndex==start_pos || topCharIndex == end_pos) return; if (pos < start_pos || pos > end_pos) { - GtkAdjustment adjustment = new GtkAdjustment(); int adjustmentHandle = OS.gtk_scrolled_window_get_vadjustment(scrolledHandle); - OS.memmove(adjustment, adjustmentHandle, GtkAdjustment.sizeof); + GtkAdjustment adjustment = new GtkAdjustment(adjustmentHandle); String tmpString= new String(getText(0,start_pos)); int currentln=getLineNumberInString(tmpString, '\n'); int adjust = (int)(currentln*adjustment.upper/getLineCount()-adjustment.page_increment); @@ -1202,17 +1205,18 @@ public void showSelection () { OS.gtk_editable_set_position (handle, widget.selection_end_pos); OS.gtk_editable_select_region (handle, widget.selection_start_pos, widget.selection_end_pos); } - +*/ } String verifyText (String string, int start, int end) { - Event event = new Event (); + /*Event event = new Event (); event.text = string; event.start = start; event.end = end; sendEvent (SWT.Verify, event); if (!event.doit) return null; - return event.text; + return event.text;*/ + return ""; } int getLineNumberInString( String string,char delimiter) { @@ -1223,4 +1227,12 @@ int getLineNumberInString( String string,char delimiter) { return count; } +static int checkStyle (int style) { + if ((style & SWT.SINGLE) != 0) style &= ~(SWT.H_SCROLL | SWT.V_SCROLL); + if ((style & (SWT.SINGLE | SWT.MULTI)) != 0) return style; + if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) != 0) { + return style | SWT.MULTI; + } + return style | SWT.SINGLE; +} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java index e1e5bedcf0..899344800d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java @@ -31,9 +31,7 @@ import org.eclipse.swt.graphics.*; * IMPORTANT: This class is not intended to be subclassed. *

    */ - public class ToolBar extends Composite { - int boxHandle, tempHandle; /** * Constructs a new instance of this class given its parent @@ -67,80 +65,59 @@ public ToolBar (Composite parent, int style) { super (parent, checkStyle (style)); } +/* + * === Handle code === + */ void createHandle (int index) { state |= HANDLE; - /* FIXME - * We do not need an event box here, as event boxes - * have real X windows. - */ - boxHandle = OS.gtk_event_box_new (); + boxHandle = OS.gtk_event_box_new(); if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); + fixedHandle = OS.eclipse_fixed_new(); + if (fixedHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); + int orientation = ((style&SWT.VERTICAL)!=0)? OS.GTK_ORIENTATION_VERTICAL : OS.GTK_ORIENTATION_HORIZONTAL; - handle = OS.gtk_toolbar_new (orientation, OS.GTK_TOOLBAR_BOTH); + handle = OS.gtk_toolbar_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - - tempHandle = OS.gtk_fixed_new(); - if (tempHandle == 0) error (SWT.ERROR_NO_HANDLES); + OS.gtk_toolbar_set_orientation(handle, orientation); } void setHandleStyle() { - int relief = ((style&SWT.FLAT)!=0)? OS.GTK_RELIEF_NONE : OS.GTK_RELIEF_NORMAL; - OS.gtk_toolbar_set_button_relief(handle, relief); +/* int relief = ((style&SWT.FLAT)!=0)? OS.GTK_RELIEF_NONE : OS.GTK_RELIEF_NORMAL; + OS.gtk_toolbar_set_button_relief(handle, relief);*/ } void configure() { - _connectParent(); - OS.gtk_container_add (boxHandle, handle); - // invisible handle to temporarily hold control (non-item) items - OS.gtk_toolbar_insert_widget (handle,tempHandle,new byte[1], new byte[1],0); -} - -public Point computeSize (int wHint, int hHint, boolean changed) { - checkWidget (); - if (layout != null) super.computeSize(wHint, hHint, changed); - return _computeSize (wHint, hHint, changed); -} - -int eventHandle () { - return boxHandle; + parent._connectChild(boxHandle); + OS.gtk_container_add(boxHandle, fixedHandle); + OS.gtk_container_add(fixedHandle, handle); } void showHandle() { OS.gtk_widget_show (boxHandle); + OS.gtk_widget_show (fixedHandle); OS.gtk_widget_show (handle); OS.gtk_widget_realize (handle); - // don't show the temp fixed } void register() { super.register (); - WidgetTable.put (boxHandle, this); } void deregister() { super.deregister (); - WidgetTable.remove (boxHandle); } -int topHandle() { return boxHandle; } -int parentingHandle() { return tempHandle; } +void releaseHandle () { + super.releaseHandle (); +} -/** - * Returns whether the argument points to an OS widget that is - * implementing the receiver, i.e., one of my own handles - */ +int topHandle() { return boxHandle; } +int parentingHandle() { return fixedHandle; } boolean isMyHandle(int h) { - if (h==handle) return true; - if (h==tempHandle) return true; - if (h==boxHandle) return true; - return false; -} -void _connectChild (int h) { - // When we put a widget as a tool item, we don't know which item it is, yet. - OS.gtk_fixed_put(tempHandle, h, (short)0, (short)0); + return super.isMyHandle(h); } @@ -148,8 +125,16 @@ void _connectChild (int h) { * === GEOMETRY === */ -boolean _setSize (int width, int height) { UtilFuncs.setSize(boxHandle, width, height); return true; } +void _setSize (int width, int height) { + OS.eclipse_fixed_set_size(parent.parentingHandle(), boxHandle, width, height); + OS.eclipse_fixed_set_size(fixedHandle, handle, width, height); +} +public Point computeSize (int wHint, int hHint, boolean changed) { + checkWidget (); + if (layout != null) super.computeSize(wHint, hHint, changed); + return new Point(300,30); +} /** @@ -168,8 +153,7 @@ boolean _setSize (int width, int height) { UtilFuncs.setSize(boxHandle, width, h * */ public ToolItem getItem (int index) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return getItems()[index]; } @@ -194,6 +178,7 @@ public ToolItem getItem (int index) { public ToolItem getItem (Point point) { return null; } + /** * Returns the number of items contained in the receiver. * @@ -205,17 +190,11 @@ public ToolItem getItem (Point point) { * */ public int getItemCount () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - /* FIXME - * This code will return the wrong count for items, - * as list includes Window children - */ -// int list = OS.gtk_container_children (handle); -// return OS.g_list_length (list); - // TEMPORARY CODE - return getItems ().length; + checkWidget(); + int list = OS.gtk_container_children (handle); + return OS.g_list_length (list); } + /** * Returns an array of TabItems which are the items * in the receiver. @@ -233,8 +212,7 @@ public int getItemCount () { * */ public ToolItem [] getItems () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); int count = 0; int list = OS.gtk_container_children (handle); int length = OS.g_list_length (list); @@ -242,15 +220,11 @@ public ToolItem [] getItems () { for (int i=0; iWRAP style, the @@ -264,11 +238,9 @@ public ToolItem [] getItems () { *
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • * */ - public int getRowCount () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - return 1; + checkWidget(); + return 1; /* On GTK, toolbars never wrap */ } Control _childFromHandle(int h) { @@ -297,8 +269,7 @@ Control _childFromHandle(int h) { * */ public int indexOf (ToolItem item) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); // TEMPORARY CODE @@ -308,21 +279,6 @@ public int indexOf (ToolItem item) { } return -1; } -int processResize (int int0, int int1, int int2) { - ToolItem [] items = getItems (); - for (int i=0; i * IMPORTANT: This class is not intended to be subclassed. */ - public class ToolItem extends Item { - int boxHandle; ToolBar parent; Control control; Image hotImage, disabledImage; + + int boxHandle, arrowHandle; + int currentpixmap; boolean drawHotImage; - int position; - boolean configured=false; - boolean shown=false; private int tooltipsHandle; /** @@ -70,8 +68,7 @@ public class ToolItem extends Item { public ToolItem (ToolBar parent, int style) { super (parent, checkStyle (style)); this.parent = parent; - position = parent.getItemCount (); - createWidget (position); + createWidget (parent.getItemCount ()); } /** * Constructs a new instance of this class given its parent @@ -111,9 +108,9 @@ public ToolItem (ToolBar parent, int style, int index) { if (!(0 <= index && index <= count)) { error (SWT.ERROR_ITEM_NOT_ADDED); } - position = index; createWidget (index); } + /** * Adds the listener to the collection of listeners who will * be notified when the control is selected, by sending @@ -140,88 +137,69 @@ public ToolItem (ToolBar parent, int style, int index) { * @see SelectionEvent */ public void addSelectionListener(SelectionListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener); addListener (SWT.DefaultSelection,typedListener); } -static int checkStyle (int style) { - return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0); -} void createHandle (int index) { state |= HANDLE; - int bits = SWT.SEPARATOR | SWT.RADIO | SWT.CHECK | SWT.PUSH; - switch (style & bits) { + switch (style & (SWT.SEPARATOR | SWT.RADIO | SWT.CHECK | SWT.PUSH)) { + case SWT.PUSH: + case 0: + handle = OS.gtk_toolbar_insert_element (parent.handle, + OS.GTK_TOOLBAR_CHILD_BUTTON(), + 0, new byte[1], null, null, + 0, 0, 0, + index); + return; case SWT.RADIO: + handle = OS.gtk_toolbar_insert_element (parent.handle, + OS.GTK_TOOLBAR_CHILD_RADIOBUTTON(), + 0, new byte[1], null, null, + 0, 0, 0, + index); + return; case SWT.CHECK: - _createToggleHandle(index); return; + handle = OS.gtk_toolbar_insert_element (parent.handle, + OS.GTK_TOOLBAR_CHILD_TOGGLEBUTTON(), + 0, new byte[1], null, null, + 0, 0, 0, + index); + return; case SWT.SEPARATOR: - _createSeparatorHandle(index); return; - case SWT.PUSH: + boxHandle = OS.gtk_event_box_new(); + if (boxHandle==0) error(SWT.ERROR_NO_HANDLES); + boolean isVertical = (parent.getStyle()&SWT.VERTICAL) != 0; + handle = isVertical? OS.gtk_hseparator_new() : OS.gtk_vseparator_new(); + if (handle==0) error(SWT.ERROR_NO_HANDLES); + OS.gtk_toolbar_insert_widget ( + parent.handle, + boxHandle, + new byte[1], new byte[1], + index); + OS.gtk_container_add(boxHandle, handle); + OS.gtk_widget_show(boxHandle); + OS.gtk_widget_show(handle); + return; default: - _createPushHandle(index); return; + /* + * Can not specify more than one style + */ + error(SWT.ERROR_ITEM_NOT_ADDED); } } -private void _createSeparatorHandle(int index) { - boxHandle = OS.gtk_event_box_new(); - if (boxHandle==0) error(SWT.ERROR_NO_HANDLES); - boolean isVertical = (parent.getStyle()&SWT.VERTICAL) != 0; - handle = isVertical? OS.gtk_hseparator_new() : OS.gtk_vseparator_new(); - if (handle==0) error(SWT.ERROR_NO_HANDLES); -} -private void _createPushHandle(int index) { - handle = OS.gtk_toolbar_insert_element (parent.handle, - OS.GTK_TOOLBAR_CHILD_BUTTON, - 0, new byte[1], null, null, - 0, 0, 0, - index); - configured=true; - shown=true; -} -private void _createToggleHandle(int index) { - handle = OS.gtk_toolbar_insert_element (parent.handle, - OS.GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - 0, new byte[1], null, null, - 0, 0, 0, - index); - configured=true; - shown=true; -} - - -void configure() { - // configure is done for non-separators - if (configured) return; - OS.gtk_toolbar_insert_widget ( - parent.handle, - topHandle(), - new byte[1], new byte[1], - position); - OS.gtk_container_add(boxHandle, handle); -} - -void showHandle() { - if (shown) return; - if ((parent.getStyle()&SWT.VERTICAL)!=0) OS.gtk_widget_set_usize(handle, 15, 3); - else OS.gtk_widget_set_usize(handle, 3, 15); - OS.gtk_widget_show(boxHandle); - OS.gtk_widget_show(handle); -} +/* Already done in createHandle() */ +void configure() {} +void showHandle() {} void register() { super.register (); - if (boxHandle != 0) WidgetTable.put (boxHandle, this); -} - -void releaseHandle () { - super.releaseHandle (); - boxHandle = 0; + if (boxHandle != 0) WidgetTable.put(boxHandle, this); } - void deregister() { super.deregister (); if (boxHandle != 0) WidgetTable.remove (boxHandle); @@ -244,12 +222,12 @@ int topHandle() { * */ public Rectangle getBounds () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return new Rectangle (widget.alloc_x, widget.alloc_y, widget.alloc_width, widget.alloc_height); + checkWidget(); + /*GtkWidget widget = new GtkWidget (handle); + return new Rectangle (widget.alloc_x, widget.alloc_y, widget.alloc_width, widget.alloc_height);*/ + return new Rectangle(2,2, 15,15); } + /** * Returns the control that is used to fill the bounds of * the item when the items is a SEPARATOR. @@ -262,8 +240,7 @@ public Rectangle getBounds () { * */ public Control getControl () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return control; } @@ -282,14 +259,12 @@ public Control getControl () { * */ public Image getDisabledImage () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); error(SWT.ERROR_NOT_IMPLEMENTED); return null; } public Display getDisplay () { - ToolBar parent = this.parent; if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED); return parent.getDisplay (); } @@ -309,11 +284,8 @@ public Display getDisplay () { * */ public boolean getEnabled () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return (widget.flags & OS.GTK_SENSITIVE) != 0; + checkWidget(); + return OS.GTK_WIDGET_SENSITIVE(handle); } /** * Returns the receiver's hot image if it has one, or null @@ -330,10 +302,11 @@ public boolean getEnabled () { * */ public Image getHotImage () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); + /* NOT IMPLEMENTED */ return null; } + /** * Returns the receiver's parent, which must be a ToolBar. * @@ -345,10 +318,11 @@ public Image getHotImage () { * */ public ToolBar getParent () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); + if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED); return parent; } + /** * Returns true if the receiver is selected, * and false otherwise. @@ -366,8 +340,7 @@ public ToolBar getParent () { * */ public boolean getSelection () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false; return OS.gtk_toggle_button_get_active (handle); } @@ -382,10 +355,10 @@ public boolean getSelection () { * */ public String getToolTipText () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return ""; } + /** * Gets the width of the receiver. * @@ -397,11 +370,9 @@ public String getToolTipText () { * */ public int getWidth () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return widget.alloc_width; + checkWidget(); +/* FIXME */ + return 15; } void hookEvents () { if ((style & SWT.SEPARATOR) != 0) return; @@ -409,6 +380,7 @@ void hookEvents () { signal_connect(handle, "enter-notify-event", SWT.MouseEnter, 3); signal_connect(handle, "leave-notify-event", SWT.MouseExit, 3); } + /** * Returns true if the receiver is enabled, and * false otherwise. @@ -425,8 +397,7 @@ void hookEvents () { * */ public boolean isEnabled () { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); return getEnabled () && parent.isEnabled (); } @@ -488,6 +459,7 @@ void releaseWidget () { tooltipsHandle = 0; parent = null; } + /** * Removes the listener from the collection of listeners who will * be notified when the control is selected. @@ -506,13 +478,13 @@ void releaseWidget () { * @see #addSelectionListener */ public void removeSelectionListener(SelectionListener listener) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection,listener); } + /** * Sets the control that is used to fill the bounds of * the item when the items is a SEPARATOR. @@ -538,11 +510,7 @@ public void setControl (Control control) { Control newControl = control; Control oldControl = this.control; if (oldControl == newControl) return; - if (oldControl != null) { - int topHandle = control.topHandle (); - int tempHandle = parent.tempHandle; - OS.gtk_widget_reparent (topHandle, tempHandle); - } + this.control = newControl; if (newControl != null) { if (handle != boxHandle) { @@ -550,9 +518,7 @@ public void setControl (Control control) { OS.gtk_widget_destroy (handle); handle = boxHandle; } - int topHandle = control.topHandle (); - OS.gtk_widget_reparent (topHandle, boxHandle); - //OS.gtk_widget_show (topHandle); + OS.gtk_widget_reparent (newControl.topHandle(), boxHandle); } else { boolean isVertical = (parent.getStyle () & SWT.VERTICAL) != 0; handle = isVertical ? OS.gtk_hseparator_new () : OS.gtk_vseparator_new (); @@ -578,11 +544,11 @@ public void setControl (Control control) { * */ public void setDisabledImage (Image image) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & SWT.SEPARATOR) != 0) return; disabledImage = image; } + /** * Enables the receiver if the argument is true, * and disables it otherwise. @@ -600,10 +566,10 @@ public void setDisabledImage (Image image) { * */ public void setEnabled (boolean enabled) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); OS.gtk_widget_set_sensitive (handle, enabled); } + /** * Sets the receiver's hot image to the argument, which may be * null indicating that no hot image should be displayed. @@ -622,14 +588,12 @@ public void setEnabled (boolean enabled) { * */ public void setHotImage (Image image) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & SWT.SEPARATOR) != 0) return; hotImage = image; } public void setImage (Image image) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); super.setImage (image); if ((style & SWT.SEPARATOR) != 0) return; int list = OS.gtk_container_children (handle); @@ -668,8 +632,7 @@ public void setSelection (boolean selected) { OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection); } public void setText (String string) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; text = string; @@ -698,8 +661,7 @@ public void setText (String string) { int widget = OS.g_list_nth_data (list, 0); if (widget != 0) OS.gtk_widget_destroy (widget); } - byte [] buffer1 = Converter.wcsToMbcs (null, text); - int label = OS.gtk_label_new (buffer1); + int label = OS.gtk_label_new (string); byte [] buffer2 = Converter.wcsToMbcs (null, pattern); OS.gtk_label_set_pattern (label, buffer2); OS.gtk_container_add (handle, label); @@ -717,8 +679,7 @@ public void setText (String string) { * */ public void setToolTipText (String string) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if (tooltipsHandle == 0) tooltipsHandle = OS.gtk_tooltips_new(); byte [] buffer = Converter.wcsToMbcs (null, string, true); OS.gtk_tooltips_set_tip(tooltipsHandle, handle, buffer, null); @@ -734,11 +695,14 @@ public void setToolTipText (String string) { * */ public void setWidth (int width) { - if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); + checkWidget(); if ((style & SWT.SEPARATOR) == 0) return; Point size = control.computeSize(width, SWT.DEFAULT); control.setSize(size); } + +static int checkStyle (int style) { + return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0); +} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java index 9b0ca5408d..457a15393f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java @@ -172,8 +172,7 @@ public Display getDisplay () { } /** - * Returns the bounds that are being drawn, expressed relative to the parent - * widget. If the parent is a Display then these are screen coordinates. + * Returns the bounds of the Rectangles being drawn. * * @return the bounds of the Rectangles being drawn * @@ -203,8 +202,7 @@ public boolean getStippled () { } /** - * Specify the rectangles that should be drawn, expressed relative to the parent - * widget. If the parent is a Display then these are screen coordinates. + * Specify the rectangles that should be drawn. * * @param rectangles the bounds of the rectangles to be drawn * @@ -379,7 +377,7 @@ private int calculateWindow() { if (parent == null) { answer = OS.GDK_ROOT_PARENT(); } else { - answer = parent._gdkWindow(); + answer = /*parent._gdkWindow();*/ 0; } if (answer==0) error(SWT.ERROR_UNSPECIFIED); return answer; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 95833415cb..c84686edbe 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -89,14 +89,9 @@ static int checkStyle (int style) { return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0); } -Point _getClientAreaSize () { - return UtilFuncs.getSize(handle); -} - -boolean _setSize(int width, int height) { - if (!UtilFuncs.setSize (eventBoxHandle, width, height)) return false; - UtilFuncs.setSize (scrolledHandle, width, height); - return true; +void _setSize(int width, int height) { + OS.eclipse_fixed_set_size(parent.parentingHandle(), topHandle(), width, height); + OS.eclipse_fixed_set_size(fixedHandle, scrolledHandle, width, height); } /** @@ -163,23 +158,16 @@ public void addTreeListener(TreeListener listener) { public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint == SWT.DEFAULT) wHint = 200; - return _computeSize (wHint, hHint, changed); -} - -void configure() { - _connectParent(); - OS.gtk_container_add(eventBoxHandle, fixedHandle); - OS.gtk_fixed_put (fixedHandle, scrolledHandle, (short)0, (short)0); - OS.gtk_container_add (scrolledHandle, handle); + return computeNativeSize (scrolledHandle, wHint, hHint, changed); } void createHandle (int index) { state |= HANDLE; - eventBoxHandle = OS.gtk_event_box_new(); - if (eventBoxHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); + boxHandle = OS.gtk_event_box_new(); + if (boxHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); - fixedHandle = OS.gtk_fixed_new (); + fixedHandle = OS.eclipse_fixed_new (); if (fixedHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); scrolledHandle = OS.gtk_scrolled_window_new(0,0); @@ -188,18 +176,34 @@ void createHandle (int index) { handle = OS.gtk_ctree_new (1, 0); if (handle == 0) SWT.error (SWT.ERROR_NO_HANDLES); } +void configure() { + parent._connectChild(topHandle()); + OS.gtk_container_add (boxHandle, fixedHandle); + OS.gtk_container_add (fixedHandle, scrolledHandle); + OS.gtk_container_add (scrolledHandle, handle); +} + +void hookEvents () { + //TO DO - get rid of enter/exit for mouse crossing border + super.hookEvents (); + signal_connect (handle, "tree_select_row", SWT.Selection, 4); + signal_connect (handle, "tree_unselect_row", SWT.Selection, 4); + signal_connect (handle, "tree_expand", SWT.Expand, 3); + signal_connect (handle, "tree_collapse", SWT.Collapse, 3); +} + +int topHandle() { return boxHandle; } +int parentingHandle() { return fixedHandle; } int createCheckPixmap(boolean checked) { /* * The box will occupy the whole item width. */ - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); int check_height = clist.row_height-1; int check_width = check_height; - GdkVisual visual = new GdkVisual(); - OS.memmove(visual, OS.gdk_visual_get_system(), GdkVisual.sizeof); + GdkVisual visual = new GdkVisual(OS.gdk_visual_get_system()); int pixmap = OS.gdk_pixmap_new(0, check_width, check_height, visual.depth); int gc = OS.gdk_gc_new(pixmap); @@ -314,8 +318,7 @@ int findSibling (int node, int index) { int depth = 1; if (node != 0) { int data = OS.g_list_nth_data (node, 0); - GtkCTreeRow row = new GtkCTreeRow (); - OS.memmove (row, data, GtkCTreeRow.sizeof); + GtkCTreeRow row = new GtkCTreeRow (data); depth = row.level + 1; } Index = 0; @@ -384,8 +387,7 @@ int getItemCount (int node) { int depth = 1; if (node != 0) { int data = OS.g_list_nth_data (node, 0); - GtkCTreeRow row = new GtkCTreeRow (); - OS.memmove (row, data, GtkCTreeRow.sizeof); + GtkCTreeRow row = new GtkCTreeRow (data); depth = row.level + 1; } Count = 0; @@ -409,8 +411,7 @@ int getItemCount (int node) { */ public int getItemHeight () { checkWidget (); - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); return clist.row_height + CELL_SPACING; } @@ -440,8 +441,7 @@ TreeItem [] getItems (int node) { int depth = 1; if (node != 0) { int data = OS.g_list_nth_data (node, 0); - GtkCTreeRow row = new GtkCTreeRow (); - OS.memmove (row, data, GtkCTreeRow.sizeof); + GtkCTreeRow row = new GtkCTreeRow (data); depth = row.level + 1; } Count = 0; @@ -495,8 +495,7 @@ public TreeItem getParentItem () { */ public TreeItem[] getSelection () { checkWidget(); - GtkCList clist = new GtkCList(); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList(handle); if (clist.selection == 0) return new TreeItem [0]; int length = OS.g_list_length (clist.selection); TreeItem [] result = new TreeItem [length]; @@ -520,8 +519,7 @@ public TreeItem[] getSelection () { */ public int getSelectionCount () { checkWidget(); - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); if (clist.selection == 0) return 0; return OS.g_list_length (clist.selection); } @@ -556,25 +554,6 @@ int GtkCTreeDispose (int ctree, int node, int data) { return 0; } -void hookEvents () { - //TO DO - get rid of enter/exit for mouse crossing border - super.hookEvents (); - signal_connect (handle, "tree_select_row", SWT.Selection, 4); - signal_connect (handle, "tree_unselect_row", SWT.Selection, 4); - signal_connect (handle, "tree_expand", SWT.Expand, 3); - signal_connect (handle, "tree_collapse", SWT.Collapse, 3); -} - -int topHandle() { return eventBoxHandle; } -int parentingHandle() { return fixedHandle; } - -boolean isMyHandle(int h) { - if (h==fixedHandle) return true; - if (h==scrolledHandle) return true; - if (h==handle) return true; - return false; -} - int processCollapse (int int0, int int1, int int2) { int index = OS.gtk_ctree_node_get_row_data (handle, int0) - 1; Event event = new Event (); @@ -610,10 +589,11 @@ int processExpand (int int0, int int1, int int2) { int processMouseDown (int callData, int arg1, int int2) { doubleSelected = false; int result = super.processMouseDown (callData, arg1, int2); - if ((style & SWT.MULTI) != 0) selected = true; - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - int x = (int) gdkEvent.x, y = (int) gdkEvent.y; +/* if ((style & SWT.MULTI) != 0) selected = true; + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int x = (int)(px[0]), y = (int)(py[0]); if ((style & SWT.CHECK) != 0) { if (!OS.gtk_ctree_is_hot_spot (handle, x, y)) { int [] row = new int [1], column = new int [1]; @@ -621,10 +601,8 @@ int processMouseDown (int callData, int arg1, int int2) { if (code != 0) { int node = OS.gtk_ctree_node_nth (handle, row [0]); int crow = OS.g_list_nth_data (node, 0); - GtkCTreeRow row_data = new GtkCTreeRow (); - OS.memmove (row_data, crow, GtkCTreeRow.sizeof); - GtkCTree ctree = new GtkCTree(); - OS.memmove (ctree, handle, GtkCTree.sizeof); + GtkCTreeRow row_data = new GtkCTreeRow (crow); + GtkCTree ctree = new GtkCTree(handle); int nX = ctree.hoffset + ctree.tree_indent * row_data.level - 2; int nY = ctree.voffset + (ctree.row_height + 1) * row [0] + 2; int [] unused = new int [1], check_width = new int [1], check_height = new int [1]; @@ -648,13 +626,14 @@ int processMouseDown (int callData, int arg1, int int2) { } } } + GdkEvent gdkEvent = new GdkEvent(callData); if (gdkEvent.type == OS.GDK_2BUTTON_PRESS) { if (!OS.gtk_ctree_is_hot_spot (handle, x, y)) { int [] row = new int [1], column = new int [1]; int code = OS.gtk_clist_get_selection_info (handle, x, y, row, column); if (code != 0) doubleSelected = true; } - } + }*/ return result; } @@ -672,13 +651,13 @@ int processMouseUp (int callData, int arg1, int int2) { * that caused the select signal is not included when the select * signal is issued. */ - GdkEventButton gdkEvent = new GdkEventButton (); - OS.memmove (gdkEvent, callData, GdkEventButton.sizeof); - int x = (int) gdkEvent.x, y = (int) gdkEvent.y; + double[] px = new double[1]; + double[] py = new double[1]; + OS.gdk_event_get_coords(callData, px, py); + int x = (int)(px[0]), y = (int)(py[0]); if (!OS.gtk_ctree_is_hot_spot (handle, x, y)) { if ((style & SWT.SINGLE) != 0) { - GtkCList clist = new GtkCList (); - OS.memmove(clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); int list = clist.selection; if (list != 0 && OS.g_list_length (list) != 0) { int node = OS.g_list_nth_data (list, 0); @@ -698,8 +677,7 @@ int processMouseUp (int callData, int arg1, int int2) { int code = OS.gtk_clist_get_selection_info (handle, x, y, row, column); if (code != 0) { int focus = OS.gtk_ctree_node_nth (handle, row [0]); - GtkCList clist = new GtkCList (); - OS.memmove (clist, handle, GtkCList.sizeof); + GtkCList clist = new GtkCList (handle); if (selected && clist.selection != 0) { int length = OS.g_list_length (clist.selection); for (int i=0; i - *
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • - *
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • - * - * - * @since 2.0 - * - */ -public Color getBackground () { - checkWidget (); - Tree parent = getParent(); - return parent.getBackground(); -} - /** * Returns a rectangle describing the receiver's size and location * relative to its parent. @@ -213,16 +194,12 @@ public Color getBackground () { */ public Rectangle getBounds () { int ctree = parent.handle; - GtkCTree tree = new GtkCTree(); - OS.memmove(tree, ctree, GtkCTree.sizeof); - - GtkAdjustment adjustment = new GtkAdjustment (); - OS.memmove (adjustment, tree.vadjustment, GtkAdjustment.sizeof); - float vaj = adjustment.value; - OS.memmove (adjustment, tree.hadjustment, GtkAdjustment.sizeof); - float haj = adjustment.value; + GtkCTree tree = new GtkCTree(ctree); +/* + double haj = OS.gtk_adjustment_get_value(tree.hadjustment); + double vaj = OS.gtk_adjustment_get_value(tree.vadjustment); + int columnHandle = tree.column; - int height=parent.getItemHeight(); int row_list = tree.row_list; int level=0; @@ -251,14 +228,14 @@ public Rectangle getBounds () { int styleHandle = OS.gtk_ctree_node_get_row_style(ctree, handle); if (styleHandle == 0) styleHandle = OS.gtk_widget_get_style(ctree); - GtkStyle style = new GtkStyle(); - OS.memmove(style, styleHandle, GtkStyle.sizeof); - int width = OS.gdk_string_width(style.font, buffer1); + GtkStyle style = new GtkStyle(styleHandle);*/ + /* FIXME */ + int width = 50; /*OS.gdk_string_width(style.font, buffer1);*/ // x = (short)column.area_x+tree.tree_indent*(level-1)+spacing[0]+tree.hoffset; - int x = 33+tree.tree_indent*(level-1)+spacing[0]+tree.hoffset; +/* int x = 33+tree.tree_indent*(level-1)+spacing[0]+tree.hoffset;*/ - return new Rectangle (x, y, width, height); + return new Rectangle (0, 0, 40, 10); } /** @@ -308,25 +285,6 @@ public boolean getExpanded () { return buffer [0]; } -/** - * Returns the foreground color that the receiver will use to draw. - * - * @return the receiver's foreground color - * - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public Color getForeground () { - checkWidget (); - Tree parent = getParent(); - return parent.getForeground(); -} - /** * Returns true if the receiver is grayed, * and false otherwise. When the parent does not have @@ -412,8 +370,7 @@ public Tree getParent () { public TreeItem getParentItem () { checkWidget(); int data = OS.g_list_nth_data (handle, 0); - GtkCTreeRow row = new GtkCTreeRow (); - OS.memmove (row, data, GtkCTreeRow.sizeof); + GtkCTreeRow row = new GtkCTreeRow (data); if (row.parent == 0) return null; int ctree = parent.handle; int index = OS.gtk_ctree_node_get_row_data (ctree, row.parent) - 1; @@ -430,30 +387,6 @@ void releaseWidget () { parent = null; } -/** - * Sets the receiver's background color to the color specified - * by the argument, or to the default system color for the item - * if the argument is null. - * - * @param color the new color (or null) - * - * @exception IllegalArgumentException
      - *
    • ERROR_INVALID_ARGUMENT - if the argument has been disposed
    • - *
    - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public void setBackground (Color color) { - checkWidget (); - if (color != null && color.isDisposed ()) - SWT.error (SWT.ERROR_INVALID_ARGUMENT); -} - /** * Sets the checked state of the receiver. *

    @@ -480,32 +413,6 @@ public void setChecked (boolean checked) { OS.gtk_ctree_set_node_info (ctree, handle, buffer, spacing [0], pixmap [0], mask [0], pixmap [0], mask [0], is_leaf [0], expanded [0]); } -/** - * Sets the receiver's foreground color to the color specified - * by the argument, or to the default system color for the item - * if the argument is null. - * - * @param color the new color (or null) - * - * @since 2.0 - * - * @exception IllegalArgumentException

      - *
    • ERROR_INVALID_ARGUMENT - if the argument has been disposed
    • - *
    - * @exception SWTException
      - *
    • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    • - *
    • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • - *
    - * - * @since 2.0 - * - */ -public void setForeground (Color color) { - checkWidget (); - if (color != null && color.isDisposed ()) - SWT.error (SWT.ERROR_INVALID_ARGUMENT); -} - /** * Sets the grayed state of the receiver. *

    diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/UtilFuncs.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/UtilFuncs.java index 0ab42ea7c5..afe935eaa7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/UtilFuncs.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/UtilFuncs.java @@ -15,110 +15,13 @@ import org.eclipse.swt.internal.gtk.*; */ class UtilFuncs { -/* - * === GEOMETRY === - */ - -static Point getLocation (int handle) { - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return new Point (widget.alloc_x, widget.alloc_y); -} - -static void setLocation(int parentHandle, int handle, int x, int y) { - // GtkFixed does not leave us alone. - // Instead, it maintains its own list of geometries for the children. - // Moreover, it will post a RESIZE on the queue that will cause - // disturbance to all our brother; to avoid that, we temporarily - // clear the VISIBLE flag, and do the synchronous update ourselves - GtkObject gtkChild = new GtkObject(); - OS.memmove (gtkChild, handle, GtkObject.sizeof); - OS.GTK_WIDGET_UNSET_FLAGS(handle, OS.GTK_VISIBLE); - OS.gtk_fixed_move(parentHandle, handle, (short)x, (short)y ); - OS.memmove(handle, gtkChild, GtkObject.sizeof); - - // force allocation update NOW - // unfortunately, due to the shape of our PI, - // we can't selectively update only x and y. - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - GtkAllocation alloc = new GtkAllocation(); - alloc.x = (short) x; - alloc.y = (short) y; - alloc.width = (short) widget.alloc_width; - alloc.height = (short) widget.alloc_height; - OS.memmove(handle, widget, GtkWidget.sizeof); - OS.gtk_widget_size_allocate(handle, alloc); -} - -static Point getSize (int handle) { - if (handle==0) { - SWT.error(SWT.ERROR_UNSPECIFIED); - } - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - return new Point (widget.alloc_width, widget.alloc_height); -} - - -static boolean setSize(int handle, int width, int height) { - if (handle==0) { - SWT.error(SWT.ERROR_UNSPECIFIED); - } - - /* Feature in Gtk. - * Gtk will refuse to set the size of any widget to anything smaller than 3x3. - */ - if (height <= 3) height = 3; - if (width <= 3) width = 3; - // first, see if we actually need to change anything - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - int alloc_width = widget.alloc_width & 0xFFFF; - int alloc_height = widget.alloc_height & 0xFFFF; - if (alloc_width == width && alloc_height == height) { - return false; - } - OS.gtk_widget_set_usize (handle, width, height); - // force child allocation update - GtkAllocation alloc = new GtkAllocation(); - alloc.x = (short) widget.alloc_x; - alloc.y = (short) widget.alloc_y; - alloc.width = (short) width; - alloc.height = (short) height; - OS.gtk_widget_size_allocate(handle, alloc); - return true; -} - -static void setZeroSize(int handle) { - // CHEATING. For some reason, - // the it will refuse to change its size to anything smaller - setSize(handle, 3,3); -} - static int getFont(int widget) { - int hStyle = OS.gtk_widget_get_style(widget); - GtkStyle style = new GtkStyle(); - OS.memmove(style, hStyle, GtkStyle.sizeof); - return style.font; + /* FIXME */ + return 0; } static void setFont(int handle, int font) { - OS.gtk_widget_ensure_style(handle); - // We can't just get the widget's style and set - // its font, because the style slot may point to the - // default font; therefore we have to obtain a clone - // of the style - GtkWidget widget = new GtkWidget (); - OS.memmove (widget, handle, GtkWidget.sizeof); - int hStyle = OS.gtk_style_copy(widget.style); - GtkStyle style = new GtkStyle(); - OS.memmove(style, hStyle, GtkStyle.sizeof); - - OS.gdk_font_unref(style.font); - style.font = font; - OS.memmove (hStyle, style, GtkStyle.sizeof); - OS.gtk_widget_set_style (handle, hStyle); + /* FIXME */ } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 70c419d725..1a8997a702 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -224,7 +224,7 @@ protected void checkSubclass () { *

  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • * */ -protected final void checkWidget () { +protected void checkWidget () { if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED); } @@ -485,7 +485,7 @@ boolean hooks (int eventType) { return eventTable.hooks (eventType); } -final boolean isValidThread () { +boolean isValidThread () { return getDisplay ().isValidThread (); } public boolean isValidWidget () { @@ -494,7 +494,7 @@ public boolean isValidWidget () { return (state & DISPOSED) == 0; } -final boolean isValidSubclass() { +boolean isValidSubclass() { return Display.isValidClass(getClass()); } @@ -550,6 +550,7 @@ void postEvent (int eventType, Event event) { } int processEvent (int eventNumber, int int0, int int1, int int2) { + System.out.println("event: "+eventNumber+" in "+this); switch (eventNumber) { case SWT.Arm: return processArm (int0, int1, int2); case SWT.Collapse: return processCollapse (int0, int1, int2); @@ -680,7 +681,6 @@ int processVerify (int int0, int int1, int int2) { } void signal_connect (int handle, String eventName, int swtEvent, int numArgs) { - byte [] buffer = Converter.wcsToMbcs (null, eventName, true); int proc=0; switch (numArgs) { case 2: proc=getDisplay().windowProc2; break; @@ -689,7 +689,9 @@ void signal_connect (int handle, String eventName, int swtEvent, int numArgs) { case 5: proc=getDisplay().windowProc5; break; default: error(SWT.ERROR_INVALID_ARGUMENT); } - OS.gtk_signal_connect (handle, buffer, proc, swtEvent); + /*OS.g_signal_connect (handle, eventName, proc, swtEvent);*/ + byte [] buffer = Converter.wcsToMbcs (null, eventName, true); + OS.gtk_signal_connect(handle, buffer, proc, swtEvent); } void signal_connect_after (int handle, String eventName, int swtEvent, int numArgs) { byte [] buffer = Converter.wcsToMbcs (null, eventName, true); @@ -910,7 +912,7 @@ char wcsToMbcs (char ch) { return 0; } -static byte[] string2bytesConvertMnemonic(String string) { +byte[] string2bytesConvertMnemonic(String string) { //FIXME need to double _'s char [] t = new char [string.length ()]; string.getChars (0, t.length, t, 0); -- cgit