Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
output.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
9
10#ifndef DUNST_OUTPUT_H
11#define DUNST_OUTPUT_H
12
13#include <stdbool.h>
14#include <glib.h>
15#include <cairo.h>
16
17typedef gpointer window;
18
19struct dimensions {
20 int x;
21 int y;
22 int w;
23 int h;
24 int text_width;
25 int text_height;
26
27 int corner_radius;
28};
29
31 char *name;
32 int id;
33 int x;
34 int y;
35 unsigned int h;
36 unsigned int mmh;
37 unsigned int w;
38 int dpi;
39};
40
41struct output {
42 bool (*init)(void);
43 void (*deinit)(void);
44
45 window (*win_create)(void);
46 void (*win_destroy)(window);
47
48 void (*win_show)(window);
49 void (*win_hide)(window);
50
51 void (*display_surface)(cairo_surface_t *srf, window win, const struct dimensions*);
52
53 cairo_t* (*win_get_context)(window);
54
55 const struct screen_info* (*get_active_screen)(void);
56
57 bool (*is_idle)(void);
58 bool (*have_fullscreen_window)(void);
59
60 double (*get_scale)(void);
61};
62
63#ifdef ENABLE_X11
64#define X11_SUPPORT 1
65#else
66#define X11_SUPPORT 0
67#endif
68
69#ifdef ENABLE_WAYLAND
70#define WAYLAND_SUPPORT 1
71#else
72#define WAYLAND_SUPPORT 0
73#endif
74
75#if !WAYLAND_SUPPORT && !X11_SUPPORT
76#error "You have to compile at least one output (X11, Wayland)"
77#endif
78
86const struct output* output_create(bool force_xwayland);
87
88bool is_running_wayland(void);
89
90#endif
const struct output * output_create(bool force_xwayland)
return an initialized output, selecting the correct output type from either wayland or X11 according ...
Definition output.c:99