Bug 474116 - Clean up deprecated GTK symbols; r=(bsmedberg + roc) sr=roc
authorArpad Borsos <arpad.borsos@googlemail.com>
Mon, 02 Feb 2009 18:49:58 +0100
changeset 24530 ce7f39495675741049406268d707694fdadf2771
parent 24529 c56446e2e61dd4d83e52a191ebc51683e1422b15
child 24531 759e7042e2d1bb65cd6a45e88efbe51ff398f565
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs474116
milestone1.9.2a1pre
Bug 474116 - Clean up deprecated GTK symbols; r=(bsmedberg + roc) sr=roc
embedding/browser/gtk/src/EmbedPrompter.cpp
embedding/browser/gtk/src/EmbedPrompter.h
embedding/browser/gtk/src/gtkmozembed.h
embedding/browser/gtk/src/gtkmozembed2.cpp
embedding/browser/gtk/src/gtkmozembedmarshal.list
embedding/browser/gtk/tests/TestGtkEmbed.cpp
embedding/browser/gtk/tests/TestGtkEmbedChild.cpp
embedding/browser/gtk/tests/TestGtkEmbedNotebook.cpp
embedding/browser/gtk/tests/TestGtkEmbedSocket.cpp
gfx/src/thebes/nsSystemFontsGTK2.cpp
gfx/thebes/src/gfxPlatformGtk.cpp
modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
modules/plugin/base/src/nsNPAPIPlugin.cpp
modules/plugin/base/src/nsPluginNativeWindowGtk2.cpp
modules/plugin/default/unix/nullplugin.c
toolkit/xre/nsAppRunner.cpp
widget/src/gtk2/mozcontainer.c
widget/src/gtk2/mozcontainer.h
widget/src/gtk2/mozdrawingarea.c
widget/src/gtk2/mozdrawingarea.h
widget/src/gtk2/nsDragService.cpp
widget/src/gtk2/nsLookAndFeel.cpp
widget/src/gtk2/nsLookAndFeel.h
widget/src/gtk2/nsToolkit.cpp
widget/src/gtk2/nsWindow.cpp
widget/src/gtkxtbin/gtk2xtbin.c
widget/src/gtkxtbin/gtk2xtbin.h
--- a/embedding/browser/gtk/src/EmbedPrompter.cpp
+++ b/embedding/browser/gtk/src/EmbedPrompter.cpp
@@ -80,17 +80,17 @@ EmbedPrompter::EmbedPrompter(void)
       mItemCount(0),
       mButtonPressed(0),
       mConfirmResult(PR_FALSE),
       mSelectedItem(0),
       mWindow(NULL),
       mUserField(NULL),
       mPassField(NULL),
       mTextField(NULL),
-      mOptionMenu(NULL),
+      mComboBox(NULL),
       mCheckBox(NULL)
 {
 }
 
 EmbedPrompter::~EmbedPrompter(void)
 {
     if (mItemList)
         delete[] mItemList;
@@ -212,28 +212,22 @@ EmbedPrompter::Create(PromptType aType, 
         gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mCheckBox))),
 				TRUE);
 
         gtk_box_pack_start(GTK_BOX(contentsVBox), mCheckBox, FALSE, FALSE, 0);
     }
 
     // Add a dropdown menu
     if (aType == TYPE_SELECT) {
-        // Build up a GtkMenu containing the items
-        GtkWidget* menu = gtk_menu_new();
+        // Build up a GtkComboBox containing the items
+        GtkWidget* mComboBox = gtk_combo_box_new_text();
         for (PRUint32 i = 0; i < mItemCount; ++i) {
-            GtkWidget* item = gtk_menu_item_new_with_label(mItemList[i].get());
-            gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+            gtk_combo_box_append_text(GTK_COMBO_BOX(mComboBox), mItemList[i].get());
         }
-
-        // Now create an OptionMenu and set this as the menu
-        mOptionMenu = gtk_option_menu_new();
-
-        gtk_option_menu_set_menu(GTK_OPTION_MENU(mOptionMenu), menu);
-        gtk_box_pack_start(GTK_BOX(contentsVBox), mOptionMenu, FALSE, FALSE, 0);
+        gtk_box_pack_start(GTK_BOX(contentsVBox), mComboBox, FALSE, FALSE, 0);
     }
 
     if (aType == TYPE_UNIVERSAL) {
         // Create buttons based on the flags passed in.
         for (int i = EMBED_MAX_BUTTONS; i >= 0; --i) {
             if (!mButtonLabels[i].IsEmpty())
                 gtk_dialog_add_button(GTK_DIALOG(mWindow),
                                       mButtonLabels[i].get(), i);
@@ -398,11 +392,20 @@ EmbedPrompter::SaveDialogValues()
         mPass.Assign(gtk_entry_get_text(GTK_ENTRY(mPassField)));
 
     if (mCheckBox)
         mCheckValue = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mCheckBox));
 
     if (mTextField)
         mTextValue.Assign(gtk_entry_get_text(GTK_ENTRY(mTextField)));
 
-    if (mOptionMenu)
-        mSelectedItem = gtk_option_menu_get_history(GTK_OPTION_MENU(mOptionMenu));
+    if (mComboBox)
+    {
+        gchar *str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(mComboBox));
+        for (PRUint32 i = 0; i < mItemCount; ++i) {
+            if(mItemList[i].Equals(str))
+            {
+                mSelectedItem = i;
+                break;
+            }
+        }
+    }
 }
--- a/embedding/browser/gtk/src/EmbedPrompter.h
+++ b/embedding/browser/gtk/src/EmbedPrompter.h
@@ -103,11 +103,11 @@ private:
     PRInt32      mButtonPressed;
     PRBool       mConfirmResult;
     PRInt32      mSelectedItem;
 
     GtkWidget   *mWindow;
     GtkWidget   *mUserField;
     GtkWidget   *mPassField;
     GtkWidget   *mTextField;
-    GtkWidget   *mOptionMenu;
+    GtkWidget   *mComboBox;
     GtkWidget   *mCheckBox;
 };
--- a/embedding/browser/gtk/src/gtkmozembed.h
+++ b/embedding/browser/gtk/src/gtkmozembed.h
@@ -77,20 +77,20 @@ extern "C" {
 #define GTKMOZEMBED_API(type, name, params) NS_EXPORT_(type) name params;
 #else
 #define GTKMOZEMBED_API(type,name, params) NS_IMPORT_(type) name params;
 #endif
 
 #endif /* XPCOM_GLUE */
 
 #define GTK_TYPE_MOZ_EMBED             (gtk_moz_embed_get_type())
-#define GTK_MOZ_EMBED(obj)             GTK_CHECK_CAST((obj), GTK_TYPE_MOZ_EMBED, GtkMozEmbed)
-#define GTK_MOZ_EMBED_CLASS(klass)     GTK_CHECK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED, GtkMozEmbedClass)
-#define GTK_IS_MOZ_EMBED(obj)          GTK_CHECK_TYPE((obj), GTK_TYPE_MOZ_EMBED)
-#define GTK_IS_MOZ_EMBED_CLASS(klass)  GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
+#define GTK_MOZ_EMBED(obj)             G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_MOZ_EMBED, GtkMozEmbed)
+#define GTK_MOZ_EMBED_CLASS(klass)     G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED, GtkMozEmbedClass)
+#define GTK_IS_MOZ_EMBED(obj)          G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_MOZ_EMBED)
+#define GTK_IS_MOZ_EMBED_CLASS(klass)  G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
 
 typedef struct _GtkMozEmbed      GtkMozEmbed;
 typedef struct _GtkMozEmbedClass GtkMozEmbedClass;
 
 struct _GtkMozEmbed
 {
   GtkBin    bin;
   void     *data;
--- a/embedding/browser/gtk/src/gtkmozembed2.cpp
+++ b/embedding/browser/gtk/src/gtkmozembed2.cpp
@@ -141,17 +141,17 @@ gtk_moz_embed_class_init(GtkMozEmbedClas
   GtkContainerClass  *container_class;
   GtkWidgetClass     *widget_class;
   GtkObjectClass     *object_class;
 
   container_class = GTK_CONTAINER_CLASS(klass);
   widget_class    = GTK_WIDGET_CLASS(klass);
   object_class    = GTK_OBJECT_CLASS(klass);
 
-  embed_parent_class = (GtkBinClass *)gtk_type_class(gtk_bin_get_type());
+  embed_parent_class = (GtkBinClass *)g_type_class_peek(gtk_bin_get_type());
 
   widget_class->realize = gtk_moz_embed_realize;
   widget_class->unrealize = gtk_moz_embed_unrealize;
   widget_class->size_allocate = gtk_moz_embed_size_allocate;
   widget_class->map = gtk_moz_embed_map;
   widget_class->unmap = gtk_moz_embed_unmap;
 
 #ifdef MOZ_ACCESSIBILITY_ATK
@@ -163,49 +163,49 @@ gtk_moz_embed_class_init(GtkMozEmbedClas
   // set up our signals
 
   moz_embed_signals[LINK_MESSAGE] =
     g_signal_new("link_message",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, link_message),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[JS_STATUS] =
     g_signal_new("js_status",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, js_status),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[LOCATION] =
     g_signal_new("location",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, location),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[TITLE] =
     g_signal_new("title",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, title),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[PROGRESS] =
     g_signal_new("progress",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, progress),
                  NULL, NULL,
-                 gtk_marshal_NONE__INT_INT,
+                 gtkmozembed_VOID__INT_INT,
                  G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
   moz_embed_signals[PROGRESS_ALL] =
     g_signal_new("progress_all",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, progress_all),
                  NULL, NULL,
                  gtkmozembed_VOID__STRING_INT_INT,
@@ -231,179 +231,179 @@ gtk_moz_embed_class_init(GtkMozEmbedClas
                  G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
                  G_TYPE_INT, G_TYPE_UINT);
   moz_embed_signals[NET_START] =
     g_signal_new("net_start",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, net_start),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[NET_STOP] =
     g_signal_new("net_stop",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, net_stop),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[NEW_WINDOW] =
     g_signal_new("new_window",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, new_window),
                  NULL, NULL,
-                 gtk_marshal_NONE__POINTER_UINT,
+                 gtkmozembed_VOID__POINTER_UINT,
                  G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT);
   moz_embed_signals[VISIBILITY] =
     g_signal_new("visibility",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, visibility),
                  NULL, NULL,
-                 gtk_marshal_NONE__BOOL,
+                 g_cclosure_marshal_VOID__BOOLEAN,
                  G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
   moz_embed_signals[DESTROY_BROWSER] =
     g_signal_new("destroy_browser",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, destroy_brsr),
                  NULL, NULL,
-                 gtk_marshal_NONE__NONE,
+                 g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   moz_embed_signals[OPEN_URI] =
     g_signal_new("open_uri",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, open_uri),
                  NULL, NULL,
                  gtkmozembed_BOOL__STRING,
                  G_TYPE_BOOLEAN, 1, G_TYPE_STRING |
                  G_SIGNAL_TYPE_STATIC_SCOPE);
   moz_embed_signals[SIZE_TO] =
     g_signal_new("size_to",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, size_to),
                  NULL, NULL,
-                 gtk_marshal_NONE__INT_INT,
+                 gtkmozembed_VOID__INT_INT,
                  G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
   moz_embed_signals[DOM_KEY_DOWN] =
     g_signal_new("dom_key_down",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_key_down),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_KEY_PRESS] =
     g_signal_new("dom_key_press",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_key_press),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_KEY_UP] =
     g_signal_new("dom_key_up",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_key_up),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_DOWN] =
     g_signal_new("dom_mouse_down",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_down),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_UP] =
     g_signal_new("dom_mouse_up",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_up),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_CLICK] =
     g_signal_new("dom_mouse_click",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_click),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_DBL_CLICK] =
     g_signal_new("dom_mouse_dbl_click",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_dbl_click),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_OVER] =
     g_signal_new("dom_mouse_over",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_over),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_MOUSE_OUT] =
     g_signal_new("dom_mouse_out",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_mouse_out),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[SECURITY_CHANGE] =
     g_signal_new("security_change",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, security_change),
                  NULL, NULL,
