\chapter{Shell Script API}

In diesem Kapitel ist die API dargestellt, wie sie f"ur Shell-Script
Programmierer zur Verf"ugung steht. Um die Hintergr"unde zu verstehen
und effizienter arbeiten zu k"onnen, sollte man auch das Kapitel
''Scripting'' gelesen haben.

Damit die hier beschriebenen Funktionen und Konstanten im Script bekannt
sind, sollte die API an oberster Stelle per Source-Include eingebunden
werden. Unter eisfair existiert dazu die Datei ''cuilib'' die unter
''/var/install/include'' abgelegt ist. Einige Programme die eine Script-
Erweiterung haben, k"onnen zus"atzliche include-Dateien anbieten (z.B. die
Datei ''ecelib'' des eisfair Konfigurationseditors), die
unbedingt hinter der allgemeinen API eingebunden werden sollten.

\begin{verbatim}
#!/bin/sh

. /var/install/include/cuilib      # Standard API
. /var/install/include/ecelib      # optional weitere API

exec_dialog()
{
...
}

cui_init
cui_run
\end{verbatim}

\section{Konstanten}

\subsection{Tastatur-, Farb- und Window-Stil- Konstanten}

\subsubsection{Key constants}
\begin{tabular}{l l}
KEY\_ENTER & 10 \\
KEY\_F1 & 265 \\
KEY\_F2 & 266 \\
KEY\_F3 & 267 \\
KEY\_F4 & 268 \\
KEY\_F5 & 269 \\
KEY\_F6 & 270 \\
KEY\_F7 & 271 \\
KEY\_F8 & 272 \\
KEY\_F9 & 273 \\
KEY\_F10 & 274 \\
\end{tabular}

\subsubsection{Color constants}
\begin{tabular}{l l}
COLOR\_BLACK & 0 \\
COLOR\_RED & 1 \\
COLOR\_GREEN & 2 \\
COLOR\_BROWN & 3 \\
COLOR\_BLUE & 4 \\
COLOR\_MAGENTA & 5 \\
COLOR\_CYAN & 6 \\
COLOR\_LIGHTGRAY & 7 \\
COLOR\_DARKGRAY & 8 \\
COLOR\_LIGHTRED & 9 \\
COLOR\_LIGHTGREEN & 10 \\
COLOR\_YELLOW & 11 \\
COLOR\_LIGHTBLUE & 12 \\
COLOR\_LIGHTMAGENTA & 13 \\
COLOR\_LIGHTCYAN & 14 \\
COLOR\_WHITE & 15 \\
\end{tabular}

\subsubsection{Window Styles}
\begin{tabular}{l l}
CWS\_NONE & '0'  \\
CWS\_BORDER & '1' \\
CWS\_CAPTION & '2' \\
CWS\_MINIMIZEBOX & '4' \\
CWS\_MAXIMIZEBOX & '8' \\
CWS\_CLOSEBOX & '16' \\
CWS\_SYSMENU & '32' \\
CWS\_RESIZE & '64' \\
CWS\_HIDDEN & '256' \\
CWS\_DISABLED & '512' \\
CWS\_TABSTOP & '1024' \\
CWS\_CENTERED & '2048' \\
CWS\_POPUP & '4096' \\
CWS\_MAXIMIZED & '8192' \\
CWS\_MINIMIZED & '16384' \\
CWS\_STATUSBAR & '32768' \\
CWS\_DEFOK & '65536' \\
CWS\_DEFCANCEL & '131072' \\
EF\_PASSWORD & '16777216' \\
MF\_AUTOWORDWRAP & '16777216' \\
LB\_SORTED & '16777216' \\
LB\_DESCENDING & '33554432' \\
\end{tabular}

\subsection{Window Hook Konstanten}

\subsubsection{Window Hook Konstanten}
\begin{tabular}{l l}
HOOK\_CREATE & '0'  \\
HOOK\_DESTROY & '1'  \\
HOOK\_CANCLOSE & '2'  \\
HOOK\_INIT & '3'  \\
HOOK\_PAINT & '4'  \\
HOOK\_NCPAINT & '5'  \\
HOOK\_SIZE & '6'  \\
HOOK\_SETFOCUS & '7'  \\
HOOK\_KILLFOCUS & '8'  \\
HOOK\_ACTIVATE & '9'  \\
HOOK\_DEACTIVATE & '10'  \\
HOOK\_KEY & '11'  \\
HOOK\_MMOVE & '12'  \\
HOOK\_MBUTTON & '13'  \\
HOOK\_VSCROLL & '14'  \\
HOOK\_HSCROLL & '15'  \\
HOOK\_TIMER & '16'  \\
\end{tabular}

