| OLD | NEW | 
|---|
| 1 /* vim:set et sts=4: */ | 1 /* vim:set et sts=4: */ | 
| 2 /* | 2 /* | 
| 3  * Copyright © 2009  Red Hat, Inc. All rights reserved. | 3  * Copyright © 2009  Red Hat, Inc. All rights reserved. | 
| 4  * Copyright © 2009  Ding-Yi Chen <dchen at redhat.com> | 4  * Copyright © 2009  Ding-Yi Chen <dchen at redhat.com> | 
| 5  * | 5  * | 
| 6  * This file is part of the ibus-chewing Project. | 6  * This file is part of the ibus-chewing Project. | 
| 7  * | 7  * | 
| 8  * This program is free software; you can redistribute it and/or | 8  * This program is free software; you can redistribute it and/or | 
| 9  * modify it under the terms of the GNU General Public License | 9  * modify it under the terms of the GNU General Public License | 
| 10  * as published by the Free Software Foundation; either version 2 | 10  * as published by the Free Software Foundation; either version 2 | 
| 11  * of the License, or (at your option) any later version. | 11  * of the License, or (at your option) any later version. | 
| 12  * | 12  * | 
| 13  * This program is distributed in the hope that it will be useful, | 13  * This program is distributed in the hope that it will be useful, | 
| 14  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 16  * GNU General Public License for more details. | 16  * GNU General Public License for more details. | 
| 17  * | 17  * | 
| 18  * You should have received a copy of the GNU General Public License | 18  * You should have received a copy of the GNU General Public License | 
| 19  * along with this program; if not, write to the Free Software | 19  * along with this program; if not, write to the Free Software | 
| 20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, US
     A. | 20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, US
     A. | 
| 21  */ | 21  */ | 
| 22 | 22 | 
| 23 #include <ibus.h> | 23 #include <ibus.h> | 
| 24 #include <stdlib.h> | 24 #include <stdlib.h> | 
| 25 #include <locale.h> | 25 #include <locale.h> | 
| 26 #include <chewing.h> | 26 #include <chewing.h> | 
| 27 #include <glib/gi18n.h> | 27 #include <glib/gi18n.h> | 
| 28 #include "ibus-chewing-engine.h" | 28 #include "ibus-chewing-engine.h" | 
| 29 #include "maker-dialog.h" | 29 // Chromium change: Remove maker-dialog | 
|  | 30 //#include "maker-dialog.h" | 
| 30 | 31 | 
| 31 MakerDialog *makerDialog=NULL; | 32 //MakerDialog *makerDialog=NULL; | 
| 32 static IBusBus *bus = NULL; | 33 static IBusBus *bus = NULL; | 
| 33 static IBusFactory *factory = NULL; | 34 static IBusFactory *factory = NULL; | 
| 34 | 35 | 
| 35 /* options */ | 36 /* options */ | 
| 36 static gboolean ibus = FALSE; | 37 static gboolean ibus = FALSE; | 
| 37 int ibus_chewing_verbose= 0; | 38 int ibus_chewing_verbose= 0; | 
| 38 IBusConfig *iConfig = NULL; | 39 IBusConfig *iConfig = NULL; | 
| 39 | 40 | 
| 40 static const GOptionEntry entries[] = | 41 static const GOptionEntry entries[] = | 
| 41 { | 42 { | 
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 128 #undef STRING_BUFFER_SIZE | 129 #undef STRING_BUFFER_SIZE | 
| 129     setlocale (LC_ALL, localeStr); | 130     setlocale (LC_ALL, localeStr); | 
| 130     G_DEBUG_MSG(1,"[I1] determine_locale %s",localeStr); | 131     G_DEBUG_MSG(1,"[I1] determine_locale %s",localeStr); | 
| 131 } | 132 } | 
| 132 | 133 | 
| 133 int | 134 int | 
| 134 main (gint argc, gchar *argv[]) | 135 main (gint argc, gchar *argv[]) | 
| 135 { | 136 { | 
| 136     GError *error = NULL; | 137     GError *error = NULL; | 
| 137     GOptionContext *context; | 138     GOptionContext *context; | 
| 138     gtk_init(&argc,&argv); | 139     // Chromium change: Remove gtk dependency. | 
|  | 140     //gtk_init(&argc,&argv); | 
| 139 | 141 | 
| 140     /* Init i18n messages */ | 142     /* Init i18n messages */ | 
| 141     setlocale (LC_ALL, "zh_TW.utf8"); | 143     setlocale (LC_ALL, "zh_TW.utf8"); | 
| 142     bindtextdomain(PROJECT_NAME, DATADIR "/locale"); | 144     bindtextdomain(PROJECT_NAME, DATADIR "/locale"); | 
| 143     textdomain(PROJECT_NAME); | 145     textdomain(PROJECT_NAME); | 
| 144 | 146 | 
| 145     context = g_option_context_new ("- ibus chewing engine component"); | 147     context = g_option_context_new ("- ibus chewing engine component"); | 
| 146 | 148 | 
| 147     g_option_context_add_main_entries (context, entries, "ibus-chewing"); | 149     g_option_context_add_main_entries (context, entries, "ibus-chewing"); | 
| 148 | 150 | 
| 149     if (!g_option_context_parse (context, &argc, &argv, &error)) { | 151     if (!g_option_context_parse (context, &argc, &argv, &error)) { | 
| 150         g_print ("Option parsing failed: %s\n", error->message); | 152         g_print ("Option parsing failed: %s\n", error->message); | 
| 151         exit (-1); | 153         exit (-1); | 
| 152     } | 154     } | 
| 153 | 155 | 
| 154     g_option_context_free (context); | 156     g_option_context_free (context); | 
| 155     start_component (); | 157     start_component (); | 
| 156     return 0; | 158     return 0; | 
| 157 } | 159 } | 
| OLD | NEW | 
|---|