Dillo
Public Member Functions | List of all members
dw::core::Platform Class Referenceabstract

An interface to encapsulate some platform dependencies. More...

#include <platform.hh>

Public Member Functions

virtual void setLayout (Layout *layout)=0
 This methods notifies the platform, that it has been attached to a layout. More...
 
virtual void attachView (View *view)=0
 This methods notifies the platform, that a view has been attached to the related layout. More...
 
virtual void detachView (View *view)=0
 This methods notifies the platform, that a view has been detached from the related layout. More...
 
virtual int textWidth (style::Font *font, const char *text, int len)=0
 Return the width of a text, with a given length and font. More...
 
virtual char * textToUpper (const char *text, int len)=0
 Return the string resulting from transforming text to uppercase. More...
 
virtual char * textToLower (const char *text, int len)=0
 Return the string resulting from transforming text to lowercase. More...
 
virtual int nextGlyph (const char *text, int idx)=0
 Return the index of the next glyph in string text. More...
 
virtual int prevGlyph (const char *text, int idx)=0
 Return the index of the previous glyph in string text. More...
 
virtual float dpiX ()=0
 Return screen resolution in x-direction. More...
 
virtual float dpiY ()=0
 Return screen resolution in y-direction. More...
 
virtual int addIdle (void(Layout::*func)())=0
 Add an idle function. More...
 
virtual void removeIdle (int idleId)=0
 Remove an idle function, which has not been processed yet. More...
 
virtual style::FontcreateFont (style::FontAttrs *attrs, bool tryEverything)=0
 Create a (platform dependent) font. More...
 
virtual bool fontExists (const char *name)=0
 
virtual style::ColorcreateColor (int color)=0
 Create a color resource for a given 0xrrggbb value. More...
 
virtual style::TooltipcreateTooltip (const char *text)=0
 Create a tooltip. More...
 
virtual void cancelTooltip ()=0
 Cancel a tooltip (either shown or requested) More...
 
virtual ImgbufcreateImgbuf (Imgbuf::Type type, int width, int height, double gamma)=0
 Create a (platform speficic) image buffer. More...
 
virtual void copySelection (const char *text)=0
 Copy selected text (0-terminated). More...
 
virtual ui::ResourceFactorygetResourceFactory ()=0
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More...
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Detailed Description

An interface to encapsulate some platform dependencies.

See also
Dillo Widget Overview

Member Function Documentation

virtual int dw::core::Platform::addIdle ( void(Layout::*)()  func)
pure virtual

Add an idle function.

An idle function is called once, when no other tasks are to be done (e.g. there are no events to process), and then removed from the queue. The return value is a number, which can be used in removeIdle below.

virtual void dw::core::Platform::attachView ( View view)
pure virtual

This methods notifies the platform, that a view has been attached to the related layout.

Implemented in dw::fltk::FltkPlatform.

virtual void dw::core::Platform::cancelTooltip ( )
pure virtual

Cancel a tooltip (either shown or requested)

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::cancelTooltip().

virtual void dw::core::Platform::copySelection ( const char *  text)
pure virtual

Copy selected text (0-terminated).

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::copySelection().

virtual style::Color* dw::core::Platform::createColor ( int  color)
pure virtual

Create a color resource for a given 0xrrggbb value.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::createColor().

virtual style::Font* dw::core::Platform::createFont ( style::FontAttrs attrs,
bool  tryEverything 
)
pure virtual

Create a (platform dependent) font.

Typically, within a platform, a sub class of dw::core::style::Font is defined, which holds more platform dependent data.

Also, this method must fill the attributes "font" (when needed), "ascent", "descent", "spaceSidth" and "xHeight". If "tryEverything" is true, several methods should be used to use another font, when the requested font is not available. Passing false is typically done, if the caller wants to test different variations.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::createFont().

virtual Imgbuf* dw::core::Platform::createImgbuf ( Imgbuf::Type  type,
int  width,
int  height,
double  gamma 
)
pure virtual

Create a (platform speficic) image buffer.

"gamma" is the value by which the image data is gamma-encoded.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::createImgbuf().

virtual style::Tooltip* dw::core::Platform::createTooltip ( const char *  text)
pure virtual

Create a tooltip.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::createTooltip().

virtual void dw::core::Platform::detachView ( View view)
pure virtual

This methods notifies the platform, that a view has been detached from the related layout.

Implemented in dw::fltk::FltkPlatform.

virtual float dw::core::Platform::dpiX ( )
pure virtual

Return screen resolution in x-direction.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::dpiX().

virtual float dw::core::Platform::dpiY ( )
pure virtual

Return screen resolution in y-direction.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::dpiY().

virtual bool dw::core::Platform::fontExists ( const char *  name)
pure virtual
virtual ui::ResourceFactory* dw::core::Platform::getResourceFactory ( )
pure virtual
virtual int dw::core::Platform::nextGlyph ( const char *  text,
int  idx 
)
pure virtual

Return the index of the next glyph in string text.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::Hyphenator::hyphenateWord(), and dw::core::Layout::nextGlyph().

virtual int dw::core::Platform::prevGlyph ( const char *  text,
int  idx 
)
pure virtual

Return the index of the previous glyph in string text.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::prevGlyph().

virtual void dw::core::Platform::removeIdle ( int  idleId)
pure virtual

Remove an idle function, which has not been processed yet.

Implemented in dw::fltk::FltkPlatform.

virtual void dw::core::Platform::setLayout ( Layout layout)
pure virtual

This methods notifies the platform, that it has been attached to a layout.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::Layout().

virtual char* dw::core::Platform::textToLower ( const char *  text,
int  len 
)
pure virtual

Return the string resulting from transforming text to lowercase.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::Hyphenator::hyphenateWord(), and dw::core::Layout::textToLower().

virtual char* dw::core::Platform::textToUpper ( const char *  text,
int  len 
)
pure virtual

Return the string resulting from transforming text to uppercase.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::textToUpper().

virtual int dw::core::Platform::textWidth ( style::Font font,
const char *  text,
int  len 
)
pure virtual

Return the width of a text, with a given length and font.

Implemented in dw::fltk::FltkPlatform.

Referenced by dw::core::Layout::textWidth().


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