aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.h
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-10 17:25:12 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-10 17:31:39 -0400
commitec77a7037586864ece6505c448ab5c15bf8a57d9 (patch)
treead23ca8d2ded6ffc0a9d9c6c5320e457c37ece32 /src/window-xlib.h
parent9118ead5ae15548c8a5b96340f9a0a24b3104e32 (diff)
downloadrunes-ec77a7037586864ece6505c448ab5c15bf8a57d9.tar.gz
runes-ec77a7037586864ece6505c448ab5c15bf8a57d9.zip
refactor how submodules are handled
let them own their own memory, so that they can free themselves once they exit the loop. also split out the parts of the terminal that we only want to initialize once, even if we open multiple terminal windows
Diffstat (limited to 'src/window-xlib.h')
-rw-r--r--src/window-xlib.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/window-xlib.h b/src/window-xlib.h
index dad4241..c84f251 100644
--- a/src/window-xlib.h
+++ b/src/window-xlib.h
@@ -21,7 +21,7 @@ enum runes_atoms {
};
struct runes_window {
- Display *dpy;
+ RunesWindowBackendGlobal *wg;
Window w;
Window border_w;
XIC ic;
@@ -32,13 +32,17 @@ struct runes_window {
cairo_t *backend_cr;
- Atom atoms[RUNES_NUM_ATOMS];
-
char visual_bell_is_ringing: 1;
char delaying: 1;
};
-void runes_window_backend_init(RunesWindowBackend *w);
+struct runes_window_global {
+ Display *dpy;
+ Atom atoms[RUNES_NUM_ATOMS];
+};
+
+RunesWindowBackendGlobal *runes_window_backend_global_init();
+RunesWindowBackend *runes_window_backend_new();
void runes_window_backend_create_window(RunesTerm *t, int argc, char *argv[]);
void runes_window_backend_init_loop(RunesTerm *t, RunesLoop *loop);
void runes_window_backend_request_flush(RunesTerm *t);
@@ -48,6 +52,7 @@ void runes_window_backend_get_size(RunesTerm *t, int *xpixel, int *ypixel);
void runes_window_backend_set_icon_name(RunesTerm *t, char *name, size_t len);
void runes_window_backend_set_window_title(
RunesTerm *t, char *name, size_t len);
-void runes_window_backend_cleanup(RunesWindowBackend *w);
+void runes_window_backend_delete(RunesWindowBackend *w);
+void runes_window_backend_global_cleanup(RunesWindowBackendGlobal *wg);
#endif