xwords/xwords4/wasm/main.h

51 lines
1.1 KiB
C
Raw Normal View History

#ifndef _MAIN_H_
#define _MAIN_H_
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "game.h"
2021-02-02 22:49:27 +01:00
typedef struct _TimerState {
void* closure;
XWTimerReason why;
XWTimerProc proc;
time_t when;
} TimerState;
2021-02-03 04:20:26 +01:00
typedef XP_Bool (*IdleProc)(void* closure);
2021-02-02 23:52:25 +01:00
typedef struct _Globals {
SDL_Window* window;
SDL_Renderer* renderer;
XWGame game;
CurGameInfo gi;
VTableMgr* vtMgr;
XW_DUtilCtxt* dutil;
XW_UtilCtxt* util;
DrawCtx* draw;
DictionaryCtxt* dict;
TransportProcs procs;
CommonPrefs cp;
2021-02-02 22:49:27 +01:00
TimerState timers[NUM_TIMERS_PLUS_ONE];
2021-02-03 04:20:26 +01:00
IdleProc idleProc;
void* idleClosure;
MemPoolCtx* mpool;
} Globals;
2021-02-02 22:49:27 +01:00
void main_set_timer( Globals* globals, XWTimerReason why, XP_U16 when,
XWTimerProc proc, void* closure );
2021-02-02 23:52:25 +01:00
typedef void (*QueryProc)(void* closure, XP_Bool confirmed);
void main_query( Globals* globals, const XP_UCHAR* query,
QueryProc proc, void* closure );
2021-02-03 04:20:26 +01:00
void main_set_idle( Globals* globals, IdleProc proc, void* closure );
2021-02-02 22:49:27 +01:00
2021-02-03 04:20:26 +01:00
void main_alert( Globals* globals, const XP_UCHAR* msg );
#endif