2005-06-22 11:20:32 -07:00
|
|
|
/*
|
|
|
|
* mooterm/mootermline.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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MOOTERM_MOOTERMLINE_H
|
|
|
|
#define MOOTERM_MOOTERMLINE_H
|
|
|
|
|
|
|
|
#ifndef MOOTERM_COMPILATION
|
|
|
|
#error "This file may not be included directly"
|
|
|
|
#endif
|
|
|
|
|
2005-07-21 15:11:16 -07:00
|
|
|
#include "mooterm/mootermbuffer.h"
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2005-07-21 15:11:16 -07:00
|
|
|
typedef struct _MooTermCell MooTermCell;
|
|
|
|
typedef struct _MooTermCellArray MooTermCellArray;
|
|
|
|
typedef struct _MooTermLine MooTermLine;
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-06 09:39:02 -07:00
|
|
|
#define EMPTY_CHAR ' '
|
2005-07-15 07:30:48 -07:00
|
|
|
#define DECALN_CHAR 'S'
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-19 07:01:41 -07:00
|
|
|
extern MooTermTextAttr MOO_TERM_ZERO_ATTR;
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-06 16:41:14 -07:00
|
|
|
|
|
|
|
/* FALSE if equal */
|
2005-07-19 07:01:41 -07:00
|
|
|
#define ATTR_CMP(a1, a2) \
|
|
|
|
((a1)->mask != (a2)->mask || \
|
|
|
|
(((a1)->mask & MOO_TERM_TEXT_FOREGROUND) && \
|
|
|
|
((a1)->foreground != (a2)->foreground)) || \
|
|
|
|
(((a1)->mask & MOO_TERM_TEXT_BACKGROUND) && \
|
|
|
|
((a1)->background != (a2)->background)))
|
2005-07-06 16:41:14 -07:00
|
|
|
|
|
|
|
|
2005-07-06 09:39:02 -07:00
|
|
|
struct _MooTermCell {
|
|
|
|
gunichar ch;
|
|
|
|
MooTermTextAttr attr;
|
|
|
|
};
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-21 15:11:16 -07:00
|
|
|
struct _MooTermCellArray {
|
2005-07-06 09:39:02 -07:00
|
|
|
MooTermCell *data;
|
|
|
|
guint len;
|
|
|
|
};
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-21 15:11:16 -07:00
|
|
|
struct _MooTermLine {
|
|
|
|
MooTermCellArray *cells;
|
|
|
|
guint wrapped : 1;
|
|
|
|
};
|
|
|
|
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-19 07:01:41 -07:00
|
|
|
MooTermLine *moo_term_line_new (guint len);
|
|
|
|
void moo_term_line_free (MooTermLine *line);
|
2005-07-21 15:11:16 -07:00
|
|
|
|
2005-07-19 07:01:41 -07:00
|
|
|
guint moo_term_line_len (MooTermLine *line);
|
2005-07-21 15:11:16 -07:00
|
|
|
|
|
|
|
MooTermTextAttr *moo_term_line_attr (MooTermLine *line,
|
|
|
|
guint index);
|
|
|
|
MooTermCell *moo_term_line_cell (MooTermLine *line,
|
|
|
|
guint index);
|
|
|
|
gunichar moo_term_line_get_unichar (MooTermLine *line,
|
|
|
|
guint col);
|
|
|
|
|
2005-07-19 07:01:41 -07:00
|
|
|
void moo_term_line_set_len (MooTermLine *line,
|
|
|
|
guint len);
|
2005-07-21 15:11:16 -07:00
|
|
|
|
2005-07-19 07:01:41 -07:00
|
|
|
void moo_term_line_erase (MooTermLine *line);
|
|
|
|
void moo_term_line_erase_range (MooTermLine *line,
|
|
|
|
guint pos,
|
|
|
|
guint len,
|
|
|
|
MooTermTextAttr *attr);
|
|
|
|
void moo_term_line_delete_range (MooTermLine *line,
|
|
|
|
guint pos,
|
|
|
|
guint len);
|
|
|
|
void moo_term_line_set_unichar (MooTermLine *line,
|
|
|
|
guint pos,
|
|
|
|
gunichar c,
|
|
|
|
guint num,
|
2005-07-06 09:39:02 -07:00
|
|
|
MooTermTextAttr *attr,
|
2005-07-19 07:01:41 -07:00
|
|
|
guint width);
|
|
|
|
void moo_term_line_insert_unichar (MooTermLine *line,
|
|
|
|
guint pos,
|
|
|
|
gunichar c,
|
|
|
|
guint num,
|
2005-07-06 09:39:02 -07:00
|
|
|
MooTermTextAttr *attr,
|
2005-07-19 07:01:41 -07:00
|
|
|
guint width);
|
|
|
|
guint moo_term_line_get_chars (MooTermLine *line,
|
|
|
|
char *buf,
|
|
|
|
guint first,
|
|
|
|
int len);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* MOOTERM_MOOTERMLINE_H */
|