
% Objective-C Foundation Reference Card (part 3)
% Copyright (c) 2003-2006 Dick van Oudheusden
% TeX Format

% Uncomment the following line for dvi/ps generation: tex ofc-refcard3.tex; dvips -o ofc-refcard3.ps ofc-refcard3.dvi
%\input outopt.tex

% Uncomment the following three lines for PDF generation: pdftex ofc-refcard3.tex
\pdfoutput=1
\pdfpageheight=21cm
\pdfpagewidth=29.7cm

% Font definitions
\font\bigbf=cmb12
\font\smallbf=cmb10
\font\smallrm=cmr8
\font\smalltt=cmtt8
\font\smallit=cmmi8
\font\tinyit=cmmi5

\def\cm#1#2{{\smalltt#1}\dotfill{\smallrm#2}\par}
\def\cn#1{\hfill{\smallrm$\lfloor$ #1}\par}
\def\cl#1#2{\hskip 12pt$\lfloor${\smalltt#1}\dotfill{\smallrm#2}\par}
\def\sect#1{\vskip 0.7cm \hfil{\smallbf#1}\hfil\par}
\def\para#1{{\smallit#1}\par}
\def\note#1{{$\smallrm$Note: #1}\par}
\def\vsep{\vskip 6pt}

% Characters definitions
\def\bs{$\backslash$}
\def\backspace{$\leftarrow$}
\def\ctrl{{\rm\char94}\kern-1pt}
\def\enter{$\hookleftarrow$}
\def\or{\thinspace{\tinyit{or}}\thinspace}
\def\key#1{$\langle${\rm{\it#1}}$\rangle$}
\def\rapos{\char125}
\def\lapos{\char123}
\def\bs{\char92}
\def\tild{\char126}

% Three columns definitions
\parindent 0pt
%\nopagenumbers
\hoffset=-1.56cm
\voffset=-1.54cm
\newdimen\fullhsize
\fullhsize=27.9cm
\hsize=8.5cm
\vsize=19cm
\def\fullline{\hbox to\fullhsize}
\let\lr=L
\newbox\leftcolumn
\newbox\midcolumn
\output={
  \if L\lr
    \global\setbox\leftcolumn=\columnbox
    \global\let\lr=M
  \else\if M\lr
    \global\setbox\midcolumn=\columnbox
    \global\let\lr=R
  \else
    \tripleformat
    \global\let\lr=L
  \fi\fi
  \ifnum\outputpenalty>-20000
  \else
    \dosupereject
  \fi}
\def\tripleformat{
  \shipout\vbox{\fullline{\box\leftcolumn\hfil\box\midcolumn\hfil\columnbox}}
  \advancepageno}
\def\columnbox{\leftline{\pagebody}}

% Card content
% Header
%\hrule\vskip 3pt
\hfil{\bf OBJECTIVE-C FOUNDATION CLASSES}\hfil\par
\hfil{\bf REFERENCE CARD}\hfil\par
\hfil{\bf Part 3: Wrappers}\hfil\par
\vskip 2pt\hrule

\sect{DAtExit}
\para{Methods}
\cm{+ add :(id) obj}{Add object to be freed during exit}
\cm{+ remove :(id) obj}{Remove object from being freed during exit}

\sect{DCRC32}
\para{Methods}
\cm{- init}{Init to start crc}
\cm{- init :(char *) cstring}{Init and update with cstring}
\cm{- init :(uchar *) data :(ulong) length}{}
\cn{Init and update with data}
\cm{- update :(char *) cstring}{Calculate crc on cstring}
\cm{- update :(uchar *) data :(ulong) length}{}
\cn{Calculate crc on data}
\cm{- (unsigned long) crc32}{Return the crc32 value}

\sect{DDbm}
\para{Methods}
\cm{- init}{Init without database}
\cm{- init :(char *) name :(char *) mode}{Init with database}
\cm{- free}{Close database and free object}
\cm{- (BOOL) isOpen}{Check for open database}
\cm{- (BOOL) isReadOnly}{Check for read only database}
\cm{- (int) error}{Return last error}
\cm{- (BOOL) open :(char *) name :(char *) mode}{Open database}
\cm{- (BOOL) insert :(void*) key :(uint) klen :(void*) data}{}
\cl{:(uint) dlen}{Insert (with replace) the data for the key}
\cm{- (DData *) get :(void*) key :(uint) klen}{}
\cn{Fetch data for key}
\cm{- (BOOL) has :(void *) key :(uint) klen}{Check for key}
\cm{- (BOOL) delete :(void *) key :(uint) klen}{Delete key}
\cm{- (BOOL) reorganize}{Reorganize the database}
\cm{- (DDbm *) close}{Close the database}
\cm{- (DList *) keys}{Return list with all keys in database}
\cm{- (DList *) objects}{Return list with all data in database}

\sect{DDirectory}
\para{Class methods}
\cm{+ (BOOL) isDriveSeparator :(char) ch}{}
\cn{Check for drive separator}
\cm{+ (BOOL) isPathSeparator :(char) ch}{}
\cn{Check for path separator}
\cm{+ (BOOL) create :(char *) path}{Create directory}
\cm{+ (BOOL) move :(char *) path :(char *) newPath}{}
\cn{Move/Rename directory}
\cm{+ (BOOL) delete :(char *) path}{Delete directory}
\cm{+ (DDirectory *) current}{Return current working dir}
\cm{+ (BOOL) current :(char *) path}{Set current dir}
\cm{+ (DDirectory *) temp}{Return temp directory}
\cm{+ (BOOL) exist :(char *) path}{Check if dir exists}
\cm{+ (DList *) childs :(char *) path :(id) filter}{}
\cn{Return names in directory}
\cm{+ (int) error}{Return last error}
\para{Object methods}
\cm{- init}{Init empty directory}
\cm{- init :(char *) path}{Init with directory}
\cm{- shallowCopy}{Copy a directory object}
\cm{- (BOOL) isAbsolute}{Check for absolute path}
\cm{- (BOOL) isEmpty}{Check for empty path}
\cm{- (char) drive}{Return drive letter or EOS}
\cm{- path :(char *) path}{Set directory path}
\cm{- (char *) path}{Get directory path}
\cm{- (char *) name}{Get last directory name}
\cm{- child :(char *) name}{Add subdirectory}
\cm{- (BOOL) parent}{Move to parent directory}
\cm{- (DList *) names}{Split path in list of names}
\cm{- names :(DList *) names}{Build path from names}

\sect{DBZipFile}
\para{Methods}
\cm{- init}{Init to empty file object}
\cm{- init :(char *) name :(char *) mode}{Open bz2 file}
\cm{- init :(char *) name :(char *) mode :(int) small}{}
\cn{Open bz2 file with memory usage indication}
\cm{- free}{Free the object (close the file)}
\cm{- (int) error}{Return the last error}
\cm{- (BOOL) isOpen}{Check for open file}
\cm{- (BOOL) open :(char *) name :(char *) mode}{Open bz2 file}
\cm{- open :(char *) name :(char *) mode :(int) small}{}
\cn{Open bz2 file with memory usage indication}
\cm{- (BOOL) isEof}{Check for end-of-file}
\cm{- (char) readChar}{Read a character}
\cm{- (DText *) readLine}{Read a line}
\cm{- (DText *) readText }{Read all text}
\cm{- (DText *) readText :(long) len}{Read len text}
\cm{- (BOOL) writeChar :(char) ch}{Write character}
\cm{- (BOOL) writeLine :(char *) text}{Write line}
\cm{- (BOOL) writeText :(char *) text}{Write text}
\cm{- (uchar) readByte}{Read a byte}
\cm{- (DData *) readData :(ulong) length}{}
\cn{Read a data string}
\cm{- (ulong) readData :(uchar *) dest :(ulong) len}{}
\cn{Read a data string}
\cm{- (double) readDouble}{Read a double}
\cm{- (long) readLong}{Read a long}
\cm{- (short) readShort}{Read a short}
\cm{- (BOOL) writeByte :(uchar) byte}{Write a byte}
\cm{- (BOOL) writeData :(uchar *) text :(ulong) length}{}
\cn{Write a data string}
\cm{- (BOOL) writeDouble :(double) nr}{Write a double}
\cm{- (BOOL) writeLong :(long) nr}{Write a long}
\cm{- (BOOL) writeShort :(short) nr}{Write a short}
\cm{- (DList *) readLines}{Read all lines in a list}
\cm{- (BOOL) writeLines :(DList *) list}{Write list to file}
\cm{- close}{Close the file}

\sect{DGraphicDrawable}
\para{Methods}
\cm{- init}{Initialise graphic drawable object}
\cm{- shallowCopy}{Copy a graphic drawable object}
\cm{- free}{Free a graphic drawable object}
\cm{- (BOOL) isOpen}{Check if the drawable is open}
\cm{- (int) bezierSteps}{Get the number of bezier steps}
\cm{- bezierSteps :(int) steps}{Set the bezier steps}
\cm{- (int) lineType}{Get the current line type}
\cm{- lineType :(int) type}{Set the line type}
\cm{- (int) dashLength}{Get the current dash length}
\cm{- dashLength :(int) length}{Set the dash length}
\cm{- (unsigned) cursorX}{Get the x-cursor}
\cm{- (unsigned) cursorY}{Get the y-cursor}
\cm{- (BOOL) cursor :(unsigned) x :(unsigned) y}{}
\cn{Set the cursor position}
\cm{- (int) error}{Get the last error}
\cm{- (ulong) tell}{Get current drawable position}
\cm{- (BOOL) seek :(ulong) offset :(int) origin}{}
\cn{Set the drawable position}
\cm{- (BOOL) skip :(unsigned long) offset}{}
\cn{Skip a number of drawable positions}
\cm{- (id) font :(id) font}{Set the current font}
\cm{- (id) font}{Get the current font}
\cm{- (unsigned) maxX}{Get the maximum x-position}
\cm{- (unsigned) height}{Get the height of the drawable}
\cm{- (unsigned) maxY}{Get the maximum y-position}
\cm{- (unsigned) width}{Get the width of the drawable}
\cm{- drawable :(unsigned) width :(unsigned) height}{}
\cn{Set the dimensions of the drawable}
\cm{- (BOOL) isValid :(unsigned) x :(unsigned) y}{}
\cn{Check if cursor position is valid in drawable}
\cm{- (BOOL) clip :(unsigned) minX :(unsigned) minY}{}
\cl{:(unsigned) maxX :(unsigned) maxY}{Set clip area}
\cm{- (BOOL) clip}{Set clip area to full drawable}
\cm{- (unsigned) clipMinY}{Get top clip area}
\cm{- (unsigned) clipMaxY}{Get bottom clip area}
\cm{- (unsigned) clipMinX}{Get left clip area}
\cm{- (unsigned) clipMaxX}{Get right clip area}
\cm{- (BOOL) color :(DColor *) fgc :(DColor *) bgc}{}
\cn{Set fore- and background color}
\cm{- (BOOL) foregroundColor :(DColor *) fgc}{}
\cn{Set foreground color}
\cm{- (DColor *) foregroundColor}{}
\cn{Get foreground color}
\cm{- (BOOL) backgroundColor :(DColor *) bgc}{}
\cn{Set background color}
\cm{- (DColor *) backgroundColor}{}
\cn{Get background color}
\cm{- (BOOL) startDrawing}{Start drawing in drawable}
\cm{- (BOOL) startDrawing :(unsigned) minX :(unsigned) minY}{}
\cl{:(unsigned) maxX :(unsigned) maxY}{}
\cn{Start drawing in clip area}
\cm{- stopDrawing}{Stop drawing in drawable}
\cm{- (BOOL) isDrawing}{Check if drawable in drawing mode}
\cm{- (BOOL) clear}{Clear the drawable}
\cm{- (BOOL) writeText :(char *) text}{Write text in drawable}
\cm{- (BOOL) writeChar :(char) ch}{Write character in drawable}
\cm{- (BOOL) writeLine :(char *) text}{Write line in drawable}
\cm{- (BOOL) writeText :(unsigned) startX :(unsigned) startY}{}
\cl{:(const char *) text}{Write text on position}
\cm{- (BOOL) writeChar :(unsigned) startX :(unsigned) startY}{}
\cl{:(char) ch}{Write character on position}
\cm{- (BOOL) writeImage :(unsigned) startX}{}
\cl{:(unsigned) startY :(id <DImage>) image}{}
\cn{Write image on position}
\cm{- (BOOL) readImage :(unsigned) startX :(unsigned) startY}{}
\cl{:(id <DImage>) image}{Read image from position}
\cm{- (BOOL) drawHLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endX :(int) lineType}{Draw horizontal line}
\cm{- (BOOL) drawHLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endX}{Draw horizontal line}
\cm{- (BOOL) drawHLine : (unsigned) endX}{}
\cn{Draw horizontal line}
\cm{- (BOOL) drawVLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endY :(int) lineType}{Draw vertical line}
\cm{- (BOOL) drawVLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endY}{Draw vertical line}
\cm{- (BOOL) drawVLine :(unsigned) endY}{Draw vertical line}
\cm{- (BOOL) drawLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endX :(unsigned) endY :(int) lineType}{}
\cn{Draw line on drawable}
\cm{- (BOOL) drawLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endX :(unsigned) endY}{Draw line}
\cm{- (BOOL) drawLine :(unsigned) endX :(unsigned) endY}{}
\cn{Draw line on drawable}
\cm{- (BOOL) drawBezierLine :(unsigned) startX}{}
\cl{:(unsigned) startY :(unsigned) strrcX}{}
\cl{:(unsigned) strrcY :(unsigned) endrcX}{}
\cl{:(unsigned) endrcY :(unsigned) endX}{}
\cl{:(unsigned) endY}{Draw bezier line drawable}
\cm{- (BOOL) drawPoint :(unsigned) startX :(unsigned) startY}{}
\cn{Draw point on drawable}
\cm{- (BOOL) drawPoint}{Draw point on current position}
\cm{- (BOOL) blit :(unsigned) startX :(unsigned) startY}{}
\cl{:(DGraphicDrawable *) other :(unsigned) oStrtX}{}
\cl{:(unsigned) oStartY :(unsigned) oEndX}{}
\cl{:(unsigned) oEndY}{Blit to the drawable}

