Exemple #1
0
int main (gint argc, gchar** argv) {
    GError* error = NULL;
    GOptionContext* context;

    setlocale (LC_ALL, "");
    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
    textdomain (GETTEXT_PACKAGE);

    context = g_option_context_new ("- ibus unikey engine component");

    g_option_context_add_main_entries (context, entries, "ibus-unikey");

    if (!g_option_context_parse (context, &argc, &argv, &error)) {
        g_print ("Option parsing failed: %s\n", error->message);
        exit (-1);
    }

    if (xml) {
        print_engines_xml ();
        return 0;
    } else if (version) {
        g_print(PACKAGE_STRING " (engine component)"
                "\n  Copyright (C) 2009 - 2011 Ubuntu-VN <http://www.ubuntu-vn.org>"
                "\n  Author: Lê Quốc Tuấn <*****@*****.**>"
                "\n  Homepage: <http://ibus-unikey.googlecode.com>"
                "\n  License: GNU GPL3"
                "\n");
        return 0;
    }

    start_component ();

    return 0;
}
Exemple #2
0
int
main (gint argc, gchar **argv)
{
    GError *error = NULL;
    GOptionContext *context;

    setlocale (LC_ALL, "");

    context = g_option_context_new ("- ibus XKB Layouts engine component");

    g_option_context_add_main_entries (context, entries, "ibus-xkb-layouts");

    if (!g_option_context_parse (context, &argc, &argv, &error)) {
        g_print ("Option parsing failed: %s\n", error->message);
        exit (-1);
    }

    if (xml) {
        print_engines_xml ();
        exit (0);
    }

    start_component ();
    return 0;
}