# PAL - Quickreference

Low level graphics
GraphMode Switch to 640x200 monochrome graphics mode.
RestoreGraph Restores the graphics settings.
TextMode Switch to text mode.
SelectFont Selects one of the 3 built-in fonts.
SetColor Sets the pen color.
SetRule Sets the graphics replacement rule.
SetPos Sets the pen position
SetMask Sets the fill mask.
SetLineType Defines the shape of the graphic lines.
SetClip Defines a clipped screen region.
Scroll Scrolls a rectangular area of the screen.
PlotDot Plots a dot to the specified coordinates.
WriteText Writes a string of text on the graphics screen.
GetImg Get a rectangular bitmap from screen.
PutImg Output a bitmap previously saved by GetImg()
DefineCursor Defines the shape of the graphics cursor.
BlinkRate Sets the graphics cursor blink rate.
Cursor Cursor control function.
MoveCursor Move cursor to the specified screen coordinates.
SaveState Save the PAL graphics state into a structure
RestoreState Restore the PAL graphics state from a structure
GetDot Reads the color of a pixel on the screen.

High-level graphics
Line Draw a line on the graphics screen.
Rectangle Draw a rectangle on the graphics screen.
RevBlock Reverse colors of an image block.
ClrBlock Fill an image block with a color
LoadImg Load an Image file (ICN) in memory.
LoadPcx Load a PCX Image file into memory.
SaveImg Save an image (.ICN format) to a file.
ShowFKeys Show function key definitions.
ShowTopLine Display title string and optional time on top line.
ShowTopTime Display title and current time on the top line.
FormatDate Format date string, in standard SysMgr format.
FormatTime Format time string, in standard SysMgr format.

External font routines
LoadHfn Load an external font in memory.
InitHfn Initialize a font.
WriteHfn Write a string using a loaded font.
TextExtHfn Compute text extent of a string in a given font.
FontHeightHfn Returns height of a given font.
DiscardHfn Discard a previously loaded font.

Unified font routines
TextOut Write a text string at a given position
TextExt Compute the (pixel) length of a string
FontHeight Compute the height of a font
LoadFont Load a proportional font from file or memory
DiscardFont Discard a loadable font, recovering its memory

Window functions
OpenWin Open a window
CloseWin Close a window
WinText Output text in a window
PALWIN Structure Records information on a window
Window Styles Control aspect of a window

Menu support
MNU Introduction
MENU structure Describes a menu
MENUITEM structure Describes a menu item
HandleMenu Display and handle a menu
MenuSelect Show a menu of options to user

Dialog box support
DIALOG Introduction
DIALOG structure Describes a dialog box
DLGITEM structure Describes a single dialog item
InitDialog Prepare a dialog to be used
SetDlgItem Set value(s) of a dialog item
ShowDialog Display a dialog window
SetFocus Set the focus to an item
GetFocus Retrieve the current focus (index)
HandleDialog Start user interaction in dialog
GetDlgItem Retrieve data from a dialog item
CloseDialog Close a dialog, free its memory

Dialog box items
IhEdit Text input
IhCombo Text input with an attached menu
IhStatic Static text and simple delimiter lines
IhCheck Check boxes
IhBitmap Bitmap (icons)
IhGroup Group
IhRadio Radio buttons
IhButton Pushbuttons
IhListBox Listbox

Listbox utility functions
LbAddString Add a string to a listbox
LbSetString Set a string in a listbox
LbDelString Delete a string from a listbox
LbGetString Get a string from a listbox
LbGetCount Return number of strings in listbox
LbGetPos Return index of currently selected string
LbSetPos Set currently selected string
LbClear Delete all strings from a listbox at once
LbSetCallBack Set listbox callback function
LbSetCount Set number of strings - callback mode only

Configuration file routines
CFG Introduction
ReadConfig Read config file given full name
ReadMyConfig Read config, given program name
NewConfig Create a new config file in memory
GetConfigString Retrieve a string from config data
GetConfigInt Retrieve an int from config data
GetFirstEntry Used to scan sections: init scan
GetNextEntry Used to scan sections: continue scan
GetFirstSection Used to scan file for sections: init scan
GetNextSection Used to scan file for sections: continue scan
GetCfgLine Retrieve line number info during scan
AddConfigString Used to add entries to a config file
ReplaceConfigString Used to replace a keys value in a config file
AddConfigInt Used to add entries to a config file
ReplaceConfigInt Used to replace a keys value in a config file
DeleteConfigString Used to delete config entries
WriteConfig Used to write a config file to disk
DiscardConfig Frees memory used by CFG database

