Back to index

im-sdk  12.3.91
Defines | Functions | Variables
palette_methods.c File Reference
#include <stdio.h>
#include <X11/Xmd.h>
#include <X11/Xlib.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include "xaux_common.h"
#include "xaux_ext_common.h"
#include "palette_aux.h"
#include "vkb_aux.h"
#include "le_aux_protocol.h"
#include "ime.h"

Go to the source code of this file.

Defines

#define ATOM_NUM_PALETTEAUX   32

Functions

void palette_aux_Proc_LE_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_IMEInfo_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Show_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Hide_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Change_Focus_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Switch_IME_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Switch_QjBj_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Switch_Punct_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Proc_LE_Beep_Notify (aux_ext_data_t *aux_ext_data)
void palette_aux_Connect_To_LE_Request (int locale_id)
void palette_aux_Switch_LE_Engine_Request (char *name)
void palette_aux_Switch_LE_QjBj_Request (int qjbj)
void palette_aux_Switch_LE_Punct_Request (int punct)
GdkFilterReturn xaux_ext_event_handler (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer user_data)
int xaux_ext_register_classes (GdkWindow *window)
Bool xaux_ext_Start (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
Bool xaux_ext_Draw (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
Bool xaux_ext_Done (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
void palette_aux_Set_Selection_Owner ()
void palette_aux_Update_LE_Properties_Request ()
void palette_aux_Commit_String_Request (char *commit_str)
void palette_aux_Commit_Key_Request (int nKeyCode, int nKeyChar, int nKeyStatus)
 NotifyIntegerListDataToLanguageEngine (Display *display, int nIntegerCount, int *pIntegerList)
 NotifyStringListDataToLanguageEngine (Display *display, int nIntegerCount, int *pIntegerList, int nStringCount, int *pStringLen, char **pStringList)

Variables

xaux_class_txc_ = 0
int im_ = 0
int ic_ = 0
xaux_class_t xaux_class
palette_window_tpalette_window
int gLocaleID = 0
Display * gDisplay = NULL
Window gWindow = 0

Define Documentation

#define ATOM_NUM_PALETTEAUX   32

Definition at line 23 of file palette_methods.c.


Function Documentation

NotifyIntegerListDataToLanguageEngine ( Display *  display,
int  nIntegerCount,
int *  pIntegerList 
)

Definition at line 607 of file palette_methods.c.

{
    aux_ext_data_t aux_ext_data;

    aux_ext_data.im = im_;
    aux_ext_data.ic = ic_;
    aux_ext_data.integer_count = nIntegerCount;
    aux_ext_data.integer_list = pIntegerList;
    aux_ext_data.string_count = 0;
    aux_ext_data.string_list = NULL;
    aux_ext_data.string_ptr = NULL;
    aux_ext_data.point.x = 0;
    aux_ext_data.point.y = 0;

    xaux_ext_SetValue(display, xc_, &aux_ext_data);
    XFlush(display);
}

Here is the call graph for this function:

NotifyStringListDataToLanguageEngine ( Display *  display,
int  nIntegerCount,
int *  pIntegerList,
int  nStringCount,
int *  pStringLen,
char **  pStringList 
)

Definition at line 626 of file palette_methods.c.

{
    int i;

    aux_ext_data_t aux_ext_data;
    aux_ext_string_t *p;

    aux_ext_data.im = im_;
    aux_ext_data.ic = ic_;
    aux_ext_data.integer_count = nIntegerCount;
    aux_ext_data.integer_list = pIntegerList;
    aux_ext_data.point.x = 0;
    aux_ext_data.point.y = 0;

    aux_ext_data.string_count = nStringCount;
    aux_ext_data.string_ptr = NULL;

    if (nStringCount > 0) {
       aux_ext_data.string_list =
           (aux_ext_string_t *) calloc(nStringCount,
                                   sizeof(aux_ext_string_t));
       for (i = 0; i < nStringCount; i++) {
           aux_ext_string_t *p = &aux_ext_data.string_list[i];
           p->length = pStringLen[i];
           p->ptr = (unsigned char *) (pStringList[i]);
       }
    }

    xaux_ext_SetValue(display, xc_, &aux_ext_data);
    XFlush(display);

    free(aux_ext_data.string_list);
}

Here is the call graph for this function:

void palette_aux_Commit_Key_Request ( int  nKeyCode,
int  nKeyChar,
int  nKeyStatus 
)

Definition at line 595 of file palette_methods.c.

{
    int nIntegerCount, pIntegerList[4];

    nIntegerCount = 4;
    pIntegerList[0] = COMMONAUX_COMMIT_KEY;
    pIntegerList[1] = nKeyCode;
    pIntegerList[2] = nKeyChar;
    pIntegerList[3] = nKeyStatus;
    NotifyIntegerListDataToLanguageEngine(gDisplay, nIntegerCount, pIntegerList);
}

Here is the call graph for this function:

void palette_aux_Commit_String_Request ( char *  commit_str)

Definition at line 570 of file palette_methods.c.

{
    int nIntegerCount, pIntegerList[3];
    int nStringCount, pStringLen[1];
    char *pStringList[1];

    if (!commit_str || !*commit_str) return;

    DEBUG_printf("palette_aux_Commit_String_Request: encode_id:%d, commit_str:%s, len: %d\n",
                 ENCODE_UTF8,  commit_str, strlen(commit_str));

    nIntegerCount = 3;
    pIntegerList[0] = COMMONAUX_COMMIT_STRING;
    pIntegerList[1] = ENCODE_UTF8;
    pIntegerList[2] = strlen(commit_str);

    nStringCount = 1;
    pStringLen[0] = strlen(commit_str) + 1;
    pStringList[0] = commit_str;

    NotifyStringListDataToLanguageEngine(gDisplay, nIntegerCount, pIntegerList,
                                    nStringCount, pStringLen,
                                    pStringList);
}

Here is the call graph for this function:

void palette_aux_Connect_To_LE_Request ( int  locale_id)
void palette_aux_Proc_LE_Notify ( aux_ext_data_t aux_ext_data)

Definition at line 230 of file palette_methods.c.

{
    Atom aux_atom =
       XInternAtom(gDisplay, "CH_PALETTEAUX_MODULE_ATOM", False);

    XSetSelectionOwner(gDisplay, aux_atom, gWindow, CurrentTime);
}
void palette_aux_Switch_LE_Engine_Request ( char *  name)

Definition at line 479 of file palette_methods.c.

{
    int nIntegerCount, pIntegerList[2];
    int nStringCount, pStringLen[1];
    char *pStringList[1];
    char *property_info_str = NULL;
    int  property_info_len = 0;

    nIntegerCount = 2;
    pIntegerList[0] = PALETTEAUX_UPDATE_PROPERTY;

    property_info_len = 0;
    property_info_str = (char *)property_data_composite_le_settings_to_xmlstr(palette_window->property_data,
                                        PROPERTY_DATA_FOR_SERVER_NOTIFICATION);
    if (property_info_str != NULL) {
            property_info_len = strlen(property_info_str);
    }

    if (property_info_len == 0)
       return;

    pIntegerList[1] = property_info_len;

#if DEBUG
    printf("palette_aux_Connect_To_LE_Request: property_info_str: \n%s\nlen: %d\n", property_info_str, property_info_len);
#endif
    nStringCount = 1;
    pStringLen[0] = property_info_len + 1;
    pStringList[0] = property_info_str;
    
    NotifyStringListDataToLanguageEngine(gDisplay, nIntegerCount,
                                    pIntegerList, nStringCount,
                                    pStringLen, pStringList);

    free((char *)property_info_str);
}

Here is the call graph for this function:

Bool xaux_ext_Done ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 161 of file palette_methods.c.

{
    DEBUG_printf("ext_Done im:0x%x, ic_id:0x%x\n", aux_ext_data->im,
               aux_ext_data->ic);
    return True;
}

Here is the call graph for this function:

Bool xaux_ext_Draw ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 147 of file palette_methods.c.

{
    DEBUG_printf("ext_Draw == im:0x%x, ic:0x%x\n", aux_ext_data->im,
               aux_ext_data->ic);
    im_ = aux_ext_data->im;
    ic_ = aux_ext_data->ic;
    xc_ = xc;

    palette_aux_Proc_LE_Notify(aux_ext_data);
    return True;
}

Here is the call graph for this function:

GdkFilterReturn xaux_ext_event_handler ( GdkXEvent *  gdk_xevent,
GdkEvent *  event,
gpointer  user_data 
)

Definition at line 88 of file palette_methods.c.

{
    XEvent *xevent = (XEvent *) gdk_xevent;

    switch (xevent->type) {
    case ClientMessage:
       xaux_ext_process_client_message((Display *) gDisplay,
                                   (XClientMessageEvent *) xevent);
       break;
    case SelectionClear:
       break;
    }
    return GDK_FILTER_CONTINUE;
}

Here is the call graph for this function:

int xaux_ext_register_classes ( GdkWindow *  window)

Definition at line 109 of file palette_methods.c.

{
    gDisplay = (Display *) GDK_WINDOW_XDISPLAY(window);
    gWindow = (Window) GDK_WINDOW_XWINDOW(window);

    /* Register aux class */
    if (xaux_ext_init_classes(gDisplay, (xaux_class_t *) & xaux_class, gWindow) == False)
       return False;

    return True;
}

Here is the call graph for this function:

Bool xaux_ext_Start ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 130 of file palette_methods.c.

{
    DEBUG_printf("ext_Start: im:%d, ic:%d\n", aux_ext_data->im,
               aux_ext_data->ic);
    im_ = aux_ext_data->im;
    ic_ = aux_ext_data->ic;
    xc_ = xc;

    /* inform Language Engine that PaletteAux has started. */
    /* Get Options Setting and send settings to Language engine. */
    palette_aux_Connect_To_LE_Request(gLocaleID);

    return True;
}

Here is the call graph for this function:


Variable Documentation

Display* gDisplay = NULL

Definition at line 39 of file palette_methods.c.

int gLocaleID = 0

Definition at line 38 of file palette_methods.c.

Window gWindow = 0

Definition at line 40 of file palette_methods.c.

int ic_ = 0

Definition at line 21 of file palette_methods.c.

int im_ = 0

Definition at line 20 of file palette_methods.c.

Definition at line 12 of file palette_main.c.

Initial value:
 {
    PALETTE_AUX_CLASS_NAME, 1,
    NULL,
    (Window) 0, (Window) 0, (Window) 0,
    (Atom) 0, (Atom) 0, (Atom) 0, (Atom) 0,
    {(Atom) 0}, ATOM_NUM_PALETTEAUX, 0,
    {(Atom) 0}, ATOM_NUM_PALETTEAUX, 0,
    NULL,
}

Definition at line 26 of file palette_methods.c.

Definition at line 19 of file palette_methods.c.