Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37566892
en ru br
Репозитории ALT

Группа :: Разработка/Perl
Пакет: perl-X11-Xlib

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

pax_global_header00006660000000000000000000000064122244663650014524gustar00rootroot0000000000000052 comment=5dd24e5abae8e700381b78ab3e2d5a3ab7cfc710
perl-X11-Xlib-0.02/000075500000000000000000000000001222446636500136505ustar00rootroot00000000000000perl-X11-Xlib-0.02/Changes000064400000000000000000000003511222446636500151420ustar00rootroot00000000000000Revision history for Perl extension X11::Xlib.

0.02 Sat Aug 21 13:48:00 2009
- formating and doc improvement (by chocolateboy)

0.01 Wed Jul 1 00:25:01 2009
- original version; created by h2xs 1.23 with options X11::Xlib
perl-X11-Xlib-0.02/MANIFEST000064400000000000000000000003161222446636500150010ustar00rootroot00000000000000Changes
inc/Devel/CheckLib.pm
lib/X11/Xlib.pm
lib/X11/Xlib/Window.pm
Makefile.PL
MANIFEST
META.yml Module meta-data (added by MakeMaker)
README
t/0-Pod-Coverage.t
t/0-Pod.t
t/1-X11-Xlib.t
typemap
Xlib.xs
perl-X11-Xlib-0.02/META.yml000064400000000000000000000010431222446636500151170ustar00rootroot00000000000000--- #YAML:1.0
name: X11-Xlib
version: 0.02
abstract: Low-level access to the X11 library
author:
- Olivier Thauvin <nanardon@nanardon.zarb.org>
license: unknown
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires: {}
no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
perl-X11-Xlib-0.02/Makefile.PL000064400000000000000000000022611222446636500156230ustar00rootroot00000000000000use 5.008000;

use strict;
use warnings;

use lib qw(inc);

use Devel::CheckLib;
use ExtUtils::MakeMaker;

check_lib_or_exit(
lib => 'X11',
header => [ 'X11/Xlib.h', 'X11/Xutil.h' ]
);

check_lib_or_exit(
lib => 'Xtst',
header => [ 'X11/extensions/XTest.h' ]
);

check_lib_or_exit(
lib => 'Xext'
);

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'X11::Xlib',
VERSION_FROM => 'lib/X11/Xlib.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/X11/Xlib.pm', # retrieve abstract from module
AUTHOR => 'Olivier Thauvin <nanardon@nanardon.zarb.org>') : ()),
LIBS => [ '-lX11 -lXtst -lXext' ], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I.', # e.g., '-I. -I/usr/include/other'
# Un-comment this if you add C files to link with later:
# OBJECT => '$(O_FILES)', # link all the C files too
);
perl-X11-Xlib-0.02/README000064400000000000000000000012301222446636500145240ustar00rootroot00000000000000X11-Xlib version 0.01
=====================

This module provide low-level access to X11 libary functions.

This includes access to some X11 extensions like the X11 test library (Xtst).

INSTALLATION

To install this module type the following:

perl Makefile.PL
make
make test
make install

DEPENDENCIES

This module requires these other libraries:

X11
Xtest
Xext

COPYRIGHT AND LICENCE

Copyright (C) 2009-2010 by Olivier Thauvin

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.7.1 or,
at your option, any later version of Perl 5 you may have available.
perl-X11-Xlib-0.02/Xlib.xs000064400000000000000000000074541222446636500151340ustar00rootroot00000000000000#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include <X11/Xlib.h>
#include <X11/Xutil.h>

static Display *TheXDisplay = NULL;

MODULE = X11::Xlib PACKAGE = X11::Xlib

void
new(class, display = NULL)
char * class
char * display
PREINIT:
Display * dpy;
PPCODE:
dpy = XOpenDisplay(display);
XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), "X11::Xlib", dpy)));

void
DESTROY(dpy)
Display *dpy
PPCODE:
(void) XCloseDisplay(dpy);

