diff options
author | 2023-05-17 12:04:42 +0200 | |
---|---|---|
committer | 2023-05-17 12:04:42 +0200 | |
commit | 22384108d7430b47f8df1e0ecefcd398661a1b1a (patch) | |
tree | 70946e6cafdd404a431e6085aacfcddaf8de038d /src/application.h | |
parent | 5b5da9985730592b25f767ef70a247f85e80a714 (diff) | |
download | cherry-22384108d7430b47f8df1e0ecefcd398661a1b1a.tar.gz cherry-22384108d7430b47f8df1e0ecefcd398661a1b1a.zip |
Add application.c and application.h
Diffstat (limited to 'src/application.h')
-rw-r--r-- | src/application.h | 35 |
1 files changed, 35 insertions, 0 deletions
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 <X11/Xlib.h> +#include <utils.h> + +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__ */ |