ltkd.h (1442B)
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 LTKD_H 18 #define LTKD_H 19 20 #include <stddef.h> 21 #include <ltk/ltk.h> 22 23 typedef struct { 24 char *text; 25 size_t len; 26 int contains_nul; 27 } ltkd_cmd_token; 28 29 typedef enum { 30 LTK_EVENT_RESIZE = 1 << 0, 31 LTK_EVENT_BUTTON = 1 << 1, 32 LTK_EVENT_KEY = 1 << 2, 33 LTK_EVENT_MENU = 1 << 3 34 } ltkd_userevent_type; 35 36 void ltkd_queue_event(ltk_window *window, ltkd_userevent_type type, const char *id, const char *data); 37 int ltkd_handle_lock_client(ltk_window *window, int client); 38 int ltkd_queue_sock_write(int client, const char *str, int len); 39 int ltkd_queue_sock_write_fmt(int client, const char *fmt, ...); 40 41 LTK_GEN_LOG_FUNC_PROTO(ltkd) 42 43 #endif /* LTKD_H */