From: Tobias Leich Date: Thu, 5 Nov 2009 18:08:20 +0000 (+0100) Subject: added MouseButtonEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53b55ab1fac0645e066e41ab35a73446a03bd0c8;p=sdlgit%2FSDL_perl.git added MouseButtonEvent --- diff --git a/Build.PL b/Build.PL index 8203115..d422e00 100644 --- a/Build.PL +++ b/Build.PL @@ -63,6 +63,13 @@ my %subsystems = }, libraries => [qw( SDL )], }, + MouseButtonEvent => { + file => { + from => 'src/Core/objects/MouseButtonEvent.xs', + to => 'lib/SDL/MouseButtonEvent.xs', + }, + libraries => [qw( SDL )], + }, MouseMotionEvent => { file => { from => 'src/Core/objects/MouseMotionEvent.xs', diff --git a/src/Core/objects/MouseButtonEvent.xs b/src/Core/objects/MouseButtonEvent.xs new file mode 100644 index 0000000..f15cbc3 --- /dev/null +++ b/src/Core/objects/MouseButtonEvent.xs @@ -0,0 +1,74 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::MouseButtonEvent PACKAGE = SDL::MouseButtonEvent PREFIX = mbevent_ + +=for documentation + +SDL_MouseButtonEvent -- Mouse button event structure + + typedef struct{ + Uint8 type; + Uint8 which; + Uint8 button; + Uint8 state; + Uint16 x, y; + } SDL_MouseButtonEvent; + + +=cut + +Uint8 +mbevent_type ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->type; + OUTPUT: + RETVAL + +Uint8 +mbevent_which ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->which; + OUTPUT: + RETVAL + +Uint8 +mbevent_button ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->button; + OUTPUT: + RETVAL + +Uint8 +mbevent_state ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->state; + OUTPUT: + RETVAL + +Uint16 +mbevent_x ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->x; + OUTPUT: + RETVAL + +Uint16 +mbevent_y ( event, ... ) + SDL_MouseButtonEvent *event + CODE: + RETVAL = event->y; + OUTPUT: + RETVAL