changeset 40:7fb1ab011933

made macro implementations active, one compile problem in OS.d:2554
author Frank Benoit <benoit@tionex.de>
date Thu, 10 Jan 2008 08:18:45 +0100
parents 8e76ddc90b31
children c83c51423d03
files dwt/internal/gtk/OS.d dwt/widgets/Composite.d dwt/widgets/Control.d dwt/widgets/Display.d dwt/widgets/Shell.d
diffstat 5 files changed, 268 insertions(+), 250 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/internal/gtk/OS.d	Thu Jan 10 07:34:05 2008 +0100
+++ b/dwt/internal/gtk/OS.d	Thu Jan 10 08:18:45 2008 +0100
@@ -12,6 +12,11 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
+/********************************************************************************
+ * D port done by:
+ *      Frank Benoit <keinfarbton@googlemail.com>
+ *      JJR
+ *******************************************************************************/
 module dwt.internal.gtk.OS;
 
 import dwt.internal.Platform;
@@ -39,6 +44,7 @@
 public alias dwt.internal.c.glib_object.GCallback GCallback;
 public alias dwt.internal.c.glib_object.GClosureNotify GClosureNotify;
 public alias dwt.internal.c.glib_object.GPollFunc GPollFunc;
+public alias dwt.internal.c.glib_object.GTypeInstance GTypeInstance;
 
 public alias dwt.internal.c.gdk.GdkColor GdkColor;
 public alias dwt.internal.c.gdk.GdkRegion GdkRegion;
@@ -165,18 +171,18 @@
 
 
 private int PANGO_PIXELS( int v );
-private GdkWindow* GDK_ROOT_PARENT();
-private GdkDisplay* GDK_DISPLAY();
-private GType GTK_TYPE_FIXED();
-private GType GTK_TYPE_CELL_RENDERER_TEXT();
-private GType GTK_TYPE_CELL_RENDERER_PIXBUF();
-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*);
+//private GdkWindow* GDK_ROOT_PARENT();
+//private GdkDisplay* GDK_DISPLAY();
+//private GType GTK_TYPE_FIXED();
+//private GType GTK_TYPE_CELL_RENDERER_TEXT();
+//private GType GTK_TYPE_CELL_RENDERER_PIXBUF();
+//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*);
 private GType GTK_WIDGET_STATE(GtkWidget*);
 private GType GTK_WIDGET_HAS_DEFAULT(GtkWidget*);
 private GType GTK_WIDGET_HAS_FOCUS(GtkWidget*);
@@ -193,7 +199,7 @@
 private GType G_TYPE_INT();
 private GType G_OBJECT_TYPE( GObject* );
 private GType G_TYPE_STRING();
-
++/
 // fontconfig.h
 struct FcConfig{};
 private extern(C) int FcConfigAppFontAddFile (FcConfig *config, char  *file);
@@ -1098,28 +1104,28 @@
     mixin ForwardGtkOsCFunc!(.XRenderFindStandardFormat);
     mixin ForwardGtkOsCFunc!(.XRenderFindVisualFormat);
     //mixin ForwardGtkOsCFunc!(Call );
-    mixin ForwardGtkOsCFunc!(.GDK_DISPLAY);
-    mixin ForwardGtkOsCFunc!(.GDK_ROOT_PARENT);
+    //mixin ForwardGtkOsCFunc!(.GDK_DISPLAY);
+    //mixin ForwardGtkOsCFunc!(.GDK_ROOT_PARENT);
 //     mixin ForwardGtkOsCFunc!(.GDK_TYPE_COLOR);
 //     mixin ForwardGtkOsCFunc!(.GDK_TYPE_PIXBUF);
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_BUTTON);
-     mixin ForwardGtkOsCFunc!(.GTK_IS_WINDOW);
+     //mixin ForwardGtkOsCFunc!(.GTK_IS_WINDOW);
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_CELL_RENDERER_PIXBUF);
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_CELL_RENDERER_TEXT);
 //     mixin ForwardGtkOsCFunc!(.GTK_IS_CELL_RENDERER_TOGGLE);
