~ubuntu-branches/ubuntu/utopic/ibus-chewing/utopic

« back to all changes in this revision

Viewing changes to src/IBusChewingEngine.gob

  • Committer: Package Import Robot
  • Author(s): ChangZhuo Chen (陳昌倬)
  • Date: 2013-11-30 21:49:05 UTC
  • Revision ID: package-import@ubuntu.com-20131130214905-xve8zrjv54qkvnr1
Tags: 1.4.3-4
* CVE-2013-4509 (Closes: #730781)
* Update debian/watch
* Bump Standards-Version to 3.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
 * @SHOW_CANDIDATE:     Whether the candidate selection should be shown. Important for Plain Zhuyin.
111
111
 * @NEED_COMMIT:        There's Something to commit.
112
112
 * @FORCE_COMMIT:       The engine should commit
 
113
 * @IS_PASSWORD:        Current input is password.
113
114
 *
114
115
 * Engine status show the current states of engine,
115
116
 * Thus this will change quite often.
124
125
    SHOW_CANDIDATE=             0x8,
125
126
    NEED_COMMIT=                0x10,
126
127
    FORCE_COMMIT=               0x20,
 
128
    IS_PASSWORD=                0x40,
127
129
} Engine:Status;
128
130
 
129
131
%h{
633
635
        }
634
636
    }
635
637
 
 
638
    protected gboolean is_password(self){
 
639
        G_DEBUG_MSG(5, "[I5] is_password = %d", self->chewingFlags & ENGINE_STATUS_IS_PASSWORD);
 
640
        return !!(self->_priv->statusFlags & ENGINE_STATUS_IS_PASSWORD);
 
641
    }
 
642
 
636
643
    /**
637
644
     * refresh_property_list:
638
645
     * @self: this instances.
952
959
    override (IBus:Engine) void
953
960
    page_up(IBus:Engine *engine){
954
961
        Self *self=SELF(engine);
 
962
        if (self_is_password(self)) return;
955
963
        chewing_handle_PageUp(self->context);
956
964
        self_update(self);
957
965
    }
960
968
    override (IBus:Engine) void
961
969
    page_down(IBus:Engine *engine){
962
970
        Self *self=SELF(engine);
 
971
        if (self_is_password(self)) return;
963
972
        chewing_handle_PageDown(self->context);
964
973
        self_update(self);
965
974
    }
967
976
    override (IBus:Engine) void
968
977
    cursor_up(IBus:Engine *engine){
969
978
        Self *self=SELF(engine);
 
979
        if (self_is_password(self)) return;
970
980
        chewing_handle_Up(self->context);
971
981
        self_update(self);
972
982
    }
974
984
    override (IBus:Engine) void
975
985
    cursor_down(IBus:Engine *engine){
976
986
        Self *self=SELF(engine);
 
987
        if (self_is_password(self)) return;
977
988
        chewing_handle_Down(self->context);
978
989
        self_update(self);
979
990
    }
1118
1129
        ibus_property_set_visible(prop,FALSE);
1119
1130
        ibus_engine_update_property(engine,prop);
1120
1131
    }
 
1132
 
 
1133
    override (IBus:Engine) void
 
1134
    set_content_type(IBus:Engine *engine, guint purpose, guint hints){
 
1135
        G_DEBUG_MSG(5,"[I5] set_content_type(%d, %d)", purpose, hints);
 
1136
 
 
1137
        Self *self=SELF(engine);
 
1138
        if (purpose == IBUS_INPUT_PURPOSE_PASSWORD ||
 
1139
            purpose == IBUS_INPUT_PURPOSE_PIN) {
 
1140
            ibus_chewing_engine_set_status_flag(self, ENGINE_STATUS_IS_PASSWORD);
 
1141
        } else {
 
1142
            ibus_chewing_engine_clear_status_flag(self, ENGINE_STATUS_IS_PASSWORD);
 
1143
        }
 
1144
    }
1121
1145
}
1122
1146
 
1123
1147
%{