BurgerLib
Public Member Functions | Private Types | Private Attributes
Burger::MacDim Class Reference

Wrapper class to detect and manage the MacDim screen saver shell. More...

#include <macdimglue.h>

List of all members.

Public Member Functions

 MacDim ()
 Default MacDim constructor.
 ~MacDim ()
 Default MacDim destructor.
State_e BURGER_API GetState (void) const
 Return the current state of MacDim.
void BURGER_API SetState (State_e uState)
 Set the state MacDim should be in.
void BURGER_API Init (void)
 Detect if MacDim is installed.
Word BURGER_API IsInPrefsMode (void)
 Return TRUE if the caller should invoke the prefs dialog.

Private Types

enum  State_e { Inactive, InPrefs, DimmerActive }

Private Attributes

Int32 m_DimmerVersion
 Mac Dim version (0,1 or 2).
Int32 m_DimmerCmdUPP
 Mac Dimmer control panel callback.

Detailed Description

Wrapper class to detect and manage the MacDim screen saver shell.

Code to detect the MacDim screen saver under MacOS 9 (Classic).

Note:
This class does nothing on Carbon or MacOSX targets. MacDim is a screen saver shell that runs under MacOS 9 only.

Member Enumeration Documentation

enum Burger::MacDim::State_e [private]
Enumerator:
Inactive 

MacDim is not present or disabled.

InPrefs 

MacDim is in the preferences dialog.

DimmerActive 

MacDim is currently running a screen saver.


Constructor & Destructor Documentation

Default MacDim constructor.

Initialize the MacDim class by clearing out my variables.

Default MacDim destructor.

Clear out the data and release the allocated routine descriptor (MacOS 9 only).


Member Function Documentation

Return the current state of MacDim.

Get the state MacDim is in, i.e. none, in prefs or the screen dimmer is active. Only returns meaningful values in version 2 or higher of MacDim and if Init() is called beforehand. Otherwise, it will return Burger::MacDim::State_e::Inactive.

Returns:
A valid Burger::MacDim::State_e.
Note:
This function always returns Burger::MacDim::State_e::Inactive on Carbon or MacOSX targets.

Detect if MacDim is installed.

Detect if MacDim is installed and if so, find the version and grab the callback pointer

Note:
This function does nothing on Carbon or MacOSX targets.

Return TRUE if the caller should invoke the prefs dialog.

Detect if MacDim is running and if it's requesting the screen saver to display a preferences configuration dialog. It will also perform a call to GetKeys() and read in the current state of the shift and control keys and if wither the left shift or left control key is pressed, it will return TRUE anyways so a standalone calling of a screen saver can display it's preferences without the screen saver shell.

Returns:
TRUE, if the preferences dialog should be displayed. FALSE, if not.
Note:
This function performs the keyboard tests on all platforms, the MacDim test on Classic only.

Set the state MacDim should be in.

The only legal value now is Burger::MacDim::State_e::Inactive. The state should be set to Burger::MacDim::State_e::Inactive when the module is executed in the prefs-state to acknowledge that the prefs state should terminate. Only works in version 2 or higher of MacDim and if Init() is called beforehand.

Parameters:
uStateState that should be set.
Note:
This function does nothing on Carbon or MacOSX targets.

Member Data Documentation

Mac Dimmer control panel callback.

Mac Dim version (0,1 or 2).