|
NAMEX11::Protocol::Ext::DAMAGE - drawing notificationsSYNOPSISuse X11::Protocol; my $X = X11::Protocol->new; $X->init_extension('DAMAGE') or print "DAMAGE extension not available"; my $damage = $X->new_rsrc; $X->DamageCreate ($damage, $drawable, 'NonEmpty'); sub my_event_handler { my %h = @_; if ($h{'name'} eq 'DamageNotify') { my $drawable = $h{'drawable'}; $X->DamageSubtract ($damage, 'None', $parts_region); # do something for $parts_region changed in $drawable } } DESCRIPTIONThe DAMAGE extension lets a client listen for changes to drawables (windows, pixmaps, etc) due to drawing operations, including drawing into sub-windows which appears in the parent.This can be used for various kinds of efficient copying or replicating of window contents, such as cloning to another screen, showing a magnified view, etc. The root window can be monitored to get changes on the whole screen. Content changes due to drawing are conceived as "damage". A server-side damage object accumulates areas as rectangles to make a server-side "region" per the XFIXES 2.0 extension (see X11::Protocol::Ext::XFIXES) A DamageNotify event is sent from a damage object. A reporting level controls the level of detail, ranging from just one event on becoming non-empty, up to an event for every drawing operation affecting the relevant drawable. Fetching an accumulated damage region (or part of it) is reckoned as a "repair". It doesn't change any drawables in any way, just fetches the region from the damage object. This fetch is atomic, so nothing is lost if the listening client is a bit lagged etc. See examples/damage-duplicate.pl for one way to use damage to duplicate a window in real-time. REQUESTSThe following requests are made available with an "init_extension()", as per "EXTENSIONS" in X11::Protocol.my $is_available = $X->init_extension('DAMAGE'); DAMAGE 1.0
DAMAGE 1.1
EVENTS"DamageNotify" events are sent to the client which created the damage object. These events are always generated, there's nothing to select or deselect them. The event has the usual fieldsname "DamageNotify" synthetic true if from a SendEvent code integer opcode sequence_number integer and event-specific fields damage XID, damage object drawable XID, as from DamageCreate level enum, as from DamageCreate more boolean, if more DamageNotify on the way time integer, server timestamp area arrayref [$x,$y,$width,$height] geometry arrayref [$rootx,$rooty,$width,$height] "drawable" and "level" are as from the "DamageCreate()" which made the "damage" object. "more" is true if there's further "DamageNotify" events on the way for this damage object. This can happen when the "level" means there's a set of "area" rectangles to report. "area" is a rectangle within "drawable", as a 4-element arrayref, [ $x, $y, $width, $height ] What it covers depends on the reporting level requested,
"geometry" is the current size and position of the drawable as a 4-element arrayref in root window coordinates. For a pixmap $root_x and $root_y are 0. [ $root_x, $root_y, $width, $height ] ENUM TYPESThe reporting level above is type "DamageReportLevel". So for example (after a successful "$X->init_extension('DAMAGE')"),$number = $X->num('DamageReportLevel', 'RawRectangles'); $string = $X->interp('DamageReportLevel', 3); See "SYMBOLIC CONSTANTS" in X11::Protocol. ERRORSError type "Damage" is a bad $damage resource XID in a request.BUGSThe server extension version number is queried in the "init_extension()", but not yet made available as such. The version determines whether "DamageAdd()" ought to work. Currently that request is always setup, but presumably generates an Opcode error if the server doesn't have it.SEE ALSOX11::Protocol, X11::Protocol::Ext::XFIXES/usr/share/doc/x11proto-damage-dev/damageproto.txt.gz, <http://cgit.freedesktop.org/xorg/proto/damageproto/tree/damageproto.txt> HOME PAGE<http://user42.tuxfamily.org/x11-protocol-other/index.html>LICENSECopyright 2011, 2012, 2013, 2014, 2017 Kevin RydeX11-Protocol-Other is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. X11-Protocol-Other is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>.
Visit the GSP FreeBSD Man Page Interface. |