1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
8 _win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
10 Evas_Object *socket_win = data;
11 evas_object_del(socket_win);
15 fill(Evas_Object *win, Eina_Bool do_bg)
17 Evas_Object *bg, *sc, *bx, *ic, *bb, *av, *en;
23 elm_win_resize_object_add(win, bg);
24 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28 sc = elm_scroller_add(win);
29 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
30 elm_win_resize_object_add(win, sc);
32 bx = elm_box_add(win);
33 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
34 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
36 en = elm_entry_add(win);
37 elm_entry_scrollable_set(en, EINA_TRUE);
38 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
39 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
40 elm_object_text_set(en, "This is a single line");
41 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
42 elm_entry_single_line_set(en, EINA_TRUE);
44 elm_box_pack_end(bx, en);
46 en = elm_entry_add(win);
47 elm_entry_scrollable_set(en, EINA_TRUE);
48 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
49 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
50 elm_object_text_set(en, "Entry 2");
51 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
52 elm_entry_single_line_set(en, EINA_TRUE);
54 elm_box_pack_end(bx, en);
56 ic = elm_icon_add(win);
57 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
58 elm_icon_file_set(ic, buf, NULL);
59 elm_icon_scale_set(ic, 0, 0);
60 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
62 bb = elm_bubble_add(win);
63 elm_object_text_set(bb, "Message 3");
64 elm_object_part_text_set(bb, "info", "10:32 4/11/2008");
65 elm_object_part_content_set(bb, "icon", ic);
67 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
68 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
69 av = elm_anchorblock_add(win);
70 elm_anchorblock_hover_style_set(av, "popout");
71 elm_anchorblock_hover_parent_set(av, win);
72 elm_object_text_set(av,
73 "Hi there. This is the most recent message in the "
74 "list of messages. It has one <a href=tel:+614321234>+61 432 1234</a> "
75 "(phone number) to click on.");
76 elm_object_content_set(bb, av);
78 elm_box_pack_end(bx, bb);
81 ic = elm_icon_add(win);
82 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
83 elm_icon_file_set(ic, buf, NULL);
84 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
86 bb = elm_bubble_add(win);
87 elm_object_text_set(bb, "Message 2");
88 elm_object_part_text_set(bb, "info", "7:16 27/10/2008");
89 elm_object_part_content_set(bb, "icon", ic);
91 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
92 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
93 av = elm_anchorblock_add(win);
94 elm_anchorblock_hover_style_set(av, "popout");
95 elm_anchorblock_hover_parent_set(av, win);
96 elm_object_text_set(av,
97 "Hey what are you doing? This is the second last message "
98 "Hi there. This is the most recent message in the "
99 "list. It's a longer one so it can wrap more and "
100 "contains a <a href=contact:john>John</a> contact "
101 "link in it to test popups on links. The idea is that "
102 "all SMS's are scanned for things that look like phone "
103 "numbers or names that are in your contacts list, and "
104 "if they are, they become clickable links that pop up "
105 "a menus of obvious actions to perform on this piece "
106 "of information. This of course can be later explicitly "
107 "done by links maybe running local apps or even being "
108 "web URL's too that launch the web browser and point it "
109 "to that URL. <item relsize=16x16 vsize=full href=emoticon/omg></item>");
110 elm_object_content_set(bb, av);
111 evas_object_show(av);
112 elm_box_pack_end(bx, bb);
113 evas_object_show(bb);
115 ic = elm_icon_add(win);
116 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
117 elm_icon_file_set(ic, buf, NULL);
118 elm_icon_scale_set(ic, 0, 0);
119 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
121 bb = elm_bubble_add(win);
122 elm_object_text_set(bb, "Message 1");
123 elm_object_part_text_set(bb, "info", "20:47 18/6/2008");
124 elm_object_part_content_set(bb, "icon", ic);
125 evas_object_show(ic);
126 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
127 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
129 av = elm_anchorblock_add(win);
130 elm_anchorblock_hover_style_set(av, "popout");
131 elm_anchorblock_hover_parent_set(av, win);
132 elm_object_text_set(av, "This is a short message. <item relsize=16x16 vsize=full href=emoticon/haha></item>");
133 elm_object_content_set(bb, av);
134 evas_object_show(av);
135 elm_box_pack_end(bx, bb);
136 evas_object_show(bb);
138 elm_object_content_set(sc, bx);
139 evas_object_show(bx);
141 evas_object_show(sc);
145 test_win_socket(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
147 Evas_Object *win, *bg, *bx, *lb;
148 Evas_Object *win_socket;
150 /* for socket info window */
151 win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
152 elm_win_title_set(win, "Label");
153 elm_win_autodel_set(win, EINA_TRUE);
155 bg = elm_bg_add(win);
156 elm_win_resize_object_add(win, bg);
157 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
158 evas_object_show(bg);
160 bx = elm_box_add(win);
161 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
162 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
164 lb = elm_label_add(win);
165 elm_object_text_set(lb,
166 "<b>This is a small label</b>"
168 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
169 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
170 elm_box_pack_end(bx, lb);
171 evas_object_show(lb);
173 lb = elm_label_add(win);
174 elm_object_text_set(lb,
175 "If you runs more than Window Plug Program<br/>"
176 "you can see each plug programs shared same<br/>"
179 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
180 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
181 elm_box_pack_end(bx, lb);
182 evas_object_show(lb);
186 evas_object_resize(win, 320, 300);
188 evas_object_show(bx);
189 evas_object_show(win);
190 elm_win_resize_object_add(win, bx);
192 /* for socket window */
193 win_socket = elm_win_add(NULL, "Window Socket", ELM_WIN_SOCKET_IMAGE);
195 if (!elm_win_socket_listen(win_socket, "ello", 0, EINA_FALSE))
197 printf("Fail to elm win socket listen \n");
198 evas_object_del(win_socket);
199 evas_object_del(win);
202 elm_win_title_set(win_socket, "Window Socket");
203 elm_win_autodel_set(win_socket, EINA_TRUE);
205 fill(win_socket, EINA_TRUE);
207 evas_object_resize(win_socket, 400, 600);
208 evas_object_show(win_socket);
210 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del,