comparison src/glyphs-x.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 70921960b980
children 01c57eb70ae9
comparison
equal deleted inserted replaced
1317:d9d08dc5e617 1318:b531bf8658e9
1 /* X-specific Lisp objects. 1 /* X-specific Lisp objects.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
3 Copyright (C) 1995 Board of Trustees, University of Illinois. 3 Copyright (C) 1995 Board of Trustees, University of Illinois.
4 Copyright (C) 1995 Tinker Systems 4 Copyright (C) 1995 Tinker Systems
5 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing 5 Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing
6 Copyright (C) 1995 Sun Microsystems 6 Copyright (C) 1995 Sun Microsystems
7 Copyright (C) 1999, 2000, 2002 Andy Piper 7 Copyright (C) 1999, 2000, 2002 Andy Piper
8 8
9 This file is part of XEmacs. 9 This file is part of XEmacs.
10 10
2464 lw_add_widget_value_arg (wv, XtNheight, 2464 lw_add_widget_value_arg (wv, XtNheight,
2465 (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); 2465 (Dimension)IMAGE_INSTANCE_HEIGHT (ii));
2466 /* update the font. */ 2466 /* update the font. */
2467 update_widget_face (wv, ii, domain); 2467 update_widget_face (wv, ii, domain);
2468 2468
2469 wid = lw_create_widget (type, wv->name, id, wv, IMAGE_INSTANCE_X_CLIPWIDGET (ii), 2469 wid = lw_create_widget (type, wv->name, id, wv,
2470 IMAGE_INSTANCE_X_CLIPWIDGET (ii),
2470 False, 0, popup_selection_callback, 0); 2471 False, 0, popup_selection_callback, 0);
2471 2472
2472 IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)wid; 2473 IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)wid;
2473 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id; 2474 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id;
2474 /* because the EmacsManager is the widgets parent we have to 2475 /* because the EmacsManager is the widgets parent we have to
2543 { 2544 {
2544 Arg al [2]; 2545 Arg al [2];
2545 int ac =0; 2546 int ac =0;
2546 #ifdef LWLIB_WIDGETS_MOTIF 2547 #ifdef LWLIB_WIDGETS_MOTIF
2547 XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++; 2548 XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++;
2548 XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));ac++; 2549 XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
2550 ac++;
2549 #else 2551 #else
2550 XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; 2552 XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
2551 #endif 2553 #endif
2552 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac); 2554 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
2553 } 2555 }
2595 return Qunbound; 2597 return Qunbound;
2596 } 2598 }
2597 2599
2598 /* instantiate a progress gauge */ 2600 /* instantiate a progress gauge */
2599 static void 2601 static void
2600 x_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2602 x_progress_gauge_instantiate (Lisp_Object image_instance,
2601 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2603 Lisp_Object instantiator,
2602 int dest_mask, Lisp_Object domain) 2604 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
2605 int dest_mask, Lisp_Object domain)
2603 { 2606 {
2604 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2607 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2605 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); 2608 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
2606 widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0); 2609 widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0);
2607 2610
2660 pointer_bg, dest_mask, domain, "combo-box", wv); 2663 pointer_bg, dest_mask, domain, "combo-box", wv);
2661 } 2664 }
2662 #endif 2665 #endif
2663 2666
2664 static void 2667 static void
2665 x_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2668 x_tab_control_instantiate (Lisp_Object image_instance,
2669 Lisp_Object instantiator,
2666 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2670 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
2667 int dest_mask, Lisp_Object domain) 2671 int dest_mask, Lisp_Object domain)
2668 { 2672 {
2669 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2673 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2670 widget_value * wv = 2674 widget_value * wv =
2680 static void 2684 static void
2681 x_tab_control_redisplay (Lisp_Object image_instance) 2685 x_tab_control_redisplay (Lisp_Object image_instance)
2682 { 2686 {
2683 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2687 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2684 2688
2685 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) 2689 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) ||
2686 ||
2687 IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) 2690 IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii))
2688 { 2691 {
2689 /* If only the order has changed then simply select the first 2692 /* If only the order has changed then simply select the first
2690 one of the pending set. This stops horrendous rebuilding - 2693 one of the pending set. This stops horrendous rebuilding -
2691 and hence flicker - of the tabs each time you click on 2694 and hence flicker - of the tabs each time you click on
2698 XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) : 2701 XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) :
2699 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); 2702 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
2700 2703
2701 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) 2704 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
2702 { 2705 {
2703 if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) 2706 if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1))
2704 { 2707 {
2705 /* There may be an encapsulated way of doing this, 2708 /* There may be an encapsulated way of doing this,
2706 but I couldn't find it. */ 2709 but I couldn't find it. */
2707 Lisp_Object old_selected =gui_item_list_find_selected 2710 Lisp_Object old_selected =
2711 gui_item_list_find_selected
2708 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); 2712 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
2709 Arg al [1]; 2713 Arg al [1];
2710 char* name; 2714 char* name;
2711 unsigned int num_children, i; 2715 unsigned int num_children, i;
2712 Widget* children; 2716 Widget* children;
2713 2717
2714 LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name, 2718 LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name,
2715 name, Qnative); 2719 name, Qnative);
2716 /* The name may contain a `.' which confuses 2720 /* The name may contain a `.' which confuses
2717 XtNameToWidget, so we do it ourselves. */ 2721 XtNameToWidget, so we do it ourselves. */
2718 children = XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii), 2722 children =
2719 &num_children); 2723 XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii),
2724 &num_children);
2720 for (i = 0; i < num_children; i++) 2725 for (i = 0; i < num_children; i++)
2721 { 2726 {
2722 if (!strcmp (XtName (children [i]), name)) 2727 if (!strcmp (XtName (children [i]), name))
2723 { 2728 {
2724 XtSetArg (al [0], XtNtopWidget, children [i]); 2729 XtSetArg (al [0], XtNtopWidget, children [i]);