static int w32_in_use;
-Lisp_Object Qnone;
Lisp_Object Qsuppress_icon;
Lisp_Object Qundefined_color;
Lisp_Object Qcancel_timer;
static HWND w32_visible_system_caret_hwnd;
+static int w32_unicode_gui;
+
/* From w32menu.c */
extern HMENU current_popup_menu;
static int menubar_in_use = 0;
BLOCK_INPUT;
result = x_text_icon (f,
- SSDATA ((!NILP (FGET (f, icon_name))
- ? FGET (f, icon_name)
- : !NILP (FGET (f, title))
- ? FGET (f, title)
- : FGET (f, name))));
+ SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : !NILP (f->title)
+ ? f->title
+ : f->name)));
if (result)
{
}
UNBLOCK_INPUT;
- if (WINDOWP (FGET (f, tool_bar_window)))
- clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix);
+ if (WINDOWP (f->tool_bar_window))
+ clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
}
run_window_configuration_change_hook (f);
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
- SDATA (FGET (f, name))))
+ SDATA (f->name)))
return;
name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
}
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, FGET (f, name))))
+ if (! NILP (Fstring_equal (name, f->name)))
return;
FSET (f, name, name);
/* For setting the frame title, the title parameter should override
the name parameter. */
- if (! NILP (FGET (f, title)))
- name = FGET (f, title);
+ if (! NILP (f->title))
+ name = f->title;
if (FRAME_W32_WINDOW (f))
{
x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
- if (EQ (name, FGET (f, title)))
+ if (EQ (name, f->title))
return;
update_mode_lines = 1;
FSET (f, title, name);
if (NILP (name))
- name = FGET (f, name);
+ name = f->name;
if (FRAME_W32_WINDOW (f))
{
static LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
+#define INIT_WINDOW_CLASS(WC) \
+ (WC).style = CS_HREDRAW | CS_VREDRAW; \
+ (WC).lpfnWndProc = (WNDPROC) w32_wnd_proc; \
+ (WC).cbClsExtra = 0; \
+ (WC).cbWndExtra = WND_EXTRA_BYTES; \
+ (WC).hInstance = hinst; \
+ (WC).hIcon = LoadIcon (hinst, EMACS_CLASS); \
+ (WC).hCursor = w32_load_cursor (IDC_ARROW); \
+ (WC).hbrBackground = NULL; \
+ (WC).lpszMenuName = NULL; \
+
static BOOL
w32_init_class (HINSTANCE hinst)
{
- WNDCLASS wc;
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = WND_EXTRA_BYTES;
- wc.hInstance = hinst;
- wc.hIcon = LoadIcon (hinst, EMACS_CLASS);
- wc.hCursor = w32_load_cursor (IDC_ARROW);
- wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH); */
- wc.lpszMenuName = NULL;
- wc.lpszClassName = EMACS_CLASS;
+ if (w32_unicode_gui)
+ {
+ WNDCLASSW uwc;
+ INIT_WINDOW_CLASS(uwc);
+ uwc.lpszClassName = L"Emacs";
+
+ return RegisterClassW (&uwc);
+ }
+ else
+ {
+ WNDCLASS wc;
+ INIT_WINDOW_CLASS(wc);
+ wc.lpszClassName = EMACS_CLASS;
- return (RegisterClass (&wc));
+ return RegisterClassA (&wc);
+ }
}
static HWND
msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL);
- while (GetMessage (&msg, NULL, 0, 0))
+ while ((w32_unicode_gui ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0))
{
if (msg.hwnd == NULL)
{
}
else
{
- DispatchMessage (&msg);
+ if (w32_unicode_gui)
+ DispatchMessageW (&msg);
+ else
+ DispatchMessageA (&msg);
}
/* Exit nested loop when our deferred message has completed. */
case WM_SYSCHAR:
case WM_CHAR:
- post_character_message (hwnd, msg, wParam, lParam,
- w32_get_key_modifiers (wParam, lParam));
+ if (wParam > 255 )
+ {
+ W32Msg wmsg;
+
+ wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
+ signal_user_input ();
+ my_post_msg (&wmsg, hwnd, WM_UNICHAR, wParam, lParam);
+
+ }
+ else
+ post_character_message (hwnd, msg, wParam, lParam,
+ w32_get_key_modifiers (wParam, lParam));
break;
case WM_UNICHAR:
}
dflt:
- return DefWindowProc (hwnd, msg, wParam, lParam);
+ return (w32_unicode_gui ? DefWindowProcW : DefWindowProcA) (hwnd, msg, wParam, lParam);
}
/* The most common default return code for handled messages is 0. */
int explicit = f->explicit_name;
f->explicit_name = 0;
- name = FGET (f, name);
+ name = f->name;
FSET (f, name, Qnil);
x_set_name (f, name, explicit);
}
? IconicState
: NormalState));
- x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name))
- ? FGET (f, icon_name)
- : FGET (f, name))));
+ x_text_icon (f, SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : f->name)));
#endif
UNBLOCK_INPUT;
FSET (f, icon_name,
x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
RES_TYPE_STRING));
- if (! STRINGP (FGET (f, icon_name)))
+ if (! STRINGP (f->icon_name))
FSET (f, icon_name, Qnil);
/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
by x_get_arg and friends, now go in the misc. alist of the frame. */
for (tem = parameters; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
- FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist)));
+ FSET (f, param_alist, Fcons (XCAR (tem), f->param_alist));
UNGCPRO;
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
- BVAR (current_buffer, truncate_lines) = Qnil;
+ BSET (current_buffer, truncate_lines, Qnil);
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
WSET (w, total_lines, make_number (40));
}
- FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols));
+ FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
adjust_glyphs (f);
w->pseudo_window_p = 1;
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
- set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
- BVAR (current_buffer, truncate_lines) = Qnil;
+ set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
+ BSET (current_buffer, truncate_lines, Qnil);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
w32_visible_system_caret_hwnd = NULL;
- DEFSYM (Qnone, "none");
DEFSYM (Qsuppress_icon, "suppress-icon");
DEFSYM (Qundefined_color, "undefined-color");
DEFSYM (Qcancel_timer, "cancel-timer");
doc: /* The ANSI code page used by the system. */);
w32_ansi_code_page = GetACP ();
+ if (os_subtype == OS_NT)
+ w32_unicode_gui = 1;
+ else
+ w32_unicode_gui = 0;
+
/* MessageBox does not work without this when linked to comctl32.dll 6.0. */
InitCommonControls ();