The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

X11::Protocol::Ext::RANDR -- Perl extension module for the X Resize, Rotate and Reflect Extension

SYNOPSIS

 use X11::Protocol;
 $x = X11::Protocol->new($ENV{'DISPLAY'});
 $x->init_extension('RANDR') or die;

DESCRIPTION

This moudle is used by the X11::Protocol(3pm) module to participate in the resize, rotate and reflect extension to the X protocol, allowing a client to participate or control these screen changes per "The X Resize, Rotate and Reflect Extension", a copy of which can be obtained from http://www.x.org/releases/X11R7.7/doc/randrproto/randrproto.txt.

This manual page does not attempt to document the protocol itself, see the specification for that. It documents the "CONSTANTS", "REQUESTS", "EVENTS" and "ERRORS" that are added to the X11::Protocol(3pm) module.

CONSTANTS

X11::Protocol::Ext::RANDR provides the following symbolic constants:

 Rotation =>
     [ qw(Rotate_0 Rotate_90 Rotate_180 Rotate_270
          Reflect_X Refect_Y) ]

 RRSelectMask =>
     [ qw(ScreenChangeNotifyMask CrtcChangeNotifyMask
          OutputChangeNotifyMask OutputPropertyNotifyMask) ]

 RRConfigStatus =>
     [ qw(Success InvalidConfigTime InvalidTime Failed) ]

 ModeFlag =>
     [ qw(HSyncPositive HSyncNegative VSyncPositive VSyncNegative
          Interlace DoubleScan CSync CSyncPositive CSyncNegative
          HSkewPercent BCast PixelMultiplex
          DoubleClock ClockDividedBy2) ]

 Connection =>
    [ qw(Connected Disconnected UnknownConnection) ]

 SubpixelOrder =>
    [ qw(Unknown HoizontalRGB HorizontalBGR VerticalRGB VerticalBGR
            None) ]

ERRORS

X11::Protocol::Ext::RANDR provides the folowing bad resource errors: Output, Crtc, Mode.

REQUESTS

