Go Back

0 /*

1 * ISC License

2 * Copyright (c) 2023 RMF <rawmonk@firemail.cc>

3 */

4 #define MAX_CMDLINE 2048

5 #define MAX_PREFIX 1024

6 #define MAX_COUNT 10000000

7 #define MAX_CMD_NAME 64

8

9 #define ERROR_INFO 0xAA

10

11 #ifndef size_t

12 #define size_t unsigned long

13 #endif

14

15 enum {

16 MODE_NORMAL,

17 MODE_CMDLINE

18 };

19

20 struct client;

21

22 struct client {

23 int count;

24 int mode;

25 int width;

26 int height;

27 char cmd[MAX_CMDLINE];

28 char search[MAX_CMDLINE];

29 char prefix[MAX_PREFIX];

30 int cursor;

31 int error;

32 int (*motion)(struct client*, int, int);

33 struct tab *tab;

34 /* internal */

35 int g;

36 void *last_request;

37 };

38

39 int client_init(struct client*);

40 int client_destroy(struct client*);

41 void client_draw(struct client*);

42 void client_display(struct client*);

43 struct rect client_display_rect(struct client*);

44 int client_input(struct client*);

45 int client_newtab(struct client *client, const char *url);

46 int client_closetab(struct client *client);

47