Transparency (pseudo)
Encyclopedia
Pseudo-transparency is a term used for X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

 clients that simulate the appearance of translucency or transparency by manipulating the same pixmap that has been drawn on the root window
Window (computing)
In computing, a window is a visual area containing some kind of user interface. It usually has a rectangular shape that can overlap with the area of other windows...

, or by instructing the X Server that the Background Pixmap should be inherited from the window's parent.

Purpose

Traditionally, the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

 has lagged behind other windowing systems in adding purely eye candy
Eye candy
Eye candy may refer to:*Attractiveness*Eye Candy , an album by Mis-Teeq*software "Eye Candy", a plugin for Adobe Photoshop and Adobe Fireworks that adds new filter effects*"Eye Candy", an episode of the animated series Happy Tree Friends...

 or aesthetic features, such as window translucency. This has encouraged client developer
Software developer
A software developer is a person concerned with facets of the software development process. Their work includes researching, designing, developing, and testing software. A software developer may take part in design, computer programming, or software project management...

s to develop hacks (cunning workarounds) to overcome this limitation.

This pseudo-transparency, so called as the background pixmap of the root window is visible (analogous to desktop wallpaper
Computer wallpaper
Wallpaper is an image used as a background of a graphical user interface on a computer screen or mobile communications device. On a computer it is usually for the desktop, while for a mobile phone it is usually the background for the 'home' or 'idle' screen...

) rather than any obscured windows, allows users to make windows look less imposing (such as Terminal emulator
Terminal emulator
A terminal emulator, terminal application, term, or tty for short, is a program that emulates a video terminal within some other display architecture....

s, which usually comprise large chunks of text), and to integrate the appearance of windows with their desktop themes.

Implementation

There are three common methods for achieving pseudo-transparency using Xlib
Xlib
Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol...

, each with its own advantages and drawbacks.

Parental-relative

The "parental-relative" method uses XSetWindowBackgroundPixmap to inherit the parent window's background image. Unfortunately, using this method, the X server permits very few operations to be performed on the background pixmap (such as XOR), preventing clients from implementing any sort of advanced image filtering.

_XROOTPMAP_ID and ESETROOT_PMAP_ID properties

These properties are used to inform the window where it can find the pixmap used on the root window. Using this information, a client can paint a section of the image (corresponding to the size and position of the window) onto its background, achieving the effect of transparency. This method uses the most memory
Computer storage
Computer data storage, often called storage or memory, refers to computer components and recording media that retain digital data. Data storage is one of the core functions and fundamental components of computers....

, but has the advantage of allowing clients to perform any operation, such as tinting or shading
Shading
Shading refers to depicting depth perception in 3D models or illustrations by varying levels of darkness.-Drawing:Shading is a process used in drawing for depicting levels of darkness on paper by applying media more densely or with a darker shade for darker areas, and less densely or with a lighter...

, on the image data.

XCopyArea

XCopyArea can achieve a more realistic transparency effect in that it can include obscured windows, but with the significant disadvantage that it is only usable with modal window
Modal window
In user interface design, a modal window is a child window that requires users to interact with it before they can return to operating the parent application, thus preventing the workflow on the application main window...

s. This method simply uses the XCopyArea function to take a partial screenshot
Screenshot
A screenshot , screen capture , screen dump, screengrab , or print screen is an image taken by a computer to record the visible items displayed on the monitor, television, or another visual output device...

 for use as the window's background pixmap.

Future

Recent technologies such as DirectFB
DirectFB
DirectFB stands for Direct Frame Buffer. It is a software library for GNU/Linux/Unix-based operating systems with a small memory footprint that provides graphics acceleration, input device handling and abstraction layer, and integrated windowing system with support for translucent windows and...

, Direct Rendering Infrastructure
Direct Rendering Infrastructure
In computing, the Direct Rendering Infrastructure is an interface and a free software implementation used in the X Window System to securely allow user applications to access the video hardware without requiring data to be passed through the X server. Its primary application is to provide...

, and hardware compositing
Compositing
Compositing is the combining of visual elements from separate sources into single images, often to create the illusion that all those elements are parts of the same scene. Live-action shooting for compositing is variously called "chroma key", "blue screen", "green screen" and other names. Today,...

 via OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 allow X client applications to utilize true alpha transparency.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK