polytreewm/src/unit.h

29 lines
431 B
C
Raw Normal View History

2021-11-17 02:56:19 +00:00
#ifndef _UNIT_H
#define _UNIT_H
#include <stdbool.h>
#include <stddef.h>
#define UNIT_DELETE(unit) { \
unit_delete(unit); \
unit = NULL; \
}
2021-11-17 03:21:32 +00:00
typedef enum {
UNIT_GLOBAL = 0,
UNIT_MONITOR = 1,
UNIT_TAG = 2,
} UnitKind;
2021-11-17 02:56:19 +00:00
typedef struct Unit {
2021-11-17 03:21:32 +00:00
UnitKind kind;
const struct Unit *parent;
2021-11-17 02:56:19 +00:00
bool show_bar;
} *Unit;
2021-11-17 03:21:32 +00:00
Unit unit_new(UnitKind kind, Unit parent);
2021-11-17 02:56:19 +00:00
void unit_delete(Unit unit);
#endif // _UNIT_H