Initial revision
[chise/xemacs-chise.git.1] / src / console.h
index ffee406..2ba1b15 100644 (file)
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA.  */
    always tagged to a particular X window (i.e. frame),
    which exists on only one screen; therefore the event won't be
    reported multiple times even if there are multiple devices on
-   the same physical display.  This is an implementation detail
+   the same physical display.  This is an implementational detail
    specific to X consoles (e.g. under NeXTstep or Windows, this
    could be different, and input would come directly from the console).
 */
@@ -60,9 +60,6 @@ enum device_metrics
   DM_slow_device, DM_security
 };
 
-extern const struct struct_description cted_description;
-extern const struct struct_description console_methods_description;
-
 struct console_methods
 {
   CONST char *name;    /* Used by print_console, print_device, print_frame */
@@ -71,7 +68,7 @@ struct console_methods
 
   /* console methods */
   void (*init_console_method) (struct console *, Lisp_Object props);
-  void (*mark_console_method) (struct console *);
+  void (*mark_console_method) (struct console *, void (*)(Lisp_Object));
   int (*initially_selected_for_input_method) (struct console *);
   void (*delete_console_method) (struct console *);
   Lisp_Object (*semi_canonicalize_console_connection_method)
@@ -89,15 +86,10 @@ struct console_methods
   void (*init_device_method) (struct device *, Lisp_Object props);
   void (*finish_init_device_method) (struct device *, Lisp_Object props);
   void (*delete_device_method) (struct device *);
-  void (*mark_device_method) (struct device *);
+  void (*mark_device_method) (struct device *, void (*)(Lisp_Object));
   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);
-  void (*disown_selection_method)(Lisp_Object selection_name, Lisp_Object timeval);
-    Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol,
-                                                Lisp_Object target_type);
-  Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name);
+  unsigned int (*device_implementation_flags_method) ();
 
   /* frame methods */
   Lisp_Object *device_specific_frame_props;
@@ -106,7 +98,7 @@ struct console_methods
   void (*init_frame_3_method) (struct frame *);
   void (*after_init_frame_method) (struct frame *, int first_on_device,
                                   int first_on_console);
-  void (*mark_frame_method) (struct frame *);
+  void (*mark_frame_method) (struct frame *, void (*)(Lisp_Object));
   void (*delete_frame_method) (struct frame *);
   void (*focus_on_frame_method) (struct frame *);
   void (*raise_frame_method) (struct frame *);
@@ -147,9 +139,7 @@ struct console_methods
   int (*eol_cursor_width_method) (void);
   void (*output_vertical_divider_method) (struct window *, int);
   void (*clear_to_window_end_method) (struct window *, int, int);
-  void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index,
-                              int, int, int, int,
-                              Lisp_Object, Lisp_Object, Lisp_Object);
+  void (*clear_region_method) (Lisp_Object, face_index, int, int, int, int);
   void (*clear_frame_method) (struct frame *);
   void (*output_begin_method) (struct device *);
   void (*output_end_method) (struct device *);
@@ -158,23 +148,14 @@ struct console_methods
                            int duration);
   void (*frame_redraw_cursor_method) (struct frame *f);
   void (*set_final_cursor_coords_method) (struct frame *, int, int);
-  void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int,
-                            int, enum edge_style);
-  void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance,
-                               struct display_box *db, struct display_glyph_area *dga,
-                               face_index findex, int cursor_start, int cursor_width,
-                               int cursor_height, int offset_bitmap);
-  void (*output_string_method) (struct window *w, struct display_line *dl,
-                               Emchar_dynarr *buf, int xpos, int xoffset,
-                               int start_pixpos, int width, face_index findex,
-                               int cursor, int cursor_start, int cursor_width,
-                               int cursor_height);
+
   /* color methods */
   int (*initialize_color_instance_method) (struct Lisp_Color_Instance *,
                                           Lisp_Object name,
                                           Lisp_Object device,
                                           Error_behavior errb);
-  void (*mark_color_instance_method) (struct Lisp_Color_Instance *);
+  void (*mark_color_instance_method) (struct Lisp_Color_Instance *,
+                                     void (*)(Lisp_Object));
   void (*print_color_instance_method) (struct Lisp_Color_Instance *,
                                       Lisp_Object printcharfun,
                                       int escapeflag);
@@ -193,7 +174,8 @@ struct console_methods
                                          Lisp_Object name,
                                          Lisp_Object device,
                                          Error_behavior errb);
-  void (*mark_font_instance_method) (struct Lisp_Font_Instance *);
+  void (*mark_font_instance_method) (struct Lisp_Font_Instance *,
+                                    void (*)(Lisp_Object));
   void (*print_font_instance_method) (struct Lisp_Font_Instance *,
                                      Lisp_Object printcharfun,
                                      int escapeflag);
@@ -214,16 +196,12 @@ struct console_methods
                                           Bytecount length);
 
   /* image methods */
