changeset 38:6e625fa1612d

Shell, some code left
author Frank Benoit <benoit@tionex.de>
date Thu, 10 Jan 2008 07:33:15 +0100
parents c86fc3d50cfa
children 8e76ddc90b31
files dwt/internal/gtk/OS.d dwt/widgets/Composite.d dwt/widgets/Control.d dwt/widgets/Decorations.d dwt/widgets/Display.d dwt/widgets/Shell.d dwt/widgets/Widget.d
diffstat 7 files changed, 398 insertions(+), 376 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/internal/gtk/OS.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/internal/gtk/OS.d	Thu Jan 10 07:33:15 2008 +0100
@@ -66,6 +66,7 @@
 public alias dwt.internal.c.gdk.GdkEventAny GdkEventAny;
 public alias dwt.internal.c.gdk.GdkEventFocus GdkEventFocus;
 public alias dwt.internal.c.gdk.GdkWindowAttr GdkWindowAttr;
+public alias dwt.internal.c.gdk.GdkEventWindowState GdkEventWindowState;
 
 public alias dwt.internal.c.pango.PangoFontDescription PangoFontDescription;
 public alias dwt.internal.c.pango.PangoTabArray PangoTabArray;
@@ -115,6 +116,7 @@
 public alias dwt.internal.c.gtk.GtkAllocation GtkAllocation;
 public alias dwt.internal.c.gtk.GtkSocket GtkSocket;
 public alias dwt.internal.c.gtk.GtkAccelGroup GtkAccelGroup;
+public alias dwt.internal.c.gtk.GtkTooltips GtkTooltips;
 
 public alias dwt.internal.c.Xlib.XErrorEvent XErrorEvent;
 public alias dwt.internal.c.Xlib.XExposeEvent XExposeEvent;
@@ -123,6 +125,7 @@
 public alias dwt.internal.c.Xlib.XRectangle XRectangle;
 public alias dwt.internal.c.Xlib.XButtonEvent XButtonEvent;
 public alias dwt.internal.c.Xlib.XWindowChanges XWindowChanges;
+public alias dwt.internal.c.Xlib.XFocusChangeEvent XFocusChangeEvent;
 
 public alias dwt.internal.c.Xrender.XRenderPictureAttributes XRenderPictureAttributes;
 public alias dwt.internal.c.Xrender.XTransform XTransform;
@@ -170,6 +173,7 @@
 private GType GTK_TYPE_CELL_RENDERER_TOGGLE();
 private bool GTK_IS_WINDOW(GtkWidget *);
 private bool GTK_IS_CONTAINER(GtkWidget*);
+private int  GTK_IS_PLUG(GtkWidget*);
 private GType GTK_TYPE_MENU();
 private GType GTK_TYPE_WIDGET();
 private GType GTK_WIDGET_FLAGS(GtkWidget*);
@@ -1060,7 +1064,7 @@
 
     mixin ForwardGtkOsCFunc!(.XSetIOErrorHandler);
     mixin ForwardGtkOsCFunc!(.XSetErrorHandler);
-    //mixin ForwardGtkOsCFunc!(.XSetInputFocus);
+    mixin ForwardGtkOsCFunc!(.XSetInputFocus);
     mixin ForwardGtkOsCFunc!(.XSynchronize);
     mixin ForwardGtkOsCFunc!(.XTestFakeButtonEvent);
     mixin ForwardGtkOsCFunc!(.XTestFakeKeyEvent);
@@ -1079,7 +1083,7 @@
 //     mixin ForwardGtkOsCFunc!(.gdk_pixmap_foreign_new);
     mixin ForwardGtkOsCFunc!(.gdk_window_lookup);
     mixin ForwardGtkOsCFunc!(.gdk_window_add_filter);
-//     mixin ForwardGtkOsCFunc!(.gdk_window_remove_filter);
+    mixin ForwardGtkOsCFunc!(.gdk_window_remove_filter);
 
 /** X render natives and constants */
  //   mixin ForwardGtkOsCFunc!(XRenderPictureAttributes_sizeof);
@@ -1105,7 +1109,7 @@
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_CELL_RENDERER_TOGGLE);
      mixin ForwardGtkOsCFunc!(.GTK_IS_CONTAINER);
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_IMAGE_MENU_ITEM);
-//     mixin ForwardGtkOsCFunc!(.GTK_IS_PLUG);
+     mixin ForwardGtkOsCFunc!(.GTK_IS_PLUG);
 //     mixin ForwardGtkOsCFunc!(.GTK_STOCK_CANCEL);
 //     mixin ForwardGtkOsCFunc!(.GTK_STOCK_OK);
      mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_TEXT);
@@ -2174,12 +2178,10 @@
          { return arg0.type; }
     static GdkWindow* GDK_EVENT_WINDOW( GdkEventAny* arg0 )
          { return arg0.window; }
-/+
-    int  X_EVENT_TYPE( XEvent* arg0 )
+    static int  X_EVENT_TYPE( XEvent* arg0 )
          { return arg0.type; }
-    Window X_EVENT_WINDOW( XAnyEvent* arg0 )
-         { return arg0.window; }
-    +/
+    //Window X_EVENT_WINDOW( XAnyEvent* arg0 )
+    //     { return arg0.window; }
 
     //g_list_data(arg0) (arg0)->data
     static void* g_list_data( GList* arg0 ) {
--- a/dwt/widgets/Composite.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Composite.d	Thu Jan 10 07:33:15 2008 +0100
@@ -705,7 +705,7 @@
 	return result;
 }
 
-override int /*long*/ gtk_focus (GtkWidget* widget, GdkEventFocus* directionType) {
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
 	if (widget is socketHandle) return 0;
 	return super.gtk_focus (widget, directionType);
 }
--- a/dwt/widgets/Control.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Control.d	Thu Jan 10 07:33:15 2008 +0100
@@ -2534,7 +2534,7 @@
 	return 0;
 }
 
-override int /*long*/ gtk_focus (GtkWidget* widget, GdkEventFocus* directionType) {
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
 	/* Stop GTK traversal for every widget */
 	return 1;
 }
--- a/dwt/widgets/Decorations.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Decorations.d	Thu Jan 10 07:33:15 2008 +0100
@@ -112,7 +112,7 @@
 	Control savedFocus;
 	Button defaultButton, saveDefault;
 	GtkAccelGroup* accelGroup;
-    int vboxHandle;
+    GtkWidget* vboxHandle;
 
 this () {
 	/* Do nothing */
@@ -488,7 +488,7 @@
 
 void releaseHandle () {
 	super.releaseHandle ();
-	vboxHandle = 0;
+	vboxHandle = null;
 }
 
 void releaseWidget () {
--- a/dwt/widgets/Display.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Display.d	Thu Jan 10 07:33:15 2008 +0100
@@ -923,6 +923,21 @@
 	OS.gdk_window_add_filter  (null, &filterProcFunc, cast(void*)&filterProcCallbackData );
 }
 
+/*
+ * Used by Shell
+ */
+package void doWindowAddFilter( CallbackData* cbdata, GdkWindow* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = widget;
+    OS.gdk_window_add_filter (window, &filterProcFunc, cast(void*)&cbdata );
+}
+
+package void doWindowRemoveFilter( CallbackData* cbdata, GdkWindow* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = widget;
+    OS.gdk_window_remove_filter(window, &filterProcFunc, cast(void*)&cbdata );
+}
+
 Image createImage (char[] name) {
 	auto style = OS.gtk_widget_get_default_style ();
 	char[] buffer = name;
@@ -1442,7 +1457,7 @@
     }
     Widget widget = getWidget (cast(GtkWidget*)callbackData.data);
     if (widget is null) return 0;
-    return widget.filterProc (xEvent, gdkEvent, callbackData.data);
+    return widget.filterProc (cast(XEvent*)xEvent, gdkEvent, callbackData.data);
 }
 
 /**
@@ -3690,13 +3705,14 @@
 	return 0;
 }
 
-int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+int /*long*/ sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	Widget widget = getWidget ( cast(GtkWidget*)user_data);
 	if (widget is null) return 0;
 	return widget.sizeAllocateProc (handle, arg0, user_data);
 }
 
