#define FOF_NO_CONNECTED_ELEMENTS 0x2000
#endif
-void syms_of_w32fns (void);
-void globals_of_w32fns (void);
-
-extern void free_frame_menubar (struct frame *);
extern int w32_console_toggle_lock_key (int, Lisp_Object);
extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
extern void w32_free_menu_strings (HWND);
extern const char *map_w32_filename (const char *, const char **);
-extern char * w32_strerror (int error_no);
#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649)
EnumDisplayMonitors_Proc enum_display_monitors_fn = NULL;
GetTitleBarInfo_Proc get_title_bar_info_fn = NULL;
-#ifdef NTGUI_UNICODE
-#define unicode_append_menu AppendMenuW
-#else /* !NTGUI_UNICODE */
extern AppendMenuW_Proc unicode_append_menu;
-#endif /* NTGUI_UNICODE */
/* Flag to selectively ignore WM_IME_CHAR messages. */
static int ignore_ime_char = 0;
static int w32_unicode_gui;
/* From w32menu.c */
-extern HMENU current_popup_menu;
int menubar_in_use = 0;
/* From w32uniscribe.c */
void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_internal_border_width (struct frame *f, Lisp_Object, Lisp_Object);
\f
/* Store the screen positions of frame F into XPTR and YPTR.
/* The default colors for the w32 color map */
typedef struct colormap_t
{
- char *name;
+ const char *name;
COLORREF colorref;
} colormap_t;
NULL, NULL, (LPBYTE)color_buffer, &color_size)
== ERROR_SUCCESS)
{
- int r, g, b;
+ unsigned r, g, b;
if (sscanf (color_buffer, " %u %u %u", &r, &g, &b) == 3)
*system_colors = Fcons (Fcons (build_string (full_name_buffer),
make_number (RGB (r, g, b))),
If F is not a color screen, return DEF (default) regardless of what
ARG says. */
-int
+static int
x_decode_color (struct frame *f, Lisp_Object arg, int def)
{
XColor cdef;
Note that this does not fully take effect if done before
F has a window. */
-void
+static void
x_set_border_pixel (struct frame *f, int pix)
{
#endif
}
\f
-void
+static void
x_clear_under_internal_border (struct frame *f)
{
int border = FRAME_INTERNAL_BORDER_WIDTH (f);
if (border != FRAME_INTERNAL_BORDER_WIDTH (f))
{
- FRAME_INTERNAL_BORDER_WIDTH (f) = border;
+ f->internal_border_width = border;
if (FRAME_X_WINDOW (f) != 0)
{
suggesting a new name, which lisp code should override; if
F->explicit_name is set, ignore the new name; otherwise, set it. */
-void
+static void
x_set_name (struct frame *f, Lisp_Object name, bool explicit)
{
/* Make sure that requests from lisp code override requests from
\f
/* Subroutines for creating a frame. */
+Cursor w32_load_cursor (LPCTSTR);
+
Cursor
w32_load_cursor (LPCTSTR name)
{
can prevent this by setting the
w32-pass-[lr]window-to-system variable to
NIL. */
- if (hs->vkCode == VK_LWIN && !NILP (Vw32_pass_lwindow_to_system) ||
- hs->vkCode == VK_RWIN && !NILP (Vw32_pass_rwindow_to_system))
+ if ((hs->vkCode == VK_LWIN && !NILP (Vw32_pass_lwindow_to_system)) ||
+ (hs->vkCode == VK_RWIN && !NILP (Vw32_pass_rwindow_to_system)))
{
/* Not prevented - Simulate the keypress to the system. */
memset (inputs, 0, sizeof (inputs));
/* Some other key was pressed while a captured Win key is down.
This is either an Emacs registered hotkey combination, or a
system hotkey. */
- if (kbdhook.lwindown && kbdhook.lwin_hooked[hs->vkCode] ||
- kbdhook.rwindown && kbdhook.rwin_hooked[hs->vkCode])
+ if ((kbdhook.lwindown && kbdhook.lwin_hooked[hs->vkCode]) ||
+ (kbdhook.rwindown && kbdhook.rwin_hooked[hs->vkCode]))
{
/* Hooked Win-x combination, do not pass the keypress to Windows. */
kbdhook.suppress_lone = 1;
/* Mark a specific key combination as hooked, preventing it to be
handled by the system. */
-void
+static void
hook_w32_key (int hook, int modifier, int vkey)
{
char *tbl = NULL;
}
}
+#ifdef WINDOWSNT
/* Check the current Win key pressed state. */
int
check_w32_winkey_state (int vkey)
}
return 0;
}
+#endif /* WINDOWSNT */
/* Reset the keyboard hook state. Locking the workstation with Win-L
leaves the Win key(s) "down" from the hook's point of view - the
keyup event is never seen. Thus, this function must be called when
the system is locked. */
-void
+static void
reset_w32_kbdhook_state (void)
{
kbdhook.lwindown = 0;
else
return (GetKeyState (vkey) & 0x1);
}
+#ifdef WINDOWSNT
if (w32_kbdhook_active && (vkey == VK_LWIN || vkey == VK_RWIN))
return check_w32_winkey_state (vkey);
+#endif
if (!modifiers_recorded)
return (GetKeyState (vkey) & 0x8000);
/* Convert between the modifier bits W32 uses and the modifier bits
Emacs uses. */
+unsigned int w32_key_to_modifier (int);
unsigned int
w32_key_to_modifier (int key)
return mods;
}
+unsigned int map_keypad_keys (unsigned int, unsigned int);
+
unsigned int
map_keypad_keys (unsigned int virt_key, unsigned int extended)
{
PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
}
+DWORD WINAPI w32_msg_worker (void *);
+
DWORD WINAPI
w32_msg_worker (void *arg)
{
Be ready to treat the case when this delivers WM_(SYS)DEADCHAR. */
static int after_deadkey = -1;
-int
+static int
deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam,
UINT lParam, int legacy_alt_meta)
{
W32Msg wmsg;
DWORD console_modifiers = construct_console_modifiers ();
int *b = buf, strip_ExtraMods = 1, hairy = 0;
- char *type_CtrlAlt = NULL;
+ const char *type_CtrlAlt = NULL;
/* XXXX In fact, there may be another case when we need to do the same:
What happens if the string defined in the LIGATURES has length
if (!STRINGP (font))
{
int i;
- static char *names[]
+ static const char *names[]
= { "Courier New-10",
"-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1",
"-*-Fixedsys-normal-r-*-*-12-*-*-*-c-*-iso8859-1",
else if (! NILP (visibility))
x_make_frame_visible (f);
else
- /* Must have been Qnil. */
- ;
+ {
+ /* Must have been Qnil. */
+ ;
+ }
}
/* Initialize `default-minibuffer-frame' in case this is the first
return sound;
}
+#if 0 /* unused */
int
x_screen_planes (register struct frame *f)
{
return FRAME_DISPLAY_INFO (f)->n_planes;
}
+#endif
\f
/* Return the display structure for the display named NAME.
Open a new connection if necessary. */
Text larger than the specified size is clipped. */)
(Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
{
- struct frame *f, *tip_f;
+ struct frame *tip_f;
struct window *w;
int root_x, root_y;
struct buffer *old_buffer;
struct text_pos pos;
- int i, width, height;
+ int width, height;
int old_windows_or_buffers_changed = windows_or_buffers_changed;
ptrdiff_t count = SPECPDL_INDEX ();
ptrdiff_t count_1;
Lisp_Object window, size;
+ AUTO_STRING (tip, " *tip*");
specbind (Qinhibit_redisplay, Qt);
CHECK_STRING (string);
- f = decode_window_system_frame (frame);
+ decode_window_system_frame (frame);
if (NILP (timeout))
timeout = make_number (5);
else
/* Create a frame for the tooltip, and record it in the global
variable tip_frame. */
+ struct frame *f; /* The value is unused. */
if (NILP (tip_frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms)))
{
/* Creating the tip frame failed. */
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
- AUTO_STRING (tip, " *tip*");
set_window_buffer (window, Fget_buffer_create (tip), false, false);
w = XWINDOW (window);
w->pseudo_window_p = true;
{
/* Filter index: 1: All Files, 2: Directories only */
static const wchar_t filter_w[] = L"All Files (*.*)\0*.*\0Directories\0*|*\0";
+#ifndef NTGUI_UNICODE
static const char filter_a[] = "All Files (*.*)\0*.*\0Directories\0*|*\0";
+#endif
Lisp_Object filename = default_filename;
struct frame *f = SELECTED_FRAME ();
/* Alphanumerics map to themselves. */
if (key[1] == 0)
{
- if (key[0] >= 'A' && key[0] <= 'Z' ||
- key[0] >= '0' && key[0] <= '9')
+ if ((key[0] >= 'A' && key[0] <= 'Z')
+ || (key[0] >= '0' && key[0] <= '9'))
return key[0];
if (key[0] >= 'a' && key[0] <= 'z')
return toupper(key[0]);
else
{
long m;
- float h;
+ double h;
char buffer[16];
snprintf (buffer, 16, "%ld", seconds_left);
seconds = build_string (buffer);
--ret;
buf[ret] = '\0';
if (!ret)
- sprintf (buf, "w32 error %u", error_no);
+ sprintf (buf, "w32 error %d", error_no);
return buf;
}
/* For convenience when debugging. (You cannot call GetLastError
directly from GDB: it will crash, because it uses the __stdcall
calling convention, not the _cdecl convention assumed by GDB.) */
+DWORD w32_last_error (void);
+
DWORD
w32_last_error (void)
{
EMACS_INT retval;
char *icon, *tip, *title, *msg;
enum NI_Severity severity;
- unsigned timeout;
+ unsigned timeout = 0;
if (nargs == 0)
return Qnil;
if (STRINGP (lres))
icon = SSDATA (ENCODE_FILE (Fexpand_file_name (lres, Qnil)));
else
- icon = "";
+ icon = (char *)"";
/* Tip. */
lres = Fplist_get (arg_plist, QCtip);
if (STRINGP (lres))
tip = SSDATA (code_convert_string_norecord (lres, Qutf_8, 1));
else
- tip = "Emacs notification";
+ tip = (char *)"Emacs notification";
/* Severity. */
lres = Fplist_get (arg_plist, QClevel);
if (STRINGP (lres))
title = SSDATA (code_convert_string_norecord (lres, Qutf_8, 1));
else
- title = "";
+ title = (char *)"";
/* Notification body text. */
lres = Fplist_get (arg_plist, QCbody);
if (STRINGP (lres))
msg = SSDATA (code_convert_string_norecord (lres, Qutf_8, 1));
else
- msg = "";
+ msg = (char *)"";
/* Do it! */
retval = add_tray_notification (f, icon, tip, severity, timeout, title, msg);
#define BACKTRACE_LIMIT_MAX 62
-int
+static int
w32_backtrace (void **buffer, int limit)
{
static CaptureStackBackTrace_proc s_pfn_CaptureStackBackTrace = NULL;
but not on Windows 7. addr2line doesn't mind a missing
"0x", but will be confused by an extra one. */
if (except_addr)
- sprintf (buf, "\r\nException 0x%lx at this address:\r\n%p\r\n",
- except_code, except_addr);
+ sprintf (buf, "\r\nException 0x%x at this address:\r\n%p\r\n",
+ (unsigned int) except_code, except_addr);
if (stderr_fd >= 0)
{
if (except_addr)