[gnome-commander] C++: inline the most popular functions



commit 1cad10b6513b0edf76ea790669886047bfb765c0
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Dec 16 16:48:22 2009 +0100

    C++: inline the most popular functions

 libgcmd/gnome-cmd-string-dialog.cc |  115 ++++------------
 libgcmd/gnome-cmd-string-dialog.h  |   52 ++-----
 libgcmd/libgcmd-data.cc            |   41 ++----
 libgcmd/libgcmd-utils.cc           |   20 +---
 libgcmd/libgcmd-utils.h            |   19 ++-
 libgcmd/libgcmd-widget-factory.cc  |  270 ++++++++---------------------------
 libgcmd/libgcmd-widget-factory.h   |   59 ++++++--
 7 files changed, 184 insertions(+), 392 deletions(-)
---
diff --git a/libgcmd/gnome-cmd-string-dialog.cc b/libgcmd/gnome-cmd-string-dialog.cc
index b410acf..0636efc 100644
--- a/libgcmd/gnome-cmd-string-dialog.cc
+++ b/libgcmd/gnome-cmd-string-dialog.cc
@@ -37,16 +37,15 @@ struct _GnomeCmdStringDialogPrivate
 static GnomeCmdDialogClass *parent_class = NULL;
 
 
-static void
-on_ok (GtkButton *button, GnomeCmdStringDialog *dialog)
+static void on_ok (GtkButton *button, GnomeCmdStringDialog *dialog)
 {
     gboolean valid = TRUE;
 
-    if (dialog->priv->ok_cb) {
-        gint i;
-        gchar **values = (gchar**)g_new (gpointer, dialog->rows);
+    if (dialog->priv->ok_cb)
+    {
+        gchar **values = (gchar**) g_new (gpointer, dialog->rows);
 
-        for (i=0; i<dialog->rows; i++)
+        for (gint i=0; i<dialog->rows; i++)
             values[i] = (gchar*)gtk_entry_get_text (GTK_ENTRY (dialog->entries[i]));
 
         valid = dialog->priv->ok_cb (dialog, (const gchar**)values, dialog->priv->data);
@@ -60,8 +59,7 @@ on_ok (GtkButton *button, GnomeCmdStringDialog *dialog)
 }
 
 
-static void
-on_cancel (GtkButton *button, GnomeCmdStringDialog *dialog)
+static void on_cancel (GtkButton *button, GnomeCmdStringDialog *dialog)
 {
     if (dialog->priv->cancel_cb)
         dialog->priv->cancel_cb (button, dialog->priv->data);
@@ -74,8 +72,7 @@ on_cancel (GtkButton *button, GnomeCmdStringDialog *dialog)
  * Gtk class implementation
  *******************************/
 
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdStringDialog *dialog = GNOME_CMD_STRING_DIALOG (object);
 
@@ -84,22 +81,20 @@ destroy (GtkObject *object)
 
     if (dialog->priv)
         g_free (dialog->priv->error_desc);
- 
+
     g_free (dialog->priv);
     dialog->priv = NULL;
 }
 
 
-static void
-map (GtkWidget *widget)
+static void map (GtkWidget *widget)
 {
     if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
         GTK_WIDGET_CLASS (parent_class)->map (widget);
 }
 
 
-static void
-class_init (GnomeCmdStringDialogClass *klass)
+static void class_init (GnomeCmdStringDialogClass *klass)
 {
     GtkObjectClass *object_class;
     GtkWidgetClass *widget_class;
@@ -112,18 +107,16 @@ class_init (GnomeCmdStringDialogClass *klass)
     widget_class->map = map;
 }
 
-static void
-init (GnomeCmdStringDialog *string_dialog)
+
+static void init (GnomeCmdStringDialog *string_dialog)
 {
     string_dialog->priv = g_new0 (GnomeCmdStringDialogPrivate, 1);
     string_dialog->rows = -1;
 }
 
 
-static void
-setup_widget (GnomeCmdStringDialog *string_dialog, gint rows)
+inline void setup_widget (GnomeCmdStringDialog *string_dialog, gint rows)
 {
-    gint i;
     GtkWidget *dialog = GTK_WIDGET (string_dialog);
     GtkWidget *table;
     GtkWidget *btn;
@@ -136,7 +129,8 @@ setup_widget (GnomeCmdStringDialog *string_dialog, gint rows)
     table = create_table (dialog, rows, 2);
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dialog), table);
 
-    for (i=0; i<rows; i++) {
+    for (gint i=0; i<rows; i++)
+    {
         string_dialog->labels[i] = create_label (dialog, "");
         table_add (table, string_dialog->labels[i], 0, i, GTK_FILL);
 
@@ -145,12 +139,8 @@ setup_widget (GnomeCmdStringDialog *string_dialog, gint rows)
         table_add (table, string_dialog->entries[i], 1, i, GtkAttachOptions(GTK_FILL|GTK_EXPAND));
     }
 
-    gnome_cmd_dialog_add_button (
-        GNOME_CMD_DIALOG (dialog),
-        GTK_STOCK_CANCEL, GTK_SIGNAL_FUNC (on_cancel), string_dialog);
-    btn = gnome_cmd_dialog_add_button (
-        GNOME_CMD_DIALOG (dialog),
-        GTK_STOCK_OK, GTK_SIGNAL_FUNC (on_ok), string_dialog);
+    gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_SIGNAL_FUNC (on_cancel), string_dialog);
+    btn = gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_OK, GTK_SIGNAL_FUNC (on_ok), string_dialog);
 
     gtk_widget_grab_focus (string_dialog->entries[0]);
     gtk_widget_grab_default (btn);
@@ -161,8 +151,7 @@ setup_widget (GnomeCmdStringDialog *string_dialog, gint rows)
  * Public functions
  ***********************************/
 
-GtkType
-gnome_cmd_string_dialog_get_type ()
+GtkType gnome_cmd_string_dialog_get_type ()
 {
     static GtkType dlg_type = 0;
 
@@ -186,13 +175,7 @@ gnome_cmd_string_dialog_get_type ()
 }
 
 
