annotate src/ui-byhand.c @ 5287:cd167465bf69

More permission consistency.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 14 Jun 2010 15:03:08 +0900
parents ba07c880114a
children b9167d522a9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5287
cd167465bf69 More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5231
diff changeset
1 /* ui-byhand.c --- hand-coded GTK functions
cd167465bf69 More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5231
diff changeset
2
cd167465bf69 More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5231
diff changeset
3 Copyright (C) 2000, 2001 William M. Perry
cd167465bf69 More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5231
diff changeset
4
cd167465bf69 More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5231
diff changeset
5 I really wish this entire file could go away, but there is
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 currently no way to do the following in the Foreign Function
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 Interface:
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 1) Deal with return values in the parameter list (ie: int *foo)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 So we have to code a few functions by hand. Ick.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 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
14
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 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
16
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 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
18 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
19 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
20 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
21
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 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
23 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
24 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
25 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
26
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
27 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
28 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
29 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
30 Boston, MA 02110-1301, USA.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 #include "gui.h"
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 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
36 Returns information about how CHILD is packed into BOX.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 Return value is a list of (EXPAND FILL PADDING PACK_TYPE).
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 (box, child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 guint padding;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 Lisp_Object result = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 CHECK_GTK_OBJECT (child);
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 if (!GTK_IS_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
51 wtaerror ("Object is not a GtkBox", box);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 }
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
56 wtaerror ("Child is not a GtkWidget", child);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 }
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 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 &expand, &fill, &padding, &pack_type);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 result = Fcons (make_int (pack_type), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 result = Fcons (make_int (padding), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 result = Fcons (fill ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 result = Fcons (expand ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 return (result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 /* 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
72 DEFUN ("gtk-button-box-get-child-size-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 Fgtk_button_box_get_child_size_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 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
75 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 ())
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 gint width, 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 gtk_button_box_get_child_size_default (&width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 return (Fcons (make_int (width), make_int (height)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 /* 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
86 DEFUN ("gtk-button-box-get-child-ipadding-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 Fgtk_button_box_get_child_ipadding_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 Return a cons cell (X . Y) of the default button box ipadding.
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 ())
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 gint x, 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 gtk_button_box_get_child_ipadding_default (&x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 /* void gtk_button_box_get_child_size (GtkButtonBox *widget,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 gint *min_width, gint *min_height); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 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
102 Get the current size of a child in the buttonbox BOX.
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 (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 gint width, height;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 CHECK_GTK_OBJECT (box);
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 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
112 wtaerror ("Not a GtkBox object", box);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 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
116 &width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 return (Fcons (make_int (width), make_int (height)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 /* 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
122 DEFUN ("gtk-button-box-get-child-ipadding",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 Fgtk_button_box_get_child_ipadding, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 Return a cons cell (X . Y) of the current buttonbox BOX ipadding.
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 (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 gint x, y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 CHECK_GTK_OBJECT (box);
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 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
134 wtaerror ("Not a GtkBox object", box);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 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
138 &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 /*void gtk_calendar_get_date (GtkCalendar *calendar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 guint *year,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 guint *month,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 guint *day);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 DEFUN ("gtk-calendar-get-date", Fgtk_calendar_get_date, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 Return a list of (YEAR MONTH DAY) from the CALENDAR object.
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 (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 guint year, month, day;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 CHECK_GTK_OBJECT (calendar);
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 if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
159 wtaerror ("Not a GtkCalendar object", calendar);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 &year, &month, &day);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 return (list3 (make_int (year), make_int (month), make_int (day)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 /* gint gtk_clist_get_text (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 gint row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 gint column,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 gchar **text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 DEFUN ("gtk-clist-get-text", Fgtk_clist_get_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 Returns the text from GtkCList OBJ cell at coordinates ROW, COLUMN.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 (obj, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 gchar *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 Lisp_Object rval = Qnil;
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 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 CHECK_INT (column);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
187 wtaerror ("Object is not a GtkCList", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
190 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
191
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 if (text)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193 {
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4709
diff changeset
194 rval = build_cistring (text);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195 /* NOTE: This is NOT a memory leak. GtkCList returns a pointer
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196 to internally used memory, not a copy of it.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 g_free (text);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201 return (rval);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 /* gint gtk_clist_get_selection_info (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 gint x,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 gint y,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 gint *row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 gint *column); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 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
210 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
211 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 (obj, x, y))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 gint row, column;
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 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 CHECK_INT (x);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 CHECK_INT (y);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
222 wtaerror ("Object is not a GtkCList", obj);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 XINT (x), XINT (y), &row, &column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 return (Fcons (make_int (row), make_int (column)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 DEFUN ("gtk-clist-get-pixmap", Fgtk_clist_get_pixmap, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 Return a cons of (pixmap . mask) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237 GdkBitmap *mask = NULL;
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 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 CHECK_INT (column);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
245 wtaerror ("Object is not a GtkCList", clist);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246 }
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 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 XINT (row), XINT (column),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250 &pixmap, &mask);
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 return (Fcons (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
256 DEFUN ("gtk-clist-get-pixtext", Fgtk_clist_get_pixtext, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
257 Return a list of (pixmap mask text) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
258 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 GdkBitmap *mask = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263 char *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 guint8 spacing;
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 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
268 CHECK_INT (column);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
271 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
272 wtaerror ("Object is not a GtkCList", clist);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 }
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 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 XINT (row), XINT (column), &text, &spacing,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
277 &pixmap, &mask);
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 return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
280 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
281 (text && text[0]) ? build_cistring (text) : Qnil));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282 }
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 /* void gtk_color_selection_get_color(GtkColorSelection *colorsel, gdouble *color); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
285 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
286 Return a list of (RED GREEN BLUE ALPHA) from the GtkColorSelection OBJECT.
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 (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 gdouble rgba[4];
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
292 CHECK_GTK_OBJECT (object);
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 if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
295 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
296 wtaerror ("Object is not a GtkColorSelection", object);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
298
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
299 gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
300
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
301 return (list4 (make_float (rgba[0]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302 make_float (rgba[1]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
303 make_float (rgba[2]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 make_float (rgba[3])));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
305 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
306
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 /* (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
308 DEFUN ("gtk-editable-insert-text", Fgtk_editable_insert_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 Insert text STRINT at POS in GtkEditable widget OBJ.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310 Returns the new position of the cursor in the widget.
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 (obj, string, pos))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
313 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
314 gint the_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 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317 CHECK_STRING (string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 CHECK_INT (pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
320 the_pos = XINT (pos);
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 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
323 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
324 wtaerror ("Object is not a GtkEditable", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
325 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
326
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
327 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
328 (char *) XSTRING_DATA (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
329 XSTRING_LENGTH (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
330 &the_pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
331
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
332 return (make_int (the_pos));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
335 DEFUN ("gtk-pixmap-get", Fgtk_pixmap_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
336 Return a cons cell of (PIXMAP . MASK) from GtkPixmap OBJECT.
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 (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 GdkPixmap *pixmap, *mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
341
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
342 CHECK_GTK_OBJECT (object);
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 if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
345 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
346 wtaerror ("Object is not a GtkPixmap", object);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
347 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
348
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
349 gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask);
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 return (Fcons (pixmap ? build_gtk_object (GTK_OBJECT (pixmap)) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
352 mask ? build_gtk_object (GTK_OBJECT (mask)) : Qnil));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
355 DEFUN ("gtk-curve-get-vector", Fgtk_curve_get_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
356 Returns a vector of LENGTH points representing the curve of CURVE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
357 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
358 (curve, length))
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 gfloat *vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
361 Lisp_Object lisp_vector = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
362 int i;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
363
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
364 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
365 CHECK_INT (length);
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 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
368 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
369 wtaerror ("Object is not a GtkCurve", curve);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
370 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
371
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
372 vector = alloca_array (gfloat, XINT (length));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
373
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
374 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
375 lisp_vector = make_vector (XINT (length), Qnil);
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 for (i = 0; i < XINT (length); i++)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
378 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
379 XVECTOR_DATA (lisp_vector)[i] = make_float (vector[i]);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
382 return (lisp_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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
385 DEFUN ("gtk-curve-set-vector", Fgtk_curve_set_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
386 Set the vector of points on CURVE to VECTOR.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
387 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
388 (curve, vector))
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 gfloat *c_vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
391 int vec_length = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
392 int i;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
393
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
394 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
395 CHECK_VECTOR (vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
396
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
397 vec_length = XVECTOR_LENGTH (vector);
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 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
400 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
401 wtaerror ("Object is not a GtkCurve", curve);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
402 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
403
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
404 c_vector = alloca_array (gfloat, vec_length);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
405
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
406 for (i = 0; i < vec_length; i++)
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 CHECK_FLOAT (XVECTOR_DATA (vector)[i]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
409 c_vector[i] = extract_float (XVECTOR_DATA (vector)[i]);
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 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
413 return (Qt);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
416 DEFUN ("gtk-label-get", Fgtk_label_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
417 Return the text of LABEL.
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 (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 gchar *string;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
422
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
423 CHECK_GTK_OBJECT (label);
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 if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
426 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
427 wtaerror ("Object is not a GtkLabel", label);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
428 }
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 gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
431
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4709
diff changeset
432 return (build_cistring (string));
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
435 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
436 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
437 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
438 (notebook, child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
439 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
440 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
441 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
442
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
443 CHECK_GTK_OBJECT (notebook);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
444 CHECK_GTK_OBJECT (child);
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 if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (notebook)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
447 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
448 wtaerror ("Object is not a GtkLabel", notebook);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
449 }
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
452 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
453 wtaerror ("Object is not a GtkWidget", child);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
454 }
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 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
457 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
458 &expand, &fill, &pack_type);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
459
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
460 return (list3 (expand ? Qt : Qnil, fill ? Qt : Qnil, make_int (pack_type)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
463 DEFUN ("gtk-widget-get-pointer", Fgtk_widget_get_pointer, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
464 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
465 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
466 (widget))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
467 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
468 gint x,y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
469 CHECK_GTK_OBJECT (widget);
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
472 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
473 wtaerror ("Object is not a GtkWidget", widget);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
474 }
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 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
477
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
478 return (Fcons (make_int (x), make_int (y)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
479 }
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 /* 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
482 destroyed. This allows us to remove the references in gui-gtk.c
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
483 that made sure callbacks and such were GCPRO-ed
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
484 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
485 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
486 __remove_gcpro_by_id (gpointer user_data)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
487 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
488 ungcpro_popup_callbacks ((GUI_ID) user_data);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
491 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2054
diff changeset
492 __generic_toolbar_callback (GtkWidget *UNUSED (item), gpointer user_data)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
493 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
494 Lisp_Object callback;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
495 Lisp_Object lisp_user_data;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
496
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
497 callback = GET_LISP_FROM_VOID (user_data);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
498
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
499 lisp_user_data = XCAR (callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
500 callback = XCDR (callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
501
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
502 signal_special_gtk_user_event (Qnil, callback, lisp_user_data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
503 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
504
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
505 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
506 generic_toolbar_insert_item (Lisp_Object toolbar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
507 Lisp_Object text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
508 Lisp_Object tooltip_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
509 Lisp_Object tooltip_private_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
510 Lisp_Object icon,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
511 Lisp_Object callback,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
512 Lisp_Object data,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
513 Lisp_Object prepend_p,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
514 Lisp_Object position)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
515 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
516 GUI_ID id;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
517 GtkWidget *w = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
518
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
519 CHECK_GTK_OBJECT (toolbar);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
520 CHECK_GTK_OBJECT (icon);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
521 CHECK_STRING (text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
522 CHECK_STRING (tooltip_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
523 CHECK_STRING (tooltip_private_text);
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 if (!SYMBOLP (callback) && !LISTP (callback))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
526 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
527 wtaerror ("Callback must be symbol or eval-able form", callback);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
528 }
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 if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
531 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
532 wtaerror ("Object is not a GtkToolbar", toolbar);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
533 }
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
536 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
537 wtaerror ("Object is not a GtkWidget", icon);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
538 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
539
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
540 callback = Fcons (data, callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
541
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
542 id = new_gui_id ();
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
543 gcpro_popup_callbacks (id, callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
544 gtk_object_weakref (XGTK_OBJECT (toolbar)->object, __remove_gcpro_by_id,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
545 (gpointer) id);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
546
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
547 if (NILP (position))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
548 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
549 w = (NILP (prepend_p) ? gtk_toolbar_append_item : gtk_toolbar_prepend_item)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
550 (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object),
2054
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
551 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
552 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
553 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
554 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
555 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
556 STORE_LISP_IN_VOID (callback));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
557 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
558 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
559 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
560 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
561 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
562 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
563 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
564 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
565 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
566 STORE_LISP_IN_VOID (callback),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
567 XINT (position));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
571 return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
574 DEFUN ("gtk-toolbar-append-item", Fgtk_toolbar_append_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
575 Appends a new button to the given toolbar.
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 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
578 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
579 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
580 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
581
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
582 DEFUN ("gtk-toolbar-prepend-item", Fgtk_toolbar_prepend_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
583 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
584 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
585 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
586 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
587 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
588 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
589
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
590 DEFUN ("gtk-toolbar-insert-item", Fgtk_toolbar_insert_item, 7, 8, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
591 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
592 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
593 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, position, data))
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 CHECK_INT (position);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
596
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
597 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
598 }
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 /* GtkCTree is an abomination in the eyes of the object system. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
601 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
602 __emacs_gtk_ctree_recurse_internal (GtkCTree *ctree, GtkCTreeNode *node, gpointer user_data)
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 Lisp_Object closure;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
605
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
606 closure = GET_LISP_FROM_VOID (user_data);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
607
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
608 call3 (XCAR (closure),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
609 build_gtk_object (GTK_OBJECT (ctree)),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
610 build_gtk_boxed (node, GTK_TYPE_CTREE_NODE),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
611 XCDR (closure));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
612 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
613
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
614 DEFUN ("gtk-ctree-recurse", Fgtk_ctree_recurse, 3, 6, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
615 Recursively apply FUNC to all nodes of CTREE at or below NODE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
616 FUNC is called with three arguments: CTREE, a GtkCTreeNode, and DATA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
617 The return value of FUNC is ignored.
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 If optional 5th argument CHILDFIRSTP is non-nil, then
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
620 the function is called for each node after it has been
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
621 called for that node's children.
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 Optional 6th argument DEPTH limits how deeply to recurse.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
624
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
625 This function encompasses all the following Gtk functions:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
626
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
627 void gtk_ctree_post_recursive (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 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
630 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
631 void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
632 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
633 gint depth,
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 (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 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
639 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
640 void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
641 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
642 gint depth,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
643 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
644 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
645 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
646 (ctree, node, func, data, childfirstp, depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
647 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
648 struct gcpro gcpro1, gcpro2, gcpro3;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
649 Lisp_Object closure = Qnil;
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_OBJECT (ctree);
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 if (!NILP (node))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
654 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
655 CHECK_GTK_BOXED (node);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
656 }
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 if (!NILP (depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
659 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
660 CHECK_INT (depth);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
661 }
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 closure = Fcons (func, data);
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 GCPRO3 (ctree, node, closure);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
666
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
667 if (NILP (depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
668 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
669 (NILP (childfirstp) ? gtk_ctree_post_recursive : gtk_ctree_pre_recursive)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
670 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
671 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
672 __emacs_gtk_ctree_recurse_internal,
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
673 STORE_LISP_IN_VOID (closure));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
674 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
675 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
676 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
677 (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
678 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
679 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
680 XINT (depth),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
681 __emacs_gtk_ctree_recurse_internal,
5013
ae48681c47fa changes to VOID_TO_LISP et al.
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
682 STORE_LISP_IN_VOID (closure));
462
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 UNGCPRO;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
686 return (Qnil);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
687 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
688
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
689 void syms_of_ui_byhand (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
690 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
691 DEFSUBR (Fgtk_toolbar_append_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
692 DEFSUBR (Fgtk_toolbar_insert_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
693 DEFSUBR (Fgtk_toolbar_prepend_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
694 DEFSUBR (Fgtk_box_query_child_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
695 DEFSUBR (Fgtk_button_box_get_child_size_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
696 DEFSUBR (Fgtk_button_box_get_child_ipadding_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
697 DEFSUBR (Fgtk_button_box_get_child_size);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
698 DEFSUBR (Fgtk_button_box_get_child_ipadding);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
699 DEFSUBR (Fgtk_calendar_get_date);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
700 DEFSUBR (Fgtk_clist_get_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
701 DEFSUBR (Fgtk_clist_get_selection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
702 DEFSUBR (Fgtk_clist_get_pixmap);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
703 DEFSUBR (Fgtk_clist_get_pixtext);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
704 DEFSUBR (Fgtk_color_selection_get_color);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
705 DEFSUBR (Fgtk_editable_insert_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
706 DEFSUBR (Fgtk_pixmap_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
707 DEFSUBR (Fgtk_curve_get_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
708 DEFSUBR (Fgtk_curve_set_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
709 DEFSUBR (Fgtk_label_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
710 DEFSUBR (Fgtk_notebook_query_tab_label_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
711 DEFSUBR (Fgtk_widget_get_pointer);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
712 DEFSUBR (Fgtk_ctree_recurse);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
713 }