Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Classes | Public Member Functions | Friends
IlvPalette Class Reference

Resource class. More...

#include <ilviews/base/resource.h>

Inheritance diagram for IlvPalette:
IlvResource

Classes

class  Builder
 IlvPalette builder. More...
 
class  Changer
 IlvPalette changer. More...
 

Public Member Functions

 IlvPalette (IlvDisplay *display)
 Initializes a new IlvPalette that is not shared. More...
 
 IlvPalette (IlvDisplay *display, IlvColor *background, IlvColor *foreground, IlvFont *font, IlvPattern *pattern)
 Initializes a new IlvPalette that is not shared, with the specified parameters. More...
 
 IlvPalette (IlvPalette const &palette)
 Initializes a new IlvPalette that is not shared as a copy of another palette. More...
 
 IlvPalette (IlvPalette const *palette)
 Initializes a new IlvPalette that is not shared, as a copy of another palette. More...
 
IlvIntensity getAlpha () const
 Gets the alpha value. More...
 
IlvAntialiasingMode getAntialiasingMode () const
 Gets the anti-aliasing mode. More...
 
IlvArcMode getArcMode () const
 Gets the arc mode. More...
 
IlvColorgetBackground () const
 Gets the background color. More...
 
IlvColorPatterngetColorPattern () const
 Gets the color pattern. More...
 
IlvFillRule getFillRule () const
 Gets the fill rule. More...
 
IlvFillStyle getFillStyle () const
 Gets the fill style. More...
 
IlvFontgetFont () const
 Gets the font. More...
 
IlvColorgetForeground () const
 Gets the foreground color. More...
 
IlvGradientPatterngetGradientPattern () const
 Gets the gradient pattern. More...
 
IlvLineStylegetLineStyle () const
 Gets the line style. More...
 
IlUShort getLineWidth () const
 Gets the line width. More...
 
IlvDrawMode getMode () const
 Gets the drawing mode. More...
 
IlBoolean getOverwrite () const
 Gets the overwrite flag. More...
 
IlvPatterngetPattern () const
 Gets the pattern. More...
 
void invert ()
 Swaps the foreground and background of the palette. More...
 
void setAlpha (IlvIntensity alpha)
 Sets the alpha value. More...
 
void setAntialiasingMode (IlvAntialiasingMode antialias)
 Sets the anti-aliasing mode. More...
 
void setArcMode (IlvArcMode arcMode)
 Sets the arc mode. More...
 
void setBackground (IlvColor *color)
 Sets the background color. More...
 
void setClip (const IlvRect *rect=0) const
 Set or reset clipping rectangle. More...
 
void setClip (const IlvRegion *clip) const
 Set clipping region. More...
 
void setColorPattern (IlvColorPattern *pattern)
 Sets the color pattern. More...
 
void setFillRule (IlvFillRule fillRule)
 Sets the fill rule. More...
 
void setFillStyle (IlvFillStyle fillStyle)
 Sets the fill style. More...
 
void setFont (IlvFont *font)
 Sets the font. More...
 
void setForeground (IlvColor *color)
 Sets the foreground color. More...
 
void setGradientPattern (IlvGradientPattern *pattern)
 Sets the gradient pattern. More...
 
void setLineStyle (IlvLineStyle *style)
 Sets the line style. More...
 
void setLineStyle (IlvLineStyle *style, IlUShort width)
 Sets the line style and width. More...
 
void setLineWidth (IlUShort width)
 Sets the line width. More...
 
void setMode (IlvDrawMode drawMode) const
 Sets the drawing mode. More...
 
void setOverwrite (IlBoolean over) const
 Sets the overwrite flag. More...
 
void setPattern (IlvPattern *pattern)
 Sets the pattern. More...
 
virtual void unLock ()
 Unlocks the resource. More...
 
- Public Member Functions inherited from IlvResource
IlvDisplaygetDisplay () const
 Gets the IlvDisplay instance. More...
 
const char * getName () const
 Gets the resource name. More...
 
void lock ()
 Locks the resource. More...
 
virtual void setName (const char *name)
 Sets the name of the resource. More...
 

Friends

class IlvDisplay
 

Detailed Description

Resource class.

Library: xviews or winviews or mviews (mutually exclusive)

IlvPalette groups together the graphic resources used in drawing primitives:

There are two ways of creating a palette:

See also
IlvDisplay::getPalette(), IlvColor, IlvLineStyle, IlvPattern.

Constructor & Destructor Documentation

◆ IlvPalette() [1/4]

IlvPalette::IlvPalette ( IlvDisplay display)

Initializes a new IlvPalette that is not shared.

The new palette is initialized with all the default values provided by the display.

