More consistent file names.

This commit is contained in:
Steve Checkoway
2008-04-29 05:48:50 +00:00
parent 6003843f0c
commit 6e44065a33
14 changed files with 110 additions and 110 deletions
@@ -1,5 +1,5 @@
#include "global.h" #include "global.h"
#include "ArchHooks_darwin.h" #include "ArchHooks_MacOSX.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "archutils/Unix/CrashHandler.h" #include "archutils/Unix/CrashHandler.h"
@@ -58,7 +58,7 @@ static bool DoEmergencyShutdown( int signal, siginfo_t *si, const ucontext_t *us
return false; return false;
} }
void ArchHooks_darwin::Init() void ArchHooks_MacOSX::Init()
{ {
/* First, handle non-fatal termination signals. */ /* First, handle non-fatal termination signals. */
SignalHandler::OnClose( DoCleanShutdown ); SignalHandler::OnClose( DoCleanShutdown );
@@ -125,7 +125,7 @@ void ArchHooks_darwin::Init()
CFRelease( path ); CFRelease( path );
} }
RString ArchHooks_darwin::GetArchName() const RString ArchHooks_MacOSX::GetArchName() const
{ {
#if defined(__ppc__) #if defined(__ppc__)
return "Mac OS X (ppc)"; return "Mac OS X (ppc)";
@@ -137,7 +137,7 @@ RString ArchHooks_darwin::GetArchName() const
} }
RString ArchHooks_darwin::GetMachineId() const RString ArchHooks_MacOSX::GetMachineId() const
{ {
RString ret; RString ret;
CFMutableDictionaryRef dict = IOServiceMatching( "IOPlatformExpertDevice" ); CFMutableDictionaryRef dict = IOServiceMatching( "IOPlatformExpertDevice" );
@@ -216,7 +216,7 @@ RString ArchHooks_darwin::GetMachineId() const
return ret; return ret;
} }
void ArchHooks_darwin::DumpDebugInfo() void ArchHooks_MacOSX::DumpDebugInfo()
{ {
/* Get system version */ /* Get system version */
@@ -350,7 +350,7 @@ RString ArchHooks::GetPreferredLanguage()
return ret; return ret;
} }
bool ArchHooks_darwin::GoToURL( RString sUrl ) bool ArchHooks_MacOSX::GoToURL( RString sUrl )
{ {
CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, (const UInt8*)sUrl.data(), CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, (const UInt8*)sUrl.data(),
sUrl.length(), kCFStringEncodingUTF8, NULL ); sUrl.length(), kCFStringEncodingUTF8, NULL );
@@ -1,9 +1,9 @@
#ifndef ARCH_HOOKS_DARWIN_H #ifndef ARCH_HOOKS_MACOSX_H
#define ARCH_HOOKS_DARWIN_H #define ARCH_HOOKS_MACOSX_H
#include "ArchHooks.h" #include "ArchHooks.h"
class ArchHooks_darwin : public ArchHooks class ArchHooks_MacOSX : public ArchHooks
{ {
public: public:
void Init(); void Init();
@@ -17,9 +17,9 @@ public:
#ifdef ARCH_HOOKS #ifdef ARCH_HOOKS
#error "More than one ArchHooks selected!" #error "More than one ArchHooks selected!"
#endif #endif
#define ARCH_HOOKS ArchHooks_darwin #define ARCH_HOOKS ArchHooks_MacOSX
#endif /* ARCH_HOOKS_DARWIN_H */ #endif /* ARCH_HOOKS_MACOSX_H */
/* /*
* (c) 2003-2005 Steve Checkoway * (c) 2003-2005 Steve Checkoway
@@ -1,12 +1,12 @@
#include "global.h" #include "global.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "DialogDriver_Cocoa.h" #include "DialogDriver_MacOSX.h"
#include "RageThreads.h" #include "RageThreads.h"
#include "ProductInfo.h" #include "ProductInfo.h"
#include "InputFilter.h" #include "InputFilter.h"
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
REGISTER_DIALOG_DRIVER_CLASS( Cocoa ); REGISTER_DIALOG_DRIVER_CLASS( MacOSX );
static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CFStringRef OK, static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CFStringRef OK,
CFStringRef alt = NULL, CFStringRef other = NULL) CFStringRef alt = NULL, CFStringRef other = NULL)
@@ -31,7 +31,7 @@ static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CF
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") ) #define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") )
void DialogDriver_Cocoa::OK( RString sMessage, RString sID ) void DialogDriver_MacOSX::OK( RString sMessage, RString sID )
{ {
CFBundleRef bundle = CFBundleGetMainBundle(); CFBundleRef bundle = CFBundleGetMainBundle();
CFStringRef sDSA = LSTRING( bundle, "Don't show again" ); CFStringRef sDSA = LSTRING( bundle, "Don't show again" );
@@ -42,12 +42,12 @@ void DialogDriver_Cocoa::OK( RString sMessage, RString sID )
Dialog::IgnoreMessage( sID ); Dialog::IgnoreMessage( sID );
} }
void DialogDriver_Cocoa::Error( RString sError, RString sID ) void DialogDriver_MacOSX::Error( RString sError, RString sID )
{ {
ShowAlert( kCFUserNotificationStopAlertLevel, sError, CFSTR("OK") ); ShowAlert( kCFUserNotificationStopAlertLevel, sError, CFSTR("OK") );
} }
Dialog::Result DialogDriver_Cocoa::AbortRetryIgnore( RString sMessage, RString sID ) Dialog::Result DialogDriver_MacOSX::AbortRetryIgnore( RString sMessage, RString sID )
{ {
CFBundleRef bundle = CFBundleGetMainBundle(); CFBundleRef bundle = CFBundleGetMainBundle();
CFStringRef sIgnore = LSTRING( bundle, "Ignore" ); CFStringRef sIgnore = LSTRING( bundle, "Ignore" );
@@ -73,7 +73,7 @@ Dialog::Result DialogDriver_Cocoa::AbortRetryIgnore( RString sMessage, RString s
} }
} }
Dialog::Result DialogDriver_Cocoa::AbortRetry( RString sMessage, RString sID ) Dialog::Result DialogDriver_MacOSX::AbortRetry( RString sMessage, RString sID )
{ {
CFBundleRef bundle = CFBundleGetMainBundle(); CFBundleRef bundle = CFBundleGetMainBundle();
CFStringRef sRetry = LSTRING( bundle, "Retry" ); CFStringRef sRetry = LSTRING( bundle, "Retry" );
@@ -1,9 +1,9 @@
#ifndef DIALOG_BOX_DRIVER_COCOA_H #ifndef DIALOG_BOX_DRIVER_MACOSX_H
#define DIALOG_BOX_DRIVER_COCOA_H #define DIALOG_BOX_DRIVER_MACOSX_H
#include "DialogDriver.h" #include "DialogDriver.h"
class DialogDriver_Cocoa: public DialogDriver class DialogDriver_MacOSX: public DialogDriver
{ {
public: public:
void Error( RString sError, RString sID ); void Error( RString sError, RString sID );
@@ -1,6 +1,6 @@
#include "global.h" #include "global.h"
#include "RageLog.h" #include "RageLog.h"
#include "InputHandler_Carbon.h" #include "InputHandler_MacOSX_HID.h"
#include "Foreach.h" #include "Foreach.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "InputFilter.h" #include "InputFilter.h"
@@ -12,15 +12,15 @@
#include <IOKit/IOMessage.h> #include <IOKit/IOMessage.h>
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
REGISTER_INPUT_HANDLER_CLASS( Carbon ); REGISTER_INPUT_HANDLER_CLASS2( HID, MacOSX_HID );
void InputHandler_Carbon::QueueCallBack( void *target, int result, void *refcon, void *sender ) void InputHandler_MacOSX_HID::QueueCallBack( void *target, int result, void *refcon, void *sender )
{ {
// The result seems useless as you can't actually return anything... // The result seems useless as you can't actually return anything...
// refcon is the Device number // refcon is the Device number
RageTimer now; RageTimer now;
InputHandler_Carbon *This = (InputHandler_Carbon *)target; InputHandler_MacOSX_HID *This = (InputHandler_MacOSX_HID *)target;
IOHIDQueueInterface **queue = (IOHIDQueueInterface **)sender; IOHIDQueueInterface **queue = (IOHIDQueueInterface **)sender;
IOHIDEventStruct event; IOHIDEventStruct event;
AbsoluteTime zeroTime = { 0, 0 }; AbsoluteTime zeroTime = { 0, 0 };
@@ -40,9 +40,9 @@ static void RunLoopStarted( CFRunLoopObserverRef o, CFRunLoopActivity a, void *s
((RageSemaphore *)sem)->Post(); ((RageSemaphore *)sem)->Post();
} }
int InputHandler_Carbon::Run( void *data ) int InputHandler_MacOSX_HID::Run( void *data )
{ {
InputHandler_Carbon *This = (InputHandler_Carbon *)data; InputHandler_MacOSX_HID *This = (InputHandler_MacOSX_HID *)data;
This->m_LoopRef = CFRunLoopGetCurrent(); This->m_LoopRef = CFRunLoopGetCurrent();
CFRetain( This->m_LoopRef ); CFRetain( This->m_LoopRef );
@@ -64,7 +64,7 @@ int InputHandler_Carbon::Run( void *data )
} }
/* Add a source for ending the run loop. This serves two purposes: /* Add a source for ending the run loop. This serves two purposes:
* 1. it provides a way to terminate the run loop when IH_Carbon exists, and * 1. it provides a way to terminate the run loop when IH_MacOSX_HID exists, and
* 2. it ensures that CFRunLoopRun() doesn't return immediately if there are no other sources. */ * 2. it ensures that CFRunLoopRun() doesn't return immediately if there are no other sources. */
{ {
/* Being a little tricky here, the perform callback takes a void* and returns nothing. /* Being a little tricky here, the perform callback takes a void* and returns nothing.
@@ -84,19 +84,19 @@ int InputHandler_Carbon::Run( void *data )
return 0; return 0;
} }
void InputHandler_Carbon::DeviceAdded( void *refCon, io_iterator_t ) void InputHandler_MacOSX_HID::DeviceAdded( void *refCon, io_iterator_t )
{ {
InputHandler_Carbon *This = (InputHandler_Carbon *)refCon; InputHandler_MacOSX_HID *This = (InputHandler_MacOSX_HID *)refCon;
LockMut( This->m_ChangeLock ); LockMut( This->m_ChangeLock );
This->m_bChanged = true; This->m_bChanged = true;
} }
void InputHandler_Carbon::DeviceChanged( void *refCon, io_service_t service, natural_t messageType, void *arg ) void InputHandler_MacOSX_HID::DeviceChanged( void *refCon, io_service_t service, natural_t messageType, void *arg )
{ {
if( messageType == kIOMessageServiceIsTerminated ) if( messageType == kIOMessageServiceIsTerminated )
{ {
InputHandler_Carbon *This = (InputHandler_Carbon *)refCon; InputHandler_MacOSX_HID *This = (InputHandler_MacOSX_HID *)refCon;
LockMut( This->m_ChangeLock ); LockMut( This->m_ChangeLock );
This->m_bChanged = true; This->m_bChanged = true;
@@ -104,20 +104,20 @@ void InputHandler_Carbon::DeviceChanged( void *refCon, io_service_t service, nat
} }
// m_LoopRef needs to be set before this is called // m_LoopRef needs to be set before this is called
void InputHandler_Carbon::StartDevices() void InputHandler_MacOSX_HID::StartDevices()
{ {
int n = 0; int n = 0;
ASSERT( m_LoopRef ); ASSERT( m_LoopRef );
FOREACH( HIDDevice *, m_vDevices, i ) FOREACH( HIDDevice *, m_vDevices, i )
(*i)->StartQueue( m_LoopRef, InputHandler_Carbon::QueueCallBack, this, n++ ); (*i)->StartQueue( m_LoopRef, InputHandler_MacOSX_HID::QueueCallBack, this, n++ );
CFRunLoopSourceRef runLoopSource = IONotificationPortGetRunLoopSource( m_NotifyPort ); CFRunLoopSourceRef runLoopSource = IONotificationPortGetRunLoopSource( m_NotifyPort );
CFRunLoopAddSource( m_LoopRef, runLoopSource, kCFRunLoopDefaultMode ); CFRunLoopAddSource( m_LoopRef, runLoopSource, kCFRunLoopDefaultMode );
} }
InputHandler_Carbon::~InputHandler_Carbon() InputHandler_MacOSX_HID::~InputHandler_MacOSX_HID()
{ {
FOREACH( HIDDevice *, m_vDevices, i ) FOREACH( HIDDevice *, m_vDevices, i )
delete *i; delete *i;
@@ -169,12 +169,12 @@ static HIDDevice *MakeDevice( InputDevice id )
return NULL; return NULL;
} }
void InputHandler_Carbon::AddDevices( int usagePage, int usage, InputDevice &id ) void InputHandler_MacOSX_HID::AddDevices( int usagePage, int usage, InputDevice &id )
{ {
io_iterator_t iter; io_iterator_t iter;
CFDictionaryRef dict = GetMatchingDictionary( usagePage, usage ); CFDictionaryRef dict = GetMatchingDictionary( usagePage, usage );
kern_return_t ret = IOServiceAddMatchingNotification( m_NotifyPort, kIOFirstMatchNotification, dict, kern_return_t ret = IOServiceAddMatchingNotification( m_NotifyPort, kIOFirstMatchNotification, dict,
InputHandler_Carbon::DeviceAdded, this, &iter ); InputHandler_MacOSX_HID::DeviceAdded, this, &iter );
io_object_t device; io_object_t device;
if( ret != KERN_SUCCESS ) if( ret != KERN_SUCCESS )
@@ -206,7 +206,7 @@ void InputHandler_Carbon::AddDevices( int usagePage, int usage, InputDevice &id
m_vDevices.push_back( dev ); m_vDevices.push_back( dev );
ret = IOServiceAddInterestNotification( m_NotifyPort, device, kIOGeneralInterest, ret = IOServiceAddInterestNotification( m_NotifyPort, device, kIOGeneralInterest,
InputHandler_Carbon::DeviceChanged, this, &i ); InputHandler_MacOSX_HID::DeviceChanged, this, &i );
if( ret == KERN_SUCCESS ) if( ret == KERN_SUCCESS )
m_vIters.push_back( i ); m_vIters.push_back( i );
@@ -214,7 +214,7 @@ void InputHandler_Carbon::AddDevices( int usagePage, int usage, InputDevice &id
} }
} }
InputHandler_Carbon::InputHandler_Carbon() : m_Sem( "Input thread started" ), m_ChangeLock( "Input handler change lock" ) InputHandler_MacOSX_HID::InputHandler_MacOSX_HID() : m_Sem( "Input thread started" ), m_ChangeLock( "Input handler change lock" )
{ {
InputDevice id = DEVICE_KEYBOARD; InputDevice id = DEVICE_KEYBOARD;
@@ -233,7 +233,7 @@ InputHandler_Carbon::InputHandler_Carbon() : m_Sem( "Input thread started" ), m_
if( PREFSMAN->m_bThreadedInput ) if( PREFSMAN->m_bThreadedInput )
{ {
m_InputThread.SetName( "Input thread" ); m_InputThread.SetName( "Input thread" );
m_InputThread.Create( InputHandler_Carbon::Run, this ); m_InputThread.Create( InputHandler_MacOSX_HID::Run, this );
// Wait for the run loop to start before returning. // Wait for the run loop to start before returning.
m_Sem.Wait(); m_Sem.Wait();
} }
@@ -245,13 +245,13 @@ InputHandler_Carbon::InputHandler_Carbon() : m_Sem( "Input thread started" ), m_
} }
} }
void InputHandler_Carbon::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) void InputHandler_MacOSX_HID::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices )
{ {
FOREACH_CONST( HIDDevice *, m_vDevices, i ) FOREACH_CONST( HIDDevice *, m_vDevices, i )
(*i)->GetDevicesAndDescriptions( vDevices ); (*i)->GetDevicesAndDescriptions( vDevices );
} }
RString InputHandler_Carbon::GetDeviceSpecificInputString( const DeviceInput &di ) RString InputHandler_MacOSX_HID::GetDeviceSpecificInputString( const DeviceInput &di )
{ {
if( di.device == DEVICE_KEYBOARD ) if( di.device == DEVICE_KEYBOARD )
{ {
@@ -341,7 +341,7 @@ RString InputHandler_Carbon::GetDeviceSpecificInputString( const DeviceInput &di
return InputHandler::GetDeviceSpecificInputString( di ); return InputHandler::GetDeviceSpecificInputString( di );
} }
wchar_t InputHandler_Carbon::DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers ) wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers )
{ {
// KeyTranslate maps these keys to a character. They shouldn't be mapped to any character. // KeyTranslate maps these keys to a character. They shouldn't be mapped to any character.
switch( button ) switch( button )
@@ -1,5 +1,5 @@
#ifndef JOYSTICK_H #ifndef INPUT_HANDLER_MACOSX_HID_H
#define JOYSTICK_H #define INPUT_HANDLER_MACOSX_HID_H
#include <vector> #include <vector>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
@@ -9,7 +9,7 @@
class HIDDevice; class HIDDevice;
class InputHandler_Carbon : public InputHandler class InputHandler_MacOSX_HID : public InputHandler
{ {
private: private:
vector<HIDDevice *> m_vDevices; vector<HIDDevice *> m_vDevices;
@@ -29,8 +29,8 @@ private:
void AddDevices( int usagePage, int usage, InputDevice &id ); void AddDevices( int usagePage, int usage, InputDevice &id );
public: public:
InputHandler_Carbon(); InputHandler_MacOSX_HID();
~InputHandler_Carbon(); ~InputHandler_MacOSX_HID();
bool DevicesChanged() { LockMut( m_ChangeLock ); return m_bChanged; } bool DevicesChanged() { LockMut( m_ChangeLock ); return m_bChanged; }
void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevicesOut ); void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevicesOut );
@@ -12,7 +12,7 @@ LoadingWindow *LoadingWindow::Create()
return new LoadingWindow_Null; return new LoadingWindow_Null;
#endif #endif
/* Don't load NULL by default. */ /* Don't load NULL by default. */
const RString drivers = "xbox,win32,cocoa,gtk"; const RString drivers = "xbox,win32,macosx,gtk";
vector<RString> DriversToTry; vector<RString> DriversToTry;
split( drivers, ",", DriversToTry, true ); split( drivers, ",", DriversToTry, true );
@@ -25,8 +25,8 @@ LoadingWindow *LoadingWindow::Create()
{ {
Driver = DriversToTry[i]; Driver = DriversToTry[i];
#ifdef USE_LOADING_WINDOW_COCOA #ifdef USE_LOADING_WINDOW_MACOSX
if( !DriversToTry[i].CompareNoCase("Cocoa") ) ret = new LoadingWindow_Cocoa; if( !DriversToTry[i].CompareNoCase("MacOSX") ) ret = new LoadingWindow_MacOSX;
#endif #endif
#ifdef USE_LOADING_WINDOW_GTK #ifdef USE_LOADING_WINDOW_GTK
if( !DriversToTry[i].CompareNoCase("Gtk") ) ret = new LoadingWindow_Gtk; if( !DriversToTry[i].CompareNoCase("Gtk") ) ret = new LoadingWindow_Gtk;
@@ -1,18 +1,18 @@
/* LoadingWindow_Cocoa - Loading window for OSX */ /* LoadingWindow_MacOSX - Loading window for OSX */
#ifndef LOADING_WINDOW_COCOA_H #ifndef LOADING_WINDOW_MACOSX_H
#define LOADING_WINDOW_COCOA_H #define LOADING_WINDOW_MACOSX_H
#include "LoadingWindow.h" #include "LoadingWindow.h"
class LoadingWindow_Cocoa : public LoadingWindow class LoadingWindow_MacOSX : public LoadingWindow
{ {
public: public:
LoadingWindow_Cocoa(); LoadingWindow_MacOSX();
~LoadingWindow_Cocoa(); ~LoadingWindow_MacOSX();
void SetText( RString str ); void SetText( RString str );
}; };
#define USE_LOADING_WINDOW_COCOA #define USE_LOADING_WINDOW_MACOSX
#endif #endif
@@ -1,6 +1,6 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "ProductInfo.h" #import "ProductInfo.h"
#import "LoadingWindow_Cocoa.h" #import "LoadingWindow_MacOSX.h"
#import "RageUtil.h" #import "RageUtil.h"
#import "RageFile.h" #import "RageFile.h"
@@ -74,7 +74,7 @@
static LoadingWindowHelper *g_Helper = nil; static LoadingWindowHelper *g_Helper = nil;
LoadingWindow_Cocoa::LoadingWindow_Cocoa() LoadingWindow_MacOSX::LoadingWindow_MacOSX()
{ {
RageFile f; RageFile f;
RString data; RString data;
@@ -104,7 +104,7 @@ LoadingWindow_Cocoa::LoadingWindow_Cocoa()
[image release]; [image release];
} }
LoadingWindow_Cocoa::~LoadingWindow_Cocoa() LoadingWindow_MacOSX::~LoadingWindow_MacOSX()
{ {
if( !g_Helper ) if( !g_Helper )
return; return;
@@ -115,7 +115,7 @@ LoadingWindow_Cocoa::~LoadingWindow_Cocoa()
[pool release]; [pool release];
} }
void LoadingWindow_Cocoa::SetText( RString str ) void LoadingWindow_MacOSX::SetText( RString str )
{ {
if( !g_Helper ) if( !g_Helper )
return; return;
@@ -1,5 +1,5 @@
#ifndef LOW_LEVEL_WINDOW_COCOA_H #ifndef LOW_LEVEL_WINDOW_MACOSX_H
#define LOW_LEVEL_WINDOW_COCOA_H #define LOW_LEVEL_WINDOW_MACOSX_H
#include "LowLevelWindow.h" #include "LowLevelWindow.h"
#include "RageDisplay.h" #include "RageDisplay.h"
@@ -7,7 +7,7 @@
typedef struct objc_object *id; typedef struct objc_object *id;
typedef const struct __CFDictionary *CFDictionaryRef; typedef const struct __CFDictionary *CFDictionaryRef;
class LowLevelWindow_Cocoa : public LowLevelWindow class LowLevelWindow_MacOSX : public LowLevelWindow
{ {
VideoModeParams m_CurrentParams; VideoModeParams m_CurrentParams;
id m_WindowDelegate; id m_WindowDelegate;
@@ -16,8 +16,8 @@ class LowLevelWindow_Cocoa : public LowLevelWindow
CFDictionaryRef m_CurrentDisplayMode; CFDictionaryRef m_CurrentDisplayMode;
public: public:
LowLevelWindow_Cocoa(); LowLevelWindow_MacOSX();
~LowLevelWindow_Cocoa(); ~LowLevelWindow_MacOSX();
void *GetProcAddress( RString s ); void *GetProcAddress( RString s );
RString TryVideoMode( const VideoModeParams& p, bool& newDeviceOut ); RString TryVideoMode( const VideoModeParams& p, bool& newDeviceOut );
void GetDisplayResolutions( DisplayResolutions &dr ) const; void GetDisplayResolutions( DisplayResolutions &dr ) const;
@@ -43,7 +43,7 @@ private:
#ifdef ARCH_LOW_LEVEL_WINDOW #ifdef ARCH_LOW_LEVEL_WINDOW
#error "More than one LowLevelWindow selected!" #error "More than one LowLevelWindow selected!"
#endif #endif
#define ARCH_LOW_LEVEL_WINDOW LowLevelWindow_Cocoa #define ARCH_LOW_LEVEL_WINDOW LowLevelWindow_MacOSX
#endif #endif
@@ -1,5 +1,5 @@
#import "global.h" #import "global.h"
#import "LowLevelWindow_Cocoa.h" #import "LowLevelWindow_MacOSX.h"
#import "DisplayResolutions.h" #import "DisplayResolutions.h"
#import "RageUtil.h" #import "RageUtil.h"
#import "RageThreads.h" #import "RageThreads.h"
@@ -177,11 +177,11 @@ static NSOpenGLContext *CreateOGLContext( GLContextType type, int iColorSize, in
} }
class RenderTarget_Cocoa : public RenderTarget class RenderTarget_MacOSX : public RenderTarget
{ {
public: public:
RenderTarget_Cocoa( id shareContext ); RenderTarget_MacOSX( id shareContext );
~RenderTarget_Cocoa(); ~RenderTarget_MacOSX();
void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut ); void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned GetTexture() const { return m_iTexHandle; } unsigned GetTexture() const { return m_iTexHandle; }
void StartRenderingTo(); void StartRenderingTo();
@@ -193,7 +193,7 @@ private:
int m_iWidth, m_iHeight; int m_iWidth, m_iHeight;
}; };
RenderTarget_Cocoa::RenderTarget_Cocoa( id shareContext ) RenderTarget_MacOSX::RenderTarget_MacOSX( id shareContext )
{ {
m_ShareContext = shareContext; m_ShareContext = shareContext;
m_OldContext = nil; m_OldContext = nil;
@@ -203,7 +203,7 @@ RenderTarget_Cocoa::RenderTarget_Cocoa( id shareContext )
m_iHeight = 0; m_iHeight = 0;
} }
RenderTarget_Cocoa::~RenderTarget_Cocoa() RenderTarget_MacOSX::~RenderTarget_MacOSX()
{ {
POOL; POOL;
[m_PBufferContext release]; [m_PBufferContext release];
@@ -211,7 +211,7 @@ RenderTarget_Cocoa::~RenderTarget_Cocoa()
glDeleteTextures( 1, &m_iTexHandle ); glDeleteTextures( 1, &m_iTexHandle );
} }
void RenderTarget_Cocoa::Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut ) void RenderTarget_MacOSX::Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut )
{ {
POOL; POOL;
m_iWidth = param.iWidth; m_iWidth = param.iWidth;
@@ -260,7 +260,7 @@ void RenderTarget_Cocoa::Create( const RenderTargetParam &param, int &iTextureWi
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
} }
void RenderTarget_Cocoa::StartRenderingTo() void RenderTarget_MacOSX::StartRenderingTo()
{ {
DEBUG_ASSERT( !m_OldContext ); DEBUG_ASSERT( !m_OldContext );
m_OldContext = [NSOpenGLContext currentContext]; m_OldContext = [NSOpenGLContext currentContext];
@@ -268,7 +268,7 @@ void RenderTarget_Cocoa::StartRenderingTo()
glViewport( 0, 0, m_iWidth, m_iHeight ); glViewport( 0, 0, m_iWidth, m_iHeight );
} }
void RenderTarget_Cocoa::FinishRenderingTo() void RenderTarget_MacOSX::FinishRenderingTo()
{ {
DEBUG_ASSERT( m_OldContext ); DEBUG_ASSERT( m_OldContext );
glFlush(); glFlush();
@@ -288,7 +288,7 @@ void RenderTarget_Cocoa::FinishRenderingTo()
m_OldContext = nil; m_OldContext = nil;
} }
LowLevelWindow_Cocoa::LowLevelWindow_Cocoa() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL) LowLevelWindow_MacOSX::LowLevelWindow_MacOSX() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL)
{ {
POOL; POOL;
m_WindowDelegate = [[SMWindowDelegate alloc] init]; m_WindowDelegate = [[SMWindowDelegate alloc] init];
@@ -299,7 +299,7 @@ LowLevelWindow_Cocoa::LowLevelWindow_Cocoa() : m_Context(nil), m_BGContext(nil),
HOOKS->SetHasFocus( [NSApp isActive] ); HOOKS->SetHasFocus( [NSApp isActive] );
} }
LowLevelWindow_Cocoa::~LowLevelWindow_Cocoa() LowLevelWindow_MacOSX::~LowLevelWindow_MacOSX()
{ {
POOL; POOL;
ShutDownFullScreen(); ShutDownFullScreen();
@@ -312,7 +312,7 @@ LowLevelWindow_Cocoa::~LowLevelWindow_Cocoa()
[m_WindowDelegate release]; [m_WindowDelegate release];
} }
void *LowLevelWindow_Cocoa::GetProcAddress( RString s ) void *LowLevelWindow_MacOSX::GetProcAddress( RString s )
{ {
// http://developer.apple.com/qa/qa2001/qa1188.html // http://developer.apple.com/qa/qa2001/qa1188.html
// Both functions mentioned in there are deprecated in 10.4. // Both functions mentioned in there are deprecated in 10.4.
@@ -326,7 +326,7 @@ void *LowLevelWindow_Cocoa::GetProcAddress( RString s )
return symbol ? NSAddressOfSymbol( symbol ) : NULL; return symbol ? NSAddressOfSymbol( symbol ) : NULL;
} }
RString LowLevelWindow_Cocoa::TryVideoMode( const VideoModeParams& p, bool& newDeviceOut ) RString LowLevelWindow_MacOSX::TryVideoMode( const VideoModeParams& p, bool& newDeviceOut )
{ {
// Always set these params. // Always set these params.
m_CurrentParams.bSmoothLines = p.bSmoothLines; m_CurrentParams.bSmoothLines = p.bSmoothLines;
@@ -432,7 +432,7 @@ RString LowLevelWindow_Cocoa::TryVideoMode( const VideoModeParams& p, bool& newD
return RString(); return RString();
} }
void LowLevelWindow_Cocoa::ShutDownFullScreen() void LowLevelWindow_MacOSX::ShutDownFullScreen()
{ {
if( m_CurrentParams.windowed ) if( m_CurrentParams.windowed )
return; return;
@@ -462,7 +462,7 @@ void LowLevelWindow_Cocoa::ShutDownFullScreen()
m_CurrentParams.windowed = true; m_CurrentParams.windowed = true;
} }
int LowLevelWindow_Cocoa::ChangeDisplayMode( const VideoModeParams& p ) int LowLevelWindow_MacOSX::ChangeDisplayMode( const VideoModeParams& p )
{ {
CFDictionaryRef mode = NULL; CFDictionaryRef mode = NULL;
CFDictionaryRef newMode; CFDictionaryRef newMode;
@@ -497,7 +497,7 @@ int LowLevelWindow_Cocoa::ChangeDisplayMode( const VideoModeParams& p )
return 0; return 0;
} }
void LowLevelWindow_Cocoa::SetActualParamsFromMode( CFDictionaryRef mode ) void LowLevelWindow_MacOSX::SetActualParamsFromMode( CFDictionaryRef mode )
{ {
SInt32 rate; SInt32 rate;
bool ret = CFNumberGetValue( (CFNumberRef)CFDictionaryGetValue(mode, CFSTR("RefreshRate")), bool ret = CFNumberGetValue( (CFNumberRef)CFDictionaryGetValue(mode, CFSTR("RefreshRate")),
@@ -541,7 +541,7 @@ static bool GetBoolValue( CFTypeRef r )
return r && CFGetTypeID( r ) == CFBooleanGetTypeID() && CFBooleanGetValue( CFBooleanRef(r) ); return r && CFGetTypeID( r ) == CFBooleanGetTypeID() && CFBooleanGetValue( CFBooleanRef(r) );
} }
void LowLevelWindow_Cocoa::GetDisplayResolutions( DisplayResolutions &dr ) const void LowLevelWindow_MacOSX::GetDisplayResolutions( DisplayResolutions &dr ) const
{ {
CFArrayRef modes = CGDisplayAvailableModes( kCGDirectMainDisplay ); CFArrayRef modes = CGDisplayAvailableModes( kCGDirectMainDisplay );
ASSERT( modes ); ASSERT( modes );
@@ -565,7 +565,7 @@ void LowLevelWindow_Cocoa::GetDisplayResolutions( DisplayResolutions &dr ) const
// Do not release modes! We don't own them here. // Do not release modes! We don't own them here.
} }
float LowLevelWindow_Cocoa::GetMonitorAspectRatio() const float LowLevelWindow_MacOSX::GetMonitorAspectRatio() const
{ {
io_connect_t displayPort = CGDisplayIOServicePort( CGMainDisplayID() ); io_connect_t displayPort = CGDisplayIOServicePort( CGMainDisplayID() );
CFDictionaryRef dict = IODisplayCreateInfoDictionary( displayPort, 0 ); CFDictionaryRef dict = IODisplayCreateInfoDictionary( displayPort, 0 );
@@ -579,12 +579,12 @@ float LowLevelWindow_Cocoa::GetMonitorAspectRatio() const
return 4/3.f; return 4/3.f;
} }
void LowLevelWindow_Cocoa::SwapBuffers() void LowLevelWindow_MacOSX::SwapBuffers()
{ {
CGLFlushDrawable( CGLGetCurrentContext() ); CGLFlushDrawable( CGLGetCurrentContext() );
} }
void LowLevelWindow_Cocoa::Update() void LowLevelWindow_MacOSX::Update()
{ {
// Keep the system from sleeping or the screen saver from activating. // Keep the system from sleeping or the screen saver from activating.
UpdateSystemActivity( IdleActivity ); UpdateSystemActivity( IdleActivity );
@@ -602,12 +602,12 @@ void LowLevelWindow_Cocoa::Update()
DISPLAY->ResolutionChanged(); DISPLAY->ResolutionChanged();
} }
RenderTarget *LowLevelWindow_Cocoa::CreateRenderTarget() RenderTarget *LowLevelWindow_MacOSX::CreateRenderTarget()
{ {
return new RenderTarget_Cocoa( m_Context ); return new RenderTarget_MacOSX( m_Context );
} }
void LowLevelWindow_Cocoa::BeginConcurrentRendering() void LowLevelWindow_MacOSX::BeginConcurrentRendering()
{ {
if( m_CurrentParams.windowed ) if( m_CurrentParams.windowed )
[m_BGContext setView:[((SMWindowDelegate *)m_WindowDelegate)->m_Window contentView]]; [m_BGContext setView:[((SMWindowDelegate *)m_WindowDelegate)->m_Window contentView]];
@@ -1,5 +1,5 @@
#include "global.h" #include "global.h"
#include "MemoryCardDriverThreaded_OSX.h" #include "MemoryCardDriverThreaded_MacOSX.h"
#include "Foreach.h" #include "Foreach.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
@@ -15,16 +15,16 @@
#include <paths.h> #include <paths.h>
#include <unistd.h> #include <unistd.h>
OSStatus MemoryCardDriverThreaded_OSX::VolumeChanged( EventHandlerCallRef ref, EventRef event, void *p ) OSStatus MemoryCardDriverThreaded_MacOSX::VolumeChanged( EventHandlerCallRef ref, EventRef event, void *p )
{ {
MemoryCardDriverThreaded_OSX *This = (MemoryCardDriverThreaded_OSX *)p; MemoryCardDriverThreaded_MacOSX *This = (MemoryCardDriverThreaded_MacOSX *)p;
LockMut( This->m_ChangedLock ); LockMut( This->m_ChangedLock );
This->m_bChanged = true; This->m_bChanged = true;
return eventNotHandledErr; // let others do something return eventNotHandledErr; // let others do something
} }
MemoryCardDriverThreaded_OSX::MemoryCardDriverThreaded_OSX() : m_ChangedLock( "MC changed lock" ) MemoryCardDriverThreaded_MacOSX::MemoryCardDriverThreaded_MacOSX() : m_ChangedLock( "MC changed lock" )
{ {
m_bChanged = true; m_bChanged = true;
m_HandlerUPP = NewEventHandlerUPP( VolumeChanged ); m_HandlerUPP = NewEventHandlerUPP( VolumeChanged );
@@ -37,13 +37,13 @@ MemoryCardDriverThreaded_OSX::MemoryCardDriverThreaded_OSX() : m_ChangedLock( "M
ASSERT( ret == noErr ); ASSERT( ret == noErr );
} }
MemoryCardDriverThreaded_OSX::~MemoryCardDriverThreaded_OSX() MemoryCardDriverThreaded_MacOSX::~MemoryCardDriverThreaded_MacOSX()
{ {
RemoveEventHandler( m_Handler ); RemoveEventHandler( m_Handler );
DisposeEventHandlerUPP( m_HandlerUPP ); DisposeEventHandlerUPP( m_HandlerUPP );
} }
void MemoryCardDriverThreaded_OSX::Unmount( UsbStorageDevice *pDevice ) void MemoryCardDriverThreaded_MacOSX::Unmount( UsbStorageDevice *pDevice )
{ {
ParamBlockRec pb; ParamBlockRec pb;
Str255 name; // A pascal string. Str255 name; // A pascal string.
@@ -59,7 +59,7 @@ void MemoryCardDriverThreaded_OSX::Unmount( UsbStorageDevice *pDevice )
LOG->Warn( "Failed to flush the memory card." ); LOG->Warn( "Failed to flush the memory card." );
} }
bool MemoryCardDriverThreaded_OSX::USBStorageDevicesChanged() bool MemoryCardDriverThreaded_MacOSX::USBStorageDevicesChanged()
{ {
LockMut( m_ChangedLock ); LockMut( m_ChangedLock );
return m_bChanged; return m_bChanged;
@@ -108,7 +108,7 @@ static RString GetStringProperty( io_registry_entry_t entry, CFStringRef key )
return ret; return ret;
} }
void MemoryCardDriverThreaded_OSX::GetUSBStorageDevices( vector<UsbStorageDevice>& vDevicesOut ) void MemoryCardDriverThreaded_MacOSX::GetUSBStorageDevices( vector<UsbStorageDevice>& vDevicesOut )
{ {
LockMut( m_ChangedLock ); LockMut( m_ChangedLock );
// First, get all device paths // First, get all device paths
@@ -222,7 +222,7 @@ void MemoryCardDriverThreaded_OSX::GetUSBStorageDevices( vector<UsbStorageDevice
delete[] fs; delete[] fs;
} }
bool MemoryCardDriverThreaded_OSX::TestWrite( UsbStorageDevice *pDevice ) bool MemoryCardDriverThreaded_MacOSX::TestWrite( UsbStorageDevice *pDevice )
{ {
if( access(pDevice->sOsMountDir, W_OK) ) if( access(pDevice->sOsMountDir, W_OK) )
{ {
@@ -1,5 +1,5 @@
#ifndef MEMORY_CARD_DRIVER_THREADED_OSX #ifndef MEMORY_CARD_DRIVER_THREADED_MACOSX_H
#define MEMORY_CARD_DRIVER_THREADED_OSX #define MEMORY_CARD_DRIVER_THREADED_MACOSX_H
#include "MemoryCardDriver.h" #include "MemoryCardDriver.h"
#include "RageThreads.h" #include "RageThreads.h"
@@ -14,11 +14,11 @@ typedef OSStatus (*EventHandlerProcPtr)( EventHandlerCallRef inHandlerCallRef,
EventRef inEvent, void * inUserData ); EventRef inEvent, void * inUserData );
typedef EventHandlerProcPtr EventHandlerUPP; typedef EventHandlerProcPtr EventHandlerUPP;
class MemoryCardDriverThreaded_OSX : public MemoryCardDriver class MemoryCardDriverThreaded_MacOSX : public MemoryCardDriver
{ {
public: public:
MemoryCardDriverThreaded_OSX(); MemoryCardDriverThreaded_MacOSX();
~MemoryCardDriverThreaded_OSX(); ~MemoryCardDriverThreaded_MacOSX();
bool Mount( UsbStorageDevice *pDevice ) { return true; } bool Mount( UsbStorageDevice *pDevice ) { return true; }
void Unmount( UsbStorageDevice *pDevice ); void Unmount( UsbStorageDevice *pDevice );
@@ -39,7 +39,7 @@ private:
#ifdef ARCH_MEMORY_CARD_DRIVER #ifdef ARCH_MEMORY_CARD_DRIVER
#error "More than one MemoryCardDriver selected." #error "More than one MemoryCardDriver selected."
#endif #endif
#define ARCH_MEMORY_CARD_DRIVER MemoryCardDriverThreaded_OSX #define ARCH_MEMORY_CARD_DRIVER MemoryCardDriverThreaded_MacOSX
#endif #endif
+5 -5
View File
@@ -13,11 +13,11 @@
#elif defined(MACOSX) #elif defined(MACOSX)
#include "ArchHooks/ArchHooks_darwin.h" #include "ArchHooks/ArchHooks_MacOSX.h"
#include "LoadingWindow/LoadingWindow_Cocoa.h" #include "LoadingWindow/LoadingWindow_MacOSX.h"
#include "LowLevelWindow/LowLevelWindow_Cocoa.h" #include "LowLevelWindow/LowLevelWindow_MacOSX.h"
#include "MemoryCard/MemoryCardDriverThreaded_OSX.h" #include "MemoryCard/MemoryCardDriverThreaded_MacOSX.h"
#define DEFAULT_INPUT_DRIVER_LIST "Carbon" #define DEFAULT_INPUT_DRIVER_LIST "HID"
#define DEFAULT_MOVIE_DRIVER_LIST "Theora,FFMpeg,Null" #define DEFAULT_MOVIE_DRIVER_LIST "Theora,FFMpeg,Null"
#define DEFAULT_SOUND_DRIVER_LIST "AudioUnit,Null" #define DEFAULT_SOUND_DRIVER_LIST "AudioUnit,Null"