Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: src/IBusChewingEngine.gob

Issue 5535007: ibus-chewing: Support IBus-1.4 API. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/ibus-chewing.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/IBusChewingEngine-def.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 requires 2.0.0 1 requires 2.0.0
2 2
3 %alltop{ 3 %alltop{
4 /* 4 /*
5 * Copyright © 2009 Red Hat, Inc. All rights reserved. 5 * Copyright © 2009 Red Hat, Inc. All rights reserved.
6 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com> 6 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com>
7 * 7 *
8 * This file is part of the ibus-chewing Project. 8 * This file is part of the ibus-chewing Project.
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 #define BUFFER_SIZE_LOCAL 200 292 #define BUFFER_SIZE_LOCAL 200
293 G_DEBUG_MSG(3,"[I3] load_setting()"); 293 G_DEBUG_MSG(3,"[I3] load_setting()");
294 int i; 294 int i;
295 //gchar buf[BUFFER_SIZE_LOCAL]; 295 //gchar buf[BUFFER_SIZE_LOCAL];
296 PropertyContext context = {NULL, self}; 296 PropertyContext context = {NULL, self};
297 297
298 for (i=0; propSpecs[i].valueType!=G_TYPE_INVALID;i++){ 298 for (i=0; propSpecs[i].valueType!=G_TYPE_INVALID;i++){
299 GValue gValue={0}; 299 GValue gValue={0};
300 300
301 G_DEBUG_MSG(4,"[I4] load_setting(), i=%d",i); 301 G_DEBUG_MSG(4,"[I4] load_setting(), i=%d",i);
302 » if (ibus_config_get_value(self->config, "engine/Chewing",propSpecs[i ].key, &gValue)){ 302 » if (ibus_chewing_config_get_value(self->config, "engine/Chewing",pro pSpecs[i].key, &gValue)){
303 // TODO: Read in the config on Chromium OS. 303 // TODO: Read in the config on Chromium OS.
304 /*switch(propSpecs[i].valueType){ 304 /*switch(propSpecs[i].valueType){
305 case G_TYPE_BOOLEAN: 305 case G_TYPE_BOOLEAN:
306 buf[0]=(g_value_get_boolean(gValue))? '1' : '0'; 306 buf[0]=(g_value_get_boolean(gValue))? '1' : '0';
307 buf[1]='\0'; 307 buf[1]='\0';
308 break; 308 break;
309 case G_TYPE_UINT: 309 case G_TYPE_UINT:
310 g_snprintf(buf,BUFFER_SIZE_LOCAL,"%u", 310 g_snprintf(buf,BUFFER_SIZE_LOCAL,"%u",
311 g_value_get_uint(gValue)); 311 g_value_get_uint(gValue));
312 break; 312 break;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 /** 670 /**
671 * save_config: 671 * save_config:
672 * @self: this instances. 672 * @self: this instances.
673 * @key_suffix: key to be set. 673 * @key_suffix: key to be set.
674 * @returns: TRUE if successful, FALSE otherwise. 674 * @returns: TRUE if successful, FALSE otherwise.
675 * 675 *
676 * Save the property value to disk. 676 * Save the property value to disk.
677 */ 677 */
678 public gboolean save_config(self, const gchar *key_suffix){ 678 public gboolean save_config(self, const gchar *key_suffix){
679 G_DEBUG_MSG(1,"[I1] save_config(%s,-)",key_suffix); 679 G_DEBUG_MSG(1,"[I1] save_config(%s,-)",key_suffix);
680 » GValue gValue={0}; 680 » // GValue gValue={0};
681 // TODO: Save the config on Chromium OS. 681 // TODO: Save the config on Chromium OS.
682 //maker_dialog_get_widget_value(MAKER_DIALOG(self->setting_dialog),key_s uffix,&gValue); 682 //maker_dialog_get_widget_value(MAKER_DIALOG(self->setting_dialog),key_s uffix,&gValue);
683 //return ibus_config_set_value (self->config,"engine/Chewing",key_suffix ,&gValue); 683 //return ibus_config_set_value (self->config,"engine/Chewing",key_suffix ,&gValue);
684 return TRUE; 684 return TRUE;
685 } 685 }
686 686
687 /** 687 /**
688 * save_config_all: 688 * save_config_all:
689 * @self: this instances. 689 * @self: this instances.
690 * @key_suffix: key to be set. 690 * @key_suffix: key to be set.
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 if (!self->config){ 1007 if (!self->config){
1008 self->config=iConfig; 1008 self->config=iConfig;
1009 self_load_setting(self); 1009 self_load_setting(self);
1010 } 1010 }
1011 if (!self->handler_id) { 1011 if (!self->handler_id) {
1012 // Watch the ibus config service for config changes. If one of chew ing's values 1012 // Watch the ibus config service for config changes. If one of chew ing's values
1013 // changes, the local state needs to be updated to match. 1013 // changes, the local state needs to be updated to match.
1014 self->handler_id = g_signal_connect(self->config, "value-changed", 1014 self->handler_id = g_signal_connect(self->config, "value-changed",
1015 G_CALLBACK(ibus_config_value_changed), self); 1015 G_CALLBACK(ibus_config_value_changed), self);
1016 } 1016 }
1017 » G_DEBUG_MSG(2,"[I2] enable() config = %x handler_id = %d", self->config, self->handler_id); 1017 » G_DEBUG_MSG(2,"[I2] enable() config = %p handler_id = %lu", self->config , self->handler_id);
1018 self_refresh_property_list(self); 1018 self_refresh_property_list(self);
1019 self->inputMode=CHEWING_INPUT_MODE_SELECTING_DONE; 1019 self->inputMode=CHEWING_INPUT_MODE_SELECTING_DONE;
1020 ibus_chewing_engine_set_status_flag(self, ENGINE_STATUS_ENABLED); 1020 ibus_chewing_engine_set_status_flag(self, ENGINE_STATUS_ENABLED);
1021 } 1021 }
1022 1022
1023 override (IBus:Engine) void 1023 override (IBus:Engine) void
1024 disable(IBus:Engine *engine){ 1024 disable(IBus:Engine *engine){
1025 G_DEBUG_MSG(2,"[I2] disable()"); 1025 G_DEBUG_MSG(2,"[I2] disable()");
1026 Self *self=SELF(engine); 1026 Self *self=SELF(engine);
1027 self_force_commit(self); 1027 self_force_commit(self);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 IBusProperty *prop=self_get_iBusProperty(self, prop_name); 1114 IBusProperty *prop=self_get_iBusProperty(self, prop_name);
1115 ibus_property_set_visible(prop,FALSE); 1115 ibus_property_set_visible(prop,FALSE);
1116 ibus_engine_update_property(engine,prop); 1116 ibus_engine_update_property(engine,prop);
1117 } 1117 }
1118 } 1118 }
1119 1119
1120 %{ 1120 %{
1121 #include "IBusChewingEngine-keys.c" 1121 #include "IBusChewingEngine-keys.c"
1122 %} 1122 %}
1123 1123
OLDNEW
« no previous file with comments | « no previous file | src/IBusChewingEngine-def.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698