SDL2-FFI

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

lib/SDL2/Version.pod
lib/SDL2/Window.pod
lib/SDL2/WindowEvent.pod
lib/SDL2/WindowShapeMode.pod
lib/SDL2/WindowShapeParams.pod
lib/SDL2/assert.pm
lib/SDL2/atomic.pm
lib/SDL2/atomic_t.pm
lib/SDL2/audio.pm
lib/SDL2/blendmode.pm
lib/SDL2/clipboard.pm
lib/SDL2/cpuinfo.pm
lib/SDL2/endian.pm
lib/SDL2/error.pm
lib/SDL2/events.pm
lib/SDL2/filesystem.pm
lib/SDL2/gamecontroller.pm
lib/SDL2/gesture.pm
lib/SDL2/haptic.pm
lib/SDL2/hints.pm
lib/SDL2/iconv_t.pm

META.json  view on Meta::CPAN

      "SDL2::atomic_t" : {
         "file" : "lib/SDL2/atomic_t.pm"
      },
      "SDL2::audio" : {
         "file" : "lib/SDL2/audio.pm"
      },
      "SDL2::blendmode" : {
         "file" : "lib/SDL2/blendmode.pm",
         "version" : "0.01"
      },
      "SDL2::clipboard" : {
         "file" : "lib/SDL2/clipboard.pm",
         "version" : "0.01"
      },
      "SDL2::endian" : {
         "file" : "lib/SDL2/endian.pm"
      },
      "SDL2::error" : {
         "file" : "lib/SDL2/error.pm",
         "version" : "0.01"
      },
      "SDL2::events" : {

META.yml  view on Meta::CPAN

    file: lib/SDL2/assert.pm
  SDL2::atomic:
    file: lib/SDL2/atomic.pm
  SDL2::atomic_t:
    file: lib/SDL2/atomic_t.pm
  SDL2::audio:
    file: lib/SDL2/audio.pm
  SDL2::blendmode:
    file: lib/SDL2/blendmode.pm
    version: '0.01'
  SDL2::clipboard:
    file: lib/SDL2/clipboard.pm
    version: '0.01'
  SDL2::endian:
    file: lib/SDL2/endian.pm
  SDL2::error:
    file: lib/SDL2/error.pm
    version: '0.01'
  SDL2::events:
    file: lib/SDL2/events.pm
    version: '0.01'
  SDL2::filesystem:

lib/SDL2/FFI.pm  view on Meta::CPAN

    my $platform = $^O;                            # https://perldoc.perl.org/perlport#PLATFORMS
    my $Windows  = !!( $platform eq 'MSWin32' );
    #
    load_lib('SDL2');
    #
    require SDL2::stdinc;
    require SDL2::assert;                          # Enable with use var like C<use SDL2 -assert=3;>
    require SDL2::atomic;
    require SDL2::rwops;                           # Does not belong here?
    require SDL2::audio;
    require SDL2::clipboard;
    require SDL2::cpuinfo;
    require SDL2::error;
    require SDL2::events;
    require SDL2::filesystem;
    require SDL2::gamecontroller;
    require SDL2::haptic;
    require SDL2::hints;
    require SDL2::joystick;
    require SDL2::loadso;
    require SDL2::log;

lib/SDL2/clipboard.pm  view on Meta::CPAN

package SDL2::clipboard 0.01 {
    use SDL2::Utils;
    attach clipboard => {
        SDL_SetClipboardText => [ ['string'], 'int' ],
        SDL_GetClipboardText => [ [],         'string' ],
        SDL_HasClipboardText => [ [],         'SDL_bool' ]
    };

=encoding utf-8

=head1 NAME

SDL2::clipboard - UTF-8 Friendly Clipboard Functions

=head1 SYNOPSIS

    use SDL2 qw[:clipboard];

=head1 DESCRIPTION

Basic clipboard handling.

=head1 Functions

These functions expose the clipboard. SDL's video subsystem must be initialized
to get or modify clipboard text.

=head2 C<SDL_SetClipboardText( ... )>

Put UTF-8 text into the clipboard.

    SDL_SetClipboardText( 'Hello, world!' );

Expected parameters include:

=over

=item C<text> - the text to store in the clipboard

=back

Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.

=head2 C<SDL_GetClipboardText( )>

Get UTF-8 text from the clipboard, which must be freed with C<SDL_free( )>.

    my $clipboard = SDL_GetClipboardText( );

This functions returns NULL if there was not enough memory left for a copy of
the clipboard's content.

Returns the clipboard text on success or NULL on failure; call C<SDL_GetError(
)> for more information. Caller must call C<SDL_free( )> on the returned
pointer when done with it.

=head2 C<SDL_HasClipboardText( )>

Query whether the clipboard exists and contains a non-empty text string.

    if ( SDL_HasClipboardText( ) ) {
        ...
    }

Returns C<SDL_TRUE> if the clipboard has text, or C<SDL_FALSE> if it does not.

=head1 LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under
the terms found in the Artistic License 2. Other copyrights, terms, and
conditions may apply to data transmitted through this module.

=head1 AUTHOR

lib/SDL2/events.pm  view on Meta::CPAN

=item C<SDL_DOLLARRECORD>

=item C<SDL_MULTIGESTURE>

=back

Clipboard events

=over

=item C<SDL_CLIPBOARDUPDATE> - The clipboard changed

=back

Drag and drop events

=over

=item C<SDL_DROPFILE> - The system requests a file open

=item C<SDL_DROPTEXT> - text/plain drag-and-drop event



( run in 1.146 second using v1.01-cache-2.11-cpan-2398b32b56e )