gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Pango Class Reference

#include <Pango.H>

Collaboration diagram for Pango:
[legend]

Public Member Functions

 Pango (void)
 
 ~Pango (void)
 Deconstructor Destructor, delete allocated memory and empty the linked lists. More...
 
string & getMarkup (void)
 
void setLabelText (GtkWidget *l)
 
Pangooperator<< (Font f)
 
Pangooperator<< (ColourLineSpec cls)
 
Pangooperator<< (string &s)
 
Pangooperator<< (const char *s)
 
Pangooperator<< (PangoIOS::specialFlags sf)
 
void reset (void)
 

Private Types

enum  pangoMarkupsIDs { COLOUR =1, SIZE, FONT }
 

Private Member Functions

void nextTag (void)
 

Private Attributes

LinkList< LinkList< pair< string *, string * > * > * > markups
 Each of the strings is associated with a set of markup and markup variable strings. More...
 
LinkList< string * > strings
 The strings to apply the markups to. More...
 
LinkList< string * > pangoMarkups
 The pango markup strings which are pointed to by markups. More...
 
string formattedMarkup
 The complete marked up string, set using getMarkup() More...
 

Detailed Description

Construct a pango markup

PangoTest.jpg

This class enables the user to construct pango markups like so :

Pango pango << "Normal text" << ColourLineSpec("g5") << "Green size 5 text"<< "Normal text";
pango << Font("Sans 12") << ColourLineSpec("r") << " Sans font size 12 text";

Markups must be added before the string they are to makrup. String may then be added.

PangoIOS provides special features for the Pango input stream.

For example using PangoIOS::Next, strings without markups can be provided :

Pango pango << ColourLineSpec("g") << "green." << PagnoIOS::Next << "text without markup";

Or markups without text can be provided :

Pango pango << Font("Sans 12") << PagnoIOS::Next << ColourLineSpec("g") << "green.";

To remove previous markups and strings :

Pango pango << ColourLineSpec("g") << "green.";
pango<<PangoIOS::Reset<<"new string";
Examples:
MessageDialogTest.C, PangoTest.C, and PangoTest2.C.

Definition at line 102 of file Pango.H.

Member Enumeration Documentation

◆ pangoMarkupsIDs

enum Pango::pangoMarkupsIDs
private
Enumerator
COLOUR 
SIZE 
FONT 

Definition at line 119 of file Pango.H.

Constructor & Destructor Documentation

◆ Pango()

Pango::Pango ( void  )
inline

Constructor Starts in the state where both markups and strings have an empty entry.

Definition at line 137 of file Pango.H.

Here is the call graph for this function:

◆ ~Pango()

Pango::~Pango ( void  )
inline

Deconstructor Destructor, delete allocated memory and empty the linked lists.

Definition at line 146 of file Pango.H.

Here is the call graph for this function:

Member Function Documentation

◆ getMarkup()

string& Pango::getMarkup ( void  )
inline

Format the markups and strings to produce a final Pango markup.

Returns
a reference to the formatted markup string.

Definition at line 155 of file Pango.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextTag()

void Pango::nextTag ( void  )
inlineprivate

Add a new markup linked list to markups and string to strings. This is called if strings.current()!=NULL and a markup operator<< is asked for. It is also called if the Pango::Reset is requested.

Definition at line 128 of file Pango.H.

Here is the call graph for this function:

◆ operator<<() [1/5]

Pango& Pango::operator<< ( Font  f)
inline

Add a font name to the markup. If there is a string already existing, then start a new markups / strings pair The Font class is copied, to allow temporaries in overloading like so : << Font("Sans 20") <<

Definition at line 193 of file Pango.H.

Here is the call graph for this function:

◆ operator<<() [2/5]

Pango& Pango::operator<< ( ColourLineSpec  cls)
inline

Add a ColourLineSpec for marking up. If a string already exists, then start a new markups / strings pair. The ColourLineSpec class is copied, to allow temporaries in overloading like so : << ColourLineSpec("r10000") <<

Parameters
clsColourLineSpec, where the integer is in thousands of a point, e.g. ColourLineSpec("r10000") is 10 point red.
Returns
A reference to this Pango class for more overloading.

Definition at line 207 of file Pango.H.

Here is the call graph for this function:

◆ operator<<() [3/5]

Pango& Pango::operator<< ( string &  s)
inline

Add a string to be marked up. If a string has been added previously, then append to it.

Definition at line 225 of file Pango.H.

Here is the call graph for this function:

◆ operator<<() [4/5]

Pango& Pango::operator<< ( const char *  s)
inline

Add a character array to be marked up. If a string has been added previously, then append to it.

Definition at line 237 of file Pango.H.

Here is the call graph for this function:

◆ operator<<() [5/5]

Pango& Pango::operator<< ( PangoIOS::specialFlags  sf)
inline

Handle the PangoIOS class specifiers

Definition at line 244 of file Pango.H.

◆ reset()

void Pango::reset ( void  )
inline

Reset the Pango object. Will remove and previous strings and markups

Definition at line 255 of file Pango.H.

Here is the call graph for this function:

◆ setLabelText()

void Pango::setLabelText ( GtkWidget *  l)
inline

Given a GtkLabel, set its text using the current state of the markups and strings.

Definition at line 185 of file Pango.H.

Here is the caller graph for this function:

Member Data Documentation

◆ formattedMarkup

string Pango::formattedMarkup
private

The complete marked up string, set using getMarkup()

Definition at line 122 of file Pango.H.

◆ markups

LinkList<LinkList<pair<string*, string*> *> *> Pango::markups
private

Each of the strings is associated with a set of markup and markup variable strings.

Definition at line 116 of file Pango.H.

◆ pangoMarkups

LinkList<string *> Pango::pangoMarkups
private

The pango markup strings which are pointed to by markups.

Definition at line 120 of file Pango.H.

◆ strings

LinkList<string*> Pango::strings
private

The strings to apply the markups to.

Definition at line 117 of file Pango.H.


The documentation for this class was generated from the following file:
gtkIOStream: Pango Class Reference
GTK+ IOStream  Beta