/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. * * 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, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * 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 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 #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED #import // Needed for UIAccelerometerDelegate #import "Platforms/iOS/CCTouchDelegateProtocol.h" // Touches only supported on iOS #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) #import "Platforms/Mac/CCEventDispatcher.h" #endif #import "CCProtocols.h" #import "CCNode.h" #pragma mark - #pragma mark CCLayer /** CCLayer is a subclass of CCNode that implements the TouchEventsDelegate protocol. All features from CCNode are valid, plus the following new features: - It can receive iPhone Touches - It can receive Accelerometer input */ #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED @interface CCLayer : CCNode { BOOL isTouchEnabled_; BOOL isAccelerometerEnabled_; } /** If isTouchEnabled, this method is called onEnter. Override it to change the way CCLayer receives touch events. ( Default: [[TouchDispatcher sharedDispatcher] addStandardDelegate:self priority:0] ) Example: -(void) registerWithTouchDispatcher { [[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES]; } Valid only on iOS. Not valid on Mac. @since v0.8.0 */ -(void) registerWithTouchDispatcher; /** whether or not it will receive Touch events. You can enable / disable touch events with this property. Only the touches of this node will be affected. This "method" is not propagated to it's children. Valid on iOS and Mac OS X v10.6 and later. @since v0.8.1 */ @property(nonatomic,assign) BOOL isTouchEnabled; /** whether or not it will receive Accelerometer events You can enable / disable accelerometer events with this property. Valid only on iOS. Not valid on Mac. @since v0.8.1 */ @property(nonatomic,assign) BOOL isAccelerometerEnabled; #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) @interface CCLayer : CCNode { BOOL isMouseEnabled_; BOOL isKeyboardEnabled_; BOOL isTouchEnabled_; } /** whether or not it will receive mouse events. Valind only Mac. Not valid on iOS */ @property (nonatomic, readwrite) BOOL isMouseEnabled; /** whether or not it will receive keyboard events. Valind only Mac. Not valid on iOS */ @property (nonatomic, readwrite) BOOL isKeyboardEnabled; /** whether or not it will receive touch events. Valid on iOS and Mac OS X v10.6 and later. */ @property (nonatomic, readwrite) BOOL isTouchEnabled; /** priority of the mouse event delegate. Default 0. Override this method to set another priority. Valind only Mac. Not valid on iOS */ -(NSInteger) mouseDelegatePriority; /** priority of the keyboard event delegate. Default 0. Override this method to set another priority. Valind only Mac. Not valid on iOS */ -(NSInteger) keyboardDelegatePriority; /** priority of the touch event delegate. Default 0. Override this method to set another priority. Valind only Mac. Not valid on iOS */ -(NSInteger) touchDelegatePriority; #endif // mac @end #pragma mark - #pragma mark CCLayerColor /** CCLayerColor is a subclass of CCLayer that implements the CCRGBAProtocol protocol. All features from CCLayer are valid, plus the following new features: - opacity - RGB colors */ @interface CCLayerColor : CCLayer { GLubyte opacity_; ccColor3B color_; ccVertex2F squareVertices_[4]; ccColor4B squareColors_[4]; ccBlendFunc blendFunc_; } /** creates a CCLayer with color, width and height in Points*/ + (id) layerWithColor: (ccColor4B)color width:
<?php
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group                                |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available at through the world-wide-web at                           |
// | http://www.php.net/license/3_0.txt.                                  |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Authors: Aidan Lister <aidan@php.net>                                |
// +----------------------------------------------------------------------+
//
// $Id: is_a.php,v 1.2 2005/11/21 10:57:23 ggiunta Exp $


/**
 * Replace function is_a()
 *
 * @category    PHP
 * @package     PHP_Compat
 * @link        http://php.net/function.is_a
 * @author      Aidan Lister <aidan@php.net>
 * @version     $Revision: 1.2 $
 * @since       PHP 4.2.0
 * @require     PHP 4.0.0 (user_error) (is_subclass_of)
 */
if (!function_exists('is_a')) {
    function is_a($object, $class)
    {
        if (!is_object($object)) {
            return false;
        }

        if (get_class($object) == strtolower($class)) {
            return true;
        } else {
            return is_subclass_of($object, $class);
        }
    }
}

?>