\subsection{Control Callback Konstanten}

\subsubsection{Edit hook types}
\begin{tabular}{l l}
EDIT\_SETFOCUS & '0' \\
EDIT\_KILLFOCUS & '1' \\
EDIT\_PREKEY & '2' \\
EDIT\_POSTKEY & '3' \\
EDIT\_CHANGED & '4' \\
\end{tabular}

\subsubsection{Label hook types}
\begin{tabular}{l l}
LABEL\_SETFOCUS & '0' \\
LABEL\_KILLFOCUS & '1' \\
\end{tabular}

\subsubsection{Button hook types}
\begin{tabular}{l l}
BUTTON\_SETFOCUS & '0' \\
BUTTON\_KILLFOCUS & '1' \\
BUTTON\_PREKEY & '2' \\
BUTTON\_POSTKEY & '3' \\
BUTTON\_CLICKED & '4' \\
\end{tabular}

\subsubsection{Radio hook types}
\begin{tabular}{l l}
RADIO\_SETFOCUS & '0' \\
RADIO\_KILLFOCUS & '1' \\
RADIO\_PREKEY & '2' \\
RADIO\_POSTKEY & '3' \\
RADIO\_CLICKED & '4' \\
\end{tabular}

\subsubsection{Checkbox hook types}
\begin{tabular}{l l}
CHECKBOX\_SETFOCUS & '0' \\
CHECKBOX\_KILLFOCUS & '1' \\
CHECKBOX\_PREKEY & '2' \\
CHECKBOX\_POSTKEY & '3' \\
CHECKBOX\_CLICKED & '4' \\
\end{tabular}

\subsubsection{Listbox hook types}
\begin{tabular}{l l}
LISTBOX\_SETFOCUS & '0' \\
LISTBOX\_KILLFOCUS & '1' \\
LISTBOX\_PREKEY & '2' \\
LISTBOX\_POSTKEY & '3' \\
LISTBOX\_CHANGED & '4' \\
LISTBOX\_CHANGING & '5' \\
LISTBOX\_CLICKED & '6' \\
\end{tabular}

\subsubsection{Combobox hook types}
\begin{tabular}{l l}
COMBOBOX\_SETFOCUS & '0' \\
COMBOBOX\_KILLFOCUS & '1' \\
COMBOBOX\_PREKEY & '2' \\
COMBOBOX\_POSTKEY & '3' \\
COMBOBOX\_CHANGED & '4' \\
COMBOBOX\_CHANGING & '5' \\
\end{tabular}

\subsubsection{Textview hook types}
\begin{tabular}{l l}
TEXTVIEW\_SETFOCUS & '0' \\
TEXTVIEW\_KILLFOCUS & '1' \\
TEXTVIEW\_PREKEY & '2' \\
TEXTVIEW\_POSTKEY & '3' \\
\end{tabular}

\subsubsection{Listview hook types}
\begin{tabular}{l l}
LISTVIEW\_SETFOCUS & '0' \\
LISTVIEW\_KILLFOCUS & '1' \\
LISTVIEW\_PREKEY & '2' \\
LISTVIEW\_POSTKEY & '3' \\
LISTVIEW\_CHANGED & '4' \\
LISTVIEW\_CHANGING & '5' \\
LISTVIEW\_CLICKED & '6' \\
\end{tabular}

\subsubsection{Memo hook types}
\begin{tabular}{l l}
MEMO\_SETFOCUS & '0' \\
MEMO\_KILLFOCUS & '1' \\
MEMO\_PREKEY & '2' \\
MEMO\_POSTKEY & '3' \\
MEMO\_CHANGED & '4' \\
\end{tabular}

\subsubsection{Terminal hook types}
\begin{tabular}{l l}
TERMINAL\_SETFOCUS & '0' \\
TERMINAL\_KILLFOCUS & '1' \\
TERMINAL\_PREKEY & '2' \\
TERMINAL\_POSTKEY & '3' \\
TERMINAL\_EXIT & '4' \\
\end{tabular}

\subsubsection{Menu hook types}
\begin{tabular}{l l}
MENU\_SETFOCUS & '0' \\
MENU\_KILLFOCUS & '1' \\
MENU\_PREKEY & '2' \\
MENU\_POSTKEY & '3' \\
MENU\_CHANGED & '4' \\
MENU\_CHANGING & '5' \\
MENU\_CLICKED & '6' \\
MENU\_ESCAPE & '7' \\
\end{tabular}


\subsection{MessageBox- und Dialogkonstanten}

