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,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,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
+ */
3
21
 
4
- rbatkhyperlink.c -
22
+ #include "rbatkprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2004/10/17 23:06:07 $
8
-
9
- Copyright (C) 2003,2004 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_HYPERLINK(RVAL2GOBJ(s)))
24
+ #define RG_TARGET_NAMESPACE cHyperlink
25
+ #define _SELF(s) (RVAL2ATKHYPERLINK(s))
14
26
 
15
27
  static VALUE
16
- rbatk_hl_get_uri(VALUE self, VALUE i)
28
+ rg_get_uri(VALUE self, VALUE i)
17
29
  {
18
30
  return CSTR2RVAL(atk_hyperlink_get_uri(_SELF(self), NUM2INT(i)));
19
31
  }
20
32
 
21
33
  static VALUE
22
- rbatk_hl_get_object(VALUE self, VALUE i)
34
+ rg_get_object(VALUE self, VALUE i)
23
35
  {
24
36
  return GOBJ2RVAL(atk_hyperlink_get_object(_SELF(self), NUM2INT(i)));
25
37
  }
26
38
 
27
39
  static VALUE
28
- rbatk_hl_is_valid(VALUE self)
40
+ rg_valid_p(VALUE self)
29
41
  {
30
42
  return CBOOL2RVAL(atk_hyperlink_is_valid(_SELF(self)));
31
43
  }
32
44
 
33
45
  #ifdef HAVE_ATK_HYPERLINK_IS_INLINE
34
46
  static VALUE
35
- rbatk_hl_is_inline(VALUE self)
47
+ rg_inline_p(VALUE self)
36
48
  {
37
49
  return CBOOL2RVAL(atk_hyperlink_is_inline(_SELF(self)));
38
50
  }
39
51
  #endif
40
52
 
41
53
  static VALUE
42
- rbatk_hl_get_n_anchors(VALUE self)
54
+ rg_n_anchors(VALUE self)
43
55
  {
44
56
  return INT2NUM(atk_hyperlink_get_n_anchors(_SELF(self)));
45
57
  }
46
58
 
47
59
  void
48
- Init_atk_hyperlink()
60
+ Init_atk_hyperlink(VALUE mAtk)
49
61
  {
50
- VALUE hl = G_DEF_CLASS(ATK_TYPE_HYPERLINK, "Hyperlink", mAtk);
62
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_HYPERLINK, "Hyperlink", mAtk);
51
63
 
52
- rb_define_method(hl, "get_uri", rbatk_hl_get_uri, 1);
53
- rb_define_method(hl, "get_object", rbatk_hl_get_object, 1);
54
- rb_define_method(hl, "valid?", rbatk_hl_is_valid, 0);
64
+ RG_DEF_METHOD(get_uri, 1);
65
+ RG_DEF_METHOD(get_object, 1);
66
+ RG_DEF_METHOD_P(valid, 0);
55
67
  #ifdef HAVE_ATK_HYPERLINK_IS_INLINE
56
- rb_define_method(hl, "inline?", rbatk_hl_is_inline, 0);
68
+ RG_DEF_METHOD_P(inline, 0);
57
69
  #endif
58
- rb_define_method(hl, "n_anchors", rbatk_hl_get_n_anchors, 0);
70
+ RG_DEF_METHOD(n_anchors, 0);
59
71
  }