int
DisplayWidth(dpy, screen=0)
Display *dpy
int screen
CODE:
RETVAL = DisplayWidth(dpy, screen);
OUTPUT:
RETVAL

int
DisplayHeight(dpy, screen=0)
Display *dpy
int screen
CODE:
RETVAL = DisplayHeight(dpy, screen);
OUTPUT:
RETVAL


# /* Windows */

void
RootWindow(dpy, screen)
Display * dpy
int screen
PREINIT:
Window window;
PPCODE:
window = RootWindow(dpy, screen);
XPUSHs(sv_2mortal(sv_setref_uv(newSVpv("", 0), "X11::Xlib::Window", window)));

# /* Event */

int
XTestFakeMotionEvent(dpy, screen, x, y, EventSendDelay = 10)
Display * dpy
int screen
int x
int y
int EventSendDelay

int
XTestFakeButtonEvent(dpy, button, pressed, EventSendDelay = 10);
Display * dpy
int button
int pressed
int EventSendDelay

int
XTestFakeKeyEvent(dpy, kc, pressed, EventSendDelay = 10)
Display * dpy
unsigned char kc
int pressed
int EventSendDelay

void
XBell(dpy, percent)
Display * dpy
int percent

void
XQueryKeymap(dpy)
Display * dpy
PREINIT:
char keys_return[32];
int i, j;
PPCODE:
XQueryKeymap(dpy, keys_return);
for(i=0; i<32; i++) {
for (j=0; j<8;j++) {
if (keys_return[i] & (1 << j))
XPUSHs(sv_2mortal(newSViv(i * 8 + j)));
}
}

unsigned long
keyboard_leds(dpy)
Display * dpy;
PREINIT:
XKeyboardState state;
CODE:
XGetKeyboardControl(dpy, &state);
RETVAL = state.led_mask;
OUTPUT:
RETVAL

void
_auto_repeat(dpy)
Display * dpy;
PREINIT:
XKeyboardState state;
int i, j;
CODE:
XGetKeyboardControl(dpy, &state);
for(i=0; i<32; i++) {
for (j=0; j<8; j++) {
if (state.auto_repeats[i] & (1 << j))
XPUSHs(sv_2mortal(newSViv(i * 8 + j)));
}
}

void
XFlush(dpy)
Display *dpy

void
XSync(dpy, flush=0)
Display * dpy
int flush

# /* keyboard functions */

char *
XKeysymToString(keysym)
unsigned long keysym
CODE:
RETVAL = XKeysymToString(keysym);
OUTPUT:
RETVAL

unsigned long
XStringToKeysym(string)
char * string
CODE:
RETVAL = XStringToKeysym(string);
OUTPUT:
RETVAL

int
IsKeypadKey(keysym)
unsigned long keysym

int
IsPrivateKeypadKey(keysym)
unsigned long keysym

int
IsPFKey(keysym)
unsigned long keysym

int
IsFunctionKey(keysym)
unsigned long keysym

int
IsMiscFunctionKey(keysym)
unsigned long keysym

int
IsModifierKey(keysym)
unsigned long keysym

unsigned int
XKeysymToKeycode(dpy, keysym)
Display *dpy
unsigned long keysym
CODE:
RETVAL = XKeysymToKeycode(dpy, keysym);
OUTPUT:
RETVAL


void
XGetKeyboardMapping(dpy, fkeycode, count = 1)
Display *dpy
unsigned int fkeycode
int count
PREINIT:
int creturn;
KeySym * keysym;
int i = 0;
PPCODE:
keysym = XGetKeyboardMapping(dpy, fkeycode, count, &creturn);
EXTEND(SP, creturn -1);
for (i=0; i < creturn; i++)
XPUSHs(sv_2mortal(newSVuv(keysym[i])));

MODULE = X11::Xlib PACKAGE = X11::Xlib::Window

