summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilly Biggs <bbiggs>2005-05-20 23:13:03 +0000
committerBilly Biggs <bbiggs>2005-05-20 23:13:03 +0000
commit3d2513f37cb9cb90fe2158e95a5f31987d9fb04e (patch)
tree9db1668b5260a0bb7e5c8d4d91fe67e20d3fb848
parentf5b4461356c334ce9a94dfa7916d0309f7c48863 (diff)
downloadeclipse.platform.swt-3d2513f37cb9cb90fe2158e95a5f31987d9fb04e.tar.gz
eclipse.platform.swt-3d2513f37cb9cb90fe2158e95a5f31987d9fb04e.tar.xz
eclipse.platform.swt-3d2513f37cb9cb90fe2158e95a5f31987d9fb04e.zip
94946
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
-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/gtk/org/eclipse/swt/widgets/ColorDialog.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java7
11 files changed, 103 insertions, 10 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 faad4be2d6..4ddf3a7ddd 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
@@ -3707,6 +3707,9 @@ OS__gtk_window_deiconify_0=cast=(GtkWindow *)
OS__gtk_window_get_focus=
OS__gtk_window_get_focus_0=cast=(GtkWindow *)
+OS__gtk_window_get_icon_list=
+OS__gtk_window_get_icon_list_0=cast=(GtkWindow *)
+
OS__gtk_window_get_mnemonic_modifier=
OS__gtk_window_get_mnemonic_modifier_0=cast=(GtkWindow *)
@@ -3760,6 +3763,10 @@ OS__gtk_window_set_geometry_hints_1=cast=(GtkWidget *)
OS__gtk_window_set_geometry_hints_2=
OS__gtk_window_set_geometry_hints_3=
+OS__gtk_window_set_icon_list=
+OS__gtk_window_set_icon_list_0=cast=(GtkWindow *)
+OS__gtk_window_set_icon_list_1=cast=(GList *)
+
OS__gtk_window_set_modal=
OS__gtk_window_set_modal_0=cast=(GtkWindow *)
OS__gtk_window_set_modal_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 dbeb1ec951..e068cb107a 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
@@ -10592,6 +10592,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1window_1get_1focus)
}
#endif
+#ifndef NO__1gtk_1window_1get_1icon_1list
+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1window_1get_1icon_1list)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1window_1get_1icon_1list_FUNC);
+ rc = (jint)gtk_window_get_icon_list((GtkWindow *)arg0);
+ OS_NATIVE_EXIT(env, that, _1gtk_1window_1get_1icon_1list_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1window_1get_1mnemonic_1modifier
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1window_1get_1mnemonic_1modifier)
(JNIEnv *env, jclass that, jint arg0)
@@ -10744,6 +10756,16 @@ fail:
}
#endif
+#ifndef NO__1gtk_1window_1set_1icon_1list
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1window_1set_1icon_1list)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1window_1set_1icon_1list_FUNC);
+ gtk_window_set_icon_list((GtkWindow *)arg0, (GList *)arg1);
+ OS_NATIVE_EXIT(env, that, _1gtk_1window_1set_1icon_1list_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1window_1set_1modal
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1window_1set_1modal)
(JNIEnv *env, jclass that, jint arg0, jboolean arg1)
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 688d7aad80..f9de761be7 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 = 987;
-int OS_nativeFunctionCallCount[987];
+int OS_nativeFunctionCount = 989;
+int OS_nativeFunctionCallCount[989];
char * OS_nativeFunctionNames[] = {
"Call",
"GDK_1WINDOWING_1X11",
@@ -846,6 +846,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1window_1add_1accel_1group",
"_1gtk_1window_1deiconify",
"_1gtk_1window_1get_1focus",
+ "_1gtk_1window_1get_1icon_1list",
"_1gtk_1window_1get_1mnemonic_1modifier",
"_1gtk_1window_1get_1position",
"_1gtk_1window_1get_1size",
@@ -859,6 +860,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1window_1set_1default",
"_1gtk_1window_1set_1destroy_1with_1parent",
"_1gtk_1window_1set_1geometry_1hints",
+ "_1gtk_1window_1set_1icon_1list",
"_1gtk_1window_1set_1modal",
"_1gtk_1window_1set_1resizable",
"_1gtk_1window_1set_1title",
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 1208fecd30..47893c948f 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
@@ -850,6 +850,7 @@ typedef enum {
_1gtk_1window_1add_1accel_1group_FUNC,
_1gtk_1window_1deiconify_FUNC,
_1gtk_1window_1get_1focus_FUNC,
+ _1gtk_1window_1get_1icon_1list_FUNC,
_1gtk_1window_1get_1mnemonic_1modifier_FUNC,
_1gtk_1window_1get_1position_FUNC,
_1gtk_1window_1get_1size_FUNC,
@@ -863,6 +864,7 @@ typedef enum {
_1gtk_1window_1set_1default_FUNC,
_1gtk_1window_1set_1destroy_1with_1parent_FUNC,
_1gtk_1window_1set_1geometry_1hints_FUNC,
+ _1gtk_1window_1set_1icon_1list_FUNC,
_1gtk_1window_1set_1modal_FUNC,
_1gtk_1window_1set_1resizable_FUNC,
_1gtk_1window_1set_1title_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 2071da4149..a4ee1318b1 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
@@ -7317,6 +7317,15 @@ public static final int /*long*/ gtk_window_get_focus(int /*long*/ window) {
lock.unlock();
}
}
+public static final native int /*long*/ _gtk_window_get_icon_list(int /*long*/ window);
+public static final int /*long*/ gtk_window_get_icon_list(int /*long*/ window) {
+ lock.lock();
+ try {
+ return _gtk_window_get_icon_list(window);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native int _gtk_window_get_mnemonic_modifier(int /*long*/ window);
public static final int gtk_window_get_mnemonic_modifier(int /*long*/ window) {
lock.lock();
@@ -7434,6 +7443,15 @@ public static final void gtk_window_set_geometry_hints(int /*long*/ window, int
lock.unlock();
}
}
+public static final native void _gtk_window_set_icon_list(int /*long*/ window, int /*long*/ list);
+public static final void gtk_window_set_icon_list(int /*long*/ window, int /*long*/ list) {
+ lock.lock();
+ try {
+ _gtk_window_set_icon_list(window, list);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native void _gtk_window_set_modal(int /*long*/ window, boolean modal);
public static final void gtk_window_set_modal(int /*long*/ window, boolean modal) {
lock.lock();
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 a3f137ce35..fae21e2fe7 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
@@ -112,7 +112,13 @@ public RGB open () {
byte [] buffer = Converter.wcsToMbcs (null, title, true);
int /*long*/ handle = OS.gtk_color_selection_dialog_new (buffer);
if (parent != null) {
- OS.gtk_window_set_transient_for (handle, parent.topHandle ());
+ int /*long*/ shellHandle = parent.topHandle ();
+ OS.gtk_window_set_transient_for (handle, shellHandle);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
}
GtkColorSelectionDialog dialog = new GtkColorSelectionDialog ();
OS.memmove (dialog, handle);
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 3d76b795c9..ebba6f95b4 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
@@ -171,8 +171,7 @@ void _setImages (Image [] images) {
pixbufs = OS.g_list_append (pixbufs, pixbuf);
}
}
- int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle ());
- OS.gdk_window_set_icon_list (window, pixbufs);
+ OS.gtk_window_set_icon_list (topHandle (), pixbufs);
int /*long*/ [] data = new int /*long*/ [1];
int /*long*/ temp = pixbufs;
while (temp != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
index 5b2be37f58..3a2854758b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -127,13 +127,19 @@ String openChooserDialog () {
Display display = parent.getDisplay ();
boolean oldWarnings = display.getWarnings ();
display.setWarnings (false);
+ int /*long*/ shellHandle = parent.topHandle ();
int /*long*/ handle = OS.gtk_file_chooser_dialog_new (
titleBytes,
- parent.topHandle (),
+ shellHandle,
OS.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
OS.GTK_STOCK_CANCEL (), OS.GTK_RESPONSE_CANCEL,
OS.GTK_STOCK_OK (), OS.GTK_RESPONSE_OK,
0);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
display.setWarnings (oldWarnings);
if (filterPath != null && filterPath.length () > 0) {
StringBuffer stringBuffer = new StringBuffer ();
@@ -185,7 +191,13 @@ String openClassicDialog () {
byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
int /*long*/ handle = OS.gtk_file_selection_new (titleBytes);
if (parent != null) {
- OS.gtk_window_set_transient_for (handle, parent.topHandle ());
+ int /*long*/ shellHandle = parent.topHandle ();
+ OS.gtk_window_set_transient_for (handle, shellHandle);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
}
String answer = null;
if (filterPath != null) {
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 386d087de5..18c725656c 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
@@ -313,13 +313,19 @@ String openChooserDialog () {
*/
boolean oldWarnings = display.getWarnings ();
display.setWarnings (false);
+ int /*long*/ shellHandle = parent.topHandle ();
handle = OS.gtk_file_chooser_dialog_new (
titleBytes,
- parent.topHandle (),
+ shellHandle,
action,
OS.GTK_STOCK_CANCEL (), OS.GTK_RESPONSE_CANCEL,
OS.GTK_STOCK_OK (), OS.GTK_RESPONSE_OK,
0);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
display.setWarnings (oldWarnings);
presetChooserDialog ();
String answer = null;
@@ -333,7 +339,13 @@ String openClassicDialog () {
byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
handle = OS.gtk_file_selection_new (titleBytes);
if (parent != null) {
- OS.gtk_window_set_transient_for (handle, parent.topHandle());
+ int /*long*/ shellHandle = parent.topHandle ();
+ OS.gtk_window_set_transient_for (handle, shellHandle);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
}
presetClassicDialog ();
String answer = null;
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 20918cfc30..99eeeb551d 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
@@ -134,7 +134,13 @@ public FontData open () {
titleBytes = Converter.wcsToMbcs (null, title, true);
handle = OS.gtk_font_selection_dialog_new (titleBytes);
if (parent!=null) {
- OS.gtk_window_set_transient_for(handle, parent.topHandle());
+ int /*long*/ shellHandle = parent.topHandle ();
+ OS.gtk_window_set_transient_for(handle, shellHandle);
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
}
if (fontData != null) {
Display display = parent != null ? parent.display : Display.getCurrent ();
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 97e90e3bcd..f0396de6c2 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
@@ -137,6 +137,13 @@ public int open () {
byte [] buffer = Converter.wcsToMbcs (null, fixPercent (message), true);
handle = OS.gtk_message_dialog_new(parentHandle, dialogFlags, messageType, 0, buffer);
if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ if (parentHandle != 0) {
+ int /*long*/ pixbufs = OS.gtk_window_get_icon_list (parentHandle);
+ if (pixbufs != 0) {
+ OS.gtk_window_set_icon_list (handle, pixbufs);
+ OS.g_list_free (pixbufs);
+ }
+ }
createButtons();
buffer = Converter.wcsToMbcs(null, title, true);
OS.gtk_window_set_title(handle,buffer);