@@ -1,41 +1,53 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatkhypertext.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2003/12/07 17:18:16 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_HYPERTEXT(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 mHypertext
25
+ #define _SELF(s) (RVAL2ATKHYPERTEXT(s))
14
26
 
15
27
  static VALUE
16
- rbatk_ht_get_link(VALUE self, VALUE link_index)
28
+ rg_get_link(VALUE self, VALUE link_index)
17
29
  {
18
30
  return GOBJ2RVAL(atk_hypertext_get_link(_SELF(self), NUM2INT(link_index)));
19
31
  }
20
32
 
21
33
  static VALUE
22
- rbatk_ht_get_n_links(VALUE self)
34
+ rg_n_links(VALUE self)
23
35
  {
24
36
  return INT2NUM(atk_hypertext_get_n_links(_SELF(self)));
25
37
  }
26
38
 
27
39
  static VALUE
28
- rbatk_ht_get_link_index(VALUE self, VALUE char_index)
40
+ rg_link_index(VALUE self, VALUE char_index)
29
41
  {
30
42
  return INT2NUM(atk_hypertext_get_link_index(_SELF(self), NUM2INT(char_index)));
31
43
  }
32
44
 
33
45
  void
34
- Init_atk_hypertext()
46
+ Init_atk_hypertext(VALUE mAtk)
35
47
  {
36
- VALUE ht = G_DEF_INTERFACE(ATK_TYPE_HYPERTEXT, "Hypertext", mAtk);
48
+ VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_HYPERTEXT, "Hypertext", mAtk);
37
49
 
38
- rb_define_method(ht, "get_link", rbatk_ht_get_link, 1);
39
- rb_define_method(ht, "n_links", rbatk_ht_get_n_links, 0);
40
- rb_define_method(ht, "link_index", rbatk_ht_get_link_index, 1);
50
+ RG_DEF_METHOD(get_link, 1);
51
+ RG_DEF_METHOD(n_links, 0);
52
+ RG_DEF_METHOD(link_index, 1);
41
53
  }
data/ext/atk/rbatkimage.c CHANGED
@@ -1,34 +1,46 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
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
+ */
3
21
 
4
- rbatkhypertext.c -
22
+ #include "rbatkprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2004/03/05 15:33:47 $
8
-
9
- Copyright (C) 2004 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_IMAGE(RVAL2GOBJ(s)))
24
+ #define RG_TARGET_NAMESPACE mImage
25
+ #define _SELF(s) (RVAL2ATKIMAGE(s))
14
26
 
15
27
  static VALUE
16
- rbatkimage_get_image_position(VALUE self, VALUE coord_type)
28
+ rg_image_position(VALUE self, VALUE coord_type)
17
29
  {
18
30
  gint x, y;
19
31
  atk_image_get_image_position(_SELF(self), &x, &y,
20
- RVAL2GENUM(coord_type, ATK_TYPE_COORD_TYPE));
32
+ RVAL2ATKCOORDTYPE(coord_type));
21
33
  return rb_assoc_new(INT2NUM(x), INT2NUM(y));
22
34
  }
23
35
 
24
36
  static VALUE
25
- rbatkimage_get_image_description(VALUE self)
37
+ rg_image_description(VALUE self)
26
38
  {
27
39
  return CSTR2RVAL(atk_image_get_image_description(_SELF(self)));
28
40
  }
29
41
 
30
42
  static VALUE
31
- rbatkimage_set_image_description(VALUE self, VALUE description)
43
+ rg_set_image_description(VALUE self, VALUE description)
32
44
  {
33
45
  gboolean ret = atk_image_set_image_description(_SELF(self),
34
46
  RVAL2CSTR(description));
@@ -37,7 +49,7 @@ rbatkimage_set_image_description(VALUE self, VALUE description)
37
49
  }
38
50
 
39
51
  static VALUE
40
- rbatkimage_get_image_size(VALUE self)
52
+ rg_image_size(VALUE self)
41
53
  {
42
54
  gint width, height;
43
55
  atk_image_get_image_size(_SELF(self), &width, &height);
@@ -45,14 +57,14 @@ rbatkimage_get_image_size(VALUE self)
45
57
  }
46
58
 
47
59
  void
48
- Init_atk_image()
60
+ Init_atk_image(VALUE mAtk)
49
61
  {
50
- VALUE image = G_DEF_INTERFACE(ATK_TYPE_IMAGE, "Image", mAtk);
62
+ VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_IMAGE, "Image", mAtk);
51
63
 