-     mixin ForwardGtkOsCFunc!(.GTK_IS_CONTAINER);
+     //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);
-     mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_PIXBUF);
-     mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_TOGGLE);
-     mixin ForwardGtkOsCFunc!(.GTK_TYPE_FIXED);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_TEXT);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_PIXBUF);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_CELL_RENDERER_TOGGLE);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_FIXED);
 
-     mixin ForwardGtkOsCFunc!(.GTK_TYPE_MENU);
-     mixin ForwardGtkOsCFunc!(.GTK_TYPE_WIDGET);
-     mixin ForwardGtkOsCFunc!(.GTK_WIDGET_FLAGS);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_MENU);
+     //mixin ForwardGtkOsCFunc!(.GTK_TYPE_WIDGET);
+     /+mixin ForwardGtkOsCFunc!(.GTK_WIDGET_FLAGS);
      mixin ForwardGtkOsCFunc!(.GTK_WIDGET_STATE);
      mixin ForwardGtkOsCFunc!(.GTK_WIDGET_HAS_DEFAULT);
      mixin ForwardGtkOsCFunc!(.GTK_WIDGET_HAS_FOCUS);
@@ -1138,7 +1144,7 @@
      mixin ForwardGtkOsCFunc!(.G_TYPE_STRING);
     mixin ForwardGtkOsCFunc!(.PANGO_PIXELS);
     //mixin ForwardGtkOsCFunc!(.PANGO_TYPE_FONT_DESCRIPTION);
-
++/
     mixin ForwardGtkOsCFunc!(.g_cclosure_new);
     mixin ForwardGtkOsCFunc!(.g_closure_ref);
     mixin ForwardGtkOsCFunc!(.g_closure_unref);
@@ -1191,7 +1197,7 @@
     mixin ForwardGtkOsCFunc!(.g_object_unref);
     mixin ForwardGtkOsCFunc!(.g_quark_from_string);
     mixin ForwardGtkOsCFunc!(.g_set_prgname);
-    mixin ForwardGtkOsCFunc!(.g_signal_connect);
+    //mixin ForwardGtkOsCFunc!(.g_signal_connect);
     mixin ForwardGtkOsCFunc!(.g_signal_connect_closure);
     mixin ForwardGtkOsCFunc!(.g_signal_connect_closure_by_id);
 //    mixin ForwardGtkOsCFunc!(.g_signal_connect_after);
@@ -2183,6 +2189,7 @@
     //Window X_EVENT_WINDOW( XAnyEvent* arg0 )
     //     { return arg0.window; }
 
