1 | #pragma once |
2 | |
3 | /* Generated with cbindgen:0.26.0 */ |
4 | |
5 | #include <cstdarg> |
6 | #include <cstdint> |
7 | #include <cstdlib> |
8 | #include <ostream> |
9 | #include <new> |
10 | #include "slint_string.h" |
11 | |
12 | /// This macro expands to the to the numeric value of the major version of Slint you're |
13 | /// developing against. For example if you're using version 1.5.2, this macro will expand to 1. |
14 | #define SLINT_VERSION_MAJOR 1 |
15 | /// This macro expands to the to the numeric value of the minor version of Slint you're |
16 | /// developing against. For example if you're using version 1.5.2, this macro will expand to 5. |
17 | #define SLINT_VERSION_MINOR 5 |
18 | /// This macro expands to the to the numeric value of the patch version of Slint you're |
19 | /// developing against. For example if you're using version 1.5.2, this macro will expand to 2. |
20 | #define SLINT_VERSION_PATCH 1 |
21 | /// This macro expands to the string representation of the version of Slint you're developing against. |
22 | /// For example if you're using version 1.5.2, this macro will expand to "1.5.2". |
23 | #define SLINT_VERSION_STRING "1.5.1" |
24 | |
25 | #define SLINT_FEATURE_BACKEND_QT |
26 | |
27 | |
28 | |
29 | namespace slint { |
30 | |
31 | /// This enum describes whether a Window is allowed to be hidden when the user tries to close the window. |
32 | /// It is the return type of the callback provided to [Window::on_close_requested]. |
33 | enum class CloseRequestResponse : uint8_t { |
34 | /// The Window will be hidden (default action) |
35 | HideWindow = 0, |
36 | /// The close request is rejected and the window will be kept shown. |
37 | KeepWindowShown = 1, |
38 | }; |
39 | |
40 | /// This enum describes a low-level access to specific graphics APIs used |
41 | /// by the renderer. |
42 | enum class GraphicsAPI : uint8_t { |
43 | /// The rendering is done using OpenGL. |
44 | NativeOpenGL, |
45 | }; |
46 | |
47 | /// This enum describes the different rendering states, that will be provided |
48 | /// to the parameter of the callback for `set_rendering_notifier` on the `slint::Window`. |
49 | enum class RenderingState : uint8_t { |
50 | /// The window has been created and the graphics adapter/context initialized. When OpenGL |
51 | /// is used for rendering, the context will be current. |
52 | RenderingSetup, |
53 | /// The scene of items is about to be rendered. When OpenGL |
54 | /// is used for rendering, the context will be current. |
55 | BeforeRendering, |
56 | /// The scene of items was rendered, but the back buffer was not sent for display presentation |
57 | /// yet (for example GL swap buffers). When OpenGL is used for rendering, the context will be current. |
58 | AfterRendering, |
59 | /// The window will be destroyed and/or graphics resources need to be released due to other |
60 | /// constraints. |
61 | RenderingTeardown, |
62 | }; |
63 | |
64 | /// This enum describes the different error scenarios that may occur when the application |
65 | /// registers a rendering notifier on a `slint::Window`. |
66 | enum class SetRenderingNotifierError : uint8_t { |
67 | /// The rendering backend does not support rendering notifiers. |
68 | Unsupported, |
69 | /// There is already a rendering notifier set, multiple notifiers are not supported. |
70 | AlreadySet, |
71 | }; |
72 | |
73 | /// Represents an RGB pixel. |
74 | struct Rgb8Pixel { |
75 | /// red value (between 0 and 255) |
76 | uint8_t r; |
77 | /// green value (between 0 and 255) |
78 | uint8_t g; |
79 | /// blue value (between 0 and 255) |
80 | uint8_t b; |
81 | /// \private |
82 | friend bool operator==(const Rgb8Pixel&, const Rgb8Pixel&) = default; |
83 | }; |
84 | |
85 | /// Represents an RGBA pixel. |
86 | struct Rgba8Pixel { |
87 | /// red value (between 0 and 255) |
88 | uint8_t r; |
89 | /// green value (between 0 and 255) |
90 | uint8_t g; |
91 | /// blue value (between 0 and 255) |
92 | uint8_t b; |
93 | /// alpha value (between 0 and 255) |
94 | uint8_t a; |
95 | /// \private |
96 | friend bool operator==(const Rgba8Pixel&, const Rgba8Pixel&) = default; |
97 | }; |
98 | |
99 | } // namespace slint |
100 | |