Dillo v3.1.1-14-g8f67d6e0
Loading...
Searching...
No Matches
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.
 
virtual void attachView (View *view)=0
 This methods notifies the platform, that a view has been attached to the related layout.
 
virtual void detachView (View *view)=0
 This methods notifies the platform, that a view has been detached from the related layout.
 
virtual int textWidth (style::Font *font, const char *text, int len)=0
 Return the width of a text, with a given length and font.
 
virtual char * textToUpper (const char *text, int len)=0
 Return the string resulting from transforming text to uppercase.
 
virtual char * textToLower (const char *text, int len)=0
 Return the string resulting from transforming text to lowercase.
 
virtual int nextGlyph (const char *text, int idx)=0
 Return the index of the next glyph in string text.
 
virtual int prevGlyph (const char *text, int idx)=0
 Return the index of the previous glyph in string text.
 
virtual float dpiX ()=0
 Return screen resolution in x-direction.
 
virtual float dpiY ()=0
 Return screen resolution in y-direction.
 
virtual int addIdle (void(Layout::*func)())=0
 Add an idle function.
 
virtual void removeIdle (int idleId)=0
 Remove an idle function, which has not been processed yet.
 
virtual style::FontcreateFont (style::FontAttrs *attrs, bool tryEverything)=0
 Create a (platform dependent) font.
 
virtual bool fontExists (const char *name)=0
 
virtual style::ColorcreateColor (int color)=0
 Create a color resource for a given 0xrrggbb value.
 
virtual style::TooltipcreateTooltip (const char *text)=0
 Create a tooltip.
 
virtual void cancelTooltip ()=0
 Cancel a tooltip (either shown or requested)
 
virtual ImgbufcreateImgbuf (Imgbuf::Type type, int width, int height, double gamma)=0
 Create a (platform speficic) image buffer.
 
virtual void copySelection (const char *text)=0
 Copy selected text (0-terminated).
 
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.
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal.
 
virtual int hashValue ()
 Return a hash value for the object.
 
virtual Objectclone ()
 Return an exact copy of the object.
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Detailed Description

An interface to encapsulate some platform dependencies.

See also
Dillo Widget Overview

Definition at line 16 of file platform.hh.

Member Function Documentation

◆ addIdle()

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.

Referenced by dw::core::Layout::queueResize(), and dw::core::Layout::scrollTo0().

◆ attachView()

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.

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

◆ cancelTooltip()

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().

◆ copySelection()

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().

◆ createColor()

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().

◆ createFont()

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().

◆ createImgbuf()

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().

◆ createTooltip()

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().

◆ detachView()

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.

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

◆ dpiX()

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().

◆ dpiY()

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().

◆ fontExists()

virtual bool dw::core::Platform::fontExists ( const char *  name)
pure virtual

◆ getResourceFactory()

virtual ui::ResourceFactory * dw::core::Platform::getResourceFactory ( )
pure virtual

◆ nextGlyph()

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::core::Layout::nextGlyph().

◆ prevGlyph()

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().

◆ removeIdle()

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.

Referenced by dw::core::Layout::updateAnchor(), and dw::core::Layout::~Layout().

◆ setLayout()

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().

◆ textToLower()

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::core::Layout::textToLower().

◆ textToUpper()

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().

◆ textWidth()

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: