Prima::X11 is a usage guide for X11 environment.
This document describes subtle topics one must be aware when programming or using Prima programs under X11.
The document covers various aspects of the toolkit and their implementation details with guidelines of the expected use. Also, standard X11 user-level and programming techniques are visited.
Basic command-line switches
--help
Prints the command-line arguments available and exits.
--display
Sets X display address in Xlib notation. If not set, standard Xlib ( XOpenDisplay(null) ) behavior applies.
Example:
--display=:0.1
--visual
Sets X visual, to be used by default. Example:
--visual=0x23
--sync
Turn off X synchronization
--bg, --fg
Set default background and foreground colors. Example:
--bg=BlanchedAlmond
--font
Sets default font. Example:
--font='adobe-helvetica-medium-r-*-*--*-120-*-*-*-*-*-*'
--no-x11
Runs Prima without X11 display initialized. This switch can be used for programs that use only OS-independent parts of Prima, such as image subsystem or PostScript generator, in environments where X is not present, for example, a CGI script. Obviously, any attempt to create instance of Prima::Application or otherwise access X-depended code under such conditions causes the program to abort.
There are alternatives to use the command switch. First, there is module Prima::noX11 for the same purpose but more convenient to use as
perl -MPrima::noX11
construct. Second, there is a technique to continue execution even if connection to a X server failed:
use Prima::noX11;
use Prima;
my $error = Prima::XOpenDisplay();
if ( defined $error) {
print "not connected to display: $errorn";
} else {
print "connected to displayn";
}
The Prima::noX11 module exports a single function XOpenDisplay into Prima namespace, to connect to the X display explicitly. The display to be connected to is $ENV{DISPLAY}, unless started otherwise on command line ( with --display option) or with parameter to the XOpenDisplay function.
This technique may be useful to programs that use Prima imaging functionality and may or may not use windowing capabilites.
Product's homepage
Requirements:
· Perl