comparison include/ConvCtrlP.h @ 0:92745d501b9a

initial import from kinput2-v3.1
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 04:44:30 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92745d501b9a
1 /* $Id: ConvCtrlP.h,v 1.20 1999/05/06 09:07:53 ishisone Exp $ */
2 /*
3 * Copyright (c) 1990 Software Research Associates, Inc.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation for any purpose and without fee is hereby granted, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Software Research Associates not be
10 * used in advertising or publicity pertaining to distribution of the
11 * software without specific, written prior permission. Software Research
12 * Associates makes no representations about the suitability of this software
13 * for any purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * Author: Makoto Ishisone, Software Research Associates, Inc., Japan
17 */
18
19 #ifndef _ConversionControlP_h
20 #define _ConversionControlP_h
21
22 #include <X11/ShellP.h>
23 #include "ConvCtrl.h"
24 #include "ICtypes.h"
25
26 #define XtREventSelectMethod "EventSelectMethod"
27
28 /*
29 * generic conversion control widget data structure
30 */
31
32 typedef struct {
33 void (*Startup)();
34 void (*Finish)();
35 void (*ChangeAttributes)();
36 void (*ChangeFocus)();
37 void (*TextChange)();
38 void (*Fix)();
39 void (*ModeChange)();
40 void (*SelectionControl)();
41 void (*AuxControl)();
42 } ConversionControlClassPart;
43
44 typedef struct _ConversionControlClassRec {
45 CoreClassPart core_class;
46 CompositeClassPart composite_class;
47 ShellClassPart shell_class;
48 WMShellClassPart wm_shell_class;
49 VendorShellClassPart vendor_shell_class;
50 TransientShellClassPart transient_shell_class;
51 ConversionControlClassPart conversionControl_class;
52 } ConversionControlClassRec;
53
54 extern ConversionControlClassRec conversionControlClassRec;
55
56 typedef struct {
57 /* resources */
58 Widget inputobj;
59 WidgetClass inputobjclass;
60 WidgetClass displayobjclass;
61 WidgetClass selectionwidgetclass;
62 Window clientwindow; /* READ ONLY RESOURCE */
63 Window focuswindow; /* READ ONLY RESOURCE */
64 Cursor cursor;
65 EventSelectMethod eventselectmethod;
66 Atom textencoding;
67 XtCallbackList textcallback;
68 XtCallbackList newtextcallback;
69 XtCallbackList endcallback;
70 XtCallbackList unusedeventcallback;
71 Boolean sendbackKeyPress; /* whether unused keypress events are
72 * sent back to the focus window or not
73 */
74 Dimension titlebarheight; /* height of a titlebar attached to
75 * popup shells (mode/selection/aux)
76 */
77 /* private state */
78 Boolean active; /* Am I active (i.e. doing conversion) now? */
79 Boolean notext; /* true iff there is no convertion text */
80 Window oldclientwindow; /* the last client window */
81 Position client_rootx; /* client window position */
82 Position client_rooty;
83 XWindowAttributes client_attr; /* client window attributes */
84 XWindowAttributes focus_attr; /* focus window attributes */
85 Window probewindow; /* window for event interception */
86 Boolean createinputobj;
87 Boolean eventused;
88 Boolean endnotify; /* endNotify callback is called */
89 } ConversionControlPart;
90
91 typedef struct _ConversionControlRec {
92 CorePart core;
93 CompositePart composite;
94 ShellPart shell;
95 WMShellPart wm;
96 VendorShellPart vendor;
97 TransientShellPart transient;
98 ConversionControlPart ccontrol;
99 } ConversionControlRec;
100
101 #define XtInheritStartup (void(*)())_XtInherit
102 #define XtInheritFinish (void(*)())_XtInherit
103 #define XtInheritChangeAttributes (void(*)())_XtInherit
104 #define XtInheritChangeFocus (void(*)())_XtInherit
105 #define XtInheritTextChange (void(*)())_XtInherit
106 #define XtInheritFix (void(*)())_XtInherit
107 #define XtInheritModeChange (void(*)())_XtInherit
108 #define XtInheritSelectionControl (void(*)())_XtInherit
109 #define XtInheritAuxControl (void(*)())_XtInherit
110
111 /*
112 * ConversionControlClass methods:
113 *
114 * void (*Startup)(Widget w, unsigned long mask, ConversionAttributes *attrs)
115 * called from CControlStartCoversion() at conversion startup.
116 * all the attributes specified in attrs and client window ID are
117 * guaranteed to be valid (ie you don't have to check their validity).
118 *
119 * void (*Finish)(Widget w)
120 * called from CControlEndConversion() at conversion finish.
121 * also called when the client window is destroyed, so take care
122 * of XErrors, namely BadWindow.
123 *
124 * void (*ChangeAttributes)(Widget w, unsigned long mask,
125 * ConversionAttributes *attrs)
126 * called from CControlChangeAttributes when conversion attributes
127 * are changed. like Startup, all the attributes are guaranteed to
128 * be valid.
129 *
130 * void (*ChangeFocus)(Widget w, int set)
131 * called from CControlChangeFocus at focus change. argument 'set'
132 * indicates the new focus state. if it is non-zero, focus is set,
133 * if it is zero, focus is unset.
134 *
135 * void (*TextChange)(Widget w)
136 * called when converting text has changed.
137 *
138 * void (*Fix)(Widget w, CCTextCallbackArg *arg)
139 * called when the text has been fixed.
140 *
141 * void (*ModeChange)(Widget w)
142 * called when input mode has changed.
143 *
144 * void (*SelectionControl)(Widget w, ICSelectionControlArg *arg)
145 * called to control candidate slection.
146 * see InputConv.h for type ICSelectionControlArg.
147 *
148 * void (*AuxControl)(Widget w, ICAuxControlArg *arg)
149 * called to control auxiliary area.
150 * see InputConv.h for type ICAuxControlArg.
151 */
152
153 #endif