Download

Support

Ewl_Stock: The Stock


Detailed Description

The stock class is an abstact class to provide the stock feature of buttons and icons in a common place. This class inherits from the Ewl_Box to allow for placing any other widget inside the stock.

Remarks:
Inherits from Ewl_Box.


Data Structures

struct  Ewl_Stock
 Inherits from Ewl_Box and provides the base for the other stock icons. More...
struct  Ewl_Stock_Funcs
 The function callbacks that an inheriting widget needs to implement. More...

Defines

#define EWL_STOCK(stock)   ((Ewl_Stock *) stock)
#define EWL_STOCK_IMAGE_SET(f)   ((Ewl_Stock_Image_Set)f)
#define EWL_STOCK_IS(w)   (ewl_widget_type_is(EWL_WIDGET(w), EWL_STOCK_TYPE))
#define EWL_STOCK_LABEL_SET(f)   ((Ewl_Stock_Label_Set)f)
#define EWL_STOCK_TOOLTIP_SET(f)   ((Ewl_Stock_Tooltip_set)f)
#define EWL_STOCK_TYPE   "stock"

Typedefs

typedef struct Ewl_Stock Ewl_Stock
typedef struct Ewl_Stock_Funcs Ewl_Stock_Funcs
typedef void(* Ewl_Stock_Image_Set )(Ewl_Stock *s, const char *file, const char *key)
typedef void(* Ewl_Stock_Label_Set )(Ewl_Stock *s, const char *txt)
typedef void(* Ewl_Stock_Tooltip_Set )(Ewl_Stock *s, const char *tip)

Functions

void ewl_stock_functions_set (Ewl_Stock *s, const Ewl_Stock_Funcs *const funcs)
int ewl_stock_init (Ewl_Stock *s)
 Initialize the stock widget and inherited fields.
Ewl_Stock_Type ewl_stock_type_get (Ewl_Stock *s)
 Get the stock type in use.
void ewl_stock_type_set (Ewl_Stock *s, Ewl_Stock_Type stock)
 Set the type of the stock to use.

Define Documentation

#define EWL_STOCK ( stock   )     ((Ewl_Stock *) stock)

#define EWL_STOCK_IMAGE_SET (  )     ((Ewl_Stock_Image_Set)f)

Typecasts a pointer to an image set pointer

#define EWL_STOCK_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_STOCK_TYPE))

Returns TRUE if the widget is an Ewl_Stock, FALSE otherwise

#define EWL_STOCK_LABEL_SET (  )     ((Ewl_Stock_Label_Set)f)

Typecasts a pointer to a label set pointer

#define EWL_STOCK_TOOLTIP_SET (  )     ((Ewl_Stock_Tooltip_set)f)

Typecast to the tooltip set pointer

#define EWL_STOCK_TYPE   "stock"


Typedef Documentation

typedef struct Ewl_Stock Ewl_Stock

The stock structure.

typedef void(* Ewl_Stock_Image_Set)(Ewl_Stock *s, const char *file, const char *key)

The image set function definition

typedef void(* Ewl_Stock_Label_Set)(Ewl_Stock *s, const char *txt)

The label set function definition

typedef void(* Ewl_Stock_Tooltip_Set)(Ewl_Stock *s, const char *tip)

The tooltip set function definition


Function Documentation

void ewl_stock_functions_set ( Ewl_Stock s,
const Ewl_Stock_Funcs *const   funcs 
)

int ewl_stock_init ( Ewl_Stock s  ) 

Initialize the stock widget and inherited fields.

Parameters:
s,: the stock widget to initialize
Returns:
Returns TRUE on success, FALSE on failure. Clears the contents of the stock widget and stores the default values.

References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_init(), EWL_STOCK_TYPE, EWL_WIDGET, and ewl_widget_inherit().

Referenced by ewl_button_init(), and ewl_icon_init().

Ewl_Stock_Type ewl_stock_type_get ( Ewl_Stock s  ) 

Get the stock type in use.

Parameters:
s,: The stock widget to get the stock type from
Returns:
Returns the Ewl_Stock_Type of the stock widget

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_STOCK_NONE, EWL_STOCK_TYPE, and stock_type.

Referenced by ewl_colordialog_cb_button_click().

void ewl_stock_type_set ( Ewl_Stock s,
Ewl_Stock_Type  stock 
)

Set the type of the stock to use.

Parameters:
s,: The stock to set the stock type on
stock,: The Ewl_Stock_Type to set on the stock widget
Returns:
Returns no value.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_ICON_SIZE_MEDIUM, ewl_icon_theme_icon_path_get(), ewl_stock_items, EWL_STOCK_NONE, EWL_STOCK_TYPE, Ewl_Stock_Funcs::image_set, Ewl_Stock_Funcs::label_set, stock_funcs, stock_type, and Ewl_Stock_Funcs::tooltip_set.

Referenced by ewl_button_init(), ewl_colordialog_init(), ewl_filepicker_init(), and ewl_icon_init().


Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sat May 17 16:51:11 2008