-int /*long*/ sizeRequestProcMeth (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+
+int /*long*/ sizeRequestProcMeth (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	Widget widget = getWidget (cast(GtkWidget*)user_data);
 	if (widget is null) return 0;
 	return widget.sizeRequestProc (handle, arg0, user_data);
@@ -3764,10 +3780,10 @@
 
 private static extern(C) int /*long*/ shellMapProcFunc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
     auto cbdata = cast(CallbackData*)user_data;
-    return cbdata.display.shellMapProc( handle, arg0, cast(int)cbdata.data );
+    return cbdata.display.shellMapProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
 }
 
-int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	Widget widget = getWidget (cast(GtkWidget*)handle);
 	if (widget is null) return 0;
 	return widget.shellMapProc (handle, arg0, user_data);
--- a/dwt/widgets/Shell.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Shell.d	Thu Jan 10 07:33:15 2008 +0100
@@ -14,28 +14,31 @@
 import dwt.widgets.Control;
 import dwt.internal.c.gtk;
 
-class Shell : Composite {
-    GtkWidget* shellHandle;
-    bool isDisposed();
-    void dispose();
-    void fixStyle ();
-    void redraw (bool);
-    void layout (bool, bool);
-    void setSavedFocus(Control);
-    GtkWidget* vboxHandle;
-    void fixShell (Shell newShell, Control control) ;
-    void bringToTop (bool force);
-    public void forceActive () ;
-    void setActiveControl (Control control) ;
-    void setToolTipText (GtkWidget* widget, char[] str) ;
-}
+import dwt.SWT;
+import dwt.internal.gtk.OS;
+import dwt.events.ShellListener;
+import dwt.graphics.Cursor;
+import dwt.graphics.Image;
+import dwt.graphics.Point;
+import dwt.graphics.Rectangle;
+import dwt.graphics.Region;
+import dwt.internal.Converter;
+import dwt.internal.SWTEventListener;
+import dwt.widgets.Composite;
+import dwt.widgets.Control;
+import dwt.widgets.Decorations;
+import dwt.widgets.Display;
+import dwt.widgets.Event;
+import dwt.widgets.EventTable;
+import dwt.widgets.Layout;
+import dwt.widgets.Listener;
+import dwt.widgets.Menu;
+import dwt.widgets.Monitor;
+import dwt.widgets.TypedListener;
+import dwt.widgets.Widget;
 
-/++
-import dwt.*;
-import dwt.internal.*;
-import dwt.internal.gtk.*;
-import dwt.graphics.*;
-import dwt.events.*;
+import Unicode = tango.text.Unicode;
+import tango.stdc.stringz;
 
 /**
  * Instances of this class represent the "windows"
@@ -133,13 +136,14 @@
  * @see Decorations
  * @see SWT
  */
-public class Shell extends Decorations {
-	int /*long*/ shellHandle, tooltipsHandle, tooltipWindow;
-	boolean mapped, moved, resized, opened;
+public class Shell : Decorations {
+	GtkWidget* shellHandle, tooltipsHandle, tooltipWindow;
+	bool mapped, moved, resized, opened;
 	int oldX, oldY, oldWidth, oldHeight;
 	int minWidth, minHeight;
 	Control lastActive;
 	Region region;
+    Display.CallbackData filterProcCallbackData;
 
 	static final int MAXIMUM_TRIM = 128;
 
@@ -152,8 +156,8 @@
  *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
  * </ul>
  */
-public Shell () {
-	this ((Display) null);
+public this () {
+	this (cast(Display) null);
 }
 /**
  * Constructs a new instance of this class given only the style
@@ -190,8 +194,8 @@
  * @see SWT#APPLICATION_MODAL
  * @see SWT#SYSTEM_MODAL
  */
-public Shell (int style) {
-	this ((Display) null, style);
+public this (int style) {
+	this (cast(Display) null, style);
 }
 
 /**
@@ -213,7 +217,7 @@
  *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
  * </ul>
  */
-public Shell (Display display) {
+public this (Display display) {
 	this (display, SWT.SHELL_TRIM);
 }
 /**
@@ -259,25 +263,25 @@
  * @see SWT#APPLICATION_MODAL
  * @see SWT#SYSTEM_MODAL
  */
-public Shell (Display display, int style) {
-	this (display, null, style, 0, false);
+public this (Display display, int style) {
+	this (display, null, style, null, false);
 }
 
-Shell (Display display, Shell parent, int style, int /*long*/ handle, boolean embedded) {
+this (Display display, Shell parent, int style, GtkWidget* handle, bool embedded) {
 	super ();
 	checkSubclass ();
-	if (display == null) display = Display.getCurrent ();
-	if (display == null) display = Display.getDefault ();
+	if (display is null) display = Display.getCurrent ();
+	if (display is null) display = Display.getDefault ();
 	if (!display.isValidThread ()) {
 		error (SWT.ERROR_THREAD_INVALID_ACCESS);
 	}
-	if (parent != null && parent.isDisposed ()) {
+	if (parent !is null && parent.isDisposed ()) {
 		error (SWT.ERROR_INVALID_ARGUMENT);
 	}
 	this.style = checkStyle (style);
 	this.parent = parent;
 	this.display = display;
-	if (handle != 0) {
+	if (handle !is null) {
 		if (embedded) {
 			this.handle = handle;
 		} else {
@@ -310,7 +314,7 @@
  *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
  * </ul>
  */
-public Shell (Shell parent) {
+public this (Shell parent) {
 	this (parent, SWT.DIALOG_TRIM);
 }
 
@@ -361,26 +365,26 @@
  * @see SWT#APPLICATION_MODAL
  * @see SWT#SYSTEM_MODAL
  */
-public Shell (Shell parent, int style) {
-	this (parent != null ? parent.display : null, parent, style, 0, false);
+public this (Shell parent, int style) {
+	this (parent !is null ? parent.display : null, parent, style, null, false);
 }
 
-public static Shell gtk_new (Display display, int /*long*/ handle) {
+public static Shell gtk_new (Display display, GtkWidget* handle) {
 	return new Shell (display, null, SWT.NO_TRIM, handle, true);
 }
 
-public static Shell internal_new (Display display, int /*long*/ handle) {
+public static Shell internal_new (Display display, GtkWidget* handle) {
 	return new Shell (display, null, SWT.NO_TRIM, handle, false);
 }
 
 static int checkStyle (int style) {
 	style = Decorations.checkStyle (style);
-	if ((style & SWT.ON_TOP) != 0) style &= ~SWT.SHELL_TRIM;
+	if ((style & SWT.ON_TOP) !is 0) style &= ~SWT.SHELL_TRIM;
 	int mask = SWT.SYSTEM_MODAL | SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL;
 	int bits = style & ~mask;
-	if ((style & SWT.SYSTEM_MODAL) != 0) return bits | SWT.SYSTEM_MODAL;
-	if ((style & SWT.APPLICATION_MODAL) != 0) return bits | SWT.APPLICATION_MODAL;
-	if ((style & SWT.PRIMARY_MODAL) != 0) return bits | SWT.PRIMARY_MODAL;
+	if ((style & SWT.SYSTEM_MODAL) !is 0) return bits | SWT.SYSTEM_MODAL;
+	if ((style & SWT.APPLICATION_MODAL) !is 0) return bits | SWT.APPLICATION_MODAL;
+	if ((style & SWT.PRIMARY_MODAL) !is 0) return bits | SWT.PRIMARY_MODAL;
 	return bits;
 }
 
@@ -405,7 +409,7 @@
  */
 public void addShellListener (ShellListener listener) {
 	checkWidget();
-	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+	if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
 	TypedListener typedListener = new TypedListener (listener);
 	addListener (SWT.Close,typedListener);
 	addListener (SWT.Iconify,typedListener);
@@ -418,8 +422,8 @@
 	if (display.ignoreTrim) return;
 	int width = OS.GTK_WIDGET_WIDTH (shellHandle);
 	int height = OS.GTK_WIDGET_HEIGHT (shellHandle);
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	GdkRectangle rect = new GdkRectangle ();
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+	GdkRectangle* rect = new GdkRectangle ();
 	OS.gdk_window_get_frame_extents (window, rect);
 	int trimWidth = Math.max (0, rect.width - width);
 	int trimHeight = Math.max (0, rect.height - height);
@@ -432,11 +436,11 @@
 		display.ignoreTrim = true;
 		return;
 	}
-	boolean hasTitle = false, hasResize = false, hasBorder = false;
-	if ((style & SWT.NO_TRIM) == 0) {
-		hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) != 0;
-		hasResize = (style & SWT.RESIZE) != 0;
-		hasBorder = (style & SWT.BORDER) != 0;
+	bool hasTitle = false, hasResize = false, hasBorder = false;
+	if ((style & SWT.NO_TRIM) is 0) {
+		hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+		hasResize = (style & SWT.RESIZE) !is 0;
+		hasBorder = (style & SWT.BORDER) !is 0;
 	}
 	if (hasTitle) {
 		if (hasResize)  {
@@ -465,16 +469,16 @@
 	}
 }
 
-void bringToTop (boolean force) {
+void bringToTop (bool force) {
 	if (!OS.GTK_WIDGET_VISIBLE (shellHandle)) return;
 	Display display = this.display;
 	Shell activeShell = display.activeShell;
-	if (activeShell == this) return;
+	if (activeShell is this) return;
 	if (!force) {
-		if (activeShell == null) return;
+		if (activeShell is null) return;
 		if (!display.activePending) {
-			int /*long*/ focusHandle = OS.gtk_window_get_focus (activeShell.shellHandle);
-			if (focusHandle != 0 && !OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) return;
+			auto focusHandle = OS.gtk_window_get_focus (cast(GtkWindow*)activeShell.shellHandle);
+			if (focusHandle !is null && !OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) return;
 		}
 	}
 	/*
@@ -487,9 +491,9 @@
 	*
 	* NOTE: This bug is fixed in GTK+ 2.6.8 and above.
 	*/
-	boolean xFocus = false;
-	if (activeShell != null) {
-		if (OS.GTK_VERSION < OS.VERSION (2, 6, 8)) {
+	bool xFocus = false;
+	if (activeShell !is null) {
+		if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 8)) {
 			xFocus = activeShell.isUndecorated ();
 		}
 		display.activeShell = null;
@@ -501,10 +505,10 @@
 	* window.  The fix is to use XSetInputFocus() to force
 	* the focus.
 	*/
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	if ((xFocus || (style & SWT.ON_TOP) != 0) && OS.GDK_WINDOWING_X11 ()) {
-		int /*long*/ xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
-		int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid (window);
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+	if ((xFocus || (style & SWT.ON_TOP) !is 0) && OS.GDK_WINDOWING_X11 ()) {
+		auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+		auto xWindow = OS.gdk_x11_drawable_get_xid (window);
 		OS.gdk_error_trap_push ();
 		/* Use CurrentTime instead of the last event time to ensure that the shell becomes active */
 		OS.XSetInputFocus (xDisplay, xWindow, OS.RevertToParent, OS.CurrentTime);
@@ -516,7 +520,7 @@
 		* to come forward in versions > 2.10.0.  The fix is to use the last
 		* user event time.
 		*/
-		if (display.windowManager.toLowerCase ().equals ("metacity")) {
+		if ( Unicode.toLower( display.windowManager ) ==/*eq*/ "metacity") {
 			OS.gdk_window_focus (window, display.lastUserEventTime);
 		} else {
 			OS.gdk_window_focus (window, OS.GDK_CURRENT_TIME);
@@ -534,8 +538,8 @@
 	if (!opened) resized = false;
 }
 
-int /*long*/ childStyle () {
-	return 0;
+override GtkStyle* childStyle () {
+	return null;
 }
 
 /**
@@ -567,15 +571,15 @@
 	checkWidget();
 	Rectangle trim = super.computeTrim (x, y, width, height);
 	int border = 0;
-	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
-		border = OS.gtk_container_get_border_width (shellHandle);
+	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+		border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
 	}
 	int trimWidth = trimWidth (), trimHeight = trimHeight ();
 	trim.x -= (trimWidth / 2) + border;
 	trim.y -= trimHeight - (trimWidth / 2) + border;
 	trim.width += trimWidth + border * 2;
 	trim.height += trimHeight + border * 2;
-	if (menuBar != null) {
+	if (menuBar !is null) {
 		forceResize ();
 		int menuBarHeight = OS.GTK_WIDGET_HEIGHT (menuBar.handle);
 		trim.y -= menuBarHeight;
@@ -584,25 +588,26 @@
 	return trim;
 }
 
+alias Decorations.createHandle createHandle;
 void createHandle (int index) {
 	state |= HANDLE | CANVAS;
-	if (shellHandle == 0) {
-		if (handle == 0) {
+	if (shellHandle is null) {
+		if (handle is null) {
 			int type = OS.GTK_WINDOW_TOPLEVEL;
-			if ((style & SWT.ON_TOP) != 0) type = OS.GTK_WINDOW_POPUP;
-			shellHandle = OS.gtk_window_new (type);
+			if ((style & SWT.ON_TOP) !is 0) type = OS.GTK_WINDOW_POPUP;
+			shellHandle = cast(GtkWidget*)OS.gtk_window_new (type);
 		} else {
-			shellHandle = OS.gtk_plug_new (handle);
+			shellHandle = cast(GtkWidget*) OS.gtk_plug_new (cast(uint)handle);
 		}
-		if (shellHandle == 0) error (SWT.ERROR_NO_HANDLES);
-		if (parent != null) {
-			OS.gtk_window_set_transient_for (shellHandle, parent.topHandle ());
-			OS.gtk_window_set_destroy_with_parent (shellHandle, true);
+		if (shellHandle is null) error (SWT.ERROR_NO_HANDLES);
+		if (parent !is null) {
+			OS.gtk_window_set_transient_for (cast(GtkWindow*)shellHandle, cast(GtkWindow*)parent.topHandle ());
+			OS.gtk_window_set_destroy_with_parent (cast(GtkWindow*)shellHandle, true);
 			if (!isUndecorated ()) {
-				OS.gtk_window_set_type_hint (shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG);
+				OS.gtk_window_set_type_hint (cast(GtkWindow*)shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG);
 			} else {
-				if (OS.GTK_VERSION >= OS.VERSION (2, 2, 0)) {
-					OS.gtk_window_set_skip_taskbar_hint (shellHandle, true);
+				if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+					OS.gtk_window_set_skip_taskbar_hint (cast(GtkWindow*)shellHandle, true);
 				}
 			}
 		}
@@ -611,40 +616,41 @@
 		* is created or it will not be allowed to be resized smaller that the
 		* initial size by the user.  The fix is to set the size to zero.
 		*/
-		if ((style & SWT.RESIZE) != 0) {
+		if ((style & SWT.RESIZE) !is 0) {
 			OS.gtk_widget_set_size_request (shellHandle, 0, 0);
-			OS.gtk_window_set_resizable (shellHandle, true);
+			OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, true);
 		} else {
-			OS.gtk_window_set_resizable (shellHandle, false);
+			OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, false);
 		}
 		vboxHandle = OS.gtk_vbox_new (false, 0);
-		if (vboxHandle == 0) error (SWT.ERROR_NO_HANDLES);
+		if (vboxHandle is null) error (SWT.ERROR_NO_HANDLES);
 		createHandle (index, false, true);
-		OS.gtk_container_add (vboxHandle, scrolledHandle);
-		OS.gtk_box_set_child_packing (vboxHandle, scrolledHandle, true, true, 0, OS.GTK_PACK_END);
-		OS.gtk_window_set_title (shellHandle, new byte [1]);
-		if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
-			OS.gtk_container_set_border_width (shellHandle, 1);
-			GdkColor color = new GdkColor ();
+		OS.gtk_container_add (cast(GtkContainer*)vboxHandle, scrolledHandle);
+		OS.gtk_box_set_child_packing (cast(GtkBox*)vboxHandle, scrolledHandle, true, true, 0, OS.GTK_PACK_END);
+        char[] dummy = "a";
+		OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, dummy.ptr );
+		if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+			OS.gtk_container_set_border_width (cast(GtkContainer*)shellHandle, 1);
+			GdkColor* color = new GdkColor ();
 			OS.gtk_style_get_black (OS.gtk_widget_get_style (shellHandle), color);
 			OS.gtk_widget_modify_bg (shellHandle,  OS.GTK_STATE_NORMAL, color);
 		}
 		int bits = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
-		boolean modal = (style & bits) != 0;
+		bool modal = (style & bits) !is 0;
 		//TEMPORARY CODE
-		if ((style & SWT.ON_TOP) == 0) modal |= (parent != null && (parent.style & bits) != 0);
-		OS.gtk_window_set_modal (shellHandle, modal);
+		if ((style & SWT.ON_TOP) is 0) modal |= (parent !is null && (parent.style & bits) !is 0);
+		OS.gtk_window_set_modal (cast(GtkWindow*)shellHandle, modal);
 	} else {
-		vboxHandle = OS.gtk_bin_get_child (shellHandle);
-		if (vboxHandle == 0) error (SWT.ERROR_NO_HANDLES);
-		int /*long*/ children = OS.gtk_container_get_children (vboxHandle);
+		vboxHandle = OS.gtk_bin_get_child (cast(GtkBin*)shellHandle);
+		if (vboxHandle is null) error (SWT.ERROR_NO_HANDLES);
+		auto children = OS.gtk_container_get_children (cast(GtkContainer*)vboxHandle);
 		if (OS.g_list_length (children) > 0) {
-			scrolledHandle = OS.g_list_data (children);
+			scrolledHandle = cast(GtkWidget*)OS.g_list_data (children);
 		}
 		OS.g_list_free (children);
-		if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
-		handle = OS.gtk_bin_get_child (scrolledHandle);
-		if (handle == 0) error (SWT.ERROR_NO_HANDLES);
+		if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+		handle = OS.gtk_bin_get_child (cast(GtkBin*)scrolledHandle);
+		if (handle is null) error (SWT.ERROR_NO_HANDLES);
 	}
 	/*
 	* Feature in GTK.  Realizing the shell triggers a size allocate event,
@@ -655,19 +661,18 @@
 	OS.gtk_widget_realize (shellHandle);
 }
 
-int /*long*/ filterProc (int /*long*/ xEvent, int /*long*/ gdkEvent, int /*long*/ data2) {
+override int /*long*/ filterProc ( XEvent* xEvent, GdkEvent* gdkEvent, void* data2) {
 	int eventType = OS.X_EVENT_TYPE (xEvent);
-	if (eventType != OS.FocusOut && eventType != OS.FocusIn) return 0;
-	XFocusChangeEvent xFocusEvent = new XFocusChangeEvent();
-	OS.memmove (xFocusEvent, xEvent, XFocusChangeEvent.sizeof);
+	if (eventType !is OS.FocusOut && eventType !is OS.FocusIn) return 0;
+	XFocusChangeEvent* xFocusEvent = cast(XFocusChangeEvent*)xEvent;
 	switch (eventType) {
 		case OS.FocusIn:
-			if (xFocusEvent.mode == OS.NotifyNormal || xFocusEvent.mode == OS.NotifyWhileGrabbed) {
+			if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
 				switch (xFocusEvent.detail) {
 					case OS.NotifyNonlinear:
 					case OS.NotifyNonlinearVirtual:
 					case OS.NotifyAncestor:
-						if (tooltipsHandle != 0) OS.gtk_tooltips_enable (tooltipsHandle);
+						if (tooltipsHandle !is null) OS.gtk_tooltips_enable (cast(GtkTooltips*)tooltipsHandle);
 						display.activeShell = this;
 						display.activePending = false;
 						sendEvent (SWT.Activate);
@@ -676,16 +681,16 @@
 			}
 			break;
 		case OS.FocusOut:
-			if (xFocusEvent.mode == OS.NotifyNormal || xFocusEvent.mode == OS.NotifyWhileGrabbed) {
+			if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
 				switch (xFocusEvent.detail) {
 					case OS.NotifyNonlinear:
 					case OS.NotifyNonlinearVirtual:
 					case OS.NotifyVirtual:
-						if (tooltipsHandle != 0) OS.gtk_tooltips_disable (tooltipsHandle);
+						if (tooltipsHandle !is null) OS.gtk_tooltips_disable (cast(GtkTooltips*)tooltipsHandle);
 						Display display = this.display;
 						sendEvent (SWT.Deactivate);
 						setActiveControl (null);
-						if (display.activeShell == this) {
+						if (display.activeShell is this) {
 							display.activeShell = null;
 							display.activePending = false;
 						}
@@ -698,14 +703,14 @@
 }
 
 Control findBackgroundControl () {
-	return (state & BACKGROUND) != 0 || backgroundImage != null ? this : null;
+	return (state & BACKGROUND) !is 0 || backgroundImage !is null ? this : null;
 }
 
 Composite findDeferredControl () {
 	return layoutCount > 0 ? this : null;
 }
 
-boolean hasBorder () {
+bool hasBorder () {
 	return false;
 }
 
@@ -720,23 +725,24 @@
 	OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [DELETE_EVENT], 0, display.closures [DELETE_EVENT], false);
 	OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.shellMapProcClosure, false);
 	OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
-	OS.g_signal_connect_closure (shellHandle, OS.move_focus, display.closures [MOVE_FOCUS], false);
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	OS.gdk_window_add_filter  (window, display.filterProc, shellHandle);
+	OS.g_signal_connect_closure (shellHandle, OS.move_focus.ptr, display.closures [MOVE_FOCUS], false);
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    display.doWindowAddFilter( &filterProcCallbackData, window, shellHandle );
+	//OS.gdk_window_add_filter  (window, display.filterProc, shellHandle);
 }
 
-public boolean isEnabled () {
+public bool isEnabled () {
 	checkWidget ();
 	return getEnabled ();
 }
 
-boolean isUndecorated () {
+bool isUndecorated () {
 	return
-		(style & (SWT.SHELL_TRIM | SWT.BORDER)) == SWT.NONE ||
-		(style & (SWT.NO_TRIM | SWT.ON_TOP)) != 0;
+		(style & (SWT.SHELL_TRIM | SWT.BORDER)) is SWT.NONE ||
+		(style & (SWT.NO_TRIM | SWT.ON_TOP)) !is 0;
 }
 
-public boolean isVisible () {
+public bool isVisible () {
 	checkWidget();
 	return getVisible ();
 }
@@ -750,37 +756,38 @@
 	/* Do nothing */
 }
 
-int /*long*/ topHandle () {
+GtkWidget* topHandle () {
 	return shellHandle;
 }
 
 void fixActiveShell () {
-	if (display.activeShell == this) {
+	if (display.activeShell is this) {
 		Shell shell = null;
-		if (parent != null && parent.isVisible ()) shell = parent.getShell ();
-		if (shell == null && isUndecorated ()) {
+		if (parent !is null && parent.isVisible ()) shell = parent.getShell ();
+		if (shell is null && isUndecorated ()) {
 			Shell [] shells = display.getShells ();
 			for (int i = 0; i < shells.length; i++) {
-				if (shells [i] != null && shells [i].isVisible ()) {
+				if (shells [i] !is null && shells [i].isVisible ()) {
 					shell = shells [i];
 					break;
 				}
 			}
 		}
-		if (shell != null) shell.bringToTop (false);
+		if (shell !is null) shell.bringToTop (false);
 	}
 }
 
 void fixShell (Shell newShell, Control control) {
-	if (this == newShell) return;
-	if (control == lastActive) setActiveControl (null);
-	String toolTipText = control.toolTipText;
-	if (toolTipText != null) {
+	if (this is newShell) return;
+	if (control is lastActive) setActiveControl (null);
+	char[] toolTipText = control.toolTipText;
+	if (toolTipText !is null) {
 		control.setToolTipText (this, null);
 		control.setToolTipText (newShell, toolTipText);
 	}
 }
 
+alias Decorations.fixStyle fixStyle;
 void fixStyle (int /*long*/ handle) {
 }
 
@@ -789,22 +796,22 @@
 }
 
 void forceResize (int width, int height) {
-	GtkRequisition requisition = new GtkRequisition ();
+	GtkRequisition* requisition = new GtkRequisition ();
 	OS.gtk_widget_size_request (vboxHandle, requisition);
-	GtkAllocation allocation = new GtkAllocation ();
-	int border = OS.gtk_container_get_border_width (shellHandle);
+	GtkAllocation* allocation = new GtkAllocation ();
+	int border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
 	allocation.x = border;
 	allocation.y = border;
 	allocation.width = width;
 	allocation.height = height;
-	OS.gtk_widget_size_allocate (vboxHandle, allocation);
+	OS.gtk_widget_size_allocate (cast(GtkWidget*)vboxHandle, allocation);
 }
 
 public Point getLocation () {
 	checkWidget ();
-	int [] x = new int [1], y = new int [1];
-	OS.gtk_window_get_position (shellHandle, x,y);
-	return new Point (x [0], y [0]);
+	int x, y;
+	OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x,&y);
+	return new Point (x, y);
 }
 
 /**
@@ -834,13 +841,13 @@
 	int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
 	int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
 	int border = 0;
-	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
-		border = OS.gtk_container_get_border_width (shellHandle);
+	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+		border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
 	}
 	return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
 }
 
-public boolean getVisible () {
+public bool getVisible () {
 	checkWidget();
 	return OS.GTK_WIDGET_VISIBLE (shellHandle);
 }
@@ -908,8 +915,8 @@
 		Control shell = shells [i];
 		do {
 			shell = shell.getParent ();
-		} while (shell != null && shell != this);
-		if (shell == this) count++;
+		} while (shell !is null && shell !is this);
+		if (shell is this) count++;
 	}
 	int index = 0;
 	Shell [] result = new Shell [count];
@@ -917,47 +924,47 @@
 		Control shell = shells [i];
 		do {
 			shell = shell.getParent ();
-		} while (shell != null && shell != this);
-		if (shell == this) {
+		} while (shell !is null && shell !is this);
+		if (shell is this) {
 			result [index++] = shells [i];
 		}
 	}
 	return result;
 }
 
-int /*long*/ gtk_configure_event (int /*long*/ widget, int /*long*/ event) {
-	int [] x = new int [1], y = new int [1];
-	OS.gtk_window_get_position (shellHandle, x, y);
-	if (!moved || oldX != x [0] || oldY != y [0]) {
+override int /*long*/ gtk_configure_event (GtkWidget* widget, int /*long*/ event) {
+	int x, y;
+	OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x, &y);
+	if (!moved || oldX !is x || oldY !is y) {
 		moved = true;
-		oldX = x [0];
-		oldY = y [0];
+		oldX = x;
+		oldY = y;
 		sendEvent (SWT.Move);
 		// widget could be disposed at this point
 	}
 	return 0;
 }
 
-int /*long*/ gtk_delete_event (int /*long*/ widget, int /*long*/ event) {
+override int /*long*/ gtk_delete_event (GtkWidget* widget, int /*long*/ event) {
 	if (isEnabled()) closeWidget ();
 	return 1;
 }
 
-int /*long*/ gtk_enter_notify_event (int /*long*/ widget, int /*long*/ event) {
-	if (widget != shellHandle) {
+override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+	if (widget !is shellHandle) {
 		return super.gtk_enter_notify_event (widget, event);
 	}
 	return 0;
 }
 
-int /*long*/ gtk_focus (int /*long*/ widget, int /*long*/ directionType) {
-	switch ((int)/*64*/directionType) {
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
+	switch (cast(int)/*64*/directionType) {
 		case OS.GTK_DIR_TAB_FORWARD:
 		case OS.GTK_DIR_TAB_BACKWARD:
 			Control control = display.getFocusControl ();
-			if (control != null) {
-				if ((control.state & CANVAS) != 0 && (control.style & SWT.EMBEDDED) != 0) {
-					int traversal = directionType == OS.GTK_DIR_TAB_FORWARD ? SWT.TRAVERSE_TAB_NEXT : SWT.TRAVERSE_TAB_PREVIOUS;
+			if (control !is null) {
+				if ((control.state & CANVAS) !is 0 && (control.style & SWT.EMBEDDED) !is 0) {
+					int traversal = directionType is OS.GTK_DIR_TAB_FORWARD ? SWT.TRAVERSE_TAB_NEXT : SWT.TRAVERSE_TAB_PREVIOUS;
 					control.traverse (traversal);
 					return 1;
 				}
@@ -967,34 +974,34 @@
 	return super.gtk_focus (widget, directionType);
 }
 
-int /*long*/ gtk_move_focus (int /*long*/ widget, int /*long*/ directionType) {
+override int /*long*/ gtk_move_focus (GtkWidget* widget, int directionType) {
 	Control control = display.getFocusControl ();
-	if (control != null) {
-		int /*long*/ focusHandle = control.focusHandle ();
-		OS.gtk_widget_child_focus (focusHandle, (int)/*64*/directionType);
+	if (control !is null) {
+		auto focusHandle = control.focusHandle ();
+		OS.gtk_widget_child_focus (focusHandle, directionType);
 	}
-	OS.g_signal_stop_emission_by_name (shellHandle, OS.move_focus);
+	OS.g_signal_stop_emission_by_name (shellHandle, OS.move_focus.ptr );
 	return 1;
 }
 
-int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) {
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
 	/* Stop menu mnemonics when the shell is disabled */
-	if (widget == shellHandle) {
-		return (state & DISABLED) != 0 ? 1 : 0;
+	if (widget is shellHandle) {
+		return (state & DISABLED) !is 0 ? 1 : 0;
 	}
 	return super.gtk_key_press_event (widget, event);
 }
 
-int /*long*/ gtk_map_event (int /*long*/ widget, int /*long*/ event) {
+override int /*long*/ gtk_map_event (GtkWidget* widget, int /*long*/ event) {
 	minimized = false;
 	sendEvent (SWT.Deiconify);
 	return 0;
 }
 
-int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) {
+override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
 	int width = OS.GTK_WIDGET_WIDTH (shellHandle);
 	int height = OS.GTK_WIDGET_HEIGHT (shellHandle);
-	if (!resized || oldWidth != width || oldHeight != height) {
+	if (!resized || oldWidth !is width || oldHeight !is height) {
 		oldWidth = width;
 		oldHeight = height;
 		resizeBounds (width, height, true);
@@ -1002,45 +1009,43 @@
 	return 0;
 }
 
-int /*long*/ gtk_realize (int /*long*/ widget) {
-	int /*long*/ result = super.gtk_realize (widget);
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	if ((style & SWT.SHELL_TRIM) != SWT.SHELL_TRIM) {
+override int /*long*/ gtk_realize (GtkWidget* widget) {
+	auto result = super.gtk_realize (widget);
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+	if ((style & SWT.SHELL_TRIM) !is SWT.SHELL_TRIM) {
 		int decorations = 0;
-		if ((style & SWT.NO_TRIM) == 0) {
-			if ((style & SWT.MIN) != 0) decorations |= OS.GDK_DECOR_MINIMIZE;
-			if ((style & SWT.MAX) != 0) decorations |= OS.GDK_DECOR_MAXIMIZE;
-			if ((style & SWT.RESIZE) != 0) decorations |= OS.GDK_DECOR_RESIZEH;
-			if ((style & SWT.BORDER) != 0) decorations |= OS.GDK_DECOR_BORDER;
-			if ((style & SWT.MENU) != 0) decorations |= OS.GDK_DECOR_MENU;
-			if ((style & SWT.TITLE) != 0) decorations |= OS.GDK_DECOR_TITLE;
+		if ((style & SWT.NO_TRIM) is 0) {
+			if ((style & SWT.MIN) !is 0) decorations |= OS.GDK_DECOR_MINIMIZE;
+			if ((style & SWT.MAX) !is 0) decorations |= OS.GDK_DECOR_MAXIMIZE;
+			if ((style & SWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_RESIZEH;
+			if ((style & SWT.BORDER) !is 0) decorations |= OS.GDK_DECOR_BORDER;
+			if ((style & SWT.MENU) !is 0) decorations |= OS.GDK_DECOR_MENU;
+			if ((style & SWT.TITLE) !is 0) decorations |= OS.GDK_DECOR_TITLE;
 			/*
 			* Feature in GTK.  Under some Window Managers (Sawmill), in order
 			* to get any border at all from the window manager it is necessary to
 			* set GDK_DECOR_BORDER.  The fix is to force these bits when any
 			* kind of border is requested.
 			*/
-			if ((style & SWT.RESIZE) != 0) decorations |= OS.GDK_DECOR_BORDER;
+			if ((style & SWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_BORDER;
 		}
 		OS.gdk_window_set_decorations (window, decorations);
 	}
-	if ((style & SWT.ON_TOP) != 0) {
+	if ((style & SWT.ON_TOP) !is 0) {
 		OS.gdk_window_set_override_redirect (window, true);
 	}
 	return result;
 }
 
-int /*long*/ gtk_unmap_event (int /*long*/ widget, int /*long*/ event) {
+override int /*long*/ gtk_unmap_event (GtkWidget* widget, int /*long*/ event) {
 	minimized = true;
 	sendEvent (SWT.Iconify);
 	return 0;
 }
 
-int /*long*/ gtk_window_state_event (int /*long*/ widget, int /*long*/ event) {
-	GdkEventWindowState gdkEvent = new GdkEventWindowState ();
-	OS.memmove (gdkEvent, event, GdkEventWindowState.sizeof);
-	minimized = (gdkEvent.new_window_state & OS.GDK_WINDOW_STATE_ICONIFIED) != 0;
-	maximized = (gdkEvent.new_window_state & OS.GDK_WINDOW_STATE_MAXIMIZED) != 0;
+override int /*long*/ gtk_window_state_event (GtkWidget* widget, GdkEventWindowState* event) {
+	minimized = (event.new_window_state & OS.GDK_WINDOW_STATE_ICONIFIED) !is 0;
+	maximized = (event.new_window_state & OS.GDK_WINDOW_STATE_MAXIMIZED) !is 0;
 	return 0;
 }
 
@@ -1092,8 +1097,8 @@
  */
 public void removeShellListener (ShellListener listener) {
 	checkWidget();
-	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
-	if (eventTable == null) return;
+	if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+	if (eventTable is null) return;
 	eventTable.unhook (SWT.Close, listener);
 	eventTable.unhook (SWT.Iconify,listener);
 	eventTable.unhook (SWT.Deiconify,listener);
@@ -1128,21 +1133,21 @@
 }
 
 void setActiveControl (Control control) {
-	if (control != null && control.isDisposed ()) control = null;
-	if (lastActive != null && lastActive.isDisposed ()) lastActive = null;
-	if (lastActive == control) return;
+	if (control !is null && control.isDisposed ()) control = null;
+	if (lastActive !is null && lastActive.isDisposed ()) lastActive = null;
+	if (lastActive is control) return;
 
 	/*
 	* Compute the list of controls to be activated and
 	* deactivated by finding the first common parent
 	* control.
 	*/
-	Control [] activate = (control == null) ? new Control[0] : control.getPath ();
-	Control [] deactivate = (lastActive == null) ? new Control[0] : lastActive.getPath ();
+	Control [] activate = (control is null) ? new Control[0] : control.getPath ();
+	Control [] deactivate = (lastActive is null) ? new Control[0] : lastActive.getPath ();
 	lastActive = control;
 	int index = 0, length = Math.min (activate.length, deactivate.length);
 	while (index < length) {
-		if (activate [index] != deactivate [index]) break;
+		if (activate [index] !is deactivate [index]) break;
 		index++;
 	}
 
@@ -1164,14 +1169,14 @@
 	}
 }
 
-void resizeBounds (int width, int height, boolean notify) {
-	if (redrawWindow != 0) {
+void resizeBounds (int width, int height, bool notify) {
+	if (redrawWindow !is null) {
 		OS.gdk_window_resize (redrawWindow, width, height);
 	}
-	if (enableWindow != 0) {
+	if (enableWindow !is null) {
 		OS.gdk_window_resize (enableWindow, width, height);
 	}
-	int border = OS.gtk_container_get_border_width (shellHandle);
+	int border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
 	int boxWidth = width - 2*border;
 	int boxHeight = height - 2*border;
 	OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
@@ -1180,14 +1185,14 @@
 		resized = true;
 		sendEvent (SWT.Resize);
 		if (isDisposed ()) return;
-		if (layout != null) {
+		if (layout_ !is null) {
 			markLayout (false, false);
 			updateLayout (false);
 		}
 	}
 }
 
-int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+int setBounds (int x, int y, int width, int height, bool move, bool resize) {
 	/*
 	* Bug in GTK.  When either of the location or size of
 	* a shell is changed while the shell is maximized, the
@@ -1197,17 +1202,17 @@
 	*/
 	if (getMaximized ()) {
 		Rectangle rect = getBounds ();
-		boolean sameOrigin = !move || (rect.x == x && rect.y == y);
-		boolean sameExtent = !resize || (rect.width == width && rect.height == height);
+		bool sameOrigin = !move || (rect.x is x && rect.y is y);
+		bool sameExtent = !resize || (rect.width is width && rect.height is height);
 		if (sameOrigin && sameExtent) return 0;
 		setMaximized (false);
 	}
 	int result = 0;
 	if (move) {
-		int [] x_pos = new int [1], y_pos = new int [1];
-		OS.gtk_window_get_position (shellHandle, x_pos, y_pos);
-		OS.gtk_window_move (shellHandle, x, y);
-		if (x_pos [0] != x || y_pos [0] != y) {
+		int x_pos, y_pos;
+		OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x_pos, &y_pos);
+		OS.gtk_window_move (cast(GtkWindow*)shellHandle, x, y);
+		if (x_pos !is x || y_pos !is y) {
 			moved = true;
 			oldX = x;
 			oldY = y;
@@ -1219,8 +1224,8 @@
 	if (resize) {
 		width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
 		height = Math.max (1, Math.max (minHeight, height - trimHeight ()));
-		if ((style & SWT.RESIZE) != 0) OS.gtk_window_resize (shellHandle, width, height);
-		boolean changed = width != oldWidth || height != oldHeight;
+		if ((style & SWT.RESIZE) !is 0) OS.gtk_window_resize (cast(GtkWindow*)shellHandle, width, height);
+		bool changed = width !is oldWidth || height !is oldHeight;
 		if (changed) {
 			oldWidth = width;
 			oldHeight = height;
@@ -1231,29 +1236,29 @@
 	return result;
 }
 
-void setCursor (int /*long*/ cursor) {
-	if (enableWindow != 0) {
-		OS.gdk_window_set_cursor (enableWindow, cursor);
+void setCursor (GdkCursor* cursor) {
+	if (enableWindow !is null) {
+		OS.gdk_window_set_cursor (cast(GdkDrawable*)enableWindow, cursor);
 		if (!OS.GDK_WINDOWING_X11 ()) {
 			OS.gdk_flush ();
 		} else {
-			int /*long*/ xDisplay = OS.GDK_DISPLAY ();
+			auto xDisplay = OS.GDK_DISPLAY ();
 			OS.XFlush (xDisplay);
 		}
 	}
 	super.setCursor (cursor);
 }
 
-public void setEnabled (boolean enabled) {
+public void setEnabled (bool enabled) {
 	checkWidget();
-	if (((state & DISABLED) == 0) == enabled) return;
+	if (((state & DISABLED) is 0) is enabled) return;
 	Display display = this.display;
 	Control control = null;
-	boolean fixFocus = false;
+	bool fixFocus_ = false;
 	if (!enabled) {
-		if (display.focusEvent != SWT.FocusOut) {
+		if (display.focusEvent !is SWT.FocusOut) {
 			control = display.getFocusControl ();
-			fixFocus = isFocusAncestor (control);
+			fixFocus_ = isFocusAncestor (control);
 		}
 	}
 	if (enabled) {
@@ -1264,30 +1269,30 @@
 	enableWidget (enabled);
 	if (isDisposed ()) return;
 	if (enabled) {
-		if (enableWindow != 0) {
-			OS.gdk_window_set_user_data (enableWindow, 0);
+		if (enableWindow !is null) {
+			OS.gdk_window_set_user_data (enableWindow, null);
 			OS.gdk_window_destroy (enableWindow);
-			enableWindow = 0;
+			enableWindow = null;
 		}
 	} else {
-		int /*long*/ parentHandle = shellHandle;
+		auto parentHandle = shellHandle;
 		OS.gtk_widget_realize (parentHandle);
-		int /*long*/ window = OS.GTK_WIDGET_WINDOW (parentHandle);
+		auto window = OS.GTK_WIDGET_WINDOW (parentHandle);
 		Rectangle rect = getBounds ();
-		GdkWindowAttr attributes = new GdkWindowAttr ();
+		GdkWindowAttr* attributes = new GdkWindowAttr ();
 		attributes.width = rect.width;
 		attributes.height = rect.height;
 		attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask);
 		attributes.wclass = OS.GDK_INPUT_ONLY;
 		attributes.window_type = OS.GDK_WINDOW_CHILD;
 		enableWindow = OS.gdk_window_new (window, attributes, 0);
-		if (enableWindow != 0) {
-			if (cursor != null) {
+		if (enableWindow !is null) {
+			if (cursor !is null) {
 				OS.gdk_window_set_cursor (enableWindow, cursor.handle);
 				if (!OS.GDK_WINDOWING_X11 ()) {
 					OS.gdk_flush ();
 				} else {
-					int /*long*/ xDisplay = OS.GDK_DISPLAY ();
+					auto xDisplay = OS.GDK_DISPLAY ();
 					OS.XFlush (xDisplay);
 				}
 			}
@@ -1295,8 +1300,8 @@
 			OS.gdk_window_show (enableWindow);
 		}
 	}
-	if (fixFocus) fixFocus (control);
-	if (enabled && display.activeShell == this) {
+	if (fixFocus_) fixFocus (control);
+	if (enabled && display.activeShell is this) {
 		if (!restoreFocus ()) traverseGroup (false);
 	}
 }
@@ -1322,43 +1327,43 @@
 }
 
 void setInitialBounds () {
-	if ((state & FOREIGN_HANDLE) != 0) return;
-	Monitor monitor = getMonitor ();
+	if ((state & FOREIGN_HANDLE) !is 0) return;
+	dwt.widgets.Monitor.Monitor monitor = getMonitor ();
 	Rectangle rect = monitor.getClientArea ();
 	int width = rect.width * 5 / 8;
 	int height = rect.height * 5 / 8;
-	if ((style & SWT.RESIZE) != 0) {
-		OS.gtk_window_resize (shellHandle, width, height);
+	if ((style & SWT.RESIZE) !is 0) {
+		OS.gtk_window_resize (cast(GtkWindow*)shellHandle, width, height);
 	}
 	resizeBounds (width, height, false);
 }
 
-public void setMaximized (boolean maximized) {
+public void setMaximized (bool maximized) {
 	checkWidget();
 	super.setMaximized (maximized);
 	if (maximized) {
-		OS.gtk_window_maximize (shellHandle);
+		OS.gtk_window_maximize (cast(GtkWindow*)shellHandle);
 	} else {
-		OS.gtk_window_unmaximize (shellHandle);
+		OS.gtk_window_unmaximize (cast(GtkWindow*)shellHandle);
 	}
 }
 
 public void setMenuBar (Menu menu) {
 	checkWidget();
-	if (menuBar == menu) return;
-	boolean both = menu != null && menuBar != null;
-	if (menu != null) {
-		if ((menu.style & SWT.BAR) == 0) error (SWT.ERROR_MENU_NOT_BAR);
-		if (menu.parent != this) error (SWT.ERROR_INVALID_PARENT);
+	if (menuBar is menu) return;
+	bool both = menu !is null && menuBar !is null;
+	if (menu !is null) {
+		if ((menu.style & SWT.BAR) is 0) error (SWT.ERROR_MENU_NOT_BAR);
+		if (menu.parent !is this) error (SWT.ERROR_INVALID_PARENT);
 	}
-	if (menuBar != null) {
-		int /*long*/ menuHandle = menuBar.handle;
+	if (menuBar !is null) {
+		auto menuHandle = menuBar.handle;
 		OS.gtk_widget_hide (menuHandle);
 		destroyAccelGroup ();
 	}
 	menuBar = menu;
-	if (menuBar != null) {
-		int /*long*/ menuHandle = menu.handle;
+	if (menuBar !is null) {
+		auto menuHandle = menu.handle;
 		OS.gtk_widget_show (menuHandle);
 		createAccelGroup ();
 		menuBar.addAccelerators (accelGroup);
@@ -1368,14 +1373,14 @@
 	resizeBounds (width, height, !both);
 }
 
-public void setMinimized (boolean minimized) {
+public void setMinimized (bool minimized) {
 	checkWidget();
-	if (this.minimized == minimized) return;
+	if (this.minimized is minimized) return;
 	super.setMinimized (minimized);
 	if (minimized) {
-		OS.gtk_window_iconify (shellHandle);
+		OS.gtk_window_iconify (cast(GtkWindow*)shellHandle);
 	} else {
-		OS.gtk_window_deiconify (shellHandle);
+		OS.gtk_window_deiconify (cast(GtkWindow*)shellHandle);
 		bringToTop (false);
 	}
 }
@@ -1397,10 +1402,10 @@
  */
 public void setMinimumSize (int width, int height) {
 	checkWidget ();
-	GdkGeometry geometry = new GdkGeometry ();
+	GdkGeometry* geometry = new GdkGeometry ();
 	minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
 	minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
-	OS.gtk_window_set_geometry_hints (shellHandle, 0, geometry, OS.GDK_HINT_MIN_SIZE);
+	OS.gtk_window_set_geometry_hints (cast(GtkWindow*)shellHandle, null, geometry, OS.GDK_HINT_MIN_SIZE);
 }
 
 /**
@@ -1422,7 +1427,7 @@
  */
 public void setMinimumSize (Point size) {
 	checkWidget ();
-	if (size == null) error (SWT.ERROR_NULL_ARGUMENT);
+	if (size is null) error (SWT.ERROR_NULL_ARGUMENT);
 	setMinimumSize (size.x, size.y);
 }
 
@@ -1448,10 +1453,10 @@
  */
 public void setRegion (Region region) {
 	checkWidget ();
-	if ((style & SWT.NO_TRIM) == 0) return;
-	if (region != null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	int /*long*/ shape_region = (region == null) ? 0 : region.handle;
+	if ((style & SWT.NO_TRIM) is 0) return;
+	if (region !is null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+	auto shape_region = (region is null) ? null : region.handle;
 	OS.gdk_window_shape_combine_region (window, shape_region, 0, 0);
 	this.region = region;
 }
@@ -1462,7 +1467,7 @@
 void setRelations() {
 }
 
-public void setText (String string) {
+public void setText (char[] string) {
 	super.setText (string);
 
 	/*
@@ -1472,17 +1477,16 @@
 	* garbage after the last character in  the title.
 	* The fix is to pad the title.
 	*/
-	int length = string.length ();
-	char [] chars = new char [Math.max (6, length) + 1];
-	string.getChars (0, length , chars, 0);
-	for (int i=length; i<chars.length; i++)  chars [i] = ' ';
-	byte [] buffer = Converter.wcsToMbcs (null, chars, true);
-	OS.gtk_window_set_title (shellHandle, buffer);
+	int length_ = string.length;
+	char [] chars = new char [Math.max (6, length_) + 1];
+	chars = string[ 0 .. length_];
+	for (int i=length_; i<chars.length; i++)  chars [i] = ' ';
+	OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, toStringz( chars ) );
 }
 
-public void setVisible (boolean visible) {
+public void setVisible (bool visible) {
 	checkWidget();
-	if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return;
+	if ((OS.GTK_WIDGET_MAPPED (shellHandle) is visible)) return;
 	if (visible) {
 		sendEvent (SWT.Show);
 		if (isDisposed ()) return;
@@ -1502,22 +1506,22 @@
 		if (!OS.GTK_IS_PLUG (shellHandle)) {
 			mapped = false;
 			if (isDisposed ()) return;
-			display.dispatchEvents = new int [] {
+			display.dispatchEvents = [
 				OS.GDK_EXPOSE,
 				OS.GDK_FOCUS_CHANGE,
 				OS.GDK_CONFIGURE,
 				OS.GDK_MAP,
 				OS.GDK_UNMAP,
-				OS.GDK_NO_EXPOSE,
-			};
+				OS.GDK_NO_EXPOSE
+			];
 			Display display = this.display;
 			display.putGdkEvents();
-			boolean iconic = false;
-			Shell shell = parent != null ? parent.getShell() : null;
+			bool iconic = false;
+			Shell shell = parent !is null ? parent.getShell() : null;
 			do {
-				OS.g_main_context_iteration (0, false);
+				OS.g_main_context_iteration (null, false);
 				if (isDisposed ()) break;
-				iconic = minimized || (shell != null && shell.minimized);
+				iconic = minimized || (shell !is null && shell.minimized);
 			} while (!mapped && !iconic);
 			display.dispatchEvents = null;
 			if (isDisposed ()) return;
@@ -1530,7 +1534,7 @@
 		mapped = true;
 
 		int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
-		if ((style & mask) != 0) {
+		if ((style & mask) !is 0) {
 			OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME);
 		}
 		opened = true;
@@ -1549,7 +1553,7 @@
 			oldHeight = size.y - trimHeight ();
 			sendEvent (SWT.Resize);
 			if (isDisposed ()) return;
-			if (layout != null) {
+			if (layout_ !is null) {
 				markLayout (false, false);
 				updateLayout (false);
 			}
@@ -1561,7 +1565,8 @@
 	}
 }
 
-void setZOrder (Control sibling, boolean above, boolean fixRelations) {
+alias Decorations.setZOrder setZOrder;
+void setZOrder (Control sibling, bool above, bool fixRelations) {
 	/*
 	* Bug in GTK+.  Changing the toplevel window Z-order causes
 	* X to send a resize event.  Before the shell is mapped, these
@@ -1573,60 +1578,60 @@
 	if (mapped) setZOrder (sibling, above, false, false);
 }
 
-int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+override int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	mapped = true;
 	display.dispatchEvents = null;
 	return 0;
 }
 
 void showWidget () {
-	if ((state & FOREIGN_HANDLE) != 0) return;
-	OS.gtk_container_add (shellHandle, vboxHandle);
-	if (scrolledHandle != 0) OS.gtk_widget_show (scrolledHandle);
-	if (handle != 0) OS.gtk_widget_show (handle);
-	if (vboxHandle != 0) OS.gtk_widget_show (vboxHandle);
+	if ((state & FOREIGN_HANDLE) !is 0) return;
+	OS.gtk_container_add (cast(GtkContainer*)shellHandle, vboxHandle);
+	if (scrolledHandle !is null) OS.gtk_widget_show (scrolledHandle);
+	if (handle !is null) OS.gtk_widget_show (handle);
+	if (vboxHandle !is null) OS.gtk_widget_show (vboxHandle);
 }
 
-int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+override int /*long*/ sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	int offset = 16;
-	int [] x = new int [1], y = new int [1];
-	OS.gdk_window_get_pointer (0, x, y, null);
-	y [0] += offset;
-	int /*long*/ screen = OS.gdk_screen_get_default ();
-	if (screen != 0) {
-		int monitorNumber = OS.gdk_screen_get_monitor_at_point (screen, x[0], y[0]);
-		GdkRectangle dest = new GdkRectangle ();
+	int x, y;
+	OS.gdk_window_get_pointer (null, &x, &y, null);
+	y += offset;
+	auto screen = OS.gdk_screen_get_default ();
+	if (screen !is null) {
+		int monitorNumber = OS.gdk_screen_get_monitor_at_point (screen, x, y);
+		GdkRectangle* dest = new GdkRectangle ();
 		OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest);
 		int width = OS.GTK_WIDGET_WIDTH (handle);
 		int height = OS.GTK_WIDGET_HEIGHT (handle);
-		if (x[0] + width > dest.x + dest.width) {
-			x [0] = (dest.x + dest.width) - width;
+		if (x + width > dest.x + dest.width) {
+			x = (dest.x + dest.width) - width;
 		}
-		if (y[0] + height > dest.y + dest.height) {
-			y[0] = (dest.y + dest.height) - height;
+		if (y + height > dest.y + dest.height) {
+			y = (dest.y + dest.height) - height;
 		}
 	}
-	OS.gtk_window_move (handle, x [0], y [0]);
+	OS.gtk_window_move (cast(GtkWindow*)handle, x, y);
 	return 0;
 }
 
-int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+override int /*long*/ sizeRequestProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	OS.gtk_widget_hide (handle);
 	return 0;
 }
 
-boolean traverseEscape () {
-	if (parent == null) return false;
+bool traverseEscape () {
+	if (parent is null) return false;
 	if (!isVisible () || !isEnabled ()) return false;
 	close ();
 	return true;
 }
 int trimHeight () {
-	if ((style & SWT.NO_TRIM) != 0) return 0;
-	boolean hasTitle = false, hasResize = false, hasBorder = false;
-	hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) != 0;
-	hasResize = (style & SWT.RESIZE) != 0;
-	hasBorder = (style & SWT.BORDER) != 0;
+	if ((style & SWT.NO_TRIM) !is 0) return 0;
+	bool hasTitle = false, hasResize = false, hasBorder = false;
+	hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+	hasResize = (style & SWT.RESIZE) !is 0;
+	hasBorder = (style & SWT.BORDER) !is 0;
 	if (hasTitle) {
 		if (hasResize) return display.titleResizeTrimHeight;
 		if (hasBorder) return display.titleBorderTrimHeight;
@@ -1638,11 +1643,11 @@
 }
 
 int trimWidth () {
-	if ((style & SWT.NO_TRIM) != 0) return 0;
-	boolean hasTitle = false, hasResize = false, hasBorder = false;
-	hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) != 0;
-	hasResize = (style & SWT.RESIZE) != 0;
-	hasBorder = (style & SWT.BORDER) != 0;
+	if ((style & SWT.NO_TRIM) !is 0) return 0;
+	bool hasTitle = false, hasResize = false, hasBorder = false;
+	hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+	hasResize = (style & SWT.RESIZE) !is 0;
+	hasBorder = (style & SWT.BORDER) !is 0;
 	if (hasTitle) {
 		if (hasResize) return display.titleResizeTrimWidth;
 		if (hasBorder) return display.titleBorderTrimWidth;
@@ -1697,27 +1702,27 @@
 
 public Rectangle getBounds () {
 	checkWidget ();
-	int [] x = new int [1], y = new int [1];
-	OS.gtk_window_get_position (shellHandle, x, y);
+	int x, y ;
+	OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x, &y);
 	int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
 	int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
 	int border = 0;
-	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
-		border = OS.gtk_container_get_border_width (shellHandle);
+	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+		border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
 	}
-	return new Rectangle (x [0], y [0], width + trimWidth () + 2*border, height + trimHeight () + 2*border);
+	return new Rectangle (x, y, width + trimWidth () + 2*border, height + trimHeight () + 2*border);
 }
 
 void releaseHandle () {
 	super.releaseHandle ();
-	shellHandle = 0;
+	shellHandle = null;
 }
 
-void releaseChildren (boolean destroy) {
+void releaseChildren (bool destroy) {
 	Shell [] shells = getShells ();
 	for (int i=0; i<shells.length; i++) {
 		Shell shell = shells [i];
-		if (shell != null && !shell.isDisposed ()) {
+		if (shell !is null && !shell.isDisposed ()) {
 			shell.release (false);
 		}
 	}
@@ -1727,25 +1732,24 @@
 void releaseWidget () {
 	super.releaseWidget ();
 	destroyAccelGroup ();
-	if (display.activeShell == this) display.activeShell = null;
-	if (tooltipsHandle != 0) OS.g_object_unref (tooltipsHandle);
-	tooltipsHandle = 0;
-	int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle);
-	OS.gdk_window_remove_filter(window, display.filterProc, shellHandle);
+	if (display.activeShell is this) display.activeShell = null;
+	if (tooltipsHandle !is null) OS.g_object_unref (tooltipsHandle);
+	tooltipsHandle = null;
+	auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    display.doWindowRemoveFilter( &filterProcCallbackData, window, shellHandle );
 	region = null;
 	lastActive = null;
 }
 
-void setToolTipText (int /*long*/ widget, String string) {
-	byte [] buffer = null;
-	if (string != null && string.length () > 0) {
-		buffer = Converter.wcsToMbcs (null, string, true);
-	}
-	if (tooltipsHandle == 0) {
-		tooltipsHandle = OS.gtk_tooltips_new ();
-		if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES);
+void setToolTipText (GtkWidget* widget, char[] string) {
+//PORTING_LEFT
+/+
+	char* buffer = toStringz( string );
+	if (tooltipsHandle is null) {
+		tooltipsHandle = cast(GtkWidget*)OS.gtk_tooltips_new ();
+		if (tooltipsHandle is null) error (SWT.ERROR_NO_HANDLES);
 		OS.g_object_ref (tooltipsHandle);
-		OS.gtk_object_sink (tooltipsHandle);
+		OS.gtk_object_sink (cast(GtkObject*)tooltipsHandle);
 	}
 
 	/*
@@ -1757,11 +1761,11 @@
 	* can cause a crash in older versions of GTK.  The fix is
 	* to avoid this call if the GTK version is older than 2.2.x.
 	*/
-	if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1)) {
-		OS.gtk_tooltips_force_window (tooltipsHandle);
+	if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 1)) {
+		OS.gtk_tooltips_force_window (cast(GtkTooltips*)tooltipsHandle);
 	}
-	int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (tooltipsHandle);
-	if (tipWindow != 0 && tipWindow != tooltipWindow) {
+	auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)tooltipsHandle);
+	if (tipWindow !is null && tipWindow !is tooltipWindow) {
 		OS.g_signal_connect (tipWindow, OS.size_allocate, display.sizeAllocateProc, shellHandle);
 		tooltipWindow = tipWindow;
 	}
@@ -1772,15 +1776,15 @@
 	* is not displayed until the mouse re-enters the window.  The
 	* fix is force the new tooltip to be active.
 	*/
-	boolean set = true;
-	if (tipWindow != 0) {
-		if ((OS.GTK_WIDGET_FLAGS (widget) & (OS.GTK_REALIZED | OS.GTK_VISIBLE)) != 0) {
+	bool set = true;
+	if (tipWindow !is null) {
+		if ((OS.GTK_WIDGET_FLAGS (widget) & (OS.GTK_REALIZED | OS.GTK_VISIBLE)) !is 0) {
 			int [] x = new int [1], y = new int [1];
-			int /*long*/ window = OS.gdk_window_at_pointer (x, y);
-			if (window != 0) {
-				int /*long*/ [] user_data = new int /*long*/ [1];
-				OS.gdk_window_get_user_data (window, user_data);
-				if (widget == user_data [0]) {
+			auto window = OS.gdk_window_at_pointer (x, y);
+			if (window !is null) {
+				GtkWidget* user_data;
+				OS.gdk_window_get_user_data (window, &user_data);
+				if (widget is user_data) {
 					/*
 					* Feature in GTK.  Calling gtk_tooltips_set_tip() positions and
 					* shows the tooltip.  If the tooltip is already visible, moving
@@ -1790,17 +1794,17 @@
 					*/
 					set = false;
 					int handler_id = OS.g_signal_connect (tipWindow, OS.size_request, display.sizeRequestProc, shellHandle);
-					OS.gtk_tooltips_set_tip (tooltipsHandle, widget, buffer, null);
+					OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, null);
 					OS.gtk_widget_hide (tipWindow);
-					int /*long*/ data = OS.gtk_tooltips_data_get (widget);
+					auto data = OS.gtk_tooltips_data_get (cast(GtkTooltips*)widget);
 					OS.GTK_TOOLTIPS_SET_ACTIVE (tooltipsHandle, data);
-					OS.gtk_tooltips_set_tip (tooltipsHandle, widget, buffer, null);
-					if (handler_id != 0) OS.g_signal_handler_disconnect (tipWindow, handler_id);
+					OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, null);
+					if (handler_id !is 0) OS.g_signal_handler_disconnect (tipWindow, handler_id);
 				}
 			}
 		}
 	}
-	if (set) OS.gtk_tooltips_set_tip (tooltipsHandle, widget, buffer, null);
+	if (set) OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, null);
+ +/
 }
 }
-++/
\ No newline at end of file
--- a/dwt/widgets/Widget.d	Thu Jan 10 05:17:47 2008 +0100
+++ b/dwt/widgets/Widget.d	Thu Jan 10 07:33:15 2008 +0100
@@ -639,7 +639,7 @@
 	return 0;
 }
 
-int /*long*/ gtk_focus (GtkWidget* widget, GdkEventFocus* event) {
+int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
 	return 0;
 }
 
@@ -699,7 +699,7 @@
 	return 0;
 }
 
-int /*long*/ gtk_move_focus (GtkWidget* widget, int /*long*/ event) {
+int /*long*/ gtk_move_focus (GtkWidget* widget, int directionType) {
 	return 0;
 }
 
@@ -795,7 +795,7 @@
 	return 0;
 }
 
-int /*long*/ gtk_window_state_event (GtkWidget* widget, int /*long*/ event) {
+int /*long*/ gtk_window_state_event (GtkWidget* widget, GdkEventWindowState* event) {
 	return 0;
 }
 
@@ -809,7 +809,7 @@
 	return OS.PANGO_PIXELS (ascent + descent);
 }
 
-int filterProc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) {
+int filterProc (XEvent* xEvent, GdkEvent* gdkEvent, void* data) {
 	return 0;
 }
 
@@ -1402,15 +1402,15 @@
 void setOrientation () {
 }
 
-int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	return 0;
 }
 
-int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+int /*long*/ sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	return 0;
 }
 
-int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+int /*long*/ sizeRequestProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	return 0;
 }
 
@@ -1492,7 +1492,7 @@
 		case EVENT: return gtk_event (handle, cast(GdkEvent*)arg0);
 		case EVENT_AFTER: return gtk_event_after (handle, cast(GdkEvent*)arg0);
 		case EXPOSE_EVENT: return gtk_expose_event (handle, cast(GdkEventExpose*)arg0);
-		case FOCUS: return gtk_focus (handle, cast(GdkEventFocus*)arg0);
+		case FOCUS: return gtk_focus (handle, arg0);
 		case FOCUS_IN_EVENT: return gtk_focus_in_event (handle, cast(GdkEventFocus*)arg0);
 		case FOCUS_OUT_EVENT: return gtk_focus_out_event (handle, cast(GdkEventFocus*)arg0);
 		case KEY_PRESS_EVENT: return gtk_key_press_event (handle, cast(GdkEventKey*)arg0);
@@ -1510,7 +1510,7 @@
 		case TOGGLED: return gtk_toggled (cast(int)handle, arg0);
 		case UNMAP_EVENT: return gtk_unmap_event (handle, arg0);
 		case VISIBILITY_NOTIFY_EVENT: return gtk_visibility_notify_event (handle, cast(GdkEventVisibility*)arg0);
-		case WINDOW_STATE_EVENT: return gtk_window_state_event (handle, arg0);
+		case WINDOW_STATE_EVENT: return gtk_window_state_event (handle, cast(GdkEventWindowState*)arg0);
 		default: return 0;
 	}
 }