~ubuntu-branches/ubuntu/precise/ibus-chewing/precise-updates

« back to all changes in this revision

Viewing changes to src/IBusChewingEngine.gob

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing, Asias He, LI Daobing
  • Date: 2010-09-13 23:05:30 UTC
  • mfrom: (1.1.12 upstream) (0.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20100913230530-aokjcxmtubcy0kh5
Tags: 1.3.7.20100910-1
[ Asias He ]
* New upstream release.
* debian/watch: use googlecode.debian.net

[ LI Daobing ]
* debian/rules: fix install path of gconf.
* debian/clean: updated. 
* debian/control: build depends on rpm. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
    protected ChewingInputMode inputMode=CHEWING_INPUT_MODE_BYPASS;
189
189
 
190
190
    /* Controlling flags */
191
 
    protected ChewingFlag flags=0;
 
191
    protected ChewingFlag chewingFlags=0;
192
192
 
193
193
    private guint statusFlags=0;
194
194
 
220
220
        g_object_ref_sink (
221
221
            ibus_property_new("chewing_settings_prop",PROP_TYPE_TOGGLE,
222
222
                SELF_GET_CLASS(self)->settings_prop_label,
223
 
                PKGDATADIR "/icons/settings.png", NULL, TRUE, TRUE,
 
223
                PROJECT_DATA_DIR "/icons/settings.png", NULL, TRUE, TRUE,
224
224
                PROP_STATE_UNCHECKED, NULL))
225
225
        }
226
226
        destroywith g_object_unref;
254
254
            gchar buf[100];
255
255
            g_snprintf(buf,100,"%s/.chewing",getenv("HOME"));
256
256
 
257
 
            chewing_Init(CHEWING_DATADIR, buf);
 
257
            chewing_Init(CHEWING_DATA_DIR, buf);
258
258
 
259
259
            self->context=chewing_new();
260
260
            chewing_set_ChiEngMode(self->context,CHINESE_MODE);
375
375
                zhuyin_tone=get_tone(chewing_get_KBType(self->context),self->_priv->key_last);
376
376
                add_tone(self->_priv->zhuyin_latest,zhuyin_tone);
377
377
                if (zhuyin_tone>0 ){
378
 
                    if (self->flags & CHEWING_FLAG_PLAIN_ZHUYIN){
 
378
                    if (self->chewingFlags & CHEWING_FLAG_PLAIN_ZHUYIN){
379
379
                        /* Open candidate selection window */
380
380
                        if (chewing_get_spaceAsSelection(self->context)){
381
381
                            chewing_handle_Space(self->context);
721
721
        int zhuyin_tone=-1;
722
722
        gint totalChoice=chewing_cand_TotalChoice(self->context);
723
723
        G_DEBUG_MSG(5, "[I5]  determine_input_mode(): TotalChoice=%d", totalChoice);
 
724
        if (chewing_commit_Check(self->context)
 
725
                && (self->_priv->key_last==IBUS_Return || self->_priv->key_last==IBUS_KP_Enter)){
 
726
            ibus_chewing_engine_set_status_flag(self,ENGINE_STATUS_NEED_COMMIT);
 
727
        }
724
728
        if (totalChoice >0){
725
729
            /* Candidate selection mode ensure. */
726
730
            self->inputMode=CHEWING_INPUT_MODE_SELECTING;
739
743
                case CHEWING_INPUT_MODE_EDITING:
740
744
                    zhuyin_tone=get_tone(chewing_get_KBType(self->context),self->_priv->key_last);
741
745
                    if (zhuyin_tone>0 ){
742
 
                        if (self->flags & CHEWING_FLAG_PLAIN_ZHUYIN){
 
746
                        if (self->chewingFlags & CHEWING_FLAG_PLAIN_ZHUYIN){
743
747
                            /* For plain zhuyin, Enter SELECTING mode */
744
748
                            self->inputMode=CHEWING_INPUT_MODE_SELECTING;
745
749
                        }else{
746
750
                            /* For normal zhuyin, Enter SELECTION_DONE mode */
747
751
                            self->inputMode=CHEWING_INPUT_MODE_SELECTION_DONE;
748
752
                        }
749
 
//                      gchar *buff_str=chewing_buffer_String(self->context);
750
 
//                      g_string_assign(self->completedString,buff_str);
751
 
//                      chewing_free(buff_str);
752
753
                    }
753
754
                    break;
754
755
                case CHEWING_INPUT_MODE_SELECTING:
755
 
                    /* Switch to another t page */
 
756
                    /* Switch to another page */
756
757
                    if (self_is_selectKey(self, self->_priv->key_last)){
757
758
                        self->inputMode=CHEWING_INPUT_MODE_SELECTION_DONE;
758
759
                    }else{
853
854
            if (!chewing_commit_Check(self->context)){
854
855
                chewing_handle_Enter(self->context);
855
856
             }
 
857
#else
 
858
            if (self->_priv->inputStyle==CHEWING_INPUT_STYLE_IN_CANDIDATE){
 
859
                /* But if in IN_CANDIDATE mode, still need to simulate enter.
 
860
                 */
 
861
                if (!chewing_commit_Check(self->context)){
 
862
                    chewing_handle_Enter(self->context);
 
863
                }
 
864
            }
 
865
 
856
866
#endif
857
867
            ibus_chewing_engine_set_status_flag(self, ENGINE_STATUS_FORCE_COMMIT);
 
868
            self_update(self);
858
869
        }
859
870
        if (chewing_commit_Check(self->context)){
860
871
            G_DEBUG_MSG(3,"[I3]  force_commit() has something to commit. buffer=%d, commit=%d",
871
882
    reset(IBus:Engine *engine){
872
883
        G_DEBUG_MSG(1,"[I1] reset");
873
884
        Self *self=SELF(engine);
874
 
        if (self->_priv->statusFlags & ENGINE_STATUS_NEED_COMMIT){
875
 
            /* Force commit non-empty preedit buffer */
876
 
            self_force_commit(self);
877
 
        }
 
885
 
 
886
        /* Always clean buffer */
 
887
        self_clean_chewing_buffer(self);
 
888
        ibus_chewing_engine_clear_status_flag(self, ENGINE_STATUS_FORCE_COMMIT);
 
889
 
878
890
        ibus_lookup_table_clear(self->table);
879
891
        /* Save KBType type, becaue chewing_Reset() will reset it to default.
880
892
         */