Commit 3f4c6d52 authored by Jan Djärv's avatar Jan Djärv

Handle deprecated Gtk+ stuff for version <= 3.10

* lisp/term/x-win.el (x-gtk-stock-map): Add icon names suggested as
replacements to stock names before stock names in a list.
Cdr may be a list, each name is tried in turn until one is found.

* src/gtkutil.c (XG_TEXT_CANCEL, XG_TEXT_OPEN, XG_TEXT_OK): New defines
to handle Gtk versions.
(xg_get_file_with_chooser): Use them.
(xg_have_tear_offs, tearoff_remove, tearoff_activate): Remove
(create_menus): Remove teroff argument and code.
Remove call to gtk_menu_set_title.
(xg_update_menubar, xg_update_submenu): Remove tearoff code.  Adjust
args to create_menus.
(xg_tool_bar_menu_proxy, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, TOOLBAR_TOP_WIDGET): Remove.
(xg_pack_tool_bar): Replace TOOLBAR_TOP_WIDGET, remove detach code.
(xg_make_tool_item): Remove detach code.
(xg_update_tool_bar_sizes): Replace TOOLBAR_TOP_WIDGET.
(find_icon_from_name): New function.
(update_frame_tool_bar): Remove GtkStockItem code, move to
find_icon_from_name.  Let stock be a list of icon names to try.
Only use gtk_image_new_from_stock on Gtk+ < 3.10.
Replace TOOLBAR_TOP_WIDGET.
(free_frame_tool_bar, xg_change_toolbar_position ): Replace
TOOLBAR_TOP_WIDGET.
(xg_initialize): Remove tearoff code.

* src/gtkutil.h (xg_have_tear_offs): Remove declaration.

* src/xmenu.c (set_frame_menubar): Remove GTK block that calls
xg_have_tear_offs.

* src/xterm.h (handlebox_widget): Remove.
parent a4c80e35
2014-10-18 Jan Djärv <jan.h.d@swipnet.se>
* term/x-win.el (x-gtk-stock-map): Add icon names suggested as
replacements to stock names before stock names in a list.
Cdr may be a list, each name is tried in turn until one is found.
2014-10-18 Alan Mackenzie <acm@muc.de>
Check that a "macro" found near point-min isn't a ## operator.
......
......@@ -1484,47 +1484,47 @@ This returns an error if any Emacs frames are X frames."
(mapcar (lambda (arg)
(cons (purecopy (car arg)) (purecopy (cdr arg))))
'(
("etc/images/new" . "gtk-new")
("etc/images/open" . "gtk-open")
("etc/images/new" . ("document-new" "gtk-new"))
("etc/images/open" . ("document-open" "gtk-open"))
("etc/images/diropen" . "n:system-file-manager")
("etc/images/close" . "gtk-close")
("etc/images/save" . "gtk-save")
("etc/images/saveas" . "gtk-save-as")
("etc/images/undo" . "gtk-undo")
("etc/images/cut" . "gtk-cut")
("etc/images/copy" . "gtk-copy")
("etc/images/paste" . "gtk-paste")
("etc/images/search" . "gtk-find")
("etc/images/print" . "gtk-print")
("etc/images/preferences" . "gtk-preferences")
("etc/images/help" . "gtk-help")
("etc/images/left-arrow" . "gtk-go-back")
("etc/images/right-arrow" . "gtk-go-forward")
("etc/images/home" . "gtk-home")
("etc/images/jump-to" . "gtk-jump-to")
("etc/images/close" . ("window-close" "gtk-close"))
("etc/images/save" . ("document-save" "gtk-save"))
("etc/images/saveas" . ("document-save-as" "gtk-save-as"))
("etc/images/undo" . ("edit-undo" "gtk-undo"))
("etc/images/cut" . ("edit-cut" "gtk-cut"))
("etc/images/copy" . ("edit-copy" "gtk-copy"))
("etc/images/paste" . ("edit-paste" "gtk-paste"))
("etc/images/search" . ("edit-find" "gtk-find"))
("etc/images/print" . ("document-print" "gtk-print"))
("etc/images/preferences" . ("preferences-system" "gtk-preferences"))
("etc/images/help" . ("help-browser" "gtk-help"))
("etc/images/left-arrow" . ("go-previous" "gtk-go-back"))
("etc/images/right-arrow" . ("go-next" "gtk-go-forward"))
("etc/images/home" . ("go-home" "gtk-home"))
("etc/images/jump-to" . ("go-jump" "gtk-jump-to"))
("etc/images/index" . "gtk-index")
("etc/images/search" . "gtk-find")
("etc/images/exit" . "gtk-quit")
("etc/images/exit" . ("application-exit" "gtk-quit"))
("etc/images/cancel" . "gtk-cancel")
("etc/images/info" . "gtk-info")
("etc/images/info" . ("dialog-information" "gtk-info"))
("etc/images/bookmark_add" . "n:bookmark_add")
;; Used in Gnus and/or MH-E:
("etc/images/attach" . "gtk-attach")
("etc/images/connect" . "gtk-connect")
("etc/images/contact" . "gtk-contact")
("etc/images/delete" . "gtk-delete")
("etc/images/describe" . "gtk-properties")
("etc/images/delete" . ("edit-delete" "gtk-delete"))
("etc/images/describe" . ("ocument-properties" "gtk-properties"))
("etc/images/disconnect" . "gtk-disconnect")
;; ("etc/images/exit" . "gtk-exit")
("etc/images/lock-broken" . "gtk-lock_broken")
("etc/images/lock-ok" . "gtk-lock_ok")
("etc/images/lock" . "gtk-lock")
("etc/images/next-page" . "gtk-next-page")
("etc/images/refresh" . "gtk-refresh")
("etc/images/sort-ascending" . "gtk-sort-ascending")
("etc/images/refresh" . ("view-refresh" "gtk-refresh"))
("etc/images/sort-ascending" . ("view-sort-ascending" "gtk-sort-ascending"))
("etc/images/sort-column-ascending" . "gtk-sort-column-ascending")
("etc/images/sort-criteria" . "gtk-sort-criteria")
("etc/images/sort-descending" . "gtk-sort-descending")
("etc/images/sort-descending" . ("view-sort-descending"
"gtk-sort-descending"))
("etc/images/sort-row-ascending" . "gtk-sort-row-ascending")
("images/gnus/toggle-subscription" . "gtk-task-recurring")
("images/mail/compose" . "gtk-mail-compose")
......@@ -1541,8 +1541,8 @@ This returns an error if any Emacs frames are X frames."
("images/mail/spam" . "gtk-spam")
;; Used for GDB Graphical Interface
("images/gud/break" . "gtk-no")
("images/gud/recstart" . "gtk-media-record")
("images/gud/recstop" . "gtk-media-stop")
("images/gud/recstart" . ("media-record" "gtk-media-record"))
("images/gud/recstop" . ("media-playback-stop" "gtk-media-stop"))
;; No themed versions available:
;; mail/preview (combining stock_mail and stock_zoom)
;; mail/save (combining stock_mail, stock_save and stock_convert)
......@@ -1551,9 +1551,12 @@ This returns an error if any Emacs frames are X frames."
Emacs must be compiled with the Gtk+ toolkit for this to have any effect.
A value that begins with n: denotes a named icon instead of a stock icon."
:version "22.2"
:type '(choice (repeat (choice symbol
(cons (string :tag "Emacs icon")
(string :tag "Stock/named")))))
:type '(choice (repeat
(choice symbol
(cons (string :tag "Emacs icon")
(choice (group (string :tag "Named")
(string :tag "Stock"))
(string :tag "Stock/named"))))))
:group 'x)
(defcustom icon-map-list '(x-gtk-stock-map)
......
2014-10-18 Jan Djärv <jan.h.d@swipnet.se>
* xterm.h (handlebox_widget): Remove.
* xmenu.c (set_frame_menubar): Remove GTK block that calls
xg_have_tear_offs.
* gtkutil.h (xg_have_tear_offs): Remove declaration.
* gtkutil.c (XG_TEXT_CANCEL, XG_TEXT_OPEN, XG_TEXT_OK): New defines
to handle Gtk versions.
(xg_get_file_with_chooser): Use them.
(xg_have_tear_offs, tearoff_remove, tearoff_activate): Remove
(create_menus): Remove teroff argument and code.
Remove call to gtk_menu_set_title.
(xg_update_menubar, xg_update_submenu): Remove tearoff code. Adjust
args to create_menus.
(xg_tool_bar_menu_proxy, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, TOOLBAR_TOP_WIDGET): Remove.
(xg_pack_tool_bar): Replace TOOLBAR_TOP_WIDGET, remove detach code.
(xg_make_tool_item): Remove detach code.
(xg_update_tool_bar_sizes): Replace TOOLBAR_TOP_WIDGET.
(find_icon_from_name): New function.
(update_frame_tool_bar): Remove GtkStockItem code, move to
find_icon_from_name. Let stock be a list of icon names to try.
Only use gtk_image_new_from_stock on Gtk+ < 3.10.
Replace TOOLBAR_TOP_WIDGET.
(free_frame_tool_bar, xg_change_toolbar_position ): Replace
TOOLBAR_TOP_WIDGET.
(xg_initialize): Remove tearoff code.
2014-10-18 Eli Zaretskii <eliz@gnu.org>
* xterm.c (x_draw_bar_cursor, x_draw_hollow_cursor): Subtract 1
......
This diff is collapsed.
......@@ -108,8 +108,6 @@ extern void xg_update_frame_menubar (struct frame *f);
extern bool xg_event_is_for_menubar (struct frame *, const XEvent *);
extern bool xg_have_tear_offs (struct frame *f);
extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid);
extern void xg_create_scroll_bar (struct frame *f,
......
......@@ -733,12 +733,6 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
f->output_data.x->saved_menu_event->type = 0;
}
#ifdef USE_GTK
/* If we have detached menus, we must update deep so detached menus
also gets updated. */
deep_p = deep_p || xg_have_tear_offs (f);
#endif
if (deep_p)
{
/* Make a widget-value tree representing the entire menu trees. */
......
......@@ -499,10 +499,6 @@ struct x_output
GtkWidget *menubar_widget;
/* The tool bar in this frame */
GtkWidget *toolbar_widget;
#ifdef HAVE_GTK_HANDLE_BOX_NEW
/* The handle box that makes the tool bar detachable. */
GtkWidget *handlebox_widget;
#endif
/* True if tool bar is packed into the hbox widget (i.e. vertical). */
bool_bf toolbar_in_hbox : 1;
bool_bf toolbar_is_packed : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment