# Copyright (c) 2007 SIEGE Development Team
# All rights reserved.
#
# This file is part of libSIEGE.
#
# This software is copyrighted work licensed under the terms of the
# 2-clause BSD license. Please consult the file "license.txt" for
# details.
#
# If you did not recieve the file with this program, please email
# Tim Chas <darkuranium@gmail.com>.

from siege.common cimport *
from siege.graphics.sprite cimport *
from siege.graphics.mask cimport *
from siege.physics.body cimport *

cdef extern from "siege/core/entity.h":
    struct SGEntity:
        SGbool active
        SGbool pausable
        
        #SGEvent* event
        void* data
        
        SGbool visible
        
        SGSprite* sprite
        SGMask* mask
        SGPhysicsBody* body
        #SGAudioSource* source
        
        float x
        float y
        float depth
        float angle
        
        SGbool minside
        
        SGbool (*cbInside)(SGEntity* entity, float x, float y)
        
        void (*lcMouseEnter)(SGEntity* entity)
        void (*lcMouseExit)(SGEntity* entity)
        
        void (*lcMouseButton)(SGEntity* entity, SGuint button)
        void (*lcMouseButtonPress)(SGEntity* entity, SGuint button)
        void (*lcMouseButtonRelease)(SGEntity* entity, SGuint button)
        
        void (*lcMouseButtonLeft)(SGEntity* entity)
        void (*lcMouseButtonLeftPress)(SGEntity* entity)
        void (*lcMouseButtonLeftRelease)(SGEntity* entity)
        
        void (*lcMouseButtonRight)(SGEntity* entity)
        void (*lcMouseButtonRightPress)(SGEntity* entity)
        void (*lcMouseButtonRightRelease)(SGEntity* entity)
        
        void (*lcMouseButtonMiddle)(SGEntity* entity)
        void (*lcMouseButtonMiddlePress)(SGEntity* entity)
        void (*lcMouseButtonMiddleRelease)(SGEntity* entity)
        
        void (*lcMouseMove)(SGEntity* entity, SGint x, SGint y)
        void (*lcMouseWheel)(SGEntity* entity, SGint wheel)
        
        void (*evInit)(SGEntity* entity)
        void (*evDeinit)(SGEntity* entity)
        
        void (*evStart)(SGEntity* entity)
        void (*evExit)(SGEntity* entity)
        void (*evTick)(SGEntity* entity)
        void (*evTickBegin)(SGEntity* entity)
        void (*evTickEnd)(SGEntity* entity)
        void (*evDraw)(SGEntity* entity)
        
        void (*evWindowOpen)(SGEntity* entity)
        void (*evWindowClose)(SGEntity* entity)
        void (*evWindowResize)(SGEntity* entity, SGuint width, SGuint height)
        
        void (*evMouseButton)(SGEntity* entity, SGuint button)
        void (*evMouseButtonPress)(SGEntity* entity, SGuint button)
        void (*evMouseButtonRelease)(SGEntity* entity, SGuint button)
        
        void (*evMouseButtonLeft)(SGEntity* entity)
        void (*evMouseButtonLeftPress)(SGEntity* entity)
        void (*evMouseButtonLeftRelease)(SGEntity* entity)
        
        void (*evMouseButtonRight)(SGEntity* entity)
        void (*evMouseButtonRightPress)(SGEntity* entity)
        void (*evMouseButtonRightRelease)(SGEntity* entity)
        
        void (*evMouseButtonMiddle)(SGEntity* entity)
        void (*evMouseButtonMiddlePress)(SGEntity* entity)
        void (*evMouseButtonMiddleRelease)(SGEntity* entity)
        
        void (*evMouseMove)(SGEntity* entity, SGint x, SGint y)
        void (*evMouseWheel)(SGEntity* entity, SGint wheel)
        
        void (*evKeyboardKey)(SGEntity* entity, SGuint key)
        void (*evKeyboardKeyPress)(SGEntity* entity, SGuint key)
        void (*evKeyboardKeyRelease)(SGEntity* entity, SGuint key)
        void (*evKeyboardKeyRepeat)(SGEntity* entity, SGuint key)
        
        void (*evKeyboardCharPress)(SGEntity* entity, SGdchar chr)
        void (*evKeyboardCharRepeat)(SGEntity* entity, SGdchar chr)
        
        void (*evJoystickButton)(SGEntity* entity, SGuint joy, SGuint button)
        void (*evJoystickButtonPress)(SGEntity* entity, SGuint joy, SGuint button)
        void (*evJoystickButtonRelease)(SGEntity* entity, SGuint joy, SGuint button)
        
        void (*evJoystickMove)(SGEntity* entity, SGuint joy, float* axis, size_t numaxis)
        
        # networking goes here

        #void (*evCollision)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionOne)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionTwo)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        
        #void (*evCollisionBegin)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionOneBegin)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionTwoBegin)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        
        #void (*evCollisionEnd)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionOneEnd)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        #void (*evCollisionTwoEnd)(SGEntity* entity, SGEntity* other, SGCollisionPoint* point)
        
        #void (*evCollisionResult)(SGEntity* entity, SGEntity* other, SGCollisionResult* result)
        #void (*evCollisionOneResult)(SGEntity* entity, SGEntity* other, SGCollisionResult* result)
        #void (*evCollisionTwoResult)(SGEntity* entity, SGEntity* other, SGCollisionResult* result)
        
        void (*evLevelStart)(SGEntity* entity)
        void (*evLevelEnd)(SGEntity* entity)
    
    SGEntity* sgEntityCreate(float priority)
    void sgEntityDestroy(SGEntity* entity)
    
    void sgEntitySetSprite(SGEntity* entity, SGSprite* sprite)
    SGSprite* sgEntityGetSprite(SGEntity* entity)
    
    void sgEntitySetMask(SGEntity* entity, SGMask* mask)
    SGMask* sgEntityGetMask(SGEntity* entity)
    
    void sgEntitySetPhysicsBody(SGEntity* entity, SGPhysicsBody* body)
    SGPhysicsBody* sgEntityGetPhysicsBody(SGEntity* entity)
    
    #void sgEntitySetAudioSource(SGEntity* entity, SGAudioSource* source)
    #SGAudioSource* sgEntityGetAudioSource(SGEntity* entity)
    
    void sgEntitySetPos(SGEntity* entity, float x, float y)
    void sgEntityGetPos(SGEntity* entity, float* x, float* y)
    
    void sgEntitySetPosX(SGEntity* entity, float x)
    float sgEntityGetPosX(SGEntity* entity)
    
    void sgEntitySetPosY(SGEntity* entity, float y)
    float sgEntityGetPosY(SGEntity* entity)
    
    void sgEntitySetDepth(SGEntity* entity, float depth)
    float sgEntityGetDepth(SGEntity* entity)
    
    void sgEntitySetAngleRads(SGEntity* entity, float rads)
    float sgEntityGetAngleRads(SGEntity* entity)
    
    void sgEntitySetAngleDegs(SGEntity* entity, float degs)
    float sgEntityGetAngleDegs(SGEntity* entity)
    
    void sgEntityDraw(SGEntity* entity)
