Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CdgShell Class Reference

Inheritance diagram for CdgShell:

Inheritance graph
[legend]
Collaboration diagram for CdgShell:

Collaboration graph
[legend]
List of all members.

Detailed Description

CdgShell - imitate the CDG shell in tcl.

Author:
Michael Daum (see also AUTHORS and THANKS for more)
Id
shell.tcl,v 1.59 2004/09/06 13:40:54 micha Exp

Definition at line 17 of file shell.tcl.

Public Member Functions

 autotag (TclString pattern, TclList args)
 background (TclString value="gray90")
 clear ()
 deleteCmd ()
 fgets ()
 getCmd ()
 getConfirmExit ()
 insert (TclString string)
 prompt (TclString value="cdg> ")
 prompt1 (TclString value="cdg> ")
 prompt2 (TclString value="tcltk# ")
 resetCmd (TclList args)
 safeEval (TclCommand cmd)
 safeSource (TclString file)
 setConfirmExit (TclBoolean x)
 setCursor (TclString pos)
 updateCmd (TclList args)

Public Attributes

TclNumber maxIndex = 100
TclNumber showTrace = 0

Private Member Functions

 b1_action (TclNumber x, TclNumber y)
 backspace_action ()
 CdgShell (TclList args)
 control_c_action ()
 control_d_action ()
 control_l_action ()
 control_q_action ()
 delete_action ()
 double_1_action (TclNumber x, TclNumber y)
 down_action ()
 end_action ()
 fgets_action ()
 getCompletions (TclString name, TclString parameter="")
 home_action ()
 left_action ()
 next_action ()
 prio_action ()
 return_action ()
 shift_down_action ()
 shift_up_action ()
 switch_interp ()
 tab_action ()
 tabtab_action ()
 triple_1_action (TclNumber x, TclNumber y)
 up_action ()

Private Attributes

TclArray commands
TclNumber completeFlag = 1
TclNumber confirmexit = 1
TclNumber firstPosition = 0.0
TclArray history
TclRef historyIndex
TclNumber interpFlag = 1
TclNumber lastPosition = 0.0
TclNumber needsLineFeed = 0
TclString oldBackground = ""
TclString safeInterp = ""
TclNumber silentFlag = 0
TclList tagging = {}


Constructor & Destructor Documentation

CdgShell::CdgShell TclList  args  )  [private]
 

constructor

Definition at line 131 of file shell.tcl.


Member Function Documentation

CdgShell::autotag TclString  pattern,
TclList  args
 

add a syntax highlightening rule.

Definition at line 314 of file shell.tcl.

References safeEval().

Referenced by background().

CdgShell::b1_action TclNumber  x,
TclNumber  y
[private]
 

button1 only sets the selection anchor.

Definition at line 938 of file shell.tcl.

Referenced by control_l_action().

CdgShell::background TclString  value = "gray90"  ) 
 

itk_option: configure the shell background color

Definition at line 307 of file shell.tcl.

References autotag().

CdgShell::backspace_action  )  [private]
 

restrict BackSpace to the command-line

Definition at line 870 of file shell.tcl.

Referenced by home_action().

CdgShell::clear  ) 
 

clear the shell screen.

Definition at line 922 of file shell.tcl.

References control_l_action().

CdgShell::control_c_action  )  [private]
 

kind of control-c

Definition at line 891 of file shell.tcl.

Referenced by delete_action().

CdgShell::control_d_action  )  [private]
 

terminate the application.

Definition at line 911 of file shell.tcl.

Referenced by control_q_action().

CdgShell::control_l_action  )  [private]
 

clear the shell screen preventing the commandline content.

Definition at line 929 of file shell.tcl.

References b1_action().

Referenced by clear().

CdgShell::control_q_action  )  [private]
 

terminate the application.

Definition at line 904 of file shell.tcl.

References control_d_action().

CdgShell::delete_action  )  [private]
 

delete doesnt delete the selection.

Definition at line 883 of file shell.tcl.

References control_c_action().

CdgShell::deleteCmd  ) 
 

delete the current command-line

Definition at line 453 of file shell.tcl.

CdgShell::double_1_action TclNumber  x,
TclNumber  y
[private]
 

double-1 without changing the insert-position.

Definition at line 952 of file shell.tcl.

CdgShell::down_action  )  [private]
 

scroll forward thru the commandline history.

Definition at line 821 of file shell.tcl.

CdgShell::end_action  )  [private]
 

set insert cursor to the end of commandline.

Definition at line 856 of file shell.tcl.

References home_action().

CdgShell::fgets  ) 
 

get a single line of input from the user without interpreting it. This proc is only used during subprompts, e.g. as used by frobbing Definition at line 467 of file shell.tcl.

CdgShell::fgets_action  )  [private]
 

alternative <Return> handler, This version gets a line, but does not call cdg commands. Definition at line 492 of file shell.tcl.

CdgShell::getCmd  ) 
 

get actual command.

Definition at line 1029 of file shell.tcl.

References resetCmd().

CdgShell::getCompletions TclString  name,
TclString  parameter = ""
[private]
 

get the set of possible commandline completions.

Parameters:
name the string to be completed. If it is "file", then parameter is used to fork an "ls \c -adF"
parameter used when name = "file"
Returns:
the set of possible completions
Definition at line 546 of file shell.tcl.

CdgShell::home_action  )  [private]
 

