* gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size
[bpt/emacs.git] / src / w32term.h
index 8f7411c..6626f62 100644 (file)
@@ -63,17 +63,10 @@ extern BOOL bUseDflt;
 
 extern struct frame *x_window_to_frame ();
 
-enum text_cursor_kinds {
-  NO_CURSOR = -1,
-  FILLED_BOX_CURSOR,
-  HOLLOW_BOX_CURSOR,
-  BAR_CURSOR
-};
-
 /* Structure recording bitmaps and reference count.
    If REFCOUNT is 0 then this record is free to be reused.  */
 
-struct w32_bitmap_record 
+struct w32_bitmap_record
 {
   Pixmap pixmap;
   char *file;
@@ -141,6 +134,9 @@ struct w32_display_info
   /* The cursor to use for vertical scroll bars.  */
   Cursor vertical_scroll_bar_cursor;
 
+  /* Resource data base */
+  char *xrdb;
+
   /* color palette information.  */
   int has_palette;
   struct w32_palette_entry * color_list;
@@ -195,6 +191,9 @@ struct w32_display_info
   /* Nonzero means defer mouse-motion highlighting.  */
   int mouse_face_defer;
 
+  /* Nonzero means that the mouse highlight should not be shown.  */
+  int mouse_face_hidden;
+
   int mouse_face_image_state;
 
   char *w32_id_name;
@@ -231,7 +230,7 @@ struct w32_display_info
      event).  It points to the focus frame's selected window's
      frame.  It differs from w32_focus_frame when we're using a global
      minibuffer.  */
-  struct frame *w32_highlight_frame;
+  struct frame *x_highlight_frame;
 
   /* Cache of images.  */
   struct image_cache *image_cache;
@@ -341,7 +340,7 @@ struct w32_output
   /* Foreground color for scroll bars.  A value of -1 means use the
      default (black for non-toolkit scroll bars).  */
   COLORREF scroll_bar_foreground_pixel;
-  
+
   /* Background color for scroll bars.  A value of -1 means use the
      default (background color of the frame for non-toolkit scroll
      bars).  */
@@ -351,31 +350,20 @@ struct w32_output
   Cursor text_cursor;
   Cursor nontext_cursor;
   Cursor modeline_cursor;
-  Cursor cross_cursor;
+  Cursor hand_cursor;
   Cursor hourglass_cursor;
   Cursor horizontal_drag_cursor;
 
   /* Window whose cursor is hourglass_cursor.  This window is
      temporarily mapped to display an hourglass cursor.  */
   Window hourglass_window;
-  
+
   /* Non-zero means hourglass cursor is currently displayed.  */
   unsigned hourglass_p : 1;
 
   /* Flag to set when the window needs to be completely repainted.  */
   int needs_exposure;
 
-  /* What kind of text cursor is drawn in this window right now?
-     (If there is no cursor (phys_cursor_x < 0), then this means nothing.)  */
-  enum text_cursor_kinds current_cursor;
-
-  /* What kind of text cursor should we draw in the future?
-     This should always be filled_box_cursor or bar_cursor.  */
-  enum text_cursor_kinds desired_cursor;
-
-  /* Width of bar cursor (if we are using that).  */
-  int cursor_width;
-
   DWORD dwStyle;
 
   /* The size of the extra width currently allotted for vertical
@@ -407,6 +395,9 @@ struct w32_output
   /* Nonzero means menubar is currently active.  */
   char menubar_active;
 
+  /* Nonzero means a menu command is being processed.  */
+  char menu_command_in_progress;
+
   /* Nonzero means menubar is about to become active, but should be
      brought up to date first.  */
   volatile char pending_menu_activation;
@@ -423,12 +414,38 @@ struct w32_output
   /* The background for which the above relief GCs were set up.
      They are changed only when a different background is involved.  */
   unsigned long relief_background;
+
+  /* See enum below */
+  int want_fullscreen;
+
+  /* This many pixels are the difference between the outer window (i.e. the
+     left of the window manager decoration) and FRAME_W32_WINDOW. */
+  int x_pixels_diff;
+
+  /* This many pixels are the difference between the outer window (i.e. the
+     top of the window manager titlebar) and FRAME_W32_WINDOW. */
+  int y_pixels_diff;
 };
 
 extern struct w32_output w32term_display;
 
+enum
+{
+  /* Values used as a bit mask, BOTH == WIDTH | HEIGHT.  */
+  FULLSCREEN_NONE       = 0,
+  FULLSCREEN_WIDTH      = 1,
+  FULLSCREEN_HEIGHT     = 2,
+  FULLSCREEN_BOTH       = 3,
+  FULLSCREEN_WAIT       = 4,
+  FULLSCREEN_MOVE_WAIT  = 8,
+};
+
+/* Return the X output data for frame F.  */
+#define FRAME_X_OUTPUT(f) ((f)->output_data.w32)
+
 /* Return the window associated with the frame F.  */
 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