-GtkWidget*
-gnome_cmd_string_dialog_new_with_cancel (const gchar *title,
-                                         const gchar **labels,
-                                         gint rows,
-                                         GnomeCmdStringDialogCallback ok_cb,
-                                         GtkSignalFunc cancel_cb,
-                                         gpointer user_data)
+GtkWidget *gnome_cmd_string_dialog_new_with_cancel (const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, GtkSignalFunc cancel_cb, gpointer user_data)
 {
     GnomeCmdStringDialog *dialog = (GnomeCmdStringDialog *) gtk_type_new (gnome_cmd_string_dialog_get_type ());
 
@@ -202,28 +185,8 @@ gnome_cmd_string_dialog_new_with_cancel (const gchar *title,
 }
 
 
-GtkWidget*
-gnome_cmd_string_dialog_new (const gchar *title,
-                             const gchar **labels,
-                             gint rows,
-                             GnomeCmdStringDialogCallback ok_cb,
-                             gpointer user_data)
+void gnome_cmd_string_dialog_setup_with_cancel (GnomeCmdStringDialog *dialog, const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, GtkSignalFunc cancel_cb, gpointer user_data)
 {
-    return gnome_cmd_string_dialog_new_with_cancel (title, labels, rows, ok_cb, NULL, user_data);
-}
-
-
-void
-gnome_cmd_string_dialog_setup_with_cancel (GnomeCmdStringDialog *dialog,
-                                           const gchar *title,
-                                           const gchar **labels,
-                                           gint rows,
-                                           GnomeCmdStringDialogCallback ok_cb,
-                                           GtkSignalFunc cancel_cb,
-                                           gpointer user_data)
-{
-    gint i;
-
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (title != NULL);
     g_return_if_fail (labels != NULL);
@@ -237,25 +200,12 @@ gnome_cmd_string_dialog_setup_with_cancel (GnomeCmdStringDialog *dialog,
     gnome_cmd_string_dialog_set_cancel_cb (dialog, cancel_cb);
 
     if (labels)
-        for (i=0; i<rows; i++)
+        for (gint i=0; i<rows; i++)
             gnome_cmd_string_dialog_set_label (dialog, i, labels[i]);
 }
 
 
-void
-gnome_cmd_string_dialog_setup (GnomeCmdStringDialog *dialog,
-                               const gchar *title,
-                               const gchar **labels,
-                               gint rows,
-                               GnomeCmdStringDialogCallback ok_cb,
-                               gpointer user_data)
-{
-    gnome_cmd_string_dialog_setup_with_cancel (dialog, title, labels, rows, ok_cb, NULL, user_data);
-}
-
-
-void
-gnome_cmd_string_dialog_set_hidden (GnomeCmdStringDialog *dialog, gint row, gboolean hidden)
+void gnome_cmd_string_dialog_set_hidden (GnomeCmdStringDialog *dialog, gint row, gboolean hidden)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (row >= 0 && row < dialog->rows);
@@ -264,8 +214,7 @@ gnome_cmd_string_dialog_set_hidden (GnomeCmdStringDialog *dialog, gint row, gboo
 }
 
 
-void
-gnome_cmd_string_dialog_set_title (GnomeCmdStringDialog *dialog, const gchar *title)
+void gnome_cmd_string_dialog_set_title (GnomeCmdStringDialog *dialog, const gchar *title)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
 
@@ -273,8 +222,7 @@ gnome_cmd_string_dialog_set_title (GnomeCmdStringDialog *dialog, const gchar *ti
 }
 
 
-void
-gnome_cmd_string_dialog_set_label (GnomeCmdStringDialog *dialog, gint row, const gchar *label)
+void gnome_cmd_string_dialog_set_label (GnomeCmdStringDialog *dialog, gint row, const gchar *label)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (row >= 0 && row < dialog->rows);
@@ -284,8 +232,7 @@ gnome_cmd_string_dialog_set_label (GnomeCmdStringDialog *dialog, gint row, const
 }
 
 
-void
-gnome_cmd_string_dialog_set_userdata (GnomeCmdStringDialog *dialog, gpointer user_data)
+void gnome_cmd_string_dialog_set_userdata (GnomeCmdStringDialog *dialog, gpointer user_data)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
 
@@ -293,8 +240,7 @@ gnome_cmd_string_dialog_set_userdata (GnomeCmdStringDialog *dialog, gpointer use
 }
 
 
-void
-gnome_cmd_string_dialog_set_ok_cb (GnomeCmdStringDialog *dialog, GnomeCmdStringDialogCallback ok_cb)
+void gnome_cmd_string_dialog_set_ok_cb (GnomeCmdStringDialog *dialog, GnomeCmdStringDialogCallback ok_cb)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (ok_cb != NULL);
@@ -303,8 +249,7 @@ gnome_cmd_string_dialog_set_ok_cb (GnomeCmdStringDialog *dialog, GnomeCmdStringD
 }
 
 
-void
-gnome_cmd_string_dialog_set_cancel_cb (GnomeCmdStringDialog *dialog, GtkSignalFunc cancel_cb)
+void gnome_cmd_string_dialog_set_cancel_cb (GnomeCmdStringDialog *dialog, GtkSignalFunc cancel_cb)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
 
@@ -312,8 +257,7 @@ gnome_cmd_string_dialog_set_cancel_cb (GnomeCmdStringDialog *dialog, GtkSignalFu
 }
 
 
-void
-gnome_cmd_string_dialog_set_value (GnomeCmdStringDialog *dialog, gint row, const gchar *value)
+void gnome_cmd_string_dialog_set_value (GnomeCmdStringDialog *dialog, gint row, const gchar *value)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (row >= 0 && row < dialog->rows);
@@ -322,8 +266,7 @@ gnome_cmd_string_dialog_set_value (GnomeCmdStringDialog *dialog, gint row, const
 }
 
 
-void
-gnome_cmd_string_dialog_set_error_desc (GnomeCmdStringDialog *dialog, gchar *msg)
+void gnome_cmd_string_dialog_set_error_desc (GnomeCmdStringDialog *dialog, gchar *msg)
 {
     g_return_if_fail (GNOME_CMD_IS_STRING_DIALOG (dialog));
     g_return_if_fail (msg != NULL);
diff --git a/libgcmd/gnome-cmd-string-dialog.h b/libgcmd/gnome-cmd-string-dialog.h
index 8cb1ada..64a2092 100644
--- a/libgcmd/gnome-cmd-string-dialog.h
+++ b/libgcmd/gnome-cmd-string-dialog.h
@@ -53,42 +53,22 @@ struct _GnomeCmdStringDialogClass
 };
 
 
-typedef gboolean (*GnomeCmdStringDialogCallback)(GnomeCmdStringDialog *dialog,
-                                                 const gchar **values,
-                                                 gpointer user_data);
-
-
-GtkWidget*
-gnome_cmd_string_dialog_new_with_cancel (const gchar *title,
-                                         const gchar **labels,
-                                         gint rows,
-                                         GnomeCmdStringDialogCallback ok_cb,
-                                         GtkSignalFunc cancel_cb,
-                                         gpointer user_data);
-
-GtkWidget*
-gnome_cmd_string_dialog_new (const gchar *title,
-                             const gchar **labels,
-                             gint rows,
-                             GnomeCmdStringDialogCallback ok_cb,
-                             gpointer user_data);
-
-void
-gnome_cmd_string_dialog_setup_with_cancel (GnomeCmdStringDialog *dialog,
-                                           const gchar *title,
-                                           const gchar **labels,
-                                           gint rows,
-                                           GnomeCmdStringDialogCallback ok_cb,
-                                           GtkSignalFunc cancel_cb,
-                                           gpointer user_data);
-
-void
-gnome_cmd_string_dialog_setup (GnomeCmdStringDialog *dialog,
-                               const gchar *title,
-                               const gchar **labels,
-                               gint rows,
-                               GnomeCmdStringDialogCallback ok_cb,
-                               gpointer user_data);
+typedef gboolean (*GnomeCmdStringDialogCallback) (GnomeCmdStringDialog *dialog, const gchar **values, gpointer user_data);
+
+
+GtkWidget *gnome_cmd_string_dialog_new_with_cancel (const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, GtkSignalFunc cancel_cb, gpointer user_data);
+
+inline GtkWidget *gnome_cmd_string_dialog_new (const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, gpointer user_data)
+{
+    return gnome_cmd_string_dialog_new_with_cancel (title, labels, rows, ok_cb, NULL, user_data);
+}
+
+void gnome_cmd_string_dialog_setup_with_cancel (GnomeCmdStringDialog *dialog, const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, GtkSignalFunc cancel_cb, gpointer user_data);
+
+inline void gnome_cmd_string_dialog_setup (GnomeCmdStringDialog *dialog, const gchar *title, const gchar **labels, gint rows, GnomeCmdStringDialogCallback ok_cb, gpointer user_data)
+{
+    gnome_cmd_string_dialog_setup_with_cancel (dialog, title, labels, rows, ok_cb, NULL, user_data);
+}
 
 GtkType gnome_cmd_string_dialog_get_type ();
 
diff --git a/libgcmd/libgcmd-data.cc b/libgcmd/libgcmd-data.cc
index 29a7669..8b6db07 100644
--- a/libgcmd/libgcmd-data.cc
+++ b/libgcmd/libgcmd-data.cc
@@ -23,22 +23,22 @@
 #include "libgcmd-data.h"
 
 
-static void set_string (const gchar *path, const gchar *value)
+inline void set_string (const gchar *path, const gchar *value)
 {
     gnome_config_set_string (path, value);
 }
 
-static void set_int    (const gchar *path, int value)
+inline void set_int (const gchar *path, int value)
 {
     gnome_config_set_int (path, value);
 }
 
-static void set_bool (const gchar *path, gboolean value)
+inline void set_bool (const gchar *path, gboolean value)
 {
     gnome_config_set_bool (path, value);
 }
 
-static gchar *get_string (const gchar *path, const gchar *def)
+inline gchar *get_string (const gchar *path, const gchar *def)
 {
     gboolean b = FALSE;
     gchar *value = gnome_config_get_string_with_default (path, &b);
@@ -47,7 +47,7 @@ static gchar *get_string (const gchar *path, const gchar *def)
     return value;
 }
 
-static gint get_int (const gchar *path, int def)
+inline gint get_int (const gchar *path, int def)
 {
     gboolean b = FALSE;
     gint value = gnome_config_get_int_with_default (path, &b);
@@ -56,7 +56,7 @@ static gint get_int (const gchar *path, int def)
     return value;
 }
 
-static gboolean get_bool (const gchar *path, gboolean def)
+inline gboolean get_bool (const gchar *path, gboolean def)
 {
     gboolean b = FALSE;
     gboolean value = gnome_config_get_bool_with_default (path, &b);
@@ -66,7 +66,7 @@ static gboolean get_bool (const gchar *path, gboolean def)
 }
 
 
-static void set_color (const gchar *path, GdkColor *color)
+inline void set_color (const gchar *path, GdkColor *color)
 {
     gchar *color_str;
     color_str = g_strdup_printf ("%d %d %d", color->red, color->green, color->blue);
@@ -75,7 +75,7 @@ static void set_color (const gchar *path, GdkColor *color)
 }
 
 
-static void get_color (const gchar *path, GdkColor *color)
+inline void get_color (const gchar *path, GdkColor *color)
 {
     gint red, green, blue;
     gchar *def = g_strdup_printf ("%d %d %d",
@@ -95,8 +95,7 @@ static void get_color (const gchar *path, GdkColor *color)
 }
 
 
-void
-gnome_cmd_data_set_string (const gchar *path, const gchar *value)
+void gnome_cmd_data_set_string (const gchar *path, const gchar *value)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -106,8 +105,7 @@ gnome_cmd_data_set_string (const gchar *path, const gchar *value)
 }
 
 
-void
-gnome_cmd_data_set_int (const gchar *path, int value)
+void gnome_cmd_data_set_int (const gchar *path, int value)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -116,8 +114,7 @@ gnome_cmd_data_set_int (const gchar *path, int value)
     g_free (s);
 }
 
-void
-gnome_cmd_data_set_bool (const gchar *path, gboolean value)
+void gnome_cmd_data_set_bool (const gchar *path, gboolean value)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -127,8 +124,7 @@ gnome_cmd_data_set_bool (const gchar *path, gboolean value)
 }
 
 
