Alien-SDL

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


  # sdl-config script
  push @candidates, $rv if $rv = check_config_script("sdl-config");

  if( $build->can_build_binaries_from_sources || scalar(@candidates) ) {
    for(qw(pthread SDL
           z jpeg tiff png SDL_image
           ogg vorbis vorbisfile SDL_mixer
           freetype SDL_ttf
           SDL_gfx
           pangoft2 pango gobject gmodule glib fontconfig expat SDL_Pango)) {
      $have_libs{$_} = check_prereqs_libs($_);
    }
  }

  $perl_libs{pthread} = check_perl_buildlibs('pthread') if $have_libs{pthread} && $^O eq 'openbsd';

  # prebuilt binaries (windows only)
  push @candidates, @{$rv} if $rv = check_prebuilt_binaries($build->os_type);

  if($build->can_build_binaries_from_sources) {

inc/My/Builder.pm  view on Meta::CPAN

      $shlib_map{SDL} = $full unless $shlib_map{SDL};
    }
  };

  $cfg->{ld_shared_libs} = [ @shlibs ];
  $cfg->{ld_paths}       = [ keys %tmp ];
  $cfg->{ld_shlib_map}   = \%shlib_map;

  my $have_libs = $self->notes('have_libs');
  for(qw(pthread  z jpeg tiff png ogg vorbis vorbisfile freetype
         pangoft2 pango gobject gmodule glib fontconfig expat )) {
    if( !$shlib_map{$_} && $have_libs->{$_}->[0] ) {
      next unless defined $have_libs->{$_}->[1];
      if ($_ eq 'pthread' && $^O eq 'openbsd') {
        my $osver = `uname -r 2>/dev/null`;
        if ($self->notes('perl_libs')->{pthread} || ($osver && $osver < 5.0)) {
          push @{ $cfg->{ld_shared_libs} }, $have_libs->{$_}->[1];
          $shlib_map{$_} = $have_libs->{$_}->[1];
        }
      }
      else {

inc/My/Utility.pm  view on Meta::CPAN

  '/usr/local/include'       => '/usr/local/lib',
  '/usr/include'             => '/usr/lib',
  '/usr/X11R6/include'       => '/usr/X11R6/lib',
  '/usr/local/include/smpeg' => '/usr/local/lib',
};
$inc_lib_candidates->{'/usr/pkg/include/smpeg'} = '/usr/local/lib'            if -f '/usr/pkg/include/smpeg/smpeg.h';
$inc_lib_candidates->{'/usr/include/smpeg'}     = '/usr/lib'                  if -f '/usr/include/smpeg/smpeg.h';
$inc_lib_candidates->{'/usr/X11R6/include'}     = '/usr/X11R6/lib'            if -f '/usr/X11R6/include/GL/gl.h';
$inc_lib_candidates->{'/usr/X11R7/include'}     = '/usr/X11R7/lib'            if -f '/usr/X11R7/include/GL/gl.h';
$inc_lib_candidates->{'/usr/X11R7/include'}     = '/usr/X11R7/lib'            if -f '/usr/X11R7/include/freetype2/freetype/freetype.h';
$inc_lib_candidates->{'/usr/X11R7/include'}     = '/usr/X11R7/lib'            if -f '/usr/X11R7/include/fontconfig/fontconfig.h';
$inc_lib_candidates->{'/usr/include/ogg'}       = '/usr/lib/x86_64-linux-gnu' if -f '/usr/lib/x86_64-linux-gnu/libogg.so';
$inc_lib_candidates->{'/usr/include/vorbis'}    = '/usr/lib/x86_64-linux-gnu' if -f '/usr/lib/x86_64-linux-gnu/libvorbis.so';
$inc_lib_candidates->{'/usr/include'}           = '/usr/lib64'                if -e '/usr/lib64' && $Config{'myarchname'} =~ /64/;
$inc_lib_candidates->{$ENV{SDL_INC}}            = $ENV{SDL_LIB}               if exists $ENV{SDL_LIB} && exists $ENV{SDL_INC};

#### packs with prebuilt binaries
# - all regexps has to match: arch_re ~ $Config{archname}, cc_re ~ $Config{cc}, os_re ~ $^O
# - the order matters, we offer binaries to user in the same order (1st = preffered)
my $prebuilt_binaries = [
    {

inc/My/Utility.pm  view on Meta::CPAN

        patches => [
          'SDL_Pango-0.1.2-API-adds.1.patch',
          'SDL_Pango-0.1.2-API-adds.2.patch',
          'SDL_Pango-0.1.2-config-tools.1.patch',
          'SDL_Pango-0.1.2-config-tools.2.patch',
          'SDL_Pango-0.1.2-config-tools.3.patch',
          'SDL_Pango-0.1.2-include-ft2build.h.patch',
        ],
        prereqs => {
          libs => [
            'pangoft2', 'pango', 'gobject', 'gmodule', 'glib', 'fontconfig', 'freetype', 'expat', # SDL_Pango
          ]
        }
      },
    ],
  },
];

sub check_config_script {
  my $script = shift || 'sdl-config';
  print "checking for config script... ";

patches/SDL_Pango-0.1.2-API-adds.1.patch  view on Meta::CPAN

     SDL_UnlockSurface(surface);
 }
 
-/*!
-    Create a context which contains Pango objects.
-
-    @return A pointer to the context as a SDLPango_Context*.
-*/
 SDLPango_Context*
-SDLPango_CreateContext()
+SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
 {
     SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
     G_CONST_RETURN char *charset;
@@ -743,8 +738,7 @@
     pango_context_set_language (context->context, pango_language_from_string (charset));
     pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
 
-    context->font_desc = pango_font_description_from_string(
-	MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
+    context->font_desc = pango_font_description_from_string(font_desc);
 
     context->layout = pango_layout_new (context->context);
 
@@ -762,6 +756,17 @@
 }
 
 /*!
+    Create a context which contains Pango objects.
+
+    @return A pointer to the context as a SDLPango_Context*.

patches/SDL_Pango-0.1.2-API-adds.1.patch  view on Meta::CPAN

+SDLPango_CreateContext()
+{
+     SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
+}
+
+/*!
     Free a context.
 
     @param *context [i/o] Context to be free
@@ -1053,6 +1058,20 @@
     pango_layout_set_font_description (context->layout, context->font_desc);
 }
 
+void
+SDLPango_SetText_GivenAlignment(
+    SDLPango_Context *context,
+    const char *text,
+    int length,
+    SDLPango_Alignment alignment)
+{
+    pango_layout_set_attributes(context->layout, NULL);
+    pango_layout_set_text (context->layout, text, length);
+    pango_layout_set_auto_dir (context->layout, TRUE);
+    pango_layout_set_alignment (context->layout, alignment);
+    pango_layout_set_font_description (context->layout, context->font_desc);
+}
+
 /*!
     Set plain text to context.
     Text must be utf-8.
@@ -1067,11 +1086,7 @@
     const char *text,
     int length)
 {
-    pango_layout_set_attributes(context->layout, NULL);
-    pango_layout_set_text (context->layout, text, length);
-    pango_layout_set_auto_dir (context->layout, TRUE);
-    pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT);
-    pango_layout_set_font_description (context->layout, context->font_desc);
+     SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
 }
 
 /*!

patches/SDL_Pango-0.1.2-API-adds.2.patch  view on Meta::CPAN

+typedef enum {
+    SDLPANGO_ALIGN_LEFT,
+    SDLPANGO_ALIGN_CENTER,
+    SDLPANGO_ALIGN_RIGHT
+} SDLPango_Alignment;
 
 extern DECLSPEC int SDLCALL SDLPango_Init();
 
 extern DECLSPEC int SDLCALL SDLPango_WasInit();
 
+extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
 extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
 
 extern DECLSPEC void SDLCALL SDLPango_FreeContext(
@@ -157,6 +170,12 @@
     const char *markup,
     int length);
 
+extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
+    SDLPango_Context *context,
+    const char *text,



( run in 1.461 second using v1.01-cache-2.11-cpan-5735350b133 )