-                 gtk_marshal_NONE__POINTER_UINT,
+                 gtkmozembed_VOID__POINTER_UINT,
                  G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT);
   moz_embed_signals[STATUS_CHANGE] =
     g_signal_new("status_change",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, status_change),
                  NULL, NULL,
                  gtkmozembed_VOID__POINTER_INT_POINTER,
                  G_TYPE_NONE, 3,
                  G_TYPE_POINTER, G_TYPE_INT, G_TYPE_POINTER);
   moz_embed_signals[DOM_ACTIVATE] =
     g_signal_new("dom_activate",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_activate),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_FOCUS_IN] =
     g_signal_new("dom_focus_in",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_focus_in),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
   moz_embed_signals[DOM_FOCUS_OUT] =
     g_signal_new("dom_focus_out",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET(GtkMozEmbedClass, dom_focus_out),
                  NULL, NULL,
-                 gtk_marshal_BOOL__POINTER,
+                 gtkmozembed_BOOL__POINTER,
                  G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
 }
 
 static void
 gtk_moz_embed_init(GtkMozEmbed *embed)
 {
   EmbedPrivate *priv = new EmbedPrivate();
   embed->data = priv;
@@ -496,22 +496,22 @@ gtk_moz_embed_realize(GtkWidget *widget)
 
   if (embedPrivate->mURI.Length())
     embedPrivate->LoadCurrentURI();
 
   // connect to the focus out event for the child
   GtkWidget *child_widget = GTK_BIN(widget)->child;
   g_signal_connect_object(G_OBJECT(child_widget),
                           "focus_out_event",
-                          GTK_SIGNAL_FUNC(handle_child_focus_out),
+                          G_CALLBACK(handle_child_focus_out),
                           embed,
                           G_CONNECT_AFTER);
   g_signal_connect_object(G_OBJECT(child_widget),
                           "focus_in_event",
-                          GTK_SIGNAL_FUNC(handle_child_focus_in),
+                          G_CALLBACK(handle_child_focus_in),
                           embed,
                           G_CONNECT_AFTER);
 }
 
 static void
 gtk_moz_embed_unrealize(GtkWidget *widget)
 {
   GtkMozEmbed  *embed;
@@ -1084,17 +1084,17 @@ gtk_moz_embed_single_class_init(GtkMozEm
   // set up our signals
 
   moz_embed_single_signals[NEW_WINDOW_ORPHAN] =
     g_signal_new("new_window_orphan",
                  G_TYPE_FROM_CLASS(klass),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET(GtkMozEmbedSingleClass, new_window_orphan),
                  NULL, NULL,
-                 gtk_marshal_NONE__POINTER_UINT,
+                 gtkmozembed_VOID__POINTER_UINT,
                  G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT);
 
 }
 
 static void
 gtk_moz_embed_single_init(GtkMozEmbedSingle *embed)
 {
   // this is a placeholder for later in case we need to stash data at
--- a/embedding/browser/gtk/src/gtkmozembedmarshal.list
+++ b/embedding/browser/gtk/src/gtkmozembedmarshal.list
@@ -6,26 +6,29 @@ BOOL:STRING,STRING,POINTER,POINTER,STRIN
 BOOL:STRING,STRING,POINTER,STRING,POINTER
 BOOL:STRING,STRING,STRING,POINTER
 INT:STRING,INT,INT,INT,INT,INT
 INT:STRING,STRING,INT,INT,INT,INT
 INT:STRING,STRING,UINT,STRING,STRING,STRING,STRING,POINTER
 INT:VOID
 STRING:STRING,STRING
 VOID:BOOL
+VOID:INT,INT
 VOID:INT,INT,BOOL
 VOID:INT,STRING
 VOID:INT,STRING,STRING
 VOID:INT,UINT
 VOID:POINTER,INT,POINTER
 VOID:POINTER,INT,STRING,STRING,STRING,STRING,STRING,BOOLEAN,INT
 VOID:POINTER,STRING,BOOL,BOOL
 VOID:STRING,INT,INT
 VOID:STRING,INT,UINT
 VOID:STRING,STRING
 VOID:STRING,STRING,POINTER
 VOID:STRING,STRING,STRING,ULONG,INT
 VOID:STRING,STRING,STRING,POINTER
 VOID:UINT,INT,INT,STRING,STRING,STRING,STRING
 VOID:ULONG,ULONG,ULONG
+VOID:POINTER,UINT
 BOOL:POINTER,UINT
+BOOL:POINTER
 VOID:POINTER
 BOOL:STRING,STRING,POINTER
--- a/embedding/browser/gtk/tests/TestGtkEmbed.cpp
+++ b/embedding/browser/gtk/tests/TestGtkEmbed.cpp
@@ -237,17 +237,17 @@ main(int argc, char **argv)
   
   full_path = g_strdup_printf("%s/%s", home_path, ".TestGtkEmbed");
   
   gtk_moz_embed_set_profile_path(full_path, "TestGtkEmbed");
 
   TestGtkBrowser *browser = new_gtk_browser(GTK_MOZ_EMBED_FLAG_DEFAULTCHROME);
 
   // set our minimum size
-  gtk_widget_set_usize(browser->mozEmbed, 400, 400);
+  gtk_widget_set_size_request(browser->mozEmbed, 400, 400);
 
   set_browser_visibility(browser, TRUE);
 
   if (argc > 1)
     gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser->mozEmbed), argv[1]);
 
   // get the singleton object and hook up to its new window callback
   // so we can create orphaned windows.
@@ -255,18 +255,18 @@ main(int argc, char **argv)
   GtkMozEmbedSingle *single;
 
   single = gtk_moz_embed_single_get();
   if (!single) {
     fprintf(stderr, "Failed to get singleton embed object!\n");
     exit(1);
   }
 
-  gtk_signal_connect(GTK_OBJECT(single), "new_window_orphan",
-		     GTK_SIGNAL_FUNC(new_window_orphan_cb), NULL);
+  g_signal_connect(GTK_OBJECT(single), "new_window_orphan",
+                   G_CALLBACK(new_window_orphan_cb), NULL);
 
   gtk_moz_embed_push_startup();
   gtk_main();
   gtk_moz_embed_pop_startup();
 }
 
 static TestGtkBrowser *
 new_gtk_browser(guint32 chromeMask)
@@ -323,41 +323,42 @@ new_gtk_browser(guint32 chromeMask)
   // create the file menu
   browser->fileMenuItem = gtk_menu_item_new_with_label("File");
   browser->fileMenu = gtk_menu_new();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM(browser->fileMenuItem),
 			     browser->fileMenu);
 
   browser->fileOpenNewBrowser = 
     gtk_menu_item_new_with_label("Open New Browser");
-  gtk_menu_append(GTK_MENU(browser->fileMenu),
-		  browser->fileOpenNewBrowser);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(browser->fileMenu),
+                        browser->fileOpenNewBrowser);
   
   browser->fileStream =
     gtk_menu_item_new_with_label("Test Stream");
-  gtk_menu_append(GTK_MENU(browser->fileMenu),
-		  browser->fileStream);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(browser->fileMenu),
+                        browser->fileStream);
 
   browser->fileMemory =
     gtk_menu_item_new_with_label("Release Memory");
-  gtk_menu_append(GTK_MENU(browser->fileMenu),
-		  browser->fileMemory);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(browser->fileMenu),
+                        browser->fileMemory);
 
   browser->fileClose =
     gtk_menu_item_new_with_label("Close");
-  gtk_menu_append(GTK_MENU(browser->fileMenu),
-		  browser->fileClose);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(browser->fileMenu),
+                        browser->fileClose);
 
   browser->fileQuit =
     gtk_menu_item_new_with_label("Quit");
-  gtk_menu_append(GTK_MENU(browser->fileMenu),
-		  browser->fileQuit);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(browser->fileMenu),
+                        browser->fileQuit);
   
   // append it
-  gtk_menu_bar_append(GTK_MENU_BAR(browser->menuBar), browser->fileMenuItem);
+  gtk_menu_shell_append((GtkMenuShell *)GTK_MENU_BAR(browser->menuBar),
+                        browser->fileMenuItem);
 
   // add it to the vbox
   gtk_box_pack_start(GTK_BOX(browser->topLevelVBox),
 		     browser->menuBar,
 		     FALSE, // expand
 		     FALSE, // fill
 		     0);    // padding
   // create the hbox that will contain the toolbar and the url text entry bar
@@ -382,44 +383,44 @@ new_gtk_browser(guint32 chromeMask)
 		   0);    // padding
   // new back button
   browser->backButton =
     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),
 			    "Back",
 			    "Go Back",
 			    "Go Back",
 			    0, // XXX replace with icon
-			    GTK_SIGNAL_FUNC(back_clicked_cb),
+			    G_CALLBACK(back_clicked_cb),
 			    browser);
   // new stop button
   browser->stopButton = 
     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),
 			    "Stop",
 			    "Stop",
 			    "Stop",
 			    0, // XXX replace with icon
-			    GTK_SIGNAL_FUNC(stop_clicked_cb),
+			    G_CALLBACK(stop_clicked_cb),
 			    browser);
   // new forward button
   browser->forwardButton =
     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),
 			    "Forward",
 			    "Forward",
 			    "Forward",
 			    0, // XXX replace with icon
-			    GTK_SIGNAL_FUNC(forward_clicked_cb),
+			    G_CALLBACK(forward_clicked_cb),
 			    browser);
   // new reload button
   browser->reloadButton = 
     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),
 			    "Reload",
 			    "Reload",
 			    "Reload",
 			    0, // XXX replace with icon
-			    GTK_SIGNAL_FUNC(reload_clicked_cb),
+			    G_CALLBACK(reload_clicked_cb),
 			    browser);
   // create the url text entry
   browser->urlEntry = gtk_entry_new();
   // add it to the hbox
   gtk_box_pack_start(GTK_BOX(browser->toolbarHBox), browser->urlEntry,
 		     TRUE, // expand
 		     TRUE, // fill
 		     0);    // padding
