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.2 by pcg, Sun Jun 1 06:40:15 2003 UTC vs.
Revision 1.4 by pcg, Mon Jun 2 14:33:20 2003 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines