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

« back to all changes in this revision

Viewing changes to uim/uim.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-07-06 22:17:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060706221724-6sobw1fcsxj647hp
Tags: 1:1.1.0-1.2
* Non-maintainer upload.
* Added -Wno-cast-align to CFLAGS, as per the RM's recommendations:

  < vorlon> Sesse: -Wno-cast-align and to hell with it :P

  Really fixes FTBFS. (Really Closes: #375081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
 
  Copyright (c) 2003,2004,2005 uim Project http://uim.freedesktop.org/
 
3
  Copyright (c) 2003-2006 uim Project http://uim.freedesktop.org/
4
4
 
5
5
  All rights reserved.
6
6
 
31
31
 
32
32
*/
33
33
 
34
 
#include "config.h"
 
34
#include <config.h>
 
35
 
35
36
#include <pwd.h>
36
37
#include <unistd.h>
37
38
#include <sys/types.h>
58
59
static uim_context context_array[CONTEXT_ARRAY_SIZE];
59
60
struct uim_im *uim_im_array;
60
61
int uim_nr_im;
 
62
 
61
63
static int uim_initialized;
62
64
 
63
65
void
140
142
  uc->mode = 0;
141
143
  /**/
142
144
  uc->propstr = NULL;
143
 
  uc->proplabelstr = NULL;
144
145
  /**/
145
146
  uc->preedit_clear_cb = NULL;
146
147
  uc->preedit_pushback_cb = NULL;
151
152
  uc->mode_update_cb = NULL;
152
153
  /**/
153
154
  uc->prop_list_update_cb  = NULL;
154
 
  uc->prop_label_update_cb = NULL;
155
155
  /**/
156
156
  uc->candidate_selector_activate_cb = NULL;
157
157
  uc->candidate_selector_select_cb = NULL;
163
163
  /**/
164
164
  uc->configuration_changed_cb = NULL;
165
165
  /**/
 
166
  uc->switch_app_global_im_cb = NULL;
 
167
  uc->switch_system_global_im_cb = NULL;
 
168
  /**/
166
169
  uc->nr_candidates = 0;
167
170
  uc->candidate_index = 0;
168
171
  /**/
213
216
}
214
217
 
215
218
void
 
219
uim_set_im_switch_request_cb(uim_context uc,
 
220
                             void (*sw_app_im_cb)(void *ptr, const char *name),
 
221
                             void (*sw_system_im_cb)(void *ptr, const char *name))
 
222
{
 
223
  uc->switch_app_global_im_cb = sw_app_im_cb;
 
224
  uc->switch_system_global_im_cb = sw_system_im_cb;
 
225
}
 
226
 
 
227
void
216
228
uim_switch_im(uim_context uc, const char *engine)
217
229
{
218
230
  /* related to the commit log of r1400:
268
280
    uc->modes[i] = NULL;
269
281
  }
270
282
  free(uc->propstr);
271
 
  free(uc->proplabelstr);
272
283
  free(uc->modes);
273
284
  free(uc->short_desc);
274
285
  free(uc->encoding);
306
317
  uc->mode_list_update_cb = update_cb;
307
318
}
308
319
 
309
 
 
310
320
void
311
321
uim_set_prop_list_update_cb(uim_context uc,
312
322
                            void (*update_cb)(void *ptr, const char *str))
314
324
  uc->prop_list_update_cb = update_cb;
315
325
}
316
326
 
317
 
 
 
327
/* Obsolete */
318
328
void
319
329
uim_set_prop_label_update_cb(uim_context uc,
320
330
                             void (*update_cb)(void *ptr, const char *str))
321
331
{
322
 
  uc->prop_label_update_cb = update_cb;
323
332
}
324
333
 
325
 
 
326
334
void
327
335
uim_prop_activate(uim_context uc, const char *str)
328
336
{
390
398
void
391
399
uim_prop_list_update(uim_context uc)
392
400
{
393
 
  if (uc && uc->propstr)
 
401
  if (uc && uc->propstr && uc->prop_list_update_cb)
394
402
    uc->prop_list_update_cb(uc->ptr, uc->propstr);
395
403
}
396
404
 
 
405
/* Obsolete */
397
406
void
398
407
uim_prop_label_update(uim_context uc)
399
408
{
400
 
  if (uc && uc->proplabelstr)
401
 
    uc->prop_label_update_cb(uc->ptr, uc->proplabelstr);
402
409
}
403
410
 
404
411
int
631
638
  char *scm_files = NULL;
632
639
  char *env = NULL;
633
640
 
634
 
  /*  if (is_setugid() == 0) {*/
 
641
  /*  if (!uim_issetugid()) {*/
635
642
    env = getenv("LIBUIM_VERBOSE");
636
643
    /*  }*/
637
644
  uim_scm_init(env);  /* init Scheme interpreter */
642
649
  uim_init_intl_subrs();
643
650
  uim_init_util_subrs();
644
651
  uim_init_plugin();
 
652
#ifdef ENABLE_ANTHY_STATIC
 
653
  uim_anthy_plugin_instance_init();
 
654
#endif
645
655
  uim_init_im_subrs();
646
656
  uim_init_key_subrs();
647
657
  
648
 
  if (is_setugid() == 0) {
 
658
  if (!uim_issetugid()) {
649
659
    scm_files = getenv("LIBUIM_SCM_FILES");
650
660
  }
651
661
  uim_scm_set_lib_path((scm_files) ? scm_files : SCM_FILES);
708
718
  }
709
719
  /**/
710
720
  uim_quit_plugin();
 
721
#ifdef ENABLE_ANTHY_STATIC
 
722
  uim_anthy_plugin_instance_quit();
 
723
#endif
711
724
  uim_scm_quit();
712
725
  free(uim_last_client_encoding);
713
726
  uim_last_client_encoding = NULL;