atk 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/ext/atk/extconf.rb +3 -0
  2. data/ext/atk/rbatk.c +56 -17
  3. data/ext/atk/rbatk.h +21 -12
  4. data/ext/atk/rbatkaction.c +38 -27
  5. data/ext/atk/rbatkcomponent.c +61 -50
  6. data/ext/atk/rbatkconversions.h +70 -0
  7. data/ext/atk/rbatkdocument.c +38 -27
  8. data/ext/atk/rbatkeditabletext.c +123 -39
  9. data/ext/atk/rbatkgobjectaccessible.c +30 -19
  10. data/ext/atk/rbatkhyperlink.c +34 -22
  11. data/ext/atk/rbatkhypertext.c +32 -20
  12. data/ext/atk/rbatkimage.c +34 -22
  13. data/ext/atk/rbatkimplementor.c +26 -14
  14. data/ext/atk/rbatknoopobject.c +28 -17
  15. data/ext/atk/rbatknoopobjectfactory.c +28 -17
  16. data/ext/atk/rbatkobject.c +48 -63
  17. data/ext/atk/rbatkobjectfactory.c +32 -20
  18. data/ext/atk/rbatkobjectrole.c +50 -0
  19. data/ext/atk/rbatkprivate.h +48 -0
  20. data/ext/atk/rbatkregistry.c +34 -22
  21. data/ext/atk/rbatkrelation.c +68 -43
  22. data/ext/atk/rbatkrelationset.c +44 -32
  23. data/ext/atk/rbatkrelationtype.c +38 -0
  24. data/ext/atk/rbatkselection.c +38 -26
  25. data/ext/atk/rbatkstate.c +32 -20
  26. data/ext/atk/rbatkstateset.c +113 -65
  27. data/ext/atk/rbatkstreamablecontent.c +33 -23
  28. data/ext/atk/rbatktable.c +91 -80
  29. data/ext/atk/rbatktext.c +85 -107
  30. data/ext/atk/rbatktextattribute.c +54 -0
  31. data/ext/atk/rbatktextrange.c +38 -33
  32. data/ext/atk/rbatktextrectangle.c +53 -48
  33. data/ext/atk/rbatkutil.c +44 -35
  34. data/ext/atk/rbatkvalue.c +39 -29
  35. data/lib/1.8/atk.so +0 -0
  36. data/lib/1.9/atk.so +0 -0
  37. data/vendor/local/bin/libatk-1.0-0.dll +0 -0
  38. data/vendor/local/lib/atk-1.0.def +3 -0
  39. data/vendor/local/lib/atk-1.0.lib +0 -0
  40. data/vendor/local/lib/libatk-1.0.dll.a +0 -0
  41. data/vendor/local/manifest/{atk-dev_1.32.0-1_win32.mft → atk-dev_1.32.0-2_win32.mft} +3 -3
  42. data/vendor/local/manifest/{atk_1.32.0-1_win32.mft → atk_1.32.0-2_win32.mft} +1 -1
  43. data/vendor/local/src/dieterv/packaging/atk_1.32.0-2_win32.log +740 -0
  44. data/vendor/local/src/{tml/packaging/atk_1.32.0-1_win32.sh → dieterv/packaging/atk_1.32.0-2_win32.sh} +30 -7
  45. metadata +18 -16
  46. data/ChangeLog +0 -278
  47. data/ext/atk/makeinits.rb +0 -39
  48. data/ext/atk/rbatkinits.c +0 -56
  49. data/vendor/local/src/tml/packaging/atk_1.32.0-1_win32.log +0 -730
@@ -1,41 +1,53 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatkobjectfactory.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2003/12/07 18:12:33 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_OBJECT_FACTORY(RVAL2GOBJ(s)))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003 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 cObjectFactory
25
+ #define _SELF(s) (RVAL2ATKOBJECTFACTORY(s))
14
26
 
15
27
  static VALUE
