Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added stubs for SDL::Pango and SDL::Pango::Context

  • Loading branch information...
commit a74034f9c97b5317202ec898c92fb41086ee7aaa 1 parent 2a83d41
Tobias Leich authored
View
21 Build.PL
@@ -351,7 +351,21 @@ my %subsystems =
to => 'lib/SDL/Image.xs',
},
libraries => [qw( SDL SDL_image jpeg png )],
- },
+ },
+ Pango => {
+ file => {
+ from => 'src/Pango/Pango.xs',
+ to => 'lib/SDL/Pango.xs',
+ },
+ libraries => [qw( SDL SDL_Pango )],
+ },
+ Context => {
+ file => {
+ from => 'src/Pango/objects/Context.xs',
+ to => 'lib/SDL/Pango/Context.xs',
+ },
+ libraries => [qw( SDL SDL_Pango )],
+ },
# Net => {
# file => {
# from => 'src/Net/Net.xs',
@@ -445,6 +459,11 @@ my %libraries = (
header => 'SDL_rotozoom.h',
lib => 'SDL_gfx',
},
+ SDL_Pango => {
+ define => 'HAVE_SDL_PANGO',
+ header => 'SDL_Pango.h',
+ lib => 'SDL_Pango',
+ },
png => {
define => 'HAVE_PNG',
header => 'png.h',
View
13 lib/SDL/Pango.pm
@@ -0,0 +1,13 @@
+package SDL::Pango;
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
+bootstrap SDL::Pango;
+
+1;
View
13 lib/SDL/Pango/Context.pm
@@ -0,0 +1,13 @@
+package SDL::Pango::Context;
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
+bootstrap SDL::Pango::Context;
+
+1;
View
35 src/Pango/Pango.xs
@@ -0,0 +1,35 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <SDL.h>
+
+#ifdef HAVE_SDL_PANGO
+#include <SDL_Pango.h>
+#endif
+
+MODULE = SDL::Pango PACKAGE = SDL::Pango PREFIX = pango_
+
+=for documentation
+
+See L<http://sdlpango.sourceforge.net/>
+
+=cut
+
+#ifdef HAVE_SDL_PANGO
+
+int
+pango_init()
+ CODE:
+ RETVAL = SDLPango_Init();
+ OUTPUT:
+ RETVAL
+
+int
+pango_was_init()
+ CODE:
+ RETVAL = SDLPango_WasInit();
+ OUTPUT:
+ RETVAL
+
+#endif
View
27 src/Pango/objects/Context.xs
@@ -0,0 +1,27 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <SDL.h>
+
+#ifdef HAVE_SDL_PANGO
+#include <SDL_Pango.h>
+#endif
+
+MODULE = SDL::Pango::Context PACKAGE = SDL::Pango::Context PREFIX = context_
+
+=for documentation
+
+See L<http://sdlpango.sourceforge.net/>
+
+=cut
+
+#ifdef HAVE_SDL_PANGO
+
+void
+context_DESTROY(self)
+ SDLPango_Context *self
+ CODE:
+ SDLPango_FreeContext(self);
+
+#endif
View
3  t/00-load.t
@@ -47,6 +47,9 @@ SDL::Mixer::Effects
SDL::Mixer::MixChunk
SDL::Mixer::MixMusic
+SDL::Pango
+SDL::Pango::Context
+
SDL::TTF
SDL::TTF::Font
View
1  t/config.t
@@ -14,6 +14,7 @@ diag "Has SDL_gfx_imagefilter = " . SDL::Config->has('SDL_gfx_imagefilter');
diag "Has SDL_gfx_primitives = " . SDL::Config->has('SDL_gfx_primitives');
diag "Has SDL_gfx_rotozoom = " . SDL::Config->has('SDL_gfx_rotozoom');
diag "Has SDL_net = " . SDL::Config->has('SDL_net');
+diag "Has SDL_Pango = " . SDL::Config->has('SDL_Pango');
diag "Has SDL_sound = " . SDL::Config->has('SDL_sound');
diag "Has smpeg = " . SDL::Config->has('smpeg');
diag "Has png = " . SDL::Config->has('png');
View
33 t/pango.t
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+use strict;
+use SDL;
+use SDL::Config;
+use SDL::Color;
+use SDL::Surface;
+use SDL::Overlay;
+use SDL::Rect;
+use SDL::Video;
+
+BEGIN
+{
+ use Test::More;
+ use lib 't/lib';
+ use SDL::TestTool;
+
+ if( !SDL::Config->has('SDL_Pango') )
+ {
+ plan( skip_all => 'SDL_Pango support not compiled' );
+ }
+}
+
+use SDL::Pango;
+use SDL::Pango::Context;
+use SDL::Version;
+
+is( SDL::Pango::was_init(), 0, "[was_init] returns false" );
+is( SDL::Pango::init(), 0, "[init] succeeded" );
+is( SDL::Pango::was_init(), -1, "[was_init] returns true" );
+
+done_testing;
+
+sleep(1);
View
1  typemap
@@ -53,6 +53,7 @@ Mix_Fading T_UV
Mix_Chunk * O_OBJECT
Mix_Music * O_OBJECT
SDL_GLattr T_IV
+SDLPango_Context * O_OBJECT
int * T_PTR
int ** T_PTR
void * T_PTR
Please sign in to comment.
Something went wrong with that request. Please try again.