Foundation > Using Rogue Wave Views on X Window Systems > Using Cairo Features with Rogue Wave Views
 
Using Cairo Features with Rogue Wave Views
What is Cairo
Cairo is an open source library which performs 2D graphics rendering on multiple output devices. In Rogue Wave Views, Cairo draws using the XRender extension, taking advantage of display hardware acceleration when available. It comes with interesting features such as transparency, anti-aliasing and gradients. For more information about Cairo, see http://www.cairographics.org.
Setting up Rogue Wave Views to use Cairo
To use Cairo in Rogue Wave Views, you must comply with the following requirements:
*The Cairo shared library and its dependencies (Zlib, PNG, Pixman) must be accessible in your library path
*The XRender shared library must be accessible in your library path
*The ilvcairo shared library delivered with Rogue Wave Views must be accessible in your library path
*Use an X Window display with the XRender extension enabled
The required libraries can be complied by downloading tarballs for XRender, Cairo, and each of its dependencies from the Internet.
Rogue Wave Views supports the Cairo 1.10 release. Rogue Wave Views applications can use Cairo on every supported X Window platform.
Using Cairo in Rogue Wave Views
Rogue Wave Views uses dynamic library loading to enable applications to draw using Cairo, even if they are statically linked. At runtime, an application will perform the following steps:
*Dynamically load the Cairo shared library
*Dynamically load the ilvcairo shared library
*Call XRenderQueryExtension to ask the X Window display if the XRender extension is available
If one of these steps fails, the application will not be able to draw using Cairo.
Cairo Features in Rogue Wave Views
When Cairo is correctly set up, Rogue Wave Views provides its benefits through a dedicated API to the IlvPalette, IlvPort, and IlvDisplay classes. The following methods have been added to handle transparency, anti-aliasing, and gradients:
*IlvPalette::setAlpha
*IlvPalette::getAlpha
*IlvPort::setAlpha
*IlvPort::getAlpha
*IlvPalette::setAntialiasingMode
*IlvPalette::getAntialiasingMode
*IlvPort::setAntialiasingMode
*IlvPort::getAntialiasingMode
*IlvPalette::setGradientPattern
*IlvPalette::getGradientPattern
*IlvDisplay::getLinearGradientPattern
*IlvDisplay::getRadialGradientPattern
See also sections Alpha Value, Anti-Aliasing Mode, and IlvGradientPattern class.

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.