(read_char): When an event from unread-command-events
[bpt/emacs.git] / src / xterm.h
index 6380af5..a1f0e38 100644 (file)
@@ -1,5 +1,6 @@
 /* Definitions and headers for communication with X protocol.
-   Copyright (C) 1989, 1993, 1994, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -339,6 +340,11 @@ struct x_display_info
   XIM xim;
   XIMStyles *xim_styles;
 #endif
+
+  /* If non-null, a cache of the colors in the color map.  Don't
+     use this directly, call x_color_cells instead.  */
+  XColor *color_cells;
+  int ncolor_cells;
 };
 
 /* This checks to make sure we have a display.  */
@@ -482,6 +488,7 @@ struct x_output
   Cursor modeline_cursor;
   Cursor cross_cursor;
   Cursor busy_cursor;
+  Cursor horizontal_drag_cursor;
 
   /* Window whose cursor is busy_cursor.  This window is temporarily
      mapped to display a busy-cursor.  */
@@ -685,8 +692,8 @@ struct x_output
    We use struct scroll_bar as a template for accessing fields of the
    vector.  */
 
-struct scroll_bar {
-
+struct scroll_bar
+{
   /* These fields are shared by all vectors.  */
   EMACS_INT size_from_Lisp_Vector_struct;
   struct Lisp_Vector *next_from_Lisp_Vector_struct;
@@ -701,9 +708,6 @@ struct scroll_bar {
      32-bit quantity, we store it split into two 32-bit values.  */
   Lisp_Object x_window_low, x_window_high;
 
-  /* Same as above for the widget.  */
-  Lisp_Object x_widget_low, x_widget_high;
-
   /* The position and size of the scroll bar in pixels, relative to the
      frame.  */
   Lisp_Object top, left, width, height;
@@ -755,13 +759,20 @@ struct scroll_bar {
 #define SET_SCROLL_BAR_X_WINDOW(ptr, id) \
   (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id))
 
-/* Extract the X widget of the scroll bar from a struct scroll_bar.  */
-#define SCROLL_BAR_X_WIDGET(ptr) \
-  ((Widget) SCROLL_BAR_PACK ((ptr)->x_widget_low, (ptr)->x_widget_high))
+/* Extract the X widget of the scroll bar from a struct scroll_bar.
+   XtWindowToWidget should be fast enough since Xt uses a hash table
+   to map windows to widgets.  */
+
+#define SCROLL_BAR_X_WIDGET(dpy, ptr) \
+  XtWindowToWidget (dpy, SCROLL_BAR_X_WINDOW (ptr))
 
 /* Store a widget id in a struct scroll_bar.  */
-#define SET_SCROLL_BAR_X_WIDGET(ptr, w) \
-  (SCROLL_BAR_UNPACK ((ptr)->x_widget_low, (ptr)->x_widget_high, (int) w))
+
+#define SET_SCROLL_BAR_X_WIDGET(ptr, w)                \
+  do {                                         \
+    Window window = XtWindow (w);              \
+    SET_SCROLL_BAR_X_WINDOW (ptr, window);     \
+} while (0)
 
 
 /* Return the inside width of a vertical scroll bar, given the outside
@@ -913,6 +924,7 @@ struct frame *check_x_frame P_ ((Lisp_Object));
 EXFUN (Fx_display_color_p, 1);
 EXFUN (Fx_display_grayscale_p, 1);
 int image_ascent P_ ((struct image *, struct face *));
+extern void x_free_gcs P_ ((struct frame *));
 
 /* From xrdb.c.  */
 
@@ -965,6 +977,7 @@ extern void x_lower_frame P_ ((struct frame *));
 extern void x_make_frame_visible P_ ((struct frame *));
 extern void x_make_frame_invisible P_ ((struct frame *));
 extern void x_iconify_frame P_ ((struct frame *));
+extern void x_free_frame_resources P_ ((struct frame *));
 extern void x_destroy_window P_ ((struct frame *));
 extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
 extern void x_wm_set_window_state P_ ((struct frame *, int));
@@ -978,6 +991,9 @@ extern unsigned long x_copy_color P_ ((struct frame *, unsigned long));
 #ifdef USE_X_TOOLKIT
 extern XtAppContext Xt_app_con;
 #endif
+extern void x_query_colors P_ ((struct frame *f, XColor *, int));
+extern void x_query_color P_ ((struct frame *f, XColor *));
+extern void x_clear_area P_ ((Display *, Window, int, int, int, int, int));
 
 /* Defined in xselect.c */
 
@@ -1004,6 +1020,8 @@ extern void x_report_frame_params P_ ((struct frame *, Lisp_Object *));
 extern int defined_color P_ ((struct frame *, char *, XColor *, int));
 extern void x_set_border_pixel P_ ((struct frame *, int));
 extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object,
+                                         int *, int *));
 extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void create_frame_xic P_ ((struct frame *));
 extern void destroy_frame_xic P_ ((struct frame *));