1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-03 15:47:46 +02:00
toxic/windows.h
Chris Hall 8687a54a87 Messenger refactor - redid work from pull request 79
Moves static state out of Messenger.c and into a Messenger struct
Purely stylistic, no functional changes were made.

This commit also changed all the callers of Messenger as they now have
to pass an instance of the Messenger struct to messenger functions.

Also removed some uses of the 'static' keyword at the beginning of
function definitions when the function was already declared static, as
these caused gcc to whine.
2013-08-12 21:37:38 +12:00

35 lines
912 B
C

/*
* Toxic -- Tox Curses Client
*/
#include <stdbool.h>
#define TOXWINDOWS_MAX_NUM 32
#define MAX_FRIENDS_NUM 100
#define MAX_STR_SIZE 256
#define KEY_SIZE_BYTES 32
/* 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
typedef struct ToxWindow_ ToxWindow;
struct ToxWindow_ {
void(*onKey)(ToxWindow*, Messenger*, int);
void(*onDraw)(ToxWindow*);
void(*onInit)(ToxWindow*, Messenger*);
void(*onFriendRequest)(ToxWindow*, uint8_t*, uint8_t*, uint16_t);
void(*onMessage)(ToxWindow*, Messenger*, int, uint8_t*, uint16_t);
void(*onNickChange)(ToxWindow*, int, uint8_t*, uint16_t);
void(*onStatusChange)(ToxWindow*, int, uint8_t*, uint16_t);
void(*onAction)(ToxWindow*, Messenger*, int, uint8_t*, uint16_t);
char title[256];
void* x;
bool blink;
WINDOW* window;
};