X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/9c8020a8df03dc67a56d7df15664dcf7ace54bf0..6b8aa22a8ac19a46416737a6579cfcb77f647f18:/src/xterm.h diff --git a/src/xterm.h b/src/xterm.h index ad522c1dd7..6bb68cf915 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1,6 +1,6 @@ /* Definitions and headers for communication with X protocol. Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -59,43 +59,6 @@ typedef GtkWidget *xt_or_gtk_widget; /* Bookkeeping to distinguish X versions. */ -/* HAVE_X11R4 is defined if we have the features of X11R4. It should - be defined when we're using X11R5, since X11R5 has the features of - X11R4. If, in the future, we find we need more of these flags - (HAVE_X11R5, for example), code should always be written to test - the most recent flag first: - - #ifdef HAVE_X11R5 - ... - #elif HAVE_X11R4 - ... - #elif HAVE_X11 - ... - #endif - - If you ever find yourself writing a "#ifdef HAVE_FOO" clause that - looks a lot like another one, consider moving the text into a macro - whose definition is configuration-dependent, but whose usage is - universal - like the stuff in systime.h. - - It turns out that we can auto-detect whether we're being compiled - with X11R3 or X11R4 by looking for the flag macros for R4 structure - members that R3 doesn't have. */ -#ifdef PBaseSize -/* AIX 3.1's X is somewhere between X11R3 and X11R4. It has - PBaseSize, but not XWithdrawWindow, XSetWMName, XSetWMNormalHints, - XSetWMIconName. - AIX 3.2 is at least X11R4. */ -#if (!defined AIX) || (defined AIX3_2) -#define HAVE_X11R4 -#endif -#endif - -#ifdef HAVE_X11R5 -/* In case someone has X11R5 on AIX 3.1, - make sure HAVE_X11R4 is defined as well as HAVE_X11R5. */ -#define HAVE_X11R4 -#endif #ifdef HAVE_X_I18N #include @@ -213,6 +176,11 @@ struct x_display_info /* The current capacity of x_font_table. */ int font_table_size; +#ifdef USE_FONT_BACKEND + /* This provides a commonly used Font ID on this display. */ + XFontStruct *font; +#endif + /* Minimum width over all characters in all fonts in font_table. */ int smallest_char_width; @@ -330,6 +298,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. @@ -359,9 +330,6 @@ struct x_display_info /* The gray pixmap. */ Pixmap gray; - /* Cache of images. */ - struct image_cache *image_cache; - #ifdef HAVE_X_I18N /* XIM (X Input method). */ XIM xim; @@ -766,11 +734,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 - /* X-specific scroll bar stuff. */ @@ -794,13 +757,14 @@ struct scroll_bar /* The next and previous in the chain of scroll bars in this frame. */ Lisp_Object next, prev; - /* The X window representing this scroll bar. Since this is a full - 32-bit quantity, we store it split into two 32-bit values. */ - Lisp_Object x_window_low, x_window_high; + /* Fields from `x_window' down will not be traced by the GC. */ + + /* The X window representing this scroll bar. */ + Window x_window; /* The position and size of the scroll bar in pixels, relative to the frame. */ - Lisp_Object top, left, width, height; + int top, left, width, height; /* The starting and ending positions of the handle, relative to the handle area (i.e. zero is the top position, not @@ -813,7 +777,7 @@ struct scroll_bar drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below where they would be normally; the bottom and top are in a different co-ordinate system. */ - Lisp_Object start, end; + int start, end; /* If the scroll bar handle is currently being dragged by the user, this is the number of pixels from the top of the handle to the @@ -821,11 +785,9 @@ struct scroll_bar being dragged, this is Qnil. */ Lisp_Object dragging; -#ifdef USE_TOOLKIT_SCROLL_BARS - /* t if the background of the fringe that is adjacent to a scroll + /* 1 if the background of the fringe that is adjacent to a scroll bar is extended to the gap between the fringe and the bar. */ - Lisp_Object fringe_extended_p; -#endif + unsigned int fringe_extended_p : 1; }; /* The number of elements a vector holding a struct scroll_bar needs. */ @@ -838,36 +800,19 @@ struct scroll_bar #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) -/* Building a 32-bit C integer from two 16-bit lisp integers. */ -#define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low)) - -/* Setting two lisp integers to the low and high words of a 32-bit C int. */ -#define SCROLL_BAR_UNPACK(low, high, int32) \ - (XSETINT ((low), (int32) & 0xffff), \ - XSETINT ((high), ((int32) >> 16) & 0xffff)) - - -/* Extract the X window id of the scroll bar from a struct scroll_bar. */ -#define SCROLL_BAR_X_WINDOW(ptr) \ - ((Window) SCROLL_BAR_PACK ((ptr)->x_window_low, (ptr)->x_window_high)) - -/* Store a window id in a 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. 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)) + XtWindowToWidget (dpy, ptr->x_window) /* Store a widget id in a struct scroll_bar. */ #define SET_SCROLL_BAR_X_WIDGET(ptr, w) \ do { \ Window window = XtWindow (w); \ - SET_SCROLL_BAR_X_WINDOW (ptr, window); \ + ptr->x_window = window; \ } while (0) @@ -1062,7 +1007,6 @@ extern Lisp_Object x_property_data_to_lisp P_ ((struct frame *, /* Defined in xfns.c */ extern struct x_display_info * check_x_display_info P_ ((Lisp_Object frame)); -extern int have_menus_p P_ ((void)); #ifdef USE_GTK extern int xg_set_icon P_ ((struct frame *, Lisp_Object)); @@ -1122,6 +1066,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