doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Enumerations | Functions | Variables
PreferencesDialog.cpp File Reference
#include "../../idlib/precompiled.h"
#include <Carbon/Carbon.h>
#include "PreferencesDialog.h"
#include "PickMonitor.h"
#include <list>
#include <set>

Go to the source code of this file.

Classes

struct  PrefInfo
 
struct  Res
 

Macros

#define kPref_PrefsDialogAlways   CFSTR("PrefsDialogAlways")
 
#define kPref_PrefsDialogOpenAL   CFSTR("UseOpenAL")
 
#define kAppCreator   'DOM3'
 
#define EnablePopupMenuItem(inControl, inMenuItem)   EnableMenuItem(GetControlPopupMenuRef(inControl),inMenuItem)
 
#define DisablePopupMenuItem(inControl, inMenuItem)   DisableMenuItem(GetControlPopupMenuRef(inControl),inMenuItem)
 
#define IsPopupMenuItemEnabled(inControl, inMenuItem)   IsMenuItemEnabled(GetControlPopupMenuRef(inControl),inMenuItem)
 

Enumerations

enum  {
  kCmdFullscreen = 'Full', kCmdInAWindow = 'Wind', kCmdResolution = 'Reso', kCmdRefreshRate = 'Refr',
  kCmdChooseMonitors = 'Moni'
}
 

Functions

bool R_GetModeInfo (int *width, int *height, int mode)
 
void Sys_DoPreferences (void)
 
Res MakeRes (int width, int height, int depth)
 
Res MakeRes (int width, int height, int depth, UInt32 resFlags)
 
 if (!ValidDisplayID(prefInfo.prefDisplayID)) prefInfo.prefDisplayID
 
 if (err!=noErr) return err
 
 SetWRefCon (prefInfo.window,(long)&prefInfo)
 
 GetControlByID (prefInfo.window,&kFullscreenBtn,&prefInfo.fullscreenBtn)
 
 assert (prefInfo.fullscreenBtn)
 
 if (!prefInfo.multiMonitor)
 
 SetControlValue (prefInfo.refreshRatePopup, prefInfo.freqMenuIndex)
 
 InstallWindowEventHandler (prefInfo.window, handler, 1,&cmdEvent,&prefInfo, NULL)
 
 RepositionWindow (prefInfo.window, NULL, kWindowAlertPositionOnMainScreen)
 
 if (outWindow)*outWindow
 
OSStatus RunGameDisplayPreferencesDialog (GameDisplayInfo *outGDInfo, WindowRef inWindow)
 

Variables

const UInt32 kRes_Stretched = (1 << 0)
 
const UInt32 kRes_Safe = (1 << 1)
 
static WindowRef * outWindow
 
static WindowRef
ValidModeCallbackProc
inCallback OSStatus 
err = noErr
 
prefInfo prefGameDisplayMode = inGDInfo->mode
 
prefInfo prefDisplayID = inGDInfo->displayID
 
prefInfo prefWidth = inGDInfo->width
 
prefInfo prefHeight = inGDInfo->height
 
prefInfo prefDepth = inGDInfo->depth
 
prefInfo prefFrequency = inGDInfo->frequency
 
prefInfo prefResFlags = inGDInfo->resFlags
 
prefInfo window = NULL
 
prefInfo okPressed = false
 
Boolean result = CFPreferencesGetAppBooleanValue (kPref_PrefsDialogAlways, kCFPreferencesCurrentApplication, &keyFound)
 
Boolean keyFound
 
prefInfo prefAlways = result && keyFound
 
prefInfo prefOpenAL = result && keyFound
 
prefInfo callback = inCallback
 
IBNibRef aslNib
 
CFBundleRef theBundle = CFBundleGetMainBundle()
 
prefInfo multiMonitor = CanUserPickMonitor()
 
EventTypeSpec cmdEvent = { kEventClassCommand, kEventCommandProcess }
 
EventHandlerUPP handler = GetPrefHandlerUPP()
 

Macro Definition Documentation

#define DisablePopupMenuItem (   inControl,
  inMenuItem 
)    DisableMenuItem(GetControlPopupMenuRef(inControl),inMenuItem)

Definition at line 209 of file PreferencesDialog.cpp.

#define EnablePopupMenuItem (   inControl,
  inMenuItem 
)    EnableMenuItem(GetControlPopupMenuRef(inControl),inMenuItem)

Definition at line 208 of file PreferencesDialog.cpp.

#define IsPopupMenuItemEnabled (   inControl,
  inMenuItem 
)    IsMenuItemEnabled(GetControlPopupMenuRef(inControl),inMenuItem)

Definition at line 210 of file PreferencesDialog.cpp.

#define kAppCreator   'DOM3'

Definition at line 42 of file PreferencesDialog.cpp.

