comparison src/glyphs-widget.c @ 1318:b531bf8658e9

[xemacs-hg @ 2003-02-21 06:56:46 by ben] redisplay fixes et al. PROBLEMS: Add comment about Cygwin, unexec and sysmalloc. Move some non-general stuff out of general. Make a section for x86. configure.in: Add check for broken alloca in funcalls. mule/mule-cmds.el: Alias file-name to native not vice-versa. Do set EOL of native but not of process output to fix various problems and be consistent with code-init.el. code-cmds.el: Return a name not a coding system. code-init.el: Reindent. Remove `file-name' since it should always be the same as native. unicode.el: Rename to load-unicode-mapping-table as suggested by the anonymous (but rather Turnbullian) comment in unicode.c. xemacs.dsp: Add /k to default build. alloc.c: Make gc_currently_forbidden static. config.h.in, lisp.h: Move some stuff to lisp.h. console-gtk.h, console-impl.h, console-msw.h, console-x.h, event-Xt.c, event-msw.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-x.c, gtk-xemacs.c: Remove duplicated code to redraw exposed area. Add deadbox method needed by the generalized redraw code. Defer redrawing if already in redisplay. frame-msw.c, event-stream.c, frame.c: Add comments about calling Lisp. debug.c, general-slots.h: Move generalish symbols to general-slots.h. doprnt.c: reindent. lisp.h, dynarr.c: Add debug code for locking a dynarr to catch invalid mods. Use in redisplay.c. eval.c: file-coding.c: Define file-name as alias for native not vice-versa. frame-gtk.c, frame-x.c: Move Qwindow_id to general-slots. dialog-msw.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, gui.c, gui.h, menubar-msw.c, menubar.c: Ensure that various glyph functions that eval within redisplay protect the evals. Same for calls to internal_equal(). Modify various functions, e.g. gui_item_*(), to protect evals within redisplay, taking an in_redisplay parameter if it's possible for them to be called both inside and outside of redisplay. gutter.c: Defer specifier-changed updating till after redisplay, if necessary, since we need to enter redisplay to do it. gutter.c: Do nothing if in redisplay. lisp.h: Add version of alloca() for use in function calls. lisp.h: Add XCAD[D+]R up to 6 D's, and aliases X1ST, X2ND, etc. frame.c, frame.h, redisplay.c, redisplay.h, signal.c, toolbar.c: Redo critical-section code and move from frame.c to redisplay.c. Require that every place inside of redisplay catch errors itself, not at the edge of the critical section (thereby bypassing the rest of redisplay and leaving things in an inconsistent state). Introduce separate means of holding frame-size changes without entering a complete critical section. Introduce "post-redisplay" methods for deferring things till after redisplay. Abort if we enter redisplay reentrantly. Disable all quit checking in redisplay since it's too dangerous. Ensure that all calls to QUIT trigger an abort if unprotected. redisplay.c, scrollbar-gtk.c, scrollbar-x.c, scrollbar.c: Create enter/exit_redisplay_critical_section_maybe() for code that needs to ensure it's in a critical section but doesn't interfere with an existing critical section. sysdep.c: Use _wexecve() when under Windows NT for Unicode correctness. text.c, text.h: Add new_dfc() functions, which return an alloca()ed value rather than requiring an lvalue. (Not really used yet; used in another workspace, to come.) Add some macros for SIZED_EXTERNAL. Update the encoding aliases after involved scrutinization of the X manual. unicode.c: Answer the anonymous but suspiciously Turnbullian questions. Rename parse-unicode-translation-table to load-unicode-mapping-table, as suggested.
author ben
date Fri, 21 Feb 2003 06:57:21 +0000
parents 9d75b4fe084c
children 7473844a83d3
comparison
equal deleted inserted replaced
1317:d9d08dc5e617 1318:b531bf8658e9
1 /* Widget-specific glyph objects. 1 /* Widget-specific glyph objects.
2 Copyright (C) 1998, 1999, 2000, 2002 Andy Piper. 2 Copyright (C) 1998, 1999, 2000, 2002 Andy Piper.
3 Copyright (C) 2003 Ben Wing.
3 4
4 This file is part of XEmacs. 5 This file is part of XEmacs.
5 6
6 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
668 same reasons we normalize file to data. 669 same reasons we normalize file to data.
669 670
670 #### should just normalize the data. */ 671 #### should just normalize the data. */
671 if (!NILP (glyph)) 672 if (!NILP (glyph))
672 { 673 {
673 substitute_keyword_value (inst, Q_image, glyph_instantiator_to_glyph (glyph)); 674 substitute_keyword_value (inst, Q_image,
675 glyph_instantiator_to_glyph (glyph));
674 } 676 }
675 677
676 return inst; 678 return inst;
677 } 679 }
678 680
987 if (width) *width = tw; 989 if (width) *width = tw;
988 } 990 }
989 } 991 }
990 992
991 /* Determine whether only the order has changed for a tab. */ 993 /* Determine whether only the order has changed for a tab. */
992 int tab_control_order_only_changed (Lisp_Object image_instance) 994 int
993 { 995 tab_control_order_only_changed (Lisp_Object image_instance)
996 {
997 /* Called within redisplay */
994 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 998 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
995 int found = 0, len, pending_len; 999 int found = 0, len, pending_len;
996 Lisp_Object rest; 1000 Lisp_Object rest;
997 1001
998 /* Degenerate case. */ 1002 /* Degenerate case. */
1011 found = 0; 1015 found = 0;
1012 LIST_LOOP (pending_rest, 1016 LIST_LOOP (pending_rest,
1013 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) 1017 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
1014 { 1018 {
1015 if (gui_item_equal_sans_selected (XCAR (rest), 1019 if (gui_item_equal_sans_selected (XCAR (rest),
1016 XCAR (pending_rest), 0)) 1020 XCAR (pending_rest), 0, 1))
1017 { 1021 {
1018 found = 1; 1022 found = 1;
1019 break; 1023 break;
1020 } 1024 }
1021 } 1025 }
1360 } 1364 }
1361 } 1365 }
1362 1366
1363 /* Work out minimum space we need to fit all the items. This could 1367 /* Work out minimum space we need to fit all the items. This could
1364 have been fixed by the user. */ 1368 have been fixed by the user. */
1365 if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) { 1369 if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
1370 {
1366 if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) 1371 if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
1367 { 1372 {
1368 Lisp_Object dynamic_width = 1373 Lisp_Object dynamic_width =
1369 Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); 1374 eval_within_redisplay (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii));
1370 if (INTP (dynamic_width)) 1375 if (INTP (dynamic_width))
1371 *width = XINT (dynamic_width); 1376 *width = XINT (dynamic_width);
1372 } 1377 }
1373 else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) 1378 else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL)
1374 { 1379 {
1375 *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) + 1380 *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) +
1376 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2; 1381 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2;
1377 } 1382 }
1378 else 1383 else
1379 { 1384 {
1380 *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 + 1385 *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 +
1381 IMAGE_INSTANCE_MARGIN_WIDTH (ii)); 1386 IMAGE_INSTANCE_MARGIN_WIDTH (ii));
1382 } 1387 }
1383 } 1388 }
1384 1389
1385 /* Work out vertical spacings. */ 1390 /* Work out vertical spacings. */
1386 if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) { 1391 if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
1392 {
1387 if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) 1393 if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
1388 { 1394 {
1389 Lisp_Object dynamic_height = 1395 Lisp_Object dynamic_height =
1390 Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); 1396 eval_within_redisplay (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii));
1391 if (INTP (dynamic_height)) 1397 if (INTP (dynamic_height))
1392 *height = XINT (dynamic_height); 1398 *height = XINT (dynamic_height);
1393 } 1399 }
1394 else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii)) 1400 else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii))
1395 { 1401 {
1396 *height = nitems * luh + ph_adjust; 1402 *height = nitems * luh + ph_adjust;
1397 } 1403 }
1398 else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL) 1404 else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL)
1399 { 1405 {
1400 *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) + 1406 *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) +
1401 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; 1407 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
1402 } 1408 }
1403 else 1409 else
1404 { 1410 {
1405 *height = maxph + (2 * widget_instance_border_width (ii) + 1411 *height = maxph + (2 * widget_instance_border_width (ii) +
1406 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; 1412 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
1407 } 1413 }
1408 } 1414 }
1409 #ifdef DEBUG_WIDGET_OUTPUT 1415 #ifdef DEBUG_WIDGET_OUTPUT
1410 stderr_out ("layout wants %dx%d\n", *width, *height); 1416 stderr_out ("layout wants %dx%d\n", *width, *height);
1411 #endif 1417 #endif
1412 } 1418 }