Inkscape
Vector Graphics Editor
page-size-preview.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Author:
4 * Michael Kowalski
5 *
6 * Copyright (C) 2021 Authors
7 *
8 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
9 */
10
11#ifndef INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H
12#define INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H
13
14#include <gtkmm/drawingarea.h>
15
16namespace Inkscape {
17namespace UI {
18namespace Widget {
19
20class PageSizePreview : public Gtk::DrawingArea {
21public:
23 // static PageSizePreview* create();
24
25 void set_desk_color(unsigned int rgba);
26 void set_page_color(unsigned int rgba);
27 void set_border_color(unsigned int rgba);
28 void draw_border(bool border);
29 void enable_drop_shadow(bool shadow);
30 void set_page_size(double width, double height);
32
33 ~PageSizePreview() override = default;
34
35private:
36 void draw_func(Cairo::RefPtr<Cairo::Context> const &cr, int width, int height);
37 unsigned int _border_color = 0x0000001f;
38 unsigned int _page_color = 0xffffff00;
39 unsigned int _desk_color = 0xc8c8c8ff;
40 bool _draw_border = true;
41 bool _draw_shadow = true;
42 bool _draw_checkerboard = false;
43 double _width = 10;
44 double _height = 7;
45};
46
47} } } // namespace Inkscape/Widget/UI
48
49#endif // INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H
50
void draw_func(Cairo::RefPtr< Cairo::Context > const &cr, int width, int height)
void set_page_size(double width, double height)
bool checkerboard(gint x, gint y, guint size)
static constexpr int height
CMYK to sRGB conversion routines.
double border
double width