From: Kartik Thakore Date: Thu, 5 Nov 2009 02:51:37 +0000 (-0500) Subject: Added stubs Event and ActiveEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=506813f7a648c7605acb6f27d46ea08367f4a331;p=sdlgit%2FSDL_perl.git Added stubs Event and ActiveEvent --- diff --git a/src/Core/objects/ActiveState.xs b/src/Core/objects/ActiveState.xs new file mode 100644 index 0000000..085e98f --- /dev/null +++ b/src/Core/objects/ActiveState.xs @@ -0,0 +1,49 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::ActiveEvent PACKAGE = SDL::ActiveEvent PREFIX = aevent_ + +=for documentation + +SDL_ActiveEvent -- Application visibility event structure + + typedef union{ + Uint8 type; + Uint8 gain; + Uint8 state; + } SDL_Event; + + +=cut + +Uint8 +aevent_type ( event, ... ) + SDL_ActiveEvent *event + CODE: + RETVAL = event->type; + OUTPUT: + RETVAL + + +Uint8 +aevent_gain ( event, ... ) + SDL_ActiveEvent *event + CODE: + RETVAL = event->gain; + OUTPUT: + RETVAL + +Uint8 +aevent_state ( event, ... ) + SDL_ActiveEvent *event + CODE: + RETVAL = event->state; + OUTPUT: + RETVAL diff --git a/src/Core/objects/Event.xs b/src/Core/objects/Event.xs new file mode 100644 index 0000000..a0f45bd --- /dev/null +++ b/src/Core/objects/Event.xs @@ -0,0 +1,66 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::Event PACKAGE = SDL::Rect PREFIX = event_ + +=for documentation + +SDL_Event -- General event structure + + typedef union{ + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; + } SDL_Event; + + +=cut + +SDL_Event * +event_new (CLASS) + char* CLASS + CODE: + SDL_Event* empty_event; + RETVAL = empty_event; + OUTPUT: + RETVAL + +Uint8 +event_type ( event, ... ) + SDL_Event *event + CODE: + RETVAL = NULL; + if ( &event != NULL ) + RETVAL = event->type; + OUTPUT: + RETVAL + +SDL_ActiveEvent * +event_active ( event, ... ) + SDL_Event *event + CODE: + RETVAL = NULL; + if ( &event != NULL ) + RETVAL = &(event->active); + OUTPUT: + RETVAL + +