changeset 545:9a775fb11bb7

[xemacs-hg @ 2001-05-18 04:39:39 by kkm] My 3 patches of 05/01-05/03
author kkm
date Fri, 18 May 2001 04:39:44 +0000
parents ffd4d00ff0b6
children 666d73d6ac56
files nt/ChangeLog nt/xemacs.mak src/ChangeLog src/console.h src/device-gtk.c src/device-msw.c src/device.c src/device.h src/dumper.c src/frame.c src/lisp.h src/redisplay.c
diffstat 12 files changed, 116 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/nt/ChangeLog	Thu May 17 13:55:47 2001 +0000
+++ b/nt/ChangeLog	Fri May 18 04:39:44 2001 +0000
@@ -1,3 +1,7 @@
+2001-05-01  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+	* xemacs.mak: Use link to make .rsrc writable, not editbin.
+
 2001-05-10  Ben Wing  <ben@xemacs.org>
 
 	* xemacs.mak (TEMACS_LIBS):
--- a/nt/xemacs.mak	Thu May 17 13:55:47 2001 +0000
+++ b/nt/xemacs.mak	Fri May 18 04:39:44 2001 +0000
@@ -1386,12 +1386,11 @@
 	$(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
 !if $(USE_PORTABLE_DUMPER)
 	rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc
-	link.exe @<<
-  $(TEMACS_LFLAGS) -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj
-<<
 # Make the resource section read/write since almost all of it is the dump
 # data which needs to be writable.  This avoids having to copy it.
-	editbin -nologo -section:.rsrc,rw xemacs.exe
+	link.exe @<<
+  $(TEMACS_LFLAGS) -section:.rsrc,rw -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj
+<<
 	$(DEL) $(TEMACS_DIR)\xemacs.dmp
 !endif
 	cd $(NT)
--- a/src/ChangeLog	Thu May 17 13:55:47 2001 +0000
+++ b/src/ChangeLog	Fri May 18 04:39:44 2001 +0000
@@ -1,3 +1,43 @@
+2001-05-03  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+	* lisp.h: (dump_add_opaque): make varaddress parameter const.
+
+	* dumper.c (struct pdump_opaque): make varaddress const.
+	(dump_add_opaque): make varaddress parameter const.
+	(pdump_load_finish): override const when copying into
+	info.varaddress.
+
+2001-05-02  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+	* console.h (struct console_methods): Added flags member.
+	(CONSOLE_IMPLEMENTATION_FLAGS): Defined.
+	(CONMETH_IMPL_FLAG): 
+	(CONSOLE_IMPL_FLAG): Macro to check implememntation flags.
+	Defined XDEVIMPF_DONT_PREEMPT_REDISPLAY.
+
+	* device.c (window_system_pixelated_geometry): Use the above macros.
+
+	* device.h (DEVICE_IMPL_FLAG): Macro to check a device
+	implememntation flag.
+	* device.h (DEVICE_DISPLAY_P): Use it.
+
+	* frame.c (delete_frame_internal): Use the above macro.
+
+	* redisplay.c (redisplay_device): Use it.
+	(redisplay_device): Obey XDEVIMPF_DONT_PREEMPT_REDISPLAY.
+	(redisplay_frame): Ditto.
+
+	* device-msw.c (mswindows_device_implementation_flags): Removed.
+	(msprinter_device_implementation_flags): Removed.
+	(console_type_create_device_mswindows): Removed references to
+	implementation_flags methods, set implementation flags here.
+	(console_type_create_device_mswindows): Added XDEVIMPF_DONT_PREEMPT.
+
+	* device-gtk.c (gtk_device_implementation_flags): Removed method.
+	(console_type_create_device_gtk): Removed method declaration.
+	Added commented out statement which semantically matches the
+	commented out statement in the above removed method.
+
 2001-05-17  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* regex.c (DECLARE_NOTHING): Define if !emacs && REGEX_MALLOC.
--- a/src/console.h	Thu May 17 13:55:47 2001 +0000
+++ b/src/console.h	Fri May 18 04:39:44 2001 +0000
@@ -63,11 +63,34 @@
 extern const struct struct_description cted_description;
 extern const struct struct_description console_methods_description;
 
+
+/*
+ * Constants returned by device_implementation_flags_method
+ */
+
+/* Set when device uses pixel-based geometry */
+#define XDEVIMPF_PIXEL_GEOMETRY		0x00000001L
+
+/* Indicates that the device is a printer */
+#define XDEVIMPF_IS_A_PRINTER		0x00000002L
+
+/* Do not automatically redisplay this device */
+#define XDEVIMPF_NO_AUTO_REDISPLAY	0x00000004L
+
+/* Do not delete the device when last frame's gone */
+#define XDEVIMPF_FRAMELESS_OK		0x00000008L
+
+/* Do not preempt resiaply of frame or device once it starts */
+#define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L
+
 struct console_methods
 {
   const char *name;	/* Used by print_console, print_device, print_frame */
   Lisp_Object symbol;
   Lisp_Object predicate_symbol;
+  unsigned int flags;	/* Read-only implementation flags, set once upon
+			   console type creation. INITIALIZE_CONSOLE_TYPE sets
+			   this member to 0. */
 
   /* console methods */
   void (*init_console_method) (struct console *, Lisp_Object props);
@@ -93,7 +116,6 @@
   void (*asynch_device_change_method) (void);
   Lisp_Object (*device_system_metrics_method) (struct device *,
                                                enum device_metrics);
-  unsigned int (*device_implementation_flags_method) (void);
   Lisp_Object (*own_selection_method)(Lisp_Object selection_name,
                                       Lisp_Object selection_value,
                                       Lisp_Object how_to_add,
@@ -303,26 +325,12 @@
 #endif
 };
 
-/*
- * Constants returned by device_implementation_flags_method
- */
-
-/* Set when device uses pixel-based geometry */
-#define XDEVIMPF_PIXEL_GEOMETRY	    0x00000001L
-
-/* Indicates that the device is a printer */
-#define XDEVIMPF_IS_A_PRINTER	    0x00000002L
-
-/* Do not automatically redisplay this device */
-#define XDEVIMPF_NO_AUTO_REDISPLAY  0x00000004L
-
-/* Do not delete the device when last frame's gone */
-#define XDEVIMPF_FRAMELESS_OK	    0x00000008L
-
+#define CONMETH_TYPE(meths) ((meths)->symbol)
+#define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f))
 
 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name)
 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol)
-#define CONMETH_TYPE(meths) ((meths)->symbol)
+#define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f))
 
 /******** Accessing / calling a console method *********/
 
@@ -407,6 +415,10 @@
 #define CONSOLE_INHERITS_METHOD(type, fromtype, m) \
   (type##_console_methods->m##_method = fromtype##_##m)
 
+/* Define console type implementation flags */
+#define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \
+  (type##_console_methods->flags = flg)
+
 struct console
 {
   struct lcrecord_header header;
--- a/src/device-gtk.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/device-gtk.c	Fri May 18 04:39:44 2001 +0000
@@ -680,12 +680,6 @@
   return (result);
 }
 
-static unsigned int
-gtk_device_implementation_flags (void)
-{
-  return 0; /* XDEVIMPF_PIXEL_GEOMETRY; */
-}
-
 
 /************************************************************************/
 /*                            initialization                            */
@@ -717,7 +711,10 @@
   CONSOLE_HAS_METHOD (gtk, mark_device);
   CONSOLE_HAS_METHOD (gtk, delete_device);
   CONSOLE_HAS_METHOD (gtk, device_system_metrics);
-  CONSOLE_HAS_METHOD (gtk, device_implementation_flags);
+  /* CONSOLE_IMPLEMENTATION_FLAGS (gtk, XDEVIMPF_PIXEL_GEOMETRY); */
+  /* I inserted the above commented out statement, as the original
+     implementation of gtk_device_implementation_flags(), which I
+     deleted, contained commented out XDEVIMPF_PIXEL_GEOMETRY - kkm*/
 }
 
 void
--- a/src/device-msw.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/device-msw.c	Fri May 18 04:39:44 2001 +0000
@@ -340,12 +340,6 @@
   return Qunbound;
 }
 
-static unsigned int
-mswindows_device_implementation_flags (void)
-{
-  return XDEVIMPF_PIXEL_GEOMETRY;
-}
-
 
 /************************************************************************/
 /*                          printer helpers                             */
