fixed plugin image size problem
[framework/uifw/elementary.git] / src / bin / test_notify.c
index bfbb05e..dcb387a 100644 (file)
@@ -1,7 +1,7 @@
-#include <Elementary.h>
 #ifdef HAVE_CONFIG_H
 # include "elementary_config.h"
 #endif
+#include <Elementary.h>
 #ifndef ELM_LIB_QUICKLAUNCH
 
 static void
@@ -40,16 +40,10 @@ _notify_block(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
 void
 test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Evas_Object *win, *bg, *bx, *tb, *notify, *bt, *lb;
-
-   win = elm_win_add(NULL, "notify", ELM_WIN_BASIC);
-   elm_win_title_set(win, "Notify");
-   elm_win_autodel_set(win, 1);
+   Evas_Object *win, *bx, *tb, *notify, *bt, *lb;
 
-   bg = elm_bg_add(win);
-   elm_win_resize_object_add(win, bg);
-   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_show(bg);
+   win = elm_win_util_standard_add("notify", "Notify");
+   elm_win_autodel_set(win, EINA_TRUE);
 
    tb = elm_table_add(win);
    elm_win_resize_object_add(win, tb);
@@ -60,29 +54,29 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "This position is the default.");
+   elm_object_text_set(lb, "This position is the default.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Top");
+   elm_object_text_set(bt, "Top");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 1, 0, 1, 1);
    evas_object_show(bt);
 
    notify = elm_notify_add(win);
-   elm_notify_repeat_events_set(notify, EINA_FALSE);
+   elm_notify_allow_events_set(notify, EINA_FALSE);
    evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
    elm_notify_timeout_set(notify, 5.0);
@@ -90,24 +84,24 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_smart_callback_add(notify, "block,clicked", _notify_block, NULL);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Bottom position. This notify use a timeout of 5 sec.<br>"
+   elm_object_text_set(lb, "Bottom position. This notify use a timeout of 5 sec.<br/>"
         "<b>The events outside the window are blocked.</b>");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Bottom");
+   elm_object_text_set(bt, "Bottom");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 1, 2, 1, 1);
    evas_object_show(bt);
@@ -119,23 +113,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Left position. This notify use a timeout of 10 sec.");
+   elm_object_text_set(lb, "Left position. This notify use a timeout of 10 sec.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Left");
+   elm_object_text_set(bt, "Left");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 0, 1, 1, 1);
    evas_object_show(bt);
@@ -147,23 +141,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Center position. This notify use a timeout of 10 sec.");
+   elm_object_text_set(lb, "Center position. This notify use a timeout of 10 sec.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Center");
+   elm_object_text_set(bt, "Center");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 1, 1, 1, 1);
    evas_object_show(bt);
@@ -173,23 +167,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_RIGHT);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Right position.");
+   elm_object_text_set(lb, "Right position.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Right");
+   elm_object_text_set(bt, "Right");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 2, 1, 1, 1);
    evas_object_show(bt);
@@ -199,23 +193,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_LEFT);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Top Left position.");
+   elm_object_text_set(lb, "Top Left position.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Top Left");
+   elm_object_text_set(bt, "Top Left");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 0, 0, 1, 1);
    evas_object_show(bt);
@@ -225,23 +219,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_RIGHT);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Top Right position.");
+   elm_object_text_set(lb, "Top Right position.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Top Right");
+   elm_object_text_set(bt, "Top Right");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 2, 0, 1, 1);
    evas_object_show(bt);
@@ -251,23 +245,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_LEFT);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Bottom Left position.");
+   elm_object_text_set(lb, "Bottom Left position.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close");
+   elm_object_text_set(bt, "Close");
    evas_object_smart_callback_add(bt, "clicked", _bt_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Bottom Left");
+   elm_object_text_set(bt, "Bottom Left");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 0, 2, 1, 1);
    evas_object_show(bt);
@@ -277,23 +271,23 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_RIGHT);
 
    bx = elm_box_add(win);
-   elm_notify_content_set(notify, bx);
-   elm_box_horizontal_set(bx, 1);
+   elm_object_content_set(notify, bx);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_label_label_set(lb, "Bottom Right position.");
+   elm_object_text_set(lb, "Bottom Right position.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Close in 2s");
+   elm_object_text_set(bt, "Close in 2s");
    evas_object_smart_callback_add(bt, "clicked", _bt_timer_close, notify);
    elm_box_pack_end(bx, bt);
    evas_object_show(bt);
 
    bt = elm_button_add(win);
-   elm_button_label_set(bt, "Bottom Right");
+   elm_object_text_set(bt, "Bottom Right");
    evas_object_smart_callback_add(bt, "clicked", _bt, notify);
    elm_table_pack(tb, bt, 2, 2, 1, 1);
    evas_object_show(bt);