16
- rbatkfact_create_accessible(VALUE self, VALUE obj)
28
+ rg_create_accessible(VALUE self, VALUE obj)
17
29
  {
18
30
  return GOBJ2RVAL(atk_object_factory_create_accessible(_SELF(self), RVAL2GOBJ(obj)));
19
31
  }
20
32
 
21
33
  static VALUE
22
- rbatkfact_get_accessible_type(VALUE self)
34
+ rg_accessible_type(VALUE self)
23
35
  {
24
36
  return GTYPE2CLASS(atk_object_factory_get_accessible_type(_SELF(self)));
25
37
  }
26
38
 
27
39
  static VALUE
28
- rbatkfact_invalidate(VALUE self)
40
+ rg_invalidate(VALUE self)
29
41
  {
30
42
  atk_object_factory_invalidate(_SELF(self));
31
43
  return self;
32
44
  }
33
45
 
34
46
  void
35
- Init_atk_objectfactory()
47
+ Init_atk_objectfactory(VALUE mAtk)
36
48
  {
37
- VALUE fact = G_DEF_CLASS(ATK_TYPE_OBJECT_FACTORY, "ObjectFactory", mAtk);
38
- rb_define_method(fact, "create_accessible", rbatkfact_create_accessible, 0);
39
- rb_define_method(fact, "accessible_type", rbatkfact_get_accessible_type, 0);
40
- rb_define_method(fact, "invalidate", rbatkfact_invalidate, 0);
49
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_OBJECT_FACTORY, "ObjectFactory", mAtk);
50
+ RG_DEF_METHOD(create_accessible, 0);
51
+ RG_DEF_METHOD(accessible_type, 0);
52
+ RG_DEF_METHOD(invalidate, 0);
41
53
  }
