summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.h
blob: 40258a9cca663ae117e7564b54ee43505f2bc434 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef SEEN_TOOLBOX_H
#define SEEN_TOOLBOX_H

/*
 * Authors:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *   Frank Felfe <innerspace@iname.com>
 *   Jon A. Cruz <jon@joncruz.org>
 *
 * Copyright (C) 1999-2002 Authors
 * Copyright (C) 2001-2002 Ximian, Inc.
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#include <glibmm/ustring.h>
#include <gtk/gtk.h>
#include <gtkmm/builder.h>
#include <gtkmm/enums.h>

#include "preferences.h"

class InkscapeWindow;
class SPDesktop;

namespace Inkscape {
namespace UI {

/**
 * Main toolbox source.
 */
class ToolboxFactory
{
public:
    static void setToolboxDesktop(GtkWidget *toolbox, SPDesktop *desktop);
    static void setOrientation(GtkWidget* toolbox, GtkOrientation orientation);
    static void showAuxToolbox(GtkWidget* toolbox);

    static GtkWidget *createToolToolbox(InkscapeWindow *window);
    static GtkWidget *createAuxToolbox();
    static GtkWidget *createCommandsToolbox();
    static GtkWidget *createSnapToolbox();

    static int prefToPixelSize(Glib::ustring const& path);
    static Gtk::IconSize prefToSize_mm(Glib::ustring const &path, int base = 0);

    static void set_icon_size(GtkWidget* toolbox, int pixel_size);
    ToolboxFactory() = delete;

    static constexpr const char* tools_icon_size = "/toolbox/tools/iconsize";
    static constexpr const char* tools_visible_buttons = "/toolbox/tools/buttons"; 
    static constexpr const char* ctrlbars_icon_size = "/toolbox/controlbars/iconsize";
    static constexpr const char* snap_bar_simple = "/toolbox/simplesnap";
    static constexpr const int min_pixel_size = 16;
    static constexpr const int max_pixel_size = 48;
    static Glib::ustring get_tool_visible_buttons_path(const Glib::ustring& button_action_name);

private:
    static void _attachDoubleClickHandlers(Glib::RefPtr<Gtk::Builder> builder, InkscapeWindow *window);
};



} // namespace UI
} // namespace Inkscape

#endif /* !SEEN_TOOLBOX_H */

/*
  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 :