ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/gtk2-perl-xs.patch
Revision: 1.1
Committed: Sun Jun 1 06:07:11 2003 UTC (20 years, 11 months ago) by pcg
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# Content
1
2
3 Gtk2/ChangeLog
4 2003/06/01 08:07 pcg
5
6 * xs/GtkAspectFrame.xs: fixed package name typo.
7 * xs/GtkAspectFrame.xs: renamed ->set to set_param, because ->set is more
8 universal.
9 * xs/GtkTreeSortable: fixed package name typo.
10
11 Glib/ChangeLog
12 2003/06/01 08:07 pcg
13
14 * gperl.h: make it compile even on non-threaded perls (where aTHX is empty).
15 * GObject.xs: ->set and ->get accept more than one property pair/name.
16
17
18 Index: Glib/GObject.xs
19 ===================================================================
20 RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GObject.xs,v
21 retrieving revision 1.2
22 diff -u -p -r1.2 GObject.xs
23 --- Glib/GObject.xs 22 May 2003 14:23:11 -0000 1.2
24 +++ Glib/GObject.xs 1 Jun 2003 06:05:24 -0000
25 @@ -390,37 +390,49 @@ g_object_get_data (object, key)
26
27
28 SV *
29 -g_object_get (object, name)
30 +g_object_get (object, ...)
31 GObject * object
32 - char * name
33 ALIAS:
34 Glib::Object::get = 0
35 Glib::Object::get_property = 1
36 PREINIT:
37 GValue value = {0,};
38 - CODE:
39 - init_property_value (object, name, &value);
40 - g_object_get_property (object, name, &value);
41 - RETVAL = gperl_sv_from_value (&value);
42 - g_value_unset (&value);
43 - OUTPUT:
44 - RETVAL
45 + PPCODE:
46 + int i;
47 +
48 + EXTEND (SP, items);
49 + for (i = 1; i <= items; i++) {
50 + char *name = SvPV_nolen (ST (i));
51 +
52 + init_property_value (object, name, &value);
53 + g_object_get_property (object, name, &value);
54 + PUSHs (sv_2mortal (gperl_sv_from_value (&value)));
55 + g_value_unset (&value);
56 + }
57
58 void
59 -g_object_set (object, name, newval)
60 +g_object_set (object, ...)
61 GObject * object
62 - char * name
63 - SV * newval
64 ALIAS:
65 Glib::Object::set = 0
66 Glib::Object::set_property = 1
67 PREINIT:
68 GValue value = {0,};
69 CODE:
70 - init_property_value (object, name, &value);
71 - gperl_value_from_sv (&value, newval);
72 - g_object_set_property (object, name, &value);
73 - g_value_unset (&value);
74 + int i;
75 +
76 + if (!(items % 2))
77 + croak ("set method expects name => value pairs (off number of arguments detected)");
78 +
79 + for (i = 1; i < items; i += 2) {
80 + char *name = SvPV_nolen (ST (i));
81 + SV *newval = ST (i + 1);
82 +
83 + init_property_value (object, name, &value);
84 + gperl_value_from_sv (&value, newval);
85 + g_object_set_property (object, name, &value);
86 + g_value_unset (&value);
87 + }
88
89
90 void
91 Index: Glib/gperl.h
92 ===================================================================
93 RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v
94 retrieving revision 1.4
95 diff -u -p -r1.4 gperl.h
96 --- Glib/gperl.h 31 May 2003 04:00:45 -0000 1.4
97 +++ Glib/gperl.h 1 Jun 2003 06:05:24 -0000
98 @@ -28,6 +28,11 @@
99
100 #include <glib-object.h>
101
102 +#ifndef PERL_IMPLICIT_CONTEXT
103 +# undef aTHX
104 +# define aTHX (void *)0
105 +#endif
106 +
107 /*
108 * miscellaneous
109 */
110 Index: Gtk2/xs/GtkAspectFrame.xs
111 ===================================================================
112 RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAspectFrame.xs,v
113 retrieving revision 1.3
114 diff -u -p -r1.3 GtkAspectFrame.xs
115 --- Gtk2/xs/GtkAspectFrame.xs 22 May 2003 14:23:23 -0000 1.3
116 +++ Gtk2/xs/GtkAspectFrame.xs 1 Jun 2003 06:05:24 -0000
117 @@ -21,7 +21,7 @@
118
119 #include "gtk2perl.h"
120
121 -MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspectframe_
122 +MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspect_frame_
123
124 ## GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child)
125 GtkWidget *
126 @@ -35,9 +35,10 @@ gtk_aspect_frame_new (class, label, xali
127 C_ARGS:
128 label, xalign, yalign, ratio, obey_child
129
130 +# renamed to set_params because the existing ->set method is more important
131 ## void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child)
132 void
133 -gtk_aspect_frame_set (aspect_frame, xalign, yalign, ratio, obey_child)
134 +gtk_aspect_frame_set_params (aspect_frame, xalign, yalign, ratio, obey_child)
135 GtkAspectFrame * aspect_frame
136 gfloat xalign
137 gfloat yalign
138 Index: Gtk2/xs/GtkTreeSortable.xs
139 ===================================================================
140 RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkTreeSortable.xs,v
141 retrieving revision 1.3
142 diff -u -p -r1.3 GtkTreeSortable.xs
143 --- Gtk2/xs/GtkTreeSortable.xs 22 May 2003 14:23:24 -0000 1.3
144 +++ Gtk2/xs/GtkTreeSortable.xs 1 Jun 2003 06:05:24 -0000
145 @@ -23,7 +23,7 @@
146
147 // typedef gint (* GtkTreeIterCompareFunc) (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
148
149 -MODULE = Gtk2::TreeSortable PACKAGE = Gtk2::TreeSortable PREFIX = gtk_tre_sortable_
150 +MODULE = Gtk2::TreeSortable PACKAGE = Gtk2::TreeSortable PREFIX = gtk_tree_sortable_
151
152 ## void gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable)
153 void