[uim-commit] r3109 - trunk/helper

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Feb 15 10:22:20 PST 2006


Author: yamaken
Date: 2006-02-15 10:22:13 -0800 (Wed, 15 Feb 2006)
New Revision: 3109

Modified:
   trunk/helper/toolbar-common-gtk.c
Log:
* helper/toolbar-common-gtk.c
  - (regist_icon, register_icon): Rename regist_icon() to register_icon()
  - (im_button_append_menu): Change coding style
  - Cosmetic changes


Modified: trunk/helper/toolbar-common-gtk.c
===================================================================
--- trunk/helper/toolbar-common-gtk.c	2006-02-15 17:07:41 UTC (rev 3108)
+++ trunk/helper/toolbar-common-gtk.c	2006-02-15 18:22:13 UTC (rev 3109)
@@ -58,57 +58,84 @@
 void uim_toolbar_get_im_list(void);
 
 
-/* FIXME! command menu and buttons should be customizable. */
-static struct _CommandEntry {
+enum {
+  TYPE_STANDALONE,
+  TYPE_APPLET,
+  TYPE_ICON
+};
+
+enum {
+  BUTTON_IM,
+  BUTTON_PROP,
+  BUTTON_TOOL
+};
+
+struct _CommandEntry {
   const gchar *desc;
   const gchar *label;
   const gchar *icon;
   const gchar *command;
   const gchar *custom_button_show_symbol;
   uim_bool show_button;
-} command_entry[] = {
-  {N_("Switch input method"),
-   NULL,
-   "switcher-icon",
-   "uim-im-switcher-gtk &",
-   "toolbar-show-switcher-button?",
-   UIM_FALSE},
+};
 
-  {N_("Preference"),
-   NULL,
-   GTK_STOCK_PREFERENCES,
-   "uim-pref-gtk &",
-   "toolbar-show-pref-button?",
-   UIM_FALSE},
+/* FIXME! command menu and buttons should be customizable. */
+static struct _CommandEntry command_entry[] = {
+  {
+    N_("Switch input method"),
+    NULL,
+    "switcher-icon",
+    "uim-im-switcher-gtk &",
+    "toolbar-show-switcher-button?",
+    UIM_FALSE
+  },
 
-  {N_("Japanese dictionary editor"),
-   "Dic",
-   NULL,
-   "uim-dict-gtk &",
-   "toolbar-show-dict-button?",
-   UIM_FALSE},
+  {
+    N_("Preference"),
+    NULL,
+    GTK_STOCK_PREFERENCES,
+    "uim-pref-gtk &",
+    "toolbar-show-pref-button?",
+    UIM_FALSE
+  },
 
-  {N_("Input pad"),
-   "Pad",
-   NULL,
-   "uim-input-pad-ja &",
-   "toolbar-show-input-pad-button?",
-   UIM_FALSE},
+  {
+    N_("Japanese dictionary editor"),
+    "Dic",
+    NULL,
+    "uim-dict-gtk &",
+    "toolbar-show-dict-button?",
+    UIM_FALSE
+  },
 
-  {N_("Handwriting input pad"),
-   "Hand",
-   NULL,
-   "uim-tomoe-gtk &",
-   "toolbar-show-handwriting-input-pad-button?",
-   UIM_FALSE},
+  {
+    N_("Input pad"),
+    "Pad",
+    NULL,
+    "uim-input-pad-ja &",
+    "toolbar-show-input-pad-button?",
+    UIM_FALSE
+  },
 
-  {N_("Help"),
-   NULL,
-   GTK_STOCK_HELP,
-   "uim-help &",
-   "toolbar-show-help-button?",
-   UIM_FALSE}
+  {
+    N_("Handwriting input pad"),
+    "Hand",
+    NULL,
+    "uim-tomoe-gtk &",
+    "toolbar-show-handwriting-input-pad-button?",
+    UIM_FALSE
+  },
+
+  {
+    N_("Help"),
+    NULL,
+    GTK_STOCK_HELP,
+    "uim-help &",
+    "toolbar-show-help-button?",
+    UIM_FALSE
+  }
 };
+
 static gint command_entry_len = sizeof(command_entry) / sizeof(struct _CommandEntry);
 
 static GtkWidget *im_menu;
@@ -117,18 +144,6 @@
 static unsigned int read_tag;
 static int uim_fd;
 
-enum {
-  TYPE_STANDALONE,
-  TYPE_APPLET,
-  TYPE_ICON
-};
-
-enum {
-  BUTTON_IM,
-  BUTTON_PROP,
-  BUTTON_TOOL
-};
-
 static void
 calc_menu_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
 		   GtkWidget *button)
@@ -709,22 +724,24 @@
 static void
 im_button_append_menu(GtkWidget *button, gchar **cols)
 {
-  GList *im_list = g_object_get_data(G_OBJECT(button), "im_name");
+  GList *im_list, *state_list;
   const gchar *im_name, *state;	
   /* const gchar *im_lang, *im_desc; */
 
   im_name = cols[0];
   state = cols[3];
 
+  im_list = g_object_get_data(G_OBJECT(button), "im_name");
   im_list = g_list_append(im_list, g_strdup(im_name));
   g_object_set_data(G_OBJECT(button), "im_name", im_list);
 
   if (state) {
-    GList *state_list = g_object_get_data(G_OBJECT(button), "im_state");
+    state_list = g_object_get_data(G_OBJECT(button), "im_state");
     state_list = g_list_append(state_list, g_strdup(state));
     g_object_set_data(G_OBJECT(button), "im_state", state_list);
   }
 }
+
 static void
 helper_toolbar_im_list_update(GtkWidget *widget, gchar **lines)
 {
@@ -876,7 +893,7 @@
 }
 
 static void
-regist_icon(void)
+register_icon(void)
 {
   GtkIconFactory *factory;
   GtkIconSet *icon_set;
@@ -909,7 +926,7 @@
   GList *prop_buttons = NULL;
   GtkSizeGroup *sg;
 
-  regist_icon();
+  register_icon();
 
   /* create widgets */
   hbox = gtk_hbox_new(FALSE, 0);



More information about the uim-commit mailing list