Functions that deal with the freezing of input event processing of an Evas canvas. More...
Functions | |
void | evas_event_default_flags_set (Evas *e, Evas_Event_Flags flags) |
Set the default set of flags an event begins with. | |
Evas_Event_Flags | evas_event_default_flags_get (const Evas *e) |
Get the defaulty set of flags an event begins with. | |
void | evas_event_freeze (Evas *e) |
Freeze all input events processing. | |
void | evas_event_thaw (Evas *e) |
Thaw a canvas out after freezing (for input events). | |
int | evas_event_freeze_get (const Evas *e) |
Return the freeze count on input events of a given canvas. | |
void | evas_event_thaw_eval (Evas *e) |
After thaw of a canvas, re-evaluate the state of objects and call callbacks. |
Detailed Description
Functions that deal with the freezing of input event processing of an Evas canvas.
There might be scenarios during a graphical user interface program's use when the developer wishes the users wouldn't be able to deliver input events to this application. It may, for example, be the time for it to populate a view or to change some layout. Assuming proper behavior with user interaction during this exact time would be hard, as things are in a changing state. The programmer can then tell the canvas to ignore input events, bringing it back to normal behavior when he/she wants.
Most of the time use of freezing events is done like this:
Some of the functions in this group are exemplified here.
Function Documentation
Evas_Event_Flags evas_event_default_flags_get | ( | const Evas * | e | ) |
Get the defaulty set of flags an event begins with.
- Parameters
-
e The canvas to get the default event flags from
- Returns
- The default event flags for that canvas
This gets the default event flags events are produced with when fed in.
- See Also
- evas_event_default_flags_set()
- Since
- 1.2
References EVAS_EVENT_FLAG_ON_HOLD.
void evas_event_default_flags_set | ( | Evas * | e, |
Evas_Event_Flags | flags | ||
) |
Set the default set of flags an event begins with.
- Parameters
-
e The canvas to set the default event flags of flags The default flags to use
Events in evas can have an event_flags member. This starts out with and initial value (no flags). this lets you set the default flags that an event begins with to be flags
- Since
- 1.2
void evas_event_freeze | ( | Evas * | e | ) |
Freeze all input events processing.
- Parameters
-
e The canvas to freeze input events processing on.
This function will indicate to Evas that the canvas e
is to have all input event processing frozen until a matching evas_event_thaw() function is called on the same canvas. All events of this kind during the freeze will get discarded. Every freeze call must be matched by a thaw call in order to completely thaw out a canvas (i.e. these calls may be nested). The most common use is when you don't want the user to interact with your user interface when you're populating a view or changing the layout.
Example:
See the full example.
If you run that example, you'll see the canvas ignoring all input events for 3 seconds, when the "f" key is pressed. In a more realistic code we would be freezing while a toolkit or Edje was doing some UI changes, thawing it back afterwards.
int evas_event_freeze_get | ( | const Evas * | e | ) |
Return the freeze count on input events of a given canvas.
- Parameters
-
e The canvas to fetch the freeze count from.
This returns the number of times the canvas has been told to freeze input events. It is possible to call evas_event_freeze() multiple times, and these must be matched by evas_event_thaw() calls. This call allows the program to discover just how many times things have been frozen in case it may want to break out of a deep freeze state where the count is high.
Example:
void evas_event_thaw | ( | Evas * | e | ) |
Thaw a canvas out after freezing (for input events).
- Parameters
-
e The canvas to thaw out.
This will thaw out a canvas after a matching evas_event_freeze() call. If this call completely thaws out a canvas, i.e., there's no other unbalanced call to evas_event_freeze(), events will start to be processed again, but any "missed" events will not be evaluated.
See evas_event_freeze() for an example.
void evas_event_thaw_eval | ( | Evas * | e | ) |
After thaw of a canvas, re-evaluate the state of objects and call callbacks.
- Parameters
-
e The canvas to evaluate after a thaw
This is normally called after evas_event_thaw() to re-evaluate mouse containment and other states and thus also call callbacks for mouse in and out on new objects if the state change demands it.
References evas_event_feed_mouse_move().