XEmacs 21.4.5 "Civil Service".
[chise/xemacs-chise.git.1] / src / console.h
index 6e3118b..d1f748f 100644 (file)
@@ -63,11 +63,34 @@ enum device_metrics
 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);
@@ -91,13 +114,22 @@ struct console_methods
   void (*delete_device_method) (struct device *);
   void (*mark_device_method) (struct device *);
   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);
+  Lisp_Object (*device_system_metrics_method) (struct device *,
+                                               enum device_metrics);
+  Lisp_Object (*own_selection_method)(Lisp_Object selection_name,
+                                      Lisp_Object selection_value,
+                                      Lisp_Object how_to_add,
+                                      Lisp_Object selection_type,
+                         int owned_p);
+  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,
+                                           Lisp_Object selection_type);
+  Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name);
+  Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name);
+  Lisp_Object (*selection_data_type_name_method)(Lisp_Object type);
 
   /* frame methods */
   Lisp_Object *device_specific_frame_props;
@@ -111,6 +143,8 @@ struct console_methods
   void (*focus_on_frame_method) (struct frame *);
   void (*raise_frame_method) (struct frame *);
   void (*lower_frame_method) (struct frame *);
+  void (*enable_frame_method) (struct frame *);
+  void (*disable_frame_method) (struct frame *);
   int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame,
                                    int *x, int *y);
   void (*set_mouse_position_method) (struct window *w, int x, int y);
@@ -225,8 +259,8 @@ struct console_methods
   void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y,
                                struct display_glyph_area* dga);
   void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h);
-  void (*update_subwindow_method) (Lisp_Image_Instance *);
-  void (*update_widget_method) (Lisp_Image_Instance *);
+  void (*redisplay_subwindow_method) (Lisp_Image_Instance *);
+  void (*redisplay_widget_method) (Lisp_Image_Instance *);
   int (*image_instance_equal_method) (Lisp_Image_Instance *,
                                      Lisp_Image_Instance *,
                                      int depth);
@@ -285,30 +319,18 @@ struct console_methods
 
 #ifdef HAVE_DIALOGS
   /* dialog methods */
-  void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc);
+  Lisp_Object (*make_dialog_box_internal_method) (struct frame *,
+                                                 Lisp_Object type,
+                                                 Lisp_Object keys);
 #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 *********/
 
@@ -374,7 +396,7 @@ struct console_methods * type##_console_methods
     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);        \
+    dump_add_root_struct_ptr (&type##_console_methods, &console_methods_description);  \
 } while (0)
 
 #define REINITIALIZE_CONSOLE_TYPE(type) do {   \
@@ -393,6 +415,10 @@ struct console_methods * type##_console_methods
 #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;
@@ -489,6 +515,12 @@ error_check_console_type (struct console *con, Lisp_Object sym)
    too many places where the abstraction is broken.  Need to
    fix. */
 
+#ifdef HAVE_GTK
+#define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk)
+#else
+#define CONSOLE_TYPESYM_GTK_P(typesym) 0
+#endif
+
 #ifdef HAVE_X_WINDOWS
 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx)
 #else
@@ -507,12 +539,16 @@ error_check_console_type (struct console *con, Lisp_Object sym)
 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream)
 
 #define CONSOLE_TYPESYM_WIN_P(typesym) \
-  (CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym))
+  (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym))
 
 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con))
 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x)
 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x)
 
+#define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con))
+#define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk)
+#define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk)
+
 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con))
 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty)
 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty)