diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-07-27 12:21:08 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-02 15:09:32 +1000 |
commit | 6d6b0333810a8b8b5f39808bc76e0eaff933a460 (patch) | |
tree | 1cb4c84443b4afd92c5f83e5a6819613c94f60ac /XOrg | |
parent | 0d3953a8f7555a58f64130b2911437835856ce32 (diff) |
XOrg: POD the XServer module
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'XOrg')
-rw-r--r-- | XOrg/XServer.pm | 81 |
1 files changed, 79 insertions, 2 deletions
diff --git a/XOrg/XServer.pm b/XOrg/XServer.pm index 5de6e41..d07526d 100644 --- a/XOrg/XServer.pm +++ b/XOrg/XServer.pm @@ -19,7 +19,23 @@ # Authors: Peter Hutterer <peter.hutterer@redhat.com> -# XServer representation, after using the Xorg.log parser +=head1 NAME + +XOrg::XServer - XServer representation + +=head1 SYNOPSIS + + use XOrg::xorglog; + + my $xlog = xorglog->new(file => "/var/log/Xorg.0.log"); + my $xserver = $xlog->server; + +=head1 DESCRIPTION + +This module is not supposed to be created directly, it is a product of +the Xorg.log parser. Use it to query information. + +=cut package XOrg::XServer; @@ -41,6 +57,10 @@ sub new { return $self; } +=head2 B<$xserver-E<gt>logfile([$logfile])> + +Returns the logfile this server writes/wrote to. +=cut sub logfile { my $self = shift; my $logfile = shift; @@ -49,6 +69,11 @@ sub logfile { return $self->{logfile}; } +=head2 B<$xserver-E<gt>version([$major, [$minor], [$patchlevel])> + +Returns a triple of the major, minor and patchlevel version. + +=cut sub version { my $self = shift; my $major = shift; @@ -66,6 +91,11 @@ sub version { return @{$self->{version}}; } +=head2 B<$xserver-E<gt>build_id([$build_id])> + +Returns the string that is the build ID. + +=cut sub build_id { my $self = shift; my $build_id = shift; @@ -74,6 +104,30 @@ sub build_id { return $self->{build_id}; } +=head2 B<$xserver-E<gt>config_backend([$config_backend])> + +Returns the string that represents the config backend. Currently known +backends: + +=over + +=item B<hal> +Device was added by the HAL backend (now deprecated on Linux). + +=item B<udev> +Device was added by the udev backend (default for hotplugged devices on +Linux). + +=item B<xorg.conf> +Device was listed in the xorg.conf. + +=item B<internal> +Device was added internally without external instructions (e.g. Wacom +driver-internal hotplugging). + +=back + +=cut sub config_backend { my $self = shift; my $config_backend = shift; @@ -82,12 +136,20 @@ sub config_backend { return $self->{config_backend}; } +=head2 B<$xserver-E<gt>modules()> + +Returns a {module name => XOrg::Module} reference of the modules loaded. +=cut + sub modules { my $self = shift; return $self->{modules}; } -# Returns 1/0 if AutoAddDevices is on/off. +=head2 B<$xserver-E<gt>auto_add_devices([$enabled])> + +returns 1/0 if AutoAddDevices is on/off. +=cut sub auto_add_devices { my $self = shift; my $auto_add_devices = shift; @@ -96,11 +158,26 @@ sub auto_add_devices { return $self->{auto_add_devices}; } +=head2 B<$xserver-E<gt>devices([\@devices])> + +Returns a [XOrg::InputDevice] list with all devices found in the log file. + +This includes those devices that did not get added (e.g. because no driver +was selected). On Linux, most mouse devices will appear twice in this list, +once because of /dev/input/eventX, once because of /dev/input/mouseX. + +=cut sub devices { my $self = shift; return $self->{devices}; } + +=head2 B<$xserver-E<gt>add_device([$device])> + +Add one XOrg::InputDevice to the list of devices. + +=cut sub add_device { my $self = shift; my $device = shift; |