summaryrefslogtreecommitdiff
path: root/testing/toxic/windows.h
blob: cb45614d57440cd9b5e4b594e3cd6c2606756cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Toxic -- Tox Curses Client
 */

#include <stdbool.h>
#define TOXWINDOWS_MAX_NUM 32
#define MAX_FRIENDS_NUM 100
 
/* 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*, int);
  void(*onDraw)(ToxWindow*);
  void(*onInit)(ToxWindow*);
  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);
  char title[256];

  void* x;
  bool blink;

  WINDOW* window;
};