unsigned int
id(window)
Window window
CODE:
RETVAL = window;
OUTPUT:
RETVAL
perl-X11-Xlib-0.02/inc/000075500000000000000000000000001222446636500144215ustar00rootroot00000000000000perl-X11-Xlib-0.02/inc/Devel/000075500000000000000000000000001222446636500154605ustar00rootroot00000000000000perl-X11-Xlib-0.02/inc/Devel/CheckLib.pm000064400000000000000000000264071222446636500174730ustar00rootroot00000000000000# $Id: CheckLib.pm,v 1.25 2008/10/27 12:16:23 drhyde Exp $

package #
Devel::CheckLib;

use strict;
use vars qw($VERSION @ISA @EXPORT);
$VERSION = '0.6';
use Config;

use File::Spec;
use File::Temp;

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(assert_lib check_lib_or_exit);

# localising prevents the warningness leaking out of this module
local $^W = 1; # use warnings is a 5.6-ism

_findcc(); # bomb out early if there's no compiler

=head1 NAME

Devel::CheckLib - check that a library is available

=head1 DESCRIPTION

Devel::CheckLib is a perl module that checks whether a particular C
library and its headers are available.

=head1 SYNOPSIS

use Devel::CheckLib;

check_lib_or_exit( lib => 'jpeg', header => 'jpeglib.h' );
check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] );

# or prompt for path to library and then do this:
check_lib_or_exit( lib => 'jpeg', libpath => $additional_path );

=head1 USING IT IN Makefile.PL or Build.PL

If you want to use this from Makefile.PL or Build.PL, do
not simply copy the module into your distribution as this may cause
problems when PAUSE and search.cpan.org index the distro. Instead, use
the use-devel-checklib script.

=head1 HOW IT WORKS

You pass named parameters to a function, describing to it how to build
and link to the libraries.

It works by trying to compile this:

int main(void) { return 0; }

and linking it to the specified libraries. If something pops out the end
which looks executable, then we know that it worked. That tiny program is
built once for each library that you specify, and (without linking) once
for each header file.

=head1 FUNCTIONS

All of these take the same named parameters and are exported by default.
To avoid exporting them, C<use Devel::CheckLib ()>.

=head2 assert_lib

This takes several named parameters, all of which are optional, and dies
with an error message if any of the libraries listed can
not be found. B<Note>: dying in a Makefile.PL or Build.PL may provoke
a 'FAIL' report from CPAN Testers' automated smoke testers. Use
C<check_lib_or_exit> instead.

The named parameters are:

=over

=item lib

Must be either a string with the name of a single
library or a reference to an array of strings of library names. Depending
on the compiler found, library names will be fed to the compiler either as
C<-l> arguments or as C<.lib> file names. (E.g. C<-ljpeg> or C<jpeg.lib>)

=item libpath

a string or an array of strings
representing additional paths to search for libraries.

=item LIBS

a C<ExtUtils::MakeMaker>-style space-seperated list of
libraries (each preceded by '-l') and directories (preceded by '-L').

This can also be supplied on the command-line.

=back

And libraries are no use without header files, so ...

=over

=item header

Must be either a string with the name of a single
header file or a reference to an array of strings of header file names.

=item incpath

a string or an array of strings
representing additional paths to search for headers.

=item INC

a C<ExtUtils::MakeMaker>-style space-seperated list of
incpaths, each preceded by '-I'.

This can also be supplied on the command-line.

=back

=head2 check_lib_or_exit

This behaves exactly the same as C<assert_lib()> except that instead of
dieing, it warns (with exactly the same error message) and exits.
This is intended for use in Makefile.PL / Build.PL
when you might want to prompt the user for various paths and
things before checking that what they've told you is sane.

If any library or header is missing, it exits with an exit value of 0 to avoid
causing a CPAN Testers 'FAIL' report. CPAN Testers should ignore this
result -- which is what you want if an external library dependency is not
available.

=cut

sub check_lib_or_exit {
eval 'assert_lib(@_)';
if($@) {
warn $@;
exit;
}
}