@@ -0,0 +1,50 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003,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 cRole
25
+
26
+ static VALUE
27
+ rg_localized_name(G_GNUC_UNUSED VALUE self)
28
+ {
29
+ #ifdef HAVE_ATK_ROLE_GET_LOCALIZED_NAME
30
+ return CSTR2RVAL(atk_role_get_localized_name(RVAL2ATKROLE(self)));
31
+ #else
32
+ rb_warning("not supported in this version of ATK.");
33
+ return Qnil;
34
+ #endif
35
+ }
36
+
37
+ static VALUE
38
+ rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name)
39
+ {
40
+ return ATKROLE2RVAL(atk_role_for_name(RVAL2CSTR(name)));
41
+ }
42
+
43
+ void
44
+ Init_atk_object_role(VALUE cObject)
45
+ {
46
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_ROLE, "Role", cObject);
47
+ RG_DEF_METHOD(localized_name, 0);
48
+ RG_DEF_SMETHOD(for_name, 1);
49
+ G_DEF_CONSTANTS(cObject, ATK_TYPE_ROLE, "ATK_");
50
+ }
@@ -0,0 +1,48 @@
1
+ #ifndef RB_ATK_PRIVATE_H
2
+ #define RB_ATK_PRIVATE_H
3
+
4
+ #include "rbatk.h"
5
+
6
+ #ifndef HAVE_RB_ERRINFO
7
+ # define rb_errinfo() (ruby_errinfo)
8
+ #endif
9
+
10
+ #ifndef G_VALUE_INIT
11
+ # define G_VALUE_INIT { 0, { { 0 } } }
12
+ #endif
13
+
14
+ G_BEGIN_DECLS
15
+
16
+ G_GNUC_INTERNAL void Init_atk_action(VALUE mAtk);
17
+ G_GNUC_INTERNAL void Init_atk_component(VALUE mAtk);
18
+ G_GNUC_INTERNAL void Init_atk_document(VALUE mAtk);
19
+ G_GNUC_INTERNAL void Init_atk_editabletext(VALUE mAtk);
20
+ G_GNUC_INTERNAL void Init_atk_gobjectaccessible(VALUE mAtk);
21
+ G_GNUC_INTERNAL void Init_atk_hyperlink(VALUE mAtk);
22
+ G_GNUC_INTERNAL void Init_atk_hypertext(VALUE mAtk);
23
+ G_GNUC_INTERNAL void Init_atk_image(VALUE mAtk);
24
+ G_GNUC_INTERNAL void Init_atk_implementor(VALUE mAtk);
25
+ G_GNUC_INTERNAL void Init_atk_noopobject(VALUE mAtk);
26
+ G_GNUC_INTERNAL void Init_atk_noopobjectfactory(VALUE mAtk);
27
+ G_GNUC_INTERNAL void Init_atk_object(VALUE mAtk);
28
+ G_GNUC_INTERNAL void Init_atk_object_role(VALUE cObject);
29
+ G_GNUC_INTERNAL void Init_atk_objectfactory(VALUE mAtk);
30
+ G_GNUC_INTERNAL void Init_atk_registry(VALUE mAtk);
31
+ G_GNUC_INTERNAL void Init_atk_relation(VALUE mAtk);
32
+ G_GNUC_INTERNAL void Init_atk_relation_type(VALUE cRelation);
33
+ G_GNUC_INTERNAL void Init_atk_relation_set(VALUE mAtk);
34
+ G_GNUC_INTERNAL void Init_atk_selection(VALUE mAtk);
35
+ G_GNUC_INTERNAL void Init_atk_state(VALUE mAtk);
36
+ G_GNUC_INTERNAL void Init_atk_state_set(VALUE mAtk);
37
+ G_GNUC_INTERNAL void Init_atk_streamable_content(VALUE mAtk);
38
+ G_GNUC_INTERNAL void Init_atk_table(VALUE mAtk);
39
+ G_GNUC_INTERNAL void Init_atk_text(VALUE mAtk);
40
+ G_GNUC_INTERNAL void Init_atk_text_attribute(VALUE mText);
41
+ G_GNUC_INTERNAL void Init_atk_text_range(VALUE mAtk);
42
+ G_GNUC_INTERNAL void Init_atk_text_rectangle(VALUE mAtk);
43
+ G_GNUC_INTERNAL void Init_atk_util(VALUE mAtk);
44
+ G_GNUC_INTERNAL void Init_atk_value(VALUE mAtk);
45
+
46
+ G_END_DECLS
47
+
48
+ #endif /* RB_ATK_PRIVATE_H */
@@ -1,19 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatkregistry.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2003/12/07 18:12:33 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_REGISTRY(RVAL2GOBJ(s)))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003 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 cRegistry
25
+ #define _SELF(s) (RVAL2ATKREGISTRY(s))
14
26
 
15
27
  static VALUE
16
- rbatkregistry_set_factory_type(VALUE self, VALUE type, VALUE factory_type)
28
+ rg_set_factory_type(VALUE self, VALUE type, VALUE factory_type)
17
29
  {
18
30
  atk_registry_set_factory_type(_SELF(self),
19
31
  CLASS2GTYPE(type),
@@ -22,30 +34,30 @@ rbatkregistry_set_factory_type(VALUE self, VALUE type, VALUE factory_type)
22
34
  }
23
35
 
24
36
  static VALUE
25
- rbatkregistry_get_factory_type(VALUE self, VALUE type)
37
+ rg_get_factory_type(VALUE self, VALUE type)
26
38
  {
27
39
  return GTYPE2CLASS(atk_registry_get_factory_type(_SELF(self), CLASS2GTYPE(type)));
28
40
  }
29
41
 
30
42
  static VALUE
31
- rbatkregistry_get_factory(VALUE self, VALUE type)
43
+ rg_get_factory(VALUE self, VALUE type)
32
44
  {
33
45
  return GOBJ2RVAL(atk_registry_get_factory(_SELF(self),
34
46
  CLASS2GTYPE(type)));
35
47
  }
36
48
 
37
49
  static VALUE
38
- rbatkregistry_s_get_default_registry(VALUE self)
50
+ rg_s_default_registry(G_GNUC_UNUSED VALUE self)
39
51
  {
40
52
  return GOBJ2RVAL(atk_get_default_registry());
41
53
  }
42
54
 
43
55
  void
44
- Init_atk_registry()
56
+ Init_atk_registry(VALUE mAtk)
45
57
  {
46
- VALUE registry = G_DEF_CLASS(ATK_TYPE_REGISTRY, "Registry", mAtk);
47
- rb_define_method(registry, "set_factory_type", rbatkregistry_set_factory_type, 2);
48
- rb_define_method(registry, "get_factory_type", rbatkregistry_get_factory_type, 1);
49
- rb_define_method(registry, "get_factory", rbatkregistry_get_factory, 1);
50
- rb_define_singleton_method(registry, "default_registry", rbatkregistry_s_get_default_registry, 0);
58
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_REGISTRY, "Registry", mAtk);
59
+ RG_DEF_METHOD(set_factory_type, 2);
60
+ RG_DEF_METHOD(get_factory_type, 1);
61
+ RG_DEF_METHOD(get_factory, 1);
62
+ RG_DEF_SMETHOD(default_registry, 0);
51
63
  }
@@ -1,77 +1,102 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatkrelation.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2005/09/15 17:30:46 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_RELATION(RVAL2GOBJ(s)))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003 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 cRelation
25
+ #define _SELF(s) (RVAL2ATKRELATION(s))
14
26
 
15
27
  static VALUE
16
- rbatkrel_s_type_register(VALUE self, VALUE name)
28
+ rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name)
17
29
  {
18
- return GENUM2RVAL(atk_relation_type_register(RVAL2CSTR(name)), ATK_TYPE_RELATION_TYPE);
30
+ return ATKRELATIONTYPE2RVAL(atk_relation_type_register(RVAL2CSTR(name)));
19
31
  }
20
32
 
21
- /* We don't need them
22
- G_CONST_RETURN gchar* atk_relation_type_get_name
23
- (AtkRelationType type);
24
- */
33
+ struct rval2atkobjects_args {
34
+ VALUE ary;
35
+ long n;
36
+ AtkObject **result;
37
+ };
25
38
 
26
39
  static VALUE
27
- rbatkrelation_s_for_name(VALUE self, VALUE name)
40
+ rval2atkobjects_body(VALUE value)
28
41
  {
29
- return GENUM2RVAL(atk_relation_type_for_name(RVAL2CSTR(name)), ATK_TYPE_RELATION_TYPE);
42
+ long i;
43
+ struct rval2atkobjects_args *args = (struct rval2atkobjects_args *)value;
44
+
45
+ for (i = 0; i < args->n; i++)
46
+ args->result[i] = RVAL2ATKOBJECT(RARRAY_PTR(args->ary)[i]);
47
+
48
+ return Qnil;
30
49
  }
31
50
 
51
+ static G_GNUC_NORETURN VALUE
52
+ rval2atkobjects_rescue(VALUE value)
53
+ {
54
+ g_free(((struct rval2atkobjects_args *)value)->result);
55
+
56
+ rb_exc_raise(rb_errinfo());
57
+ }
32
58
 
33
59
  static VALUE
34
- rbatkrel_initialize(VALUE self, VALUE targets, VALUE relationship)
60
+ rg_initialize(VALUE self, VALUE targets, VALUE rbrelationship)
35
61
  {
36
- VALUE ary = rb_ary_to_ary(targets);
37
- long i;
38
- long len = RARRAY_LEN(ary);
39
- AtkObject **objects = g_new(AtkObject *, len);
62
+ AtkRelationType relationship = RVAL2ATKRELATIONTYPE(rbrelationship);
63
+ struct rval2atkobjects_args args;
64
+ AtkRelation *relation;
65
+
66
+ args.ary = rb_ary_to_ary(targets);
67
+ args.n = RARRAY_LEN(args.ary);
68
+ args.result = g_new(AtkObject *, args.n + 1);
69
+
70
+ rb_rescue(rval2atkobjects_body, (VALUE)&args,
71
+ rval2atkobjects_rescue, (VALUE)&args);
40
72
 
41
- for (i = 0; i < len; i++)
42
- objects[i] = RVAL2ATKOBJECT(RARRAY_PTR(targets)[i]);
73
+ relation = atk_relation_new(args.result, args.n, relationship);
43
74
 
44
- G_INITIALIZE(self, atk_relation_new(objects,
45
- len,
46
- RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE)));
75
+ g_free(args.result);
47
76
 
