aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2011-11-09 12:51:08 (EST)
committerSilenio Quarti2011-11-25 12:07:00 (EST)
commitfb6589b64340ba0188ea90d333c916c8736110eb (patch)
tree9b6395bb2db1a9ae4866694404c271a25a664012
parent06428b09c6c14470d675fecd4d6c34c1b898979a (diff)
downloadeclipse.platform.swt-fb6589b64340ba0188ea90d333c916c8736110eb.zip
eclipse.platform.swt-fb6589b64340ba0188ea90d333c916c8736110eb.tar.gz
eclipse.platform.swt-fb6589b64340ba0188ea90d333c916c8736110eb.tar.bz2
Bug 364761 - Add gtk_cell_layout_get_cells and use it when gtk >=2.12.0.
-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.h2
-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.c5
-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.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java21
8 files changed, 86 insertions, 10 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 075721d..747b11d 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
@@ -7830,6 +7830,26 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1clear)
}
#endif
+#ifndef NO__1gtk_1cell_1layout_1get_1cells
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1cell_1layout_1get_1cells)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1cell_1layout_1get_1cells_FUNC);
+/*
+ rc = (jintLong)gtk_cell_layout_get_cells(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_cell_layout_get_cells)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1cell_1layout_1get_1cells_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1cell_1layout_1pack_1start
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1pack_1start)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jboolean arg2)
@@ -15018,7 +15038,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1get_1cell_1rende
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1column_1get_1cell_1renderers_FUNC);
+/*
rc = (jintLong)gtk_tree_view_column_get_cell_renderers((GtkTreeViewColumn *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_tree_view_column_get_cell_renderers)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkTreeViewColumn *))fp)((GtkTreeViewColumn *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1column_1get_1cell_1renderers_FUNC);
return rc;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index 7c0079e..d6b55b9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -19,8 +19,8 @@
#define NDEBUG
#define G_DISABLE_DEPRECATED
-#define GTK_DISABLE_DEPRECATED
/*
+#define GTK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATED
#define GTK_DISABLE_SINGLE_INCLUDES
#define GSEAL_ENABLE
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 c52e9f5..b31c9cc 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
@@ -74,6 +74,7 @@
#define gtk_calendar_set_display_options_LIB LIB_GTK
#define gtk_clipboard_store_LIB LIB_GTK
#define gtk_clipboard_set_can_store_LIB LIB_GTK
+#define gtk_cell_layout_get_cells_LIB LIB_GTK
#define gtk_cell_layout_set_attributes_LIB LIB_GTK
#define gtk_cell_layout_clear_LIB LIB_GTK
#define gtk_cell_layout_pack_start_LIB LIB_GTK
@@ -129,6 +130,7 @@
#define gtk_tooltip_trigger_tooltip_query_LIB LIB_GTK
#define gtk_tree_selection_count_selected_rows_LIB LIB_GTK
#define gtk_tree_selection_get_selected_rows_LIB LIB_GTK
+#define gtk_tree_view_column_get_cell_renderers_LIB LIB_GTK
#define gtk_tree_view_column_cell_get_position_LIB LIB_GTK
#define gtk_tree_view_convert_widget_to_bin_window_coords_LIB LIB_GTK
#define gtk_tree_view_set_grid_lines_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 35b6682..f34c147 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
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1378;
-int OS_nativeFunctionCallCount[1378];
+int OS_nativeFunctionCount = 1379;
+int OS_nativeFunctionCallCount[1379];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -638,6 +638,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1calendar_1select_1month",
"_1gtk_1calendar_1set_1display_1options",
"_1gtk_1cell_1layout_1clear",
+ "_1gtk_1cell_1layout_1get_1cells",
"_1gtk_1cell_1layout_1pack_1start",
"_1gtk_1cell_1layout_1set_1attributes",
"_1gtk_1cell_1renderer_1get_1size",
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 c611bcb..972785a 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
@@ -646,6 +646,7 @@ typedef enum {
_1gtk_1calendar_1select_1month_FUNC,
_1gtk_1calendar_1set_1display_1options_FUNC,
_1gtk_1cell_1layout_1clear_FUNC,
+ _1gtk_1cell_1layout_1get_1cells_FUNC,
_1gtk_1cell_1layout_1pack_1start_FUNC,
_1gtk_1cell_1layout_1set_1attributes_FUNC,
_1gtk_1cell_1renderer_1get_1size_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 74b4a76..9fd9813 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
@@ -6094,6 +6094,16 @@ public static final void gtk_cell_layout_clear(int /*long*/ cell_layout) {
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native int /*long*/ _gtk_cell_layout_get_cells(int /*long*/ cell_layout);
+public static final int /*long*/ gtk_cell_layout_get_cells(int /*long*/ cell_layout) {
+ lock.lock();
+ try {
+ return _gtk_cell_layout_get_cells(cell_layout);
+ } finally {
+ lock.unlock();
+ }
+}
/** @method flags=no_gen */
public static final native void _gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel);
public static final void gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel) {
@@ -11786,7 +11796,10 @@ public static final void gtk_tree_view_column_clear(int /*long*/ tree_column) {
lock.unlock();
}
}
-/** @param tree_column cast=(GtkTreeViewColumn *) */
+/**
+ * @method flags=dynamic
+ * @param tree_column cast=(GtkTreeViewColumn *)
+ */
public static final native int /*long*/ _gtk_tree_view_column_get_cell_renderers(int /*long*/ tree_column);
public static final int /*long*/ gtk_tree_view_column_get_cell_renderers(int /*long*/ tree_column) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index b58c8b5..7b38bd8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -348,7 +348,12 @@ int calculateWidth (int /*long*/ column, int /*long*/ iter) {
int [] w = new int [1];
OS.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
width += 2 * w [0];
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int /*long*/ temp = list;
while (temp != 0) {
@@ -1577,7 +1582,13 @@ public boolean getLinesVisible() {
}
int /*long*/ getPixbufRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
+
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ pixbufRenderer = 0;
@@ -1818,7 +1829,12 @@ public int getSortDirection () {
}
int /*long*/ getTextRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ textRenderer = 0;
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 196ba6e..7715436 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
@@ -435,7 +435,12 @@ int calculateWidth (int /*long*/ column, int /*long*/ iter, boolean recurse) {
}
OS.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
width += 2 * w [0];
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int /*long*/ temp = list;
while (temp != 0) {
@@ -1677,7 +1682,12 @@ public TreeItem getParentItem () {
}
int /*long*/ getPixbufRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ pixbufRenderer = 0;
@@ -1817,7 +1827,12 @@ public int getSortDirection () {
}
int /*long*/ getTextRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ textRenderer = 0;