Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Functions
gtkiiimwin.h File Reference
#include <gtk/gtk.h>
#include "ime.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _tagPCStyleAtomic
struct  _tagPCStyleOption

Defines

#define CANDIDATES_POSITION_PREEDIT_CARET   0
#define CANDIDATES_POSITION_IME   1
#define CANDIDATES_POSITION_PREEDIT_RIGHT   2
#define CANDIDATES_POSITION_PREEDIT_STARTS   3
#define TITLE_ABOVE_CANDIDATES   0
#define TITLE_BELOW_CANDIDATES   1
#define TITLE_LEFT2_CANDIDATES   0
#define TITLE_RIGHT2_CANDIDATES   1
#define PC_STYLE_CUSTOM   0
#define PC_STYLE_ROOT   1
#define PC_STYLE_CLASSIC   2
#define PC_STYLE_TRADITIONAL   3
#define PC_STYLE_MODERN   4
#define PC_PAGE_FIRST   0
#define PC_PAGE_PREV   1
#define PC_PAGE_NEXT   2
#define PC_PAGE_LAST   3

Typedefs

typedef struct _tagPCStyleAtomic TPCStyleAtomic
typedef struct _tagPCStyleOption TPCStyleOption
typedef void * TIIimPCWin
typedef void(* TIIimPCWinCallback )(TIIimPCWin vpc, int op)

Functions

TIIimPCWin createStockPreeditCandidatesWindows (int stockStyle)
TIIimPCWin createPreeditCandidatesWindows (TPCStyleAtomic *style)
void freePreeditCandidatesWindows (TIIimPCWin vpc)
void movePreedit (TIIimPCWin vpc, int cursor_x, int cursor_y, int cursor_w, int cursor_h)
void showPreedit (TIIimPCWin vpc)
void hidePreedit (TIIimPCWin vpc)
void updatePreedit (TIIimPCWin vpc, const char *label, int caret, int candidate_start, int nfbs, ImeFeedbackRec *fbs)
void showCandidates (TIIimPCWin vpc)
void hideCandidates (TIIimPCWin vpc)
void updateCandidates (TIIimPCWin vpc, int num, const char *candidates[], const char *title, int firstIdx, int focusIdx, int total, int *p_fb_counts, ImeFeedbackRec **pfbs)
int isPCFollowCursor (TIIimPCWin vpc)
int is_pc_preedit_show (TIIimPCWin vpc)
int is_pc_candidates_show (TIIimPCWin vpc)
TPCStyleOptiongetStyles (TIIimPCWin vpc)
void getPCCursorPosition (TIIimPCWin vpc, int *pcursor_x, int *pcursor_y, int *pcursor_w, int *pcursor_h)
void registerStyleChangeCallback (TIIimPCWin vpc, TIIimPCWinCallback callback)
void registerPageCallback (TIIimPCWin vpc, TIIimPCWinCallback callback)
void registerSelectionCallback (TIIimPCWin vpc, TIIimPCWinCallback callback)
void registerMoveCallback (TIIimPCWin vpc, TIIimPCWinCallback callback)

Class Documentation

struct _tagPCStyleAtomic

Definition at line 18 of file gtkiiimwin.h.

Class Members
int candidatePosition
int candidateTitlePosition
int candidateVertical
int composite
int followCursor
int ignoreCandidateTitle
int showPageControl
int showSystemBar
struct _tagPCStyleOption

Definition at line 37 of file gtkiiimwin.h.

Collaboration diagram for _tagPCStyleOption:
Class Members
TPCStyleAtomic customOption
int type

Define Documentation

#define CANDIDATES_POSITION_IME   1

Definition at line 9 of file gtkiiimwin.h.

Definition at line 8 of file gtkiiimwin.h.

Definition at line 10 of file gtkiiimwin.h.

Definition at line 11 of file gtkiiimwin.h.

#define PC_PAGE_FIRST   0

Definition at line 68 of file gtkiiimwin.h.

#define PC_PAGE_LAST   3

Definition at line 71 of file gtkiiimwin.h.

#define PC_PAGE_NEXT   2

Definition at line 70 of file gtkiiimwin.h.

#define PC_PAGE_PREV   1

Definition at line 69 of file gtkiiimwin.h.

#define PC_STYLE_CLASSIC   2

Definition at line 33 of file gtkiiimwin.h.

#define PC_STYLE_CUSTOM   0

Definition at line 31 of file gtkiiimwin.h.

#define PC_STYLE_MODERN   4

Definition at line 35 of file gtkiiimwin.h.

#define PC_STYLE_ROOT   1

Definition at line 32 of file gtkiiimwin.h.

#define PC_STYLE_TRADITIONAL   3

Definition at line 34 of file gtkiiimwin.h.

#define TITLE_ABOVE_CANDIDATES   0

Definition at line 13 of file gtkiiimwin.h.

#define TITLE_BELOW_CANDIDATES   1

Definition at line 14 of file gtkiiimwin.h.

