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.5 by pcg, Tue Jun 3 04:45:42 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.
4 * xs/GtkTextTag.xs: add GtkTextTagTable + some methods.
5 * gtk-demo/textview.pl: fix demo to actually use unicode
6 as opposed to the garbled latin1.
8 7
9Glib 8Index: Gtk2/gtk-demo/textview.pl
10 * 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
13Index: Makefile
14=================================================================== 9===================================================================
15RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Makefile,v 10RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/gtk-demo/textview.pl,v
16retrieving revision 1.2 11retrieving revision 1.4
17diff -u -p -r1.2 Makefile 12diff -u -p -r1.4 textview.pl
18--- Makefile 17 May 2003 21:28:05 -0000 1.2 13--- Gtk2/gtk-demo/textview.pl 17 May 2003 13:31:02 -0000 1.4
19+++ Makefile 1 Jun 2003 20:11:52 -0000 14+++ Gtk2/gtk-demo/textview.pl 2 Jun 2003 16:21:31 -0000
20@@ -16,7 +16,7 @@ 15@@ -246,10 +246,10 @@ sub insert_text {
21 # non-system installed version. If you have any questions send them to the 16 $buffer->insert_with_tags_by_name ($iter, "Internationalization. ",
22 # mailing list -rm 17 "heading");
18
19- $buffer->insert ($iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman (Deutsch S\303\274d) Gr\303\274\303\237 Gott\nGreek (\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254) \316\223\316\265\316\271\316\254 \317\203\316\261\317\202\nHebrew \327\251\327\234\327\225\327\235\nJapanese (\346\227\245\346\234\254\350\252\236)\n\nThe widget properly handles bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, grapheme boundaries, and so on using the Pango internationalization framework.\n");
20+ $buffer->insert ($iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman (S\x{fc}ddeutschland) Gr\x{fc}\x{df} Gott\nGreek (\x{395}\x{3bb}\x{3bb}\x{3b7}\x{3bd}\x{3b9}\x{3ba}\x{3ac}) \x{393}\x{3b5}\x{3b9}\x{3ac} \x{3c3}\x{3b1}\x{3c2}\nHebrew \x{5e9}\x{5dc}\x{5d5}\x{5dd}\nJapanese (\x{65e5}\x{672c}\x{8a9e})\n\nThe widget properly handles bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, grapheme boundaries, and so on using the Pango internationalization framework.\n");
23 21
24-PREFIX=/usr/local 22 $buffer->insert ($iter, "Here's a word-wrapped quote in a right-to-left language:\n");
25+PREFIX=//opt/perl 23- $buffer->insert_with_tags_by_name ($iter, "\331\210\331\202\330\257 \330\250\330\257\330\243 \330\253\331\204\330\247\330\253 \331\205\331\206 \330\243\331\203\330\253\330\261 \330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 \330\252\331\202\330\257\331\205\330\247 \331\201\331\212 \330\264\330\250\331\203\330\251 \330\247\331\203\330\263\331\212\331\210\331\206 \330\250\330\261\330\247\331\205\330\254\331\207\330\247 \331\203\331\205\331\206\330\270\331\205\330\247\330\252 \331\204\330\247 \330\252\330\263\330\271\331\211 \331\204\331\204\330\261\330\250\330\255\330\214 \330\253\331\205 \330\252\330\255\331\210\331\204\330\252 \331\201\331\212 \330\247\331\204\330\263\331\206\331\210\330\247\330\252 \330\247\331\204\330\256\331\205\330\263 \330\247\331\204\331\205\330\247\330\266\331\212\330\251 \330\245\331\204\331\211 \331\205\330\244\330\263\330\263\330\247\330\252 \331\205\330\247\331\204\331\212\330\251 \331\205\331\206\330\270\331\205\330\251\330\214 \331\210\330\250\330\247\330\252\330\252 \330\254\330\262\330\241\330\247 \331\205\331\206 \330\247\331\204\331\206\330\270\330\247\331\205 \330\247\331\204\331\205\330\247\331\204\331\212 \331\201\331\212 \330\250\331\204\330\257\330\247\331\206\331\207\330\247\330\214 \331\210\331\204\331\203\331\206\331\207\330\247 \330\252\330\252\330\256\330\265\330\265 \331\201\331\212 \330\256\330\257\331\205\330\251 \331\202\330\267\330\247\330\271 \330\247\331\204\331\205\330\264\330\261\331\210\330\271\330\247\330\252 \330\247\331\204\330\265\330\272\331\212\330\261\330\251. \331\210\330\243\330\255\330\257 \330\243\331\203\330\253\330\261 \331\207\330\260\331\207 \330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 \331\206\330\254\330\247\330\255\330\247 \331\207\331\210 \302\273\330\250\330\247\331\206\331\203\331\210\330\263\331\210\331\204\302\253 \331\201\331\212 \330\250\331\210\331\204\331\212\331\201\331\212\330\247.\n\n",
26 24+ $buffer->insert_with_tags_by_name ($iter, "\x{648}\x{642}\x{62f} \x{628}\x{62f}\x{623} \x{62b}\x{644}\x{627}\x{62b} \x{645}\x{646} \x{623}\x{643}\x{62b}\x{631} \x{627}\x{644}\x{645}\x{624}\x{633}\x{633}\x{627}\x{62a} \x{62a}\x{642}\x{62f}\x{645}\x{627} \x{641}\x{64a} \x{634}\x{628}\x{643}\x{629} \x{627}\x{643}\x{633}\x{64a}\x{648}\x{646} \x{628}\x{631}\x{627}\x{645}\x{62c}\x{647}\x{627} \x{643}\x{645}\x{646}\x{638}\x{645}\x{627}\x{62a} \x{644}\x{627} \x{62a}\x{633}\x{639}\x{649} \x{644}\x{644}\x{631}\x{628}\x{62d}\x{60c} \x{62b}\x{645} \x{62a}\x{62d}\x{648}\x{644}\x{62a} \x{641}\x{64a} \x{627}\x{644}\x{633}\x{646}\x{648}\x{627}\x{62a} \x{627}\x{644}\x{62e}\x{645}\x{633} \x{627}\x{644}\x{645}\x{627}\x{636}\x{64a}\x{629} \x{625}\x{644}\x{649} \x{645}\x{624}\x{633}\x{633}\x{627}\x{62a} \x{645}\x{627}\x{644}\x{64a}\x{629} \x{645}\x{646}\x{638}\x{645}\x{629}\x{60c} \x{648}\x{628}\x{627}\x{62a}\x{62a} \x{62c}\x{632}\x{621}\x{627} \x{645}\x{646} \x{627}\x{644}\x{646}\x{638}\x{627}\x{645} \x{627}\x{644}\x{645}\x{627}\x{644}\x{64a} \x{641}\x{64a} \x{628}\x{644}\x{62f}\x{627}\x{646}\x{647}\x{627}\x{60c} \x{648}\x{644}\x{643}\x{646}\x{647}\x{627} \x{62a}\x{62a}\x{62e}\x{635}\x{635} \x{641}\x{64a} \x{62e}\x{62f}\x{645}\x{629} \x{642}\x{637}\x{627}\x{639} \x{627}\x{644}\x{645}\x{634}\x{631}\x{648}\x{639}\x{627}\x{62a} \x{627}\x{644}\x{635}\x{63a}\x{64a}\x{631}\x{629}. \x{648}\x{623}\x{62d}\x{62f} \x{623}\x{643}\x{62b}\x{631} \x{647}\x{630}\x{647} \x{627}\x{644}\x{645}\x{624}\x{633}\x{633}\x{627}\x{62a} \x{646}\x{62c}\x{627}\x{62d}\x{627} \x{647}\x{648} \x{bb}\x{628}\x{627}\x{646}\x{643}\x{648}\x{633}\x{648}\x{644}\x{ab} \x{641}\x{64a} \x{628}\x{648}\x{644}\x{64a}\x{641}\x{64a}\x{627}.\n\n",
27 TARGETS=Glib/Makefile Glib.build 25 "rtl_quote");
28 TARGETS+=Gtk2/Makefile Gtk2.build 26
29Index: Glib/GObject.xs 27 $buffer->insert ($iter, "You can put widgets in the buffer: Here's a button: ");
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
103===================================================================
104RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v
105retrieving revision 1.4
106diff -u -p -r1.4 gperl.h
107--- Glib/gperl.h 31 May 2003 04:00:45 -0000 1.4
108+++ Glib/gperl.h 1 Jun 2003 20:11:54 -0000
109@@ -28,6 +28,11 @@
110
111 #include <glib-object.h>
112
113+#ifndef PERL_IMPLICIT_CONTEXT
114+# undef aTHX
115+# define aTHX (void *)0
116+#endif
117+
118 /*
119 * miscellaneous
120 */
121Index: Gtk2/xs/GtkAdjustment.xs 28Index: Gtk2/xs/GtkAdjustment.xs
122=================================================================== 29===================================================================
123RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAdjustment.xs,v 30RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAdjustment.xs,v
124retrieving revision 1.3 31retrieving revision 1.3
125diff -u -p -r1.3 GtkAdjustment.xs 32diff -u -p -r1.3 GtkAdjustment.xs
126--- Gtk2/xs/GtkAdjustment.xs 22 May 2003 14:23:23 -0000 1.3 33--- 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 34+++ Gtk2/xs/GtkAdjustment.xs 2 Jun 2003 16:21:31 -0000
128@@ -58,3 +58,35 @@ gtk_adjustment_set_value (adjustment, va 35@@ -58,3 +58,35 @@ gtk_adjustment_set_value (adjustment, va
129 GtkAdjustment *adjustment 36 GtkAdjustment *adjustment
130 gdouble value 37 gdouble value
131 38
132+gdouble 39+gdouble
159+ break; 66+ break;
160+ } 67+ }
161+ OUTPUT: 68+ OUTPUT:
162+ RETVAL 69+ RETVAL
163+ 70+
164Index: Gtk2/xs/GtkAspectFrame.xs 71Index: Gtk2/xs/GtkTextTag.xs
165=================================================================== 72===================================================================
166RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkAspectFrame.xs,v 73RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkTextTag.xs,v
167retrieving revision 1.3 74retrieving revision 1.3
168diff -u -p -r1.3 GtkAspectFrame.xs 75diff -u -p -r1.3 GtkTextTag.xs
169--- Gtk2/xs/GtkAspectFrame.xs 22 May 2003 14:23:23 -0000 1.3 76--- Gtk2/xs/GtkTextTag.xs 22 May 2003 14:23:24 -0000 1.3
170+++ Gtk2/xs/GtkAspectFrame.xs 1 Jun 2003 20:11:54 -0000 77+++ Gtk2/xs/GtkTextTag.xs 2 Jun 2003 16:21:31 -0000
171@@ -21,7 +21,7 @@ 78@@ -83,3 +83,34 @@ gtk_text_attributes_copy_values (dest, s
172 79 ##gtk_text_attributes_ref (values)
173 #include "gtk2perl.h" 80 ## GtkTextAttributes *values
174 81 ##
175-MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspectframe_ 82+
176+MODULE = Gtk2::AspectFrame PACKAGE = Gtk2::AspectFrame PREFIX = gtk_aspect_frame_ 83+MODULE = Gtk2::TextTag PACKAGE = Gtk2::TextTagTable PREFIX = gtk_text_tag_table_
177 84+
178 ## GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child) 85+GtkTextTagTable_noinc *
179 GtkWidget * 86+gtk_text_tag_table_new (class)
180@@ -35,9 +35,10 @@ gtk_aspect_frame_new (class, label, xali 87+ SV * class
181 C_ARGS: 88+ C_ARGS:
182 label, xalign, yalign, ratio, obey_child 89+
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 90+void
187-gtk_aspect_frame_set (aspect_frame, xalign, yalign, ratio, obey_child) 91+gtk_text_tag_table_add (table, tag)
188+gtk_aspect_frame_set_params (aspect_frame, xalign, yalign, ratio, obey_child) 92+ GtkTextTagTable *table
189 GtkAspectFrame * aspect_frame 93+ GtkTextTag *tag
190 gfloat xalign 94+
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 95+void
96+gtk_text_tag_table_remove (table, tag)
97+ GtkTextTagTable *table
98+ GtkTextTag *tag
99+
100+GtkTextTag *
101+gtk_text_tag_table_lookup (table, name)
102+ GtkTextTagTable * table
103+ const gchar * name
104+
105+#void gtk_text_tag_table_foreach (GtkTextTagTable *table,
106+# GtkTextTagTableForeach func,
107+# gpointer data);
108+
109+gint
110+gtk_text_tag_table_get_size (table)
111+ GtkTextTagTable * table
112+

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines