143
147
static gint _read_cache_entry_func (gchar** argv, int argv_length1, gpointer self);
144
148
static gint _write_cache_entry_func (gchar** argv, int argv_length1, gpointer self);
145
149
static gint _print_address_entry_func (gchar** argv, int argv_length1, gpointer self);
150
static gint _read_config_entry_func (gchar** argv, int argv_length1, gpointer self);
151
static gint _reset_config_entry_func (gchar** argv, int argv_length1, gpointer self);
146
152
static gint _print_help_entry_func (gchar** argv, int argv_length1, gpointer self);
147
153
gint _vala_main (gchar** argv, int argv_length1);
148
154
static gchar** _vala_array_dup1 (gchar** self, int length);
149
155
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
150
156
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
157
static gint _vala_array_length (gpointer array);
152
const CommandEntry commands[10] = {{"engine", "Set or get engine", _get_set_engine_entry_func}, {"exit", "Exit ibus-daemon", _exit_daemon_entry_func}, {"list-engine", "Show available engines", _list_engine_entry_func}, {"watch", "(Not implemented)", _message_watch_entry_func}, {"restart", "Restart ibus-daemon", _restart_daemon_entry_func}, {"version", "Show version", _print_version_entry_func}, {"read-cache", "Show the content of registry cache", _read_cache_entry_func}, {"write-cache", "Create registry cache", _write_cache_entry_func}, {"address", "Print the D-Bus address of ibus-daemon", _print_address_entry_func}, {"help", "Show this information", _print_help_entry_func}};
159
const gchar* IBUS_SCHEMAS[3] = {"org.freedesktop.ibus.general", "org.freedesktop.ibus.general.hotkey", "org.freedesktop.ibus.panel"};
160
const CommandEntry commands[12] = {{"engine", "Set or get engine", _get_set_engine_entry_func}, {"exit", "Exit ibus-daemon", _exit_daemon_entry_func}, {"list-engine", "Show available engines", _list_engine_entry_func}, {"watch", "(Not implemented)", _message_watch_entry_func}, {"restart", "Restart ibus-daemon", _restart_daemon_entry_func}, {"version", "Show version", _print_version_entry_func}, {"read-cache", "Show the content of registry cache", _read_cache_entry_func}, {"write-cache", "Create registry cache", _write_cache_entry_func}, {"address", "Print the D-Bus address of ibus-daemon", _print_address_entry_func}, {"read-config", "Show the configuration values", _read_config_entry_func}, {"reset-config", "Reset the configuration values", _reset_config_entry_func}, {"help", "Show this information", _print_help_entry_func}};
154
162
EngineList* engine_list_construct (GType object_type) {
155
163
EngineList* self = NULL;
1394
gint read_config (gchar** argv, int argv_length1) {
1396
GString* output = NULL;
1397
GString* _tmp0_ = NULL;
1398
GString* _tmp18_ = NULL;
1399
const gchar* _tmp19_ = NULL;
1400
_tmp0_ = g_string_new ("");
1403
const gchar** schema_collection = NULL;
1404
gint schema_collection_length1 = 0;
1405
gint _schema_collection_size_ = 0;
1407
schema_collection = IBUS_SCHEMAS;
1408
schema_collection_length1 = G_N_ELEMENTS (IBUS_SCHEMAS);
1409
for (schema_it = 0; schema_it < G_N_ELEMENTS (IBUS_SCHEMAS); schema_it = schema_it + 1) {
1410
gchar* _tmp1_ = NULL;
1411
gchar* schema = NULL;
1412
_tmp1_ = g_strdup (schema_collection[schema_it]);
1415
GSettings* settings = NULL;
1416
const gchar* _tmp2_ = NULL;
1417
GSettings* _tmp3_ = NULL;
1418
GString* _tmp4_ = NULL;
1419
const gchar* _tmp5_ = NULL;
1420
GSettings* _tmp6_ = NULL;
1421
gchar** _tmp7_ = NULL;
1422
gchar** _tmp8_ = NULL;
1424
_tmp3_ = g_settings_new (_tmp2_);
1428
g_string_append_printf (_tmp4_, "SCHEMA: %s\n", _tmp5_);
1430
_tmp8_ = _tmp7_ = g_settings_list_keys (_tmp6_);
1432
gchar** key_collection = NULL;
1433
gint key_collection_length1 = 0;
1434
gint _key_collection_size_ = 0;
1436
key_collection = _tmp8_;
1437
key_collection_length1 = _vala_array_length (_tmp7_);
1438
for (key_it = 0; key_it < _vala_array_length (_tmp7_); key_it = key_it + 1) {
1439
gchar* _tmp9_ = NULL;
1441
_tmp9_ = g_strdup (key_collection[key_it]);
1444
GVariant* variant = NULL;
1445
GSettings* _tmp10_ = NULL;
1446
const gchar* _tmp11_ = NULL;
1447
GVariant* _tmp12_ = NULL;
1448
GString* _tmp13_ = NULL;
1449
const gchar* _tmp14_ = NULL;
1450
GVariant* _tmp15_ = NULL;
1451
gchar* _tmp16_ = NULL;
1452
gchar* _tmp17_ = NULL;
1455
_tmp12_ = g_settings_get_value (_tmp10_, _tmp11_);
1460
_tmp16_ = g_variant_print (_tmp15_, TRUE);
1462
g_string_append_printf (_tmp13_, " %s: %s\n", _tmp14_, _tmp17_);
1464
_g_variant_unref0 (variant);
1468
key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
1470
_g_object_unref0 (settings);
1476
_tmp19_ = _tmp18_->str;
1477
g_print ("%s", _tmp19_);
1478
result = EXIT_SUCCESS;
1479
_g_string_free0 (output);
1484
gint reset_config (gchar** argv, int argv_length1) {
1486
const gchar* _tmp0_ = NULL;
1487
const gchar* _tmp12_ = NULL;
1488
_tmp0_ = _ ("Resetting…");
1489
g_print ("%s\n", _tmp0_);
1491
const gchar** schema_collection = NULL;
1492
gint schema_collection_length1 = 0;
1493
gint _schema_collection_size_ = 0;
1495
schema_collection = IBUS_SCHEMAS;
1496
schema_collection_length1 = G_N_ELEMENTS (IBUS_SCHEMAS);
1497
for (schema_it = 0; schema_it < G_N_ELEMENTS (IBUS_SCHEMAS); schema_it = schema_it + 1) {
1498
gchar* _tmp1_ = NULL;
1499
gchar* schema = NULL;
1500
_tmp1_ = g_strdup (schema_collection[schema_it]);
1503
GSettings* settings = NULL;
1504
const gchar* _tmp2_ = NULL;
1505
GSettings* _tmp3_ = NULL;
1506
const gchar* _tmp4_ = NULL;
1507
GSettings* _tmp5_ = NULL;
1508
gchar** _tmp6_ = NULL;
1509
gchar** _tmp7_ = NULL;
1511
_tmp3_ = g_settings_new (_tmp2_);
1514
g_print ("SCHEMA: %s\n", _tmp4_);
1516
_tmp7_ = _tmp6_ = g_settings_list_keys (_tmp5_);
1518
gchar** key_collection = NULL;
1519
gint key_collection_length1 = 0;
1520
gint _key_collection_size_ = 0;
1522
key_collection = _tmp7_;
1523
key_collection_length1 = _vala_array_length (_tmp6_);
1524
for (key_it = 0; key_it < _vala_array_length (_tmp6_); key_it = key_it + 1) {
1525
gchar* _tmp8_ = NULL;
1527
_tmp8_ = g_strdup (key_collection[key_it]);
1530
const gchar* _tmp9_ = NULL;
1531
GSettings* _tmp10_ = NULL;
1532
const gchar* _tmp11_ = NULL;
1534
g_print (" %s\n", _tmp9_);
1537
g_settings_reset (_tmp10_, _tmp11_);
1541
key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
1543
_g_object_unref0 (settings);
1549
_tmp12_ = _ ("Done");
1550
g_print ("%s\n", _tmp12_);
1551
result = EXIT_SUCCESS;
1386
1556
gint print_help (gchar** argv, int argv_length1) {
1387
1557
gint result = 0;
1388
1558
FILE* _tmp0_ = NULL;