edelib
2.0.0
|
#include <edelib/Window.h>
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) |
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:
Window | ( | int | X, |
int | Y, | ||
int | W, | ||
int | H, | ||
const char * | l = 0 , |
||
int | component = WIN_INIT_ALL |
||
) |
Constructor
Window | ( | int | W, |
int | H, | ||
const char * | l = 0 , |
||
int | component = WIN_INIT_ALL |
||
) |
Constructor
virtual ~Window | ( | ) | [virtual] |
Destructor
int component | ( | void | ) | [inline] |
Returns loaded parts given in WindowComponents
bool double_buffer | ( | void | ) | [inline] |
Returns true if window is double buffered
virtual void flush | ( | void | ) | [inline, virtual] |
virtual void hide | ( | void | ) | [inline, virtual] |
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.
virtual void resize | ( | int | X, |
int | Y, | ||
int | W, | ||
int | H | ||
) | [inline, virtual] |
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.
virtual void show | ( | void | ) | [virtual] |
Show a window
virtual void show | ( | int | argc, |
char ** | argv | ||
) | [inline, virtual] |
Show a window
void single_buffer | ( | bool | s | ) | [inline] |
Set window either to single or double buffered. Only valid if called before show().
bool single_buffer | ( | void | ) | [inline] |
Returns true if window is single buffered
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.
const char* const* window_icon | ( | void | ) | [inline] |
Get a window icon
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.
WindowXSettingsCallback* xsettings_callback | ( | void | ) | [inline] |
Returns callback used for XSETTINGS protocol
void* xsettings_callback_data | ( | void | ) | [inline] |
Returns data assigned that should be passed to the XSETTINGS callback