/* Menu support for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2015 Free
+ Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2016 Free
Software Foundation, Inc.
This file is part of GNU Emacs.
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 of the License, 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
#include "lisp.h"
#include "keyboard.h"
-#include "keymap.h"
#include "frame.h"
-#include "termhooks.h"
-#include "window.h"
#include "blockinput.h"
-#include "character.h"
#include "buffer.h"
-#include "charset.h"
-#include "coding.h"
+#include "coding.h" /* for ENCODE_SYSTEM */
#include "menu.h"
/* This may include sys/types.h, and that somehow loses
#include <sys/types.h>
#endif
-#include "dispextern.h"
-
#include "w32common.h" /* for osinfo_cache */
#undef HAVE_DIALOGS /* TODO: Implement native dialogs. */
HMENU current_popup_menu;
-void syms_of_w32menu (void);
-void globals_of_w32menu (void);
-
typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) (
IN HMENU,
IN UINT,
IN UINT type);
#ifdef NTGUI_UNICODE
-#define get_menu_item_info GetMenuItemInfoA
-#define set_menu_item_info SetMenuItemInfoA
-#define unicode_append_menu AppendMenuW
-#define unicode_message_box MessageBoxW
+GetMenuItemInfoA_Proc get_menu_item_info = GetMenuItemInfoA;
+SetMenuItemInfoA_Proc set_menu_item_info = SetMenuItemInfoA;
+AppendMenuW_Proc unicode_append_menu = AppendMenuW;
+MessageBoxW_Proc unicode_message_box = MessageBoxW;
#else /* !NTGUI_UNICODE */
GetMenuItemInfoA_Proc get_menu_item_info = NULL;
SetMenuItemInfoA_Proc set_menu_item_info = NULL;
MessageBoxW_Proc unicode_message_box = NULL;
#endif /* NTGUI_UNICODE */
-void set_frame_menubar (struct frame *, bool, bool);
-
#ifdef HAVE_DIALOGS
static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **);
#else
when the user makes a selection.
Figure out what the user chose
and put the appropriate events into the keyboard buffer. */
+void menubar_selection_callback (struct frame *, void *);
void
menubar_selection_callback (struct frame *f, void * client_data)
/* Force the window size to be recomputed so that the frame's text
area remains the same, if menubar has just been created. */
if (old_widget == NULL)
- adjust_frame_size (f, -1, -1, 2, false, Qmenu_bar_lines);
+ {
+ windows_or_buffers_changed = 23;
+ adjust_frame_size (f, -1, -1, 2, false, Qmenu_bar_lines);
+ }
}
unblock_input ();
if (STRINGP (temp))
{
- char *utf8_text = SDATA (ENCODE_UTF_8 (temp));
+ char *utf8_text = SSDATA (ENCODE_UTF_8 (temp));
/* Be pessimistic about the number of characters needed.
Remember characters outside the BMP will take more than
one utf16 word, so we cannot simply use the character
length of temp. */
int utf8_len = strlen (utf8_text);
text = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
- utf8to16 (utf8_text, utf8_len, text);
+ utf8to16 ((unsigned char *)utf8_text, utf8_len, text);
}
else
{
- text = L"";
+ text = (WCHAR *)L"";
}
if (NILP (header))
encoding so questions representable by the system codepage
are encoded properly. */
if (STRINGP (temp))
- text = SDATA (ENCODE_SYSTEM (temp));
+ text = SSDATA (ENCODE_SYSTEM (temp));
else
text = "";
else
utf16_string = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
- utf8to16 (out_string, utf8_len, utf16_string);
+ utf8to16 ((unsigned char *)out_string, utf8_len, utf16_string);
return_value = unicode_append_menu (menu, fuFlags,
item != NULL ? (UINT_PTR) item
: (UINT_PTR) wv->call_data,
/* Display help string for currently pointed to menu item. Not
supported on NT 3.51 and earlier, as GetMenuItemInfo is not
available. */
+void w32_menu_display_help (HWND, HMENU, UINT, UINT);
+
void
w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
{