@@ -444,129 +445,129 @@ new_gtk_browser(guint32 chromeMask)
   gtk_box_pack_start(GTK_BOX(browser->progressAreaHBox), browser->progressBar,
 		     FALSE, // expand
 		     FALSE, // fill
 		     0); // padding
   
   // create our status area and the alignment object that will keep it
   // from expanding
   browser->statusAlign = gtk_alignment_new(0, 0, 1, 1);
-  gtk_widget_set_usize(browser->statusAlign, 1, -1);
+  gtk_widget_set_size_request(browser->statusAlign, 1, -1);
   // create the status bar
   browser->statusBar = gtk_statusbar_new();
   gtk_container_add(GTK_CONTAINER(browser->statusAlign), browser->statusBar);
   // add it to the hbox
   gtk_box_pack_start(GTK_BOX(browser->progressAreaHBox), browser->statusAlign,
 		     TRUE, // expand
 		     TRUE, // fill
 		     0);   // padding
   // by default none of the buttons are marked as sensitive.
   gtk_widget_set_sensitive(browser->backButton, FALSE);
   gtk_widget_set_sensitive(browser->stopButton, FALSE);
   gtk_widget_set_sensitive(browser->forwardButton, FALSE);
   gtk_widget_set_sensitive(browser->reloadButton, FALSE);
   
   // catch the destruction of the toplevel window
-  gtk_signal_connect(GTK_OBJECT(browser->topLevelWindow), "delete_event",
-		     GTK_SIGNAL_FUNC(delete_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->topLevelWindow), "delete_event",
+                   G_CALLBACK(delete_cb), browser);
 
   // hook up the activate signal to the right callback
-  gtk_signal_connect(GTK_OBJECT(browser->urlEntry), "activate",
-		     GTK_SIGNAL_FUNC(url_activate_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->urlEntry), "activate",
+                   G_CALLBACK(url_activate_cb), browser);
 
   // hook up to the open new browser activation
-  gtk_signal_connect(GTK_OBJECT(browser->fileOpenNewBrowser), "activate",
-		     GTK_SIGNAL_FUNC(menu_open_new_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->fileOpenNewBrowser), "activate",
+                   G_CALLBACK(menu_open_new_cb), browser);
   // hook up to the stream test
-  gtk_signal_connect(GTK_OBJECT(browser->fileStream), "activate",
-		     GTK_SIGNAL_FUNC(menu_stream_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->fileStream), "activate",
+                   G_CALLBACK(menu_stream_cb), browser);
   // hook up the memory pressure release function
-  gtk_signal_connect(GTK_OBJECT(browser->fileMemory), "activate",
-		     GTK_SIGNAL_FUNC(menu_memory_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->fileMemory), "activate",
+                   G_CALLBACK(menu_memory_cb), browser);
   // close this window
-  gtk_signal_connect(GTK_OBJECT(browser->fileClose), "activate",
-		     GTK_SIGNAL_FUNC(menu_close_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->fileClose), "activate",
+                   G_CALLBACK(menu_close_cb), browser);
   // quit the application
