diff options
author | Bogdan Gheorghe <gheorghe> | 2008-07-21 15:57:33 +0000 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe> | 2008-07-21 15:57:33 +0000 |
commit | 181b731993c5a525df086962c4ea6d1bdb7e6ade (patch) | |
tree | 7b49ee61992487a0250f6b57af877824a6b71ee4 | |
parent | 44d9cc20c793088b9054bd5a5c4505422e2cc565 (diff) | |
download | eclipse.platform.swt-181b731993c5a525df086962c4ea6d1bdb7e6ade.tar.gz eclipse.platform.swt-181b731993c5a525df086962c4ea6d1bdb7e6ade.tar.xz eclipse.platform.swt-181b731993c5a525df086962c4ea6d1bdb7e6ade.zip |
239418 table.setLinesVisible(true) does not work on solaris. Eclipse 3.2.0 and GTK 2.12.0 and 11.
8 files changed, 53 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties index de04600d45..9cf856a5e2 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2007 IBM Corporation and others. +# Copyright (c) 2000, 2008 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -4528,6 +4528,10 @@ OS__gtk_tree_view_set_enable_search= OS__gtk_tree_view_set_enable_search_0=cast=(GtkTreeView *) OS__gtk_tree_view_set_enable_search_1= +OS__gtk_tree_view_set_grid_lines=flags=dynamic +OS__gtk_tree_view_set_grid_lines_0=cast=(GtkTreeView*) +OS__gtk_tree_view_set_grid_lines_1=cast=(GtkTreeViewGridLines) + OS__gtk_tree_view_set_headers_visible= OS__gtk_tree_view_set_headers_visible_0=cast=(GtkTreeView *) OS__gtk_tree_view_set_headers_visible_1=cast=(gboolean) 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 6bd3dabcdd..f371e6f6a2 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 @@ -14750,6 +14750,32 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1set_1enable_1search) } #endif +#ifndef NO__1gtk_1tree_1view_1set_1grid_1lines +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1set_1grid_1lines) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1set_1grid_1lines_FUNC); +/* + gtk_tree_view_set_grid_lines((GtkTreeView*)arg0, (GtkTreeViewGridLines)arg1); +*/ + { + static int initialized = 0; + static void *handle = NULL; + typedef void (*FPTR)(GtkTreeView*, GtkTreeViewGridLines); + static FPTR fptr; + if (!initialized) { + if (!handle) handle = dlopen(gtk_tree_view_set_grid_lines_LIB, RTLD_LAZY); + if (handle) fptr = (FPTR)dlsym(handle, "gtk_tree_view_set_grid_lines"); + initialized = 1; + } + if (fptr) { + (*fptr)((GtkTreeView*)arg0, (GtkTreeViewGridLines)arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1set_1grid_1lines_FUNC); +} +#endif + #ifndef NO__1gtk_1tree_1view_1set_1headers_1visible JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1set_1headers_1visible) (JNIEnv *env, jclass that, jint arg0, jboolean 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 bfec191b64..76c6e678a8 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 @@ -85,6 +85,7 @@ #define gtk_tree_selection_count_selected_rows_LIB "libgtk-x11-2.0.so.0" #define gtk_tree_selection_get_selected_rows_LIB "libgtk-x11-2.0.so.0" #define gtk_tree_view_column_cell_get_position_LIB "libgtk-x11-2.0.so.0" +#define gtk_tree_view_set_grid_lines_LIB "libgtk-x11-2.0.so.0" #define gtk_entry_set_alignment_LIB "libgtk-x11-2.0.so.0" #define gdk_cursor_new_from_pixbuf_LIB "libgdk-x11-2.0.so.0" #define gdk_display_get_default_LIB "libgdk-x11-2.0.so.0" 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 8911e9181c..b5724723f2 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 = 1265; -int OS_nativeFunctionCallCount[1265]; +int OS_nativeFunctionCount = 1266; +int OS_nativeFunctionCallCount[1266]; char * OS_nativeFunctionNames[] = { "Call", "GDK_1EVENT_1TYPE", @@ -1015,6 +1015,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1tree_1view_1set_1cursor", "_1gtk_1tree_1view_1set_1drag_1dest_1row", "_1gtk_1tree_1view_1set_1enable_1search", + "_1gtk_1tree_1view_1set_1grid_1lines", "_1gtk_1tree_1view_1set_1headers_1visible", "_1gtk_1tree_1view_1set_1model", "_1gtk_1tree_1view_1set_1rules_1hint", 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 7ab714e0e0..22211061ab 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 @@ -1023,6 +1023,7 @@ typedef enum { _1gtk_1tree_1view_1set_1cursor_FUNC, _1gtk_1tree_1view_1set_1drag_1dest_1row_FUNC, _1gtk_1tree_1view_1set_1enable_1search_FUNC, + _1gtk_1tree_1view_1set_1grid_1lines_FUNC, _1gtk_1tree_1view_1set_1headers_1visible_FUNC, _1gtk_1tree_1view_1set_1model_FUNC, _1gtk_1tree_1view_1set_1rules_1hint_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h index 16c7e051b8..4c1a302d8c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2008 IBM Corporation and others. 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 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 79ab3ab4a3..36675542f5 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 @@ -355,6 +355,10 @@ public class OS extends C { public static final int GTK_TREE_VIEW_DROP_AFTER = 1; public static final int GTK_TREE_VIEW_DROP_INTO_OR_BEFORE = 2; public static final int GTK_TREE_VIEW_DROP_INTO_OR_AFTER = 3; + public static final int GTK_TREE_VIEW_GRID_LINES_NONE = 0; + public static final int GTK_TREE_VIEW_GRID_LINES_HORIZONTAL = 1; + public static final int GTK_TREE_VIEW_GRID_LINES_VERTICAL = 2; + public static final int GTK_TREE_VIEW_GRID_LINES_BOTH = 3; public static final int GDK_UNMAP = 15; public static final int GTK_UNIT_PIXEL = 0; public static final int GTK_UNIT_POINTS = 1; @@ -8820,6 +8824,15 @@ public static final void gtk_tree_view_set_cursor(int /*long*/ tree_view, int /* lock.unlock(); } } +public static final native void _gtk_tree_view_set_grid_lines(int /*long*/ tree_view, int grid_lines); +public static final void gtk_tree_view_set_grid_lines(int /*long*/ tree_view, int grid_lines) { + lock.lock(); + try { + _gtk_tree_view_set_grid_lines(tree_view, grid_lines); + } finally { + lock.unlock(); + } +} public static final native void _gtk_tree_view_set_headers_visible(int /*long*/ tree_view, boolean visible); public static final void gtk_tree_view_set_headers_visible(int /*long*/ tree_view, boolean visible) { 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 f9ecdb6248..1ef75c5a5e 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 @@ -2976,6 +2976,9 @@ public void setItemCount (int count) { public void setLinesVisible (boolean show) { checkWidget(); OS.gtk_tree_view_set_rules_hint (handle, show); + if (OS.GTK_VERSION >= OS.VERSION (2, 12, 0)) { + OS.gtk_tree_view_set_grid_lines(handle, show ? OS.GTK_TREE_VIEW_GRID_LINES_VERTICAL : OS.GTK_TREE_VIEW_GRID_LINES_NONE); + } } void setParentBackground () { |