Ewl_Text_Trigger: References portions of the
Detailed Description
Defines a class for triggering actions within the text.text that respond to actions.
- Remarks:
- Inherits from Ewl_Widget.
Data Structures | |
struct | Ewl_Text_Trigger |
Inherits from Ewl_Widget and extends to provide a trigger for the text widget. More... | |
Defines | |
#define | EWL_TEXT_TRIGGER(trigger) ((Ewl_Text_Trigger *) trigger) |
#define | EWL_TEXT_TRIGGER_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_TEXT_TRIGGER_TYPE)) |
#define | EWL_TEXT_TRIGGER_TYPE "trigger" |
Typedefs | |
typedef struct Ewl_Text_Trigger | Ewl_Text_Trigger |
Functions | |
void | ewl_text_trigger_area_add (Ewl_Text *t, Ewl_Text_Trigger *cur, int x, int y, int w, int h) |
Creates a trigger area at the given co-ordinates. | |
void | ewl_text_trigger_areas_cleanup (Ewl_Text_Trigger *trig) |
Cleans up the trigger areas for trig. | |
unsigned int | ewl_text_trigger_base_get (Ewl_Text_Trigger *t) |
Retrieves the current base position of the cursor. | |
void | ewl_text_trigger_base_set (Ewl_Text_Trigger *t, unsigned int char_pos) |
Sets the given position pos as the base for the trigger t. | |
void | ewl_text_trigger_cb_configure (Ewl_Widget *w, void *ev, void *data) |
Configures the areas associated with trig. | |
void | ewl_text_trigger_cb_hide (Ewl_Widget *w, void *ev, void *data) |
Hides the trigger. | |
void | ewl_text_trigger_cb_show (Ewl_Widget *w, void *ev, void *data) |
Shows the trigger. | |
void | ewl_text_trigger_cb_unrealize (Ewl_Widget *w, void *ev, void *data) |
Unrealizes the trigger. | |
int | ewl_text_trigger_init (Ewl_Text_Trigger *trigger, Ewl_Text_Trigger_Type type) |
Initializes a trigger to default values. | |
unsigned int | ewl_text_trigger_length_get (Ewl_Text_Trigger *t) |
Retrieves the length from the cursor t. | |
void | ewl_text_trigger_length_set (Ewl_Text_Trigger *t, unsigned int char_len) |
Sets the length len on the trigger t. | |
Ewl_Widget * | ewl_text_trigger_new (Ewl_Text_Trigger_Type type) |
Creates a new trigger for the text object. | |
unsigned int | ewl_text_trigger_start_pos_get (Ewl_Text_Trigger *t) |
Retrieves the start position of the trigger. | |
void | ewl_text_trigger_start_pos_set (Ewl_Text_Trigger *t, unsigned int char_pos) |
Sets the start position of the trigger t to position pos. | |
Ewl_Text_Trigger_Type | ewl_text_trigger_type_get (Ewl_Text_Trigger *t) |
Retrieves the type of the trigger. |
Define Documentation
#define EWL_TEXT_TRIGGER | ( | trigger | ) | ((Ewl_Text_Trigger *) trigger) |
Typecasts a pointer to an Ewl_Text_Trigger pointer
Referenced by ewl_entry_selection_clear(), ewl_text_cb_child_add(), ewl_text_cb_child_remove(), ewl_text_cb_mouse_down(), ewl_text_cb_mouse_move(), ewl_text_cb_mouse_up(), ewl_text_select(), ewl_text_selection_get(), ewl_text_selection_text_get(), ewl_text_trigger_cb_configure(), ewl_text_trigger_cb_destroy(), ewl_text_trigger_cb_hide(), ewl_text_trigger_cb_show(), and ewl_text_trigger_cb_unrealize().
#define EWL_TEXT_TRIGGER_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_TEXT_TRIGGER_TYPE)) |
Returns TRUE if the widget is an Ewl_Text_Trigger, FALSE otherwise
Referenced by ewl_text_cb_child_add(), and ewl_text_cb_child_remove().
#define EWL_TEXT_TRIGGER_TYPE "trigger" |
The type name for the Ewl_Text_Trigger widget
Referenced by ewl_text_trigger_area_add(), ewl_text_trigger_areas_cleanup(), ewl_text_trigger_base_get(), ewl_text_trigger_base_set(), ewl_text_trigger_cb_configure(), ewl_text_trigger_cb_destroy(), ewl_text_trigger_cb_hide(), ewl_text_trigger_cb_show(), ewl_text_trigger_cb_unrealize(), ewl_text_trigger_init(), ewl_text_trigger_length_get(), ewl_text_trigger_length_set(), ewl_text_trigger_start_pos_get(), ewl_text_trigger_start_pos_set(), and ewl_text_trigger_type_get().
Typedef Documentation
typedef struct Ewl_Text_Trigger Ewl_Text_Trigger |
A trigger in the text, used for selections and clickable text
Function Documentation
void ewl_text_trigger_area_add | ( | Ewl_Text * | t, | |
Ewl_Text_Trigger * | cur, | |||
int | x, | |||
int | y, | |||
int | w, | |||
int | h | |||
) |
Creates a trigger area at the given co-ordinates.
- Parameters:
-
t,: The Ewl_Text parent cur,: The trigger to work with x,: The x position y,: The y position w,: The width h,: The height
- Returns:
- Returns no value
References areas, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_OBJECT, ewl_object_geometry_request(), EWL_TEXT_TRIGGER_AREA, EWL_TEXT_TRIGGER_TYPE, EWL_TEXT_TYPE, ewl_widget_show(), and type.
void ewl_text_trigger_areas_cleanup | ( | Ewl_Text_Trigger * | trig | ) |
Cleans up the trigger areas for trig.
- Parameters:
-
trig,: The trigger to work with
- Returns:
- Returns no value
References areas, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_TEXT_TRIGGER_TYPE, and text_parent.
Referenced by ewl_text_cb_child_remove(), ewl_text_cb_mouse_down(), ewl_text_trigger_cb_unrealize(), and ewl_text_trigger_length_set().
unsigned int ewl_text_trigger_base_get | ( | Ewl_Text_Trigger * | t | ) |
Retrieves the current base position of the cursor.
- Parameters:
-
t,: The trigger to work with
- Returns:
- Returns the current base position of the cursor
References char_base, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_TEXT_TRIGGER_TYPE.
void ewl_text_trigger_base_set | ( | Ewl_Text_Trigger * | t, | |
unsigned int | char_pos | |||
) |
Sets the given position pos as the base for the trigger t.
- Parameters:
-
t,: The trigger to work with char_pos,: The position to set as the base for the cursor
- Returns:
- Returns no value
References char_base, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_text_cb_mouse_down().
void ewl_text_trigger_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
Configures the areas associated with trig.
- Parameters:
-
w,: The trigger to work with ev,: UNUSED data,: UNUSED
- Returns:
- Returns no value
References areas, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_TEXT_TRIGGER, EWL_TEXT_TRIGGER_TYPE, EWL_WIDGET, and ewl_widget_configure().
Referenced by ewl_text_trigger_init().
void ewl_text_trigger_cb_hide | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
Hides the trigger.
- Parameters:
-
w,: The trigger to work with ev,: UNUSED data,: UNUSED
- Returns:
- Returns no value
References areas, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_TEXT_TRIGGER, EWL_TEXT_TRIGGER_TYPE, and ewl_widget_hide().
Referenced by ewl_text_trigger_init().
void ewl_text_trigger_cb_show | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
Shows the trigger.
- Parameters:
-
w,: The trigger to work with ev,: UNUSED data,: UNUSED
- Returns:
- Returns no value
References areas, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_TEXT_TRIGGER, EWL_TEXT_TRIGGER_TYPE, and ewl_widget_show().
Referenced by ewl_text_trigger_init().
void ewl_text_trigger_cb_unrealize | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
Unrealizes the trigger.
- Parameters:
-
w,: The trigger to work with ev,: UNUSED data,: UNUSED
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_TEXT_TRIGGER, ewl_text_trigger_areas_cleanup(), and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_text_trigger_init().
int ewl_text_trigger_init | ( | Ewl_Text_Trigger * | trigger, | |
Ewl_Text_Trigger_Type | type | |||
) |
Initializes a trigger to default values.
- Parameters:
-
trigger,: The trigger to initialize type,: The type of the triger
- Returns:
- Returns TRUE if successful of FALSE otherwise
References areas, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CONFIGURE, EWL_CALLBACK_DESTROY, EWL_CALLBACK_HIDE, ewl_callback_prepend(), EWL_CALLBACK_SHOW, EWL_CALLBACK_UNREALIZE, EWL_TEXT_SELECTION_TYPE, ewl_text_trigger_cb_configure(), ewl_text_trigger_cb_destroy(), ewl_text_trigger_cb_hide(), ewl_text_trigger_cb_show(), ewl_text_trigger_cb_unrealize(), EWL_TEXT_TRIGGER_TYPE, EWL_TEXT_TRIGGER_TYPE_SELECTION, EWL_TEXT_TRIGGER_TYPE_TRIGGER, EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_focusable_set(), ewl_widget_inherit(), ewl_widget_init(), ewl_widget_internal_set(), and type.
Referenced by ewl_text_trigger_new().
unsigned int ewl_text_trigger_length_get | ( | Ewl_Text_Trigger * | t | ) |
Retrieves the length from the cursor t.
- Parameters:
-
t,: The trigger to work with
- Returns:
- Returns the length of the trigger
References char_len, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_entry_selection_clear(), and ewl_text_selection_get().
void ewl_text_trigger_length_set | ( | Ewl_Text_Trigger * | t, | |
unsigned int | char_len | |||
) |
Sets the length len on the trigger t.
- Parameters:
-
t,: The trigger to work with char_len,: The length to set on the cursor
- Returns:
- Returns no value
References char_len, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_text_trigger_areas_cleanup(), and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_entry_selection_clear(), ewl_text_cb_mouse_down(), and ewl_text_select().
Ewl_Widget* ewl_text_trigger_new | ( | Ewl_Text_Trigger_Type | type | ) |
Creates a new trigger for the text object.
- Parameters:
-
type,: The type of trigger to create
- Returns:
- Returns a new ewl_text_trigger widget
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_text_trigger_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.
unsigned int ewl_text_trigger_start_pos_get | ( | Ewl_Text_Trigger * | t | ) |
Retrieves the start position of the trigger.
- Parameters:
-
t,: The trigger to work with
- Returns:
- Returns the current start position of the trigger
References char_pos, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_entry_selection_clear().
void ewl_text_trigger_start_pos_set | ( | Ewl_Text_Trigger * | t, | |
unsigned int | char_pos | |||
) |
Sets the start position of the trigger t to position pos.
- Parameters:
-
t,: The trigger to work with char_pos,: The position to set
- Returns:
- Returns no value
References char_pos, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, and EWL_TEXT_TRIGGER_TYPE.
Referenced by ewl_text_cb_mouse_down(), and ewl_text_select().
Ewl_Text_Trigger_Type ewl_text_trigger_type_get | ( | Ewl_Text_Trigger * | t | ) |
Retrieves the type of the trigger.
- Parameters:
-
t,: The trigger to work with
- Returns:
- Returns the type of the trigger
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_TEXT_TRIGGER_TYPE, EWL_TEXT_TRIGGER_TYPE_NONE, and type.