summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-05 11:09:21 -0400
committerAnatoly Spektor <aspektor@redhat.com>2012-10-05 11:09:21 -0400
commit09d10bce0031c23a939a7d18f8a2d89cf9782bdd (patch)
treef76c05987283e951c9cf5f6472985394939c2880
parentf09fefa7c4435a8da7b2516204fa717abff74704 (diff)
downloadeclipse.platform.swt-gtk3_redner_option_64.tar.gz
eclipse.platform.swt-gtk3_redner_option_64.tar.xz
eclipse.platform.swt-gtk3_redner_option_64.zip
Use gtk_render_option instead of gtk_paint_option for GTK+3 and highergtk3_redner_option_64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java12
6 files changed, 60 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 5e10070851..5a6eda239c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -11540,7 +11540,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1paint_1option)
OS_NATIVE_ENTER(env, that, _1gtk_1paint_1option_FUNC);
if (arg4) if ((lparg4 = getGdkRectangleFields(env, arg4, &_arg4)) == NULL) goto fail;
if (arg6) if ((lparg6 = (*env)->GetByteArrayElements(env, arg6, NULL)) == NULL) goto fail;
- gtk_paint_option((GtkStyle *)arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10);
+/*
+ gtk_paint_option(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_paint_option)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, GdkWindow *, jint, jint, GdkRectangle *, GtkWidget *, const gchar *, jint, jint, jint, jint))fp)(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10);
+ }
+ }
fail:
if (arg6 && lparg6) (*env)->ReleaseByteArrayElements(env, arg6, lparg6, 0);
if (arg4 && lparg4) setGdkRectangleFields(env, arg4, lparg4);
@@ -12890,6 +12898,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1line)
}
#endif
+#ifndef NO__1gtk_1render_1option
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1option)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1render_1option_FUNC);
+/*
+ gtk_render_option(arg0, arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_render_option)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jintLong, gdouble, gdouble, gdouble, gdouble))fp)(arg0, arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1render_1option_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1scale_1new
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1scale_1new)
(JNIEnv *env, jclass that, jint arg0, jintLong arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 942698e5e0..398622cb54 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -308,6 +308,7 @@
#define gtk_paint_hline_LIB LIB_GTK
#define gtk_paint_vline_LIB LIB_GTK
#define gtk_paint_flat_box_LIB LIB_GTK
+#define gtk_paint_option_LIB LIB_GTK LIB_GTK
#define gtk_page_setup_get_bottom_margin_LIB LIB_GTK
#define gtk_page_setup_get_left_margin_LIB LIB_GTK
#define gtk_page_setup_get_orientation_LIB LIB_GTK
@@ -381,6 +382,7 @@
#define gtk_render_line_LIB LIB_GTK
#define gtk_render_frame_LIB LIB_GTK
#define gtk_render_background_LIB LIB_GTK
+#define gtk_render_option_LIB LIB_GTK LIB_GTK
#define gtk_progress_bar_set_inverted_LIB LIB_GTK
#define gtk_progress_bar_set_orientation_LIB LIB_GTK
#define ubuntu_menu_proxy_get_LIB LIB_GTK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 3559ae0c39..2990feb813 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -956,6 +956,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1render_1frame",
"_1gtk_1render_1handle",
"_1gtk_1render_1line",
+ "_1gtk_1render_1option",
"_1gtk_1scale_1new",
"_1gtk_1scale_1set_1digits",
"_1gtk_1scale_1set_1draw_1value",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index a802197f31..dd042cfd75 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -966,6 +966,7 @@ typedef enum {
_1gtk_1render_1frame_FUNC,
_1gtk_1render_1handle_FUNC,
_1gtk_1render_1line_FUNC,
+ _1gtk_1render_1option_FUNC,
_1gtk_1scale_1new_FUNC,
_1gtk_1scale_1set_1digits_FUNC,
_1gtk_1scale_1set_1draw_1value_FUNC,
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 a833eb2453..46d1769d06 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
@@ -8585,6 +8585,22 @@ public static final void gtk_render_background(long /*int*/ context, long /*int*
}
/**
* @method flags=dynamic
+ * @param x cast=(gdouble)
+ * @param y cast=(gdouble)
+ * @param width cast=(gdouble)
+ * @param height cast=(gdouble)
+ */
+public static final native void _gtk_render_option(long /*int*/ context, long /*int*/ cr, double x , double y, double width, double height);
+public static final void gtk_render_option(long /*int*/ context, long /*int*/ cr, double x , double y, double width, double height) {
+ lock.lock();
+ try {
+ _gtk_render_option(context, cr, x , y, width, height);
+ } finally {
+ lock.unlock();
+ }
+}
+/**
+ * @method flags=dynamic
* @param window cast=(GdkWindow *)
* @param widget cast=(GtkWidget *)
* @param detail cast=(const gchar *)
@@ -8615,7 +8631,7 @@ public static final void gtk_paint_focus(long /*int*/ style, long /*int*/ window
}
}
/**
- * @param style cast=(GtkStyle *)
+ * @method flags=dynamic
* @param window cast=(GdkWindow *)
* @param widget cast=(GtkWidget *)
* @param detail cast=(const gchar *)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
index aa6cc69cee..a414103e31 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.internal.theme;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
public class ButtonDrawData extends DrawData {
@@ -219,4 +220,15 @@ int hit(Theme theme, Point position, Rectangle bounds) {
return bounds.contains(position) ? DrawData.WIDGET_WHOLE : DrawData.WIDGET_NOWHERE;
}
+void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create (window);
+ long /*int*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_render_option (context, cairo, x, y, width, height);
+ Cairo.cairo_destroy (cairo);
+ } else {
+ OS.gtk_paint_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ }
+}
+
}