elm grid obj++
[framework/uifw/elementary.git] / src / bin / test.c
index e4d12dd..d0825b2 100644 (file)
@@ -67,7 +67,9 @@ void test_genlist6(void *data, Evas_Object *obj, void *event_info);
 void test_genlist7(void *data, Evas_Object *obj, void *event_info);
 void test_genlist8(void *data, Evas_Object *obj, void *event_info);
 void test_genlist9(void *data, Evas_Object *obj, void *event_info);
+void test_genlist10(void *data, Evas_Object *obj, void *event_info);
 void test_table(void *data, Evas_Object *obj, void *event_info);
+void test_table2(void *data, Evas_Object *obj, void *event_info);
 void test_gengrid(void *data, Evas_Object *obj, void *event_info);
 void test_gengrid2(void *data, Evas_Object *obj, void *event_info);
 void test_pager(void *data, Evas_Object *obj, void *event_info);
@@ -114,12 +116,16 @@ void test_cursor2(void *data, Evas_Object *obj, void *event_info);
 void test_cursor3(void *data, Evas_Object *obj, void *event_info);
 void test_focus(void *data, Evas_Object *obj, void *event_info);
 void test_focus2(void *data, Evas_Object *obj, void *event_info);
+void test_focus3(void *data, Evas_Object *obj, void *event_info);
 void test_flipselector(void *data, Evas_Object *obj, void *event_info);
 void test_diskselector(void *data, Evas_Object *obj, void *event_info);
 void test_colorselector(void *data, Evas_Object *obj, void *event_info);
 void test_ctxpopup(void *data, Evas_Object *obj, void *event_info);
 void test_bubble(void *data, Evas_Object *obj, void *event_info);
+void test_segment_control(void *data, Evas_Object *obj, void *event_info);
 void test_store(void *data, Evas_Object *obj, void *event_info);