\sect{DGraphicScreen : DGraphicDrawable}
\para{Methods}
\cm{- init}{Initialise an unopened screen}
\cm{- init :(unsigned) width :(unsigned) height}{}
\cl{:(unsigned) bbp :(DColor *) fgc :(DColor *) bgc}{}
\cn{Init and open a graphic screen}
\cm{- free}{Free the object}
\cm{- (id) screenHandler :(id) handler}{Set screen handler}
\cm{- (id) screenHandler}{Get current screen handler}
\cm{- (BOOL) open :(unsigned) width :(unsigned) height}{}
\cl{:(unsigned) bbp :(DColor *) fgc :(DColor *) bgc}{}
\cn{Open a graphic screen}
\cm{- close}{Close the graphic screen}
\cm{- (int) pointer :(int) state}{Set pointer visibility}
\cm{- (BOOL) startDrawing}{Start drawing in screen}
\cm{- stopDrawing}{Stop drawing in screen}
\cm{- (unsigned) waitEvents}{Wait and process events}
\cm{- (unsigned) processEvents}{Process pending events}
\cm{- clearEvents}{Clear pending events}

\sect{DGraphicSurface : DGraphicDrawable}
\para{Methods}
\cm{- init}{Initialise an unopened surface}
\cm{- init :(unsigned) width :(unsigned) height}{}
\cl{:(DColor *) fgc :(DColor *) bgc}{}
\cn{Initialise and open a grapic surface}
\cm{- free}{Free the surface}
\cm{- (BOOL) open :(unsigned) width :(unsigned) height}{}
\cl{:(DColor *) fgc :(DColor *) bgc}{}
\cn{Initialise and open a graphic surface}
\cm{- (DGraphicSurface *) close}{Close the surface}

\sect{DGZipFile}
\para{Constants}
\cm{DGZ\_SEEK\_SET}{Seek from start of file}
\cm{DGZ\_SEEK\_CUR}{Seek from current position}
\cm{DGZ\_DEFAULT}{Default stategy}
\cm{DGZ\_FILTERED}{Filtered data strategy}
\cm{DGZ\_HUFFMAN}{Huffman compression strategy}
\para{Methods}
\cm{- init}{Init to empty file object}
\cm{- init :(char *) name :(char *) mode}{Open file}
\cm{- init :(char *) name :(char *) mode :(int) level}{}
\cl{:(int) strategy}{Open file with level and strategy}
\cm{- free}{Free the object (close the file)}
\cm{- (int) error}{Return the last error}
\cm{- (BOOL) isOpen}{Check for open file}
\cm{- (BOOL) open :(char *) name :(char *) mode}{Open file}
\cm{- open :(char *) name :(char *) mode :(int) level}{}
\cl{:(int) strategy}{Open file with level and strategy}
\cm{- (BOOL) isEof}{Check for end-of-file}
\cm{- (char) readChar}{Read a character}
\cm{- (DText *) readLine}{Read a line}
\cm{- (DText *) readText }{Read all text}
\cm{- (DText *) readText :(long) len}{Read len text}
\cm{- (BOOL) seek :(ulong) off :(int) org}{Move position}
\cm{- (BOOL) skip :(ulong) off}{Skip forward} 
\cm{- (unsigned long) tell}{Return current position}
\cm{- (BOOL) writeChar :(char) ch}{Write character}
\cm{- (BOOL) writeLine :(char *) text}{Write line}
\cm{- (BOOL) writeText :(char *) text}{Write text}
\cm{- (uchar) readByte}{Read a byte}
\cm{- (DData *) readData :(ulong) length}{}
\cn{Read a data string}
\cm{- (ulong) readData :(uchar *) dest :(ulong) len}{}
\cn{Read a data string}
\cm{- (double) readDouble}{Read a double}
\cm{- (long) readLong}{Read a long}
\cm{- (short) readShort}{Read a short}
\cm{- (BOOL) writeByte :(uchar) byte}{Write a byte}
\cm{- (BOOL) writeData :(uchar *) text :(ulong) length}{}
\cn{Write a data string}
\cm{- (BOOL) writeDouble :(double) nr}{Write a double}
\cm{- (BOOL) writeLong :(long) nr}{Write a long}
\cm{- (BOOL) writeShort :(short) nr}{Write a short}
\cm{- (DList *) readLines}{Read all lines in a list}
\cm{- (BOOL) writeLines :(DList *) list}{Write list to file}
\cm{- (BOOL) flush }{Flush the output buffers}
\cm{- close}{Close the file}

