Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_Environment.h File Reference


Namespaces

namespace  CP_Environment

Application Info

CPLAT::CP_String GetAppName ()
FourCharCode GetCreator ()
CPLAT::CP_FileSystemSpec GetAppSpec ()
CPLAT::CP_FileSystemSpec GetAppFolder ()

OS Info

UInt32 GetOSVersion ()

Testers

bool IsOSX ()

UI

CP_RGBColor GetButtonColor (SInt16 inColorIndex)

Unicode

bool HasUnicode ()

Features

bool IsFeatureAvailable_Mac (OSType inSelector, UInt32 inAttribute)
bool HasCarbonVersionOrGreater (SInt32 inDesiredVersion)
bool HasMPTasks ()
Ptr GetSharedLibrarySymbol (ConstStringPtr inLibraryName, ConstStringPtr inSymbolName)
bool HasSharedLibrarySymbol (UInt32 inSymbolName)

Defines

#define IsCFMAddressResolved(inAddress)   (true)

Enumerations

enum  {
  kCP_E_GrayscaleColor_WhiteIndex = 0, kCP_E_GrayscaleColor_BlackIndex = 1, kCP_E_GrayscaleColor_Gray1Index = 2, kCP_E_GrayscaleColor_Gray2Index = 3,
  kCP_E_GrayscaleColor_Gray3Index = 4, kCP_E_GrayscaleColor_Gray4Index = 5, kCP_E_GrayscaleColor_Gray5Index = 6, kCP_E_GrayscaleColor_Gray6Index = 7,
  kCP_E_GrayscaleColor_Gray7Index = 8, kCP_E_GrayscaleColor_Gray8Index = 9, kCP_E_GrayscaleColor_Gray9Index = 10, kCP_E_GrayscaleColor_Gray10Index = 11,
  kCP_E_GrayscaleColor_Gray11Index = 12, kCP_E_GrayscaleColor_Gray12Index = 13
}

Functions

bool IsNT ()
bool IsWin32 ()
bool IsWin32s ()
bool IsWin98 ()

Define Documentation

#define IsCFMAddressResolved inAddress   )     (true)
 


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
kCP_E_GrayscaleColor_WhiteIndex 
kCP_E_GrayscaleColor_BlackIndex 
kCP_E_GrayscaleColor_Gray1Index 
kCP_E_GrayscaleColor_Gray2Index 
kCP_E_GrayscaleColor_Gray3Index 
kCP_E_GrayscaleColor_Gray4Index 
kCP_E_GrayscaleColor_Gray5Index 
kCP_E_GrayscaleColor_Gray6Index 
kCP_E_GrayscaleColor_Gray7Index 
kCP_E_GrayscaleColor_Gray8Index 
kCP_E_GrayscaleColor_Gray9Index 
kCP_E_GrayscaleColor_Gray10Index 
kCP_E_GrayscaleColor_Gray11Index 
kCP_E_GrayscaleColor_Gray12Index 


Function Documentation

CP_String CP_Environment::GetAppName  ) 
 

Return the name of this application as a CP_String.

Exceptions:
OSError exceptions.
Returns:
CP_String const Returns the name this application.

FourCharCode CP_Environment::GetCreator  ) 
 

Returns the creator ccode for this application.

Exceptions:
OSError exceptions.
Returns:
FourCharCode Returns a FourCharCode for this application.

CPLAT::CP_FileSystemSpec CP_Environment::GetAppSpec  ) 
 

Returns a CP_FileSystemSpec object to the application.

Exceptions:
OSError / Runtime exceptions.
Returns:
CP_FileSystemSpec A file system spec that points to our application.

CP_FileSystemSpec CP_Environment::GetAppFolder  ) 
 

Returns the folder that the application is contained in.

Exceptions:
none 
Returns:
CP_FileSystemSpec The folder that contains the application.

UInt32 CP_Environment::GetOSVersion  ) 
 

Return the operating system version.

  • MacOS: Returns the gestalt version -- System 8.5 == 0x0850
  • Windows: The high word specifies the major version, and the low word the minor version.

Exceptions:
none 
Returns:
UInt32 The OS version being run on.

bool CP_Environment::IsOSX  ) 
 

Returns true if this application is running under MacOSX

Exceptions:
none 
Returns:
bool Returns true if running under OSX, false otherwise.

CP_RGBColor CP_Environment::GetButtonColor SInt16  inColorIndex  ) 
 

Returns a CP_RGBColor for Apples Grayscale appearance from the passed in color index.

Parameters:
inColorIndex Index into the grayscale color table.
Exceptions:
none 
Returns:
void

bool CP_Environment::HasUnicode  ) 
 

Retrurns true if the underlying OS will support Unicode.

Exceptions:
none 
Returns:
bool const True if Unicode is supported.

bool CP_Environment::IsFeatureAvailable_Mac OSType  inSelector,
UInt32  inAttribute
 

Calls upon Gestalt to determine if a features if available under MacOS.

Parameters:
inSelector The Gestalt selector.
inAttribute The attribute for the Gestalt call.
Exceptions:
none 
Returns:
bool True if the feature is available.

bool CP_Environment::HasCarbonVersionOrGreater SInt32  inDesiredVersion  ) 
 

Returns true if we have Carbon in a version that is at or greater than the passed in desired version. There are defines for the most common Carbon versions as follows:

  • kCP_E_CarbonVersion_1 = 0x00000100, // 1.0
  • kCP_E_CarbonVersion_11 = 0x00000110, // 1.1
  • kCP_E_CarbonVersion_12 = 0x00000120, // 1.2
  • kCP_E_CarbonVersion_13 = 0x00000130, // 1.3
  • kCP_E_CarbonVersion_14 = 0x00000140, // 1.4
  • kCP_E_CarbonVersion_15 = 0x00000150, // 1.5
  • kCP_E_CarbonVersion_16 = 0x00000160 // 1.6

Parameters:
inDesiredVersion The minimum version we are checking for.
Exceptions:
none 
Returns:
bool True if the Carbon version is equal or greater than the passed in version.

bool CP_Environment::HasMPTasks  ) 
 

Retrurns true if the underlying OS has support for MPTasks.

Exceptions:
none 
Returns:
bool True if MPTasks are supported.

Ptr CP_Environment::GetSharedLibrarySymbol ConstStringPtr  inLibraryName,
ConstStringPtr  inSymbolName
 

Return a Ptr to a shared library symbol.

Exceptions:
none 
Returns:
Ptr Ptr to the symbol.

bool CP_Environment::HasSharedLibrarySymbol UInt32  inSymbolName  ) 
 

Return true if the passed in library symbol is resolved.

Exceptions:
none 
Returns:
bool True if the passed in symbol is available.

bool CP_Environment::IsNT  ) 
 

Return true if we are running under Windows NT.

Exceptions:
none 
Returns:
bool True if we are running some version of Windows NT.

bool CP_Environment::IsWin32  ) 
 

Return true if we are running a version of Win32.

Exceptions:
none 
Returns:
bool True if we are running some version of Win32.

bool CP_Environment::IsWin32s  ) 
 

Return true if we are running a version of Win32s.

Exceptions:
none 
Returns:
bool True if we are running some version of Win32s.

bool CP_Environment::IsWin98  ) 
 

Return true if we are running a version of Windows 98 or later.

Exceptions:
none 
Returns:
bool True if we are running some version of Windows 98 or later.


Generated on Sat Sep 17 20:01:14 2005 for CPLAT by  doxygen 1.4.0