Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Widget: The Parent Widget Class Common to All Widgets

Defines the Ewl_Widget class and it's accessor/modifier functions. More...

Data Structures

struct  Ewl_Widget
 The class inheriting from Ewl_Object that provides appearance, parent, and callback capabilities. More...

struct  Ewl_Widget
 The class inheriting from Ewl_Object that provides appearance, parent, and callback capabilities. More...


Defines

#define EWL_WIDGET(widget)   ((Ewl_Widget *) widget)
 Typecast a pointer to an Ewl_Widget pointer.

#define LAYER(w)   EWL_WIDGET(w)->layer
 Used to retrieve the layer of a widget.


Typedefs

typedef Ewl_Widget Ewl_Widget
 The class that all widgets should inherit.


Functions

int ewl_widget_init (Ewl_Widget *w, char *appearance)
 Initialize a widget to default values and callbacks.

void ewl_widget_reparent (Ewl_Widget *widget)
 initiate reparent of the specified widget

void ewl_widget_realize (Ewl_Widget *widget)
 Realize the specified widget.

void ewl_widget_unrealize (Ewl_Widget *w)
 Unrealize the specified widget.

void ewl_widget_show (Ewl_Widget *widget)
 mark a widget as visible

void ewl_widget_hide (Ewl_Widget *widget)
 Mark a widget as invisible.

void ewl_widget_destroy (Ewl_Widget *widget)
 Destroy the specified widget.

void ewl_widget_configure (Ewl_Widget *widget)
 Initiate configuring of the specified widget.

void ewl_widget_theme_update (Ewl_Widget *w)
 Initiate theme update of the specified widget.

void ewl_widget_data_set (Ewl_Widget *w, void *k, void *v)
 Attach the specified key / value pair to the widget.

void ewl_widget_data_del (Ewl_Widget *w, void *k)
 Remove the specified key / value pair from the widget.

void * ewl_widget_data_get (Ewl_Widget *w, void *k)
 retrieve the specified key / value pair from the widget

void ewl_widget_state_set (Ewl_Widget *w, char *state)
 Update the appearance of the widget to a state.

void ewl_widget_appearance_set (Ewl_Widget *w, char *appearance)
 Change the appearance of the specified widget.

char * ewl_widget_appearance_get (Ewl_Widget *w)
 Retrieve the appearance key of the widget.

char * ewl_widget_appearance_single_get (Ewl_Widget *w)
 Retrieve the last element of the appearance key of the widget.

void ewl_widget_inherit (Ewl_Widget *widget, char *type)
 Appends the given inheritance to this widgets inheritance string.

unsigned int ewl_widget_type_is (Ewl_Widget *widget, char *type)
 Determine if the widget w has inherited from the type t.

void ewl_widget_parent_set (Ewl_Widget *w, Ewl_Widget *p)
 change the parent of the specified widget

void ewl_widget_enable (Ewl_Widget *w)
 Re-enable a disabled widget.

void ewl_widget_disable (Ewl_Widget *w)
 Prevent a widget from receiving any events.

void ewl_widget_print (Ewl_Widget *w)
 Prints info for debugging a widget's state information.

int ewl_widget_layer_sum_get (Ewl_Widget *w)
 Sums the layers of a widgets parents to determine it's absolute layer.

void ewl_widget_layer_set (Ewl_Widget *w, int layer)
 Set the relative layer to it's parent.

int ewl_widget_layer_get (Ewl_Widget *w)
 Retrieve a widgets layer relative to it's parent.

void ewl_widget_internal_set (Ewl_Widget *w, unsigned int val)
 Marks a widget as one used internally to another container.

unsigned int ewl_widget_internal_is (Ewl_Widget *w)
 Checks the widget for the internal flag.

void ewl_widget_clipped_set (Ewl_Widget *w, unsigned int val)
 Marks whether the widget should be clipped at it's boundaries.

unsigned int ewl_widget_clipped_is (Ewl_Widget *w)
 Checks if a widget clips it's theme object.

void ewl_widget_focus_send (Ewl_Widget *w)
 Changes the keyboard focus to the widget w.

Ewl_Widgetewl_widget_focused_get (void)
 Retrieve the currently focused widget.

void ewl_widget_tab_order_push (Ewl_Widget *w)
 Changes the order in the embed so w receives focus first on tab.


Detailed Description

Defines the Ewl_Widget class and it's accessor/modifier functions.