+void test_win_inline(void *data, Evas_Object *obj, void *event_info);
+void test_grid(void *data, Evas_Object *obj, void *event_info);
 
 struct elm_test
 {
@@ -171,13 +177,13 @@ my_win_main(char *autorun)
    Eina_List *tests, *l;
    struct elm_test *t;
 
-   /* create an elm window - it returns an evas object. this is a little
+   /* create an elm window - it returns an evas object. this is a little
     * special as the object lives in the canvas that is inside the window
     * so what is returned is really inside the window, but as you manipulate
     * the evas object returned - the window will respond. elm_win makes sure
     * of that so you can blindly treat it like any other evas object
-    * pretty much, just as long as you know it has special significance */
-   /* the first parameter is a "parent" window - eg for a dialog you want to
+    * pretty much, just as long as you know it has special significance.
+    * the first parameter is a "parent" window - eg for a dialog you want to
     * have a main window it is related to, here it is NULL meaning there
     * is no parent. "main" is the name of the window - used by the window
     * manager for identifying the window uniquely amongst all the windows
@@ -229,9 +235,9 @@ my_win_main(char *autorun)
 
    lb = elm_label_add(win);
    elm_label_label_set(lb,
-                      "Please select a test from the list below<br>"
-                      "by clicking the test button to show the<br>"
-                      "test window.");
+                       "Please select a test from the list below<br>"
+                       "by clicking the test button to show the<br>"
+                       "test window.");
    elm_frame_content_set(fr, lb);
    evas_object_show(lb);
 
@@ -278,6 +284,7 @@ my_win_main(char *autorun)
    ADD_TEST("File Selector Entry", test_fileselector_entry);
    ADD_TEST("Toggles", test_toggle);
    ADD_TEST("Table", test_table);
+   ADD_TEST("Table Homogeneous", test_table2);
    ADD_TEST("Clock", test_clock);
    ADD_TEST("Clock 2", test_clock2);
    ADD_TEST("Layout", test_layout);
@@ -318,6 +325,7 @@ my_win_main(char *autorun)
    ADD_TEST("Genlist Tree", test_genlist6);
    ADD_TEST("Genlist Group", test_genlist8);
    ADD_TEST("Genlist Group Tree", test_genlist9);
+   ADD_TEST("Genlist Mode", test_genlist10);
    ADD_TEST("GenGrid", test_gengrid);
    ADD_TEST("GenGrid 2", test_gengrid2);
    ADD_TEST("Checks", test_check);
@@ -366,37 +374,41 @@ my_win_main(char *autorun)
    ADD_TEST("Cursor 3", test_cursor3);
    ADD_TEST("Focus", test_focus);
    ADD_TEST("Focus 2", test_focus2);
+   ADD_TEST("Focus 3", test_focus3);
    ADD_TEST("Flip Selector", test_flipselector);
    ADD_TEST("Disk Selector", test_diskselector);
    ADD_TEST("Color Selector", test_colorselector);
    ADD_TEST("Ctxpopup", test_ctxpopup);
    ADD_TEST("Bubble", test_bubble);
+   ADD_TEST("Segment Control", test_segment_control);
    ADD_TEST("Store", test_store);
+   ADD_TEST("Window Inline", test_win_inline);
+   ADD_TEST("Grid", test_grid);
 #undef ADD_TEST
 
    if (autorun)
      {
         EINA_LIST_FOREACH(tests, l, t)
-          if ((t->name) && (t->cb) && (!strcmp(t->name, autorun)))
-            t->cb(NULL, NULL, NULL);
+           if ((t->name) && (t->cb) && (!strcmp(t->name, autorun)))
+             t->cb(NULL, NULL, NULL);
      }
 
    if (tests)
      {
-       char last_letter = 0;
-       EINA_LIST_FREE(tests, t)
-         {
-            Elm_List_Item *it;
-            it = elm_list_item_append(li, t->name, NULL, NULL, t->cb, NULL);
-            if (last_letter != t->name[0])
-              {
-                 char letter[2] = {t->name[0], '\0'};
-                 elm_index_item_append(idx, letter, it);
-                 last_letter = t->name[0];
-              }
-            free(t);
-         }
-       elm_index_item_go(idx, 0);
+        char last_letter = 0;
+        EINA_LIST_FREE(tests, t)
+          {
+             Elm_List_Item *it;
+             it = elm_list_item_append(li, t->name, NULL, NULL, t->cb, NULL);
+             if (last_letter != t->name[0])
+               {
+                  char letter[2] = {t->name[0], '\0'};
+                  elm_index_item_append(idx, letter, it);
+                  last_letter = t->name[0];
+               }
+             free(t);
+          }
+        elm_index_item_go(idx, 0);
      }
 
    elm_list_go(li);
@@ -407,14 +419,22 @@ my_win_main(char *autorun)
    evas_object_show(win);
 }
 
-/* this is your elementary main function - it MUSt be called IMMEDIATELY
- * after elm_init() and MUSt be passed argc and argv, and MUST be called
+/* this is your elementary main function - it MUST be called IMMEDIATELY
+ * after elm_init() and MUST be passed argc and argv, and MUST be called
  * elm_main and not be static - must be a visible symbol with EAPI infront */
 EAPI int
 elm_main(int argc, char **argv)
 {
    char *autorun = NULL;
 
+   /* tell elm about our app so it can figure out where to get files */
+   elm_app_info_set(elm_main, "elementary", "images/logo.png");
+   elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
+   elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
+
+   printf("my prefix: %s\n", elm_app_prefix_dir_get());
+
+   printf("elm test data in %s\n", elm_app_data_dir_get());
    /* if called with a single argument try to autorun a test with
     * the same name as the given param
     * ex:  elementary_test "Box Vert 2" */
@@ -430,5 +450,6 @@ elm_main(int argc, char **argv)
    return 0;
 }
 #endif
-/* all emeentary apps should use this. but it right after elm_main() */
+/* all elementary apps should use this. but it should be placed right after
+ * elm_main() */
 ELM_MAIN()