lib/ewl_freebox.h
Go to the documentation of this file.00001 /* vim: set sw=8 ts=8 sts=8 expandtab: */ 00002 #ifndef EWL_FREEBOX_H 00003 #define EWL_FREEBOX_H 00004 00022 #define EWL_FREEBOX_TYPE "freebox" 00023 00029 typedef int (*Ewl_Freebox_Comparator)(Ewl_Widget *a, Ewl_Widget *b); 00030 00035 #define EWL_FREEBOX(box) ((Ewl_Freebox *)box) 00036 00041 #define EWL_FREEBOX_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_FREEBOX_TYPE)) 00042 00046 typedef struct Ewl_Freebox Ewl_Freebox; 00047 00052 struct Ewl_Freebox 00053 { 00054 Ewl_Container container; 00056 Ewl_Freebox_Layout_Type layout; 00057 Ewl_Freebox_Comparator comparator; 00058 Ewl_Orientation orientation; 00059 unsigned short sorted; 00060 }; 00061 00062 Ewl_Widget *ewl_vfreebox_new(void); 00063 Ewl_Widget *ewl_hfreebox_new(void); 00064 Ewl_Widget *ewl_freebox_new(void); 00065 int ewl_freebox_init(Ewl_Freebox *fb); 00066 00067 void ewl_freebox_orientation_set(Ewl_Freebox *fb, 00068 Ewl_Orientation orientation); 00069 Ewl_Orientation ewl_freebox_orientation_get(Ewl_Freebox *fb); 00070 00071 void ewl_freebox_layout_type_set(Ewl_Freebox *fb, 00072 Ewl_Freebox_Layout_Type type); 00073 Ewl_Freebox_Layout_Type ewl_freebox_layout_type_get(Ewl_Freebox *fb); 00074 00075 void ewl_freebox_comparator_set(Ewl_Freebox *fb, 00076 Ewl_Freebox_Comparator cmp); 00077 Ewl_Freebox_Comparator ewl_freebox_comparator_get(Ewl_Freebox *fb); 00078 00079 void ewl_freebox_resort(Ewl_Freebox *fb); 00080 00081 /* 00082 * Internal callbacks, override at your risk 00083 */ 00084 void ewl_freebox_cb_configure(Ewl_Widget *w, void *ev, void *data); 00085 00086 void ewl_freebox_cb_child_add(Ewl_Container *c, Ewl_Widget *w); 00087 void ewl_freebox_cb_child_show(Ewl_Container *c, Ewl_Widget *w); 00088 00093 #endif 00094