#define ROTE_ATTR_MOD_XBG(attr, newxbg) attr &= 0xF0, attr |= (newxbg)
#define ROTE_ATTR_MOD_XFG(attr, newxfg) attr &= 0x0F, attr |= ((newxfg) << 4)
#define ROTE_ATTR_MOD_BOLD(attr, boldbit) \
- attr &= 0x7F, attr |= (boldbit)?0x80:0x00
+ attr &= 0x7F, attr |= (boldbit)?0x80:0x00
#define ROTE_ATTR_MOD_BLINK(attr, blinkbit) \
- attr &= 0xF7, attr |= (blinkbit)?0x08:0x00
+ attr &= 0xF7, attr |= (blinkbit)?0x08:0x00
/* these return non-zero for 'yes', zero for 'no'. Don't rely on them being
* any more specific than that (e.g. being exactly 1 for 'yes' or whatever). */
/* Represents each of the text cells in the terminal screen */
typedef struct RoteCell_ {
- unsigned char ch; /* >= 32, that is, control characters are not
- * allowed to be on the virtual screen */
+ unsigned char ch; /* >= 32, that is, control characters are not
+ * allowed to be on the virtual screen */
- unsigned char attr; /* a color attribute, as described previously */
+ unsigned char attr; /* a color attribute, as described previously */
} RoteCell;
/* Declaration of opaque rote_Term_Private structure */
* of this structure, but please pay close attention to the fields
* marked read-only or with special usage notes. */
typedef struct RoteTerm_ {
- int rows, cols; /* terminal dimensions, READ-ONLY. You
- * can't resize the terminal by changing
- * this (a segfault is about all you will
- * accomplish). */
-
- RoteCell **cells; /* matrix of cells. This
- * matrix is indexed as cell[row][column]
- * where 0 <= row < rows and
- * 0 <= col < cols
- *
- * You may freely modify the contents of
- * the cells.
- */
-
- int crow, ccol; /* cursor coordinates. READ-ONLY. */
-
- unsigned char curattr; /* current attribute, that is the attribute
- * that will be used for newly inserted
- * characters */
-
- pid_t childpid; /* pid of the child process running in the
- * terminal; 0 for none. This is READ-ONLY. */
-
- RoteTermPrivate *pd; /* private state data */
-
- bool insert; /* insert or replace mode */
- /* --- dirtiness flags: the following flags will be raised when the
- * corresponding items are modified. They can only be unset by YOU
- * (when, for example, you redraw the term or something) --- */
- bool curpos_dirty; /* whether cursor location has changed */
- bool *line_dirty; /* whether each row is dirty */
- /* --- end dirtiness flags */
+ int rows, cols; /* terminal dimensions, READ-ONLY. You
+ * can't resize the terminal by changing
+ * this (a segfault is about all you will
+ * accomplish). */
+
+ RoteCell **cells; /* matrix of cells. This
+ * matrix is indexed as cell[row][column]
+ * where 0 <= row < rows and
+ * 0 <= col < cols
+ *
+ * You may freely modify the contents of
+ * the cells.
+ */
+
+ int crow, ccol; /* cursor coordinates. READ-ONLY. */
+
+ unsigned char curattr; /* current attribute, that is the attribute
+ * that will be used for newly inserted
+ * characters */
+
+ pid_t childpid; /* pid of the child process running in the
+ * terminal; 0 for none. This is READ-ONLY. */
+
+ RoteTermPrivate *pd; /* private state data */
+
+ bool insert; /* insert or replace mode */
+ /* --- dirtiness flags: the following flags will be raised when the
+ * corresponding items are modified. They can only be unset by YOU
+ * (when, for example, you redraw the term or something) --- */
+ bool curpos_dirty; /* whether cursor location has changed */
+ bool *line_dirty; /* whether each row is dirty */
+ /* --- end dirtiness flags */
} RoteTerm;
/* Creates a new virtual terminal with the given dimensions. You
* changed).
*/
void rote_vt_install_handler(RoteTerm *rt, rote_es_handler_t handler);
-
+
/* Possible return values for the custom handler function and their
* meanings: */
#define ROTE_HANDLERESULT_OK 0 /* means escape sequence was handled */