diff dwt/widgets/Display.d @ 33:27324bbbac70

changed to regenerated BCD bindings
author Frank Benoit <benoit@tionex.de>
date Thu, 10 Jan 2008 02:18:07 +0100
parents 5e5d1c9cffdb
children 6e625fa1612d
line wrap: on
line diff
--- a/dwt/widgets/Display.d	Wed Jan 09 07:07:50 2008 +0100
+++ b/dwt/widgets/Display.d	Thu Jan 10 02:18:07 2008 +0100
@@ -27,8 +27,6 @@
 import dwt.internal.Converter;
 import dwt.internal.Lock;
 import dwt.internal.LONG;
-import dwt.internal.gtk.c.gdktypes;
-import dwt.internal.gtk.c.gtktypes;
 import dwt.internal.gtk.OS;
 import dwt.widgets.Caret;
 import dwt.widgets.Control;
@@ -741,7 +739,7 @@
 	}
 }
 
-private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, void* userData) {
+private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, char* userData) {
     auto disp = cast(Display)userData;
     return disp.checkIfEventProcMeth( display, xEvent );
 }
@@ -882,31 +880,31 @@
 		fixed_info.class_size = GtkFixedClass.sizeof;
 		fixed_info.class_init = & fixedClassInitProcFunc;
 		fixed_info.instance_size = GtkFixed.sizeof;
-		fixed_type = OS.g_type_register_static (OS.GTK_TYPE_FIXED (), "SwtFixed".ptr, fixed_info, cast(GTypeFlags)0);
+		fixed_type = OS.g_type_register_static (OS.GTK_TYPE_FIXED (), "SwtFixed".ptr, fixed_info, 0);
 	}
 	if (text_renderer_type is 0) {
 		GTypeInfo* renderer_info = new GTypeInfo ();
 		renderer_info.class_size = GtkCellRendererTextClass.sizeof;
 		renderer_info.class_init = & rendererClassInitProcFunc;
 		renderer_info.instance_size = GtkCellRendererText.sizeof;
-		text_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TEXT (), "SwtTextRenderer".ptr, renderer_info, cast(GTypeFlags)0);
+		text_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TEXT (), "SwtTextRenderer".ptr, renderer_info, 0);
 	}
 	if (pixbuf_renderer_type is 0) {
 		GTypeInfo* renderer_info = new GTypeInfo ();
 		renderer_info.class_size = GtkCellRendererPixbufClass.sizeof;
 		renderer_info.class_init = & rendererClassInitProcFunc;
 		renderer_info.instance_size = GtkCellRendererPixbuf.sizeof;
-		pixbuf_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_PIXBUF (), "SwtPixbufRenderer".ptr, renderer_info, cast(GTypeFlags)0);
+		pixbuf_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_PIXBUF (), "SwtPixbufRenderer".ptr, renderer_info, 0);
 	}
 	if (toggle_renderer_type is 0) {
 		GTypeInfo* renderer_info = new GTypeInfo ();
 		renderer_info.class_size = GtkCellRendererToggleClass.sizeof;
 		renderer_info.class_init = & rendererClassInitProcFunc;
 		renderer_info.instance_size = GtkCellRendererToggle.sizeof;
-		toggle_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TOGGLE (), "SwtToggleRenderer".ptr, renderer_info, cast(GTypeFlags)0);
+		toggle_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TOGGLE (), "SwtToggleRenderer".ptr, renderer_info, 0);
 	}
 
-	OS.gtk_widget_set_default_direction (cast(GtkTextDirection)OS.GTK_TEXT_DIR_LTR);
+	OS.gtk_widget_set_default_direction (OS.GTK_TEXT_DIR_LTR);
 	OS.gdk_rgb_init ();
 	char* p = toStringz(APP_NAME);
 	OS.g_set_prgname (p);
@@ -914,12 +912,12 @@
 	OS.gtk_rc_parse_string ("style \"swt-flat\" { GtkToolbar::shadow-type = none } widget \"*.swt-toolbar-flat\" style : highest \"swt-flat\"".ptr);
 
 	/* Initialize the hidden shell */
-	shellHandle = OS.gtk_window_new (cast(GtkWindowType)OS.GTK_WINDOW_TOPLEVEL);
+	shellHandle = OS.gtk_window_new (OS.GTK_WINDOW_TOPLEVEL);
 	if (shellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
 	OS.gtk_widget_realize (shellHandle);
 
 	/* Initialize the filter and event callback */
-	OS.gdk_event_handler_set (&eventProcFunc, cast(void*)this, cast(GDestroyNotify) 0);
+	OS.gdk_event_handler_set (&eventProcFunc, cast(void*)this, null);
     filterProcCallbackData.display = this;
     filterProcCallbackData.data = null;
 	OS.gdk_window_add_filter  (null, &filterProcFunc, cast(void*)&filterProcCallbackData );
@@ -930,9 +928,9 @@
 	char[] buffer = name;
 	auto pixbuf = OS.gtk_icon_set_render_icon (
 		OS.gtk_icon_factory_lookup_default (buffer.ptr), style,
-		cast(GtkTextDirection)OS.GTK_TEXT_DIR_NONE,
-        cast(GtkStateType)OS.GTK_STATE_NORMAL,
-        cast(GtkIconSize)OS.GTK_ICON_SIZE_DIALOG, null, null );
+		OS.GTK_TEXT_DIR_NONE,
+        OS.GTK_STATE_NORMAL,
+        OS.GTK_ICON_SIZE_DIALOG, null, null );
 	if (pixbuf is null) return null;
 	int width = OS.gdk_pixbuf_get_width (pixbuf);
 	int height = OS.gdk_pixbuf_get_height (pixbuf);
@@ -970,10 +968,10 @@
 	GdkPixbuf* pixbuf;
 	bool hasMask = image.mask !is null && OS.gdk_drawable_get_depth (image.mask) is 1;
 	if (hasMask) {
-		pixbuf = OS.gdk_pixbuf_new (cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, true, 8, w, h );
+		pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, true, 8, w, h );
 		if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
 		OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
-		auto maskPixbuf = OS.gdk_pixbuf_new(cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, false, 8, w, h);
+		auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, w, h);
 		if (maskPixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
 		OS.gdk_pixbuf_get_from_drawable(maskPixbuf, image.mask, null, 0, 0, 0, 0, w, h);
 		int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
@@ -998,7 +996,7 @@
 	} else {
 		ImageData data = image.getImageData ();
 		bool hasAlpha = data.getTransparencyType () is SWT.TRANSPARENCY_ALPHA;
-		pixbuf = OS.gdk_pixbuf_new (cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, hasAlpha, 8, w, h);
+		pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, hasAlpha, 8, w, h);
 		if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
 		OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
 		if (hasAlpha) {
@@ -1304,7 +1302,7 @@
 		this.flushAll = all;
 		auto xDisplay = OS.GDK_DISPLAY ();
 		auto xEvent = cast(XEvent*)OS.g_malloc (XEvent.sizeof);
-		OS.XCheckIfEvent (xDisplay, xEvent, &checkIfEventProcFunc, cast(void*)this );
+		OS.XCheckIfEvent (xDisplay, xEvent, &checkIfEventProcFunc, cast(char*)this );
 		OS.g_free (xEvent);
 		this.flushWindow = null;
 	}
@@ -1415,14 +1413,14 @@
 	return filterTable.hooks (eventType);
 }
 
-private static extern(C) GdkFilterReturn filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) {
+private static extern(C) int filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) {
     auto callbackdata = cast(CallbackData*)data;
     auto disp = callbackdata.display;
-    if( disp is null ) return GdkFilterReturn.CONTINUE;
+    if( disp is null ) return 0;
     return disp.filterProcMeth(xEvent,gdkEvent,callbackdata);
 }
 