The Ewl_Widget extends the Ewl_Object to provide the basic facilities necessary for widgets to interact with the end user. This includes basic callbacks for input events, window information changes, and drawing to the display.


Typedef Documentation

typedef struct Ewl_Widget Ewl_Widget
 

The class that all widgets should inherit.

Provides reference to a parent widget/container, callbacks, and appearance information.


Function Documentation

char* ewl_widget_appearance_get Ewl_Widget w  ) 
 

Retrieve the appearance key of the widget.

Parameters:
w: the widget to retrieve the appearance key
Returns:
Returns a pointer to the appearance key string on success, NULL on failure.

void ewl_widget_appearance_set Ewl_Widget w,
char *  appearance
 

Change the appearance of the specified widget.

Parameters:
w: the widget to change the appearance
appearance: the new key for the widgets appearance
Returns:
Returns no value.
Changes the key associated with the widgets appearance and calls the theme update callback to initiate the change.

char* ewl_widget_appearance_single_get Ewl_Widget w  ) 
 

Retrieve the last element of the appearance key of the widget.

Parameters:
w: the widget to retrieve the appearance key
Returns:
Returns a pointer to the last element of the appearance key string on success, NULL on failure.

unsigned int ewl_widget_clipped_is Ewl_Widget w  ) 
 

Checks if a widget clips it's theme object.

Parameters:
w: the widget to check if it clips it's theme object
Returns:
Returns TRUE if the widget clips, otherwise FALSE.

void ewl_widget_clipped_set Ewl_Widget w,
unsigned int  val
 

Marks whether the widget should be clipped at it's boundaries.

Parameters:
w: the widget to mark as unclipped
val: the state of the clipping flag
Returns:
Returns no value.

void ewl_widget_configure Ewl_Widget w  ) 
 

Initiate configuring of the specified widget.

Parameters:
w: the widget to configure
Returns:
Returns no value.
The configure callback is triggered for the specified widget, this should adjust the widgets size and position.

void ewl_widget_data_del Ewl_Widget w,
void *  k
 

Remove the specified key / value pair from the widget.

Parameters:
w: the widget that owns the key value pair
k: the key that is associated with the data
Returns:
Returns no value.
Removes a key / value pair with k as the key from the specified widget w.

void* ewl_widget_data_get Ewl_Widget w,
void *  k
 

retrieve the specified key / value pair from the widget

Parameters:
w: the widget that owns the key value pair
k: the key that is associated with the data
Returns:
Returns the value associated with k on success, NULL on failure.
Retrieves a key / value pair with k as the key from the specified widget w.

void ewl_widget_data_set Ewl_Widget w,
void *  k,
void *  v
 

Attach the specified key / value pair to the widget.

Parameters:
w: the widget to own the key value pair
k: the key that is associated with the data
v: the data that is to be tracked
Returns:
Returns no value.
Assigns a key / value pair with k as the key and v as the value to the specified widget w.

void ewl_widget_destroy Ewl_Widget w  ) 
 

Destroy the specified widget.

Parameters:
w: the widget to be destroyed
Returns:
Returns no value.
The widget calls it's destroy callback to do any clean up necessary and then free's the widget.

void ewl_widget_disable Ewl_Widget w  ) 
 

Prevent a widget from receiving any events.

Parameters:
w: the widget to disable
Returns:
Returns no value. Disables a specified widget.
This prevents that widget from receiving any user input events.

void ewl_widget_enable Ewl_Widget w  ) 
 

Re-enable a disabled widget.

Parameters:
w: the widget to re-enable
Returns:
Returns no value.
Re-enables a previously disabled widget.

void ewl_widget_focus_send Ewl_Widget w  ) 
 

Changes the keyboard focus to the widget w.

Parameters:
w: the widget to receive keyboard focus
Returns:
Returns no value.

Ewl_Widget* ewl_widget_focused_get void   ) 
 

Retrieve the currently focused widget.

Returns:
Returns the currnetly focused widget.

void ewl_widget_hide Ewl_Widget w  ) 
 

Mark a widget as invisible.

Parameters:
w: the widget to be marked as invisible
Returns:
Returns no value.
Marks the widget as invisible so that it will not be displayed the next time through the rendering loop.

void ewl_widget_inherit Ewl_Widget widget,
char *  inherit
 

Appends the given inheritance to this widgets inheritance string.

Parameters:
widget: the widget to set the inheritance on
inherit: the string to append to the inheritance
Returns:
Returns no value.

int ewl_widget_init Ewl_Widget w,
char *  appearance
 

