Kaydet (Commit) fbbcc07f authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

gbuildify apple_remote

üst e48d33bc
......@@ -1023,6 +1023,13 @@ $(call gb_LinkTarget_add_libs,$(1), \
endef
define gb_LinkTarget__use_iokit
$(call gb_LinkTarget_add_libs,$(1), \
-framework IOKit \
)
endef
define gb_LinkTarget__use_qtkit
$(call gb_LinkTarget_add_libs,$(1), \
-framework QTKit \
......
# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiebaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2012 the
# Initial Developer. All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
$(eval $(call gb_Library_Library,AppleRemote))
$(eval $(call gb_Library_set_include,AppleRemote,\
-I$(SRCDIR)/apple_remote/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_externals,AppleRemote,\
cocoa \
carbon \
iokit \
))
$(eval $(call gb_Library_add_libs,AppleRemote,\
-framework Cocoa \
-framework Carbon \
-framework IOKit \
))
$(eval $(call gb_Library_add_objcobjects,AppleRemote,\
apple_remote/source/KeyspanFrontRowControl \
apple_remote/source/AppleRemote \
apple_remote/source/RemoteControl \
apple_remote/source/RemoteControlContainer \
apple_remote/source/GlobalKeyboardDevice \
apple_remote/source/HIDRemoteControlDevice \
apple_remote/source/MultiClickRemoteBehavior \
apple_remote/source/RemoteMainController \
))
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiebaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2012 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Module_Module,apple_remote))
ifeq ($(GUIBASE),aqua)
$(eval $(call gb_Module_add_targets,apple_remote,\
Library_AppleRemote \
Package_inc \
))
endif
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiebaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2012 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Package_Package,apple_remote_inc,$(SRCDIR)/apple_remote/inc))
$(eval $(call gb_Package_add_file,apple_remote_inc,inc/apple_remote/RemoteControl.h,apple_remote/RemoteControl.h))
$(eval $(call gb_Package_add_file,apple_remote_inc,inc/apple_remote/RemoteMainController.h,apple_remote/RemoteMainController.h))
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
PRJ=.
PRJNAME=external
TARGET=AppleRemote
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
.IF "$(GUIBASE)"!="aqua"
dummy:
# nothing
.ELSE # "$(GUIBASE)"!="aqua"
SHL1STDLIBS+= \
-framework Cocoa -framework Carbon -framework IOKit
LIB1FILES+= \
$(SLB)$/AppleRemote.lib
SLOFILES= \
$(SLO)$/KeyspanFrontRowControl.obj \
$(SLO)$/AppleRemote.obj \
$(SLO)$/RemoteControl.obj \
$(SLO)$/RemoteControlContainer.obj \
$(SLO)$/GlobalKeyboardDevice.obj \
$(SLO)$/HIDRemoteControlDevice.obj \
$(SLO)$/MultiClickRemoteBehavior.obj \
$(SLO)$/RemoteMainController.obj
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1OBJS= $(SLOFILES)
OUT2INC = \
$(BUILDDIR)$/KeyspaFrontRowControl.h \
$(BUILDDIR)$/AppleRemote.h \
$(BUILDDIR)$/RemoteControl.h \
$(BUILDDIR)$/RemoteControlContainer.h \
$(BUILDDIR)$/GlobalKeyboardDevice.h \
$(BUILDDIR)$/HIDRemoteControlDevice.h \
$(BUILDDIR)$/MultiClickRemoteBehavior.h \
$(BUILDDIR)$/RemoteMainController.h
.ENDIF # "$(GUIBASE)"!="aqua"
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
apr apple_remote : solenv soltools NULL
apr apple_remote nmake - u apr_aprem NULL
apr apple_remote\prj nmake - u apr_aprem NULL
mkdir: %_DEST%\inc\apple_remote
..\inc\*.h %_DEST%\inc\apple_remote\*
..\%__SRC%\lib\*.dylib %_DEST%\lib\*.dylib
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
#import <Carbon/Carbon.h>
......
......@@ -2,13 +2,13 @@
* GlobalKeyboardDevice.m
* RemoteControlWrapper
*
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Copyright (c) 2006 martinkahr.com. All rights reserved.
*
* Code modified and adapted to OpenOffice.org
* Code modified and adapted to OpenOffice.org
* by Eric Bachard on 11.08.2008 under the same license
*
* Permission is hereby granted, free of charge, to any person obtaining a
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
......@@ -20,7 +20,7 @@
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
......@@ -41,7 +41,7 @@
/*
the following default keys are read and shall be used to change the keyboard mapping
mac.remotecontrols.GlobalKeyboardDevice.plus_modifiers
mac.remotecontrols.GlobalKeyboardDevice.plus_keycode
mac.remotecontrols.GlobalKeyboardDevice.minus_modifiers
......@@ -62,19 +62,19 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
@implementation GlobalKeyboardDevice
- (id) initWithDelegate: (id) _remoteControlDelegate {
- (id) initWithDelegate: (id) _remoteControlDelegate {
if ( (self = [super initWithDelegate: _remoteControlDelegate]) ) {
hotKeyRemoteEventMapping = [[NSMutableDictionary alloc] init];
unsigned int modifiers = cmdKey + shiftKey /*+ optionKey*/ + controlKey;
[self mapRemoteButton:kRemoteButtonPlus defaultKeycode:F1 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonMinus defaultKeycode:F2 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonPlay defaultKeycode:F3 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonLeft defaultKeycode:F4 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonRight defaultKeycode:F5 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonMenu defaultKeycode:F6 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonPlay_Hold defaultKeycode:F7 defaultModifiers:modifiers];
[self mapRemoteButton:kRemoteButtonPlay_Hold defaultKeycode:F7 defaultModifiers:modifiers];
}
return self;
}
......@@ -85,48 +85,48 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
}
- (void) mapRemoteButton: (RemoteControlEventIdentifier) remoteButtonIdentifier defaultKeycode: (unsigned int) defaultKeycode defaultModifiers: (unsigned int) defaultModifiers {
NSString* defaultsKey = NULL;
NSString* defaultsKey = NULL;
switch(remoteButtonIdentifier) {
case kRemoteButtonPlus:
defaultsKey = @"plus";
break;
case kRemoteButtonMinus:
defaultsKey = @"minus";
break;
break;
case kRemoteButtonMenu:
defaultsKey = @"menu";
break;
break;
case kRemoteButtonPlay:
defaultsKey = @"play";
break;
case kRemoteButtonRight:
defaultsKey = @"right";
break;
case kRemoteButtonLeft:
break;
case kRemoteButtonLeft:
defaultsKey = @"left";
break;
case kRemoteButtonPlay_Hold:
defaultsKey = @"playhold";
break;
default:
break;
default:
#ifdef DEBUG
NSLog(@"Unknown global keyboard defaults key for remote button identifier %d", remoteButtonIdentifier);
#endif
break;
}
NSNumber* modifiersCfg = [[NSUserDefaults standardUserDefaults] objectForKey: [NSString stringWithFormat: @"mac.remotecontrols.GlobalKeyboardDevice.%@_modifiers", defaultsKey]];
NSNumber* keycodeCfg = [[NSUserDefaults standardUserDefaults] objectForKey: [NSString stringWithFormat: @"mac.remotecontrols.GlobalKeyboardDevice.%@_keycode", defaultsKey]];
unsigned int modifiers = defaultModifiers;
if (modifiersCfg) modifiers = [modifiersCfg unsignedIntValue];
unsigned int keycode = defaultKeycode;
if (keycodeCfg) keycode = [keycodeCfg unsignedIntValue];
[self registerHotKeyCode: keycode modifiers: modifiers remoteEventIdentifier: remoteButtonIdentifier];
}
}
- (void) setListeningToRemote: (BOOL) value {
if (value == [self isListeningToRemote]) return;
......@@ -136,26 +136,29 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
[self stopListening: self];
}
}
- (BOOL) isListeningToRemote {
- (BOOL) isListeningToRemote {
return (eventHandlerRef!=NULL);
}
- (void) startListening: (id) sender {
if (eventHandlerRef) return;
EventTypeSpec eventSpec[2] = {
{ kEventClassKeyboard, kEventHotKeyPressed },
{ kEventClassKeyboard, kEventHotKeyReleased }
};
};
InstallEventHandler( GetEventDispatcherTarget(),
(EventHandlerProcPtr)hotKeyEventHandler,
2, eventSpec, self, &eventHandlerRef);
(EventHandlerProcPtr)hotKeyEventHandler,
2, eventSpec, self, &eventHandlerRef);
(void)sender;
}
- (void) stopListening: (id) sender {
RemoveEventHandler(eventHandlerRef);
eventHandlerRef = NULL;
(void)sender;
}
- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier {
......@@ -171,21 +174,21 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
return "Keyboard";
}
- (BOOL)registerHotKeyCode: (unsigned int) keycode modifiers: (unsigned int) modifiers remoteEventIdentifier: (RemoteControlEventIdentifier) identifier {
- (BOOL)registerHotKeyCode: (unsigned int) keycode modifiers: (unsigned int) modifiers remoteEventIdentifier: (RemoteControlEventIdentifier) identifier {
OSStatus err;
EventHotKeyID hotKeyID;
EventHotKeyRef carbonHotKey;
hotKeyID.signature = 'PTHk';
hotKeyID.id = (long)keycode;
err = RegisterEventHotKey(keycode, modifiers, hotKeyID, GetEventDispatcherTarget(), 0, &carbonHotKey );
if( err )
return NO;
[hotKeyRemoteEventMapping setObject: [NSNumber numberWithInt:identifier] forKey: [NSNumber numberWithUnsignedInt: hotKeyID.id]];
return YES;
}
/*
......@@ -194,21 +197,21 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
OSStatus err;
EventHotKeyRef carbonHotKey;
NSValue* key;
if( [[self allHotKeys] containsObject: hotKey] == NO )
return;
carbonHotKey = [self _carbonHotKeyForHotKey: hotKey];
NSAssert( carbonHotKey != nil, @"" );
err = UnregisterEventHotKey( carbonHotKey );
//Watch as we ignore 'err':
key = [NSValue valueWithPointer: carbonHotKey];
[mHotKeys removeObjectForKey: key];
[self _updateEventHandler];
//See that? Completely ignored
}
*/
......@@ -227,13 +230,14 @@ static RemoteControlEventIdentifier lastEvent;
static OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void* userData )
{
(void)inHandlerRef;
GlobalKeyboardDevice* keyboardDevice = (GlobalKeyboardDevice*) userData;
EventHotKeyID hkCom;
GetEventParameter(inEvent,kEventParamDirectObject,typeEventHotKeyID,NULL,sizeof(hkCom),NULL,&hkCom);
RemoteControlEventIdentifier identifier = [keyboardDevice remoteControlEventIdentifierForID:hkCom.id];
if (identifier == 0) return noErr;
BOOL pressedDown = YES;
if (identifier != lastEvent) {
lastEvent = identifier;
......@@ -242,7 +246,7 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerRef, EventRef in
pressedDown = NO;
}
[keyboardDevice sendRemoteButtonEvent: identifier pressedDown: pressedDown];
return noErr;
}
......
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
#import <IOKit/hid/IOHIDLib.h>
......
......@@ -29,7 +29,7 @@
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
/**
A behavior that adds multiclick and hold events on top of a device.
......
......@@ -2,13 +2,13 @@
* RemoteControl.m
* RemoteControlWrapper
*
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Copyright (c) 2006 martinkahr.com. All rights reserved.
*
* Code modified and adapted to OpenOffice.org
* Code modified and adapted to OpenOffice.org
* by Eric Bachard on 11.08.2008 under the same License
*
* Permission is hereby granted, free of charge, to any person obtaining a
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
......@@ -20,17 +20,17 @@
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*****************************************************************************/
#import "RemoteControl.h"
// notifaction names that are being used to signal that an application wants to
#import <apple_remote/RemoteControl.h>
// notifaction names that are being used to signal that an application wants to
// have access to the remote control device or if the application has finished
// using the remote control device
NSString* REQUEST_FOR_REMOTE_CONTROL_NOTIFCATION = @"mac.remotecontrols.RequestForRemoteControl";
......@@ -47,14 +47,14 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
@implementation RemoteControl
// returns nil if the remote control device is not available
- (id) initWithDelegate: (id) _remoteControlDelegate {
- (id) initWithDelegate: (id) _remoteControlDelegate {
if ( (self = [super init]) ) {
delegate = [_remoteControlDelegate retain];
delegate = [_remoteControlDelegate retain];
#ifdef DEBUG
NSLog(@"RemoteControl initWithDelegate ok");
#endif
}
return self;
return self;
}
- (void) dealloc {
......@@ -66,33 +66,38 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
#ifdef DEBUG
NSLog(@"setListeningToRemote ok");
#endif
(void)value;
}
- (BOOL) isListeningToRemote {
return NO;
return NO;
}
- (void) startListening: (id) sender {
#ifdef DEBUG
NSLog(@"startListening ok");
#endif
(void)sender;
}
- (void) stopListening: (id) sender {
#ifdef DEBUG
NSLog(@"stopListening ok");
#endif
(void)sender;
}
- (BOOL) isOpenInExclusiveMode {
return YES;
return YES;
}
- (void) setOpenInExclusiveMode: (BOOL) value {
(void)value;
}
- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier {
#ifdef DEBUG
NSLog(@"sending event for button identifier \n");
NSLog(@"sending event for button identifier \n");
#endif
return YES;
(void)identifier;
return YES;
}
+ (void) sendDistributedNotification: (NSString*) notificationName targetBundleIdentifier: (NSString*) targetIdentifier
......@@ -106,7 +111,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
kTargetApplicationIdentifier /*targetBundleIdentifier -> does not appear, since the peer is nil*/,
nil];
#ifdef DEBUG
// Debug purpose: returns all the existing dictionary keys.
// Debug purpose: returns all the existing dictionary keys.
NSString *s;
NSEnumerator *e = [userInfo keyEnumerator];
while ( (s = [e nextObject]) ) {
......@@ -119,10 +124,10 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
NSLog(@"sendDistributedNotification ...");
#endif
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:notificationName
object:nil
userInfo:userInfo
deliverImmediately:YES];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:notificationName
object:nil
userInfo:userInfo
deliverImmediately:YES];
}
}
......@@ -140,7 +145,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
}
+ (const char*) remoteControlDeviceName {
return NULL;
return NULL;
}
@end
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
@interface RemoteControlContainer : RemoteControl {
NSMutableArray* remoteControls;
......
......@@ -2,13 +2,13 @@
* RemoteControlContainer.m
* RemoteControlWrapper
*
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Created by Martin Kahr on 11.03.06 under a MIT-style license.
* Copyright (c) 2006 martinkahr.com. All rights reserved.
*
* Code modified and adapted to OpenOffice.org
* Code modified and adapted to OpenOffice.org
* by Eric Bachard on 11.08.2008 under the same License
*
* Permission is hereby granted, free of charge, to any person obtaining a
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
......@@ -20,7 +20,7 @@
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
......@@ -33,23 +33,23 @@
@implementation RemoteControlContainer
- (id) initWithDelegate: (id) _remoteControlDelegate {
if ( (self = [super initWithDelegate:_remoteControlDelegate]) ) {
remoteControls = [[NSMutableArray alloc] init];
if ( (self = [super initWithDelegate:_remoteControlDelegate]) ) {
remoteControls = [[NSMutableArray alloc] init];
#ifdef DEBUG
NSLog(@"RemoteControlContainer initWithDelegate ok");
}
}
else {
NSLog(@"RemoteControlContainer initWithDelegate failed");
#endif
}
return self;
return self;
}
- (void) dealloc {
[self stopListening: self];
[remoteControls release];
[super dealloc];
[self stopListening: self];
[remoteControls release];
[super dealloc];
}
- (BOOL) instantiateAndAddRemoteControlDeviceWithClass: (Class) clazz {
......@@ -58,83 +58,87 @@
if (remoteControl) {
[remoteControls addObject: remoteControl];
[remoteControl addObserver: self forKeyPath:@"listeningToRemote" options:NSKeyValueObservingOptionNew context:nil];
toReturn = YES;