Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
icon-loader.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors:
6 * see git history
7 * Jabiertxo Arraiza <jabier.arraiza@marker.es>
8 *
9 * Copyright (C) 2018 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef SEEN_INK_ICON_LOADER_H
14#define SEEN_INK_ICON_LOADER_H
15
16#include <cstdint>
17#include <utility>
18#include <glibmm/refptr.h>
19#include <glibmm/ustring.h>
20#include <gtkmm/enums.h>
21
22namespace Gtk {
23class Image;
24} // namespace Gtk
25
26// N.B. These return unmanaged widgets, so callers must manage() or delete them!
27Gtk::Image *sp_get_icon_image(Glib::ustring const &icon_name, int size);
28Gtk::Image *sp_get_icon_image(Glib::ustring const &icon_name, Gtk::IconSize icon_size);
29GtkWidget *sp_get_icon_image(Glib::ustring const &icon_name, GtkIconSize icon_size);
30
31namespace Inkscape::UI {
32
34struct GetShapeIconResult final { Glib::ustring icon_name; Glib::ustring color_class; };
35// Get the icon name and CSS class you need to use to show a specific shape icon
36[[nodiscard]] GetShapeIconResult get_shape_icon(Glib::ustring const &shape_type,
37 std::uint32_t rgba_color);
38// Get a managed Gtk::Image with icon_name & CSS class for a specific shape icon
39[[nodiscard]] Gtk::Image *get_shape_image(Glib::ustring const &shape_type,
40 std::uint32_t rgba_color,
41 Gtk::IconSize icon_size = Gtk::IconSize::INHERIT);
42
43} // namespace Inkscape::UI
44
45#endif // SEEN_INK_ICON_LOADER_H
46
47/*
48 Local Variables:
49 mode:c++
50 c-file-style:"stroustrup"
51 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
52 indent-tabs-mode:nil
53 fill-column:99
54 End:
55*/
56// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Geom::IntPoint size
Gtk::Image * sp_get_icon_image(Glib::ustring const &icon_name, int size)
Definition desktop.h:50
User interface code.
Definition desktop.h:113
Gtk::Image * get_shape_image(Glib::ustring const &shape_type, std::uint32_t const rgba_color, Gtk::IconSize const icon_size)
As get_shape_icon(), but returns a ready-made, managed Image having that icon name & CSS class.
GetShapeIconResult get_shape_icon(Glib::ustring const &shape_type, std::uint32_t const rgba_color)
Get the shape icon for this named shape type.
A pair containing an icon name & a CSS class to set an RGBA color.
Definition icon-loader.h:34