\sect{DInet6SocketAddress}
\para{Constants}
\cm{DSA\_AF\_INET6}{Inet6 socket family (IPv6)}
\para{Methods}
\cm{- init}{Init empty inet socket address}
\cm{- init :(ulong) a1 :(ulong) a2 :(ulong) a3 :(ulong) a4}{}
\cl{:(int) port :(ulong) flowInfo :(ulong) scopeId}{}
\cn{Init with IPv6 address}
\cm{- init ::(uchar[16]) address :(int) port :(ulong)}{}
\cl{ flowInfo :(ulong) scopeId}{Init with IPv6 address}
\cm{- (int) error}{Get the last error}
\cm{- (int) family}{Return the family}
\cm{- (void *) sockaddr}{Return the sockaddr struct}
\cm{- (int) size}{Return the size of sockaddr}
\cm{- (int) port}{Return the port of the address}
\cm{- port :(int) port}{Set the port of the address}
\cm{- (DText *) host}{Return the host name}
\cm{- set :(ulong) a1 :(ulong) a2 :(ulong) a3 :(ulong) a4}{}
\cl{:(int) port :(ulong) flowInfo :(ulong) scopeId}{}
\cn{Set with IPv6 address}
\cm{- get :(ulong *) a1 :(ulong *) a2 :(ulong *) a3}{}
\cl{:(ulong *) a4 :(int *) port :(ulong *) flowInfo}{}
\cl{:(ulong *) scopeId}{Get IPv6 address info}
\cm{- set :(uchar[16]) address :(int) port :(ulong)}{}
\cl{ flowInfo :(ulong) scopeId}{Set with IPv6 address}
\cm{- get :(uchar[16]) address :(int *) port :(ulong *)}{}
\cl{ flowInfo :(ulong *) scopeId}{Get IPv6 address info}
\cm{- get16 :(unsigned[8]) address :(int *) port :(ulong *)}{}
\cl{ flowInfo :(ulong *) scopeId}{Get IPv6 address info}
\cm{- (BOOL) host :(char *) name :(int) port :(ulong)}{}
\cl{ flowInfo :(ulong) scopeId}{Set with host}
\cm{- (BOOL) sockaddr :(void *) addr :(int) size}{}
\cn{Set with sockaddr struct}
\cm{- loopback :(int) port :(ulong) flowInfo :(ulong)}{}
\cl{ scopeId}{Set with loopback}
\cm{- any :(int) port :(ulong) flowInfo :(ulong) scopeId}{}
\cn{Set with any address}
\cm{- close}{Close the address}

\sect{DInetSocketAddress}
\para{Constants}
\cm{DSA\_AF\_INET}{Inet socket family}
\para{Methods}
\cm{- init}{Init empty inet socket address}
\cm{- init :(long) address :(int) port}{Init with address}
\cm{- init :(uchar) b1 :(uchar) b2 :(uchar) b3 :(uchar) b4}{}
\cl{:(int) port}{Init with b1.b2.b3.b4}
\cm{- shallowCopy}{Copy the socket address}
\cm{- (int) error}{Get the last error}
\cm{- (int) family}{Return the family}
\cm{- (void *) sockaddr}{Return the sockaddr struct}
\cm{- (int) size}{Return the size of sockaddr}
\cm{- (int) port}{Return the port of the address}
\cm{- port :(int) port}{Set the port of the address}
\cm{- (DText *) host}{Return the host name}
\cm{- set :(ulong) address :(int) port}{Set with address}
\cm{- set :(uchar) b1 :(uchar) b2 :(uchar) b3 :(uchar) b4}{}
\cl{:(int) port}{Set with b1.b2.b3.b4}
\cm{- (int) get :(uchar *) b1 :(uchar *) b2 :(uchar *) b3}{}
\cl{:(uchar *) b4}{Get the inet address}
\cm{- (BOOL) host :(char *) name :(int) port}{Set with host}
\cm{- (BOOL) sockaddr :(void *) addr :(int) size}{}
\cn{Set with sockaddr struct}
\cm{- loopback :(int) port}{Set with loopback}
\cm{- any :(int) port}{Set with any address}
\cm{- broadcast :(int) port}{Set with broadcast address}
\cm{- close}{Close the address}

\sect{DJPEGImage}
\para{Class methods}
\cm{+ (BOOL) isImage :(id) source}{Check for JPEG image}
\para{Methods}
\cm{- init}{Init JPEG image}
\cm{- free}{Free JPEG image}
\cm{- (unsigned) height}{Return image height}
\cm{- (unsigned) width}{Return image width}
\cm{- (unsigned) bytesPerPixel}{Return bytes per pixel }
\cm{- (unsigned) images}{Return number of images }
\cm{- (BOOL) open :(id) srce}{Open object for reading}
\cm{- (BOOL) open :(id) dest :(unsigned) width}{}
\cl{:(unsigned) height :(int) quality}{}
\cn{Open object for writing}
\cm{- (unsigned) readRow :(uchar *) data}{Read row of pixels}
\cm{- (BOOL) writeRow :(uchar *) data :(unsigned) width}{}
\cn{Write row of pixels}
\cm{- (BOOL) close}{Close image object}

