~ubuntu-branches/ubuntu/precise/hime/precise

« back to all changes in this revision

Viewing changes to src/im-client/hime-im-client.h

  • Committer: Package Import Robot
  • Author(s): Yao Wei (魏銘廷)
  • Date: 2012-01-14 00:24:08 UTC
  • Revision ID: package-import@ubuntu.com-20120114002408-e79gagbeg1rt8npv
Tags: upstream-0.9.9
Import upstream version 0.9.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2011 Edward Der-Hua Liu, Hsin-Chu, Taiwan
 
2
 *
 
3
 * This library is free software; you can redistribute it and/or
 
4
 * modify it under the terms of the GNU Lesser General Public
 
5
 * License as published by the Free Software Foundation; either
 
6
 * version 2.1 of the License, or (at your option) any later version.
 
7
 *
 
8
 * This library is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public
 
14
 * License along with this library; if not, write to the Free Software
 
15
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
16
 */
 
17
 
 
18
#ifndef HIME_IM_CLIENT_H
 
19
#define HIME_IM_CLIENT_H
 
20
struct HIME_PASSWD;
 
21
 
 
22
typedef struct HIME_client_handle_S {
 
23
  int fd;
 
24
  Window client_win;    /* client window */
 
25
  u_int input_style;    /* input style */
 
26
  XPoint spot_location; /* spot location */
 
27
// below is private data, don't modify them.
 
28
  u_int flag;
 
29
  Display *disp;
 
30
  struct HIME_PASSWD *passwd;
 
31
  u_int seq;
 
32
} HIME_client_handle;
 
33
 
 
34
enum {
 
35
  FLAG_HIME_client_handle_has_focus = 1,
 
36
  FLAG_HIME_client_handle_use_preedit = 2,
 
37
  FLAG_HIME_client_handle_raise_window = 0x1000  // for mozilla, dirty fix
 
38
};
 
39
 
 
40
enum {
 
41
  FLAG_HIME_srv_ret_status_use_pop_up = 1    // If this is used, we don't need the dirty fix
 
42
};
 
43
 
 
44
 
 
45
#ifdef __cplusplus
 
46
extern "C" {
 
47
#endif
 
48
 
 
49
HIME_client_handle *hime_im_client_open(Display *disp);
 
50
void hime_im_client_close(HIME_client_handle *handle);
 
51
void hime_im_client_focus_in(HIME_client_handle *handle);
 
52
void hime_im_client_focus_out(HIME_client_handle *handle);
 
53
void hime_im_client_focus_out2(HIME_client_handle *handle, char **rstr);
 
54
void hime_im_client_set_window(HIME_client_handle *handle, Window win);
 
55
void hime_im_client_set_cursor_location(HIME_client_handle *handle,
 
56
                                        int x, int y);
 
57
/*  rstr returns UTF-8 encoded string, you should use 'free()' to free the
 
58
    memory.
 
59
 
 
60
    return boolean:
 
61
      FALSE : the key is rejected, should use client's own result(ASCII key).
 
62
      TRUE : the key is accepted, translated result is in rstr.
 
63
 */
 
64
int hime_im_client_forward_key_press(HIME_client_handle *handle,
 
65
                                          KeySym key, u_int state,
 
66
                                          char **rstr);
 
67
// return some state bits instead of TRUE/FALSE
 
68
int hime_im_client_forward_key_press2(HIME_client_handle *handle,
 
69
                                          KeySym key, u_int state,
 
70
                                          char **rstr);
 
71
int hime_im_client_forward_key_release(HIME_client_handle *handle,
 
72
                                          KeySym key, u_int state,
 
73
                                          char **rstr);
 
74
 
 
75
void hime_im_client_set_flags(HIME_client_handle *handle, int flags, int *ret_flags);
 
76
void hime_im_client_clear_flags(HIME_client_handle *handle, int flags, int *ret_flags);
 
77
 
 
78
void hime_im_client_reset(HIME_client_handle *handle);
 
79
void hime_im_client_message(HIME_client_handle *handle, char *message);
 
80
 
 
81
#include "hime-im-client-attr.h"
 
82
int hime_im_client_get_preedit(HIME_client_handle *handle, char **str, HIME_PREEDIT_ATTR att[], int *cursor, int *sub_comp_len);
 
83
 
 
84
Window find_hime_window(Display *dpy);
 
85
 
 
86
#ifdef __cplusplus
 
87
}
 
88
#endif
 
89
 
 
90
 
 
91
#endif