1 /******************************************************************
2 
3          Copyright 1994, 1995 by Sun Microsystems, Inc.
4          Copyright 1993, 1994 by Hewlett-Packard Company
5 
6 Permission to use, copy, modify, distribute, and sell this software
7 and its documentation for any purpose is hereby granted without fee,
8 provided that the above copyright notice appear in all copies and
9 that both that copyright notice and this permission notice appear
10 in supporting documentation, and that the name of Sun Microsystems, Inc.
11 and Hewlett-Packard not be used in advertising or publicity pertaining to
12 distribution of the software without specific, written prior permission.
13 Sun Microsystems, Inc. and Hewlett-Packard make no representations about
14 the suitability of this software for any purpose.  It is provided "as is"
15 without express or implied warranty.
16 
17 SUN MICROSYSTEMS INC. AND HEWLETT-PACKARD COMPANY DISCLAIMS ALL
18 WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
20 SUN MICROSYSTEMS, INC. AND HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY
21 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
22 RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
23 CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
24 IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 
26   Author: Hidetoshi Tajima(tajima@Eng.Sun.COM) Sun Microsystems, Inc.
27 
28 ******************************************************************/
29 #ifndef _FCITX_IC_H_
30 #define _FCITX_IC_H_
31 
32 #include "fcitx/frontend.h"
33 
34 struct _FcitxXimFrontend;
35 
36 /**
37  * XIM Preedit Attributes
38  **/
39 typedef struct {
40     XRectangle      area;   /* area */
41     XRectangle      area_needed;    /* area needed */
42     XPoint          spot_location;  /* spot location */
43     Colormap        cmap;   /* colormap */
44     CARD32          foreground; /* foreground */
45     CARD32          background; /* background */
46     Pixmap          bg_pixmap;  /* background pixmap */
47     char           *base_font;  /* base font of fontset */
48     CARD32          line_space; /* line spacing */
49     Cursor          cursor; /* cursor */
50 } PreeditAttributes;
51 
52 /**
53  * XIM Status Attributes
54  **/
55 typedef struct {
56     XRectangle      area;   /* area */
57     XRectangle      area_needed;    /* area needed */
58     Colormap        cmap;   /* colormap */
59     CARD32          foreground; /* foreground */
60     CARD32          background; /* background */
61     Pixmap          bg_pixmap;  /* background pixmap */
62     char           *base_font;  /* base font of fontset */
63     CARD32          line_space; /* line spacing */
64     Cursor          cursor; /* cursor */
65 } StatusAttributes;
66 
67 /**
68  * Input Context for Fcitx XIM Frontend
69  **/
70 typedef struct _FcitxXimIC {
71     CARD16          id;     /* ic id */
72     INT32           input_style;    /* input style */
73     Window          client_win; /* client window */
74     Window          focus_win;  /* focus window */
75     char           *resource_name;  /* resource name */
76     char           *resource_class; /* resource class */
77     PreeditAttributes pre_attr; /* preedit attributes */
78     StatusAttributes sts_attr;  /* status attributes */
79 
80     CARD16 connect_id;
81     int bPreeditStarted;
82     uint onspot_preedit_length;
83     boolean bHasCursorLocation;
84     int offset_x;
85     int offset_y;
86 } FcitxXimIC;
87 
88 struct FcitxXimFrontend;
89 
90 void     XimCreateIC(void* arg, FcitxInputContext* context, void *priv);
91 void     XimDestroyIC(void* arg, FcitxInputContext* arg1);
92 boolean  XimCheckIC(void* arg, FcitxInputContext* arg1, void* arg2);
93 void     XimSetIC(struct _FcitxXimFrontend* xim, IMChangeICStruct * call_data);
94 void     XimGetIC(struct _FcitxXimFrontend* xim, IMChangeICStruct * call_data);
95 boolean  XimCheckICFromSameApplication(void* arg, FcitxInputContext* icToCheck, FcitxInputContext* ic);
96 
97 #endif
98 
99 // kate: indent-mode cstyle; space-indent on; indent-width 0;
100