annotate src/ui-byhand.c @ 2586:196ee3cd1ac5

[xemacs-hg @ 2005-02-15 01:19:48 by ben] first check-in of ben-fixup branch
author ben
date Tue, 15 Feb 2005 01:21:24 +0000
parents ecf1ebac70d8
children db7068430402
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
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 #include "gui.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 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
15 Returns information about how CHILD is packed into BOX.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 Return value is a list of (EXPAND FILL PADDING PACK_TYPE).
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 (box, child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 guint padding;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 Lisp_Object result = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26 CHECK_GTK_OBJECT (child);
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 if (!GTK_IS_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
30 wtaerror ("Object is not a GtkBox", box);
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
35 wtaerror ("Child is not a GtkWidget", child);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 &expand, &fill, &padding, &pack_type);
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 result = Fcons (make_int (pack_type), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 result = Fcons (make_int (padding), result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 result = Fcons (fill ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 result = Fcons (expand ? Qt : Qnil, result);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 return (result);
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 /* 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
51 DEFUN ("gtk-button-box-get-child-size-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 Fgtk_button_box_get_child_size_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 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
54 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 ())
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 gint width, height;
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_button_box_get_child_size_default (&width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 return (Fcons (make_int (width), make_int (height)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 /* 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
65 DEFUN ("gtk-button-box-get-child-ipadding-default",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 Fgtk_button_box_get_child_ipadding_default, 0, 0, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 Return a cons cell (X . Y) of the default button box ipadding.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 */
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 gint x, y;
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 gtk_button_box_get_child_ipadding_default (&x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 return (Fcons (make_int (x), make_int (y)));
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 /* void gtk_button_box_get_child_size (GtkButtonBox *widget,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 gint *min_width, gint *min_height); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 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
81 Get the current size of a child in the buttonbox BOX.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 (box))
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 gint width, height;
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 CHECK_GTK_OBJECT (box);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
91 wtaerror ("Not a GtkBox object", box);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 }
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_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 &width, &height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 return (Fcons (make_int (width), make_int (height)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 /* 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
101 DEFUN ("gtk-button-box-get-child-ipadding",
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 Fgtk_button_box_get_child_ipadding, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 Return a cons cell (X . Y) of the current buttonbox BOX ipadding.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 (box))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 gint x, y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 CHECK_GTK_OBJECT (box);
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 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
113 wtaerror ("Not a GtkBox object", box);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 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
117 &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 return (Fcons (make_int (x), make_int (y)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 /*void gtk_calendar_get_date (GtkCalendar *calendar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 guint *year,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 guint *month,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 guint *day);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 DEFUN ("gtk-calendar-get-date", Fgtk_calendar_get_date, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 Return a list of (YEAR MONTH DAY) from the CALENDAR object.
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 (calendar))
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 guint year, month, day;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 CHECK_GTK_OBJECT (calendar);
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 if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
138 wtaerror ("Not a GtkCalendar object", calendar);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 &year, &month, &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 return (list3 (make_int (year), make_int (month), make_int (day)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 }
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 /* gint gtk_clist_get_text (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 gint row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 gint column,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 gchar **text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 DEFUN ("gtk-clist-get-text", Fgtk_clist_get_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153 Returns the text from GtkCList OBJ cell at coordinates ROW, COLUMN.
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 (obj, row, column))
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 gchar *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 Lisp_Object rval = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 CHECK_INT (column);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
166 wtaerror ("Object is not a GtkCList", obj);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 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
170
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 if (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 rval = build_string (text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 /* NOTE: This is NOT a memory leak. GtkCList returns a pointer
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 to internally used memory, not a copy of it.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 g_free (text);
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 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 return (rval);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 /* gint gtk_clist_get_selection_info (GtkCList *clist,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 gint x,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 gint y,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 gint *row,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187 gint *column); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 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
189 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
190 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191 (obj, x, y))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193 gint row, column;
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 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196 CHECK_INT (x);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 CHECK_INT (y);
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 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
201 wtaerror ("Object is not a GtkCList", obj);
462
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 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 XINT (x), XINT (y), &row, &column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 return (Fcons (make_int (row), make_int (column)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 }
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 DEFUN ("gtk-clist-get-pixmap", Fgtk_clist_get_pixmap, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211 Return a cons of (pixmap . mask) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 GdkBitmap *mask = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220 CHECK_INT (column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
224 wtaerror ("Object is not a GtkCList", clist);
462
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 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 XINT (row), XINT (column),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229 &pixmap, &mask);
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 return (Fcons (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 DEFUN ("gtk-clist-get-pixtext", Fgtk_clist_get_pixtext, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 Return a list of (pixmap mask text) at ROW,COLUMN in CLIST.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238 (clist, row, column))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240 GdkPixmap *pixmap = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 GdkBitmap *mask = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 char *text = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243 guint8 spacing;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
245 CHECK_GTK_OBJECT (clist);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246 CHECK_INT (row);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247 CHECK_INT (column);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
251 wtaerror ("Object is not a GtkCList", clist);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
252 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
255 XINT (row), XINT (column), &text, &spacing,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
256 &pixmap, &mask);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
257
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
258 return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 (text && text[0]) ? build_string (text) : Qnil));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263 /* void gtk_color_selection_get_color(GtkColorSelection *colorsel, gdouble *color); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 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
265 Return a list of (RED GREEN BLUE ALPHA) from the GtkColorSelection OBJECT.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
266 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267 (object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
268 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
269 gdouble rgba[4];
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 CHECK_GTK_OBJECT (object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
272
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
274 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
275 wtaerror ("Object is not a GtkColorSelection", object);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
277
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
278 gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba);
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 return (list4 (make_float (rgba[0]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
281 make_float (rgba[1]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282 make_float (rgba[2]),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
283 make_float (rgba[3])));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
284 }
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 /* (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
287 DEFUN ("gtk-editable-insert-text", Fgtk_editable_insert_text, 3, 3, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
288 Insert text STRINT at POS in GtkEditable widget OBJ.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
289 Returns the new position of the cursor in the widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
290 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291 (obj, string, pos))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
292 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
293 gint the_pos;
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 CHECK_GTK_OBJECT (obj);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
296 CHECK_STRING (string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 CHECK_INT (pos);
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 the_pos = XINT (pos);
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 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
303 wtaerror ("Object is not a GtkEditable", obj);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 }
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 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 (char *) XSTRING_DATA (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
308 XSTRING_LENGTH (string),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 &the_pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
311 return (make_int (the_pos));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
312 }
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 DEFUN ("gtk-pixmap-get", Fgtk_pixmap_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
315 Return a cons cell of (PIXMAP . MASK) from GtkPixmap OBJECT.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
316 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317 (object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319 GdkPixmap *pixmap, *mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
320
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
321 CHECK_GTK_OBJECT (object);
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 if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
324 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
325 wtaerror ("Object is not a GtkPixmap", object);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
328 gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask);
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 return (Fcons (pixmap ? build_gtk_object (GTK_OBJECT (pixmap)) : Qnil,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
331 mask ? build_gtk_object (GTK_OBJECT (mask)) : Qnil));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
332 }
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 DEFUN ("gtk-curve-get-vector", Fgtk_curve_get_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
335 Returns a vector of LENGTH points representing the curve of CURVE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
336 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
337 (curve, length))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
338 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
339 gfloat *vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
340 Lisp_Object lisp_vector = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
341 int i;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
342
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
343 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
344 CHECK_INT (length);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
345
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
346 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
347 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
348 wtaerror ("Object is not a GtkCurve", curve);
462
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
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
351 vector = alloca_array (gfloat, XINT (length));
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
352
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
353 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
354 lisp_vector = make_vector (XINT (length), Qnil);
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 for (i = 0; i < XINT (length); i++)
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 XVECTOR_DATA (lisp_vector)[i] = make_float (vector[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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
361 return (lisp_vector);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
364 DEFUN ("gtk-curve-set-vector", Fgtk_curve_set_vector, 2, 2, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
365 Set the vector of points on CURVE to VECTOR.
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 (curve, vector))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
368 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
369 gfloat *c_vector = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
370 int vec_length = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
371 int i;
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 CHECK_GTK_OBJECT (curve);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
374 CHECK_VECTOR (vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
375
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
376 vec_length = XVECTOR_LENGTH (vector);
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 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
379 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
380 wtaerror ("Object is not a GtkCurve", curve);
462
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
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
383 c_vector = alloca_array (gfloat, vec_length);
462
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 for (i = 0; i < vec_length; i++)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
386 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
387 CHECK_FLOAT (XVECTOR_DATA (vector)[i]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
388 c_vector[i] = extract_float (XVECTOR_DATA (vector)[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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
391 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
392 return (Qt);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
395 DEFUN ("gtk-label-get", Fgtk_label_get, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
396 Return the text of LABEL.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
397 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
398 (label))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
399 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
400 gchar *string;
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 CHECK_GTK_OBJECT (label);
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 if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
405 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
406 wtaerror ("Object is not a GtkLabel", label);
462
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
409 gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
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 return (build_string (string));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
412 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
413
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
414 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
415 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
416 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
417 (notebook, child))
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 gboolean expand, fill;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
420 GtkPackType pack_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
421
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
422 CHECK_GTK_OBJECT (notebook);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
423 CHECK_GTK_OBJECT (child);
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_NOTEBOOK (XGTK_OBJECT (notebook)->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", notebook);
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
431 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
432 wtaerror ("Object is not a GtkWidget", child);
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 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
436 GTK_WIDGET (XGTK_OBJECT (child)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
437 &expand, &fill, &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 return (list3 (expand ? Qt : Qnil, fill ? Qt : Qnil, make_int (pack_type)));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
440 }
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 DEFUN ("gtk-widget-get-pointer", Fgtk_widget_get_pointer, 1, 1, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
443 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
444 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
445 (widget))
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 gint x,y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
448 CHECK_GTK_OBJECT (widget);
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 if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
451 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
452 wtaerror ("Object is not a GtkWidget", widget);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
453 }
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 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
456
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
457 return (Fcons (make_int (x), make_int (y)));
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
460 /* 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
461 destroyed. This allows us to remove the references in gui-gtk.c
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
462 that made sure callbacks and such were GCPRO-ed
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 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
465 __remove_gcpro_by_id (gpointer user_data)
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 ungcpro_popup_callbacks ((GUI_ID) user_data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
468 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
469
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
470 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2054
diff changeset
471 __generic_toolbar_callback (GtkWidget *UNUSED (item), gpointer user_data)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
472 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
473 Lisp_Object callback;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
474 Lisp_Object lisp_user_data;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
475
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 563
diff changeset
476 callback = VOID_TO_LISP (user_data);
462
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 lisp_user_data = XCAR (callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
479 callback = XCDR (callback);
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 signal_special_gtk_user_event (Qnil, callback, lisp_user_data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
482 }
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 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
485 generic_toolbar_insert_item (Lisp_Object toolbar,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
486 Lisp_Object text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
487 Lisp_Object tooltip_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
488 Lisp_Object tooltip_private_text,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
489 Lisp_Object icon,
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 data,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
492 Lisp_Object prepend_p,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
493 Lisp_Object position)
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 GUI_ID id;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
496 GtkWidget *w = NULL;
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 CHECK_GTK_OBJECT (toolbar);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
499 CHECK_GTK_OBJECT (icon);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
500 CHECK_STRING (text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
501 CHECK_STRING (tooltip_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
502 CHECK_STRING (tooltip_private_text);
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 if (!SYMBOLP (callback) && !LISTP (callback))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
505 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
506 wtaerror ("Callback must be symbol or eval-able form", callback);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
507 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
508
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
509 if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
510 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
511 wtaerror ("Object is not a GtkToolbar", toolbar);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
512 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
513
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
514 if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
515 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
516 wtaerror ("Object is not a GtkWidget", icon);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
517 }
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 callback = Fcons (data, callback);
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 id = new_gui_id ();
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
522 gcpro_popup_callbacks (id, callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
523 gtk_object_weakref (XGTK_OBJECT (toolbar)->object, __remove_gcpro_by_id,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
524 (gpointer) id);
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 (NILP (position))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
527 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
528 w = (NILP (prepend_p) ? gtk_toolbar_append_item : gtk_toolbar_prepend_item)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
529 (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object),
2054
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
530 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
531 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
532 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
533 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
534 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
535 LISP_TO_VOID (callback));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
536 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
537 else
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 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
540 (char*) XSTRING_DATA (text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
541 (char*) XSTRING_DATA (tooltip_text),
91d4c8c65a0f [xemacs-hg @ 2004-05-02 04:06:51 by malcolmp]
malcolmp
parents: 851
diff changeset
542 (char*) XSTRING_DATA (tooltip_private_text),
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
543 GTK_WIDGET (XGTK_OBJECT (icon)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
544 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
545 LISP_TO_VOID (callback),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
546 XINT (position));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
547 }
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
550 return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
551 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
552
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
553 DEFUN ("gtk-toolbar-append-item", Fgtk_toolbar_append_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
554 Appends a new button to the given toolbar.
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 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
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 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
559 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
560
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
561 DEFUN ("gtk-toolbar-prepend-item", Fgtk_toolbar_prepend_item, 6, 7, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
562 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
563 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
564 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, data))
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 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
567 }
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 DEFUN ("gtk-toolbar-insert-item", Fgtk_toolbar_insert_item, 7, 8, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
570 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
571 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
572 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, position, data))
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 CHECK_INT (position);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
575
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
576 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
577 }
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 /* GtkCTree is an abomination in the eyes of the object system. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
580 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
581 __emacs_gtk_ctree_recurse_internal (GtkCTree *ctree, GtkCTreeNode *node, gpointer user_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 Lisp_Object closure;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
584
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 563
diff changeset
585 closure = VOID_TO_LISP (user_data);
462
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 call3 (XCAR (closure),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
588 build_gtk_object (GTK_OBJECT (ctree)),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
589 build_gtk_boxed (node, GTK_TYPE_CTREE_NODE),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
590 XCDR (closure));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
591 }
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 DEFUN ("gtk-ctree-recurse", Fgtk_ctree_recurse, 3, 6, 0, /*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
594 Recursively apply FUNC to all nodes of CTREE at or below NODE.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
595 FUNC is called with three arguments: CTREE, a GtkCTreeNode, and DATA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
596 The return value of FUNC is ignored.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
597
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
598 If optional 5th argument CHILDFIRSTP is non-nil, then
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
599 the function is called for each node after it has been
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
600 called for that node's children.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
601
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
602 Optional 6th argument DEPTH limits how deeply to recurse.
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 This function encompasses all the following Gtk functions:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
605
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
606 void gtk_ctree_post_recursive (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
607 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
608 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
609 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
610 void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
611 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
612 gint depth,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
613 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
614 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
615 void gtk_ctree_pre_recursive (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
616 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
617 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
618 gpointer data);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
619 void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
620 GtkCTreeNode *node,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
621 gint depth,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
622 GtkCTreeFunc func,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
623 gpointer data);
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 (ctree, node, func, data, childfirstp, depth))
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 struct gcpro gcpro1, gcpro2, gcpro3;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
628 Lisp_Object closure = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
629
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
630 CHECK_GTK_OBJECT (ctree);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
631
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
632 if (!NILP (node))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
633 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
634 CHECK_GTK_BOXED (node);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
635 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
636
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
637 if (!NILP (depth))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
638 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
639 CHECK_INT (depth);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
640 }
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 closure = Fcons (func, data);
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 GCPRO3 (ctree, node, closure);
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 if (NILP (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 (NILP (childfirstp) ? gtk_ctree_post_recursive : gtk_ctree_pre_recursive)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
649 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
650 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
651 __emacs_gtk_ctree_recurse_internal,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
652 LISP_TO_VOID (closure));
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 else
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 (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
657 (GTK_CTREE (XGTK_OBJECT (ctree)->object),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
658 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
659 XINT (depth),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
660 __emacs_gtk_ctree_recurse_internal,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
661 LISP_TO_VOID (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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
664 UNGCPRO;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
665 return (Qnil);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
668 void syms_of_ui_byhand (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
669 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
670 DEFSUBR (Fgtk_toolbar_append_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
671 DEFSUBR (Fgtk_toolbar_insert_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
672 DEFSUBR (Fgtk_toolbar_prepend_item);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
673 DEFSUBR (Fgtk_box_query_child_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
674 DEFSUBR (Fgtk_button_box_get_child_size_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
675 DEFSUBR (Fgtk_button_box_get_child_ipadding_default);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
676 DEFSUBR (Fgtk_button_box_get_child_size);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
677 DEFSUBR (Fgtk_button_box_get_child_ipadding);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
678 DEFSUBR (Fgtk_calendar_get_date);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
679 DEFSUBR (Fgtk_clist_get_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
680 DEFSUBR (Fgtk_clist_get_selection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
681 DEFSUBR (Fgtk_clist_get_pixmap);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
682 DEFSUBR (Fgtk_clist_get_pixtext);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
683 DEFSUBR (Fgtk_color_selection_get_color);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
684 DEFSUBR (Fgtk_editable_insert_text);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
685 DEFSUBR (Fgtk_pixmap_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
686 DEFSUBR (Fgtk_curve_get_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
687 DEFSUBR (Fgtk_curve_set_vector);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
688 DEFSUBR (Fgtk_label_get);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
689 DEFSUBR (Fgtk_notebook_query_tab_label_packing);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
690 DEFSUBR (Fgtk_widget_get_pointer);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
691 DEFSUBR (Fgtk_ctree_recurse);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
692 }