diff options
author | June McEnroe <june@causal.agency> | 2022-02-19 18:28:45 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-02-19 18:28:45 -0500 |
commit | 3359a5d69b0fe3c08812f7db83e27958ffec820f (patch) | |
tree | f3a358df92531a55880e0d5c793b6ed963e76920 /command.c | |
parent | Enable -Wmissing-prototypes (diff) | |
download | catgirl-3359a5d69b0fe3c08812f7db83e27958ffec820f.tar.gz catgirl-3359a5d69b0fe3c08812f7db83e27958ffec820f.zip |
Factor out window management to window.c
Diffstat (limited to '')
-rw-r--r-- | command.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/command.c b/command.c index 335c396..a127af3 100644 --- a/command.c +++ b/command.c @@ -144,7 +144,7 @@ static void commandMsg(uint id, char *params) { if (params) { splitMessage("PRIVMSG", msg, params); } else { - uiShowID(msg); + windowShow(windowFor(msg)); } } @@ -376,25 +376,25 @@ static void commandQuery(uint id, char *params) { if (idColors[query] == Default) { idColors[query] = completeColor(id, params); } - uiShowID(query); + windowShow(windowFor(query)); } static void commandWindow(uint id, char *params) { if (!params) { - uiWindows(); + windowList(); } else if (isdigit(params[0])) { - uiShowNum(strtoul(params, NULL, 10)); + windowShow(strtoul(params, NULL, 10)); } else { id = idFind(params); if (id) { - uiShowID(id); + windowShow(windowFor(id)); return; } for (const char *match; (match = completeSubstr(None, params));) { id = idFind(match); if (!id) continue; completeAccept(); - uiShowID(id); + windowShow(windowFor(id)); break; } } @@ -405,20 +405,20 @@ static void commandMove(uint id, char *params) { char *name = strsep(¶ms, " "); if (params) { id = idFind(name); - if (id) uiMoveID(id, strtoul(params, NULL, 10)); + if (id) windowMove(windowFor(id), strtoul(params, NULL, 10)); } else { - uiMoveID(id, strtoul(name, NULL, 10)); + windowMove(windowFor(id), strtoul(name, NULL, 10)); } } static void commandClose(uint id, char *params) { if (!params) { - uiCloseID(id); + windowClose(windowFor(id)); } else if (isdigit(params[0])) { - uiCloseNum(strtoul(params, NULL, 10)); + windowClose(strtoul(params, NULL, 10)); } else { id = idFind(params); - if (id) uiCloseID(id); + if (id) windowClose(windowFor(id)); } } |