-  gtk_signal_connect(GTK_OBJECT(browser->fileQuit), "activate",
-		     GTK_SIGNAL_FUNC(menu_quit_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->fileQuit), "activate",
+                   G_CALLBACK(menu_quit_cb), browser);
 
   // hook up the location change to update the urlEntry
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "location",
-		     GTK_SIGNAL_FUNC(location_changed_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "location",
+                   G_CALLBACK(location_changed_cb), browser);
   // hook up the title change to update the window title
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "title",
-		     GTK_SIGNAL_FUNC(title_changed_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "title",
+                   G_CALLBACK(title_changed_cb), browser);
   // hook up the start and stop signals
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_start",
-		     GTK_SIGNAL_FUNC(load_started_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_stop",
-		     GTK_SIGNAL_FUNC(load_finished_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_start",
+                   G_CALLBACK(load_started_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_stop",
+                   G_CALLBACK(load_finished_cb), browser);
   // hook up to the change in network status
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state",
-		     GTK_SIGNAL_FUNC(net_state_change_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state_all",
-		     GTK_SIGNAL_FUNC(net_state_change_all_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state",
+                   G_CALLBACK(net_state_change_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state_all",
+                   G_CALLBACK(net_state_change_all_cb), browser);
   // hookup to changes in progress
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress",
-		     GTK_SIGNAL_FUNC(progress_change_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress_all",
-		     GTK_SIGNAL_FUNC(progress_change_all_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress",
+                   G_CALLBACK(progress_change_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress_all",
+                   G_CALLBACK(progress_change_all_cb), browser);
   // hookup to changes in over-link message
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "link_message",
-		     GTK_SIGNAL_FUNC(link_message_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "link_message",
+                   G_CALLBACK(link_message_cb), browser);
   // hookup to changes in js status message
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "js_status",
-		     GTK_SIGNAL_FUNC(js_status_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "js_status",
+                   G_CALLBACK(js_status_cb), browser);
   // hookup to see whenever a new window is requested
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "new_window",
-		     GTK_SIGNAL_FUNC(new_window_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "new_window",
+                   G_CALLBACK(new_window_cb), browser);
   // hookup to any requested visibility changes
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "visibility",
-		     GTK_SIGNAL_FUNC(visibility_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "visibility",
+                   G_CALLBACK(visibility_cb), browser);
   // hookup to the signal that says that the browser requested to be
   // destroyed
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy_browser",
-		     GTK_SIGNAL_FUNC(destroy_brsr_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy_browser",
+                   G_CALLBACK(destroy_brsr_cb), browser);
   // hookup to the signal that is called when someone clicks on a link
   // to load a new uri
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "open_uri",
-		     GTK_SIGNAL_FUNC(open_uri_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "open_uri",
+                   G_CALLBACK(open_uri_cb), browser);
   // this signal is emitted when there's a request to change the
   // containing browser window to a certain height, like with width
   // and height args for a window.open in javascript
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "size_to",
-		     GTK_SIGNAL_FUNC(size_to_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "size_to",
+                   G_CALLBACK(size_to_cb), browser);
   // key event signals
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_down",
-		     GTK_SIGNAL_FUNC(dom_key_down_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_press",
-		     GTK_SIGNAL_FUNC(dom_key_press_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_up",
-		     GTK_SIGNAL_FUNC(dom_key_up_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_down",
-		     GTK_SIGNAL_FUNC(dom_mouse_down_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_up",
-		     GTK_SIGNAL_FUNC(dom_mouse_up_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_click",
-		     GTK_SIGNAL_FUNC(dom_mouse_click_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_dbl_click",
-		     GTK_SIGNAL_FUNC(dom_mouse_dbl_click_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_over",
-		     GTK_SIGNAL_FUNC(dom_mouse_over_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_out",
-		     GTK_SIGNAL_FUNC(dom_mouse_out_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_activate",
-		     GTK_SIGNAL_FUNC(dom_activate_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_focus_in",
-		     GTK_SIGNAL_FUNC(dom_focus_in_cb), browser);
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_focus_out",
-		     GTK_SIGNAL_FUNC(dom_focus_out_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_down",
+                   G_CALLBACK(dom_key_down_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_press",
+                   G_CALLBACK(dom_key_press_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_up",
+                   G_CALLBACK(dom_key_up_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_down",
+                   G_CALLBACK(dom_mouse_down_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_up",
+                   G_CALLBACK(dom_mouse_up_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_click",
+                   G_CALLBACK(dom_mouse_click_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_dbl_click",
+                   G_CALLBACK(dom_mouse_dbl_click_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_over",
+                   G_CALLBACK(dom_mouse_over_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_out",
+                   G_CALLBACK(dom_mouse_out_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_activate",
+                   G_CALLBACK(dom_activate_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_focus_in",
+                   G_CALLBACK(dom_focus_in_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_focus_out",
+                   G_CALLBACK(dom_focus_out_cb), browser);
   // hookup to when the window is destroyed
-  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy",
-		     GTK_SIGNAL_FUNC(destroy_cb), browser);
+  g_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy",
+                   G_CALLBACK(destroy_cb), browser);
   
   // set the chrome type so it's stored in the object
   gtk_moz_embed_set_chrome_mask(GTK_MOZ_EMBED(browser->mozEmbed),
 				actualChromeMask);
 
   return browser;
 }
 
@@ -661,17 +662,17 @@ url_activate_cb    (GtkEditable *widget,
 }
 
 void
 menu_open_new_cb   (GtkMenuItem *menuitem, TestGtkBrowser *browser)
 {
   g_print("opening new browser.\n");
   TestGtkBrowser *newBrowser = 
     new_gtk_browser(GTK_MOZ_EMBED_FLAG_DEFAULTCHROME);
-  gtk_widget_set_usize(newBrowser->mozEmbed, 400, 400);
+  gtk_widget_set_size_request(newBrowser->mozEmbed, 400, 400);
   set_browser_visibility(newBrowser, TRUE);
 }
 
 void
 menu_stream_cb     (GtkMenuItem *menuitem, TestGtkBrowser *browser)
 {
   g_print("menu_stream_cb\n");
   const char *data;
@@ -749,19 +750,19 @@ destroy_cb         (GtkWidget *widget, T
 {
   GList *tmp_list;
   g_print("destroy_cb\n");
   num_browsers--;
   tmp_list = g_list_find(browser_list, browser);
   browser_list = g_list_remove_link(browser_list, tmp_list);
   if (browser->tempMessage)
     g_free(browser->tempMessage);
-  gtk_idle_add(idle_pop, NULL);
+  g_idle_add(idle_pop, NULL);
   if (num_browsers == 0)
-    gtk_idle_add (idle_quit, NULL);
+    g_idle_add (idle_quit, NULL);
 }
 
 void
 location_changed_cb (GtkMozEmbed *embed, TestGtkBrowser *browser)
 {
   char *newLocation;
   int   newPosition = 0;
   g_print("location_changed_cb\n");
@@ -814,17 +815,17 @@ load_finished_cb    (GtkMozEmbed *embed,
 {
   g_print("load_finished_cb\n");
   gtk_widget_set_sensitive(browser->stopButton, FALSE);
   gtk_widget_set_sensitive(browser->reloadButton, TRUE);
   browser->loadPercent = 0;
   browser->bytesLoaded = 0;
   browser->maxBytesLoaded = 0;
   update_status_bar_text(browser);
-  gtk_progress_set_percentage(GTK_PROGRESS(browser->progressBar), 0);
+  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(browser->progressBar), 0);
 }
 
 
 void
 net_state_change_cb (GtkMozEmbed *embed, gint flags, guint status,
 		     TestGtkBrowser *browser)
 {
   g_print("net_state_change_cb %d\n", flags);
@@ -867,32 +868,32 @@ void net_state_change_all_cb (GtkMozEmbe
 void progress_change_cb   (GtkMozEmbed *embed, gint cur, gint max,
 			   TestGtkBrowser *browser)
 {
   g_print("progress_change_cb cur %d max %d\n", cur, max);
 
   // avoid those pesky divide by zero errors
   if (max < 1)
   {
-    gtk_progress_set_activity_mode(GTK_PROGRESS(browser->progressBar), FALSE);
     browser->loadPercent = 0;
     browser->bytesLoaded = cur;
     browser->maxBytesLoaded = 0;
     update_status_bar_text(browser);
   }
   else
   {
     browser->bytesLoaded = cur;
     browser->maxBytesLoaded = max;
     if (cur > max)
       browser->loadPercent = 100;
     else
       browser->loadPercent = (cur * 100) / max;
     update_status_bar_text(browser);
-    gtk_progress_set_percentage(GTK_PROGRESS(browser->progressBar), browser->loadPercent / 100.0);
+    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(browser->progressBar),
+                                  browser->loadPercent / 100.0);
   }
   
 }
 
 void progress_change_all_cb (GtkMozEmbed *embed, const char *uri,
 			     gint cur, gint max,
 			     TestGtkBrowser *browser)
 {
@@ -928,17 +929,17 @@ js_status_cb (GtkMozEmbed *embed, TestGt
 }
 
 void
 new_window_cb (GtkMozEmbed *embed, GtkMozEmbed **newEmbed, guint chromemask, TestGtkBrowser *browser)
 {
   g_print("new_window_cb\n");
   g_print("embed is %p chromemask is %d\n", (void *)embed, chromemask);
   TestGtkBrowser *newBrowser = new_gtk_browser(chromemask);
-  gtk_widget_set_usize(newBrowser->mozEmbed, 400, 400);
+  gtk_widget_set_size_request(newBrowser->mozEmbed, 400, 400);
   *newEmbed = GTK_MOZ_EMBED(newBrowser->mozEmbed);
   g_print("new browser is %p\n", (void *)*newEmbed);
 }
 
 void
 visibility_cb (GtkMozEmbed *embed, gboolean visibility, TestGtkBrowser *browser)
 {
   g_print("visibility_cb %d\n", visibility);
@@ -964,17 +965,17 @@ open_uri_cb          (GtkMozEmbed *embed
   return FALSE;
 }
 
 void
 size_to_cb (GtkMozEmbed *embed, gint width, gint height,
 	    TestGtkBrowser *browser)
 {
   g_print("*** size_to_cb %d %d\n", width, height);
-  gtk_widget_set_usize(browser->mozEmbed, width, height);
+  gtk_widget_set_size_request(browser->mozEmbed, width, height);
 }
 
 gint dom_key_down_cb      (GtkMozEmbed *embed, nsIDOMKeyEvent *event,
 			   TestGtkBrowser *browser)
 {
   PRUint32 keyCode = 0;
   //  g_print("dom_key_down_cb\n");
   event->GetKeyCode(&keyCode);
--- a/embedding/browser/gtk/tests/TestGtkEmbedChild.cpp
+++ b/embedding/browser/gtk/tests/TestGtkEmbedChild.cpp
@@ -133,20 +133,20 @@ main(int argc, char **argv)
 
   if (xid == 0) {
     fprintf(stderr, "Invalid window id '%s'\n", argv[1]);
     exit(1);
   }
 
   window = gtk_plug_new(xid);
 
-  gtk_signal_connect(GTK_OBJECT(window), "destroy",
-		     GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
+  g_signal_connect(GTK_OBJECT(window), "destroy",
+                   G_CALLBACK(gtk_main_quit), NULL);
 
-  gtk_container_border_width(GTK_CONTAINER(window), 0);
+  gtk_container_set_border_width(GTK_CONTAINER(window), 0);
 
   vbox = gtk_vbox_new (FALSE, 0);
   gtk_container_add(GTK_CONTAINER(window), vbox);
   gtk_widget_show(vbox);
 
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
   gtk_widget_show (hbox);
@@ -154,22 +154,21 @@ main(int argc, char **argv)
   entry = gtk_entry_new ();
   gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
   gtk_widget_show (entry);
 
   button = gtk_button_new_with_label("Load");
   gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
   gtk_widget_show(button);
 
-  gtk_signal_connect(GTK_OBJECT(button), "clicked",
-		     GTK_SIGNAL_FUNC(load_page), NULL);
+  g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(load_page), NULL);
 
   embed = gtk_moz_embed_new();
   gtk_box_pack_start(GTK_BOX(vbox), embed, TRUE, TRUE, 0);
-  gtk_widget_set_usize(embed, 200, 200);
+  gtk_widget_set_size_request(embed, 200, 200);
   gtk_widget_show(embed);
 
   gtk_widget_show(window);
   
   gtk_main();
 
   fprintf(stderr, "exiting.\n");
 
--- a/embedding/browser/gtk/tests/TestGtkEmbedNotebook.cpp
+++ b/embedding/browser/gtk/tests/TestGtkEmbedNotebook.cpp
@@ -50,34 +50,34 @@ int main(int argc, char *argv[])
 	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 	
 	container = gtk_notebook_new();
 	mozembed = gtk_moz_embed_new();
 	label = gtk_label_new("Can you see this message?\n"
 			      "Once you switch to mozembed page " 
 			      "you never see this message.");
 
-	gtk_signal_connect(GTK_OBJECT(mozembed), "destroy",
-					 GTK_SIGNAL_FUNC(gtk_main_quit),
+	g_signal_connect(GTK_OBJECT(mozembed), "destroy",
+	                 G_CALLBACK(gtk_main_quit),
 NULL);
 
 	gtk_container_add(GTK_CONTAINER(window), container);
 
 	gtk_notebook_append_page(GTK_NOTEBOOK(container),
 			label,
 			gtk_label_new("gtk label"));
 
 	gtk_notebook_append_page(GTK_NOTEBOOK(container),
 			mozembed,
 			gtk_label_new("mozembed"));
 
 
 
 
-	gtk_widget_set_usize(window, 400, 300);
+	gtk_widget_set_size_request(window, 400, 300);
 	gtk_widget_show(mozembed);
 	gtk_widget_show(label);
 	gtk_widget_show_all(window);
 
 	url = (argc > 1) ? argv[1] : (char *)"localhost";
 	gtk_moz_embed_load_url(GTK_MOZ_EMBED(mozembed), url);
 
 	gtk_main();
--- a/embedding/browser/gtk/tests/TestGtkEmbedSocket.cpp
+++ b/embedding/browser/gtk/tests/TestGtkEmbedSocket.cpp
@@ -33,16 +33,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 GtkWidget *toplevel_window = 0;
 GtkWidget *button = 0;
 GtkWidget *vbox = 0;
 GtkWidget *gtk_socket = 0;
 
@@ -51,30 +52,30 @@ insert_mozilla(gpointer data);
 
 int
 main(int argc, char **argv)
 {
   gtk_init(&argc, &argv);
 
   toplevel_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
-  gtk_signal_connect(GTK_OBJECT(toplevel_window), "destroy",
-		     (GtkSignalFunc) gtk_exit, NULL);
+  g_signal_connect(GTK_OBJECT(toplevel_window), "destroy",
+                   G_CALLBACK(exit), NULL);
 
   vbox = gtk_vbox_new(FALSE, 0);
   gtk_container_add(GTK_CONTAINER(toplevel_window), vbox);
   gtk_widget_show(vbox);
 
   button = gtk_button_new_with_label("Insert Mozilla");
 
   gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
   gtk_widget_show(button);
 
-  gtk_signal_connect(GTK_OBJECT(button), "clicked",
-		     GTK_SIGNAL_FUNC(insert_mozilla), NULL);
+  g_signal_connect(GTK_OBJECT(button), "clicked",
+                   G_CALLBACK(insert_mozilla), NULL);
 
   gtk_widget_show(toplevel_window);
 
   gtk_main();
 
   return 0;
 }
 
--- a/gfx/src/thebes/nsSystemFontsGTK2.cpp
+++ b/gfx/src/thebes/nsSystemFontsGTK2.cpp
@@ -149,27 +149,27 @@ nsSystemFontsGTK2::nsSystemFontsGTK2()
     GetSystemFontInfo(entry, &mFieldFontName, &mFieldFontStyle);
 
     gtk_widget_destroy(window);  // no unref, windows are different
 
     // mMenuFont
     GtkWidget *accel_label = gtk_accel_label_new("M");
     GtkWidget *menuitem = gtk_menu_item_new();
     GtkWidget *menu = gtk_menu_new();
-    gtk_object_ref(GTK_OBJECT(menu));
-    gtk_object_sink(GTK_OBJECT(menu));
+    g_object_ref(GTK_OBJECT(menu));
+    g_object_ref_sink(GTK_OBJECT(menu));
 
     gtk_container_add(GTK_CONTAINER(menuitem), accel_label);
-    gtk_menu_append(GTK_MENU(menu), menuitem);
+    gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(menu), menuitem);
 
     gtk_widget_ensure_style(accel_label);
 
     GetSystemFontInfo(accel_label, &mMenuFontName, &mMenuFontStyle);
 
-    gtk_widget_unref(menu);
+    g_object_unref(menu);
 
     // mButtonFont
     parent = gtk_fixed_new();
     GtkWidget *button = gtk_button_new();
     label = gtk_label_new("M");
     window = gtk_window_new(GTK_WINDOW_POPUP);
           
     gtk_container_add(GTK_CONTAINER(button), label);
--- a/gfx/thebes/src/gfxPlatformGtk.cpp
+++ b/gfx/thebes/src/gfxPlatformGtk.cpp
@@ -697,17 +697,17 @@ gfxPlatformGtk::FindFontEntry(const nsAS
 
 void
 gfxPlatformGtk::SetGdkDrawable(gfxASurface *target,
                                GdkDrawable *drawable)
 {
     if (target->CairoStatus())
         return;
 
-    gdk_drawable_ref(drawable);
+    g_object_ref(drawable);
 
     cairo_surface_set_user_data (target->CairoSurface(),
                                  &cairo_gdk_drawable_key,
                                  drawable,
                                  do_gdk_drawable_unref);
 }
 
 #ifdef MOZ_X11
--- a/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
+++ b/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
@@ -434,26 +434,26 @@ nsIconChannel::InitWithGnome(nsIMozIconU
   }
 
   GdkPixbuf* scaled = buf;
   if (gdk_pixbuf_get_width(buf)  != iconSize &&
       gdk_pixbuf_get_height(buf) != iconSize) {
     // scale...
     scaled = gdk_pixbuf_scale_simple(buf, iconSize, iconSize,
                                      GDK_INTERP_BILINEAR);
-    gdk_pixbuf_unref(buf);
+    g_object_unref(buf);
     if (!scaled)
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // XXX Respect icon state
   
   rv = moz_gdk_pixbuf_to_channel(scaled, aIconURI,
                                  getter_AddRefs(mRealChannel));
-  gdk_pixbuf_unref(scaled);
+  g_object_unref(scaled);
   return rv;
 }
 #endif
 
 nsresult
 nsIconChannel::Init(nsIURI* aURI)
 {
   nsCOMPtr<nsIMozIconURI> iconURI = do_QueryInterface(aURI);
@@ -503,17 +503,17 @@ nsIconChannel::Init(nsIURI* aURI)
 #endif
 
   if (!icon)
     return NS_ERROR_NOT_AVAILABLE;
   
   nsresult rv = moz_gdk_pixbuf_to_channel(icon, iconURI,
                                           getter_AddRefs(mRealChannel));
 
-  gdk_pixbuf_unref(icon);
+  g_object_unref(icon);
 
   return rv;
 }
 
 void
 nsIconChannel::Shutdown() {
   if (gProtoWindow) {
     gtk_widget_destroy(gProtoWindow);
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -1892,17 +1892,17 @@ NPError NP_CALLBACK
         return NPERR_NO_ERROR;
       }
     }
     // adobe nppdf calls XtGetApplicationNameAndClass(display,
     // &instance, &class) we have to init Xt toolkit before get
     // XtDisplay just call gtk_xtbin_new(w,0) once
     static GtkWidget *gtkXtBinHolder = 0;
     if (!gtkXtBinHolder) {
-      gtkXtBinHolder = gtk_xtbin_new(GDK_ROOT_PARENT(),0);
+      gtkXtBinHolder = gtk_xtbin_new((GdkWindow*)GDK_ROOT_WINDOW(),0);
       // it crashes on destroy, let it leak
       // gtk_widget_destroy(gtkXtBinHolder);
     }
     (*(Display **)result) =  GTK_XTBIN(gtkXtBinHolder)->xtdisplay;
     return NPERR_NO_ERROR;
 #endif
     return NPERR_GENERIC_ERROR;
   }
--- a/modules/plugin/base/src/nsPluginNativeWindowGtk2.cpp
+++ b/modules/plugin/base/src/nsPluginNativeWindowGtk2.cpp
@@ -181,17 +181,17 @@ nsresult nsPluginNativeWindowGtk2::Creat
   // Make sure to handle the plug_removed signal.  If we don't the
   // socket will automatically be destroyed when the plug is
   // removed, which means we're destroying it more than once.
   // SYNTAX ERROR.
   g_signal_connect(mSocketWidget, "plug_removed",
                    G_CALLBACK(plug_removed_cb), NULL);
 
   g_signal_connect(mSocketWidget, "destroy",
-                   GTK_SIGNAL_FUNC(gtk_widget_destroyed), &mSocketWidget);
+                   G_CALLBACK(gtk_widget_destroyed), &mSocketWidget);
 
   gpointer user_data = NULL;
   gdk_window_get_user_data(parent_win, &user_data);
 
   GtkContainer *container = GTK_CONTAINER(user_data);
   gtk_container_add(container, mSocketWidget);
   gtk_widget_realize(mSocketWidget);
 
--- a/modules/plugin/default/unix/nullplugin.c
+++ b/modules/plugin/default/unix/nullplugin.c
@@ -81,20 +81,20 @@ destroyWidget(PluginInstance *This)
     }
 }
 
 /* callback function for the OK button */
 static void 
 DialogOKClicked (GtkButton *button, gpointer data)
 {
     PluginInstance* This = (PluginInstance*) data;
-    GtkWidget* dialogWindow = gtk_object_get_data(GTK_OBJECT(button), DIALOGID);
+    GtkWidget* dialogWindow = g_object_get_data(GTK_OBJECT(button), DIALOGID);
     char *url;
 
-    gtk_object_remove_data(GTK_OBJECT(button), DIALOGID);
+    g_object_set_data(GTK_OBJECT(button), DIALOGID, NULL);
 
     if (This->pluginsFileUrl != NULL)
     {
         /* Get the JavaScript command string */
         static const char buf[] = 
           "javascript:netscape.softupdate.Trigger.StartSoftwareUpdate(\"%s\")";
 
         url = NPN_MemAlloc(strlen(This->pluginsFileUrl) + (sizeof(buf) - 2));
@@ -144,17 +144,17 @@ DialogCancelClicked (GtkButton *button, 
 }
 
 /* function that closes the dialog if ESC is pressed */
 static gboolean
 DialogEscapePressed (GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
     if (event->keyval == GDK_Escape)
     {
-        gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
+        g_signal_stop_emission_by_name (GTK_OBJECT (widget), "key_press_event");
         gtk_object_destroy (GTK_OBJECT (widget));
         return TRUE;
     }
 
     return FALSE;
 }
 
 /* a handy procedure to add a widget and pack it as well */
@@ -288,44 +288,44 @@ makeWidget(PluginInstance *This)
     This->exists = TRUE;
     This->dialogBox = dialogWindow;
     addToList(&head, This);
     gtk_window_set_title(GTK_WINDOW(dialogWindow), PLUGIN_NAME);
     gtk_window_set_position(GTK_WINDOW(dialogWindow), GTK_WIN_POS_CENTER);
     gtk_window_set_modal(GTK_WINDOW(dialogWindow), FALSE);
     gtk_window_set_wmclass(GTK_WINDOW(dialogWindow), "Mozilla", "DefaultPlugin");
     gtk_container_set_border_width(GTK_CONTAINER(dialogWindow), 20);
-    gtk_window_set_policy(GTK_WINDOW(dialogWindow), FALSE, FALSE, TRUE);
+    gtk_window_set_resizable(GTK_WINDOW(dialogWindow), FALSE);
 
     PR_snprintf(message, sizeof(message) - 1, MESSAGE, This->type);
     dialogMessage = AddWidget(gtk_label_new (message), 
                    GTK_DIALOG(dialogWindow)->vbox);
 
     okButton= AddWidget(gtk_button_new_with_label (OK_BUTTON), 
                    GTK_DIALOG(dialogWindow)->action_area);
-    gtk_object_set_data(GTK_OBJECT(okButton), DIALOGID, dialogWindow);
+    g_object_set_data(GTK_OBJECT(okButton), DIALOGID, dialogWindow);
 
     GTK_WIDGET_SET_FLAGS (okButton, GTK_CAN_DEFAULT);
     gtk_widget_grab_default(okButton);
 
     cancelButton= AddWidget(gtk_button_new_with_label (CANCEL_BUTTON), 
                    GTK_DIALOG(dialogWindow)->action_area);
 
-    gtk_signal_connect (GTK_OBJECT(okButton),  "clicked",
-                        GTK_SIGNAL_FUNC(DialogOKClicked), This);
+    g_signal_connect (GTK_OBJECT(okButton),  "clicked",
+                      G_CALLBACK(DialogOKClicked), This);
 
-    gtk_signal_connect (GTK_OBJECT(cancelButton),  "clicked",
-                        GTK_SIGNAL_FUNC(DialogCancelClicked), This);
+    g_signal_connect (GTK_OBJECT(cancelButton),  "clicked",
+                      G_CALLBACK(DialogCancelClicked), This);
 
-    gtk_signal_connect(GTK_OBJECT(dialogWindow), "key_press_event",
-                        GTK_SIGNAL_FUNC (DialogEscapePressed), NULL);
+    g_signal_connect(GTK_OBJECT(dialogWindow), "key_press_event",
+                     G_CALLBACK(DialogEscapePressed), NULL);
 
     /* hookup to when the dialog is destroyed */
-    gtk_signal_connect(GTK_OBJECT(dialogWindow), "destroy",
-                        GTK_SIGNAL_FUNC(onDestroyWidget), This);
+    g_signal_connect(GTK_OBJECT(dialogWindow), "destroy",
+                     G_CALLBACK(onDestroyWidget), This);
 
     gtk_widget_show_all(dialogWindow);
 }
 
 /* XPM */
 static char * npnul320_xpm[] = {
 "32 32 6 1",
 "       c None",
@@ -423,17 +423,17 @@ createPixmap(PluginInstance *This)
 }
 
 static void
 drawPixmap(PluginInstance *This)
 {
     if (nullPluginGdkPixmap)
     {
         int pixmap_with, pixmap_height, dest_x, dest_y;
-        gdk_window_get_size((GdkWindow *)nullPluginGdkPixmap, &pixmap_with, &pixmap_height);
+        gdk_drawable_get_size((GdkWindow *)nullPluginGdkPixmap, &pixmap_with, &pixmap_height);
         dest_x = This->width/2 - pixmap_with/2;
         dest_y = This->height/2 - pixmap_height/2;
         if (dest_x >= 0 && dest_y >= 0)
         {
 #ifdef MOZ_X11
             GC gc;
             gc = XCreateGC(This->display, This->window, 0, NULL);
             XCopyArea(This->display, GDK_WINDOW_XWINDOW(nullPluginGdkPixmap) , This->window, gc,
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2889,18 +2889,17 @@ XRE_main(int argc, char* argv[], const n
       _g_set_application_name(gAppData->name);
     }
     _gtk_window_set_auto_startup_notification_fn _gtk_window_set_auto_startup_notification =
       (_gtk_window_set_auto_startup_notification_fn)FindFunction("gtk_window_set_auto_startup_notification");
     if (_gtk_window_set_auto_startup_notification) {
       _gtk_window_set_auto_startup_notification(PR_FALSE);
     }
 
-    gtk_widget_set_default_visual(gdk_rgb_get_visual());
-    gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
+    gtk_widget_set_default_colormap(gdk_rgb_get_colormap());
 #endif /* MOZ_WIDGET_GTK2 */
 
     // Call the code to install our handler
 #ifdef MOZ_JPROF
     setupProfilingStuff();
 #endif
 
     // Try to allocate "native app support."
--- a/widget/src/gtk2/mozcontainer.c
+++ b/widget/src/gtk2/mozcontainer.c
@@ -78,20 +78,20 @@ static void moz_container_allocate_child
                                           MozContainerChild *child);
 static MozContainerChild *
 moz_container_get_child (MozContainer *container, GtkWidget *child);
 
 static GtkContainerClass *parent_class = NULL;
 
 /* public methods */
 
-GtkType
+GType
 moz_container_get_type(void)
 {
-    static GtkType moz_container_type = 0;
+    static GType moz_container_type = 0;
 
     if (!moz_container_type) {
         static GTypeInfo moz_container_info = {
             sizeof(MozContainerClass), /* class_size */
             NULL, /* base_init */
             NULL, /* base_finalize */
             (GClassInitFunc) moz_container_class_init, /* class_init */
             NULL, /* class_destroy */
@@ -117,17 +117,17 @@ moz_container_get_type(void)
     return moz_container_type;
 }
 
 GtkWidget *
 moz_container_new (void)
 {
     MozContainer *container;
 
-    container = gtk_type_new (MOZ_CONTAINER_TYPE);
+    container = g_object_new (MOZ_CONTAINER_TYPE, NULL);
 
     return GTK_WIDGET(container);
 }
 
 void
 moz_container_put (MozContainer *container, GtkWidget *child_widget,
                    gint x, gint y)
 {
--- a/widget/src/gtk2/mozcontainer.h
+++ b/widget/src/gtk2/mozcontainer.h
@@ -41,37 +41,37 @@
 
 #include <gtk/gtk.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 #define MOZ_CONTAINER_TYPE            (moz_container_get_type())
-#define MOZ_CONTAINER(obj)            (GTK_CHECK_CAST ((obj), MOZ_CONTAINER_TYPE, MozContainer))
-#define MOZ_CONTAINER_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), MOZ_CONTAINER_TYPE, MozContainerClass))
-#define IS_MOZ_CONTAINER(obj)         (GTK_CHECK_TYPE ((obj), MOZ_CONTAINER_TYPE))
-#define IS_MOZ_CONTAINER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), MOZ_CONTAINER_TYPE))
-#define MOZ_CONAINTER_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), MOZ_CONTAINER_TYPE, MozContainerClass))
+#define MOZ_CONTAINER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOZ_CONTAINER_TYPE, MozContainer))
+#define MOZ_CONTAINER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MOZ_CONTAINER_TYPE, MozContainerClass))
+#define IS_MOZ_CONTAINER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOZ_CONTAINER_TYPE))
+#define IS_MOZ_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOZ_CONTAINER_TYPE))
+#define MOZ_CONAINTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), MOZ_CONTAINER_TYPE, MozContainerClass))
 
 typedef struct _MozContainer      MozContainer;
 typedef struct _MozContainerClass MozContainerClass;
 
 struct _MozContainer
 {
     GtkContainer   container;
     GList         *children;
 };
 
 struct _MozContainerClass
 {
     GtkContainerClass parent_class;
 };
 
-GtkType    moz_container_get_type (void);
+GType      moz_container_get_type (void);
 GtkWidget *moz_container_new      (void);
 void       moz_container_put      (MozContainer *container,
                                    GtkWidget    *child_widget,
                                    gint          x,
                                    gint          y);
 void       moz_container_move          (MozContainer *container,
                                         GtkWidget    *child_widget,
                                         gint          x,
--- a/widget/src/gtk2/mozdrawingarea.c
+++ b/widget/src/gtk2/mozdrawingarea.c
@@ -47,20 +47,20 @@ static void moz_drawingarea_create_windo
                                                  GdkWindow *parent,
                                                  GtkWidget *widget,
                                                  GdkVisual *visual);
 
 static void moz_drawingarea_finalize            (GObject *object);
 
 static GObjectClass *parent_class = NULL;
 
-GtkType
+GType
 moz_drawingarea_get_type(void)
 {
-    static GtkType moz_drawingarea_type = 0;
+    static GType moz_drawingarea_type = 0;
 
    if (!moz_drawingarea_type) {
        static GTypeInfo moz_drawingarea_info = {
            sizeof(MozDrawingareaClass), /* class size */
            NULL, /* base_init */
            NULL, /* base_finalize */
            (GClassInitFunc) moz_drawingarea_class_init, /* class_init */
            NULL, /* class_destroy */
--- a/widget/src/gtk2/mozdrawingarea.h
+++ b/widget/src/gtk2/mozdrawingarea.h
@@ -43,21 +43,21 @@
 #include <gtk/gtk.h>
 #include "mozcontainer.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 #define MOZ_DRAWINGAREA_TYPE            (moz_drawingarea_get_type())
-#define MOZ_DRAWINGAREA(obj)            (GTK_CHECK_CAST((obj), MOZ_DRAWINGAREA_TYPE, MozDrawingarea))
-#define MOZ_DRAWINGAREA_CLASS(klass)    (GTK_CHECK_CLASS_CAST((klass), MOZ_DRAWINGAREA_TYPE, MozDrawingareaClass))
-#define IS_MOZ_DRAWINGAREA(obj)         (GTK_CHECK_TYPE((obj), MOZ_DRAWINGAREA_TYPE))
-#define IS_MOZ_DRAWINGAREA_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), MOZ_DRAWINGAREA_TYPE))
-#define MOZ_DRAWINGAREA_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS((obj), MOZ_DRAWINGAREA_TYPE, MozDrawingareaClass))
+#define MOZ_DRAWINGAREA(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), MOZ_DRAWINGAREA_TYPE, MozDrawingarea))
+#define MOZ_DRAWINGAREA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), MOZ_DRAWINGAREA_TYPE, MozDrawingareaClass))
+#define IS_MOZ_DRAWINGAREA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), MOZ_DRAWINGAREA_TYPE))
+#define IS_MOZ_DRAWINGAREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MOZ_DRAWINGAREA_TYPE))
+#define MOZ_DRAWINGAREA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), MOZ_DRAWINGAREA_TYPE, MozDrawingareaClass))
 
 #if (GTK_CHECK_VERSION(2, 12, 0) || \
     (GTK_CHECK_VERSION(2, 10, 0) && defined(MOZ_PLATFORM_HILDON)))
 #define HAVE_GTK_MOTION_HINTS
 #endif
 
 typedef struct _MozDrawingarea      MozDrawingarea;
 typedef struct _MozDrawingareaClass MozDrawingareaClass;
@@ -70,17 +70,17 @@ struct _MozDrawingarea
     MozDrawingarea *parent;
 };
 
 struct _MozDrawingareaClass
 {
     GObjectClass parent_class;
 };
 
-GtkType         moz_drawingarea_get_type       (void);
+GType           moz_drawingarea_get_type       (void);
 MozDrawingarea *moz_drawingarea_new            (MozDrawingarea *parent,
                                                 MozContainer *widget_parent,
                                                 GdkVisual *visual);
 void            moz_drawingarea_reparent       (MozDrawingarea *drawingarea,
                                                 GdkWindow *aNewParent);
 void            moz_drawingarea_move           (MozDrawingarea *drawingarea,
                                                 gint x, gint y);
 void            moz_drawingarea_resize         (MozDrawingarea *drawingarea,
--- a/widget/src/gtk2/nsDragService.cpp
+++ b/widget/src/gtk2/nsDragService.cpp
@@ -101,20 +101,20 @@ nsDragService::nsDragService()
 
     // our hidden source widget
     mHiddenWidget = gtk_invisible_new();
     // make sure that the widget is realized so that
     // we can use it as a drag source.
     gtk_widget_realize(mHiddenWidget);
     // hook up our internal signals so that we can get some feedback
     // from our drag source
-    gtk_signal_connect(GTK_OBJECT(mHiddenWidget), "drag_data_get",
-                       GTK_SIGNAL_FUNC(invisibleSourceDragDataGet), this);
-    gtk_signal_connect(GTK_OBJECT(mHiddenWidget), "drag_end",
-                       GTK_SIGNAL_FUNC(invisibleSourceDragEnd), this);
+    g_signal_connect(GTK_OBJECT(mHiddenWidget), "drag_data_get",
+                     G_CALLBACK(invisibleSourceDragDataGet), this);
+    g_signal_connect(GTK_OBJECT(mHiddenWidget), "drag_end",
+                     G_CALLBACK(invisibleSourceDragEnd), this);
 
     // set up our logging module
     if (!sDragLm)
     sDragLm = PR_NewLogModule("nsDragService");
     PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::nsDragService"));
     mTargetWidget = 0;
     mTargetDragContext = 0;
     mTargetTime = 0;
@@ -287,17 +287,17 @@ nsDragService::SetAlphaPixmap(gfxASurfac
     // ...and paint the drag image with translucency
     xPixmapCtx->SetOperator(gfxContext::OPERATOR_SOURCE);
     xPixmapCtx->SetSource(aSurface);
     xPixmapCtx->Paint(DRAG_IMAGE_ALPHA_LEVEL);
 
     // The drag transaction addrefs the pixmap, so we can just unref it from us here
     gtk_drag_set_icon_pixmap(aContext, alphaColormap, pixmap, NULL,
                              aXOffset, aYOffset);
-    gdk_pixmap_unref(pixmap);
+    g_object_unref(pixmap);
     return PR_TRUE;
 }
 
 NS_IMETHODIMP
 nsDragService::StartDragSession()
 {
     PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::StartDragSession"));
     return nsBaseDragService::StartDragSession();
--- a/widget/src/gtk2/nsLookAndFeel.cpp
+++ b/widget/src/gtk2/nsLookAndFeel.cpp
@@ -77,18 +77,17 @@ nsLookAndFeel::nsLookAndFeel() : nsXPLoo
     if (!sInitialized) {
         sInitialized = PR_TRUE;
         InitLookAndFeel();
     }
 }
 
 nsLookAndFeel::~nsLookAndFeel()
 {
-    //  gtk_widget_destroy(mWidget);
-    gtk_widget_unref(mWidget);
+    g_object_unref(mWidget);
 }
 
 nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor)
 {
     nsresult res = NS_OK;
 
     switch (aID) {
         // These colors don't seem to be used for anything anymore in Mozilla
@@ -408,22 +407,22 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(c
         // XXXldb Why is this commented out?
         //    aMetric = 4;
         break;
     case eMetric_TextFieldHeight:
         {
             GtkRequisition req;
             GtkWidget *text = gtk_entry_new();
             // needed to avoid memory leak
-            gtk_widget_ref(text);
-            gtk_object_sink(GTK_OBJECT(text));
+            g_object_ref(text);
+            g_object_ref_sink(GTK_OBJECT(text));
             gtk_widget_size_request(text,&req);
             aMetric = req.height;
             gtk_widget_destroy(text);
-            gtk_widget_unref(text);
+            g_object_unref(text);
         }
         break;
     case eMetric_TextFieldBorder:
         aMetric = 2;
         break;
     case eMetric_TextVerticalInsidePadding:
         aMetric = 0;
         break;
@@ -486,31 +485,31 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(c
         break;
     case eMetric_SelectTextfieldsOnKeyFocus:
         {
             GtkWidget *entry;
             GtkSettings *settings;
             gboolean select_on_focus;
 
             entry = gtk_entry_new();
-            gtk_widget_ref(entry);
-            gtk_object_sink(GTK_OBJECT(entry));
+            g_object_ref(entry);
+            g_object_ref_sink(GTK_OBJECT(entry));
             settings = gtk_widget_get_settings(entry);
             g_object_get(settings, 
                          "gtk-entry-select-on-focus",
                          &select_on_focus,
                          NULL);
             
             if(select_on_focus)
                 aMetric = 1;
             else
                 aMetric = 0;
 
             gtk_widget_destroy(entry);
-            gtk_widget_unref(entry);
+            g_object_unref(entry);
         }
         break;
     case eMetric_SubmenuDelay:
         {
             GtkSettings *settings;
             gint delay;
 
             settings = gtk_settings_get_default ();
@@ -531,17 +530,17 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(c
     case eMetric_DragThresholdX:
     case eMetric_DragThresholdY:
         {
             GtkWidget* box = gtk_hbox_new(FALSE, 5);
             gint threshold = 0;
             g_object_get(gtk_widget_get_settings(box),
                          "gtk-dnd-drag-threshold", &threshold,
                          NULL);
-            gtk_object_sink(GTK_OBJECT(box));
+            g_object_ref_sink(GTK_OBJECT(box));
             aMetric = threshold;
         }
         break;
     case eMetric_ScrollArrowStyle:
         aMetric =
             ConvertGTKStepperStyleToMozillaScrollArrowStyle(moz_gtk_get_scrollbar_widget());
         break;
     case eMetric_ScrollSliderStyle:
@@ -651,24 +650,24 @@ nsLookAndFeel::InitLookAndFeel()
         sInfoBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
         sInfoText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
     }
 
     // menu foreground & menu background
     GtkWidget *accel_label = gtk_accel_label_new("M");
     GtkWidget *menuitem = gtk_menu_item_new();
     GtkWidget *menu = gtk_menu_new();
-    gtk_object_ref(GTK_OBJECT(menu));
-    gtk_object_sink(GTK_OBJECT(menu));
+    g_object_ref(GTK_OBJECT(menu));
+    g_object_ref_sink(GTK_OBJECT(menu));
 
     gtk_container_add(GTK_CONTAINER(menuitem), accel_label);
-    gtk_menu_append(GTK_MENU(menu), menuitem);
+    gtk_menu_shell_append((GtkMenuShell *)GTK_MENU(menu), menuitem);
 
-    gtk_widget_set_rc_style(accel_label);
-    gtk_widget_set_rc_style(menu);
+    gtk_widget_set_style(accel_label, NULL);
+    gtk_widget_set_style(menu, NULL);
     gtk_widget_realize(menu);
     gtk_widget_realize(accel_label);
 
     style = gtk_widget_get_style(accel_label);
     if (style) {
         sMenuText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
     }
 
@@ -678,17 +677,17 @@ nsLookAndFeel::InitLookAndFeel()
     }
     
     style = gtk_widget_get_style(menuitem);
     if (style) {
         sMenuHover = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_PRELIGHT]);
         sMenuHoverText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_PRELIGHT]);
     }
 
-    gtk_widget_unref(menu);
+    g_object_unref(menu);
 
 
     // button styles
     GtkWidget *parent = gtk_fixed_new();
     GtkWidget *button = gtk_button_new();
     GtkWidget *label = gtk_label_new("M");
     GtkWidget *combobox = gtk_combo_box_new();
     GtkWidget *comboboxLabel = gtk_label_new("M");
@@ -699,22 +698,22 @@ nsLookAndFeel::InitLookAndFeel()
     gtk_container_add(GTK_CONTAINER(button), label);
     gtk_container_add(GTK_CONTAINER(combobox), comboboxLabel);
     gtk_container_add(GTK_CONTAINER(parent), button);
     gtk_container_add(GTK_CONTAINER(parent), treeView);
     gtk_container_add(GTK_CONTAINER(parent), linkButton);
     gtk_container_add(GTK_CONTAINER(parent), combobox);
     gtk_container_add(GTK_CONTAINER(window), parent);
 
-    gtk_widget_set_rc_style(button);
-    gtk_widget_set_rc_style(label);
-    gtk_widget_set_rc_style(treeView);
-    gtk_widget_set_rc_style(linkButton);
-    gtk_widget_set_rc_style(combobox);
-    gtk_widget_set_rc_style(comboboxLabel);
+    gtk_widget_set_style(button, NULL);
+    gtk_widget_set_style(label, NULL);
+    gtk_widget_set_style(treeView, NULL);
+    gtk_widget_set_style(linkButton, NULL);
+    gtk_widget_set_style(combobox, NULL);
+    gtk_widget_set_style(comboboxLabel, NULL);
 
     gtk_widget_realize(button);
     gtk_widget_realize(label);
     gtk_widget_realize(treeView);
     gtk_widget_realize(linkButton);
     gtk_widget_realize(combobox);
     gtk_widget_realize(comboboxLabel);
 
@@ -803,15 +802,15 @@ nsLookAndFeel::GetPasswordCharacter()
 }
 
 NS_IMETHODIMP
 nsLookAndFeel::LookAndFeelChanged()
 {
     nsXPLookAndFeel::LookAndFeelChanged();
 
     if (mWidget)
-        gtk_widget_unref(mWidget);
+        g_object_unref(mWidget);
  
     InitWidget();
     InitLookAndFeel();
 
     return NS_OK;
 }
--- a/widget/src/gtk2/nsLookAndFeel.h
+++ b/widget/src/gtk2/nsLookAndFeel.h
@@ -76,16 +76,16 @@ protected:
     static nscolor sComboBoxText;
     static nscolor sComboBoxBackground;
     static PRUnichar sInvisibleCharacter;
     static float   sCaretRatio;
 
     static void InitLookAndFeel();
     void InitWidget() {
         mWidget = gtk_invisible_new();
-        gtk_object_ref(GTK_OBJECT(mWidget));
-        gtk_object_sink(GTK_OBJECT(mWidget));
+        g_object_ref(GTK_OBJECT(mWidget));
+        g_object_ref_sink(GTK_OBJECT(mWidget));
         gtk_widget_ensure_style(mWidget);
         mStyle = gtk_widget_get_style(mWidget);
     }
 };
 
 #endif
--- a/widget/src/gtk2/nsToolkit.cpp
+++ b/widget/src/gtk2/nsToolkit.cpp
@@ -61,17 +61,17 @@ nsGTKToolkit::nsGTKToolkit()
 //-------------------------------------------------------------------------
 //
 // destructor
 //
 //-------------------------------------------------------------------------
 nsGTKToolkit::~nsGTKToolkit()
 {
     if (mSharedGC) {
-        gdk_gc_unref(mSharedGC);
+        g_object_unref(mSharedGC);
     }
 
     // Remove the TLS reference to the toolkit...
     PR_SetThreadPrivate(gToolkitTLSIndex, nsnull);
 }
 
 //-------------------------------------------------------------------------
 //
@@ -85,22 +85,22 @@ void nsGTKToolkit::CreateSharedGC(void)
 {
     GdkPixmap *pixmap;
 
     if (mSharedGC)
         return;
 
     pixmap = gdk_pixmap_new(NULL, 1, 1, gdk_rgb_get_visual()->depth);
     mSharedGC = gdk_gc_new(pixmap);
-    gdk_pixmap_unref(pixmap);
+    g_object_unref(pixmap);
 }
 
 GdkGC *nsGTKToolkit::GetSharedGC(void)
 {
-    return gdk_gc_ref(mSharedGC);
+    return (GdkGC *)g_object_ref(mSharedGC);
 }
 
 //-------------------------------------------------------------------------
 //
 //
 //-------------------------------------------------------------------------
 NS_IMETHODIMP nsGTKToolkit::Init(PRThread *aThread)
 {
--- a/widget/src/gtk2/nsWindow.cpp
+++ b/widget/src/gtk2/nsWindow.cpp
@@ -704,17 +704,17 @@ nsWindow::Destroy(void)
         mWindowGroup = nsnull;
     }
 
     // Destroy thebes surface now. Badness can happen if we destroy
     // the surface after its X Window.
     mThebesSurface = nsnull;
 
     if (mDragMotionTimerID) {
-        gtk_timeout_remove(mDragMotionTimerID);
+        g_source_remove(mDragMotionTimerID);
         mDragMotionTimerID = 0;
     }
 
     if (mDrawingarea) {
         g_object_set_data(G_OBJECT(mDrawingarea->clip_window),
                           "nsWindow", NULL);
         g_object_set_data(G_OBJECT(mDrawingarea->inner_window),
                           "nsWindow", NULL);
@@ -1499,56 +1499,56 @@ nsWindow::SetCursor(imgIContainer* aCurs
 
     int width = gdk_pixbuf_get_width(pixbuf);
     int height = gdk_pixbuf_get_height(pixbuf);
     // Reject cursors greater than 128 pixels in some direction, to prevent
     // spoofing.
     // XXX ideally we should rescale. Also, we could modify the API to
     // allow trusted content to set larger cursors.
     if (width > 128 || height > 128) {
-        gdk_pixbuf_unref(pixbuf);
+        g_object_unref(pixbuf);
         return NS_ERROR_NOT_AVAILABLE;
     }
 
     // Looks like all cursors need an alpha channel (tested on Gtk 2.4.4). This
     // is of course not documented anywhere...
     // So add one if there isn't one yet
     if (!gdk_pixbuf_get_has_alpha(pixbuf)) {
         GdkPixbuf* alphaBuf = gdk_pixbuf_add_alpha(pixbuf, FALSE, 0, 0, 0);
-        gdk_pixbuf_unref(pixbuf);
+        g_object_unref(pixbuf);
         if (!alphaBuf) {
             return NS_ERROR_OUT_OF_MEMORY;
         }
         pixbuf = alphaBuf;
     }
 
     GdkCursor* cursor;
     if (!_gdk_cursor_new_from_pixbuf || !_gdk_display_get_default) {
         // Fallback to a monochrome cursor
         GdkPixmap* mask = gdk_pixmap_new(NULL, width, height, 1);
         if (!mask) {
-            gdk_pixbuf_unref(pixbuf);
+            g_object_unref(pixbuf);
             return NS_ERROR_OUT_OF_MEMORY;
         }
 
         PRUint8* data = Data32BitTo1Bit(gdk_pixbuf_get_pixels(pixbuf),
                                         gdk_pixbuf_get_rowstride(pixbuf),
                                         width, height);
         if (!data) {
             g_object_unref(mask);
-            gdk_pixbuf_unref(pixbuf);
+            g_object_unref(pixbuf);
             return NS_ERROR_OUT_OF_MEMORY;
         }
 
         GdkPixmap* image = gdk_bitmap_create_from_data(NULL, (const gchar*)data, width,
                                                        height);
         delete[] data;
         if (!image) {
             g_object_unref(mask);
-            gdk_pixbuf_unref(pixbuf);
+            g_object_unref(pixbuf);
             return NS_ERROR_OUT_OF_MEMORY;
         }
 
         gdk_pixbuf_render_threshold_alpha(pixbuf, mask, 0, 0, 0, 0, width,
                                           height, 1);
 
         GdkColor fg = { 0, 0, 0, 0 }; // Black
         GdkColor bg = { 0, 0xFFFF, 0xFFFF, 0xFFFF }; // White
@@ -1558,17 +1558,17 @@ nsWindow::SetCursor(imgIContainer* aCurs
         g_object_unref(image);
         g_object_unref(mask);
     } else {
         // Now create the cursor
         cursor = _gdk_cursor_new_from_pixbuf(_gdk_display_get_default(),
                                              pixbuf,
                                              aHotspotX, aHotspotY);
     }
-    gdk_pixbuf_unref(pixbuf);
+    g_object_unref(pixbuf);
     nsresult rv = NS_ERROR_OUT_OF_MEMORY;
     if (cursor) {
         if (mContainer) {
             gdk_window_set_cursor(GTK_WIDGET(mContainer)->window, cursor);
             rv = NS_OK;
         }
         gdk_cursor_unref(cursor);
     }
@@ -4447,17 +4447,17 @@ nsWindow::ApplyTransparencyBitmap()
     gtk_widget_reset_shapes(mShell);
     GdkBitmap* maskBitmap = gdk_bitmap_create_from_data(mShell->window,
             mTransparencyBitmap,
             mTransparencyBitmapWidth, mTransparencyBitmapHeight);
     if (!maskBitmap)
         return;
 
     gtk_widget_shape_combine_mask(mShell, maskBitmap, 0, 0);
-    gdk_bitmap_unref(maskBitmap);
+    g_object_unref(maskBitmap);
 }
 
 nsresult
 nsWindow::UpdateTranslucentWindowAlphaInternal(const nsIntRect& aRect,
                                                PRUint8* aAlphas, PRInt32 aStride)
 {
     if (!mShell) {
         // Pass the request to the toplevel window
@@ -5006,17 +5006,17 @@ is_mouse_in_window (GdkWindow* aWindow, 
             break;
         }
 
         offsetX += tmpX;
         offsetY += tmpY;
         window = gdk_window_get_parent(window);
     }
 
-    gdk_window_get_size(aWindow, &w, &h);
+    gdk_drawable_get_size(aWindow, &w, &h);
 
     if (aMouseX > x && aMouseX < x + w &&
         aMouseY > y && aMouseY < y + h)
         return PR_TRUE;
 
     return PR_FALSE;
 }
 
@@ -5211,26 +5211,26 @@ get_gtk_cursor(nsCursor aCursor)
         if (!cursor)
             return NULL;
 
         mask =
             gdk_bitmap_create_from_data(NULL,
                                         (char *)GtkCursors[newType].mask_bits,
                                         32, 32);
         if (!mask) {
-            gdk_bitmap_unref(cursor);
+            g_object_unref(cursor);
             return NULL;
         }
 
         gdkcursor = gdk_cursor_new_from_pixmap(cursor, mask, &fg, &bg,
                                                GtkCursors[newType].hot_x,
                                                GtkCursors[newType].hot_y);
 
-        gdk_bitmap_unref(mask);
-        gdk_bitmap_unref(cursor);
+        g_object_unref(mask);
+        g_object_unref(cursor);
     }
 
     gCursorCache[aCursor] = gdkcursor;
 
     return gdkcursor;
 }
 
 // gtk callbacks
@@ -5785,48 +5785,48 @@ nsWindow::ResetDragMotionTimer(GtkWidget
                                GdkDragContext *aDragContext,
                                gint aX, gint aY, guint aTime)
 {
 
     // We have to be careful about ref ordering here.  if aWidget ==
     // mDraMotionWidget be careful not to let the refcnt drop to zero.
     // Same with the drag context.
     if (aWidget)
-        gtk_widget_ref(aWidget);
+        g_object_ref(aWidget);
     if (mDragMotionWidget)
-        gtk_widget_unref(mDragMotionWidget);
+        g_object_unref(mDragMotionWidget);
     mDragMotionWidget = aWidget;
 
     if (aDragContext)
-        gdk_drag_context_ref(aDragContext);
+        g_object_ref(aDragContext);
     if (mDragMotionContext)
-        gdk_drag_context_unref(mDragMotionContext);
+        g_object_unref(mDragMotionContext);
     mDragMotionContext = aDragContext;
 
     mDragMotionX = aX;
     mDragMotionY = aY;
     mDragMotionTime = aTime;
 
     // always clear the timer
     if (mDragMotionTimerID) {
-        gtk_timeout_remove(mDragMotionTimerID);
+        g_source_remove(mDragMotionTimerID);
         mDragMotionTimerID = 0;
         LOG(("*** canceled motion timer\n"));
     }
 
     // if no widget was passed in, just return instead of setting a new
     // timer
     if (!aWidget) {
         return;
     }
 
     // otherwise we create a new timer
-    mDragMotionTimerID = gtk_timeout_add(100,
-                                         (GtkFunction)DragMotionTimerCallback,
-                                         this);
+    mDragMotionTimerID = g_timeout_add(100,
+                                       (GtkFunction)DragMotionTimerCallback,
+                                       this);
 }
 
 void
 nsWindow::FireDragMotionTimer(void)
 {
     LOG(("nsWindow::FireDragMotionTimer(%p)\n", this));
 
     OnDragMotionEvent(mDragMotionWidget, mDragMotionContext,
--- a/widget/src/gtkxtbin/gtk2xtbin.c
+++ b/widget/src/gtkxtbin/gtk2xtbin.c
@@ -205,45 +205,48 @@ xt_event_polling_timer_callback(gpointer
      up to 20 Xt events right now and save the rest for later. This is a hack,
      but it oughta work. We *really* should have out of process plugins.
   */
   while (eventsToProcess-- && XtAppPending(ac))
     XtAppProcessEvent(ac, XtIMAll);
   return TRUE;
 }
 
-GtkType
+GType
 gtk_xtbin_get_type (void)
 {
-  static GtkType xtbin_type = 0;
+  static GType xtbin_type = 0;
 
   if (!xtbin_type) {
-      static const GtkTypeInfo xtbin_info =
+      static const GTypeInfo xtbin_info =
       {
-        "GtkXtBin",
-        sizeof (GtkXtBin),
-        sizeof (GtkXtBinClass),
-        (GtkClassInitFunc) gtk_xtbin_class_init,
-        (GtkObjectInitFunc) gtk_xtbin_init,
-        /* reserved_1 */ NULL,
-        /* reserved_2 */ NULL,
-        (GtkClassInitFunc) NULL
+        sizeof (GtkXtBinClass), /* class_size */
+        NULL, /* base_init */
+        NULL, /* base_finalize */
+        (GClassInitFunc) gtk_xtbin_class_init, /* class_init */
+        NULL, /* class_finalize */
+        NULL, /* class_data */
+        sizeof (GtkXtBin), /* instance_size */
+        0, /* n_preallocs */
+        (GInstanceInitFunc) gtk_xtbin_init, /* instance_init */
+        NULL /* value_table */
       };
-      xtbin_type = gtk_type_unique (GTK_TYPE_SOCKET, &xtbin_info);
+      xtbin_type = g_type_register_static(GTK_TYPE_SOCKET, "GtkXtBin",
+        &xtbin_info, 0);
     }
   return xtbin_type;
 }
 
 static void
 gtk_xtbin_class_init (GtkXtBinClass *klass)
 {
   GtkWidgetClass *widget_class;
   GtkObjectClass *object_class;
 
-  parent_class = gtk_type_class (GTK_TYPE_SOCKET);
+  parent_class = g_type_class_ref (GTK_TYPE_SOCKET);
 
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class->realize = gtk_xtbin_realize;
   widget_class->unrealize = gtk_xtbin_unrealize;
 
   object_class = GTK_OBJECT_CLASS (klass);
   object_class->destroy = gtk_xtbin_destroy;
 }
@@ -306,17 +309,17 @@ gtk_xtbin_realize (GtkWidget *widget)
 
 GtkWidget*
 gtk_xtbin_new (GdkWindow *parent_window, String * f)
 {
   GtkXtBin *xtbin;
   gpointer user_data;
 
   assert(parent_window != NULL);
-  xtbin = gtk_type_new (GTK_TYPE_XTBIN);
+  xtbin = g_object_new (GTK_TYPE_XTBIN, NULL);
 
   if (!xtbin)
     return (GtkWidget*)NULL;
 
   if (f)
     fallback = f;
 
   /* Initialize the Xt toolkit */
@@ -364,19 +367,19 @@ gtk_xtbin_new (GdkWindow *parent_window,
     xt_event_poll_fd.events = G_IO_IN; 
     xt_event_poll_fd.revents = 0;    /* hmm... is this correct? */
 
     g_main_context_add_poll ((GMainContext*)NULL, 
                              &xt_event_poll_fd, 
                              G_PRIORITY_LOW);
     /* add a timer so that we can poll and process Xt timers */
     xt_polling_timer_id =
-      gtk_timeout_add(25,
-                      (GtkFunction)xt_event_polling_timer_callback,
-                      xtdisplay);
+      g_timeout_add(25,
+                    (GtkFunction)xt_event_polling_timer_callback,
+                    xtdisplay);
   }
 
   /* Bump up our usage count */
   num_widgets++;
 
   /* Build the hierachy */
   xtbin->xtdisplay = xtbin->xtclient.xtdisplay;
   gtk_widget_set_parent_window(GTK_WIDGET(xtbin), parent_window);
@@ -482,17 +485,17 @@ gtk_xtbin_destroy (GtkObject *object)
        connection from the mainloop */
     if (0 == num_widgets) {
 #ifdef DEBUG_XTBIN
       printf("removing the Xt connection from the main loop\n");
 #endif
       g_main_context_remove_poll((GMainContext*)NULL, &xt_event_poll_fd);
       g_source_remove(tag);
 
-      gtk_timeout_remove(xt_polling_timer_id);
+      g_source_remove(xt_polling_timer_id);
       xt_polling_timer_id = 0;
     }
   }
 
   GTK_OBJECT_CLASS(parent_class)->destroy(object);
 }
 
 /*
--- a/widget/src/gtkxtbin/gtk2xtbin.h
+++ b/widget/src/gtkxtbin/gtk2xtbin.h
@@ -58,23 +58,23 @@
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 typedef struct _GtkXtBin GtkXtBin;
 typedef struct _GtkXtBinClass GtkXtBinClass;
 
 #define GTK_TYPE_XTBIN                  (gtk_xtbin_get_type ())
-#define GTK_XTBIN(obj)                  (GTK_CHECK_CAST ((obj), \
+#define GTK_XTBIN(obj)                  (G_TYPE_CHECK_INSTANCE_CAST  ((obj), \
                                          GTK_TYPE_XTBIN, GtkXtBin))
-#define GTK_XTBIN_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), \
+#define GTK_XTBIN_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), \
                                          GTK_TYPE_XTBIN, GtkXtBinClass))
-#define GTK_IS_XTBIN(obj)               (GTK_CHECK_TYPE ((obj), \
+#define GTK_IS_XTBIN(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
                                          GTK_TYPE_XTBIN))
-#define GTK_IS_XTBIN_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), \
+#define GTK_IS_XTBIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), \
                                          GTK_TYPE_XTBIN))
 typedef struct _XtClient XtClient;
 
 struct _XtClient {
   Display	*xtdisplay;
   Widget	top_widget;    /* The toplevel widget */
   Widget	child_widget;  /* The embedded widget */
   Visual	*xtvisual;
@@ -95,17 +95,17 @@ struct _GtkXtBin
   XtClient	 xtclient;         /* Xt Client for XEmbed */
 };
   
 struct _GtkXtBinClass
 {
   GtkSocketClass widget_class;
 };
 
-GTKXTBIN_API(GtkType)     gtk_xtbin_get_type (void);
+GTKXTBIN_API(GType)       gtk_xtbin_get_type (void);
 GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
 GTKXTBIN_API(void)        gtk_xtbin_set_position (GtkXtBin *xtbin,
                                                   gint       x,
                                                   gint       y);
 GTKXTBIN_API(void)       gtk_xtbin_resize (GtkWidget *widget,
                                            gint       width,
                                            gint       height);