Kaydet (Commit) 87f52352 authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

Resolves: #i124201# rename apple_remote's MainController...

to AppleRemoteController

having a MainController class in the global namespace of an application with
gazillions of MVC patterns is not a good idea. Renaming it to better match
its scope (i.e. the Apple Remote) cleans this up.

(cherry picked from commit 8ef38360)

Conflicts:
	apple_remote/source/RemoteMainController.m
	include/apple_remote/RemoteMainController.h
	vcl/inc/osx/saldata.hxx
	vcl/osx/saldata.cxx
	vcl/osx/salinst.cxx
	vcl/osx/vclnsapp.mm

Change-Id: I1f252ac51ef65966a48ee03b2cd3519f98d57383
üst c7e0bfd1
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// Sample Code 3: Multi Click Behavior and Hold Event Simulation // Sample Code 3: Multi Click Behavior and Hold Event Simulation
// ------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------
@implementation MainController @implementation AppleRemoteMainController
- (id) init { - (id) init {
self = [super init]; // because we redefined our own init instead of use the fu..nny awakeFromNib self = [super init]; // because we redefined our own init instead of use the fu..nny awakeFromNib
...@@ -75,11 +75,11 @@ ...@@ -75,11 +75,11 @@
// to give the binding mechanism a chance to see the change of the attribute // to give the binding mechanism a chance to see the change of the attribute
[self setValue: container forKey: @"remoteControl"]; [self setValue: container forKey: @"remoteControl"];
#ifdef DEBUG #ifdef DEBUG
NSLog(@"MainController init done"); NSLog(@"AppleRemoteMainController init done");
#endif #endif
} }
else else
NSLog(@"MainController init failed"); NSLog(@"AppleRemoteMainController init failed");
return self; return self;
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
//static void sendTheEvent( unichar, int ); //static void sendTheEvent( unichar, int );
SAL_DLLPUBLIC_EXPORT @interface MainController : NSObject { SAL_DLLPUBLIC_EXPORT @interface AppleRemoteMainController : NSObject {
@public // else remoteControl is not reachable from GetSalData()->mpMainController @public // else remoteControl is not reachable from GetSalData()->mpMainController
RemoteControl* remoteControl; RemoteControl* remoteControl;
@private @private
......
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
#if !HAVE_FEATURE_MACOSX_SANDBOX #if !HAVE_FEATURE_MACOSX_SANDBOX
MainController* mpMainController; // Apple Remote AppleRemoteMainController* mpAppleRemoteMainController;
#endif #endif
NSObject* mpDockIconClickHandler; NSObject* mpDockIconClickHandler;
long mnDPIX; // #i100617# read DPI only once per office life long mnDPIX; // #i100617# read DPI only once per office life
......
...@@ -47,7 +47,7 @@ SalData::SalData() ...@@ -47,7 +47,7 @@ SalData::SalData()
maCursors( POINTER_COUNT, INVALID_CURSOR_PTR ), maCursors( POINTER_COUNT, INVALID_CURSOR_PTR ),
mbIsScrollbarDoubleMax( false ), mbIsScrollbarDoubleMax( false ),
#if !HAVE_FEATURE_MACOSX_SANDBOX #if !HAVE_FEATURE_MACOSX_SANDBOX
mpMainController( NULL ), mpAppleRemoteMainController( NULL ),
#endif #endif
mpDockIconClickHandler( nil ), mpDockIconClickHandler( nil ),
mnDPIX( 0 ), mnDPIX( 0 ),
...@@ -82,8 +82,8 @@ SalData::~SalData() ...@@ -82,8 +82,8 @@ SalData::~SalData()
s_aAutoReleaseKey = 0; s_aAutoReleaseKey = 0;
} }
#if !HAVE_FEATURE_MACOSX_SANDBOX #if !HAVE_FEATURE_MACOSX_SANDBOX
if ( mpMainController ) if ( mpAppleRemoteMainController )
[mpMainController release]; [mpAppleRemoteMainController release];
#endif #endif
} }
......
...@@ -170,7 +170,7 @@ static void initNSApp() ...@@ -170,7 +170,7 @@ static void initNSApp()
object: nil ]; object: nil ];
#if !HAVE_FEATURE_MACOSX_SANDBOX #if !HAVE_FEATURE_MACOSX_SANDBOX
// Initialize Apple Remote // Initialize Apple Remote
GetSalData()->mpMainController = [[MainController alloc] init]; GetSalData()->mpAppleRemoteMainController = [[AppleRemoteMainController alloc] init];
[[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
selector: @selector(applicationWillBecomeActive:) selector: @selector(applicationWillBecomeActive:)
......
...@@ -434,15 +434,16 @@ ...@@ -434,15 +434,16 @@
{ {
(void)pNotification; (void)pNotification;
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
if( pSalData->mpMainController && pSalData->mpMainController->remoteControl) AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
{ {
// [remoteControl startListening: self]; // [remoteControl startListening: self];
// does crash because the right thing to do is // does crash because the right thing to do is
// [GetSalData()->mpMainController->remoteControl startListening: self]; // [pAppleRemoteCtrl->remoteControl startListening: self];
// but the instance variable 'remoteControl' is declared protected // but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m // workaround : declare remoteControl instance variable as public in RemoteMainController.m
[pSalData->mpMainController->remoteControl startListening: self]; [pAppleRemoteCtrl->remoteControl startListening: self];
#ifdef DEBUG #ifdef DEBUG
NSLog(@"Apple Remote will become active - Using remote controls"); NSLog(@"Apple Remote will become active - Using remote controls");
#endif #endif
...@@ -461,15 +462,16 @@ ...@@ -461,15 +462,16 @@
{ {
(void)pNotification; (void)pNotification;
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
if( pSalData->mpMainController && pSalData->mpMainController->remoteControl) AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
{ {
// [remoteControl stopListening: self]; // [remoteControl stopListening: self];
// does crash because the right thing to do is // does crash because the right thing to do is
// [GetSalData()->mpMainController->remoteControl stopListening: self]; // [pAppleRemoteCtrl->remoteControl stopListening: self];
// but the instance variable 'remoteControl' is declared protected // but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m // workaround : declare remoteControl instance variable as public in RemoteMainController.m
[pSalData->mpMainController->remoteControl stopListening: self]; [pAppleRemoteCtrl->remoteControl stopListening: self];
#ifdef DEBUG #ifdef DEBUG
NSLog(@"Apple Remote will resign active - Releasing remote controls"); NSLog(@"Apple Remote will resign active - Releasing remote controls");
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment