Global variables shared by all functions in the application. More...
Static Public Member Functions | |
static uint16_t | RegisterWindowClass (uint_t uIconResID=0) |
Create the global Burgerlib Window Class. | |
static void | UnregisterWindowClass (void) |
Release the global Burgerlib Window Class. | |
static void | AddToMenubar (NSMenu *pNSMenu) |
Add a new NSMenu to the application menu bar (MacOSX Only) | |
static NSString * | GetApplicationName (void) |
Query the application's plist for the Bundle name. | |
static void | CreateApplicationMenu (void) |
Add a new application menu for to the application menu bar (MacOSX Only) | |
static void | CreateWindowMenu (void) |
Add a new view menu for window selection to the application menu bar (MacOSX Only) | |
static void | CreateViewMenu (void) |
Add a new view menu for full screen toggling to the application menu bar (MacOSX Only) | |
static void | CreateHelpMenu (void) |
Add a new help menu with search to the application menu bar (MacOSX Only) | |
static void | CreateDefaultMenus (void) |
Create a new application menu bar (MacOSX Only) | |
static void | GetHIDDeviceName (String *pOutput, __IOHIDDevice *pDevice) |
Obtain the name of an HID device (MacOSX Only) | |
static __CFDictionary * | CreateHIDDictionary (uint_t uPage, uint_t uUsage) |
Create a MutableDictionary for use to the HID Manager (MacOSX Only) | |
static void | GetDisplayName (String *pOutput, uint_t uDisplayID) |
Get the name of a monitor (MacOSX Only) | |
static int | NumberFromKey (const __CFDictionary *pDictionary, const char *pKey) |
Get an integer from a Dictionary (MacOSX Only) | |
static uint_t | GetQuickTimeVersion (void) noexcept |
Return the version of QuickTime. | |
static eError | GetErrorCode (void) noexcept |
Get the current error code the application will return on exit. | |
static void | SetErrorCode (eError iNewError) noexcept |
Set the current error code. | |
static char * | GetErrorMsg (void) noexcept |
Get the pointer to the global error message buffer. | |
static void | SetErrorMsg (const char *pMessage,...) |
Update the current error message. | |
static uint_t | AreWarningsEnabled (void) noexcept |
Return non-zero if warning logging is enabled. | |
static uint_t | GetErrorBombFlag (void) noexcept |
Get the current flag to treat warnings as fatal errors. | |
static uint_t | SetErrorBombFlag (uint_t uNewFlag) noexcept |
Set the current flag to treat warnings as fatal errors. | |
static uint_t | GetExitFlag (void) noexcept |
Get the "shutdown in progress" flag. | |
static void | SetExitFlag (uint_t uNewFlag) noexcept |
Set the current flag if a shut down is in progress. | |
static void | Shutdown (void) |
Immediately shut down the application. | |
static void | Shutdown (int iError) |
Immediately shut down the application with an error code. | |
static uint32_t | Version (void) |
Return the version of Burgerlib. | |
static uint32_t | VersionBuild (void) |
Return the build number of Burgerlib. | |
static uint_t | LaunchURL (const char *pURL) |
Load and launch a web page from an address string. | |
static int | ExecuteTool (const char *pFilename, const char *pParameters, OutputMemoryStream *pOutput=nullptr) |
Execute a tool and capture the text output. | |
Private Attributes | |
uint_t | m_uMacOSVersion |
Discovered version of MacOS (MacOS only) | |
uint_t | m_uQuickTimeVersion |
QuickTime's version in 0x0102 (1.2) format. | |
uint8_t | m_bMacOSTested |
MacOS version was tested (MacOS only) | |
uint8_t | m_bQuickTimeVersionValid |
TRUE if Quicktime's version is valid. | |
Static Private Attributes | |
static uint16_t | g_uAtom |
Atom assigned to my class (Windows only) | |
static uint32_t | g_uQuickTimeVersion |
QuickTime's version in 0x0102 (1.2) format. | |
static uint8_t | g_bQuickTimeVersionValid |
TRUE if Quicktime's version is valid. | |
static eError | g_iErrorCode |
Global default error code used by Globals::Shutdown(). | |
static char | g_ErrorMsg [512] |
Global Buffer containing the last fatal error or warning. | |
static uint_t | g_bBombFlag |
TRUE if non-fatal errors are treated as fatal | |
static uint_t | g_bExitFlag |
Global TRUE if the app is in the process of shutting down. | |
static Globals | g_Globals |
Singleton instance of the global variables. | |
Global variables shared by all functions in the application.
These globals are used for the application to manage operating system resources that have a global effect.
|
static |
Add a new NSMenu to the application menu bar (MacOSX Only)
Given a created NSMenu, add the item as a submenu to the main menu bar
pNSMenu | A valid pointer to an NSMenu |
|
inlinestaticnoexcept |
Return non-zero if warning logging is enabled.
For debugging, if this flag returns a non-zero value, log messages if a non-fatal error condition occurs.
|
static |
Add a new application menu for to the application menu bar (MacOSX Only)
Creates an NSMenu with the name of the application and add a several entries.
"About %s" with no hot key and calls orderFrontStandardAboutPanel "Preferences…" with a hot key of Option-',' and has no action "Services" with no hot key and calls no action and is attached to setServicesMenu "Hide %s" with no hot key and calls hide "Hide others" with no hot key and calls hideOtherApplications "Show All" with no hot key and calls unhideAllApplications "Quit %s" with a hot key of Option-Q and calls terminate
|
static |
Create a new application menu bar (MacOSX Only)
If there's no [NSApp mainMenu], create one.
|
static |
Add a new help menu with search to the application menu bar (MacOSX Only)
Creates an NSMenu called "Help" and adds two entries, the first is the "Search" text entry field, followed by a menu item of "%s Help" where s is the pApplicationName and it called the showHelp selector when invoked.
|
static |
Create a MutableDictionary for use to the HID Manager (MacOSX Only)
Given a Page and Usage key values, create a dictionary for passing into the IOHID Kit manager.
uPage | Value to associate with kIOHIDDeviceUsagePageKey |
uUsage | Value to associate with kIOHIDDeviceUsageKey |
|
static |
Add a new view menu for full screen toggling to the application menu bar (MacOSX Only)
Creates an NSMenu called "View" and add a single entry: "Toggle Full Screen". The menu item triggers the selector toggleFullScreen when invoked. The hot key is Option-Enter (ALT-Enter)
This function tests if it's running on 10.6 or higher, if this test fails, the function does nothing.
|
static |
Add a new view menu for window selection to the application menu bar (MacOSX Only)
Creates an NSMenu called "Window" and add a several entries.
"Minimize" with a hot key of Option-M and calls performMiniaturize "Zoom" with no hot key and calls performZoom "Bring All to Front" with no hot key and calls arrangeInFront
|
static |
Execute a tool and capture the text output.
If another program needs to be executed, call it with a command line and capture the text output into a stream if desired
pFilename | Pointer to a "C" string of the executable in Burgerlib format |
pParameters | Pointer to a "C" string of the command line parameters (No translation is performed) |
pOutput | Pointer to a OutputMemoryStream to store the captured output. NULL is acceptable if output capturing is not desired |
|
static |
Query the application's plist for the Bundle name.
To determine the name of the application for updating menus or other systems that need the application's for display, call this function which checks "CFBundleDisplayName" first, "CFBundleName" second and the processName last.
Get the name of a monitor (MacOSX Only)
Given a CGDirectDisplayID, return the name of a monitor. If the monitor has no name, in cases such as if it's a Mac without a monitor, it will be set to "Inactive"
pOutput | Pointer to the String to receive the name of the monitor |
uDisplayID | CGDirectDisplayID of the monitor to obtain the name from |
|
inlinestaticnoexcept |
Get the current flag to treat warnings as fatal errors.
When Burger::Debug::Warning is called, it will test the state of this boolean flag and if TRUE, it will abort code execution and exit immediately.
|
inlinestaticnoexcept |
Get the current error code the application will return on exit.
When the main() function exits, this is the error code that should be returned.
|
inlinestaticnoexcept |
Get the pointer to the global error message buffer.
Calls to many functions that fail will update this buffer to return verbose output.
|
inlinestaticnoexcept |
Get the "shutdown in progress" flag.
If the application has called Globals::Shutdown(), this flag is set to TRUE to prevent recursion if Globals::Shutdown() is called by cleanup code.
|
static |
Obtain the name of an HID device (MacOSX Only)
Given an IOHIDDeviceRef, query for a device name, and if none is found, a manufacturer name and store it in the output.
pOutput | Pointer to a String class instance to recieve the string |
pDevice | Pointer to a valid IOHIDDeviceRef |
|
staticnoexcept |
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.
By invoking DEEP magic, I will divine the version of QuickTimeX that is present. It will do a manual check of the system folder for either QTIM32.dll (Old) or Quicktime.qts (Current) and pull the version resource from the file.
|
static |
Load and launch a web page from an address string.
For Windows and MacOS platforms, this will open a web browser to a specific URL. It will use the default browser selected by the user from the operating system settings
pURL | Pointer to a UTF8 string with the URL to a web page to open |
|
static |
Get an integer from a Dictionary (MacOSX Only)
Given a CFDictionaryRef and a query key, look up the item in the dictionary and if present, return the value as an integer. Returns zero on failure.
pDictionary | CFDictionaryRef of the dictionary to query |
pKey | "C" string of the data to query |
|
static |
Create the global Burgerlib Window Class.
Windows requires a WNDCLASS definition declared to allow the creation of application specific windows. Burgerlib uses it's own custom callback function and it's declared after this function is called which calls RegisterClassExW() in windows that creates an ATOM of the type BurgerGameClass.
The string can be obtained with a call to get_window_class_name() if it's desired for an application to create a Burgerlib window without Burgerlib doing it for you.
The ATOM is released on application shutdown, or manually with a call to UnregisterWindowClass()
If this function had previously created the game class, it will return the ATOM that was created before and exit immediately.
uIconResID | Numeric ID of the Windows Icon to attach to the window that's in the EXE files resource data (0 to use the default application icon from Windows) |
Set the current flag to treat warnings as fatal errors.
When Burger::Debug::Warning is called, it will test the state of this boolean flag and if TRUE, it will abort code execution and exit immediately.
uNewFlag | If non-zero, it will set the flag, zero will clear it. |
|
inlinestaticnoexcept |
Set the current error code.
When the application shuts down, main() will return an integer error code. This function will set that code.
iNewError | The new error code, zero means no error. |
|
static |
|
inlinestaticnoexcept |
Set the current flag if a shut down is in progress.
If the application has called Globals::Shutdown(), this flag is set to TRUE to prevent recursion if Globals::Shutdown() is called by cleanup code.
This function should set this flag if it's implementing its own form of Globals::Shutdown() or is manually calling exit()
uNewFlag | If non-zero, it will set the flag, zero will clear it. |
|
static |
Immediately shut down the application with an error code.
Calls exit() with the error code (Default is zero)
iError | Error code to return when main() is returned from. |
|
static |
Immediately shut down the application.
Calls exit() with the currently logged error code (Default is zero) The exit flag is set to prevent recursion.
|
static |
Release the global Burgerlib Window Class.
When RegisterWindowClass(uint_t) is called, it will create a global ATOM of the window class. This function will unregister the class. This function is called on shutdown automatically
|
static |
Return the version of Burgerlib.
Returns the version of Burgerlib in a single number.
Currently, Burgerlib is 5.0.3
|
static |
Return the build number of Burgerlib.
Returns the change list number that generated this version of Burgerlib. Use this value to determine if a specific version is needed for compatibility
|
staticprivate |
Global TRUE if the app is in the process of shutting down.
|
staticprivate |
TRUE if Quicktime's version is valid.
(Windows only)
|
staticprivate |
Global Buffer containing the last fatal error or warning.
|
staticprivate |
Singleton instance of the global variables.
|
staticprivate |
Global default error code used by Globals::Shutdown().
|
staticprivate |
Atom assigned to my class (Windows only)
|
staticprivate |
QuickTime's version in 0x0102 (1.2) format.
(Windows only)
|
private |