Commit Graph

120 Commits

Author SHA1 Message Date
Jason Rumney
abb15ebda6 (w32_system_caret_hwnd, w32_system_caret_width)
(w32_system_caret_height, w32_system_caret_x)
(w32_system_caret_y): New variables for tracking system caret.
(w32_initialize): Initialize them.
(x_display_and_set_cursor): Make system caret follow the active cursor.
2001-10-27 22:21:24 +00:00
Gerd Moellmann
62e3398212 (fast_find_position): Call row_containing_pos
with additional argument.
2001-10-24 09:12:40 +00:00
Jason Rumney
98515cf03b (x_erase_phys_cursor): Remove inverse_p. 2001-10-21 21:23:03 +00:00
Jason Rumney
565153ffd3 Fix formatting for new function. 2001-10-21 18:35:35 +00:00
Jason Rumney
9f5a911b46 (remember_mouse_glyph): New function.
(w32_mouse_position): Use it.
(note_mouse_movement): If the mouse moved off the glyph, remember its
new position.

Sync with xterm.c:
(notice_overwritten_cursor): Renamed from note_overwritten_text_cursor.
Rewritten to take glyph widths into account.
(x_y_to_hpos_vpos): Add parameter BUFFER_ONLY_P.
(fast_find_string_pos): New function.
(fast_find_position): Return the correct vpos.  Add parameter STOP.
In the final row, stop before glyphs having STOP as object.
Don't consider glyphs that are not from a buffer.
(fast_find_position) [0]: Add a presumably more correct version for after 21.1.
(expose_window_tree, expose_frame): Don't compute intersections here.
(expose_window): Do it here instead.
(expose_window_tree, expose_window, expose_line): Return 1 when
overwriting mouse-face.
(expose_window): If W is the window currently being updated, mark
the frame garbaged.
(expose_frame): If mouse-face was overwritten, redo it.
(x_use_underline_position_properties): New variable.
(syms_of_xterm): DEFVAR_BOOL it.
(x_draw_glyph_string): Add comment to use it in future.
(x_draw_glyph_string): Restore clipping after drawing box.
Fix a computation of the underline position.
(w32_get_glyph_string_clip_rect): Minor cleanup.
(x_fill_stretch_glyph_string): Remove an assertion.
(x_produce_glyphs): Don't convert multibyte characters
to unibyte characters in unibyte buffers.
(cursor_in_mouse_face_p): New function.
(x_draw_stretch_glyph_string): Use it to choose a different GC
when drawing a cursor within highlighted text.  Don't draw
background again if it has already been drawn.
(x_draw_glyph_string_box): Don't draw a full-width
box just because the glyph row's full_width_p flag is set.
(x_draw_glyphs): Fix computation of rightmost x for full-width rows.
(x_dump_glyph_string): Put in #if GLYPH_DEBUG.
(w32_draw_relief_rect): Extend left shadow to the bottom and left;
change bottom shadow accordingly. Some cleanup.
(x_update_window_end): Handle overwritten mouse face
also for tool bar windows.
(show_mouse_face): Set the glyph row's mouse_face_p flag also when
DRAW is DRAW_IMAGE_RAISED.
(clear_mouse_face): Return 1 if text with mouse face was
actually redrawn.  Make the function static.  Reset
dpyinfo->mouse_face_overlay otherwise note_mouse_highlight might
optimize away highlighting if we pass over that same overlay again.
(note_mouse_highlight): Call mouse_face_overlay_overlaps
to detect a case where we have to highlight a different region
despite not having left the currently highlighted region.
Set mouse_face_overlay in the x_display_info.  Avoid changing the
mouse pointer shape when show_mouse_face has already done it, or
there is no need.  Handle mouse-face and help-echo in strings.
(glyph_rect): New function.
(w32_mouse_position): Use it to raise the threshold for mouse
movement event generation.
(w32_initialize_display_info): Initialize the x_display_info's
mouse_face_overlay.
(w32_set_vertical_scroll_bar): Don't clear a zero height or width area.
(w32_set_vertical_scroll_bar, x_scroll_bar_create): Don't configure
a widget to zero height.
2001-10-21 15:20:03 +00:00
Miles Bader
e617a35b40 (x_fix_overlapping_area, x_write_glyphs, expose_area)
(expose_line, x_erase_phys_cursor): Don't use `inverse_p' field.
(w32_reassert_line_highlight, x_change_line_highlight): Functions removed.
2001-10-20 05:49:35 +00:00
Andrew Innes
0e804d381c (w32_encode_char): Get cached codepage from font_info,
rather than working it out by calling w32_codepage_for_font for
every glyph.
2001-10-17 17:48:44 +00:00
Andrew Innes
66e5868ae1 (w32_read_socket): Determine clipping rectangle for
the entire frame, including areas covered by scrollbars and the
menubar.  This avoids internal arguments about whether a frame is
fully obscured or not.
2001-10-17 17:19:27 +00:00
Ken Raeburn
f3fbd15535 Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
with lisp system changes.
2001-10-16 09:09:51 +00:00
Stefan Monnier
8feddab4e0 Include keymap.h. 2001-10-08 11:39:52 +00:00
Gerd Moellmann
32c82ac0a1 Don't define min/max. 2001-10-08 08:08:08 +00:00
Andrew Innes
8f8601801d (w32_read_socket): Add more information to debugging output. 2001-09-04 17:42:03 +00:00
Eli Zaretskii
f4fccc1e96 (x_set_glyph_string_background_width)
(show_mouse_face): Track the last changes in xterm.c.
2001-08-28 17:12:20 +00:00
Andrew Innes
858a55c1e1 Draw relief (if any) before
drawing glyph string.
2001-08-14 11:46:33 +00:00
Andrew Innes
8c3b00cbc7 (x_display_list): New variable.
(w32_term_init): Set it.
2001-07-26 10:06:32 +00:00
Jason Rumney
5b844253e1 * w32term.c (x_set_glyph_string_background_width): Extend the
background face to the end of the drawing area in the text area,
only.
(x_insert_glyphs): Call window_box_left to obtain the left
x-coordinate of the area to shift.
2001-02-23 10:17:41 +00:00
Andrew Innes
60222d69c6 (x_produce_image_glyph): Pay attention to the case that
face->box_line_width is negative.
(x_produce_stretch_glyph): Likewise.
(x_produce_glyphs): Likewise.
(x_estimate_mode_line_height): Likewise.
(x_draw_glyph_string_background): Likewise.
(x_draw_glyph_string_foreground): Likewise.
(x_draw_composite_glyph_string_foreground): Likewise.
(x_draw_glyph_string_box): Likewise.
(x_draw_image_foreground): Likewise.
(x_draw_image_relief): Likewise.
(x_draw_image_foreground_1): Likewise.
(x_draw_image_glyph_string): Likewise.
2001-02-12 14:50:08 +00:00
Jason Rumney
49be9f70fb (w32_encode_char): Treat eight bit graphic and control
characters the same as ASCII and latin-1.
(x_display_and_set_cursor): Check for the focus	frame's selected
window instead of selected_window.
(x_after_update_window_line): Don't clear if frame's internal
border width is zero.
(x_new_font): Don't change a tooltip's size.
(w32_initialize): Set char_ins_del_ok to 1.
2001-02-09 10:03:42 +00:00
Stefan Monnier
d8e675f595 (w32_set_scroll_bar_thumb): Use double' for range' to avoid overflow. 2001-02-08 15:07:23 +00:00
Eli Zaretskii
fccb828847 (x_draw_row_bitmaps): Delay obtaining HDC to avoid returning without
releasing it.
2001-01-29 12:36:52 +00:00
Andrew Innes
0f32f0232b (w32_ring_bell): Only support visible bell on w32
frames.
(w32_initialize): Don't set term hooks that aren't actually needed
in windowed mode.
2001-01-20 14:04:28 +00:00
Jason Rumney
c2cc16fa2b (x_produce_stretch_glyph): Only use Qspace when GLYPH_DEBUG is defined.
(x_produce_glyphs): Don't xassert `it->descent > 0'; this isn't
true for images with `:ascent 100'.
(x_set_mouse_face_gc): If the last used mouse face has gone in the
meantime, use face MOUSE_FACE_ID.
If first glyph isn't a character glyph, use the ASCII NUL
character to determine the face.
(expose_area): Do not treat left margin specially.
(note_mode_line_highlight): If no local_map, check global keymap.
(note_mouse_highlight): Initialize overlay.
(clear_mouse_face): Don't return if tip_frame is non-nil.
(show_scroll_bars): Remove unused function.
(w32_read_socket) [WM_KILLFOCUS]: Set help_echo to Qnil.
(x_draw_bar_cursor): Remove extra test for out of bounds cursor.
Clip to row.
(x_erase_phys_cursor): Don't apply XWINDOW to variable that may be nil.
(x_free_frame_resources): Unload relief colors.
2001-01-18 09:19:39 +00:00
Jason Rumney
d6ff54d52f (x_produce_image_glyph, x_draw_image_foreground)
(x_draw_image_relief, x_draw_image_foreground_1)
(x_draw_image_glyph_string): Adapt to change of image margins.
(w32_fill_rect, w32_read_socket, x_bitmap_icon)
(x_new_fontset, x_calc_absolute_position, x_iconify_frame):
Add parentheses.
2001-01-13 00:01:51 +00:00
Andrew Innes
7e6ac5b91d (x_update_begin):
(x_update_end):
(x_clear_frame):
(x_ins_del_lines):
(x_change_line_highlight):
(x_delete_glyphs):
(w32_ring_bell):
(x_update_begin):
(x_update_end):
(w32_reassert_line_highlight):
(w32_frame_rehighlight):
(w32_frame_raise_lower): Do nothing if not w32 frame.
2001-01-02 22:47:48 +00:00
Gerd Moellmann
5bf045202f (syms_of_xterm): DEFVAR_LISP x-toolkit-scroll-bars
instead of x-toolkit-scroll-bars-p.
(Vx_toolkit_scroll_bars): Renamed from x_toolkit_scroll_bars_p.
2000-12-27 14:33:11 +00:00
Jason Rumney
9436cdf9a6 (w32_draw_bitmap): Fix drawing so it does not appear in the wrong colors
when the foreground is not black.
(expose_window): Don't redraw the window that's currently being updated.
2000-12-22 11:33:37 +00:00
Andrew Innes
99012074ba (x_update_begin): Regenerate the palette here, rather
than for each window.
2000-12-21 14:58:55 +00:00
Jason Rumney
988646fc79 (x_draw_hollow_cursor): Delay obtaining the frame's DC to avoid
returning without releasing it.
2000-12-21 11:06:32 +00:00
Andrew Innes
25badd7aeb (clear_mouse_face): Treat tip_frame as a Lisp_Object.
(x_free_frame_resources): New function.
(x_destroy_window): Use it.
2000-12-14 10:55:10 +00:00
Jason Rumney
2df8529411 (expose_area): Complete last change. 2000-12-05 22:42:49 +00:00
Jason Rumney
f201d7329f (x_produce_glyphs): If a font for a component of
a composition is not found, use 1 pixel dot ascent and 0 dot
descent value to avoid displaying terribly tall empty boxes.
(expose_area): Pass x-coordinate relative to the exposed
area to x_draw_glyphs instead of a window-relative coordinate.
2000-12-05 19:23:21 +00:00
Jason Rumney
250cfeced5 (x_estimate_mode_line_height): If `mode-line' face hasn't a font, use
that of the frame, as drawing glyphs does.
(note_mouse_highlight): Change the cursor shape	on the vertical
border between windows [not enabled].
2000-12-02 21:05:01 +00:00
Jason Rumney
4b99045f51 (w32_bdf_per_char_metric): Dereference pointer correctly for single
byte character case.
(w32_per_char_metric): Do not try to make any assumptions about the
metrics of BDF fonts.
2000-12-02 14:38:57 +00:00
Jason Rumney
e4a5241280 (x_draw_vertical_border): Fix call to w32_fill_rect. 2000-12-01 19:47:36 +00:00
Gerd Moellmann
d417b5e034 (x_tool_bar_item, w32_handle_tool_bar_click)
(note_tool_bar_highlight): Change references to mambers deleted
from struct frame to use the new ones.
2000-11-22 16:33:16 +00:00
Jason Rumney
92bb977fc2 (w32_draw_bitmap): Use face to set colors. 2000-11-18 01:58:42 +00:00
Jason Rumney
e5fa381b67 (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT): New constant.
(w32_alloc_lighter_color): Use new brightness calculations from
xterm.c. Scale delta to be in the range expected by W32.
(w32_draw_relief_rect): Use frame relief colors.
2000-11-15 23:48:42 +00:00
Jason Rumney
02f593f3d0 (w32_encode_char): Handle CP_UNICODE specially.
(w32_use_unicode_for_codepage): Use new pseudo-codepages.
2000-11-10 22:11:25 +00:00
Kenichi Handa
458f45fad3 (VCENTER_BASELINE_OFFSET): Fix previous change. If the
font is taller than the frame line, we don't have to vias the
division by two.
2000-11-08 00:53:11 +00:00
Andrew Innes
1521ce96f5 (x_produce_glyphs): Fix typo in enum name. 2000-11-05 21:44:19 +00:00
Jason Rumney
01b220b61a (x_produce_glyphs): Handle composite characters.
(x_draw_glyph_string_foreground)
(x_draw_composite_glyph_string_foreground): Restore old font.
2000-10-31 12:42:51 +00:00
Jason Rumney
00c9699523 (w32_bdf_per_char_metric): Negate descent.
(w32_cache_char_metrics): Handle possibility that 'x' does not
exist in a BDF font.
(W32_TEXTOUT): w32_BDF_TextOut wants number of bytes not chars.
2000-10-29 20:59:47 +00:00
Stefan Monnier
020676925c * lisp.h (KEYMAPP): New macro.
(get_keymap): Remove.
(get_keymap_1): Rename get_keymap.
* keyboard.h (get_keymap_1, Fkeymapp): Remove prototype.
* xterm.c (note_mode_line_highlight): Use KEYMAPP.
* xmenu.c (single_submenu): Use KEYMAPP.
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
* w32term.c (note_mode_line_highlight): Use KEYMAPP.
* w32menu.c (True, False): Remove (use TRUE and FALSE instead).
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
(single_submenu): Use KEYMAPP.
(w32_menu_show, w32_dialog_show): Use TRUE.
* minibuf.c (Fread_from_minibuffer): Update call to get_keymap.
* keymap.c (KEYMAPP): Remove (moved to lisp.h).
(Fkeymapp): Use KEYMAPP.
(get_keymap): Rename from get_keymap_1.  Remove old def.
Return t when autoload=0 and error=0 and the keymap needs autoloading.
(Fcopy_keymap): Check (eq (car x) 'keymap) rather than using Fkeymapp.
(Fminor_mode_key_binding): Don't raise an error if the binding
is not a keymap.
(Fuse_global_map, Fuse_local_map): Allow autoloading.
(Faccessible_keymaps): Fetch keymaps rather than checking Fkeymapp.
* keyboard.c (read_char): get_keymap_1 -> get_keymap.
Allow Vspecial_event_map to be autoloaded.
(menu_bar_items): Fetch the keymap rather than using keymapp.
(menu_bar_one_keymap): No need to follow func-indirect any more.
(parse_menu_item): get_keymap_1 -> get_keymap.
(tool_bar_items): Fetch the keymap rather than using keymapp.
(read_key_sequence): Use KEYMAPP.
* intervals.c (get_local_map): Use get_keymap rather than following
function-indirections explicitly.
* doc.c (Fsubstitute_command_keys): get_keymap_1 -> get_keymap.
2000-10-27 22:20:19 +00:00
Jason Rumney
3090a5a5bc (VCENTER_BASELINE_OFFSET): Bias division (see xterm.c comment below). 2000-10-23 22:14:57 +00:00
Jason Rumney
f1eed8ff5b (w32_cache_char_metrics): Double check that font is
really fixed pitch before trusting tmPitchAndFamily.
2000-10-21 17:14:43 +00:00
Andrew Innes
82f9d56522 (w32_per_char_metric): Remove HDC argument. Use
cached information in emulated XFontStruct to handle common cases
quickly.  Do not allocate XCharStruct for return.
(w32_native_per_char_metric): New function.
(w32_bdf_per_char_metric): Fill in supplied XCharStruct instead of
allocating one.
(x_produce_glyphs): Don't get an HDC.  Change calls to
w32_per_char_metric to match arg change above.  Remove calls to
free results.
(w32_get_glyph_overhangs): Ditto.
(w32_cache_char_metrics): New function.
2000-10-21 13:26:41 +00:00
Jason Rumney
2d0c0bd755 (x_produce_glyphs): Handle unibyte_display_via_language_environment correctly.
(w32_draw_box_rect): Fix the calculation of width and height.
2000-10-19 19:21:07 +00:00
Jason Rumney
9127e20e66 (w32_char_font_type, w32_encode_char, x_produce_glyphs): Distinguish
single and multibyte BDF fonts.
(w32_bdf_per_char_metric): New function.
(w32_per_char_metric): Use it.
(x_draw_glyph_string_background): Always draw background for BDF glyphs.

(x_produce_glyphs):  If the distance from the current position to the
next tab stop is less than a canonical character width, use the tab
stop after that.
(x_draw_glyphs): Handle case START and END are out of bounds more carefully.
(x_clear_mouse_face): Block/unblock input.
(x_display_and_set_cursor): Don't show a hollow box cursor for buffers
whose cursor_type is nil.
2000-09-29 21:20:59 +00:00
Andrew Innes
dfaaaafb67 (w32_per_char_metric): Handle non-TrueType fonts. 2000-09-14 21:34:22 +00:00
Andrew Innes
38006079e4 Include keyboard.h before frame.h.
[USE_CRT_DLL]: Remove unnecessary extern, which screws
up dllimport attributes.
(x_update_window_end): Update prototype.
2000-08-22 23:43:25 +00:00