From 22384108d7430b47f8df1e0ecefcd398661a1b1a Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 17 May 2023 12:04:42 +0200 Subject: Add application.c and application.h --- src/application.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/application.h (limited to 'src/application.h') diff --git a/src/application.h b/src/application.h new file mode 100644 index 0000000..2bc130f --- /dev/null +++ b/src/application.h @@ -0,0 +1,35 @@ +/* See LICENSE file for copyright and license details. */ + +#ifndef __CHERRY_APPLICATION_H__ +#define __CHERRY_APPLICATION_H__ + +#include +#include + +typedef struct CherryApplication { + char *name; + + /* Xlib stuff */ + Display *display; + int screen; + int depth; + Visual *visual; + + void (*listener_activate)(struct CherryApplication *, void *); + void *listener_activate_data; + + void (*listener_deactivate)(struct CherryApplication *, void *); + void *listener_deactivate_data; + + list_t windows; +} CherryApplication; + +CherryApplication *cherry_application_new(const char *); +int cherry_application_run(CherryApplication *, int, char **); +CherryApplication *cherry_application_get_running_app(void); + +/* LISTENERS */ +void cherry_application_set_activated_listener(CherryApplication *, void (*f)(struct CherryApplication *, void *), void *); +void cherry_application_set_deactivated_listener(CherryApplication *, void (*f)(struct CherryApplication *, void *), void *); + +#endif /* __CHERRY_APPLICATION_H__ */ -- cgit v1.2.3