Index: gok/gok-button.c
===================================================================
--- gok/gok-button.c	(revision 2691)
+++ gok/gok-button.c	(working copy)
@@ -1,7 +1,7 @@
 /* gok-button.c
 *
-* Copyright 2002 Sun Microsystems, Inc.,
-* Copyright 2001 University Of Toronto
+* Copyright 2002-2009 Sun Microsystems, Inc.,
+* Copyright 2001-2009 University Of Toronto
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
@@ -19,57 +19,21 @@
 * Boston, MA 02111-1307, USA.
 */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include "gok-button.h"
+
 #include "gok-keyboard.h"
 #include "gok-log.h"
 #include "gok-data.h"
 #include "gok-scanner.h"
 #include "main.h"
-#include <stdio.h>
-#include <gnome.h>
 
-static void gok_button_class_init    (GokButtonClass *klass);
-static void gok_button_init          (GokButton      *gok_button);
-static gboolean gok_button_expose    (GtkWidget      *widget, GdkEventExpose *expose);
-GokKey* gok_button_find_key (GtkWidget* pWidget);
+static gboolean gok_button_expose   (GtkWidget *widget, GdkEventExpose *expose);
+static GokKey * gok_button_find_key (GtkWidget *pWidget);
 
-static GtkToggleButtonClass *parent_class = NULL;
-
 /* TODO: make image/text relationship (i.e. image on left, label on right) configurable */
 
-/**
-* gok_button_get_type
-*
-* returns: the gok button type
-**/
-GtkType
-gok_button_get_type ()
-{
-  static GtkType GokButtonType = 0;
- if (!GokButtonType)
-    {
-      static const GtkTypeInfo GokButtonInfo =
-      {
-	"GokButton",
-	sizeof (GokButton),
-	sizeof (GokButtonClass),
-	(GtkClassInitFunc) gok_button_class_init,
-	(GtkObjectInitFunc) gok_button_init,
-	NULL,
-     NULL,
-	(GtkClassInitFunc) NULL,
-      };
+G_DEFINE_TYPE (GokButton, gok_button, GTK_TYPE_TOGGLE_BUTTON)
 
-      GokButtonType = gtk_type_unique (GTK_TYPE_TOGGLE_BUTTON, &GokButtonInfo);
-    }
-
-  return GokButtonType;
-}
-
 /**
 * gok_button_class_init
 * @class: Pointer to the class that will be initialized.
@@ -78,9 +42,8 @@
 static void
 gok_button_class_init (GokButtonClass *klass)
 {
-	GtkWidgetClass   *widget_class;
-	widget_class   = (GtkWidgetClass*)   klass;
-	parent_class = g_type_class_peek_parent (klass);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
 	widget_class->expose_event = gok_button_expose;
 }
 
@@ -289,7 +252,8 @@ void gok_button_state_changed (GtkWidget *widget,
 *
 * Returns: A pointer to the key that holds the widget, NULL if not found.
 **/
-GokKey* gok_button_find_key (GtkWidget* pWidget)
+static GokKey *
+gok_button_find_key (GtkWidget* pWidget)
 {
 	GokKeyboard* pKeyboard;
 	GokKey* pKey;
@@ -315,7 +279,7 @@ gok_button_expose (GtkWidget      *widget,
 		   GdkEventExpose *event)
 {
  	gboolean retval = 
-		(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+		(* GTK_WIDGET_CLASS (gok_button_parent_class)->expose_event) (widget, event);
 	
 	if (GTK_WIDGET_DRAWABLE (widget) && GOK_BUTTON (widget)->pImage) {
 		if (GOK_BUTTON (widget)->indicator_type != NULL) {
Index: gok/gok-button.h
===================================================================
--- gok/gok-button.h	(revision 2691)
+++ gok/gok-button.h	(working copy)
@@ -1,7 +1,7 @@
 /* gok-button.h
 *
-* Copyright 2001,2002 Sun Microsystems, Inc.,
-* Copyright 2001,2002 University Of Toronto
+* Copyright 2001-2009 Sun Microsystems, Inc.,
+* Copyright 2001-2009 University Of Toronto
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
@@ -23,25 +23,24 @@
 #define __GOKBUTTON_H__
 
 #include <gtk/gtk.h>
-#include <gdk/gdk.h>
+
 #include "gok-key.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
-#define GOK_TYPE_BUTTON                  (gok_button_get_type ())
-#define GOK_BUTTON(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOK_TYPE_BUTTON, GokButton))
-#define GOK_BUTTON_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, GOK_TYPE_BUTTON, GokButtonClass)
-#define GOK_IS_BUTTON(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, GOK_TYPE_BUTTON)
-#define GOK_IS_BUTTON_CLASS(klass)       G_TYPE_CHECK_CLASS_TYPE (klass, GOK_TYPE_BUTTON)
+#define GOK_TYPE_BUTTON        (gok_button_get_type ())
+#define GOK_BUTTON(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GOK_TYPE_BUTTON, GokButton))
+#define GOK_BUTTON_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST (k, GOK_TYPE_BUTTON, GokButtonClass)
+#define GOK_IS_BUTTON(o)       (G_TYPE_CHECK_INSTANCE_TYPE (o, GOK_TYPE_BUTTON))
+#define GOK_IS_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE (k, GOK_TYPE_BUTTON))
 
-typedef struct _GokButton       GokButton;
-typedef struct _GokButtonClass  GokButtonClass;
+typedef struct _GokButton      GokButton;
+typedef struct _GokButtonClass GokButtonClass;
 
 struct _GokButton
 {
-	GtkToggleButton button;
+	GtkToggleButton parent;
+
 	GtkWidget* pBox;
 	GtkWidget* pLabel;
         GtkWidget* pImage;
@@ -50,10 +49,10 @@ struct _GokButton
 
 struct _GokButtonClass
 {
-  GtkToggleButtonClass parent_class;
+	GtkToggleButtonClass parent;
 };
 
-GtkType    gok_button_get_type (void) G_GNUC_CONST;
+GType      gok_button_get_type (void) G_GNUC_CONST;
 GtkWidget* gok_button_new_with_label (const gchar *pText, GokImagePlacementPolicy align);
 GtkWidget* gok_button_new_with_image (GtkWidget *image, GokImagePlacementPolicy align);
 void gok_button_set_image (GokButton *button, GtkImage *image);
@@ -62,9 +61,6 @@ gint gok_button_enter_notify   (GtkWidget *widget,
 gint gok_button_leave_notify   (GtkWidget *widget, GdkEventCrossing   *event);
 void gok_button_state_changed   (GtkWidget *widget, GtkStateType state, gpointer user_data);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
-
 #endif /* __GOKBUTTON_H__ */
