CuiWindow

Name

CuiWindow -- 

Synopsis


#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);

Object Hierarchy


  GObject
   +----CuiWidget
         +----CuiRectangle
               +----CuiWindow

Description

Details

CuiWindow

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


cui_window_new ()

CuiWidget*  cui_window_new                  (Background *background);

background :

Returns :


cui_window_set_begin_mark ()

void        cui_window_set_begin_mark       (CuiWindow *window,
                                             GtkTextMark *mark);

Sets the start point of the window.

window :

a CuiWindow

mark :

the begin point as a GtkTextMark


cui_window_set_end_mark ()

void        cui_window_set_end_mark         (CuiWindow *window,
                                             GtkTextMark *mark);

Sets the end point of the window.

window :

a CuiWindow

mark :

the end point as a GtkTextMark


cui_window_set_command ()

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 :

a CuiWindow

command :

the command created this window.


cui_window_set_working_directory ()

void        cui_window_set_working_directory
                                            (CuiWindow *window,
                                             GString *wd);

Sets the directory path in which this window was created.

window :

a CuiWindow

wd :

the new working directory


cui_window_get_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 :

a CuiWindow

Returns :

the working directory


cui_window_apply_tag ()

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


cui_window_realize ()

void        cui_window_realize              (CuiWindow *window);

Realizes the window by calculating some data and creating some widgets.

window :

the window to realize


cui_window_get_token_marks ()

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


cui_window_set_title ()

void        cui_window_set_title            (CuiWindow *window,
                                             gchar *title);

Sets the window title of the window if it is empty, otherwise do nothing.

window :

a CuiWindow

title :

a new window title


cui_window_set_title_if_empty ()

void        cui_window_set_title_if_empty   (CuiWindow *window,
                                             gchar *title);

window :

title :


cui_window_set_parse_tree ()

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 :

a CuiWindow

parse_tree :

a shell parse tree


cui_window_get_title ()

gchar*      cui_window_get_title            (CuiWindow *window);

Returns the window title of a Cuiwindow. The return string should not be changed or freed.

window :

the CuiWindow

Returns :

the window title