-/* Definitions and headers for communication under the Win32 API.
+/* Definitions and headers for communication on the Microsoft W32 API.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Added by Kevin Gallo */
-#include <win32.h>
+#include <w32gui.h>
/* The class of this X application. */
#define EMACS_CLASS "Emacs"
struct w32_output
{
+ /* Menubar "widget" handle. */
+ HMENU menubar_widget;
+
/* Original palette (used to deselect real palette after drawing) */
HPALETTE old_palette;
/* Nonzero means tried already to make this frame visible. */
char asked_for_visible;
+
+ /* Nonzero means menubar is currently active. */
+ char menubar_active;
+
+ /* Nonzero means menubar is about to become active, but should be
+ brought up to date first. */
+ volatile char pending_menu_activation;
};
/* Get at the computed faces of an X window frame. */
inset the handle boundaries from the scroll bar edges. */
#define VERTICAL_SCROLL_BAR_LEFT_BORDER (0)
#define VERTICAL_SCROLL_BAR_RIGHT_BORDER (0)
-#define VERTICAL_SCROLL_BAR_TOP_BORDER (0)
-#define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (0)
+#define VERTICAL_SCROLL_BAR_TOP_BORDER (vertical_scroll_bar_top_border)
+#define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (vertical_scroll_bar_bottom_border)
/* Minimum lengths for scroll bar handles, in pixels. */
-#define VERTICAL_SCROLL_BAR_MIN_HANDLE (0)
+#define VERTICAL_SCROLL_BAR_MIN_HANDLE (vertical_scroll_bar_min_handle)
+
\f
/* Manipulating pixel sizes and character sizes.
extern XFontStruct *w32_load_font ();
extern void w32_unload_font ();
+/* Define for earlier versions of Visual C */
+#ifndef WM_MOUSEWHEEL
+#define WM_MOUSEWHEEL (WM_MOUSELAST + 1)
+#endif /* WM_MOUSEWHEEL */
+#ifndef MSH_MOUSEWHEEL
+#define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
+#endif /* MSH_MOUSEWHEEL */
+
#define WM_EMACS_START (WM_USER + 1)
#define WM_EMACS_KILL (WM_EMACS_START + 0x00)
#define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 0x01)
#define WM_EMACS_SHOWWINDOW (WM_EMACS_START + 0x04)
#define WM_EMACS_SETWINDOWPOS (WM_EMACS_START + 0x05)
#define WM_EMACS_DESTROYWINDOW (WM_EMACS_START + 0x06)
-#define WM_EMACS_END (WM_EMACS_START + 0x10)
-
-typedef struct {
- HWND hwndAfter;
- int x;
- int y;
- int cx;
- int cy;
- int flags;
-} W32WindowPos;
-
-#define WND_X_UNITS_INDEX (0)
-#define WND_Y_UNITS_INDEX (4)
-#define WND_BACKGROUND_INDEX (8)
-
-#define WND_LAST_INDEX (16)
+#define WM_EMACS_TRACKPOPUPMENU (WM_EMACS_START + 0x07)
+#define WM_EMACS_SETFOCUS (WM_EMACS_START + 0x08)
+#define WM_EMACS_SETFOREGROUND (WM_EMACS_START + 0x09)
+#define WM_EMACS_SETLOCALE (WM_EMACS_START + 0x0a)
+#define WM_EMACS_END (WM_EMACS_START + 0x0b)
+
+#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)
-extern DWORD dwWinThreadId;
-extern HANDLE hWinThread;
+extern DWORD dwWindowsThreadId;
+extern HANDLE hWindowsThread;
extern DWORD dwMainThreadId;
extern HANDLE hMainThread;
RECT rect;
} W32Msg;
+/* Structure for recording message when input thread must return a
+ result that depends on lisp thread to compute. Lisp thread can
+ complete deferred messages out of order. */
+typedef struct deferred_msg
+{
+ struct deferred_msg * next;
+ W32Msg w32msg;
+ LRESULT result;
+ int completed;
+} deferred_msg;
+
extern CRITICAL_SECTION critsect;
extern void init_crit ();
extern BOOL get_next_msg ();
extern BOOL post_msg ();
+extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result);
extern void wait_for_sync ();
extern BOOL parse_button ();