+struct _api_data
+{
+ unsigned int state; /* What state we are testing */
+ Evas_Object *box; /* Additional data defined by test */
+ Eina_Bool free_data; /* free data on close */
+};
+typedef struct _api_data api_data;
+enum _api_state
+{
+ ICON_UNSET,
+ WINDOW_TITLE_SET,
+ 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;
+
+ /* Get first item of list of vbox children */
+ Evas_Object *fs_bt = eina_list_nth(items, 0);
+
+ /* use elm_box_children_get() to get list of children */
+ switch(api->state)
+ { /* Put all api-changes under switch */
+ case ICON_UNSET:
+ elm_fileselector_button_icon_unset(fs_bt);
+ break;
+
+ case WINDOW_TITLE_SET:
+ elm_fileselector_button_window_title_set(fs_bt, "Custom title from API");
+ 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
+create_dir_struct(void)
+{
+ FILE *fp;
+ mkdir("/tmp/test_fs_bt", S_IRWXU);
+ fp = fopen("/tmp/test_fs_bt/a_file.txt", "w");
+ if (fp) fclose(fp);
+ fp = fopen("/tmp/test_fs_bt/k_file.txt", "w");
+ if (fp) fclose(fp);
+ fp = fopen("/tmp/test_fs_bt/m_file.txt", "w");
+ if (fp) fclose(fp);
+
+ mkdir("/tmp/test_fs_bt/a_subdir", S_IRWXU);
+ fp = fopen("/tmp/test_fs_bt/a_subdir/d_sub_file.txt", "w");
+ if (fp) fclose(fp);
+ fp = fopen("/tmp/test_fs_bt/a_subdir/j_sub_file.txt", "w");
+ if (fp) fclose(fp);
+}
+