aboutsummaryrefslogtreecommitdiff
path: root/src/dbus.h
blob: 54a58af52c900a4b095025cca1f5c596f1720b4e (plain) (blame)
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
48
49
50
51
52
53
54
// SPDX-License-Identifier: MIT
/*
 * Compton - a compositor for X11
 *
 * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard
 *
 * Copyright (c) 2011-2013, Christopher Jeffrey
 * See LICENSE-mit for more information.
 *
 */

#include <stdbool.h>

#include <dbus/dbus.h>

typedef struct session session_t;
struct win;

/**
 * Return a string representation of a D-Bus message type.
 */
static inline const char *cdbus_repr_msgtype(DBusMessage *msg) {
	return dbus_message_type_to_string(dbus_message_get_type(msg));
}

/**
 * Initialize D-Bus connection.
 */
bool cdbus_init(session_t *ps, const char *uniq_name);

/**
 * Destroy D-Bus connection.
 */
void cdbus_destroy(session_t *ps);

/// Generate dbus win_added signal
void cdbus_ev_win_added(session_t *ps, struct win *w);

/// Generate dbus win_destroyed signal
void cdbus_ev_win_destroyed(session_t *ps, struct win *w);

/// Generate dbus win_mapped signal
void cdbus_ev_win_mapped(session_t *ps, struct win *w);

/// Generate dbus win_unmapped signal
void cdbus_ev_win_unmapped(session_t *ps, struct win *w);

/// Generate dbus win_focusout signal
void cdbus_ev_win_focusout(session_t *ps, struct win *w);

/// Generate dbus win_focusin signal
void cdbus_ev_win_focusin(session_t *ps, struct win *w);

// vim: set noet sw=8 ts=8 :