edelib  2.1.0
Public Member Functions | List of all members
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:

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

Member Function Documentation

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

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.

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

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 
)
inlinevirtual

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


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