\sect{DKey}
\para{Constants}
\cm{DKEY\_NULL}{ctrl-@ key}
\cm{DKEY\_BACKSPACE}{Backspace key}
\cm{DKEY\_ENTER}{Enter key}
\cm{DKEY\_ESCAPE}{Escape key}
\cm{DKEY\_DELETE}{Delete key}
\cm{DKEY\_F1}{Function key 1}
\cm{DKEY\_F2}{Function key 2}
\cm{DKEY\_F3}{Function key 3}
\cm{DKEY\_F4}{Function key 4}
\cm{DKEY\_F5}{Function key 5}
\cm{DKEY\_F6}{Function key 6}
\cm{DKEY\_F7}{Function key 7}
\cm{DKEY\_F8}{Function key 8}
\cm{DKEY\_F9}{Function key 9}
\cm{DKEY\_F10}{Function key 10}
\cm{DKEY\_F11}{Function key 11}
\cm{DKEY\_F12}{Function key 12}
\cm{DKEY\_F13}{Function key 13}
\cm{DKEY\_F14}{Function key 14}
\cm{DKEY\_F15}{Function key 15}
\cm{DKEY\_F16}{Function key 16}
\cm{DKEY\_F17}{Function key 17}
\cm{DKEY\_F18}{Function key 18}
\cm{DKEY\_F19}{Function key 19}
\cm{DKEY\_F20}{Function key 20}
\cm{DKEY\_NUMLOCK}{Numlock key}
\cm{DKEY\_CAPSLOCK}{Capslock key}
\cm{DKEY\_SCROLLLOCK}{Scroll key}
\cm{DKEY\_SHIFT}{Shift key}
\cm{DKEY\_CTRL}{Control key}
\cm{DKEY\_ALT}{Alt key}
\cm{DKEY\_UP}{Up arrow key}
\cm{DKEY\_DOWN}{Down arrow key}
\cm{DKEY\_RIGHT}{Right arrow key}
\cm{DKEY\_LEFT}{Left arrow key}
\cm{DKEY\_INSERT}{Insert key}
\cm{DKEY\_HOME}{Home key}
\cm{DKEY\_END}{End key}
\cm{DKEY\_PAGEUP}{Page up key}
\cm{DKEY\_PAGEDOWN}{Page down key}
\cm{DKEY\_MOUSE\_KEYS}{Mouse keys group bit}
\cm{DKEY\_MOUSE\_RIGHT}{Right mouse button}
\cm{DKEY\_MOUSE\_MIDDLE}{Middle mouse button}
\cm{DKEY\_MOUSE\_LEFT}{Left mouse button}
\cm{DKEY\_MOD\_SHIFT}{shift modifier}
\cm{DKEY\_MOD\_CTRL}{control modifier}
\cm{DKEY\_MOD\_ALT}{alt modifier}
\cm{DKEY\_MOD\_KP}{keypad modifier}
\para{Methods}
\cm{- init}{Init to NULL key}
\cm{- init :(int) code}{Init to key code}
\cm{- free}{Free the object}
\cm{- (BOOL) isCtrlKey}{Check for ctrl key}
\cm{- (BOOL) isFunctionKey}{Check for function key}
\cm{- (BOOL) isKeypadKey}{Check for keypad key}
\cm{- (BOOL) isAltKey}{Check for alt key}
\cm{- (BOOL) isShiftKey}{Check for shift key}
\cm{- (BOOL) isMouseKey}{Check for mouse key}
\cm{- (DKey *) set :(int) code}{Set the code for the key}
\cm{- (int) get}{Get the key code}
\cm{- (int) key}{Get the key (without modifiers)}
\cm{- (int) mod}{Get the key modifiers}
\cm{- (DText *) toText}{Convert to text object}
\cm{- (int) fromString :(char **) cstr}{Parse from string}

\sect{DMD5}
\para{Methods}
\cm{- init}{Init empty md5}
\cm{- init :(char *) cstr}{Init with c-string}
\cm{- init :(uchar *) data :(ulong) len}{Init with data}
\cm{- update :(char *) cstr}{Update with c-string}
\cm{- update :(uchar *) data :(ulong) len}{Update with data}
\cm{- (DData *) digest}{Return digest}
\cm{- (DText *) hexdigest}{Return digest in hex-ascii}

\sect{DPNGImage}
\para{Class methods}
\cm{+ (BOOL) isImage :(id) source}{Check for PNG image}
\para{Methods}
\cm{- init}{Init PNG image}
\cm{- free}{Free PNG image}
\cm{- (unsigned) height}{Return image height}
\cm{- (unsigned) width}{Return image width}
\cm{- (unsigned) bytesPerPixel}{Return bytes per pixel}
\cm{- (unsigned) images}{Return number of images}
\cm{- (BOOL) open :(id) srce}{Open object for reading}
\cm{- (BOOL) open :(id) dest :(unsigned) width}{}
\cl{:(unsigned) height :(unsigned) bytesPerPixel}{}
\cn{Open object for writing}
\cm{- (unsigned) readRow :(uchar *) data}{Read row of pixels}
\cm{- (BOOL) writeRow :(uchar *) data :(unsigned) width}{}
\cn{Write row of pixels}
\cm{- (BOOL) close}{Close image object}

\sect{DRegEx}
\para{Syntax}
\cm{.}{Match any char (incl. newline)}
\cm{*}{Match zero or more}
\cm{+}{Match one or more}
\cm{?}{Match zero or one}
\cm{$\{$c$\}$}{Match exactly c times}
\cm{$\{$min,max$\}$}{Match min..max times}
\cm{|}{Match alternatives}
\cm{[]}{Match one in the list}
\cm{[\^{ }]}{Match any except in list}
\cm{[::]}{Match a class in a list}
\cm{()}{Group or subexpression}
\cm{\^{ }}{Match begin of line}
\cm{\$}{Match end of line}
\para{Constants}
\cm{DRE\_NO\_MATCH}{No result for match or search}
\cm{DRE\_ERROR}{Error for match or search}
\para{Methods}
\cm{- init}{Init empty regex}
\cm{- init :(char *) pattern}{Init with case sensitive pattern}
\cm{- free}{Free the regex}
\cm{- (BOOL) ccompile :(char *) ptrn}{Compile case sens. pattern}
\cm{- (BOOL) icompile :(char *) ptrn}{}
\cn{Compile case insens. pattern}
\cm{- (int) match :(char *) str}{Match for length}
\cm{- (int) match :(char *) str :(int) from}{}
\cn{Match for length with offset}
\cm{- (int) match :(uchar *) data :(int) length :(int) from}{}
\cn{Match for length with offset}
\cm{- (int) search :(char *) str}{Search for start}
\cm{- (int) search :(char *) str :(int) from :(int) to}{}
\cn{Search for start in range}
\cm{- (int) search :(uchar *) data :(int) len}{Search for start}
\cm{- (int) search :(uchar *)str :(int)len :(int)fr :(int)to}{}
\cn{Search for start in range}
\cm{- (DArray *) indices}{Last matched indices}
\cm{- (DArray *) matches :(char *) str}{Last matched texts}
\cm{- (DArray *) matches :(uchar *) data :(int) len}{}
\cn{Last matched data}

\sect{DSHA1}
\para{Methods}
\cm{- init}{Init empty sha1}
\cm{- init :(char *) cstr}{Init with c-string}
\cm{- init :(uchar *) data :(ulong) len}{Init with data}
\cm{- update :(char *) cstr}{Update with c-string}
\cm{- update :(uchar *) data :(ulong) len}{Update with data}
\cm{- (DData *) digest}{Return digest}
\cm{- (DText *) hexdigest}{Return digest in hex-ascii}

\sect{DSHA256}
\para{Methods}
\cm{- init}{Init empty sha256}
\cm{- init :(char *) cstr}{Init with c-string}
\cm{- init :(uchar *) data :(ulong) len}{Init with data}
\cm{- reset}{Reset the sha256}
\cm{- update :(char *) cstr}{Update with c-string}
\cm{- update :(uchar *) data :(ulong) len}{Update with data}
\cm{- (DData *) digest}{Return digest}
\cm{- (DText *) hexdigest}{Return digest in hex-ascii}

\sect{DSimpleFont}
\para{Methods}
\cm{- init}{Init simple bitmap font}
\cm{- shallowCopy}{Shallow copy the font}
\cm{- free}{Free the font}
\cm{- (char *) familyName}{Get family name}
\cm{- (char *) styleName}{Get style name}
\cm{- (int) glyphsInFont}{Get number of glyphs}
\cm{- (BOOL) size :(unsigned) width :(unsigned) height}{}
\cn{Set the font width and height}
\cm{- (BOOL) size :(char *) cstr :(unsigned) width}{}
\cl{:(unsigned) height}{Set font size via string}
\cm{- (BOOL) stringSize :(char *) cstr :(unsigned *) width}{}
\cl{:(unsigned *) height}{Get string size in font}
\cm{- (BOOL) charSize :(char) ch :(unsigned *) width}{}
\cl{:(unsigned *) height}{Get character size in font}
\cm{- (BOOL) glyph :(char) ch :(DFT\_Glyph *) glyph}{}
\cn{Get glyph info for character}

\sect{DSocket}
\para{Constants}
\cm{DSK\_STREAM}{Stream socket type}
\cm{DSK\_DGRAM}{Datagram socket type}
\cm{DSK\_MSG\_OOB}{Out of band message flag}
\cm{DSK\_MSG\_DONTROUTE}{Do not route the message flag}
\cm{DSK\_MSG\_PEEK}{Peek data message flag}
\cm{DSK\_MSG\_WAITALL}{Wait for the full message flag}
\cm{DSK\_SHUT\_RD}{Shutdown receive flag}
\cm{DSK\_SHUT\_WR}{Shutdown send flag}
\cm{DSK\_SHUT\_RDWR}{Shutdown both send and receive flag}
\para{Class methods}
\cm{+ (int) protocol :(const char *) name}{}
\para{Methods}
\cm{- init}{Init empty socket}
\cm{- init :(int) fileno :(id) address :(int) type}{}
\cl{:(int) protocol}{Init socket with file descr.}
\cm{- init :(int) family :(int) type :(int) protocol}{}
\cn{Init socket with address}
\cm{- free}{Free socket}
\cm{- (int) fileno}{Return file descriptor}
\cm{- (int) error}{Return last error}
\cm{- (int) family}{Return family of socket}
\cm{- (int) type}{Return type of socket}
\cm{- (BOOL) setSocketOption :(int) level :(int) optname}{}
\cl{:(void *) optval :(int) optsize}{Set socket option}
\cm{- (BOOL) getSocketOption :(int) level :(int) optname}{}
\cl{:(void *) optval :(int) optsize}{Get socket option}
\cm{- (BOOL) blocking :(BOOL) block}{Set blocking state}
\cm{- (BOOL) blocking}{Return blocking state}
\cm{- (BOOL) reuseAddr :(BOOL) reuse}{Set reuse state}
\cm{- (BOOL) reuseAddr}{Get reuse state}
\cm{- (BOOL) sendBufferSize :(int) size}{Set send buffer size}
\cm{- (int) sendBufferSize}{Get send buffer size}
\cm{- (BOOL) receiveBufferSize :(int) size}{}
\cn{Set receive buffer size}
\cm{- (int) receiveBufferSize}{Get receive buffer size}
\cm{- (BOOL) keepAlive :(BOOL) keep}{Set keep alive state}
\cm{- (BOOL) keepAlive}{Get keep alive state}
\cm{- (BOOL) linger :(unsigned) secs}{Set linger time}
\cm{- (unsigned) linger}{Get linger time}
\cm{- (BOOL) open :(int) family :(int) type :(int) protocol}{}
\cn{Open socket with address}
\cm{- (BOOL) bind :(id) address}{Bind socket to address}
\cm{- (BOOL) listen :(int) backlog}{Listen for connections}
\cm{- (DSocket *) accept}{Accept a connection}
\cm{- (BOOL) connect :(id) address}{Connect to address}
\cm{- (BOOL) close}{Close socket}
\cm{- (BOOL) shutdown :(int) what}{Shutdown connection}
\cm{- (int) sendto :(id) address :(void *) data}{}
\cl{:(int) length :(int) flags}{Send data connectionless}
\cm{- (DData *) recvfrom :(id) address :(int) length}{}
\cl{:(int) flags}{Receive data connectionless}
\cm{- (int) send :(void *) data :(int) length :(int) flags}{}
\cn{Send data via connection}
\cm{- (DData *) recv :(int) length :(int) flags}{}
\cn{Receive data via connection}
\cm{- (int) sendto :(id) address :(char *) cstr :(int) flags}{}
\cn{Send text connectionless}
\cm{- (int) recvfrom :(Text *) dest :(id) address :(int) len}{}
\cl{:(int) flags}{Receive text connectionless}
\cm{- (int) send :(char *) cstring :(int) flags}{}
\cn{Send text via connection}
\cm{- (int) recv :(DText *) dest :(int) length :(int) flags}{}
\cn{Receive text via connection}
\cm{- (long) recv :(DText *) dest :(const char *) eofl}{}
\cn{:(long) length :(int) flags}{Receive text till eofl}