sub assert_lib {
my %args = @_;
my (@libs, @libpaths, @headers, @incpaths);

# FIXME: these four just SCREAM "refactor" at me
@libs = (ref($args{lib}) ? @{$args{lib}} : $args{lib})
if $args{lib};
@libpaths = (ref($args{libpath}) ? @{$args{libpath}} : $args{libpath})
if $args{libpath};
@headers = (ref($args{header}) ? @{$args{header}} : $args{header})
if $args{header};
@incpaths = (ref($args{incpath}) ? @{$args{incpath}} : $args{incpath})
if $args{incpath};

# work-a-like for Makefile.PL's LIBS and INC arguments
# if given as command-line argument, append to %args
for my $arg (@ARGV) {
for my $mm_attr_key qw(LIBS INC) {
if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) {
# it is tempting to put some \s* into the expression, but the
# MM command-line parser only accepts LIBS etc. followed by =,
# so we should not be any more lenient with whitespace than that
$args{$mm_attr_key} .= " $mm_attr_value";
}
}
}

# using special form of split to trim whitespace
if(defined($args{LIBS})) {
foreach my $arg (split(' ', $args{LIBS})) {
die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-l/i);
push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2);
}
}
if(defined($args{INC})) {
foreach my $arg (split(' ', $args{INC})) {
die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/);
push @incpaths, substr($arg, 2);
}
}

my @cc = _findcc();
my @missing;

# first figure out which headers we can't find ...
for my $header (@headers) {
my($ch, $cfile) = File::Temp::tempfile(
'assertlibXXXXXXXX', SUFFIX => '.c'
);
print $ch qq{#include <$header>\nint main(void) { return 0; }\n};
close($ch);
my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
my @sys_cmd;
# FIXME: re-factor - almost identical code later when linking
if ( $Config{cc} eq 'cl' ) { # Microsoft compiler
require Win32;
@sys_cmd = (@cc, $cfile, "/Fe$exefile", (map { '/I'.Win32::GetShortPathName($_) } @incpaths));
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
@sys_cmd = (@cc, (map { "-I$_" } @incpaths), "-o$exefile", $cfile);
} else { # Unix-ish
# gcc, Sun, AIX (gcc, cc)
@sys_cmd = (@cc, $cfile, (map { "-I$_" } @incpaths), "-o", "$exefile");
}
warn "# @sys_cmd\n" if $args{debug};
my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
push @missing, $header if $rv != 0 || ! -x $exefile;
_cleanup_exe($exefile);
unlink $cfile;
}

# now do each library in turn with no headers
my($ch, $cfile) = File::Temp::tempfile(
'assertlibXXXXXXXX', SUFFIX => '.c'
);
print $ch "int main(void) { return 0; }\n";
close($ch);
for my $lib ( @libs ) {
my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
my @sys_cmd;
if ( $Config{cc} eq 'cl' ) { # Microsoft compiler
require Win32;
my @libpath = map {
q{/libpath:} . Win32::GetShortPathName($_)
} @libpaths;
@sys_cmd = (@cc, $cfile, "${lib}.lib", "/Fe$exefile",
"/link", @libpath
);
} elsif($Config{cc} eq 'CC/DECC') { # VMS
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
my @libpath = map { "-L$_" } @libpaths;
@sys_cmd = (@cc, "-o$exefile", "-l$lib", @libpath, $cfile);
} else { # Unix-ish
# gcc, Sun, AIX (gcc, cc)
my @libpath = map { "-L$_" } @libpaths;
@sys_cmd = (@cc, $cfile, "-o", "$exefile", "-l$lib", @libpath);
}
warn "# @sys_cmd\n" if $args{debug};
my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
push @missing, $lib if $rv != 0 || ! -x $exefile;
_cleanup_exe($exefile);
}
unlink $cfile;

my $miss_string = join( q{, }, map { qq{'$_'} } @missing );
die("Can't link/include $miss_string\n") if @missing;
}

