| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
// This is for including the config header before any code (such as |
| 18 |
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated: |
| 19 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 20 |
|
| 21 |
#include <gtkmm/toolshell.h> |
| 22 |
#include <gtkmm/toolitem.h> |
| 23 |
#include <gtkmm/toolbutton.h> |
| 24 |
#include <gtkmm/toggletoolbutton.h> |
| 25 |
#include <gtkmm/container.h> |
| 26 |
|
| 27 |
_DEFS(gtkmm,gtk) |
| 28 |
_PINCLUDE(gtkmm/private/container_p.h) |
| 29 |
|
| 30 |
namespace Gtk |
| 31 |
{ |
| 32 |
|
| 33 |
//TODO: Derive from Toolshell when we can break ABI. |
| 34 |
/** Bars of buttons and other widgets. |
| 35 |
* @ingroup Widgets |
| 36 |
* @ingroup Containers |
| 37 |
* @ingroup Toolbars |
| 38 |
*/ |
| 39 |
class GTKMM_API Toolbar |
| 40 |
: public Container, |
| 41 |
public ToolShell |
| 42 |
{ |
| 43 |
_CLASS_GTKOBJECT(Toolbar,GtkToolbar,GTK_TOOLBAR,Gtk::Container,GtkContainer,,,GTKMM_API) |
| 44 |
_IMPLEMENTS_INTERFACE(ToolShell) |
| 45 |
public: |
| 46 |
_CTOR_DEFAULT() |
| 47 |
|
| 48 |
_WRAP_METHOD(void insert(ToolItem& item, int pos), gtk_toolbar_insert) |
| 49 |
void insert(ToolButton& item, int pos, const sigc::slot<void>& clicked_slot); |
| 50 |
void insert(ToggleToolButton& item, int pos, const sigc::slot<void>& toggled_slot); |
| 51 |
|
| 52 |
void append(ToolItem& item); |
| 53 |
void append(ToolButton& item, const sigc::slot<void>& clicked_slot); |
| 54 |
void append(ToggleToolButton& item, const sigc::slot<void>& toggled_slot); |
| 55 |
|
| 56 |
void prepend(ToolItem& item); |
| 57 |
void prepend(ToolButton& item, const sigc::slot<void>& clicked_slot); |
| 58 |
void prepend(ToggleToolButton& item, const sigc::slot<void>& toggled_slot); |
| 59 |
|
| 60 |
_WRAP_METHOD(int get_item_index(const ToolItem& item) const, gtk_toolbar_get_item_index) |
| 61 |
_WRAP_METHOD(int get_n_items() const, gtk_toolbar_get_n_items) |
| 62 |
_WRAP_METHOD(ToolItem* get_nth_item(int n), gtk_toolbar_get_nth_item) |
| 63 |
_WRAP_METHOD(const ToolItem* get_nth_item(int n) const, gtk_toolbar_get_nth_item, constversion) |
| 64 |
_WRAP_METHOD(bool get_show_arrow() const, gtk_toolbar_get_show_arrow) |
| 65 |
_WRAP_METHOD(void set_show_arrow(bool show_arrow = true), gtk_toolbar_set_show_arrow) |
| 66 |
|
| 67 |
/* Style methods */ |
| 68 |
|
| 69 |
_WRAP_METHOD(void set_toolbar_style(ToolbarStyle style), gtk_toolbar_set_style) |
| 70 |
_WRAP_METHOD(ToolbarStyle get_toolbar_style() const, gtk_toolbar_get_style) |
| 71 |
|
| 72 |
_WRAP_METHOD(void unset_toolbar_style(), gtk_toolbar_unset_style) |
| 73 |
|
| 74 |
//Note that gtk_toolbar_set_icon_size() and gtk_toolbar_unset_icon_size() were |
| 75 |
//deprecated sometime before GTK+ 2.4, but were undeprecated in GTK+ 2.12. |
| 76 |
_WRAP_METHOD(void set_icon_size(IconSize icon_size), gtk_toolbar_set_icon_size) |
| 77 |
_WRAP_METHOD(void unset_icon_size(), gtk_toolbar_unset_icon_size) |
| 78 |
|
| 79 |
_WRAP_METHOD(IconSize get_icon_size() const, gtk_toolbar_get_icon_size) |
| 80 |
|
| 81 |
_WRAP_METHOD(ReliefStyle get_relief_style() const, gtk_toolbar_get_relief_style) |
| 82 |
_WRAP_METHOD(int get_drop_index(int x, int y) const, gtk_toolbar_get_drop_index) |
| 83 |
_WRAP_METHOD(void set_drop_highlight_item(ToolItem& tool_item, int index), gtk_toolbar_set_drop_highlight_item) |
| 84 |
void unset_drop_highlight_item(); |
| 85 |
|
| 86 |
_WRAP_SIGNAL(void orientation_changed(Orientation orientation), "orientation_changed") |
| 87 |
_WRAP_SIGNAL(void toolbar_style_changed(ToolbarStyle style), "style_changed") |
| 88 |
_WRAP_SIGNAL(bool popup_context_menu(int x, int y, int button_number), "popup_context_menu") |
| 89 |
|
| 90 |
_IGNORE_SIGNAL("focus_home_or_end") |
| 91 |
|
| 92 |
_WRAP_PROPERTY("toolbar_style", ToolbarStyle) |
| 93 |
_WRAP_PROPERTY("show_arrow", bool) |
| 94 |
_WRAP_PROPERTY("icon-size", IconSize) |
| 95 |
_WRAP_PROPERTY("icon-size-set", bool) |
| 96 |
|
| 97 |
_WRAP_CHILD_PROPERTY("expand", bool) |
| 98 |
_WRAP_CHILD_PROPERTY("homogeneous", bool) |
| 99 |
}; |
| 100 |
|
| 101 |
} // namespace Gtk |