48
- g_free(objects);
77
+ G_INITIALIZE(self, relation);
49
78
 
50
79
  return Qnil;
51
80
  }
52
81
 
53
82
  #if ATK_CHECK_VERSION(1,9,0)
54
83
  static VALUE
55
- rbatkrel_add_target(VALUE self, VALUE obj)
84
+ rg_add_target(VALUE self, VALUE obj)
56
85
  {
57
- atk_relation_add_target(_SELF(self), ATK_OBJECT(RVAL2GOBJ(obj)));
86
+ atk_relation_add_target(_SELF(self), RVAL2ATKOBJECT(obj));
58
87
  return self;
59
88
  }
60
89
  #endif
61
90
 
62
91
  void
63
- Init_atk_relation()
92
+ Init_atk_relation(VALUE mAtk)
64
93
  {
65
- VALUE rel = G_DEF_CLASS(ATK_TYPE_RELATION, "Relation", mAtk);
66
- VALUE type;
67
- rb_define_singleton_method(rel, "type_register", rbatkrel_s_type_register, 1);
68
- rb_define_method(rel, "initialize", rbatkrel_initialize, 2);
94
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_RELATION, "Relation", mAtk);
95
+ RG_DEF_SMETHOD(type_register, 1);
96
+ RG_DEF_METHOD(initialize, 2);
69
97
  #if ATK_CHECK_VERSION(1,9,0)
70
- rb_define_method(rel, "add_target", rbatkrel_add_target, 1);
98
+ RG_DEF_METHOD(add_target, 1);
71
99
  #endif
72
100
 
73
- /* AtkRelationType */
74
- type = G_DEF_CLASS(ATK_TYPE_RELATION_TYPE, "Type", rel);
75
- rb_define_singleton_method(type, "for_name", rbatkrelation_s_for_name, 1);
76
- G_DEF_CONSTANTS(rel, ATK_TYPE_RELATION_TYPE, "ATK_");
101
+ Init_atk_relation_type(RG_TARGET_NAMESPACE);
77
102
  }
@@ -1,59 +1,71 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003 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
+ */
3
21
 
4
- rbatkrelationset.c -
22
+ #include "rbatkprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2005/09/15 17:30:46 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_RELATION_SET(RVAL2GOBJ(s)))
24
+ #define RG_TARGET_NAMESPACE cRelationSet
25
+ #define _SELF(s) (RVAL2ATKRELATIONSET(s))
14
26
 
15
27
  static VALUE
16
- rbatkrelset_initialize(VALUE self)
28
+ rg_initialize(VALUE self)
17
29
  {
18
30
  G_INITIALIZE(self, atk_relation_set_new());
19
31
  return Qnil;
20
32
  }
21
33
 
22
34
  static VALUE
23
- rbatkrelset_contains(VALUE self, VALUE relationship)
35
+ rg_contains_p(VALUE self, VALUE relationship)
24
36
  {
25
37
  return CBOOL2RVAL(atk_relation_set_contains(
26
38
  _SELF(self),
27
- RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE)));
39
+ RVAL2ATKRELATIONTYPE(relationship)));
28
40
  }
29
41
 
30
42
  static VALUE
31
- rbatkrelset_remove(VALUE self, VALUE relation)
43
+ rg_remove(VALUE self, VALUE relation)
32
44
  {
33
- atk_relation_set_remove(_SELF(self), ATK_RELATION(RVAL2GOBJ(relation)));
45
+ atk_relation_set_remove(_SELF(self), RVAL2ATKRELATION(relation));
34
46
  return self;
35
47
  }