52
- rb_define_method(image, "image_position", rbatkimage_get_image_position, 1);
53
- rb_define_method(image, "image_description", rbatkimage_get_image_description, 0);
54
- rb_define_method(image, "set_image_description", rbatkimage_set_image_description, 1);
55
- rb_define_method(image, "image_size", rbatkimage_get_image_size, 0);
64
+ RG_DEF_METHOD(image_position, 1);
65
+ RG_DEF_METHOD(image_description, 0);
66
+ RG_DEF_METHOD(set_image_description, 1);
67
+ RG_DEF_METHOD(image_size, 0);
56
68
 
57
- G_DEF_SETTERS(image);
69
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
58
70
  }
@@ -1,26 +1,38 @@
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
- rbatkimplementor.c -
22
+ #include "rbatkprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2003/12/07 17:18:16 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
- #include "rbatk.h"
12
-
13
- #define _SELF(s) (ATK_IMPLEMENTOR(RVAL2GOBJ(s)))
24
+ #define RG_TARGET_NAMESPACE mImplementor
25
+ #define _SELF(s) (RVAL2ATKIMPLEMENTOR(s))
14
26
 
15
27
  static VALUE
16
- rbatkimpl_ref_accessible(VALUE self)
28
+ rg_ref_accessible(VALUE self)
17
29
  {
18
30
  return GOBJ2RVAL(atk_implementor_ref_accessible(_SELF(self)));
19
31
  }
20
32
 
21
33
  void
22
- Init_atk_implementor()
34
+ Init_atk_implementor(VALUE mAtk)
23
35
  {
24
- VALUE impl = G_DEF_INTERFACE(ATK_TYPE_IMPLEMENTOR, "Implementor", mAtk);
25
- rb_define_method(impl, "ref_accessible", rbatkimpl_ref_accessible, 0);
36
+ VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_IMPLEMENTOR, "Implementor", mAtk);
37
+ RG_DEF_METHOD(ref_accessible, 0);
26
38
  }
@@ -1,29 +1,40 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatknoopobject.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2003/12/04 18:06:17 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbatk.h"
13
-
14
- #define _SELF(s) (ATK_NOOPOBJECT(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 cNoOpObject
25
+ #define _SELF(s) (RVAL2ATKNOOPOBJECT(s))
15
26
 
16
27
  static VALUE
17
- rbatk_no_op_object_initialize(VALUE self, VALUE gobj)
28
+ rg_initialize(VALUE self, VALUE gobj)
18
29
  {
19
30
  G_INITIALIZE(self, atk_no_op_object_new(RVAL2GOBJ(gobj)));
20
31
  return Qnil;
21
32
  }
22
33
 
23
34
  void
24
- Init_atk_noopobject()
35
+ Init_atk_noopobject(VALUE mAtk)
25
36
  {
26
- VALUE noop = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT, "NoOpObject", mAtk);
37
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT, "NoOpObject", mAtk);
27
38
 
28
- rb_define_method(noop, "initialize", rbatk_no_op_object_initialize, 1);
39
+ RG_DEF_METHOD(initialize, 1);
29
40
  }
@@ -1,29 +1,40 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatknoopobjectfactory.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2003/12/07 17:18:16 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbatk.h"
13
-
14
- #define _SELF(s) (ATK_NO_OP_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 cNoOpObjectFactory
25
+ #define _SELF(s) (RVAL2ATKNOOPOBJECTFACTORY(s))
15
26
 
16
27
  static VALUE
17
- rbatk_no_op_object_factory_initialize(VALUE self)
28
+ rg_initialize(VALUE self)
18
29
  {
19
30
  G_INITIALIZE(self, atk_no_op_object_factory_new());
20
31
  return Qnil;
21
32
  }
22
33
 
23
34
  void
