vclnsapp.mm (245318c3) vclnsapp.mm (dbfe0a54)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 436 unchanged lines hidden (view full) ---

445// for Apple Remote implementation
446
447#pragma mark -
448#pragma mark NSApplication Delegates
449- (void)applicationWillBecomeActive:(NSNotification *)pNotification
450{
451 (void)pNotification;
452 SalData* pSalData = GetSalData();
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 436 unchanged lines hidden (view full) ---

445// for Apple Remote implementation
446
447#pragma mark -
448#pragma mark NSApplication Delegates
449- (void)applicationWillBecomeActive:(NSNotification *)pNotification
450{
451 (void)pNotification;
452 SalData* pSalData = GetSalData();
453 if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
453 AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
454 if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
454 {
455 // [remoteControl startListening: self];
456 // does crash because the right thing to do is
455 {
456 // [remoteControl startListening: self];
457 // does crash because the right thing to do is
457 // [GetSalData()->mpMainController->remoteControl startListening: self];
458 // [pAppleRemoteCtrl->remoteControl startListening: self];
458 // but the instance variable 'remoteControl' is declared protected
459 // workaround : declare remoteControl instance variable as public in RemoteMainController.m
460
459 // but the instance variable 'remoteControl' is declared protected
460 // workaround : declare remoteControl instance variable as public in RemoteMainController.m
461
461 [pSalData->mpMainController->remoteControl startListening: self];
462 [pAppleRemoteCtrl->remoteControl startListening: self];
462#ifdef DEBUG
463 NSLog(@"Apple Remote will become active - Using remote controls");
464#endif
465 }
466 for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
467 it != pSalData->maPresentationFrames.end(); ++it )
468 {
469 NSWindow* pNSWindow = (*it)->getNSWindow();
470 [pNSWindow setLevel: NSPopUpMenuWindowLevel];
471 if( [pNSWindow isVisible] )
472 [pNSWindow orderFront: NSApp];
473 }
474}
475
476- (void)applicationWillResignActive:(NSNotification *)pNotification
477{
478 (void)pNotification;
479 SalData* pSalData = GetSalData();
463#ifdef DEBUG
464 NSLog(@"Apple Remote will become active - Using remote controls");
465#endif
466 }
467 for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
468 it != pSalData->maPresentationFrames.end(); ++it )
469 {
470 NSWindow* pNSWindow = (*it)->getNSWindow();
471 [pNSWindow setLevel: NSPopUpMenuWindowLevel];
472 if( [pNSWindow isVisible] )
473 [pNSWindow orderFront: NSApp];
474 }
475}
476
477- (void)applicationWillResignActive:(NSNotification *)pNotification
478{
479 (void)pNotification;
480 SalData* pSalData = GetSalData();
480 if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
481 AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
482 if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
481 {
482 // [remoteControl stopListening: self];
483 // does crash because the right thing to do is
483 {
484 // [remoteControl stopListening: self];
485 // does crash because the right thing to do is
484 // [GetSalData()->mpMainController->remoteControl stopListening: self];
486 // [pAppleRemoteCtrl->remoteControl stopListening: self];
485 // but the instance variable 'remoteControl' is declared protected
486 // workaround : declare remoteControl instance variable as public in RemoteMainController.m
487
487 // but the instance variable 'remoteControl' is declared protected
488 // workaround : declare remoteControl instance variable as public in RemoteMainController.m
489
488 [pSalData->mpMainController->remoteControl stopListening: self];
490 [pAppleRemoteCtrl->remoteControl stopListening: self];
489#ifdef DEBUG
490 NSLog(@"Apple Remote will resign active - Releasing remote controls");
491#endif
492 }
493 for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
494 it != pSalData->maPresentationFrames.end(); ++it )
495 {
496 [(*it)->getNSWindow() setLevel: NSNormalWindowLevel];

--- 23 unchanged lines hidden ---
491#ifdef DEBUG
492 NSLog(@"Apple Remote will resign active - Releasing remote controls");
493#endif
494 }
495 for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
496 it != pSalData->maPresentationFrames.end(); ++it )
497 {
498 [(*it)->getNSWindow() setLevel: NSNormalWindowLevel];

--- 23 unchanged lines hidden ---