/* Implementation of GUI terminal on the Microsoft W32 API.
-Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
static int max_fringe_bmp = 0;
static HBITMAP *fringe_bmp = 0;
-/* Non-nil means Emacs uses toolkit scroll bars. */
-
-Lisp_Object Vx_toolkit_scroll_bars;
-
/* Temporary variables for w32_read_socket. */
static int last_mousemove_x = 0;
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
static Lisp_Object last_window;
-/* Non-zero means make use of UNDERLINE_POSITION font properties. */
-int x_use_underline_position_properties;
-
-/* Non-zero means to draw the underline at the same place as the descent line. */
-
-int x_underline_at_descent_line;
-
extern unsigned int msh_mousewheel;
extern void free_frame_menubar (struct frame *);
extern int w32_codepage_for_font (char *fontname);
extern Cursor w32_load_cursor (LPCTSTR name);
-extern Lisp_Object Vwindow_system;
-
#define x_any_window_to_frame x_window_to_frame
#define x_top_window_to_frame x_window_to_frame
#define WS_EX_LAYERED 0x80000
#endif
-/* Frame being updated by update_frame. This is declared in term.c.
- This is set by update_begin and looked at by all the
- w32 functions. It is zero while not inside an update.
- In that case, the w32 functions assume that `SELECTED_FRAME ()'
- is the frame to apply to. */
-extern struct frame *updating_frame;
-
/* This is a frame waiting to be autoraised, within w32_read_socket. */
struct frame *pending_autoraise_frame;
int w32_system_caret_height;
int w32_system_caret_x;
int w32_system_caret_y;
-int w32_use_visible_system_caret;
-
DWORD dwWindowsThreadId = 0;
HANDLE hWindowsThread = NULL;
DWORD dwMainThreadId = 0;
/* Where the mouse was last time we reported a mouse event. */
static RECT last_mouse_glyph;
static FRAME_PTR last_mouse_glyph_frame;
-static Lisp_Object last_mouse_press_frame;
-
-int w32_num_mouse_buttons;
-
-Lisp_Object Vw32_swap_mouse_buttons;
-
-/* Control whether x_raise_frame also sets input focus. */
-Lisp_Object Vw32_grab_focus_on_raise;
-
-/* Control whether Caps Lock affects non-ascii characters. */
-Lisp_Object Vw32_capslock_is_shiftlock;
-
-/* Control whether right-alt and left-ctrl should be recognized as AltGr. */
-Lisp_Object Vw32_recognize_altgr;
/* The scroll bar in which the last motion event occurred.
static int input_signal_count;
#endif
-extern Lisp_Object Vcommand_line_args, Vsystem_name;
-
-/* A mask of extra modifier bits to put into every keyboard char. */
-extern EMACS_INT extra_keyboard_modifiers;
-
/* Keyboard code page - may be changed by language-change events. */
static int keyboard_codepage;
w32_set_clip_rectangle (s->hdc, r);
else if (n > 1)
{
- HRGN full_clip, clip1, clip2;
- clip1 = CreateRectRgnIndirect (r);
- clip2 = CreateRectRgnIndirect (r + 1);
- if (CombineRgn (full_clip, clip1, clip2, RGN_OR) != ERROR)
- {
- SelectClipRgn (s->hdc, full_clip);
- }
+ HRGN clip1 = CreateRectRgnIndirect (r);
+ HRGN clip2 = CreateRectRgnIndirect (r + 1);
+ if (CombineRgn (clip1, clip1, clip2, RGN_OR) != ERROR)
+ SelectClipRgn (s->hdc, clip1);
DeleteObject (clip1);
DeleteObject (clip2);
- DeleteObject (full_clip);
}
s->num_clips = n;
}
else if (! s->first_glyph->u.cmp.automatic)
{
int y = s->ybase;
- int width = 0;
HFONT old_font;
old_font = SelectObject (s->hdc, FONT_HANDLE (font));
glyph->u.glyphless.ch)
: XCHAR_TABLE (Vglyphless_char_display)->extras[0]);
if (STRINGP (acronym))
- str = (char *) SDATA (acronym);
+ str = SSDATA (acronym);
}
}
else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
}
-/* Clear entire frame. If updating_frame is non-null, clear that
- frame. Otherwise clear the selected frame. */
+/* Clear entire frame. */
static void
x_clear_frame (struct frame *f)
static void
w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
{
- struct frame *f = XFRAME (WINDOW_FRAME (w));
RECT clip_rect;
int window_x, window_y, window_width;
}
-/* Create an xrdb-style database of resources to supercede registry settings.
+/* Create an xrdb-style database of resources to supersede registry settings.
The database is just a concatenation of C strings, finished by an additional
\0. The strings are submitted to some basic normalization, so
terminal->mouse_position_hook = w32_mouse_position;
terminal->frame_rehighlight_hook = w32_frame_rehighlight;
terminal->frame_raise_lower_hook = w32_frame_raise_lower;
- // terminal->fullscreen_hook = XTfullscreen_hook;
+ /* terminal->fullscreen_hook = XTfullscreen_hook; */
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
terminal like X does. */
terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
init_kboard (terminal->kboard);
- terminal->kboard->Vwindow_system = intern ("w32");
+ KVAR (terminal->kboard, Vwindow_system) = intern ("w32");
terminal->kboard->next_kboard = all_kboards;
all_kboards = terminal->kboard;
/* Don't let the initial kboard remain current longer than necessary.
x_delete_terminal (struct terminal *terminal)
{
struct w32_display_info *dpyinfo = terminal->display_info.w32;
- int i;
/* Protect against recursive calls. delete_frame in
delete_terminal calls us back when it deletes our last frame. */
DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
DEFVAR_INT ("w32-num-mouse-buttons",
- &w32_num_mouse_buttons,
+ w32_num_mouse_buttons,
doc: /* Number of physical mouse buttons. */);
w32_num_mouse_buttons = 2;
DEFVAR_LISP ("w32-swap-mouse-buttons",
- &Vw32_swap_mouse_buttons,
+ Vw32_swap_mouse_buttons,
doc: /* Swap the mapping of middle and right mouse buttons.
When nil, middle button is mouse-2 and right button is mouse-3. */);
Vw32_swap_mouse_buttons = Qnil;
DEFVAR_LISP ("w32-grab-focus-on-raise",
- &Vw32_grab_focus_on_raise,
+ Vw32_grab_focus_on_raise,
doc: /* Raised frame grabs input focus.
When t, `raise-frame' grabs input focus as well. This fits well
with the normal Windows click-to-focus policy, but might not be
Vw32_grab_focus_on_raise = Qt;
DEFVAR_LISP ("w32-capslock-is-shiftlock",
- &Vw32_capslock_is_shiftlock,
+ Vw32_capslock_is_shiftlock,
doc: /* Apply CapsLock state to non character input keys.
When nil, CapsLock only affects normal character input keys. */);
Vw32_capslock_is_shiftlock = Qnil;
DEFVAR_LISP ("w32-recognize-altgr",
- &Vw32_recognize_altgr,
+ Vw32_recognize_altgr,
doc: /* Recognize right-alt and left-ctrl as AltGr.
When nil, the right-alt and left-ctrl key combination is
interpreted normally. */);
Vw32_recognize_altgr = Qt;
DEFVAR_BOOL ("w32-use-visible-system-caret",
- &w32_use_visible_system_caret,
+ w32_use_visible_system_caret,
doc: /* Flag to make the system caret visible.
When this is non-nil, Emacs will indicate the position of point by
using the system caret instead of drawing its own cursor. Some screen
/* We don't yet support this, but defining this here avoids whining
from cus-start.el and other places, like "M-x set-variable". */
DEFVAR_BOOL ("x-use-underline-position-properties",
- &x_use_underline_position_properties,
+ x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
x_use_underline_position_properties = 0;
DEFVAR_BOOL ("x-underline-at-descent-line",
- &x_underline_at_descent_line,
+ x_underline_at_descent_line,
doc: /* *Non-nil means to draw the underline at the same place as the descent line.
A value of nil means to draw the underline according to the value of the
variable `x-use-underline-position-properties', which is usually at the
baseline level. The default value is nil. */);
x_underline_at_descent_line = 0;
- DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
+ DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
doc: /* Which toolkit scroll bars Emacs uses, if any.
A value of nil means Emacs doesn't use toolkit scroll bars.
With the X Window system, the value is a symbol describing the
staticpro (&last_mouse_motion_frame);
last_mouse_motion_frame = Qnil;
}
-