int main(gint argc, gchar * argv[])
{
    GError *error = NULL;
    GOptionContext *context;

    /* Init i18n messages */
    setlocale(LC_ALL, "");
    bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale");
    textdomain(QUOTE_ME(PROJECT_NAME));

    context = g_option_context_new("schemasFile");

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

    if (!g_option_context_parse(context, &argc, &argv, &error)) {
	g_print("Option parsing failed: %s\n", error->message);
	return 1;
    }
    g_option_context_free(context);
    if (argc < 2) {
	fprintf(stderr, "Specify filename of outputing schemas file!\n");
	return 1;
    }
    mkdg_log_set_level(verbose);
    schemasFilename = argv[1];
    gboolean result = write_schemas_file(schemasFilename);
    if (!result) {
	return 2;
    }
    return 0;
}
Пример #2
0
int main(gint argc, gchar * argv[])
{
    GError *error = NULL;
    GOptionContext *context;
    gtk_init(&argc, &argv);

    /* Init i18n messages */
    setlocale(LC_ALL, "");
    bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale");
    textdomain(QUOTE_ME(PROJECT_NAME));
    determine_locale();

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

    g_option_context_add_main_entries(context, entries,
				      QUOTE_ME(PROJECT_NAME));

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

    g_option_context_free(context);
    mkdg_log_set_level(ibus_chewing_verbose);

    if (showFlags) {
	printf("PROJECT_NAME=" QUOTE_ME(PROJECT_NAME) "\n");
	printf("DATA_DIR=" QUOTE_ME(DATA_DIR) "\n");
	printf("CHEWING_DATADIR_REAL=" QUOTE_ME(CHEWING_DATADIR_REAL)
	       "\n");
    } else {
	start_component();
    }
    return 0;
}
gint main(gint argc, gchar ** argv)
{
    g_test_init(&argc, &argv, NULL);
    mkdg_log_set_level(DEBUG);
    engine = ibus_chewing_engine_new();
    ibus_chewing_pre_edit_save_property_int(engine->icPreEdit,
					   "max-chi-symbol-len", 8);
    ibus_chewing_pre_edit_set_apply_property_boolean(engine->icPreEdit,
					       "plain-zhuyin", FALSE);

    gboolean cleanBufferFocusOut=ibus_chewing_pre_edit_get_property_boolean(engine->icPreEdit, "clean-buffer-focus-out");
    TEST_RUN_THIS(focus_out_then_focus_in_with_aux_text_clean_buffer_off_test);
    TEST_RUN_THIS(focus_out_then_focus_in_with_aux_text_clean_buffer_on_test);
    ibus_chewing_pre_edit_save_property_boolean(engine->icPreEdit,
	    "clean-buffer-focus-out", cleanBufferFocusOut);

    return g_test_run();
}
gint main(gint argc, gchar ** argv)
{
    g_test_init(&argc, &argv, NULL);
#ifdef USE_GSETTINGS
    backend = mkdg_g_settings_backend_new(QUOTE_ME(PROJECT_SCHEMA_ID),
					  QUOTE_ME(PROJECT_SCHEMA_DIR),
					  NULL);
#elif defined USE_GCONF2
    backend = gconf2_backend_new(QUOTE_ME(PROJECT_SCHEMA_BASE), NULL);
#else
    g_error("Flag GSETTINGS_SUPPORT or GCONF2_SUPPORT are required!");
    return 2;
#endif				/* USE_GSETTINGS */
    mkdg_log_set_level(DEBUG);

    TEST_RUN_THIS(mkdg_g_value_from_string_boolean_test);
    TEST_RUN_THIS(mkdg_g_value_from_string_int_test);
    TEST_RUN_THIS(mkdg_g_value_from_string_uint_test);
    TEST_RUN_THIS(mkdg_g_value_from_string_string_test);
    return g_test_run();
}