Back to index

im-sdk  12.3.91
gtkiiimwin.h
Go to the documentation of this file.
00001 #ifndef __GTK__IIIM_WIN_H
00002 #define __GTK__IIIM_WIN_H
00003 
00004 #include <gtk/gtk.h>
00005 
00006 #include "ime.h"
00007 
00008 #define CANDIDATES_POSITION_PREEDIT_CARET    0
00009 #define CANDIDATES_POSITION_IME              1
00010 #define CANDIDATES_POSITION_PREEDIT_RIGHT    2
00011 #define CANDIDATES_POSITION_PREEDIT_STARTS   3
00012 
00013 #define TITLE_ABOVE_CANDIDATES               0
00014 #define TITLE_BELOW_CANDIDATES               1
00015 #define TITLE_LEFT2_CANDIDATES               0
00016 #define TITLE_RIGHT2_CANDIDATES              1
00017 
00018 typedef struct _tagPCStyleAtomic {
00019   int    showSystemBar;
00020   int    followCursor;
00021   int    composite;
00022   int    showPageControl;
00023   int    ignoreCandidateTitle;
00024 
00025   // following 3 is useless when composite != 0
00026   int    candidateVertical;
00027   int    candidatePosition;
00028   int    candidateTitlePosition;  // useless when ignoreCandidateTitle != 0
00029 } TPCStyleAtomic;
00030 
00031 #define PC_STYLE_CUSTOM                     0
00032 #define PC_STYLE_ROOT                       1
00033 #define PC_STYLE_CLASSIC                    2
00034 #define PC_STYLE_TRADITIONAL                3
00035 #define PC_STYLE_MODERN                     4
00036 
00037 typedef struct _tagPCStyleOption {
00038     int             type;
00039     TPCStyleAtomic  customOption;
00040 } TPCStyleOption;
00041 
00042 typedef void* TIIimPCWin;
00043 
00044 TIIimPCWin createStockPreeditCandidatesWindows(int stockStyle);
00045 TIIimPCWin createPreeditCandidatesWindows(TPCStyleAtomic* style);
00046 //void recreateWindows(TIIimPCWin vpc, TPCStyleOption* pstyle);
00047 void freePreeditCandidatesWindows(TIIimPCWin vpc);
00048 
00049 void movePreedit(TIIimPCWin vpc, int cursor_x, int cursor_y, int cursor_w, int cursor_h);
00050 
00051 void showPreedit(TIIimPCWin vpc);
00052 void hidePreedit(TIIimPCWin vpc);
00053 void updatePreedit(TIIimPCWin vpc, const char* label, int caret, int candidate_start, int nfbs, ImeFeedbackRec*fbs);
00054 
00055 void showCandidates(TIIimPCWin vpc);
00056 void hideCandidates(TIIimPCWin vpc);
00057 void updateCandidates(TIIimPCWin vpc, int num, const char* candidates[], const char* title,
00058                       int firstIdx, int focusIdx, int total, int *p_fb_counts, ImeFeedbackRec **pfbs);
00059 
00060 int  isPCFollowCursor(TIIimPCWin vpc);
00061 int  is_pc_preedit_show(TIIimPCWin vpc);
00062 int  is_pc_candidates_show(TIIimPCWin vpc);
00063 
00064 TPCStyleOption* getStyles(TIIimPCWin vpc);
00065 void getPCCursorPosition(TIIimPCWin vpc, int *pcursor_x, int *pcursor_y, int *pcursor_w, int* pcursor_h);
00066 
00067 
00068 #define PC_PAGE_FIRST          0
00069 #define PC_PAGE_PREV           1
00070 #define PC_PAGE_NEXT           2
00071 #define PC_PAGE_LAST           3
00072 
00073 typedef void (*TIIimPCWinCallback)(TIIimPCWin vpc, int op);
00074 
00075 void registerStyleChangeCallback(TIIimPCWin vpc, TIIimPCWinCallback callback);
00076 void registerPageCallback(TIIimPCWin vpc, TIIimPCWinCallback callback);
00077 void registerSelectionCallback(TIIimPCWin vpc, TIIimPCWinCallback callback);
00078 void registerMoveCallback(TIIimPCWin vpc, TIIimPCWinCallback callback);
00079 
00080 
00081 #endif
00082