1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 03:26:46 +02:00

fix prompt bug, improve comments, and give prompt its own window struct

This commit is contained in:
Jfreegman
2013-12-04 22:33:04 -05:00
parent a57f94306a
commit 3740cb6763
2 changed files with 62 additions and 34 deletions

View File

@ -52,6 +52,7 @@ enum {
typedef struct ToxWindow ToxWindow;
typedef struct StatusBar StatusBar;
typedef struct PromptBuf PromptBuf;
typedef struct ChatContext ChatContext;
struct ToxWindow {
@ -81,11 +82,13 @@ struct ToxWindow {
int x;
ChatContext *chatwin;
PromptBuf *promptbuf;
StatusBar *stb;
WINDOW *window;
};
/* statusbar info holder */
struct StatusBar {
WINDOW *topline;
uint8_t statusmsg[TOX_MAX_STATUSMESSAGE_LENGTH];
@ -96,16 +99,26 @@ struct StatusBar {
bool is_online;
};
/* chat and groupchat window/buffer holder */
struct ChatContext {
wchar_t line[MAX_STR_SIZE];
size_t pos;
size_t len;
int orig_y;
WINDOW *history;
WINDOW *linewin;
WINDOW *sidebar;
};
/* prompt window/buffer holder */
struct PromptBuf {
wchar_t line[MAX_STR_SIZE];
size_t pos;
size_t len;
int orig_y;
bool scroll; /* used for prompt window hack to determine when to scroll down */
WINDOW *linewin;
};
/* Start file transfer code */
#define MAX_FILES 256