+#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc)
 
 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
@@ -445,6 +462,9 @@ extern struct w32_output w32term_display;
 #define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info)
 #define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info)
 
+/* This is the `Display *' which frame F is on.  */
+#define FRAME_X_DISPLAY(f) (0)
+
 /* This is the 'font_info *' which frame F has.  */
 #define FRAME_W32_FONT_TABLE(f) (FRAME_W32_DISPLAY_INFO (f)->font_table)
 
@@ -452,8 +472,6 @@ extern struct w32_output w32term_display;
 #define PIXEL_WIDTH(f) ((f)->output_data.w32->pixel_width)
 #define PIXEL_HEIGHT(f) ((f)->output_data.w32->pixel_height)
 
-#define FRAME_DESIRED_CURSOR(f) ((f)->output_data.w32->desired_cursor)
-
 /* Value is the smallest width of any character in any font on frame F.  */
 
 #define FRAME_SMALLEST_CHAR_WIDTH(F) \
@@ -586,7 +604,7 @@ struct scroll_bar {
 
 /* Return the length of the rectangle within which the top of the
    handle must stay.  This isn't equivalent to the inside height,
-   because the scroll bar handle has a minimum height.  
+   because the scroll bar handle has a minimum height.
 
    This is the real range of motion for the scroll bar, so when we're
    scaling buffer positions to scroll bar positions, we use this, not
@@ -649,7 +667,7 @@ struct scroll_bar {
    + (f)->output_data.w32->internal_border_width)
 
 
-/* Return the row/column (zero-based) of the character cell containing 
+/* Return the row/column (zero-based) of the character cell containing
    the pixel on FRAME at ROW/COL.  */
 #define PIXEL_TO_CHAR_ROW(f, row) \
   (((row) - (f)->output_data.w32->internal_border_width) \
@@ -692,6 +710,9 @@ w32_fill_area (f,hdc,f->output_data.x->background_pixel,px,py,nx,ny)
 extern struct font_info *w32_load_font ();
 extern void w32_unload_font ();
 
+extern void x_fullscreen_adjust P_ ((struct frame *f, int *, int *,
+                                    int *, int *));
+
 /* Define for earlier versions of Visual C */
 #ifndef WM_MOUSEWHEEL
 #define WM_MOUSEWHEEL                 (WM_MOUSELAST + 1)
@@ -724,13 +745,14 @@ extern void w32_unload_font ();
 #define WM_EMACS_DESTROY_CARET         (WM_EMACS_START + 16)
 #define WM_EMACS_SHOW_CARET            (WM_EMACS_START + 17)
 #define WM_EMACS_HIDE_CARET            (WM_EMACS_START + 18)
-#define WM_EMACS_END                   (WM_EMACS_START + 19)
-
-#define WND_FONTWIDTH_INDEX    (0) 
-#define WND_LINEHEIGHT_INDEX   (4) 
-#define WND_BORDER_INDEX       (8) 
-#define WND_SCROLLBAR_INDEX    (12) 
-#define WND_BACKGROUND_INDEX   (16) 
+#define WM_EMACS_SETCURSOR             (WM_EMACS_START + 19)
+#define WM_EMACS_END                   (WM_EMACS_START + 20)
+
+#define WND_FONTWIDTH_INDEX    (0)
+#define WND_LINEHEIGHT_INDEX   (4)
+#define WND_BORDER_INDEX       (8)
+#define WND_SCROLLBAR_INDEX    (12)
+#define WND_BACKGROUND_INDEX   (16)
 #define WND_LAST_INDEX         (20)
 
 #define WND_EXTRA_BYTES     (WND_LAST_INDEX)
@@ -818,7 +840,7 @@ extern BOOL parse_button ();
 #define WM_MOUSELEAVE 0x02A3
 #define TME_LEAVE 0x00000002;
 
-typedef struct tagTRACKMOUSEEVENT 
+typedef struct tagTRACKMOUSEEVENT
 {
   DWORD cbSize;
   DWORD dwFlags;
@@ -835,3 +857,12 @@ struct frame * check_x_frame (Lisp_Object);
 EXFUN (Fx_display_color_p, 1);
 EXFUN (Fx_display_grayscale_p, 1);
 int image_ascent P_ ((struct image *, struct face *));
+
+#define FONT_TYPE_FOR_UNIBYTE(font, ch)                        \
+  ((font)->bdf ? BDF_1D_FONT : ANSI_FONT)
+
+#define FONT_TYPE_FOR_MULTIBYTE(font, ch)              \
+  (!(font)->bdf                                                \
+   ? UNICODE_FONT                                      \
+   : ((CHARSET_DIMENSION (CHAR_CHARSET ((ch))) == 1)   \
+      ? BDF_1D_FONT : BDF_2D_FONT))