Miscellaneous routines
AnnuncPos Set the annunciators position.
Check5f Check for presence of INT 5Fh services.
CheckSysMgr Check if SysMgr services are available.
FatalExit Fatal error exit from PAL and return error code.
PalInit Initialize PAL library (first thing to do).
PalDeInit Shut down PAL library.
WhichHp Returns the model number of the palmtop.
GetKey Get a key (with ASCII and Scan code).
KeyWaiting Returns TRUE if a key is waiting
PushKeys Push a sequence of Keys which GetKey will deliver.
Volume Set the volume level of the palmtop.
SetSerialPort Turn on/off the serial port of the palmtop.
SetLightSleep Enable/disable light-sleep (Power-management).
SetTimeOut Set the timeout delay of the Auto-Power-Off.
MsgBox Display a message box with buttons
MsgWin Display a message window
AskYesNo Ask the user Yes or No
MsDelay Wait a specified number of milliseconds
BattType Get/Set main battery type
BattVoltage Read main/backup battery voltage.
BattStatus Check main/backup/card battery status.
ChargeMode Set/get battery charging mode.
DCStatus Detects if an external DC adaptor is used.
OpenMeter Opens (displays) a progress/level meter.
CloseMeter Closes an active prog/level meter.
UpdateMeter Updates the percentage (level) of a meter.
GetVolume Get the volume level of the palmtop.
BattFast Detects if the battery is fast charging.
BattGetTimer Reads the battery charging timer.
BattSetTimer Sets the battery charging timer.
SetErrorHandler Set the int 24 handler to be used
LastMemoFile Return last file edited in MEMO
SerialCtl Toggle SysMgr serial port interference

System manager access
Sound Services
m_play Play a HP compatible sound file.
Commands Command codes for m_play
m_asound Generate one of several sound patterns
m_soundoff Turn off sounds in progress

Task Control Block access
m_get_TCB Get Task Control Block information
m_get_TCB_size Get Task Control Block size
IsAppActive Checks if a given Application is active.

Clipboard Management Services
m_cb_read Read data from clipboard
m_cb_write Write data to clipboard
m_close_cb Release the clipboard
m_fini_rep Terminate writing to clipboard
m_get_cb_info Get clipboard state info
m_new_rep Prepare sending a new 'representation'
m_open_cb Claim access to the clipboard and lock it
m_rep_index Get info about a representation
m_reset_cb Clear clipboard, get ownership
Clipboard Status
cbcp.c Sample clipboard access

Expanded memory support
EmsInit Check for the presence of an EMS driver.
EmsCheck Check for the presence of an EMS driver.
EmsAlloc Allocate EMS pages.
EmsMap Map a given logical page into a physical frame.
EmsFree Frees as allocated EMS block.
EmsFrameSeg Return segment address of the EMS frame;
EmsFreeCnt Return the number of free EMS pages available
EmsLastError Returns last error reported by an EMS routine
EmsPageCnt Return the total number of EMS pages available.
EmsVersion Returns the version of the EMS driver.

APPMGR.DAT file management
APPMGR.DAT An introduction to APPMGR.DAT
CloseAppMgr Close Application Manager
LoadAppDat Load application manager control file
SaveAppDat Write Application Manager control file
GetAppCnt Get number of installed applications
GetAppDef Get an applications definition
SetAppDef Set an applications definition
AddAppDef Add an application definition
DelAppDef Delete an application definition
ValidIcon Check IMGHDR pointer for valid icon
GetAppIcn Retrieve an icons bitmap
SetAppIcn Set an icons bitmap
NewAppIcn Return a free user icon slot

Filer communication routines
FilerConnect Initiate filer communications.
FilerDisconnect Close down filer communications.
FilerSendFile Send a file to the palmtop.
FilerGetFile Get a file from the palmtop.
FilerDelFile Delete a file on the palmtop.
FilerMakeDir Create a new directory on the remote.
FilerDelDir Delete a remote directory on the pamtop.
FilerAskDir Ask information about a remote directory.
FilerGetDir Get remote directory information.
FilerSync Attempt to re-synchronize with server.
FilerCallBack Information about Filer Callback functions.

Picklist routines
FilePickList Display a picklist of files.
PickList Display a picklist of strings.
QuickPickList An easier way to display a picklist.
FreePickResults Free storage associated with picklist results.
PickCount Determine the number of items in a picklist
FindLastPick Find end of linked PICKRESULTS
PICKRESULTS Structure returned by PickLists.

Alternate memory management routines
MEM Introduction
PalMalloc Replacement for malloc
PalRealloc Replacement for realloc
PalCalloc Replacement for calloc
PalFree Replacement for free
PalStrdup Replacement for strdup
SetPalMemFail Define your own out of memory handler

Software Carousel Interface routines
SCPresent Is Software Carousel Present?
SCVersion Get Software Carousel Version
SCMenu Display the Software Carousel menu
SCSwitch Switch to another Work Area
SCQuit Terminate SC
SCBoot Reboot the computer.
SCKill Kill a program in a session.
SCSizeStatus Get Size and Status of a Work Area
SCErrorMessage Convert Errorcode to Text
SCGetName Get a Work Areas Name
SCSetSize Set a Work Areas Size
SCSetName Set a Work Areas Name
SCSendCommand Send Keystrokes to a Work Area
SCCodeMode Where is Software Carousel Running.
SCKeyboardCommands Enable/Disable Work Area Switching.