vdr  2.4.0
Public Member Functions | Private Attributes | List of all members
cTextWrapper Class Reference

#include <font.h>

Public Member Functions

 cTextWrapper (void)
 
 cTextWrapper (const char *Text, const cFont *Font, int Width)
 
 ~cTextWrapper ()
 
void Set (const char *Text, const cFont *Font, int Width)
 
const char * Text (void)
 
int Lines (void)
 
const char * GetLine (int Line)
 

Private Attributes

char * text
 
char * eol
 
int lines
 
int lastLine
 

Detailed Description

Definition at line 104 of file font.h.

Constructor & Destructor Documentation

cTextWrapper::cTextWrapper ( void  )

Definition at line 545 of file font.c.

References eol, lastLine, lines, and text.

cTextWrapper::cTextWrapper ( const char *  Text,
const cFont Font,
int  Width 
)

Definition at line 552 of file font.c.

References Set(), and text.

cTextWrapper::~cTextWrapper ( )

Definition at line 558 of file font.c.

References text.

Member Function Documentation

const char * cTextWrapper::GetLine ( int  Line)

Returns the given Line. The first line is numbered 0.

Definition at line 635 of file font.c.

References eol, lastLine, lines, and text.

Referenced by cTextScroller::DrawText().

int cTextWrapper::Lines ( void  )
inline

Returns the actual number of lines needed to display the full wrapped text.

Definition at line 121 of file font.h.

References lines.

Referenced by cTextScroller::Total().

void cTextWrapper::Set ( const char *  Text,
const cFont Font,
int  Width 
)

Wraps the Text to make it fit into the area defined by the given Width when displayed with the given Font.

Wrapping is done by inserting the necessary number of newline characters into the string.

Definition at line 563 of file font.c.

References eol, lastLine, lines, MALLOC, stripspace(), text, Utf8CharGet(), SI::Utf8CharLen(), and cFont::Width().

Referenced by cTextWrapper(), and cTextScroller::Set().

const char * cTextWrapper::Text ( void  )

Returns the full wrapped text.

Definition at line 626 of file font.c.

References eol, and text.

Member Data Documentation

char* cTextWrapper::eol
private

Definition at line 107 of file font.h.

Referenced by cTextWrapper(), GetLine(), Set(), and Text().

int cTextWrapper::lastLine
private

Definition at line 109 of file font.h.

Referenced by cTextWrapper(), GetLine(), and Set().

int cTextWrapper::lines
private

Definition at line 108 of file font.h.

Referenced by cTextWrapper(), GetLine(), Lines(), and Set().

char* cTextWrapper::text
private

Definition at line 106 of file font.h.

Referenced by cTextWrapper(), GetLine(), Set(), Text(), and ~cTextWrapper().


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