-void
-gnome_cmd_data_set_color (const gchar *path, GdkColor *color)
+void gnome_cmd_data_set_color (const gchar *path, GdkColor *color)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -138,8 +134,7 @@ gnome_cmd_data_set_color (const gchar *path, GdkColor *color)
 }
 
 
-gchar*
-gnome_cmd_data_get_string (const gchar *path, const gchar *def)
+gchar *gnome_cmd_data_get_string (const gchar *path, const gchar *def)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -151,8 +146,7 @@ gnome_cmd_data_get_string (const gchar *path, const gchar *def)
 }
 
 
-gint
-gnome_cmd_data_get_int (const gchar *path, int def)
+gint gnome_cmd_data_get_int (const gchar *path, int def)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -164,8 +158,7 @@ gnome_cmd_data_get_int (const gchar *path, int def)
 }
 
 
-gboolean
-gnome_cmd_data_get_bool (const gchar *path, gboolean def)
+gboolean gnome_cmd_data_get_bool (const gchar *path, gboolean def)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -177,8 +170,7 @@ gnome_cmd_data_get_bool (const gchar *path, gboolean def)
 }
 
 
-void
-gnome_cmd_data_get_color (const gchar *path, GdkColor *color)
+void gnome_cmd_data_get_color (const gchar *path, GdkColor *color)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
 
