2013-07-31 11:20:16 -07:00
|
|
|
/*
|
|
|
|
* Toxic -- Tox Curses Client
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2013-08-05 01:57:29 -04:00
|
|
|
#define TOXWINDOWS_MAX_NUM 32
|
|
|
|
#define MAX_FRIENDS_NUM 100
|
2013-08-08 04:51:58 -04:00
|
|
|
#define MAX_STR_SIZE 256
|
|
|
|
#define KEY_SIZE_BYTES 32
|
|
|
|
|
2013-08-05 01:57:29 -04:00
|
|
|
/* number of permanent default windows */
|
|
|
|
#define N_DEFAULT_WINS 2
|
|
|
|
|
|
|
|
/* maximum window slots for WINDOW_STATUS array */
|
|
|
|
#define MAX_WINDOW_SLOTS N_DEFAULT_WINS+MAX_FRIENDS_NUM
|
2013-07-31 11:20:16 -07:00
|
|
|
|
2013-07-29 16:32:39 -07:00
|
|
|
typedef struct ToxWindow_ ToxWindow;
|
|
|
|
|
|
|
|
struct ToxWindow_ {
|
|
|
|
void(*onKey)(ToxWindow*, int);
|
|
|
|
void(*onDraw)(ToxWindow*);
|
|
|
|
void(*onInit)(ToxWindow*);
|
2013-07-31 10:20:03 -07:00
|
|
|
void(*onFriendRequest)(ToxWindow*, uint8_t*, uint8_t*, uint16_t);
|
|
|
|
void(*onMessage)(ToxWindow*, int, uint8_t*, uint16_t);
|
|
|
|
void(*onNickChange)(ToxWindow*, int, uint8_t*, uint16_t);
|
|
|
|
void(*onStatusChange)(ToxWindow*, int, uint8_t*, uint16_t);
|
2013-08-08 15:01:33 -04:00
|
|
|
void(*onAction)(ToxWindow*, int, uint8_t*, uint16_t);
|
2013-07-29 16:32:39 -07:00
|
|
|
char title[256];
|
|
|
|
|
2013-07-31 10:20:03 -07:00
|
|
|
void* x;
|
2013-07-31 11:20:16 -07:00
|
|
|
bool blink;
|
2013-07-31 10:20:03 -07:00
|
|
|
|
2013-07-29 16:32:39 -07:00
|
|
|
WINDOW* window;
|
|
|
|
};
|