rofi 2.0.0
display.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
28#ifndef ROFI_DISPLAY_H
29#define ROFI_DISPLAY_H
30
31#include "helper.h"
32#include "nkutils-bindings.h"
33#include <glib.h>
34
38typedef struct _workarea {
44 int x;
46 int y;
48 int w;
50 int h;
51 int mw, mh;
53 char *name;
55 struct _workarea *next;
57
58struct _display_proxy;
59
60/* Implementations */
61extern struct _display_proxy *const xcb_proxy;
62#ifdef ENABLE_WAYLAND
63extern struct _display_proxy *const wayland_proxy;
64#endif
65
66void display_init(const struct _display_proxy *disp_in);
67
76
85gboolean display_setup(GMainLoop *main_loop, NkBindings *bindings);
86
92gboolean display_late_setup(void);
93
97void display_early_cleanup(void);
98
102void display_cleanup(void);
103
108
117 GSpawnChildSetupFunc *child_setup,
118 gpointer *user_data);
119
120void display_set_input_focus(guint w);
122
123guint display_scale(void);
124
129
130typedef void (* ClipboardCb)(char *clipboard_data, void *user_data);
131void display_get_clipboard_data(enum clipboard_type, ClipboardCb callback, void* user_data);
132
134
135#endif
gboolean display_late_setup(void)
Definition display.c:28
int monitor_active(workarea *mon)
Definition display.c:18
void display_early_cleanup(void)
Definition display.c:30
void display_startup_notification(RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data)
Definition display.c:36
void display_cleanup(void)
Definition display.c:32
guint display_scale(void)
Definition display.c:42
void display_init(const struct _display_proxy *disp_in)
clipboard_type
Definition display.h:125
@ CLIPBOARD_DEFAULT
Definition display.h:126
@ CLIPBOARD_PRIMARY
Definition display.h:127
void display_set_input_focus(guint w)
Definition display.c:20
void display_get_clipboard_data(enum clipboard_type, ClipboardCb callback, void *user_data)
Definition display.c:44
struct _workarea workarea
void(* ClipboardCb)(char *clipboard_data, void *user_data)
Definition display.h:130
void display_revert_input_focus(void)
Definition display.c:22
gboolean display_setup(GMainLoop *main_loop, NkBindings *bindings)
Definition display.c:24
void display_dump_monitor_layout(void)
Definition display.c:34
void display_set_fullscreen_mode(void)
Definition display.c:48
NkBindings * bindings
Definition rofi.c:136
GMainLoop * main_loop
Definition rofi.c:142
int w
Definition display.h:48
int x
Definition display.h:44
int monitor_id
Definition display.h:40
char * name
Definition display.h:53
int mh
Definition display.h:51
struct _workarea * next
Definition display.h:55
int h
Definition display.h:50
int mw
Definition display.h:51
int primary
Definition display.h:42
int y
Definition display.h:46
display_proxy *const wayland_proxy
Definition display.c:1857
display_proxy *const xcb_proxy
Definition display.c:2048
workarea mon
Definition view.c:117