sub _cleanup_exe {
my ($exefile) = @_;
my $ofile = $exefile;
$ofile =~ s/$Config{_exe}$/$Config{_o}/;
unlink $exefile if -f $exefile;
unlink $ofile if -f $ofile;
unlink "$exefile\.manifest" if -f "$exefile\.manifest";
return
}

sub _findcc {
my @paths = split(/$Config{path_sep}/, $ENV{PATH});
my @cc = split(/\s+/, $Config{cc});
return @cc if -x $cc[0];
foreach my $path (@paths) {
my $compiler = File::Spec->catfile($path, $cc[0]) . $Config{_exe};
return ($compiler, @cc[1 .. $#cc]) if -x $compiler;
}
die("Couldn't find your C compiler\n");
}

# code substantially borrowed from IPC::Run3
sub _quiet_system {
my (@cmd) = @_;

# save handles
local *STDOUT_SAVE;
local *STDERR_SAVE;
open STDOUT_SAVE, ">&STDOUT" or die "CheckLib: $! saving STDOUT";
open STDERR_SAVE, ">&STDERR" or die "CheckLib: $! saving STDERR";

# redirect to nowhere
local *DEV_NULL;
open DEV_NULL, ">" . File::Spec->devnull
or die "CheckLib: $! opening handle to null device";
open STDOUT, ">&" . fileno DEV_NULL
or die "CheckLib: $! redirecting STDOUT to null handle";
open STDERR, ">&" . fileno DEV_NULL
or die "CheckLib: $! redirecting STDERR to null handle";

# run system command
my $rv = system(@cmd);

# restore handles
open STDOUT, ">&" . fileno STDOUT_SAVE
or die "CheckLib: $! restoring STDOUT handle";
open STDERR, ">&" . fileno STDERR_SAVE
or die "CheckLib: $! restoring STDERR handle";

return $rv;
}

=head1 PLATFORMS SUPPORTED

You must have a C compiler installed. We check for C<$Config{cc}>,
both literally as it is in Config.pm and also in the $PATH.

It has been tested with varying degrees on rigourousness on:

=over

=item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin)

=item Sun's compiler tools on Solaris

=item IBM's tools on AIX

=item SGI's tools on Irix 6.5

=item Microsoft's tools on Windows

=item MinGW on Windows (with Strawberry Perl)

=item Borland's tools on Windows

=item QNX

=back

=head1 WARNINGS, BUGS and FEEDBACK

This is a very early release intended primarily for feedback from
people who have discussed it. The interface may change and it has
not been adequately tested.

Feedback is most welcome, including constructive criticism.
Bug reports should be made using L<http://rt.cpan.org/> or by email.

When submitting a bug report, please include the output from running:

perl -V
perl -MDevel::CheckLib -e0

=head1 SEE ALSO

L<Devel::CheckOS>

L<Probe::Perl>

=head1 AUTHORS

David Cantrell E<lt>david@cantrell.org.ukE<gt>

David Golden E<lt>dagolden@cpan.orgE<gt>

Thanks to the cpan-testers-discuss mailing list for prompting us to write it
in the first place;

to Chris Williams for help with Borland support.

=head1 COPYRIGHT and LICENCE

Copyright 2007 David Cantrell. Portions copyright 2007 David Golden.

This module is free-as-in-speech software, and may be used, distributed,
and modified under the same conditions as perl itself.

=head1 CONSPIRACY

This module is also free-as-in-mason software.

=cut

1;
perl-X11-Xlib-0.02/lib/000075500000000000000000000000001222446636500144165ustar00rootroot00000000000000perl-X11-Xlib-0.02/lib/X11/000075500000000000000000000000001222446636500147675ustar00rootroot00000000000000perl-X11-Xlib-0.02/lib/X11/Xlib.pm000064400000000000000000000113421222446636500162240ustar00rootroot00000000000000package X11::Xlib;

use 5.008000;

use strict;
use warnings;
use base qw(Exporter);

use XSLoader;

our $VERSION = '0.02';

XSLoader::load(__PACKAGE__, $VERSION);

our @EXPORT = qw(
XKeysymToString
XStringToKeysym
IsFunctionKey
IsKeypadKey
IsMiscFunctionKey
IsModifierKey
IsPFKey
IsPrivateKeypadKey
);

1;

__END__


=head1 NAME

X11::Xlib - Low-level access to the X11 library

=head1 SYNOPSIS

use X11::Xlib;
my $display = X11::Xlib->new();
...

=head1 DESCRIPTION

This module provides low-level access to X11 libary functions.

This includes access to some X11 extensions like the X11 test library (Xtst).

=cut

=head1 METHODS

=head2 X11::Xlib->new($display)

Instantiate a new C<X11::Xlib> object. This object contains the connection to the
X11 display.

The C<$display> variable specifies the display adress to open. If unset, the
C<$DISPLAY> environement variable is used.

=head2 DISPLAY METHODS

=head3 $display->DisplayWidth($screen)

Return the width of screen number C<$screen> (or 0 if not specified).

=head3 $display->DisplayHeight($screen)

Return the height of screen number C<$screen> (or 0 if not specified).

=head2 EVENT METHODS

=head3 $display->XTestFakeMotionEvent($screen, $x, $y, $EventSendDelay)

Fake a mouse movement on screen number C<$screen> to position C<$x>,C<$y>.

The optional C<$EventSendDelay> parameter specifies the number of milliseconds to wait
before sending the event. The default is 10 milliseconds.

=head3 $display->XTestFakeButtonEvent($button, $pressed, $EventSendDelay);

Simulate an action on mouse button number C<$button>. C<$pressed> indicates whether
the button should be pressed (true) or released (false).

The optional C<$EventSendDelay> parameter specifies the number of milliseconds ro wait
before sending the event. The default is 10 milliseconds.

=head3 $display->XTestFakeKeyEvent($kc, $pressed, $EventSendDelay)

Simulate a event on any key on the keyboard. C<$kc> is the key code (8 to 255),
and C<$pressed> indicates if the key was pressed or released.

The optional C<$EventSendDelay> parameter specifies the number of milliseconds to wait
before sending the event. The default is 10 milliseconds.

=head3 $display->XBell($percent)

Make the X server emit a sound.

=head3 $display->XQueryKeymap

Return an array of the key codes currently pressed on the keyboard.

=head3 $display->keyboard_leds

Return a mask value for the currently-lit keyboard LEDs.

=head3 $display->XFlush

Flush pending events sent via the Fake* methods to the X11 server.

This method must be used to ensure the fake events take are triggered.

=head3 $display->XSync($flush)

Force the X server to sync event. The optional C<$flush> parameter allows pending
events to be discarded.

=head3 $display->XKeysymToKeycode($keysym)

Return the key code corresponding to the character number C<$keysym>.

=head3 $display->XGetKeyboardMapping($keycode, $count)

Return an array of character numbers corresponding to the key C<$keycode>.

Each value in the array corresponds to the action of a key modifier (Shift, Alt).

C<$count> is the number of the keycode to return. The default value is 1, e.g.
it returns the character corresponding to the given $keycode.

=head3 $display->RootWindow

Return an L<X11::Xlib::Window> object corresponding to the X11 root window.

=head2 KEYCODE FUNCTIONS

=head3 XKeysymToString($keysym)

Return the human-readable string for character number C<$keysym>.

C<XKeysymToString> is the exact reverse of C<XStringToKeysym>.

=head3 XStringToKeysym($string)

Return the keysym number for the human-readable character C<$string>.

C<XStringToKeysym> is the exact reverse of C<XKeysymToString>.

=head3 IsFunctionKey($keysym)

Return true if C<$keysym> is a function key (F1 .. F35)

=head3 IsKeypadKey($keysym)

Return true if C<$keysym> is on numeric keypad.

=head3 IsMiscFunctionKey($keysym)

Return true is key if... honestly don't know :\

=head3 IsModifierKey($keysym)

Return true if C<$keysym> is a modifier key (Shift, Alt).

=head3 IsPFKey($keysym)

No idea.

=head3 IsPrivateKeypadKey($keysym)

Again, no idea.

=cut

=head1 SEE ALSO

=over 4

=item L<X11::GUITest>

This module provides the same functions but with a high level approach.

=item L<Gtk2>

Functions provided by X11/Xlib are mostly included in the L<Gtk2> binding, but
through the GTK API and perl objects.

=back

=head1 NOTES

This module is still incomplete, but patches are welcome :)

