Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
dw::fltk::FltkPlatform Class Reference

#include <fltkplatform.hh>

Classes

class  FltkResourceFactory
 
class  IdleFunc
 

Public Member Functions

 FltkPlatform ()
 
 ~FltkPlatform ()
 
void setLayout (core::Layout *layout)
 This methods notifies the platform, that it has been attached to a layout.
 
void attachView (core::View *view)
 This methods notifies the platform, that a view has been attached to the related layout.
 
void detachView (core::View *view)
 This methods notifies the platform, that a view has been detached from the related layout.
 
int textWidth (core::style::Font *font, const char *text, int len)
 Return the width of a text, with a given length and font.
 
char * textToUpper (const char *text, int len)
 Return the string resulting from transforming text to uppercase.
 
char * textToLower (const char *text, int len)
 Return the string resulting from transforming text to lowercase.
 
int nextGlyph (const char *text, int idx)
 Return the index of the next glyph in string text.
 
int prevGlyph (const char *text, int idx)
 Return the index of the previous glyph in string text.
 
float dpiX ()
 Return screen resolution in x-direction.
 
float dpiY ()
 Return screen resolution in y-direction.
 
int addIdle (void(core::Layout::*func)())
 
void removeIdle (int idleId)
 Remove an idle function, which has not been processed yet.
 
core::style::FontcreateFont (core::style::FontAttrs *attrs, bool tryEverything)
 Create a (platform dependent) font.
 
bool fontExists (const char *name)
 
core::style::ColorcreateColor (int color)
 Create a color resource for a given 0xrrggbb value.
 
core::style::TooltipcreateTooltip (const char *text)
 Create a tooltip.
 
void cancelTooltip ()
 Cancel a tooltip (either shown or requested)
 
core::ImgbufcreateImgbuf (core::Imgbuf::Type type, int width, int height, double gamma)
 Create a (platform speficic) image buffer.
 
void copySelection (const char *text)
 Copy selected text (0-terminated).
 
core::ui::ResourceFactorygetResourceFactory ()
 ...
 
void attachResource (ui::FltkResource *resource)
 
void detachResource (ui::FltkResource *resource)
 
- Public Member Functions inherited from dw::core::Platform
virtual int addIdle (void(Layout::*func)())=0
 Add an idle function.
 
- 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.
 

Private Member Functions

void generalIdle ()
 

Static Private Member Functions

static void generalStaticIdle (void *data)
 

Private Attributes

FltkResourceFactory resourceFactory
 
core::Layoutlayout
 
lout::container::typed::List< IdleFunc > * idleQueue
 
bool idleFuncRunning
 
int idleFuncId
 
FltkViewview
 
lout::container::typed::List< ui::FltkResource > * resources
 

Detailed Description

Definition at line 92 of file fltkplatform.hh.

Constructor & Destructor Documentation

◆ FltkPlatform()

◆ ~FltkPlatform()

dw::fltk::FltkPlatform::~FltkPlatform ( )

Definition at line 467 of file fltkplatform.cc.

References DBG_OBJ_DELETE, generalStaticIdle(), idleFuncRunning, idleQueue, and resources.

Member Function Documentation

◆ addIdle()

int dw::fltk::FltkPlatform::addIdle ( void(core::Layout::*)()  func)

◆ attachResource()

void dw::fltk::FltkPlatform::attachResource ( ui::FltkResource resource)

◆ attachView()

void dw::fltk::FltkPlatform::attachView ( core::View view)
virtual

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

Implements dw::core::Platform.

Definition at line 484 of file fltkplatform.cc.

References dw::fltk::ui::FltkResource::attachView(), MSG_ERR, resources, and view.

◆ cancelTooltip()

void dw::fltk::FltkPlatform::cancelTooltip ( )
virtual

Cancel a tooltip (either shown or requested)

Implements dw::core::Platform.

Definition at line 335 of file fltkplatform.cc.

References dw::fltk::FltkTooltip::cancel().

◆ copySelection()

void dw::fltk::FltkPlatform::copySelection ( const char *  text)
virtual

Copy selected text (0-terminated).

Implements dw::core::Platform.

Definition at line 703 of file fltkplatform.cc.

◆ createColor()

core::style::Color * dw::fltk::FltkPlatform::createColor ( int  color)
virtual

Create a color resource for a given 0xrrggbb value.

Implements dw::core::Platform.

Definition at line 693 of file fltkplatform.cc.

References dw::fltk::FltkColor::create().

◆ createFont()

core::style::Font * dw::fltk::FltkPlatform::createFont ( core::style::FontAttrs attrs,
bool  tryEverything 
)
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", "zeroWidth" 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.

Implements dw::core::Platform.

Definition at line 686 of file fltkplatform.cc.

References dw::fltk::FltkFont::create().

◆ createImgbuf()

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

Create a (platform speficic) image buffer.

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

Implements dw::core::Platform.

Definition at line 708 of file fltkplatform.cc.

◆ createTooltip()

