5160 |
/* RIF: Draw or clear cursor on window W. */ |
/* RIF: Draw or clear cursor on window W. */ |
5161 |
|
|
5162 |
static void |
static void |
5163 |
w32_draw_window_cursor (w, glyph_row, on, x, y, new_cursor_type, new_cursor_width) |
w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) |
5164 |
struct window *w; |
struct window *w; |
5165 |
struct glyph_row *glyph_row; |
struct glyph_row *glyph_row; |
5166 |
int on, x, y; |
int x, y; |
5167 |
int new_cursor_type, new_cursor_width; |
int cursor_type, cursor_width; |
5168 |
|
int on_p, active_p; |
5169 |
{ |
{ |
5170 |
if (on) |
if (on_p) |
5171 |
{ |
{ |
5172 |
/* If the user wants to use the system caret, make sure our own |
/* If the user wants to use the system caret, make sure our own |
5173 |
cursor remains invisible. */ |
cursor remains invisible. */ |
5176 |
if (w->phys_cursor_type != NO_CURSOR) |
if (w->phys_cursor_type != NO_CURSOR) |
5177 |
erase_phys_cursor (w); |
erase_phys_cursor (w); |
5178 |
|
|
5179 |
new_cursor_type = w->phys_cursor_type = NO_CURSOR; |
cursor_type = w->phys_cursor_type = NO_CURSOR; |
5180 |
w->phys_cursor_width = -1; |
w->phys_cursor_width = -1; |
5181 |
} |
} |
5182 |
else |
else |
5183 |
{ |
{ |
5184 |
w->phys_cursor_type = new_cursor_type; |
w->phys_cursor_type = cursor_type; |
5185 |
} |
} |
5186 |
|
|
5187 |
w->phys_cursor_on_p = 1; |
w->phys_cursor_on_p = 1; |
5189 |
/* If this is the active cursor, we need to track it with the |
/* If this is the active cursor, we need to track it with the |
5190 |
system caret, so third party software like screen magnifiers |
system caret, so third party software like screen magnifiers |
5191 |
and speech synthesizers can follow the cursor. */ |
and speech synthesizers can follow the cursor. */ |
5192 |
if (active_cursor) |
if (active_p) |
5193 |
{ |
{ |
5194 |
HWND hwnd = FRAME_W32_WINDOW (f); |
HWND hwnd = FRAME_W32_WINDOW (f); |
5195 |
|
|
5211 |
PostMessage (hwnd, WM_EMACS_TRACK_CARET, 0, 0); |
PostMessage (hwnd, WM_EMACS_TRACK_CARET, 0, 0); |
5212 |
} |
} |
5213 |
|
|
5214 |
switch (new_cursor_type) |
switch (cursor_type) |
5215 |
{ |
{ |
5216 |
case HOLLOW_BOX_CURSOR: |
case HOLLOW_BOX_CURSOR: |
5217 |
x_draw_hollow_cursor (w, glyph_row); |
x_draw_hollow_cursor (w, glyph_row); |
5222 |
break; |
break; |
5223 |
|
|
5224 |
case BAR_CURSOR: |
case BAR_CURSOR: |
5225 |
x_draw_bar_cursor (w, glyph_row, new_cursor_width, BAR_CURSOR); |
x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR); |
5226 |
break; |
break; |
5227 |
|
|
5228 |
case HBAR_CURSOR: |
case HBAR_CURSOR: |
5229 |
x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR); |
x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR); |
5230 |
break; |
break; |
5231 |
|
|
5232 |
case NO_CURSOR: |
case NO_CURSOR: |