@@ -186,4 +178,3 @@ gnome_cmd_data_get_color (const gchar *path, GdkColor *color)
 
     g_free (s);
 }
-
diff --git a/libgcmd/libgcmd-utils.cc b/libgcmd/libgcmd-utils.cc
index 18c56f9..407ff95 100644
--- a/libgcmd/libgcmd-utils.cc
+++ b/libgcmd/libgcmd-utils.cc
@@ -24,7 +24,7 @@
 #include "libgcmd-utils.h"
 
 
-static gchar *get_trashed_string (const gchar *in)
+inline gchar *get_trashed_string (const gchar *in)
 {
     gchar *out = g_strdup (in);
     gchar *end;
@@ -54,21 +54,3 @@ gchar *get_utf8 (const gchar *unknown)
 
     return out;
 }
-
-
-gchar *get_bold_text (const gchar *in)
-{
-    return g_strdup_printf ("<span weight=\"bold\">%s</span>", in);
-}
-
-
-gchar *get_mono_text (const gchar *in)
-{
-    return g_strdup_printf ("<span font_family=\"monospace\">%s</span>", in);
-}
-
-
-gchar *get_bold_mono_text (const gchar *in)
-{
-    return g_strdup_printf ("<span font_family=\"monospace\" weight=\"bold\">%s</span>", in);
-}
diff --git a/libgcmd/libgcmd-utils.h b/libgcmd/libgcmd-utils.h
index 20c5929..526dfe9 100644
--- a/libgcmd/libgcmd-utils.h
+++ b/libgcmd/libgcmd-utils.h
@@ -23,10 +23,19 @@
 
 gchar *get_utf8 (const gchar *unknown);
 
-gchar *get_bold_text (const gchar *in);
-
-gchar *get_mono_text (const gchar *in);
-
-gchar *get_bold_mono_text (const gchar *in);
+inline gchar *get_bold_text (const gchar *in)
+{
+    return g_strdup_printf ("<span weight=\"bold\">%s</span>", in);
+}
+
+inline gchar *get_mono_text (const gchar *in)
+{
+    return g_strdup_printf ("<span font_family=\"monospace\">%s</span>", in);
+}
+
+inline gchar *get_bold_mono_text (const gchar *in)
+{
+    return g_strdup_printf ("<span font_family=\"monospace\" weight=\"bold\">%s</span>", in);
+}
 
 #endif //__LIB_GCMD_UTILS_H__
diff --git a/libgcmd/libgcmd-widget-factory.cc b/libgcmd/libgcmd-widget-factory.cc
index 9ccf6f5..3cc4275 100644
--- a/libgcmd/libgcmd-widget-factory.cc
+++ b/libgcmd/libgcmd-widget-factory.cc
@@ -25,9 +25,7 @@
 #include "gnome-cmd-dialog.h"
 
 
-GtkWidget*
-lookup_widget                          (GtkWidget       *widget,
-                                        const gchar     *widget_name)
+GtkWidget *lookup_widget (GtkWidget *widget, const gchar     *widget_name)
 {
     GtkWidget *parent, *found_widget;
 
@@ -59,8 +57,7 @@ lookup_widget                          (GtkWidget       *widget,
  * This type of frame is the first thing packed in each tab
  *
  */
-GtkWidget *
-create_frame (GtkWidget *parent, const gchar *text, gint spacing)
+GtkWidget *create_frame (GtkWidget *parent, const gchar *text, gint spacing)
 {
     GtkWidget *frame = gtk_frame_new (text);
     gtk_widget_ref (frame);
@@ -72,8 +69,7 @@ create_frame (GtkWidget *parent, const gchar *text, gint spacing)
 }
 
 
-GtkWidget *
-create_tabframe (GtkWidget *parent)
+GtkWidget *create_tabframe (GtkWidget *parent)
 {
     GtkWidget *frame = create_frame (parent, "", 6);
     gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
@@ -81,8 +77,7 @@ create_tabframe (GtkWidget *parent)
 }
 
 
-GtkWidget *
-create_space_frame (GtkWidget *parent, gint space)
+GtkWidget *create_space_frame (GtkWidget *parent, gint space)
 {
     GtkWidget *frame = create_frame (parent, NULL, space);
     gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
@@ -90,8 +85,7 @@ create_space_frame (GtkWidget *parent, gint space)
 }
 
 
-GtkWidget *
-create_table (GtkWidget *parent, gint rows, gint cols)
+GtkWidget *create_table (GtkWidget *parent, gint rows, gint cols)
 {
     GtkWidget *table = gtk_table_new (rows, cols, FALSE);
     gtk_widget_ref (table);
@@ -105,8 +99,7 @@ create_table (GtkWidget *parent, gint rows, gint cols)
 }
 
 
-GtkWidget *
-create_vbox (GtkWidget *parent, gboolean h, gint s)
+GtkWidget *create_vbox (GtkWidget *parent, gboolean h, gint s)
 {
     GtkWidget *vbox = gtk_vbox_new (h, s);
     gtk_widget_ref (vbox);
@@ -118,8 +111,7 @@ create_vbox (GtkWidget *parent, gboolean h, gint s)
 }
 
 
-GtkWidget *
-create_hbox (GtkWidget *parent, gboolean h, gint s)
+GtkWidget *create_hbox (GtkWidget *parent, gboolean h, gint s)
 {
     GtkWidget *hbox = gtk_hbox_new (h, s);
     gtk_widget_ref (hbox);
@@ -131,22 +123,7 @@ create_hbox (GtkWidget *parent, gboolean h, gint s)
 }
 
 
-GtkWidget *
-create_tabvbox (GtkWidget *parent)
-{
-    return create_vbox (parent, FALSE, 6);
-}
-
-
-GtkWidget *
-create_tabhbox (GtkWidget *parent)
-{
-    return create_hbox (parent, FALSE, 6);
-}
-
-
-GtkWidget *
-create_label (GtkWidget *parent, const gchar *text)
+GtkWidget *create_label (GtkWidget *parent, const gchar *text)
 {
     GtkWidget *label;
 
@@ -161,8 +138,7 @@ create_label (GtkWidget *parent, const gchar *text)
 }
 
 
-GtkWidget *
-create_bold_label (GtkWidget *parent, const gchar *text)
+GtkWidget *create_bold_label (GtkWidget *parent, const gchar *text)
 {
     GtkWidget *label = create_label (parent, text);
 
@@ -174,8 +150,7 @@ create_bold_label (GtkWidget *parent, const gchar *text)
 }
 
 
-GtkWidget *
-create_hsep (GtkWidget *parent)
+GtkWidget *create_hsep (GtkWidget *parent)
 {
     GtkWidget *sep = gtk_hseparator_new ();
     gtk_widget_ref (sep);
@@ -186,8 +161,7 @@ create_hsep (GtkWidget *parent)
 }
 
 
-GtkWidget *
-create_vsep (GtkWidget *parent)
+GtkWidget *create_vsep (GtkWidget *parent)
 {
     GtkWidget *sep = gtk_vseparator_new ();
     gtk_widget_ref (sep);
@@ -198,8 +172,7 @@ create_vsep (GtkWidget *parent)
 }
 
 
-GtkWidget *
-create_space_hbox (GtkWidget *parent, GtkWidget *content)
+GtkWidget *create_space_hbox (GtkWidget *parent, GtkWidget *content)
 {
     GtkWidget *hbox = create_hbox (parent, FALSE, 0);
     GtkWidget *lbl = create_label (parent, "    ");
@@ -211,8 +184,7 @@ create_space_hbox (GtkWidget *parent, GtkWidget *content)
 }
 
 
-GtkWidget *
-create_category (GtkWidget *parent, GtkWidget *content, gchar *title)
+GtkWidget *create_category (GtkWidget *parent, GtkWidget *content, gchar *title)
 {
     GtkWidget *frame = create_vbox (parent, FALSE, 0);
     GtkWidget *label = create_bold_label (parent, title);
@@ -229,8 +201,7 @@ create_category (GtkWidget *parent, GtkWidget *content, gchar *title)
 }
 
 
-GtkWidget *
-create_named_button_with_data (GtkWidget *parent, const gchar *label, const gchar *name, GtkSignalFunc func, gpointer data)
+GtkWidget *create_named_button_with_data (GtkWidget *parent, const gchar *label, const gchar *name, GtkSignalFunc func, gpointer data)
 {
     guint key;
     GtkAccelGroup *accel_group = gtk_accel_group_new ();
@@ -241,8 +212,7 @@ create_named_button_with_data (GtkWidget *parent, const gchar *label, const gcha
                                 key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
     gtk_window_add_accel_group (GTK_WINDOW (parent), accel_group);
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     if (func)
         gtk_signal_connect (GTK_OBJECT (w), "clicked", func, data);
@@ -251,30 +221,7 @@ create_named_button_with_data (GtkWidget *parent, const gchar *label, const gcha
 }
 
 
-GtkWidget *
-create_button_with_data (GtkWidget *parent, const gchar *label,
-                         GtkSignalFunc func, gpointer data)
-{
-    return create_named_button_with_data (parent, label, "button", func, data);
-}
-
-
-GtkWidget *
-create_button (GtkWidget *parent, gchar *label, GtkSignalFunc func)
-{
-    return create_button_with_data (parent, label, func, parent);
-}
-
-
-GtkWidget *
-create_named_button (GtkWidget *parent, gchar *label, gchar *name, GtkSignalFunc func)
-{
-    return create_named_button_with_data (parent, label, name, func, parent);
-}
-
-
-GtkWidget *
-create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data)
+GtkWidget * create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data)
 {
     GtkWidget *w = gtk_button_new_from_stock ((const gchar *) stock);
     gtk_widget_ref (w);
@@ -287,34 +234,11 @@ create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gch
 }
 
 
-GtkWidget *
-create_stock_button_with_data (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func, gpointer data)
-{
-    return create_named_stock_button_with_data (parent, stock, "button", func, data);
-}
-
-
-GtkWidget *
-create_named_stock_button (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func)
-{
-    return create_named_stock_button_with_data (parent, stock, name, func, parent);
-}
-
-
-GtkWidget *
-create_stock_button (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func)
-{
-    return create_stock_button_with_data (parent, stock, func, parent);
-}
-
-
-GtkWidget *
-create_entry (GtkWidget *parent, const gchar *name, const gchar *value)
+GtkWidget *create_entry (GtkWidget *parent, const gchar *name, const gchar *value)
 {
     GtkWidget *w = gtk_entry_new ();
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, w, (GtkDestroyNotify) gtk_widget_unref);
     if (value)
         gtk_entry_set_text (GTK_ENTRY (w), value);
     gtk_widget_show (w);
@@ -322,12 +246,9 @@ create_entry (GtkWidget *parent, const gchar *name, const gchar *value)
 }
 
 
-GtkWidget *
-create_check (GtkWidget *parent, gchar *text, gchar *name)
+GtkWidget *create_check (GtkWidget *parent, gchar *text, gchar *name)
 {
-    GtkWidget *btn;
-
-    btn = gtk_check_button_new_with_label (text);
+    GtkWidget *btn = gtk_check_button_new_with_label (text);
     gtk_widget_ref (btn);
     gtk_object_set_data_full (GTK_OBJECT (parent), name, btn,
                               (GtkDestroyNotify) gtk_widget_unref);
@@ -337,12 +258,9 @@ create_check (GtkWidget *parent, gchar *text, gchar *name)
 }
 
 
-GtkWidget *
-create_radio (GtkWidget *parent, GSList *group, const gchar *text, const gchar *name)
+GtkWidget *create_radio (GtkWidget *parent, GSList *group, const gchar *text, const gchar *name)
 {
-    GtkWidget *btn;
-
-    btn = gtk_radio_button_new_with_label (group, text);
+    GtkWidget *btn = gtk_radio_button_new_with_label (group, text);
     gtk_widget_ref (btn);
     gtk_object_set_data_full (GTK_OBJECT (parent), name, btn,
                               (GtkDestroyNotify) gtk_widget_unref);
@@ -352,8 +270,7 @@ create_radio (GtkWidget *parent, GSList *group, const gchar *text, const gchar *
 }
 
 
-GtkWidget *
-create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value)
+GtkWidget *create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value)
 {
     GtkObject *adj;
     GtkWidget *spin;
@@ -361,8 +278,7 @@ create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value)
     adj = gtk_adjustment_new (value, min, max, 1, 10, 10);
     spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0);
     gtk_widget_ref (spin);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, spin,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, spin, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (spin);
     gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
 