X11::Protocol::Ext::RANDR provides the following requests:

 $X->RRQueryVersion($major, $minor)
 =>
 ($major, $minor)
 $X->RRSetScreenConfig($window, $time, $config_time, size_index,
         rotation_reflection, refresh_rate)
 =>
 ($status, $time, $config_time, $root, $subpixel_order)
 $X->RRSelectInput($window, $enable)

     $enable => $RRSelectMask  # mask
 $X->RRGetScreenInfo($window)
 =>
 ($rotations, $root, $time, $config_time, $size_index,
  $rotation_and_reflection, $rate, $screensizes, $rateinfos)

     $screensizes => [ $screensize, ... ]
     $screensize  => [ $width, $height, $width_mm, $height_mm ]

     $rateinfos   => [ $rateinfos, ... ]
     $rateinfo    => [ $rate, ... ]
 $X->RRGetScreenSizeRange($window)
 =>
 ($minWidth, $minHeight, $maxWidth, $maxHeight)
 $X->RRSetScreenSize($window, $width, $height, $width_mm, $height_mm)
 $X->RRGetScreenResources($window)
 =>
 ($time, $config_time, $crtcs, $outputs, $modeinfos)

     $crtcs      => [ $crtc,     ... ]
     $outputs    => [ $output,   ... ]
     $modeinfos  => [ $modeinfo, ... ]

     $modeinfo   => [ $id, $width, $heigth, $dot_clock, $h_sync_start,
                     $h_sync_end, $h_total, $h_skew, $v_sync_start,
                     $v_sync_end, $v_total, $mode_flags, $name ]

     $mode_flags => $ModeFlag   # mask
 $X->RRGetOutputInfo($output, $config_time)
 =>
 ($status, $time, $crtc, $width_mm, $height_mm, $connection,
      $subpixel_order, $preferred_modes, $crtcs, $modes, $clones, $name)
 $X->RRListOutputProperties($output)
 =>
 ($atom, ...)
 $X->RRQueryOutputProperty($output,$atom)
 =>
 ($pending, $range, $immutable, @values)
 $X->RRConfigureOutputProperty($output,$atom,$pending,$range,@values)
 $X->RRChangeOutputProperty($output,$property,$type,$format,$mode,@values)
 $X->RRDeleteOutputProperty($output, $atom)
 $X->RRGetOutputProperty($output, $property, $type, $offset, $length,
         $delete, $pending)
 =>
 ($format, $type, $bytes_after, @values
 $X->RRCreateMode($window, $id, $width, $height, $dot_clock,
         $h_sync_start, $h_sync_end, $h_total, $h_skew, $v_sync_start,
         $v_sync_end, $v_total, $flags, $name)
 =>
 ($mode)
 $X->RRDestroyMode($mode)
 $X->RRAddOutputMode($output, $mode)
 $X->RRDeleteOutputMode($output, $mode)
 $X->RRGetCrtcInfo($ctrc,$config_time)
 =>
 ($status, $timestamp, $x, $y, $width, $height, $mode, $current_randr,
  $possible_rotations, $outputs, $possible_outputs)

     $outputs           => [ $output, ... ]
     $possible_outputs  => [ $output, ... ]
 $X->RRSetCrtcConfig($ctrc, $time, $config_time, $x, $y, $mode, $randr,
         @outputs)
 =>
 ($status, $new_time)
 $X->RRGetCrtcGammaSize($crtc)
 =>
 ($size)
 $X->RRGetCrtcGamma($crtc)
 =>
 ($crtc, $reds, $greens, $blues)
 $X->RRSetCrtcGamma($crtc,@reds,@greens,@blues)
 $X->RRGetScreenResourcesCurrent($window)
 =>
 ($time, $config_time, $crtcs, $outputs, $modeinfos)
     
     $crtcs      => [ $crtc,     ... ]
     $outputs    => [ $output,   ... ]
     $modeinfos  => [ $modeinfo, ... ]

     $modeinfo   => [ $id, $width, $height, $dot_clock, $h_sync_start,
                      $h_sync_end, $h_total, $h_skew, $v_sync_start,
                      $v_sync_end, $v_total, $mod_flags, $name ]
     $mode_flags => $ModeFlag  # mask
 $X->RRSetCrtcTransform($ctrc,$transform,$filter,@params)
 $X->RRGetCrtcTransform($crtc)
 =>
 ($pending, $has_transforms, $current, $pending_filter, $current_filter)

     $pending_filter => [ $filter, @params ]
     $current_filter => [ $filter, @params ]
 $X->RRGetPanning($crtc)
 =>
 ($status, $time, $left, $top, $width, $height, $track_left, $track_top,
  $track_width, $track_height, $border_left, $border_top, $border_right,
  $border_bottom)
 $X->RRSetPanning($crtc, $time, $left, $top, $width, $height,
         $track_left, $track_top, $track_width, $track_height,
         $border_left, $border_top, $border_right, $border_bottom)
 =>
 ($status, $new_time)
 $X->RRSetOutputPrimary($window, $output)
 $X->RRGetOutputPrimary($window)
 =>
 ($length, $output, @pads)

EVENTS

X11::Protocol::Ext::RANDR provides the following events:

The following events were added in Version 1.0 of the specification. This event uses a single event number.

 RRScreenChangeNotify => {
     name=>'RRScreenChangeNotify',
     new_rotation_and_reflection=>$rotation, # Rotation
     timestamp=>$timestamp,
     configuration_timestamp=>$timestamp,
     root_window=>$window,
     request_window=>$window,
     size_id=>$sizeid, # SizeID
     subpixel_order_defined_in_render=>$subpixelorder,
     width_in_pixels=>$width,
     height_in_pixels=>$height,
     width_in_millimeters=>$width_mm,
     height_in_millimeters=>$height_mm}

The following events were added in Version 1.2 of the specification. Unfortunately they chose to multiplex the events under only one additional event number. Therefore, the format of these events depend on the value of the sub_code field which is of type RR1dot2EventType.

 RRCrtcChangeNotify => {
     name=>'RR1dot2EventNotify',
     sub_code=>$RR1dot2EventType, # 0 or 'RRCrtcChangeNotify'
     timestamp=>$timestamp,
     request_window=>$window,
     crtc_affected=>$crtc,
     mode_in_use=>$mode,  # Mode
     new_rotation_and_reflection=>$rotation, # Rotation
     x=>$x,
     y=>$y,
     width=>$width,
     height=>$height}
 RROutputChangeNotify => {
     name=>'RR1dot2EventNotify',
     sub_code=>$RR1dot2EventType, # 1 or 'RROutputChangeNotify
     timestamp=>$time,
     configuration_timestamp=>$config_time,
     request_window=>$window,
     output_affected=>$output,
     crtc_in_use=>$crtc,
     mode_in_use=>$mode,
     rotation_in_use=>$rotation, # Rotation
     connection_status=>$status, # Connection
     subpixel_order=>$subpixel_order}
 RROutputPropertyNotify => {
     name=>'RR1dot2EventNotify',
     sub_code=>$RR1dot2EventType, # 2 or 'RROutputPropertyNotify
     window=>$window,
     output=>$output,
     atom=>$atom,
     timestamp=>$time}

BUGS

Probably lots: this module has not been thoroughly tested. At least it loads and initializes on server supporting the correct version.

AUTHOR

Brian Bidulock <bidulock@openss7.org>

SEE ALSO

perl(1), X11::Protocol(3pm), X Synchronization Extension Protocol.