1 /*
2  * $Id: xjutil.h,v 1.2 2001/06/14 18:16:13 ura Exp $
3  */
4 
5 /*
6  * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
7  * This file is part of FreeWnn.
8  *
9  * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
10  * Copyright 1991, 1992 by Massachusetts Institute of Technology
11  *
12  * Author: OMRON SOFTWARE Co., Ltd. <freewnn@rd.kyoto.omronsoft.co.jp>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with GNU Emacs; see the file COPYING.  If not, write to the
26  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  *
28  * Commentary:
29  *
30  * Change log:
31  *
32  * Last modified date: 8,Feb.1999
33  *
34  * Code:
35  *
36  */
37 /*      Version 4.0
38  */
39 /*********
40 
41         dicserver.h
42 
43 *********/
44 
45 #include <X11/Xlib.h>
46 #include <X11/IntrinsicP.h>
47 #include <X11/Xutil.h>
48 #include <X11/Xatom.h>
49 #include <X11/keysym.h>
50 #ifdef X11R5
51 #include "Xi18nint.h"
52 #else
53 #include "Xlcint.h"
54 #include <X11/Xlocale.h>
55 #endif /* X11R5 */
56 #include "msg.h"
57 #include "xim.h"
58 /*
59 #include "rk_header.h"
60 #include "rk_multi.h"
61 */
62 
63 typedef struct _XjutilFSRec
64 {
65   XFontSet fs;
66   XCharStruct *b_char;
67   int act;
68   struct _XjutilFSRec *next;
69 }
70 XjutilFSRec;
71 
72 typedef XjutilFSRec *XjutilFSList;
73 
74 typedef struct _JutilTextRec
75 {
76   Window wp;
77   Window w;
78   Window wn[3];
79   long x;
80   long y;
81   long width;
82   long height;
83   long bp;
84   short max_columns;
85   short vst;
86   wchar *buf;
87   unsigned char *att;
88   short max_pos;
89   short currentcol;
90   short maxcolumns;
91   short note[2];
92   unsigned char cursor_flag;
93   unsigned char mark_flag;
94   unsigned char u_line_flag;
95   unsigned char r_flag;
96   unsigned char b_flag;
97 }
98 JutilTextRec;
99 
100 #define JCLIENTS        4
101 
102 typedef struct _JutilRec
103 {
104   Window w;
105   BoxRec *rk_mode;
106   BoxRec *title;
107   BoxRec *button[MAX_JU_BUTTON];
108   int max_button;
109   BoxRec *mes_button[JCLIENTS];
110   int mes_mode_return[JCLIENTS];
111   int max_mes;
112   JutilTextRec *mes_text[JCLIENTS];
113   int mode;
114   int mes_mode;
115   XPoint save_p;
116 }
117 JutilRec;
118 
119 typedef struct _Xjutil
120 {
121   char *lang;
122   char *lc_name;
123   unsigned int cswidth_id;
124 #ifdef X11R5
125   XLocale xlc;
126 #else
127   XLCd xlc;
128 #endif                          /* X11R5 */
129   int mode;                     /* ICHIRAN or JUTIL */
130   int screen_count;
131   XIMRootRec **root_pointer;
132   int default_screen;
133   short sel_ret;
134   char sel_button;
135   unsigned char work;
136   char save_under;
137 }
138 Xjutil;
139 
140 extern Display *dpy;
141 extern Atom select_id;
142 
143 #define FontWidth               (cur_fs->b_char->width)
144 #define FontAscent              (cur_fs->b_char->ascent)
145 #define FontDescent             (cur_fs->b_char->descent)
146 #define FontHeight              (FontAscent + FontDescent)
147 
148 #define print_out_func          (f_table->print_out_function)
149 #define input_func              (f_table->input_function)
150 #define call_t_redraw_move_func (f_table->call_t_redraw_move_function)
151 #define call_t_redraw_move_1_func (f_table->call_t_redraw_move_1_function)
152 #define call_t_redraw_move_2_func (f_table->call_t_redraw_move_2_function)
153 #define call_t_print_l_func     (f_table->call_t_print_l_function)
154 #define redraw_when_chmsig_func (f_table->redraw_when_chmsig_function)
155 #define char_len_func           (f_table->char_len_function)
156 #define char_q_len_func         (f_table->char_q_len_function)
157 #define t_redraw_move_func      (f_table->t_redraw_move_function)
158 #define t_print_l_func          (f_table->t_print_l_function)
159 #define c_top_func              (f_table->c_top_function)
160 #define c_end_func              (f_table->c_end_function)
161 #define c_end_nobi_func         (f_table->c_end_nobi_function)
162 #define hani_settei_func        (f_table->hani_settei_function)
163 
164 #define cur_env                 (env_is_reverse? cur_reverse_env->env: cur_normal_env->env)
165