-GdkFilterReturn filterProcMeth (GdkXEvent* xEvent, GdkEvent* gdkEvent, CallbackData* callbackData) {
+int filterProcMeth (GdkXEvent* xEvent, GdkEvent* gdkEvent, CallbackData* callbackData) {
     if( callbackData.data is null ){
         /*
          * Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK
@@ -1443,7 +1441,7 @@
         }
     }
     Widget widget = getWidget (cast(GtkWidget*)callbackData.data);
-    if (widget is null) return GdkFilterReturn.CONTINUE;
+    if (widget is null) return 0;
     return widget.filterProc (xEvent, gdkEvent, callbackData.data);
 }
 
@@ -2072,7 +2070,7 @@
 	GdkColor* gdkColor;
 
 	/* Get Tooltip resources */
-	auto tooltipShellHandle = OS.gtk_window_new (cast(GtkWindowType)OS.GTK_WINDOW_POPUP);
+	auto tooltipShellHandle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
 	if (tooltipShellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
 //	byte[] gtk_tooltips = Converter.wcsToMbcs (null, "gtk-tooltips", true);
 	OS.gtk_widget_set_name (tooltipShellHandle, "gtk-tooltips".ptr );
@@ -2456,7 +2454,7 @@
 	auto root = cast(GdkDrawable *) OS.GDK_ROOT_PARENT ();
 	auto gdkGC = OS.gdk_gc_new (root);
 	if (gdkGC is null) SWT.error (SWT.ERROR_NO_HANDLES);
-	OS.gdk_gc_set_subwindow (gdkGC, cast(GdkSubwindowMode)OS.GDK_INCLUDE_INFERIORS);
+	OS.gdk_gc_set_subwindow (gdkGC, OS.GDK_INCLUDE_INFERIORS);
 	if (data !is null) {
 		int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
 		if ((data.style & mask) is 0) {
@@ -3045,7 +3043,7 @@
 	COLOR_INFO_BACKGROUND = COLOR_INFO_FOREGROUND = null;
 
 	/* Dispose the event callback */
-	OS.gdk_event_handler_set (null, null, cast(GDestroyNotify) 0);
+	OS.gdk_event_handler_set (null, null, null);
 
 	/* Dispose the hidden shell */
 	if (shellHandle !is null) OS.gtk_widget_destroy (shellHandle);
@@ -3450,7 +3448,7 @@
     return setDirectionProc( widget, cast(int)direction );
 }
 static int /*long*/ setDirectionProc (GtkWidget* widget, int /*long*/ direction) {
-	OS.gtk_widget_set_direction (widget, cast(GtkTextDirection) direction);
+	OS.gtk_widget_set_direction (widget,  direction);
 	if (OS.GTK_IS_CONTAINER (widget)) {
 		OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, cast(void*)direction);
 	}
@@ -3484,7 +3482,7 @@
 void showIMWindow (Control control) {
 	imControl = control;
 	if (preeditWindow is null) {
-		preeditWindow = cast(GtkWindow*)OS.gtk_window_new (cast(GtkWindowType)OS.GTK_WINDOW_POPUP);
+		preeditWindow = cast(GtkWindow*)OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
 		if (preeditWindow is null) error (SWT.ERROR_NO_HANDLES);
 		preeditLabel = cast(GtkLabel*) OS.gtk_label_new (null);
 		if (preeditLabel is null) error (SWT.ERROR_NO_HANDLES);
@@ -3498,7 +3496,7 @@
 	if (preeditString !is null && strlen (preeditString) > 0) {
 		Control widget = control.findBackgroundControl ();
 		if (widget is null) widget = control;
-		OS.gtk_widget_modify_bg (cast(GtkWidget*)preeditWindow, cast(GtkStateType) OS.GTK_STATE_NORMAL, widget.getBackgroundColor ());
+		OS.gtk_widget_modify_bg (cast(GtkWidget*)preeditWindow, OS.GTK_STATE_NORMAL, widget.getBackgroundColor ());
 		widget.setForegroundColor (cast(GtkWidget*)preeditLabel, control.getForegroundColor());
 		OS.gtk_widget_modify_font (cast(GtkWidget*)preeditLabel, control.getFontDescription ());
 		if (pangoAttrs !is null) OS.gtk_label_set_attributes (preeditLabel, pangoAttrs);