summaryrefslogtreecommitdiff
path: root/vcl/aqua/source/app/vclnsapp.mm
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-10-29 10:26:13 +0000
committerRüdiger Timm <rt@openoffice.org>2008-10-29 10:26:13 +0000
commit4f976ce5f5ca31a3c6092891ff6b78ccfc415a19 (patch)
treec6583a1524bc480f632fe85c02351477e694fd47 /vcl/aqua/source/app/vclnsapp.mm
parent011bcd1ea1e8ce10f6b9946d8d44d05a59387b8c (diff)
CWS-TOOLING: integrate CWS appleremote01
Diffstat (limited to 'vcl/aqua/source/app/vclnsapp.mm')
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm45
1 files changed, 43 insertions, 2 deletions
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index a8516b2a9da6..4e7678e17a8d 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: vclnsapp.mm,v $
- * $Revision: 1.9 $
+ * $Revision: 1.8.46.3 $
*
* This file is part of OpenOffice.org.
*
@@ -39,9 +39,14 @@
#include "vcl/window.hxx"
#include "vcl/svapp.hxx"
-
+#include "vcl/cmdevt.hxx"
#include "rtl/ustrbuf.hxx"
+#include "premac.h"
+#import "Carbon/Carbon.h"
+#import "apple_remote/RemoteControl.h"
+#include "postmac.h"
+
@implementation CocoaThreadEnabler
-(void)enableCocoaThreads:(id)param
@@ -340,5 +345,41 @@
[pDock insertItem: pNewItem atIndex: [pDock numberOfItems]];
}
+// for Apple Remote implementation
+
+#pragma mark -
+#pragma mark NSApplication Delegates
+- (void)applicationWillBecomeActive:(NSNotification *)aNotification {
+ if (GetSalData()->mpMainController->remoteControl) {
+
+ // [remoteControl startListening: self];
+ // does crash because the right thing to do is
+ // [GetSalData()->mpMainController->remoteControl startListening: self];
+ // but the instance variable 'remoteControl' is declared protected
+ // workaround : declare remoteControl instance variable as public in RemoteMainController.m
+
+ [GetSalData()->mpMainController->remoteControl startListening: self];
+#ifdef DEBUG
+ NSLog(@"Apple Remote will become active - Using remote controls");
+#endif
+ }
+}
+
+- (void)applicationWillResignActive:(NSNotification *)aNotification {
+ if (GetSalData()->mpMainController->remoteControl) {
+
+ // [remoteControl stopListening: self];
+ // does crash because the right thing to do is
+ // [GetSalData()->mpMainController->remoteControl stopListening: self];
+ // but the instance variable 'remoteControl' is declared protected
+ // workaround : declare remoteControl instance variable as public in RemoteMainController.m
+
+ [GetSalData()->mpMainController->remoteControl stopListening: self];
+#ifdef DEBUG
+ NSLog(@"Apple Remote will resign active - Releasing remote controls");
+#endif
+ }
+}
+
@end