+/+
     //g_list_data(arg0) (arg0)->data
     static void* g_list_data( GList* arg0 ) {
         return arg0.data;
@@ -2267,6 +2274,7 @@
     static int gtk_style_get_ythickness( GtkStyle* arg0 ) {
         return arg0.ythickness;
     }
+    +/
     /+
     gtk_style_get_fg_gc(arg0, arg1, arg2) *arg2 = (arg0)->fg_gc[arg1]
     gtk_style_get_bg_gc(arg0, arg1, arg2) *arg2 = (arg0)->bg_gc[arg1]
@@ -2280,546 +2288,556 @@
 
     localeconv_decimal_point() localeconv()->decimal_point
 +/
-/+    
+
    /**************************************************************************
 
         Utility methods -- conversions of gtk macros
 
     **************************************************************************/
-    
-    gulong g_signal_connect( gpointer arg0, ghar* arg1, GCallback arg2, gpointer arg3 )
+    static gulong g_signal_connect( gpointer arg0, gchar* arg1, GCallback arg2, gpointer arg3 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return g_signal_connect_data (arg0, arg1, arg2, arg3, null , cast(GConnectFlags) 0) ;
     }
-    
-    gulong g_signal_connect_after( gpointer arg0, gchar* arg1, GCallback arg2, gpointer arg3 )
+
+    static gulong g_signal_connect_after( gpointer arg0, gchar* arg1, GCallback arg2, gpointer arg3 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_signal_connect_data ( arg0, arg1, arg2, arg3, null, GConnectFlags.AFTER )
+        return g_signal_connect_data ( arg0, arg1, arg2, arg3, null, GConnectFlags.G_CONNECT_AFTER );
     }
 
-    GSList* g_slist_next( GSList* arg0 )
+    static GSList* g_slist_next( GSList* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return arg0 ? arg0.next : null;
     }
 
-    GList* g_list_next( GList* arg0 )
+    static GList* g_list_next( GList* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return arg0 ? arg0.next : null;
     }
-    
-    GList* g_list_previous( GList* arg0 )
+
+    static GList* g_list_previous( GList* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return arg0 ? arg0.prev : null;
     }
 
-    Display* GDK_DISPLAY() 
+    static Display* GDK_DISPLAY()
     {
         lock.lock();
         scope(exit) lock.unlock();
         // gdk_display needs to be a reference to the an external X11 global
         // representing the current X11 display
-        return gdk_display; 
+        return gdk_display;
     }
 
-    GdkWindow* GDK_ROOT_PARENT()
+    static GdkWindow* GDK_ROOT_PARENT()
     {
         lock.lock();
         scope(exit) lock.unlock;
         return gdk_get_default_root_window();
     }
 
-    GType GDK_TYPE_COLOR()
+    static GType GDK_TYPE_COLOR()
     {
         lock.lock();
         scope(exit) lock.unlock;
         return gdk_color_get_type();
     }
 
-    GType GDK_TYPE_PIXBUF()
+    static GType GDK_TYPE_PIXBUF()
     {
         lock.lock();
         scope(exit) lock.unlock;
         return gdk_pixbuf_get_type();
     }
 
-    bool GTK_IS_BUTTON( GTypeInstance* arg0 )
+    static bool GTK_IS_BUTTON( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-    	return  g_type_check_instance_is_a( arg0, gtk_button_get_type() );
+    	return  cast(bool)g_type_check_instance_is_a( arg0, gtk_button_get_type() );
     }
-    
-    bool GTK_IS_WINDOW( GTypeInstance* arg0 )
+
+    static bool GTK_IS_WINDOW( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_window_get_type());
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_window_get_type());
     }
- 
-    bool GTK_IS_CELL_RENDERER_PIXBUF( GTypeInstance* arg0 )
+
+    static bool GTK_IS_CELL_RENDERER_PIXBUF( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_cell_renderer_pixbuf_get_type());
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_cell_renderer_pixbuf_get_type());
     }
 
-    bool GTK_IS_CELL_RENDERER_TEXT( GTypeInstance* arg0 )
+    static bool GTK_IS_CELL_RENDERER_TEXT( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_cell_renderer_text_get_type());
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_cell_renderer_text_get_type());
     }
 
-    bool GTK_IS_CELL_RENDERER_TOGGLE( GTypeInstance* arg0 )
+    static bool GTK_IS_CELL_RENDERER_TOGGLE( GTypeInstance* arg0 )
     {
-        lock.lock()
+        lock.lock();
         scope(exit) lock.unlock();
-        return 	g_type_check_instance_is_a( arg0, gtk_cell_renderer_toggle_get_type ());
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_cell_renderer_toggle_get_type ());
     }
 
-    bool GTK_IS_CONTAINER( GTypeInstance* arg0 )
+    static bool GTK_IS_CONTAINER( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_container_get_type () );
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_container_get_type () );
     }
 
-    
-    bool GTK_IS_IMAGE_MENU_ITEM( GTypeInstance* arg0 )
+
+    static bool GTK_IS_IMAGE_MENU_ITEM( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_image_menu_item_get_type ());
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_image_menu_item_get_type ());
     }
-    
-    bool GTK_IS_PLUG( GTypeInstance* arg0 )
+
+    static bool GTK_IS_PLUG( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return g_type_check_instance_is_a( arg0, gtk_plug_get_type () );
+        return cast(bool)g_type_check_instance_is_a( arg0, gtk_plug_get_type () );
     }
-    
+
     // Should use d char[] instead for next two methods? - JJR
-    char* GTK_STOCK_CANCEL()
+    static char* GTK_STOCK_CANCEL()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return "gtk-cancel";
     }
 
-    char* GTK_STOCK_OK()
-    {   
+    static char* GTK_STOCK_OK()
+    {
         lock.lock();
         scope(exit) lock.unlock();
         return "gtk-ok";
     }
 
-    GType GTK_TYPE_CELL_RENDERER_TEXT()
+    static GType GTK_TYPE_CELL_RENDERER_TEXT()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_cell_renderer_text_get_type();
     }
 
-    GType GTK_TYPE_CELL_RENDERER_PIXBUF()
+    static GType GTK_TYPE_CELL_RENDERER_PIXBUF()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_cell_renderer_pixbuf_get_type();
     }
 
-    GType GTK_TYPE_CELL_RENDERER_TOGGLE ()
+    static GType GTK_TYPE_CELL_RENDERER_TOGGLE ()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_cell_renderer_toggle_get_type();
     }
 
-    GType GTK_TYPE_FIXED()
+    static GType GTK_TYPE_FIXED()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_fixed_get_type ();
     }
 
-    GType GTK_TYPE_MENU()
+    static GType GTK_TYPE_MENU()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_menu_get_type ();
     }
-    
-    GType GTK_TYPE_WIDGET()
+
+    static GType GTK_TYPE_WIDGET()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return gtk_widget_get_type ();
     }
 
-    guint32 GTK_WIDGET_FLAGS( GTypeInstance* arg0 )
+    static uint GTK_WIDGET_FLAGS( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return    (cast(GtkObject*) g_type_check_instance_cast ( arg0,  gtk_object_get_type ())).flags ;
+        return    (cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*) arg0,  gtk_object_get_type ())).flags ;
     }
 
-    guint8 GTK_WIDGET_STATE( GTypeInstance* arg0 )
+    static ubyte GTK_WIDGET_STATE( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return (  cast(GtkWidget*) g_type_check_instance_cast (arg0, gtk_widget_get_type ())).state;
+        return (  cast(GtkWidget*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_widget_get_type ())).state;
     }
-    
-    bool GTK_WIDGET_HAS_DEFAULT( GTypeInstance* arg0 )
-    {   
-        lock.lock(); 
-        scope(exit) lock.unlock();
-        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (arg0, gtk_object_get_type () )).flags & GTK_HAS_DEFAULT) != 0) ;
-    }
-    
-    bool GTK_WIDGET_HAS_FOCUS( GTypeInstance* arg0 )
+
+    static bool GTK_WIDGET_HAS_DEFAULT( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (arg0, gtk_object_get_type () )).flags & GTK_HAS_FOCUS) != 0) ;
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_HAS_DEFAULT) != 0) ;
     }
 
-    bool GTK_WIDGET_IS_SENSITIVE( GTypeInstance* arg0 )
+    static bool GTK_WIDGET_HAS_FOCUS( GtkWidget* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_HAS_FOCUS) != 0) ;
+    }
+
+    static bool GTK_WIDGET_IS_SENSITIVE( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return ( ( ( cast (GtkObject*) g_type_check_instance_cast ( arg0, gtk_object_get_type ()) ).flags & GTK_SENSITIVE) != 0)   && ( ( ( cast(GtkObject*) g_type_check_instance_cast ( arg0, gtk_object_get_type ()) ).flags & GTK_PARENT_SENSITIVE) != 0);
+        return ( ( ( cast (GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0, gtk_object_get_type ()) ).flags & GtkWidgetFlags.GTK_SENSITIVE) != 0)   && ( ( ( cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0, gtk_object_get_type ()) ).flags & GtkWidgetFlags.GTK_PARENT_SENSITIVE) != 0);
     }
-    
-    bool GTK_WIDGET_MAPPED( GTypeInstance* arg0 )
+
+    static bool GTK_WIDGET_MAPPED( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (arg0, gtk_object_get_type () )).flags & GTK_MAPPED) != 0) ;
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_MAPPED) != 0) ;
     }
 
-    bool GTK_WIDGET_SENSITIVE( GTypeInstance* arg0 )
+    static bool GTK_WIDGET_SENSITIVE( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (arg0, gtk_object_get_type () )).flags & GTK_SENSITIVE) != 0) ;
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GTK_SENSITIVE) != 0) ;
     }
 
