From: Tobias Leich Date: Thu, 5 Nov 2009 17:59:30 +0000 (+0100) Subject: fixed KeyboardEvent::keysym, added MousMotionEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0044e8a57fe925be3967408f80e502d4b39dab6;p=sdlgit%2FSDL_perl.git fixed KeyboardEvent::keysym, added MousMotionEvent --- diff --git a/Build.PL b/Build.PL index a6dfd32..8203115 100644 --- a/Build.PL +++ b/Build.PL @@ -56,6 +56,20 @@ my %subsystems = }, libraries => [qw( SDL )], }, + KeyboardEvent => { + file => { + from => 'src/Core/objects/KeyboardEvent.xs', + to => 'lib/SDL/KeyboardEvent.xs', + }, + libraries => [qw( SDL )], + }, + MouseMotionEvent => { + file => { + from => 'src/Core/objects/MouseMotionEvent.xs', + to => 'lib/SDL/MouseMotionEvent.xs', + }, + libraries => [qw( SDL )], + }, MultiThread => { file => { from => 'src/Core/MultiThread.xs', diff --git a/src/Core/objects/KeyboardEvent.xs b/src/Core/objects/KeyboardEvent.xs index 580bdec..94ad8c6 100644 --- a/src/Core/objects/KeyboardEvent.xs +++ b/src/Core/objects/KeyboardEvent.xs @@ -39,10 +39,12 @@ kbevent_state ( event, ... ) OUTPUT: RETVAL -SDL_keysym +SDL_keysym * kbevent_keysym ( event, ... ) SDL_KeyboardEvent *event + PREINIT: + char* CLASS = "SDL::keysym"; CODE: - RETVAL = event->gain; + RETVAL = &(event->keysym); OUTPUT: RETVAL diff --git a/src/Core/objects/MouseMotionEvent.xs b/src/Core/objects/MouseMotionEvent.xs new file mode 100644 index 0000000..3441108 --- /dev/null +++ b/src/Core/objects/MouseMotionEvent.xs @@ -0,0 +1,73 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::MouseMotionEvent PACKAGE = SDL::MouseMotionEvent PREFIX = mmevent_ + +=for documentation + +SDL_MouseMotionEvent -- Mouse motion event structure + + typedef struct{ + Uint8 type; + Uint8 state; + Uint16 x, y; + Uint16 xrel, yrel; + } SDL_MouseMotionEvent; + + +=cut + +Uint8 +mmevent_type ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->type; + OUTPUT: + RETVAL + +Uint8 +mmevent_state ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->state; + OUTPUT: + RETVAL + +Uint16 +mmevent_x ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->x; + OUTPUT: + RETVAL + +Uint16 +mmevent_y ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->y; + OUTPUT: + RETVAL + +Uint16 +mmevent_xrel ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->xrel; + OUTPUT: + RETVAL + +Uint16 +mmevent_yrel ( event, ... ) + SDL_MouseMotionEvent *event + CODE: + RETVAL = event->yrel; + OUTPUT: + RETVAL