Back to index

im-sdk  12.3.91
main.c
Go to the documentation of this file.
00001 /* GNOME INPUT METHOD SWITCHER
00002  * Copyright 2003 Sun Microsystems Inc.
00003  *
00004  * This is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #include <config.h>
00021 
00022 #include <gtk/gtkmain.h>
00023 #include <gtk/gtkdrawingarea.h>
00024 #include <gtk/gtksignal.h>
00025 #include <panel-applet.h>
00026 #include <gnome.h>
00027 
00028 #include "gnome-im-switcher.h"
00029 #include "widgets.h"
00030 #include "preference.h"
00031 #include "iiim-interface.h"
00032 
00033 static gboolean
00034 gimlet_applet_new (PanelApplet *applet, gpointer data)
00035 {
00036   GimletWindow *gimlet;
00037 
00038   gimlet = g_new0 (GimletWindow, 1);
00039 
00040   gimlet->applet = applet;
00041 
00042   /* default preference settings */
00043   gimlet->conversion_on_start = TRUE;
00044   gimlet->input_lang_policy = FOLLOW_QUICK_ACCESS_MENU;
00045 
00046   gimlet->conversion_mode = FALSE;
00047 
00048   gimlet_preference_init (gimlet);
00049 
00050   gimlet_iiim_selection_set (gimlet);
00051 
00052   gimlet_init (gimlet);
00053 
00054   return TRUE;
00055 }
00056 
00057 static gboolean
00058 imswitcher_applet_factory (PanelApplet *applet,
00059                         const gchar *iid, gpointer data)
00060 {
00061   gboolean retval = FALSE;
00062        
00063   if (strcmp (iid, "OAFIID:GNOME_imswitcher") != 0)
00064     return FALSE;
00065 
00066   retval = gimlet_applet_new (applet, data);
00067        
00068   return retval;
00069 }
00070 
00071 PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_imswitcher_Factory",
00072                              PANEL_TYPE_APPLET,
00073                              "GNOME Input Method Applet",
00074                              "0",
00075                              imswitcher_applet_factory,
00076                              NULL);
00077