quakeforge/ruamoko/qwaq/qwaq.h
Bill Currie 72900fd16b [qwaq] Move input handling to its own thread
As it is now a completely separate sub-system, there is a bit of trouble
with mouse handling in that curses must be initialized before input for
the mouse to work properly, but the basic scheme seems to be working
nicely. I suspect the solution to the init order issue is to make have
the curses sub-system initialize the terminal input driver, at least for
mouse input (ie, maybe just enable/disable mouse handing).
2021-09-22 16:22:11 +09:00

35 lines
863 B
C

#ifndef __qwaq_h
#define __qwaq_h
#include <pthread.h>
#include "QF/darray.h"
#include "QF/progs.h"
#include "QF/sys.h"
typedef void (*progsinit_f) (progs_t *pr);
typedef struct qwaq_thread_s {
pthread_t thread_id;
int return_code;
struct DARRAY_TYPE (const char *) args;
sys_printf_t sys_printf;
progsinit_f*progsinit;
progs_t *pr;
struct hashlink_s *hashlink_freelist;
func_t main_func;
void *data;
} qwaq_thread_t;
typedef struct qwaq_thread_set_s DARRAY_TYPE(qwaq_thread_t *) qwaq_thread_set_t;
void BI_Init (progs_t *pr);
void BI_Curses_Init (progs_t *pr);
void BI_Input_Init (progs_t *pr);
void QWAQ_EditBuffer_Init (progs_t *pr);
extern struct cbuf_s *qwaq_cbuf;
qwaq_thread_t *create_thread (void *(*thread_func) (qwaq_thread_t *), void *);
int qwaq_init_threads (qwaq_thread_set_t *thread_data);
#endif//__qwaq_h