\sect{DSystemLogger}
\cm{- init}{Init default system logger}
\cm{- init :(char *) appName :(BOOL) toStdErr}{}
\cn{Init system logger with application name}
\cm{- (BOOL) doLog :(int) level :(char *) message}{}
\cn{Log a message with a level}
\cm{- (int) mask :(int) levels}{Set the level mask}
\cm{- (int) mask :(int) high :(int) low}{Set the level range}
\note{Only where available (unix)}

\sect{DTextDrawable}
\cm{- init}{Init text drawable}
\cm{- shallowCopy}{Copy the text drawable}
\cm{- free}{Free text drawable}
\cm{- (unsigned) cursorX}{Get cursor x-position}
\cm{- (unsigned) cursorY}{Get cursor y-position}
\cm{- (BOOL) cursor :(unsigned) x :(unsigned) y}{}
\cn{Set cursor position}
\cm{- (int) cursor :(int) state}{Set cursor state}
\cm{- (int) pointer :(int) state}{Set pointer state}
\cm{- (int) error}{Get the last error}
\cm{- (unsigned long) tell}{Tell current cursor position}
\cm{- (BOOL) seek :(unsigned long) offset :(int) origin}{}
\cn{Set the cursor position}
\cm{- (BOOL) skip :(unsigned long) offset}{Skip cursor positions}
\cm{- (unsigned) maxX}{Get maximum x-position}
\cm{- (unsigned) lines}{Get number of lines}
\cm{- (unsigned) maxY}{Get maximum y-position}
\cm{- (unsigned) columns}{Get number of columns}
\cm{- drawable :(unsigned) columns :(unsigned) lines}{}
\cn{Set the size of the drawable}
\cm{- (BOOL) isValid :(unsigned) x :(unsigned) y}{}
\cn{Check if position is on the drawable}
\cm{- (BOOL) clip :(unsigned) minX :(unsigned) maxX}{}
\cl{:(unsigned) minY :(unsigned) maxY}{Set clipping area}
\cm{- (BOOL) clip}{Set clipping area full drawable}
\cm{- (unsigned) clipMinY}{Get minimum clipping y-position}
\cm{- (unsigned) clipMaxY}{Get maximum clipping y-position}
\cm{- (unsigned) clipMinX}{Get minimum clipping x-position}
\cm{- (unsigned) clipMaxX}{Get maximum clipping x-position}
\cm{- (BOOL) color :(DColor *) fgc :(DColor *) bgc}{}
\cn{Set foreground and background color}
\cm{- (BOOL) foregroundColor :(DColor *) fgc}{}
\cn{Set foreground color}
\cm{- (DColor *) foregroundColor}{Get foreground color}
\cm{- (BOOL) backgroundColor :(DColor *) bgc}{}
\cn{Set background color}
\cm{- (DColor *) backgroundColor}{Get background color}
\cm{- (BOOL) startDrawing}{Start drawing on text screen}
\cm{- (BOOL) startDrawing :(unsigned) minX :(unsigned) maxX}{}
\cl{:(unsigned) minY :(unsigned) maxY}{}
\cn{Start drawing in clipped area}
\cm{- stopDrawing}{Stop drawing}
\cm{- (BOOL) isDrawing}{Check for drawing mode}
\cm{- (BOOL) clear}{Clear the drawable}
\cm{- (BOOL) writeText :(char *) text}{Write text on drawable}
\cm{- (BOOL) writeChar :(char) ch}{Write character on drawable}
\cm{- (BOOL) writeLine :(char *) text}{Write text line on drawable}
\cm{- (BOOL) writeText :(unsigned) startX :(unsigned) startY}{}
\cl{:(const char *) text}{Write text on drawable}
\cm{- (BOOL) writeChar :(unsigned) startX :(unsigned) startY}{}
\cl{:(char) ch}{Write character on drawable}
\cm{- (int) readChar :(unsigned) startX :(unsigned) startY}{}
\cn{Read a character from the drawable}
\cm{- (BOOL) drawHLine :(unsigned) startX : (unsigned) endX}{}
\cl{:(unsigned) startY :(int) lineType}{}
\cl{:(unsigned) lineWidth}{Draw horizontal line on drawable}
\cm{- (BOOL) drawHLine :(unsigned) startX : (unsigned) endX}{}
\cl{:(unsigned) startY}{Draw horizontal line on drawable}
\cm{- (BOOL) drawHLine :(unsigned) endX}{Draw horizontal line}
\cm{- (BOOL) drawVLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endY :(int) lineType}{}
\cl{:(unsigned) lineWidth}{Draw vertical line on drawable}
\cm{- (BOOL) drawVLine :(unsigned) startX :(unsigned) startY}{}
\cl{:(unsigned) endY}{Draw vertical line on drawable}
\cm{- (BOOL) drawVLine :(unsigned) endY}{Draw vertical line}
\cm{- (BOOL) drawLine :(unsigned) startX :(unsigned) endX}{}
\cl{:(unsigned) startY :(unsigned) endY :(int) lineType}{}
\cl{:(unsigned) lineWidth}{Draw vertical line on drawable}
\cm{- (BOOL) drawLine :(unsigned) startX :(unsigned) endX}{}
\cl{:(unsigned) startY :(unsigned) endY}{Draw vertical line}
\cm{- (BOOL) drawLine :(unsigned) endX :(unsigned) endY}{}
\cn{Draw vertical line on drawable}
\cm{- (BOOL) drawPoint :(unsigned) startX :(unsigned) startY}{}
\cn{Draw point on drawable}
\cm{- (BOOL) drawPoint}{Draw point on drawable}
\cm{- (BOOL) blit :(unsigned) startX :(unsigned) startY}{}
\cl{:(DTextDrawable *) other :(unsigned) oStartX}{}
\cl{:(unsigned) oEndX :(unsigned) oStartY}{}
\cl{:(unsigned) oEndY}{Blit other drawable on this drawable}

