diff options
author | 2023-05-17 17:23:34 +0200 | |
---|---|---|
committer | 2023-05-17 17:23:34 +0200 | |
commit | 09c7778c402e6bc2f07d6582034fa807988a262c (patch) | |
tree | c107bedb13b1c88bd7323108bf4bbfd969dc00bf /src/window.h | |
parent | 2c08b225c0e3b8b4eea754d1ebd62be7ac06b936 (diff) | |
download | cherry-09c7778c402e6bc2f07d6582034fa807988a262c.tar.gz cherry-09c7778c402e6bc2f07d6582034fa807988a262c.zip |
Add cherry_window_set_listener() function
With this function, a CherryWindow can listen events. At the moment, just this
listener is available.
Diffstat (limited to 'src/window.h')
-rw-r--r-- | src/window.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/window.h b/src/window.h index e22badc..f024feb 100644 --- a/src/window.h +++ b/src/window.h @@ -5,7 +5,7 @@ #include "dimension.h" -typedef struct { +typedef struct CherryWindow { char *title; CherryDimension *dimension; int x, y; @@ -13,6 +13,9 @@ typedef struct { /* Xlib stuff */ Window window_handler; + GC gc; + + int (*listener)(struct CherryWindow *, int); } CherryWindow; CherryWindow *cherry_window_new(void); @@ -21,5 +24,6 @@ void cherry_window_set_title(CherryWindow *, char *); void cherry_window_set_dimension(CherryWindow *, int, int); void cherry_window_set_position(CherryWindow *, int, int); void cherry_window_set_visible(CherryWindow *, int); +void cherry_window_set_listener(CherryWindow *, int (*listener)(struct CherryWindow *, int)); #endif /* __CHERRY_WINDOW_H__ */ |