summaryrefslogtreecommitdiffstats
path: root/src/ui/toolbar/toolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/toolbar/toolbar.cpp')
-rw-r--r--src/ui/toolbar/toolbar.cpp56
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 :