atk 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +225 -0
- data/README +30 -0
- data/Rakefile +67 -0
- data/extconf.rb +59 -0
- data/src/lib/atk.rb +2 -0
- data/src/makeinits.rb +39 -0
- data/src/rbatk.c +27 -0
- data/src/rbatk.h +36 -0
- data/src/rbatkaction.c +81 -0
- data/src/rbatkcomponent.c +184 -0
- data/src/rbatkdocument.c +95 -0
- data/src/rbatkeditabletext.c +102 -0
- data/src/rbatkgobjectaccessible.c +37 -0
- data/src/rbatkhyperlink.c +92 -0
- data/src/rbatkhypertext.c +44 -0
- data/src/rbatkimage.c +62 -0
- data/src/rbatkimplementor.c +27 -0
- data/src/rbatkinits.c +55 -0
- data/src/rbatknoopobject.c +30 -0
- data/src/rbatknoopobjectfactory.c +30 -0
- data/src/rbatkobject.c +178 -0
- data/src/rbatkobjectfactory.c +44 -0
- data/src/rbatkregistry.c +55 -0
- data/src/rbatkrelation.c +104 -0
- data/src/rbatkrelationset.c +94 -0
- data/src/rbatkselection.c +82 -0
- data/src/rbatkstate.c +41 -0
- data/src/rbatkstateset.c +143 -0
- data/src/rbatkstreamablecontent.c +50 -0
- data/src/rbatktable.c +292 -0
- data/src/rbatktext.c +364 -0
- data/src/rbatktextrange.c +91 -0
- data/src/rbatktextrectangle.c +156 -0
- data/src/rbatkutil.c +125 -0
- data/src/rbatkvalue.c +74 -0
- data/src/rbatkversion.h +24 -0
- metadata +125 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/************************************************
|
3
|
+
|
4
|
+
rbatktextrange.c -
|
5
|
+
|
6
|
+
$Author: sakai $
|
7
|
+
$Date: 2007/07/16 03:01:02 $
|
8
|
+
|
9
|
+
Copyright (C) 2004 Masao Mutoh
|
10
|
+
|
11
|
+
This file is derived from rbgdkrange.c.
|
12
|
+
rbgdkrange.c -
|
13
|
+
Copyright (C) 2002,2003 Masao Mutoh
|
14
|
+
|
15
|
+
rbgdkrange.c file is derived from rbgdkregion.c.
|
16
|
+
rbgdkregion.c -
|
17
|
+
Copyright (C) 1998-2000 Yukihiro Matsumoto,
|
18
|
+
Daisuke Kanda,
|
19
|
+
Hiroshi Igarashi
|
20
|
+
************************************************/
|
21
|
+
|
22
|
+
#include "rbatk.h"
|
23
|
+
|
24
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
25
|
+
#define _SELF(r) ((AtkTextRange*)RVAL2BOXED(r, ATK_TYPE_TEXT_RANGE))
|
26
|
+
|
27
|
+
/**********************************/
|
28
|
+
static AtkTextRange*
|
29
|
+
atk_text_range_copy(const AtkTextRange* val)
|
30
|
+
{
|
31
|
+
AtkTextRange* new_val;
|
32
|
+
g_return_val_if_fail (val != NULL, NULL);
|
33
|
+
new_val = g_new(AtkTextRange, 1);
|
34
|
+
*new_val = *val;
|
35
|
+
return new_val;
|
36
|
+
}
|
37
|
+
|
38
|
+
GType
|
39
|
+
atk_text_range_get_type(void)
|
40
|
+
{
|
41
|
+
static GType our_type = 0;
|
42
|
+
|
43
|
+
if (our_type == 0)
|
44
|
+
our_type = g_boxed_type_register_static ("AtkTextRange",
|
45
|
+
(GBoxedCopyFunc)atk_text_range_copy,
|
46
|
+
(GBoxedFreeFunc)g_free);
|
47
|
+
return our_type;
|
48
|
+
}
|
49
|
+
/**********************************/
|
50
|
+
/* Struct accessors */
|
51
|
+
static VALUE
|
52
|
+
atktextrange_bounds(self)
|
53
|
+
VALUE self;
|
54
|
+
{
|
55
|
+
return BOXED2RVAL(&_SELF(self)->bounds, ATK_TYPE_TEXT_RECTANGLE);
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
atktextrange_start_offset(self)
|
60
|
+
VALUE self;
|
61
|
+
{
|
62
|
+
return INT2NUM(_SELF(self)->start_offset);
|
63
|
+
}
|
64
|
+
|
65
|
+
static VALUE
|
66
|
+
atktextrange_end_offset(self)
|
67
|
+
VALUE self;
|
68
|
+
{
|
69
|
+
return INT2NUM(_SELF(self)->end_offset);
|
70
|
+
}
|
71
|
+
|
72
|
+
static VALUE
|
73
|
+
atktextrange_content(self)
|
74
|
+
VALUE self;
|
75
|
+
{
|
76
|
+
return CSTR2RVAL(_SELF(self)->content);
|
77
|
+
}
|
78
|
+
#endif
|
79
|
+
|
80
|
+
void
|
81
|
+
Init_atk_text_range()
|
82
|
+
{
|
83
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
84
|
+
VALUE range = G_DEF_CLASS(ATK_TYPE_TEXT_RANGE, "TextRange", mAtk);
|
85
|
+
|
86
|
+
rb_define_method(range, "bounds", atktextrange_bounds, 0);
|
87
|
+
rb_define_method(range, "start_offset", atktextrange_start_offset, 0);
|
88
|
+
rb_define_method(range, "end_offset", atktextrange_end_offset, 0);
|
89
|
+
rb_define_method(range, "content", atktextrange_content, 0);
|
90
|
+
#endif
|
91
|
+
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/************************************************
|
3
|
+
|
4
|
+
rbatktextrectangle.c -
|
5
|
+
|
6
|
+
$Author: mutoh $
|
7
|
+
$Date: 2004/10/19 13:33:43 $
|
8
|
+
|
9
|
+
Copyright (C) 2004 Masao Mutoh
|
10
|
+
|
11
|
+
This file is derived from rbgdkrectangle.c.
|
12
|
+
rbgdkrectangle.c -
|
13
|
+
Copyright (C) 2002,2003 Masao Mutoh
|
14
|
+
|
15
|
+
rbgdkrectangle.c file is derived from rbgdkregion.c.
|
16
|
+
rbgdkregion.c -
|
17
|
+
Copyright (C) 1998-2000 Yukihiro Matsumoto,
|
18
|
+
Daisuke Kanda,
|
19
|
+
Hiroshi Igarashi
|
20
|
+
************************************************/
|
21
|
+
|
22
|
+
#include "rbatk.h"
|
23
|
+
|
24
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
25
|
+
#define _SELF(r) ((AtkTextRectangle*)RVAL2BOXED(r, ATK_TYPE_TEXT_RECTANGLE))
|
26
|
+
|
27
|
+
/**********************************/
|
28
|
+
static AtkTextRectangle*
|
29
|
+
atk_text_rectangle_copy(const AtkTextRectangle* val)
|
30
|
+
{
|
31
|
+
AtkTextRectangle* new_val;
|
32
|
+
g_return_val_if_fail (val != NULL, NULL);
|
33
|
+
new_val = g_new(AtkTextRectangle, 1);
|
34
|
+
*new_val = *val;
|
35
|
+
return new_val;
|
36
|
+
}
|
37
|
+
|
38
|
+
GType
|
39
|
+
atk_text_rectangle_get_type(void)
|
40
|
+
{
|
41
|
+
static GType our_type = 0;
|
42
|
+
|
43
|
+
if (our_type == 0)
|
44
|
+
our_type = g_boxed_type_register_static ("AtkTextRectangle",
|
45
|
+
(GBoxedCopyFunc)atk_text_rectangle_copy,
|
46
|
+
(GBoxedFreeFunc)g_free);
|
47
|
+
return our_type;
|
48
|
+
}
|
49
|
+
/**********************************/
|
50
|
+
|
51
|
+
static VALUE
|
52
|
+
atktextrect_initialize(self, x, y, width, height)
|
53
|
+
VALUE self, x, y, width, height;
|
54
|
+
{
|
55
|
+
AtkTextRectangle new;
|
56
|
+
|
57
|
+
new.x = NUM2INT(x);
|
58
|
+
new.y = NUM2INT(y);
|
59
|
+
new.width = NUM2INT(width);
|
60
|
+
new.height = NUM2INT(height);
|
61
|
+
|
62
|
+
G_INITIALIZE(self, &new);
|
63
|
+
return Qnil;
|
64
|
+
}
|
65
|
+
|
66
|
+
/* Struct accessors */
|
67
|
+
static VALUE
|
68
|
+
atktextrect_x(self)
|
69
|
+
VALUE self;
|
70
|
+
{
|
71
|
+
return INT2NUM(_SELF(self)->x);
|
72
|
+
}
|
73
|
+
|
74
|
+
static VALUE
|
75
|
+
atktextrect_y(self)
|
76
|
+
VALUE self;
|
77
|
+
{
|
78
|
+
return INT2NUM(_SELF(self)->y);
|
79
|
+
}
|
80
|
+
|
81
|
+
static VALUE
|
82
|
+
atktextrect_w(self)
|
83
|
+
VALUE self;
|
84
|
+
{
|
85
|
+
return INT2NUM(_SELF(self)->width);
|
86
|
+
}
|
87
|
+
|
88
|
+
static VALUE
|
89
|
+
atktextrect_h(self)
|
90
|
+
VALUE self;
|
91
|
+
{
|
92
|
+
return INT2NUM(_SELF(self)->height);
|
93
|
+
}
|
94
|
+
|
95
|
+
static VALUE
|
96
|
+
atktextrect_set_x(self, x)
|
97
|
+
VALUE self, x;
|
98
|
+
{
|
99
|
+
_SELF(self)->x = NUM2INT(x);
|
100
|
+
return self;
|
101
|
+
}
|
102
|
+
|
103
|
+
static VALUE
|
104
|
+
atktextrect_set_y(self, y)
|
105
|
+
VALUE self, y;
|
106
|
+
{
|
107
|
+
_SELF(self)->y = NUM2INT(y);
|
108
|
+
return self;
|
109
|
+
}
|
110
|
+
|
111
|
+
static VALUE
|
112
|
+
atktextrect_set_w(self, width)
|
113
|
+
VALUE self, width;
|
114
|
+
{
|
115
|
+
_SELF(self)->width = NUM2INT(width);
|
116
|
+
return self;
|
117
|
+
}
|
118
|
+
|
119
|
+
static VALUE
|
120
|
+
atktextrect_set_h(self, height)
|
121
|
+
VALUE self, height;
|
122
|
+
{
|
123
|
+
_SELF(self)->height = NUM2INT(height);
|
124
|
+
return self;
|
125
|
+
}
|
126
|
+
|
127
|
+
static VALUE
|
128
|
+
atktextrect_to_a(self)
|
129
|
+
VALUE self;
|
130
|
+
{
|
131
|
+
AtkTextRectangle* a = _SELF(self);
|
132
|
+
return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y),
|
133
|
+
INT2FIX(a->width), INT2FIX(a->height));
|
134
|
+
}
|
135
|
+
#endif
|
136
|
+
|
137
|
+
void
|
138
|
+
Init_atk_text_rectangle()
|
139
|
+
{
|
140
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
141
|
+
VALUE rect = G_DEF_CLASS(ATK_TYPE_TEXT_RECTANGLE, "TextRectangle", mAtk);
|
142
|
+
|
143
|
+
rb_define_method(rect, "initialize", atktextrect_initialize, 4);
|
144
|
+
rb_define_method(rect, "x", atktextrect_x, 0);
|
145
|
+
rb_define_method(rect, "y", atktextrect_y, 0);
|
146
|
+
rb_define_method(rect, "width", atktextrect_w, 0);
|
147
|
+
rb_define_method(rect, "height", atktextrect_h, 0);
|
148
|
+
rb_define_method(rect, "set_x", atktextrect_set_x, 1);
|
149
|
+
rb_define_method(rect, "set_y", atktextrect_set_y, 1);
|
150
|
+
rb_define_method(rect, "set_width", atktextrect_set_w, 1);
|
151
|
+
rb_define_method(rect, "set_height", atktextrect_set_h, 1);
|
152
|
+
rb_define_method(rect, "to_a", atktextrect_to_a, 0);
|
153
|
+
|
154
|
+
G_DEF_SETTERS(rect);
|
155
|
+
#endif
|
156
|
+
}
|
data/src/rbatkutil.c
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/************************************************
|
3
|
+
|
4
|
+
rbatkutil.c -
|
5
|
+
|
6
|
+
$Author: sakai $
|
7
|
+
$Date: 2007/07/08 02:51:52 $
|
8
|
+
|
9
|
+
Copyright (C) 2004 Masao Mutoh
|
10
|
+
************************************************/
|
11
|
+
|
12
|
+
#include "rbatk.h"
|
13
|
+
|
14
|
+
static ID id_call;
|
15
|
+
|
16
|
+
/* How can I implement them?
|
17
|
+
guint atk_add_focus_tracker (AtkEventListener focus_tracker);
|
18
|
+
void atk_remove_focus_tracker (guint tracker_id);
|
19
|
+
void atk_focus_tracker_init (AtkEventListenerInit add_function);
|
20
|
+
void (*AtkEventListener) (AtkObject*);
|
21
|
+
void (*AtkEventListenerInit) (void);
|
22
|
+
guint atk_add_global_event_listener (GSignalEmissionHook listener,
|
23
|
+
const gchar *event_type);
|
24
|
+
void atk_remove_global_event_listener
|
25
|
+
(guint listener_id);
|
26
|
+
*/
|
27
|
+
|
28
|
+
static VALUE
|
29
|
+
rbatk_focus_tracker_notify(self, obj)
|
30
|
+
VALUE self, obj;
|
31
|
+
{
|
32
|
+
atk_focus_tracker_notify(ATK_OBJECT(RVAL2GOBJ(obj)));
|
33
|
+
return self;
|
34
|
+
}
|
35
|
+
|
36
|
+
static gint
|
37
|
+
key_snoop_func(AtkKeyEventStruct* event, gpointer func)
|
38
|
+
{
|
39
|
+
VALUE ret = rb_funcall((VALUE)func, id_call, 7,
|
40
|
+
INT2NUM(event->type), UINT2NUM(event->state),
|
41
|
+
UINT2NUM(event->keyval), INT2NUM(event->length),
|
42
|
+
CSTR2RVAL(event->string), UINT2NUM(event->keycode),
|
43
|
+
UINT2NUM(event->timestamp));
|
44
|
+
return NUM2INT(ret);
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rbatk_add_key_event_listener(self)
|
49
|
+
VALUE self;
|
50
|
+
{
|
51
|
+
guint ret;
|
52
|
+
VALUE func = rb_block_proc();
|
53
|
+
G_RELATIVE(self, func);
|
54
|
+
ret = atk_add_key_event_listener((AtkKeySnoopFunc)key_snoop_func, (gpointer)func);
|
55
|
+
return UINT2NUM(ret);
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rbatk_remove_key_event_listener(self, id)
|
60
|
+
VALUE self, id;
|
61
|
+
{
|
62
|
+
atk_remove_key_event_listener(NUM2UINT(id));
|
63
|
+
return self;
|
64
|
+
}
|
65
|
+
|
66
|
+
static VALUE
|
67
|
+
rbatk_get_root(self)
|
68
|
+
VALUE self;
|
69
|
+
{
|
70
|
+
return GOBJ2RVAL(atk_get_root());
|
71
|
+
}
|
72
|
+
|
73
|
+
#if ATK_CHECK_VERSION(1,6,0)
|
74
|
+
static VALUE
|
75
|
+
rbatk_get_focus_object(self)
|
76
|
+
VALUE self;
|
77
|
+
{
|
78
|
+
return GOBJ2RVAL(atk_get_focus_object());
|
79
|
+
}
|
80
|
+
#endif
|
81
|
+
|
82
|
+
static VALUE
|
83
|
+
rbatk_get_toolkit_name(self)
|
84
|
+
VALUE self;
|
85
|
+
{
|
86
|
+
return CSTR2RVAL(atk_get_toolkit_name());
|
87
|
+
}
|
88
|
+
|
89
|
+
static VALUE
|
90
|
+
rbatk_get_toolkit_version(self)
|
91
|
+
VALUE self;
|
92
|
+
{
|
93
|
+
return CSTR2RVAL(atk_get_toolkit_version());
|
94
|
+
}
|
95
|
+
|
96
|
+
void
|
97
|
+
Init_atk_util()
|
98
|
+
{
|
99
|
+
VALUE coord;
|
100
|
+
|
101
|
+
VALUE util = G_DEF_CLASS(ATK_TYPE_UTIL, "Util", mAtk);
|
102
|
+
|
103
|
+
id_call = rb_intern("call");
|
104
|
+
|
105
|
+
rb_define_singleton_method(util, "focus_tracker_notify", rbatk_focus_tracker_notify, 1);
|
106
|
+
rb_define_singleton_method(util, "add_key_event_listener", rbatk_add_key_event_listener, 0);
|
107
|
+
rb_define_singleton_method(util, "remove_key_event_listener", rbatk_remove_key_event_listener, 1);
|
108
|
+
|
109
|
+
rb_define_singleton_method(util, "root", rbatk_get_root, 0);
|
110
|
+
#if ATK_CHECK_VERSION(1,6,0)
|
111
|
+
rb_define_singleton_method(util, "focus_object", rbatk_get_focus_object, 0);
|
112
|
+
#endif
|
113
|
+
rb_define_singleton_method(util, "toolkit_name", rbatk_get_toolkit_name, 0);
|
114
|
+
rb_define_singleton_method(util, "toolkit_version", rbatk_get_toolkit_version, 0);
|
115
|
+
rb_define_singleton_method(util, "toolkit_version", rbatk_get_toolkit_version, 0);
|
116
|
+
|
117
|
+
/* AtkCoordType */
|
118
|
+
coord = G_DEF_CLASS(ATK_TYPE_COORD_TYPE, "CoordType", util);
|
119
|
+
G_DEF_CONSTANTS(util, ATK_TYPE_COORD_TYPE, "ATK_");
|
120
|
+
|
121
|
+
/* AtkKeyEventType */
|
122
|
+
coord = G_DEF_CLASS(ATK_TYPE_KEY_EVENT_TYPE, "KeyEventType", util);
|
123
|
+
G_DEF_CONSTANTS(util, ATK_TYPE_KEY_EVENT_TYPE, "ATK_");
|
124
|
+
|
125
|
+
}
|
data/src/rbatkvalue.c
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/************************************************
|
3
|
+
|
4
|
+
rbatkvalue.c -
|
5
|
+
|
6
|
+
$Author: mutoh $
|
7
|
+
$Date: 2003/12/23 15:59:28 $
|
8
|
+
|
9
|
+
Copyright (C) 2003 Masao Mutoh
|
10
|
+
************************************************/
|
11
|
+
|
12
|
+
#include "rbatk.h"
|
13
|
+
|
14
|
+
#define _SELF(s) (ATK_VALUE(RVAL2GOBJ(s)))
|
15
|
+
|
16
|
+
static VALUE
|
17
|
+
rbatk_value_get_current_value(self)
|
18
|
+
VALUE self;
|
19
|
+
{
|
20
|
+
GValue gval = {0,};
|
21
|
+
atk_value_get_current_value(_SELF(self), &gval);
|
22
|
+
|
23
|
+
return GVAL2RVAL(&gval);
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rbatk_value_get_maximum_value(self)
|
29
|
+
VALUE self;
|
30
|
+
{
|
31
|
+
GValue gval = {0,};
|
32
|
+
atk_value_get_maximum_value(_SELF(self), &gval);
|
33
|
+
|
34
|
+
return GVAL2RVAL(&gval);
|
35
|
+
}
|
36
|
+
|
37
|
+
static VALUE
|
38
|
+
rbatk_value_get_minimum_value(self)
|
39
|
+
VALUE self;
|
40
|
+
{
|
41
|
+
GValue gval = {0,};
|
42
|
+
atk_value_get_minimum_value(_SELF(self), &gval);
|
43
|
+
|
44
|
+
return GVAL2RVAL(&gval);
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rbatk_value_set_current_value(self, value)
|
49
|
+
VALUE self, value;
|
50
|
+
{
|
51
|
+
GValue gval = {0,};
|
52
|
+
g_value_init(&gval, RVAL2GTYPE(value));
|
53
|
+
|
54
|
+
rbgobj_rvalue_to_gvalue(value, &gval);
|
55
|
+
|
56
|
+
if (! atk_value_set_current_value(_SELF(self), &gval)){
|
57
|
+
rb_raise(rb_eRuntimeError, "Can't set the current value.");
|
58
|
+
}
|
59
|
+
|
60
|
+
return self;
|
61
|
+
}
|
62
|
+
|
63
|
+
void
|
64
|
+
Init_atk_value()
|
65
|
+
{
|
66
|
+
VALUE mValue = G_DEF_INTERFACE(ATK_TYPE_VALUE, "Value", mAtk);
|
67
|
+
|
68
|
+
rb_define_method(mValue, "current", rbatk_value_get_current_value, 0);
|
69
|
+
rb_define_method(mValue, "max", rbatk_value_get_maximum_value, 0);
|
70
|
+
rb_define_method(mValue, "min", rbatk_value_get_minimum_value, 0);
|
71
|
+
rb_define_method(mValue, "set_current", rbatk_value_set_current_value, 1);
|
72
|
+
|
73
|
+
G_DEF_SETTERS(mValue);
|
74
|
+
}
|
data/src/rbatkversion.h
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/************************************************
|
3
|
+
|
4
|
+
rbatkversion.h -
|
5
|
+
|
6
|
+
This file was generated by mkmf-gnome2.rb.
|
7
|
+
|
8
|
+
************************************************/
|
9
|
+
|
10
|
+
#ifndef __RBATK_VERSION_H__
|
11
|
+
#define __RBATK_VERSION_H__
|
12
|
+
|
13
|
+
#define ATK_MAJOR_VERSION (1)
|
14
|
+
#define ATK_MINOR_VERSION (26)
|
15
|
+
#define ATK_MICRO_VERSION (0)
|
16
|
+
|
17
|
+
#define ATK_CHECK_VERSION(major,minor,micro) \
|
18
|
+
(ATK_MAJOR_VERSION > (major) || \
|
19
|
+
(ATK_MAJOR_VERSION == (major) && ATK_MINOR_VERSION > (minor)) || \
|
20
|
+
(ATK_MAJOR_VERSION == (major) && ATK_MINOR_VERSION == (minor) && \
|
21
|
+
ATK_MICRO_VERSION >= (micro)))
|
22
|
+
|
23
|
+
|
24
|
+
#endif /* __RBATK_VERSION_H__ */
|