@@ -533,14 +527,6 @@
   mark_object (DEVICE_MSPRINTER_DEVMODE (d));
 }
 
-static unsigned int
-msprinter_device_implementation_flags (void)
-{
-  return (  XDEVIMPF_PIXEL_GEOMETRY
-	  | XDEVIMPF_IS_A_PRINTER
-	  | XDEVIMPF_NO_AUTO_REDISPLAY
-	  | XDEVIMPF_FRAMELESS_OK );
-}
 
 /************************************************************************/
 /*                      printer Lisp subroutines                        */
@@ -1304,13 +1290,17 @@
   CONSOLE_HAS_METHOD (mswindows, mark_device);
   CONSOLE_HAS_METHOD (mswindows, delete_device);
   CONSOLE_HAS_METHOD (mswindows, device_system_metrics);
-  CONSOLE_HAS_METHOD (mswindows, device_implementation_flags);
+  CONSOLE_IMPLEMENTATION_FLAGS (mswindows, XDEVIMPF_PIXEL_GEOMETRY);
 
   CONSOLE_HAS_METHOD (msprinter, init_device);
   CONSOLE_HAS_METHOD (msprinter, mark_device);
   CONSOLE_HAS_METHOD (msprinter, delete_device);
   CONSOLE_HAS_METHOD (msprinter, device_system_metrics);
-  CONSOLE_HAS_METHOD (msprinter, device_implementation_flags);
+  CONSOLE_IMPLEMENTATION_FLAGS (msprinter, (XDEVIMPF_PIXEL_GEOMETRY
+					    | XDEVIMPF_IS_A_PRINTER
+					    | XDEVIMPF_NO_AUTO_REDISPLAY
+					    | XDEVIMPF_DONT_PREEMPT_REDISPLAY
+					    | XDEVIMPF_FRAMELESS_OK));
 }
 
 
--- a/src/device.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/device.c	Fri May 18 04:39:44 2001 +0000
@@ -1175,8 +1175,7 @@
   Lisp_Object winsy = domain_device_type (domain);
   struct console_methods *meth = decode_console_type (winsy, ERROR_ME_NOT);
   assert (meth);
