#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) |
void | foreign_callback (WindowForeignCallback *cb, void *data=((void *) 0)) |
void | foreign_callback_data (void *data) |
WindowForeignCallback * | foreign_callback (void) |
void * | foreign_callback_data (void) |
void | window_id (unsigned int id) |
unsigned int | window_id (void) |
Static Public Member Functions | |
static void | do_foreign_callback (unsigned int id) |
static void | do_foreign_callback_for_all (void) |
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
static void do_foreign_callback | ( | unsigned int | id | ) | [static] |
Call registered foreign callback, by window id
static void do_foreign_callback_for_all | ( | void | ) | [inline, static] |
Call foreign callbacks of all windows, no matter what ID they set. This is useful when all apps should call callbacks in the same time, due e.g. some global updates or similar
bool double_buffer | ( | void | ) | [inline] |
Returns true if window is double buffered
virtual void flush | ( | void | ) | [inline, virtual] |
WindowForeignCallback* foreign_callback | ( | void | ) | [inline] |
Returns pointer to foreign callback function
void foreign_callback | ( | WindowForeignCallback * | cb, | |
void * | data = ((void*)0) | |||
) | [inline] |
Setup foreign callback. Foreign callbacks allows to call registered functions in (or from) external programs, by using X messaging system.
To do so, window (it has to be Window class or inherited one), if wants to allow external calls, has to register window ID. This should be unique, integer number, known to the external caller.
After setting ID and callback via foreign_callback(), external caller will use do_foreign_callback(ID) to call it.
Foreign callbacks can be used to instruct application to re-read it's configuration file, after that file was changed by different program.
void* foreign_callback_data | ( | void | ) | [inline] |
Return additional data for foreign callback. If data wasn't set previously, returned value will be NULL
void foreign_callback_data | ( | void * | data | ) | [inline] |
Setup data for foreign callback
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 | ( | int | argc, | |
char ** | argv | |||
) | [inline, virtual] |
Show a window
virtual void show | ( | void | ) | [virtual] |
Show a window
bool single_buffer | ( | void | ) | [inline] |
Returns true if window is single buffered
void single_buffer | ( | bool | s | ) | [inline] |
Set window either to single or double buffered. Only valid if called before show().
const char* const* window_icon | ( | void | ) | [inline] |
Get a window icon
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.
unsigned int window_id | ( | void | ) | [inline] |
Returns window ID (used by foreign callbacks)
void window_id | ( | unsigned int | id | ) | [inline] |
Setup window ID (used by foreign callbacks)
WindowXSettingsCallback* xsettings_callback | ( | void | ) | [inline] |
Returns callback used for XSETTINGS protocol
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.
void* xsettings_callback_data | ( | void | ) | [inline] |
Returns data assigned that should be passed to the XSETTINGS callback