|
BurgerLib
|
Class containing MacOS specific helper functions. More...
#include <maconly.h>

Public Types | |
| typedef struct OpaqueDialogPtr * | DialogRef |
| Alias for DialogRef for MacOS. | |
Static Public Member Functions | |
| static BURGER_INLINE Word | IsKeyPressedInKeyMap (const Word8 *pKeyMap, Word uKeyCode) |
| Test if a key is pressed in a KeyMap structure. | |
| static Word BURGER_API | GetOSVersion (void) |
| Return the version of MacOS. | |
| static Word BURGER_API | GetSoundManagerVersion (void) |
| Return the version of the Sound Manager. | |
| static Word BURGER_API | GetAppleShareVersion (void) |
| Return the version of AppleShare library. | |
| static Word BURGER_API | GetQuickTimeVersion (void) |
| Return the version of QuickTime. | |
| static Word BURGER_API | GetInputSprocketVersion (void) |
| Return the version of InputSprocket. | |
| static Word BURGER_API | GetDrawSprocketVersion (void) |
| Return the version of DrawSprocket. | |
| static Word BURGER_API | IsAltivecPresent (void) |
| Detect if Altivec instructions are present. | |
| static Word BURGER_API | IsQuickTimePowerPlugAvailable (void) |
| Detect if the PowerPC native version of Quicktime is present. | |
| static Word BURGER_API | IsTrapAvailable (Word uTrapNum) |
| Detect if a MacOS trap number exists. | |
| static Word BURGER_API | DialogControlGetValue (DialogRef pDialog, Word uItemNum) |
| Return the value of a Mac Dialog Control. | |
| static void BURGER_API | DialogControlSetValue (DialogRef pDialog, Word uItemNum, Word uValue) |
| Sets the value of a Mac Dialog Control. | |
| static void BURGER_API | DialogControlToggleValue (DialogRef pDialog, Word uItemNum) |
| Toggles the value of a Mac Dialog Control. | |
| static Word BURGER_API | GetPathFromDirID (Burger::Filename *pOutput, long lDirID, short sVolRefNum) |
| Convert a Mac DirID and a Volume reference into a Burgerlib path. | |
| static char *BURGER_API | GetPathFromFSSpec (char *pOutput, WordPtr uOutputSize, const FSSpec *pInput) |
| Convert a MacOS FSSpec into a Burgerlib path. | |
| static WordPtr BURGER_API | GetPathFromFSSpecToBuffer (char *pOutput, WordPtr uOutputSize, const FSSpec *pInput) |
| Convert a MacOS FSSpec into a Burgerlib path. | |
| static char *BURGER_API | GetPathFromFileURL (char *pOutput, WordPtr uOutputSize, const char *pInput) |
| Convert a CFURL into a Burgerlib path. | |
| static WordPtr BURGER_API | GetPathFromFileURLToBuffer (char *pOutput, WordPtr uOutputSize, const char *pInput) |
| Convert a CFURL into a Burgerlib path. | |
Private Attributes | |
| Word16 | m_usOSVersion |
| Cached MacOS Version, zero means uninitialized. | |
| Word16 | m_usSoundManagerVersion |
| Sound manager version in 0x0102 (1.2) format. | |
| Word8 | m_bSoundManagerVersionValid |
| TRUE if sound manager version is valid | |
| Word8 | m_bAppleShareVersionValid |
| TRUE if the AppleShare version is valid | |
| Word16 | m_usAppleShareVersion |
| AppleShare version in 0x0102 (1.2) format. | |
| Word16 | m_usInputSprocketVersion |
| InputSprocket version in 0x0102 (1.2) format. | |
| Word8 | m_bInputSprocketVersionFlag |
| TRUE if InputSprocket version was obtained | |
| Word8 | m_bDrawSprocketVersionFlag |
| TRUE if DrawSprocket version was obtained | |
| Word16 | m_usDrawSprocketVersion |
| DrawSprocket version in 0x0102 (1.2) format. | |
| Word8 | m_bQuickTimePowerPlugPresent |
| Bit 0 == TRUE if Quicktime's Power plug is loaded. Bit 7 (0x80) denotes bit 0 is valid. | |
| Word8 | m_bPowerPCFlags |
| Bit field returned by Gestalt(gestaltPowerPCProcessorFeatures)&0x3F. Bit 7 (0x80) denotes if the rest of the bits are valid. | |
| Word16 | m_usQuickTimeVersion |
| QuickTime's version in 0x0102 (1.2) format. | |
| Word8 | m_bQuickTimeVersionValid |
| TRUE if Quicktime's version is valid. | |
Static Private Attributes | |
| static Burger::Mac | s_Singleton |
Class containing MacOS specific helper functions.
Code to simply common MacOS 9 (Classic) operations for MacOS specific code.
| typedef struct OpaqueDialogPtr* Burger::Mac::DialogRef |
Alias for DialogRef for MacOS.
| Word BURGER_API Burger::Mac::DialogControlGetValue | ( | DialogRef | pDialog, |
| Word | uItemNum | ||
| ) | [static] |
Return the value of a Mac Dialog Control.
Given a DialogRef and an Item number, query the item and return the value associated with it. If the item is invalid or an error occurs, return 0.
| pDialog | A valid MacOS DialogRef. |
| uItemNum | A valid item number associated with the dialog. |
| void BURGER_API Burger::Mac::DialogControlSetValue | ( | DialogRef | pDialog, |
| Word | uItemNum, | ||
| Word | uValue | ||
| ) | [static] |
Sets the value of a Mac Dialog Control.
Given a DialogRef, an Item number and a new value to use, select the item and set the passed value to it. If the item is invalid or an error occurs, do nothing.
| pDialog | A valid MacOS DialogRef. |
| uItemNum | A valid item number associated with the dialog. |
| uValue | A new value to associate with the item in the range of 0 to 65535 inclusive. |
| void BURGER_API Burger::Mac::DialogControlToggleValue | ( | DialogRef | pDialog, |
| Word | uItemNum | ||
| ) | [static] |
Toggles the value of a Mac Dialog Control.
Given a DialogRef and an Item number, query the item's value and toggle it with the != truth statement so only TRUE or FALSE are the resulting values. Useful for toggling checkboxes.
| pDialog | A valid MacOS DialogRef. |
| uItemNum | A valid item number associated with the dialog. |
| Word BURGER_API Burger::Mac::GetAppleShareVersion | ( | void | ) | [static] |
Return the version of AppleShare library.
Ask the AppleShare library what version it is and return that value. The function caches the value so subsequent calls do not ask AppleShare for the version again.
| Word BURGER_API Burger::Mac::GetDrawSprocketVersion | ( | void | ) | [static] |
Return the version of DrawSprocket.
Detect if DrawSprocket is available, and if so, query it for the version present. If DrawSprocket is not available, the version returned is zero.
This function is written so it only asks for the version once from DrawSprocket. It will cache the version and return the cached value on subsequent calls.
DSpGetVersion() only appeared in version 1.7 or later and as a result, to get the version from earlier versions the version resource found in the library itself must be opened and read. Because of this, the first call to this function may take some time.
| Word BURGER_API Burger::Mac::GetInputSprocketVersion | ( | void | ) | [static] |
Return the version of InputSprocket.
Detect if InputSprocket is available, and if so, query it for the version present. If InputSprocket is not available, the version returned is zero.
This function is written so it only asks for the version once from InputSprocket. It will cache the version and return the cached value on subsequent calls.
| Word BURGER_API Burger::Mac::GetOSVersion | ( | void | ) | [static] |
Return the version of MacOS.
Ask MacOS what version it is and return that value. The function caches the value so subsequent calls do not ask the OS for the version again.
| Word BURGER_API Burger::Mac::GetPathFromDirID | ( | Burger::Filename * | pOutput, |
| long | lDirID, | ||
| short | sVolRefNum | ||
| ) | [static] |
Convert a Mac DirID and a Volume reference into a Burgerlib path.
Given a 32 bit directory ID and a 16 bit volume number, determine the full Burgerlib pathname that is its equivalent.
What is returned is either NULL for an error condition, pOutput if the user supplied buffer was large enough to contain the requested data or a newly allocated pointer to a larger buffer to hold the requested data.
| pOutput | Pointer to a buffer to accept the output string |
| lDirID | 32-bit directory ID supplied by MacOS |
| sVolRefNum | 16-bit volume reference number supplied by MacOS |
| char *BURGER_API Burger::Mac::GetPathFromFileURL | ( | char * | pOutput, |
| WordPtr | uOutputSize, | ||
| const char * | pInput | ||
| ) | [static] |
Convert a CFURL into a Burgerlib path.
Given a valid MacOSX style CFURL, convert it into a full Burgerlib format pathname and return it.
If the string is not a valid CFURL, it's considered an error condition and the output string will be set to an empty string.
What is returned is either NULL for an error condition, pOutput if the user supplied buffer was large enough to contain the requested data or a newly allocated pointer to a larger buffer to hold the requested data.
| pOutput | Pointer to a user supplied buffer for storing the results, or NULL to force a buffer to be allocated |
| uOutputSize | Length in bytes of the user supplied buffer or the size of the initial buffer to allocate if pOutput is NULL. if pOutput is NULL and this paramater is zero, this function will determine the optimimum initial buffer size. |
| pInput | Pointer to a valid CFURL. |
| WordPtr BURGER_API Burger::Mac::GetPathFromFileURLToBuffer | ( | char * | pOutput, |
| WordPtr | uOutputSize, | ||
| const char * | pInput | ||
| ) | [static] |
Convert a CFURL into a Burgerlib path.
Given a valid MacOSX style CFURL, convert it into a full Burgerlib format pathname and return it.
If the string is not a valid CFURL, it's considered an error condition and the function will return zero and leave the output buffer untouched.
| pOutput | Pointer to a buffer to receive the burgerlib path |
| uOutputSize | Size of the buffer to receive the burgerlib path |
| pInput | Pointer to a valid CFURL. |
| char *BURGER_API Burger::Mac::GetPathFromFSSpec | ( | char * | pOutput, |
| WordPtr | uOutputSize, | ||
| const FSSpec * | pInput | ||
| ) | [static] |
Convert a MacOS FSSpec into a Burgerlib path.
Given a valid MacOS9 style FSSpec record, determine the full Burgerlib format pathname and return it.
What is returned is either NULL for an error condition, pOutput if the user supplied buffer was large enough to contain the requested data or a newly allocated pointer to a larger buffer to hold the requested data.
| pOutput | Pointer to a user supplied buffer for storing the results, or NULL to force a buffer to be allocated |
| uOutputSize | Length in bytes of the user supplied buffer or the size of the initial buffer to allocate if pOutput is NULL. if pOutput is NULL and this paramater is zero, this function will determine the optimimum initial buffer size. |
| pInput | Pointer to a valid FSSpec. |
| WordPtr BURGER_API Burger::Mac::GetPathFromFSSpecToBuffer | ( | char * | pOutput, |
| WordPtr | uOutputSize, | ||
| const FSSpec * | pInput | ||
| ) | [static] |
Convert a MacOS FSSpec into a Burgerlib path.
Given a valid MacOS9 style FSSpec record, determine the full Burgerlib format pathname and return it.
| pOutput | Pointer to a buffer to receive the burgerlib path |
| uOutputSize | Size of the buffer to receive the burgerlib path |
| pInput | Pointer to a valid FSSpec. |
| Word BURGER_API Burger::Mac::GetQuickTimeVersion | ( | void | ) | [static] |
Return the version of QuickTime.
Detect if QuickTime is available, and if so, query it for the version present. If QuickTime is not available, the version returned is zero.
This function is written so it only asks for the version once from QuickTime. It will cache the version and return the cached value on subsequent calls.
| Word BURGER_API Burger::Mac::GetSoundManagerVersion | ( | void | ) | [static] |
Return the version of the Sound Manager.
Ask the MacOS Sound Manager what version it is and return that value. The function caches the value so subsequent calls do not ask the Sound Manager for the version again.
| Word BURGER_API Burger::Mac::IsAltivecPresent | ( | void | ) | [static] |
Detect if Altivec instructions are present.
Detect if the Altivec instruction set is present and return TRUE if so.
This function is written so it only does the detection once and it caches the result. The cached value is returned on subsequent calls.
| Burger::Mac::IsKeyPressedInKeyMap | ( | const Word8 * | pKeyMap, |
| Word | uKeyCode | ||
| ) | [inline, static] |
Test if a key is pressed in a KeyMap structure.
This MacOS function will take a KeyMap and a MacOS scancode and return a non-zero value if that key is currently held down. Zero is returned if not.
| pKeyMap | Pointer to a KeyMap structure, filled in by GetKeys(); |
| uKeyCode | Mac OS keyboard scan code from 0 to 127 inclusive. |
| Word BURGER_API Burger::Mac::IsQuickTimePowerPlugAvailable | ( | void | ) | [static] |
Detect if the PowerPC native version of Quicktime is present.
Detect if the PowerPC native extension of Quicktime is loaded and available. This is only for Quicktime version 2.5 during the initial transition from 680x0 to PowerPC. It's almost certainly going to return TRUE on PowerPC systems. Only in very rare cases of Quicktime 2.5 where it's emulated in 680x0 code (And therefore a performance bottleneck) in which this matters.
This function is written so it only does the detection once and it caches the result. The cached value is returned on subsequent calls.
| Word BURGER_API Burger::Mac::IsTrapAvailable | ( | Word | uTrapNum | ) | [static] |
Detect if a MacOS trap number exists.
Detect if a specific 680x0 trap instruction is present.
Due to the nature of this function, caching in impractical and it is not performed. This function is considered a performance bottleneck and should be called sparingly.
| uTrapNum | A valid MacOS 680x0 trap number from Traps.h. |
Word8 Burger::Mac::m_bAppleShareVersionValid [private] |
TRUE if the AppleShare version is valid
Word8 Burger::Mac::m_bDrawSprocketVersionFlag [private] |
TRUE if DrawSprocket version was obtained
TRUE if InputSprocket version was obtained
Word8 Burger::Mac::m_bPowerPCFlags [private] |
Bit field returned by Gestalt(gestaltPowerPCProcessorFeatures)&0x3F. Bit 7 (0x80) denotes if the rest of the bits are valid.
Word8 Burger::Mac::m_bQuickTimeVersionValid [private] |
TRUE if sound manager version is valid
Word16 Burger::Mac::m_usAppleShareVersion [private] |
AppleShare version in 0x0102 (1.2) format.
Word16 Burger::Mac::m_usDrawSprocketVersion [private] |
DrawSprocket version in 0x0102 (1.2) format.
Word16 Burger::Mac::m_usInputSprocketVersion [private] |
InputSprocket version in 0x0102 (1.2) format.
Word16 Burger::Mac::m_usOSVersion [private] |
Cached MacOS Version, zero means uninitialized.
Word16 Burger::Mac::m_usQuickTimeVersion [private] |
QuickTime's version in 0x0102 (1.2) format.
Word16 Burger::Mac::m_usSoundManagerVersion [private] |
Sound manager version in 0x0102 (1.2) format.
Burger::Mac Burger::Mac::s_Singleton [static, private] |
1.8.0