mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:23:03 +01:00
Refactor of core done.
This commit is contained in:
parent
da369f1507
commit
05fd02767f
2
chat.c
2
chat.c
@ -342,7 +342,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Messenger *m, char *cmd)
|
||||
wprintw(ctx->history, "Invalid command.\n");
|
||||
}
|
||||
|
||||
static void chat_onDraw(ToxWindow *self)
|
||||
static void chat_onDraw(ToxWindow *self, Messenger *m)
|
||||
{
|
||||
curs_set(1);
|
||||
int x, y;
|
||||
|
@ -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);
|
||||
werase(self->window);
|
||||
|
||||
|
@ -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);
|
||||
werase(self->window);
|
||||
|
2
prompt.c
2
prompt.c
@ -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);
|
||||
int x, y;
|
||||
|
@ -225,7 +225,7 @@ void draw_active_window(Messenger *m)
|
||||
prepare_window(a->window);
|
||||
a->blink = false;
|
||||
draw_bar();
|
||||
a->onDraw(a);
|
||||
a->onDraw(a, m);
|
||||
|
||||
/* Handle input */
|
||||
int ch = getch();
|
||||
|
@ -24,7 +24,7 @@ typedef struct ToxWindow_ ToxWindow;
|
||||
|
||||
struct ToxWindow_ {
|
||||
void(*onKey)(ToxWindow *, Messenger *, int);
|
||||
void(*onDraw)(ToxWindow *);
|
||||
void(*onDraw)(ToxWindow *, Messenger *);
|
||||
void(*onInit)(ToxWindow *, Messenger *);
|
||||
void(*onFriendRequest)(ToxWindow *, uint8_t *, uint8_t *, uint16_t);
|
||||
void(*onMessage)(ToxWindow *, Messenger *, int, uint8_t *, uint16_t);
|
||||
|
Loading…
Reference in New Issue
Block a user