@@ -370,25 +286,21 @@ create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value)
 }
 
 
-GtkWidget *
-create_color_button (GtkWidget *parent, gchar *name)
+GtkWidget *create_color_button (GtkWidget *parent, gchar *name)
 {
     GtkWidget *w = gtk_color_button_new ();
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     return w;
 }
 
 
-GtkWidget *
-create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path)
+GtkWidget *create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path)
 {
     GtkWidget *icon_entry = gnome_icon_entry_new (NULL, NULL);
     gtk_widget_ref (icon_entry);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, icon_entry,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, icon_entry, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (icon_entry);
     if (icon_path)
         gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (icon_entry), icon_path);
@@ -396,15 +308,12 @@ create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path)
 }
 
 
-GtkWidget *
-create_scale (GtkWidget *parent, gchar *name, gint value, gint min, gint max)
+GtkWidget *create_scale (GtkWidget *parent, gchar *name, gint value, gint min, gint max)
 {
-    GtkWidget *scale = gtk_hscale_new (
-        GTK_ADJUSTMENT (gtk_adjustment_new (value, min, max, 0, 0, 0)));
+    GtkWidget *scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (value, min, max, 0, 0, 0)));
 
     gtk_widget_ref (scale);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, scale,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, scale,(GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (scale);
     gtk_scale_set_digits (GTK_SCALE (scale), 0);
 
@@ -412,21 +321,18 @@ create_scale (GtkWidget *parent, gchar *name, gint value, gint min, gint max)
 }
 
 
-GtkWidget *
-create_file_entry (GtkWidget *parent, gchar *name, const gchar *value)
+GtkWidget *create_file_entry (GtkWidget *parent, gchar *name, const gchar *value)
 {
     GtkWidget *fentry, *entry;
 
     fentry = gnome_file_entry_new (NULL, NULL);
     gtk_widget_ref (fentry);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "fileentry", fentry,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "fileentry", fentry, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (fentry);
 
     entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry));
     gtk_widget_ref (entry);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, entry,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, entry, (GtkDestroyNotify) gtk_widget_unref);
     if (value)
         gtk_entry_set_text (GTK_ENTRY (entry), value);
     gtk_widget_show (entry);
@@ -435,42 +341,34 @@ create_file_entry (GtkWidget *parent, gchar *name, const gchar *value)
 }
 
 
