Mercurial > emacs
comparison src/xterm.c @ 25544:693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Likewise for upper-case etc.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sun, 05 Sep 1999 15:49:07 +0000 |
parents | be975dcf4a0c |
children | e98819a94512 |
comparison
equal
deleted
inserted
replaced
25543:6289141fa825 | 25544:693ca9ba497a |
---|---|
409 static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int, | 409 static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int, |
410 int *, int *, int *)); | 410 int *, int *, int *)); |
411 static void note_mode_line_highlight P_ ((struct window *, int, int)); | 411 static void note_mode_line_highlight P_ ((struct window *, int, int)); |
412 static void x_check_font P_ ((struct frame *, XFontStruct *)); | 412 static void x_check_font P_ ((struct frame *, XFontStruct *)); |
413 static void note_mouse_highlight P_ ((struct frame *, int, int)); | 413 static void note_mouse_highlight P_ ((struct frame *, int, int)); |
414 static void note_toolbar_highlight P_ ((struct frame *f, int, int)); | 414 static void note_tool_bar_highlight P_ ((struct frame *f, int, int)); |
415 static void x_handle_toolbar_click P_ ((struct frame *, XButtonEvent *)); | 415 static void x_handle_tool_bar_click P_ ((struct frame *, XButtonEvent *)); |
416 static void show_mouse_face P_ ((struct x_display_info *, | 416 static void show_mouse_face P_ ((struct x_display_info *, |
417 enum draw_glyphs_face)); | 417 enum draw_glyphs_face)); |
418 static int x_io_error_quitter P_ ((Display *)); | 418 static int x_io_error_quitter P_ ((Display *)); |
419 int x_catch_errors P_ ((Display *)); | 419 int x_catch_errors P_ ((Display *)); |
420 void x_uncatch_errors P_ ((Display *, int)); | 420 void x_uncatch_errors P_ ((Display *, int)); |
2437 && MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (s->w, s->row)) | 2437 && MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (s->w, s->row)) |
2438 r->y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (s->w); | 2438 r->y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (s->w); |
2439 else | 2439 else |
2440 r->y = max (0, s->row->y); | 2440 r->y = max (0, s->row->y); |
2441 | 2441 |
2442 /* If drawing a toolbar window, draw it over the internal border | 2442 /* If drawing a tool-bar window, draw it over the internal border |
2443 at the top of the window. */ | 2443 at the top of the window. */ |
2444 if (s->w == XWINDOW (s->f->toolbar_window)) | 2444 if (s->w == XWINDOW (s->f->tool_bar_window)) |
2445 r->y -= s->f->output_data.x->internal_border_width; | 2445 r->y -= s->f->output_data.x->internal_border_width; |
2446 | 2446 |
2447 /* If S draws overlapping rows, it's sufficient to use the top and | 2447 /* If S draws overlapping rows, it's sufficient to use the top and |
2448 bottom of the window for clipping because this glyph string | 2448 bottom of the window for clipping because this glyph string |
2449 intentionally draws over other lines. */ | 2449 intentionally draws over other lines. */ |
3462 } | 3462 } |
3463 | 3463 |
3464 if (s->hl == DRAW_IMAGE_SUNKEN | 3464 if (s->hl == DRAW_IMAGE_SUNKEN |
3465 || s->hl == DRAW_IMAGE_RAISED) | 3465 || s->hl == DRAW_IMAGE_RAISED) |
3466 { | 3466 { |
3467 thick = toolbar_button_relief > 0 ? toolbar_button_relief : 3; | 3467 thick = tool_bar_button_relief > 0 ? tool_bar_button_relief : 3; |
3468 raised_p = s->hl == DRAW_IMAGE_RAISED; | 3468 raised_p = s->hl == DRAW_IMAGE_RAISED; |
3469 } | 3469 } |
3470 else | 3470 else |
3471 { | 3471 { |
3472 thick = abs (s->img->relief); | 3472 thick = abs (s->img->relief); |
4097 s->area = area; | 4097 s->area = area; |
4098 s->first_glyph = row->glyphs[area] + start; | 4098 s->first_glyph = row->glyphs[area] + start; |
4099 s->height = row->height; | 4099 s->height = row->height; |
4100 s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 4100 s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
4101 | 4101 |
4102 /* Display the internal border below the toolbar window. */ | 4102 /* Display the internal border below the tool-bar window. */ |
4103 if (s->w == XWINDOW (s->f->toolbar_window)) | 4103 if (s->w == XWINDOW (s->f->tool_bar_window)) |
4104 s->y -= s->f->output_data.x->internal_border_width; | 4104 s->y -= s->f->output_data.x->internal_border_width; |
4105 | 4105 |
4106 s->ybase = s->y + row->ascent; | 4106 s->ybase = s->y + row->ascent; |
4107 } | 4107 } |
4108 | 4108 |
4868 if (height > 3 * FRAME_LINE_HEIGHT (f)) | 4868 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
4869 { | 4869 { |
4870 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 4870 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
4871 flash_left, | 4871 flash_left, |
4872 (FRAME_INTERNAL_BORDER_WIDTH (f) | 4872 (FRAME_INTERNAL_BORDER_WIDTH (f) |
4873 + FRAME_TOOLBAR_LINES (f) * CANON_Y_UNIT (f)), | 4873 + FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)), |
4874 width, flash_height); | 4874 width, flash_height); |
4875 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 4875 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
4876 flash_left, | 4876 flash_left, |
4877 (height - flash_height | 4877 (height - flash_height |
4878 - FRAME_INTERNAL_BORDER_WIDTH (f)), | 4878 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
4917 if (height > 3 * FRAME_LINE_HEIGHT (f)) | 4917 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
4918 { | 4918 { |
4919 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 4919 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
4920 flash_left, | 4920 flash_left, |
4921 (FRAME_INTERNAL_BORDER_WIDTH (f) | 4921 (FRAME_INTERNAL_BORDER_WIDTH (f) |
4922 + FRAME_TOOLBAR_LINES (f) * CANON_Y_UNIT (f)), | 4922 + FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)), |
4923 width, flash_height); | 4923 width, flash_height); |
4924 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 4924 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
4925 flash_left, | 4925 flash_left, |
4926 (height - flash_height | 4926 (height - flash_height |
4927 - FRAME_INTERNAL_BORDER_WIDTH (f)), | 4927 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
5105 } | 5105 } |
5106 | 5106 |
5107 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); | 5107 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); |
5108 expose_window_tree (XWINDOW (f->root_window), &r); | 5108 expose_window_tree (XWINDOW (f->root_window), &r); |
5109 | 5109 |
5110 if (WINDOWP (f->toolbar_window)) | 5110 if (WINDOWP (f->tool_bar_window)) |
5111 { | 5111 { |
5112 struct window *w = XWINDOW (f->toolbar_window); | 5112 struct window *w = XWINDOW (f->tool_bar_window); |
5113 XRectangle window_rect; | 5113 XRectangle window_rect; |
5114 XRectangle intersection_rect; | 5114 XRectangle intersection_rect; |
5115 int window_x, window_y, window_width, window_height; | 5115 int window_x, window_y, window_width, window_height; |
5116 | 5116 |
5117 | 5117 |
6143 | 6143 |
6144 /* Convert to window-relative pixel coordinates. */ | 6144 /* Convert to window-relative pixel coordinates. */ |
6145 w = XWINDOW (window); | 6145 w = XWINDOW (window); |
6146 frame_to_window_pixel_xy (w, &x, &y); | 6146 frame_to_window_pixel_xy (w, &x, &y); |
6147 | 6147 |
6148 /* Handle toolbar window differently since it doesn't display a | 6148 /* Handle tool-bar window differently since it doesn't display a |
6149 buffer. */ | 6149 buffer. */ |
6150 if (EQ (window, f->toolbar_window)) | 6150 if (EQ (window, f->tool_bar_window)) |
6151 { | 6151 { |
6152 note_toolbar_highlight (f, x, y); | 6152 note_tool_bar_highlight (f, x, y); |
6153 return; | 6153 return; |
6154 } | 6154 } |
6155 | 6155 |
6156 if (portion == 1 || portion == 3) | 6156 if (portion == 1 || portion == 3) |
6157 { | 6157 { |
6370 } | 6370 } |
6371 | 6371 |
6372 | 6372 |
6373 | 6373 |
6374 /*********************************************************************** | 6374 /*********************************************************************** |
6375 Toolbars | 6375 Tool-bars |
6376 ***********************************************************************/ | 6376 ***********************************************************************/ |
6377 | 6377 |
6378 static int x_toolbar_item P_ ((struct frame *, int, int, | 6378 static int x_tool_bar_item P_ ((struct frame *, int, int, |
6379 struct glyph **, int *, int *, int *)); | 6379 struct glyph **, int *, int *, int *)); |
6380 | 6380 |
6381 /* Toolbar item index of the item on which a mouse button was pressed | 6381 /* Tool-bar item index of the item on which a mouse button was pressed |
6382 or -1. */ | 6382 or -1. */ |
6383 | 6383 |
6384 static int last_toolbar_item; | 6384 static int last_tool_bar_item; |
6385 | 6385 |
6386 | 6386 |
6387 /* Get information about the toolbar item at position X/Y on frame F. | 6387 /* Get information about the tool-bar item at position X/Y on frame F. |
6388 Return in *GLYPH a pointer to the glyph of the toolbar item in | 6388 Return in *GLYPH a pointer to the glyph of the tool-bar item in |
6389 the current matrix of the toolbar window of F, or NULL if not | 6389 the current matrix of the tool-bar window of F, or NULL if not |
6390 on a toolbar item. Return in *PROP_IDX the index of the toolbar | 6390 on a tool-bar item. Return in *PROP_IDX the index of the tool-bar |
6391 item in F->current_toolbar_items. Value is | 6391 item in F->current_tool_bar_items. Value is |
6392 | 6392 |
6393 -1 if X/Y is not on a toolbar item | 6393 -1 if X/Y is not on a tool-bar item |
6394 0 if X/Y is on the same item that was highlighted before. | 6394 0 if X/Y is on the same item that was highlighted before. |
6395 1 otherwise. */ | 6395 1 otherwise. */ |
6396 | 6396 |
6397 static int | 6397 static int |
6398 x_toolbar_item (f, x, y, glyph, hpos, vpos, prop_idx) | 6398 x_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx) |
6399 struct frame *f; | 6399 struct frame *f; |
6400 int x, y; | 6400 int x, y; |
6401 struct glyph **glyph; | 6401 struct glyph **glyph; |
6402 int *hpos, *vpos, *prop_idx; | 6402 int *hpos, *vpos, *prop_idx; |
6403 { | 6403 { |
6404 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 6404 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
6405 struct window *w = XWINDOW (f->toolbar_window); | 6405 struct window *w = XWINDOW (f->tool_bar_window); |
6406 int area; | 6406 int area; |
6407 | 6407 |
6408 /* Find the glyph under X/Y. */ | 6408 /* Find the glyph under X/Y. */ |
6409 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); | 6409 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); |
6410 if (*glyph == NULL) | 6410 if (*glyph == NULL) |
6411 return -1; | 6411 return -1; |
6412 | 6412 |
6413 /* Get the start of this toolbar item's properties in | 6413 /* Get the start of this tool-bar item's properties in |
6414 f->current_toolbar_items. */ | 6414 f->current_tool_bar_items. */ |
6415 if (!toolbar_item_info (f, *glyph, prop_idx)) | 6415 if (!tool_bar_item_info (f, *glyph, prop_idx)) |
6416 return -1; | 6416 return -1; |
6417 | 6417 |
6418 /* Is mouse on the highlighted item? */ | 6418 /* Is mouse on the highlighted item? */ |
6419 if (EQ (f->toolbar_window, dpyinfo->mouse_face_window) | 6419 if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) |
6420 && *vpos >= dpyinfo->mouse_face_beg_row | 6420 && *vpos >= dpyinfo->mouse_face_beg_row |
6421 && *vpos <= dpyinfo->mouse_face_end_row | 6421 && *vpos <= dpyinfo->mouse_face_end_row |
6422 && (*vpos > dpyinfo->mouse_face_beg_row | 6422 && (*vpos > dpyinfo->mouse_face_beg_row |
6423 || *hpos >= dpyinfo->mouse_face_beg_col) | 6423 || *hpos >= dpyinfo->mouse_face_beg_col) |
6424 && (*vpos < dpyinfo->mouse_face_end_row | 6424 && (*vpos < dpyinfo->mouse_face_end_row |
6428 | 6428 |
6429 return 1; | 6429 return 1; |
6430 } | 6430 } |
6431 | 6431 |
6432 | 6432 |
6433 /* Handle mouse button event on the toolbar of frame F, at | 6433 /* Handle mouse button event on the tool-bar of frame F, at |
6434 frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress | 6434 frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress |
6435 or ButtonRelase. */ | 6435 or ButtonRelase. */ |
6436 | 6436 |
6437 static void | 6437 static void |
6438 x_handle_toolbar_click (f, button_event) | 6438 x_handle_tool_bar_click (f, button_event) |
6439 struct frame *f; | 6439 struct frame *f; |
6440 XButtonEvent *button_event; | 6440 XButtonEvent *button_event; |
6441 { | 6441 { |
6442 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 6442 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
6443 struct window *w = XWINDOW (f->toolbar_window); | 6443 struct window *w = XWINDOW (f->tool_bar_window); |
6444 int hpos, vpos, prop_idx; | 6444 int hpos, vpos, prop_idx; |
6445 struct glyph *glyph; | 6445 struct glyph *glyph; |
6446 Lisp_Object enabled_p; | 6446 Lisp_Object enabled_p; |
6447 int x = button_event->x; | 6447 int x = button_event->x; |
6448 int y = button_event->y; | 6448 int y = button_event->y; |
6449 | 6449 |
6450 /* If not on the highlighted toolbar item, return. */ | 6450 /* If not on the highlighted tool-bar item, return. */ |
6451 frame_to_window_pixel_xy (w, &x, &y); | 6451 frame_to_window_pixel_xy (w, &x, &y); |
6452 if (x_toolbar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) | 6452 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) |
6453 return; | 6453 return; |
6454 | 6454 |
6455 /* If item is disabled, do nothing. */ | 6455 /* If item is disabled, do nothing. */ |
6456 enabled_p = (XVECTOR (f->current_toolbar_items) | 6456 enabled_p = (XVECTOR (f->current_tool_bar_items) |
6457 ->contents[prop_idx + TOOLBAR_ITEM_ENABLED_P]); | 6457 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); |
6458 if (NILP (enabled_p)) | 6458 if (NILP (enabled_p)) |
6459 return; | 6459 return; |
6460 | 6460 |
6461 if (button_event->type == ButtonPress) | 6461 if (button_event->type == ButtonPress) |
6462 { | 6462 { |
6463 /* Show item in pressed state. */ | 6463 /* Show item in pressed state. */ |
6464 show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN); | 6464 show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN); |
6465 dpyinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN; | 6465 dpyinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN; |
6466 last_toolbar_item = prop_idx; | 6466 last_tool_bar_item = prop_idx; |
6467 } | 6467 } |
6468 else | 6468 else |
6469 { | 6469 { |
6470 Lisp_Object key, frame; | 6470 Lisp_Object key, frame; |
6471 struct input_event event; | 6471 struct input_event event; |
6472 | 6472 |
6473 /* Show item in released state. */ | 6473 /* Show item in released state. */ |
6474 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); | 6474 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); |
6475 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; | 6475 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; |
6476 | 6476 |
6477 key = (XVECTOR (f->current_toolbar_items) | 6477 key = (XVECTOR (f->current_tool_bar_items) |
6478 ->contents[prop_idx + TOOLBAR_ITEM_KEY]); | 6478 ->contents[prop_idx + TOOL_BAR_ITEM_KEY]); |
6479 | 6479 |
6480 XSETFRAME (frame, f); | 6480 XSETFRAME (frame, f); |
6481 event.kind = TOOLBAR_EVENT; | 6481 event.kind = TOOL_BAR_EVENT; |
6482 event.frame_or_window = Fcons (frame, Fcons (Qtoolbar, Qnil)); | 6482 event.frame_or_window = Fcons (frame, Fcons (Qtool_bar, Qnil)); |
6483 kbd_buffer_store_event (&event); | 6483 kbd_buffer_store_event (&event); |
6484 | 6484 |
6485 event.kind = TOOLBAR_EVENT; | 6485 event.kind = TOOL_BAR_EVENT; |
6486 event.frame_or_window = Fcons (frame, key); | 6486 event.frame_or_window = Fcons (frame, key); |
6487 event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), | 6487 event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), |
6488 button_event->state); | 6488 button_event->state); |
6489 kbd_buffer_store_event (&event); | 6489 kbd_buffer_store_event (&event); |
6490 last_toolbar_item = -1; | 6490 last_tool_bar_item = -1; |
6491 } | 6491 } |
6492 } | 6492 } |
6493 | 6493 |
6494 | 6494 |
6495 /* Possibly highlight a toolbar item on frame F when mouse moves to | 6495 /* Possibly highlight a tool-bar item on frame F when mouse moves to |
6496 toolbar window-relative coordinates X/Y. Called from | 6496 tool-bar window-relative coordinates X/Y. Called from |
6497 note_mouse_highlight. */ | 6497 note_mouse_highlight. */ |
6498 | 6498 |
6499 static void | 6499 static void |
6500 note_toolbar_highlight (f, x, y) | 6500 note_tool_bar_highlight (f, x, y) |
6501 struct frame *f; | 6501 struct frame *f; |
6502 int x, y; | 6502 int x, y; |
6503 { | 6503 { |
6504 Lisp_Object window = f->toolbar_window; | 6504 Lisp_Object window = f->tool_bar_window; |
6505 struct window *w = XWINDOW (window); | 6505 struct window *w = XWINDOW (window); |
6506 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 6506 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
6507 int hpos, vpos; | 6507 int hpos, vpos; |
6508 struct glyph *glyph; | 6508 struct glyph *glyph; |
6509 struct glyph_row *row; | 6509 struct glyph_row *row; |
6519 { | 6519 { |
6520 clear_mouse_face (dpyinfo); | 6520 clear_mouse_face (dpyinfo); |
6521 return; | 6521 return; |
6522 } | 6522 } |
6523 | 6523 |
6524 rc = x_toolbar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx); | 6524 rc = x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx); |
6525 if (rc < 0) | 6525 if (rc < 0) |
6526 { | 6526 { |
6527 /* Not on toolbar item. */ | 6527 /* Not on tool-bar item. */ |
6528 clear_mouse_face (dpyinfo); | 6528 clear_mouse_face (dpyinfo); |
6529 return; | 6529 return; |
6530 } | 6530 } |
6531 else if (rc == 0) | 6531 else if (rc == 0) |
6532 /* On same toolbar item as before. */ | 6532 /* On same tool-bar item as before. */ |
6533 goto set_help_echo; | 6533 goto set_help_echo; |
6534 | 6534 |
6535 clear_mouse_face (dpyinfo); | 6535 clear_mouse_face (dpyinfo); |
6536 | 6536 |
6537 /* Mouse is down, but on different toolbar item? */ | 6537 /* Mouse is down, but on different tool-bar item? */ |
6538 mouse_down_p = (dpyinfo->grabbed | 6538 mouse_down_p = (dpyinfo->grabbed |
6539 && f == last_mouse_frame | 6539 && f == last_mouse_frame |
6540 && FRAME_LIVE_P (f)); | 6540 && FRAME_LIVE_P (f)); |
6541 if (mouse_down_p | 6541 if (mouse_down_p |
6542 && last_toolbar_item != prop_idx) | 6542 && last_tool_bar_item != prop_idx) |
6543 return; | 6543 return; |
6544 | 6544 |
6545 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; | 6545 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; |
6546 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; | 6546 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; |
6547 | 6547 |
6548 /* If toolbar item is not enabled, don't highlight it. */ | 6548 /* If tool-bar item is not enabled, don't highlight it. */ |
6549 enabled_p = (XVECTOR (f->current_toolbar_items) | 6549 enabled_p = (XVECTOR (f->current_tool_bar_items) |
6550 ->contents[prop_idx + TOOLBAR_ITEM_ENABLED_P]); | 6550 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); |
6551 if (!NILP (enabled_p)) | 6551 if (!NILP (enabled_p)) |
6552 { | 6552 { |
6553 /* Compute the x-position of the glyph. In front and past the | 6553 /* Compute the x-position of the glyph. In front and past the |
6554 image is a space. We include this is the highlighted area. */ | 6554 image is a space. We include this is the highlighted area. */ |
6555 row = MATRIX_ROW (w->current_matrix, vpos); | 6555 row = MATRIX_ROW (w->current_matrix, vpos); |
6566 dpyinfo->mouse_face_end_col = hpos + 1; | 6566 dpyinfo->mouse_face_end_col = hpos + 1; |
6567 dpyinfo->mouse_face_end_row = vpos; | 6567 dpyinfo->mouse_face_end_row = vpos; |
6568 dpyinfo->mouse_face_end_x = x + glyph->pixel_width; | 6568 dpyinfo->mouse_face_end_x = x + glyph->pixel_width; |
6569 dpyinfo->mouse_face_end_y = row->y; | 6569 dpyinfo->mouse_face_end_y = row->y; |
6570 dpyinfo->mouse_face_window = window; | 6570 dpyinfo->mouse_face_window = window; |
6571 dpyinfo->mouse_face_face_id = TOOLBAR_FACE_ID; | 6571 dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID; |
6572 | 6572 |
6573 /* Display it as active. */ | 6573 /* Display it as active. */ |
6574 show_mouse_face (dpyinfo, draw); | 6574 show_mouse_face (dpyinfo, draw); |
6575 dpyinfo->mouse_face_image_state = draw; | 6575 dpyinfo->mouse_face_image_state = draw; |
6576 } | 6576 } |
6577 | 6577 |
6578 set_help_echo: | 6578 set_help_echo: |
6579 | 6579 |
6580 /* Set help_echo to a help string.to display for this toolbar item. | 6580 /* Set help_echo to a help string.to display for this tool-bar item. |
6581 XTread_socket does the rest. */ | 6581 XTread_socket does the rest. */ |
6582 help_echo = (XVECTOR (f->current_toolbar_items) | 6582 help_echo = (XVECTOR (f->current_tool_bar_items) |
6583 ->contents[prop_idx + TOOLBAR_ITEM_HELP]); | 6583 ->contents[prop_idx + TOOL_BAR_ITEM_HELP]); |
6584 if (!STRINGP (help_echo)) | 6584 if (!STRINGP (help_echo)) |
6585 help_echo = (XVECTOR (f->current_toolbar_items) | 6585 help_echo = (XVECTOR (f->current_tool_bar_items) |
6586 ->contents[prop_idx + TOOLBAR_ITEM_CAPTION]); | 6586 ->contents[prop_idx + TOOL_BAR_ITEM_CAPTION]); |
6587 } | 6587 } |
6588 | 6588 |
6589 | 6589 |
6590 | 6590 |
6591 /* Find the glyph matrix position of buffer position POS in window W. | 6591 /* Find the glyph matrix position of buffer position POS in window W. |
9518 case ButtonRelease: | 9518 case ButtonRelease: |
9519 { | 9519 { |
9520 /* If we decide we want to generate an event to be seen | 9520 /* If we decide we want to generate an event to be seen |
9521 by the rest of Emacs, we put it here. */ | 9521 by the rest of Emacs, we put it here. */ |
9522 struct input_event emacs_event; | 9522 struct input_event emacs_event; |
9523 int toolbar_p = 0; | 9523 int tool_bar_p = 0; |
9524 | 9524 |
9525 emacs_event.kind = no_event; | 9525 emacs_event.kind = no_event; |
9526 bzero (&compose_status, sizeof (compose_status)); | 9526 bzero (&compose_status, sizeof (compose_status)); |
9527 | 9527 |
9528 if (dpyinfo->grabbed | 9528 if (dpyinfo->grabbed |
9532 else | 9532 else |
9533 f = x_window_to_frame (dpyinfo, event.xbutton.window); | 9533 f = x_window_to_frame (dpyinfo, event.xbutton.window); |
9534 | 9534 |
9535 if (f) | 9535 if (f) |
9536 { | 9536 { |
9537 /* Is this in the toolbar? */ | 9537 /* Is this in the tool-bar? */ |
9538 if (WINDOWP (f->toolbar_window) | 9538 if (WINDOWP (f->tool_bar_window) |
9539 && XFASTINT (XWINDOW (f->toolbar_window)->height)) | 9539 && XFASTINT (XWINDOW (f->tool_bar_window)->height)) |
9540 { | 9540 { |
9541 Lisp_Object window; | 9541 Lisp_Object window; |
9542 int p, x, y; | 9542 int p, x, y; |
9543 | 9543 |
9544 x = event.xbutton.x; | 9544 x = event.xbutton.x; |
9545 y = event.xbutton.y; | 9545 y = event.xbutton.y; |
9546 | 9546 |
9547 /* Set x and y. */ | 9547 /* Set x and y. */ |
9548 window = window_from_coordinates (f, x, y, &p, 1); | 9548 window = window_from_coordinates (f, x, y, &p, 1); |
9549 if (EQ (window, f->toolbar_window)) | 9549 if (EQ (window, f->tool_bar_window)) |
9550 { | 9550 { |
9551 x_handle_toolbar_click (f, &event.xbutton); | 9551 x_handle_tool_bar_click (f, &event.xbutton); |
9552 toolbar_p = 1; | 9552 tool_bar_p = 1; |
9553 } | 9553 } |
9554 } | 9554 } |
9555 | 9555 |
9556 if (!toolbar_p) | 9556 if (!tool_bar_p) |
9557 if (!dpyinfo->x_focus_frame | 9557 if (!dpyinfo->x_focus_frame |
9558 || f == dpyinfo->x_focus_frame) | 9558 || f == dpyinfo->x_focus_frame) |
9559 construct_mouse_click (&emacs_event, &event, f); | 9559 construct_mouse_click (&emacs_event, &event, f); |
9560 } | 9560 } |
9561 else | 9561 else |
9578 Emacs events should reflect only motion after | 9578 Emacs events should reflect only motion after |
9579 the ButtonPress. */ | 9579 the ButtonPress. */ |
9580 if (f != 0) | 9580 if (f != 0) |
9581 f->mouse_moved = 0; | 9581 f->mouse_moved = 0; |
9582 | 9582 |
9583 if (!toolbar_p) | 9583 if (!tool_bar_p) |
9584 last_toolbar_item = -1; | 9584 last_tool_bar_item = -1; |
9585 if (display_busy_cursor_p) | 9585 if (display_busy_cursor_p) |
9586 inhibit_busy_cursor = 2; | 9586 inhibit_busy_cursor = 2; |
9587 } | 9587 } |
9588 else | 9588 else |
9589 { | 9589 { |
12834 memory_below_frame = 0; /* we don't remember what scrolls | 12834 memory_below_frame = 0; /* we don't remember what scrolls |
12835 off the bottom */ | 12835 off the bottom */ |
12836 baud_rate = 19200; | 12836 baud_rate = 19200; |
12837 | 12837 |
12838 x_noop_count = 0; | 12838 x_noop_count = 0; |
12839 last_toolbar_item = -1; | 12839 last_tool_bar_item = -1; |
12840 any_help_event_p = 0; | 12840 any_help_event_p = 0; |
12841 | 12841 |
12842 /* Try to use interrupt input; if we can't, then start polling. */ | 12842 /* Try to use interrupt input; if we can't, then start polling. */ |
12843 Fset_input_mode (Qt, Qnil, Qt, Qnil); | 12843 Fset_input_mode (Qt, Qnil, Qt, Qnil); |
12844 | 12844 |