atk 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ 2011-09-16 Nikolai Weibull <now@bitwi.se>
2
+
3
+ * lib/atk.rb: Remove unused variable.
4
+
5
+ 2011-09-12 Nikolai Weibull <now@bitwi.se>
6
+
7
+ * ext/atk/rbatkrelation.c: Fix initialization.
8
+ * ext/atk/*.c: Remove methods that implement methods already
9
+ implemented with properties.
10
+
11
+ 2011-09-09 Nikolai Weibull <now@bitwi.se>
12
+
13
+ * ext/atk/*.c: Fix all warnings generated with gcc 4.4.5.
14
+ * ext/atk/*.c: Fix all RVAL2CSTR calls.
15
+
1
16
  2011-02-26 Kouhei Sutou <kou@cozmixng.org>
2
17
 
3
18
  * ext/atk/extconf.rb: remove needless add_distcleanfile.
data/ext/atk/rbatk.h CHANGED
@@ -26,6 +26,8 @@
26
26
  # define RUBY_ATK_VAR extern
27
27
  #endif
28
28
 
29
+ #define RVAL2ATKOBJECT(s) ATK_OBJECT(RVAL2GOBJ(s))
30
+
29
31
  extern void Init_atk_inits();
30
32
  extern GType atk_text_rectangle_get_type(void);
31
33
  extern GType atk_text_range_get_type(void);
@@ -33,15 +33,15 @@ static VALUE
33
33
  rbatk_document_get_attribute_value(VALUE self, VALUE name)
34
34
  {
35
35
  return CSTR2RVAL(atk_document_get_attribute_value(_SELF(self),
36
- (const gchar*)RVAL2CSTR(name)));
36
+ RVAL2CSTR(name)));
37
37
  }
38
38
 
39
39
  static VALUE
40
40
  rbatk_document_set_attribute_value(VALUE self, VALUE name, VALUE value)
41
41
  {
42
42
  gboolean ret = atk_document_set_attribute_value(_SELF(self),
43
- (const gchar*)RVAL2CSTR(name),
44
- (const gchar*)RVAL2CSTR(value));
43
+ RVAL2CSTR(name),
44
+ RVAL2CSTR(value));
45
45
 
46
46
  if (! ret) rb_raise(rb_eRuntimeError, "Can't set attribute value: %s, %s",
47
47
  RVAL2CSTR(name), RVAL2CSTR(value));
@@ -24,18 +24,6 @@ rbatk_hl_get_object(VALUE self, VALUE i)
24
24
  return GOBJ2RVAL(atk_hyperlink_get_object(_SELF(self), NUM2INT(i)));
25
25
  }
26
26
 
27
- static VALUE
28
- rbatk_hl_get_end_index(VALUE self)
29
- {
30
- return INT2NUM(atk_hyperlink_get_end_index(_SELF(self)));
31
- }
32
-
33
- static VALUE
34
- rbatk_hl_get_start_index(VALUE self)
35
- {
36
- return INT2NUM(atk_hyperlink_get_start_index(_SELF(self)));
37
- }
38
-
39
27
  static VALUE
40
28
  rbatk_hl_is_valid(VALUE self)
41
29
  {
@@ -56,14 +44,6 @@ rbatk_hl_get_n_anchors(VALUE self)
56
44
  return INT2NUM(atk_hyperlink_get_n_anchors(_SELF(self)));
57
45
  }
58
46
 
59
- #ifdef HAVE_ATK_HYPERLINK_IS_SELECTED_LINK
60
- static VALUE
61
- rbatk_hl_is_selected_link(VALUE self)
62
- {
63
- return CBOOL2RVAL(atk_hyperlink_is_selected_link(_SELF(self)));
64
- }
65
- #endif
66
-
67
47
  void
68
48
  Init_atk_hyperlink()
69
49
  {
@@ -71,14 +51,9 @@ Init_atk_hyperlink()
71
51
 
72
52
  rb_define_method(hl, "get_uri", rbatk_hl_get_uri, 1);
73
53
  rb_define_method(hl, "get_object", rbatk_hl_get_object, 1);
74
- rb_define_method(hl, "end_index", rbatk_hl_get_end_index, 0);
75
- rb_define_method(hl, "start_index", rbatk_hl_get_start_index, 0);
76
54
  rb_define_method(hl, "valid?", rbatk_hl_is_valid, 0);
77
55
  #ifdef HAVE_ATK_HYPERLINK_IS_INLINE
78
56
  rb_define_method(hl, "inline?", rbatk_hl_is_inline, 0);
79
57
  #endif
80
58
  rb_define_method(hl, "n_anchors", rbatk_hl_get_n_anchors, 0);
81
- #ifdef HAVE_ATK_HYPERLINK_IS_SELECTED_LINK
82
- rb_define_method(hl, "selected_link?", rbatk_hl_is_selected_link, 0);
83
- #endif
84
59
  }
data/ext/atk/rbatkinits.c CHANGED
@@ -24,7 +24,8 @@ extern void Init_atk_text_range();
24
24
  extern void Init_atk_text_rectangle();
25
25
  extern void Init_atk_util();
26
26
  extern void Init_atk_value();
27
- void Init_atk_inits()
27
+ void
28
+ Init_atk_inits()
28
29
  {
29
30
  Init_atk_action();
30
31
  Init_atk_component();
@@ -11,7 +11,7 @@
11
11
 
12
12
  #include "rbatk.h"
13
13
 
14
- #define _SELF(s) (ATK_OBJECT(RVAL2GOBJ(s)))
14
+ #define _SELF(s) RVAL2ATKOBJECT(s)
15
15
 
16
16
  /* How can I implement this? Since 1.10
17
17
  AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor);
@@ -33,42 +33,23 @@ rbatkrelation_s_for_name(VALUE self, VALUE name)
33
33
  static VALUE
34
34
  rbatkrel_initialize(VALUE self, VALUE targets, VALUE relationship)
35
35
  {
36
- gint i;
37
- gint len = RARRAY_LEN(targets);
38
- AtkObject* objects = g_new(AtkObject, len);
36
+ VALUE ary = rb_ary_to_ary(targets);
37
+ long i;
38
+ long len = RARRAY_LEN(ary);
39
+ AtkObject **objects = g_new(AtkObject *, len);
39
40
 
40
- for (i = 0; i < len; i++) {
41
- objects = (AtkObject*)RARRAY_PTR(targets)[i];
42
- objects++;
43
- }
41
+ for (i = 0; i < len; i++)
42
+ objects[i] = RVAL2ATKOBJECT(RARRAY_PTR(targets)[i]);
44
43
 
45
- G_INITIALIZE(self, atk_relation_new(&objects, len,
44
+ G_INITIALIZE(self, atk_relation_new(objects,
45
+ len,
46
46
  RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE)));
47
+
47
48
  g_free(objects);
48
49
 
49
50
  return Qnil;
50
51
  }
51
52
 
52
- static VALUE
53
- rbatkrel_get_relation_type(VALUE self)
54
- {
55
- return GENUM2RVAL(atk_relation_get_relation_type(_SELF(self)), ATK_TYPE_RELATION_TYPE);
56
- }
57
-
58
- static VALUE
59
- rbatkrel_get_target(VALUE self)
60
- {
61
- gint i;
62
- GPtrArray* garray = atk_relation_get_target(_SELF(self));
63
- VALUE ary = rb_ary_new();
64
-
65
- for (i = 0; i < garray->len; i++){
66
- rb_ary_push(ary, GOBJ2RVAL((AtkObject*)g_ptr_array_index(garray, i)));
67
- }
68
- g_ptr_array_free(garray, TRUE);
69
- return ary;
70
- }
71
-
72
53
  #if ATK_CHECK_VERSION(1,9,0)
73
54
  static VALUE
74
55
  rbatkrel_add_target(VALUE self, VALUE obj)
@@ -85,8 +66,6 @@ Init_atk_relation()
85
66
  VALUE type;
86
67
  rb_define_singleton_method(rel, "type_register", rbatkrel_s_type_register, 1);
87
68
  rb_define_method(rel, "initialize", rbatkrel_initialize, 2);
88
- rb_define_method(rel, "relation_type", rbatkrel_get_relation_type, 0);
89
- rb_define_method(rel, "target", rbatkrel_get_target, 0);
90
69
  #if ATK_CHECK_VERSION(1,9,0)
91
70
  rb_define_method(rel, "add_target", rbatkrel_add_target, 1);
92
71
  #endif
data/ext/atk/rbatktable.c CHANGED
@@ -228,7 +228,6 @@ Init_atk_table()
228
228
  {
229
229
  VALUE mTable = G_DEF_INTERFACE(ATK_TYPE_TABLE, "Table", mAtk);
230
230
 
231
- rb_define_method(mTable, "set_caption", rbatk_table_set_caption, 1);
232
231
  rb_define_method(mTable, "ref_at", rbatk_table_ref_at, 2);
233
232
  rb_define_method(mTable, "get_index_at", rbatk_table_get_index_at, 2);
234
233
  rb_define_method(mTable, "get_column_at_index", rbatk_table_get_column_at_index, 1);
data/ext/atk/rbatkutil.c CHANGED
@@ -105,7 +105,6 @@ Init_atk_util()
105
105
  #endif
106
106
  rb_define_singleton_method(util, "toolkit_name", rbatk_get_toolkit_name, 0);
107
107
  rb_define_singleton_method(util, "toolkit_version", rbatk_get_toolkit_version, 0);
108
- rb_define_singleton_method(util, "toolkit_version", rbatk_get_toolkit_version, 0);
109
108
 
110
109
  /* AtkCoordType */
111
110
  coord = G_DEF_CLASS(ATK_TYPE_COORD_TYPE, "CoordType", util);
data/lib/atk.rb CHANGED
@@ -5,7 +5,7 @@ vendor_dir = base_dir + "vendor" + "local"
5
5
  vendor_bin_dir = vendor_dir + "bin"
6
6
  GLib.prepend_environment_path(vendor_bin_dir)
7
7
  begin
8
- major, minor, micro, = RUBY_VERSION.split(/\./)
8
+ major, minor, _ = RUBY_VERSION.split(/\./)
9
9
  require "#{major}.#{minor}/atk.so"
10
10
  rescue LoadError
11
11
  require 'atk.so'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - The Ruby-GNOME2 Proejct Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-13 00:00:00 Z
18
+ date: 2011-09-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: glib2
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 23
28
+ hash: 21
29
29
  segments:
30
30
  - 1
31
31
  - 0
32
- - 0
33
- version: 1.0.0
32
+ - 1
33
+ version: 1.0.1
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description: Ruby/ATK is a Ruby binding of ATK-1.0.x.