</tbody>
</table>
-
<h2 id="evas_object" name="evas_object">Evas Object Events</h2>
<p>Each Evas object on a specific Evas canvas can be manipulated independently. Each object can send events, which you can handle by registering callback functions for them. The events all relate to single objects, not the whole canvas.</p>
</tbody>
</table>
+<p>The following example shows a scenario with an image and an <code>EVAS_CALLBACK_MOUSE_UP</code> event callback, where the callback is used to print out the location where a touch up event occurs over the image. The callback uses the <code>EVAS_EVENT_FLAG_ON_HOLD</code> event flag to check whether the event is usable: if the <code>EVAS_EVENT_FLAG_ON_HOLD</code> event flag is set, the event is on hold and must not be used to perform any actions.</p>
+
+<pre class="prettyprint">
+static void
+_mouse_up(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Up *ev = event_info;
+
+ if (ev->button != 1) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+
+ printf("MOUSE: up @ %4i %4i\n", ev->canvas.x, ev->canvas.y);
+}
+
+static void
+_add_mouse_up(Evas_Object *window)
+{
+ Evas_Object *image;
+
+ image = elm_image_add(win);
+ evas_object_event_callback_add(image, EVAS_CALLBACK_MOUSE_UP, _mouse_up, NULL);
+ evas_object_show(image);
+}
+</pre>
+
<h2 id="evas_smart_object" name="evas_smart_object">Evas Smart Object Events</h2>
<p>Evas smart object events are the most widely-used type of events in graphical applications, since they are used for signals, such as <code>"clicked"</code>, <code>"clicked,double"</code> (double-click), and <code>"pressed"</code>. They are identified by strings, and each smart object is able to define its own events (although the names follow conventions).</p>
<li><code>EVAS_CALLBACK_MULTI_MOVE</code>: Object receives the multi-mouse/touch move event.</li>
</ul>
+<p>The following example shows a scenario with an image and an <code>EVAS_CALLBACK_MOUSE_UP</code> event callback, where the callback is used to print out the location where a touch up event occurs over the image. The callback uses the <code>EVAS_EVENT_FLAG_ON_HOLD</code> event flag to check whether the event is usable: if the <code>EVAS_EVENT_FLAG_ON_HOLD</code> event flag is set, the event is on hold and must not be used to perform any actions.</p>
+
+<pre class="prettyprint">
+static void
+_mouse_up(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Up *ev = event_info;
+
+ if (ev->button != 1) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+
+ printf("MOUSE: up @ %4i %4i\n", ev->canvas.x, ev->canvas.y);
+}
+
+static void
+_add_mouse_up(Evas_Object *window)
+{
+ Evas_Object *image;
+
+ image = elm_image_add(win);
+ evas_object_event_callback_add(image, EVAS_CALLBACK_MOUSE_UP, _mouse_up, NULL);
+ evas_object_show(image);
+}
+</pre>
+
<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../../scripts/showhide.js"></script>