2005-07-12 01:27:21 -07:00
|
|
|
/*
|
|
|
|
* mooterm/mooterm-ctlfuncs.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004-2005 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
2005-07-23 21:58:57 -07:00
|
|
|
*/
|
2005-07-12 01:27:21 -07:00
|
|
|
|
|
|
|
#ifndef MOOTERM_MOOTERM_CTLFUNCS_H
|
|
|
|
#define MOOTERM_MOOTERM_CTLFUNCS_H
|
|
|
|
|
|
|
|
#include "mooterm/mootermbuffer-private.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if 1
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_NOT_IMPLEMENTED \
|
|
|
|
G_STMT_START { \
|
2005-07-12 07:23:08 -07:00
|
|
|
char *s = _moo_term_current_ctl (parser); \
|
2005-07-15 08:11:08 -07:00
|
|
|
TERM_IMPLEMENT_ME_WARNING ("'%s': implement me", s); \
|
2005-07-12 07:23:08 -07:00
|
|
|
g_free (s); \
|
2005-07-15 08:11:08 -07:00
|
|
|
} G_STMT_END
|
|
|
|
#define VT_IGNORED \
|
|
|
|
G_STMT_START { \
|
2005-07-14 23:37:09 -07:00
|
|
|
char *s = _moo_term_current_ctl (parser); \
|
|
|
|
g_warning ("'%s' ignored", s); \
|
|
|
|
g_free (s); \
|
2005-07-15 08:11:08 -07:00
|
|
|
} G_STMT_END
|
2005-07-12 01:27:21 -07:00
|
|
|
#else
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_NOT_IMPLEMENTED G_STMT_START {} G_STMT_END
|
|
|
|
#define VT_IGNORED G_STMT_START {} G_STMT_END
|
2005-07-12 01:27:21 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_PRINT_CHAR(ch) moo_term_buffer_print_unichar (parser->term->priv->buffer, ch)
|
2005-07-12 01:27:21 -07:00
|
|
|
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_XON g_warning ("%s: got XON", G_STRLOC)
|
|
|
|
#define VT_XOFF g_warning ("%s: got XOFF", G_STRLOC)
|
2005-07-12 01:27:21 -07:00
|
|
|
|
|
|
|
#define vt_SET_ICON_NAME(s) moo_term_set_icon_name (parser->term, s)
|
|
|
|
#define vt_SET_WINDOW_TITLE(s) moo_term_set_window_title (parser->term, s)
|
|
|
|
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_BEL moo_term_bell (parser->term)
|
|
|
|
#define VT_BS moo_term_buffer_backspace (parser->term->priv->buffer)
|
|
|
|
#define VT_TAB moo_term_buffer_tab (parser->term->priv->buffer, 1)
|
|
|
|
#define VT_LF moo_term_buffer_linefeed (parser->term->priv->buffer)
|
|
|
|
#define VT_CR moo_term_buffer_carriage_return (parser->term->priv->buffer)
|
|
|
|
#define VT_SO moo_term_buffer_shift (parser->term->priv->buffer, 1)
|
|
|
|
#define VT_SI moo_term_buffer_shift (parser->term->priv->buffer, 0)
|
|
|
|
#define VT_IND moo_term_buffer_index (parser->term->priv->buffer)
|
|
|
|
#define VT_NEL moo_term_buffer_new_line (parser->term->priv->buffer)
|
|
|
|
#define VT_HTS moo_term_buffer_set_tab_stop (parser->term->priv->buffer)
|
|
|
|
#define VT_TBC(w) moo_term_buffer_clear_tab_stop (parser->term->priv->buffer, w)
|
|
|
|
#define VT_RI moo_term_buffer_reverse_index (parser->term->priv->buffer)
|
|
|
|
#define VT_SS2 moo_term_buffer_single_shift (parser->term->priv->buffer, 2)
|
|
|
|
#define VT_SS3 moo_term_buffer_single_shift (parser->term->priv->buffer, 3)
|
|
|
|
#define VT_DECID moo_term_decid (parser->term)
|
|
|
|
#define VT_SGR moo_term_buffer_sgr (parser->term->priv->buffer, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_CUU(n) moo_term_buffer_cuu (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CUD(n) moo_term_buffer_cud (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CUF(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
|
|
|
|
#define VT_CUB(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, -n)
|
|
|
|
#define VT_DCH(n) moo_term_buffer_delete_char (parser->term->priv->buffer, n)
|
|
|
|
#define VT_DL(n) moo_term_buffer_delete_line (parser->term->priv->buffer, n)
|
|
|
|
#define VT_ECH(n) moo_term_buffer_erase_char (parser->term->priv->buffer, n)
|
|
|
|
#define VT_ED(n) moo_term_buffer_erase_in_display (parser->term->priv->buffer, n)
|
|
|
|
#define VT_EL(n) moo_term_buffer_erase_in_line (parser->term->priv->buffer, n)
|
|
|
|
#define VT_ICH(n) moo_term_buffer_insert_char (parser->term->priv->buffer, n)
|
|
|
|
#define VT_IL(n) moo_term_buffer_insert_line (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CUP(r,c) moo_term_buffer_cup (parser->term->priv->buffer, (r)-1, (c)-1)
|
|
|
|
#define VT_DECSTBM(t,b) moo_term_buffer_set_scrolling_region (parser->term->priv->buffer, (t)-1, (b)-1);
|
2005-07-16 21:38:09 -07:00
|
|
|
#define VT_DECSC moo_term_decsc (parser->term)
|
|
|
|
#define VT_DECRC moo_term_decrc (parser->term)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_DECSET moo_term_set_dec_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len, \
|
|
|
|
TRUE)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_DECRST moo_term_set_dec_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len, \
|
|
|
|
FALSE)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_SM moo_term_set_ansi_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len, \
|
|
|
|
TRUE)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_RM moo_term_set_ansi_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len, \
|
|
|
|
FALSE)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_SCS(n,s) moo_term_buffer_select_charset (parser->term->priv->buffer, n, s)
|
|
|
|
#define VT_DECKPAM moo_term_set_mode (parser->term, MODE_DECNKM, TRUE)
|
|
|
|
#define VT_DECKPNM moo_term_set_mode (parser->term, MODE_DECNKM, FALSE)
|
|
|
|
#define VT_DECSAVE moo_term_save_dec_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_DECRESTORE moo_term_restore_dec_modes (parser->term, \
|
2005-07-12 07:23:08 -07:00
|
|
|
(int*) parser->numbers->data, \
|
|
|
|
parser->numbers->len)
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_DA1 moo_term_da1 (parser->term)
|
|
|
|
#define VT_DA2 moo_term_da2 (parser->term)
|
|
|
|
#define VT_DA3 moo_term_da3 (parser->term)
|
|
|
|
#define VT_DECRQSS(s) moo_term_setting_request (parser->term, s)
|
|
|
|
#define VT_DSR(t,a,e) moo_term_dsr (parser->term, t, a, e)
|
|
|
|
#define VT_DECSTR moo_term_soft_reset (parser->term)
|
|
|
|
#define VT_RIS moo_term_reset (parser->term)
|
2005-07-14 23:37:09 -07:00
|
|
|
|
2005-07-15 08:11:08 -07:00
|
|
|
#define VT_CBT(n) moo_term_buffer_back_tab (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CHA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
|
|
|
|
#define VT_CHT(n) moo_term_buffer_tab (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CNL(n) moo_term_buffer_cursor_next_line (parser->term->priv->buffer, n)
|
|
|
|
#define VT_CPL(n) moo_term_buffer_cursor_prev_line (parser->term->priv->buffer, n)
|
|
|
|
#define VT_HPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
|
|
|
|
#define VT_HPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
|
|
|
|
#define VT_VPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, n, -1)
|
|
|
|
#define VT_VPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, n, 0)
|
|
|
|
#define VT_DECALN moo_term_buffer_decaln (parser->term->priv->buffer)
|
2005-07-12 01:27:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* MOOTERM_MOOTERM_CTLFUNCS_H */
|