Mercurial > hg > xemacs-beta
comparison src/glyphs-msw.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 | e22b0213b713 |
children | a8d8f419b459 |
comparison
equal
deleted
inserted
replaced
1317:d9d08dc5e617 | 1318:b531bf8658e9 |
---|---|
1 /* mswindows-specific glyph objects. | 1 /* mswindows-specific glyph objects. |
2 Copyright (C) 1998, 1999, 2000 Andy Piper. | 2 Copyright (C) 1998, 1999, 2000 Andy Piper. |
3 Copyright (C) 2001, 2002 Ben Wing. | 3 Copyright (C) 2001, 2002, 2003 Ben Wing. |
4 | 4 |
5 This file is part of XEmacs. | 5 This file is part of XEmacs. |
6 | 6 |
7 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 |
8 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 |
2037 GWL_STYLE); | 2037 GWL_STYLE); |
2038 | 2038 |
2039 if (CONSP (item)) | 2039 if (CONSP (item)) |
2040 item = XCAR (item); | 2040 item = XCAR (item); |
2041 | 2041 |
2042 if (gui_item_active_p (item)) | 2042 if (gui_item_active_p (item, 1)) |
2043 qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), | 2043 qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), |
2044 GWL_STYLE, style & ~WS_DISABLED); | 2044 GWL_STYLE, style & ~WS_DISABLED); |
2045 else | 2045 else |
2046 qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), | 2046 qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), |
2047 GWL_STYLE, style | WS_DISABLED); | 2047 GWL_STYLE, style | WS_DISABLED); |
2228 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); | 2228 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); |
2229 Lisp_Gui_Item *pgui = XGUI_ITEM (gui); | 2229 Lisp_Gui_Item *pgui = XGUI_ITEM (gui); |
2230 | 2230 |
2231 CHECK_MSWINDOWS_DEVICE (device); | 2231 CHECK_MSWINDOWS_DEVICE (device); |
2232 | 2232 |
2233 if (!gui_item_active_p (gui)) | 2233 if (!gui_item_active_p (gui, 0)) |
2234 flags |= WS_DISABLED; | 2234 flags |= WS_DISABLED; |
2235 | 2235 |
2236 style = pgui->style; | 2236 style = pgui->style; |
2237 | 2237 |
2238 if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) | 2238 if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) |
2373 pointer_bg, dest_mask, domain, | 2373 pointer_bg, dest_mask, domain, |
2374 "BUTTON", flags, 0); | 2374 "BUTTON", flags, 0); |
2375 | 2375 |
2376 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); | 2376 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); |
2377 /* set the checked state */ | 2377 /* set the checked state */ |
2378 if (gui_item_selected_p (gui)) | 2378 if (gui_item_selected_p (gui, 0)) |
2379 qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); | 2379 qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); |
2380 else | 2380 else |
2381 qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); | 2381 qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); |
2382 /* add the image if one was given */ | 2382 /* add the image if one was given */ |
2383 if (!NILP (glyph) && IMAGE_INSTANCEP (glyph) | 2383 if (!NILP (glyph) && IMAGE_INSTANCEP (glyph) |
2399 { | 2399 { |
2400 /* This function can GC if IN_REDISPLAY is false. */ | 2400 /* This function can GC if IN_REDISPLAY is false. */ |
2401 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2401 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2402 | 2402 |
2403 /* buttons checked or otherwise */ | 2403 /* buttons checked or otherwise */ |
2404 if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii))) | 2404 if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii), 1)) |
2405 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | 2405 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), |
2406 BM_SETCHECK, (WPARAM)BST_CHECKED, 0); | 2406 BM_SETCHECK, (WPARAM)BST_CHECKED, 0); |
2407 else | 2407 else |
2408 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | 2408 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), |
2409 BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); | 2409 BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); |
2641 /* add items to the tab */ | 2641 /* add items to the tab */ |
2642 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) | 2642 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) |
2643 { | 2643 { |
2644 int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i); | 2644 int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i); |
2645 assert (idx == i); | 2645 assert (idx == i); |
2646 if (gui_item_selected_p (XCAR (rest))) | 2646 if (gui_item_selected_p (XCAR (rest), 0)) |
2647 selected = i; | 2647 selected = i; |
2648 i++; | 2648 i++; |
2649 } | 2649 } |
2650 qxeSendMessage (wnd, TCM_SETCURSEL, selected, 0); | 2650 qxeSendMessage (wnd, TCM_SETCURSEL, selected, 0); |
2651 } | 2651 } |
2655 mswindows_tab_control_redisplay (Lisp_Object image_instance) | 2655 mswindows_tab_control_redisplay (Lisp_Object image_instance) |
2656 { | 2656 { |
2657 /* This function can GC if IN_REDISPLAY is false. */ | 2657 /* This function can GC if IN_REDISPLAY is false. */ |
2658 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2658 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2659 #ifdef DEBUG_WIDGET_OUTPUT | 2659 #ifdef DEBUG_WIDGET_OUTPUT |
2660 stderr_out ("tab control %p redisplayed\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); | 2660 stderr_out ("tab control %p redisplayed\n", |
2661 IMAGE_INSTANCE_SUBWINDOW_ID (ii)); | |
2661 #endif | 2662 #endif |
2662 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) | 2663 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) |
2663 || | 2664 || |
2664 IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) | 2665 IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) |
2665 { | 2666 { |
2680 XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) : | 2681 XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) : |
2681 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); | 2682 XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); |
2682 | 2683 |
2683 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) | 2684 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) |
2684 { | 2685 { |
2685 if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) | 2686 if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1)) |
2686 { | 2687 { |
2687 Lisp_Object old_selected = gui_item_list_find_selected | 2688 Lisp_Object old_selected = |
2689 gui_item_list_find_selected | |
2688 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); | 2690 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); |
2689 | 2691 |
2690 /* Pick up the new selected item. */ | 2692 /* Pick up the new selected item. */ |
2691 XGUI_ITEM (old_selected)->selected = | 2693 XGUI_ITEM (old_selected)->selected = |
2692 XGUI_ITEM (XCAR (rest))->selected; | 2694 XGUI_ITEM (XCAR (rest))->selected; |
2697 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; | 2699 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; |
2698 | 2700 |
2699 qxeSendMessage (wnd, TCM_SETCURSEL, i, 0); | 2701 qxeSendMessage (wnd, TCM_SETCURSEL, i, 0); |
2700 #ifdef DEBUG_WIDGET_OUTPUT | 2702 #ifdef DEBUG_WIDGET_OUTPUT |
2701 stderr_out ("tab control %p selected item %d\n", | 2703 stderr_out ("tab control %p selected item %d\n", |
2702 IMAGE_INSTANCE_SUBWINDOW_ID (ii), i); | 2704 IMAGE_INSTANCE_SUBWINDOW_ID (ii), i); |
2703 #endif | 2705 #endif |
2704 break; | 2706 break; |
2705 } | 2707 } |
2706 i++; | 2708 i++; |
2707 } | 2709 } |
2714 /* add items to the tab */ | 2716 /* add items to the tab */ |
2715 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) | 2717 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) |
2716 { | 2718 { |
2717 add_tab_item (image_instance, wnd, XCAR (rest), | 2719 add_tab_item (image_instance, wnd, XCAR (rest), |
2718 IMAGE_INSTANCE_FRAME (ii), i); | 2720 IMAGE_INSTANCE_FRAME (ii), i); |
2719 if (gui_item_selected_p (XCAR (rest))) | 2721 if (gui_item_selected_p (XCAR (rest), 1)) |
2720 selected_idx = i; | 2722 selected_idx = i; |
2721 i++; | 2723 i++; |
2722 } | 2724 } |
2723 qxeSendMessage (wnd, TCM_SETCURSEL, selected_idx, 0); | 2725 qxeSendMessage (wnd, TCM_SETCURSEL, selected_idx, 0); |
2724 } | 2726 } |