24
- Init_atk_noopobjectfactory()
35
+ Init_atk_noopobjectfactory(VALUE mAtk)
25
36
  {
26
- VALUE noop = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT_FACTORY, "NoOpObjectFactory", mAtk);
37
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT_FACTORY, "NoOpObjectFactory", mAtk);
27
38
 
28
- rb_define_method(noop, "initialize", rbatk_no_op_object_factory_initialize, 0);
39
+ RG_DEF_METHOD(initialize, 0);
29
40
  }
@@ -1,16 +1,27 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbatkobject.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:28 $
8
-
9
- Copyright (C) 2003,2004 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbatk.h"
13
-
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 cObject
14
25
  #define _SELF(s) RVAL2ATKOBJECT(s)
15
26
 
16
27
  /* How can I implement this? Since 1.10
@@ -26,19 +37,19 @@ AtkObject* atk_object_get_parent (AtkObject *accessible);
26
37
  */
27
38
 
28
39
  static VALUE
29
- rbatkobj_get_n_accessible_children(VALUE self)
40
+ rg_n_accessible_children(VALUE self)
30
41
  {
31
42
  return INT2NUM(atk_object_get_n_accessible_children(_SELF(self)));
32
43
  }
33
44
 
34
45
  static VALUE
35
- rbatkobj_ref_accessible_child(VALUE self, VALUE i)
46
+ rg_ref_accessible_child(VALUE self, VALUE i)
36
47
  {
37
48
  return GOBJ2RVAL(atk_object_ref_accessible_child(_SELF(self), NUM2INT(i)));
38
49
  }
39
50
 
40
51
  static VALUE
41
- rbatkobj_ref_releation_set(VALUE self)
52
+ rg_ref_relation_set(VALUE self)
42
53
  {
43
54
  return GOBJ2RVAL(atk_object_ref_relation_set(_SELF(self)));
44
55
  }
@@ -50,13 +61,13 @@ AtkRole atk_object_get_role (AtkObject *accessible);
50
61
  */
51
62
 
52
63
  static VALUE
53
- rbatkobj_ref_state_set(VALUE self)
64
+ rg_ref_state_set(VALUE self)
54
65
  {
55
66
  return GOBJ2RVAL(atk_object_ref_state_set(_SELF(self)));
56
67
  }
57
68
 
58
69
  static VALUE
59
- rbatkobj_get_index_in_parent(VALUE self)
70
+ rg_index_in_parent(VALUE self)
60
71
  {
61
72
  return INT2NUM(atk_object_get_index_in_parent(_SELF(self)));
62
73
  }
@@ -81,10 +92,10 @@ void atk_object_remove_property_change_handler
81
92
  */
82
93
 
83
94
  static VALUE
84
- rbatkobj_notify_state_change(VALUE self, VALUE state, VALUE value)
95
+ rg_notify_state_change(VALUE self, VALUE state, VALUE value)
85
96
  {
86
97
  atk_object_notify_state_change(_SELF(self),
87
- RVAL2GENUM(state, ATK_TYPE_STATE_TYPE),
98
+ RVAL2ATKSTATETYPE(state),
88
99
  RVAL2CBOOL(value));
89
100
  return self;
90
101
  }
@@ -96,73 +107,47 @@ void atk_object_initialize (AtkObject *accessible,
96
107
 
97
108
  #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP
98
109
  static VALUE
99
- rbatkobj_add_relationship(VALUE self, VALUE relationship, VALUE target)
110
+ rg_add_relationship(VALUE self, VALUE relationship, VALUE target)
100
111
  {
101
112
  return CBOOL2RVAL(atk_object_add_relationship(
102
113
  _SELF(self),
103
- RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE),
114
+ RVAL2ATKRELATIONTYPE(relationship),
104
115
  _SELF(target)));
105
116
  }
106
117
  #endif
107
118
 
108
119
  #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP
109
120
  static VALUE
110
- rbatkobj_remove_relationship(VALUE self, VALUE relationship, VALUE target)
121
+ rg_remove_relationship(VALUE self, VALUE relationship, VALUE target)
111
122
  {
112
123
  return CBOOL2RVAL(atk_object_remove_relationship(
113
124
  _SELF(self),
114
- RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE),
125
+ RVAL2ATKRELATIONTYPE(relationship),
115
126
  _SELF(target)));
116
127
  }
117
128
  #endif
118
129
 
119
- /* We don't need this.
120
- G_CONST_RETURN gchar* atk_role_get_name (AtkRole role);
121
- */
122
-
123
- static VALUE
124
- rbatkrole_get_localized_name(VALUE self)
125
- {
126
- #ifdef HAVE_ATK_ROLE_GET_LOCALIZED_NAME
127
- return CSTR2RVAL(atk_role_get_localized_name(RVAL2GENUM(self, ATK_TYPE_ROLE)));
128
- #else
129
- rb_warning("not supported in this version of ATK.");
130
- return Qnil;
131
- #endif
132
- }
133
-
134
- static VALUE
135
- rbatkrole_s_for_name(VALUE self, VALUE name)
136
- {
137
- return GENUM2RVAL(atk_role_for_name(RVAL2CSTR(name)), ATK_TYPE_ROLE);
138
- }
139
-
140
130
  void
141
- Init_atk_object()
131
+ Init_atk_object(VALUE mAtk)
142
132
  {
143
- VALUE obj = G_DEF_CLASS(ATK_TYPE_OBJECT, "Object", mAtk);
144
- VALUE role;
145
-
146
- rb_define_method(obj, "n_accessible_children", rbatkobj_get_n_accessible_children, 0);
147
- rb_define_method(obj, "ref_accessible_child", rbatkobj_ref_accessible_child, 1);
148
- rb_define_method(obj, "ref_relation_set", rbatkobj_ref_releation_set, 0);
149
- rb_define_method(obj, "ref_state_set", rbatkobj_ref_state_set, 0);
150
- rb_define_method(obj, "index_in_parent", rbatkobj_get_index_in_parent, 0);
151
- rb_define_method(obj, "notify_state_change", rbatkobj_notify_state_change, 2);
133
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_OBJECT, "Object", mAtk);
134
+
135
+ RG_DEF_METHOD(n_accessible_children, 0);
136
+ RG_DEF_METHOD(ref_accessible_child, 1);
137
+ RG_DEF_METHOD(ref_relation_set, 0);
138
+ RG_DEF_METHOD(ref_state_set, 0);
139
+ RG_DEF_METHOD(index_in_parent, 0);
140
+ RG_DEF_METHOD(notify_state_change, 2);
152
141
  #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP
153
- rb_define_method(obj, "add_relationship", rbatkobj_add_relationship, 2);
142
+ RG_DEF_METHOD(add_relationship, 2);
154
143
  #endif
155
144
  #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP
156
- rb_define_method(obj, "remove_relationship", rbatkobj_remove_relationship, 2);
145
+ RG_DEF_METHOD(remove_relationship, 2);
157
146
  #endif
158
147
 
159
- /* AtkRole */
160
- role = G_DEF_CLASS(ATK_TYPE_ROLE, "Role", obj);
161
- rb_define_method(role, "localized_name", rbatkrole_get_localized_name, 0);
162
- rb_define_singleton_method(role, "for_name", rbatkrole_s_for_name, 1);
163
- G_DEF_CONSTANTS(obj, ATK_TYPE_ROLE, "ATK_");
148
+ Init_atk_object_role(RG_TARGET_NAMESPACE);
164
149
 
165
150
  /* AtkLayer */
166
- G_DEF_CLASS(ATK_TYPE_LAYER, "Layer", obj);
167
- G_DEF_CONSTANTS(obj, ATK_TYPE_LAYER, "ATK_");
151
+ G_DEF_CLASS(ATK_TYPE_LAYER, "Layer", RG_TARGET_NAMESPACE);
152
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_LAYER, "ATK_");
168
153
  }