1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
4  *
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef MY_ATK_TEXT_H_
24 #define MY_ATK_TEXT_H_
25 
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <atk/atk.h>
29 
30 #include "my-atk-object.h"
31 #define MY_TYPE_ATK_TEXT             (my_atk_text_get_type ())
32 #define MY_ATK_TEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_TEXT, MyAtkText))
33 #define MY_ATK_TEXT_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_TEXT, MyAtkTextClass))
34 #define MY_IS_ATK_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_TEXT))
35 #define MY_IS_ATK_TEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_TEXT))
36 #define MY_ATK_TEXT_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_TEXT, MyAtkTextClass))
37 
38 typedef struct _MyAtkText MyAtkText;
39 typedef struct _MyAtkTextClass MyAtkTextClass;
40 
41 typedef void (* MyAtkTextFunc) (MyAtkText *obj);
42 
43 struct _MyAtkText {
44   MyAtkObject parent;
45   gchar *text;
46   gint caret_offset;
47   gint x;
48   gint y;
49   gint width;
50   gint height;
51   GList *selection;
52   AtkAttributeSet *attributes;
53 };
54 
55 struct _MyAtkTextClass {
56   MyAtkObjectClass parent;
57 };
58 
59 GType my_atk_text_get_type (void);
60 
61 guint my_atk_set_text (AtkText *obj,
62                        const gchar *text,
63                        const gint x,
64                        const gint y,
65                        const gint width,
66                        const gint height,
67                        AtkAttributeSet *attrSet);
68 
69 MyAtkText *my_atk_text_new (void);
70 
71 #endif /* MY_ATK_TEXT_H_ */
72