Parameters
displayThe display instance.

◆ IlvPalette() [2/4]

IlvPalette::IlvPalette ( IlvDisplay display,
IlvColor background,
IlvColor foreground,
IlvFont font,
IlvPattern pattern 
)

Initializes a new IlvPalette that is not shared, with the specified parameters.

Parameters
displayThe display instance.
backgroundThe background color of this palette.
foregroundThe foreground color of this palette.
fontThe font of this palette.
patternThe fill pattern color of this palette.

◆ IlvPalette() [3/4]

IlvPalette::IlvPalette ( IlvPalette const *  palette)

Initializes a new IlvPalette that is not shared, as a copy of another palette.

Constructor.

Parameters
paletteA pointer to the palette that is copied.

◆ IlvPalette() [4/4]

IlvPalette::IlvPalette ( IlvPalette const &  palette)

Initializes a new IlvPalette that is not shared as a copy of another palette.

Parameters
paletteThe palette that is copied.

Member Function Documentation

◆ getAlpha()

IlvIntensity IlvPalette::getAlpha ( ) const

Gets the alpha value.

The alpha value is the amount of opacity that will be used when drawing with this palette. A value of IlvFullIntensity means that the drawing will be opaque. A value of 0 means that the drawing will be completely transparent. When drawing into an IlvPort object, the alpha value of the palette will be composed with the alpha value of the port.

Returns
The alpha value of the palette.

◆ getAntialiasingMode()

IlvAntialiasingMode IlvPalette::getAntialiasingMode ( ) const

Gets the anti-aliasing mode.

Returns
The anti-aliasing mode of the palette.

◆ getArcMode()

IlvArcMode IlvPalette::getArcMode ( ) const

Gets the arc mode.

Returns
The arc mode attribute of the palette.

◆ getBackground()

IlvColor* IlvPalette::getBackground ( ) const

Gets the background color.

Retrieves the background color of the palette. This resource should never be deleted. If you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The background color of the palette.

◆ getColorPattern()

IlvColorPattern* IlvPalette::getColorPattern ( ) const

Gets the color pattern.

Retrieves the color pattern of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The color pattern of the palette.

◆ getFillRule()

IlvFillRule IlvPalette::getFillRule ( ) const

Gets the fill rule.

Returns
The fill rule attribute of the palette.

◆ getFillStyle()

IlvFillStyle IlvPalette::getFillStyle ( ) const

Gets the fill style.

Returns
The line width attribute of the palette.

◆ getFont()

IlvFont* IlvPalette::getFont ( ) const

Gets the font.

Retrieves the font of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The font of the palette.

◆ getForeground()

IlvColor* IlvPalette::getForeground ( ) const

Gets the foreground color.

Retrieves the foreground color of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The foreground color of the palette.

◆ getGradientPattern()

IlvGradientPattern* IlvPalette::getGradientPattern ( ) const

Gets the gradient pattern.

Retrieves the gradient pattern of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The color pattern of the palette.

◆ getLineStyle()

IlvLineStyle* IlvPalette::getLineStyle ( ) const

Gets the line style.

Retrieves the line style of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The line style of the palette.

◆ getLineWidth()

IlUShort IlvPalette::getLineWidth ( ) const

Gets the line width.

Returns
The line width attribute of the palette.

◆ getMode()

IlvDrawMode IlvPalette::getMode ( ) const

Gets the drawing mode.

Returns
The current drawing mode of the palette.

◆ getOverwrite()

IlBoolean IlvPalette::getOverwrite ( ) const

Gets the overwrite flag.

Returns
Indicates whether or not the drawing functions that use this palette draw on top of or under the windows.

◆ getPattern()

IlvPattern* IlvPalette::getPattern ( ) const

Gets the pattern.

Retrieves the pattern of the palette. This resource should never be deleted; if you want to use it in a context different from this palette, you should consider using lock() and unLock() on the resource.

Returns
The pattern of the palette.

◆ invert()

void IlvPalette::invert ( )

Swaps the foreground and background of the palette.

Swaps the foreground and the background color of this IlvPalette object.

◆ setAlpha()

void IlvPalette::setAlpha ( IlvIntensity  alpha)

Sets the alpha value.

Parameters
alphaThe new alpha value of the palette.

◆ setAntialiasingMode()

void IlvPalette::setAntialiasingMode ( IlvAntialiasingMode  antialias)

Sets the anti-aliasing mode.

Parameters
antialiasThe new anti-aliasing mode of the palette.

◆ setArcMode()

void IlvPalette::setArcMode ( IlvArcMode  arcMode)

Sets the arc mode.

Sets arcMode as the arc mode attribute of the palette.

