GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Pango Class Reference

#include <Pango.H>

Collaboration diagram for Pango:
Collaboration graph
[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<< (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";

Definition at line 86 of file Pango.H.

Member Enumeration Documentation

enum Pango::pangoMarkupsIDs
private
Enumerator
COLOUR 
SIZE 
FONT 

Definition at line 103 of file Pango.H.

Constructor & Destructor Documentation

Pango::Pango ( void  )
inline
Constructor

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

Definition at line 121 of file Pango.H.

Here is the call graph for this function:

Pango::~Pango ( void  )
inline

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

Definition at line 130 of file Pango.H.

Here is the call graph for this function:

Member Function Documentation

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 139 of file Pango.H.

Here is the call graph for this function:

Here is the caller graph for this function:

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 112 of file Pango.H.

Here is the call graph for this function:

Here is the caller graph for this function:

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 177 of file Pango.H.

Here is the call graph for this function:

Here is the caller graph for this function:

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 191 of file Pango.H.

Here is the call graph for this function:

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 209 of file Pango.H.

Here is the call graph for this function:

Pango& Pango::operator<< ( 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 221 of file Pango.H.

Here is the call graph for this function:

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

Handle the PangoIOS class specifiers

Definition at line 228 of file Pango.H.

Here is the call graph for this function:

void Pango::reset ( void  )
inline
Reset the Pango object.

Will remove and previous strings and markups

Definition at line 239 of file Pango.H.

Here is the call graph for this function:

Here is the caller graph for this function:

void Pango::setLabelText ( GtkWidget *  l)
inline

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

Definition at line 169 of file Pango.H.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

string Pango::formattedMarkup
private

The complete marked up string, set using getMarkup()

Definition at line 106 of file Pango.H.

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 100 of file Pango.H.

LinkList<string *> Pango::pangoMarkups
private

The pango markup strings which are pointed to by markups.

Definition at line 104 of file Pango.H.

LinkList<string*> Pango::strings
private

The strings to apply the markups to.

Definition at line 101 of file Pango.H.


The documentation for this class was generated from the following file: