MacPascal Units
Bill Catambay, Pascal Central Editor

MacPascal Units is an extension of Pascal Central. The intent is to provide useful Pascal units for Macintosh development. If you have some units you think others could benefit from, and don't mind sharing, please submit your units using the Pascal submission page.

NOTE: To save the unit to your desktop, Control-Click (or Right-Click) the link, and choose "Save Link As...", and save as Source.

Unit Author Description Posted On
MySQL Adriaan van Os Pascal interface to the MySQL library.

Function mysql_init_func
Function mysql_list_fields_func
Function mysql_master_query_func
[and more...]
ncurses Willett Kempton Pascal interface to the ncurses library.

Function define_key
Function resizeterm
Function baudrate
[and more...]
CarbonPrinting A.D. Jensen A printing unit that supports printing in Carbon.

Function HandlePageSetup
Function ReadyPrinting
Function PrintingOpenNextPage
[and more...]
Huffman James Derrick A utility unit encoding and decoding using Huffman compression.

Function HuffmanEncode
Function HuffmanDecode
genDialogs David Sinclair A utility unit focused on the dialog manager.

Function DlogGetKind
Function DlogFindKind
Function dlogSearchDItems
Function dlogItemIsCtrl
[and more...]
genEvents David Sinclair A utility unit focused on event routines (including a non-IC method for opening URLs in a browser).

Function EventKeyIsDown
Function eventGotRequiredParams
Function eventBringAppToFront
Function eventSendOpenURLAE
[and more...]
genFiles David Sinclair A utility unit focused on file I/O.

Function fileExists
Function fileRenameUnique
Function fileOpenDataFork
Function fileFromScrap
[and more...]
genGraphics David Sinclair A utility unit focused on graphics port routines.

Function grafHasColour
Function GrafGetIconSuite
Function grafGetClip
Function GrafGetItemRect
[and more...]
genNumerics David Sinclair A utility unit focused on numerics.

Function NumRnd
Function TestBit
Function numGetResource
Function numGetLineFromHandle
[and more...]
genPrefs David Sinclair A utility unit focused on saving and loading preferences.

Function prefsSave
Function prefsRead
Function prefsCopyRes
Function prefsSaveData
Function prefsCopyResList
genProgressDialogs David Sinclair A utility unit focused on displaying progress bars.

Function progGetColour
Procedure progProgressBar
Function progChangeMessage
Function progDisplayMessage
[and more...]
genResources David Sinclair A utility unit focused on resource handling routines.

Procedure resReallyBadError
Procedure resInit
Function resStrListLength
Function resBeginStrList
Function resAddToStrList
genSort David Sinclair A utility unit focused on general list sorting routines.

Function sortCreateList
Procedure sortAddString
Procedure sortTheStrings
Function sortReadString
Function sortCount
Procedure sortDisposeList
genStrings David Sinclair A utility unit focused on string handling.

Function StrBoolean
Function strGetIndString
Function strToNum
Function strLastPos
[and more...]
genToolbox David Sinclair A utility unit focused on event routines (including a non-IC method for opening URLs in a browser).

Procedure InitialiseToolbox
Function Abs
Function Copy
Function Geneva
Function Monaco
Function Palatino
genCustomCreators David Sinclair A utility unit focused on creating custom controls.

Procedure creatorSetupPopupMenu
Procedure creatorSetupItems
Procedure creatorHandleEditHits
Procedure creatorHandlePopupHits
Procedure CreatorHandleButtonHits
REWInternet Bob Williams A unit with Internet Config (IC) routines.

Function REWInitIC
Procedure REWOpenURL
Procedure REWDownloadFile
[and more...]
Binhex Ingemar Ragnemalm I took the best code I could find, DropBin, and made a nice stand-alone binhexing unit.

Procedure DoBinHex
arrowLines Michael J. Gibbs A small unit for drawing lines with arrowheads.

Procedure setArrowType
Procedure arrowLineTo
Procedure arrowLine
complexMath Michael J. Gibbs A unit that provides some basic arithmetic functions for complex numbers and functions for converting to and from polar coordinates.

Function addComplex
Function subComplex
Function mulComplex
Function divComplex
Function imag2Polar
Function polar2Imag
cStack Michael J. Gibbs A unit that provides stack management routines for user objects based on listObjs.p.

Procedure iStack
Procedure push
Function pop
Procedure free
[and more...]
CursorAnimation Michael J. Gibbs A unit that provides animated cursor routines in object form.

Procedure iAnimatedCursor
Procedure animateCursor
Procedure setCursorInterval
dottedLines Michael J. Gibbs A unit that handles drawing dashed and dotted lines.

Procedure SetBlackWhite
Procedure dottedLine
Procedure dottedLineTo
Procedure drawDotted
fileErrors Michael J. Gibbs A unit that provides file system error number to text description translation, based on the resources stored in fileErrors.rsrc.

Procedure getErrorDescription
fileIO Michael J. Gibbs A unit providing a complete file I/O object class. Allows file objects to be initialized based on file name and volume reference or file system spec.

Function readFile
Function writeFile
Function writeLine
Function writeStr
Function readChar
Procedure getfName
[and more...]
hex Michael J. Gibbs A unit providing decimal to hexidecimal conversions for 4, 8, 16 and 32 bit integers and hexidecimal to decimal conversion for 32 bit integers.

Function nibble2Hex
Function byte2Hex
Function int2Hex
Function long2Hex
Function hex2Long
iconAnimation Michael J. Gibbs A unit providing an icon animation object class.

Procedure iAnimatedIcon
Procedure setAnimationInterval
Function getAnimationInterval
Procedure setFrameIncrement
Function getCurrentFrame
[and more...]
listObjs Michael J. Gibbs A unit providing a powerful class to manage lists of objects of any class, non-invasively.

Procedure prependToList
Procedure insertInList
Procedure mergeList
Function getElement
Function findElement
[and more...]
machineNames Michael J. Gibbs A small unit that returns the machine and owner names from the File Sharing control panel.

Procedure GetOwnerName
Procedure GetMachineName
money Michael J. Gibbs A small unit that provides a procedure for converting a numeric value into the format used on checks.

Procedure dollars2Text
mousePosn Michael J. Gibbs A unit that provides routines for setting and getting the mouse position under Mac OS 9 and earlier.

Procedure SetMouse
Procedure getRawMouse
pcFileIO Michael J. Gibbs A unit reading and writing MS-DOS/MS-Windows created text and binary files, object class. Performs byte order correction on integers, long integers, and single and double precision floating point (real) values for Mac applications using PC files directly.

Function readLine
Function writeLine
Function readInteger
Function writeDouble
[and more...]
preferences Michael J. Gibbs A unit for simplifying the use of preference settings in object-oriented applications.

Function getPreferences
Procedure setPreferences
Function updatePreferences
Function makeNewPreferences
[and more...]
NavigationServices Ken Beath A C unit with accompanying Pascal interface supporting Mac OS Navigation Services.

Function OpenFileDialog
Function SaveFileDialog
Function ConfirmSaveDialog
Function MyNavServicesAvailable
REWSleep Bob Williams A Sleep library which invokes your procedures upon sleep and doze states.

Function REWCanSleep
Procedure REWInitSleep
Procedure REWFinishSleep
DepthLib Bill Catambay Library routines for getting and setting the color depth for monitors.

Function MaxScreenDepth
Function GetScreenDepth
Procedure SetScreenDepth
Function GetScreenMode
Procedure SetScreenMode
[and more...]
GammaPaslib Matthew Mora Library routines for Altering the Gamma Tables of GDevices.

Function IsGammaAvailable
Function DoGammaFade
Procedure DelayFadeToBlack
Procedure DelayFadeFromBlack
[and more...]
Awesomefade Ingemar Ragnemalm Routines for performing various CLUT fading.

Function MakeRGB
Procedure CLUTFadeToBlack
Procedure FadeToCT
Procedure FadeToRGB
Procedure RotateCT
[and more...]
Carbon Michael Shopsin Necessary globals and functions to support carbonizing Pascal.

Function myGetMenuBarHeight
Procedure myDisposeFilter
Function myGetWindowRect
Function myGetDialogPort
Procedure myDisableItem
Function myLoWord
[and much more...]
CarbonStuff Ken Beath Routines to help you port your Pascal programs to Carbon.

Func GetWindowPort
Func GetDialogWindow
Func GetControlHilite
Func IsWindowVisible
[and much more...]
TextStuff Robert R. Dell Routines for various text utilities.

Proc Decit
Proc Comma
Proc Hexit
Proc MakeByte
Proc MakeWord
Proc MakeLong
Proc TrimEndingPadding
Proc TrimBeginningPadding
ControlsAndWindows Robert R. Dell Routines for handling data structures for multiple windows.

Proc InitControlsAndWindows
Proc CreateNewWindowEntry
Proc LocateWindowByName
Proc LocateWindowByWindow
Proc RemoveWindowEntry
Proc SetTheWindowTitle
[includes similar procs for Controls]
Fast Fourier Transforms Richard Palais Well tested routines for fast fourier tranforms.

Procedure fft
Procedure ifft
Philippe Casgrain Routines for drawing arrows, including indented arrows, and arrows at varying angles.

Procedure ArrowDraw
BarCodes Robert R. Dell Routines for drawing barcodes.

Procedure DrawBarCode
Procedure InitBarCodes
Procedure BarCodeError
Procedure BarCodeWidth

This page authored by Bill Catambay
Send Comments to: Pascal Central Editor