=head1 AUTHOR

Olivier Thauvin, E<lt>nanardon@nanardon.zarb.orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2009-2010 by Olivier Thauvin

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
perl-X11-Xlib-0.02/lib/X11/Xlib/000075500000000000000000000000001222446636500156655ustar00rootroot00000000000000perl-X11-Xlib-0.02/lib/X11/Xlib/Window.pm000064400000000000000000000014341222446636500174740ustar00rootroot00000000000000package X11::Xlib::Window;

use 5.010000;

use strict;
use warnings;

use X11::Xlib;

our $VERSION = '0.01';

1;

__END__

=head1 NAME

X11::Xlib::Window - Low-level access to X11 windows

=head1 SYNOPSIS

use X11::Xlib;
my $display = X11::Xlib->new();
my $window = $display->RootWindow();
...

=head1 DESCRIPTION

=cut

=head1 METHODS

=head2 $window->id

Return the X11 numeric ID of the window.

=head1 SEE ALSO

L<X11::Xlib>

=head1 AUTHOR

Olivier Thauvin, E<lt>nanardon@nanardon.zarb.orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2009-2010 by Olivier Thauvin

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
perl-X11-Xlib-0.02/t/000075500000000000000000000000001222446636500141135ustar00rootroot00000000000000perl-X11-Xlib-0.02/t/0-Pod-Coverage.t000064400000000000000000000003221222446636500167050ustar00rootroot00000000000000#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;

eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
all_pod_coverage_ok();
perl-X11-Xlib-0.02/t/0-Pod.t000064400000000000000000000003261222446636500151600ustar00rootroot00000000000000#!/usr/bin/env perl

use strict;
use warnings;

eval "use Test::Pod";

if ($@) {
print "1..0 # Skip Test::Pod not installed", $/;
exit;
}

my @PODS = qw#../blib#;

all_pod_files_ok(all_pod_files(@PODS));
perl-X11-Xlib-0.02/t/1-X11-Xlib.t000064400000000000000000000013071222446636500157040ustar00rootroot00000000000000#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 10;

BEGIN { use_ok('X11::Xlib') };

ok(my $display = X11::Xlib->new, "Can get display");
ok($display->DisplayWidth(0), "Can get display width");
ok($display->DisplayHeight(0), "Can get display height");
is(XKeysymToString(0x61), 'a', "Can get string from keysym");
is(XStringToKeysym('a'), 0x61, "Can get keysym from string");

# We can't really test here because of keyboard
# data changes
my @keysym = $display->XGetKeyboardMapping(54);
ok(@keysym, "can get the keyboard mapping");

ok(my $rootwindow = $display->RootWindow(0), "Can get root window");
isa_ok($rootwindow, 'X11::Xlib::Window');
ok($rootwindow->id, "Can get window id");
perl-X11-Xlib-0.02/typemap000064400000000000000000000006151222446636500152540ustar00rootroot00000000000000TYPEMAP
Display * O_OBJECT
Window O_OBJECT

INPUT
O_OBJECT
if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG))
$var = ($type)SvIV((SV*)SvRV( $arg ));
else {
warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
XSRETURN_UNDEF;
}

OUTPUT
O_OBJECT
sv_setref_pv( $arg, (char *)CLASS, (void*)$var );

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin