Ewl_Attach: A mechanism to attach data to widgets.
Detailed Description
Defines methods for attaching data to widgets.
Data Structures | |
struct | Ewl_Attach |
Contains information about widget attachments. More... | |
struct | Ewl_Attach_Dnd |
DND data associated with the widget. More... | |
Defines | |
#define | EWL_ATTACH(attach) ((Ewl_Attach *) attach) |
#define | ewl_attach_color_get(w) ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_COLOR) |
#define | ewl_attach_color_set(w, data) ewl_attach_other_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_COLOR, data) |
#define | EWL_ATTACH_IS(w) (ewl_widget_type_is(EWL_WIDGET(w)), EWL_ATTACH_TYPE) |
#define | ewl_attach_mouse_argb_cursor_set(w, cursor) |
#define | ewl_attach_mouse_cursor_set(w, data) |
#define | ewl_attach_name_get(w) ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_NAME) |
#define | ewl_attach_name_set(w, data) ewl_attach_text_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_NAME, data) |
#define | ewl_attach_tooltip_text_set(w, data) ewl_attach_text_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_TOOLTIP, data) |
#define | EWL_ATTACH_TOOLTIP_TYPE "tooltip" |
#define | ewl_attach_tooltip_widget_set(w, data) ewl_attach_widget_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_TOOLTIP, data) |
#define | ewl_attach_widget_association_get(w) ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_WIDGET_ASSOCIATION) |
#define | ewl_attach_widget_association_set(w, data) |
Typedefs | |
typedef struct Ewl_Attach | Ewl_Attach |
typedef struct Ewl_Attach_Dnd | Ewl_Attach_Dnd |
Functions | |
void * | ewl_attach_get (Ewl_Widget *w, Ewl_Attach_Type t) |
Get the attachment of type t from the widget w . | |
void | ewl_attach_list_del (Ewl_Attach_List *list, Ewl_Attach_Type type) |
Deletes the given type type from the list list . | |
void | ewl_attach_other_set (Ewl_Widget *w, Ewl_Attach_Type t, void *data) |
Attaches the data data to the widget w with the attache type of t . | |
void | ewl_attach_text_set (Ewl_Widget *w, Ewl_Attach_Type t, const char *data) |
Attaches the text data to the widget w . | |
void | ewl_attach_widget_set (Ewl_Widget *w, Ewl_Attach_Type t, Ewl_Widget *data) |
Attaches a widget data to the widget w . |
Define Documentation
#define EWL_ATTACH | ( | attach | ) | ((Ewl_Attach *) attach) |
Typecast a pointer to an Ewl_Attach pointer
Referenced by ewl_attach_list_del().
#define ewl_attach_color_get | ( | w | ) | ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_COLOR) |
Convenience method to get a colour attachment back
Referenced by ewl_widget_cb_reveal(), and ewl_widget_color_get().
#define ewl_attach_color_set | ( | w, | |||
data | ) | ewl_attach_other_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_COLOR, data) |
Convenience method to set a colour widget attachment
Referenced by ewl_widget_color_set().
#define EWL_ATTACH_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w)), EWL_ATTACH_TYPE) |
Returns TRUE if the widget is an Ewl_Attach widget, FALSE otherwise
#define ewl_attach_mouse_argb_cursor_set | ( | w, | |||
cursor | ) |
Value:
ewl_attach_other_set(EWL_WIDGET(w), \ EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR, cursor)
Referenced by ewl_dnd_drag_start().
#define ewl_attach_mouse_cursor_set | ( | w, | |||
data | ) |
Value:
ewl_attach_other_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_MOUSE_CURSOR, \ (int *)data)
Referenced by ewl_embed_mouse_cursor_set(), ewl_entry_init(), and ewl_paned_grabber_show_cursor_for().
#define ewl_attach_name_get | ( | w | ) | ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_NAME) |
Convenience method to get a widgets name attachment
Referenced by ewl_widget_name_get().
#define ewl_attach_name_set | ( | w, | |||
data | ) | ewl_attach_text_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_NAME, data) |
Convenience method to set a widget name attachment
Referenced by ewl_widget_name_set().
#define ewl_attach_tooltip_text_set | ( | w, | |||
data | ) | ewl_attach_text_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_TOOLTIP, data) |
Convenience method to set a tooltip text attachment
#define EWL_ATTACH_TOOLTIP_TYPE "tooltip" |
The type name for the Ewl_Attach tooltip
#define ewl_attach_tooltip_widget_set | ( | w, | |||
data | ) | ewl_attach_widget_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_TOOLTIP, data) |
Convenience method to set a tooltip widget attachement
#define ewl_attach_widget_association_get | ( | w | ) | ewl_attach_get(EWL_WIDGET(w), EWL_ATTACH_TYPE_WIDGET_ASSOCIATION) |
Convenience method to get the data attached to a notebook item
Referenced by ewl_notebook_cb_child_remove(), ewl_notebook_cb_tab_clicked(), ewl_notebook_page_tab_widget_get(), ewl_notebook_page_tab_widget_set(), and ewl_notebook_visible_page_set().
#define ewl_attach_widget_association_set | ( | w, | |||
data | ) |
Value:
Convenience method to attach data to a notebook itemReferenced by ewl_notebook_page_tab_widget_set().
Typedef Documentation
typedef struct Ewl_Attach Ewl_Attach |
Ewl_Attach provides a way to attach data to widgets
typedef struct Ewl_Attach_Dnd Ewl_Attach_Dnd |
Ewl_Attach_Dnd provides a way to attach DND data to widgets
Function Documentation
void* ewl_attach_get | ( | Ewl_Widget * | w, | |
Ewl_Attach_Type | t | |||
) |
Get the attachment of type t
from the widget w
.
- Parameters:
-
w,: The widget to get the attachment from t,: The type of attachment to get
- Returns:
- Returns the data for the given attachment type
References Ewl_Widget::attach, data, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, and EWL_WIDGET_TYPE.
Referenced by ewl_attach_dnd_drag_set(), ewl_embed_mouse_cursor_set(), and ewl_embed_mouse_move_feed().
void ewl_attach_list_del | ( | Ewl_Attach_List * | list, | |
Ewl_Attach_Type | type | |||
) |
Deletes the given type type
from the list list
.
- Parameters:
-
list,: The Ewl_Attach_List to delete type,: The Ewl_Attach_Type to delete
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DENTER_FUNCTION, Ewl_Attach_List::direct, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ATTACH, Ewl_Attach_List::len, Ewl_Attach_List::list, and type.
Referenced by ewl_attach_other_set(), ewl_attach_text_set(), ewl_attach_widget_set(), and ewl_widget_free().
void ewl_attach_other_set | ( | Ewl_Widget * | w, | |
Ewl_Attach_Type | t, | |||
void * | data | |||
) |
Attaches the data data
to the widget w
with the attache type of t
.
- Parameters:
-
w,: The widget to attach the data too t,: The type of attachment data,: The data to attach
- Returns:
- Returns no value
References Ewl_Widget::attach, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ATTACH_DATA_TYPE_OTHER, ewl_attach_list_del(), and EWL_WIDGET_TYPE.
Referenced by ewl_attach_dnd_drag_set().
void ewl_attach_text_set | ( | Ewl_Widget * | w, | |
Ewl_Attach_Type | t, | |||
const char * | data | |||
) |
Attaches the text data
to the widget w
.
- Parameters:
-
w,: The widget to attach the text too t,: The type of the attachment data,: The text to set as the attachment
- Returns:
- Returns no value
References Ewl_Widget::attach, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ATTACH_DATA_TYPE_TEXT, ewl_attach_list_del(), and EWL_WIDGET_TYPE.
void ewl_attach_widget_set | ( | Ewl_Widget * | w, | |
Ewl_Attach_Type | t, | |||
Ewl_Widget * | data | |||
) |
Attaches a widget data
to the widget w
.
- Parameters:
-
w,: The widget to attach the widget too t,: The type of data being attached data,: The wiget to attach
- Returns:
- Returns no value
References Ewl_Widget::attach, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ATTACH_DATA_TYPE_WIDGET, ewl_attach_list_del(), and EWL_WIDGET_TYPE.