]> code.delx.au - gnu-emacs/blobdiff - src/xterm.h
Add 2010 to copyright years.
[gnu-emacs] / src / xterm.h
index 246a10ee6717922dfdec15328ebd437ddc02f693..a766f863c4dd5dde90483d9c8a3dc8d2747b5805 100644 (file)
@@ -1,13 +1,13 @@
 /* Definitions and headers for communication with X protocol.
    Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+                 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <X11/Xlib.h>
 #include <X11/cursorfont.h>
@@ -69,7 +67,7 @@ typedef GtkWidget *xt_or_gtk_widget;
 #define WHITE_PIX_DEFAULT(f) WhitePixel (FRAME_X_DISPLAY (f), \
                                         XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
 
-#define FONT_WIDTH(f)  ((f)->max_bounds.width)
+#define FONT_WIDTH(f)  ((f)->max_width)
 #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
 #define FONT_BASE(f)    ((f)->ascent)
 #define FONT_DESCENT(f) ((f)->descent)
@@ -90,6 +88,15 @@ typedef GtkWidget *xt_or_gtk_widget;
    | EnterWindowMask           \
    | VisibilityChangeMask)
 
+#ifdef HAVE_X11R6_XIM
+/* Data structure passed to xim_instantiate_callback.  */
+struct xim_inst_t
+{
+  struct x_display_info *dpyinfo;
+  char *resource_name;
+};
+#endif /* HAVE_X11R6_XIM */
+
 /* Structure recording X pixmap and reference count.
    If REFCOUNT is 0 then this record is free to be reused.  */
 
@@ -143,9 +150,6 @@ struct x_display_info
   /* Number of planes on this screen.  */
   int n_planes;
 
-  /* Dimensions of this screen.  */
-  int height, width;
-
   /* Mask of things that cause the mouse to be grabbed.  */
   int grabbed;
 
@@ -162,6 +166,9 @@ struct x_display_info
   /* The cursor to use for vertical scroll bars.  */
   Cursor vertical_scroll_bar_cursor;
 
+  /* The invisible cursor used for pointer blanking.  */
+  Cursor invisible_cursor;
+
 #ifdef USE_GTK
   /* The GDK cursor for scroll bars and popup menus.  */
   GdkCursor *xg_cursor;
@@ -170,12 +177,6 @@ struct x_display_info
   /* X Resource data base */
   XrmDatabase xrdb;
 
-  /* A table of all the fonts we have already loaded.  */
-  struct font_info *font_table;
-
-  /* The current capacity of x_font_table.  */
-  int font_table_size;
-
   /* Minimum width over all characters in all fonts in font_table.  */
   int smallest_char_width;
 
@@ -218,9 +219,7 @@ struct x_display_info
 
   char *x_id_name;
 
-  /* The number of fonts actually stored in x_font_table.
-     font_table[n] is used and valid if 0 <= n < n_fonts.  0 <=
-     n_fonts <= font_table_size and font_table[i].name != 0.  */
+  /* The number of fonts opened for this display.  */
   int n_fonts;
 
   /* Pointer to bitmap records.  */
@@ -293,6 +292,9 @@ struct x_display_info
   /* Atom used in toolkit scroll bar client messages.  */
   Atom Xatom_Scrollbar;
 
+  /* Atom used in XEmbed client messages.  */
+  Atom Xatom_XEMBED;
   int cut_buffers_initialized; /* Whether we're sure they all exist */
 
   /* The frame (if any) which has the X window that has keyboard focus.
@@ -315,20 +317,14 @@ struct x_display_info
      minibuffer.  */
   struct frame *x_highlight_frame;
 
-  /* The null pixel used for filling a character background with
-     background color of a gc.  */
-  Pixmap null_pixel;
-
   /* The gray pixmap.  */
   Pixmap gray;
 
-  /* Cache of images.  */
-  struct image_cache *image_cache;
-
 #ifdef HAVE_X_I18N
   /* XIM (X Input method).  */
   XIM xim;
   XIMStyles *xim_styles;
+  struct xim_inst_t *xim_callback_data;
 #endif
 
   /* If non-null, a cache of the colors in the color map.  Don't
@@ -359,10 +355,21 @@ struct x_display_info
   size_t x_dnd_atoms_size;
   size_t x_dnd_atoms_length;
 
-  /* Extended window manager hints, Atoms supported by the window manager  */
+  /* Extended window manager hints, Atoms supported by the window manager and
+     atoms for settig the window type.  */
   Atom *net_supported_atoms;
   int nr_net_supported_atoms;
   Window net_supported_window;
+  Atom Xatom_net_window_type, Xatom_net_window_type_tooltip;
+
+  /* Atoms dealing with maximization and fullscreen */
+  Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom,
+    Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
+    Xatom_net_wm_state_sticky;
+
+  /* XSettings atoms and windows.  */
+  Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;
+  Window xsettings_window;
 };
 
 #ifdef HAVE_X_I18N
@@ -375,10 +382,13 @@ extern void check_x P_ ((void));
 
 extern struct frame *x_window_to_frame P_ ((struct x_display_info *, int));
 
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
 extern struct frame *x_any_window_to_frame P_ ((struct x_display_info *, int));