#define kPref_PrefsDialogAlways   CFSTR("PrefsDialogAlways")

Definition at line 38 of file PreferencesDialog.cpp.

#define kPref_PrefsDialogOpenAL   CFSTR("UseOpenAL")

Definition at line 39 of file PreferencesDialog.cpp.

Enumeration Type Documentation

anonymous enum
Enumerator
kCmdFullscreen 
kCmdInAWindow 
kCmdResolution 
kCmdRefreshRate 
kCmdChooseMonitors 

Definition at line 213 of file PreferencesDialog.cpp.

Function Documentation

assert ( prefInfo.  fullscreenBtn)
GetControlByID ( prefInfo.  window,
kFullscreenBtn,
&prefInfo.  fullscreenBtn 
)
if ( ValidDisplayIDprefInfo.prefDisplayID)
if ( err!  = noErr)
if ( !prefInfo.  multiMonitor)

Definition at line 768 of file PreferencesDialog.cpp.

if ( outWindow  )
InstallWindowEventHandler ( prefInfo.  window,
handler  ,
,
cmdEvent,
prefInfo,
NULL   
)
Res MakeRes ( int  width,
int  height,
int  depth 
)
inline

Definition at line 256 of file PreferencesDialog.cpp.

Res MakeRes ( int  width,
int  height,
int  depth,
UInt32  resFlags 
)
inline

Definition at line 262 of file PreferencesDialog.cpp.

bool R_GetModeInfo ( int width,
int height,
int  mode 
)
RepositionWindow ( prefInfo.  window,
NULL  ,
kWindowAlertPositionOnMainScreen   
)
OSStatus RunGameDisplayPreferencesDialog ( GameDisplayInfo outGDInfo,
WindowRef  inWindow 
)

Definition at line 807 of file PreferencesDialog.cpp.

SetControlValue ( prefInfo.  refreshRatePopup,
prefInfo.  freqMenuIndex 
)
SetWRefCon ( prefInfo.  window,
(long)&  prefInfo 
)
void Sys_DoPreferences ( void  )

Definition at line 124 of file PreferencesDialog.cpp.

Variable Documentation

IBNibRef aslNib

Definition at line 744 of file PreferencesDialog.cpp.

prefInfo callback = inCallback

Definition at line 734 of file PreferencesDialog.cpp.

EventTypeSpec cmdEvent = { kEventClassCommand, kEventCommandProcess }

Definition at line 788 of file PreferencesDialog.cpp.

return err = noErr

Definition at line 708 of file PreferencesDialog.cpp.

EventHandlerUPP handler = GetPrefHandlerUPP()

Definition at line 789 of file PreferencesDialog.cpp.

Boolean keyFound

Definition at line 728 of file PreferencesDialog.cpp.

const UInt32 kRes_Safe = (1 << 1)

Definition at line 46 of file PreferencesDialog.cpp.

const UInt32 kRes_Stretched = (1 << 0)

Definition at line 45 of file PreferencesDialog.cpp.

prefInfo multiMonitor = CanUserPickMonitor()

Definition at line 766 of file PreferencesDialog.cpp.

prefInfo okPressed = false

Definition at line 725 of file PreferencesDialog.cpp.

WindowRef* outWindow

Definition at line 706 of file PreferencesDialog.cpp.

prefInfo prefAlways = result && keyFound

Definition at line 730 of file PreferencesDialog.cpp.

prefInfo prefDepth = inGDInfo->depth

Definition at line 721 of file PreferencesDialog.cpp.

prefInfo prefDisplayID = inGDInfo->displayID

Definition at line 718 of file PreferencesDialog.cpp.

prefInfo prefFrequency = inGDInfo->frequency

Definition at line 722 of file PreferencesDialog.cpp.

prefInfo prefGameDisplayMode = inGDInfo->mode

Definition at line 717 of file PreferencesDialog.cpp.

prefInfo prefHeight = inGDInfo->height

Definition at line 720 of file PreferencesDialog.cpp.

prefInfo prefOpenAL = result && keyFound

Definition at line 732 of file PreferencesDialog.cpp.

prefInfo prefResFlags = inGDInfo->resFlags

Definition at line 723 of file PreferencesDialog.cpp.

prefInfo prefWidth = inGDInfo->width

Definition at line 719 of file PreferencesDialog.cpp.

result = CFPreferencesGetAppBooleanValue (kPref_PrefsDialogAlways, kCFPreferencesCurrentApplication, &keyFound)

Definition at line 727 of file PreferencesDialog.cpp.

CFBundleRef theBundle = CFBundleGetMainBundle()

Definition at line 745 of file PreferencesDialog.cpp.

prefInfo window = NULL

Definition at line 724 of file PreferencesDialog.cpp.