Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
manager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Colors::Manager - Look after all a document's icc profiles.
4 *
5 * Copyright 2023 Martin Owens <doctormo@geek-2.com>
6 *
7 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
8 */
9
10#ifndef SEEN_COLORS_MANAGER_H
11#define SEEN_COLORS_MANAGER_H
12
13#include <map>
14#include <memory>
15#include <optional>
16#include <vector>
17
18#include "spaces/components.h"
19
20namespace Inkscape::Colors {
21namespace Space {
22enum class Type;
23class AnySpace;
24} // namespace Space
25class Color;
26class Parser;
27
29{
30private:
31 Manager(Manager const &) = delete;
32 void operator=(Manager const &) = delete;
33
34public:
35
36 static Manager &get()
37 {
38 static Manager instance;
39 return instance;
40 }
41
42 // Request all color spaces with given trait(s); Ex: spaces(Traits::Picker) to list of types suitable for GUI
43 std::vector<std::shared_ptr<Space::AnySpace>> spaces(Space::Traits traits);
44
45 std::shared_ptr<Space::AnySpace> find(Space::Type type) const;
46 std::shared_ptr<Space::AnySpace> find(std::string const &name) const;
47
48protected:
49 Manager();
50 ~Manager() = default;
51
52 std::shared_ptr<Space::AnySpace> addSpace(Space::AnySpace *space);
53 bool removeSpace(std::shared_ptr<Space::AnySpace> space);
54
55private:
56 std::vector<std::shared_ptr<Space::AnySpace>> _spaces;
57};
58
59} // namespace Inkscape::Colors
60
61#endif // SEEN_COLORS_MANAGER_H
62
63/*
64 Local Variables:
65 mode:c++
66 c-file-style:"stroustrup"
67 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
68 indent-tabs-mode:nil
69 fill-column:99
70 End:
71*/
72// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
uint32_t Color
void operator=(Manager const &)=delete
std::shared_ptr< Space::AnySpace > find(Space::Type type) const
Finds the first global color space matching the given type.
Definition manager.cpp:97
std::shared_ptr< Space::AnySpace > addSpace(Space::AnySpace *space)
Add the given space and assume ownership over it.
Definition manager.cpp:67
Manager(Manager const &)=delete
static Manager & get()
Definition manager.h:36
std::vector< std::shared_ptr< Space::AnySpace > > _spaces
Definition manager.h:56
bool removeSpace(std::shared_ptr< Space::AnySpace > space)
Removes the given space from the list of available spaces.
Definition manager.cpp:79
std::vector< std::shared_ptr< Space::AnySpace > > spaces(Space::Traits traits)
Definition manager.cpp:84
A set of useful color modifying functions which do not fit as generic methods on the color class itse...
Definition profile.cpp:24
Glib::ustring name
Definition toolbars.cpp:55