#define TITLE_LEFT2_CANDIDATES   0

Definition at line 15 of file gtkiiimwin.h.

#define TITLE_RIGHT2_CANDIDATES   1

Definition at line 16 of file gtkiiimwin.h.


Typedef Documentation

typedef void* TIIimPCWin

Definition at line 42 of file gtkiiimwin.h.

typedef void(* TIIimPCWinCallback)(TIIimPCWin vpc, int op)

Definition at line 73 of file gtkiiimwin.h.


Function Documentation

Definition at line 1172 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = (TRealIIimPCWin*)calloc(1, sizeof(TRealIIimPCWin));
    pc->cursor_x = pc->cursor_y = 0x80000000; //move to almost the center bottom

    if (pstyle == NULL) {
        pc->style.type = PC_STYLE_MODERN;
        pc->style.customOption = predefinedStyles[pc->style.type];
    } else {
        pc->style.type = PC_STYLE_CUSTOM;
        pc->style.customOption = *pstyle;
    }

    createWindows(pc);

    return pc;
}

Here is the call graph for this function:

Definition at line 1157 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = (TRealIIimPCWin*)calloc(1, sizeof(TRealIIimPCWin));
    pc->cursor_x = pc->cursor_y = 0x80000000; //move to almost the center bottom

    if (stockStyle < PC_STYLE_CUSTOM || stockStyle > PC_STYLE_MODERN)
        stockStyle = PC_STYLE_MODERN;
    pc->style.type = stockStyle;
    pc->style.customOption = predefinedStyles[stockStyle];

    createWindows(pc);

    return pc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1146 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = (TRealIIimPCWin*)vpc;
    if (pc) {
        if (pc->pMenu) freePCSysMenu(pc->pMenu);
        pc->pMenu = NULL;
        destroyWindows(pc);
        free(pc);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void getPCCursorPosition ( TIIimPCWin  vpc,
int *  pcursor_x,
int *  pcursor_y,
int *  pcursor_w,
int *  pcursor_h 
)

Definition at line 1984 of file gtkiiimwin.c.

{
    TRealIIimPCWin *pc = (TRealIIimPCWin *)vpc;
    *pcursor_x = pc->cursor_x;
    *pcursor_y = pc->cursor_y;
    *pcursor_w = pc->cursor_w;
    *pcursor_h = pc->cursor_h;
    return;
    //gtk_window_get_position(GTK_WINDOW(pc->preeditWin), px, py);
}

Here is the caller graph for this function:

Definition at line 2019 of file gtkiiimwin.c.

{
    return  &((TRealIIimPCWin *)vpc)->style;
}
void hideCandidates ( TIIimPCWin  vpc)

Definition at line 1528 of file gtkiiimwin.c.

{
    int i;
    TRealIIimPCWin* pc = vpc;

    if (pc->poping_up != 1) {
        pc->candidatesShow = 0;
        pc->candidatesRealShow = 0;

        gtk_widget_hide(pc->pageButtonBox);
        gtk_widget_hide(pc->candidatesTitleBox);
        gtk_widget_hide(pc->candidatesPackBox);
        updateCandidatesData(pc, 0, NULL, NULL, 0, 0, 0, 0, NULL);
        if (!is_pc_composite(pc)) {
            gtk_widget_hide(pc->candidatesWin);
            if (!is_pc_candidates_vertical(pc))
                gtk_window_set_resizable(GTK_WINDOW(pc->candidatesWin), FALSE);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hidePreedit ( TIIimPCWin  vpc)

Definition at line 1228 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = vpc;

    if (pc->poping_up != 1) {
        pc->preeditShow = 0;
        pc->preeditRealShow = 0;

        gtk_widget_hide (pc->preeditWin);
        updatePreeditData(vpc, "", 0, 0, 0, NULL);
        if (is_pc_composite(pc)) {
            gtk_window_set_resizable(GTK_WINDOW(pc->preeditWin), FALSE);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2034 of file gtkiiimwin.c.

{
    return  ((TRealIIimPCWin *)vpc)->candidatesShow;
}

Definition at line 2029 of file gtkiiimwin.c.

{
    return  ((TRealIIimPCWin *)vpc)->preeditShow;
}

Definition at line 2024 of file gtkiiimwin.c.

{
    return is_pc_follow_cursor((TRealIIimPCWin *)vpc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void movePreedit ( TIIimPCWin  vpc,
int  cursor_x,
int  cursor_y,
int  cursor_w,
int  cursor_h 
)

Definition at line 1264 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = vpc;
    int predx, predy, predw, predh;

    int sw = gdk_screen_get_width  ( gtk_widget_get_screen(pc->preeditWin) );
    int sh = gdk_screen_get_height ( gtk_widget_get_screen(pc->preeditWin) );

    if (pc && pc->preeditWin) {
        if (cursor_x == 0x80000000)
            cursor_x = sw/2 - 100;
        if (cursor_y == 0x80000000)
            cursor_y = sh - 180;

        pc->cursor_x = cursor_x;
        pc->cursor_y = cursor_y;
        pc->cursor_w = cursor_w;
        pc->cursor_h = cursor_h;

        gtk_window_get_position(GTK_WINDOW(pc->preeditWin), &predx, &predy);
        adjustPCWindows(pc, predx, predy, pc->preeditWin->allocation.width, pc->preeditWin->allocation.height);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void registerMoveCallback ( TIIimPCWin  vpc,
TIIimPCWinCallback  callback 
)

Definition at line 2013 of file gtkiiimwin.c.

Here is the caller graph for this function:

void registerPageCallback ( TIIimPCWin  vpc,
TIIimPCWinCallback  callback 
)

Definition at line 2001 of file gtkiiimwin.c.

Here is the caller graph for this function:

Definition at line 2007 of file gtkiiimwin.c.

Here is the caller graph for this function:

Definition at line 1995 of file gtkiiimwin.c.

Here is the caller graph for this function:

void showCandidates ( TIIimPCWin  vpc)

Definition at line 1430 of file gtkiiimwin.c.

{
    int i;
    TRealIIimPCWin* pc = vpc;

    pc->candidatesShow = 1;

    if (pc->candidatesCount == 0) {
        if (!is_pc_composite(pc))
            gtk_widget_hide(pc->candidatesWin);
        pc->candidatesRealShow = 0;
        gtk_widget_hide(pc->candidatesPackBox);
    } else {
        if (pc->candidatesRealShow > 1) { 
            if (!is_pc_composite(pc) && !is_pc_candidates_vertical(pc))
                gtk_window_set_resizable(GTK_WINDOW(pc->candidatesWin), TRUE);
        } else {
            pc->candidatesRealShow = 1;
            gtk_widget_show(pc->candidatesPackBox);
            if (!is_pc_composite(pc) && !is_pc_candidates_vertical(pc))
                gtk_window_set_resizable(GTK_WINDOW(pc->candidatesWin), FALSE);
            if (!is_pc_composite(pc))
                gtk_widget_show(pc->candidatesWin);
        }
    }

    if (is_pc_show_candidates_title(pc) && pc->bufCandidateTitle[0] != 0)
        gtk_widget_show(pc->candidatesTitleBox);
    else
        gtk_widget_hide(pc->candidatesTitleBox);

    if (is_pc_show_page_buttons(pc))
        gtk_widget_show(pc->pageButtonBox);
    else
        gtk_widget_hide(pc->pageButtonBox);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void showPreedit ( TIIimPCWin  vpc)

Definition at line 1206 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = vpc;

    pc->preeditShow = 1;
    if (im_label_get_text_length(IM_LABEL(pc->preeditLabel)) == 0) {
        gtk_widget_hide (pc->preeditWin);
        pc->preeditRealShow = 0;
        if (is_pc_composite(pc))
            gtk_window_set_resizable(GTK_WINDOW(pc->preeditWin), FALSE);
    } else {
        if (pc->preeditRealShow > 1) {
            if (is_pc_composite(pc))
                gtk_window_set_resizable(GTK_WINDOW(pc->preeditWin), TRUE);
        } else  {
            pc->preeditRealShow = 1;
            movePreedit(pc, pc->cursor_x, pc->cursor_y, pc->cursor_w, pc->cursor_h);
            gtk_widget_show(pc->preeditWin);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void updateCandidates ( TIIimPCWin  vpc,
int  num,
const char *  candidates[],
const char *  title,
int  firstIdx,
int  focusIdx,
int  total,
int *  p_fb_counts,
ImeFeedbackRec **  pfbs 
)

Definition at line 1550 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = vpc;

    updateCandidatesData(vpc, num, candidates, title, firstIdx, focusIdx, total, p_fb_counts, pfbs);

    if (is_pc_composite(pc) && pc->preeditShow && pc->preeditRealShow == 1) {
        pc->preeditRealShow = 2;
        showPreedit(pc);
        //gtk_window_set_resizable(GTK_WINDOW(pc->preeditWin), TRUE);
    }
   
    if (!is_pc_composite(pc) && num >0 && pc->candidatesRealShow == 1)
        pc->candidatesRealShow = 2;

    if (pc->candidatesShow)
        showCandidates(vpc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void updatePreedit ( TIIimPCWin  vpc,
const char *  label,
int  caret,
int  candidate_start,
int  nfbs,
ImeFeedbackRec fbs 
)

Definition at line 1417 of file gtkiiimwin.c.

{
    TRealIIimPCWin* pc = vpc;

    updatePreeditData(vpc, label, caret, candidate_start, nfbs, fbs);

    if (pc->bufPreedit[0] != 0 && pc->preeditShow && pc->preeditRealShow == 1)
        pc->preeditRealShow = 2;

    if (pc->preeditShow)
        showPreedit(pc);
}

Here is the call graph for this function:

Here is the caller graph for this function: