~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to uim/context.h

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2005-12-04 13:10:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051204131042-ktzc8b17zi7a3cw8
Tags: 1:0.4.9.1-1
* New upstream release
* libuim0-nox, libuim-nox-dev, and libuim0-dbg-nox is now obsolete.
  Because libuim0 does not depends on X11. They now become dummy package,
  therefore you can safely remove them.
* Add --enable-debug in configure again.
* debian/patches/08_fix_privilage_escalation_CVE_2005_3149: disabled.
* Fix Error on purge because update-uim-config is not found.
  (closes: Bug#339345)
* uim-qt: New package for Qt utilities for uim. qt-immodule does not
  contained yet because of Debian's Qt3 does not support immodule and
  because uim does not recognize libqt4-dev's headers properly. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
 
  Copyright (c) 2003,2004 uim Project http://uim.freedesktop.org/
 
3
  Copyright (c) 2003-2005 uim Project http://uim.freedesktop.org/
4
4
 
5
5
  All rights reserved.
6
6
 
17
17
     may be used to endorse or promote products derived from this software
18
18
     without specific prior written permission.
19
19
 
20
 
  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
20
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21
21
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
22
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
 
  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
23
  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24
24
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
25
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
26
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33
33
#ifndef _context_h_included_
34
34
#define _context_h_included_
35
35
 
 
36
#ifdef __cplusplus
 
37
extern "C" {
 
38
#endif
 
39
 
36
40
#include <stdio.h>
37
41
#include "config.h"
38
42
#include "gettext.h"
39
43
#include "uim.h"
40
44
#include "uim-scm.h"
41
 
#include "siod.h"
42
45
 
43
46
struct uim_im {
44
47
  char *name;
47
50
  char *short_desc;
48
51
};
49
52
 
50
 
struct cb_q {
51
 
  struct cb *first_cb;
52
 
  struct cb *tail_cb;
53
 
  int flushing;
54
 
};
55
 
 
56
53
struct uim_candidate_ {
57
54
  char *str;         /* candidate */
58
55
  char *heading_label;
117
114
  /* surrounding text */
118
115
  void (*request_surrounding_text_cb)(void *ptr);
119
116
  int (*delete_surrounding_text_cb)(void *ptr, int offset, int len);
120
 
  /* callback queue */
121
 
  struct cb_q cb_q;
122
117
  /* preedit segments array */
123
118
  struct preedit_segment *psegs;
124
119
  int nr_psegs;
125
120
};
126
121
 
127
 
enum {
128
 
  CAND_ACTIVATE_CB,
129
 
  CAND_SELECT_CB,
130
 
  CAND_DEACTIVATE_CB,
131
 
  COMMIT_CB,
132
 
  PREEDIT_CLEAR_CB,
133
 
  PREEDIT_PUSHBACK_CB,
134
 
  PREEDIT_UPDATE_CB,
135
 
  MODE_UPDATE_CB,
136
 
  MODE_LIST_UPDATE_CB,
137
 
  PROP_LABEL_UPDATE_CB,
138
 
  PROP_LIST_UPDATE_CB,
139
 
  CAND_SHIFT_PAGE_CB,
140
 
  REQUEST_SURROUNDING_CB,
141
 
  DELETE_SURROUNDING_CB
142
 
};
143
 
 
144
 
struct cb {
145
 
  int type;
146
 
  char *str;
147
 
  int n1, n2;
148
 
  struct cb *next;
149
 
};
150
 
 
151
122
 
152
123
#ifdef ENABLE_NLS
153
124
#define UIM_PREPARE_SAVING_TEXTDOMAIN_CODESET() \
154
 
    const char *orig_encoding, *client_encoding;
 
125
    char *enc, *orig_encoding = NULL; \
 
126
    const char *client_encoding;
155
127
#define UIM_SWITCH_TEXTDOMAIN_CODESET(uc) \
156
 
  orig_encoding = bind_textdomain_codeset(GETTEXT_PACKAGE, NULL); \
 
128
  if ((enc = bind_textdomain_codeset(GETTEXT_PACKAGE, NULL))) \
 
129
    orig_encoding = strdup(enc); \
157
130
  client_encoding = (uc) ? ((struct uim_context_ *)uc)->encoding : uim_last_client_encoding; \
158
131
  bind_textdomain_codeset(GETTEXT_PACKAGE, client_encoding);
159
132
#define UIM_RESTORE_TEXTDOMAIN_CODESET() \
160
 
  bind_textdomain_codeset(GETTEXT_PACKAGE, orig_encoding);
 
133
  bind_textdomain_codeset(GETTEXT_PACKAGE, orig_encoding); \
 
134
  free(orig_encoding);
161
135
#else  /* ENABLE_NLS */
162
136
#define UIM_PREPARE_SAVING_TEXTDOMAIN_CODESET()
163
137
#define UIM_SWITCH_TEXTDOMAIN_CODESET(uc)
171
145
      if (uc) \
172
146
        uim_eval_string(uc, sexp_str); \
173
147
      else \
174
 
        repl_c_string(sexp_str, 0, 1); \
 
148
        uim_scm_eval_c_string(sexp_str); \
175
149
 
176
150
#define UIM_EVAL_STRING(uc, sexp_str) \
177
151
  { \
264
238
/**/
265
239
uim_context
266
240
uim_find_context(int id);
 
241
void uim_scm_init(const char *verbose_level);
 
242
void uim_scm_quit(void);
 
243
 
 
244
#ifdef UIM_COMPAT_SCM
 
245
void uim_init_compat_scm_subrs(void);
 
246
#endif
267
247
void uim_init_key_subrs(void);
268
248
void uim_init_util_subrs(void);
 
249
#ifdef UIM_COMPAT_TABLE
269
250
void uim_init_table_subrs(void);
 
251
#endif
270
252
void uim_init_im_subrs(void);
271
 
 
272
 
/**/
273
 
void uim_init_skk_dic(void);
274
 
void uim_quit_skk_dic(void);
275
 
void uim_init_anthy(void);
276
 
void uim_quit_anthy(void);
277
 
void uim_init_prime(void);
278
 
void uim_quit_prime(void);
279
 
void uim_init_m17nlib(void);
280
 
void uim_quit_m17nlib(void);
281
 
 
282
 
/**/
283
 
char *uim_get_c_string(LISP str);
284
 
int uim_key_sym_to_int(LISP sym);
 
253
void uim_init_intl_subrs(void);
 
254
 
 
255
/**/
 
256
void uim_init_plugin(void);
 
257
void uim_quit_plugin(void);
285
258
 
286
259
int uim_iconv_is_convertible(const char *tocode, const char *fromcode);
287
260
void *uim_iconv_create(const char *tocode, const char *fromcode);
290
263
 
291
264
int uim_sizeof_sexp_str(const char *tmpl, ...);
292
265
void uim_eval_string(uim_context, char *str);
293
 
void uim_schedule_cb(uim_context, int type, char *str, int n1, int n2);
294
266
void uim_release_preedit_segments(uim_context uc);
295
267
void uim_update_preedit_segments(uim_context uc);
296
268
 
298
270
extern int uim_nr_im;
299
271
extern char *uim_last_client_encoding;
300
272
 
 
273
#ifdef __cplusplus
 
274
}
 
275
#endif
301
276
#endif