ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/gtk2-perl-xs.patch
(Generate patch)

Comparing kgsueme/gtk2-perl-xs.patch (file contents):
Revision 1.3 by pcg, Sun Jun 1 20:12:10 2003 UTC vs.
Revision 1.4 by pcg, Mon Jun 2 14:33:20 2003 UTC

1 1
2Gtk2 2Gtk2
3 * xs/GtkAspectFrame.xs: fixed package name typo.
4 * xs/GtkAspectFrame.xs: renamed ->set to set_param, because ->set is more
5 universal.
6 * xs/GtkTreeSortable.xs: fixed package name typo.
7 * xs/GtkAdjustment.xs: add accors/mutators for struct values. 3 * xs/GtkAdjustment.xs: add accors/mutators for struct values.
8 4
9Glib 5Glib
10 * gperl.h: make it compile even on non-threaded perls (where aTHX is empty). 6 * gperl.h: make it compile even on non-threaded perls (where aTHX is empty).
11 * GObject.xs: ->set and ->get accept more than one property pair/name.
12 7
13Index: Makefile
14===================================================================
15RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Makefile,v
16retrieving revision 1.2
17diff -u -p -r1.2 Makefile
18--- Makefile 17 May 2003 21:28:05 -0000 1.2
19+++ Makefile 1 Jun 2003 20:11:52 -0000
20@@ -16,7 +16,7 @@
21 # non-system installed version. If you have any questions send them to the
22 # mailing list -rm
23
24-PREFIX=/usr/local
25+PREFIX=//opt/perl
26
27 TARGETS=Glib/Makefile Glib.build
28 TARGETS+=Gtk2/Makefile Gtk2.build
29Index: Glib/GObject.xs
30===================================================================
31RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GObject.xs,v
32retrieving revision 1.2
33diff -u -p -r1.2 GObject.xs
34--- Glib/GObject.xs 22 May 2003 14:23:11 -0000 1.2
35+++ Glib/GObject.xs 1 Jun 2003 20:11:53 -0000
36@@ -390,37 +390,49 @@ g_object_get_data (object, key)
37
38
39 SV *
40-g_object_get (object, name)
41+g_object_get (object, ...)
42 GObject * object
43- char * name
44 ALIAS:
45 Glib::Object::get = 0
46 Glib::Object::get_property = 1
47 PREINIT:
48 GValue value = {0,};
49- CODE:
50- init_property_value (object, name, &value);
51- g_object_get_property (object, name, &value);
52- RETVAL = gperl_sv_from_value (&value);
53- g_value_unset (&value);
54- OUTPUT:
55- RETVAL
56+ PPCODE:
57+ int i;
58+
59+ EXTEND (SP, items);
60+ for (i = 1; i < items; i++) {
61+ char *name = SvPV_nolen (ST (i));
62+
63+ init_property_value (object, name, &value);
64+ g_object_get_property (object, name, &value);
65+ PUSHs (sv_2mortal (gperl_sv_from_value (&value)));
66+ g_value_unset (&value);
67+ }
68
69 void
70-g_object_set (object, name, newval)
71+g_object_set (object, ...)
72 GObject * object
73- char * name
74- SV * newval
75 ALIAS:
76 Glib::Object::set = 0
77 Glib::Object::set_property = 1
78 PREINIT:
79 GValue value = {0,};
80 CODE:
81- init_property_value (object, name, &value);
82- gperl_value_from_sv (&value, newval);
83- g_object_set_property (object, name, &value);
84- g_value_unset (&value);
85+ int i;
86+
87+ if (!(items % 2))
88+ croak ("set method expects name => value pairs (off number of arguments detected)");
89+
90+ for (i = 1; i < items; i += 2) {
91+ char *name = SvPV_nolen (ST (i));
92+ SV *newval = ST (i + 1);
93+
94+ init_property_value (object, name, &value);
95+ gperl_value_from_sv (&value, newval);
96+ g_object_set_property (object, name, &value);
97+ g_value_unset (&value);
98+ }
99
100
101 void
102Index: Glib/gperl.h 8Index: Glib/gperl.h
103=================================================================== 9===================================================================
104RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v 10RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v
105retrieving revision 1.4 11retrieving revision 1.4
106diff -u -p -r1.4 gperl.h 12diff -u -p -r1.4 gperl.h
107--- Glib/gperl.h 31 May 2003 04:00:45 -0000 1.4 13--- Glib/gperl.h 31 May 2003 04:00:45 -0000 1.4
108+++ Glib/gperl.h 1 Jun 2003 20:11:54 -0000 14+++ Glib/gperl.h 2 Jun 2003 14:32:11 -0000
109@@ -28,6 +28,11 @@ 15@@ -28,6 +28,11 @@
110 16
111 #include <glib-object.h> 17 #include <glib-object.h>
112 18
113+#ifndef PERL_IMPLICIT_CONTEXT 19+#ifndef PERL_IMPLICIT_CONTEXT
122=================================================================== 28===================================================================
123RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAdjustment.xs,v 29RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAdjustment.xs,v
124retrieving revision 1.3 30retrieving revision 1.3
125diff -u -p -r1.3 GtkAdjustment.xs 31diff -u -p -r1.3 GtkAdjustment.xs
126--- Gtk2/xs/GtkAdjustment.xs 22 May 2003 14:23:23 -0000 1.3 32--- Gtk2/xs/GtkAdjustment.xs 22 May 2003 14:23:23 -0000 1.3
127+++ Gtk2/xs/GtkAdjustment.xs 1 Jun 2003 20:11:54 -0000 33+++ Gtk2/xs/GtkAdjustment.xs 2 Jun 2003 14:32:11 -0000
128@@ -58,3 +58,35 @@ gtk_adjustment_set_value (adjustment, va 34@@ -58,3 +58,35 @@ gtk_adjustment_set_value (adjustment, va
129 GtkAdjustment *adjustment 35 GtkAdjustment *adjustment
130 gdouble value 36 gdouble value
131 37
132+gdouble 38+gdouble
159+ break; 65+ break;
160+ } 66+ }
161+ OUTPUT: 67+ OUTPUT:
162+ RETVAL 68+ RETVAL
163+ 69+
164Index: Gtk2/xs/GtkAspectFrame.xs
165===================================================================
166RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAspectFrame.xs,v
167retrieving revision 1.3
168diff -u -p -r1.3 GtkAspectFrame.xs
169--- Gtk2/xs/GtkAspectFrame.xs 22 May 2003 14:23:23 -0000 1.3
170+++ Gtk2/xs/GtkAspectFrame.xs 1 Jun 2003 20:11:54 -0000
171@@ -21,7 +21,7 @@
172
173 #include "gtk2perl.h"
174
175-MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspectframe_
176+MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspect_frame_
177
178 ## GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child)
179 GtkWidget *
180@@ -35,9 +35,10 @@ gtk_aspect_frame_new (class, label, xali
181 C_ARGS:
182 label, xalign, yalign, ratio, obey_child
183
184+# renamed to set_params because the existing ->set method is more important
185 ## void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child)
186 void
187-gtk_aspect_frame_set (aspect_frame, xalign, yalign, ratio, obey_child)
188+gtk_aspect_frame_set_params (aspect_frame, xalign, yalign, ratio, obey_child)
189 GtkAspectFrame * aspect_frame
190 gfloat xalign
191 gfloat yalign
192Index: Gtk2/xs/GtkTreeSortable.xs
193===================================================================
194RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkTreeSortable.xs,v
195retrieving revision 1.3
196diff -u -p -r1.3 GtkTreeSortable.xs
197--- Gtk2/xs/GtkTreeSortable.xs 22 May 2003 14:23:24 -0000 1.3
198+++ Gtk2/xs/GtkTreeSortable.xs 1 Jun 2003 20:11:54 -0000
199@@ -23,7 +23,7 @@
200
201 // typedef gint (* GtkTreeIterCompareFunc) (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
202
203-MODULE = Gtk2::TreeSortable PACKAGE = Gtk2::TreeSortable PREFIX = gtk_tre_sortable_
204+MODULE = Gtk2::TreeSortable PACKAGE = Gtk2::TreeSortable PREFIX = gtk_tree_sortable_
205
206 ## void gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable)
207 void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines