World Library  
Flag as Inappropriate
Email this Article

Shape extension

Article Id: WHEBN0003578426
Reproduction Date:

Title: Shape extension  
Author: World Heritage Encyclopedia
Language: English
Subject: X Window System, JWM, Xnest, X386, Re-parenting window manager
Collection:
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Shape extension

X Nonrectangular Window Shape Extension
The round oclock window.
Original author(s) X.Org Foundation
Stable release 1.1 / 2006 (2006)

In the X Window System, the X Nonrectangular Window Shape Extension allows windows to be given arbitrary, non-rectangular shapes.

Two well-known applets that use the shape extension are oclock, which is a simple round analog clock, and xeyes, which shows two googly eyes that follow the cursor on the screen as if they were watching it. Most X Window systems have one or the other (or both) in their standard installations. In addition, some window managers use the shape extension to draw non-rectangular icons.

Implementation

Applications can only create rectangular windows, but can then change their shape to be an arbitrary part of the original rectangle. The remaining area of the rectangle is not only transparent (shows what is below the window); rather, it is not part of the window at all. For example, if a window is shaped with a hole in the middle, not only the hole shows what is below the window, but a click in the hole is considered to be a click in what is below the window.

A window having a rectangular outline but a hole in the middle.

Applications create windows as usual (specifying width and height), but can then change the shape of a window to be a subset of the original area. by sending the X display server either a list of rectangles or a pixmap of color depth one (a black-and-white pixmap). More precisely, a client can request the rectangles or the pixmap to be set as the new shape, but also to be combined in various ways (e.g., intersected or added) with the old shape. A third way for changing the shape of a window is by using the current shape of a window or a part of it.

The extension allows defining the shape of two separate regions: the clipping and the bounding regions. These two areas are defined even for windows not using the shape extension: the clipping region is the area that can be used for drawing, the bounding region is the total area covered by the window (that is, the clipping region plus the border). The shape extension allows defining two independent shapes for these two regions.

Both the clipping and bounding are associated, in the shape extension, two areas: a default rectangular region and a possibly non-rectangular client region, defined and changed by the client as specified above. The effective region, which is the actual shape of the window, is the intersection of these two areas. This intersection is performed every time either region is changed: for example, if the client regions contains parts that are outside the default region but the default region is then enlarged, the effective region will include these parts.

See also

External links

  • X Nonrectangular Window Shape Extension Library
  • X Nonrectangular Window Shape Extension Protocol
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.