diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-07-09 15:10:22 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-01 13:25:01 -0400 |
commit | c6e846c2a1f2f65f82baf98b5937ac087d800678 (patch) | |
tree | 6875680861626be5e55d571c466f40fcb91d71b3 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | 2d0d1fe9d220400e0b4957016ec81f97281b8e3b (diff) | |
download | eclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.tar.gz eclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.tar.xz eclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.zip |
Use gtk_widget_get_mapped() instead of deprecated GTK_WIDGET_MAPPED
Conflicts:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
4 files changed, 39 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index f0f82958f7..cea75adf1d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -2314,8 +2314,14 @@ int /*long*/ fixedMapProc (int /*long*/ widget) { int /*long*/ widgets = widgetList; while (widgets != 0) { int /*long*/ child = OS.g_list_data (widgets); - if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) { - OS.gtk_widget_map (child); + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.gtk_widget_get_mapped (child)) { + OS.gtk_widget_map (child); + } + }else{ + if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) { + OS.gtk_widget_map (child); + } } widgets = OS.g_list_next (widgets); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 8bd103943e..2a8379d756 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -193,7 +193,11 @@ static int checkStyle (int style) { } void _setVisible (boolean visible) { - if (visible == OS.GTK_WIDGET_MAPPED (handle)) return; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if(visible == OS.gtk_widget_get_mapped(handle)) return; + }else{ + if (visible == OS.GTK_WIDGET_MAPPED (handle)) return; + } if (visible) { sendEvent (SWT.Show); if (getItemCount () != 0) { @@ -372,8 +376,14 @@ void fixMenus (Decorations newParent) { /*public*/ Rectangle getBounds () { checkWidget(); - if (!OS.GTK_WIDGET_MAPPED (handle)) { - return new Rectangle (0, 0, 0, 0); + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_mapped (handle)){ + return new Rectangle (0, 0, 0, 0); + } + }else{ + if (!OS.GTK_WIDGET_MAPPED (handle)) { + return new Rectangle (0, 0, 0, 0); + } } int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); int [] origin_x = new int [1], origin_y = new int [1]; @@ -639,7 +649,11 @@ public boolean getVisible () { } } } - return OS.GTK_WIDGET_MAPPED (handle); + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + return OS.gtk_widget_get_mapped(handle); + }else{ + return OS.GTK_WIDGET_MAPPED (handle); + } } int /*long*/ gtk_hide (int /*long*/ widget) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java index 69f6ae0f87..7350dddf1e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java @@ -319,8 +319,14 @@ int /*long*/ getAccelGroup () { /*public*/ Rectangle getBounds () { checkWidget(); - if (!OS.GTK_WIDGET_MAPPED (handle)) { - return new Rectangle (0, 0, 0, 0); + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_mapped (handle)) { + return new Rectangle (0, 0, 0, 0); + } + }else{ + if (!OS.GTK_WIDGET_MAPPED (handle)) { + return new Rectangle (0, 0, 0, 0); + } } int x = OS.GTK_WIDGET_X (handle); int y = OS.GTK_WIDGET_Y (handle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index deed81c947..66262e3473 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -2005,7 +2005,11 @@ public void setVisible (boolean visible) { updateModal (); } showWithParent = visible; - if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (OS.gtk_widget_get_mapped(shellHandle) == visible) return; + }else{ + if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return; + } if (visible) { if (center && !moved) { center (); |