mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 07:11:34 -08:00
Change spelling of toolbar' to tool_bar' or `tool-bar'.
Likewise for upper-case etc.
This commit is contained in:
parent
e037b9ecb3
commit
9ea173e830
12 changed files with 304 additions and 303 deletions
10
src/alloc.c
10
src/alloc.c
|
|
@ -2247,14 +2247,14 @@ mark_object (argptr)
|
|||
mark_object (&ptr->buffer_predicate);
|
||||
mark_object (&ptr->buffer_list);
|
||||
mark_object (&ptr->menu_bar_window);
|
||||
mark_object (&ptr->toolbar_window);
|
||||
mark_object (&ptr->tool_bar_window);
|
||||
mark_face_cache (ptr->face_cache);
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
mark_image_cache (ptr);
|
||||
mark_object (&ptr->desired_toolbar_items);
|
||||
mark_object (&ptr->current_toolbar_items);
|
||||
mark_object (&ptr->desired_toolbar_string);
|
||||
mark_object (&ptr->current_toolbar_string);
|
||||
mark_object (&ptr->desired_tool_bar_items);
|
||||
mark_object (&ptr->current_tool_bar_items);
|
||||
mark_object (&ptr->desired_tool_bar_string);
|
||||
mark_object (&ptr->current_tool_bar_string);
|
||||
#endif /* HAVE_WINDOW_SYSTEM */
|
||||
}
|
||||
else if (GC_BOOL_VECTOR_P (obj))
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,7 @@ enum face_id
|
|||
{
|
||||
DEFAULT_FACE_ID,
|
||||
MODE_LINE_FACE_ID,
|
||||
TOOLBAR_FACE_ID,
|
||||
TOOL_BAR_FACE_ID,
|
||||
BITMAP_AREA_FACE_ID,
|
||||
TOP_LINE_FACE_ID,
|
||||
BASIC_FACE_ID_SENTINEL
|
||||
|
|
@ -1581,7 +1581,7 @@ struct it
|
|||
unsigned overlay_strings_at_end_processed_p : 1;
|
||||
|
||||
/* The ID of the default face to use. One of DEFAULT_FACE_ID,
|
||||
MODE_LINE_FACE_ID, or TOOLBAR_FACE_ID, depending on what we
|
||||
MODE_LINE_FACE_ID, or TOOL_BAR_FACE_ID, depending on what we
|
||||
are displaying. */
|
||||
int base_face_id;
|
||||
|
||||
|
|
@ -1961,69 +1961,69 @@ struct image_cache
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
Toolbars
|
||||
Tool-bars
|
||||
***********************************************************************/
|
||||
|
||||
/* Enumeration defining where to find toolbar item information in
|
||||
toolbar items vectors stored with frames. Each toolbar item
|
||||
occupies TOOLBAR_ITEM_NSLOTS elements in such a vector. */
|
||||
/* Enumeration defining where to find tool-bar item information in
|
||||
tool-bar items vectors stored with frames. Each tool-bar item
|
||||
occupies TOOL_BAR_ITEM_NSLOTS elements in such a vector. */
|
||||
|
||||
enum toolbar_item_idx
|
||||
enum tool_bar_item_idx
|
||||
{
|
||||
/* The key of the toolbar item. Used to remove items when a binding
|
||||
/* The key of the tool-bar item. Used to remove items when a binding
|
||||
for `undefined' is found. */
|
||||
TOOLBAR_ITEM_KEY,
|
||||
TOOL_BAR_ITEM_KEY,
|
||||
|
||||
/* Non-nil if item is enabled. */
|
||||
TOOLBAR_ITEM_ENABLED_P,
|
||||
TOOL_BAR_ITEM_ENABLED_P,
|
||||
|
||||
/* Non-nil if item is selected (pressed). */
|
||||
TOOLBAR_ITEM_SELECTED_P,
|
||||
TOOL_BAR_ITEM_SELECTED_P,
|
||||
|
||||
/* Caption. */
|
||||
TOOLBAR_ITEM_CAPTION,
|
||||
TOOL_BAR_ITEM_CAPTION,
|
||||
|
||||
/* Image(s) to display. This is either a single image specification
|
||||
or a vector of specifications. */
|
||||
TOOLBAR_ITEM_IMAGES,
|
||||
TOOL_BAR_ITEM_IMAGES,
|
||||
|
||||
/* The binding. */
|
||||
TOOLBAR_ITEM_BINDING,
|
||||
TOOL_BAR_ITEM_BINDING,
|
||||
|
||||
/* Button type. One of nil, `:radio' or `:toggle'. */
|
||||
TOOLBAR_ITEM_TYPE,
|
||||
TOOL_BAR_ITEM_TYPE,
|
||||
|
||||
/* Help string. */
|
||||
TOOLBAR_ITEM_HELP,
|
||||
TOOL_BAR_ITEM_HELP,
|
||||
|
||||
/* Sentinel = number of slots in toolbar_items occupied by one
|
||||
toolbar item. */
|
||||
TOOLBAR_ITEM_NSLOTS
|
||||
/* Sentinel = number of slots in tool_bar_items occupied by one
|
||||
tool-bar item. */
|
||||
TOOL_BAR_ITEM_NSLOTS
|
||||
};
|
||||
|
||||
|
||||
/* An enumeration for the different images that can be specified
|
||||
for a toolbar item. */
|
||||
for a tool-bar item. */
|
||||
|
||||
enum toolbar_item_image
|
||||
enum tool_bar_item_image
|
||||
{
|
||||
TOOLBAR_IMAGE_ENABLED_SELECTED,
|
||||
TOOLBAR_IMAGE_ENABLED_DESELECTED,
|
||||
TOOLBAR_IMAGE_DISABLED_SELECTED,
|
||||
TOOLBAR_IMAGE_DISABLED_DESELECTED
|
||||
TOOL_BAR_IMAGE_ENABLED_SELECTED,
|
||||
TOOL_BAR_IMAGE_ENABLED_DESELECTED,
|
||||
TOOL_BAR_IMAGE_DISABLED_SELECTED,
|
||||
TOOL_BAR_IMAGE_DISABLED_DESELECTED
|
||||
};
|
||||
|
||||
/* Non-zero means raise toolbar buttons when the mouse moves over them. */
|
||||
/* Non-zero means raise tool-bar buttons when the mouse moves over them. */
|
||||
|
||||
extern int auto_raise_toolbar_buttons_p;
|
||||
extern int auto_raise_tool_bar_buttons_p;
|
||||
|
||||
/* Margin around toolbar buttons in pixels. */
|
||||
/* Margin around tool-bar buttons in pixels. */
|
||||
|
||||
extern int toolbar_button_margin;
|
||||
extern int tool_bar_button_margin;
|
||||
|
||||
/* Thickness of relief to draw around toolbar buttons. */
|
||||
/* Thickness of relief to draw around tool-bar buttons. */
|
||||
|
||||
extern int toolbar_button_relief;
|
||||
extern int tool_bar_button_relief;
|
||||
|
||||
|
||||
|
||||
|
|
@ -2060,8 +2060,8 @@ void move_it_vertically P_ ((struct it *, int));
|
|||
void move_it_by_lines P_ ((struct it *, int, int));
|
||||
int frame_mode_line_height P_ ((struct frame *));
|
||||
void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *));
|
||||
int toolbar_item_info P_ ((struct frame *, struct glyph *, int *));
|
||||
extern Lisp_Object Qtoolbar;
|
||||
int tool_bar_item_info P_ ((struct frame *, struct glyph *, int *));
|
||||
extern Lisp_Object Qtool_bar;
|
||||
extern Lisp_Object Vshow_trailing_whitespace;
|
||||
extern int redisplaying_p;
|
||||
|
||||
|
|
|
|||
|
|
@ -885,9 +885,9 @@ clear_current_matrices (f)
|
|||
if (WINDOWP (f->menu_bar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
|
||||
|
||||
/* Clear the matrix of the toolbar window, if any. */
|
||||
if (WINDOWP (f->toolbar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->toolbar_window)->current_matrix);
|
||||
/* Clear the matrix of the tool-bar window, if any. */
|
||||
if (WINDOWP (f->tool_bar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
|
||||
|
||||
/* Clear current window matrices. */
|
||||
xassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
|
||||
|
|
@ -907,8 +907,8 @@ clear_desired_matrices (f)
|
|||
if (WINDOWP (f->menu_bar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
|
||||
|
||||
if (WINDOWP (f->toolbar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->toolbar_window)->desired_matrix);
|
||||
if (WINDOWP (f->tool_bar_window))
|
||||
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
|
||||
|
||||
/* Do it for window matrices. */
|
||||
xassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
|
||||
|
|
@ -2076,21 +2076,21 @@ adjust_frame_glyphs_for_window_redisplay (f)
|
|||
}
|
||||
#endif /* not USE_X_TOOLKIT */
|
||||
|
||||
/* Allocate/ reallocate matrices of the toolbar window. If we don't
|
||||
have a toolbar window yet, make one. */
|
||||
if (NILP (f->toolbar_window))
|
||||
/* Allocate/ reallocate matrices of the tool bar window. If we
|
||||
don't have a tool bar window yet, make one. */
|
||||
if (NILP (f->tool_bar_window))
|
||||
{
|
||||
f->toolbar_window = make_window ();
|
||||
w = XWINDOW (f->toolbar_window);
|
||||
f->tool_bar_window = make_window ();
|
||||
w = XWINDOW (f->tool_bar_window);
|
||||
XSETFRAME (w->frame, f);
|
||||
w->pseudo_window_p = 1;
|
||||
}
|
||||
else
|
||||
w = XWINDOW (f->toolbar_window);
|
||||
w = XWINDOW (f->tool_bar_window);
|
||||
|
||||
XSETFASTINT (w->top, FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (w->left, 0);
|
||||
XSETFASTINT (w->height, FRAME_TOOLBAR_LINES (f));
|
||||
XSETFASTINT (w->height, FRAME_TOOL_BAR_LINES (f));
|
||||
XSETFASTINT (w->width, FRAME_WINDOW_WIDTH (f));
|
||||
allocate_matrices_for_window_redisplay (w, ch_dim);
|
||||
}
|
||||
|
|
@ -2167,14 +2167,14 @@ free_glyphs (f)
|
|||
f->menu_bar_window = Qnil;
|
||||
}
|
||||
|
||||
/* Free the toolbar window and its glyph matrices. */
|
||||
if (!NILP (f->toolbar_window))
|
||||
/* Free the tool bar window and its glyph matrices. */
|
||||
if (!NILP (f->tool_bar_window))
|
||||
{
|
||||
struct window *w = XWINDOW (f->toolbar_window);
|
||||
struct window *w = XWINDOW (f->tool_bar_window);
|
||||
free_glyph_matrix (w->desired_matrix);
|
||||
free_glyph_matrix (w->current_matrix);
|
||||
w->desired_matrix = w->current_matrix = NULL;
|
||||
f->toolbar_window = Qnil;
|
||||
f->tool_bar_window = Qnil;
|
||||
}
|
||||
|
||||
/* Release frame glyph matrices. Reset fields to zero in
|
||||
|
|
@ -3352,10 +3352,10 @@ update_frame (f, force_p, inhibit_hairy_id_p)
|
|||
update_window (XWINDOW (f->menu_bar_window), 1);
|
||||
|
||||
/* Update the tool-bar window, if present. */
|
||||
if (WINDOWP (f->toolbar_window))
|
||||
if (WINDOWP (f->tool_bar_window))
|
||||
{
|
||||
Lisp_Object tem;
|
||||
struct window *w = XWINDOW (f->toolbar_window);
|
||||
struct window *w = XWINDOW (f->tool_bar_window);
|
||||
|
||||
/* Update tool-bar window. */
|
||||
if (w->must_be_updated_p)
|
||||
|
|
@ -3365,16 +3365,16 @@ update_frame (f, force_p, inhibit_hairy_id_p)
|
|||
|
||||
/* Swap tool-bar strings. We swap because we want to
|
||||
reuse strings. */
|
||||
tem = f->current_toolbar_string;
|
||||
f->current_toolbar_string = f->desired_toolbar_string;
|
||||
f->desired_toolbar_string = tem;
|
||||
f->n_current_toolbar_items = f->n_desired_toolbar_items;
|
||||
tem = f->current_tool_bar_string;
|
||||
f->current_tool_bar_string = f->desired_tool_bar_string;
|
||||
f->desired_tool_bar_string = tem;
|
||||
f->n_current_tool_bar_items = f->n_desired_tool_bar_items;
|
||||
|
||||
/* Swap tool-bar items. We swap because we want to
|
||||
reuse vectors. */
|
||||
tem = f->current_toolbar_items;
|
||||
f->current_toolbar_items = f->desired_toolbar_items;
|
||||
f->desired_toolbar_items = tem;
|
||||
tem = f->current_tool_bar_items;
|
||||
f->current_tool_bar_items = f->desired_tool_bar_items;
|
||||
f->desired_tool_bar_items = tem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5336,8 +5336,8 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
|
|||
if (FRAME_TERMCAP_P (f) && !pretend)
|
||||
FrameCols = newwidth;
|
||||
|
||||
if (WINDOWP (f->toolbar_window))
|
||||
XSETFASTINT (XWINDOW (f->toolbar_window)->width, newwidth);
|
||||
if (WINDOWP (f->tool_bar_window))
|
||||
XSETFASTINT (XWINDOW (f->tool_bar_window)->width, newwidth);
|
||||
}
|
||||
|
||||
FRAME_HEIGHT (f) = newheight;
|
||||
|
|
|
|||
14
src/frame.c
14
src/frame.c
|
|
@ -90,7 +90,7 @@ Lisp_Object Qname;
|
|||
Lisp_Object Qonly;
|
||||
Lisp_Object Qunsplittable;
|
||||
Lisp_Object Qmenu_bar_lines;
|
||||
Lisp_Object Qtoolbar_lines;
|
||||
Lisp_Object Qtool_bar_lines;
|
||||
Lisp_Object Qwidth;
|
||||
Lisp_Object Qx;
|
||||
Lisp_Object Qw32;
|
||||
|
|
@ -128,8 +128,8 @@ syms_of_frame_1 ()
|
|||
staticpro (&Qunsplittable);
|
||||
Qmenu_bar_lines = intern ("menu-bar-lines");
|
||||
staticpro (&Qmenu_bar_lines);
|
||||
Qtoolbar_lines = intern ("toolbar-lines");
|
||||
staticpro (&Qtoolbar_lines);
|
||||
Qtool_bar_lines = intern ("tool-bar-lines");
|
||||
staticpro (&Qtool_bar_lines);
|
||||
Qwidth = intern ("width");
|
||||
staticpro (&Qwidth);
|
||||
Qx = intern ("x");
|
||||
|
|
@ -329,10 +329,10 @@ make_frame (mini_p)
|
|||
f->namebuf = 0;
|
||||
f->title = Qnil;
|
||||
f->menu_bar_window = Qnil;
|
||||
f->toolbar_window = Qnil;
|
||||
f->desired_toolbar_items = f->current_toolbar_items = Qnil;
|
||||
f->desired_toolbar_string = f->current_toolbar_string = Qnil;
|
||||
f->n_desired_toolbar_items = f->n_current_toolbar_items = 0;
|
||||
f->tool_bar_window = Qnil;
|
||||
f->desired_tool_bar_items = f->current_tool_bar_items = Qnil;
|
||||
f->desired_tool_bar_string = f->current_tool_bar_string = Qnil;
|
||||
f->n_desired_tool_bar_items = f->n_current_tool_bar_items = 0;
|
||||
|
||||
root_window = make_window ();
|
||||
if (mini_p)
|
||||
|
|
|
|||
26
src/frame.h
26
src/frame.h
|
|
@ -148,14 +148,14 @@ struct frame
|
|||
toolkit support is available. */
|
||||
Lisp_Object menu_bar_window;
|
||||
|
||||
/* A window used to display the toolbar of a frame. */
|
||||
Lisp_Object toolbar_window;
|
||||
/* A window used to display the tool-bar of a frame. */
|
||||
Lisp_Object tool_bar_window;
|
||||
|
||||
/* Desired and current toolbar items. */
|
||||
Lisp_Object desired_toolbar_items, current_toolbar_items;
|
||||
/* Desired and current tool-bar items. */
|
||||
Lisp_Object desired_tool_bar_items, current_tool_bar_items;
|
||||
|
||||
/* Desired and current contents displayed in toolbar_window. */
|
||||
Lisp_Object desired_toolbar_string, current_toolbar_string;
|
||||
/* Desired and current contents displayed in tool_bar_window. */
|
||||
Lisp_Object desired_tool_bar_string, current_tool_bar_string;
|
||||
|
||||
/* beyond here, there should be no more Lisp_Object components. */
|
||||
|
||||
|
|
@ -176,11 +176,11 @@ struct frame
|
|||
be used for output. */
|
||||
unsigned glyphs_initialized_p : 1;
|
||||
|
||||
/* Margin at the top of the frame. Used to display the toolbar. */
|
||||
int toolbar_lines;
|
||||
/* Margin at the top of the frame. Used to display the tool-bar. */
|
||||
int tool_bar_lines;
|
||||
|
||||
int n_desired_toolbar_items;
|
||||
int n_current_toolbar_items;
|
||||
int n_desired_tool_bar_items;
|
||||
int n_current_tool_bar_items;
|
||||
|
||||
/* A buffer for decode_mode_line. */
|
||||
char *decode_mode_spec_buffer;
|
||||
|
|
@ -412,14 +412,14 @@ typedef struct frame *FRAME_PTR;
|
|||
These lines are counted in FRAME_HEIGHT. */
|
||||
#define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
|
||||
|
||||
/* Number of lines of frame F used for the toolbar. */
|
||||
/* Number of lines of frame F used for the tool-bar. */
|
||||
|
||||
#define FRAME_TOOLBAR_LINES(f) (f)->toolbar_lines
|
||||
#define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
|
||||
|
||||
/* Lines above the top-most window in frame F. */
|
||||
|
||||
#define FRAME_TOP_MARGIN(F) \
|
||||
(FRAME_MENU_BAR_LINES (F) + FRAME_TOOLBAR_LINES (F))
|
||||
(FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
|
||||
|
||||
/* Nonzero if this frame should display a menu bar
|
||||
in a way that does not use any text lines. */
|
||||
|
|
|
|||
211
src/keyboard.c
211
src/keyboard.c
|
|
@ -2101,7 +2101,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
|
|||
&& !NILP (prev_event)
|
||||
&& EVENT_HAS_PARAMETERS (prev_event)
|
||||
&& !EQ (XCONS (prev_event)->car, Qmenu_bar)
|
||||
&& !EQ (XCONS (prev_event)->car, Qtoolbar)
|
||||
&& !EQ (XCONS (prev_event)->car, Qtool_bar)
|
||||
/* Don't bring up a menu if we already have another event. */
|
||||
&& NILP (Vunread_command_events)
|
||||
&& unread_command_char < 0)
|
||||
|
|
@ -2354,7 +2354,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
|
|||
posn = POSN_BUFFER_POSN (EVENT_START (c));
|
||||
/* Handle menu-bar events:
|
||||
insert the dummy prefix event `menu-bar'. */
|
||||
if (EQ (posn, Qmenu_bar) || EQ (posn, Qtoolbar))
|
||||
if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar))
|
||||
{
|
||||
/* Change menu-bar to (menu-bar) as the event "position". */
|
||||
POSN_BUFFER_POSN (EVENT_START (c)) = Fcons (posn, Qnil);
|
||||
|
|
@ -3185,9 +3185,9 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
|
|||
beginning of the menu sequence, and we might as well leave
|
||||
that as the `event with parameters' for this selection. */
|
||||
if ((event->kind == menu_bar_event
|
||||
|| event->kind == TOOLBAR_EVENT)
|
||||
|| event->kind == TOOL_BAR_EVENT)
|
||||
&& !(CONSP (obj) && EQ (XCONS (obj)->car, Qmenu_bar))
|
||||
&& !(CONSP (obj) && EQ (XCONS (obj)->car, Qtoolbar))
|
||||
&& !(CONSP (obj) && EQ (XCONS (obj)->car, Qtool_bar))
|
||||
&& used_mouse_menu)
|
||||
*used_mouse_menu = 1;
|
||||
#endif
|
||||
|
|
@ -4680,7 +4680,7 @@ make_lispy_event (event)
|
|||
return XCONS (event->frame_or_window)->cdr;
|
||||
#endif
|
||||
|
||||
case TOOLBAR_EVENT:
|
||||
case TOOL_BAR_EVENT:
|
||||
{
|
||||
Lisp_Object key;
|
||||
if (!CONSP (event->frame_or_window))
|
||||
|
|
@ -6378,40 +6378,40 @@ parse_menu_item (item, notreal, inmenubar)
|
|||
Tool-bars
|
||||
***********************************************************************/
|
||||
|
||||
/* A vector holding toolbar items while they are parsed in function
|
||||
toolbar_items runs Each item occupies TOOLBAR_ITEM_NSCLOTS
|
||||
elements in the vector. */
|
||||
/* A vector holding tool bar items while they are parsed in function
|
||||
tool_bar_items runs Each item occupies TOOL_BAR_ITEM_NSCLOTS elements
|
||||
in the vector. */
|
||||
|
||||
static Lisp_Object toolbar_items_vector;
|
||||
static Lisp_Object tool_bar_items_vector;
|
||||
|
||||
/* A vector holding the result of parse_toolbar_item. Layout is like
|
||||
the one for a single item in toolbar_items_vector. */
|
||||
/* A vector holding the result of parse_tool_bar_item. Layout is like
|
||||
the one for a single item in tool_bar_items_vector. */
|
||||
|
||||
static Lisp_Object toolbar_item_properties;
|
||||
static Lisp_Object tool_bar_item_properties;
|
||||
|
||||
/* Next free index in toolbar_items_vector. */
|
||||
/* Next free index in tool_bar_items_vector. */
|
||||
|
||||
static int ntoolbar_items;
|
||||
static int ntool_bar_items;
|
||||
|
||||
/* The symbols `toolbar', `toolbar-item', and `:image'. */
|
||||
/* The symbols `tool-bar', and `:image'. */
|
||||
|
||||
extern Lisp_Object Qtoolbar;
|
||||
extern Lisp_Object Qtool_bar;
|
||||
Lisp_Object QCimage;
|
||||
|
||||
/* Function prototypes. */
|
||||
|
||||
static void init_toolbar_items P_ ((Lisp_Object));
|
||||
static void process_toolbar_item P_ ((Lisp_Object, Lisp_Object));
|
||||
static int parse_toolbar_item P_ ((Lisp_Object, Lisp_Object));
|
||||
static void append_toolbar_item P_ ((void));
|
||||
static void init_tool_bar_items P_ ((Lisp_Object));
|
||||
static void process_tool_bar_item P_ ((Lisp_Object, Lisp_Object));
|
||||
static int parse_tool_bar_item P_ ((Lisp_Object, Lisp_Object));
|
||||
static void append_tool_bar_item P_ ((void));
|
||||
|
||||
|
||||
/* Return a vector of toolbar items for keymaps currently in effect.
|
||||
/* Return a vector of tool bar items for keymaps currently in effect.
|
||||
Reuse vector REUSE if non-nil. Return in *NITEMS the number of
|
||||
toolbar items found. */
|
||||
tool bar items found. */
|
||||
|
||||
Lisp_Object
|
||||
toolbar_items (reuse, nitems)
|
||||
tool_bar_items (reuse, nitems)
|
||||
Lisp_Object reuse;
|
||||
int *nitems;
|
||||
{
|
||||
|
|
@ -6433,8 +6433,8 @@ toolbar_items (reuse, nitems)
|
|||
oquit = Vinhibit_quit;
|
||||
Vinhibit_quit = Qt;
|
||||
|
||||
/* Initialize toolbar_items_vector and protect it from GC. */
|
||||
init_toolbar_items (reuse);
|
||||
/* Initialize tool_bar_items_vector and protect it from GC. */
|
||||
init_tool_bar_items (reuse);
|
||||
|
||||
/* Build list of keymaps in maps. Set nmaps to the number of maps
|
||||
to process. */
|
||||
|
|
@ -6467,13 +6467,13 @@ toolbar_items (reuse, nitems)
|
|||
maps[nmaps++] = current_global_map;
|
||||
|
||||
/* Process maps in reverse order and look up in each map the prefix
|
||||
key `toolbar'. */
|
||||
key `tool-bar'. */
|
||||
for (i = nmaps - 1; i >= 0; --i)
|
||||
if (!NILP (maps[i]))
|
||||
{
|
||||
Lisp_Object keymap;
|
||||
|
||||
keymap = get_keyelt (access_keymap (maps[i], Qtoolbar, 1, 1), 0);
|
||||
keymap = get_keyelt (access_keymap (maps[i], Qtool_bar, 1, 1), 0);
|
||||
if (!NILP (Fkeymapp (keymap)))
|
||||
{
|
||||
Lisp_Object tail;
|
||||
|
|
@ -6483,28 +6483,28 @@ toolbar_items (reuse, nitems)
|
|||
{
|
||||
Lisp_Object keydef = XCAR (tail);
|
||||
if (CONSP (keydef))
|
||||
process_toolbar_item (XCAR (keydef), XCDR (keydef));
|
||||
process_tool_bar_item (XCAR (keydef), XCDR (keydef));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vinhibit_quit = oquit;
|
||||
*nitems = ntoolbar_items / TOOLBAR_ITEM_NSLOTS;
|
||||
return toolbar_items_vector;
|
||||
*nitems = ntool_bar_items / TOOL_BAR_ITEM_NSLOTS;
|
||||
return tool_bar_items_vector;
|
||||
}
|
||||
|
||||
|
||||
/* Process the definition of KEY which is DEF. */
|
||||
|
||||
static void
|
||||
process_toolbar_item (key, def)
|
||||
process_tool_bar_item (key, def)
|
||||
Lisp_Object key, def;
|
||||
{
|
||||
int i;
|
||||
extern Lisp_Object Qundefined;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
|
||||
/* Protect KEY and DEF from GC because parse_toolbar_item may call
|
||||
/* Protect KEY and DEF from GC because parse_tool_bar_item may call
|
||||
eval. */
|
||||
GCPRO2 (key, def);
|
||||
|
||||
|
|
@ -6512,32 +6512,32 @@ process_toolbar_item (key, def)
|
|||
{
|
||||
/* If a map has an explicit `undefined' as definition,
|
||||
discard any previously made item. */
|
||||
for (i = 0; i < ntoolbar_items; i += TOOLBAR_ITEM_NSLOTS)
|
||||
for (i = 0; i < ntool_bar_items; i += TOOL_BAR_ITEM_NSLOTS)
|
||||
{
|
||||
Lisp_Object *v = XVECTOR (toolbar_items_vector)->contents + i;
|
||||
Lisp_Object *v = XVECTOR (tool_bar_items_vector)->contents + i;
|
||||
|
||||
if (EQ (key, v[TOOLBAR_ITEM_KEY]))
|
||||
if (EQ (key, v[TOOL_BAR_ITEM_KEY]))
|
||||
{
|
||||
if (ntoolbar_items > i + TOOLBAR_ITEM_NSLOTS)
|
||||
bcopy (v + TOOLBAR_ITEM_NSLOTS, v,
|
||||
((ntoolbar_items - i - TOOLBAR_ITEM_NSLOTS)
|
||||
if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS)
|
||||
bcopy (v + TOOL_BAR_ITEM_NSLOTS, v,
|
||||
((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS)
|
||||
* sizeof (Lisp_Object)));
|
||||
ntoolbar_items -= TOOLBAR_ITEM_NSLOTS;
|
||||
ntool_bar_items -= TOOL_BAR_ITEM_NSLOTS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (parse_toolbar_item (key, def))
|
||||
/* Append a new toolbar item to toolbar_items_vector. Accept
|
||||
else if (parse_tool_bar_item (key, def))
|
||||
/* Append a new tool bar item to tool_bar_items_vector. Accept
|
||||
more than one definition for the same key. */
|
||||
append_toolbar_item ();
|
||||
append_tool_bar_item ();
|
||||
|
||||
UNGCPRO;
|
||||
}
|
||||
|
||||
|
||||
/* Parse a toolbar item specification ITEM for key KEY and return the
|
||||
result in toolbar_item_properties. Value is zero if ITEM is
|
||||
/* Parse a tool bar item specification ITEM for key KEY and return the
|
||||
result in tool_bar_item_properties. Value is zero if ITEM is
|
||||
invalid.
|
||||
|
||||
ITEM is a list `(menu-item CAPTION BINDING PROPS...)'.
|
||||
|
|
@ -6545,19 +6545,19 @@ process_toolbar_item (key, def)
|
|||
CAPTION is the caption of the item, If it's not a string, it is
|
||||
evaluated to get a string.
|
||||
|
||||
BINDING is the toolbar item's binding. Toolbar items with keymaps
|
||||
BINDING is the tool bar item's binding. Tool-bar items with keymaps
|
||||
as binding are currently ignored.
|
||||
|
||||
The following properties are recognized:
|
||||
|
||||
- `:enable FORM'.
|
||||
|
||||
FORM is evaluated and specifies whether the toolbar item is enabled
|
||||
or disabled.
|
||||
FORM is evaluated and specifies whether the tool bar item is
|
||||
enabled or disabled.
|
||||
|
||||
- `:visible FORM'
|
||||
|
||||
FORM is evaluated and specifies whether the toolbar item is visible.
|
||||
FORM is evaluated and specifies whether the tool bar item is visible.
|
||||
|
||||
- `:filter FUNCTION'
|
||||
|
||||
|
|
@ -6572,18 +6572,18 @@ process_toolbar_item (key, def)
|
|||
- `:image IMAGES'
|
||||
|
||||
IMAGES is either a single image specification or a vector of four
|
||||
image specifications. See enum toolbar_item_images.
|
||||
image specifications. See enum tool_bar_item_images.
|
||||
|
||||
- `:help HELP-STRING'.
|
||||
|
||||
Gives a help string to display for the toolbar item. */
|
||||
Gives a help string to display for the tool bar item. */
|
||||
|
||||
static int
|
||||
parse_toolbar_item (key, item)
|
||||
parse_tool_bar_item (key, item)
|
||||
Lisp_Object key, item;
|
||||
{
|
||||
/* Access slot with index IDX of vector toolbar_item_properties. */
|
||||
#define PROP(IDX) XVECTOR (toolbar_item_properties)->contents[IDX]
|
||||
/* Access slot with index IDX of vector tool_bar_item_properties. */
|
||||
#define PROP(IDX) XVECTOR (tool_bar_item_properties)->contents[IDX]
|
||||
|
||||
Lisp_Object filter = Qnil;
|
||||
Lisp_Object caption;
|
||||
|
|
@ -6592,9 +6592,9 @@ parse_toolbar_item (key, item)
|
|||
int i;
|
||||
struct gcpro gcpro1;
|
||||
|
||||
/* Defininition looks like `(toolbar-item CAPTION BINDING
|
||||
/* Defininition looks like `(tool-bar-item CAPTION BINDING
|
||||
PROPS...)'. Rule out items that aren't lists, don't start with
|
||||
`toolbar-item' or whose rest following `toolbar-item' is not a
|
||||
`tool-bar-item' or whose rest following `tool-bar-item' is not a
|
||||
list. */
|
||||
if (!CONSP (item)
|
||||
|| !EQ (XCAR (item), Qmenu_item)
|
||||
|
|
@ -6602,20 +6602,20 @@ parse_toolbar_item (key, item)
|
|||
!CONSP (item)))
|
||||
return 0;
|
||||
|
||||
/* Create toolbar_item_properties vector if necessary. Reset it to
|
||||
/* Create tool_bar_item_properties vector if necessary. Reset it to
|
||||
defaults. */
|
||||
if (VECTORP (toolbar_item_properties))
|
||||
if (VECTORP (tool_bar_item_properties))
|
||||
{
|
||||
for (i = 0; i < TOOLBAR_ITEM_NSLOTS; ++i)
|
||||
for (i = 0; i < TOOL_BAR_ITEM_NSLOTS; ++i)
|
||||
PROP (i) = Qnil;
|
||||
}
|
||||
else
|
||||
toolbar_item_properties
|
||||
= Fmake_vector (make_number (TOOLBAR_ITEM_NSLOTS), Qnil);
|
||||
tool_bar_item_properties
|
||||
= Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil);
|
||||
|
||||
/* Set defaults. */
|
||||
PROP (TOOLBAR_ITEM_KEY) = key;
|
||||
PROP (TOOLBAR_ITEM_ENABLED_P) = Qt;
|
||||
PROP (TOOL_BAR_ITEM_KEY) = key;
|
||||
PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
|
||||
|
||||
/* Get the caption of the item. If the caption is not a string,
|
||||
evaluate it to get a string. If we don't get a string, skip this
|
||||
|
|
@ -6627,7 +6627,7 @@ parse_toolbar_item (key, item)
|
|||
if (!STRINGP (caption))
|
||||
return 0;
|
||||
}
|
||||
PROP (TOOLBAR_ITEM_CAPTION) = caption;
|
||||
PROP (TOOL_BAR_ITEM_CAPTION) = caption;
|
||||
|
||||
/* Give up if rest following the caption is not a list. */
|
||||
item = XCDR (item);
|
||||
|
|
@ -6635,7 +6635,7 @@ parse_toolbar_item (key, item)
|
|||
return 0;
|
||||
|
||||
/* Store the binding. */
|
||||
PROP (TOOLBAR_ITEM_BINDING) = XCAR (item);
|
||||
PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item);
|
||||
item = XCDR (item);
|
||||
|
||||
/* Process the rest of the properties. */
|
||||
|
|
@ -6648,7 +6648,7 @@ parse_toolbar_item (key, item)
|
|||
|
||||
if (EQ (key, QCenable))
|
||||
/* `:enable FORM'. */
|
||||
PROP (TOOLBAR_ITEM_ENABLED_P) = value;
|
||||
PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
|
||||
else if (EQ (key, QCvisible))
|
||||
{
|
||||
/* `:visible FORM'. If got a visible property and that
|
||||
|
|
@ -6658,7 +6658,7 @@ parse_toolbar_item (key, item)
|
|||
}
|
||||
else if (EQ (key, QChelp))
|
||||
/* `:help HELP-STRING'. */
|
||||
PROP (TOOLBAR_ITEM_HELP) = value;
|
||||
PROP (TOOL_BAR_ITEM_HELP) = value;
|
||||
else if (EQ (key, QCfilter))
|
||||
/* ':filter FORM'. */
|
||||
filter = value;
|
||||
|
|
@ -6671,8 +6671,8 @@ parse_toolbar_item (key, item)
|
|||
selected = XCDR (value);
|
||||
if (EQ (type, QCtoggle) || EQ (type, QCradio))
|
||||
{
|
||||
PROP (TOOLBAR_ITEM_SELECTED_P) = selected;
|
||||
PROP (TOOLBAR_ITEM_TYPE) = type;
|
||||
PROP (TOOL_BAR_ITEM_SELECTED_P) = selected;
|
||||
PROP (TOOL_BAR_ITEM_TYPE) = type;
|
||||
}
|
||||
}
|
||||
else if (EQ (key, QCimage)
|
||||
|
|
@ -6680,29 +6680,29 @@ parse_toolbar_item (key, item)
|
|||
|| (VECTORP (value) && XVECTOR (value)->size == 4)))
|
||||
/* Value is either a single image specification or a vector
|
||||
of 4 such specifications for the different buttion states. */
|
||||
PROP (TOOLBAR_ITEM_IMAGES) = value;
|
||||
PROP (TOOL_BAR_ITEM_IMAGES) = value;
|
||||
}
|
||||
|
||||
/* If got a filter apply it on binding. */
|
||||
if (!NILP (filter))
|
||||
PROP (TOOLBAR_ITEM_BINDING)
|
||||
PROP (TOOL_BAR_ITEM_BINDING)
|
||||
= menu_item_eval_property (list2 (filter,
|
||||
list2 (Qquote,
|
||||
PROP (TOOLBAR_ITEM_BINDING))));
|
||||
PROP (TOOL_BAR_ITEM_BINDING))));
|
||||
|
||||
/* See if the binding is a keymap. Give up if it is. */
|
||||
if (!NILP (get_keymap_1 (PROP (TOOLBAR_ITEM_BINDING), 0, 1)))
|
||||
if (!NILP (get_keymap_1 (PROP (TOOL_BAR_ITEM_BINDING), 0, 1)))
|
||||
return 0;
|
||||
|
||||
/* Enable or disable selection of item. */
|
||||
if (!EQ (PROP (TOOLBAR_ITEM_ENABLED_P), Qt))
|
||||
PROP (TOOLBAR_ITEM_ENABLED_P)
|
||||
= menu_item_eval_property (PROP (TOOLBAR_ITEM_ENABLED_P));
|
||||
if (!EQ (PROP (TOOL_BAR_ITEM_ENABLED_P), Qt))
|
||||
PROP (TOOL_BAR_ITEM_ENABLED_P)
|
||||
= menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P));
|
||||
|
||||
/* Handle radio buttons or toggle boxes. */
|
||||
if (!NILP (PROP (TOOLBAR_ITEM_SELECTED_P)))
|
||||
PROP (TOOLBAR_ITEM_SELECTED_P)
|
||||
= menu_item_eval_property (PROP (TOOLBAR_ITEM_SELECTED_P));
|
||||
if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)))
|
||||
PROP (TOOL_BAR_ITEM_SELECTED_P)
|
||||
= menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P));
|
||||
|
||||
return 1;
|
||||
|
||||
|
|
@ -6710,48 +6710,49 @@ parse_toolbar_item (key, item)
|
|||
}
|
||||
|
||||
|
||||
/* Initialize Vtoolbar_items. REUSE, if non-nil, is a vector that can
|
||||
be reused. */
|
||||
/* Initialize tool_bar_items_vector. REUSE, if non-nil, is a vector
|
||||
that can be reused. */
|
||||
|
||||
static void
|
||||
init_toolbar_items (reuse)
|
||||
init_tool_bar_items (reuse)
|
||||
Lisp_Object reuse;
|
||||
{
|
||||
if (VECTORP (reuse))
|
||||
toolbar_items_vector = reuse;
|
||||
tool_bar_items_vector = reuse;
|
||||
else
|
||||
toolbar_items_vector = Fmake_vector (make_number (64), Qnil);
|
||||
ntoolbar_items = 0;
|
||||
tool_bar_items_vector = Fmake_vector (make_number (64), Qnil);
|
||||
ntool_bar_items = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Append parsed toolbar item properties from toolbar_item_properties */
|
||||
/* Append parsed tool bar item properties from
|
||||
tool_bar_item_properties */
|
||||
|
||||
static void
|
||||
append_toolbar_item ()
|
||||
append_tool_bar_item ()
|
||||
{
|
||||
Lisp_Object *to, *from;
|
||||
|
||||
/* Enlarge toolbar_items_vector if necessary. */
|
||||
if (ntoolbar_items + TOOLBAR_ITEM_NSLOTS
|
||||
>= XVECTOR (toolbar_items_vector)->size)
|
||||
/* Enlarge tool_bar_items_vector if necessary. */
|
||||
if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
|
||||
>= XVECTOR (tool_bar_items_vector)->size)
|
||||
{
|
||||
Lisp_Object new_vector;
|
||||
int old_size = XVECTOR (toolbar_items_vector)->size;
|
||||
int old_size = XVECTOR (tool_bar_items_vector)->size;
|
||||
|
||||
new_vector = Fmake_vector (make_number (2 * old_size), Qnil);
|
||||
bcopy (XVECTOR (toolbar_items_vector)->contents,
|
||||
bcopy (XVECTOR (tool_bar_items_vector)->contents,
|
||||
XVECTOR (new_vector)->contents,
|
||||
old_size * sizeof (Lisp_Object));
|
||||
toolbar_items_vector = new_vector;
|
||||
tool_bar_items_vector = new_vector;
|
||||
}
|
||||
|
||||
/* Append entries from toolbar_item_properties to the end of
|
||||
toolbar_items_vector. */
|
||||
to = XVECTOR (toolbar_items_vector)->contents + ntoolbar_items;
|
||||
from = XVECTOR (toolbar_item_properties)->contents;
|
||||
bcopy (from, to, TOOLBAR_ITEM_NSLOTS * sizeof *to);
|
||||
ntoolbar_items += TOOLBAR_ITEM_NSLOTS;
|
||||
/* Append entries from tool_bar_item_properties to the end of
|
||||
tool_bar_items_vector. */
|
||||
to = XVECTOR (tool_bar_items_vector)->contents + ntool_bar_items;
|
||||
from = XVECTOR (tool_bar_item_properties)->contents;
|
||||
bcopy (from, to, TOOL_BAR_ITEM_NSLOTS * sizeof *to);
|
||||
ntool_bar_items += TOOL_BAR_ITEM_NSLOTS;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -6821,7 +6822,7 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu)
|
|||
use a real menu for mouse selection. */
|
||||
if (EVENT_HAS_PARAMETERS (prev_event)
|
||||
&& !EQ (XCONS (prev_event)->car, Qmenu_bar)
|
||||
&& !EQ (XCONS (prev_event)->car, Qtoolbar))
|
||||
&& !EQ (XCONS (prev_event)->car, Qtool_bar))
|
||||
{
|
||||
/* Display the menu and get the selection. */
|
||||
Lisp_Object *realmaps
|
||||
|
|
@ -7786,7 +7787,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
|
|||
posn = POSN_BUFFER_POSN (EVENT_START (key));
|
||||
/* Handle menu-bar events:
|
||||
insert the dummy prefix event `menu-bar'. */
|
||||
if (EQ (posn, Qmenu_bar) || EQ (posn, Qtoolbar))
|
||||
if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar))
|
||||
{
|
||||
if (t + 1 >= bufsize)
|
||||
error ("Key sequence too long");
|
||||
|
|
@ -9520,7 +9521,7 @@ struct event_head head_table[] = {
|
|||
void
|
||||
syms_of_keyboard ()
|
||||
{
|
||||
/* Toolbars. */
|
||||
/* Tool-bars. */
|
||||
QCimage = intern (":image");
|
||||
staticpro (&QCimage);
|
||||
|
||||
|
|
@ -9530,10 +9531,10 @@ syms_of_keyboard ()
|
|||
staticpro (&item_properties);
|
||||
item_properties = Qnil;
|
||||
|
||||
staticpro (&toolbar_item_properties);
|
||||
toolbar_item_properties = Qnil;
|
||||
staticpro (&toolbar_items_vector);
|
||||
toolbar_items_vector = Qnil;
|
||||
staticpro (&tool_bar_item_properties);
|
||||
tool_bar_item_properties = Qnil;
|
||||
staticpro (&tool_bar_items_vector);
|
||||
tool_bar_items_vector = Qnil;
|
||||
|
||||
staticpro (&real_this_command);
|
||||
real_this_command = Qnil;
|
||||
|
|
|
|||
|
|
@ -2357,7 +2357,7 @@ EXFUN (Frecursive_edit, 0);
|
|||
EXFUN (Fcommand_execute, 4);
|
||||
EXFUN (Finput_pending_p, 0);
|
||||
extern Lisp_Object menu_bar_items P_ ((Lisp_Object));
|
||||
extern Lisp_Object toolbar_items P_ ((Lisp_Object, int *));
|
||||
extern Lisp_Object tool_bar_items P_ ((Lisp_Object, int *));
|
||||
extern Lisp_Object Qvertical_scroll_bar;
|
||||
extern void discard_mouse_events ();
|
||||
EXFUN (Fevent_convert_list, 1);
|
||||
|
|
@ -2639,7 +2639,7 @@ extern void syms_of_xfaces P_ ((void));
|
|||
|
||||
#ifdef HAVE_X_WINDOWS
|
||||
/* Defined in xfns.c */
|
||||
extern void x_set_toolbar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
extern void syms_of_xfns P_ ((void));
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -307,13 +307,13 @@ enum event_kind
|
|||
.code is a number identifying it,
|
||||
index into lispy_user_signals. */
|
||||
|
||||
/* Currently only returned when the mouse enters a toolbar item that
|
||||
/* Currently only returned when the mouse enters a tool-bar item that
|
||||
has a help string. Member frame_or_window of the input_event is
|
||||
a cons cell whose car is the toolbar's frame and whose cdr is the
|
||||
a cons cell whose car is the tool-bar's frame and whose cdr is the
|
||||
help string. */
|
||||
HELP_EVENT,
|
||||
|
||||
TOOLBAR_EVENT
|
||||
TOOL_BAR_EVENT
|
||||
};
|
||||
|
||||
/* If a struct input_event has a kind which is selection_request_event
|
||||
|
|
|
|||
36
src/window.c
36
src/window.c
|
|
@ -581,14 +581,14 @@ If they are on the border between WINDOW and its right sibling,\n\
|
|||
set *PART to 1; if it is on the separating line between the window
|
||||
and its right sibling, set it to 2; otherwise set it to 0. If
|
||||
there is no window under X, Y return nil and leave *PART
|
||||
unmodified. TOOLBAR_P non-zero means detect toolbar windows. */
|
||||
unmodified. TOOL_BAR_P non-zero means detect tool-bar windows. */
|
||||
|
||||
Lisp_Object
|
||||
window_from_coordinates (frame, x, y, part, toolbar_p)
|
||||
window_from_coordinates (frame, x, y, part, tool_bar_p)
|
||||
FRAME_PTR frame;
|
||||
int x, y;
|
||||
int *part;
|
||||
int toolbar_p;
|
||||
int tool_bar_p;
|
||||
{
|
||||
register Lisp_Object tem, first;
|
||||
int found;
|
||||
|
|
@ -609,14 +609,14 @@ window_from_coordinates (frame, x, y, part, toolbar_p)
|
|||
}
|
||||
while (!EQ (tem, first));
|
||||
|
||||
/* See if it's in the toolbar window, if a toolbar exists. */
|
||||
if (toolbar_p
|
||||
&& WINDOWP (frame->toolbar_window)
|
||||
&& XFASTINT (XWINDOW (frame->toolbar_window)->height)
|
||||
&& coordinates_in_window (XWINDOW (frame->toolbar_window), &x, &y))
|
||||
/* See if it's in the tool bar window, if a tool bar exists. */
|
||||
if (tool_bar_p
|
||||
&& WINDOWP (frame->tool_bar_window)
|
||||
&& XFASTINT (XWINDOW (frame->tool_bar_window)->height)
|
||||
&& coordinates_in_window (XWINDOW (frame->tool_bar_window), &x, &y))
|
||||
{
|
||||
*part = 0;
|
||||
return frame->toolbar_window;
|
||||
return frame->tool_bar_window;
|
||||
}
|
||||
|
||||
return Qnil;
|
||||
|
|
@ -3976,7 +3976,7 @@ struct save_window_data
|
|||
EMACS_INT size_from_Lisp_Vector_struct;
|
||||
struct Lisp_Vector *next_from_Lisp_Vector_struct;
|
||||
Lisp_Object frame_width, frame_height, frame_menu_bar_lines;
|
||||
Lisp_Object frame_toolbar_lines;
|
||||
Lisp_Object frame_tool_bar_lines;
|
||||
Lisp_Object selected_frame;
|
||||
Lisp_Object current_window;
|
||||
Lisp_Object current_buffer;
|
||||
|
|
@ -4091,7 +4091,7 @@ the return value is nil. Otherwise the value is t.")
|
|||
int previous_frame_height = FRAME_HEIGHT (f);
|
||||
int previous_frame_width = FRAME_WIDTH (f);
|
||||
int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f);
|
||||
int previous_frame_toolbar_lines = FRAME_TOOLBAR_LINES (f);
|
||||
int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f);
|
||||
|
||||
/* The mouse highlighting code could get screwed up
|
||||
if it runs during this. */
|
||||
|
|
@ -4106,9 +4106,9 @@ the return value is nil. Otherwise the value is t.")
|
|||
!= previous_frame_menu_bar_lines)
|
||||
x_set_menu_bar_lines (f, data->frame_menu_bar_lines, make_number (0));
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
if (XFASTINT (data->frame_toolbar_lines)
|
||||
!= previous_frame_toolbar_lines)
|
||||
x_set_toolbar_lines (f, data->frame_toolbar_lines, make_number (0));
|
||||
if (XFASTINT (data->frame_tool_bar_lines)
|
||||
!= previous_frame_tool_bar_lines)
|
||||
x_set_tool_bar_lines (f, data->frame_tool_bar_lines, make_number (0));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -4273,9 +4273,9 @@ the return value is nil. Otherwise the value is t.")
|
|||
x_set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines),
|
||||
make_number (0));
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
if (previous_frame_toolbar_lines != FRAME_TOOLBAR_LINES (f))
|
||||
x_set_toolbar_lines (f, make_number (previous_frame_toolbar_lines),
|
||||
make_number (0));
|
||||
if (previous_frame_tool_bar_lines != FRAME_TOOL_BAR_LINES (f))
|
||||
x_set_tool_bar_lines (f, make_number (previous_frame_tool_bar_lines),
|
||||
make_number (0));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -4529,7 +4529,7 @@ redirection (see `redirect-frame-focus').")
|
|||
XSETFASTINT (data->frame_width, FRAME_WIDTH (f));
|
||||
XSETFASTINT (data->frame_height, FRAME_HEIGHT (f));
|
||||
XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (data->frame_toolbar_lines, FRAME_TOOLBAR_LINES (f));
|
||||
XSETFASTINT (data->frame_tool_bar_lines, FRAME_TOOL_BAR_LINES (f));
|
||||
XSETFRAME (data->selected_frame, selected_frame);
|
||||
data->current_window = FRAME_SELECTED_WINDOW (f);
|
||||
XSETBUFFER (data->current_buffer, current_buffer);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ Lisp_Object Qx_charset_registry;
|
|||
|
||||
/* Names of basic faces. */
|
||||
|
||||
Lisp_Object Qdefault, Qmodeline, Qtoolbar, Qregion, Qmargin;
|
||||
Lisp_Object Qdefault, Qmodeline, Qtool_bar, Qregion, Qmargin;
|
||||
Lisp_Object Qtop_line;
|
||||
|
||||
/* Default stipple pattern used on monochrome displays. This stipple
|
||||
|
|
@ -5130,7 +5130,7 @@ realize_basic_faces (f)
|
|||
if (realize_default_face (f))
|
||||
{
|
||||
realize_named_face (f, Qmodeline, MODE_LINE_FACE_ID);
|
||||
realize_named_face (f, Qtoolbar, TOOLBAR_FACE_ID);
|
||||
realize_named_face (f, Qtool_bar, TOOL_BAR_FACE_ID);
|
||||
realize_named_face (f, Qmargin, BITMAP_AREA_FACE_ID);
|
||||
realize_named_face (f, Qtop_line, TOP_LINE_FACE_ID);
|
||||
success_p = 1;
|
||||
|
|
@ -6242,8 +6242,8 @@ syms_of_xfaces ()
|
|||
staticpro (&Qdefault);
|
||||
Qmodeline = intern ("modeline");
|
||||
staticpro (&Qmodeline);
|
||||
Qtoolbar = intern ("toolbar");
|
||||
staticpro (&Qtoolbar);
|
||||
Qtool_bar = intern ("tool-bar");
|
||||
staticpro (&Qtool_bar);
|
||||
Qregion = intern ("region");
|
||||
staticpro (&Qregion);
|
||||
Qmargin = intern ("margin");
|
||||
|
|
|
|||
24
src/xfns.c
24
src/xfns.c
|
|
@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Image support (XBM, XPM, PBM, JPEG, TIFF, GIF, PNG, GS). tooltips,
|
||||
toolbars, busy-cursor, file selection dialog added by Gerd
|
||||
tool-bars, busy-cursor, file selection dialog added by Gerd
|
||||
Moellmann <gerd@gnu.org>. */
|
||||
|
||||
/* Completely rewritten by Richard Stallman. */
|
||||
|
|
@ -259,7 +259,7 @@ Lisp_Object Qscreen_gamma;
|
|||
|
||||
extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
|
||||
extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
|
||||
extern Lisp_Object Qtoolbar_lines;
|
||||
extern Lisp_Object Qtool_bar_lines;
|
||||
|
||||
extern Lisp_Object Vwindow_system_version;
|
||||
|
||||
|
|
@ -769,7 +769,7 @@ void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
|||
void x_set_scroll_bar_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
void x_set_unsplittable P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
void x_set_toolbar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
|
||||
void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object,
|
||||
Lisp_Object));
|
||||
void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object,
|
||||
|
|
@ -803,7 +803,7 @@ static struct x_frame_parm_table x_frame_parms[] =
|
|||
"unsplittable", x_set_unsplittable,
|
||||
"vertical-scroll-bars", x_set_vertical_scroll_bars,
|
||||
"visibility", x_set_visibility,
|
||||
"toolbar-lines", x_set_toolbar_lines,
|
||||
"tool-bar-lines", x_set_tool_bar_lines,
|
||||
"scroll-bar-foreground", x_set_scroll_bar_foreground,
|
||||
"scroll-bar-background", x_set_scroll_bar_background,
|
||||
"screen-gamma", x_set_screen_gamma
|
||||
|
|
@ -1984,7 +1984,7 @@ x_set_menu_bar_lines (f, value, oldval)
|
|||
The frame's height doesn't change. */
|
||||
|
||||
void
|
||||
x_set_toolbar_lines (f, value, oldval)
|
||||
x_set_tool_bar_lines (f, value, oldval)
|
||||
struct frame *f;
|
||||
Lisp_Object value, oldval;
|
||||
{
|
||||
|
|
@ -1999,8 +1999,8 @@ x_set_toolbar_lines (f, value, oldval)
|
|||
/* Make sure we redisplay all windows in this frame. */
|
||||
++windows_or_buffers_changed;
|
||||
|
||||
delta = nlines - FRAME_TOOLBAR_LINES (f);
|
||||
FRAME_TOOLBAR_LINES (f) = nlines;
|
||||
delta = nlines - FRAME_TOOL_BAR_LINES (f);
|
||||
FRAME_TOOL_BAR_LINES (f) = nlines;
|
||||
x_set_menu_bar_lines_1 (FRAME_ROOT_WINDOW (f), delta);
|
||||
adjust_glyphs (f);
|
||||
}
|
||||
|
|
@ -3773,7 +3773,7 @@ This function is an internal primitive--use `make-frame' instead.")
|
|||
|
||||
x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
|
||||
"menuBar", "MenuBar", RES_TYPE_NUMBER);
|
||||
x_default_parameter (f, parms, Qtoolbar_lines, make_number (0),
|
||||
x_default_parameter (f, parms, Qtool_bar_lines, make_number (0),
|
||||
"toolBar", "ToolBar", RES_TYPE_NUMBER);
|
||||
x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
|
||||
"scrollBarWidth", "ScrollBarWidth",
|
||||
|
|
@ -3807,13 +3807,13 @@ This function is an internal primitive--use `make-frame' instead.")
|
|||
tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
|
||||
f->no_split = minibuffer_only || EQ (tem, Qt);
|
||||
|
||||
/* Create the X widget or window. Add the toolbar height to the
|
||||
/* Create the X widget or window. Add the tool-bar height to the
|
||||
initial frame height so that the user gets a text display area of
|
||||
the size he specified with -g or via .Xdefaults. Later changes
|
||||
of the toolbar height don't change the frame size. This is done
|
||||
of the tool-bar height don't change the frame size. This is done
|
||||
so that users can create tall Emacs frames without having to
|
||||
guess how tall the toolbar will get. */
|
||||
f->height += FRAME_TOOLBAR_LINES (f);
|
||||
guess how tall the tool-bar will get. */
|
||||
f->height += FRAME_TOOL_BAR_LINES (f);
|
||||
|
||||
#ifdef USE_X_TOOLKIT
|
||||
x_window (f, window_prompting, minibuffer_only);
|
||||
|
|
|
|||
148
src/xterm.c
148
src/xterm.c
|
|
@ -411,8 +411,8 @@ static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int,
|
|||
static void note_mode_line_highlight P_ ((struct window *, int, int));
|
||||
static void x_check_font P_ ((struct frame *, XFontStruct *));
|
||||
static void note_mouse_highlight P_ ((struct frame *, int, int));
|
||||
static void note_toolbar_highlight P_ ((struct frame *f, int, int));
|
||||
static void x_handle_toolbar_click P_ ((struct frame *, XButtonEvent *));
|
||||
static void note_tool_bar_highlight P_ ((struct frame *f, int, int));
|
||||
static void x_handle_tool_bar_click P_ ((struct frame *, XButtonEvent *));
|
||||
static void show_mouse_face P_ ((struct x_display_info *,
|
||||
enum draw_glyphs_face));
|
||||
static int x_io_error_quitter P_ ((Display *));
|
||||
|
|
@ -2439,9 +2439,9 @@ x_get_glyph_string_clip_rect (s, r)
|
|||
else
|
||||
r->y = max (0, s->row->y);
|
||||
|
||||
/* If drawing a toolbar window, draw it over the internal border
|
||||
/* If drawing a tool-bar window, draw it over the internal border
|
||||
at the top of the window. */
|
||||
if (s->w == XWINDOW (s->f->toolbar_window))
|
||||
if (s->w == XWINDOW (s->f->tool_bar_window))
|
||||
r->y -= s->f->output_data.x->internal_border_width;
|
||||
|
||||
/* If S draws overlapping rows, it's sufficient to use the top and
|
||||
|
|
@ -3464,7 +3464,7 @@ x_draw_image_relief (s)
|
|||
if (s->hl == DRAW_IMAGE_SUNKEN
|
||||
|| s->hl == DRAW_IMAGE_RAISED)
|
||||
{
|
||||
thick = toolbar_button_relief > 0 ? toolbar_button_relief : 3;
|
||||
thick = tool_bar_button_relief > 0 ? tool_bar_button_relief : 3;
|
||||
raised_p = s->hl == DRAW_IMAGE_RAISED;
|
||||
}
|
||||
else
|
||||
|
|
@ -4099,8 +4099,8 @@ x_init_glyph_string (s, char2b, w, row, area, start, hl)
|
|||
s->height = row->height;
|
||||
s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
|
||||
|
||||
/* Display the internal border below the toolbar window. */
|
||||
if (s->w == XWINDOW (s->f->toolbar_window))
|
||||
/* Display the internal border below the tool-bar window. */
|
||||
if (s->w == XWINDOW (s->f->tool_bar_window))
|
||||
s->y -= s->f->output_data.x->internal_border_width;
|
||||
|
||||
s->ybase = s->y + row->ascent;
|
||||
|
|
@ -4870,7 +4870,7 @@ XTflash (f)
|
|||
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
|
||||
flash_left,
|
||||
(FRAME_INTERNAL_BORDER_WIDTH (f)
|
||||
+ FRAME_TOOLBAR_LINES (f) * CANON_Y_UNIT (f)),
|
||||
+ FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)),
|
||||
width, flash_height);
|
||||
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
|
||||
flash_left,
|
||||
|
|
@ -4919,7 +4919,7 @@ XTflash (f)
|
|||
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
|
||||
flash_left,
|
||||
(FRAME_INTERNAL_BORDER_WIDTH (f)
|
||||
+ FRAME_TOOLBAR_LINES (f) * CANON_Y_UNIT (f)),
|
||||
+ FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)),
|
||||
width, flash_height);
|
||||
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
|
||||
flash_left,
|
||||
|
|
@ -5107,9 +5107,9 @@ expose_frame (f, x, y, w, h)
|
|||
TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height));
|
||||
expose_window_tree (XWINDOW (f->root_window), &r);
|
||||
|
||||
if (WINDOWP (f->toolbar_window))
|
||||
if (WINDOWP (f->tool_bar_window))
|
||||
{
|
||||
struct window *w = XWINDOW (f->toolbar_window);
|
||||
struct window *w = XWINDOW (f->tool_bar_window);
|
||||
XRectangle window_rect;
|
||||
XRectangle intersection_rect;
|
||||
int window_x, window_y, window_width, window_height;
|
||||
|
|
@ -6145,11 +6145,11 @@ note_mouse_highlight (f, x, y)
|
|||
w = XWINDOW (window);
|
||||
frame_to_window_pixel_xy (w, &x, &y);
|
||||
|
||||
/* Handle toolbar window differently since it doesn't display a
|
||||
/* Handle tool-bar window differently since it doesn't display a
|
||||
buffer. */
|
||||
if (EQ (window, f->toolbar_window))
|
||||
if (EQ (window, f->tool_bar_window))
|
||||
{
|
||||
note_toolbar_highlight (f, x, y);
|
||||
note_tool_bar_highlight (f, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -6372,37 +6372,37 @@ redo_mouse_highlight ()
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
Toolbars
|
||||
Tool-bars
|
||||
***********************************************************************/
|
||||
|
||||
static int x_toolbar_item P_ ((struct frame *, int, int,
|
||||
struct glyph **, int *, int *, int *));
|
||||
static int x_tool_bar_item P_ ((struct frame *, int, int,
|
||||
struct glyph **, int *, int *, int *));
|
||||
|
||||
/* Toolbar item index of the item on which a mouse button was pressed
|
||||
/* Tool-bar item index of the item on which a mouse button was pressed
|
||||
or -1. */
|
||||
|
||||
static int last_toolbar_item;
|
||||
static int last_tool_bar_item;
|
||||
|
||||
|
||||
/* Get information about the toolbar item at position X/Y on frame F.
|
||||
Return in *GLYPH a pointer to the glyph of the toolbar item in
|
||||
the current matrix of the toolbar window of F, or NULL if not
|
||||
on a toolbar item. Return in *PROP_IDX the index of the toolbar
|
||||
item in F->current_toolbar_items. Value is
|
||||
/* Get information about the tool-bar item at position X/Y on frame F.
|
||||
Return in *GLYPH a pointer to the glyph of the tool-bar item in
|
||||
the current matrix of the tool-bar window of F, or NULL if not
|
||||
on a tool-bar item. Return in *PROP_IDX the index of the tool-bar
|
||||
item in F->current_tool_bar_items. Value is
|
||||
|
||||
-1 if X/Y is not on a toolbar item
|
||||
-1 if X/Y is not on a tool-bar item
|
||||
0 if X/Y is on the same item that was highlighted before.
|
||||
1 otherwise. */
|
||||
|
||||
static int
|
||||
x_toolbar_item (f, x, y, glyph, hpos, vpos, prop_idx)
|
||||
x_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx)
|
||||
struct frame *f;
|
||||
int x, y;
|
||||
struct glyph **glyph;
|
||||
int *hpos, *vpos, *prop_idx;
|
||||
{
|
||||
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
|
||||
struct window *w = XWINDOW (f->toolbar_window);
|
||||
struct window *w = XWINDOW (f->tool_bar_window);
|
||||
int area;
|
||||
|
||||
/* Find the glyph under X/Y. */
|
||||
|
|
@ -6410,13 +6410,13 @@ x_toolbar_item (f, x, y, glyph, hpos, vpos, prop_idx)
|
|||
if (*glyph == NULL)
|
||||
return -1;
|
||||
|
||||
/* Get the start of this toolbar item's properties in
|
||||
f->current_toolbar_items. */
|
||||
if (!toolbar_item_info (f, *glyph, prop_idx))
|
||||
/* Get the start of this tool-bar item's properties in
|
||||
f->current_tool_bar_items. */
|
||||
if (!tool_bar_item_info (f, *glyph, prop_idx))
|
||||
return -1;
|
||||
|
||||
/* Is mouse on the highlighted item? */
|
||||
if (EQ (f->toolbar_window, dpyinfo->mouse_face_window)
|
||||
if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window)
|
||||
&& *vpos >= dpyinfo->mouse_face_beg_row
|
||||
&& *vpos <= dpyinfo->mouse_face_end_row
|
||||
&& (*vpos > dpyinfo->mouse_face_beg_row
|
||||
|
|
@ -6430,31 +6430,31 @@ x_toolbar_item (f, x, y, glyph, hpos, vpos, prop_idx)
|
|||
}
|
||||
|
||||
|
||||
/* Handle mouse button event on the toolbar of frame F, at
|
||||
/* Handle mouse button event on the tool-bar of frame F, at
|
||||
frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress
|
||||
or ButtonRelase. */
|
||||
|
||||
static void
|
||||
x_handle_toolbar_click (f, button_event)
|
||||
x_handle_tool_bar_click (f, button_event)
|
||||
struct frame *f;
|
||||
XButtonEvent *button_event;
|
||||
{
|
||||
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
|
||||
struct window *w = XWINDOW (f->toolbar_window);
|
||||
struct window *w = XWINDOW (f->tool_bar_window);
|
||||
int hpos, vpos, prop_idx;
|
||||
struct glyph *glyph;
|
||||
Lisp_Object enabled_p;
|
||||
int x = button_event->x;
|
||||
int y = button_event->y;
|
||||
|
||||
/* If not on the highlighted toolbar item, return. */
|
||||
/* If not on the highlighted tool-bar item, return. */
|
||||
frame_to_window_pixel_xy (w, &x, &y);
|
||||
if (x_toolbar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0)
|
||||
if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0)
|
||||
return;
|
||||
|
||||
/* If item is disabled, do nothing. */
|
||||
enabled_p = (XVECTOR (f->current_toolbar_items)
|
||||
->contents[prop_idx + TOOLBAR_ITEM_ENABLED_P]);
|
||||
enabled_p = (XVECTOR (f->current_tool_bar_items)
|
||||
->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]);
|
||||
if (NILP (enabled_p))
|
||||
return;
|
||||
|
||||
|
|
@ -6463,7 +6463,7 @@ x_handle_toolbar_click (f, button_event)
|
|||
/* Show item in pressed state. */
|
||||
show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN);
|
||||
dpyinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN;
|
||||
last_toolbar_item = prop_idx;
|
||||
last_tool_bar_item = prop_idx;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6474,34 +6474,34 @@ x_handle_toolbar_click (f, button_event)
|
|||
show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED);
|
||||
dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
|
||||
|
||||
key = (XVECTOR (f->current_toolbar_items)
|
||||
->contents[prop_idx + TOOLBAR_ITEM_KEY]);
|
||||
key = (XVECTOR (f->current_tool_bar_items)
|
||||
->contents[prop_idx + TOOL_BAR_ITEM_KEY]);
|
||||
|
||||
XSETFRAME (frame, f);
|
||||
event.kind = TOOLBAR_EVENT;
|
||||
event.frame_or_window = Fcons (frame, Fcons (Qtoolbar, Qnil));
|
||||
event.kind = TOOL_BAR_EVENT;
|
||||
event.frame_or_window = Fcons (frame, Fcons (Qtool_bar, Qnil));
|
||||
kbd_buffer_store_event (&event);
|
||||
|
||||
event.kind = TOOLBAR_EVENT;
|
||||
event.kind = TOOL_BAR_EVENT;
|
||||
event.frame_or_window = Fcons (frame, key);
|
||||
event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f),
|
||||
button_event->state);
|
||||
kbd_buffer_store_event (&event);
|
||||
last_toolbar_item = -1;
|
||||
last_tool_bar_item = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Possibly highlight a toolbar item on frame F when mouse moves to
|
||||
toolbar window-relative coordinates X/Y. Called from
|
||||
/* Possibly highlight a tool-bar item on frame F when mouse moves to
|
||||
tool-bar window-relative coordinates X/Y. Called from
|
||||
note_mouse_highlight. */
|
||||
|
||||
static void
|
||||
note_toolbar_highlight (f, x, y)
|
||||
note_tool_bar_highlight (f, x, y)
|
||||
struct frame *f;
|
||||
int x, y;
|
||||
{
|
||||
Lisp_Object window = f->toolbar_window;
|
||||
Lisp_Object window = f->tool_bar_window;
|
||||
struct window *w = XWINDOW (window);
|
||||
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
|
||||
int hpos, vpos;
|
||||
|
|
@ -6521,33 +6521,33 @@ note_toolbar_highlight (f, x, y)
|
|||
return;
|
||||
}
|
||||
|
||||
rc = x_toolbar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx);
|
||||
rc = x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx);
|
||||
if (rc < 0)
|
||||
{
|
||||
/* Not on toolbar item. */
|
||||
/* Not on tool-bar item. */
|
||||
clear_mouse_face (dpyinfo);
|
||||
return;
|
||||
}
|
||||
else if (rc == 0)
|
||||
/* On same toolbar item as before. */
|
||||
/* On same tool-bar item as before. */
|
||||
goto set_help_echo;
|
||||
|
||||
clear_mouse_face (dpyinfo);
|
||||
|
||||
/* Mouse is down, but on different toolbar item? */
|
||||
/* Mouse is down, but on different tool-bar item? */
|
||||
mouse_down_p = (dpyinfo->grabbed
|
||||
&& f == last_mouse_frame
|
||||
&& FRAME_LIVE_P (f));
|
||||
if (mouse_down_p
|
||||
&& last_toolbar_item != prop_idx)
|
||||
&& last_tool_bar_item != prop_idx)
|
||||
return;
|
||||
|
||||
dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
|
||||
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
|
||||
|
||||
/* If toolbar item is not enabled, don't highlight it. */
|
||||
enabled_p = (XVECTOR (f->current_toolbar_items)
|
||||
->contents[prop_idx + TOOLBAR_ITEM_ENABLED_P]);
|
||||
/* If tool-bar item is not enabled, don't highlight it. */
|
||||
enabled_p = (XVECTOR (f->current_tool_bar_items)
|
||||
->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]);
|
||||
if (!NILP (enabled_p))
|
||||
{
|
||||
/* Compute the x-position of the glyph. In front and past the
|
||||
|
|
@ -6568,7 +6568,7 @@ note_toolbar_highlight (f, x, y)
|
|||
dpyinfo->mouse_face_end_x = x + glyph->pixel_width;
|
||||
dpyinfo->mouse_face_end_y = row->y;
|
||||
dpyinfo->mouse_face_window = window;
|
||||
dpyinfo->mouse_face_face_id = TOOLBAR_FACE_ID;
|
||||
dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, draw);
|
||||
|
|
@ -6577,13 +6577,13 @@ note_toolbar_highlight (f, x, y)
|
|||
|
||||
set_help_echo:
|
||||
|
||||
/* Set help_echo to a help string.to display for this toolbar item.
|
||||
/* Set help_echo to a help string.to display for this tool-bar item.
|
||||
XTread_socket does the rest. */
|
||||
help_echo = (XVECTOR (f->current_toolbar_items)
|
||||
->contents[prop_idx + TOOLBAR_ITEM_HELP]);
|
||||
help_echo = (XVECTOR (f->current_tool_bar_items)
|
||||
->contents[prop_idx + TOOL_BAR_ITEM_HELP]);
|
||||
if (!STRINGP (help_echo))
|
||||
help_echo = (XVECTOR (f->current_toolbar_items)
|
||||
->contents[prop_idx + TOOLBAR_ITEM_CAPTION]);
|
||||
help_echo = (XVECTOR (f->current_tool_bar_items)
|
||||
->contents[prop_idx + TOOL_BAR_ITEM_CAPTION]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -9520,7 +9520,7 @@ XTread_socket (sd, bufp, numchars, expected)
|
|||
/* If we decide we want to generate an event to be seen
|
||||
by the rest of Emacs, we put it here. */
|
||||
struct input_event emacs_event;
|
||||
int toolbar_p = 0;
|
||||
int tool_bar_p = 0;
|
||||
|
||||
emacs_event.kind = no_event;
|
||||
bzero (&compose_status, sizeof (compose_status));
|
||||
|
|
@ -9534,9 +9534,9 @@ XTread_socket (sd, bufp, numchars, expected)
|
|||
|
||||
if (f)
|
||||
{
|
||||
/* Is this in the toolbar? */
|
||||
if (WINDOWP (f->toolbar_window)
|
||||
&& XFASTINT (XWINDOW (f->toolbar_window)->height))
|
||||
/* Is this in the tool-bar? */
|
||||
if (WINDOWP (f->tool_bar_window)
|
||||
&& XFASTINT (XWINDOW (f->tool_bar_window)->height))
|
||||
{
|
||||
Lisp_Object window;
|
||||
int p, x, y;
|
||||
|
|
@ -9546,14 +9546,14 @@ XTread_socket (sd, bufp, numchars, expected)
|
|||
|
||||
/* Set x and y. */
|
||||
window = window_from_coordinates (f, x, y, &p, 1);
|
||||
if (EQ (window, f->toolbar_window))
|
||||
if (EQ (window, f->tool_bar_window))
|
||||
{
|
||||
x_handle_toolbar_click (f, &event.xbutton);
|
||||
toolbar_p = 1;
|
||||
x_handle_tool_bar_click (f, &event.xbutton);
|
||||
tool_bar_p = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!toolbar_p)
|
||||
if (!tool_bar_p)
|
||||
if (!dpyinfo->x_focus_frame
|
||||
|| f == dpyinfo->x_focus_frame)
|
||||
construct_mouse_click (&emacs_event, &event, f);
|
||||
|
|
@ -9580,8 +9580,8 @@ XTread_socket (sd, bufp, numchars, expected)
|
|||
if (f != 0)
|
||||
f->mouse_moved = 0;
|
||||
|
||||
if (!toolbar_p)
|
||||
last_toolbar_item = -1;
|
||||
if (!tool_bar_p)
|
||||
last_tool_bar_item = -1;
|
||||
if (display_busy_cursor_p)
|
||||
inhibit_busy_cursor = 2;
|
||||
}
|
||||
|
|
@ -12836,7 +12836,7 @@ x_initialize ()
|
|||
baud_rate = 19200;
|
||||
|
||||
x_noop_count = 0;
|
||||
last_toolbar_item = -1;
|
||||
last_tool_bar_item = -1;
|
||||
any_help_event_p = 0;
|
||||
|
||||
/* Try to use interrupt input; if we can't, then start polling. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue