#define zv_width 8
#define zv_height 72
#define zv_period 3
-static unsigned char zv_bits[] = {
+static unsigned short zv_bits[] = {
0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00,
/* Non-zero means autoselect window with the mouse cursor. */
-int x_autoselect_window_p;
+int mouse_autoselect_window;
/* Non-zero means draw block and hollow cursor as wide as the glyph
under it. For example, if a block cursor is over a tab, it will be
static void w32_frame_rehighlight P_ ((struct frame *));
static void x_frame_rehighlight P_ ((struct w32_display_info *));
static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
-static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int));
+static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
+ enum text_cursor_kinds));
static void expose_frame P_ ((struct frame *, int, int, int, int));
static int expose_window_tree P_ ((struct window *, RECT *));
static int expose_window P_ ((struct window *, RECT *));
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
left_x + i * left_p, top_y + i,
- (right_x + 1 - i * right_p) - (left_x + i * left_p) + 1, 1);
+ right_x - left_x - i * (left_p + right_p ) + 1, 1);
/* Left. */
if (left_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
left_x + i, top_y + i, 1,
- (bottom_y - i) - (top_y + i) + 2);
+ bottom_y - top_y - 2 * i + 1);
if (raised_p)
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
left_x + i * left_p, bottom_y - i,
- (right_x - i * right_p) - (left_x + i * left_p) + 2, 1);
+ right_x - left_x - i * (left_p + right_p) + 1, 1);
/* Right. */
if (right_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
right_x - i, top_y + i + 1, 1,
- (bottom_y - i) - (top_y + i));
+ bottom_y - top_y - 2 * i - 1);
w32_set_clip_rectangle (hdc, NULL);
the image. I believe it's looking better if we do
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
- w32_draw_rectangle (s->hdc, s->gc, x, y, s->img->width - 1,
- s->img->height - 1);
+ {
+ int r = s->img->relief;
+ if (r < 0) r = -r;
+ w32_draw_rectangle (s->hdc, s->gc, x - r, y - r ,
+ s->img->width + r*2 - 1, s->img->height + r*2 - 1);
+ }
w32_set_clip_rectangle (s->hdc, NULL);
}
}
the image. I believe it's looking better if we do
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
- w32_draw_rectangle (hdc, s->gc, x, y, s->img->width - 1,
- s->img->height - 1);
+ {
+ int r = s->img->relief;
+ if (r < 0) r = -r;
+ w32_draw_rectangle (s->hdc, s->gc, x - r, y - r ,
+ s->img->width + r*2 - 1, s->img->height + r*2 - 1);
+ }
}
}
else
parse_button (msg->msg.message, HIWORD (msg->msg.wParam),
&button, &up);
- /* Make the event type no_event; we'll change that when we decide
+ /* Make the event type NO_EVENT; we'll change that when we decide
otherwise. */
- result->kind = mouse_click;
+ result->kind = MOUSE_CLICK_EVENT;
result->code = button;
result->timestamp = msg->msg.time;
result->modifiers = (msg->dwModifiers
struct frame *f;
{
POINT p;
- result->kind = mouse_wheel;
+ result->kind = MOUSE_WHEEL_EVENT;
result->code = (short) HIWORD (msg->msg.wParam);
result->timestamp = msg->msg.time;
result->modifiers = msg->dwModifiers;
char *name;
int i, len;
- result->kind = drag_n_drop;
+ result->kind = DRAG_N_DROP_EVENT;
result->code = 0;
result->timestamp = msg->msg.time;
result->modifiers = msg->dwModifiers;
continue;
name = alloca (len + 1);
DragQueryFile (hdrop, i, name, len + 1);
- files = Fcons (build_string (name), files);
+ files = Fcons (DECODE_FILE (build_string (name)), files);
}
DragFinish (hdrop);
memcpy (&last_mouse_motion_event, msg, sizeof (last_mouse_motion_event));
XSETFRAME (last_mouse_motion_frame, frame);
- if (x_autoselect_window_p)
+#if 0 /* Calling Lisp asynchronously is not safe. */
+ if (mouse_autoselect_window)
{
int area;
Lisp_Object window;
window = window_from_coordinates (frame, mouse_x, mouse_y, &area, 0);
/* Window will be selected only when it is not selected now and
- last mouse movement event was not in it. Minubuffer window
+ last mouse movement event was not in it. Minibuffer window
will be selected iff it is active. */
if (!EQ (window, last_window)
&& !EQ (window, selected_window)
last_window=window;
}
+#endif
if (msg->hwnd != FRAME_W32_WINDOW (frame))
{
if (glyph < end
&& STRINGP (glyph->object)
- && XSTRING (glyph->object)->intervals
+ && STRING_INTERVALS (glyph->object)
&& glyph->charpos >= 0
- && glyph->charpos < XSTRING (glyph->object)->size)
+ && glyph->charpos < SCHARS (glyph->object))
{
/* If we're on a string with `help-echo' text property,
arrange for the help to be displayed. This is done by
if (NILP (b))
b = make_number (0);
if (NILP (e))
- e = make_number (XSTRING (object)->size - 1);
+ e = make_number (SCHARS (object) - 1);
fast_find_string_pos (w, XINT (b), object,
&dpyinfo->mouse_face_beg_col,
&dpyinfo->mouse_face_beg_row,
/* Try text properties. */
if (STRINGP (object)
&& charpos >= 0
- && charpos < XSTRING (object)->size)
+ && charpos < SCHARS (object))
{
help = Fget_text_property (make_number (charpos),
Qhelp_echo, object);
if (NILP (enabled_p))
return;
- if (button_event->kind == mouse_click)
+ if (button_event->modifiers & down_modifier)
{
/* Show item in pressed state. */
show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN);
event.kind = TOOL_BAR_EVENT;
event.frame_or_window = frame;
event.arg = key;
- event.modifiers = button_event->modifiers;
+ /* The keyboard buffer doesn't like the up modifier being set. */
+ event.modifiers = button_event->modifiers & ~up_modifier;
kbd_buffer_store_event (&event);
last_tool_bar_item = -1;
}
}
/* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind
- is set to something other than no_event, it is enqueued.
+ is set to something other than NO_EVENT, it is enqueued.
This may be called from a signal handler, so we have to ignore GC
mark bits. */
if (! GC_WINDOWP (bar->window))
abort ();
- emacs_event->kind = w32_scroll_bar_click;
+ emacs_event->kind = W32_SCROLL_BAR_CLICK_EVENT;
emacs_event->code = 0;
/* not really meaningful to distinguish up/down */
emacs_event->modifiers = msg->dwModifiers;
}
/* fall through */
default:
- emacs_event->kind = no_event;
+ emacs_event->kind = NO_EVENT;
return FALSE;
}
/* We may get paint messages even though the client
area is clipped - these are not expose events. */
DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f,
- XSTRING (f->name)->data));
+ SDATA (f->name)));
}
else if (f->async_visible != 1)
{
f->async_iconified = 0;
SET_FRAME_GARBAGED (f);
DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
- XSTRING (f->name)->data));
+ SDATA (f->name)));
/* WM_PAINT serves as MapNotify as well, so report
visibility changes properly. */
if (f->iconified)
{
- bufp->kind = deiconify_event;
+ bufp->kind = DEICONIFY_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp++;
if (numchars == 0)
abort ();
- bufp->kind = language_change_event;
+ bufp->kind = LANGUAGE_CHANGE_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp->code = msg.msg.wParam;
if (temp_index == sizeof temp_buffer / sizeof (short))
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
- bufp->kind = non_ascii_keystroke;
+ bufp->kind = NON_ASCII_KEYSTROKE_EVENT;
bufp->code = msg.msg.wParam;
bufp->modifiers = msg.dwModifiers;
XSETFRAME (bufp->frame_or_window, f);
if (temp_index == sizeof temp_buffer / sizeof (short))
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
- bufp->kind = ascii_keystroke;
+ bufp->kind = ASCII_KEYSTROKE_EVENT;
bufp->code = msg.msg.wParam;
bufp->modifiers = msg.dwModifiers;
XSETFRAME (bufp->frame_or_window, f);
int button;
int up;
- emacs_event.kind = no_event;
+ emacs_event.kind = NO_EVENT;
if (dpyinfo->grabbed && last_mouse_frame
&& FRAME_LIVE_P (last_mouse_frame))
y = XFASTINT (emacs_event.y);
/* Set x and y. */
- window = window_from_coordinates (f,
- emacs_event.x,
- emacs_event.y,
- &p, 1);
+ window = window_from_coordinates (f, x, y, &p, 1);
+
if (EQ (window, f->tool_bar_window))
{
w32_handle_tool_bar_click (f, &emacs_event);
f->async_visible = 0;
f->async_iconified = 1;
- bufp->kind = iconify_event;
+ bufp->kind = ICONIFY_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp++;
f->output_data.w32->left_pos = x;
f->output_data.w32->top_pos = y;
- bufp->kind = deiconify_event;
+ bufp->kind = DEICONIFY_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp++;
if (numchars == 0)
abort ();
- bufp->kind = delete_window_event;
+ bufp->kind = DELETE_WINDOW_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp++;
if (numchars == 0)
abort ();
- bufp->kind = menu_bar_activate_event;
+ bufp->kind = MENU_BAR_ACTIVATE_EVENT;
XSETFRAME (bufp->frame_or_window, f);
bufp->arg = Qnil;
bufp++;
if (!FRAME_OBSCURED_P (f))
{
DebPrint (("frame %p (%s) obscured\n", f,
- XSTRING (f->name)->data));
+ SDATA (f->name)));
}
}
else
{
SET_FRAME_GARBAGED (f);
DebPrint (("obscured frame %p (%s) found to be visible\n", f,
- XSTRING (f->name)->data));
+ SDATA (f->name)));
/* Force a redisplay sooner or later. */
record_asynch_buffer_change ();
--gerd. */
static void
-x_draw_bar_cursor (w, row, width)
+x_draw_bar_cursor (w, row, width, kind)
struct window *w;
struct glyph_row *row;
int width;
+ enum text_cursor_kinds kind;
{
struct frame *f = XFRAME (w->frame);
struct glyph *cursor_glyph;
if (width < 0)
width = f->output_data.w32->cursor_width;
+ width = min (cursor_glyph->pixel_width, width);
/* If the glyph's background equals the color we normally draw
the bar cursor in, the bar cursor in its normal color is
x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
hdc = get_frame_dc (f);
w32_clip_to_row (w, row, hdc, 0);
- w32_fill_area (f, hdc, cursor_color, x,
- WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
- min (cursor_glyph->pixel_width, width),
- row->height);
+
+ if (kind == BAR_CURSOR)
+ {
+ w32_fill_area (f, hdc, cursor_color, x,
+ WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
+ width, row->height);
+ }
+ else
+ {
+ w32_fill_area (f, hdc, cursor_color, x,
+ WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
+ row->height - width),
+ cursor_glyph->pixel_width, width);
+ }
release_frame_dc (f, hdc);
}
}
break;
case BAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, new_cursor_width);
+ x_draw_bar_cursor (w, glyph_row, new_cursor_width, BAR_CURSOR);
+ break;
+
+ case HBAR_CURSOR:
+ x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR);
break;
case NO_CURSOR:
if (NILP (icon))
hicon = LoadIcon (hinst, EMACS_CLASS);
else if (STRINGP (icon))
- hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0,
+ hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0,
LR_DEFAULTSIZE | LR_LOADFROMFILE);
else if (SYMBOLP (icon))
{
to do. */
return fontset_name (fontset);
- result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data));
+ result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
if (!STRINGP (result))
/* Can't load ASCII font. */
dpyinfo->name_list_element = XCAR (w32_display_name_list);
dpyinfo->w32_id_name
- = (char *) xmalloc (XSTRING (Vinvocation_name)->size
- + XSTRING (Vsystem_name)->size
+ = (char *) xmalloc (SCHARS (Vinvocation_name)
+ + SCHARS (Vsystem_name)
+ 2);
sprintf (dpyinfo->w32_id_name, "%s@%s",
- XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);
+ SDATA (Vinvocation_name), SDATA (Vsystem_name));
/* Default Console mode values - overridden when running in GUI mode
with values obtained from system metrics. */
staticpro (&previous_help_echo);
help_echo_pos = -1;
- DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p,
+ DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window,
doc: /* *Non-nil means autoselect window with mouse pointer. */);
- x_autoselect_window_p = 0;
+ mouse_autoselect_window = 0;
DEFVAR_BOOL ("w32-use-visible-system-caret",
&w32_use_visible_system_caret,
wide as that tab on the display. */);
x_stretch_cursor_p = 0;
-#if 0 /* TODO: Setting underline position from font properties. */
DEFVAR_BOOL ("x-use-underline-position-properties",
&x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil. */);
x_use_underline_position_properties = 1;
-#endif
DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
doc: /* If not nil, Emacs uses toolkit scroll bars. */);