This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
forked from 5HARK/im-nimf-qt5
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nimf-im.h
98 lines (85 loc) · 3.92 KB
/
nimf-im.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
* nimf-im.h
* This file is part of Nimf.
*
* Copyright (C) 2015-2018 Hodong Kim <[email protected]>
*
* Nimf is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Nimf is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __NIMF_IM_H__
#define __NIMF_IM_H__
#if !defined (__NIMF_H_INSIDE__) && !defined (NIMF_COMPILATION)
#error "Only <nimf.h> can be included directly."
#endif
#include <glib-object.h>
#include "nimf-client.h"
#include "nimf-events.h"
#include "nimf-types.h"
G_BEGIN_DECLS
#define NIMF_TYPE_IM (nimf_im_get_type ())
#define NIMF_IM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_IM, NimfIM))
#define NIMF_IM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NIMF_TYPE_IM, NimfIMClass))
#define NIMF_IS_IM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_IM))
#define NIMF_IS_IM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NIMF_TYPE_IM))
#define NIMF_IM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_IM, NimfIMClass))
typedef struct _NimfIM NimfIM;
typedef struct _NimfIMClass NimfIMClass;
struct _NimfIM
{
NimfClient parent_instance;
gchar *preedit_string;
NimfPreeditAttr **preedit_attrs;
gint cursor_pos;
};
struct _NimfIMClass
{
/*< private >*/
NimfClientClass parent_class;
/*< public >*/
/* Signals */
void (*preedit_start) (NimfIM *im);
void (*preedit_end) (NimfIM *im);
void (*preedit_changed) (NimfIM *im);
void (*commit) (NimfIM *im, const gchar *str);
gboolean (*retrieve_surrounding) (NimfIM *im);
gboolean (*delete_surrounding) (NimfIM *im,
gint offset,
gint n_chars);
void (*beep) (NimfIM *im);
};
GType nimf_im_get_type (void) G_GNUC_CONST;
NimfIM *nimf_im_new (void);
void nimf_im_focus_in (NimfIM *im);
void nimf_im_focus_out (NimfIM *im);
void nimf_im_reset (NimfIM *im);
gboolean nimf_im_filter_event (NimfIM *im,
NimfEvent *event);
void nimf_im_get_preedit_string (NimfIM *im,
gchar **str,
NimfPreeditAttr ***attrs,
gint *cursor_pos);
void nimf_im_set_cursor_location (NimfIM *im,
const NimfRectangle *area);
void nimf_im_set_use_preedit (NimfIM *im,
gboolean use_preedit);
gboolean nimf_im_get_surrounding (NimfIM *im,
gchar **text,
gint *cursor_index);
void nimf_im_set_surrounding (NimfIM *im,
const char *text,
gint len,
gint cursor_index);
G_END_DECLS
#endif /* __NIMF_IM_H__ */