]> code.delx.au - gnu-emacs/blobdiff - src/w32term.h
Fix input methods for GTK.
[gnu-emacs] / src / w32term.h
index 509a9efb4f8517ec894c3cecc7385d474d6b6163..bc99e0f36f2bdc64b14aa6bd30de07049fa22641 100644 (file)
@@ -63,13 +63,6 @@ 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.  */
 
@@ -195,6 +188,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 +227,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;
@@ -354,6 +350,7 @@ struct w32_output
   Cursor cross_cursor;
   Cursor hourglass_cursor;
   Cursor horizontal_drag_cursor;
+  Cursor hand_cursor;
 
   /* Window whose cursor is hourglass_cursor.  This window is
      temporarily mapped to display an hourglass cursor.  */
@@ -365,17 +362,6 @@ struct w32_output
   /* 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
@@ -385,7 +371,8 @@ struct w32_output
   /* The extra width currently allotted for the areas in which
      truncation marks, continuation marks, and overlay arrows are
      displayed.  */
-  int flags_areas_extra;
+  int left_fringe_width, right_fringe_width;
+  int fringe_cols, fringes_extra;
 
   /* This is the gravity value for the specified window position.  */
   int win_gravity;
@@ -406,6 +393,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;
@@ -422,10 +412,32 @@ 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 window associated with the frame F.  */
 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
 
@@ -451,8 +463,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) \
@@ -468,38 +478,22 @@ extern struct w32_output w32term_display;
 #define FRAME_X_IMAGE_CACHE(F) FRAME_W32_DISPLAY_INFO ((F))->image_cache
 
 \f
-/* Pixel width of the bitmaps drawn to indicate truncation,
-   continuation etc.  */
-
-#define FRAME_FLAGS_BITMAP_WIDTH(f)    8
-#define FRAME_FLAGS_BITMAP_HEIGHT(f)   8
-
-/* Total width of areas reserved for drawing truncation bitmaps,
+/* Total width of fringes reserved for drawing truncation bitmaps,
    continuation bitmaps and alike.  The width is in canonical char
    units of the frame.  This must currently be the case because window
    sizes aren't pixel values.  If it weren't the case, we wouldn't be
    able to split windows horizontally nicely.  */
 
-#define FRAME_X_FLAGS_AREA_COLS(F)                             \
-     ((2 * FRAME_FLAGS_BITMAP_WIDTH ((F)) + CANON_X_UNIT ((F)) - 1)    \
-      / CANON_X_UNIT ((F)))
-
-/* Total width of flags areas in pixels.  */
-
-#define FRAME_X_FLAGS_AREA_WIDTH(F) \
-     (FRAME_X_FLAGS_AREA_COLS ((F)) * CANON_X_UNIT ((F)))
+#define FRAME_X_FRINGE_COLS(F) ((F)->output_data.w32->fringe_cols)
 
-/* Pixel-width of the left flags area.  */
+/* Total width of fringes in pixels.  */
 
-#define FRAME_X_LEFT_FLAGS_AREA_WIDTH(F) \
-     (FRAME_X_FLAGS_AREA_WIDTH (F) / 2)
+#define FRAME_X_FRINGE_WIDTH(F) ((F)->output_data.w32->fringes_extra)
 
-/* Pixel-width of the right flags area.  Note that we are doing
-   integer arithmetic here, so don't loose a pixel if the total
-   width is an odd number.  */
+/* Pixel-width of the left and right fringe.  */
 
-#define FRAME_X_RIGHT_FLAGS_AREA_WIDTH(F)      \
-     (FRAME_X_FLAGS_AREA_WIDTH (F) - FRAME_X_FLAGS_AREA_WIDTH (F) / 2)
+#define FRAME_X_LEFT_FRINGE_WIDTH(F) ((F)->output_data.w32->left_fringe_width)
+#define FRAME_X_RIGHT_FRINGE_WIDTH(F) ((F)->output_data.w32->right_fringe_width)
 
 
 \f
@@ -657,7 +651,7 @@ struct scroll_bar {
 #define CHAR_TO_PIXEL_WIDTH(f, width) \
   (CHAR_TO_PIXEL_COL (f, width) \
    + (f)->output_data.w32->vertical_scroll_bar_extra \
-   + (f)->output_data.w32->flags_areas_extra \
+   + (f)->output_data.w32->fringes_extra \
    + (f)->output_data.w32->internal_border_width)
 #define CHAR_TO_PIXEL_HEIGHT(f, height) \
   (CHAR_TO_PIXEL_ROW (f, height) \
@@ -678,7 +672,7 @@ struct scroll_bar {
 #define PIXEL_TO_CHAR_WIDTH(f, width) \
   (PIXEL_TO_CHAR_COL (f, ((width) \
                          - (f)->output_data.w32->internal_border_width \
-                         - (f)->output_data.w32->flags_areas_extra \
+                         - (f)->output_data.w32->fringes_extra \
                          - (f)->output_data.w32->vertical_scroll_bar_extra)))
 #define PIXEL_TO_CHAR_HEIGHT(f, height) \
   (PIXEL_TO_CHAR_ROW (f, ((height) \
@@ -707,6 +701,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)
@@ -714,6 +711,10 @@ extern void w32_unload_font ();
 #ifndef MSH_MOUSEWHEEL
 #define MSH_MOUSEWHEEL                "MSWHEEL_ROLLMSG"
 #endif /* MSH_MOUSEWHEEL */
+#ifndef WM_XBUTTONDOWN
+#define WM_XBUTTONDOWN                 (WM_MOUSEWHEEL + 1)
+#define WM_XBUTTONUP                   (WM_MOUSEWHEEL + 2)
+#endif /* WM_XBUTTONDOWN */
 
 #define WM_EMACS_START                 (WM_USER + 1)
 #define WM_EMACS_KILL                  (WM_EMACS_START + 0)
@@ -733,7 +734,10 @@ extern void w32_unload_font ();
 #define WM_EMACS_TOGGLE_LOCK_KEY       (WM_EMACS_START + 14)
 #define WM_EMACS_TRACK_CARET           (WM_EMACS_START + 15)
 #define WM_EMACS_DESTROY_CARET         (WM_EMACS_START + 16)
-#define WM_EMACS_END                   (WM_EMACS_START + 17)
+#define WM_EMACS_SHOW_CARET            (WM_EMACS_START + 17)
+#define WM_EMACS_HIDE_CARET            (WM_EMACS_START + 18)
+#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) 
@@ -821,6 +825,21 @@ extern BOOL parse_button ();
 #define RIGHT_WIN_PRESSED      0x4000
 #define APPS_PRESSED           0x2000
 
+/* When compiling on Windows 9x/ME and NT 3.x, the following are not defined
+   (even though they are supported on 98 and ME.  */
+#ifndef WM_MOUSELEAVE
+#define WM_MOUSELEAVE 0x02A3
+#define TME_LEAVE 0x00000002;
+
+typedef struct tagTRACKMOUSEEVENT 
+{
+  DWORD cbSize;
+  DWORD dwFlags;
+  HWND hwndTrack;
+  DWORD dwHoverTime;
+} TRACKMOUSEEVENT;
+#endif
+
 struct image;
 struct face;