Ewl_Icon: An icon widget
Detailed Description
Describes a widget to layout and manipulate icons.
- Remarks:
- Inherits from Ewl_Stock.
Tutorial
Data Structures | |
struct | Ewl_Icon |
Inherits from Ewl_Stock and extends to provide for an icon layout. More... | |
Defines | |
#define | EWL_ICON(icon) ((Ewl_Icon *)icon) |
#define | EWL_ICON_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_ICON_TYPE)) |
#define | EWL_ICON_TYPE "icon" |
Typedefs | |
typedef struct Ewl_Icon | Ewl_Icon |
Functions | |
const char * | ewl_icon_alt_text_get (Ewl_Icon *icon) |
Retrieves the alternate text set on the icon. | |
void | ewl_icon_alt_text_set (Ewl_Icon *icon, const char *txt) |
Sets the given text as the alternate text for the icon. | |
void | ewl_icon_cb_destroy (Ewl_Widget *w, void *ev, void *data) |
unsigned int | ewl_icon_constrain_get (Ewl_Icon *icon) |
Retrieve the constrain value set on the icon. | |
void | ewl_icon_constrain_set (Ewl_Icon *icon, unsigned int val) |
Set the constrain value on the icon. | |
unsigned int | ewl_icon_editable_get (Ewl_Icon *icon) |
Retrieve if the icon is editable or not. | |
void | ewl_icon_editable_set (Ewl_Icon *icon, unsigned int e) |
Set if the icon is editable or not. | |
Ewl_Widget * | ewl_icon_extended_data_get (Ewl_Icon *icon) |
Retrieve the extended data from the icon. | |
void | ewl_icon_extended_data_set (Ewl_Icon *icon, Ewl_Widget *ext) |
Set the extended data into the icon. | |
const char * | ewl_icon_image_file_get (Ewl_Icon *icon) |
Retrieve the image to used in the icon. | |
void | ewl_icon_image_set (Ewl_Icon *icon, const char *file, const char *key) |
set the image to use in the icon | |
int | ewl_icon_init (Ewl_Icon *icon) |
Initializes the given Ewl_Icon widget. | |
unsigned int | ewl_icon_label_complex_get (Ewl_Icon *icon) |
Retrieve if the icon has a complex label or not. | |
void | ewl_icon_label_complex_set (Ewl_Icon *icon, unsigned int complex_label) |
Set if the icon use a label or a text widget for the label part. | |
unsigned int | ewl_icon_label_compressed_get (Ewl_Icon *icon) |
Retrieves the current compressiion setting for the icon. | |
void | ewl_icon_label_compressed_set (Ewl_Icon *icon, unsigned int compress) |
Sets the compressions setting for the icon to the given value. | |
const char * | ewl_icon_label_get (Ewl_Icon *icon) |
Retrieve the label from the icon. | |
void | ewl_icon_label_set (Ewl_Icon *icon, const char *label) |
Set the label of the icon. | |
Ewl_Widget * | ewl_icon_new (void) |
Creates and initializes a new Ewl_Icon widget. | |
void | ewl_icon_part_hide (Ewl_Icon *icon, Ewl_Icon_Part part) |
Hide the given part of the icon. Note: You can only hide one part. | |
Ewl_Widget * | ewl_icon_simple_new (void) |
Creates and initializes a new Ewl_Icon widget. | |
unsigned int | ewl_icon_thumbnailing_get (Ewl_Icon *icon) |
Retrieve if the icon use thumbnailing. | |
void | ewl_icon_thumbnailing_set (Ewl_Icon *icon, unsigned int thumb) |
Set if the icon thumbnailed the image or use it directly. | |
Ewl_Icon_Type | ewl_icon_type_get (Ewl_Icon *icon) |
Retrieve the type of the icon. | |
void | ewl_icon_type_set (Ewl_Icon *icon, Ewl_Icon_Type type) |
Set the type of the icon. |
Define Documentation
#define EWL_ICON | ( | icon | ) | ((Ewl_Icon *)icon) |
Typecasts a pointer to an Ewl_Icon pointer.
Referenced by ewl_calendar_init(), ewl_filelist_multi_select_preview_get(), ewl_filelist_selected_file_preview_get(), ewl_filelist_view_widget_fetch(), ewl_filepicker_init(), ewl_icon_cb_destroy(), ewl_icon_new(), ewl_icon_simple_new(), ewl_toolbar_cb_child_add(), and ewl_toolbar_icon_part_hide().
#define EWL_ICON_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_ICON_TYPE)) |
Returns TRUE if the widget is an Ewl_Icon, FALSE otherwise
Referenced by ewl_toolbar_cb_child_add(), and ewl_toolbar_icon_part_hide().
#define EWL_ICON_TYPE "icon" |
The type name for the Ewl_Icon widget
Referenced by ewl_icon_alt_text_get(), ewl_icon_alt_text_set(), ewl_icon_cb_destroy(), ewl_icon_constrain_get(), ewl_icon_constrain_set(), ewl_icon_editable_get(), ewl_icon_editable_set(), ewl_icon_extended_data_get(), ewl_icon_extended_data_set(), ewl_icon_image_file_get(), ewl_icon_image_set(), ewl_icon_init(), ewl_icon_label_complex_get(), ewl_icon_label_complex_set(), ewl_icon_label_compressed_get(), ewl_icon_label_compressed_set(), ewl_icon_label_get(), ewl_icon_label_set(), ewl_icon_part_hide(), ewl_icon_thumbnailing_get(), ewl_icon_thumbnailing_set(), ewl_icon_type_get(), and ewl_icon_type_set().
Typedef Documentation
Function Documentation
const char* ewl_icon_alt_text_get | ( | Ewl_Icon * | icon | ) |
Retrieves the alternate text set on the icon.
- Parameters:
-
icon,: The icon to work with
- Returns:
- Returns the alternate text set on the icon
References alt, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON_TYPE, EWL_LABEL, and ewl_label_text_get().
void ewl_icon_alt_text_set | ( | Ewl_Icon * | icon, | |
const char * | txt | |||
) |
Sets the given text as the alternate text for the icon.
- Parameters:
-
icon,: The icon to work with txt,: The text to set as the alternate text
- Returns:
- Returns no value
References alt, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CONTAINER, ewl_container_child_prepend(), EWL_FLAG_ALIGN_CENTER, EWL_FLAG_FILL_VFILL, ewl_icon_image_file_get(), EWL_ICON_IMAGE_LOADING, ewl_icon_theme_icon_path_get(), EWL_ICON_TYPE, EWL_LABEL, ewl_label_new(), ewl_label_text_set(), EWL_OBJECT, ewl_object_alignment_set(), ewl_object_fill_policy_set(), ewl_widget_hide(), ewl_widget_show(), and image.
Referenced by ewl_calendar_init(), and ewl_filepicker_init().
void ewl_icon_cb_destroy | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ICON, EWL_ICON_TYPE, IF_FREE, and label_text.
Referenced by ewl_icon_init().
unsigned int ewl_icon_constrain_get | ( | Ewl_Icon * | icon | ) |
Retrieve the constrain value set on the icon.
- Parameters:
-
icon,: The icon to get the constrain from
- Returns:
- Returns the current constrain value of the icon
References constrain, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_ICON_TYPE.
void ewl_icon_constrain_set | ( | Ewl_Icon * | icon, | |
unsigned int | val | |||
) |
Set the constrain value on the icon.
- Parameters:
-
icon,: The Ewl_Icon to constrain val,: The val to constrain too
- Returns:
- Returns no value.
References constrain, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ICON_TYPE, EWL_IMAGE, ewl_image_constrain_set(), and image.
Referenced by ewl_filelist_view_widget_fetch(), and ewl_icon_image_set().
unsigned int ewl_icon_editable_get | ( | Ewl_Icon * | icon | ) |
Retrieve if the icon is editable or not.
- Parameters:
-
icon,: The icon to check if it's editable
- Returns:
- Returns TRUE if the icon is editable, FALSE otherwise
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, editable, and EWL_ICON_TYPE.
void ewl_icon_editable_set | ( | Ewl_Icon * | icon, | |
unsigned int | e | |||
) |
Set if the icon is editable or not.
- Parameters:
-
icon,: The icon to set if it is editable or not e,: The value to set as the editable flag
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, editable, ewl_callback_append(), ewl_callback_del(), EWL_CALLBACK_MOUSE_DOWN, EWL_ICON_TYPE, and label.
Referenced by ewl_icon_simple_new().
Ewl_Widget* ewl_icon_extended_data_get | ( | Ewl_Icon * | icon | ) |
Retrieve the extended data from the icon.
- Parameters:
-
icon,: The icon to get the extended data from
- Returns:
- Returns the extended data on the icon, or NULL if none set
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON_TYPE, and extended.
void ewl_icon_extended_data_set | ( | Ewl_Icon * | icon, | |
Ewl_Widget * | ext | |||
) |
Set the extended data into the icon.
- Parameters:
-
icon,: The icon to set the extended data into ext,: The extended data to set in the icon
- Returns:
- Returns no value
- Note:
- The widget passed in here becomes internal to the icon, you should not delete it after this. You can pack widgets as needed but the icon will handle the show/hide of the widget after this
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTAINER, ewl_container_child_append(), EWL_ICON_TYPE, EWL_ICON_TYPE_SHORT, ewl_widget_destroy(), ewl_widget_hide(), ewl_widget_internal_set(), ewl_widget_show(), extended, and type.
Referenced by ewl_filelist_selected_file_preview_get().
const char* ewl_icon_image_file_get | ( | Ewl_Icon * | icon | ) |
Retrieve the image to used in the icon.
- Parameters:
-
icon,: The Ewl_Icon to get the image file from
- Returns:
- Returns the image file associated with this icon, or NULL if none.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON_TYPE, EWL_IMAGE, ewl_image_file_path_get(), and image.
Referenced by ewl_icon_alt_text_set().
void ewl_icon_image_set | ( | Ewl_Icon * | icon, | |
const char * | file, | |||
const char * | key | |||
) |
set the image to use in the icon
- Parameters:
-
icon,: The Ewl_Icon to set the image into file,: The file with the image key,: The key inside the file if applicable
- Returns:
- Returns no value
References alt, constrain, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_callback_append(), EWL_CALLBACK_VALUE_CHANGED, EWL_CONTAINER, ewl_container_child_prepend(), EWL_FLAG_ALIGN_CENTER, ewl_icon_constrain_set(), EWL_ICON_IMAGE_LOADING, EWL_ICON_PART_IMAGE, ewl_icon_theme_icon_path_get(), EWL_ICON_TYPE, EWL_IMAGE, ewl_image_file_set(), ewl_image_new(), ewl_image_proportional_set(), ewl_image_thumbnail_get(), EWL_OBJECT, ewl_object_alignment_set(), ewl_widget_destroy(), ewl_widget_internal_set(), ewl_widget_show(), hidden, image, and thumbnailing.
Referenced by ewl_calendar_init(), ewl_filelist_view_widget_fetch(), and ewl_filepicker_init().
int ewl_icon_init | ( | Ewl_Icon * | icon | ) |
Initializes the given Ewl_Icon widget.
- Parameters:
-
icon,: The widget to initialize
- Returns:
- Returns TRUE on successful initialization, FALSE otherwise
References complex_label, constrain, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_orientation_set(), ewl_box_spacing_set(), EWL_CALLBACK_DESTROY, ewl_callback_prepend(), EWL_FLAG_FILL_NONE, ewl_icon_cb_destroy(), EWL_ICON_TYPE, EWL_OBJECT, ewl_object_fill_policy_set(), EWL_ORIENTATION_VERTICAL, EWL_STOCK, ewl_stock_functions_set(), ewl_stock_init(), EWL_STOCK_NONE, ewl_stock_type_set(), EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_inherit(), and thumbnailing.
Referenced by ewl_icon_new().
unsigned int ewl_icon_label_complex_get | ( | Ewl_Icon * | icon | ) |
Retrieve if the icon has a complex label or not.
- Parameters:
-
icon,: The icon to check if its label is complex
- Returns:
- Returns TRUE if the label is complex, FALSE otherwise
References complex_label, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_ICON_TYPE.
void ewl_icon_label_complex_set | ( | Ewl_Icon * | icon, | |
unsigned int | c | |||
) |
Set if the icon use a label or a text widget for the label part.
- Parameters:
-
icon,: The icon to set if it has a complex label or not c,: The value to set as the complex flag
- Returns:
- Returns no value.
References complex_label, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_TYPE, ewl_widget_destroy(), and label.
Referenced by ewl_icon_simple_new().
unsigned int ewl_icon_label_compressed_get | ( | Ewl_Icon * | icon | ) |
Retrieves the current compressiion setting for the icon.
- Parameters:
-
icon,: The ewl_icon to work with
- Returns:
- Returns the current compression setting for the icon
References compress_label, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_ICON_TYPE.
void ewl_icon_label_compressed_set | ( | Ewl_Icon * | icon, | |
unsigned int | compress | |||
) |
Sets the compressions setting for the icon to the given value.
- Parameters:
-
icon,: The icon to work with compress,: The compression setting to use
- Returns:
- Returns no value
References compress_label, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, and EWL_ICON_TYPE.
Referenced by ewl_icon_simple_new().
const char* ewl_icon_label_get | ( | Ewl_Icon * | icon | ) |
Retrieve the label from the icon.
- Parameters:
-
icon,: The icon to get the label from
- Returns:
- Returns the icons label or NULL if none set
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON_TYPE, label, and label_text.
void ewl_icon_label_set | ( | Ewl_Icon * | icon, | |
const char * | label | |||
) |
Set the label of the icon.
- Parameters:
-
icon,: The icon to set the label onto label,: The label to set on the icon
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_TYPE, IF_FREE, label, and label_text.
Referenced by ewl_filelist_multi_select_preview_get(), ewl_filelist_selected_file_preview_get(), and ewl_filelist_view_widget_fetch().
Ewl_Widget* ewl_icon_new | ( | void | ) |
Creates and initializes a new Ewl_Icon widget.
- Returns:
- Returns a new Ewl_Icon widget, or NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON, ewl_icon_init(), ewl_widget_destroy(), and NEW.
Referenced by ewl_calendar_init(), ewl_filelist_selected_file_preview_get(), ewl_filepicker_init(), and ewl_icon_simple_new().
void ewl_icon_part_hide | ( | Ewl_Icon * | icon, | |
Ewl_Icon_Part | part | |||
) |
Hide the given part of the icon. Note: You can only hide one part.
- Parameters:
-
icon,: The icon to set the part to hide of part,: The part to hide
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_TYPE, and hidden.
Referenced by ewl_toolbar_cb_child_add(), and ewl_toolbar_icon_part_hide().
Ewl_Widget* ewl_icon_simple_new | ( | void | ) |
Creates and initializes a new Ewl_Icon widget.
- Returns:
- Returns a new Ewl_Icon widget, or NULL on failure The difference to ewl_icon_new() is that it has lighter default values. The defaults are complex_label: no compressed_label: no editable: no thumbnailing: no
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ICON, ewl_icon_editable_set(), ewl_icon_label_complex_set(), ewl_icon_label_compressed_set(), ewl_icon_new(), and ewl_icon_thumbnailing_set().
Referenced by ewl_filelist_multi_select_preview_get(), and ewl_filelist_view_widget_fetch().
unsigned int ewl_icon_thumbnailing_get | ( | Ewl_Icon * | icon | ) |
Retrieve if the icon use thumbnailing.
- Parameters:
-
icon,: The icon to check if it's thumbnails the image
- Returns:
- Returns TRUE if the label use thumbnailing, FALSE otherwise
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_ICON_TYPE, and thumbnailing.
void ewl_icon_thumbnailing_set | ( | Ewl_Icon * | icon, | |
unsigned int | t | |||
) |
Set if the icon thumbnailed the image or use it directly.
- Parameters:
-
icon,: The icon to set if the image gets thumbnailed t,: The value to set as the thumbnail flag
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_TYPE, and thumbnailing.
Referenced by ewl_icon_simple_new().
Ewl_Icon_Type ewl_icon_type_get | ( | Ewl_Icon * | icon | ) |
Retrieve the type of the icon.
- Parameters:
-
icon,: The icon to get the type from
- Returns:
- Returns the Ewl_Icon_Type of the icon
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_ICON_TYPE, EWL_ICON_TYPE_SHORT, and type.
void ewl_icon_type_set | ( | Ewl_Icon * | icon, | |
Ewl_Icon_Type | type | |||
) |
Set the type of the icon.
- Parameters:
-
icon,: The icon to set the type of type The type to set on this icon
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_TYPE, EWL_ICON_TYPE_SHORT, ewl_widget_hide(), ewl_widget_show(), extended, and type.
Referenced by ewl_filelist_selected_file_preview_get().