core::style::Tooltip * dw::fltk::FltkPlatform::createTooltip ( const char *  text)
virtual

Create a tooltip.

Implements dw::core::Platform.

Definition at line 698 of file fltkplatform.cc.

References dw::fltk::FltkTooltip::create().

◆ detachResource()

void dw::fltk::FltkPlatform::detachResource ( ui::FltkResource resource)

Definition at line 726 of file fltkplatform.cc.

References resources.

Referenced by dw::fltk::ui::FltkResource::~FltkResource().

◆ detachView()

void dw::fltk::FltkPlatform::detachView ( core::View view)
virtual

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

Implements dw::core::Platform.

Definition at line 498 of file fltkplatform.cc.

References dw::fltk::ui::FltkResource::detachView(), MSG_ERR, resources, and view.

◆ dpiX()

float dw::fltk::FltkPlatform::dpiX ( )
virtual

Return screen resolution in x-direction.

Implements dw::core::Platform.

Definition at line 604 of file fltkplatform.cc.

◆ dpiY()

float dw::fltk::FltkPlatform::dpiY ( )
virtual

Return screen resolution in y-direction.

Implements dw::core::Platform.

Definition at line 612 of file fltkplatform.cc.

◆ fontExists()

bool dw::fltk::FltkPlatform::fontExists ( const char *  name)
virtual

◆ generalIdle()

void dw::fltk::FltkPlatform::generalIdle ( )
private

◆ generalStaticIdle()

void dw::fltk::FltkPlatform::generalStaticIdle ( void *  data)
staticprivate

Definition at line 620 of file fltkplatform.cc.

Referenced by addIdle(), generalIdle(), removeIdle(), and ~FltkPlatform().

◆ getResourceFactory()

core::ui::ResourceFactory * dw::fltk::FltkPlatform::getResourceFactory ( )
virtual

...

Implements dw::core::Platform.

Definition at line 714 of file fltkplatform.cc.

References resourceFactory.

◆ nextGlyph()

int dw::fltk::FltkPlatform::nextGlyph ( const char *  text,
int  idx 
)
virtual

Return the index of the next glyph in string text.

Implements dw::core::Platform.

Definition at line 594 of file fltkplatform.cc.

Referenced by textWidth().

◆ prevGlyph()

int dw::fltk::FltkPlatform::prevGlyph ( const char *  text,
int  idx 
)
virtual

Return the index of the previous glyph in string text.

Implements dw::core::Platform.

Definition at line 599 of file fltkplatform.cc.

◆ removeIdle()

void dw::fltk::FltkPlatform::removeIdle ( int  idleId)
virtual

◆ setLayout()

void dw::fltk::FltkPlatform::setLayout ( core::Layout layout)
virtual

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

Implements dw::core::Platform.

Definition at line 477 of file fltkplatform.cc.

References DBG_OBJ_ASSOC_CHILD, and layout.

◆ textToLower()

char * dw::fltk::FltkPlatform::textToLower ( const char *  text,
int  len 
)
virtual

Return the string resulting from transforming text to lowercase.

Implements dw::core::Platform.

Definition at line 579 of file fltkplatform.cc.

◆ textToUpper()

char * dw::fltk::FltkPlatform::textToUpper ( const char *  text,
int  len 
)
virtual

Return the string resulting from transforming text to uppercase.

Implements dw::core::Platform.

Definition at line 564 of file fltkplatform.cc.

◆ textWidth()

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

Member Data Documentation

◆ idleFuncId

int dw::fltk::FltkPlatform::idleFuncId
private

Definition at line 138 of file fltkplatform.hh.

Referenced by addIdle(), and FltkPlatform().

◆ idleFuncRunning

bool dw::fltk::FltkPlatform::idleFuncRunning
private

Definition at line 137 of file fltkplatform.hh.

Referenced by addIdle(), FltkPlatform(), generalIdle(), removeIdle(), and ~FltkPlatform().

◆ idleQueue

lout::container::typed::List<IdleFunc>* dw::fltk::FltkPlatform::idleQueue
private

Definition at line 136 of file fltkplatform.hh.

Referenced by addIdle(), FltkPlatform(), generalIdle(), removeIdle(), and ~FltkPlatform().

◆ layout

core::Layout* dw::fltk::FltkPlatform::layout
private

Definition at line 134 of file fltkplatform.hh.

Referenced by FltkPlatform(), generalIdle(), and setLayout().

◆ resourceFactory

FltkResourceFactory dw::fltk::FltkPlatform::resourceFactory
private

Definition at line 125 of file fltkplatform.hh.

Referenced by FltkPlatform(), and getResourceFactory().

◆ resources

lout::container::typed::List<ui::FltkResource>* dw::fltk::FltkPlatform::resources
private

◆ view

FltkView* dw::fltk::FltkPlatform::view
private

Definition at line 143 of file fltkplatform.hh.

Referenced by attachResource(), attachView(), detachView(), and FltkPlatform().


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