2 window-commands.c : irssi
4 Copyright (C) 2000 Timo Sirainen
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "module-formats.h"
31 #include "fe-windows.h"
32 #include "window-items.h"
33 #include "windows-layout.h"
34 #include "printtext.h"
36 static void window_print_binds(WINDOW_REC *win)
40 printformat_window(win, MSGLEVEL_CLIENTCRAP,
41 TXT_WINDOW_INFO_BOUND_ITEMS_HEADER);
42 for (tmp = win->bound_items; tmp != NULL; tmp = tmp->next) {
43 WINDOW_BIND_REC *bind = tmp->data;
45 printformat_window(win, MSGLEVEL_CLIENTCRAP,
46 TXT_WINDOW_INFO_BOUND_ITEM,
47 bind->name, bind->servertag,
48 bind->sticky ? "sticky" : "");
50 printformat_window(win, MSGLEVEL_CLIENTCRAP,
51 TXT_WINDOW_INFO_BOUND_ITEMS_FOOTER);
54 static void window_print_items(WINDOW_REC *win)
59 printformat_window(win, MSGLEVEL_CLIENTCRAP,
60 TXT_WINDOW_INFO_ITEMS_HEADER);
61 for (tmp = win->items; tmp != NULL; tmp = tmp->next) {
62 WI_ITEM_REC *item = tmp->data;
64 type = module_find_id_str("WINDOW ITEM TYPE", item->type);
65 printformat_window(win, MSGLEVEL_CLIENTCRAP,
67 type == NULL ? "??" : type,
69 item->server == NULL ? "" :
72 printformat_window(win, MSGLEVEL_CLIENTCRAP,
73 TXT_WINDOW_INFO_ITEMS_FOOTER);
76 static void cmd_window_info(WINDOW_REC *win)
80 printformat_window(win, MSGLEVEL_CLIENTCRAP,
81 TXT_WINDOW_INFO_HEADER);
83 /* Window reference number + sticky status */
84 if (!win->sticky_refnum) {
85 printformat_window(win, MSGLEVEL_CLIENTCRAP,
86 TXT_WINDOW_INFO_REFNUM, win->refnum);
88 printformat_window(win, MSGLEVEL_CLIENTCRAP,
89 TXT_WINDOW_INFO_REFNUM_STICKY, win->refnum);
93 if (win->name != NULL) {
94 printformat_window(win, MSGLEVEL_CLIENTCRAP,
95 TXT_WINDOW_INFO_NAME, win->name);
98 /* Window width / height */
99 printformat_window(win, MSGLEVEL_CLIENTCRAP, TXT_WINDOW_INFO_SIZE,
100 win->width, win->height);
102 /* Window immortality */
104 printformat_window(win, MSGLEVEL_CLIENTCRAP,
105 TXT_WINDOW_INFO_IMMORTAL);
108 /* Window history name */
109 if (win->history_name != NULL) {
110 printformat_window(win, MSGLEVEL_CLIENTCRAP,
111 TXT_WINDOW_INFO_HISTORY, win->history_name);
115 levelstr = win->level == 0 ?
116 g_strdup("NONE") : bits2level(win->level);
117 printformat_window(win, MSGLEVEL_CLIENTCRAP, TXT_WINDOW_INFO_LEVEL,
121 /* Active window server + sticky status */
122 if (win->servertag == NULL) {
123 printformat_window(win, MSGLEVEL_CLIENTCRAP,
124 TXT_WINDOW_INFO_SERVER,
125 win->active_server != NULL ?
126 win->active_server->tag : "NONE");
128 if (win->active_server != NULL &&
129 strcmp(win->active_server->tag, win->servertag) != 0)
130 g_warning("Active server isn't the sticky server!");
132 printformat_window(win, MSGLEVEL_CLIENTCRAP,
133 TXT_WINDOW_INFO_SERVER_STICKY,
137 /* Window theme + error status */
138 if (win->theme_name != NULL) {
139 printformat_window(win, MSGLEVEL_CLIENTCRAP,
140 TXT_WINDOW_INFO_THEME, win->theme_name,
141 win->theme != NULL ? "" : "(not loaded)");
144 /* Bound items in window */
145 if (win->bound_items != NULL)
146 window_print_binds(win);
149 if (win->items != NULL)
150 window_print_items(win);
152 signal_emit("window print info", 1, win);
154 printformat_window(win, MSGLEVEL_CLIENTCRAP,
155 TXT_WINDOW_INFO_FOOTER);
158 static void cmd_window(const char *data, void *server, WI_ITEM_REC *item)
160 while (*data == ' ') data++;
163 cmd_window_info(active_win);
164 else if (is_numeric(data, 0))
165 signal_emit("command window refnum", 3, data, server, item);
167 command_runsub("window", data, server, item);
170 /* SYNTAX: WINDOW NEW [hide] */
171 static void cmd_window_new(const char *data, void *server, WI_ITEM_REC *item)
176 g_return_if_fail(data != NULL);
178 type = (g_strncasecmp(data, "hid", 3) == 0 || g_strcasecmp(data, "tab") == 0) ? 1 :
179 (g_strcasecmp(data, "split") == 0 ? 2 : 0);
180 signal_emit("gui window create override", 1, GINT_TO_POINTER(type));
182 window = window_create(NULL, FALSE);
183 window_change_server(window, server);
186 /* SYNTAX: WINDOW CLOSE [<first> [<last>]] */
187 static void cmd_window_close(const char *data)
189 GSList *tmp, *destroys;
191 int first_num, last_num;
194 if (!cmd_get_params(data, &free_arg, 2, &first, &last))
197 if ((*first != '\0' && !is_numeric(first, '\0')) ||
198 ((*last != '\0') && !is_numeric(last, '\0'))) {
199 cmd_params_free(free_arg);
203 first_num = *first == '\0' ? active_win->refnum : atoi(first);
204 last_num = *last == '\0' ? first_num : atoi(last);
206 /* get list of windows to destroy */
208 for (tmp = windows; tmp != NULL; tmp = tmp->next) {
209 WINDOW_REC *rec = tmp->data;
211 if (rec->refnum >= first_num && rec->refnum <= last_num)
212 destroys = g_slist_append(destroys, rec);
215 /* really destroy the windows */
216 while (destroys != NULL) {
217 WINDOW_REC *rec = destroys->data;
219 if (windows->next != NULL) {
223 printformat_window(rec, MSGLEVEL_CLIENTERROR,
224 TXT_WINDOW_IMMORTAL_ERROR);
228 destroys = g_slist_remove(destroys, rec);
231 cmd_params_free(free_arg);
234 /* SYNTAX: WINDOW REFNUM <number> */
235 static void cmd_window_refnum(const char *data)
239 if (!is_numeric(data, 0))
242 window = window_find_refnum(atoi(data));
244 window_set_active(window);
247 /* return the first window number with the highest activity */
248 static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
250 WINDOW_REC *rec, *max_win;
252 int max_act, through;
254 g_return_val_if_fail(window != NULL, NULL);
256 max_win = NULL; max_act = 0; through = FALSE;
258 tmp = g_slist_find(windows, window);
259 for (;; tmp = tmp->next) {
265 if (through && tmp->data == window)
270 if (rec->data_level > 0 && max_act < rec->data_level) {
271 max_act = rec->data_level;
279 /* SYNTAX: WINDOW GOTO active|<number>|<name> */
280 static void cmd_window_goto(const char *data)
286 g_return_if_fail(data != NULL);
288 if (is_numeric(data, 0)) {
289 cmd_window_refnum(data);
293 if (!cmd_get_params(data, &free_arg, 1, &target))
296 if (g_strcasecmp(target, "active") == 0)
297 window = window_highest_activity(active_win);
299 window = window_find_item(active_win->active_server, target);
302 window_set_active(window);
304 cmd_params_free(free_arg);
307 /* SYNTAX: WINDOW NEXT */
308 static void cmd_window_next(void)
312 num = window_refnum_next(active_win->refnum, TRUE);
313 if (num < 1) num = windows_refnum_last();
315 window_set_active(window_find_refnum(num));
318 /* SYNTAX: WINDOW LAST */
319 static void cmd_window_last(void)
321 if (windows->next != NULL)
322 window_set_active(windows->next->data);
325 /* SYNTAX: WINDOW PREVIOUS */
326 static void cmd_window_previous(void)
330 num = window_refnum_prev(active_win->refnum, TRUE);
331 if (num < 1) num = window_refnum_next(0, TRUE);
333 window_set_active(window_find_refnum(num));
336 /* SYNTAX: WINDOW LEVEL [<level>] */
337 static void cmd_window_level(const char *data)
341 g_return_if_fail(data != NULL);
343 window_set_level(active_win, combine_level(active_win->level, data));
345 level = active_win->level == 0 ? g_strdup("NONE") :
346 bits2level(active_win->level);
347 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
348 TXT_WINDOW_LEVEL, level);
352 /* SYNTAX: WINDOW IMMORTAL on|off|toggle */
353 static void cmd_window_immortal(const char *data)
358 set = active_win->immortal;
359 else if (g_strcasecmp(data, "ON") == 0)
361 else if (g_strcasecmp(data, "OFF") == 0)
363 else if (g_strcasecmp(data, "TOGGLE") == 0)
364 set = !active_win->immortal;
366 printformat_window(active_win, MSGLEVEL_CLIENTERROR,
372 window_set_immortal(active_win, TRUE);
373 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
374 TXT_WINDOW_SET_IMMORTAL);
376 window_set_immortal(active_win, FALSE);
377 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
378 TXT_WINDOW_UNSET_IMMORTAL);
382 /* SYNTAX: WINDOW SERVER [-sticky | -unsticky] <tag> */
383 static void cmd_window_server(const char *data)
390 if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
391 "window server", &optlist, &tag))
394 if (*tag == '\0' && active_win->active_server != NULL &&
395 (g_hash_table_lookup(optlist, "sticky") != NULL ||
396 g_hash_table_lookup(optlist, "unsticky") != NULL)) {
397 tag = active_win->active_server->tag;
401 cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
402 server = server_find_tag(tag);
404 server = server_find_lookup_tag(tag);
406 if (g_hash_table_lookup(optlist, "unsticky") != NULL &&
407 active_win->servertag != NULL) {
408 g_free_and_null(active_win->servertag);
409 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
410 TXT_UNSET_SERVER_STICKY);
413 if (active_win->servertag != NULL &&
414 g_hash_table_lookup(optlist, "sticky") == NULL) {
415 printformat_window(active_win, MSGLEVEL_CLIENTERROR,
416 TXT_ERROR_SERVER_STICKY);
417 } else if (server == NULL) {
418 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
419 TXT_UNKNOWN_SERVER_TAG, tag);
420 } else if (active_win->active == NULL) {
421 window_change_server(active_win, server);
422 if (g_hash_table_lookup(optlist, "sticky") != NULL) {
423 g_free_not_null(active_win->servertag);
424 active_win->servertag = g_strdup(server->tag);
425 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
426 TXT_SET_SERVER_STICKY, server->tag);
428 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
430 server->tag, server->connrec->address,
431 server->connrec->chatnet == NULL ? "" :
432 server->connrec->chatnet);
435 cmd_params_free(free_arg);
438 static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
440 while (*data == ' ') data++;
442 if (is_numeric(data, '\0'))
443 signal_emit("command window item goto", 3, data, server, item);
445 command_runsub("window item", data, server, item);
448 /* SYNTAX: WINDOW ITEM PREV */
449 static void cmd_window_item_prev(void)
451 window_item_prev(active_win);
454 /* SYNTAX: WINDOW ITEM NEXT */
455 static void cmd_window_item_next(void)
457 window_item_next(active_win);
460 /* SYNTAX: WINDOW ITEM GOTO <number>|<name> */
461 static void cmd_window_item_goto(const char *data, SERVER_REC *server)
468 if (!cmd_get_params(data, &free_arg, 1, &target))
471 if (is_numeric(target, '\0')) {
472 /* change to specified number */
473 tmp = g_slist_nth(active_win->items, atoi(target)-1);
474 item = tmp == NULL ? NULL : tmp->data;
476 item = window_item_find_window(active_win, server, target);
480 window_item_set_active(active_win, item);
482 cmd_params_free(free_arg);
485 /* SYNTAX: WINDOW ITEM MOVE <number>|<name> */
486 static void cmd_window_item_move(const char *data, SERVER_REC *server,
493 if (!cmd_get_params(data, &free_arg, 1, &target))
496 if (is_numeric(target, '\0')) {
497 /* move current window item to specified window */
498 window = window_find_refnum(atoi(target));
500 /* move specified window item to current window */
501 item = window_item_find(server, target);
504 if (window != NULL && item != NULL)
505 window_item_set_active(window, item);
507 cmd_params_free(free_arg);
510 /* SYNTAX: WINDOW NUMBER [-sticky] <number> */
511 static void cmd_window_number(const char *data)
518 if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
519 "window number", &optlist, &refnum))
523 cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
527 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
530 window_set_refnum(active_win, num);
531 active_win->sticky_refnum =
532 g_hash_table_lookup(optlist, "sticky") != NULL;
535 cmd_params_free(free_arg);
538 /* SYNTAX: WINDOW NAME <name> */
539 static void cmd_window_name(const char *data)
543 win = window_find_name(data);
544 if (win == NULL || win == active_win)
545 window_set_name(active_win, data);
546 else if (active_win->name == NULL ||
547 strcmp(active_win->name, data) != 0) {
548 printformat_window(active_win, MSGLEVEL_CLIENTERROR,
549 TXT_WINDOW_NAME_NOT_UNIQUE, data);
553 /* SYNTAX: WINDOW HISTORY <name> */
554 void cmd_window_history(const char *data)
556 window_set_history(active_win, data);
559 /* we're moving the first window to last - move the first contiguous block
560 of refnums to left. Like if there's windows 1..5 and 7..10, move 1 to
561 11, 2..5 to 1..4 and leave 7..10 alone */
562 static void window_refnums_move_left(WINDOW_REC *move_window)
565 int refnum, new_refnum;
567 new_refnum = windows_refnum_last();
568 for (refnum = move_window->refnum+1; refnum <= new_refnum; refnum++) {
569 window = window_find_refnum(refnum);
570 if (window == NULL) {
575 window_set_refnum(window, refnum-1);
578 window_set_refnum(move_window, new_refnum);
581 /* we're moving the last window to first - make some space so we can use the
583 static void window_refnums_move_right(WINDOW_REC *move_window)
586 int refnum, new_refnum;
589 if (window_find_refnum(new_refnum) == NULL) {
590 window_set_refnum(move_window, new_refnum);
594 /* find the first unused refnum, like if there's windows
595 1..5 and 7..10, we only need to move 1..5 to 2..6 */
597 while (move_window->refnum == refnum ||
598 window_find_refnum(refnum) != NULL) refnum++;
601 while (refnum >= new_refnum) {
602 window = window_find_refnum(refnum);
603 window_set_refnum(window, refnum+1);
608 window_set_refnum(move_window, new_refnum);
611 /* SYNTAX: WINDOW MOVE PREV */
612 static void cmd_window_move_prev(void)
616 refnum = window_refnum_prev(active_win->refnum, FALSE);
618 window_set_refnum(active_win, refnum);
622 window_refnums_move_left(active_win);
625 /* SYNTAX: WINDOW MOVE NEXT */
626 static void cmd_window_move_next(void)
630 refnum = window_refnum_next(active_win->refnum, FALSE);
632 window_set_refnum(active_win, refnum);
636 window_refnums_move_right(active_win);
639 static void active_window_move_to(int new_refnum)
643 if (new_refnum > active_win->refnum) {
645 refnum = window_refnum_next(active_win->refnum, FALSE);
646 if (refnum == -1 || refnum > new_refnum)
649 window_set_refnum(active_win, refnum);
653 refnum = window_refnum_prev(active_win->refnum, FALSE);
654 if (refnum == -1 || refnum < new_refnum)
657 window_set_refnum(active_win, refnum);
662 /* SYNTAX: WINDOW MOVE FIRST */
663 static void cmd_window_move_first(void)
665 active_window_move_to(1);
668 /* SYNTAX: WINDOW MOVE LAST */
669 static void cmd_window_move_last(void)
671 active_window_move_to(windows_refnum_last());
674 /* SYNTAX: WINDOW MOVE <number>|<direction> */
675 static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
677 if (!is_numeric(data, 0)) {
678 command_runsub("window move", data, server, item);
682 active_window_move_to(atoi(data));
685 /* SYNTAX: WINDOW LIST */
686 static void cmd_window_list(void)
688 GSList *tmp, *sorted;
691 sorted = windows_get_sorted();
692 printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_HEADER);
693 for (tmp = sorted; tmp != NULL; tmp = tmp->next) {
694 WINDOW_REC *rec = tmp->data;
696 levelstr = bits2level(rec->level);
697 printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_LINE,
698 rec->refnum, rec->name == NULL ? "" : rec->name,
699 rec->active == NULL ? "" : rec->active->visible_name,
700 rec->active_server == NULL ? "" : ((SERVER_REC *) rec->active_server)->tag,
704 g_slist_free(sorted);
705 printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_FOOTER);
708 /* SYNTAX: WINDOW THEME [-delete] [<name>] */
709 static void cmd_window_theme(const char *data)
716 if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
717 "window theme", &optlist, &name))
720 if (g_hash_table_lookup(optlist, "delete") != NULL) {
721 g_free_and_null(active_win->theme_name);
723 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
724 TXT_WINDOW_THEME_REMOVED);
725 } else if (*name == '\0') {
726 if (active_win->theme == NULL) {
727 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
728 TXT_WINDOW_THEME_DEFAULT);
730 theme = active_win->theme;
731 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
733 theme->name, theme->path);
736 g_free_not_null(active_win->theme_name);
737 active_win->theme_name = g_strdup(data);
739 active_win->theme = theme = theme_load(data);
741 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
742 TXT_WINDOW_THEME_CHANGED,
743 theme->name, theme->path);
745 printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
746 TXT_THEME_NOT_FOUND, data);
750 cmd_params_free(free_arg);
753 static void cmd_layout(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
755 command_runsub("layout", data, server, item);
758 /* SYNTAX: FOREACH WINDOW <command> */
759 static void cmd_foreach_window(const char *data)
766 list = g_slist_copy(windows);
767 while (list != NULL) {
768 WINDOW_REC *rec = list->data;
771 signal_emit("send command", 3, data, rec->active_server,
773 list = g_slist_remove(list, list->data);
776 if (g_slist_find(windows, old) != NULL)
780 void window_commands_init(void)
782 command_bind("window", NULL, (SIGNAL_FUNC) cmd_window);
783 command_bind("window new", NULL, (SIGNAL_FUNC) cmd_window_new);
784 command_bind("window close", NULL, (SIGNAL_FUNC) cmd_window_close);
785 command_bind("window kill", NULL, (SIGNAL_FUNC) cmd_window_close);
786 command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server);
787 command_bind("window refnum", NULL, (SIGNAL_FUNC) cmd_window_refnum);
788 command_bind("window goto", NULL, (SIGNAL_FUNC) cmd_window_goto);
789 command_bind("window previous", NULL, (SIGNAL_FUNC) cmd_window_previous);
790 command_bind("window next", NULL, (SIGNAL_FUNC) cmd_window_next);
791 command_bind("window last", NULL, (SIGNAL_FUNC) cmd_window_last);
792 command_bind("window level", NULL, (SIGNAL_FUNC) cmd_window_level);
793 command_bind("window immortal", NULL, (SIGNAL_FUNC) cmd_window_immortal);
794 command_bind("window item", NULL, (SIGNAL_FUNC) cmd_window_item);
795 command_bind("window item prev", NULL, (SIGNAL_FUNC) cmd_window_item_prev);
796 command_bind("window item next", NULL, (SIGNAL_FUNC) cmd_window_item_next);
797 command_bind("window item goto", NULL, (SIGNAL_FUNC) cmd_window_item_goto);
798 command_bind("window item move", NULL, (SIGNAL_FUNC) cmd_window_item_move);
799 command_bind("window number", NULL, (SIGNAL_FUNC) cmd_window_number);
800 command_bind("window name", NULL, (SIGNAL_FUNC) cmd_window_name);
801 command_bind("window history", NULL, (SIGNAL_FUNC) cmd_window_history);
802 command_bind("window move", NULL, (SIGNAL_FUNC) cmd_window_move);
803 command_bind("window move prev", NULL, (SIGNAL_FUNC) cmd_window_move_prev);
804 command_bind("window move next", NULL, (SIGNAL_FUNC) cmd_window_move_next);
805 command_bind("window move first", NULL, (SIGNAL_FUNC) cmd_window_move_first);
806 command_bind("window move last", NULL, (SIGNAL_FUNC) cmd_window_move_last);
807 command_bind("window list", NULL, (SIGNAL_FUNC) cmd_window_list);
808 command_bind("window theme", NULL, (SIGNAL_FUNC) cmd_window_theme);
809 command_bind("layout", NULL, (SIGNAL_FUNC) cmd_layout);
810 /* SYNTAX: LAYOUT SAVE */
811 command_bind("layout save", NULL, (SIGNAL_FUNC) windows_layout_save);
812 /* SYNTAX: LAYOUT RESET */
813 command_bind("layout reset", NULL, (SIGNAL_FUNC) windows_layout_reset);
814 command_bind("foreach window", NULL, (SIGNAL_FUNC) cmd_foreach_window);
816 command_set_options("window number", "sticky");
817 command_set_options("window server", "sticky unsticky");
818 command_set_options("window theme", "delete");
821 void window_commands_deinit(void)
823 command_unbind("window", (SIGNAL_FUNC) cmd_window);
824 command_unbind("window new", (SIGNAL_FUNC) cmd_window_new);
825 command_unbind("window close", (SIGNAL_FUNC) cmd_window_close);
826 command_unbind("window kill", (SIGNAL_FUNC) cmd_window_close);
827 command_unbind("window server", (SIGNAL_FUNC) cmd_window_server);
828 command_unbind("window refnum", (SIGNAL_FUNC) cmd_window_refnum);
829 command_unbind("window goto", (SIGNAL_FUNC) cmd_window_goto);
830 command_unbind("window previous", (SIGNAL_FUNC) cmd_window_previous);
831 command_unbind("window next", (SIGNAL_FUNC) cmd_window_next);
832 command_unbind("window last", (SIGNAL_FUNC) cmd_window_last);
833 command_unbind("window level", (SIGNAL_FUNC) cmd_window_level);
834 command_unbind("window immortal", (SIGNAL_FUNC) cmd_window_immortal);
835 command_unbind("window item", (SIGNAL_FUNC) cmd_window_item);
836 command_unbind("window item prev", (SIGNAL_FUNC) cmd_window_item_prev);
837 command_unbind("window item next", (SIGNAL_FUNC) cmd_window_item_next);
838 command_unbind("window item goto", (SIGNAL_FUNC) cmd_window_item_goto);
839 command_unbind("window item move", (SIGNAL_FUNC) cmd_window_item_move);
840 command_unbind("window number", (SIGNAL_FUNC) cmd_window_number);
841 command_unbind("window name", (SIGNAL_FUNC) cmd_window_name);
842 command_unbind("window history", (SIGNAL_FUNC) cmd_window_history);
843 command_unbind("window move", (SIGNAL_FUNC) cmd_window_move);
844 command_unbind("window move prev", (SIGNAL_FUNC) cmd_window_move_prev);
845 command_unbind("window move next", (SIGNAL_FUNC) cmd_window_move_next);
846 command_unbind("window move first", (SIGNAL_FUNC) cmd_window_move_first);
847 command_unbind("window move last", (SIGNAL_FUNC) cmd_window_move_last);
848 command_unbind("window list", (SIGNAL_FUNC) cmd_window_list);
849 command_unbind("window theme", (SIGNAL_FUNC) cmd_window_theme);
850 command_unbind("layout", (SIGNAL_FUNC) cmd_layout);
851 command_unbind("layout save", (SIGNAL_FUNC) windows_layout_save);
852 command_unbind("layout reset", (SIGNAL_FUNC) windows_layout_reset);
853 command_unbind("foreach window", (SIGNAL_FUNC) cmd_foreach_window);