summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-18 21:47:08 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-18 21:50:03 +0200
commit94c60047c2e05a3cfabd5b5a52cf91d326ef7324 (patch)
treec7f6ccf1823b02557d9b55b3876ac39d75ae6ebe
parent83f0e902bf2973f4e08dcdc325e798330b9351ba (diff)
here comes a new exampledevs/bu5hm4n/cv-finalize
-rw-r--r--src/examples/elementary/efl_ui_grid_view_example_1.c482
-rw-r--r--src/examples/elementary/meson.build3
2 files changed, 484 insertions, 1 deletions
diff --git a/src/examples/elementary/efl_ui_grid_view_example_1.c b/src/examples/elementary/efl_ui_grid_view_example_1.c
new file mode 100644
index 0000000000..2c7d219559
--- /dev/null
+++ b/src/examples/elementary/efl_ui_grid_view_example_1.c
@@ -0,0 +1,482 @@
1// gcc -o efl_ui_grid_view_example_1 efl_ui_grid_view_example_1.c `pkg-config --cflags --libs elementary`
2
3#define EFL_BETA_API_SUPPORT 1
4
5#include <Efl.h>
6#include <Efl_Ui.h>
7#include <Elementary.h>
8#include "efl_ui_grid_view.eo.h"
9
10
11static Efl_Model*
12_make_model(Evas_Object *win)
13{
14 Eina_Value vtext;
15 Efl_Generic_Model *model, *child;
16
17 model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
18 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
19
20#define IC(x) \
21 child = efl_model_child_add(model); \
22 eina_value_set(&vtext, x); \
23 efl_model_property_set(child, "title", &vtext);
24
25 IC("user-home")
26 IC("user-bookmarks")
27 IC("user-desktop")
28 IC("user-trash")
29 IC("folder")
30 IC("folder-drag-accept")
31 IC("folder-remote")
32 IC("folder-open")
33 IC("folder-home")
34 IC("folder-download")
35 IC("folder-recent")
36 IC("folder-documents")
37 IC("folder-pictures")
38 IC("folder-music")
39 IC("folder-videos")
40 IC("folder-visiting")
41 IC("network-server")
42 IC("network-workgroup")
43 IC("start-here")
44 IC("emblem-default")
45 IC("emblem-documents")
46 IC("emblem-downloads")
47 IC("emblem-favorite")
48 IC("emblem-important")
49 IC("emblem-mail")
50 IC("emblem-photos")
51 IC("emblem-readonly")
52 IC("emblem-shared")
53 IC("emblem-symbolic-link")
54 IC("emblem-unreadable")
55 IC("emblem-system")
56 IC("emblem-synchronized")
57 IC("emblem-synchronizing")
58 IC("address-book-new")
59 IC("application-exit")
60 IC("appointment-new")
61 IC("call-start")
62 IC("call-stop")
63 IC("contact-new")
64 IC("document-open")
65 IC("document-open-recent")
66 IC("document-page-setup")
67 IC("document-properties")
68 IC("document-save")
69 IC("document-save-as")
70 IC("document-send")
71 IC("document-close")
72 IC("document-new")
73 IC("document-print")
74 IC("document-print-preview")
75 IC("document-revert")
76 IC("document-export")
77 IC("document-import")
78 IC("edit-clear")
79 IC("edit-copy")
80 IC("edit-cut")
81 IC("edit-delete")
82 IC("edit-find")
83 IC("edit-find-replace")
84 IC("edit-paste")
85 IC("edit-redo")
86 IC("edit-undo")
87 IC("edit-select-all")
88 IC("folder-copy")
89 IC("folder-move")
90 IC("folder-new")
91 IC("format-indent-less")
92 IC("format-indent-more")
93 IC("format-justify-center")
94 IC("format-justify-fill")
95 IC("format-justify-left")
96 IC("format-justify-right")
97 IC("format-text-direction-ltr")
98 IC("format-text-direction-rtl")
99 IC("format-text-bold")
100 IC("format-text-italic")
101 IC("format-text-underline")
102 IC("format-text-strikethrough")
103 IC("go-home")
104 IC("go-bottom")
105 IC("go-down")
106 IC("go-first")
107 IC("go-jump")
108 IC("go-last")
109 IC("go-next")
110 IC("go-previous")
111 IC("go-top")
112 IC("go-up")
113 IC("insert-image")
114 IC("insert-link")
115 IC("insert-object")
116 IC("insert-text")
117 IC("list-add")
118 IC("list-remove")
119 IC("mail-forward")
120 IC("mail-mark-important")
121 IC("mail-mark-junk")
122 IC("mail-mark-notjunk")
123 IC("mail-mark-read")
124 IC("mail-mark-unread")
125 IC("mail-message-new")
126 IC("mail-reply-all")
127 IC("mail-reply-sender")
128 IC("mail-send")
129 IC("mail-send-receive")
130 IC("media-eject")
131 IC("media-playback-pause")
132 IC("media-playback-start")
133 IC("media-playback-stop")
134 IC("media-record")
135 IC("media-seek-backward")
136 IC("media-seek-forward")
137 IC("media-skip-backward")
138 IC("media-skip-forward")
139 IC("object-flip-horizontal")
140 IC("object-flip-vertical")
141 IC("object-rotate-left")
142 IC("object-rotate-right")
143 IC("process-stop")
144 IC("tools-check-spelling")
145 IC("view-list-compact")
146 IC("view-list-details")
147 IC("view-list-icons")
148 IC("view-fullscreen")
149 IC("view-refresh")
150 IC("view-restore")
151 IC("view-sort-ascending")
152 IC("view-sort-descending")
153 IC("view-close")
154 IC("window-close")
155 IC("window-new")
156 IC("system-run")
157 IC("system-shutdown")
158 IC("system-reboot")
159 IC("system-lock-screen")
160 IC("system-log-out")
161 IC("system-search")
162 IC("help-about")
163 IC("help-contents")
164 IC("help-faq")
165 IC("zoom-in")
166 IC("zoom-out")
167 IC("zoom-original")
168 IC("zoom-fit")
169 IC("zoom-fill")
170 IC("zoom-fit-best")
171 IC("appointment-missed")
172 IC("appointment-soon")
173 IC("audio-volume-high")
174 IC("audio-volume-low")
175 IC("audio-volume-medium")
176 IC("audio-volume-muted")
177 IC("audio-volume")
178 IC("battery-caution")
179 IC("battery-empty")
180 IC("battery-low")
181 IC("battery-good")
182 IC("battery-full")
183 IC("battery-caution-charging")
184 IC("battery-empty-charging")
185 IC("battery-low-charging")
186 IC("battery-good-charging")
187 IC("battery-full-charging")
188 IC("bluetooth-active")
189 IC("bluetooth-disabled")
190 IC("changes-allow")
191 IC("changes-prevent")
192 IC("dialog-error")
193 IC("dialog-information")
194 IC("dialog-password")
195 IC("dialog-question")
196 IC("dialog-warning")
197 IC("media-playlist-repeat")
198 IC("media-playlist-shuffle")
199 IC("network-cellular-3g")
200 IC("network-cellular-4g")
201 IC("network-cellular-edge")
202 IC("network-cellular-gprs")
203 IC("network-cellular-umts")
204 IC("network-cellular-connected")
205 IC("network-cellular-signal-excellent")
206 IC("network-cellular-signal-good")
207 IC("network-cellular-signal-none")
208 IC("network-cellular-signal-ok")
209 IC("network-cellular-signal-weak")
210 IC("network-cellular-signal-acquiring")
211 IC("network-error")
212 IC("network-offline")
213 IC("network-receive")
214 IC("network-transmit-receive")
215 IC("network-transmit")
216 IC("network-idle")
217 IC("network-vpn")
218 IC("network-vpn-acquiring")
219 IC("network-wireless-acquiring")
220 IC("network-wireless-encrypted")
221 IC("network-wireless-signal-excellent")
222 IC("network-wireless-signal-good")
223 IC("network-wireless-signal-none")
224 IC("network-wireless-signal-ok")
225 IC("network-wireless-signal-weak")
226 IC("printer-error")
227 IC("printer-printing")
228 IC("printer-warning")
229 IC("security-high")
230 IC("security-medium")
231 IC("security-low")
232 IC("software-update-available")
233 IC("software-update-urgent")
234 IC("task-due")
235 IC("task-past-due")
236 IC("user-available")
237 IC("user-away")
238 IC("user-busy")
239 IC("user-invisible")
240 IC("user-idle")
241 IC("user-offline")
242 IC("user-trash-full")
243 IC("weather-clear-night")
244 IC("weather-clear")
245 IC("weather-clouds-night")
246 IC("weather-clouds")
247 IC("weather-few-clouds-night")
248 IC("weather-few-clouds")
249 IC("weather-fog")
250 IC("weather-overcast")
251 IC("weather-severe-alert")
252 IC("weather-showers-scattered")
253 IC("weather-showers")
254 IC("weather-snow")
255 IC("weather-storm")
256 IC("mail-attachment")
257 IC("mail-unread")
258 IC("mail-read")
259 IC("mail-replied")
260 IC("mail-signed")
261 IC("mail-signed-verified")
262 IC("starred")
263 IC("non-starred")
264 IC("audio-card")
265 IC("audio-input-microphone")
266 IC("battery")
267 IC("camera")
268 IC("camera-photo")
269 IC("camera-web")
270 IC("camera-video")
271 IC("drive-harddisk")
272 IC("drive-harddisk-ieee1394")
273 IC("drive-harddisk-usb")
274 IC("drive-optical")
275 IC("drive-removable-media")
276 IC("drive-removable-media-ieee1394")
277 IC("drive-removable-media-usb")
278 IC("computer")
279 IC("computer-laptop")
280 IC("multimedia-player")
281 IC("media-optical")
282 IC("media-optical-cd")
283 IC("media-optical-audio")
284 IC("media-optical-dvd")
285 IC("media-optical-bd")
286 IC("media-flash")
287 IC("media-flash-cf")
288 IC("media-flash-ms")
289 IC("media-flash-sd")
290 IC("media-flash-sm")
291 IC("media-floppy")
292 IC("media-zip")
293 IC("media-tape")
294 IC("media-memory")
295 IC("processor")
296 IC("input-mouse")
297 IC("input-tablet")
298 IC("input-keyboard")
299 IC("input-gaming")
300 IC("pda")
301 IC("phone")
302 IC("printer")
303 IC("scanner")
304 IC("modem")
305 IC("video-display")
306 IC("network-wired")
307 IC("network-wireless")
308 IC("applications-accessories")
309 IC("applications-development")
310 IC("applications-games")
311 IC("applications-graphics")
312 IC("applications-internet")
313 IC("applications-multimedia")
314 IC("applications-office")
315 IC("applications-other")
316 IC("applications-science")
317 IC("applications-system")
318 IC("applications-utilities")
319 IC("preferences-desktop")
320 IC("preferences-system")
321 IC("preferences-other")
322 IC("preferences-color")
323 IC("preferences-profile")
324 IC("preferences-desktop-display")
325 IC("preferences-desktop-font")
326 IC("preferences-desktop-keyboard")
327 IC("preferences-desktop-locale")
328 IC("preferences-desktop-multimedia")
329 IC("preferences-desktop-screensaver")
330 IC("preferences-desktop-theme")
331 IC("preferences-desktop-wallpaper")
332 IC("system-file-manager")
333 IC("flag-ad")
334 IC("flag-af")
335 IC("flag-al")
336 IC("flag-am")
337 IC("flag-ar")
338 IC("flag-at")
339 IC("flag-au")
340 IC("flag-az")
341 IC("flag-ba")
342 IC("flag-bd")
343 IC("flag-be")
344 IC("flag-bg")
345 IC("flag-br")
346 IC("flag-bt")
347 IC("flag-bw")
348 IC("flag-by")
349 IC("flag-ca")
350 IC("flag-cd")
351 IC("flag-ch")
352 IC("flag-cm")
353 IC("flag-cn")
354 IC("flag-cz")
355 IC("flag-de")
356 IC("flag-dk")
357 IC("flag-ee")
358 IC("flag-es")
359 IC("flag-et")
360 IC("flag-fi")
361 IC("flag-fo")
362 IC("flag-fr")
363 IC("flag-gb")
364 IC("flag-ge")
365 IC("flag-gh")
366 IC("flag-gn")
367 IC("flag-gr")
368 IC("flag-hr")
369 IC("flag-hu")
370 IC("flag-ie")
371 IC("flag-il")
372 IC("flag-in")
373 IC("flag-iq")
374 IC("flag-ir")
375 IC("flag-is")
376 IC("flag-it")
377 IC("flag-jp")
378 IC("flag-ke")
379 IC("flag-kg")
380 IC("flag-kh")
381 IC("flag-kr")
382 IC("flag-ku")
383 IC("flag-kz")
384 IC("flag-la")
385 IC("flag-lk")
386 IC("flag-lt")
387 IC("flag-lv")
388 IC("flag-ma")
389 IC("flag-md")
390 IC("flag-me")
391 IC("flag-mk")
392 IC("flag-ml")
393 IC("flag-mm")
394 IC("flag-mn")
395 IC("flag-mt")
396 IC("flag-mv")
397 IC("flag-my")
398 IC("flag-ng")
399 IC("flag-nl")
400 IC("flag-no")
401 IC("flag-np")
402 IC("flag-ph")
403 IC("flag-pk")
404 IC("flag-pl")
405 IC("flag-pt")
406 IC("flag-ro")
407 IC("flag-rs")
408 IC("flag-ru")
409 IC("flag-se")
410 IC("flag-si")
411 IC("flag-sk")
412 IC("flag-sn")
413 IC("flag-sy")
414 IC("flag-th")
415 IC("flag-tj")
416 IC("flag-tm")
417 IC("flag-tr")
418 IC("flag-tw")
419 IC("flag-tz")
420 IC("flag-ua")
421 IC("flag-us")
422 IC("flag-uz")
423 IC("flag-vn")
424 IC("flag-za")
425 IC("inode-directory")
426
427 eina_value_flush(&vtext);
428 return model;
429}
430
431static void
432_item_constructing(void *data EINA_UNUSED, const Efl_Event *ev)
433{
434 Efl_Gfx_Entity *item = ev->info;
435
436 if (!efl_key_data_get(item, "efl.ui.widget.factory.size_set"))
437 efl_gfx_hint_size_min_set(item, EINA_SIZE2D(100, 100));
438}
439
440EAPI_MAIN void
441efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
442{
443 Efl_Ui_Factory *factory, *image_factory;
444 Efl_Ui_Win *win;
445 Efl_Ui_Grid_View *grid;
446 Eo *model;
447 Efl_Ui_Select_Model *selmodel;
448
449 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
450
451 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
452 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
453 efl_text_set(efl_added, "Efl.Ui.Grid_View example"),
454 efl_ui_win_autodel_set(efl_added, EINA_TRUE)
455 );
456
457 model = _make_model(win);
458 selmodel = efl_add(EFL_UI_SELECT_MODEL_CLASS, efl_main_loop_get()
459 , efl_ui_view_model_set(efl_added, model)
460 );
461
462 image_factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
463 efl_ui_widget_factory_item_class_set(image_factory, EFL_UI_IMAGE_CLASS);
464 efl_ui_property_bind(image_factory, "icon", "title");
465
466 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
467 efl_ui_widget_factory_item_class_set(factory, EFL_UI_GRID_DEFAULT_ITEM_CLASS);
468 efl_ui_property_bind(factory, "efl.text", "title");
469 efl_ui_factory_bind(factory, "icon", image_factory);
470 efl_event_callback_add(factory, EFL_UI_FACTORY_EVENT_ITEM_CONSTRUCTING, _item_constructing, NULL);
471
472 grid = efl_add(EFL_UI_GRID_VIEW_CLASS, win,
473 efl_ui_collection_view_factory_set(efl_added, factory),
474 efl_ui_view_model_set(efl_added, selmodel)
475 );
476 evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
477 evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
478
479 efl_content_set(win, grid);
480 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 320));
481}
482EFL_MAIN()
diff --git a/src/examples/elementary/meson.build b/src/examples/elementary/meson.build
index 53489299cb..380d3ef446 100644
--- a/src/examples/elementary/meson.build
+++ b/src/examples/elementary/meson.build
@@ -120,7 +120,8 @@ examples = [
120 'efl_ui_theme_example_02', 120 'efl_ui_theme_example_02',
121 'efl_ui_slideshow_example', 121 'efl_ui_slideshow_example',
122 'efl_ui_radio_example_01', 122 'efl_ui_radio_example_01',
123 'efl_ui_grid_example_1' 123 'efl_ui_grid_example_1',
124 'efl_ui_grid_view_example_1'
124] 125]
125 126
126foreach example : examples 127foreach example : examples