-  return (MAYBE_INT_CONTYPE_METH (meth, device_implementation_flags, ())
-	  & XDEVIMPF_PIXEL_GEOMETRY);
+  return CONMETH_IMPL_FLAG (meth, XDEVIMPF_PIXEL_GEOMETRY);
 }
 
 DEFUN ("domain-device-type", Fdomain_device_type, 0, 1, 0, /*
--- a/src/device.h	Thu May 17 13:55:47 2001 +0000
+++ b/src/device.h	Fri May 18 04:39:44 2001 +0000
@@ -48,6 +48,7 @@
 
 #define DEVICE_TYPE_NAME(d) ((d)->devmeths->name)
 #define DEVICE_TYPE(d) ((d)->devmeths->symbol)
+#define DEVICE_IMPL_FLAG(d, f) CONMETH_IMPL_FLAG ((d)->devmeths, (f))
 #define DEVICE_SPECIFIC_FRAME_PROPS(d) \
   ((d)->devmeths->device_specific_frame_props)
 
@@ -273,9 +274,7 @@
 
 #define DEVICE_DISPLAY_P(dev)				\
   (DEVICE_LIVE_P (dev) &&				\
-   (MAYBE_INT_DEVMETH (dev,				\
-		       device_implementation_flags, ())	\
-    & XDEVIMPF_IS_A_PRINTER) ? 0 : 1)
+    !DEVICE_IMPL_FLAG (dev, XDEVIMPF_IS_A_PRINTER))
 
 #define CHECK_DISPLAY_DEVICE(dev)			\
   do {							\
--- a/src/dumper.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/dumper.c	Fri May 18 04:39:44 2001 +0000
@@ -44,7 +44,7 @@
 
 typedef struct
 {
-  void *varaddress;
+  const void *varaddress;
   size_t size;
 } pdump_opaque;
 
@@ -84,7 +84,7 @@
 /* Mark SIZE bytes at non-heap address VARADDRESS for dumping as is,
    without any bit-twiddling. */
 void
-dump_add_opaque (void *varaddress, size_t size)
+dump_add_opaque (const void *varaddress, size_t size)
 {
   pdump_opaque info;
   info.varaddress = varaddress;
@@ -1114,7 +1114,7 @@
   for (i=0; i<header->nb_opaques; i++)
     {
       pdump_opaque info = PDUMP_READ_ALIGNED (p, pdump_opaque);
-      memcpy (info.varaddress, p, info.size);
+      memcpy ((void*)info.varaddress, p, info.size);
       p += info.size;
     }
 
--- a/src/frame.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/frame.c	Fri May 18 04:39:44 2001 +0000
@@ -1304,9 +1304,8 @@
   console = DEVICE_CONSOLE (d);
   con = XCONSOLE (console);
 
-  if (!called_from_delete_device &&
-      !(MAYBE_INT_DEVMETH (d, device_implementation_flags, ())
-	& XDEVIMPF_FRAMELESS_OK))
+  if (!called_from_delete_device
+      && !DEVICE_IMPL_FLAG (d, XDEVIMPF_FRAMELESS_OK))
     {
       /* If we're deleting the only non-minibuffer frame on the
 	 device, delete the device. */
--- a/src/lisp.h	Thu May 17 13:55:47 2001 +0000
+++ b/src/lisp.h	Fri May 18 04:39:44 2001 +0000
@@ -2163,7 +2163,7 @@
 
 /* dump_add_opaque (&var, size) dumps the opaque static structure `var'. */
 #ifdef PDUMP
-void dump_add_opaque (void *, size_t);
+void dump_add_opaque (const void *, size_t);
 #else
 #define dump_add_opaque(varaddr,size) DO_NOTHING
 #endif
--- a/src/redisplay.c	Thu May 17 13:55:47 2001 +0000
+++ b/src/redisplay.c	Fri May 18 04:39:44 2001 +0000
@@ -6276,7 +6276,8 @@
 {
   struct device *d = XDEVICE (f->device);
 
-  if (preemption_check)
+  if (preemption_check
+      && !DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY))
     {
       /* The preemption check itself takes a lot of time,
 	 so normally don't do it here.  We do it if called
@@ -6436,27 +6437,29 @@
 redisplay_device (struct device *d, int automatic)
 {
   Lisp_Object frame, frmcons;
-  int preempted = 0;
   int size_change_failed = 0;
   struct frame *f;
 
-  if (automatic
-      && (MAYBE_INT_DEVMETH (d, device_implementation_flags, ())
-	  & XDEVIMPF_NO_AUTO_REDISPLAY))
+  if (automatic && DEVICE_IMPL_FLAG (d, XDEVIMPF_NO_AUTO_REDISPLAY))
     return 0;
 
   if (DEVICE_STREAM_P (d)) /* nothing to do */
     return 0;
 
   /* It is possible that redisplay has been called before the
-     device is fully initialized.  If so then continue with the
-     next device. */
+     device is fully initialized, or that the console implementation
+     allows frameless devices.  If so then continue with the next
+     device. */
   if (NILP (DEVICE_SELECTED_FRAME (d)))
     return 0;
 
-  REDISPLAY_PREEMPTION_CHECK;
-  if (preempted)
-    return 1;
+  if (!DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY))
+    {
+      int preempted;
+      REDISPLAY_PREEMPTION_CHECK;
+      if (preempted)
+	return 1;
+    }
 
   /* Always do the selected frame first. */
   frame = DEVICE_SELECTED_FRAME (d);
@@ -6470,11 +6473,10 @@
     {
       if (CLASS_REDISPLAY_FLAGS_CHANGEDP(f))
 	{
-	  preempted = redisplay_frame (f, 0);
-	}
-
-      if (preempted)
-	return 1;
+	  int preempted = redisplay_frame (f, 0);
+	  if (preempted)
+	    return 1;
+	}
 
       /* If the frame redisplay did not get preempted, then this flag
          should have gotten set to 0.  It might be possible for that
@@ -6500,12 +6502,11 @@
 	{
 	  if (CLASS_REDISPLAY_FLAGS_CHANGEDP (f))
 	    {
-	      preempted = redisplay_frame (f, 0);
+	      int preempted = redisplay_frame (f, 0);
+	      if (preempted)
+		return 1;
 	    }
 
-	  if (preempted)
-	    return 1;
-
 	  if (f->size_change_pending)
 	    size_change_failed = 1;
 	}