edelib 2.1.0
Window Class Reference

Window class. More...

#include <edelib/Window.h>

Inheritance diagram for Window:

Public Member Functions

 Window (int X, int Y, int W, int H, const char *l=0, int component=WIN_INIT_ALL)
 
 Window (int W, int H, const char *l=0, int component=WIN_INIT_ALL)
 
virtual ~Window ()
 
int component (void)
 
void xsettings_callback (WindowXSettingsCallback cb, void *data=((void *) 0))
 
WindowXSettingsCallback * xsettings_callback (void)
 
void * xsettings_callback_data (void)
 
void pause_xsettings_callback (void)
 
void restore_xsettings_callback (void)
 
void window_icon (const char *const *pix)
 
const char *const * window_icon (void)
 
virtual void show (void)
 
virtual void show (int argc, char **argv)
 
void single_buffer (bool s)
 
bool single_buffer (void)
 
bool double_buffer (void)
 
virtual void flush (void)
 
virtual void resize (int X, int Y, int W, int H)
 
virtual void hide (void)
 

Detailed Description

Window class.

This is Window class similar to FLTK's Fl_Window and Fl_Double_Window with addition of icon themes, XSETTINGS protocol, dialog icons setup and image initialization code, often called prior program startup.

It will also clean loaded data (e.g. call IconLoader::shutdown()), automatically when window is closed.

Contrary to the FLTK's Fl_Window and Fl_Double_Window which are separate classes, this class can be both of them (actually you can chose will window be single buffered or double buffered). If member single_buffer() is set to true, window will behave as Fl_Window, if not (default), window will be as Fl_Double_Window.

Make sure to call single_buffer() before show() if you want to change single/double buffering scheme.

Window implements the following XSETTINGS keys:

  • Fltk/Background - set FL_BACKGROUND color
  • Fltk/Background2 - set FL_BACKGROUND2 color
  • Fltk/Foreground - set FL_FOREGROUND color
  • Fltk/FontSize - set font size
  • Net/IconThemeName - load icon theme with the given name
Note
Due some FLTK issues, when font size was changed (via Fltk/FontSize), window will not be redrawn (actually, it can't be redrawn), so window has to be closed and opened again.

Constructor & Destructor Documentation

◆ Window() [1/2]

Window ( int X,
int Y,
int W,
int H,
const char * l = 0,
int component = WIN_INIT_ALL )

Constructor

◆ Window() [2/2]

Window ( int W,
int H,
const char * l = 0,
int component = WIN_INIT_ALL )

Constructor

◆ ~Window()

virtual ~Window ( )
virtual

Destructor

Member Function Documentation

◆ component()

int component ( void )
inline

Returns loaded parts given in WindowComponents

◆ double_buffer()

bool double_buffer ( void )
inline

Returns true if window is double buffered

◆ flush()

virtual void flush ( void )
inlinevirtual

Flush window content. If you inherit this class and re-implement flush(), make sure you call this flush() not the one from Fl_Window or Fl_Double_Window.

◆ hide()

virtual void hide ( void )
inlinevirtual

Hide window. If you inherit this class and re-implement hide(), make sure you call this hide() not the one from Fl_Window or Fl_Double_Window.

◆ pause_xsettings_callback()

void pause_xsettings_callback ( void )
inline

This function is meant to be used to temporary disable XSETTINGS callback. This is often used to prevent callback be called twice when is set() called from XSettingsClient.

◆ resize()

virtual void resize ( int X,
int Y,
int W,
int H )
inlinevirtual

Resize window. If you inherit this class and re-implement resize(), make sure you call this resize() not the one from Fl_Window or Fl_Double_Window.

◆ restore_xsettings_callback()

void restore_xsettings_callback ( void )
inline

Restore previously disabled callback. Note that this function must be called after pause_xsettings_callback() or it will disable callback completely.

◆ show() [1/2]

virtual void show ( int argc,
char ** argv )
inlinevirtual

Show a window

◆ show() [2/2]

virtual void show ( void )
virtual

Show a window

◆ single_buffer() [1/2]

void single_buffer ( bool s)
inline

Set window either to single or double buffered. Only valid if called before show().

◆ single_buffer() [2/2]

bool single_buffer ( void )
inline

Returns true if window is single buffered

◆ window_icon() [1/2]

void window_icon ( const char *const * pix)
inline

Set a window icon (icon that will be shown in titlebar). To allow compatibility with FLTK, this function must be called before show() or icon will not be shown.

◆ window_icon() [2/2]

const char *const * window_icon ( void )
inline

Get a window icon

◆ xsettings_callback() [1/2]

WindowXSettingsCallback * xsettings_callback ( void )
inline

Returns callback used for XSETTINGS protocol

◆ xsettings_callback() [2/2]

void xsettings_callback ( WindowXSettingsCallback cb,
void * data = ((void*)0) )
inline

Register callback for changes via XSETTINGS protocol. Optional, data parameter will be passed to the callback.

If callback function returns true, window will be redrawn.

◆ xsettings_callback_data()

void * xsettings_callback_data ( void )
inline

Returns data assigned that should be passed to the XSETTINGS callback


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