![]() | ![]() | ![]() | Cuiterm Reference Manual | ![]() |
---|
#include <history.h> CuiWindow; CuiWidget* cui_window_new (Background *background); void cui_window_set_begin_mark (CuiWindow *window, GtkTextMark *mark); void cui_window_set_end_mark (CuiWindow *window, GtkTextMark *mark); void cui_window_set_command (CuiWindow *window, GString *command); void cui_window_set_working_directory (CuiWindow *window, GString *wd); const gchar* cui_window_get_working_directory (CuiWindow *window); void cui_window_apply_tag (CuiWindow *window, gchar *tag, GtkTextMark *mbegin, GtkTextMark *mend); void cui_window_realize (CuiWindow *window); gboolean cui_window_get_token_marks (CuiWindow *window, char *token, GtkTextMark **mbegin, GtkTextMark **mend); void cui_window_set_title (CuiWindow *window, gchar *title); void cui_window_set_title_if_empty (CuiWindow *window, gchar *title); void cui_window_set_parse_tree (CuiWindow *window, GNode *parse_tree); gchar* cui_window_get_title (CuiWindow *window);
typedef struct { GtkTextMark *begin; GtkTextMark *end; GtkTextMark *parser_cursor; /* wandering cursor */ GtkTextMark *lexer_cursor; /* */ GString *command; GNode *parse_tree; GString *wd; GString *username; GString *hostname; } CuiWindow;
GtkTextMark *begin ; | the starting point of the window is at the command line |
GtkTextMark *end ; | the end point of the window |
GtkTextMark *parser_cursor ; | the point where the parser reads the text (FIXME: do we need this?) |
GtkTextMark *lexer_cursor ; | the point where the lexer reads the text |
GString *command ; | the full command line created this command |
GNode *parse_tree ; | A tree created by the bash parser. Every element is a CuiLexElement. |
GString *wd ; | the working directory part from the prompt |
GString *username ; | the user name part from the cursor |
GString *hostname ; | the hostname part from the cursor |
void cui_window_set_begin_mark (CuiWindow *window, GtkTextMark *mark);
Sets the start point of the window.
window : | |
mark : | the begin point as a GtkTextMark |
void cui_window_set_end_mark (CuiWindow *window, GtkTextMark *mark);
Sets the end point of the window.
window : | |
mark : | the end point as a GtkTextMark |
void cui_window_set_command (CuiWindow *window, GString *command);
Sets the command (the full command line) of which created this window. We use this facility to repeat the command if we want to refresh the window after a procedure has been completed on it.
window : | |
command : | the command created this window. |
void cui_window_set_working_directory (CuiWindow *window, GString *wd);
Sets the directory path in which this window was created.
window : | |
wd : | the new working directory |
const gchar* cui_window_get_working_directory (CuiWindow *window);
Returns the working directory of the window. This is a directory which was the working directory when the window creator command was executed.
window : | |
Returns : | the working directory |
void cui_window_apply_tag (CuiWindow *window, gchar *tag, GtkTextMark *mbegin, GtkTextMark *mend);
Applies a text attribute tag in the window. A command parser can use this function to create syntax highlights in the terminal.
window : | the CuiWindow |
tag : | the name of the tag |
mbegin : | the starting point of the text we highlight |
mend : | the end point of the text we highlight |
void cui_window_realize (CuiWindow *window);
Realizes the window by calculating some data and creating some widgets.
window : | the window to realize |
gboolean cui_window_get_token_marks (CuiWindow *window, char *token, GtkTextMark **mbegin, GtkTextMark **mend);
Gets the text marks of the next lexical element in the window. A lexical analyzer can use this function to find out the borders of a given lexical element. If a lexical analizer uses this function then itm ust call for every lexical element!
window : | the embedded window |
token : | the token was identified by the lexer and we want to read |
mbegin : | the place where we put the start pointer, or NULL |
mend : | the place where we put the end pointer, or NULL |
Returns : | TRUE if the token found |
void cui_window_set_title (CuiWindow *window, gchar *title);
Sets the window title of the window if it is empty, otherwise do nothing.
window : | |
title : | a new window title |
void cui_window_set_title_if_empty (CuiWindow *window, gchar *title);
window : | |
title : |
|
void cui_window_set_parse_tree (CuiWindow *window, GNode *parse_tree);
Sets the parse tree for the window. The window uses the parse tree to decide what to do with the programs output.
window : | |
parse_tree : | a shell parse tree |
<<< CuiFrame | CuiActionArea >>> |