Initialize a widget to default values and callbacks.

Parameters:
w: the widget to initialize
appearance: the key for the widgets theme appearance
Returns:
Returns TRUE on success, FALSE on failure.
The widget w is initialized to default values and is assigned the default callbacks. The appearance key is assigned for easy access to theme information.

unsigned int ewl_widget_internal_is Ewl_Widget w  ) 
 

Checks the widget for the internal flag.

Parameters:
w: the widget to query the state of the internal flag
Returns:
Returns TRUE if the widget is marked internal, otherwise FALSE.

void ewl_widget_internal_set Ewl_Widget w,
unsigned int  val
 

Marks a widget as one used internally to another container.

Parameters:
w: the widget to mark as internally used
val: a boolean to indicate the state of the internal flag
Returns:
Returns no value.
Indicate whether a widget is to be used as an internal decoration on another widget. This allows for using some of the standard container functions to access the contents of complex widgets w/o fear of damaging internal layout structure.

int ewl_widget_layer_get Ewl_Widget w  ) 
 

Retrieve a widgets layer relative to it's parent.

Parameters:
w: the widget to retrieve current relative layer
Returns:
Returns a widgets current layer relative to it's parent.

void ewl_widget_layer_set Ewl_Widget w,
int  layer
 

Set the relative layer to it's parent.

Parameters:
w: the widget to change relative layers
layer: the new relative layer of the widget
Returns:
Returns no value.
Changes the current layer of w relative to it's parent. The default value is 5.

int ewl_widget_layer_sum_get Ewl_Widget w  ) 
 

Sums the layers of a widgets parents to determine it's absolute layer.

Parameters:
w: the widget to retrieve sum of layers
Returns:
Returns the absolute layer the widget is placed on.

void ewl_widget_parent_set Ewl_Widget w,
Ewl_Widget p
 

change the parent of the specified widget

Parameters:
w: the widget to change the parent
p: the new parent of the widget
Returns:
Returns no value.
Changes the parent of the widget w, to the container p. The reparent callback is triggered to notify children of w of the change in parent.

void ewl_widget_print Ewl_Widget w  ) 
 

Prints info for debugging a widget's state information.

Parameters:
w: the widget to print info
Returns:
Returs no value.

void ewl_widget_realize Ewl_Widget w  ) 
 

Realize the specified widget.

Parameters:
w: the widget to realize
Returns:
Returns no value.
The specified widget is realized, ie. actually displayed to the screen.

void ewl_widget_reparent Ewl_Widget w  ) 
 

initiate reparent of the specified widget

Parameters:
w: the widget to reparent
Returns:
Returns no value.
The reparent callback is triggered for the specified widget, this should adjust the widgets attributes based on the new parent.

void ewl_widget_show Ewl_Widget w  ) 
 

mark a widget as visible

Parameters:
w: the widget to be marked as visible
Returns:
Returns no value.
Marks the widget as visible so that it will be displayed the next time through the rendering loop. Note that the show callback may be delayed until the widget has been realized.

void ewl_widget_state_set Ewl_Widget w,
char *  state
 

Update the appearance of the widget to a state.

Parameters:
w: the widget to update the appearance
state: the new state of the widget
Returns:
Returns no value.
Changes the appearance of the widget depending on the state string passed by the state parameter.

void ewl_widget_tab_order_push Ewl_Widget w  ) 
 

Changes the order in the embed so w receives focus first on tab.

Parameters:
w: the widget to be moved to the front of the focus list
Returns:
Returns no value.
This moves the widget w to the front of the tab order list in the embed that holds it. This is the recommended method for manipulating tab order, The embed versions should only be accessed internally if you understand their ramifications.

void ewl_widget_theme_update Ewl_Widget w  ) 
 

Initiate theme update of the specified widget.

Parameters:
w: the widget to update the theme
Returns:
Returns no value.
The theme update callback is triggered for the specified widget, this should adjust the widgets appearance.

unsigned int ewl_widget_type_is Ewl_Widget widget,
char *  type
 

Determine if the widget w has inherited from the type t.

Parameters:
widget: the widget to determine if a type is inherited
type: the type to check for inheritance in the widget
Returns:
Returns TRUE if w inherited the type t, otherwise FALSE.

void ewl_widget_unrealize Ewl_Widget w  ) 
 

Unrealize the specified widget.

Parameters:
w: the widget to unrealize
Returns:
Returns no value.
The specified widget is unrealized, ie. no longer displayed to the screen.