summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-19 18:28:45 -0500
committerJune McEnroe <june@causal.agency>2022-02-19 18:28:45 -0500
commit3359a5d69b0fe3c08812f7db83e27958ffec820f (patch)
treef3a358df92531a55880e0d5c793b6ed963e76920 /chat.h
parentEnable -Wmissing-prototypes (diff)
downloadcatgirl-3359a5d69b0fe3c08812f7db83e27958ffec820f.tar.gz
catgirl-3359a5d69b0fe3c08812f7db83e27958ffec820f.zip
Factor out window management to window.c
Diffstat (limited to '')
-rw-r--r--chat.h74
1 files changed, 60 insertions, 14 deletions
diff --git a/chat.h b/chat.h
index 8a9a48f..e9a2926 100644
--- a/chat.h
+++ b/chat.h
@@ -293,26 +293,34 @@ const char *commandIsAction(uint id, const char *input);
 size_t commandWillSplit(uint id, const char *input);
 void commandCompleteAdd(void);
 
-enum Heat { Ice, Cold, Warm, Hot };
-enum { TimeCap = 64 };
-extern enum Heat uiThreshold;
-extern struct Time {
-	bool enable;
-	const char *format;
-	int width;
-} uiTime;
+enum Heat {
+	Ice,
+	Cold,
+	Warm,
+	Hot,
+};
+
+enum {
+	TitleCap = 256,
+	StatusLines = 1,
+	MarkerLines = 1,
+	SplitLines = 5,
+	InputLines = 1,
+	InputCols = 1024,
+};
+extern char uiTitle[TitleCap];
+extern struct _win_st *uiStatus;
+extern struct _win_st *uiMain;
 extern struct Util uiNotifyUtil;
 void uiInitEarly(void);
 void uiInitLate(void);
+uint uiAttr(struct Style style);
+short uiPair(struct Style style);
+void uiUpdate(void);
 void uiShow(void);
 void uiHide(void);
+void uiWait(void);
 void uiDraw(void);
-void uiWindows(void);
-void uiShowID(uint id);
-void uiShowNum(uint num);
-void uiMoveID(uint id, uint num);
-void uiCloseID(uint id);
-void uiCloseNum(uint id);
 void uiRead(void);
 void uiWrite(uint id, enum Heat heat, const time_t *time, const char *str);
 void uiFormat(
@@ -321,6 +329,44 @@ void uiFormat(
 void uiLoad(const char *name);
 int uiSave(void);
 
+enum Scroll {
+	ScrollOne,
+	ScrollPage,
+	ScrollAll,
+	ScrollUnread,
+	ScrollHot,
+};
+extern struct Time {
+	bool enable;
+	const char *format;
+	int width;
+} windowTime;
+extern enum Heat windowThreshold;
+void windowInit(void);
+void windowUpdate(void);
+void windowResize(void);
+bool windowWrite(uint id, enum Heat heat, const time_t *time, const char *str);
+void windowBare(void);
+uint windowID(void);
+uint windowNum(void);
+uint windowFor(uint id);
+void windowShow(uint num);
+void windowAuto(void);
+void windowSwap(void);
+void windowMove(uint from, uint to);
+void windowClose(uint num);
+void windowList(void);
+void windowMark(void);
+void windowUnmark(void);
+void windowToggleMute(void);
+void windowToggleTime(void);
+void windowToggleThresh(int n);
+bool windowTimeEnable(void);
+void windowScroll(enum Scroll by, int n);
+void windowSearch(const char *str, int dir);
+int windowSave(FILE *file);
+void windowLoad(FILE *file, size_t version);
+
 enum { BufferCap = 1024 };
 struct Buffer;
 struct Line {