.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "X11::Protocol::Ext::TOG_CUP 3pm" .TH X11::Protocol::Ext::TOG_CUP 3pm "2016-12-25" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" X11::Protocol::Ext::TOG_CUP \- colormap utilization policy extension .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use X11::Protocol; \& my $X = X11::Protocol\->new; \& $X\->init_extension(\*(AqTOG\-CUP\*(Aq) \& or print "TOG\-CUP extension not available"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The TOG-CUP extension helps applications with private colormaps use the same pixel for the same color in different colormaps. .PP Using common pixel values, were possible, means that when a private colormap is in use (\f(CW\*(C`$x\->InstallColormap()\*(C'\fR, usually done by the window manager) some of the colours in other windows will still appear correctly. .PP Note that this extension makes a subtle change to the core \&\f(CW\*(C`$X\->AllocColor()\*(C'\fR and \f(CW\*(C`$X\->AllocNamedColor()\*(C'\fR requests. Normally they allocate the first available pixel, but with TOG-CUP if there's a matching colour in the default colormap and that same pixel in the target colormap is free then that pixel is allocated, thus making that colour the same in the two colormaps. .SH "REQUESTS" .IX Header "REQUESTS" The following are made available with an \f(CW\*(C`init_extension()\*(C'\fR per \&\*(L"\s-1EXTENSIONS\*(R"\s0 in X11::Protocol. .PP .Vb 1 \& my $bool = $X\->init_extension(\*(AqTOG\-CUP\*(Aq); .Ve .ie n .IP """($server_major, $server_minor) = $X\->CupQueryVersion ($client_major, $client_minor)""" 4 .el .IP "\f(CW($server_major, $server_minor) = $X\->CupQueryVersion ($client_major, $client_minor)\fR" 4 .IX Item "($server_major, $server_minor) = $X->CupQueryVersion ($client_major, $client_minor)" Negotiate a protocol version with the server. \f(CW$client_major\fR and \&\f(CW$client_minor\fR is what the client would like, the returned \&\f(CW$server_major\fR and \f(CW$server_minor\fR is what the server will do, which might be different. .Sp The current code supports up to 1.0. The intention would be to automatically negotiate in \f(CW\*(C`init_extension()\*(C'\fR if necessary, which it's currently not. .ie n .IP """@colors = $X\->CupGetReservedColormapEntries ($screen)""" 4 .el .IP "\f(CW@colors = $X\->CupGetReservedColormapEntries ($screen)\fR" 4 .IX Item "@colors = $X->CupGetReservedColormapEntries ($screen)" Return a list of reserved colormap entries in the default colormap of screen number \f(CW$screen\fR (an integer 0 upwards). Each returned element is an arrayref .Sp .Vb 1 \& [ $pixel, $red16, $blue16, $green16, $alloc_flags ] .Ve .Sp \&\f(CW$red16\fR, \f(CW$blue16\fR and \f(CW$green16\fR are \s-1RGB\s0 colour components in the range 0 to 65535. \f(CW$alloc_flags\fR is currently unused. .Sp Reserved colours are pre-allocated and unchanging. The core protocol specifies \f(CW\*(C`$X\->{\*(Aqblack_pixel\*(Aq}\*(C'\fR and \f(CW\*(C`$X\->{\*(Aqwhite_pixel\*(Aq}\*(C'\fR and they're included in the result, plus any further colours which might be reserved. .Sp For example under the MS-DOS graphical overlay manager there's a certain set of \*(L"desktop\*(R" colours which a server on that system might treat as reserved. .ie n .IP """@colors = $X\->CupStoreColors ($colormap, [$pixel,$red16,$green16,$blue16],...)""" 4 .el .IP "\f(CW@colors = $X\->CupStoreColors ($colormap, [$pixel,$red16,$green16,$blue16],...)\fR" 4 .IX Item "@colors = $X->CupStoreColors ($colormap, [$pixel,$red16,$green16,$blue16],...)" Allocate read-only colours in \f(CW$colormap\fR at particular pixels. .Sp Each argument is an arrayref of desired pixel and \s-1RGB\s0 colour. (A \f(CW$do_mask\fR parameter can be present at the end too but is unused and can be omitted.) .Sp .Vb 1 \& [ $pixel, $red16, $blue16, $green16 ] .Ve .Sp The desired colour is allocated shareable read-only (like \&\f(CW\*(C`$X\->AllocColor()\*(C'\fR) at the given \f(CW$pixel\fR if possible, or another if necessary. The return is a similar list of arrayref elements, one for each argument .Sp .Vb 1 \& [ $pixel, $red16, $blue16, $green16, $alloc_flags ] .Ve .Sp The returned \f(CW$pixel\fR might differ from what was requested. If the requested \f(CW$pixel\fR is already allocated, and it has a different colour, then another pixel value is chosen. .Sp The returned \s-1RGB\s0 components are the actual colour shade allocated. This might differ if the visual has limited colour resolution (which is likely). .Sp The returned \f(CW$alloc_flags\fR has bit 0x08 set if the pixel was successfully allocated, or clear if not. Other bits in \f(CW$alloc_flags\fR are currently unused. .Sp For example .Sp .Vb 5 \& my @ret = $X\->CupStoreColors \& ($colormap, \& [ 2, 65535,0,0], # red \& [ 3, 0,65535,0], # green \& [ 4, 16383,16383,16383]); # grey \& \& foreach my $elem (@ret) { \& my ($pixel, $red,$green,$blue, $alloc_ok) = @$elem; \& my $ok = ($alloc_ok & 8 ? "allocated" : "oops, not allocated"); \& print "at $pixel actual $red,$green,$blue $ok\en"; \& } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" X11::Protocol .PP Colormap Utilization Policy and Extension, Version 1.0 http://www.xfree86.org/current/tog\-cup.html .PP \&\fI/usr/share/doc/x11proto\-xext\-dev/tog\-cup.txt.gz\fR, \&\fI/usr/share/X11/doc/hardcopy/Xext/tog\-cup.PS.gz\fR .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2011, 2012, 2013 Kevin Ryde .PP X11\-Protocol\-Other is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP X11\-Protocol\-Other is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with X11\-Protocol\-Other. If not, see .