comparison src/ui-byhand.c @ 563:183866b06e0b

[xemacs-hg @ 2001-05-24 07:50:48 by ben] Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c: -- defsymbol -> DEFSYMBOL. -- add an error type to all errors. -- eliminate the error functions in eval.c that let you just use Qerror as the type. -- redo the error API to be more consistent, sensibly named, and easier to use. -- redo the error hierarchy somewhat. create new errors: structure-formation-error, gui-error, invalid-constant, stack-overflow, out-of-memory, process-error, network-error, sound-error, printing-unreadable-object, base64-conversion- error; coding-system-error renamed to text-conversion error; some others. -- fix Mule problems in error strings in emodules.c, tooltalk.c. -- fix error handling in mswin open-network-stream. -- Mule-ize all sound files and clean up the headers. -- nativesound.h -> sound.h and used for all sound files. -- move some shared stuff into glyphs-shared.c: first attempt at eliminating some of the massive GTK code duplication. xemacs.mak: add glyphs-shared.c. xemacs-faq.texi: document how to debug X errors subr.el: fix doc string to reflect reality
author ben
date Thu, 24 May 2001 07:51:33 +0000
parents 0784d089fdc9
children 6728e641994e
comparison
equal deleted inserted replaced
562:c775bd016b32 563:183866b06e0b
25 CHECK_GTK_OBJECT (box); 25 CHECK_GTK_OBJECT (box);
26 CHECK_GTK_OBJECT (child); 26 CHECK_GTK_OBJECT (child);
27 27
28 if (!GTK_IS_BOX (XGTK_OBJECT (box)->object)) 28 if (!GTK_IS_BOX (XGTK_OBJECT (box)->object))
29 { 29 {
30 signal_simple_error ("Object is not a GtkBox", box); 30 wtaerror ("Object is not a GtkBox", box);
31 } 31 }
32 32
33 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object)) 33 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
34 { 34 {
35 signal_simple_error ("Child is not a GtkWidget", child); 35 wtaerror ("Child is not a GtkWidget", child);
36 } 36 }
37 37
38 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object), 38 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object),
39 GTK_WIDGET (XGTK_OBJECT (child)->object), 39 GTK_WIDGET (XGTK_OBJECT (child)->object),
40 &expand, &fill, &padding, &pack_type); 40 &expand, &fill, &padding, &pack_type);
86 86
87 CHECK_GTK_OBJECT (box); 87 CHECK_GTK_OBJECT (box);
88 88
89 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object)) 89 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
90 { 90 {
91 signal_simple_error ("Not a GtkBox object", box); 91 wtaerror ("Not a GtkBox object", box);
92 } 92 }
93 93
94 gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), 94 gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
95 &width, &height); 95 &width, &height);
96 96
108 108
109 CHECK_GTK_OBJECT (box); 109 CHECK_GTK_OBJECT (box);
110 110
111 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object)) 111 if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
112 { 112 {
113 signal_simple_error ("Not a GtkBox object", box); 113 wtaerror ("Not a GtkBox object", box);
114 } 114 }
115 115
116 gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), 116 gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
117 &x, &y); 117 &x, &y);
118 118
133 133
134 CHECK_GTK_OBJECT (calendar); 134 CHECK_GTK_OBJECT (calendar);
135 135
136 if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object)) 136 if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object))
137 { 137 {
138 signal_simple_error ("Not a GtkCalendar object", calendar); 138 wtaerror ("Not a GtkCalendar object", calendar);
139 } 139 }
140 140
141 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object), 141 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object),
142 &year, &month, &day); 142 &year, &month, &day);
143 143
161 CHECK_INT (row); 161 CHECK_INT (row);
162 CHECK_INT (column); 162 CHECK_INT (column);
163 163
164 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) 164 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
165 { 165 {
166 signal_simple_error ("Object is not a GtkCList", obj); 166 wtaerror ("Object is not a GtkCList", obj);
167 } 167 }
168 168
169 gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XINT (row), XINT (column), &text); 169 gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XINT (row), XINT (column), &text);
170 170
171 if (text) 171 if (text)
196 CHECK_INT (x); 196 CHECK_INT (x);
197 CHECK_INT (y); 197 CHECK_INT (y);
198 198
199 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) 199 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
200 { 200 {
201 signal_simple_error ("Object is not a GtkCList", obj); 201 wtaerror ("Object is not a GtkCList", obj);
202 } 202 }
203 203
204 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object), 204 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object),
205 XINT (x), XINT (y), &row, &column); 205 XINT (x), XINT (y), &row, &column);
206 206
219 CHECK_INT (row); 219 CHECK_INT (row);
220 CHECK_INT (column); 220 CHECK_INT (column);
221 221
222 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) 222 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
223 { 223 {
224 signal_simple_error ("Object is not a GtkCList", clist); 224 wtaerror ("Object is not a GtkCList", clist);
225 } 225 }
226 226
227 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object), 227 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object),
228 XINT (row), XINT (column), 228 XINT (row), XINT (column),
229 &pixmap, &mask); 229 &pixmap, &mask);
246 CHECK_INT (row); 246 CHECK_INT (row);
247 CHECK_INT (column); 247 CHECK_INT (column);
248 248
249 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) 249 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
250 { 250 {
251 signal_simple_error ("Object is not a GtkCList", clist); 251 wtaerror ("Object is not a GtkCList", clist);
252 } 252 }
253 253
254 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object), 254 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object),
255 XINT (row), XINT (column), &text, &spacing, 255 XINT (row), XINT (column), &text, &spacing,
256 &pixmap, &mask); 256 &pixmap, &mask);
270 270
271 CHECK_GTK_OBJECT (object); 271 CHECK_GTK_OBJECT (object);
272 272
273 if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object)) 273 if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object))
274 { 274 {
275 signal_simple_error ("Object is not a GtkColorSelection", object); 275 wtaerror ("Object is not a GtkColorSelection", object);
276 } 276 }
277 277
278 gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba); 278 gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba);
279 279
280 return (list4 (make_float (rgba[0]), 280 return (list4 (make_float (rgba[0]),
298 298
299 the_pos = XINT (pos); 299 the_pos = XINT (pos);
300 300
301 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object)) 301 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object))
302 { 302 {
303 signal_simple_error ("Object is not a GtkEditable", obj); 303 wtaerror ("Object is not a GtkEditable", obj);
304 } 304 }
305 305
306 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object), 306 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object),
307 (char *) XSTRING_DATA (string), 307 (char *) XSTRING_DATA (string),
308 XSTRING_LENGTH (string), 308 XSTRING_LENGTH (string),
320 320
321 CHECK_GTK_OBJECT (object); 321 CHECK_GTK_OBJECT (object);
322 322
323 if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object)) 323 if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object))
324 { 324 {
325 signal_simple_error ("Object is not a GtkPixmap", object); 325 wtaerror ("Object is not a GtkPixmap", object);
326 } 326 }
327 327
328 gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask); 328 gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask);
329 329
330 return (Fcons (pixmap ? build_gtk_object (GTK_OBJECT (pixmap)) : Qnil, 330 return (Fcons (pixmap ? build_gtk_object (GTK_OBJECT (pixmap)) : Qnil,
343 CHECK_GTK_OBJECT (curve); 343 CHECK_GTK_OBJECT (curve);
344 CHECK_INT (length); 344 CHECK_INT (length);
345 345
346 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object)) 346 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
347 { 347 {
348 signal_simple_error ("Object is not a GtkCurve", curve); 348 wtaerror ("Object is not a GtkCurve", curve);
349 } 349 }
350 350
351 vector = (gfloat *) alloca (sizeof (gfloat) * XINT (length)); 351 vector = (gfloat *) alloca (sizeof (gfloat) * XINT (length));
352 352
353 gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XINT (length), vector); 353 gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XINT (length), vector);
375 375
376 vec_length = XVECTOR_LENGTH (vector); 376 vec_length = XVECTOR_LENGTH (vector);
377 377
378 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object)) 378 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
379 { 379 {
380 signal_simple_error ("Object is not a GtkCurve", curve); 380 wtaerror ("Object is not a GtkCurve", curve);
381 } 381 }
382 382
383 c_vector = (gfloat *) alloca (sizeof (gfloat) * vec_length); 383 c_vector = (gfloat *) alloca (sizeof (gfloat) * vec_length);
384 384
385 for (i = 0; i < vec_length; i++) 385 for (i = 0; i < vec_length; i++)
401 401
402 CHECK_GTK_OBJECT (label); 402 CHECK_GTK_OBJECT (label);
403 403
404 if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object)) 404 if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object))
405 { 405 {
406 signal_simple_error ("Object is not a GtkLabel", label); 406 wtaerror ("Object is not a GtkLabel", label);
407 } 407 }
408 408
409 gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string); 409 gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
410 410
411 return (build_string (string)); 411 return (build_string (string));
422 CHECK_GTK_OBJECT (notebook); 422 CHECK_GTK_OBJECT (notebook);
423 CHECK_GTK_OBJECT (child); 423 CHECK_GTK_OBJECT (child);
424 424
425 if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (notebook)->object)) 425 if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (notebook)->object))
426 { 426 {
427 signal_simple_error ("Object is not a GtkLabel", notebook); 427 wtaerror ("Object is not a GtkLabel", notebook);
428 } 428 }
429 429
430 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object)) 430 if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
431 { 431 {
432 signal_simple_error ("Object is not a GtkWidget", child); 432 wtaerror ("Object is not a GtkWidget", child);
433 } 433 }
434 434
435 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object), 435 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object),
436 GTK_WIDGET (XGTK_OBJECT (child)->object), 436 GTK_WIDGET (XGTK_OBJECT (child)->object),
437 &expand, &fill, &pack_type); 437 &expand, &fill, &pack_type);
447 gint x,y; 447 gint x,y;
448 CHECK_GTK_OBJECT (widget); 448 CHECK_GTK_OBJECT (widget);
449 449
450 if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object)) 450 if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object))
451 { 451 {
452 signal_simple_error ("Object is not a GtkWidget", widget); 452 wtaerror ("Object is not a GtkWidget", widget);
453 } 453 }
454 454
455 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y); 455 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y);
456 456
457 return (Fcons (make_int (x), make_int (y))); 457 return (Fcons (make_int (x), make_int (y)));
501 CHECK_STRING (tooltip_text); 501 CHECK_STRING (tooltip_text);
502 CHECK_STRING (tooltip_private_text); 502 CHECK_STRING (tooltip_private_text);
503 503
504 if (!SYMBOLP (callback) && !LISTP (callback)) 504 if (!SYMBOLP (callback) && !LISTP (callback))
505 { 505 {
506 signal_simple_error ("Callback must be symbol or eval-able form", callback); 506 wtaerror ("Callback must be symbol or eval-able form", callback);
507 } 507 }
508 508
509 if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object)) 509 if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object))
510 { 510 {
511 signal_simple_error ("Object is not a GtkToolbar", toolbar); 511 wtaerror ("Object is not a GtkToolbar", toolbar);
512 } 512 }
513 513
514 if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object)) 514 if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object))
515 { 515 {
516 signal_simple_error ("Object is not a GtkWidget", icon); 516 wtaerror ("Object is not a GtkWidget", icon);
517 } 517 }
518 518
519 callback = Fcons (data, callback); 519 callback = Fcons (data, callback);
520 520
521 id = new_gui_id (); 521 id = new_gui_id ();