~ubuntu-branches/ubuntu/natty/fcitx/natty

« back to all changes in this revision

Viewing changes to src/vk.c

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-09-24 23:03:16 UTC
  • mfrom: (1.3.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090924230316-icfw5cd3xbnm0cvx
Tags: 1:3.6.1-1
* new upstream release.
* debian/control:
  - add me to Uploader.
  - add libxtst-dev to Build-Depends.
  - bump standards version to 3.8.3.
* debian/rules:
  - updated, no longer need to call autogen.sh
* debian/clean: updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        return False;
108
108
 
109
109
    XChangeWindowAttributes (dpy, VKWindow, attribmask, &attrib);
110
 
    XSelectInput (dpy, VKWindow, ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | StructureNotifyMask | EnterWindowMask | PointerMotionMask | LeaveWindowMask | VisibilityChangeMask);
 
110
    XSelectInput (dpy, VKWindow, ExposureMask | ButtonPressMask | ButtonReleaseMask  | PointerMotionMask );
111
111
 
112
112
    InitVKWindowColor ();
113
113
    LoadVKMapFile ();
132
132
 
133
133
void DisplayVKWindow (void)
134
134
{
135
 
    if (!IsWindowVisible (VKWindow))
136
 
        XMapRaised (dpy, VKWindow);
 
135
    XMapRaised (dpy, VKWindow);
137
136
}
138
137
 
139
138
void DrawVKWindow (void)
232
231
    if (IsInBox (x, y, 1, 1, VK_WINDOW_WIDTH, 16))
233
232
        ChangVK ();
234
233
    else {
235
 
        if (!icid || !connect_id)
 
234
        if (!CurrentIC->id || !connect_id)
236
235
            return False;
237
236
 
238
237
        strKey[1] = '\0';
243
242
 
244
243
            x -= 4;
245
244
            if (x >= 313 && x <= 344) { //backspace
246
 
                MyIMForwardEvent (connect_id, icid, 22);
 
245
                MyIMForwardEvent (connect_id, CurrentIC->id, 22);
247
246
                return True;
248
247
            }
249
248
            else {
262
261
                return False;
263
262
 
264
263
            if (x >= 4 && x < 38) {     //Tab
265
 
                MyIMForwardEvent (connect_id, icid, 23);
 
264
                MyIMForwardEvent (connect_id, CurrentIC->id, 23);
266
265
                return True;
267
266
            }
268
267
            else {
317
316
        else if (y >= 140 && y <= 162) {        //������         
318
317
            if (x >= 4 && x < 38) {     //Ins
319
318
                //�ı�INS��״̬
320
 
                MyIMForwardEvent (connect_id, icid, 106);
 
319
                MyIMForwardEvent (connect_id, CurrentIC->id, 106);
321
320
                return True;
322
321
            }
323
322
            else if (x >= 61 && x < 98) {       //DEL
324
 
                MyIMForwardEvent (connect_id, icid, 107);
 
323
                MyIMForwardEvent (connect_id, CurrentIC->id, 107);
325
324
                return True;
326
325
            }
327
326
            else if (x >= 99 && x < 270)        //�ո�
337
336
        if (pstr) {
338
337
            memset (&forwardEvent, 0, sizeof (IMForwardEventStruct));
339
338
            forwardEvent.connect_id = connect_id;
340
 
            forwardEvent.icid = icid;
 
339
            forwardEvent.icid = CurrentIC->id;
341
340
            SendHZtoClient (&forwardEvent, pstr);
342
341
            iHZInputed += (int) (strlen (pstr) / 2);    //����ͳ������
343
342
        }
534
533
 
535
534
        XMoveWindow (dpy, VKWindow, x, y);
536
535
        DisplayVKWindow ();
537
 
        if (IsWindowVisible (inputWindow))
538
 
            XUnmapWindow (dpy, inputWindow);
 
536
        XUnmapWindow (dpy, inputWindow);
539
537
 
540
538
        if (ConnectIDGetState (connect_id) == IS_CLOSED)
541
539
            SetIMState (True);
542
540
    }
543
 
    else if (IsWindowVisible (VKWindow))
 
541
    else
544
542
        XUnmapWindow (dpy, VKWindow);
545
543
 
546
544
    SwitchIM (-2);