comparison mcabber/src/commands.c @ 1172:334ae9f498f1

Add some more iline functions (Lego12239)
author Mikael Berthe <mikael@lilotux.net>
date Tue, 03 Apr 2007 20:30:28 +0200
parents 03a38b7ad2e0
children 960f34ec22a2
comparison
equal deleted inserted replaced
1171:03a38b7ad2e0 1172:334ae9f498f1
69 static void do_request(char *arg); 69 static void do_request(char *arg);
70 static void do_event(char *arg); 70 static void do_event(char *arg);
71 static void do_help(char *arg); 71 static void do_help(char *arg);
72 static void do_pgp(char *arg); 72 static void do_pgp(char *arg);
73 static void do_iline(char *arg); 73 static void do_iline(char *arg);
74 static void do_screen_refresh(char *arg);
75 static void do_chat_disable(char *arg);
74 76
75 // Global variable for the commands list 77 // Global variable for the commands list
76 static GSList *Commands; 78 static GSList *Commands;
77 79
78 80
132 cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status); 134 cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status);
133 cmd_add("status_to", "Show or set your status for one recipient", 135 cmd_add("status_to", "Show or set your status for one recipient",
134 COMPL_JID, COMPL_STATUS, &do_status_to); 136 COMPL_JID, COMPL_STATUS, &do_status_to);
135 cmd_add("version", "Show mcabber version", 0, 0, &do_version); 137 cmd_add("version", "Show mcabber version", 0, 0, &do_version);
136 cmd_add("iline", "Manipulate input buffer", 0, 0, &do_iline); 138 cmd_add("iline", "Manipulate input buffer", 0, 0, &do_iline);
139 cmd_add("screen_refresh", "Redraw mcabber screen", 0, 0, &do_screen_refresh);
140 cmd_add("chat_disable", "Disable chat mode", 0, 0, &do_chat_disable);
137 141
138 // Status category 142 // Status category
139 compl_add_category_word(COMPL_STATUS, "online"); 143 compl_add_category_word(COMPL_STATUS, "online");
140 compl_add_category_word(COMPL_STATUS, "avail"); 144 compl_add_category_word(COMPL_STATUS, "avail");
141 compl_add_category_word(COMPL_STATUS, "invisible"); 145 compl_add_category_word(COMPL_STATUS, "invisible");
2725 readline_backward_word(); 2729 readline_backward_word();
2726 } else if (!strcasecmp(arg, "word_fdel")) { 2730 } else if (!strcasecmp(arg, "word_fdel")) {
2727 readline_forward_kill_word(); 2731 readline_forward_kill_word();
2728 } else if (!strcasecmp(arg, "word_bdel")) { 2732 } else if (!strcasecmp(arg, "word_bdel")) {
2729 readline_backward_kill_word(); 2733 readline_backward_kill_word();
2734 } else if (!strcasecmp(arg, "word_upcase")) {
2735 readline_updowncase_word(1);
2736 } else if (!strcasecmp(arg, "word_downcase")) {
2737 readline_updowncase_word(0);
2738 } else if (!strcasecmp(arg, "word_capit")) {
2739 readline_capitalize_word();
2730 } else if (!strcasecmp(arg, "fchar")) { 2740 } else if (!strcasecmp(arg, "fchar")) {
2731 readline_forward_char(); 2741 readline_forward_char();
2732 } else if (!strcasecmp(arg, "bchar")) { 2742 } else if (!strcasecmp(arg, "bchar")) {
2733 readline_backward_char(); 2743 readline_backward_char();
2734 } else if (!strcasecmp(arg, "char_fdel")) { 2744 } else if (!strcasecmp(arg, "char_fdel")) {
2735 readline_forward_kill_char(); 2745 readline_forward_kill_char();
2736 } else if (!strcasecmp(arg, "char_bdel")) { 2746 } else if (!strcasecmp(arg, "char_bdel")) {
2737 readline_backward_kill_char(); 2747 readline_backward_kill_char();
2738 } else if (!strcasecmp(arg, "char_swp")) { 2748 } else if (!strcasecmp(arg, "char_swap")) {
2739 readline_transpose_chars(); 2749 readline_transpose_chars();
2740 } else if (!strcasecmp(arg, "hist_prev")) { 2750 } else if (!strcasecmp(arg, "hist_prev")) {
2741 readline_hist_prev(); 2751 readline_hist_prev();
2742 } else if (!strcasecmp(arg, "hist_next")) { 2752 } else if (!strcasecmp(arg, "hist_next")) {
2743 readline_hist_next(); 2753 readline_hist_next();
2749 readline_forward_kill_iline(); 2759 readline_forward_kill_iline();
2750 } else if (!strcasecmp(arg, "iline_bdel")) { 2760 } else if (!strcasecmp(arg, "iline_bdel")) {
2751 readline_backward_kill_iline(); 2761 readline_backward_kill_iline();
2752 } else if (!strcasecmp(arg, "send_multiline")) { 2762 } else if (!strcasecmp(arg, "send_multiline")) {
2753 readline_send_multiline(); 2763 readline_send_multiline();
2754 } 2764 } else if (!strcasecmp(arg, "iline_accept")) {
2765 readline_accept_line();
2766 } else if (!strcasecmp(arg, "iline_accept_down_hist")) { // May be too long
2767 readline_accept_line_down_hist();
2768 } else if (!strcasecmp(arg, "compl_cancel")) {
2769 readline_cancel_completion();
2770 } else if (!strcasecmp(arg, "compl_do")) {
2771 readline_do_completion();
2772 }
2773 }
2774
2775 static void do_screen_refresh(char *arg)
2776 {
2777 readline_refresh_screen();
2778 }
2779
2780 static void do_chat_disable(char *arg)
2781 {
2782 readline_disable_chat_mode();
2755 } 2783 }
2756 2784
2757 static void do_connect(char *arg) 2785 static void do_connect(char *arg)
2758 { 2786 {
2759 mcabber_connect(); 2787 mcabber_connect();