ltk.h (1972B)
1 /* 2 * Copyright (c) 2016-2024 lumidify <nobody@lumidify.org> 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef LTK_H 18 #define LTK_H 19 20 #include <stddef.h> 21 #include <stdint.h> 22 23 #include "clipboard.h" 24 #include "widget.h" 25 #include "window.h" 26 #include "text.h" 27 28 int ltk_init(void); 29 void ltk_deinit(void); 30 31 void ltk_mainloop_init(void); 32 void ltk_mainloop_step(int limit_framerate); 33 34 void ltk_mainloop(void); 35 /* FIXME: maybe better name */ 36 void ltk_mainloop_restartable(void); 37 void ltk_mainloop_quit(void); 38 39 void ltk_unregister_timer(int timer_id); 40 int ltk_register_timer(long first, long repeat, void (*callback)(ltk_callback_arg data), ltk_callback_arg data); 41 42 /* These are here so they can be added to the global array in ltk.c */ 43 ltk_window *ltk_window_create(const char *title, int x, int y, unsigned int w, unsigned int h); 44 void ltk_window_destroy(ltk_widget *self, int shallow); 45 46 /* convenience function to use the default text context */ 47 ltk_text_line *ltk_text_line_create_default(const char *font, int font_size, char *text, int take_over_text, int width); 48 ltk_text_line *ltk_text_line_create_const_text_default(const char *font, int font_size, const char *text, int width); 49 50 ltk_clipboard *ltk_get_clipboard(void); 51 ltk_renderdata *ltk_get_renderer(void); 52 53 #endif /* LTK_H */