added SysWMEvent
Tobias Leich [Thu, 5 Nov 2009 21:04:54 +0000 (22:04 +0100)]
Build.PL
src/Core/objects/SysWMEvent.xs [new file with mode: 0644]

index 11925fb..0e14209 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -147,6 +147,13 @@ my %subsystems =
                },
                libraries => [qw( SDL )],
        },
+       SysWMEvent => {
+               file      => {
+                       from  => 'src/Core/objects/SysWMEvent.xs',
+                       to    => 'lib/SDL/SysWMEvent.xs',
+               },
+               libraries => [qw( SDL )],
+       },
        Overlay => {
                file      => {
                        from  => 'src/Core/objects/Overlay.xs',
diff --git a/src/Core/objects/SysWMEvent.xs b/src/Core/objects/SysWMEvent.xs
new file mode 100644 (file)
index 0000000..5f7354b
--- /dev/null
@@ -0,0 +1,42 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+MODULE = SDL::SysWMEvent       PACKAGE = SDL::SysWMEvent    PREFIX = wmevent_
+
+=for documentation
+
+SDL_SysWMEvent -- Platform-dependent window manager event
+
+ typedef struct{
+  Uint8 type; /* Always SDL_SYSWMEVEBT */
+  SDL_SysWMmsg *msg;
+ } SDL_SysWMEvent;
+
+see also: L<SDL::WindowManagement::sys_WM_event>
+
+=cut
+
+Uint8
+wmevent_type ( event, ... )
+       SDL_SysWMEvent *event
+       CODE: 
+               RETVAL = event->type;
+       OUTPUT:
+               RETVAL
+
+SDL_SysWMmsg *
+wmevent_msg ( event, ... )
+       SDL_SysWMEvent *event
+       PREINIT:
+               char* CLASS = "SDL::SysWMmsg";
+       CODE: 
+               RETVAL = &(event->msg);
+       OUTPUT:
+               RETVAL