73 |
static int last_mousemove_x = 0; |
static int last_mousemove_x = 0; |
74 |
static int last_mousemove_y = 0; |
static int last_mousemove_y = 0; |
75 |
|
|
76 |
|
/* Define GET_WHEEL_DELTA_WPARAM macro if system headers don't. */ |
77 |
|
#ifndef GET_WHEEL_DELTA_WPARAM |
78 |
|
#define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam)) |
79 |
|
#endif |
80 |
|
|
81 |
/* Non-zero means that a HELP_EVENT has been generated since Emacs |
/* Non-zero means that a HELP_EVENT has been generated since Emacs |
82 |
start. */ |
start. */ |
83 |
|
|
261 |
static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
262 |
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, |
263 |
enum text_cursor_kinds)); |
enum text_cursor_kinds)); |
264 |
static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, |
static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, HDC)); |
|
HDC, int)); |
|
265 |
|
|
266 |
static Lisp_Object Qvendor_specific_keysyms; |
static Lisp_Object Qvendor_specific_keysyms; |
267 |
|
|
300 |
#endif /* 0 */ |
#endif /* 0 */ |
301 |
|
|
302 |
|
|
303 |
void XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, |
void |
304 |
XGCValues *xgcv) |
XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, |
305 |
|
XGCValues *xgcv) |
306 |
{ |
{ |
307 |
if (mask & GCForeground) |
if (mask & GCForeground) |
308 |
gc->foreground = xgcv->foreground; |
gc->foreground = xgcv->foreground; |
323 |
return gc; |
return gc; |
324 |
} |
} |
325 |
|
|
326 |
void XGetGCValues (void* ignore, XGCValues *gc, |
void |
327 |
|
XGetGCValues (void* ignore, XGCValues *gc, |
328 |
unsigned long mask, XGCValues *xgcv) |
unsigned long mask, XGCValues *xgcv) |
329 |
{ |
{ |
330 |
XChangeGC (ignore, xgcv, mask, gc); |
XChangeGC (ignore, xgcv, mask, gc); |
500 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
501 |
RECT r; |
RECT r; |
502 |
HDC hdc; |
HDC hdc; |
503 |
|
|
504 |
r.left = x; |
r.left = x; |
505 |
r.right = x + 1; |
r.right = x + 1; |
506 |
r.top = y0; |
r.top = y0; |
657 |
{ |
{ |
658 |
HDC hdc = get_frame_dc (f); |
HDC hdc = get_frame_dc (f); |
659 |
w32_clear_area (f, hdc, 0, y, width, height); |
w32_clear_area (f, hdc, 0, y, width, height); |
660 |
w32_clear_area (f, hdc, f->output_data.w32->pixel_width - width, |
w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width, |
661 |
y, width, height); |
y, width, height); |
662 |
release_frame_dc (f, hdc); |
release_frame_dc (f, hdc); |
663 |
} |
} |
684 |
hdc = get_frame_dc (f); |
hdc = get_frame_dc (f); |
685 |
|
|
686 |
/* Must clip because of partially visible lines. */ |
/* Must clip because of partially visible lines. */ |
687 |
w32_clip_to_row (w, row, hdc, 1); |
w32_clip_to_row (w, row, hdc); |
688 |
|
|
689 |
if (p->bx >= 0) |
if (p->bx >= 0) |
690 |
{ |
{ |
895 |
BOOL retval; |
BOOL retval; |
896 |
|
|
897 |
xassert (font && char2b); |
xassert (font && char2b); |
898 |
xassert (font_type != UNKNOWN_FONT); |
|
899 |
|
/* TODO: This function is currently called through the RIF, and in |
900 |
|
some cases font_type is UNKNOWN_FONT. We currently allow the |
901 |
|
cached metrics to be used, which seems to work, but in cases |
902 |
|
where font_type is UNKNOWN_FONT, we probably haven't encoded |
903 |
|
char2b appropriately. All callers need checking to see what they |
904 |
|
are passing. This is most likely to affect variable width fonts |
905 |
|
outside the Latin-1 range, particularly in languages like Thai |
906 |
|
that rely on rbearing and lbearing to provide composition. I |
907 |
|
don't think that is working currently anyway, but we don't seem |
908 |
|
to have anyone testing such languages on Windows. */ |
909 |
|
|
910 |
/* Handle the common cases quickly. */ |
/* Handle the common cases quickly. */ |
911 |
if (!font->bdf && font->per_char == NULL) |
if (!font->bdf && font->per_char == NULL) |
914 |
else if (!font->bdf && *char2b < 128) |
else if (!font->bdf && *char2b < 128) |
915 |
return &font->per_char[*char2b]; |
return &font->per_char[*char2b]; |
916 |
|
|
917 |
|
xassert (font_type != UNKNOWN_FONT); |
918 |
|
|
919 |
pcm = &font->scratch; |
pcm = &font->scratch; |
920 |
|
|
921 |
if (font_type == BDF_1D_FONT) |
if (font_type == BDF_1D_FONT) |
1850 |
if (s->row->full_width_p |
if (s->row->full_width_p |
1851 |
&& !s->w->pseudo_window_p) |
&& !s->w->pseudo_window_p) |
1852 |
{ |
{ |
1853 |
last_x += FRAME_X_RIGHT_FRINGE_WIDTH (s->f); |
last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w); |
1854 |
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f)) |
if (s->area != RIGHT_MARGIN_AREA |
1855 |
last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f); |
|| WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) |
1856 |
|
last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w); |
1857 |
} |
} |
1858 |
|
|
1859 |
/* The glyph that may have a right box line. */ |
/* The glyph that may have a right box line. */ |
2275 |
{ |
{ |
2276 |
/* If `x-stretch-block-cursor' is nil, don't draw a block cursor |
/* If `x-stretch-block-cursor' is nil, don't draw a block cursor |
2277 |
as wide as the stretch glyph. */ |
as wide as the stretch glyph. */ |
2278 |
int width = min (CANON_X_UNIT (s->f), s->background_width); |
int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width); |
2279 |
|
|
2280 |
/* Draw cursor. */ |
/* Draw cursor. */ |
2281 |
x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height); |
x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height); |
2620 |
without mode lines. Include in this box the left and right |
without mode lines. Include in this box the left and right |
2621 |
fringes of W. */ |
fringes of W. */ |
2622 |
window_box (w, -1, &x, &y, &width, &height); |
window_box (w, -1, &x, &y, &width, &height); |
|
width += FRAME_X_FRINGE_WIDTH (f); |
|
|
x -= FRAME_X_LEFT_FRINGE_WIDTH (f); |
|
2623 |
|
|
2624 |
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
2625 |
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
2928 |
struct frame *f; |
struct frame *f; |
2929 |
{ |
{ |
2930 |
POINT p; |
POINT p; |
2931 |
result->kind = MOUSE_WHEEL_EVENT; |
int delta; |
2932 |
result->code = (short) HIWORD (msg->msg.wParam); |
|
2933 |
|
result->kind = WHEEL_EVENT; |
2934 |
|
result->code = 0; |
2935 |
result->timestamp = msg->msg.time; |
result->timestamp = msg->msg.time; |
2936 |
result->modifiers = msg->dwModifiers; |
|
2937 |
|
/* A WHEEL_DELTA positive value indicates that the wheel was rotated |
2938 |
|
forward, away from the user (up); a negative value indicates that |
2939 |
|
the wheel was rotated backward, toward the user (down). */ |
2940 |
|
delta = GET_WHEEL_DELTA_WPARAM (msg->msg.wParam); |
2941 |
|
|
2942 |
|
/* The up and down modifiers indicate if the wheel was rotated up or |
2943 |
|
down based on WHEEL_DELTA value. */ |
2944 |
|
result->modifiers = (msg->dwModifiers |
2945 |
|
| ((delta < 0 ) ? down_modifier : up_modifier)); |
2946 |
|
|
2947 |
p.x = LOWORD (msg->msg.lParam); |
p.x = LOWORD (msg->msg.lParam); |
2948 |
p.y = HIWORD (msg->msg.lParam); |
p.y = HIWORD (msg->msg.lParam); |
2949 |
ScreenToClient (msg->msg.hwnd, &p); |
ScreenToClient (msg->msg.hwnd, &p); |
3064 |
static struct scroll_bar *x_window_to_scroll_bar (); |
static struct scroll_bar *x_window_to_scroll_bar (); |
3065 |
static void x_scroll_bar_report_motion (); |
static void x_scroll_bar_report_motion (); |
3066 |
static void x_check_fullscreen P_ ((struct frame *)); |
static void x_check_fullscreen P_ ((struct frame *)); |
|
static void x_check_fullscreen_move P_ ((struct frame *)); |
|
3067 |
static int glyph_rect P_ ((struct frame *f, int, int, RECT *)); |
static int glyph_rect P_ ((struct frame *f, int, int, RECT *)); |
3068 |
|
|
3069 |
|
|
3098 |
{ |
{ |
3099 |
Lisp_Object window; |
Lisp_Object window; |
3100 |
|
|
3101 |
window = window_from_coordinates (f, x, y, 0, 0); |
window = window_from_coordinates (f, x, y, 0, &x, &y, 0); |
3102 |
|
|
3103 |
if (!NILP (window)) |
if (!NILP (window)) |
3104 |
{ |
{ |
3105 |
struct window *w = XWINDOW (window); |
struct window *w = XWINDOW (window); |
3106 |
struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
3107 |
struct glyph_row *end = r + w->current_matrix->nrows - 1; |
struct glyph_row *end = r + w->current_matrix->nrows - 1; |
3108 |
|
|
|
frame_to_window_pixel_xy (w, &x, &y); |
|
|
|
|
3109 |
for (; r < end && r->enabled_p; ++r) |
for (; r < end && r->enabled_p; ++r) |
3110 |
if (r->y <= y && r->y + r->height > y) |
if (r->y <= y && r->y + r->height > y) |
3111 |
{ |
{ |
3120 |
if (x < r->x) |
if (x < r->x) |
3121 |
{ |
{ |
3122 |
/* x is to the left of the first glyph in the row. */ |
/* x is to the left of the first glyph in the row. */ |
3123 |
rect->left = XINT (w->left); |
/* Shouldn't this be a pixel value? |
3124 |
|
WINDOW_LEFT_EDGE_X (w) seems to be the right value. |
3125 |
|
++KFS */ |
3126 |
|
rect->left = WINDOW_LEFT_EDGE_COL (w); |
3127 |
rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x); |
rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x); |
3128 |
return 1; |
return 1; |
3129 |
} |
} |
3139 |
|
|
3140 |
/* x is to the right of the last glyph in the row. */ |
/* x is to the right of the last glyph in the row. */ |
3141 |
rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx); |
rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx); |
3142 |
rect->right = XINT (w->left) + XINT (w->width); |
/* Shouldn't this be a pixel value? |
3143 |
|
WINDOW_RIGHT_EDGE_X (w) seems to be the right value. |
3144 |
|
++KFS */ |
3145 |
|
rect->right = WINDOW_RIGHT_EDGE_COL (w); |
3146 |
return 1; |
return 1; |
3147 |
} |
} |
3148 |
} |
} |
3162 |
int width = FRAME_SMALLEST_CHAR_WIDTH (f1); |
int width = FRAME_SMALLEST_CHAR_WIDTH (f1); |
3163 |
int height = FRAME_SMALLEST_FONT_HEIGHT (f1); |
int height = FRAME_SMALLEST_FONT_HEIGHT (f1); |
3164 |
|
|
3165 |
/* Arrange for the division in PIXEL_TO_CHAR_COL etc. to |
/* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to |
3166 |
round down even for negative values. */ |
round down even for negative values. */ |
3167 |
if (gx < 0) |
if (gx < 0) |
3168 |
gx -= width - 1; |
gx -= width - 1; |
3603 |
struct frame *f = XFRAME (w->frame); |
struct frame *f = XFRAME (w->frame); |
3604 |
struct scroll_bar *bar; |
struct scroll_bar *bar; |
3605 |
int top, height, left, sb_left, width, sb_width; |
int top, height, left, sb_left, width, sb_width; |
3606 |
int window_x, window_y, window_width, window_height; |
int window_y, window_height; |
3607 |
|
|
3608 |
/* Get window dimensions. */ |
/* Get window dimensions. */ |
3609 |
window_box (w, -1, &window_x, &window_y, &window_width, &window_height); |
window_box (w, -1, 0, &window_y, 0, &window_height); |
3610 |
top = window_y; |
top = window_y; |
3611 |
width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f); |
width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f); |
3612 |
height = window_height; |
height = window_height; |
3613 |
|
|
3614 |
/* Compute the left edge of the scroll bar area. */ |
/* Compute the left edge of the scroll bar area. */ |
3615 |
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) |
left = WINDOW_SCROLL_BAR_AREA_X (w); |
|
left = XINT (w->left) + XINT (w->width) - FRAME_SCROLL_BAR_COLS (f); |
|
|
else |
|
|
left = XFASTINT (w->left); |
|
|
left *= CANON_X_UNIT (f); |
|
|
left += FRAME_INTERNAL_BORDER_WIDTH (f); |
|
3616 |
|
|
3617 |
/* Compute the width of the scroll bar which might be less than |
/* Compute the width of the scroll bar which might be less than |
3618 |
the width of the area reserved for the scroll bar. */ |
the width of the area reserved for the scroll bar. */ |
3619 |
if (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0) |
if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0) |
3620 |
sb_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f); |
sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); |
3621 |
else |
else |
3622 |
sb_width = width; |
sb_width = width; |
3623 |
|
|
3624 |
/* Compute the left edge of the scroll bar. */ |
/* Compute the left edge of the scroll bar. */ |
3625 |
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) |
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) |
3626 |
sb_left = left + width - sb_width - (width - sb_width) / 2; |
sb_left = left + width - sb_width - (width - sb_width) / 2; |
3627 |
else |
else |
3628 |
sb_left = left + (width - sb_width) / 2; |
sb_left = left + (width - sb_width) / 2; |
4274 |
int x = LOWORD (msg.msg.lParam); |
int x = LOWORD (msg.msg.lParam); |
4275 |
int y = HIWORD (msg.msg.lParam); |
int y = HIWORD (msg.msg.lParam); |
4276 |
|
|
4277 |
window = window_from_coordinates (f, x, y, 0, 0); |
window = window_from_coordinates (f, x, y, 0, 0, 0, 0); |
4278 |
|
|
4279 |
/* Window will be selected only when it is not |
/* Window will be selected only when it is not |
4280 |
selected now and last mouse movement event was |
selected now and last mouse movement event was |
4359 |
|
|
4360 |
/* Is this in the tool-bar? */ |
/* Is this in the tool-bar? */ |
4361 |
if (WINDOWP (f->tool_bar_window) |
if (WINDOWP (f->tool_bar_window) |
4362 |
&& XFASTINT (XWINDOW (f->tool_bar_window)->height)) |
&& WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) |
4363 |
{ |
{ |
4364 |
Lisp_Object window; |
Lisp_Object window; |
4365 |
int x = XFASTINT (emacs_event.x); |
int x = XFASTINT (emacs_event.x); |
4366 |
int y = XFASTINT (emacs_event.y); |
int y = XFASTINT (emacs_event.y); |
4367 |
|
|
4368 |
window = window_from_coordinates (f, x, y, 0, 1); |
window = window_from_coordinates (f, x, y, 0, 0, 0, 1); |
4369 |
|
|
4370 |
if (EQ (window, f->tool_bar_window)) |
if (EQ (window, f->tool_bar_window)) |
4371 |
{ |
{ |
4410 |
break; |
break; |
4411 |
} |
} |
4412 |
|
|
4413 |
case WM_MOUSEWHEEL: |
case WM_MOUSEWHEEL: |
4414 |
if (dpyinfo->grabbed && last_mouse_frame |
{ |
4415 |
&& FRAME_LIVE_P (last_mouse_frame)) |
if (dpyinfo->grabbed && last_mouse_frame |
4416 |
f = last_mouse_frame; |
&& FRAME_LIVE_P (last_mouse_frame)) |
4417 |
else |
f = last_mouse_frame; |
4418 |
f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
else |
4419 |
|
f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4420 |
|
|
4421 |
if (f) |
if (f) |
4422 |
{ |
{ |
4423 |
if ((!dpyinfo->w32_focus_frame |
|
4424 |
|| f == dpyinfo->w32_focus_frame) |
if ((!dpyinfo->w32_focus_frame |
4425 |
&& (numchars >= 1)) |
|| f == dpyinfo->w32_focus_frame) |
4426 |
{ |
&& (numchars >= 1)) |
4427 |
construct_mouse_wheel (bufp, &msg, f); |
{ |
4428 |
bufp++; |
/* Emit an Emacs wheel-up/down event. */ |
4429 |
count++; |
construct_mouse_wheel (bufp, &msg, f); |
4430 |
numchars--; |
bufp++; |
4431 |
} |
count++; |
4432 |
} |
numchars--; |
4433 |
|
} |
4434 |
|
/* Ignore any mouse motion that happened before this |
4435 |
|
event; any subsequent mouse-movement Emacs events |
4436 |
|
should reflect only motion after the |
4437 |
|
ButtonPress. */ |
4438 |
|
f->mouse_moved = 0; |
4439 |
|
} |
4440 |
|
last_mouse_frame = f; |
4441 |
|
last_tool_bar_item = -1; |
4442 |
|
} |
4443 |
break; |
break; |
4444 |
|
|
4445 |
case WM_DROPFILES: |
case WM_DROPFILES: |
4475 |
f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4476 |
if (f) |
if (f) |
4477 |
{ |
{ |
4478 |
x_check_fullscreen_move(f); |
if (f->want_fullscreen & FULLSCREEN_WAIT) |
4479 |
if (f->output_data.w32->want_fullscreen & FULLSCREEN_WAIT) |
f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH); |
|
f->output_data.w32->want_fullscreen &= |
|
|
~(FULLSCREEN_WAIT|FULLSCREEN_BOTH); |
|
4480 |
} |
} |
4481 |
check_visibility = 1; |
check_visibility = 1; |
4482 |
break; |
break; |
4497 |
int x, y; |
int x, y; |
4498 |
|
|
4499 |
x_real_positions (f, &x, &y); |
x_real_positions (f, &x, &y); |
4500 |
f->output_data.w32->left_pos = x; |
f->left_pos = x; |
4501 |
f->output_data.w32->top_pos = y; |
f->top_pos = y; |
4502 |
} |
} |
4503 |
|
|
4504 |
check_visibility = 1; |
check_visibility = 1; |
4570 |
when the Window is iconified, with 3000,3000 |
when the Window is iconified, with 3000,3000 |
4571 |
as the co-ords. */ |
as the co-ords. */ |
4572 |
x_real_positions (f, &x, &y); |
x_real_positions (f, &x, &y); |
4573 |
f->output_data.w32->left_pos = x; |
f->left_pos = x; |
4574 |
f->output_data.w32->top_pos = y; |
f->top_pos = y; |
4575 |
|
|
4576 |
bufp->kind = DEICONIFY_EVENT; |
bufp->kind = DEICONIFY_EVENT; |
4577 |
XSETFRAME (bufp->frame_or_window, f); |
XSETFRAME (bufp->frame_or_window, f); |
4603 |
height = rect.bottom - rect.top; |
height = rect.bottom - rect.top; |
4604 |
width = rect.right - rect.left; |
width = rect.right - rect.left; |
4605 |
|
|
4606 |
rows = PIXEL_TO_CHAR_HEIGHT (f, height); |
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); |
4607 |
columns = PIXEL_TO_CHAR_WIDTH (f, width); |
columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); |
4608 |
|
|
4609 |
/* TODO: Clip size to the screen dimensions. */ |
/* TODO: Clip size to the screen dimensions. */ |
4610 |
|
|
4612 |
not changed, the font size may have changed, so we need |
not changed, the font size may have changed, so we need |
4613 |
to check the pixel dimensions as well. */ |
to check the pixel dimensions as well. */ |
4614 |
|
|
4615 |
if (columns != f->width |
if (columns != FRAME_COLS (f) |
4616 |
|| rows != f->height |
|| rows != FRAME_LINES (f) |
4617 |
|| width != f->output_data.w32->pixel_width |
|| width != FRAME_PIXEL_WIDTH (f) |
4618 |
|| height != f->output_data.w32->pixel_height) |
|| height != FRAME_PIXEL_HEIGHT (f)) |
4619 |
{ |
{ |
4620 |
change_frame_size (f, rows, columns, 0, 1, 0); |
change_frame_size (f, rows, columns, 0, 1, 0); |
4621 |
SET_FRAME_GARBAGED (f); |
SET_FRAME_GARBAGED (f); |
4622 |
cancel_mouse_face (f); |
cancel_mouse_face (f); |
4623 |
f->output_data.w32->pixel_width = width; |
FRAME_PIXEL_WIDTH (f) = width; |
4624 |
f->output_data.w32->pixel_height = height; |
FRAME_PIXEL_HEIGHT (f) = height; |
4625 |
f->output_data.w32->win_gravity = NorthWestGravity; |
f->win_gravity = NorthWestGravity; |
4626 |
} |
} |
4627 |
} |
} |
4628 |
|
|
4662 |
case WM_SETFOCUS: |
case WM_SETFOCUS: |
4663 |
/* TODO: Port this change: |
/* TODO: Port this change: |
4664 |
2002-06-28 Jan D. <jan.h.d@swipnet.se> |
2002-06-28 Jan D. <jan.h.d@swipnet.se> |
4665 |
* xterm.h (struct x_output): Add focus_state. |
* xterm.h (struct x_output): Add focus_state. |
4666 |
* xterm.c (x_focus_changed): New function. |
* xterm.c (x_focus_changed): New function. |
4667 |
(x_detect_focus_change): New function. |
(x_detect_focus_change): New function. |
4668 |
(XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut |
(XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut |
4669 |
EnterNotify and LeaveNotify to track X focus changes. |
EnterNotify and LeaveNotify to track X focus changes. |
4670 |
*/ |
*/ |
4671 |
f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd); |
f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd); |
4672 |
|
|
4673 |
dpyinfo->w32_focus_event_frame = f; |
dpyinfo->w32_focus_event_frame = f; |
4784 |
break; |
break; |
4785 |
|
|
4786 |
default: |
default: |
4787 |
/* Check for messages registered at runtime. */ |
/* Check for messages registered at runtime. */ |
4788 |
if (msg.msg.message == msh_mousewheel) |
if (msg.msg.message == msh_mousewheel) |
4789 |
{ |
{ |
4790 |
if (dpyinfo->grabbed && last_mouse_frame |
/* Forward MSH_MOUSEWHEEL as WM_MOUSEWHEEL. */ |
4791 |
&& FRAME_LIVE_P (last_mouse_frame)) |
msg.msg.message = WM_MOUSEWHEEL; |
4792 |
f = last_mouse_frame; |
prepend_msg (&msg); |
|
else |
|
|
f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
|
|
|
|
|
if (f) |
|
|
{ |
|
|
if ((!dpyinfo->w32_focus_frame |
|
|
|| f == dpyinfo->w32_focus_frame) |
|
|
&& (numchars >= 1)) |
|
|
{ |
|
|
construct_mouse_wheel (bufp, &msg, f); |
|
|
bufp++; |
|
|
count++; |
|
|
numchars--; |
|
|
} |
|
|
} |
|
4793 |
} |
} |
4794 |
break; |
break; |
4795 |
} |
} |
4814 |
Lisp_Object tail, frame; |
Lisp_Object tail, frame; |
4815 |
|
|
4816 |
FOR_EACH_FRAME (tail, frame) |
FOR_EACH_FRAME (tail, frame) |
4817 |
{ |
{ |
4818 |
FRAME_PTR f = XFRAME (frame); |
FRAME_PTR f = XFRAME (frame); |
4819 |
/* The tooltip has been drawn already. Avoid the |
/* The tooltip has been drawn already. Avoid the |
4820 |
SET_FRAME_GARBAGED below. */ |
SET_FRAME_GARBAGED below. */ |
4821 |
if (EQ (frame, tip_frame)) |
if (EQ (frame, tip_frame)) |
4822 |
continue; |
continue; |
4823 |
|
|
4824 |
/* Check "visible" frames and mark each as obscured or not. |
/* Check "visible" frames and mark each as obscured or not. |
4825 |
Note that async_visible is nonzero for unobscured and |
Note that async_visible is nonzero for unobscured and |
4826 |
obscured frames, but zero for hidden and iconified frames. */ |
obscured frames, but zero for hidden and iconified frames. */ |
4827 |
if (FRAME_W32_P (f) && f->async_visible) |
if (FRAME_W32_P (f) && f->async_visible) |
4828 |
{ |
{ |
4829 |
RECT clipbox; |
RECT clipbox; |
4830 |
HDC hdc; |
HDC hdc; |
4831 |
|
|
4832 |
enter_crit (); |
enter_crit (); |
4833 |
/* Query clipping rectangle for the entire window area |
/* Query clipping rectangle for the entire window area |
4834 |
(GetWindowDC), not just the client portion (GetDC). |
(GetWindowDC), not just the client portion (GetDC). |
4835 |
Otherwise, the scrollbars and menubar aren't counted as |
Otherwise, the scrollbars and menubar aren't counted as |
4836 |
part of the visible area of the frame, and we may think |
part of the visible area of the frame, and we may think |
4837 |
the frame is obscured when really a scrollbar is still |
the frame is obscured when really a scrollbar is still |
4838 |
visible and gets WM_PAINT messages above. */ |
visible and gets WM_PAINT messages above. */ |
4839 |
hdc = GetWindowDC (FRAME_W32_WINDOW (f)); |
hdc = GetWindowDC (FRAME_W32_WINDOW (f)); |
4840 |
GetClipBox (hdc, &clipbox); |
GetClipBox (hdc, &clipbox); |
4841 |
ReleaseDC (FRAME_W32_WINDOW (f), hdc); |
ReleaseDC (FRAME_W32_WINDOW (f), hdc); |
4842 |
leave_crit (); |
leave_crit (); |
4843 |
|
|
4844 |
if (clipbox.right == clipbox.left |
if (clipbox.right == clipbox.left |
4845 |
|| clipbox.bottom == clipbox.top) |
|| clipbox.bottom == clipbox.top) |
4846 |
{ |
{ |
4847 |
/* Frame has become completely obscured so mark as |
/* Frame has become completely obscured so mark as |
4848 |
such (we do this by setting async_visible to 2 so |
such (we do this by setting async_visible to 2 so |
4849 |
that FRAME_VISIBLE_P is still true, but redisplay |
that FRAME_VISIBLE_P is still true, but redisplay |
4850 |
will skip it). */ |
will skip it). */ |
4851 |
f->async_visible = 2; |
f->async_visible = 2; |
4852 |
|
|
4853 |
if (!FRAME_OBSCURED_P (f)) |
if (!FRAME_OBSCURED_P (f)) |
4854 |
{ |
{ |
4855 |
DebPrint (("frame %p (%s) obscured\n", f, |
DebPrint (("frame %p (%s) obscured\n", f, |
4856 |
SDATA (f->name))); |
SDATA (f->name))); |
4857 |
} |
} |
4858 |
} |
} |
4859 |
else |
else |
4860 |
{ |
{ |
4861 |
/* Frame is not obscured, so mark it as such. */ |
/* Frame is not obscured, so mark it as such. */ |
4862 |
f->async_visible = 1; |
f->async_visible = 1; |
4863 |
|
|
4864 |
if (FRAME_OBSCURED_P (f)) |
if (FRAME_OBSCURED_P (f)) |
4865 |
{ |
{ |
4866 |
SET_FRAME_GARBAGED (f); |
SET_FRAME_GARBAGED (f); |
4867 |
DebPrint (("obscured frame %p (%s) found to be visible\n", f, |
DebPrint (("obscured frame %p (%s) found to be visible\n", f, |
4868 |
SDATA (f->name))); |
SDATA (f->name))); |
4869 |
|
|
4870 |
/* Force a redisplay sooner or later. */ |
/* Force a redisplay sooner or later. */ |
4871 |
record_asynch_buffer_change (); |
record_asynch_buffer_change (); |
4872 |
} |
} |
4873 |
} |
} |
4874 |
} |
} |
4875 |
} |
} |
4876 |
} |
} |
4877 |
|
|
4878 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
4888 |
|
|
4889 |
/* Set clipping for output in glyph row ROW. W is the window in which |
/* Set clipping for output in glyph row ROW. W is the window in which |
4890 |
we operate. GC is the graphics context to set clipping in. |
we operate. GC is the graphics context to set clipping in. |
|
WHOLE_LINE_P non-zero means include the areas used for truncation |
|
|
mark display and alike in the clipping rectangle. |
|
4891 |
|
|
4892 |
ROW may be a text row or, e.g., a mode line. Text rows must be |
ROW may be a text row or, e.g., a mode line. Text rows must be |
4893 |
clipped to the interior of the window dedicated to text display, |
clipped to the interior of the window dedicated to text display, |
4894 |
mode lines must be clipped to the whole window. */ |
mode lines must be clipped to the whole window. */ |
4895 |
|
|
4896 |
static void |
static void |
4897 |
w32_clip_to_row (w, row, hdc, whole_line_p) |
w32_clip_to_row (w, row, hdc) |
4898 |
struct window *w; |
struct window *w; |
4899 |
struct glyph_row *row; |
struct glyph_row *row; |
4900 |
HDC hdc; |
HDC hdc; |
|
int whole_line_p; |
|
4901 |
{ |
{ |
4902 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
4903 |
RECT clip_rect; |
RECT clip_rect; |
4904 |
int window_x, window_y, window_width, window_height; |
int window_y, window_width; |
4905 |
|
|
4906 |
window_box (w, -1, &window_x, &window_y, &window_width, &window_height); |
window_box (w, -1, 0, &window_y, &window_width, 0); |
4907 |
|
|
4908 |
clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0); |
clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0); |
4909 |
clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
4911 |
clip_rect.right = clip_rect.left + window_width; |
clip_rect.right = clip_rect.left + window_width; |
4912 |
clip_rect.bottom = clip_rect.top + row->visible_height; |
clip_rect.bottom = clip_rect.top + row->visible_height; |
4913 |
|
|
|
/* If clipping to the whole line, including trunc marks, extend |
|
|
the rectangle to the left and increase its width. */ |
|
|
if (whole_line_p) |
|
|
{ |
|
|
clip_rect.left -= FRAME_X_LEFT_FRINGE_WIDTH (f); |
|
|
clip_rect.right += FRAME_X_FRINGE_WIDTH (f); |
|
|
} |
|
|
|
|
4914 |
w32_set_clip_rectangle (hdc, &clip_rect); |
w32_set_clip_rectangle (hdc, &clip_rect); |
4915 |
} |
} |
4916 |
|
|
4949 |
wd = cursor_glyph->pixel_width; |
wd = cursor_glyph->pixel_width; |
4950 |
if (cursor_glyph->type == STRETCH_GLYPH |
if (cursor_glyph->type == STRETCH_GLYPH |
4951 |
&& !x_stretch_cursor_p) |
&& !x_stretch_cursor_p) |
4952 |
wd = min (CANON_X_UNIT (f), wd); |
wd = min (FRAME_COLUMN_WIDTH (f), wd); |
4953 |
w->phys_cursor_width = wd; |
w->phys_cursor_width = wd; |
4954 |
|
|
4955 |
rect.right = rect.left + wd; |
rect.right = rect.left + wd; |
4956 |
hdc = get_frame_dc (f); |
hdc = get_frame_dc (f); |
4957 |
/* Set clipping, draw the rectangle, and reset clipping again. */ |
/* Set clipping, draw the rectangle, and reset clipping again. */ |
4958 |
w32_clip_to_row (w, row, hdc, 0); |
w32_clip_to_row (w, row, hdc); |
4959 |
FrameRect (hdc, &rect, hb); |
FrameRect (hdc, &rect, hb); |
4960 |
DeleteObject (hb); |
DeleteObject (hb); |
4961 |
w32_set_clip_rectangle (hdc, NULL); |
w32_set_clip_rectangle (hdc, NULL); |
5021 |
|
|
5022 |
|
|
5023 |
hdc = get_frame_dc (f); |
hdc = get_frame_dc (f); |
5024 |
w32_clip_to_row (w, row, hdc, 0); |
w32_clip_to_row (w, row, hdc); |
5025 |
|
|
5026 |
if (kind == BAR_CURSOR) |
if (kind == BAR_CURSOR) |
5027 |
{ |
{ |
5250 |
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset; |
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset; |
5251 |
FRAME_FONTSET (f) = -1; |
FRAME_FONTSET (f) = -1; |
5252 |
|
|
5253 |
|
FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f)); |
5254 |
|
FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f)); |
5255 |
|
|
5256 |
|
compute_fringe_widths (f, 1); |
5257 |
|
|
5258 |
/* Compute the scroll bar width in character columns. */ |
/* Compute the scroll bar width in character columns. */ |
5259 |
if (f->scroll_bar_pixel_width > 0) |
if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) |
5260 |
{ |
{ |
5261 |
int wid = FONT_WIDTH (FRAME_FONT (f)); |
int wid = FRAME_COLUMN_WIDTH (f); |
5262 |
f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; |
FRAME_CONFIG_SCROLL_BAR_COLS (f) |
5263 |
|
= (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; |
5264 |
} |
} |
5265 |
else |
else |
5266 |
{ |
{ |
5267 |
int wid = FONT_WIDTH (FRAME_FONT (f)); |
int wid = FRAME_COLUMN_WIDTH (f); |
5268 |
f->scroll_bar_cols = (14 + wid - 1) / wid; |
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; |
5269 |
} |
} |
5270 |
|
|
5271 |
/* Now make the frame display the given font. */ |
/* Now make the frame display the given font. */ |
5272 |
if (FRAME_W32_WINDOW (f) != 0) |
if (FRAME_W32_WINDOW (f) != 0) |
5273 |
{ |
{ |
|
frame_update_line_height (f); |
|
5274 |
if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
5275 |
x_set_window_size (f, 0, f->width, f->height); |
x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
5276 |
} |
} |
|
else |
|
|
/* If we are setting a new frame's font for the first time, |
|
|
there are no faces yet, so this font's height is the line height. */ |
|
|
f->output_data.w32->line_height = FONT_HEIGHT (FRAME_FONT (f)); |
|
5277 |
|
|
5278 |
return build_string (fontp->full_name); |
return build_string (fontp->full_name); |
5279 |
} |
} |
5335 |
struct frame *f; |
struct frame *f; |
5336 |
{ |
{ |
5337 |
POINT pt; |
POINT pt; |
5338 |
int flags = f->output_data.w32->size_hint_flags; |
int flags = f->size_hint_flags; |
5339 |
|
|
5340 |
pt.x = pt.y = 0; |
pt.x = pt.y = 0; |
5341 |
|
|
5367 |
/* Treat negative positions as relative to the leftmost bottommost |
/* Treat negative positions as relative to the leftmost bottommost |
5368 |
position that fits on the screen. */ |
position that fits on the screen. */ |
5369 |
if (flags & XNegative) |
if (flags & XNegative) |
5370 |
f->output_data.w32->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width |
f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width |
5371 |
- 2 * f->output_data.w32->border_width - pt.x |
- 2 * f->border_width - pt.x |
5372 |
- PIXEL_WIDTH (f) |
- FRAME_PIXEL_WIDTH (f) |
5373 |
+ f->output_data.w32->left_pos); |
+ f->left_pos); |
5374 |
|
|
5375 |
if (flags & YNegative) |
if (flags & YNegative) |
5376 |
f->output_data.w32->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height |
f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height |
5377 |
- 2 * f->output_data.w32->border_width - pt.y |
- 2 * f->border_width - pt.y |
5378 |
- PIXEL_HEIGHT (f) |
- FRAME_PIXEL_HEIGHT (f) |
5379 |
+ f->output_data.w32->top_pos); |
+ f->top_pos); |
5380 |
/* The left_pos and top_pos |
/* The left_pos and top_pos |
5381 |
are now relative to the top and left screen edges, |
are now relative to the top and left screen edges, |
5382 |
so the flags should correspond. */ |
so the flags should correspond. */ |
5383 |
f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative); |
f->size_hint_flags &= ~ (XNegative | YNegative); |
5384 |
} |
} |
5385 |
|
|
5386 |
/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, |
/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, |
5399 |
|
|
5400 |
if (change_gravity > 0) |
if (change_gravity > 0) |
5401 |
{ |
{ |
5402 |
f->output_data.w32->top_pos = yoff; |
f->top_pos = yoff; |
5403 |
f->output_data.w32->left_pos = xoff; |
f->left_pos = xoff; |
5404 |
f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative); |
f->size_hint_flags &= ~ (XNegative | YNegative); |
5405 |
if (xoff < 0) |
if (xoff < 0) |
5406 |
f->output_data.w32->size_hint_flags |= XNegative; |
f->size_hint_flags |= XNegative; |
5407 |
if (yoff < 0) |
if (yoff < 0) |
5408 |
f->output_data.w32->size_hint_flags |= YNegative; |
f->size_hint_flags |= YNegative; |
5409 |
f->output_data.w32->win_gravity = NorthWestGravity; |
f->win_gravity = NorthWestGravity; |
5410 |
} |
} |
5411 |
x_calc_absolute_position (f); |
x_calc_absolute_position (f); |
5412 |
|
|
5413 |
BLOCK_INPUT; |
BLOCK_INPUT; |
5414 |
x_wm_set_size_hint (f, (long) 0, 0); |
x_wm_set_size_hint (f, (long) 0, 0); |
5415 |
|
|
5416 |
modified_left = f->output_data.w32->left_pos; |
modified_left = f->left_pos; |
5417 |
modified_top = f->output_data.w32->top_pos; |
modified_top = f->top_pos; |
5418 |
|
|
5419 |
my_set_window_pos (FRAME_W32_WINDOW (f), |
my_set_window_pos (FRAME_W32_WINDOW (f), |
5420 |
NULL, |
NULL, |
5431 |
x_check_fullscreen (f) |
x_check_fullscreen (f) |
5432 |
struct frame *f; |
struct frame *f; |
5433 |
{ |
{ |
5434 |
if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH) |
if (f->want_fullscreen & FULLSCREEN_BOTH) |
5435 |
{ |
{ |
5436 |
int width, height, ign; |
int width, height, ign; |
5437 |
|
|
5438 |
x_real_positions (f, &f->output_data.w32->left_pos, |
x_real_positions (f, &f->left_pos, &f->top_pos); |
|
&f->output_data.w32->top_pos); |
|
5439 |
|
|
5440 |
x_fullscreen_adjust (f, &width, &height, &ign, &ign); |
x_fullscreen_adjust (f, &width, &height, &ign, &ign); |
5441 |
|
|
5442 |
/* We do not need to move the window, it shall be taken care of |
/* We do not need to move the window, it shall be taken care of |
5443 |
when setting WM manager hints. |
when setting WM manager hints. */ |
5444 |
If the frame is visible already, the position is checked by |
if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) |
|
x_check_fullscreen_move. */ |
|
|
if (f->width != width || f->height != height) |
|
5445 |
{ |
{ |
5446 |
change_frame_size (f, height, width, 0, 1, 0); |
change_frame_size (f, height, width, 0, 1, 0); |
5447 |
SET_FRAME_GARBAGED (f); |
SET_FRAME_GARBAGED (f); |
5448 |
cancel_mouse_face (f); |
cancel_mouse_face (f); |
5449 |
|
|
5450 |
/* Wait for the change of frame size to occur */ |
/* Wait for the change of frame size to occur */ |
5451 |
f->output_data.w32->want_fullscreen |= FULLSCREEN_WAIT; |
f->want_fullscreen |= FULLSCREEN_WAIT; |
5452 |
} |
} |
5453 |
} |
} |
5454 |
} |
} |
5455 |
|
|
|
/* If frame parameters are set after the frame is mapped, we need to move |
|
|
the window. This is done in xfns.c. |
|
|
Some window managers moves the window to the right position, some |
|
|
moves the outer window manager window to the specified position. |
|
|
Here we check that we are in the right spot. If not, make a second |
|
|
move, assuming we are dealing with the second kind of window manager. */ |
|
|
static void |
|
|
x_check_fullscreen_move (f) |
|
|
struct frame *f; |
|
|
{ |
|
|
if (f->output_data.w32->want_fullscreen & FULLSCREEN_MOVE_WAIT) |
|
|
{ |
|
|
int expect_top = f->output_data.w32->top_pos; |
|
|
int expect_left = f->output_data.w32->left_pos; |
|
|
|
|
|
if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT) |
|
|
expect_top = 0; |
|
|
if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH) |
|
|
expect_left = 0; |
|
|
|
|
|
if (expect_top != f->output_data.w32->top_pos |
|
|
|| expect_left != f->output_data.w32->left_pos) |
|
|
x_set_offset (f, expect_left, expect_top, 1); |
|
|
|
|
|
/* Just do this once */ |
|
|
f->output_data.w32->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
5456 |
/* Call this to change the size of frame F's x-window. |
/* Call this to change the size of frame F's x-window. |
5457 |
If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity |
If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity |
5458 |
for this size change and subsequent size changes. |
for this size change and subsequent size changes. |
5469 |
BLOCK_INPUT; |
BLOCK_INPUT; |
5470 |
|
|
5471 |
check_frame_size (f, &rows, &cols); |
check_frame_size (f, &rows, &cols); |
5472 |
f->output_data.w32->vertical_scroll_bar_extra |
f->scroll_bar_actual_width |
5473 |
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
= FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
|
? 0 |
|
|
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); |
|
5474 |
|
|
5475 |
compute_fringe_widths (f, 0); |
compute_fringe_widths (f, 0); |
5476 |
|
|
5477 |
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); |
5478 |
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); |
5479 |
|
|
5480 |
f->output_data.w32->win_gravity = NorthWestGravity; |
f->win_gravity = NorthWestGravity; |
5481 |
x_wm_set_size_hint (f, (long) 0, 0); |
x_wm_set_size_hint (f, (long) 0, 0); |
5482 |
|
|
5483 |
{ |
{ |
5512 |
We pass 1 for DELAY since we can't run Lisp code inside of |
We pass 1 for DELAY since we can't run Lisp code inside of |
5513 |
a BLOCK_INPUT. */ |
a BLOCK_INPUT. */ |
5514 |
change_frame_size (f, rows, cols, 0, 1, 0); |
change_frame_size (f, rows, cols, 0, 1, 0); |
5515 |
PIXEL_WIDTH (f) = pixelwidth; |
FRAME_PIXEL_WIDTH (f) = pixelwidth; |
5516 |
PIXEL_HEIGHT (f) = pixelheight; |
FRAME_PIXEL_HEIGHT (f) = pixelheight; |
5517 |
|
|
5518 |
/* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
/* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
5519 |
receive in the ConfigureNotify event; if we get what we asked |
receive in the ConfigureNotify event; if we get what we asked |
5544 |
{ |
{ |
5545 |
int pix_x, pix_y; |
int pix_x, pix_y; |
5546 |
|
|
5547 |
pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.w32->font) / 2; |
pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2; |
5548 |
pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.w32->line_height / 2; |
pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2; |
5549 |
|
|
5550 |
if (pix_x < 0) pix_x = 0; |
if (pix_x < 0) pix_x = 0; |
5551 |
if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); |
if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f); |
5552 |
|
|
5553 |
if (pix_y < 0) pix_y = 0; |
if (pix_y < 0) pix_y = 0; |
5554 |
if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f); |
if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f); |
5555 |
|
|
5556 |
x_set_mouse_pixel_position (f, pix_x, pix_y); |
x_set_mouse_pixel_position (f, pix_x, pix_y); |
5557 |
} |
} |
5719 |
before the window gets really visible. */ |
before the window gets really visible. */ |
5720 |
if (! FRAME_ICONIFIED_P (f) |
if (! FRAME_ICONIFIED_P (f) |
5721 |
&& ! f->output_data.w32->asked_for_visible) |
&& ! f->output_data.w32->asked_for_visible) |
5722 |
x_set_offset (f, f->output_data.w32->left_pos, f->output_data.w32->top_pos, 0); |
x_set_offset (f, f->left_pos, f->top_pos, 0); |
5723 |
|
|
5724 |
f->output_data.w32->asked_for_visible = 1; |
f->output_data.w32->asked_for_visible = 1; |
5725 |
|
|
5907 |
|
|
5908 |
enter_crit (); |
enter_crit (); |
5909 |
|
|
5910 |
SetWindowLong (window, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font)); |
SetWindowLong (window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f)); |
5911 |
SetWindowLong (window, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height); |
SetWindowLong (window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f)); |
5912 |
SetWindowLong (window, WND_BORDER_INDEX, f->output_data.w32->internal_border_width); |
SetWindowLong (window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f)); |
5913 |
SetWindowLong (window, WND_SCROLLBAR_INDEX, f->output_data.w32->vertical_scroll_bar_extra); |
SetWindowLong (window, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width); |
5914 |
|
|
5915 |
leave_crit (); |
leave_crit (); |
5916 |
} |
} |
5917 |
|
|
5918 |
/* Window manager things */ |
/* Window manager things */ |
5919 |
void x_wm_set_icon_position (f, icon_x, icon_y) |
void |
5920 |
|
x_wm_set_icon_position (f, icon_x, icon_y) |
5921 |
struct frame *f; |
struct frame *f; |
5922 |
int icon_x, icon_y; |
int icon_x, icon_y; |
5923 |
{ |
{ |
6214 |
unsigned char *bits = fringe_bitmaps[i].bits; |
unsigned char *bits = fringe_bitmaps[i].bits; |
6215 |
for (j = 0; j < h; j++) |
for (j = 0; j < h; j++) |
6216 |
{ |
{ |
6217 |
static unsigned char swap_nibble[16] |
static unsigned char swap_nibble[16] |
6218 |
= { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ |
= { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ |
6219 |
0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ |
0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ |
6220 |
0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ |
0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ |
6221 |
0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */ |
0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */ |
6222 |
|
|
6223 |
unsigned char b = *bits++; |
unsigned char b = *bits++; |
6224 |
*wb++ = (unsigned short)((swap_nibble[b & 0xf]<<4) |
*wb++ = (unsigned short)((swap_nibble[b & 0xf]<<4) |
6225 |
| (swap_nibble[(b>>4) & 0xf])); |
| (swap_nibble[(b>>4) & 0xf])); |
6525 |
staticpro (&last_mouse_motion_frame); |
staticpro (&last_mouse_motion_frame); |
6526 |
last_mouse_motion_frame = Qnil; |
last_mouse_motion_frame = Qnil; |
6527 |
} |
} |
6528 |
|
|
6529 |
|
/* arch-tag: 5fa70624-ab86-499c-8a85-473958ee4646 |
6530 |
|
(do not change this comment) */ |