Sync with upstream
authorMike McCormack <mj.mccormack@samsung.com>
Tue, 22 Nov 2011 04:57:26 +0000 (13:57 +0900)
committerMike McCormack <mj.mccormack@samsung.com>
Tue, 22 Nov 2011 04:57:26 +0000 (13:57 +0900)
src/bin/test_focus.c
src/bin/test_glview.c
src/bin/test_glview_simple.c
src/bin/test_hover.c
src/bin/test_hoversel.c
src/bin/test_label.c
src/bin/test_map.c
src/bin/test_menu.c
src/bin/test_pager.c

index 11d47a5..49af5cc 100644 (file)
@@ -91,7 +91,8 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
           {
              Evas_Object *lb = elm_label_add(win);
              elm_object_text_set(lb,
-                                 "<b>Use Tab and Shift+Tab</b>"
+                                 "<b>Use Tab, Shift+Tab, and<br>"
+                                                                "Arrow Keys</b>"
                                 );
              evas_object_size_hint_weight_set(lb, 0.0, 0.0);
              evas_object_size_hint_align_set(lb, EVAS_HINT_FILL,
index 0919d17..0991ea4 100644 (file)
@@ -326,7 +326,9 @@ static const char vertex_shader[] =
    "}\n";
 
  static const char fragment_shader[] =
+   "#ifdef GL_ES\n"
    "precision mediump float;\n"
+   "#endif\n"
    "uniform vec4 color;\n"
    "uniform vec3 light;\n"
    "varying vec3 rotated_normal;\n"
@@ -598,7 +600,7 @@ test_glview(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_glview_init_func_set(gl, _init_gl);
    elm_glview_del_func_set(gl, _del_gl);
    elm_glview_resize_func_set(gl, _resize_gl);
-   elm_glview_render_func_set(gl, (Elm_GLView_Func)_draw_gl);
+   elm_glview_render_func_set(gl, (Elm_GLView_Func_Cb)_draw_gl);
    elm_box_pack_end(bx, gl);
    evas_object_show(gl);
 
index f5e4441..a87931a 100644 (file)
@@ -47,7 +47,7 @@ load_shader( GLData *gld, GLenum type, const char *shader_src )
              char* info_log = malloc(sizeof(char) * info_len);
 
              gl->glGetShaderInfoLog(shader, info_len, NULL, info_log);
-             printf("Error compiling shader:\n%s\n", info_log );
+             printf("Error compiling shader:\n%s\n======\n%s\n======\n", info_log, shader_src );
              free(info_log);
           }
         gl->glDeleteShader(shader);
@@ -70,7 +70,9 @@ init_shaders(GLData *gld)
       "}                            \n";
 
    GLbyte fShaderStr[] =
-      "precision mediump float;\n"\
+      "#ifdef GL_ES                                 \n"
+      "precision mediump float;                     \n"
+      "#endif                                       \n"
       "void main()                                  \n"
       "{                                            \n"
       "  gl_FragColor = vec4 ( 1.0, 0.0, 0.0, 1.0 );\n"
index db27639..be10a31 100644 (file)
@@ -86,7 +86,7 @@ test_hover(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    evas_object_size_hint_min_set(bg, 160, 160);
    evas_object_size_hint_max_set(bg, 640, 640);
-   evas_object_resize(win, 320, 320);
+   evas_object_resize(win, 440, 440);
    evas_object_show(win);
 }
 
@@ -166,7 +166,7 @@ test_hover2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    evas_object_size_hint_min_set(bg, 160, 160);
    evas_object_size_hint_max_set(bg, 640, 640);
-   evas_object_resize(win, 320, 320);
+   evas_object_resize(win, 440, 440);
    evas_object_show(win);
 }
 #endif
index a55ac63..e91121d 100644 (file)
@@ -24,6 +24,8 @@ test_hoversel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
    evas_object_show(bx);
 
    bt = elm_hoversel_add(win);
+// FIXME: need to add horizontal hoversel theme to default some day
+//   elm_hoversel_horizontal_set(bt, 1);
    elm_hoversel_hover_parent_set(bt, win);
    elm_object_text_set(bt, "Labels");
    elm_hoversel_item_add(bt, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
index 46ea32f..d29b963 100644 (file)
@@ -68,11 +68,10 @@ test_label(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
-   elm_win_resize_object_add(win, bx);
-   evas_object_show(bx);
-
    evas_object_resize(win, 320, 300);
 
+   evas_object_show(bx);
    evas_object_show(win);
+   elm_win_resize_object_add(win, bx);
 }
 #endif
index 7725dfc..8b1a033 100644 (file)
@@ -348,7 +348,6 @@ static void
 map_track_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    Evas_Object *fs, *bg, *vbox, *hbox, *sep;
-   const char *path = NULL;
 
    fs_win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
    elm_win_title_set(fs_win, "File Selector");
@@ -367,9 +366,7 @@ map_track_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED
    fs = elm_fileselector_add(fs_win);
    elm_fileselector_is_save_set(fs, EINA_TRUE);
    elm_fileselector_expandable_set(fs, EINA_FALSE);
-   path = getenv("HOME");
-   if (!path) path = "./";
-   elm_fileselector_path_set(fs, path);
+   elm_fileselector_path_set(fs, getenv("HOME"));
    evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(vbox, fs);
index b880994..540b425 100644 (file)
@@ -72,7 +72,7 @@ _populate_2(Elm_Menu_Item *item)
 static void
 _populate_1(Evas_Object *win, Elm_Menu_Item *item)
 {
-   Elm_Menu_Item *item2, *item3;
+   Elm_Menu_Item *item2;
    Evas_Object *radio;
 
    radio = elm_radio_add(win);
@@ -80,7 +80,7 @@ _populate_1(Evas_Object *win, Elm_Menu_Item *item)
    elm_radio_value_set(radio, 0);
    elm_object_text_set(radio, "radio in menu");
    item2 = elm_menu_item_add(menu, item, "object-rotate-left", "menu 1", NULL, NULL);
-   item3 = elm_menu_item_add_object(menu, item, radio, NULL, NULL);
+   elm_menu_item_add_object(menu, item, radio, NULL, NULL);
 
    _populate_2(item2);
 }
index 4421e89..c2dca23 100644 (file)
@@ -98,18 +98,18 @@ test_pager(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    lb = elm_label_add(win);
    elm_object_text_set(lb,
-                      "This is page 1 in a pager stack.<br>"
-                      "<br>"
-                      "So what is a pager stack? It is a stack<br>"
-                      "of pages that hold widgets in it. The<br>"
-                      "pages can be pushed and popped on and<br>"
-                      "off the stack, activated and otherwise<br>"
-                      "activated if already in the stack<br>"
-                      "(activated means promoted to the top of<br>"
-                      "the stack).<br>"
-                      "<br>"
-                      "The theme may define the animation how<br>"
-                      "show and hide of pages. Select one theme style:");
+                       "This is page 1 in a pager stack.<br>"
+                       "<br>"
+                       "So what is a pager stack? It is a stack<br>"
+                       "of pages that hold widgets in it. The<br>"
+                       "pages can be pushed and popped on and<br>"
+                       "off the stack, activated and otherwise<br>"
+                       "activated if already in the stack<br>"
+                       "(activated means promoted to the top of<br>"
+                       "the stack).<br>"
+                       "<br>"
+                       "The theme may define the animation how<br>"
+                       "show and hide of pages. Select one theme style:");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
@@ -150,11 +150,11 @@ test_pager(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    lb = elm_label_add(win);
    elm_object_text_set(lb,
-                      "This is page 2 in a pager stack.<br>"
-                      "<br>"
-                      "This is just like the previous page in<br>"
-                      "the pager stack."
-                      );
+                       "This is page 2 in a pager stack.<br>"
+                       "<br>"
+                       "This is just like the previous page in<br>"
+                       "the pager stack."
+                      );
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
@@ -178,10 +178,10 @@ test_pager(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    lb = elm_label_add(win);
    elm_object_text_set(lb,
-                      "This is page 3 in a pager stack.<br>"
-                      "<br>"
-                      "This is just like the previous page in<br>"
-                      "the pager stack.");
+                       "This is page 3 in a pager stack.<br>"
+                       "<br>"
+                       "This is just like the previous page in<br>"
+                       "the pager stack.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
@@ -215,9 +215,6 @@ test_pager(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    //elm_win_resize_object_add(win, ly2);
    evas_object_show(ly2);
 
-
-
-
    bt = elm_button_add(win);
    elm_object_text_set(bt, "Flip to 1");
    evas_object_smart_callback_add(bt, "clicked", my_pager_4, &info);
@@ -273,6 +270,15 @@ my_pager_push(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED
 }
 
 void
+_hide_finished(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   //To prevent the window size become zero. 
+   Pginfo *info = data;
+   if (elm_pager_content_top_get(info->pager)) return;
+   elm_win_resize_object_del(info->win, info->pager);
+}
+
+void
 test_pager_slide(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    Evas_Object *win, *bg, *pg, *bx, *lb, *bt;
@@ -291,24 +297,25 @@ test_pager_slide(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
 
    pg = elm_pager_add(win);
    elm_win_resize_object_add(win, pg);
+   evas_object_smart_callback_add(pg, "hide,finished",
+                                  _hide_finished, &info);
    elm_object_style_set(pg, "slide");
    evas_object_show(pg);
    info.pager = pg;
-
    bx = elm_box_add(win);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
    elm_object_text_set(lb,
-                      "This is page 1 in a slide pager.<br>"
-                      "<br>"
-                      "The slide pager style is useful for browsing<br>"
-                      "a hierarchy of objects, as it makes clear<br>"
-                      "the direction of the browse.<br>"
-                      "This is the 'slide' style, also available<br>"
-                      "a fully transparent style named 'slide_invisble'.<br>"
-                      "<br>");
+                       "This is page 1 in a slide pager.<br>"
+                       "<br>"
+                       "The slide pager style is useful for browsing<br>"
+                       "a hierarchy of objects, as it makes clear<br>"
+                       "the direction of the browse.<br>"
+                       "This is the 'slide' style, also available<br>"
+                       "a fully transparent style named 'slide_invisble'.<br>"
+                       "<br>");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);