diff options
author | Chong Yidong <[email protected]> | 2009-07-16 01:24:00 +0000 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2009-07-16 01:24:00 +0000 |
commit | 4e6b227dbe52c61ca54df5fc0597fb190734210d (patch) | |
tree | 54bbbc631d207a4a724f3e5e66df752cbe0573a6 /src | |
parent | c0db3477b4b038cf220b60790cb7bd7a9eff976d (diff) |
* xterm.c (Qx_gtk_map_stock): New var.
* gtkutil.c (update_frame_tool_bar): Use Qx_gtk_map_stock instead of
calling intern each time.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/gtkutil.c | 10 | ||||
-rw-r--r-- | src/xterm.c | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3110337869..999269f60a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2009-07-16 Chong Yidong <[email protected]> + + * xterm.c (Qx_gtk_map_stock): New var. + + * gtkutil.c (update_frame_tool_bar): Use Qx_gtk_map_stock instead + of calling intern each time. + 2009-07-15 YAMAMOTO Mitsuharu <[email protected]> * nsfont.m (nsfont_draw): Remove code for stippling, which actually diff --git a/src/gtkutil.c b/src/gtkutil.c index e18044f85e..5072094d6c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -3827,6 +3827,8 @@ find_rtl_image (f, image, rtl) /* Update the tool bar for frame F. Add new buttons and remove old. */ +extern Lisp_Object Qx_gtk_map_stock; + void update_frame_tool_bar (f) FRAME_PTR f; @@ -3878,7 +3880,6 @@ update_frame_tool_bar (f) for (i = 0; i < f->n_tool_bar_items; ++i) { - int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); int idx; @@ -3893,7 +3894,6 @@ update_frame_tool_bar (f) Lisp_Object rtl; GtkWidget *wbutton = NULL; GtkWidget *weventbox; - Lisp_Object func = intern ("x-gtk-map-stock"); Lisp_Object specified_file; ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i); @@ -3914,10 +3914,10 @@ update_frame_tool_bar (f) } specified_file = file_for_image (image); - if (!NILP (specified_file) && EQ (Qt, Ffboundp (func))) - stock = call1 (func, specified_file); + if (!NILP (specified_file) && !NILP (Ffboundp (Qx_gtk_map_stock))) + stock = call1 (Qx_gtk_map_stock, specified_file); - if (! NILP (stock) && STRINGP (stock)) + if (STRINGP (stock)) { stock_name = SSDATA (stock); if (stock_name[0] == 'n' && stock_name[1] == ':') diff --git a/src/xterm.c b/src/xterm.c index 8d9a7d3cc0..7ec0e0268e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -323,6 +323,9 @@ static Lisp_Object Qlatin_1; #ifdef USE_GTK /* The name of the Emacs icon file. */ static Lisp_Object xg_default_icon_file; + +/* Used in gtkutil.c. */ +Lisp_Object Qx_gtk_map_stock; #endif /* Used in x_flush. */ @@ -10788,6 +10791,9 @@ syms_of_xterm () #ifdef USE_GTK xg_default_icon_file = build_string ("icons/hicolor/scalable/apps/emacs.svg"); staticpro (&xg_default_icon_file); + + Qx_gtk_map_stock = intern ("x-gtk-map-stock"); + staticpro (&Qx_gtk_map_stock); #endif DEFVAR_BOOL ("x-use-underline-position-properties", |