diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2018-06-17 21:46:25 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2018-06-17 21:46:25 +0000 |
| commit | 860d9295fd3fd6b5ed8e7141651cda01b016d46c (patch) | |
| tree | 93f9e943625ba0f538839f8b2e0e7b732a8f542c /src/ui/toolbar/toolbar.cpp | |
| parent | Potential fix for FTBFS introduced in 60ecfba7 (diff) | |
| download | inkscape-860d9295fd3fd6b5ed8e7141651cda01b016d46c.tar.gz inkscape-860d9295fd3fd6b5ed8e7141651cda01b016d46c.zip | |
ZoomToolbar: C++ify and GtkAction migration
Diffstat (limited to 'src/ui/toolbar/toolbar.cpp')
| -rw-r--r-- | src/ui/toolbar/toolbar.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/ui/toolbar/toolbar.cpp b/src/ui/toolbar/toolbar.cpp new file mode 100644 index 000000000..e1c9d082f --- /dev/null +++ b/src/ui/toolbar/toolbar.cpp @@ -0,0 +1,56 @@ +#include "toolbar.h" + +#include <gtkmm/separatortoolitem.h> + +#include "desktop.h" + +#include "helper/action.h" + +namespace Inkscape { +namespace UI { +namespace Toolbar { + +/** + * \brief Add a toolbutton that performs a given verb + * + * \param[in] verb_code The code for the verb (e.g., SP_VERB_EDIT_SELECT_ALL) + */ +void +Toolbar::add_toolbutton_for_verb(unsigned int verb_code) +{ + auto context = Inkscape::ActionContext(_desktop); + auto button = SPAction::create_toolbutton_for_verb(verb_code, context); + add(*button); +} + +/** + * \brief Add a separator line to the toolbar + * + * \details This is just a convenience wrapper for the + * standard GtkMM functionality + */ +void +Toolbar::add_separator() +{ + add(* Gtk::manage(new Gtk::SeparatorToolItem())); +} + +GtkWidget * +Toolbar::create(SPDesktop *desktop) +{ + auto toolbar = Gtk::manage(new Toolbar(desktop)); + return GTK_WIDGET(toolbar->gobj()); +} +} +} +} +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