Parameters
arcModeThe arc mode to set.

◆ setBackground()

void IlvPalette::setBackground ( IlvColor color)

Sets the background color.

Sets the background color of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
colorThe new background color.

◆ setClip() [1/2]

void IlvPalette::setClip ( const IlvRect rect = 0) const

Set or reset clipping rectangle.

This member function forces all drawing operations that are done with this IlvPalette to be clipped in the rectangle rect. If no value is given, then 0 is assumed and no clipping takes place anymore. You should always reset the clipping region to none (that is, call the member function setClip() with no parameter) after it has been used, because clipping is not considered as a persistent attribute of the palette (two palettes using exactly the same resources but different clipping regions are considered identical).

Parameters
rectThe rectangle on which clipping is to occur, or 0 to reset clipping.

◆ setClip() [2/2]

void IlvPalette::setClip ( const IlvRegion clip) const

Set clipping region.

This member function forces all drawing operations that are done with this IlvPalette to be clipped in the region clip. It has the same effect as the first setClip() method, except that the clipping now takes place on a real region.

Parameters
clipThe region on which clipping is to occur.

◆ setColorPattern()

void IlvPalette::setColorPattern ( IlvColorPattern pattern)

Sets the color pattern.

Sets the color pattern of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
patternThe new color pattern.

◆ setFillRule()

void IlvPalette::setFillRule ( IlvFillRule  fillRule)

Sets the fill rule.

Sets fillRule as the fill rule attribute of the palette.

Parameters
fillRuleThe fill rule to set.

◆ setFillStyle()

void IlvPalette::setFillStyle ( IlvFillStyle  fillStyle)

Sets the fill style.

Sets fillStyle as the fill style attribute of the palette.

Parameters
fillStyleThe fill style to set.

◆ setFont()

void IlvPalette::setFont ( IlvFont font)

Sets the font.

Sets the font of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
fontThe new font.

◆ setForeground()

void IlvPalette::setForeground ( IlvColor color)

Sets the foreground color.

Sets the foreground color of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
colorThe new foreground color.

◆ setGradientPattern()

void IlvPalette::setGradientPattern ( IlvGradientPattern pattern)

Sets the gradient pattern.

Sets the gradient pattern of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
patternThe new color pattern.

◆ setLineStyle() [1/2]

void IlvPalette::setLineStyle ( IlvLineStyle style)

Sets the line style.

Sets style as the line style resource of the palette. The palette calls lock() on style, then the palette calls unLock() on the old line style resource to release a reference to it.

Parameters
styleThe line style to set.

◆ setLineStyle() [2/2]

void IlvPalette::setLineStyle ( IlvLineStyle style,
IlUShort  width 
)

Sets the line style and width.

Sets style as the line style resource of the palette and width as the line width attribute. The palette calls lock() on style, then the palette calls unLock() on the old line style resource to release a reference to it.

Parameters
styleThe line style to set.
widthThe line width to set.

◆ setLineWidth()

void IlvPalette::setLineWidth ( IlUShort  width)

Sets the line width.

Sets width as the line width attribute of the palette.

Parameters
widthThe line width to set.

◆ setMode()

void IlvPalette::setMode ( IlvDrawMode  drawMode) const

Sets the drawing mode.

Sets the drawing mode of this palette to drawMode.

Parameters
drawModeThe drawing mode to set.

◆ setOverwrite()

void IlvPalette::setOverwrite ( IlBoolean  over) const

Sets the overwrite flag.

Modifies the way the drawing member functions of the IlvDisplay class operate when drawing on the root port. If the over parameter is set to IlFalse, the drawing operations are hidden by the windows stored on the top window. If the parameter is set to IlTrue, the drawing operations are performed on top of every window present on the screen, just as if the windows were part of the root window.

Parameters
overThe new overwrite flag value.

◆ setPattern()

void IlvPalette::setPattern ( IlvPattern pattern)

Sets the pattern.

Sets the pattern of the palette. The palette calls lock() on the resource provided as argument. Then the palette calls unLock() on the old resource to release a reference to it.

Parameters
patternThe new pattern.

◆ unLock()

virtual void IlvPalette::unLock ( )
virtual

Unlocks the resource.

This function decrements the reference count of the resource, and deletes it if this count becomes 0. Resource management is closely concerned with the way resources are locked and unlocked. Whenever you need a specific resource in one of your persistent objects, you should use this mechanism to make sure that it will stay safe within your IlvDisplay instance. If your application needs more than one instance of IlvDisplay, you have to create resources within each environment, since resources cannot be shared between the different IlvDisplay contexts.

Reimplemented from IlvResource.