annotate src/ui-byhand.c @ 5231:ba07c880114a

Fix up FSF's Franklin Street address in many files.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sun, 13 Jun 2010 17:44:56 +0900
parents ae48681c47fa
children cd167465bf69 2aa9cd456ae7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 /* I really wish this entire file could go away, but there is
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 currently no way to do the following in the Foreign Function
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 Interface:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5 1) Deal with return values in the parameter list (ie: int *foo)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 So we have to code a few functions by hand. Ick.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 William M. Perry 5/8/00
4709
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
10
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
11 This file is part of XEmacs.
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
12
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
13 XEmacs is free software; you can redistribute it and/or modify it
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
14 under the terms of the GNU General Public License as published by the
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
15 Free Software Foundation; either version 2, or (at your option) any
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
16 later version.
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
17
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
18 XEmacs is distributed in the hope that it will be useful, but WITHOUT
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
21 for more details.
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
22
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
23 You should have received a copy of the GNU General Public License
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
24 along with XEmacs; see the file COPYING. If not, write to
db7068430402 Add explicit GPL v2 or later notices to Bill Perry's code, where such notices
Jerry James <james@xemacs.org>
parents: 2367
diff changeset
25 the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
5231
ba07c880114a Fix up FSF's Franklin Street address in many files.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5013
diff changeset
26 Boston, MA 02110-1301, USA.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 #include "gui.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31 DEFUN ("gtk-box-query-child-packing", Fgtk_box_query_child_packing, 2, 2,0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 Returns information about how CHILD is packed into BOX.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 Return value is a list of (EXPAND FILL PADDING PACK_TYPE).
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
35 (box, child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 guint padding;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 Lisp_Object result = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 CHECK_GTK_OBJECT (child);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 if (!GTK_IS_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
47 wtaerror ("Object is not a GtkBox", box);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
52 wtaerror ("Child is not a GtkWidget", child);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 &expand, &fill, &padding, &pack_type);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 result = Fcons (make_int (pack_type), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 result = Fcons (make_int (padding), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 result = Fcons (fill ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 result = Fcons (expand ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 return (result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 /* void gtk_button_box_get_child_size_default (gint *min_width, gint *min_height); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 DEFUN ("gtk-button-box-get-child-size-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 Fgtk_button_box_get_child_size_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 Return a cons cell (WIDTH . HEIGHT) of the default button box child size.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 ())
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 gint width, height;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 gtk_button_box_get_child_size_default (&width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 return (Fcons (make_int (width), make_int (height)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 /* void gtk_button_box_get_child_ipadding_default (gint *ipad_x, gint *ipad_y); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 DEFUN ("gtk-button-box-get-child-ipadding-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 Fgtk_button_box_get_child_ipadding_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 Return a cons cell (X . Y) of the default button box ipadding.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 ())
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 gint x, y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 gtk_button_box_get_child_ipadding_default (&x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 /* void gtk_button_box_get_child_size (GtkButtonBox *widget,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 gint *min_width, gint *min_height); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 DEFUN ("gtk-button-box-get-child-size", Fgtk_button_box_get_child_size, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 Get the current size of a child in the buttonbox BOX.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 (box))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 gint width, height;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
108 wtaerror ("Not a GtkBox object", box);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 &width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 return (Fcons (make_int (width), make_int (height)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 /* void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 DEFUN ("gtk-button-box-get-child-ipadding",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 Fgtk_button_box_get_child_ipadding, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 Return a cons cell (X . Y) of the current buttonbox BOX ipadding.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 (box))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 gint x, y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
130 wtaerror ("Not a GtkBox object", box);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133 gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 /*void gtk_calendar_get_date (GtkCalendar *calendar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 guint *year,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 guint *month,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 guint *day);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 DEFUN ("gtk-calendar-get-date", Fgtk_calendar_get_date, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 Return a list of (YEAR MONTH DAY) from the CALENDAR object.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 (calendar))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 guint year, month, day;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 CHECK_GTK_OBJECT (calendar);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153 if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
155 wtaerror ("Not a GtkCalendar object", calendar);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159 &year, &month, &day);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 return (list3 (make_int (year), make_int (month), make_int (day)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 /* gint gtk_clist_get_text (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 gint row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 gint column,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 gchar **text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 DEFUN ("gtk-clist-get-text", Fgtk_clist_get_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 Returns the text from GtkCList OBJ cell at coordinates ROW, COLUMN.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172 (obj, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 gchar *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 Lisp_Object rval = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 CHECK_INT (column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
183 wtaerror ("Object is not a GtkCList", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XINT (row), XINT (column), &text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 if (text)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189 {
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4709
diff changeset
190 rval = build_cistring (text);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191 /* NOTE: This is NOT a memory leak. GtkCList returns a pointer
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 to internally used memory, not a copy of it.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193 g_free (text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 return (rval);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 /* gint gtk_clist_get_selection_info (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201 gint x,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202 gint y,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 gint *row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 gint *column); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 DEFUN ("gtk-clist-get-selection-info", Fgtk_clist_get_selection, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 Returns a cons cell of (ROW . COLUMN) of the GtkCList OBJ at coordinates X, Y.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 (obj, x, y))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 gint row, column;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 CHECK_INT (x);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 CHECK_INT (y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
218 wtaerror ("Object is not a GtkCList", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 XINT (x), XINT (y), &row, &column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
224 return (Fcons (make_int (row), make_int (column)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227 DEFUN ("gtk-clist-get-pixmap", Fgtk_clist_get_pixmap, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 Return a cons of (pixmap . mask) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233 GdkBitmap *mask = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237 CHECK_INT (column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
241 wtaerror ("Object is not a GtkCList", clist);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
245 XINT (row), XINT (column),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246 &pixmap, &mask);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248 return (Fcons (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
251
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
252 DEFUN ("gtk-clist-get-pixtext", Fgtk_clist_get_pixtext, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 Return a list of (pixmap mask text) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
255 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
256 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
257 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
258 GdkBitmap *mask = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259 char *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 guint8 spacing;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 CHECK_INT (column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
265
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
266 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
268 wtaerror ("Object is not a GtkCList", clist);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
269 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
270
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
271 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
272 XINT (row), XINT (column), &text, &spacing,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 &pixmap, &mask);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
274
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
275 return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil,
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4709
diff changeset
277 (text && text[0]) ? build_cistring (text) : Qnil));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
278 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
279
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
280 /* void gtk_color_selection_get_color(GtkColorSelection *colorsel, gdouble *color); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
281 DEFUN ("gtk-color-selection-get-color", Fgtk_color_selection_get_color, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282 Return a list of (RED GREEN BLUE ALPHA) from the GtkColorSelection OBJECT.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
283 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
284 (object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
285 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
286 gdouble rgba[4];
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
287
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
288 CHECK_GTK_OBJECT (object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
289
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
290 if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
292 wtaerror ("Object is not a GtkColorSelection", object);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
293 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
294
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
295 gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
296
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 return (list4 (make_float (rgba[0]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
298 make_float (rgba[1]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
299 make_float (rgba[2]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
300 make_float (rgba[3])));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
301 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
303 /* (gtk-import-function nil "gtk_editable_insert_text" 'GtkEditable 'GtkString 'gint 'pointer-to-gint) */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 DEFUN ("gtk-editable-insert-text", Fgtk_editable_insert_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
305 Insert text STRINT at POS in GtkEditable widget OBJ.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
306 Returns the new position of the cursor in the widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
308 (obj, string, pos))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310 gint the_pos;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
311
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
312 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
313 CHECK_STRING (string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
314 CHECK_INT (pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
315
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
316 the_pos = XINT (pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
320 wtaerror ("Object is not a GtkEditable", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
321 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
322
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
323 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
324 (char *) XSTRING_DATA (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
325 XSTRING_LENGTH (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
326 &the_pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
327
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
328 return (make_int (the_pos));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
329 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
330
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
331 DEFUN ("gtk-pixmap-get", Fgtk_pixmap_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
332 Return a cons cell of (PIXMAP . MASK) from GtkPixmap OBJECT.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
333 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
334 (object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
335 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
336 GdkPixmap *pixmap, *mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
337
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
338 CHECK_GTK_OBJECT (object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
339
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
340 if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
341 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
342 wtaerror ("Object is not a GtkPixmap", object);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
343 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
344
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
345 gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
346
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
347 return (Fcons (pixmap ? build_gtk_object (GTK_OBJECT (pixmap)) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
348 mask ? build_gtk_object (GTK_OBJECT (mask)) : Qnil));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
349 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
350
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
351 DEFUN ("gtk-curve-get-vector", Fgtk_curve_get_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
352 Returns a vector of LENGTH points representing the curve of CURVE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
353 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
354 (curve, length))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
355 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
356 gfloat *vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
357 Lisp_Object lisp_vector = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
358 int i;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
359
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
360 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
361 CHECK_INT (length);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
362
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
363 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
364 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
365 wtaerror ("Object is not a GtkCurve", curve);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
366 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
367
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
368 vector = alloca_array (gfloat, XINT (length));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
369
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
370 gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XINT (length), vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
371 lisp_vector = make_vector (XINT (length), Qnil);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
372
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
373 for (i = 0; i < XINT (length); i++)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
374 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
375 XVECTOR_DATA (lisp_vector)[i] = make_float (vector[i]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
376 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
377
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
378 return (lisp_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
379 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
380
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
381 DEFUN ("gtk-curve-set-vector", Fgtk_curve_set_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
382 Set the vector of points on CURVE to VECTOR.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
383 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
384 (curve, vector))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
385 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
386 gfloat *c_vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
387 int vec_length = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
388 int i;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
389
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
390 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
391 CHECK_VECTOR (vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
392
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
393 vec_length = XVECTOR_LENGTH (vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
394
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
395 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
396 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
397 wtaerror ("Object is not a GtkCurve", curve);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
398 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
399
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
400 c_vector = alloca_array (gfloat, vec_length);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
401
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
402 for (i = 0; i < vec_length; i++)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
403 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
404 CHECK_FLOAT (XVECTOR_DATA (vector)[i]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
405 c_vector[i] = extract_float (XVECTOR_DATA (vector)[i]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
406 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
407
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
408 gtk_curve_set_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), vec_length, c_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
409 return (Qt);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
410 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
411
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
412 DEFUN ("gtk-label-get", Fgtk_label_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
413 Return the text of LABEL.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
414 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
415 (label))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
416 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
417 gchar *string;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
418
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
419 CHECK_GTK_OBJECT (label);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
420
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
421 if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
422 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
423 wtaerror ("Object is not a GtkLabel", label);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
424 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
425
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
426 gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
427
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4709
diff changeset
428 return (build_cistring (string));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
429 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
430
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
431 DEFUN ("gtk-notebook-query-tab-label-packing", Fgtk_notebook_query_tab_label_packing, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
432 Return a list of packing information (EXPAND FILL PACK_TYPE) for CHILD in NOTEBOOK.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
433 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
434 (notebook, child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
435 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
436 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
437 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
438
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
439 CHECK_GTK_OBJECT (notebook);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
440 CHECK_GTK_OBJECT (child);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
441
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
442 if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (notebook)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
443 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
444 wtaerror ("Object is not a GtkLabel", notebook);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
445 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
446
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
447 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
448 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
449 wtaerror ("Object is not a GtkWidget", child);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
450 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
451
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
452 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
453 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
454 &expand, &fill, &pack_type);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
455
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
456 return (list3 (expand ? Qt : Qnil, fill ? Qt : Qnil, make_int (pack_type)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
457 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
458
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
459 DEFUN ("gtk-widget-get-pointer", Fgtk_widget_get_pointer, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
460 Return the pointer position relative to WIDGET as a cons of (X . Y).
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
461 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
462 (widget))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
463 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
464 gint x,y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
465 CHECK_GTK_OBJECT (widget);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
466
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
467 if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
468 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
469 wtaerror ("Object is not a GtkWidget", widget);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
470 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
471
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
472 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
473
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
474 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
475 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
476
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
477 /* This is called whenever an item with a GUI_ID associated with it is
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
478 destroyed. This allows us to remove the references in gui-gtk.c
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
479 that made sure callbacks and such were GCPRO-ed
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
480 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
481 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
482 __remove_gcpro_by_id (gpointer user_data)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
483 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
484 ungcpro_popup_callbacks ((GUI_ID) user_data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
485 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
486
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
487 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2054
diff changeset
488 __generic_toolbar_callback (GtkWidget *UNUSED (item), gpointer user_data)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
489 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
490 Lisp_Object callback;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
491 Lisp_Object lisp_user_data;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
492
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
493 callback = GET_LISP_FROM_VOID (user_data);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
494
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
495 lisp_user_data = XCAR (callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
496 callback = XCDR (callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
497
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
498 signal_special_gtk_user_event (Qnil, callback, lisp_user_data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
499 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
500
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
501 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
502 generic_toolbar_insert_item (Lisp_Object toolbar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
503 Lisp_Object text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
504 Lisp_Object tooltip_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
505 Lisp_Object tooltip_private_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
506 Lisp_Object icon,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
507 Lisp_Object callback,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
508 Lisp_Object data,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
509 Lisp_Object prepend_p,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
510 Lisp_Object position)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
511 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
512 GUI_ID id;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
513 GtkWidget *w = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
514
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
515 CHECK_GTK_OBJECT (toolbar);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
516 CHECK_GTK_OBJECT (icon);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
517 CHECK_STRING (text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
518 CHECK_STRING (tooltip_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
519 CHECK_STRING (tooltip_private_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
520
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
521 if (!SYMBOLP (callback) && !LISTP (callback))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
522 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
523 wtaerror ("Callback must be symbol or eval-able form", callback);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
524 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
525
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
526 if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
527 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
528 wtaerror ("Object is not a GtkToolbar", toolbar);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
529 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
530
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
531 if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
532 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
533 wtaerror ("Object is not a GtkWidget", icon);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
534 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
535
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
536 callback = Fcons (data, callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
537
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
538 id = new_gui_id ();
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
539 gcpro_popup_callbacks (id, callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
540 gtk_object_weakref (XGTK_OBJECT (toolbar)->object, __remove_gcpro_by_id,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
541 (gpointer) id);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
542
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
543 if (NILP (position))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
544 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
545 w = (NILP (prepend_p) ? gtk_toolbar_append_item : gtk_toolbar_prepend_item)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
546 (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object),
2054
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
547 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
548 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
549 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
550 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
551 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
552 STORE_LISP_IN_VOID (callback));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
553 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
554 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
555 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
556 w = gtk_toolbar_insert_item (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object),
2054
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
557 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
558 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
559 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
560 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
561 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
562 STORE_LISP_IN_VOID (callback),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
563 XINT (position));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
564 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
565
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
566
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
567 return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
568 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
569
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
570 DEFUN ("gtk-toolbar-append-item", Fgtk_toolbar_append_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
571 Appends a new button to the given toolbar.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
572 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
573 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
574 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
575 return (generic_toolbar_insert_item (toolbar,text,tooltip_text,tooltip_private_text,icon,callback,data,Qnil,Qnil));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
576 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
577
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
578 DEFUN ("gtk-toolbar-prepend-item", Fgtk_toolbar_prepend_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
579 Adds a new button to the beginning (left or top edges) of the given toolbar.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
580 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
581 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
582 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
583 return (generic_toolbar_insert_item (toolbar,text,tooltip_text,tooltip_private_text,icon,callback,data,Qt,Qnil));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
584 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
585
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
586 DEFUN ("gtk-toolbar-insert-item", Fgtk_toolbar_insert_item, 7, 8, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
587 Adds a new button to the beginning (left or top edges) of the given toolbar.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
588 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
589 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, position, data))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
590 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
591 CHECK_INT (position);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
592
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
593 return (generic_toolbar_insert_item (toolbar,text,tooltip_text,tooltip_private_text,icon,callback,data,Qnil,position));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
594 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
595
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
596 /* GtkCTree is an abomination in the eyes of the object system. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
597 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
598 __emacs_gtk_ctree_recurse_internal (GtkCTree *ctree, GtkCTreeNode *node, gpointer user_data)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
599 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
600 Lisp_Object closure;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
601
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
602 closure = GET_LISP_FROM_VOID (user_data);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
603
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
604 call3 (XCAR (closure),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
605 build_gtk_object (GTK_OBJECT (ctree)),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
606 build_gtk_boxed (node, GTK_TYPE_CTREE_NODE),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
607 XCDR (closure));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
608 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
609
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
610 DEFUN ("gtk-ctree-recurse", Fgtk_ctree_recurse, 3, 6, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
611 Recursively apply FUNC to all nodes of CTREE at or below NODE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
612 FUNC is called with three arguments: CTREE, a GtkCTreeNode, and DATA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
613 The return value of FUNC is ignored.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
614
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
615 If optional 5th argument CHILDFIRSTP is non-nil, then
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
616 the function is called for each node after it has been
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
617 called for that node's children.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
618
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
619 Optional 6th argument DEPTH limits how deeply to recurse.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
620
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
621 This function encompasses all the following Gtk functions:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
622
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
623 void gtk_ctree_post_recursive (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
624 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
625 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
626 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
627 void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
628 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
629 gint depth,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
630 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
631 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
632 void gtk_ctree_pre_recursive (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
633 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
634 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
635 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
636 void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
637 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
638 gint depth,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
639 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
640 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
641 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
642 (ctree, node, func, data, childfirstp, depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
643 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
644 struct gcpro gcpro1, gcpro2, gcpro3;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
645 Lisp_Object closure = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
646
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
647 CHECK_GTK_OBJECT (ctree);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
648
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
649 if (!NILP (node))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
650 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
651 CHECK_GTK_BOXED (node);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
652 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
653
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
654 if (!NILP (depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
655 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
656 CHECK_INT (depth);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
657 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
658
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
659 closure = Fcons (func, data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
660
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
661 GCPRO3 (ctree, node, closure);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
662
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
663 if (NILP (depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
664 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
665 (NILP (childfirstp) ? gtk_ctree_post_recursive : gtk_ctree_pre_recursive)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
666 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
667 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
668 __emacs_gtk_ctree_recurse_internal,
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
669 STORE_LISP_IN_VOID (closure));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
670 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
671 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
672 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
673 (NILP (childfirstp) ? gtk_ctree_post_recursive_to_depth : gtk_ctree_pre_recursive_to_depth)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
674 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
675 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
676 XINT (depth),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
677 __emacs_gtk_ctree_recurse_internal,
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
678 STORE_LISP_IN_VOID (closure));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
679 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
680
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
681 UNGCPRO;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
682 return (Qnil);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
683 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
684
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
685 void syms_of_ui_byhand (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
686 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
687 DEFSUBR (Fgtk_toolbar_append_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
688 DEFSUBR (Fgtk_toolbar_insert_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
689 DEFSUBR (Fgtk_toolbar_prepend_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
690 DEFSUBR (Fgtk_box_query_child_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
691 DEFSUBR (Fgtk_button_box_get_child_size_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
692 DEFSUBR (Fgtk_button_box_get_child_ipadding_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
693 DEFSUBR (Fgtk_button_box_get_child_size);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
694 DEFSUBR (Fgtk_button_box_get_child_ipadding);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
695 DEFSUBR (Fgtk_calendar_get_date);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
696 DEFSUBR (Fgtk_clist_get_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
697 DEFSUBR (Fgtk_clist_get_selection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
698 DEFSUBR (Fgtk_clist_get_pixmap);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
699 DEFSUBR (Fgtk_clist_get_pixtext);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
700 DEFSUBR (Fgtk_color_selection_get_color);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
701 DEFSUBR (Fgtk_editable_insert_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
702 DEFSUBR (Fgtk_pixmap_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
703 DEFSUBR (Fgtk_curve_get_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
704 DEFSUBR (Fgtk_curve_set_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
705 DEFSUBR (Fgtk_label_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
706 DEFSUBR (Fgtk_notebook_query_tab_label_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
707 DEFSUBR (Fgtk_widget_get_pointer);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
708 DEFSUBR (Fgtk_ctree_recurse);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
709 }