FFI-Platypus
view release on metacpan or search on metacpan
Discussion
The API used by Microsoft Windows presents some unique challenges. On
32 bit systems a different ABI is used than what is used by the
standard C library. It also provides a rats nest of type aliases.
Finally if you want to talk Unicode to any of the Windows API you will
need to use UTF-16LE instead of UTF-8 which is native to Perl. (The
Win32 API refers to these as LPWSTR and LPCWSTR types). As much as
possible the Win32 "language" plugin attempts to handle these
challenges transparently. For more details see
FFI::Platypus::Lang::Win32.
Discussion
The libnotify library is a desktop GUI notification system for the
GNOME Desktop environment. This script sends a notification event that
should show up as a balloon, for me it did so in the upper right hand
corner of my screen.
Structured Data Records (by pointer or by reference)
lib/FFI/Platypus.pm view on Meta::CPAN
=head3 Discussion
The API used by Microsoft Windows presents some unique
challenges. On 32 bit systems a different ABI is used than what
is used by the standard C library. It also provides a rats nest of
type aliases. Finally if you want to talk Unicode to any of the
Windows API you will need to use C<UTF-16LE> instead of C<UTF-8>
which is native to Perl. (The Win32 API refers to these as
C<LPWSTR> and C<LPCWSTR> types). As much as possible the Win32
"language" plugin attempts to handle these challenges transparently.
For more details see L<FFI::Platypus::Lang::Win32>.
=head3 Discussion
The libnotify library is a desktop GUI notification system for the
GNOME Desktop environment. This script sends a notification event that
should show up as a balloon, for me it did so in the upper right hand
corner of my screen.
=head2 Structured Data Records (by pointer or by reference)
lib/FFI/Platypus/Lang/Win32.pm view on Meta::CPAN
strings probably requires some more detail:
[version 1.35]
This plugin also provides C<LPCWSTR> and C<LPWSTR> "wide" string types
which are implemented using L<FFI::Platypus::Type::WideString>. For
full details, please see the documentation for that module, and note
that C<LPCWSTR> is a wide string in the read-only string mode and
C<LPWSTR> is a wide string in the read-write buffer mode.
The C<LPCWSTR> is handled fairly transparently by the plugin, but for
when using read-write buffers (C<LPWSTR>) with the Win32 API you typically
need to allocate a buffer string of the right size. These examples will
use C<GetCurrentDirectoryW> attached as C<GetCurrentDirectory>
as in the synopsis above. These are illustrative only, you would normally
want to use the L<Cwd> module to get the current working directory.
=over 4
=item default buffer size 2048
lib/FFI/Platypus/Type/WideString.pm view on Meta::CPAN
These strings are most commonly used on Windows where they are referred to as
C<LPWSTR> and C<LPCWSTR> (The former for read/write buffers and the latter for
const read-only strings), where they are encoded as C<UTF-16LE>.
They are also supported by libc on many modern Unix systems where they are usually
C<UTF-32> of the native byte-order of the system. APIs on Unix systems more
commonly use UTF-8 which provides some compatibility with ASCII, but you may
occasionally find APIs that talk in wide strings. (libarchive, for example,
can work in both).
This plugin will detect the native wide string format for you and transparently
convert Perl strings, which are typically encoded internally as UTF-8. If for
some reason it cannot detect the correct encoding, or if your platform is
currently supported, an exception will be thrown (please open a ticket if this
is the case). It can be used either for read/write buffers, for const read-only
strings, and for return values. It supports these options:
Options:
=over 4
( run in 0.433 second using v1.01-cache-2.11-cpan-0a6323c29d9 )