-extern struct frame *x_non_menubar_window_to_frame P_ ((struct x_display_info *, int));
+extern struct frame *x_menubar_window_to_frame P_ ((struct x_display_info *, int));
 extern struct frame *x_top_window_to_frame P_ ((struct x_display_info *, int));
+
+#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
+#define x_any_window_to_frame x_window_to_frame
+#define x_top_window_to_frame x_window_to_frame
 #endif
 
 /* This is a chain of structures for all the X displays currently in use.  */
@@ -395,17 +405,16 @@ extern Lisp_Object Vx_pixel_size_width_font_regexp;
 
 extern struct x_display_info *x_display_info_for_display P_ ((Display *));
 extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object));
+extern void x_set_frame_alpha P_ ((struct frame *));
 
 extern struct x_display_info *x_term_init P_ ((Lisp_Object, char *, char *));
 extern int x_display_ok  P_ ((const char *));
 
-extern Lisp_Object x_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
 extern void select_visual P_ ((struct x_display_info *));
-extern struct font_info *x_get_font_info P_ ((struct frame *f, int));
-extern struct font_info *x_load_font P_ ((struct frame *, char *, int));
-extern struct font_info *x_query_font P_ ((struct frame *, char *));
-extern void x_find_ccl_program P_ ((struct font_info *));
+
 \f
+struct font;
+
 /* Each X frame object points to its own struct x_output object
    in the output_data.x field.  The x_output structure contains
    the information that is specific to X windows.  */
@@ -484,7 +493,7 @@ struct x_output
   int icon_bitmap;
 
   /* Default ASCII font of this frame.  */
-  XFontStruct *font;
+  struct font *font;
 
   /* The baseline offset of the default ASCII font.  */
   int baseline_offset;
@@ -525,6 +534,7 @@ struct x_output
   Cursor hand_cursor;
   Cursor hourglass_cursor;
   Cursor horizontal_drag_cursor;
+  Cursor current_cursor;
 
   /* Window whose cursor is hourglass_cursor.  This window is temporarily
      mapped to display an hourglass cursor.  */
@@ -718,11 +728,6 @@ enum
 
 #define FRAME_SMALLEST_FONT_HEIGHT(F) \
      FRAME_X_DISPLAY_INFO(F)->smallest_font_height
-
-/* Return a pointer to the image cache of frame F.  */
-
-#define FRAME_X_IMAGE_CACHE(F) FRAME_X_DISPLAY_INFO ((F))->image_cache
-
 \f
 /* X-specific scroll bar stuff.  */
 
@@ -970,6 +975,11 @@ extern void set_vertical_scroll_bar P_ ((struct window *));
 extern int x_dispatch_event P_ ((XEvent *, Display *));
 extern unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
                                                unsigned));
+extern int x_display_pixel_height P_ ((struct x_display_info *));
+extern int x_display_pixel_width P_ ((struct x_display_info *));
+
+extern void x_set_sticky P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void x_wait_for_event P_ ((struct frame *, int));
 
 /* Defined in xselect.c */
 
@@ -1055,6 +1065,66 @@ extern int x_session_have_connection P_ ((void));
 extern void x_session_close P_ ((void));
 #endif
 
+/* XEmbed implementation.  */
+
+#define XEMBED_VERSION 0
+
+enum xembed_info
+  {
+    XEMBED_MAPPED = 1 << 0
+  };
+
+enum xembed_message
+  {
+    XEMBED_EMBEDDED_NOTIFY        = 0,
+    XEMBED_WINDOW_ACTIVATE        = 1,
+    XEMBED_WINDOW_DEACTIVATE      = 2,
+    XEMBED_REQUEST_FOCUS          = 3,
+    XEMBED_FOCUS_IN               = 4,
+    XEMBED_FOCUS_OUT              = 5,
+    XEMBED_FOCUS_NEXT             = 6,
+    XEMBED_FOCUS_PREV             = 7,
+
+    XEMBED_MODALITY_ON            = 10,
+    XEMBED_MODALITY_OFF           = 11,
+    XEMBED_REGISTER_ACCELERATOR   = 12,
+    XEMBED_UNREGISTER_ACCELERATOR = 13,
+    XEMBED_ACTIVATE_ACCELERATOR   = 14
+  };
+
+enum xembed_focus
+  {
+    XEMBED_FOCUS_CURRENT = 0,
+    XEMBED_FOCUS_FIRST   = 1,
+    XEMBED_FOCUS_LAST    = 2
+  };
+
+enum xembed_modifier
+  {
+    XEMBED_MODIFIER_SHIFT   = 1 << 0,
+    XEMBED_MODIFIER_CONTROL = 1 << 1,
+    XEMBED_MODIFIER_ALT     = 1 << 2,
+    XEMBED_MODIFIER_SUPER   = 1 << 3,
+    XEMBED_MODIFIER_HYPER   = 1 << 4
+  };
+
+enum xembed_accelerator
+  {
+    XEMBED_ACCELERATOR_OVERLOADED = 1 << 0
+  };
+
+/* Defined in xterm.c */
+
+extern void xembed_set_info P_ ((struct frame *f, enum xembed_info flags));
+extern void xembed_send_message P_ ((struct frame *f, Time time,
+                                    enum xembed_message message,
+                                    long detail, long data1, long data2));
+
+/* Is the frame embedded into another application? */
+
+#define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0)
+
+
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0