\subsubsection{MessageBox Styles}
\begin{tabular}{l l}
MB\_NORMAL & '0' \\
MB\_INFO & '16777216' \\
MB\_ERROR & '33554432' \\
MB\_OK & '0' \\
MB\_OKCANCEL & '67108864' \\
MB\_YESNO & '134217728' \\
MB\_YESNOCANCEL & '268435456' \\
MB\_RETRYCANCEL & '536870912' \\
MB\_DEFBUTTON1 & '1073741824' \\
MB\_DEFBUTTON2 & '2147483648' \\
\end{tabular}

\subsubsection{Dialog result codes}
\begin{tabular}{l l}
IDOK & '1' \\
IDCANCEL & '2' \\
IDYES & '3' \\
IDNO & '4' \\
IDRETRY & '5' \\
\end{tabular}

\subsubsection{Scroll bar control codes}
\begin{tabular}{l l}
SB\_LINEDOWN & '1' \\
SB\_LINEUP & '2' \\
SB\_PAGEDOWN & '3' \\
SB\_PAGEUP & '4' \\
SB\_THUMBTRACK & '5' \\
\end{tabular}

% ****************************************************************************
% General Window API
% ****************************************************************************

\section{General Window API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_message()}           &   MessageBox. \\
\hline
\texttt{ cui\_window\_new()}       &   Create new window instance. \\
\hline
\texttt{ cui\_window\_create()}    &   Create window (and make it visible). \\
\hline
\texttt{ cui\_window\_destroy()}   &   Destroy window (and it's data). \\
\hline
\texttt{ cui\_window\_quit()}      &   Quit application. \\
\hline
\texttt{ cui\_window\_modal()}     &   Execute as modal dialog. \\
\hline
\texttt{ cui\_window\_close()}     &   Close a modal dialog. \\
\hline
\texttt{ cui\_window\_sethook()}   &   Assign a window hook. \\
\hline
\texttt{ cui\_window\_getctrl()}   &   Get a control window. \\
\hline
\texttt{ cui\_getdesktop()}        &   Get desktop window. \\
\hline
\texttt{ cui\_window\_move()}      &   Move and/or resize a window. \\
\hline
\texttt{ cui\_getwindowrect()}     &   Get a window's rectangle. \\
\hline
\texttt{ cui\_getclientrect()}     &   Get a window's client rectangle. \\
\hline
\texttt{ cui\_settimer()}          &   Start a window timer. \\
\hline
\texttt{ cui\_killtimer()}         &   Stop a window timer. \\
\hline
\texttt{ cui\_addcolors()}         &   Add/Modify a color profile. \\
\hline
\texttt{ cui\_hascolors()}         &   Check if color profile has been defined. \\
\hline
\texttt{ cui\_window\_setcolors()} &   Assign a color profile to a window. \\
\hline
\texttt{ cui\_window\_settext()}   &   Set window text. \\
\hline
\texttt{ cui\_window\_setltext()}  &   Set window left text. \\
\hline
\texttt{ cui\_window\_setrtext()}  &   Set window right text. \\
\hline
\texttt{ cui\_window\_setltext()}  &   Set window left text. \\
\hline
\texttt{ cui\_window\_setstatustext()}   &   Set window left text. \\
\hline
\texttt{ cui\_window\_setltext()}  &   Set window status text. \\
\hline
\texttt{ cui\_window\_setlstatustext()}  &   Set window left status text. \\
\hline
\texttt{ cui\_window\_setrstatustext()}  &   Set window right status text. \\
\hline
\texttt{ cui\_window\_totop()}  &   Bring window to top. \\
\hline
\texttt{ cui\_window\_maximize()}  &   Maximize window (and reverse). \\
\hline
\texttt{ cui\_window\_minimize()}  &   Minimize window (and reverse). \\
\hline
\texttt{ cui\_window\_hide()}  &  Hide window (and reverse). \\
\hline
\texttt{ cui\_window\_enable()}  &   Enable window (and reverse). \\
\hline
\texttt{ cui\_window\_invalidate()}  &   Invalidate window and force redrawing. \\
\hline
\texttt{ cui\_update()}  &   Update window stack. \\
\hline
\texttt{ cui\_leave\_curses()} & Leave curses mode. \\
\hline
\texttt{ cui\_resume\_curses()} & Resume curses mode. \\
\hline
\texttt{ cui\_shell\_execute()} & Execute shell script. \\
\hline
\end{tabularx}

\subsection{cui\_message()}
\begin{tabular}{l l l}
Expects: &  \$1  <-- Parent window &: Window Handle \\
         &  \$2  <-- Message       &: String \\
         &  \$3  <-- Title         &: String \\
         &  \$4  <-- Style         &: Integer (use \$MB\_XXX constants) \\
Returns: &  \$p2 --> Result code   &: Integer \\
\end{tabular}

\subsection{cui\_window\_new()}
\begin{tabular}{l l l}
Expects: &  \$1  <-- Parent Window &: Window Handle \\
         &  \$2  <-- X             &: Integer \\
         &  \$3  <-- Y             &: Integer \\
         &  \$4  <-- W             &: Integer \\
         &  \$5  <-- H             &: Integer \\
         &  \$6  <-- Style         &: Integer (use \$CWS\_XXX constants) \\
Returns: &  \$p2 --> New Window    &: Window Handle \\
\end{tabular}

\subsection{cui\_message()}
\begin{tabular}{l l l}
Expects: &  \$1  <-- Parent Window &: Window Handle \\
         &  \$2  <-- Message       &: String \\
         &  \$3  <-- Title         &: String \\
         &  \$4  <-- Style         &: Integer (use \$MB\_XXX constants) \\
Returns: &  \$p2 --> Result code   &: Integer \\
\end{tabular}

\subsection{cui\_window\_new()}
\begin{tabular}{l l l}
Expects: &  \$1  <-- Parent Window &: Window Handle \\
         &  \$2  <-- X             &: Integer \\
         &  \$3  <-- Y             &: Integer \\
         &  \$4  <-- W             &: Integer \\
         &  \$5  <-- H             &: Integer \\
         &  \$6  <-- Style         &: Integer (use \$CWS\_XXX constants) \\
Returns: &  \$p2 --> New Window    &: Window Handle \\
\end{tabular}

\subsection{cui\_window\_create()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_destroy()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_quit()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Exit code      &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_modal()}
\begin{tabular}{l l l}
Expects:  & \$1  <-- Window        &: Window Handle \\
Returns:  & \$p2 --> Result code   &: Integer \\
\end{tabular}

\subsection{cui\_window\_close()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Result code    &: Integer \\
Returns: & \$p2 --> "1" success    &: ''0'' no success (refused to close) \\
\end{tabular}

\subsection{cui\_window\_sethook()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_getctrl()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Ctrl ID        &: Integer \\
Returns: & \$p2 --> Ctrl           &: Window Handle or ''0'' if not found \\
\end{tabular}

\subsection{cui\_getdesktop()}
\begin{tabular}{l l l}
Expects: & <nothing> & \\
Returns: & \$p2 --> Desktop        &: Window Handle \\
\end{tabular}

\subsection{cui\_window\_move()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- X              &: Integer \\
         & \$3  <-- Y              &: Integer \\
         & \$4  <-- W              &: Integer \\
         & \$5  <-- H              &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_getwindowrect()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> X              &: Integer \\
         & \$p3 --> Y              &: Integer \\
         & \$p4 --> W              &: Integer \\
         & \$p5 --> H              &: Integer \\
\end{tabular}

\subsection{cui\_getclientrect()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> X              &: Integer \\
         & \$p3 --> Y              &: Integer \\
         & \$p4 --> W              &: Integer \\
         & \$p5 --> H              &: Integer \\
\end{tabular}

\subsection{cui\_settimer()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- TimerId        &: Integer \\
         & \$3  <-- Time           &: Integer (Milliseconds 100ms resolution) \\
Returns: & <nothing>  & \\
\end{tabular}

\subsection{cui\_killtimer()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- TimerId        &: Integer \\
Returns: & <nothing>  & \\
\end{tabular}

\subsection{cui\_addcolors()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Name           &: Window Handle \\
         & \$2  <-- WndColor       &: Integer (COLOR\_XXX) \\
         & \$3  <-- WndSelColor    &: Integer (COLOR\_XXX) \\
         & \$4  <-- WndTxtColor    &: Integer (COLOR\_XXX) \\
         & \$5  <-- SelTxtColor    &: Integer (COLOR\_XXX) \\
         & \$6  <-- InactTxtColor  &: Integer (COLOR\_XXX) \\
         & \$7  <-- HilightColor   &: Integer (COLOR\_XXX) \\
         & \$8  <-- TitleTxtColor  &: Integer (COLOR\_XXX) \\
         & \$9  <-- TitleBkgndColor   &: Integer (COLOR\_XXX) \\
         & \$10 <-- StatusTxtColor    &: Integer (COLOR\_XXX) \\
         & \$11 <-- StatusBkgndColor  &: Integer (COLOR\_XXX) \\
         & \$12 <-- BorderColor    &: Integer (COLOR\_XXX) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_hascolors()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Name           &: Name of profile \\
Returns: & \$p2 --> Result         &: Integer (0 = not defined, 1 = defined) \\
\end{tabular}

\subsection{cui\_window\_setcolors()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Name           &: Name of profile \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_settext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_setltext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_setrtext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_setstatustext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_setlstatustext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_setrstatustext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: Window text \\
Returns: & <nothing> & \\
\end{tabular}


\subsection{cui\_window\_totop()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_maximize()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- State          &: 1 = maximize, 0 = normal \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_minimize()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- State          &: 1 = minimized, 0 = normal \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_hide()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- State          &: 1 = hidden, 0 = normal \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_enable()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- State          &: 1 = enabled (default), 0 = disabled \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_window\_invalidate()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_update()}
\begin{tabular}{l l l}
Expects: & <nothing> & \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_leave\_curses()}
\begin{tabular}{l l l}
Expects: & <nothing> & \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_resume\_curses()}
\begin{tabular}{l l l}
Expects: & <nothing> & \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_shell\_execute()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Shell command  &: String \\
Returns: & <nothing> & \\
\end{tabular}


% ****************************************************************************
% Edit Control API
% ****************************************************************************

\section{Edit Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_edit\_new()}         &   Make new edit. \\
\hline
\texttt{ cui\_edit\_callback()}    &   Assign a edit callback. \\
\hline
\texttt{ cui\_edit\_settext()}     &   Set edit text. \\
\hline
\texttt{ cui\_edit\_gettext()}     &   Get edit text. \\
\hline
\end{tabularx}


\subsection{cui\_edit\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- Len            &: Integer \\
         & \$8  <-- ID             &: Integer \\
         & \$9  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$10 <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_edit\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_edit\_settext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: String \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_edit\_gettext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Text           &: String \\
\end{tabular}


% ****************************************************************************
% Label Control API
% ****************************************************************************

\section{Label Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_label\_new()}        &   Make new label. \\
\hline
\texttt{ cui\_label\_callback()}   &   Assign a label callback. \\
\hline
\end{tabularx}

\subsection{cui\_label\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_label\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}


% ****************************************************************************
% Button Control API
% ****************************************************************************

\section{Button Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_button\_new()}       &   Make new button. \\
\hline
\texttt{ cui\_button\_callback()}  &   Assign a button callback. \\
\hline
\end{tabularx}

\subsection{cui\_button\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_button\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 		: Window Handle \\
         & \$2  <-- Hook   		: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target 		: Window Handle \\
         & \$4  <-- Proc   		: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

% ****************************************************************************
% Groupbox Control API
% ****************************************************************************

\section{Groupbox Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_groupbox\_new()}     &   Make new groupbox. \\
\hline
\end{tabularx}

\subsection{cui\_groupbox\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$8  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}


% ****************************************************************************
% Radio Control API
% ****************************************************************************

\section{Radio Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_radio\_new()}        &   Make new radio control. \\
\hline
\texttt{ cui\_radio\_callback()}   &   Assign a radio callback. \\
\hline
\texttt{ cui\_radio\_setcheck()}   &   Set radio check status. \\
\hline
\texttt{ cui\_radio\_getcheck()}   &   Get radio check status. \\
\hline
\end{tabularx}

\subsection{cui\_radio\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_radio\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_radio\_setcheck()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window        &: Window Handle \\
         & \$2  <-- Value         &: Integer (0 or 1) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_radio\_getcheck()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window        &: Window Handle \\
Returns: & \$p2 --> Value         &: Integer (0 or 1) \\
\end{tabular}


% ****************************************************************************
% Checkbox Control API
% ****************************************************************************

\section{Checkbox Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_checkbox\_new()}      &   Make new checkbox control. \\
\hline
\texttt{ cui\_checkbox\_callback()} &   Assign a checkbox callback. \\
\hline
\texttt{ cui\_checkbox\_setcheck()} &   Set checkbox check status. \\
\hline
\texttt{ cui\_checkbox\_getcheck()} &   Get checkbox check status. \\
\hline
\end{tabularx}

\subsection{cui\_checkbox\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_checkbox\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_checkbox\_setcheck()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Value          &: Integer (0 or 1) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_checkbox\_getcheck()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Value          &: Integer (0 or 1) \\
\end{tabular}


% ****************************************************************************
% Listbox Control API
% ****************************************************************************

\section{Listbox Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_listbox\_new()}       &   Make new listbox control. \\
\hline
\texttt{ cui\_listbox\_callback()}  &   Assign a listbox callback. \\
\hline
\texttt{ cui\_listbox\_add()}       &   Add string to listbox. \\
\hline
\texttt{ cui\_listbox\_delete()}    &   Delete string from listbox. \\
\hline
\texttt{ cui\_listbox\_get()}       &   Get string from listbox. \\
\hline
\texttt{ cui\_listbox\_adddata()}   &   Assign data to listbox item. \\
\hline
\texttt{ cui\_listbox\_getdata()}   &   Read data from listbox item. \\
\hline
\texttt{ cui\_listbox\_setsel()}    &   Set current selection. \\
\hline
\texttt{ cui\_listbox\_getsel()}    &   Get current selection. \\
\hline
\texttt{ cui\_listbox\_clear()}     &   Clear listbox content. \\
\hline
\texttt{ cui\_listbox\_getcount()}  &   Get number of items in listbox. \\
\hline
\texttt{ cui\_listbox\_select()}    &   Select string in listbox. \\
\hline
\end{tabularx}

\subsection{cui\_listbox\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_listbox\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listbox\_add()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Value          &: String \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}

\subsection{cui\_listbox\_delete()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listbox\_get()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & \$p2 --> Value          &: String \\
\end{tabular}

\subsection{cui\_listbox\_adddata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
         & \$3  <-- Data           &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listbox\_getdata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & \$p2 --> Data           &: Integer \\
\end{tabular}

\subsection{cui\_listbox\_setsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listbox\_getsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}

\subsection{cui\_listbox\_clear()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listbox\_getcount()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> NumItems       &: Integer \\
\end{tabular}

\subsection{cui\_listbox\_select()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- String         &: String to select \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}


% ****************************************************************************
% Combobox Control API
% ****************************************************************************

\section{Combobox Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_combobox\_new()}      &   Make new combobox control. \\
\hline
\texttt{ cui\_combobox\_callback()} &   Assign a combobox callback. \\
\hline
\texttt{ cui\_combobox\_add()}      &   Add string to combobox. \\
\hline
\texttt{ cui\_combobox\_delete()}   &   Delete string from combobox. \\
\hline
\texttt{ cui\_combobox\_get()}      &   Get string from combobox. \\
\hline
\texttt{ cui\_combobox\_adddata()}  &   Assign data to combobox item. \\
\hline
\texttt{ cui\_combobox\_getdata()}  &   Read data from combobox item. \\
\hline
\texttt{ cui\_combobox\_setsel()}   &   Set current selection. \\
\hline
\texttt{ cui\_combobox\_getsel()}   &   Get current selection. \\
\hline
\texttt{ cui\_combobox\_clear()}    &   Clear combobox content. \\
\hline
\texttt{ cui\_combobox\_getcount()} &   Get number of items in combobox. \\
\hline
\texttt{ cui\_combobox\_select()}    &   Select string in the combobox. \\
\hline
\end{tabularx}

\subsection{cui\_combobox\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- X              &: Integer \\
         & \$3  <-- Y              &: Integer \\
         & \$4  <-- W              &: Integer \\
         & \$5  <-- H              &: Integer \\
         & \$6  <-- ID             &: Integer \\
         & \$7  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$8  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_combobox\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_combobox\_add()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Value  	       &: String \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}

\subsection{cui\_combobox\_delete()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index  	       &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_combobox\_get()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & \$p2 --> Value          &: String \\
\end{tabular}

\subsection{cui\_combobox\_adddata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
         & \$3  <-- Data           &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_combobox\_getdata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index  	       &: Integer \\
Returns: & \$p2 --> Data           &: Integer \\
\end{tabular}

\subsection{cui\_combobox\_setsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Index          &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_combobox\_getsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}

\subsection{cui\_combobox\_clear()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_combobox\_getcount()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> NumItems       &: Integer \\
\end{tabular}

\subsection{cui\_combobox\_select()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- String         &: String to select \\
Returns: & \$p2 --> Index          &: Integer \\
\end{tabular}


% ****************************************************************************
% ProgressBar Control API
% ****************************************************************************

\section{ProgressBar Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_progress\_new()}      &   Make new progress bar control. \\
\hline
\texttt{ cui\_progress\_setrange()} &   Set bar range. \\
\hline
\texttt{ cui\_progress\_setpos()}   &   Set bar pos. \\
\hline
\texttt{ cui\_progress\_getrange()} &   Get bar range. \\
\hline
\texttt{ cui\_progress\_getpos()}   &   Get bar pos. \\
\hline
\end{tabularx}

\subsection{cui\_progress\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Title          &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_progress\_setrange()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Range          &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_progress\_setpos()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Pos            &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_progress\_getrange()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Range          &: Integer \\
\end{tabular}

\subsection{cui\_progress\_getpos()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Pos            &: Integer \\
\end{tabular}


% ****************************************************************************
% Textview Control API
% ****************************************************************************

\section{Textview Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_textview\_new()}      &   Make new textview control. \\
\hline
\texttt{ cui\_textview\_callback()} &   Assign a textview callback. \\
\hline
\texttt{ cui\_textview\_wordwrap()} &   Enable word wrap. \\
\hline
\texttt{ cui\_textview\_add()}      &   Add string to textview. \\
\hline
\texttt{ cui\_textview\_clear()}    &   Clear text view. \\
\hline
\texttt{ cui\_textview\_read()}     &   Read a file. \\
\hline
\texttt{ cui\_textview\_search()}   &   Search within textview. \\
\hline
\end{tabularx}

\subsection{cui\_textview\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Title          &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_textview\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_textview\_wordwrap()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Enable?        &: Integer (0 or 1) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_textview\_add()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Value          &: String \\
         & \$3  <-- Update         &: Flag (1 = update view, 0 = no update) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_textview\_clear()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Value          &: String \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_textview\_read()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Filename       &: String \\
Returns: & \$p2 --> Success        &: Integer (0 = failed, 1 = success) \\
\end{tabular}

\subsection{cui\_textview\_search()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- SearchStr      &: String \\
         & \$3  <-- WholeWord      &: Integer (0 or 1) \\
         & \$4  <-- CaseSense      &: Integer (0 or 1) \\
         & \$5  <-- Down           &: Integer (0 or 1) \\
Returns: & \$p2 --> Success        &: Integer (0 = failed, 1 = success) \\
\end{tabular}


% ****************************************************************************
% Listview Control API
% ****************************************************************************

\section{Listview Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_listview\_new()}      &   Make new listview control. \\
\hline
\texttt{ cui\_listview\_callback()} &   Assign a listview callback. \\
\hline
\texttt{ cui\_listview\_setcoltext()} &  Set listview column titel. \\
\hline
\texttt{ cui\_listview\_clear()}    &   Clear listview data. \\
\hline
\texttt{ cui\_listview\_add()}      &   Add a new (empty) record to the list view (must be populated with data using cui\_listview\_settext) \\
\hline
\texttt{ cui\_listview\_settext()}  &   Assign text data to listview record. \\
\hline
\texttt{ cui\_listview\_gettext()}  &   Get text data assigned listview record. \\
\hline
\texttt{ cui\_listview\_setdata()}  &   Assign integer data to listview record. \\
\hline
\texttt{ cui\_listview\_getdata()}  &   Get integer data from listview record. \\
\hline
\texttt{ cui\_listview\_setsel()}   &   Set current selection in listview control. \\
\hline
\texttt{ cui\_listview\_getsel()}   &   Get current selection of listview control. \\
\hline
\texttt{ cui\_listview\_getcount()} &   Get number of records in listview control. \\
\hline
\texttt{ cui\_listview\_update()}   &   Update listview visual display after modifying data. \\
\hline
\end{tabularx}

\subsection{cui\_listview\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Title          &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- Num columns    &: Integer \\
         & \$8  <-- ID             &: Integer \\
         & \$9  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$10 <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_listview\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_setcoltext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	       &: Window Handle \\
         & \$2  <-- Col-No         &: Integer \\
         & \$3  <-- Text           &: String \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_clear()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_add()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Index of new record &: Integer \\
\end{tabular}

\subsection{cui\_listview\_settext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Rec. index     &: Integer (returned by cui\_listview\_add) \\
         & \$3  <-- Col. index     &: Integer (0 | 1 | ... | cols - 1) \\
         & \$4  <-- Text           &: String \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_gettext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Rec. index 	   &: Integer (returned by cui\_listview\_add) \\
         & \$3  <-- Col. index     &: Integer (0 | 1 | ... | cols - 1) \\
Returns: & \$p2 --> Text           &: String \\
\end{tabular}

\subsection{cui\_listview\_setdata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Rec. index     &: Integer (returned by cui\_listview\_add) \\
         & \$3  <-- Data           &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_getdata()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Rec. index     &: Integer (returned by cui\_listview\_add) \\
Returns: & \$p2 --> Data           &: Integer \\
\end{tabular}

\subsection{cui\_listview\_setsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Rec. index     &: Integer (returned by cui\_listview\_add) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_listview\_getsel()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Sel. index     &: Integer (-1 if not selected) \\
\end{tabular}

\subsection{cui\_listview\_getcount()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window     	   &: Window Handle \\
Returns: & \$p2 --> Count          &: Integer \\
\end{tabular}

\subsection{cui\_listview\_update()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}


% ****************************************************************************
% Memo Control API (multi line edit)
% ****************************************************************************

\section{Memo Control API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_memo\_new()}         &   Make new memo. \\
\hline
\texttt{ cui\_memo\_callback()}    &   Assign a memo callback. \\
\hline
\texttt{ cui\_memo\_settext()}     &   Set memo text. \\
\hline
\texttt{ cui\_memo\_gettext()}     &   Get memo text. \\
\hline
\end{tabularx}


\subsection{cui\_memo\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Window title   &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_memo\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_memo\_settext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: String \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_memo\_gettext()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> Text           &: String \\
\end{tabular}

\subsection{cui\_memo\_setwrapcolumns()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Column         &: String \\
Returns: & <nothing> & \\
\end{tabular}


% ****************************************************************************
% Terminal Window API
% ****************************************************************************

\section{Terminal Window API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_terminal\_new()}      &   Make new terminal control. \\
\hline
\texttt{ cui\_terminal\_callback()} &   Assign a terminal callback. \\
\hline
\texttt{ cui\_terminal\_write()}    &   Write text into the terminal window. \\
\hline
\texttt{ cui\_terminal\_run()}      &   Run a command within the terminal window. \\
\hline
\texttt{ cui\_terminal\_pipe()}     &   Pipe text data to the running co process. \\
\hline
\end{tabularx}


\subsection{cui\_terminal\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Title          &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_terminal\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	      &: Window Handle \\
         & \$2  <-- Hook   	      &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target        &: Window Handle \\
         & \$4  <-- Proc          &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_terminal\_write()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	     &: Window Handle \\
         & \$2  <-- Text         &: String \\
         & \$3  <-- DoUpdate     &: Integer \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_terminal\_run()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window       &: Window Handle \\
         & \$2  <-- Text         &: String \\
Returns: & \$p2 --> Success      &: Integer (0 or 1 !not the exit code of the process!) \\
\end{tabular}

\subsection{cui\_terminal\_pipe()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window 	     &: Window Handle \\
         & \$2  <-- Text         &: String \\
Returns: & <nothing> & \\
\end{tabular}


% ****************************************************************************
% Menu Window API
% ****************************************************************************

\section{Menu Window API}

\begin{tabularx}{\textwidth}[t]{|X|X|}
\hline
\bf{Funktion}& \bf{Beschreibung}\\
\hline
\texttt{ cui\_menu\_new()}          &   Make new menu control. \\
\hline
\texttt{ cui\_menu\_callback()}     &   Assign a menu callback. \\
\hline
\texttt{ cui\_menu\_additem()}      &   Add a menu item. \\
\hline
\texttt{ cui\_menu\_addseparator()} &   Add a menu separator. \\
\hline
\texttt{ cui\_menu\_selitem()}      &   Select menu item. \\
\hline
\texttt{ cui\_menu\_getselitem()}   &   Get selected menu item. \\
\hline
\texttt{ cui\_menu\_clear()}        &   Clear menu. \\
\hline
\end{tabularx}

\subsection{cui\_menu\_new()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Parent Window  &: Window Handle \\
         & \$2  <-- Title          &: String \\
         & \$3  <-- X              &: Integer \\
         & \$4  <-- Y              &: Integer \\
         & \$5  <-- W              &: Integer \\
         & \$6  <-- H              &: Integer \\
         & \$7  <-- ID             &: Integer \\
         & \$8  <-- Set style      &: Integer (use \$CWS\_XXX constants) \\
         & \$9  <-- Clear style    &: Integer (use \$CWS\_XXX constants) \\
Returns: & \$p2 --> New Window     &: Window Handle \\
\end{tabular}

\subsection{cui\_menu\_callback()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Hook           &: Integer (use \$HOOK\_XXX constants) \\
         & \$3  <-- Target         &: Window Handle \\
         & \$4  <-- Proc           &: String (name of shell function) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_menu\_additem()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Text           &: String \\
         & \$3  <-- Id     	       &: Item id \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_menu\_addseparator()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window        &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_menu\_selitem()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
         & \$2  <-- Id     	       &: Integer (item id) \\
Returns: & <nothing> & \\
\end{tabular}

\subsection{cui\_menu\_getselitem()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & \$p2 --> ItemId         &: Integer \\
\end{tabular}

\subsection{cui\_menu\_clear()}
\begin{tabular}{l l l}
Expects: & \$1  <-- Window         &: Window Handle \\
Returns: & <nothing> & \\
\end{tabular}



