1 #include <Elementary.h>
4 # include "elementary_config.h"
6 #ifndef ELM_LIB_QUICKLAUNCH
9 unsigned int state; /* What state we are testing */
12 typedef struct _api_data api_data;
19 typedef enum _api_state api_state;
22 set_api_state(api_data *api)
28 t = elm_win_inwin_content_unset(api->inwin);
30 t = elm_label_add(elm_object_parent_widget_get(api->inwin));
31 elm_object_text_set(t, "Content was unset.<br>DONE!");
32 elm_win_inwin_content_set(api->inwin, t);
41 _api_bt_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
42 { /* Will add here a SWITCH command containing code to modify test-object */
43 /* in accordance a->state value. */
47 printf("clicked event on API Button: api_state=<%d>\n", a->state);
50 sprintf(str, "Next API function (%u)", a->state);
51 elm_object_text_set(obj, str);
52 elm_object_disabled_set(obj, a->state == API_STATE_LAST);
56 _cleanup_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
62 test_inwin(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
64 Evas_Object *win, *bg, *inwin, *lb, *bxx, *bt;
65 api_data *api = calloc(1, sizeof(api_data));
67 win = elm_win_add(NULL, "inwin", ELM_WIN_BASIC);
68 elm_win_title_set(win, "Inwin");
69 elm_win_autodel_set(win, EINA_TRUE);
70 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
73 elm_win_resize_object_add(win, bg);
74 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 inwin = elm_win_inwin_add(win);
79 evas_object_show(inwin);
81 bxx = elm_box_add(inwin);
82 evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
83 evas_object_show(bxx);
85 bt = elm_button_add(inwin);
86 elm_object_text_set(bt, "Next API function");
87 evas_object_smart_callback_add(bt, "clicked", _api_bt_clicked, (void *) api);
88 elm_box_pack_end(bxx, bt);
89 elm_object_disabled_set(bt, api->state == API_STATE_LAST);
92 lb = elm_label_add(win);
93 elm_object_text_set(lb,
94 "This is an \"inwin\" - a window in a<br/>"
95 "window. This is handy for quick popups<br/>"
96 "you want centered, taking over the window<br/>"
97 "until dismissed somehow. Unlike hovers they<br/>"
98 "don't hover over their target.");
99 elm_box_pack_end(bxx, lb);
100 elm_win_inwin_content_set(inwin, bxx);
101 evas_object_show(lb);
103 evas_object_resize(win, 320, 240);
104 evas_object_show(win);
108 test_inwin2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
110 Evas_Object *win, *bg, *inwin, *lb;
112 win = elm_win_add(NULL, "inwin2", ELM_WIN_BASIC);
113 elm_win_title_set(win, "Inwin 2");
114 elm_win_autodel_set(win, EINA_TRUE);
116 bg = elm_bg_add(win);
117 elm_win_resize_object_add(win, bg);
118 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
119 evas_object_show(bg);
121 inwin = elm_win_inwin_add(win);
122 elm_object_style_set(inwin, "minimal_vertical");
123 evas_object_show(inwin);
125 lb = elm_label_add(win);
126 elm_object_text_set(lb,
127 "This is an \"inwin\" - a window in a<br/>"
128 "window. This is handy for quick popups<br/>"
129 "you want centered, taking over the window<br/>"
130 "until dismissed somehow. Unlike hovers they<br/>"
131 "don't hover over their target.<br/>"
133 "This inwin style compacts itself vertically<br/>"
134 "to the size of its contents minimum size.");
135 elm_win_inwin_content_set(inwin, lb);
136 evas_object_show(lb);
138 evas_object_resize(win, 320, 240);
139 evas_object_show(win);