27 class Font :
public string {
32 void init(){pangoFontDescription=NULL;}
42 if (pangoFontDescription)
43 pango_font_description_free(pangoFontDescription);
44 pangoFontDescription=NULL;
50 if (pangoFontDescription)
51 pango_font_description_free(pangoFontDescription);
52 pangoFontDescription=NULL;
53 return pangoFontDescription=pango_font_description_from_string(c_str());
129 markups.
add(
new LinkList<pair<string*, string*> *>);
138 pangoMarkups.
add(
new string(
"foreground"));
139 pangoMarkups.
add(
new string(
"size"));
140 pangoMarkups.
add(
new string(
"font"));
149 delete pangoMarkups.
remove();
160 for (
int i=1; i<=markups.
getCount(); i++){
163 for (
int j=1;j<=currentMarkups->
getCount();j++){
165 formattedMarkup+=
"<span ";
166 currentMarkups->
grab(j);
167 formattedMarkup+=(*currentMarkups->
current()->first)+
"='"+(*currentMarkups->
current()->second)+
"'";
169 formattedMarkup+=
">";
171 formattedMarkup+=
" ";
175 formattedMarkup+=(*strings.
current());
177 formattedMarkup+=
"</span>";
180 return formattedMarkup;
186 gtk_label_set_markup(GTK_LABEL(l), getMarkup().c_str());
196 markups.
current()->add(
new pair<string*, string*>(pangoMarkups.
grab(FONT),
new string(f)));
212 markups.
current()->add(
new pair<string*, string*>(pangoMarkups.
grab(COLOUR),
new string(c)));
216 ostringstream oss; oss<<cls.
getSize();
217 markups.
current()->add(
new pair<string*, string*>(pangoMarkups.
grab(SIZE),
new string(oss.str())));
228 strings.
change(
new string(s));
260 pair<string*, string*> *
p=llp->
remove();
bool wasColourSpecified(void)
gchar * getColourString(void)
TYPE change(TYPE changeElement)
exchange lugs The current lug is replaced with this lug.
TYPE current(void)
return a pointer to the current lug
PangoFontDescription * getPangoFontDescription(void)
float getSize(void) const
TYPE grab(int i)
returns the i'th lug in the chain irrespective of direction
PangoFontDescription * pangoFontDescription
void setLabelText(GtkWidget *l)
Pango & operator<<(ColourLineSpec cls)
TYPE prev(void)
Return a pointer to the previous lug and move to that lug Increments against dir (either forward or b...
bool wasSizeSpecified(void)
LinkList< string * > pangoMarkups
The pango markup strings which are pointed to by markups.
~Pango(void)
Deconstructor Destructor, delete allocated memory and empty the linked lists.
Font(const char *str)
Construct a font description from a character array.
TYPE remove(void)
remove the current lug from the LinkList The current lug is removed form the list and passed back to ...
TYPE next(void)
Return a pointer to the next lug and move on to that lug Increments according to dir (either forward ...
Pango & operator<<(Font f)
void add(TYPE newElement)
Adds as the current element ... Added to the next of the current lug.
LinkList< string * > strings
The strings to apply the markups to.
std::ostream & operator<<(std::ostream &stream, const BitStream &bitStream)
string formattedMarkup
The complete marked up string, set using getMarkup()
Pango & operator<<(PangoIOS::specialFlags sf)
LinkList< LinkList< pair< string *, string * > * > * > markups
Each of the strings is associated with a set of markup and markup variable strings.
Font(string str)
Construct a font description from a string.
Pango & operator<<(string &s)
encapsulates a method to specify colour and line or point plotting This class tries to encapsulate oc...
Pango & operator<<(const char *s)