mirror of
https://github.com/swaywm/sway.git
synced 2026-02-23 01:40:27 -05:00
swaybar: add tray interface
This commit is contained in:
parent
598e950296
commit
5f65f33989
8 changed files with 110 additions and 13 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _SWAYBAR_BAR_H
|
||||
#define _SWAYBAR_BAR_H
|
||||
#include <wayland-client.h>
|
||||
#include "config.h"
|
||||
#include "input.h"
|
||||
#include "pool-buffer.h"
|
||||
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
||||
|
|
@ -8,6 +9,9 @@
|
|||
|
||||
struct swaybar_config;
|
||||
struct swaybar_output;
|
||||
#if HAVE_TRAY
|
||||
struct swaybar_tray;
|
||||
#endif
|
||||
struct swaybar_workspace;
|
||||
struct loop;
|
||||
|
||||
|
|
@ -38,6 +42,10 @@ struct swaybar {
|
|||
int ipc_socketfd;
|
||||
|
||||
struct wl_list outputs; // swaybar_output::link
|
||||
|
||||
#if HAVE_TRAY
|
||||
struct swaybar_tray *tray;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct swaybar_output {
|
||||
|
|
|
|||
28
include/swaybar/tray/tray.h
Normal file
28
include/swaybar/tray/tray.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef _SWAYBAR_TRAY_TRAY_H
|
||||
#define _SWAYBAR_TRAY_TRAY_H
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_SYSTEMD
|
||||
#include <systemd/sd-bus.h>
|
||||
#elif HAVE_ELOGIND
|
||||
#include <elogind/sd-bus.h>
|
||||
#endif
|
||||
#include <cairo.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct swaybar;
|
||||
struct swaybar_output;
|
||||
|
||||
struct swaybar_tray {
|
||||
struct swaybar *bar;
|
||||
|
||||
int fd;
|
||||
sd_bus *bus;
|
||||
};
|
||||
|
||||
struct swaybar_tray *create_tray(struct swaybar *bar);
|
||||
void destroy_tray(struct swaybar_tray *tray);
|
||||
void tray_in(int fd, short mask, void *data);
|
||||
uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue