+struct _api_data
+{
+ unsigned int state; /* What state we are testing */
+ Evas_Object *win; /* Parent Window of widgets */
+ void *box; /* Use this to get box content */
+};
+typedef struct _api_data api_data;
+
+enum _api_state
+{
+ BUBBLE_SET_CORNER_1,
+ BUBBLE_SET_CORNER_2,
+ BUBBLE_SET_ICON_CONTENT,
+ API_STATE_LAST
+};
+typedef enum _api_state api_state;
+
+static void
+set_api_state(api_data *api)
+{
+ const Eina_List *items = elm_box_children_get(api->box);
+ if(!eina_list_count(items))
+ return;
+
+ switch(api->state)
+ { /* Put all api-changes under switch */
+ case BUBBLE_SET_CORNER_1:
+ elm_bubble_corner_set(eina_list_nth(items, 0), "bottom_left");
+ elm_object_text_set(elm_object_content_get(eina_list_nth(items, 0)),
+ "Corner: base (bottom-left) - with icon");
+ elm_bubble_corner_set(eina_list_nth(items, 1), "top_right");
+ elm_object_text_set(elm_object_content_get(eina_list_nth(items, 1)),
+ "Corner: base (top-right) - no icon");
+ break;
+
+ case BUBBLE_SET_CORNER_2:
+ elm_bubble_corner_set(eina_list_nth(items, 0), "top_right");
+ elm_object_text_set(elm_object_content_get(eina_list_nth(items, 0)),
+ "Corner: base (top-right) - with icon");
+ elm_bubble_corner_set(eina_list_nth(items, 1), "bottom_left");
+ elm_object_text_set(elm_object_content_get(eina_list_nth(items, 1)),
+ "Corner: base (bottom-left) - no icon");
+ break;
+
+ case BUBBLE_SET_ICON_CONTENT:
+ {
+ char buf[PATH_MAX];
+ Evas_Object *ct, *ic = elm_icon_add(api->win);
+
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+ elm_object_content_set(eina_list_nth(items, 0), ic);
+ ct = elm_label_add(api->win);
+ elm_object_text_set(ct, "Using icon as top-bubble content");
+ elm_object_content_set(eina_list_nth(items, 1), ct);
+ evas_object_size_hint_align_set(ic, 0.5, 0.5);
+ evas_object_show(ic);
+ }
+ break;
+
+ case API_STATE_LAST:
+
+ break;
+ default:
+ return;
+ }
+}
+
+static void
+_api_bt_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
+{ /* Will add here a SWITCH command containing code to modify test-object */
+ /* in accordance a->state value. */
+ api_data *a = data;
+ char str[128];
+
+ printf("clicked event on API Button: api_state=<%d>\n", a->state);
+ set_api_state(a);
+ a->state++;
+ sprintf(str, "Next API function (%u)", a->state);
+ elm_object_text_set(obj, str);
+ elm_object_disabled_set(obj, a->state == API_STATE_LAST);
+}
+
+static void
+_cleanup_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ free(data);
+}
+
+