atk 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +30 -0
- data/Rakefile +31 -0
- data/ext/atk/atk.def +2 -0
- data/ext/atk/depend +11 -0
- data/ext/atk/extconf.rb +81 -0
- data/ext/atk/rbatk.c +66 -0
- data/ext/atk/rbatk.h +47 -0
- data/ext/atk/rbatkaction.c +85 -0
- data/ext/atk/rbatkcomponent.c +175 -0
- data/ext/atk/rbatkconversions.h +70 -0
- data/ext/atk/rbatkdocument.c +96 -0
- data/ext/atk/rbatkeditabletext.c +177 -0
- data/ext/atk/rbatkgobjectaccessible.c +46 -0
- data/ext/atk/rbatkhyperlink.c +71 -0
- data/ext/atk/rbatkhypertext.c +53 -0
- data/ext/atk/rbatkimage.c +68 -0
- data/ext/atk/rbatkimplementor.c +38 -0
- data/ext/atk/rbatknoopobject.c +40 -0
- data/ext/atk/rbatknoopobjectfactory.c +40 -0
- data/ext/atk/rbatkobject.c +153 -0
- data/ext/atk/rbatkobjectfactory.c +53 -0
- data/ext/atk/rbatkobjectrole.c +50 -0
- data/ext/atk/rbatkprivate.h +48 -0
- data/ext/atk/rbatkregistry.c +63 -0
- data/ext/atk/rbatkrelation.c +98 -0
- data/ext/atk/rbatkrelationset.c +95 -0
- data/ext/atk/rbatkrelationtype.c +38 -0
- data/ext/atk/rbatkselection.c +87 -0
- data/ext/atk/rbatkstate.c +51 -0
- data/ext/atk/rbatkstateset.c +180 -0
- data/ext/atk/rbatkstreamablecontent.c +57 -0
- data/ext/atk/rbatktable.c +271 -0
- data/ext/atk/rbatktext.c +318 -0
- data/ext/atk/rbatktextattribute.c +54 -0
- data/ext/atk/rbatktextrange.c +92 -0
- data/ext/atk/rbatktextrectangle.c +149 -0
- data/ext/atk/rbatkutil.c +122 -0
- data/ext/atk/rbatkvalue.c +78 -0
- data/extconf.rb +49 -0
- data/lib/2.0/atk.so +0 -0
- data/lib/2.1/atk.so +0 -0
- data/lib/2.2/atk.so +0 -0
- data/lib/atk.rb +21 -0
- data/test/atk-test-utils.rb +21 -0
- data/test/run-test.rb +45 -0
- data/test/test-text-rectangle.rb +26 -0
- data/vendor/local/bin/libatk-1.0-0.dll +0 -0
- data/vendor/local/include/atk-1.0/atk/atk-enum-types.h +63 -0
- data/vendor/local/include/atk-1.0/atk/atk.h +61 -0
- data/vendor/local/include/atk-1.0/atk/atkaction.h +117 -0
- data/vendor/local/include/atk-1.0/atk/atkcomponent.h +225 -0
- data/vendor/local/include/atk-1.0/atk/atkdocument.h +113 -0
- data/vendor/local/include/atk-1.0/atk/atkeditabletext.h +109 -0
- data/vendor/local/include/atk-1.0/atk/atkgobjectaccessible.h +68 -0
- data/vendor/local/include/atk-1.0/atk/atkhyperlink.h +114 -0
- data/vendor/local/include/atk-1.0/atk/atkhyperlinkimpl.h +68 -0
- data/vendor/local/include/atk-1.0/atk/atkhypertext.h +78 -0
- data/vendor/local/include/atk-1.0/atk/atkimage.h +90 -0
- data/vendor/local/include/atk-1.0/atk/atkmisc.h +112 -0
- data/vendor/local/include/atk-1.0/atk/atknoopobject.h +59 -0
- data/vendor/local/include/atk-1.0/atk/atknoopobjectfactory.h +59 -0
- data/vendor/local/include/atk-1.0/atk/atkobject.h +751 -0
- data/vendor/local/include/atk-1.0/atk/atkobjectfactory.h +72 -0
- data/vendor/local/include/atk-1.0/atk/atkplug.h +66 -0
- data/vendor/local/include/atk-1.0/atk/atkrange.h +59 -0
- data/vendor/local/include/atk-1.0/atk/atkregistry.h +74 -0
- data/vendor/local/include/atk-1.0/atk/atkrelation.h +99 -0
- data/vendor/local/include/atk-1.0/atk/atkrelationset.h +91 -0
- data/vendor/local/include/atk-1.0/atk/atkrelationtype.h +83 -0
- data/vendor/local/include/atk-1.0/atk/atkselection.h +100 -0
- data/vendor/local/include/atk-1.0/atk/atksocket.h +71 -0
- data/vendor/local/include/atk-1.0/atk/atkstate.h +190 -0
- data/vendor/local/include/atk-1.0/atk/atkstateset.h +92 -0
- data/vendor/local/include/atk-1.0/atk/atkstreamablecontent.h +110 -0
- data/vendor/local/include/atk-1.0/atk/atktable.h +233 -0
- data/vendor/local/include/atk-1.0/atk/atktablecell.h +104 -0
- data/vendor/local/include/atk-1.0/atk/atktext.h +453 -0
- data/vendor/local/include/atk-1.0/atk/atkutil.h +357 -0
- data/vendor/local/include/atk-1.0/atk/atkvalue.h +163 -0
- data/vendor/local/include/atk-1.0/atk/atkversion.h +394 -0
- data/vendor/local/include/atk-1.0/atk/atkwindow.h +53 -0
- data/vendor/local/lib/girepository-1.0/Atk-1.0.typelib +0 -0
- data/vendor/local/lib/libatk-1.0.dll.a +0 -0
- data/vendor/local/lib/libatk-1.0.la +41 -0
- data/vendor/local/lib/pkgconfig/atk.pc +11 -0
- data/vendor/local/share/gir-1.0/Atk-1.0.gir +15525 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkAction.html +477 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkComponent.html +1146 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkDocument.html +714 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkEditableText.html +429 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkGObjectAccessible.html +166 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkHyperlink.html +570 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkHypertext.html +286 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkImage.html +319 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkMisc.html +191 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkNoOpObject.html +130 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkNoOpObjectFactory.html +107 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkObject.html +3056 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkObjectFactory.html +214 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkRegistry.html +265 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkRelation.html +659 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkRelationSet.html +413 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkSelection.html +453 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkStateSet.html +539 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkStreamableContent.html +274 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkTable.html +1790 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkTableCell.html +497 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkText.html +2547 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkUtil.html +1111 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkValue.html +743 -0
- data/vendor/local/share/gtk-doc/html/atk/AtkWindow.html +452 -0
- data/vendor/local/share/gtk-doc/html/atk/accessibles.html +49 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-12.html +51 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-13.html +41 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-20.html +35 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-22.html +45 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-3.html +41 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-30.html +41 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-4.html +35 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-6.html +35 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-1-9.html +39 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-2-10.html +35 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-2-12.html +78 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-2-2.html +53 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-2-8.html +47 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-deprecated.html +119 -0
- data/vendor/local/share/gtk-doc/html/atk/api-index-full.html +775 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-AtkHyperlinkImpl.html +142 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-AtkPlug.html +147 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-AtkRange.html +328 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-AtkSocket.html +207 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-AtkState.html +556 -0
- data/vendor/local/share/gtk-doc/html/atk/atk-Versioning-Utilities.html +293 -0
- data/vendor/local/share/gtk-doc/html/atk/atk.devhelp2 +441 -0
- data/vendor/local/share/gtk-doc/html/atk/atkobject.html +33 -0
- data/vendor/local/share/gtk-doc/html/atk/data.html +49 -0
- data/vendor/local/share/gtk-doc/html/atk/deprecated.html +33 -0
- data/vendor/local/share/gtk-doc/html/atk/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/index.html +175 -0
- data/vendor/local/share/gtk-doc/html/atk/index.sgml +632 -0
- data/vendor/local/share/gtk-doc/html/atk/interfaces.html +89 -0
- data/vendor/local/share/gtk-doc/html/atk/left-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/overview.html +47 -0
- data/vendor/local/share/gtk-doc/html/atk/right-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/style.css +476 -0
- data/vendor/local/share/gtk-doc/html/atk/toolkit.html +33 -0
- data/vendor/local/share/gtk-doc/html/atk/up-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/up.png +0 -0
- data/vendor/local/share/gtk-doc/html/atk/utilities.html +47 -0
- data/vendor/local/share/license/atk/AUTHORS +18 -0
- data/vendor/local/share/license/atk/COPYING +482 -0
- data/vendor/local/share/locale/af/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/am/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/an/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ar/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/as/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ast/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/az/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/be/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/be@latin/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/bg/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/bn/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/bn_IN/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/bs/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ca/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ca@valencia/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/cs/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/cy/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/da/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/de/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/dz/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/el/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/en@shaw/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/en_CA/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/en_GB/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/eo/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/es/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/et/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/eu/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/fa/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/fi/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/fr/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ga/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/gl/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/gu/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/he/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/hi/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/hr/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/hu/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/hy/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/id/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/is/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/it/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ja/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ka/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/kk/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/km/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/kn/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ko/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ku/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/li/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/lt/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/lv/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/mai/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/mk/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ml/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/mn/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/mr/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ms/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/nb/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ne/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/nl/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/nn/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/oc/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/or/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/pa/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/pl/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ps/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/pt/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/pt_BR/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ro/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ru/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/rw/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/si/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sk/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sl/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sq/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sr/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sr@ije/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sr@latin/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/sv/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ta/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/te/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/tg/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/th/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/tk/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/tr/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/tt/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/ug/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/uk/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/vi/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/wa/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/xh/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/yi/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/zh_CN/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/zh_HK/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/zh_TW/LC_MESSAGES/atk10.mo +0 -0
- data/vendor/local/share/locale/zu/LC_MESSAGES/atk10.mo +0 -0
- metadata +307 -0
data/ext/atk/rbatktext.c
ADDED
@@ -0,0 +1,318 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2004 Masao Mutoh
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbatkprivate.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE mText
|
25
|
+
#define _SELF(s) (RVAL2ATKTEXT(s))
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_get_text(VALUE self, VALUE start_offset, VALUE end_offset)
|
29
|
+
{
|
30
|
+
VALUE ret;
|
31
|
+
gchar* text = atk_text_get_text(_SELF(self),
|
32
|
+
NUM2INT(start_offset),
|
33
|
+
NUM2INT(end_offset));
|
34
|
+
ret = CSTR2RVAL(text);
|
35
|
+
g_free(text);
|
36
|
+
return ret;
|
37
|
+
}
|
38
|
+
|
39
|
+
static VALUE
|
40
|
+
rg_get_character_at_offset(VALUE self, VALUE offset)
|
41
|
+
{
|
42
|
+
gchar buf[10];
|
43
|
+
gint len = g_unichar_to_utf8(atk_text_get_character_at_offset
|
44
|
+
(_SELF(self), NUM2INT(offset)), buf);
|
45
|
+
buf[len] = '\0';
|
46
|
+
return rb_str_new2(buf);
|
47
|
+
}
|
48
|
+
|
49
|
+
static VALUE
|
50
|
+
rg_get_text_after_offset(VALUE self, VALUE offset, VALUE boundary_type)
|
51
|
+
{
|
52
|
+
gchar* ret;
|
53
|
+
VALUE result;
|
54
|
+
gint start_offset, end_offset;
|
55
|
+
|
56
|
+
ret = atk_text_get_text_after_offset(_SELF(self), NUM2INT(offset),
|
57
|
+
RVAL2ATKTEXTBOUNDARY(boundary_type),
|
58
|
+
&start_offset, &end_offset);
|
59
|
+
result = rb_ary_new3(3, CSTR2RVAL(ret),
|
60
|
+
INT2NUM(start_offset), INT2NUM(end_offset));
|
61
|
+
g_free(ret);
|
62
|
+
|
63
|
+
return result;
|
64
|
+
}
|
65
|
+
|
66
|
+
static VALUE
|
67
|
+
rg_get_text_at_offset(VALUE self, VALUE offset, VALUE boundary_type)
|
68
|
+
{
|
69
|
+
gchar* ret;
|
70
|
+
VALUE result;
|
71
|
+
gint start_offset, end_offset;
|
72
|
+
|
73
|
+
ret = atk_text_get_text_at_offset(_SELF(self), NUM2INT(offset),
|
74
|
+
RVAL2ATKTEXTBOUNDARY(boundary_type),
|
75
|
+
&start_offset, &end_offset);
|
76
|
+
result = rb_ary_new3(3, CSTR2RVAL(ret),
|
77
|
+
INT2NUM(start_offset), INT2NUM(end_offset));
|
78
|
+
g_free(ret);
|
79
|
+
|
80
|
+
return result;
|
81
|
+
}
|
82
|
+
|
83
|
+
static VALUE
|
84
|
+
rg_get_text_before_offset(VALUE self, VALUE offset, VALUE boundary_type)
|
85
|
+
{
|
86
|
+
gchar* ret;
|
87
|
+
VALUE result;
|
88
|
+
gint start_offset, end_offset;
|
89
|
+
|
90
|
+
ret = atk_text_get_text_before_offset(_SELF(self), NUM2INT(offset),
|
91
|
+
RVAL2ATKTEXTBOUNDARY(boundary_type),
|
92
|
+
&start_offset, &end_offset);
|
93
|
+
result = rb_ary_new3(3, CSTR2RVAL(ret),
|
94
|
+
INT2NUM(start_offset), INT2NUM(end_offset));
|
95
|
+
g_free(ret);
|
96
|
+
|
97
|
+
return result;
|
98
|
+
}
|
99
|
+
|
100
|
+
static VALUE
|
101
|
+
rg_caret_offset(VALUE self)
|
102
|
+
{
|
103
|
+
return INT2NUM(atk_text_get_caret_offset(_SELF(self)));
|
104
|
+
}
|
105
|
+
|
106
|
+
static VALUE
|
107
|
+
rg_get_character_extents(VALUE self, VALUE offset, VALUE coords)
|
108
|
+
{
|
109
|
+
gint x, y, width, height;
|
110
|
+
atk_text_get_character_extents(_SELF(self), NUM2INT(offset),
|
111
|
+
&x, &y, &width, &height,
|
112
|
+
RVAL2ATKCOORDTYPE(coords));
|
113
|
+
return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height));
|
114
|
+
}
|
115
|
+
|
116
|
+
static VALUE
|
117
|
+
rg_get_run_attributes(VALUE self, VALUE offset)
|
118
|
+
{
|
119
|
+
gint start_offset, end_offset;
|
120
|
+
AtkAttributeSet* list;
|
121
|
+
VALUE ary;
|
122
|
+
|
123
|
+
list = atk_text_get_run_attributes(_SELF(self), NUM2INT(offset),
|
124
|
+
&start_offset, &end_offset);
|
125
|
+
|
126
|
+
ary = rb_ary_new();
|
127
|
+
|
128
|
+
while (list) {
|
129
|
+
AtkAttribute* data = (AtkAttribute*)list->data;
|
130
|
+
rb_ary_push(ary, rb_assoc_new(CSTR2RVAL(data->name),
|
131
|
+
CSTR2RVAL(data->value)));
|
132
|
+
list = list->next;
|
133
|
+
}
|
134
|
+
atk_attribute_set_free(list);
|
135
|
+
return ary;
|
136
|
+
}
|
137
|
+
|
138
|
+
static VALUE
|
139
|
+
rg_default_attributes(VALUE self)
|
140
|
+
{
|
141
|
+
AtkAttributeSet* list;
|
142
|
+
VALUE ary;
|
143
|
+
|
144
|
+
list = atk_text_get_default_attributes(_SELF(self));
|
145
|
+
ary = rb_ary_new();
|
146
|
+
|
147
|
+
while (list) {
|
148
|
+
AtkAttribute* data = (AtkAttribute*)list->data;
|
149
|
+
rb_ary_push(ary, rb_assoc_new(CSTR2RVAL(data->name),
|
150
|
+
CSTR2RVAL(data->value)));
|
151
|
+
list = list->next;
|
152
|
+
}
|
153
|
+
atk_attribute_set_free(list);
|
154
|
+
return ary;
|
155
|
+
}
|
156
|
+
|
157
|
+
static VALUE
|
158
|
+
rg_character_count(VALUE self)
|
159
|
+
{
|
160
|
+
return INT2NUM(atk_text_get_character_count(_SELF(self)));
|
161
|
+
}
|
162
|
+
|
163
|
+
static VALUE
|
164
|
+
rg_get_offset_at_point(VALUE self, VALUE x, VALUE y, VALUE coords)
|
165
|
+
{
|
166
|
+
return INT2NUM(atk_text_get_offset_at_point(_SELF(self),
|
167
|
+
NUM2INT(x), NUM2INT(y),
|
168
|
+
RVAL2ATKCOORDTYPE(coords)));
|
169
|
+
}
|
170
|
+
|
171
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
172
|
+
#ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE
|
173
|
+
static VALUE
|
174
|
+
rg_get_bounded_ranges(VALUE self, VALUE rect, VALUE coord_type, VALUE x_clip_type, VALUE y_clip_type)
|
175
|
+
{
|
176
|
+
AtkTextRange** ranges;
|
177
|
+
int i = 0;
|
178
|
+
VALUE ary;
|
179
|
+
ranges = atk_text_get_bounded_ranges(_SELF(self),
|
180
|
+
RVAL2ATKTEXTRECTANGLE(rect),
|
181
|
+
RVAL2ATKCOORDTYPE(coord_type),
|
182
|
+
RVAL2ATKTEXTCLIPTYPE(x_clip_type),
|
183
|
+
RVAL2ATKTEXTCLIPTYPE(y_clip_type));
|
184
|
+
ary = rb_ary_new();
|
185
|
+
while(ranges[i]){
|
186
|
+
rb_ary_push(ary, ATKTEXTRANGE2RVAL(ranges[i]));
|
187
|
+
i++;
|
188
|
+
}
|
189
|
+
#ifdef HAVE_ATK_TEXT_FREE_RANGES
|
190
|
+
atk_text_free_ranges(ranges);
|
191
|
+
#endif
|
192
|
+
return ary;
|
193
|
+
}
|
194
|
+
#endif
|
195
|
+
|
196
|
+
static VALUE
|
197
|
+
rg_get_range_extents(VALUE self, VALUE start_offset, VALUE end_offset, VALUE coord_type)
|
198
|
+
{
|
199
|
+
AtkTextRectangle rect;
|
200
|
+
atk_text_get_range_extents(_SELF(self), NUM2INT(start_offset),
|
201
|
+
NUM2INT(end_offset),
|
202
|
+
RVAL2ATKCOORDTYPE(coord_type),
|
203
|
+
&rect);
|
204
|
+
return ATKTEXTRECTANGLE2RVAL(&rect);
|
205
|
+
}
|
206
|
+
|
207
|
+
/* Don't need this
|
208
|
+
void atk_text_free_ranges (AtkTextRange **ranges);
|
209
|
+
*/
|
210
|
+
#endif
|
211
|
+
|
212
|
+
static VALUE
|
213
|
+
rg_n_selections(VALUE self)
|
214
|
+
{
|
215
|
+
return INT2NUM(atk_text_get_n_selections(_SELF(self)));
|
216
|
+
}
|
217
|
+
|
218
|
+
static VALUE
|
219
|
+
rg_get_selection(VALUE self, VALUE selection_num)
|
220
|
+
{
|
221
|
+
gint start_offset, end_offset;
|
222
|
+
VALUE ret;
|
223
|
+
gchar* text = atk_text_get_selection(_SELF(self), NUM2INT(selection_num),
|
224
|
+
&start_offset, &end_offset);
|
225
|
+
ret = CSTR2RVAL(text);
|
226
|
+
g_free(text);
|
227
|
+
|
228
|
+
return ret;
|
229
|
+
}
|
230
|
+
|
231
|
+
static VALUE
|
232
|
+
rg_add_selection(VALUE self, VALUE start_offset, VALUE end_offset)
|
233
|
+
{
|
234
|
+
gboolean ret = atk_text_add_selection(_SELF(self), NUM2INT(start_offset),
|
235
|
+
NUM2INT(end_offset));
|
236
|
+
if (! ret) rb_raise(rb_eRuntimeError, "Can't add selection");
|
237
|
+
return self;
|
238
|
+
}
|
239
|
+
|
240
|
+
static VALUE
|
241
|
+
rg_remove_selection(VALUE self, VALUE selection_num)
|
242
|
+
{
|
243
|
+
gint num;
|
244
|
+
gboolean ret;
|
245
|
+
|
246
|
+
num = NUM2INT(selection_num);
|
247
|
+
ret = atk_text_remove_selection(_SELF(self), num);
|
248
|
+
if (! ret)
|
249
|
+
rb_raise(rb_eRuntimeError, "Can't remove selection. num = %d", num);
|
250
|
+
return self;
|
251
|
+
}
|
252
|
+
|
253
|
+
static VALUE
|
254
|
+
rg_set_selection(VALUE self, VALUE selection_num, VALUE start_offset, VALUE end_offset)
|
255
|
+
{
|
256
|
+
gboolean ret = atk_text_set_selection(_SELF(self), NUM2INT(selection_num),
|
257
|
+
NUM2INT(start_offset),
|
258
|
+
NUM2INT(end_offset));
|
259
|
+
if (! ret) rb_raise(rb_eRuntimeError, "Can't set selection");
|
260
|
+
return self;
|
261
|
+
}
|
262
|
+
|
263
|
+
static VALUE
|
264
|
+
rg_set_caret_offset(VALUE self, VALUE offset)
|
265
|
+
{
|
266
|
+
gboolean ret = atk_text_set_caret_offset(_SELF(self), NUM2INT(offset));
|
267
|
+
if (! ret) rb_raise(rb_eRuntimeError, "Can't set caret offset");
|
268
|
+
return self;
|
269
|
+
}
|
270
|
+
|
271
|
+
/* We don't need them.
|
272
|
+
void atk_attribute_set_free (AtkAttributeSet *attrib_set);
|
273
|
+
*/
|
274
|
+
|
275
|
+
void
|
276
|
+
Init_atk_text(VALUE mAtk)
|
277
|
+
{
|
278
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_TEXT, "Text", mAtk);
|
279
|
+
|
280
|
+
RG_DEF_METHOD(get_text, 2);
|
281
|
+
RG_DEF_METHOD(get_character_at_offset, 1);
|
282
|
+
RG_DEF_METHOD(get_text_after_offset, 2);
|
283
|
+
RG_DEF_METHOD(get_text_at_offset, 2);
|
284
|
+
RG_DEF_METHOD(get_text_before_offset, 2);
|
285
|
+
RG_DEF_METHOD(caret_offset, 0);
|
286
|
+
RG_DEF_METHOD(get_character_extents, 2);
|
287
|
+
RG_DEF_METHOD(get_run_attributes, 1);
|
288
|
+
RG_DEF_METHOD(default_attributes, 0);
|
289
|
+
RG_DEF_METHOD(character_count, 0);
|
290
|
+
RG_DEF_METHOD(get_offset_at_point, 3);
|
291
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
292
|
+
#ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE
|
293
|
+
RG_DEF_METHOD(get_bounded_ranges, 4);
|
294
|
+
RG_DEF_METHOD(get_range_extents, 3);
|
295
|
+
#endif
|
296
|
+
#endif
|
297
|
+
RG_DEF_METHOD(n_selections, 0);
|
298
|
+
RG_DEF_METHOD(get_selection, 1);
|
299
|
+
RG_DEF_METHOD(add_selection, 2);
|
300
|
+
RG_DEF_METHOD(remove_selection, 1);
|
301
|
+
RG_DEF_METHOD(set_selection, 3);
|
302
|
+
RG_DEF_METHOD(set_caret_offset, 1);
|
303
|
+
|
304
|
+
/* AtkTextBoundary */
|
305
|
+
#ifdef ATK_TYPE_TEXT_BOUNDARY
|
306
|
+
G_DEF_CLASS(ATK_TYPE_TEXT_BOUNDARY, "Boundary", RG_TARGET_NAMESPACE);
|
307
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_TEXT_BOUNDARY, "ATK_TEXT_");
|
308
|
+
#endif
|
309
|
+
/* AtkTextClipType */
|
310
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
311
|
+
#ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE
|
312
|
+
G_DEF_CLASS(ATK_TYPE_TEXT_CLIP_TYPE, "ClipType", RG_TARGET_NAMESPACE);
|
313
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_TEXT_CLIP_TYPE, "ATK_TEXT_");
|
314
|
+
#endif
|
315
|
+
#endif
|
316
|
+
|
317
|
+
Init_atk_text_attribute(RG_TARGET_NAMESPACE);
|
318
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2004 Masao Mutoh
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbatkprivate.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cAttribute
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name)
|
28
|
+
{
|
29
|
+
return ATKTEXTATTRIBUTE2RVAL(atk_text_attribute_register(RVAL2CSTR(name)));
|
30
|
+
}
|
31
|
+
|
32
|
+
static VALUE
|
33
|
+
rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name)
|
34
|
+
{
|
35
|
+
return ATKTEXTATTRIBUTE2RVAL(atk_text_attribute_for_name(RVAL2CSTR(name)));
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE
|
39
|
+
rg_get_value(VALUE self, VALUE index)
|
40
|
+
{
|
41
|
+
return CSTR2RVAL(atk_text_attribute_get_value(RVAL2ATKTEXTATTRIBUTE(self),
|
42
|
+
NUM2INT(index)));
|
43
|
+
}
|
44
|
+
|
45
|
+
void
|
46
|
+
Init_atk_text_attribute(VALUE mText)
|
47
|
+
{
|
48
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_TEXT_ATTRIBUTE, "Attribute", mText);
|
49
|
+
G_DEF_CONSTANTS(mText, ATK_TYPE_TEXT_ATTRIBUTE, "ATK_TEXT_");
|
50
|
+
|
51
|
+
RG_DEF_SMETHOD(type_register, 1);
|
52
|
+
RG_DEF_SMETHOD(for_name, 1);
|
53
|
+
RG_DEF_METHOD(get_value, 1);
|
54
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2004 Masao Mutoh
|
5
|
+
* Copyright (C) 2002,2003 Masao Mutoh
|
6
|
+
* Copyright (C) 1998-2000 Yukihiro Matsumoto,
|
7
|
+
* Daisuke Kanda,
|
8
|
+
* Hiroshi Igarashi
|
9
|
+
*
|
10
|
+
* This library is free software; you can redistribute it and/or
|
11
|
+
* modify it under the terms of the GNU Lesser General Public
|
12
|
+
* License as published by the Free Software Foundation; either
|
13
|
+
* version 2.1 of the License, or (at your option) any later version.
|
14
|
+
*
|
15
|
+
* This library is distributed in the hope that it will be useful,
|
16
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
18
|
+
* Lesser General Public License for more details.
|
19
|
+
*
|
20
|
+
* You should have received a copy of the GNU Lesser General Public
|
21
|
+
* License along with this library; if not, write to the Free Software
|
22
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
23
|
+
* MA 02110-1301 USA
|
24
|
+
*/
|
25
|
+
|
26
|
+
#include "rbatkprivate.h"
|
27
|
+
|
28
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
29
|
+
#define RG_TARGET_NAMESPACE cTextRange
|
30
|
+
#define _SELF(r) (RVAL2ATKTEXTRANGE(r))
|
31
|
+
|
32
|
+
/**********************************/
|
33
|
+
static AtkTextRange*
|
34
|
+
atk_text_range_copy(const AtkTextRange* val)
|
35
|
+
{
|
36
|
+
AtkTextRange* new_val;
|
37
|
+
g_return_val_if_fail (val != NULL, NULL);
|
38
|
+
new_val = g_new(AtkTextRange, 1);
|
39
|
+
*new_val = *val;
|
40
|
+
return new_val;
|
41
|
+
}
|
42
|
+
|
43
|
+
GType
|
44
|
+
atk_text_range_get_type(void)
|
45
|
+
{
|
46
|
+
static GType our_type = 0;
|
47
|
+
|
48
|
+
if (our_type == 0)
|
49
|
+
our_type = g_boxed_type_register_static ("AtkTextRange",
|
50
|
+
(GBoxedCopyFunc)atk_text_range_copy,
|
51
|
+
(GBoxedFreeFunc)g_free);
|
52
|
+
return our_type;
|
53
|
+
}
|
54
|
+
/**********************************/
|
55
|
+
/* Struct accessors */
|
56
|
+
static VALUE
|
57
|
+
rg_bounds(VALUE self)
|
58
|
+
{
|
59
|
+
return ATKTEXTRECTANGLE2RVAL(&_SELF(self)->bounds);
|
60
|
+
}
|
61
|
+
|
62
|
+
static VALUE
|
63
|
+
rg_start_offset(VALUE self)
|
64
|
+
{
|
65
|
+
return INT2NUM(_SELF(self)->start_offset);
|
66
|
+
}
|
67
|
+
|
68
|
+
static VALUE
|
69
|
+
rg_end_offset(VALUE self)
|
70
|
+
{
|
71
|
+
return INT2NUM(_SELF(self)->end_offset);
|
72
|
+
}
|
73
|
+
|
74
|
+
static VALUE
|
75
|
+
rg_content(VALUE self)
|
76
|
+
{
|
77
|
+
return CSTR2RVAL(_SELF(self)->content);
|
78
|
+
}
|
79
|
+
#endif
|
80
|
+
|
81
|
+
void
|
82
|
+
Init_atk_text_range(VALUE mAtk)
|
83
|
+
{
|
84
|
+
#ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES
|
85
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_TEXT_RANGE, "TextRange", mAtk);
|
86
|
+
|
87
|
+
RG_DEF_METHOD(bounds, 0);
|
88
|
+
RG_DEF_METHOD(start_offset, 0);
|
89
|
+
RG_DEF_METHOD(end_offset, 0);
|
90
|
+
RG_DEF_METHOD(content, 0);
|
91
|
+
#endif
|
92
|
+
}
|