k3Menu CSS-style properties
This commit is contained in:
20
src/k3menu.h
20
src/k3menu.h
@@ -61,6 +61,19 @@ typedef struct k3MEventHandler {
|
||||
uint16_t code;
|
||||
} k3MEventHandler;
|
||||
|
||||
enum k3MPropertyType {
|
||||
k3M_PROP_BG_COLOR,
|
||||
k3M_PROP_BORDER_RADIUS,
|
||||
};
|
||||
struct k3MProperty {
|
||||
enum k3MPropertyType type;
|
||||
union {
|
||||
intmax_t si[4];
|
||||
void *ptr;
|
||||
uint8_t buf[32];
|
||||
};
|
||||
};
|
||||
|
||||
struct k3MObj {
|
||||
struct k3MObj *parent;
|
||||
|
||||
@@ -76,6 +89,9 @@ struct k3MObj {
|
||||
|
||||
k3MEventHandler *handlers;
|
||||
size_t handlerCount;
|
||||
|
||||
struct k3MProperty *properties;
|
||||
size_t propertyCount;
|
||||
};
|
||||
|
||||
#define k3MenuSetBounds(a, x, y, w, h) k3MenuSetBounds_((struct k3MObj*) (a), (x), (y), (w), (h))
|
||||
@@ -89,6 +105,9 @@ bool k3MEventSend(struct k3MEvent *ev);
|
||||
int k3MRemoveChild(struct k3MObj *parent, struct k3MObj *child);
|
||||
void k3MAddChild(struct k3MObj *parent, struct k3MObj *child);
|
||||
|
||||
void k3MOverrideProperty(struct k3MObj *obj, struct k3MProperty);
|
||||
struct k3MProperty *k3MFindProperty(struct k3MObj *obj, enum k3MPropertyType, bool direct);
|
||||
|
||||
struct k3MLabel {
|
||||
struct k3MObj;
|
||||
|
||||
@@ -102,6 +121,7 @@ struct k3MScreen {
|
||||
struct k3MObj;
|
||||
|
||||
struct k3MObj *keyboardFocus;
|
||||
struct k3MObj *lastHover;
|
||||
};
|
||||
struct k3MScreen *k3MScreen();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user