1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-26 10:03:28 +01:00

Refactor of core done.

This commit is contained in:
irungentoo 2013-08-20 14:47:32 -04:00
parent da369f1507
commit 05fd02767f
6 changed files with 7 additions and 7 deletions

2
chat.c
View File

@ -342,7 +342,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Messenger *m, char *cmd)
wprintw(ctx->history, "Invalid command.\n"); wprintw(ctx->history, "Invalid command.\n");
} }
static void chat_onDraw(ToxWindow *self) static void chat_onDraw(ToxWindow *self, Messenger *m)
{ {
curs_set(1); curs_set(1);
int x, y; int x, y;

View File

@ -34,9 +34,9 @@ static void dhtstatus_onKey(ToxWindow *self, Messenger *m, int key)
} }
} }
static void dhtstatus_onDraw(ToxWindow *self) static void dhtstatus_onDraw(ToxWindow *self, Messenger *m)
{ {
Client_data *close_clientlist = DHT_get_close_list(temp_DHT); Client_data *close_clientlist = DHT_get_close_list(m->dht);
curs_set(0); curs_set(0);
werase(self->window); werase(self->window);

View File

@ -102,7 +102,7 @@ static void friendlist_onKey(ToxWindow *self, Messenger *m, int key)
} }
} }
static void friendlist_onDraw(ToxWindow *self) static void friendlist_onDraw(ToxWindow *self, Messenger *m)
{ {
curs_set(0); curs_set(0);
werase(self->window); werase(self->window);

View File

@ -460,7 +460,7 @@ static void prompt_onKey(ToxWindow *self, Messenger *m, int key)
} }
} }
static void prompt_onDraw(ToxWindow *self) static void prompt_onDraw(ToxWindow *self, Messenger *m)
{ {
curs_set(1); curs_set(1);
int x, y; int x, y;

View File

@ -225,7 +225,7 @@ void draw_active_window(Messenger *m)
prepare_window(a->window); prepare_window(a->window);
a->blink = false; a->blink = false;
draw_bar(); draw_bar();
a->onDraw(a); a->onDraw(a, m);
/* Handle input */ /* Handle input */
int ch = getch(); int ch = getch();

View File

@ -24,7 +24,7 @@ typedef struct ToxWindow_ ToxWindow;
struct ToxWindow_ { struct ToxWindow_ {
void(*onKey)(ToxWindow *, Messenger *, int); void(*onKey)(ToxWindow *, Messenger *, int);
void(*onDraw)(ToxWindow *); void(*onDraw)(ToxWindow *, Messenger *);
void(*onInit)(ToxWindow *, Messenger *); void(*onInit)(ToxWindow *, Messenger *);
void(*onFriendRequest)(ToxWindow *, uint8_t *, uint8_t *, uint16_t); void(*onFriendRequest)(ToxWindow *, uint8_t *, uint8_t *, uint16_t);
void(*onMessage)(ToxWindow *, Messenger *, int, uint8_t *, uint16_t); void(*onMessage)(ToxWindow *, Messenger *, int, uint8_t *, uint16_t);