summaryrefslogtreecommitdiffstats
path: root/src/ui/toolbar/toolbar.cpp
blob: e1c9d082feb8aa25f575eb5b9ad0db6055f1718a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 :