-    void GTK_WIDGET_SET_FLAGS( GTypeInstance* arg0, guint32 arg1 )
+    static void GTK_WIDGET_SET_FLAGS( GtkWidget* arg0, uint arg1 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        (cast(GtkObject*) g_type_check_instance_cast ( arg0,  gtk_object_get_type () ) ).flags |= arg1; 
+        (cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0,  gtk_object_get_type () ) ).flags |= arg1;
     }
 
-    void GTK_WIDGET_UNSET_FLAGS( GTypeInstance* arg0, guint32 arg1 )
+    static void GTK_WIDGET_UNSET_FLAGS( GtkWidget* arg0, uint arg1 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        (cast(GtkObject*) g_type_check_instance_cast ( arg0,  gtk_object_get_type () ) ).flags &= ~arg1; 
+        (cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0,  gtk_object_get_type () ) ).flags &= ~arg1;
     }
-    
-    bool GTK_WIDGET_VISIBLE( GTypeInstance* arg0 )
+
+    static bool GTK_WIDGET_VISIBLE( GtkWidget* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (arg0, gtk_object_get_type () )).flags & GTK_VISIBLE) != 0) ;
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GTK_VISIBLE) != 0) ;
     }
-    
-    GObjectClass* G_OBJECT_CLASS( GTypeClass* arg0 )
+
+    static GObjectClass* G_OBJECT_CLASS( GTypeClass* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return (cast(GObjectClass*) g_type_check_class_cast ( arg0, cast(GType) (20 << 2) ) ) ;
     }
-    
-    GObjectClass* G_OBJECT_GET_CLASS( GTypeClass* arg0 )
-    {        
+
+    // Compile prob: GTypeClass has no member g_class
+   /+ static GObjectClass* G_OBJECT_GET_CLASS( GTypeClass* arg0 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
         return (cast(GObjectClass*) arg0.g_class) ;
-    }    
+    }+/
 
-    gchar* G_OBJECT_TYPE_NAME( GTypeInstance* arg0 )
+    static gchar* G_OBJECT_TYPE_NAME( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return g_type_name( (cast(GTypeClass*) arg0.g_class).g_type ) ;
     }
 
-    GType G_TYPE_BOOLEAN()
+    static GType G_TYPE_BOOLEAN()
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return  (cast(GType) (5 << 2)) ;  
+        return  (cast(GType) (5 << 2)) ;
     }
 
-    GType G_TYPE_INT()
+    static GType G_TYPE_INT()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return (cast(GType) (6 << 2));
     }
-    
-    GType G_OBJECT_TYPE( GTypeInstance* arg0 )
+
+    static GType G_OBJECT_TYPE( GTypeInstance* arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return (cast(GTypeClass*) arg0.g_class).g_type;
     }
 
-    GType G_TYPE_STRING()
+    static GType G_TYPE_STRING()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return (cast(GType) (16 << 2));
-    }    
+    }
 
 
-    int PANGO_PIXELS( int arg0 )
+    static int PANGO_PIXELS( int arg0 )
     {
         lock.lock();
         scope(exit) lock.unlock();
         return ((arg0 + 512) >> 10);
-    }    
+    }
 
-    GType PANGO_TYPE_FONT_DESCRIPTION()
+    static GType PANGO_TYPE_FONT_DESCRIPTION()
     {
         lock.lock();
         scope(exit) lock.unlock();
         return pango_font_description_get_type () ;
     }
-    
+
     /**************************************************************************
 
         Utility methods -- conversions of SWT macros
 
     **************************************************************************/
 
