summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2008-04-03 19:46:34 +0000
committerBogdan Gheorghe <gheorghe>2008-04-03 19:46:34 +0000
commit0484a0c9dec969c27763b2f5da7ad5db559b1597 (patch)
treeeda9f6f6ed49da971310926ad62def0fcd27e157 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse
parent2486773519200a5726741a30e65461bdad86a446 (diff)
downloadeclipse.platform.swt-0484a0c9dec969c27763b2f5da7ad5db559b1597.tar.gz
eclipse.platform.swt-0484a0c9dec969c27763b2f5da7ad5db559b1597.tar.xz
eclipse.platform.swt-0484a0c9dec969c27763b2f5da7ad5db559b1597.zip
224121 BIDI3.4:HCG Print dialog is not mirrored completely
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MessageBox.java13
6 files changed, 68 insertions, 35 deletions
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 46c21e6cec..86971e640c 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,10 +112,6 @@ public RGB open () {
byte [] buffer = Converter.wcsToMbcs (null, title, true);
int /*long*/ handle = OS.gtk_color_selection_dialog_new (buffer);
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
if (parent != null) {
int /*long*/ shellHandle = parent.topHandle ();
OS.gtk_window_set_transient_for (handle, shellHandle);
@@ -141,7 +137,16 @@ public RGB open () {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
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 2859a2200c..a37f693a18 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
@@ -166,17 +166,22 @@ String openChooserDialog () {
}
String answer = null;
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
display.addIdleProc ();
Dialog oldModal = null;
if (OS.gtk_window_get_modal (handle)) {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
@@ -248,17 +253,22 @@ String openClassicDialog () {
OS.gtk_widget_show (labelHandle);
}
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
display.addIdleProc ();
Dialog oldModal = null;
if (OS.gtk_window_get_modal (handle)) {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
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 8a6925022f..29e641e03e 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
@@ -2426,7 +2426,7 @@ void initializeCallbacks () {
cellDataProc = cellDataCallback.getAddress ();
if (cellDataProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
- setDirectionCallback = new Callback (this, "setDirectionProc", 2); //$NON-NLS-1$
+ setDirectionCallback = new Callback (this, "setDirectionProc", 4); //$NON-NLS-1$
setDirectionProc = setDirectionCallback.getAddress ();
if (setDirectionProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
@@ -3582,12 +3582,11 @@ public void setData (Object data) {
this.data = data;
}
-int /*long*/ setDirectionProc (int /*long*/ widget, int /*long*/ direction) {
- OS.gtk_widget_set_direction (widget, (int)/*64*/ direction);
- if (OS.GTK_IS_CONTAINER (widget)) {
- OS.gtk_container_forall (widget, setDirectionProc, direction);
+int /*long*/ setDirectionProc (int /*long*/ ihint, int n_param_values, int /*long*/ param_values, int /*long*/ data) {
+ if (OS.gtk_widget_get_toplevel (OS.g_value_peek_pointer(param_values)) == data) {
+ OS.gtk_widget_set_direction (OS.g_value_peek_pointer(param_values), OS.GTK_TEXT_DIR_RTL);
}
- return 0;
+ return 1;
}
void setModalDialog (Dialog modalDailog) {
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 7d639cc636..74a64a200e 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
@@ -381,10 +381,6 @@ String openChooserDialog () {
}
presetChooserDialog ();
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
display.addIdleProc ();
String answer = null;
Dialog oldModal = null;
@@ -392,7 +388,16 @@ String openChooserDialog () {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
@@ -417,10 +422,6 @@ String openClassicDialog () {
}
presetClassicDialog ();
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
display.addIdleProc ();
String answer = null;
Dialog oldModal = null;
@@ -428,7 +429,16 @@ String openClassicDialog () {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
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 fddff2e8e7..e0b25068eb 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
@@ -135,11 +135,6 @@ public FontData open () {
titleBytes = Converter.wcsToMbcs (null, title, true);
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
handle = OS.gtk_font_selection_dialog_new (titleBytes);
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
-
if (parent!=null) {
int /*long*/ shellHandle = parent.topHandle ();
OS.gtk_window_set_transient_for(handle, shellHandle);
@@ -165,7 +160,16 @@ public FontData open () {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}
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 cf10b83c27..502e166662 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
@@ -148,17 +148,22 @@ public int open () {
buffer = Converter.wcsToMbcs(null, title, true);
OS.gtk_window_set_title(handle,buffer);
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
- OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
display.addIdleProc ();
Dialog oldModal = null;
if (OS.gtk_window_get_modal (handle)) {
oldModal = display.getModalDialog ();
display.setModalDialog (this);
}
+ int signalId = 0;
+ int /*long*/ hookId = 0;
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
+ hookId = OS.g_signal_add_emission_hook (signalId, 0, display.setDirectionProc, handle, 0);
+ }
int response = OS.gtk_dialog_run (handle);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0) {
+ OS.g_signal_remove_emission_hook (signalId, hookId);
+ }
if (OS.gtk_window_get_modal (handle)) {
display.setModalDialog (oldModal);
}