Added stubs Event and ActiveEvent
Kartik Thakore [Thu, 5 Nov 2009 02:51:37 +0000 (21:51 -0500)]
src/Core/objects/ActiveState.xs [new file with mode: 0644]
src/Core/objects/Event.xs [new file with mode: 0644]

diff --git a/src/Core/objects/ActiveState.xs b/src/Core/objects/ActiveState.xs
new file mode 100644 (file)
index 0000000..085e98f
--- /dev/null
@@ -0,0 +1,49 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+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 (file)
index 0000000..a0f45bd
--- /dev/null
@@ -0,0 +1,66 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+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
+
+