X11::FullScreen - Perl extension for creating a simple borderless window with X


X11-FullScreen documentation Contained in the X11-FullScreen distribution.

Index


Code Index:

NAME

Top

X11::FullScreen - Perl extension for creating a simple borderless window with X

SYNOPSIS

Top

  use X11::FullScreen;

  # Open a handle to the X display 0.0
  my $display = X11::Fullscreen::Display->new(":0.0");

  # Create a full-screen window
  my $window = $display->createWindow();

  # Sync the X display
  $display->sync();

  # Display a still image
  $display->displayStill($window, "/path/to/my.png");

  # Return any new expose events
  my @events = $display->checkWindowEvent($window);




DESCRIPTION

Top

Companion to Video::Xine, this module is used for creating simple borderless X windows. In addition, it uses Imlib2 to display still images.

It was primarily developed to provide a no-frills interface to X for use with Video::Xine, as part of the Video::PlaybackMachine project.

METHODS

Top

The primary class for this package is X11::FullScreen::Display.

new( $display_string )

Creates a new Display object. $display_string should be a valid display specifier, such as ':0.0'. Example:

  my $display = X11::FullScreen::Display->new('localhost:0.1');

getDefaultScreenNumber()

Returns the number of the display's default screen.

getWidth( $screen_number )

Returns the width in pixels of the screen numbered $screen_number of the current display, or of the default screen if not specified.

getHeight( $screen_number )

Returns the height in pixels of the screen numbered $screen_number of the current display, or of the default screen if not specified.

getPixelAspect( $screen_number )

Returns the pixel aspect of the screen numbered $screen_number of the current display, or of the default screen if not specified. The pixel aspect is calculated by dividing the screen's vertical resolution by its horizontal resolution.

createWindow( $width, $height )

Creates a new X11 window on the display and returns its ID. If $width and $height are not specified, takes up the entire screen.

displayStill( $window, $image_file, [ $width, $height ] )

Displays a still image on the given display on the given window.

checkWindowEvent( $window, $event_mask )

Checks for any new event which has occurred to $window. If $event_mask is not specified, defaults to ( ExposureMask | VisibilityChangeMask). This package does not yet have constants for the various event masks available; if you wish to use different masks you are on your own.

BUGS

Top

Undoubtably. This code is still in alpha state.

The checkWindowEvent() method is currently only useful for checking for expose events, since the method does not provide useful constants for passing event masks to it.

SEE ALSO

Top

Video::Xine, Video::PlaybackMachine, Xlib

AUTHOR

Top

Stephen Nelson, <stephen@cpan.org<gt>

COPYRIGHT AND LICENSE

Top


X11-FullScreen documentation Contained in the X11-FullScreen distribution.

package X11::FullScreen;

use 5.008005;
use strict;
use warnings;

our $VERSION = '0.03';

require XSLoader;
XSLoader::load('X11::FullScreen', $VERSION);

package X11::FullScreen::Display;

sub createWindow {
  my $self = shift;
  my ($width, $height) = @_;

  defined $width
    or $width = $self->getWidth();

  defined $height
    or $height = $self->getHeight();

  return doCreateWindow($self,$width,$height);
}

sub displayStill {
  my $self = shift;
  my ($window, $mrl, $width, $height) = @_;
  defined $width
    or $width = $self->getWidth();
  defined $height
    or $height = $self->getHeight();
  doDisplayStill($self,$window,$mrl,$width,$height);
}


1;
__END__