1] make-image-instance should be working.
2] less glyph/gutter flashing under mswin.
3] conversion routines [TO_INTERNAL_FORMAT et al] are now reentrant.
2000-05-16 Ben Wing <ben(a)xemacs.org>
* buffer.c:
* buffer.c (dfc_convert_to/from_internal_format):
* buffer.c (reinit_vars_of_buffer):
Fix conversion functions to allow reentrancy.
* console-msw.c:
* console-msw.c (mswindows_output_last_error):
New fun, generally useful -- output a human-readable
version of GetLastError() on the console.
* console-msw.h:
* console-msw.h (struct mswindows_frame):
Changes for DeferWindowPos. Declare mswindows_output_last_error().
* console-stream.c (stream_output_begin):
* console-stream.c (stream_output_end):
* console-stream.c (stream_output_vertical_divider):
* console-stream.c (stream_clear_region):
* console-stream.c (stream_flash):
* console-stream.c (console_type_create_stream):
Delete blank stream methods, not needed.
* console.h (struct console_methods):
Split begin/end methods into window and frame.
* event-msw.c:
* event-msw.c (mswindows_handle_paint):
* event-msw.c (output_alt_keyboard_state):
* event-msw.c (mswindows_wnd_proc):
* event-msw.c (vars_of_event_mswindows):
Comment about problems with ignored-expose.
Define mswindows-debug-events; not really implemented.
* frame-msw.c (mswindows_init_frame_1):
random cleanups.
* glyphs-msw.c:
* glyphs-msw.c (begin_defer_window_pos):
* glyphs-msw.c (mswindows_unmap_subwindow):
* glyphs-msw.c (mswindows_map_subwindow):
* glyphs-msw.c (mswindows_resize_subwindow):
Use DeferWindowPos to reduce flashing when mapping/unmapping.
* glyphs.c (make_image_instance_1):
Fix crash.
* gutter.c (Fredisplay_gutter_area):
Use new begin/end methods.
* lisp.h (Dynarr_new2):
New creation fun.
* redisplay-msw.c:
* redisplay-msw.c (mswindows_frame_output_begin):
* redisplay-msw.c (mswindows_frame_output_end):
* redisplay-msw.c (console_type_create_redisplay_mswindows):
New begin/end methods -- handle DeferWindowPos.
* redisplay-output.c (redisplay_move_cursor):
* redisplay-output.c (redraw_cursor_in_window):
* redisplay-output.c (redisplay_update_line):
* redisplay-output.c (redisplay_output_window):
New begin/end methods.
* redisplay-tty.c:
* redisplay-tty.c (tty_frame_output_begin):
* redisplay-tty.c (tty_frame_output_end):
* redisplay-tty.c (console_type_create_redisplay_tty):
New begin/end methods.
* redisplay-x.c:
* redisplay-x.c (x_window_output_begin):
* redisplay-x.c (x_window_output_end):
* redisplay-x.c (console_type_create_redisplay_x):
New begin/end methods.
* redisplay.c (redisplay_frame):
* redisplay.c (Fredisplay_echo_area):
New begin/end methods.
use MAYBE_DEVMETH for clear_frame; it may not exist.
* window.h (WINDOW_XFRAME):
WINDOW_XFOO macros -- get locale and decode struct pointer.
? fixup-427-5.diff
? lib-src/etags.pdb
? lib-src/hexl.pdb
? lib-src/i.pdb
? lib-src/make-docfile.pdb
? lib-src/mmencode.pdb
? lib-src/movemail.pdb
? lib-src/run.res
? lib-src/sorted-doc.pdb
? lib-src/vc50.pdb
? lib-src/wakeup.pdb
? lisp/process2.el
? nt/obj
? src/glyphs-msw.c.2
? src/NEEDTODUMP
? src/runxemacs.pdb
? src/temacs.bsc
? src/temacs.map
? src/temacs.opt
? src/temacs.pdb
? src/xemacs.opt
? src/Xpm.dll
cvs server: Diffing .
cvs server: Diffing dynodump
cvs server: Diffing dynodump/i386
cvs server: Diffing dynodump/ppc
cvs server: Diffing dynodump/sparc
cvs server: Diffing etc
cvs server: Diffing etc/custom
cvs server: Diffing etc/custom/example-themes
cvs server: Diffing etc/eos
cvs server: Diffing etc/idd
cvs server: Diffing etc/photos
cvs server: Diffing etc/sparcworks
cvs server: Diffing etc/tests
cvs server: Diffing etc/tests/external-widget
cvs server: Diffing etc/toolbar
cvs server: Diffing info
cvs server: Diffing lib-src
cvs server: Diffing lisp
cvs server: Diffing lisp/mule
cvs server: Diffing lisp/term
cvs server: Diffing lock
cvs server: Diffing lwlib
cvs server: Diffing man
cvs server: Diffing man/internals
cvs server: Diffing man/lispref
cvs server: Diffing man/new-users-guide
cvs server: Diffing man/xemacs
cvs server: Diffing modules
cvs server: Diffing modules/base64
cvs server: Diffing modules/ldap
cvs server: Diffing modules/sample
cvs server: Diffing modules/zlib
cvs server: Diffing nt
cvs server: Diffing nt/inc
cvs server: Diffing nt/inc/arpa
cvs server: Diffing nt/inc/netinet
cvs server: Diffing nt/inc/sys
cvs server: Diffing nt/installer
cvs server: Diffing nt/installer/Wise
cvs server: Diffing src
Index: src/buffer.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.36.2.30
diff -u -r1.36.2.30 buffer.c
--- buffer.c 2000/05/09 11:54:54 1.36.2.30
+++ buffer.c 2000/05/16 08:43:54
@@ -1830,8 +1830,18 @@
#define coding_system_is_binary(coding_system) 1
#endif
-static Extbyte_dynarr *conversion_out_dynarr;
-static Bufbyte_dynarr *conversion_in_dynarr;
+typedef struct
+{
+ Dynarr_declare (Bufbyte_dynarr *);
+} Bufbyte_dynarr_dynarr;
+
+typedef struct
+{
+ Dynarr_declare (Extbyte_dynarr *);
+} Extbyte_dynarr_dynarr;
+
+static Extbyte_dynarr_dynarr *conversion_out_dynarr_list;
+static Bufbyte_dynarr_dynarr *conversion_in_dynarr_list;
static int dfc_convert_to_external_format_in_use;
static int dfc_convert_to_internal_format_in_use;
@@ -1860,6 +1870,7 @@
dfc_conversion_data *sink)
{
int count = specpdl_depth ();
+ Extbyte_dynarr *conversion_out_dynarr;
type_checking_assert
(((source_type == DFC_TYPE_DATA) ||
@@ -1869,20 +1880,20 @@
((sink_type == DFC_TYPE_DATA) ||
(sink_type == DFC_TYPE_LISP_LSTREAM && LSTREAMP
(source->lisp_object))));
- if (dfc_convert_to_external_format_in_use != 0)
- error ("Can't call a conversion function from a conversion function");
- else
- dfc_convert_to_external_format_in_use = 1;
-
record_unwind_protect (dfc_convert_to_external_format_reset_in_use,
- Qzero);
+ make_int (dfc_convert_to_external_format_in_use));
+ if (Dynarr_length (conversion_out_dynarr_list) <=
+ dfc_convert_to_external_format_in_use)
+ Dynarr_add (conversion_out_dynarr_list, Dynarr_new (Extbyte));
+ conversion_out_dynarr = Dynarr_at (conversion_out_dynarr_list,
+ dfc_convert_to_external_format_in_use);
+ dfc_convert_to_external_format_in_use++;
+ Dynarr_reset (conversion_out_dynarr);
#ifdef FILE_CODING
coding_system = Fget_coding_system (coding_system);
#endif
- Dynarr_reset (conversion_out_dynarr);
-
/* Here we optimize in the case where the coding system does no
conversion. However, we don't want to optimize in case the source
or sink is an lstream, since writing to an lstream can cause a
@@ -2015,6 +2026,7 @@
dfc_conversion_data *sink)
{
int count = specpdl_depth ();
+ Bufbyte_dynarr *conversion_in_dynarr;
type_checking_assert
((source_type == DFC_TYPE_DATA ||
@@ -2023,20 +2035,20 @@
(sink_type == DFC_TYPE_DATA ||
sink_type == DFC_TYPE_LISP_LSTREAM));
- if (dfc_convert_to_internal_format_in_use != 0)
- error ("Can't call a conversion function from a conversion function");
- else
- dfc_convert_to_internal_format_in_use = 1;
-
record_unwind_protect (dfc_convert_to_internal_format_reset_in_use,
- Qzero);
+ make_int (dfc_convert_to_internal_format_in_use));
+ if (Dynarr_length (conversion_in_dynarr_list) <=
+ dfc_convert_to_internal_format_in_use)
+ Dynarr_add (conversion_in_dynarr_list, Dynarr_new (Bufbyte));
+ conversion_in_dynarr = Dynarr_at (conversion_in_dynarr_list,
+ dfc_convert_to_internal_format_in_use);
+ dfc_convert_to_internal_format_in_use++;
+ Dynarr_reset (conversion_in_dynarr);
#ifdef FILE_CODING
coding_system = Fget_coding_system (coding_system);
#endif
- Dynarr_reset (conversion_in_dynarr);
-
if (source_type != DFC_TYPE_LISP_LSTREAM &&
sink_type != DFC_TYPE_LISP_LSTREAM &&
coding_system_is_binary (coding_system))
@@ -2218,8 +2230,10 @@
void
reinit_vars_of_buffer (void)
{
- conversion_in_dynarr = Dynarr_new (Bufbyte);
- conversion_out_dynarr = Dynarr_new (Extbyte);
+ conversion_in_dynarr_list = Dynarr_new2 (Bufbyte_dynarr_dynarr,
+ Bufbyte_dynarr *);
+ conversion_out_dynarr_list = Dynarr_new2 (Extbyte_dynarr_dynarr,
+ Extbyte_dynarr *);
staticpro_nodump (&Vbuffer_alist);
Vbuffer_alist = Qnil;
Index: src/console-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console-msw.c,v
retrieving revision 1.4.2.9
diff -u -r1.4.2.9 console-msw.c
--- console-msw.c 2000/05/11 10:29:35 1.4.2.9
+++ console-msw.c 2000/05/16 08:43:54
@@ -518,6 +518,23 @@
return Qnil;
}
+void
+mswindows_output_last_error (char *frob)
+{
+ LPVOID lpMsgBuf;
+ int errval = GetLastError();
+
+ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER
+ | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, errval,
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ stderr_out ("last error during %s is %d: %s\n",
+ frob, errval, lpMsgBuf);
+}
+
/************************************************************************/
/* initialization */
Index: src/console-msw.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console-msw.h,v
retrieving revision 1.22.2.21
diff -u -r1.22.2.21 console-msw.h
--- console-msw.h 2000/05/03 14:47:02 1.22.2.21
+++ console-msw.h 2000/05/16 08:43:55
@@ -159,6 +159,9 @@
/* DC for this win32 window */
HDC hdc;
+ /* Used with DeferWindowPos */
+ HDWP hdwp;
+
/* Time of last click event, for button 2 emul */
DWORD last_click_time;
@@ -346,5 +349,8 @@
HWND ctrl, LPARAM id);
int msw_windows9x_p (void);
+
+
+void mswindows_output_last_error (char *frob);
#endif /* INCLUDED_console_msw_h_ */
Index: src/console-stream.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console-stream.c,v
retrieving revision 1.11.2.6
diff -u -r1.11.2.6 console-stream.c
--- console-stream.c 2000/03/16 07:04:47 1.11.2.6
+++ console-stream.c 2000/05/16 08:43:55
@@ -201,16 +201,6 @@
}
static void
-stream_output_begin (struct device *d)
-{
-}
-
-static void
-stream_output_end (struct device *d)
-{
-}
-
-static void
stream_output_display_block (struct window *w, struct display_line *dl,
int block, int start, int end,
int start_pixpos, int cursor_start,
@@ -219,16 +209,6 @@
}
static void
-stream_output_vertical_divider (struct window *w, int clear)
-{
-}
-
-static void
-stream_clear_to_window_end (struct window *w, int ypos1, int ypos2)
-{
-}
-
-static void
stream_clear_region (Lisp_Object window, struct device* d, struct frame * f,
face_index findex, int x, int y,
int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
@@ -236,11 +216,6 @@
{
}
-static void
-stream_clear_frame (struct frame *f)
-{
-}
-
static int
stream_flash (struct device *d)
{
@@ -285,14 +260,9 @@
CONSOLE_HAS_METHOD (stream, right_margin_width);
CONSOLE_HAS_METHOD (stream, text_width);
CONSOLE_HAS_METHOD (stream, output_display_block);
- CONSOLE_HAS_METHOD (stream, output_vertical_divider);
CONSOLE_HAS_METHOD (stream, divider_height);
CONSOLE_HAS_METHOD (stream, eol_cursor_width);
- CONSOLE_HAS_METHOD (stream, clear_to_window_end);
CONSOLE_HAS_METHOD (stream, clear_region);
- CONSOLE_HAS_METHOD (stream, clear_frame);
- CONSOLE_HAS_METHOD (stream, output_begin);
- CONSOLE_HAS_METHOD (stream, output_end);
CONSOLE_HAS_METHOD (stream, flash);
CONSOLE_HAS_METHOD (stream, ring_bell);
}
Index: src/console.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console.h,v
retrieving revision 1.22.2.23
diff -u -r1.22.2.23 console.h
--- console.h 2000/02/26 11:39:48 1.22.2.23
+++ console.h 2000/05/16 08:43:55
@@ -152,8 +152,10 @@
int, int, int, int,
Lisp_Object, Lisp_Object, Lisp_Object);
void (*clear_frame_method) (struct frame *);
- void (*output_begin_method) (struct device *);
- void (*output_end_method) (struct device *);
+ void (*window_output_begin_method) (struct window *);
+ void (*frame_output_begin_method) (struct frame *);
+ void (*window_output_end_method) (struct window *);
+ void (*frame_output_end_method) (struct frame *);
int (*flash_method) (struct device *);
void (*ring_bell_method) (struct device *, int volume, int pitch,
int duration);
Index: src/event-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/event-msw.c,v
retrieving revision 1.38.2.44
diff -u -r1.38.2.44 event-msw.c
--- event-msw.c 2000/05/03 14:47:03 1.38.2.44
+++ event-msw.c 2000/05/16 08:43:56
@@ -148,6 +148,10 @@
int mswindows_mouse_button_max_skew_y;
int mswindows_mouse_button_tolerance;
+#ifdef DEBUG_XEMACS
+int mswindows_debug_events;
+#endif
+
/* This is the event signaled by the event pump.
See mswindows_pump_outstanding_events for comments */
static Lisp_Object mswindows_error_caught_in_modal_loop;
@@ -1661,6 +1665,9 @@
windows are unmapped, however once we are in the guts of
WM_PAINT we need to make sure that we don't register
unmaps then because they will not actually occur. */
+ /* #### commenting out the next line seems to fix some problems
+ but not all. only andy currently understands this stuff and
+ he needs to review it more carefully. --ben */
if (!check_for_ignored_expose (frame, x, y, width, height))
{
hold_ignored_expose_registration = 1;
@@ -1684,6 +1691,50 @@
return 0;
}
+#ifdef DEBUG_XEMACS
+
+/* try to debug the stuck-alt-key problem. */
+
+static void
+output_alt_keyboard_state (void)
+{
+ BYTE keymap[256];
+ SHORT keystate[3], asyncstate[3];
+
+ GetKeyboardState (keymap);
+ keystate[0] = GetKeyState (VK_MENU);
+ keystate[1] = GetKeyState (VK_LMENU);
+ keystate[2] = GetKeyState (VK_RMENU);
+ asyncstate[0] = GetAsyncKeyState (VK_MENU);
+ asyncstate[1] = GetAsyncKeyState (VK_LMENU);
+ asyncstate[2] = GetAsyncKeyState (VK_RMENU);
+
+ stderr_out ("GetKeyboardState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d
%d\n",
+ keymap[VK_MENU] & 0x80 ? 1 : 0,
+ keymap[VK_MENU] & 0x1 ? 1 : 0,
+ keymap[VK_LMENU] & 0x80 ? 1 : 0,
+ keymap[VK_LMENU] & 0x1 ? 1 : 0,
+ keymap[VK_RMENU] & 0x80 ? 1 : 0,
+ keymap[VK_RMENU] & 0x1 ? 1 : 0);
+ stderr_out ("GetKeyState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d %d\n",
+ keystate[0] & 0x8000 ? 1 : 0,
+ keystate[0] & 0x1 ? 1 : 0,
+ keystate[1] & 0x8000 ? 1 : 0,
+ keystate[1] & 0x1 ? 1 : 0,
+ keystate[2] & 0x8000 ? 1 : 0,
+ keystate[2] & 0x1 ? 1 : 0);
+ stderr_out ("GetAsyncKeyState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d
%d\n",
+ asyncstate[0] & 0x8000 ? 1 : 0,
+ asyncstate[0] & 0x1 ? 1 : 0,
+ asyncstate[1] & 0x8000 ? 1 : 0,
+ asyncstate[1] & 0x1 ? 1 : 0,
+ asyncstate[2] & 0x8000 ? 1 : 0,
+ asyncstate[2] & 0x1 ? 1 : 0);
+}
+
+#endif /* DEBUG_XEMACS */
+
+
/*
* The windows procedure for the window class XEMACS_CLASS
*/
@@ -1728,6 +1779,16 @@
BYTE keymap[256];
int should_set_keymap = 0;
+#ifdef DEBUG_XEMACS
+ if (mswindows_debug_events)
+ {
+ stderr_out ("%s wparam=%d lparam=%d\n",
+ message == WM_KEYUP ? "WM_KEYUP" : "WM_SYSKEYUP",
+ wParam, lParam);
+ output_alt_keyboard_state ();
+ }
+#endif /* DEBUG_XEMACS */
+
if (wParam == VK_CONTROL)
{
GetKeyboardState (keymap);
@@ -1769,6 +1830,16 @@
int extendedp = lParam & 0x1000000;
Lisp_Object keysym;
+#ifdef DEBUG_XEMACS
+ if (mswindows_debug_events)
+ {
+ stderr_out ("%s wparam=%d lparam=%d\n",
+ message == WM_KEYDOWN ? "WM_KEYDOWN" : "WM_SYSKEYDOWN",
+ wParam, lParam);
+ output_alt_keyboard_state ();
+ }
+#endif /* DEBUG_XEMACS */
+
frame = XFRAME (mswindows_find_frame (hwnd));
GetKeyboardState (keymap);
mods = mswindows_modifier_state (keymap, has_AltGr);
@@ -3161,6 +3232,20 @@
mswindows_error_caught_in_modal_loop = Qnil;
staticpro (&mswindows_error_caught_in_modal_loop);
+
+
+#ifdef DEBUG_XEMACS
+ DEFVAR_INT ("mswindows-debug-events", &mswindows_debug_events /*
+If non-zero, display debug information about Windows events that XEmacs sees.
+Information is displayed in a console window. Currently defined values are:
+
+1 == non-verbose output
+2 == verbose output
+
+#### Unfortunately, not yet implemented.
+*/ );
+ mswindows_debug_events = 0;
+#endif
DEFVAR_BOOL ("mswindows-alt-by-itself-activates-menu",
&mswindows_alt_by_itself_activates_menu /*
Index: src/frame-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame-msw.c,v
retrieving revision 1.29.2.20
diff -u -r1.29.2.20 frame-msw.c
--- frame-msw.c 2000/04/28 15:17:19 1.29.2.20
+++ frame-msw.c 2000/05/16 08:43:56
@@ -127,13 +127,6 @@
abs (XINT (height));
/* Misc frame stuff */
- FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0;
- FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0;
- FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0;
- FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0;
- FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0;
- FRAME_MSWINDOWS_DATA(f)->sizing = 0;
- FRAME_MSWINDOWS_DATA(f)->paint_pending = 0;
FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil;
#ifdef HAVE_TOOLBARS
FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) =
Index: src/glyphs-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-msw.c,v
retrieving revision 1.21.2.57
diff -u -r1.21.2.57 glyphs-msw.c
--- glyphs-msw.c 2000/05/03 14:47:05 1.21.2.57
+++ glyphs-msw.c 2000/05/16 08:43:57
@@ -20,7 +20,7 @@
/* Synched up with: Not in FSF. */
-/* written by Andy Piper <andy(a)xemacs.org> plagerising bits from
+/* written by Andy Piper <andy(a)xemacs.org> plagiarising bits from
glyphs-x.c */
#include <config.h>
@@ -2140,6 +2140,14 @@
return mswindows_get_hfont (XFONT_INSTANCE (font), under, strike);
}
+static HDWP
+begin_defer_window_pos (struct frame *f)
+{
+ if (FRAME_MSWINDOWS_DATA (f)->hdwp == 0)
+ FRAME_MSWINDOWS_DATA (f)->hdwp = BeginDeferWindowPos (10);
+ return FRAME_MSWINDOWS_DATA (f)->hdwp;
+}
+
/* unmap the image if it is a widget. This is used by redisplay via
redisplay_unmap_subwindows */
static void
@@ -2147,11 +2155,26 @@
{
if (IMAGE_INSTANCE_SUBWINDOW_ID (p))
{
- SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
- NULL,
- 0, 0, 0, 0,
- SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE
- | SWP_NOSENDCHANGING);
+ struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p));
+ HDWP hdwp = begin_defer_window_pos (f);
+ HDWP new_hdwp;
+ new_hdwp = DeferWindowPos (hdwp, IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
+ NULL,
+ 0, 0, 0, 0,
+ SWP_HIDEWINDOW | SWP_NOACTIVATE |
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER
+ /* Setting this flag causes the call to
+ DeferWindowPos to fail with
+ "Invalid parameter". I don't understand
+ why we bother to try and set this
+ anyway. -- ben */
+ /* | SWP_NOSENDCHANGING */
+ );
+ if (!new_hdwp)
+ mswindows_output_last_error ("unmapping");
+ else
+ hdwp = new_hdwp;
+ FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp;
if (GetFocus() == WIDGET_INSTANCE_MSWINDOWS_HANDLE (p))
SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)));
}
@@ -2163,6 +2186,9 @@
mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y,
struct display_glyph_area* dga)
{
+ struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p));
+ HDWP hdwp = begin_defer_window_pos (f);
+ HDWP new_hdwp;
/* move the window before mapping it ... */
SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
NULL,
@@ -2176,12 +2202,24 @@
SWP_NOZORDER | SWP_NOSIZE
| SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
/* ... now map it - we are not allowed to move it at the same time. */
- SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
- NULL,
- 0, 0, 0, 0,
- SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
- | SWP_SHOWWINDOW | SWP_NOCOPYBITS
- | SWP_NOSENDCHANGING);
+ new_hdwp = DeferWindowPos (hdwp, IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
+ NULL,
+ 0, 0, 0, 0,
+ SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
+ | SWP_SHOWWINDOW
+ /* | SWP_NOCOPYBITS */
+ /* Setting this flag causes the call to
+ DeferWindowPos to fail with
+ "Invalid parameter". I don't understand
+ why we bother to try and set this
+ anyway. -- ben */
+ /* | SWP_NOSENDCHANGING */
+ | SWP_NOACTIVATE);
+ if (!new_hdwp)
+ mswindows_output_last_error ("mapping");
+ else
+ hdwp = new_hdwp;
+ FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp;
}
/* resize the subwindow instance */
@@ -2189,11 +2227,12 @@
mswindows_resize_subwindow (Lisp_Image_Instance* ii, int w, int h)
{
/* Set the size of the control .... */
- SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
- NULL,
- 0, 0, w, h,
- SWP_NOZORDER | SWP_NOMOVE
- | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
+ if (!SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
+ NULL,
+ 0, 0, w, h,
+ SWP_NOZORDER | SWP_NOMOVE
+ | SWP_NOCOPYBITS | SWP_NOSENDCHANGING))
+ mswindows_output_last_error ("resizing");
}
/* Simply resize the window here. */
Index: src/glyphs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v
retrieving revision 1.23.2.69
diff -u -r1.23.2.69 glyphs.c
--- glyphs.c 2000/05/11 10:29:35 1.23.2.69
+++ glyphs.c 2000/05/16 08:43:59
@@ -1374,7 +1374,7 @@
if (EQ (XVECTOR_DATA (data)[0], Qinherit))
signal_simple_error ("Inheritance not allowed here", data);
governing_domain =
- get_image_instantiator_governing_domain (XVECTOR_DATA (data)[0], domain);
+ get_image_instantiator_governing_domain (data, domain);
ii = instantiate_image_instantiator (governing_domain, domain, data,
Qnil, Qnil, dest_mask, Qnil);
RETURN_UNGCPRO (ii);
Index: src/gutter.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.c,v
retrieving revision 1.1.2.35
diff -u -r1.1.2.35 gutter.c
--- gutter.c 2000/05/09 11:54:56 1.1.2.35
+++ gutter.c 2000/05/16 08:43:59
@@ -988,7 +988,9 @@
DEVICE_FRAME_LOOP (frmcons, d)
{
struct frame *f = XFRAME (XCAR (frmcons));
-
+
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+
/* Sequence is quite important here. We not only want to
redisplay the gutter area but we also want to flush any
frame size changes out so that the gutter redisplay happens
@@ -1014,12 +1016,9 @@
update_frame_gutters (f);
unhold_one_frame_size_changes (f);
}
- }
- /* We now call the output_end routine for tty frames. We delay
- doing so in order to avoid cursor flicker. So much for 100%
- encapsulation. */
- if (DEVICE_TTY_P (d))
- DEVMETH (d, output_end, (d));
+
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
d->gutter_changed = 0;
}
Index: src/lisp.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.38.2.62
diff -u -r1.38.2.62 lisp.h
--- lisp.h 2000/05/12 09:19:47 1.38.2.62
+++ lisp.h 2000/05/16 08:44:01
@@ -63,6 +63,8 @@
void Dynarr_free (void *d);
#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
+#define Dynarr_new2(dynarr_type, type) \
+ ((dynarr_type *) Dynarr_newf (sizeof (type)))
#define Dynarr_at(d, pos) ((d)->base[pos])
#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
#define Dynarr_length(d) ((d)->cur)
Index: src/redisplay-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-msw.c,v
retrieving revision 1.28.2.25
diff -u -r1.28.2.25 redisplay-msw.c
--- redisplay-msw.c 2000/05/03 14:47:13 1.28.2.25
+++ redisplay-msw.c 2000/05/16 08:44:01
@@ -957,23 +957,31 @@
}
/*****************************************************************************
- mswindows_output_begin
+ mswindows_frame_output_begin
Perform any necessary initialization prior to an update.
****************************************************************************/
static void
-mswindows_output_begin (struct device *d)
+mswindows_frame_output_begin (struct frame *f)
{
}
/*****************************************************************************
- mswindows_output_end
+ mswindows_frame_output_end
Perform any necessary flushing of queues when an update has completed.
****************************************************************************/
static void
-mswindows_output_end (struct device *d)
+mswindows_frame_output_end (struct frame *f)
{
+ HDWP hdwp = FRAME_MSWINDOWS_DATA (f)->hdwp;
+
+ if (hdwp != 0)
+ {
+ EndDeferWindowPos (hdwp);
+ FRAME_MSWINDOWS_DATA (f)->hdwp = 0;
+ }
+
GdiFlush();
}
@@ -1360,8 +1368,8 @@
CONSOLE_HAS_METHOD (mswindows, output_vertical_divider);
CONSOLE_HAS_METHOD (mswindows, clear_region);
CONSOLE_HAS_METHOD (mswindows, clear_frame);
- CONSOLE_HAS_METHOD (mswindows, output_begin);
- CONSOLE_HAS_METHOD (mswindows, output_end);
+ CONSOLE_HAS_METHOD (mswindows, frame_output_begin);
+ CONSOLE_HAS_METHOD (mswindows, frame_output_end);
CONSOLE_HAS_METHOD (mswindows, flash);
CONSOLE_HAS_METHOD (mswindows, ring_bell);
CONSOLE_HAS_METHOD (mswindows, bevel_area);
@@ -1376,8 +1384,8 @@
CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_vertical_divider);
CONSOLE_INHERITS_METHOD (msprinter, mswindows, clear_region);
CONSOLE_INHERITS_METHOD (msprinter, mswindows, clear_frame);
- CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_begin);
- CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_end);
+ CONSOLE_INHERITS_METHOD (msprinter, mswindows, frame_output_begin);
+ CONSOLE_INHERITS_METHOD (msprinter, mswindows, frame_output_end);
CONSOLE_INHERITS_METHOD (msprinter, mswindows, bevel_area);
CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_string);
CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_pixmap);
Index: src/redisplay-output.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-output.c,v
retrieving revision 1.11.2.37
diff -u -r1.11.2.37 redisplay-output.c
--- redisplay-output.c 2000/05/03 14:47:14 1.11.2.37
+++ redisplay-output.c 2000/05/16 08:44:02
@@ -895,7 +895,10 @@
}
else
{
- DEVMETH (d, output_begin, (d));
+ {
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
+ }
rb->cursor_type = CURSOR_OFF;
dl->cursor_elt = -1;
output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
@@ -910,7 +913,10 @@
if (w != XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d))))
{
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
@@ -929,7 +935,10 @@
output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
else
@@ -993,7 +1002,10 @@
make_int (ADJ_BUFPOS), w->buffer);
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
@@ -1006,7 +1018,10 @@
}
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 0;
}
#undef ADJ_BUFPOS
@@ -1061,12 +1076,18 @@
(f, dl->ypos - 1, rb->xpos));
if (run_end_begin_meths)
- DEVMETH (d, output_begin, (d));
+ {
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
+ }
output_display_line (w, 0, dla, y, rb->xpos, rb->xpos + rb->width);
if (run_end_begin_meths)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
}
}
@@ -2037,7 +2058,7 @@
display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP);
display_line_dynarr *ddla = window_display_lines (w, DESIRED_DISP);
- DEVMETH (d, output_begin, (d));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
while (first_line <= last_line)
{
@@ -2122,14 +2143,8 @@
}
#endif
- /* This has to be done after we've updated the values. We don't
- call output_end for tty frames. Redisplay will do this after all
- tty windows have been updated. This cuts down on cursor
- flicker. */
- if (FRAME_TTY_P (f))
- redisplay_redraw_cursor (f, 0);
- else
- DEVMETH (d, output_end, (d));
+ redisplay_redraw_cursor (f, 0);
+ MAYBE_DEVMETH (d, window_output_end, (w));
}
/*****************************************************************************
@@ -2243,7 +2258,7 @@
}
/* Perform any output initialization. */
- DEVMETH (d, output_begin, (d));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
/* If the window's structure has changed clear the internal border
above it if it is topmost (the function will check). */
@@ -2266,7 +2281,7 @@
if (window_needs_vertical_divider (w)
&& (f->windows_structure_changed || f->clear))
{
- DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed));
+ MAYBE_DEVMETH (d, output_vertical_divider, (w,
f->windows_structure_changed));
}
/* Clear the rest of the window, if necessary. */
@@ -2300,13 +2315,8 @@
get invalidated when it should be. */
INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (d);
- /* We don't call output_end for tty frames. Redisplay will do this
- after all tty windows have been updated. This cuts down on
- cursor flicker. */
- if (FRAME_TTY_P (f))
- redisplay_redraw_cursor (f, 0);
- else
- DEVMETH (d, output_end, (d));
+ redisplay_redraw_cursor (f, 0);
+ MAYBE_DEVMETH (d, window_output_end, (w));
#ifdef HAVE_SCROLLBARS
update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0);
Index: src/redisplay-tty.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-tty.c,v
retrieving revision 1.15.2.11
diff -u -r1.15.2.11 redisplay-tty.c
--- redisplay-tty.c 2000/05/03 14:47:15 1.15.2.11
+++ redisplay-tty.c 2000/05/16 08:44:03
@@ -138,23 +138,23 @@
}
/*****************************************************************************
- tty_output_begin
+ tty_frame_output_begin
Perform any necessary initialization prior to an update.
****************************************************************************/
#ifdef DEBUG_XEMACS
-void tty_output_begin (struct device *d);
+void tty_frame_output_begin (struct frame *f);
void
#else
static void
#endif
-tty_output_begin (struct device *d)
+tty_frame_output_begin (struct frame *f)
{
#ifndef HAVE_TERMIOS
/* Termcap requires `ospeed' to be a global variable so we have to
always set it for whatever tty console we are actually currently
working with. */
- ospeed = DEVICE_TTY_DATA (d)->ospeed;
+ ospeed = DEVICE_TTY_DATA (XDEVICE (FRAME_DEVICE (f)))->ospeed;
#endif
}
@@ -164,13 +164,14 @@
Perform any necessary flushing of queues when an update has completed.
****************************************************************************/
#ifdef DEBUG_XEMACS
-void tty_output_end (struct device *d);
+void tty_frame_output_end (struct frame *f);
void
#else
static void
#endif
-tty_output_end (struct device *d)
+tty_frame_output_end (struct frame *f)
{
+ struct device *d = XDEVICE (FRAME_DEVICE (f));
struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
CONSOLE_TTY_CURSOR_X (c) = CONSOLE_TTY_FINAL_CURSOR_X (c);
@@ -1490,8 +1491,8 @@
CONSOLE_HAS_METHOD (tty, clear_to_window_end);
CONSOLE_HAS_METHOD (tty, clear_region);
CONSOLE_HAS_METHOD (tty, clear_frame);
- CONSOLE_HAS_METHOD (tty, output_begin);
- CONSOLE_HAS_METHOD (tty, output_end);
+ CONSOLE_HAS_METHOD (tty, frame_output_begin);
+ CONSOLE_HAS_METHOD (tty, frame_output_end);
CONSOLE_HAS_METHOD (tty, flash);
CONSOLE_HAS_METHOD (tty, ring_bell);
CONSOLE_HAS_METHOD (tty, set_final_cursor_coords);
Index: src/redisplay-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.23.2.25
diff -u -r1.23.2.25 redisplay-x.c
--- redisplay-x.c 2000/05/03 14:47:15 1.23.2.25
+++ redisplay-x.c 2000/05/16 08:44:03
@@ -286,24 +286,24 @@
}
/*****************************************************************************
- x_output_begin
+ x_window_output_begin
Perform any necessary initialization prior to an update.
****************************************************************************/
static void
-x_output_begin (struct device *d)
+x_window_output_begin (struct window *w)
{
}
/*****************************************************************************
- x_output_end
+ x_window_output_end
Perform any necessary flushing of queues when an update has completed.
****************************************************************************/
static void
-x_output_end (struct device *d)
+x_window_output_end (struct window *w)
{
- XFlush (DEVICE_X_DISPLAY (d));
+ XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w)));
}
/*****************************************************************************
@@ -2095,8 +2095,8 @@
CONSOLE_HAS_METHOD (x, output_vertical_divider);
CONSOLE_HAS_METHOD (x, clear_region);
CONSOLE_HAS_METHOD (x, clear_frame);
- CONSOLE_HAS_METHOD (x, output_begin);
- CONSOLE_HAS_METHOD (x, output_end);
+ CONSOLE_HAS_METHOD (x, window_output_begin);
+ CONSOLE_HAS_METHOD (x, window_output_end);
CONSOLE_HAS_METHOD (x, flash);
CONSOLE_HAS_METHOD (x, ring_bell);
CONSOLE_HAS_METHOD (x, bevel_area);
Index: src/redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.55.2.56
diff -u -r1.55.2.56 redisplay.c
--- redisplay.c 2000/05/09 11:54:57 1.55.2.56
+++ redisplay.c 2000/05/16 08:44:06
@@ -6373,6 +6373,8 @@
#### If a frame-size change does occur we should probably
actually be preempting redisplay. */
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+
/* We can now update the gutters, safe in the knowledge that our
efforts won't get undone. */
@@ -6386,7 +6388,7 @@
/* Erase the frame before outputting its contents. */
if (f->clear)
{
- DEVMETH (d, clear_frame, (f));
+ MAYBE_DEVMETH (d, clear_frame, (f));
}
/* Do the selected window first. */
@@ -6395,11 +6397,7 @@
/* Then do the rest. */
redisplay_windows (f->root_window, 1);
- /* We now call the output_end routine for tty frames. We delay
- doing so in order to avoid cursor flicker. So much for 100%
- encapsulation. */
- if (FRAME_TTY_P (f))
- DEVMETH (d, output_end, (d));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
update_frame_title (f);
@@ -8837,6 +8835,9 @@
if (FRAME_REPAINT_P (f) && FRAME_HAS_MINIBUF_P (f))
{
Lisp_Object window = FRAME_MINIBUF_WINDOW (f);
+
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+
/*
* If the frame size has changed, there may be random
* chud on the screen left from previous messages
@@ -8845,19 +8846,15 @@
*/
if (f->echo_area_garbaged)
{
- DEVMETH (d, clear_frame, (f));
+ MAYBE_DEVMETH (d, clear_frame, (f));
f->echo_area_garbaged = 0;
}
redisplay_window (window, 0);
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+
call_redisplay_end_triggers (XWINDOW (window), 0);
}
}
-
- /* We now call the output_end routine for tty frames. We delay
- doing so in order to avoid cursor flicker. So much for 100%
- encapsulation. */
- if (DEVICE_TTY_P (d))
- DEVMETH (d, output_end, (d));
}
return Qnil;
Index: src/window.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/window.h,v
retrieving revision 1.13.2.12
diff -u -r1.13.2.12 window.h
--- window.h 2000/03/04 16:53:37 1.13.2.12
+++ window.h 2000/05/16 08:44:07
@@ -387,9 +387,13 @@
int window_divider_width (struct window *w);
#define WINDOW_FRAME(w) ((w)->frame)
+#define WINDOW_XFRAME(w) XFRAME (WINDOW_FRAME (w))
#define WINDOW_BUFFER(w) ((w)->buffer)
+#define WINDOW_XBUFFER(w) XBUFFER (WINDOW_BUFFER (w))
#define WINDOW_DEVICE(w) FRAME_DEVICE (XFRAME (WINDOW_FRAME (w)))
+#define WINDOW_XDEVICE(w) XDEVICE (WINDOW_DEVICE (w))
#define WINDOW_CONSOLE(w) DEVICE_CONSOLE (XDEVICE (WINDOW_DEVICE (w)))
+#define WINDOW_XCONSOLE(w) XCONSOLE (WINDOW_CONSOLE (w))
/* XEmacs window size and positioning macros. */
#define WINDOW_TOP(w) ((w)->pixel_top)
cvs server: Diffing src/m
cvs server: Diffing src/s
cvs server: Diffing tests
cvs server: Diffing tests/DLL
cvs server: Diffing tests/Dnd
cvs server: Diffing tests/automated
cvs server: Diffing tests/mule
cvs server: Diffing tests/tooltalk
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/chronic-pain/