1#!/usr/bin/perl -w 2 3# Copyright 2011 Kevin Ryde 4 5# This file is part of X11-Protocol-Other. 6# 7# X11-Protocol-Other is free software; you can redistribute it and/or 8# modify it under the terms of the GNU General Public License as published 9# by the Free Software Foundation; either version 3, or (at your option) any 10# later version. 11# 12# X11-Protocol-Other is distributed in the hope that it will be useful, 13# but WITHOUT ANY WARRANTY; without even the implied warranty of 14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 15# Public License for more details. 16# 17# You should have received a copy of the GNU General Public License along 18# with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>. 19 20use strict; 21use X11::Protocol; 22 23use lib 'devel', '.'; 24 25# uncomment this to run the ### lines 26use Smart::Comments; 27 28$ENV{DISPLAY} = ":102"; 29{ 30 my $X = X11::Protocol->new ($ENV{DISPLAY} || ':0'); 31 ### root: $X->{'root'} 32 33 { my @query = $X->QueryExtension('XINERAMA'); 34 ### @query 35 } 36 $X->QueryPointer($X->{'root'}); # sync 37 38 $X->init_extension('XINERAMA') or die $@; 39 $X->QueryPointer($X->{'root'}); # sync 40 41 { my @version = $X->PanoramiXQueryVersion (99,99); 42 ### PanoramiXQueryVersion: @version 43 } 44 $X->QueryPointer($X->{'root'}); # sync 45 46 my @state = $X->PanoramiXGetState ($X->{'root'}); 47 ### PanoramiXGetState: @state 48 $X->QueryPointer($X->{'root'}); # sync 49 50 my @count = $X->PanoramiXGetScreenCount ($X->{'root'}); 51 ### PanoramiXGetScreenCount: @count 52 $X->QueryPointer($X->{'root'}); # sync 53 my ($count) = @count; 54 55 { 56 my @size = $X->PanoramiXGetScreenSize ($X->{'root'}, 999999); 57 ### PanoramiXGetScreenSize: @size 58 } 59 foreach my $monitor (0 .. $count+5) { 60 ### $monitor 61 my @size = $X->PanoramiXGetScreenSize ($X->{'root'}, $monitor); 62 ### PanoramiXGetScreenSize: @size 63 $X->QueryPointer($X->{'root'}); # sync 64 } 65 66 67 my @active = $X->XineramaIsActive (); 68 ### XineramaIsActive: @active 69 $X->QueryPointer($X->{'root'}); # sync 70 71 my @query = $X->XineramaQueryScreens ($X->{'root'}); 72 ### XineramaQueryScreens: @query 73 $X->QueryPointer($X->{'root'}); # sync 74 75 exit 0; 76} 77