-GtkWidget *
-create_clist (GtkWidget *parent, gchar *name, gint cols, gint rowh,
-              GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved)
+GtkWidget *create_clist (GtkWidget *parent, gchar *name, gint cols, gint rowh, GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved)
 {
     GtkWidget *sw, *clist;
 
     sw = gtk_scrolled_window_new (NULL, NULL);
     gtk_widget_ref (sw);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "sw", sw,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "sw", sw, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (sw);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
-                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
     clist = gtk_clist_new (cols);
     gtk_widget_ref (clist);
     gtk_object_set_data (GTK_OBJECT (sw), "clist", clist);
-    gtk_object_set_data_full (GTK_OBJECT (parent), name, clist,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), name, clist, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (clist);
     gtk_clist_set_row_height (GTK_CLIST (clist), rowh);
     gtk_container_add (GTK_CONTAINER (sw), clist);
     gtk_clist_column_titles_show (GTK_CLIST (clist));
 
     if (on_row_selected)
-        gtk_signal_connect (GTK_OBJECT (clist), "select-row",
-                            GTK_SIGNAL_FUNC (on_row_selected), parent);
+        gtk_signal_connect (GTK_OBJECT (clist), "select-row", GTK_SIGNAL_FUNC (on_row_selected), parent);
     if (on_row_moved)
-        gtk_signal_connect (GTK_OBJECT (clist), "row-move",
-                            GTK_SIGNAL_FUNC (on_row_moved), parent);
+        gtk_signal_connect (GTK_OBJECT (clist), "row-move", GTK_SIGNAL_FUNC (on_row_moved), parent);
     return sw;
 }
 
 
-void
-create_clist_column (GtkWidget *sw, gint col, gint width, gchar *label)
+void create_clist_column (GtkWidget *sw, gint col, gint width, gchar *label)
 {
     GtkWidget *clist = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (sw), "clist");
     gtk_clist_set_column_width (GTK_CLIST (clist), col, width);
@@ -478,13 +376,11 @@ create_clist_column (GtkWidget *sw, gint col, gint width, gchar *label)
 }
 
 
-GtkWidget *
-create_vbuttonbox (GtkWidget *parent)
+GtkWidget *create_vbuttonbox (GtkWidget *parent)
 {
     GtkWidget *w = gtk_vbutton_box_new ();
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "vbuttonbox", w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "vbuttonbox", w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     gtk_button_box_set_layout (GTK_BUTTON_BOX (w), GTK_BUTTONBOX_START);
     gtk_box_set_spacing (GTK_BOX (w), 12);
@@ -492,46 +388,38 @@ create_vbuttonbox (GtkWidget *parent)
 }
 
 
-GtkWidget *
-create_hbuttonbox (GtkWidget *parent)
+GtkWidget *create_hbuttonbox (GtkWidget *parent)
 {
     GtkWidget *w = gtk_hbutton_box_new ();
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "hbuttonbox", w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "hbuttonbox", w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     gtk_box_set_spacing (GTK_BOX (w), 12);
     return w;
 }
 
 
-GtkWidget *
-create_combo (GtkWidget *parent)
+GtkWidget *create_combo (GtkWidget *parent)
 {
     GtkWidget *combo = gtk_combo_new ();
     gtk_widget_ref (combo);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "combo", combo,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "combo", combo, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (combo);
     return combo;
 }
 
 
-GtkWidget *
-create_option_menu (GtkWidget *parent, const gchar **items)
+GtkWidget *create_option_menu (GtkWidget *parent, const gchar **items)
 {
-    gint i = 0;
-
     GtkWidget *optmenu = gtk_option_menu_new ();
     gtk_widget_ref (optmenu);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "optmenu", optmenu,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "optmenu", optmenu, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (optmenu);
 
     GtkWidget *menu = gtk_menu_new ();
     gtk_widget_show (menu);
 
-    for (i = 0; items[i]; i++)
+    for (gint i = 0; items[i]; i++)
     {
         GtkWidget *item = gtk_menu_item_new_with_label (items[i]);
         gtk_widget_show (item);
@@ -544,75 +432,45 @@ create_option_menu (GtkWidget *parent, const gchar **items)
 }
 
 
-const gchar *
-get_combo_text (GtkWidget *combo)
+const gchar *get_combo_text (GtkWidget *combo)
 {
     return gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (combo)->entry));
 }
 
 
-GtkWidget *
-create_progress_bar (GtkWidget *parent)
+GtkWidget *create_progress_bar (GtkWidget *parent)
 {
     GtkWidget *w = gtk_progress_bar_new ();
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "progress_bar", w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "progress_bar", w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     gtk_progress_set_show_text (GTK_PROGRESS (w), TRUE);
     return w;
 }
 
 
-GSList *
-get_radio_group (GtkWidget *radio)
-{
-    return gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
-}
-
-
-void
-table_add (GtkWidget *table, GtkWidget *w, gint x, gint y, GtkAttachOptions x_opts)
-{
-    gtk_table_attach (GTK_TABLE (table), w, x, x+1, y, y+1, x_opts, (GtkAttachOptions)0, 0, 0);
-}
-
-
-void
-table_add_y (GtkWidget *table, GtkWidget *w, gint x, gint y,
-             GtkAttachOptions x_opts, GtkAttachOptions y_opts)
-{
-    gtk_table_attach (GTK_TABLE (table), w, x, x+1, y, y+1, x_opts, y_opts, 0, 0);
-}
-
-
-GtkWidget *
-create_pixmap (GtkWidget *parent, GdkPixmap *pm, GdkBitmap *mask)
+GtkWidget *create_pixmap (GtkWidget *parent, GdkPixmap *pm, GdkBitmap *mask)
 {
     GtkWidget *w = gtk_pixmap_new (pm, mask);
     gtk_widget_ref (w);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "pixmap", w,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "pixmap", w, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (w);
     return w;
 }
 
 
-GtkWidget *
-create_sw (GtkWidget *parent)
+GtkWidget *create_sw (GtkWidget *parent)
 {
     GtkWidget *scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
     gtk_widget_ref (scrolledwindow);
-    gtk_object_set_data_full (GTK_OBJECT (parent), "scrolledwindow", scrolledwindow,
-                              (GtkDestroyNotify) gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (parent), "scrolledwindow", scrolledwindow, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (scrolledwindow);
     gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     return scrolledwindow;
 }
 
 
-void
-progress_bar_update (GtkWidget *pbar, gint max)
+void progress_bar_update (GtkWidget *pbar, gint max)
 {
     gint value = (gint)gtk_progress_get_value (GTK_PROGRESS (pbar)) + 1;
 
@@ -622,8 +480,7 @@ progress_bar_update (GtkWidget *pbar, gint max)
 }
 
 
-const char *
-get_entry_text (GtkWidget *parent, gchar *entry_name)
+const char *get_entry_text (GtkWidget *parent, gchar *entry_name)
 {
     GtkWidget *entry = lookup_widget (parent, entry_name);
     if (!entry) return NULL;
@@ -633,15 +490,13 @@ get_entry_text (GtkWidget *parent, gchar *entry_name)
 }
 
 
-static void
-on_response (GtkDialog *dialog, gint id, gpointer data)
+static void on_response (GtkDialog *dialog, gint id, gpointer data)
 {
     gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 
-void
-create_error_dialog (const gchar *msg, ...)
+void create_error_dialog (const gchar *msg, ...)
 {
     va_list      argptr;
     gchar        string[1024];
@@ -651,8 +506,7 @@ create_error_dialog (const gchar *msg, ...)
     vsprintf (string, msg, argptr);
     va_end (argptr);
 
-    dialog = gtk_message_dialog_new (GTK_WINDOW (main_win_widget), GTK_DIALOG_MODAL,
-                                     GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, string);
+    dialog = gtk_message_dialog_new (GTK_WINDOW (main_win_widget), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, string);
 
     gtk_signal_connect (GTK_OBJECT (dialog), "response", GTK_SIGNAL_FUNC (on_response), dialog);
 
diff --git a/libgcmd/libgcmd-widget-factory.h b/libgcmd/libgcmd-widget-factory.h
index fec173f..eec0506 100644
--- a/libgcmd/libgcmd-widget-factory.h
+++ b/libgcmd/libgcmd-widget-factory.h
@@ -35,9 +35,15 @@ GtkWidget *create_vbox (GtkWidget *parent, gboolean h, gint s);
 
 GtkWidget *create_hbox (GtkWidget *parent, gboolean h, gint s);
 
-GtkWidget *create_tabvbox (GtkWidget *parent);
+inline GtkWidget *create_tabvbox (GtkWidget *parent)
+{
+    return create_vbox (parent, FALSE, 6);
+}
 
-GtkWidget *create_tabhbox (GtkWidget *parent);
+inline GtkWidget *create_tabhbox (GtkWidget *parent)
+{
+    return create_hbox (parent, FALSE, 6);
+}
 
 GtkWidget *create_label (GtkWidget *parent, const gchar *text);
 
@@ -51,21 +57,39 @@ GtkWidget *create_space_hbox (GtkWidget *parent, GtkWidget *content);
 
 GtkWidget *create_category (GtkWidget *parent, GtkWidget *content, gchar *title);
 
-GtkWidget *create_button (GtkWidget *parent, gchar *label, GtkSignalFunc func);
+GtkWidget *create_named_button_with_data (GtkWidget *parent, const gchar *label, const gchar *name, GtkSignalFunc func, gpointer data);
 
-GtkWidget *create_named_button (GtkWidget *parent, gchar *label, gchar *name, GtkSignalFunc func);
+inline GtkWidget *create_button_with_data (GtkWidget *parent, const gchar *label, GtkSignalFunc func, gpointer data)
+{
+    return create_named_button_with_data (parent, label, "button", func, data);
+}
 
-GtkWidget *create_button_with_data (GtkWidget *parent, const gchar *label, GtkSignalFunc func, gpointer data);
+inline GtkWidget *create_button (GtkWidget *parent, gchar *label, GtkSignalFunc func)
+{
+    return create_button_with_data (parent, label, func, parent);
+}
 
-GtkWidget *create_named_button_with_data (GtkWidget *parent, const gchar *label, const gchar *name, GtkSignalFunc func, gpointer data);
+inline GtkWidget *create_named_button (GtkWidget *parent, gchar *label, gchar *name, GtkSignalFunc func)
+{
+    return create_named_button_with_data (parent, label, name, func, parent);
+}
 
-GtkWidget *create_stock_button (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func);
+GtkWidget *create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data);
 
-GtkWidget *create_named_stock_button (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func);
+inline GtkWidget *create_stock_button_with_data (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func, gpointer data)
+{
+    return create_named_stock_button_with_data (parent, stock, "button", func, data);
+}
 
-GtkWidget *create_stock_button_with_data (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func, gpointer data);
+inline GtkWidget *create_named_stock_button (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func)
+{
+    return create_named_stock_button_with_data (parent, stock, name, func, parent);
+}
 
-GtkWidget *create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data);
+inline GtkWidget *create_stock_button (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func)
+{
+    return create_stock_button_with_data (parent, stock, func, parent);
+}
 
 GtkWidget *create_entry (GtkWidget *parent, const gchar *name, const gchar *value);
 
@@ -97,11 +121,20 @@ GtkWidget *create_option_menu (GtkWidget *parent, const gchar **items);
 
 const gchar *get_combo_text (GtkWidget *combo);
 
-GSList *get_radio_group (GtkWidget *radio);
+inline GSList *get_radio_group (GtkWidget *radio)
+{
+    return gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
+}
 
-void table_add (GtkWidget *table, GtkWidget *w, gint x, gint y, GtkAttachOptions x_opts);
+inline void table_add (GtkWidget *table, GtkWidget *w, gint x, gint y, GtkAttachOptions x_opts)
+{
+    gtk_table_attach (GTK_TABLE (table), w, x, x+1, y, y+1, x_opts, (GtkAttachOptions)0, 0, 0);
+}
 
-void table_add_y (GtkWidget *table, GtkWidget *w, gint x, gint y, GtkAttachOptions x_opts, GtkAttachOptions y_opts);
+inline void table_add_y (GtkWidget *table, GtkWidget *w, gint x, gint y, GtkAttachOptions x_opts, GtkAttachOptions y_opts)
+{
+    gtk_table_attach (GTK_TABLE (table), w, x, x+1, y, y+1, x_opts, y_opts, 0, 0);
+}
 
 GtkWidget *create_pixmap (GtkWidget *parent, GdkPixmap *pm, GdkBitmap *mask);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]