mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
4293c4b1e6
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.
35 lines
912 B
C
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;
|
|
};
|