Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
color-notebook.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors:
6 * Lauris Kaplinski <lauris@kaplinski.com>
7 * bulia byak <buliabyak@users.sf.net>
8 * Tomasz Boczkowski <penginsbacon@gmail.com> (c++-sification)
9 *
10 * Copyright (C) 2001-2014 Authors
11 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
12 */
13#ifndef SEEN_SP_COLOR_NOTEBOOK_H
14#define SEEN_SP_COLOR_NOTEBOOK_H
15
16#include <memory> // for unique_ptr
17#include <vector> // for vector
18
19#include <glibmm/ustring.h> // for ustring
20#include <gtkmm/grid.h> // for Grid
21#include <gtkmm/widget.h> // for GtkWidget, Widget (ptr only)
22#include <sigc++/connection.h> // for connection
23
24#include "colors/color-set.h"
25#include "preferences.h" // for PrefObserver
26
27class SPDocument;
28
29namespace Gtk {
30class Box;
31class Label;
32class Stack;
33class StackSwitcher;
34} // namespace Gtk
35
36namespace Inkscape::UI::Widget {
37
38class IconComboBox;
39
41 : public Gtk::Grid
42{
43public:
44 ColorNotebook(std::shared_ptr<Colors::ColorSet> color);
45 ~ColorNotebook() override;
46
47 void set_label(const Glib::ustring& label);
48
49protected:
50 void _initUI();
51 void _addPageForSpace(std::shared_ptr<Colors::Space::AnySpace> space);
52 void setDocument(SPDocument *document);
53
54 static void _onPickerClicked(GtkWidget *widget, ColorNotebook *colorbook);
55 //virtual void _onSelectedColorChanged();
56 int getPageIndex(const Glib::ustring &name);
57 int getPageIndex(Gtk::Widget *widget);
58
59 //void _updateICCButtons();
60 void _setCurrentPage(int i, bool sync_combo);
61
62 std::shared_ptr<Colors::ColorSet> _colors;
63 unsigned long _entryId = 0;
64 Gtk::Stack* _book = nullptr;
65 Gtk::StackSwitcher* _switcher = nullptr;
66 Gtk::Box* _buttonbox = nullptr;
67 Gtk::Label* _label = nullptr;
68 GtkWidget *_rgbal = nullptr; /* RGBA entry */
69 GtkWidget *_outofgamut = nullptr;
70 GtkWidget *_colormanaged = nullptr;
71 GtkWidget *_toomuchink = nullptr;
72 GtkWidget *_btn_picker = nullptr;
73 GtkWidget *_p = nullptr; /* Color preview */
74 sigc::connection _onetimepick;
75 IconComboBox* _combo = nullptr;
76
77private:
79 std::vector<PrefObserver> _visibility_observers;
80
82 sigc::connection _doc_replaced_connection;
83};
84
85} // namespace Inkscape::UI::Widget
86
87#endif // SEEN_SP_COLOR_NOTEBOOK_H
88
89/*
90 Local Variables:
91 mode:c++
92 c-file-style:"stroustrup"
93 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
94 indent-tabs-mode:nil
95 fill-column:99
96 End:
97*/
98// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
99
int getPageIndex(const Glib::ustring &name)
std::shared_ptr< Colors::ColorSet > _colors
void setDocument(SPDocument *document)
void _addPageForSpace(std::shared_ptr< Colors::Space::AnySpace > space)
std::vector< PrefObserver > _visibility_observers
void set_label(const Glib::ustring &label)
static void _onPickerClicked(GtkWidget *widget, ColorNotebook *colorbook)
void _setCurrentPage(int i, bool sync_combo)
Typed SVG document implementation.
Definition document.h:101
A set of colors which can be modified together used for color pickers.
double c[8][4]
Glib::ustring label
Definition desktop.h:50
Custom widgets.
Definition desktop.h:126
std::unique_ptr< Preferences::PreferencesObserver > PrefObserver
Singleton class to access the preferences file in a convenient way.
Glib::ustring name
Definition toolbars.cpp:55