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>
......
......@@ -152,10 +152,13 @@ static OSStatus hotKeyEventHandler(EventHandlerCallRef, EventRef, void*);
InstallEventHandler( GetEventDispatcherTarget(),
(EventHandlerProcPtr)hotKeyEventHandler,
2, eventSpec, self, &eventHandlerRef);
(void)sender;
}
- (void) stopListening: (id) sender {
RemoveEventHandler(eventHandlerRef);
eventHandlerRef = NULL;
(void)sender;
}
- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier {
......@@ -227,6 +230,7 @@ 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);
......
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
#import <IOKit/hid/IOHIDLib.h>
......
......@@ -105,8 +105,10 @@
[delegate sendRemoteButtonEvent: event pressedDown: pressedDown remoteControl:self];
}
- (void) setCookieMappingInDictionary: (NSMutableDictionary*) cookieToButtonMapping {
- (void) setCookieMappingInDictionary: (NSMutableDictionary*) cookieToButtonMap {
(void)cookieToButtonMap;
}
- (int) remoteIdSwitchCookie {
return 0;
}
......@@ -142,6 +144,7 @@
}
- (void) startListening: (id) sender {
(void)sender;
if ([self isListeningToRemote]) return;
// 4th July 2007
......@@ -194,6 +197,7 @@ cleanup:
}
- (void) stopListening: (id) sender {
(void)sender;
if ([self isListeningToRemote]==NO) return;
BOOL sendNotification = NO;
......@@ -320,6 +324,7 @@ cleanup:
}
- (void) remoteControlAvailable:(NSNotification *)notification {
(void)notification;
[self removeNotifcationObserver];
[self startListening: self];
}
......@@ -330,7 +335,9 @@ cleanup:
Will be called for any event of any type (cookie) to which we subscribe
*/
static void QueueCallbackFunction(void* target, IOReturn result, void* refcon, void* sender) {
if (target < 0) {
(void)refcon;
(void)sender;
if ((intptr_t)target < 0) {
NSLog(@"QueueCallbackFunction called with invalid target!");
return;
}
......
......@@ -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.
......
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#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
......@@ -66,6 +66,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
#ifdef DEBUG
NSLog(@"setListeningToRemote ok");
#endif
(void)value;
}
- (BOOL) isListeningToRemote {
return NO;
......@@ -75,23 +76,27 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
#ifdef DEBUG
NSLog(@"startListening ok");
#endif
(void)sender;
}
- (void) stopListening: (id) sender {
#ifdef DEBUG
NSLog(@"stopListening ok");
#endif
(void)sender;
}
- (BOOL) isOpenInExclusiveMode {
return YES;
}
- (void) setOpenInExclusiveMode: (BOOL) value {
(void)value;
}
- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier {
#ifdef DEBUG
NSLog(@"sending event for button identifier \n");
#endif
(void)identifier;
return YES;
}
......
......@@ -28,7 +28,7 @@
*
*****************************************************************************/
#import "RemoteControl.h"
#import <apple_remote/RemoteControl.h>
@interface RemoteControlContainer : RemoteControl {
NSMutableArray* remoteControls;
......
......@@ -84,17 +84,21 @@
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
[self reset];
(void)keyPath;
(void)object;
(void)change;
(void)context;
}
- (void) setListeningToRemote: (BOOL) value {
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
[[remoteControls objectAtIndex: i] setListeningToRemote: value];
}
if (value && value != [self isListeningToRemote]) [self performSelector:@selector(reset) withObject:nil afterDelay:0.01];
}
- (BOOL) isListeningToRemote {
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
if ([[remoteControls objectAtIndex: i] isListeningToRemote]) {
return YES;
......@@ -107,7 +111,7 @@
#ifdef DEBUG
NSLog(@"startListening to events... ");
#endif
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
[[remoteControls objectAtIndex: i] startListening: sender];
}
......@@ -116,7 +120,7 @@
#ifdef DEBUG
NSLog(@"stopListening to events... ");
#endif
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
[[remoteControls objectAtIndex: i] stopListening: sender];
}
......@@ -124,14 +128,14 @@
- (BOOL) isOpenInExclusiveMode {
BOOL mode = YES;
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
mode = mode && ([[remoteControls objectAtIndex: i] isOpenInExclusiveMode]);
}
return mode;
}
- (void) setOpenInExclusiveMode: (BOOL) value {
int i;
unsigned int i;
for(i=0; i < [remoteControls count]; i++) {
[[remoteControls objectAtIndex: i] setOpenInExclusiveMode:value];
}
......
......@@ -27,7 +27,7 @@
*
*****************************************************************************/
#import "RemoteMainController.h"
#import <apple_remote/RemoteMainController.h>
#import "AppleRemote.h"
#import "KeyspanFrontRowControl.h"
#import "GlobalKeyboardDevice.h"
......@@ -100,6 +100,7 @@
- (void) remoteButton: (RemoteControlEventIdentifier)buttonIdentifier pressedDown: (BOOL) pressedDown clickCount: (unsigned int)clickCount
{
(void)clickCount;
NSString* pressed = @"";
#ifdef DEBUG
NSString* buttonName = nil;
......
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