2008-06-06 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tests / dummyatk / my-atk-text.h
1 #ifndef MY_ATK_TEXT_H
2 #define MY_ATK_TEXT_H
3 /*
4  * MyAtkText: implements AtkText and AtkEditableText
5  */
6 #include <atk/atk.h>
7
8 #include "my-atk-object.h"
9         
10 #define MY_TYPE_ATK_TEXT             (my_atk_text_get_type ())
11 #define MY_ATK_TEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_TEXT, MyAtkText))
12 #define MY_ATK_TEXT_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_TEXT, MyAtkTextClass))
13 #define MY_IS_ATK_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_TEXT))
14 #define MY_IS_ATK_TEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_TEXT))
15 #define MY_ATK_TEXT_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_TEXT, MyAtkTextClass))
16
17 typedef struct _MyAtkText MyAtkText;
18 typedef struct _MyAtkTextClass MyAtkTextClass;
19
20 //Struct, describing bounds of one selection.
21 typedef struct
22 {
23     gint start_offset, end_offset;
24 }TextSelection;
25 //Struct, describing values, needed for determine extent of characters 
26 typedef struct
27 {
28     gint base_x, base_y;//coordinates of the top-left corner of text
29     gint pixels_above_line;
30     gint pixels_below_line;
31     gint size;//size of the character(height in pixels)
32     gint pixels_between_characters;//monoscaped font
33     gint width;//width of character
34 }TextBounds; 
35
36 struct _MyAtkText
37 {
38     MyAtkObject parent;
39     
40     gchar* str;//string, containing text
41     GList* attributes;//running atributes
42     AtkAttributeSet *default_attributes;//default attributes
43     
44     TextBounds bounds;
45     
46     GArray* selections;
47     
48     gint caret_offset;
49 };
50
51 struct _MyAtkTextClass
52 {
53     MyAtkObjectClass parent;
54     gchar* clipboard;
55 };
56
57 GType my_atk_text_get_type();
58
59 void my_atk_text_interface_init(gpointer g_iface, gpointer iface_data);
60 #endif /*MY_ATK_TEXT_H*/