// Show window after the base GUI is set up
evas_object_show(ad->win);
-
- ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
}
</pre>
</li>
elm_list_mode_set(list, ELM_LIST_COMPRESS);
elm_list_item_append(list, "Blend", NULL, NULL, blend_cb, navi);
- elm_list_item_append(list, "Color", NULL, NULL, color_cb, navi
+ elm_list_item_append(list, "Color", NULL, NULL, color_cb, navi);
elm_list_item_append(list, "Fade", NULL, NULL, fade_cb, navi);
elm_list_item_append(list, "Flip", NULL, NULL, flip_cb, navi);
elm_list_item_append(list, "Rotation", NULL, NULL, rotation_cb, navi);
}
</pre>
-<p>This tutorial describes only the rotation and zoom implementations. For more information about other effects, see the <span style="font-family: Courier New,Courier,monospace">transit.c</span> file and the <a href="../../../../org.tizen.native.mobile.apireference/group__Transit.html">Transit</a> API. The following figure illustrates the rotation and zoom effects.</p>
+<p>This tutorial describes only the rotation and zoom implementations. For more information about other effects, see the <span style="font-family: Courier New,Courier,monospace">transit.c</span> file and the <a href="../../../../org.tizen.native.mobile.apireference/group__Transit.html">Transit</a> API or use NULL instead. The following figure illustrates the rotation and zoom effects.</p>
<p class="figure">Figure: Rotation and zoom</p>
<p align="center"><img alt="Rotation and zoom" src="../../images/transit_rotation_zoom.png" /></p>
elm_transit_object_add(transit, layout);
elm_transit_effect_rotation_add(transit, 0, 360);
elm_transit_duration_set(transit, 1);
- elm_transit_del_cb_set(transit, transit_del_cb, NULL);
</pre>
</li>
<li>To start the transit animation, use the <span style="font-family: Courier New,Courier,monospace">elm_transit_go()</span> function:
elm_transit_object_add(transit2, layout);
elm_transit_effect_zoom_add(transit2, 0.4, 1.0);
elm_transit_duration_set(transit2, 0.5);
- elm_transit_del_cb_set(transit2, transit_del_cb, NULL);
</pre>
</li>
<li>Set both effects to be applied in sequence, and start the animation:
{
Evas_Object *win;
Evas_Object *button;
-Evas_Object *default_btn;
+ Evas_Object *default_btn;
}
appdata_s;</pre>
</li>
create_base_gui(appdata_s *ad)
{
Evas_Object *evas_text = NULL;
- Evas *evas = NULL;
+ Evas *evas = NULL;
// Window
ad->win = elm_win_util_standard_add("Extra object function", "Extra object function");
// Window callbacks
evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
- eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, back_cb, ad);
+ eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
evas = evas_object_evas_get(ad->win);
evas_object_text_text_set(evas_text, "Evas Map Mapping");
evas_object_text_font_set(evas_text, "Sans", 18);
evas_object_color_set(evas_text, 50, 100, 200, 255);
- evas_object_move(evas_text, 10, 90);
+ evas_object_move(evas_text, 15, 40);
evas_object_show(evas_text);
// Evas map source code
}</pre>
</li>
-<li>
-<p>Implement callback functions to enable closing the application:</p>
-
-<pre class="prettyprint">static void
-back_cb(void *data, Evas_Object *obj, void *event_info)
-{
- appdata_s *ad = data;
-
- elm_win_lower(ad->win);
-}
-static void
-win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
-{
- ui_app_exit();
-}</pre>
-</li>
-<li>
-<p>Create an elementary application with a GUI:</p>
-<pre class="prettyprint">static bool
-app_create(void *data)
-{
- appdata_s *ad = data;
-
- // Create the application UI
- create_base_gui(ad);
-
- return true;
-}
-
-int
-main(int argc, char *argv[])
-{
- appdata_s ad = {0,};
-
- ui_app_lifecycle_callback_s event_callback = {0,};
-
- event_callback.create = app_create;
-
- // Run the main loop
- return ui_app_main(argc, argv, &event_callback, &ad);
-}</pre>
-</li>
<li>
<p>Create the button for mapping. Use the move and resize functions to configure the button's custom geometry:</p>
<pre class="prettyprint">// Create a button for mapping
ad->button = elm_button_add(ad->win);
elm_object_text_set(ad->button, "Evas Map Mapping ");
-evas_object_move(ad->button, 15, 100);
-evas_object_resize(ad->button, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
+evas_object_move(ad->button, 15, 50);
+evas_object_resize(ad->button, 350, 100);
evas_object_show(ad->button);
// Create a default button
ad->default_btn = elm_button_add(ad->win);
elm_object_text_set(ad->default_btn, "Default Button ");
-evas_object_move(ad->default_btn, 15, 300);
-evas_object_resize(ad->default_btn, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
+evas_object_move(ad->default_btn, 15, 600);
+evas_object_resize(ad->default_btn, 450, 100);
evas_object_show(ad->default_btn);</pre>
</li>
</ol>
<p>Set the coordinates for each point using the <span style="font-family: Courier New,Courier,monospace">evas_map_point_coord_set()</span> function. You can apply several effects to the Evas object by setting each point of the map to the right coordinates.</p>
<pre class="prettyprint">// Set map coordinates
-evas_map_point_coord_set(map, 0, 15, 100, 0);
-evas_map_point_coord_set(map, 1, 265, 100, 0);
-evas_map_point_coord_set(map, 2, 265, 300, 0);
-evas_map_point_coord_set(map, 3, 15, 400, 0);</pre>
+evas_map_point_coord_set(map, 0, 15, 500, 0);
+evas_map_point_coord_set(map, 1, 365, 100, 0);
+evas_map_point_coord_set(map, 2, 365, 200, 0);
+evas_map_point_coord_set(map, 3, 15, 600, 0);</pre>
</li>
<li>
<p>Set UV data using the <span style="font-family: Courier New,Courier,monospace">evas_map_point_image_uv_set()</span> function, which informs the map of the correct pixels in the image it is mapping:</p>
<pre class="prettyprint">// Set image UV
-evas_map_point_image_uv_set(map, 0, 0, 0);
-evas_map_point_image_uv_set(map, 1, 500, 50);
-evas_map_point_image_uv_set(map, 2, 500, 400);
-evas_map_point_image_uv_set(map, 3, 0, 200);</pre>
+evas_map_point_image_uv_set(map, 0, 0, 0);
+evas_map_point_image_uv_set(map, 1, 360, 0);
+evas_map_point_image_uv_set(map, 2, 350, 90);
+evas_map_point_image_uv_set(map, 3, 0, 100);</pre>
</li>
</ol>