Ewl_Freebox: A Freelayout widget
Detailed Description
Defines a class to allow the user to specify the layout type for the widget.
- Remarks:
- Inherits from Ewl_Container.
Tutorial
Data Structures | |
struct | Ewl_Freebox |
Inherits from Ewl_Container and extends to allow for differnt layout algorithms. More... | |
Defines | |
#define | EWL_FREEBOX(box) ((Ewl_Freebox *)box) |
#define | EWL_FREEBOX_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_FREEBOX_TYPE)) |
#define | EWL_FREEBOX_TYPE "freebox" |
Typedefs | |
typedef struct Ewl_Freebox | Ewl_Freebox |
typedef int(* | Ewl_Freebox_Comparator )(Ewl_Widget *a, Ewl_Widget *b) |
Functions | |
void | ewl_freebox_cb_child_add (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_freebox_cb_child_show (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_freebox_cb_configure (Ewl_Widget *w, void *ev, void *data) |
Ewl_Freebox_Comparator | ewl_freebox_comparator_get (Ewl_Freebox *fb) |
Retrieve the comparator set in the Ewl_Freebox. | |
void | ewl_freebox_comparator_set (Ewl_Freebox *fb, Ewl_Freebox_Comparator cmp) |
Set the comparator to use in the Ewl_Freebox. | |
int | ewl_freebox_init (Ewl_Freebox *fb) |
Initializes an Ewl_Freebox widget to default values. | |
Ewl_Freebox_Layout_Type | ewl_freebox_layout_type_get (Ewl_Freebox *fb) |
Retrieve the layout type of the Ewl_Freebox. | |
void | ewl_freebox_layout_type_set (Ewl_Freebox *fb, Ewl_Freebox_Layout_Type type) |
Set the layout type of the Ewl_Freebox. | |
Ewl_Widget * | ewl_freebox_new (void) |
Creates a new, initialized Ewl_Freebox widget. | |
Ewl_Orientation | ewl_freebox_orientation_get (Ewl_Freebox *fb) |
Retrieve the current orientation of the freebox. | |
void | ewl_freebox_orientation_set (Ewl_Freebox *fb, Ewl_Orientation orientation) |
Sets the orientation of the freebox. | |
void | ewl_freebox_resort (Ewl_Freebox *fb) |
This will force the freebox to resort and redraw it's contents. Useful if part of the content changes but no child widgets where added/removed. (An icon label changes for example). | |
Ewl_Widget * | ewl_hfreebox_new (void) |
creates and initializes a new freebox widget | |
Ewl_Widget * | ewl_vfreebox_new (void) |
creates and initializes a new freebox widget |
Define Documentation
#define EWL_FREEBOX | ( | box | ) | ((Ewl_Freebox *)box) |
Typecasts a pointer to an Ewl_Freebox pointer.
Referenced by ewl_freebox_cb_child_add(), ewl_freebox_cb_child_show(), ewl_freebox_cb_configure(), ewl_freebox_new(), ewl_tree_view_freebox_init(), and ewl_vfreebox_new().
#define EWL_FREEBOX_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_FREEBOX_TYPE)) |
Returns TRUE if the widget is an Ewl_Freebox, FALSE otherwise
#define EWL_FREEBOX_TYPE "freebox" |
The type name for the Ewl_Freebox widget
Referenced by ewl_freebox_cb_child_add(), ewl_freebox_cb_child_show(), ewl_freebox_cb_configure(), ewl_freebox_comparator_get(), ewl_freebox_comparator_set(), ewl_freebox_init(), ewl_freebox_layout_type_get(), ewl_freebox_layout_type_set(), ewl_freebox_orientation_get(), ewl_freebox_orientation_set(), and ewl_freebox_resort().
Typedef Documentation
typedef struct Ewl_Freebox Ewl_Freebox |
A free layout container.
typedef int(* Ewl_Freebox_Comparator)(Ewl_Widget *a, Ewl_Widget *b) |
Callback to compare two widgets to determine which is first. If the return is < 0 then a is first. If the return is > 0 then b is first. If the return == 0 then they are equal
Function Documentation
void ewl_freebox_cb_child_add | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_FREEBOX, EWL_FREEBOX_TYPE, and sorted.
Referenced by ewl_freebox_init().
void ewl_freebox_cb_child_show | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_FREEBOX, EWL_FREEBOX_TYPE, and sorted.
Referenced by ewl_freebox_init().
void ewl_freebox_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_FREEBOX, EWL_FREEBOX_LAYOUT_AUTO, EWL_FREEBOX_LAYOUT_COMPARATOR, EWL_FREEBOX_LAYOUT_MANUAL, EWL_FREEBOX_TYPE, and layout.
Referenced by ewl_freebox_init().
Ewl_Freebox_Comparator ewl_freebox_comparator_get | ( | Ewl_Freebox * | fb | ) |
Retrieve the comparator set in the Ewl_Freebox.
- Parameters:
-
fb,: The Ewl_Freebox to get the comparator from
- Returns:
- Returns the Ewl_Freebox_Comparator set on the given Ewl_Freebox or NULL if none set.
References comparator, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, and EWL_FREEBOX_TYPE.
void ewl_freebox_comparator_set | ( | Ewl_Freebox * | fb, | |
Ewl_Freebox_Comparator | cmp | |||
) |
Set the comparator to use in the Ewl_Freebox.
- Parameters:
-
fb,: The Ewl_Freebox to set the comparator on cmp,: The Ewl_Freebox_Comparator functon to set
- Returns:
- Returns no value
References comparator, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_FREEBOX_TYPE, EWL_WIDGET, ewl_widget_configure(), and sorted.
int ewl_freebox_init | ( | Ewl_Freebox * | fb | ) |
Initializes an Ewl_Freebox widget to default values.
- Parameters:
-
fb,: The Ewl_Freebox to initialize
- Returns:
- Returns TRUE on success or FALSE on failure
References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CONFIGURE, EWL_CONTAINER, ewl_container_add_notify_set(), ewl_container_init(), ewl_container_show_notify_set(), ewl_freebox_cb_child_add(), ewl_freebox_cb_child_show(), ewl_freebox_cb_configure(), EWL_FREEBOX_LAYOUT_AUTO, EWL_FREEBOX_TYPE, EWL_ORIENTATION_HORIZONTAL, EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_focusable_set(), ewl_widget_inherit(), layout, and orientation.
Referenced by ewl_freebox_new().
Ewl_Freebox_Layout_Type ewl_freebox_layout_type_get | ( | Ewl_Freebox * | fb | ) |
Retrieve the layout type of the Ewl_Freebox.
- Parameters:
-
fb,: The Ewl_Freebox to get the layout from
- Returns:
- Returns the Ewl_Freebox_Layout_Type currently set on this freebox
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_FREEBOX_LAYOUT_AUTO, EWL_FREEBOX_TYPE, and layout.
void ewl_freebox_layout_type_set | ( | Ewl_Freebox * | fb, | |
Ewl_Freebox_Layout_Type | type | |||
) |
Set the layout type of the Ewl_Freebox.
- Parameters:
-
fb,: The Ewl_Freebox to change type,: The Ewl_Freebox_Layout_Type to set on this freebox
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_FREEBOX_TYPE, EWL_WIDGET, ewl_widget_configure(), and layout.
Referenced by ewl_tree_view_freebox_init().
Ewl_Widget* ewl_freebox_new | ( | void | ) |
Creates a new, initialized Ewl_Freebox widget.
- Returns:
- Returns a new Ewl_Freebox on success or NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_FREEBOX, ewl_freebox_init(), ewl_widget_destroy(), and NEW.
Referenced by ewl_hfreebox_new(), and ewl_vfreebox_new().
Ewl_Orientation ewl_freebox_orientation_get | ( | Ewl_Freebox * | fb | ) |
Retrieve the current orientation of the freebox.
- Parameters:
-
fb,: The freebox to use
- Returns:
- Returns the orientation of the freebox
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_FREEBOX_TYPE, EWL_ORIENTATION_HORIZONTAL, and orientation.
void ewl_freebox_orientation_set | ( | Ewl_Freebox * | fb, | |
Ewl_Orientation | orientation | |||
) |
Sets the orientation of the freebox.
- Parameters:
-
fb,: The freebox to use orientation,: The orientation to set
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_FREEBOX_TYPE, EWL_WIDGET, ewl_widget_configure(), and orientation.
void ewl_freebox_resort | ( | Ewl_Freebox * | fb | ) |
This will force the freebox to resort and redraw it's contents. Useful if part of the content changes but no child widgets where added/removed. (An icon label changes for example).
- Parameters:
-
fb,: The Ewl_Freebox to for a resort on
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_FREEBOX_TYPE, EWL_WIDGET, ewl_widget_configure(), and sorted.
Ewl_Widget* ewl_hfreebox_new | ( | void | ) |
creates and initializes a new freebox widget
- Note:
- This will allow for differnt types of 'free' layout depending on what you need. First there is AUTO layout, which will just place the widgets in rows and columns (this will expand the freebox as needed while trying to maintain the given space).
The third type of layout is COMPARATOR. This will require the comparator function to be set into the freebox. Then, as it is layout out widgets it will call the comparator to determine which should be placed first. It will then layout in rows/columns the same as AUTO. (This is essentially AUTO with sorting.)
- Returns:
- Returns a new horizontal Ewl_Freebox widget or NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, and ewl_freebox_new().
Ewl_Widget* ewl_vfreebox_new | ( | void | ) |
creates and initializes a new freebox widget
- Returns:
- Returns a new vertical Ewl_Freebox widget or NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_FREEBOX, ewl_freebox_new(), and EWL_ORIENTATION_VERTICAL.
Referenced by ewl_tree_view_freebox_init().