aboutsummaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-21 20:16:43 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-21 20:16:43 +0100
commitd2f5deb27816889cdc9b25e868557f0bcd23e163 (patch)
treeb5709f59f5b5d0fe7c2735f01e79ffe5d6df2844 /src/window.h
parentcf7f3127cbde7354f1b592af0d23de4d7cd1123f (diff)
downloadimv-d2f5deb27816889cdc9b25e868557f0bcd23e163.tar.gz
Improve header commenting
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
index a496655..978278c 100644
--- a/src/window.h
+++ b/src/window.h
@@ -42,37 +42,57 @@ struct imv_event {
} data;
};
+/* Create a new window */
struct imv_window *imv_window_create(int w, int h, const char *title);
+/* Clean up an imv_window instance */
void imv_window_free(struct imv_window *window);
+/* Clears the window with the given colour */
void imv_window_clear(struct imv_window *window, unsigned char r,
unsigned char g, unsigned char b);
+/* Get the logical/event/window manager size of the window */
void imv_window_get_size(struct imv_window *window, int *w, int *h);
+/* Get the pixel dimensions that the window is rendered at */
void imv_window_get_framebuffer_size(struct imv_window *window, int *w, int *h);
+/* Set the window's title */
void imv_window_set_title(struct imv_window *window, const char *title);
+/* Returns true if the window is fullscreen */
bool imv_window_is_fullscreen(struct imv_window *window);
+/* Set the window's fullscreen state */
void imv_window_set_fullscreen(struct imv_window *window, bool fullscreen);
+/* Check whether a given mouse button is pressed */
bool imv_window_get_mouse_button(struct imv_window *window, int button);
+/* Gets the mouse's position */
void imv_window_get_mouse_position(struct imv_window *window, double *x, double *y);
+/* Swap the framebuffers. Present anything rendered since the last call. */
void imv_window_present(struct imv_window *window);
+/* Blocks until an event is received, or the timeout (in seconds) expires */
void imv_window_wait_for_event(struct imv_window *window, double timeout);
+/* Push an event to the event queue. An internal copy of the event is made.
+ * Wakes up imv_window_wait_for_event */
void imv_window_push_event(struct imv_window *window, struct imv_event *e);
typedef void (*imv_event_handler)(void *data, const struct imv_event *e);
+/* When called, the handler function is called for each event on the event
+ * queue */
void imv_window_pump_events(struct imv_window *window, imv_event_handler handler, void *data);
+/* If the current keyboard layout is known, returns a null-terminated string
+ * describing the keyboard layout and options, suitable for libxkbcommon to
+ * parse. If unknown, returns NULL.
+ */
const char *imv_window_get_keymap(struct imv_window *window);
#endif