Mercurial > emacs
comparison src/xterm.c @ 33761:047804baee1c
(x_handle_tool_bar_click, note_tool_bar_highlight):
Change references to mambers deleted from struct frame to use the
new ones.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Wed, 22 Nov 2000 16:29:33 +0000 |
| parents | 5c2be00ed2ba |
| children | f86c06451792 |
comparison
equal
deleted
inserted
replaced
| 33760:22dc6e2e7410 | 33761:047804baee1c |
|---|---|
| 6893 | 6893 |
| 6894 /* Get information about the tool-bar item at position X/Y on frame F. | 6894 /* Get information about the tool-bar item at position X/Y on frame F. |
| 6895 Return in *GLYPH a pointer to the glyph of the tool-bar item in | 6895 Return in *GLYPH a pointer to the glyph of the tool-bar item in |
| 6896 the current matrix of the tool-bar window of F, or NULL if not | 6896 the current matrix of the tool-bar window of F, or NULL if not |
| 6897 on a tool-bar item. Return in *PROP_IDX the index of the tool-bar | 6897 on a tool-bar item. Return in *PROP_IDX the index of the tool-bar |
| 6898 item in F->current_tool_bar_items. Value is | 6898 item in F->tool_bar_items. Value is |
| 6899 | 6899 |
| 6900 -1 if X/Y is not on a tool-bar item | 6900 -1 if X/Y is not on a tool-bar item |
| 6901 0 if X/Y is on the same item that was highlighted before. | 6901 0 if X/Y is on the same item that was highlighted before. |
| 6902 1 otherwise. */ | 6902 1 otherwise. */ |
| 6903 | 6903 |
| 6916 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); | 6916 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); |
| 6917 if (*glyph == NULL) | 6917 if (*glyph == NULL) |
| 6918 return -1; | 6918 return -1; |
| 6919 | 6919 |
| 6920 /* Get the start of this tool-bar item's properties in | 6920 /* Get the start of this tool-bar item's properties in |
| 6921 f->current_tool_bar_items. */ | 6921 f->tool_bar_items. */ |
| 6922 if (!tool_bar_item_info (f, *glyph, prop_idx)) | 6922 if (!tool_bar_item_info (f, *glyph, prop_idx)) |
| 6923 return -1; | 6923 return -1; |
| 6924 | 6924 |
| 6925 /* Is mouse on the highlighted item? */ | 6925 /* Is mouse on the highlighted item? */ |
| 6926 if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) | 6926 if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) |
| 6958 frame_to_window_pixel_xy (w, &x, &y); | 6958 frame_to_window_pixel_xy (w, &x, &y); |
| 6959 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) | 6959 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) |
| 6960 return; | 6960 return; |
| 6961 | 6961 |
| 6962 /* If item is disabled, do nothing. */ | 6962 /* If item is disabled, do nothing. */ |
| 6963 enabled_p = (XVECTOR (f->current_tool_bar_items) | 6963 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); |
| 6964 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); | |
| 6965 if (NILP (enabled_p)) | 6964 if (NILP (enabled_p)) |
| 6966 return; | 6965 return; |
| 6967 | 6966 |
| 6968 if (button_event->type == ButtonPress) | 6967 if (button_event->type == ButtonPress) |
| 6969 { | 6968 { |
| 6979 | 6978 |
| 6980 /* Show item in released state. */ | 6979 /* Show item in released state. */ |
| 6981 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); | 6980 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); |
| 6982 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; | 6981 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; |
| 6983 | 6982 |
| 6984 key = (XVECTOR (f->current_tool_bar_items) | 6983 key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); |
| 6985 ->contents[prop_idx + TOOL_BAR_ITEM_KEY]); | |
| 6986 | 6984 |
| 6987 XSETFRAME (frame, f); | 6985 XSETFRAME (frame, f); |
| 6988 event.kind = TOOL_BAR_EVENT; | 6986 event.kind = TOOL_BAR_EVENT; |
| 6989 event.frame_or_window = frame; | 6987 event.frame_or_window = frame; |
| 6990 event.arg = frame; | 6988 event.arg = frame; |
| 7053 | 7051 |
| 7054 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; | 7052 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; |
| 7055 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; | 7053 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; |
| 7056 | 7054 |
| 7057 /* If tool-bar item is not enabled, don't highlight it. */ | 7055 /* If tool-bar item is not enabled, don't highlight it. */ |
| 7058 enabled_p = (XVECTOR (f->current_tool_bar_items) | 7056 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); |
| 7059 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); | |
| 7060 if (!NILP (enabled_p)) | 7057 if (!NILP (enabled_p)) |
| 7061 { | 7058 { |
| 7062 /* Compute the x-position of the glyph. In front and past the | 7059 /* Compute the x-position of the glyph. In front and past the |
| 7063 image is a space. We include this is the highlighted area. */ | 7060 image is a space. We include this is the highlighted area. */ |
| 7064 row = MATRIX_ROW (w->current_matrix, vpos); | 7061 row = MATRIX_ROW (w->current_matrix, vpos); |
| 7088 | 7085 |
| 7089 /* Set help_echo to a help string.to display for this tool-bar item. | 7086 /* Set help_echo to a help string.to display for this tool-bar item. |
| 7090 XTread_socket does the rest. */ | 7087 XTread_socket does the rest. */ |
| 7091 help_echo_object = help_echo_window = Qnil; | 7088 help_echo_object = help_echo_window = Qnil; |
| 7092 help_echo_pos = -1; | 7089 help_echo_pos = -1; |
| 7093 help_echo = (XVECTOR (f->current_tool_bar_items) | 7090 help_echo = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_HELP); |
| 7094 ->contents[prop_idx + TOOL_BAR_ITEM_HELP]); | |
| 7095 if (NILP (help_echo)) | 7091 if (NILP (help_echo)) |
| 7096 help_echo = (XVECTOR (f->current_tool_bar_items) | 7092 help_echo = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); |
| 7097 ->contents[prop_idx + TOOL_BAR_ITEM_CAPTION]); | |
| 7098 } | 7093 } |
| 7099 | 7094 |
| 7100 | 7095 |
| 7101 | 7096 |
| 7102 /* Find the glyph matrix position of buffer position POS in window W. | 7097 /* Find the glyph matrix position of buffer position POS in window W. |
