summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/image-properties.h
blob: 24678d248224f40f8abe9f211b562d811483eb71 (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
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef SEEN_IMAGE_PROPERTIES_H
#define SEEN_IMAGE_PROPERTIES_H

#include <gtkmm/box.h>
#include <gtkmm/builder.h>
#include <gtkmm/button.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/drawingarea.h>
#include <gtkmm/radiobutton.h>
#include "helper/auto-connection.h"
#include "object/sp-image.h"
#include "ui/operation-blocker.h"

namespace Inkscape {
namespace UI {
namespace Widget {

class ImageProperties : public Gtk::Box {
public:
    ImageProperties();
    ~ImageProperties() override = default;

    void update(SPImage* image);

private:
    void on_style_updated() override;
    void update_bg_color();

    Glib::RefPtr<Gtk::Builder> _builder;

    Gtk::DrawingArea& _preview;
    Gtk::RadioButton& _aspect;
    Gtk::RadioButton& _stretch;
    Gtk::ComboBoxText& _rendering;
    Gtk::Button& _embed;
    int _preview_max_height;
    int _preview_max_width;
    SPImage* _image = nullptr;
    OperationBlocker _update;
    Cairo::RefPtr<Cairo::Surface> _preview_image;
    uint32_t _background_color = 0;
};

}}} // namespaces

#endif // SEEN_IMAGE_PROPERTIES_H