Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Pango::Color Class Reference

A PangoColor C++ wrapper class. More...

#include <xfc/pango/attributes.hh>

Inheritance diagram for Xfc::Pango::Color:

Xfc::G::Boxed Xfc::Object Xfc::Trackable List of all members.

Constructors

Public Member Functions

Accessors
Methods

Detailed Description

A PangoColor C++ wrapper class.


Constructor & Destructor Documentation

Xfc::Pango::Color::Color ( const char *  spec  )  [explicit]

Constructs a color object by filling in the fields from a string specification.

Parameters:
spec A string specifying the new color.
If parsing of the specifier failed the color is set to black. The string can either be one of a large set of standard names (taken from the X11 rgb.txt file), or it can be a hex value in the form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue components of the color, respectively. For example, white in the four forms is '#fff' '#ffffff' '#fffffffff' and '#ffffffffffff'.

Xfc::Pango::Color::Color ( unsigned short  red,
unsigned short  green,
unsigned short  blue 
)

Construct a color with the specified red, green and blue values.

Parameters:
red The red component of the color, a value between 0 and 65535.
green The green component of the color, a value between 0 and 65535.
blue The blue component of the color, a value between 0 and 65535.

Xfc::Pango::Color::Color ( PangoColor *  color  )  [explicit]

Construct a new color from an existing PangoColor.

Parameters:
color A pointer to a PangoColor.
The color can be a newly created PangoColor or an existing PangoColor. The Color object created is a temporary object. It doesn't take over the ownership of PangoColor and PangoColor is not freed by the destructor. Color is created with a reference count of 1 that the caller owns.

Xfc::Pango::Color::Color ( GdkColor *  color,
bool  copy 
)

Construct a new color from an existing PangoColor.

Parameters:
color A pointer to a PangoColor.
copy Whether the Color object should make a copy of PangoColor or not.
The color can be a newly created PangoColor or an existing PangoColor. If copy is true Color will make a copy of PangoColor. If copy is false Color wont make a copy but instead takes over the ownership of PangoColor. Either way, the destructor will free PangoColor when the Color object is destroyed. This constructor is used by G::Boxed::wrap() to wrap PangoColor objects in a C++ wrapper. Color is created with a reference count of 1 that the caller owns.

Xfc::Pango::Color::Color ( const Color src  ) 

Copy constructor.

Parameters:
src The source color.


Member Function Documentation

Color& Xfc::Pango::Color::operator= ( const Color src  ) 

Assignment operator.

Parameters:
src The source color.

unsigned short Xfc::Pango::Color::get_red (  )  const

Returns the red component of the color.

This is a value between 0 and 65535, with 65535 indicating full intensitiy.

unsigned short Xfc::Pango::Color::get_green (  )  const

Returns the green component of the color.

This is a value between 0 and 65535, with 65535 indicating full intensitiy.

unsigned short Xfc::Pango::Color::get_blue (  )  const

Returns the blue component of the color.

This is a value between 0 and 65535, with 65535 indicating full intensitiy.

void Xfc::Pango::Color::set_red ( unsigned short  red  ) 

Sets the red component of the color.

Parameters:
red The red component, a value between 0 and 65535,

void Xfc::Pango::Color::set_green ( unsigned short  green  ) 

Sets the green component of the color.

Parameters:
green The green component, a value between 0 and 65535,

void Xfc::Pango::Color::set_blue ( unsigned short  blue  ) 

Sets the blue component of the color.

Parameters:
blue The blue component, a value between 0 and 65535,

void Xfc::Pango::Color::set ( unsigned short  red,
unsigned short  green,
unsigned short  blue 
)

Sets the red, green and blue components to the specified values.

Parameters:
red The red component of the color, a value between 0 and 65535.
green The green component of the color.
blue The blue component of the color.

bool Xfc::Pango::Color::parse ( const char *  spec  ) 

Fill in the fields of a color from a string specification.

Parameters:
spec A string specifying the new color.
Returns:
true if parsing of the specifier succeeded, otherwise false.
The string can either one of a large set of standard names (taken from the X11 rgb.txt file), or it can be a hex value in the form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue components of the color, respectively. For example, white in the four forms is '#fff' '#ffffff' '#fffffffff' and '#ffffffffffff'.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3