/* Implementation of GUI terminal on the Microsoft Windows API.
-Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
w32_frame_up_to_date (struct frame *f)
{
if (FRAME_W32_P (f))
- {
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-
- if (hlinfo->mouse_face_deferred_gc
- || f == hlinfo->mouse_face_mouse_frame)
- {
- block_input ();
- if (hlinfo->mouse_face_mouse_frame)
- note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
- hlinfo->mouse_face_mouse_x,
- hlinfo->mouse_face_mouse_y);
- hlinfo->mouse_face_deferred_gc = 0;
- unblock_input ();
- }
- }
+ FRAME_MOUSE_UPDATE (f);
}
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 - top_y - 2 * i + 1);
+ left_x + i, top_y + (i + 1) * top_p, 1,
+ bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
if (raised_p)
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
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 - top_y - 2 * i - 1);
+ right_x - i, top_y + (i + 1) * top_p, 1,
+ bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
w32_set_clip_rectangle (hdc, NULL);
static void
x_draw_image_relief (struct glyph_string *s)
{
- int x0, y0, x1, y1, thick, raised_p;
+ int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
RECT r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
raised_p = s->img->relief > 0;
}
- x0 = x - thick;
- y0 = y - thick;
- x1 = x + s->slice.width + thick - 1;
- y1 = y + s->slice.height + thick - 1;
+ x1 = x + s->slice.width - 1;
+ y1 = y + s->slice.height - 1;
+ top_p = bot_p = left_p = right_p = 0;
+
+ if (s->slice.x == 0)
+ x -= thick, left_p = 1;
+ if (s->slice.y == 0)
+ y -= thick, top_p = 1;
+ if (s->slice.x + s->slice.width == s->img->width)
+ x1 += thick, right_p = 1;
+ if (s->slice.y + s->slice.height == s->img->height)
+ y1 += thick, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
- w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
- s->slice.y == 0,
- s->slice.y + s->slice.height == s->img->height,
- s->slice.x == 0,
- s->slice.x + s->slice.width == s->img->width,
- &r);
+ w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
+ top_p, bot_p, left_p, right_p, &r);
}
return retval;
}
+#ifdef WINDOWSNT
/* Put file notifications into the Emacs input event queue. This
function runs when the WM_EMACS_FILENOTIFY message arrives from a
watcher thread. */
/* We've stuffed all the events ourselves, so w32_read_socket shouldn't. */
event->kind = NO_EVENT;
}
+#endif
\f
/* Function to report a mouse movement to the mainstream Emacs code.
static struct scroll_bar *
x_window_to_scroll_bar (Window window_id)
{
- Lisp_Object tail;
+ Lisp_Object tail, frame;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- Lisp_Object frame, bar, condemned;
-
- frame = XCAR (tail);
- /* All elements of Vframe_list should be frames. */
- if (! FRAMEP (frame))
- emacs_abort ();
+ Lisp_Object bar, condemned;
/* Scan this frame's scroll bar list for a scroll bar with the
right window ID. */
HWND hwnd;
SCROLLINFO si;
struct scroll_bar *bar
- = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil));
+ = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil));
Lisp_Object barobj;
block_input ();
check_visibility = 1;
break;
+#ifdef WINDOWSNT
case WM_EMACS_FILENOTIFY:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
queue_notifications (&inev, &msg, f, &count);
break;
+#endif
default:
/* Check for messages registered at runtime. */
FRAME_FONT (f) = font;
FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
FRAME_COLUMN_WIDTH (f) = font->average_width;
- FRAME_SPACE_WIDTH (f) = font->space_width;
FRAME_LINE_HEIGHT (f) = font->height;
compute_fringe_widths (f, 1);
}
}
+static void
+w32fullscreen_hook (FRAME_PTR f)
+{
+ static int normal_width, normal_height, normal_top, normal_left;
+
+ if (f->async_visible)
+ {
+ int width, height, top_pos, left_pos, pixel_height, pixel_width;
+ int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f);
+ RECT workarea_rect;
+
+ block_input ();
+ if (normal_height <= 0)
+ normal_height = cur_h;
+ if (normal_width <= 0)
+ normal_width = cur_w;
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+ x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos);
+
+ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ pixel_height = workarea_rect.bottom - workarea_rect.top;
+ pixel_width = workarea_rect.right - workarea_rect.left;
+
+ switch (f->want_fullscreen)
+ {
+ /* No difference between these two when there is no WM */
+ case FULLSCREEN_MAXIMIZED:
+ PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
+ break;
+ case FULLSCREEN_BOTH:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ left_pos = workarea_rect.left;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_WIDTH:
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ if (normal_height > 0)
+ height = normal_height;
+ left_pos = workarea_rect.left;
+ break;
+ case FULLSCREEN_HEIGHT:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ if (normal_width > 0)
+ width = normal_width;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_NONE:
+ if (normal_height > 0)
+ height = normal_height;
+ else
+ normal_height = height;
+ if (normal_width > 0)
+ width = normal_width;
+ else
+ normal_width = width;
+ /* FIXME: Should restore the original position of the frame. */
+ top_pos = left_pos = 0;
+ break;
+ }
+
+ if (cur_w != width || cur_h != height)
+ {
+ x_set_offset (f, left_pos, top_pos, 1);
+ x_set_window_size (f, 1, width, height);
+ do_pending_window_change (0);
+ }
+ unblock_input ();
+ }
+}
+
/* Call this to change the size of frame F's x-window.
If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
for this size change and subsequent size changes.
hlinfo->mouse_face_end_row
= hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
}
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 = w32fullscreen_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;