-  void (*mark_image_instance_method) (struct Lisp_Image_Instance *);
+  void (*mark_image_instance_method) (struct Lisp_Image_Instance *,
+                                     void (*)(Lisp_Object));
   void (*print_image_instance_method) (struct Lisp_Image_Instance *,
                                       Lisp_Object printcharfun,
                                       int escapeflag);
   void (*finalize_image_instance_method) (struct Lisp_Image_Instance *);
-  void (*unmap_subwindow_method) (struct Lisp_Image_Instance *);
-  void (*map_subwindow_method) (struct Lisp_Image_Instance *, int x, int y,
-                               struct display_glyph_area* dga);
-  void (*resize_subwindow_method) (struct Lisp_Image_Instance *, int w, int h);
-  void (*update_subwindow_method) (struct Lisp_Image_Instance *);
   int (*image_instance_equal_method) (struct Lisp_Image_Instance *,
                                      struct Lisp_Image_Instance *,
                                      int depth);
@@ -231,14 +209,29 @@ struct console_methods
                                               int depth);
   void (*init_image_instance_from_eimage_method) (struct Lisp_Image_Instance *ii,
                                                  int width, int height,
-                                                 int slices,
-                                                 unsigned char *eimage,
+                                                 unsigned char *eimage, 
                                                  int dest_mask,
                                                  Lisp_Object instantiator,
                                                  Lisp_Object domain);
   Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method);
   int (*colorize_image_instance_method) (Lisp_Object image_instance,
                                         Lisp_Object fg, Lisp_Object bg);
+#ifdef HAVE_XPM
+    /* which is more tacky - this or #defines in glyphs.c? */
+  void (*xpm_instantiate_method)(Lisp_Object image_instance, 
+                                Lisp_Object instantiator,
+                                Lisp_Object pointer_fg, 
+                                Lisp_Object pointer_bg,
+                                int dest_mask, Lisp_Object domain);
+#endif
+#ifdef HAVE_WINDOW_SYSTEM
+    /* which is more tacky - this or #defines in glyphs.c? */
+  void (*xbm_instantiate_method)(Lisp_Object image_instance, 
+                                Lisp_Object instantiator,
+                                Lisp_Object pointer_fg, 
+                                Lisp_Object pointer_bg,
+                                int dest_mask, Lisp_Object domain);
+#endif
   Lisp_Object image_conversion_list;
 
 #ifdef HAVE_TOOLBARS
@@ -304,9 +297,9 @@ struct console_methods
 
 /* Call a void-returning console method, if it exists */
 #define MAYBE_CONTYPE_METH(meth, m, args) do {                 \
-  struct console_methods *maybe_contype_meth_meth = (meth);    \
-  if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m))         \
-    CONTYPE_METH (maybe_contype_meth_meth, m, args);           \
+  struct console_methods *_maybe_contype_meth_meth = (meth);   \
+  if (HAS_CONTYPE_METH_P (_maybe_contype_meth_meth, m))                \
+    CONTYPE_METH (_maybe_contype_meth_meth, m, args);          \
 } while (0)
 
 /* Call a console method, if it exists; otherwise return
@@ -357,19 +350,12 @@ struct console_methods * type##_console_methods
     type##_console_methods = xnew_and_zero (struct console_methods);   \
     type##_console_methods->name = obj_name;                           \
     type##_console_methods->symbol = Q##type;                          \
-    defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym);    \
+    defsymbol (&type##_console_methods->predicate_symbol, pred_sym);   \
     add_entry_to_console_type_list (Q##type, type##_console_methods);  \
     type##_console_methods->image_conversion_list = Qnil;              \
-    staticpro_nodump (&type##_console_methods->image_conversion_list); \
-    dumpstruct (&type##_console_methods, &console_methods_description);        \
+    staticpro (&type##_console_methods->image_conversion_list);                \
 } while (0)
 
-#define REINITIALIZE_CONSOLE_TYPE(type) do {   \
-    staticpro_nodump (&type##_console_methods->predicate_symbol);      \
-    staticpro_nodump (&type##_console_methods->image_conversion_list); \
-} while (0)
-
-
 /* Declare that console-type TYPE has method M; used in
    initialization routines */
 #define CONSOLE_HAS_METHOD(type, m) \
@@ -420,6 +406,7 @@ DECLARE_LRECORD (console, struct console);
 #define XCONSOLE(x) XRECORD (x, console, struct console)
 #define XSETCONSOLE(x, p) XSETRECORD (x, p, console)
 #define CONSOLEP(x) RECORDP (x, console)
+#define GC_CONSOLEP(x) GC_RECORDP (x, console)
 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console)
 #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console)
 
@@ -544,7 +531,7 @@ int valid_console_type_p (Lisp_Object type);
 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device)
 #define CONSOLE_SELECTED_FRAME(con) \
   DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device))
-#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame)
+#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->_last_nonminibuf_frame)
 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char)
 
 #define CDFW_CONSOLE(obj)                              \