36
48
 
37
49
  static VALUE
38
- rbatkrelset_add(VALUE self, VALUE relation)
50
+ rg_add(VALUE self, VALUE relation)
39
51
  {
40
- atk_relation_set_add(_SELF(self), ATK_RELATION(RVAL2GOBJ(relation)));
52
+ atk_relation_set_add(_SELF(self), RVAL2ATKRELATION(relation));
41
53
  return self;
42
54
  }
43
55
 
44
56
  static VALUE
45
- rbatkrelset_get_n_relations(VALUE self)
57
+ rg_n_relations(VALUE self)
46
58
  {
47
59
  return INT2NUM(atk_relation_set_get_n_relations(_SELF(self)));
48
60
  }
49
61
 
50
62
  static VALUE
51
- rbatkrelset_get_relation(VALUE self, VALUE i)
63
+ rg_get_relation(VALUE self, VALUE i)
52
64
  {
53
65
  if (rb_obj_is_kind_of(i, GTYPE2CLASS(ATK_TYPE_RELATION_TYPE))){
54
66
  return GOBJ2RVAL(atk_relation_set_get_relation_by_type(
55
67
  _SELF(self),
56
- RVAL2GENUM(i, ATK_TYPE_RELATION_TYPE)));
68
+ RVAL2ATKRELATIONTYPE(i)));
57
69
  } else {
58
70
  return GOBJ2RVAL(atk_relation_set_get_relation(_SELF(self), NUM2INT(i)));
59
71
  }
@@ -61,27 +73,27 @@ rbatkrelset_get_relation(VALUE self, VALUE i)
61
73
 
62
74
  #if ATK_CHECK_VERSION(1,9,0)
63
75
  static VALUE
64
- rbatkrelset_add_relation(VALUE self, VALUE relationship, VALUE obj)
76
+ rg_add_relation(VALUE self, VALUE relationship, VALUE obj)
65
77
  {
66
78
  atk_relation_set_add_relation_by_type(_SELF(self),
67
- RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE),
68
- ATK_OBJECT(RVAL2GOBJ(obj)));
79
+ RVAL2ATKRELATIONTYPE(relationship),
80
+ RVAL2ATKOBJECT(obj));
69
81
  return self;
70
82
  }
71
83
  #endif
72
84
 
73
85
  void
74
- Init_atk_relation_set()
86
+ Init_atk_relation_set(VALUE mAtk)
75
87
  {
76
- VALUE rel = G_DEF_CLASS(ATK_TYPE_RELATION_SET, "RelationSet", mAtk);
88
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_RELATION_SET, "RelationSet", mAtk);
77
89
 
78
- rb_define_method(rel, "initialize", rbatkrelset_initialize, 0);
79
- rb_define_method(rel, "contains?", rbatkrelset_contains, 1);
80
- rb_define_method(rel, "remove", rbatkrelset_remove, 1);
81
- rb_define_method(rel, "add", rbatkrelset_add, 1);
82
- rb_define_method(rel, "n_relations", rbatkrelset_get_n_relations, 0);
83
- rb_define_method(rel, "get_relation", rbatkrelset_get_relation, 1);
90
+ RG_DEF_METHOD(initialize, 0);
91
+ RG_DEF_METHOD_P(contains, 1);
92
+ RG_DEF_METHOD(remove, 1);
93
+ RG_DEF_METHOD(add, 1);
94
+ RG_DEF_METHOD(n_relations, 0);
95
+ RG_DEF_METHOD(get_relation, 1);
84
96
  #if ATK_CHECK_VERSION(1,9,0)
85
- rb_define_method(rel, "add_relation", rbatkrelset_add_relation, 2);
97
+ RG_DEF_METHOD(add_relation, 2);
86
98
  #endif
87
99
  }