set the insert cursor to the start of commandline.

Definition at line 863 of file shell.tcl.

References backspace_action().

Referenced by end_action().

CdgShell::insert TclString  string  ) 
 

print a string to the shell output.

Parameters:
string the message to be printed
Definition at line 390 of file shell.tcl.

Referenced by setCursor().

CdgShell::left_action  )  [private]
 

restrict cursor movement to the commandline end.

Definition at line 844 of file shell.tcl.

CdgShell::next_action  )  [private]
 

simply scroll down one page, no cursor positioning.

Definition at line 983 of file shell.tcl.

References shift_up_action().

Referenced by prio_action().

CdgShell::prio_action  )  [private]
 

simply scroll up one page, no cursor positioning.

Definition at line 976 of file shell.tcl.

References next_action().

CdgShell::prompt TclString  value = "cdg> "  ) 
 

itk_option: configure the shell prompt. the actual value will be set to one of -prompt1 or -prompt2

CdgShell::prompt1 TclString  value = "cdg> "  ) 
 

itk_option: configure the shell first prompt

CdgShell::prompt2 TclString  value = "tcltk# "  ) 
 

itk_option: configure the shell second prompt

CdgShell::resetCmd TclList  args  ) 
 

reset commandline.

Definition at line 1038 of file shell.tcl.

Referenced by getCmd().

CdgShell::return_action  )  [private]
 

the return key binding.

Definition at line 507 of file shell.tcl.

CdgShell::safeEval TclCommand  cmd  ) 
 

evaluate a command in the safe interpreter.

Definition at line 322 of file shell.tcl.

Referenced by autotag().

CdgShell::safeSource TclString  file  ) 
 

source the commands in the safe interpreter.

Parameters:
file filename of the file to be read
Definition at line 366 of file shell.tcl.

CdgShell::setCursor TclString  pos  ) 
 

set the insert cursor.

Parameters:
pos a valid tcl text widget index specification.
Definition at line 380 of file shell.tcl.

References insert().

CdgShell::shift_down_action  )  [private]
 

simply scroll down one line, no cursor positioning.

Definition at line 997 of file shell.tcl.

References updateCmd().

Referenced by shift_up_action().

CdgShell::shift_up_action  )  [private]
 

simply scroll up one line, no cursor positioning.

Definition at line 990 of file shell.tcl.

References shift_down_action().

Referenced by next_action().

CdgShell::switch_interp  )  [private]
 

switch interpreter. This method allows you to access the interpreter that executes the XCDG application. Definition at line 1055 of file shell.tcl.

CdgShell::tab_action  )  [private]
 

tab action. This is part of the commandline completion suite. Definition at line 676 of file shell.tcl.

CdgShell::tabtab_action  )  [private]
 

double tab action. This method is part of the commandline completion. Definition at line 609 of file shell.tcl.

CdgShell::triple_1_action TclNumber  x,
TclNumber  y
[private]
 

Triple-1 without changing the insert-position.

Definition at line 964 of file shell.tcl.

CdgShell::up_action  )  [private]
 

step backwards thru the commandline history.

Definition at line 794 of file shell.tcl.

CdgShell::updateCmd TclList  args  ) 
 

expand commandline if needed.

Definition at line 1004 of file shell.tcl.

Referenced by shift_down_action().


Member Data Documentation

TclArray CdgShell::commands [private]
 

array of additional commands

Definition at line 63 of file shell.tcl.

TclNumber CdgShell::completeFlag = 1 [private]
 

boolean flag with 0: command incomplete, 1: complete

Definition at line 49 of file shell.tcl.

TclNumber CdgShell::firstPosition = 0.0 [private]
 

start of the commandline

Definition at line 69 of file shell.tcl.

TclArray CdgShell::history [private]
 

shell command history

Definition at line 38 of file shell.tcl.

TclRef CdgShell::historyIndex [private]
 

index in the shell command history

Definition at line 41 of file shell.tcl.

TclNumber CdgShell::interpFlag = 1 [private]
 

boolean flag with 0: application, 1: safe shell. the ctrl-t key lets you switch between the two interpreters. the application interpreter is the one executing the XCDG Definition at line 54 of file shell.tcl.

TclNumber CdgShell::lastPosition = 0.0 [private]
 

end of the commandline

Definition at line 72 of file shell.tcl.

TclNumber CdgShell::maxIndex = 100
 

the maximum nr of commands stored in the history

Definition at line 45 of file shell.tcl.

TclNumber CdgShell::needsLineFeed = 0 [private]
 

flag indicating wether next insert deletes line

Definition at line 78 of file shell.tcl.

TclString CdgShell::oldBackground = "" [private]
 

temporarily store the old shell background color here

Definition at line 75 of file shell.tcl.

TclString CdgShell::safeInterp = "" [private]
 

interpreter where all commands are executed

Definition at line 57 of file shell.tcl.

TclNumber CdgShell::showTrace = 0
 

flag to show a tcl error trace or not.

Definition at line 34 of file shell.tcl.

TclNumber CdgShell::silentFlag = 0 [private]
 

boolean flag 0: print command result, 1: don't

Definition at line 60 of file shell.tcl.

TclList CdgShell::tagging = {} [private]
 

list of autotag information

Definition at line 66 of file shell.tcl.


The documentation for this class was generated from the following file:
XCDG 0.95 (20 Oct 2004)