\sect{DTextScreen : DTextDrawable}
\cm{- init}{Init text screen object}
\cm{- init :(DColor *) fgc :(DColor *) bgc}{}
\cn{Init and open text screen}
\cm{- free}{Free the text screen}
\cm{- (BOOL) isOpen}{Check if text screen is open}
\cm{- (BOOL) hasColors}{Check if text screen support colors}
\cm{- (id) screenHandler :(id) handler}{Set screen event handler}
\cm{- (id) screenHandler}{Get current screen event handler}
\cm{- (BOOL) open :(DColor *) fgc :(DColor *) bgc}{}
\cn{Open text screen}
\cm{- close}{Close text screen}
\cm{- beep }{Generate beep}
\cm{- (int) cursor :(int) state}{Set the state of the cursor}
\cm{- (BOOL) startDrawing}{Start drawing on the text screen}
\cm{- stopDrawing}{Stop drawing on the text screen}
\cm{- (unsigned) waitEvents}{Wait and process events}
\cm{- (unsigned) processEvents}{Processing waiting events}
\cm{- clearEvents}{Clear any pending events}

\sect{DTextSurface : DTextDrawable}
\cm{- init}{Init text surface}
\cm{- shallowCopy}{Copy the text surface}
\cm{- free}{Free text surface}
\cm{- (BOOL) isOpen}{Check if surface is open}
\cm{- (BOOL) open :(unsigned) columns :(unsigned) lines}{}
\cl{:(DColor *) fgc :(DColor *) bgc}{Open the text surface}
\cm{- close}{Close the text surface}

\sect{DTimer}
\para{Methods}
\cm{+ (void) delay :(long) msec}{Delay msec}
\cm{- init}{Init default timer}
\cm{- init :(long) timeOut}{Init with time-out value}
\cm{- (long) timer}{Return current timer}
\cm{- (long) timeOut}{Return current time out value}
\cm{- timeOut :(long) timeOut}{Set time out value}
\cm{- restart}{Restart the timer}
\cm{- (BOOL) isExpired}{Test for expired timer, auto restart}
\cm{- (BOOL) isExpired :(long) timeOut}{}
\cn{Test for timed expiration, auto restart}
\note{All times in milliseconds}

\sect{DTrueTypeFont}
\para{Methods}
\cm{- init}{Init simple bitmap font}
\cm{- shallowCopy}{Shallow copy the font}
\cm{- free}{Free the font}
\cm{- (char *) familyName}{Get family name}
\cm{- (char *) styleName}{Get style name}
\cm{- (int) glyphsInFont}{Get number of glyphs}
\cm{ - (BOOL) open :(char *) filename}{}
\cn{Open a TrueType font (file)}
\cm{- (BOOL) isOpen}{Check if font (file) is open}
\cm{- (BOOL) close}{Close the font (file)}
\cm{- (BOOL) size :(unsigned) width :(unsigned) height}{}
\cn{Set the font width and height}
\cm{- (BOOL) size :(char *) cstr :(unsigned) width}{}
\cl{:(unsigned) height}{Set font size via string}
\cm{- (BOOL) stringSize :(char *) cstr :(unsigned *) width}{}
\cl{:(unsigned *) height}{Get string size in font}
\cm{- (BOOL) charSize :(char) ch :(unsigned *) width}{}
\cl{:(unsigned *) height}{Get character size in font}
\cm{- (BOOL) glyph :(char) ch :(DFT\_Glyph *) glyph}{}
\cn{Get glyph info for character}


\sect{DUnixSocketAddress}
\para{Constants}
\cm{DSA\_AF\_UNIX}{Unix socket family}
\para{Methods}
\cm{- init}{Init empty unix socket address}
\cm{- init :(char *) filename}{Init with filename}
\cm{- shallowCopy}{Copy the socket address}
\cm{- (int) error}{Get the last error (always 0)}
\cm{- (int) family}{Return the family}
\cm{- (void *) sockaddr}{Return the sockaddr struct}
\cm{- (int) size}{Return the size of sockaddr}
\cm{- (int) port}{Return the port}
\cm{- (DText *) host}{Return the host name}
\cm{- (BOOL) filename :(char *) name}{Set with filename}
\cm{- (BOOL) sockaddr :(void *) addr :(int) size}{}
\cn{Set with sockaddr struct}
\cm{- close}{Close the address}
\note{Only where available (unix)}

\sect{DXMLReader}
\cm{- init}{Init xml reader}
\cm{- free}{Free xml reader}
\cm{- bufferSize :(int) size}{Set parser buffer size}
\cm{- (int) bufferSize}{Get parser buffer size}
\cm{- encoding :(char *) encoding}{Set override encoding}
\cm{- (char *) encoding}{Get override encoding}
\cm{- (BOOL) parse :(id) source :(char *) name :(id) handler}{}
\cl{:(char) separator}{Parse the xml source with handler}
\cm{- (int) lineNumber}{Return the parsed line number}
\cm{- (int) columnNumber}{Return the parsed column number}
\cm{- (const char *) name}{Return the name of the source}
\cm{+ (char *) errorToString :(int) error}{Translate error}

% Footer
\vfill \hrule\smallskip
{\smallrm Version 0.8.0. This card may be freely distributed under 
the terms of the GNU general public licence\par
Copyright \copyright\ {\oldstyle 2003-2006} by Dick van Oudheusden}

% Ending
\supereject
\if L\lr \else\null\vfill\eject\fi
\if L\lr \else\null\vfill\eject\fi
\bye

% EOF