-    gpointer g_list_data( GList* arg0 ) 
-    {         
+    static gpointer g_list_data( GList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.data;
+    }
+
+    static gpointer g_slist_data( GSList* arg0 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        return arg0.data; 
+        return arg0.data;
     }
 
-    gpointer g_slist_data( GSList* arg0 ) 
+    static void g_list_set_next( GList* arg0, GList* arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.next = arg1;
+    }
+
+    static void g_list_set_previous( GList* arg0, GList* arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.prev = arg1;
+    }
+
+    static char* gtk_rc_style_get_bg_pixmap_name( GtkRcStyle* arg0, int arg1 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return arg0.data; 
+        return arg0.bg_pixmap_name[arg1];
     }
-    
-    void g_list_set_next( GList* arg0, GList* arg1 ) 
-    {         
+
+    static int  gtk_rc_style_get_color_flags( GtkRcStyle* arg0, int arg1)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.color_flags[arg1];
+    }
+
+    static void gtk_rc_style_set_bg( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        arg0.next = arg1; 
+        if (arg2 !is null) {
+            arg0.bg[arg1] = *arg2;
+        }
     }
-    
-    void g_list_set_previous( GList* arg0, GList* arg1 ) 
-    {   
+
+    static void gtk_rc_style_set_bg_pixmap_name( GtkRcStyle* arg0, int arg1, char* arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        arg0.prev = arg1; 
+        arg0.bg_pixmap_name[arg1] = arg2;
     }
 
-    char* gtk_rc_style_get_bg_pixmap_name( GtkRcStyle* arg0, int arg1 ) 
-    {   
+    static void gtk_rc_style_set_color_flags( GtkRcStyle* arg0, int arg1, int arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        return arg0.bg_pixmap_name[arg1]; 
+        arg0.color_flags[arg1] = arg2;
     }
 
-    int  gtk_rc_style_get_color_flags( GtkRcStyle* arg0, int arg1) 
+    static void gtk_rc_style_set_fg( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
     {
         lock.lock();
         scope(exit) lock.unlock();
-        return arg0.color_flags[arg1]; 
-    }
-
-    void gtk_rc_style_set_bg( GtkRcStyle* arg0, int arg1, GdkColor* arg2) 
-    {   
-        lock.lock();
-        scope(exit) lock.unlock();
-        if (arg2 !is null) { 
-            arg0.bg[arg1] = *arg2; 
-        } 
+        if (arg2 !is null ) {
+            arg0.fg[arg1] = *arg2;
+        }
     }
 
-    void gtk_rc_style_set_bg_pixmap_name( GtkRcStyle* arg0, int arg1, char* arg2) 
-    {   
-        lock.lock();
-        scope(exit) lock.unlock();
-        arg0.bg_pixmap_name[arg1] = arg2; 
-    }
-
-    void gtk_rc_style_set_color_flags( GtkRcStyle* arg0, int arg1, int arg2) 
-    { 
-        lock.lock();
-        scope(exit) lock.unlock();
-        arg0.color_flags[arg1] = arg2; 
-    }
-    
-    void gtk_rc_style_set_fg( GtkRcStyle* arg0, int arg1, GdkColor* arg2) 
-    {   
+    static void gtk_rc_style_set_text( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        if (arg2 !is null ) { 
-            arg0.fg[arg1] = *arg2; 
-        } 
-    }
-    
-    void gtk_rc_style_set_text( GtkRcStyle* arg0, int arg1, GdkColor* arg2) 
-    {         
-        lock.lock();
-        scope(exit) lock.unlock();
-        if (arg2 !is null) { 
-            arg0.text[arg1] = *arg2; 
-        } 
+        if (arg2 !is null) {
+            arg0.text[arg1] = *arg2;
+        }
     }
 
-    void* gtk_style_get_font_desc( GtkStyle* arg0 )
-    {   
+    static void* gtk_style_get_font_desc( GtkStyle* arg0 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        return arg0.font_desc; 
+        return arg0.font_desc;
     }
 
-    void gtk_style_get_base( GtkStyle* arg0, int arg1, GdkColor* arg2 ) 
-    {         
+    static void gtk_style_get_base( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.base[arg1]; 
+        *arg2 = arg0.base[arg1];
     }
 
-    void gtk_style_get_bg( GtkStyle* arg0, int arg1, GdkColor* arg2 ) 
+    static void gtk_style_get_bg( GtkStyle* arg0, int arg1, GdkColor* arg2 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.bg[arg1]; 
+        *arg2 = arg0.bg[arg1];
     }
 
-    void gtk_style_get_black( GtkStyle* arg0, GdkColor* arg1 )
-    {         
+    static void gtk_style_get_black( GtkStyle* arg0, GdkColor* arg1 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg1 = arg0.black; 
+        *arg1 = arg0.black;
     }
 
-    void gtk_style_get_dark( GtkStyle* arg0, int arg1, GdkColor* arg2 ) 
-    {         
+    static void gtk_style_get_dark( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.dark[arg1]; 
+        *arg2 = arg0.dark[arg1];
     }
-    
-    void gtk_style_get_fg( GtkStyle* arg0, int arg1, GdkColor* arg2 ) 
-    {   
+
+    static void gtk_style_get_fg( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.fg[arg1]; 
+        *arg2 = arg0.fg[arg1];
     }
 
-    void gtk_style_get_light( GtkStyle* arg0, int arg1, GdkColor* arg2) 
-    {   
+    static void gtk_style_get_light( GtkStyle* arg0, int arg1, GdkColor* arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.light[arg1]; 
+        *arg2 = arg0.light[arg1];
     }
 
-    void gtk_style_get_text( GtkStyle* arg0, int arg1, GdkColor* arg2) 
-    {         
+    static void gtk_style_get_text( GtkStyle* arg0, int arg1, GdkColor* arg2)
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.text[arg1]; 
+        *arg2 = arg0.text[arg1];
     }
 
-    int  gtk_style_get_xthickness( GtkStyle* arg0 ) 
-    {   
+    static int  gtk_style_get_xthickness( GtkStyle* arg0 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
         return arg0.xthickness;
     }
 
-    int gtk_style_get_ythickness( GtkStyle* arg0 ) 
-    {   
-        lock.lock();
-        scope(exit) lock.unlock();
-        return arg0.ythickness; 
-    }
-    
-    void gtk_style_get_fg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 ) 
-    {         
+    static int gtk_style_get_ythickness( GtkStyle* arg0 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.fg_gc[arg1]; 
+        return arg0.ythickness;
     }
 
-    void gtk_style_get_bg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 ) 
-    {         
+    static void gtk_style_get_fg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.bg_gc[arg1]; 
-    }
-
-    void gtk_style_get_light_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 ) 
-    {   
-        lock.lock();
-        scope(exit) lock.unlock();
-        *arg2 = arg0.light_gc[arg1]; 
+        *arg2 = arg0.fg_gc[arg1];
     }
 
-    void gtk_style_get_dark_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
-    { 
+    static void gtk_style_get_bg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.dark_gc[arg1]; }
-    }
-
-    void gtk_style_get_mid_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
-    {         
-        lock.lock();
-        scope(exit) lock.unlock();
-        *arg2 = arg0.mid_gc[arg1]; 
+        *arg2 = arg0.bg_gc[arg1];
     }
 
-    void gtk_style_get_text_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
-    {   
+    static void gtk_style_get_light_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.text_gc[arg1]; 
+        *arg2 = arg0.light_gc[arg1];
     }
 
-    void gtk_style_get_text_aa_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
-    { 
+    static void gtk_style_get_dark_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg2 = arg0.text_aa_gc[arg1]; 
+        *arg2 = arg0.dark_gc[arg1];
     }
 
-    void gtk_style_get_black_gc( GtkStyle* arg0, GdkGC** arg1 )
+    static void gtk_style_get_mid_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
     {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg1 = arg0.black_gc; 
+        *arg2 = arg0.mid_gc[arg1];
+    }
+
+    static void gtk_style_get_text_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.text_gc[arg1];
+    }
+
+    static void gtk_style_get_text_aa_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.text_aa_gc[arg1];
     }
 
-    void gtk_style_get_white_gc( GtkStyle* arg0, GdkGC** arg1 )
-    { 
+    static void gtk_style_get_black_gc( GtkStyle* arg0, GdkGC** arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg1 = arg0.black_gc;
+    }
+
+    static void gtk_style_get_white_gc( GtkStyle* arg0, GdkGC** arg1 )
+    {
         lock.lock();
         scope(exit) lock.unlock();
-        *arg1 = arg0.white_gc; 
+        *arg1 = arg0.white_gc;
     }
-+/
+
+    //localeconv_decimal_point() localeconv()->decimal_point
 }
+
+
+
+
+
+
+
+
+
--- a/dwt/widgets/Composite.d	Thu Jan 10 07:34:05 2008 +0100
+++ b/dwt/widgets/Composite.d	Thu Jan 10 08:18:45 2008 +0100
@@ -471,7 +471,7 @@
 			auto window = cast(GdkDrawable*)OS.g_list_data (windows);
 			if (window !is redrawWindow) {
 				OS.gdk_window_get_user_data (window, cast(void**)&userData);
-				if (userData is null || OS.G_OBJECT_TYPE (userData) !is display.gtk_fixed_get_type ()) {
+				if (userData is null || OS.G_OBJECT_TYPE (cast(GTypeInstance*)userData) !is display.gtk_fixed_get_type ()) {
 					OS.gdk_window_lower (window);
 				}
 			}
--- a/dwt/widgets/Control.d	Thu Jan 10 07:34:05 2008 +0100
+++ b/dwt/widgets/Control.d	Thu Jan 10 08:18:45 2008 +0100
@@ -2499,7 +2499,7 @@
 				display.ignoreFocus = false;
 				auto grabHandle = OS.gtk_grab_get_current ();
 				if (grabHandle !is null) {
-					if (OS.G_OBJECT_TYPE ( cast(GObject*)grabHandle) is OS.GTK_TYPE_MENU ()) {
+					if (OS.G_OBJECT_TYPE ( cast(GTypeInstance*)grabHandle) is OS.GTK_TYPE_MENU ()) {
 						display.ignoreFocus = true;
 						break;
 					}
--- a/dwt/widgets/Display.d	Thu Jan 10 07:34:05 2008 +0100
+++ b/dwt/widgets/Display.d	Thu Jan 10 08:18:45 2008 +0100
@@ -607,7 +607,7 @@
 }
 int /*long*/ allChildrenProc (GtkWidget* widget, int /*long*/ recurse) {
 	allChildren = OS.g_list_append (allChildren, widget);
-	if (recurse !is 0 && OS.GTK_IS_CONTAINER (widget)) {
+	if (recurse !is 0 && OS.GTK_IS_CONTAINER (cast(GTypeInstance*)widget)) {
         allChildrenProcCallbackData.display = this;
         allChildrenProcCallbackData.data = cast(void*)recurse;
 		OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData);
@@ -713,7 +713,7 @@
 	if (!OS.GDK_WINDOWING_X11 ()) {
 		OS.gdk_flush ();
 	} else {
-		GdkDisplay* xDisplay = OS.GDK_DISPLAY ();
+		void* xDisplay = OS.GDK_DISPLAY ();
 		OS.XFlush (xDisplay);
 	}
 }
@@ -1168,7 +1168,7 @@
 	Shell shell = null;
 	Control control = null;
 	auto grabHandle = OS.gtk_grab_get_current ();
-	if (grabHandle !is null && OS.GTK_IS_WINDOW (grabHandle) && OS.gtk_window_get_modal (cast(GtkWindow*)grabHandle)) {
+	if (grabHandle !is null && OS.GTK_IS_WINDOW (cast(GTypeInstance*)grabHandle) && OS.gtk_window_get_modal (cast(GtkWindow*)grabHandle)) {
 		switch (eventType) {
 			case OS.GDK_KEY_PRESS:
 			case OS.GDK_KEY_RELEASE:
@@ -3464,7 +3464,7 @@
 }
 static int /*long*/ setDirectionProc (GtkWidget* widget, int /*long*/ direction) {
 	OS.gtk_widget_set_direction (widget,  direction);
-	if (OS.GTK_IS_CONTAINER (widget)) {
+	if (OS.GTK_IS_CONTAINER (cast(GTypeInstance*)widget)) {
 		OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, cast(void*)direction);
 	}
 	return 0;
--- a/dwt/widgets/Shell.d	Thu Jan 10 07:34:05 2008 +0100
+++ b/dwt/widgets/Shell.d	Thu Jan 10 08:18:45 2008 +0100
@@ -1503,7 +1503,7 @@
 		* unminimized or shown on the desktop.
 		*/
 		OS.gtk_widget_show (shellHandle);
-		if (!OS.GTK_IS_PLUG (shellHandle)) {
+		if (!OS.GTK_IS_PLUG (cast(GTypeInstance*)shellHandle)) {
 			mapped = false;
 			if (isDisposed ()) return;
 			display.dispatchEvents = [