![]() |
libxputty 0.1
|
This file contains definitions and structs used on all platforms. Platform specific definitions are located in xwidget-platform.h Xlib compatibility definitions for MSWindows are located in xputty-mswin.h. More...
Go to the source code of this file.
Data Structures | |
struct | Xputty |
Xputty - the main struct. It should be declared before any other call to a Xputty function. Xputty store a pointer in the childlist, to any Widget_t related to this instance of libxputty. The first created Widget_t is the toplevel window. When the toplevel window call destroy_widget(), Xputty call destroy_widget() for all remaining Widget_t's in the main childlist. So any allocated memory should be released before the toplevel window finaly close. More... | |
Typedefs | |
typedef struct Childlist_t | Childlist_t |
Childlist_t - maintain a Widget_t list of childs for a Widget_t. | |
typedef struct Adjustment_t | Adjustment_t |
Adjustment_t - Adjustment_t for a Widget_t. | |
typedef struct Widget_t | Widget_t |
Widget_t - the Widget_t base struct. | |
typedef struct XColor_t | XColor_t |
XColor_t - the Widget_t Color struct. | |
typedef struct SystrayColor_t | SystrayColor_t |
SystrayColor_t - the Systray Icon background Color. | |
typedef struct Xputty | Xputty |
Xputty - the main struct.It should be declared before any other call to a Xputty function. | |
typedef void(* | xfunc) (void *widget, void *user_data) |
*xfunc - function pointer to connect XEvents from a Widget_t to a event handler | |
Functions | |
void | main_init (Xputty *main) |
main_init - open the Display and init the main->childlist. Set the bool run to true. The bool run is used to terminate the main event loop. main_init() should be called directly after the declaration of Xputty before the first Widget_t get created. Any Widget_t created afterwards will be added to the main childlist. The main childlist is used to check if a Widget_t is valid to receive a Event. Xputty check if a Widget_t is registerd in the main childlist, and only forward events when it found the Widget_t in the list. When a Widget_t call destroy_widget() any childs of this Widget_t receive a call to destroy_widget() to release there memory, they get removed from the main childlist and finaly the Widget_t itself will be removed from the main childlist as well. On main_quit() any remaining Widget_t from the main childlist will be destroyed, to ensure that we leave the memory clean. | |
void | main_run (Xputty *main) |
main_run - start the main event loop. It should be start after your Widget_t's been created. You could create and destroy additional Widget_t's at any time later during run. | |
void | run_embedded (Xputty *main) |
run_embedded - the main event loop to run embedded UI's. It should be start after your Widget_t's been created. You could create and destroy additional Widget_t's at any time later during run. | |
void | main_quit (Xputty *main) |
main_quit - destroy all remaining Widget_t's from the main->childlist. Free all resources which may be allocated between init and quit. It should be called after main_run()/run_embedded(); | |
This file contains definitions and structs used on all platforms. Platform specific definitions are located in xwidget-platform.h Xlib compatibility definitions for MSWindows are located in xputty-mswin.h.
Definition in file xputty.h.
typedef struct Adjustment_t Adjustment_t |
Adjustment_t - Adjustment_t for a Widget_t.
typedef struct Childlist_t Childlist_t |
Childlist_t - maintain a Widget_t list of childs for a Widget_t.
typedef struct SystrayColor_t SystrayColor_t |
SystrayColor_t - the Systray Icon background Color.
typedef void(* xfunc) (void *widget, void *user_data) |
void main_init | ( | Xputty * | main | ) |
main_init - open the Display and init the main->childlist.
Set the bool run to true.
The bool run is used to terminate the main event loop.
main_init() should be called directly after the declaration of Xputty before the first Widget_t get created.
Any Widget_t created afterwards will be added to the main childlist.
The main childlist is used to check if a Widget_t is valid to receive a Event.
Xputty check if a Widget_t is registerd in the main childlist, and only forward events when it found the Widget_t in the list.
When a Widget_t call destroy_widget() any childs of this Widget_t receive a call to destroy_widget() to release there memory, they get removed from the main childlist and finaly the Widget_t itself will be removed from the main childlist as well. On main_quit() any remaining Widget_t from the main childlist will be destroyed, to ensure that we leave the memory clean.
*main | - pointer to the main Xputty struct |
Definition at line 24 of file xputty.c.
References Xputty::big_font, Xputty::childlist, childlist_init(), Xputty::color_scheme, Xputty::csize, Xputty::ctext, Xputty::dpy, Xputty::hold_grab, Xputty::is_grab, Xputty::key_snooper, Xputty::normal_font, os_init_dnd(), os_open_display(), Xputty::run, set_dark_theme(), set_systray_color(), Xputty::small_font, Xputty::submenu, and Xputty::systray_color.
void main_quit | ( | Xputty * | main | ) |
main_quit - destroy all remaining Widget_t's from the main->childlist.
Free all resources which may be allocated between init and quit.
It should be called after main_run()/run_embedded();
*main | - pointer to the main Xputty struct |
Definition at line 57 of file xputty.c.
References Xputty::childlist, childlist_destroy(), Childlist_t::childs, Xputty::color_scheme, Xputty::ctext, destroy_widget(), Xputty::dpy, Childlist_t::elem, os_close_display(), and Xputty::systray_color.
void main_run | ( | Xputty * | main | ) |
main_run - start the main event loop.
It should be start after your Widget_t's been created.
You could create and destroy additional Widget_t's at any time later during run.
*main | - pointer to the main Xputty struct |
Definition at line 49 of file xputty.c.
References os_main_run().
void run_embedded | ( | Xputty * | main | ) |
run_embedded - the main event loop to run embedded UI's.
It should be start after your Widget_t's been created.
You could create and destroy additional Widget_t's at any time later during run.
*main | - pointer to the main Xputty struct |
Definition at line 53 of file xputty.c.
References os_run_embedded().