home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************
- *
- * Copyright ⌐ 1998, Bachmann Software and Services.
- * All rights reserved.
- *
- * FileName:
- * PageMgr.h
- *
- * Description:
- * Page Manager library API definitions. The Page Manager library
- * provides graphical printing for the Palm Computing Platform.
- *
- * History:
- * 03/30/99 Greg Winton Created file.
- *
- * 04/07/99 Greg Winton Added functions:
- * - PagPrintText
- * - PagPrintLine
- * - PagNewLine
- * - PagNewPage
- * - PagSetFont
- * - PagWrite
- *
- *******************************************************************/
-
- #ifndef __PAGE_MGR_H__
- #define __PAGE_MGR_H__
-
- // If we're actually compiling the library code, then we need to
- // eliminate the trap glue that would otherwise be generated from
- // this header file in order to prevent compiler errors in CW Pro 2.
- #ifdef BUILDING_PAGE_MGR
- #define PAGE_MGR_TRAP(trapNum)
- #else
- #define PAGE_MGR_TRAP(trapNum) SYS_TRAP(trapNum)
- #endif
-
-
- // PalmPilot common definitions
- // #include <Common.h>
- // #include <SystemMgr.rh>
- #include <PalmOS.h>
- #include <PalmCompatibility.h>
-
- // PageMgr Definitions
- #include <PageMgrDefines.h>
- #include <SystemMgr.h>
-
- //-----------------------------------------------------------------------------
- // Page Manager library function trap ID's. Each library call gets a trap number:
- // pagTrapXXXX which serves as an index into the library's dispatch table.
- // The constant sysLibTrapCustom is the first available trap number after
- // the system predefined library traps Open,Close,Sleep & Wake.
- //
- // WARNING!!! The order of these traps MUST match the order of the dispatch
- // table in SampleLibDispatch.c!!!
- //-----------------------------------------------------------------------------
-
- typedef enum {
- pagTrapGetLibAPIVersion = sysLibTrapCustom,
- pagTrapSetOption,
- pagTrapPrintText,
- pagTrapPrintLine,
- pagTrapNewLine,
- pagTrapNewPage,
- pagTrapSetFont,
- pagTrapWrite,
- pagTrapOpenByConfig,
- pagTrapGetConfigValue,
- pagTrapPrintParagraph,
- pagTrapPrintPage,
-
- pagTrapLast
- } PageMgrTrapNumberEnum;
-
- /********************************************************************
- * API Prototypes
- ********************************************************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- //--------------------------------------------------
- // Standard library open, close, sleep and wake functions
- //--------------------------------------------------
-
- extern Err PagOpen(UInt refNum, CharPtr printerName, CharPtr portName)
- PAGE_MGR_TRAP(sysLibTrapOpen);
-
- extern Err PagClose(UInt refNum)
- PAGE_MGR_TRAP(sysLibTrapClose);
-
- extern Err PagSleep(UInt refNum)
- PAGE_MGR_TRAP(sysLibTrapSleep);
-
- extern Err PagWake(UInt refNum)
- PAGE_MGR_TRAP(sysLibTrapWake);
-
-
- //--------------------------------------------------
- // Custom library API functions
- //--------------------------------------------------
-
- // Get our library API version
- extern Err PagGetLibAPIVersion(UInt refNum, DWordPtr dwVerP)
- PAGE_MGR_TRAP(pagTrapGetLibAPIVersion);
-
- // Set an option.
- extern Err PagSetOption(UInt refNum, PagOptionEnum option, DWord value)
- PAGE_MGR_TRAP(pagTrapSetOption);
-
- // Print text.
- extern Err PagPrintText(UInt refNum, CharPtr text)
- PAGE_MGR_TRAP(pagTrapPrintText);
-
- // Print a line of text.
- extern Err PagPrintLine(UInt refNum, CharPtr line)
- PAGE_MGR_TRAP(pagTrapPrintLine);
-
- // Go to next line.
- extern Err PagNewLine(UInt refNum)
- PAGE_MGR_TRAP(pagTrapNewLine);
-
- // Eject the current page.
- extern Err PagNewPage(UInt refNum)
- PAGE_MGR_TRAP(pagTrapNewPage);
-
- // Set the font.
- extern Err PagSetFont(UInt refNum, PagFontPtr fontP)
- PAGE_MGR_TRAP(pagTrapSetFont);
-
- // Write bytes to the printer.
- extern Err PagWrite(UInt refNum, BytePtr bytes, UInt len)
- PAGE_MGR_TRAP(pagTrapWrite);
-
- // Open via BPMConfig settings
- extern Err PagOpenByConfig (UInt refNum)
- PAGE_MGR_TRAP(pagTrapOpenByConfig);
-
- // get config value
- extern Err PagGetConfigValue(UInt refNum,CharPtr szKey,CharPtr szBuf,Int size)
- PAGE_MGR_TRAP(pagTrapGetConfigValue);
-
- // PrintParagraph
- extern Err PagPrintParagraph(UInt refNum,CharPtr line, Int tabsize)
- PAGE_MGR_TRAP(pagTrapPrintParagraph);
-
- // PrintPage
- extern Err PagPrintPage(UInt refNum,CharPtr text)
- PAGE_MGR_TRAP(pagTrapPrintPage);
-
- // For loading the library in PalmPilot Mac emulation mode
- extern Err PagInstall(UInt refNum, SysLibTblEntryPtr entryP);
-
- #ifdef __cplusplus
- }
- #endif
-
- /********************************************************************
- * Public Macros
- ********************************************************************/
-
- #endif // __PAGE_MGR_H__
-