summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--configure.ac19
-rw-r--r--elementary.pc.in5
-rw-r--r--src/bin/Makefile.am8
-rw-r--r--src/bin/test.c4
-rw-r--r--src/bin/test_icon_desktops.c112
-rw-r--r--src/bin/test_photo.c63
-rw-r--r--src/bin/test_photocam.c6
-rw-r--r--src/lib/Elementary.h.in10
-rw-r--r--src/lib/Makefile.am5
-rw-r--r--src/lib/elm_main.c74
10 files changed, 296 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 1fcc24327..8578d2871 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,24 @@ PKG_CHECK_MODULES([ELEMENTARY_EDBUS],
190) 190)
191AC_SUBST(ELM_EDBUS_DEF) 191AC_SUBST(ELM_EDBUS_DEF)
192 192
193ELM_EFREET_DEF="#undef"
194have_elementary_efreet="no"
195PKG_CHECK_MODULES([ELEMENTARY_EFREET],
196 [
197 efreet
198 efreet-mime
199 efreet-trash
200 ],
201 [
202 AC_DEFINE(HAVE_ELEMENTARY_EFREET, 1, [Efreet support for Elementary])
203 have_elementary_efreet="yes"
204 ELM_EFREET_DEF="#define"
205 requirement_elm="efreet efreet-mime efreet-trash ${requirement_elm}"
206 ],
207 [have_elementary_efreet="no"]
208)
209AC_SUBST(ELM_EFREET_DEF)
210
193ELM_ALLOCA_H_DEF="#undef" 211ELM_ALLOCA_H_DEF="#undef"
194AC_CHECK_HEADER(alloca.h, [ELM_ALLOCA_H_DEF="#define"]) 212AC_CHECK_HEADER(alloca.h, [ELM_ALLOCA_H_DEF="#define"])
195AC_SUBST(ELM_ALLOCA_H_DEF) 213AC_SUBST(ELM_ALLOCA_H_DEF)
@@ -251,6 +269,7 @@ echo " Windows CE....: ${have_elementary_wince}"
251echo 269echo
252echo "Features:" 270echo "Features:"
253echo " EDBus.........: ${have_elementary_edbus}" 271echo " EDBus.........: ${have_elementary_edbus}"
272echo " EFreet........: ${have_elementary_efreet}"
254echo 273echo
255echo "edje_cc.........: ${edje_cc}" 274echo "edje_cc.........: ${edje_cc}"
256echo 275echo
diff --git a/elementary.pc.in b/elementary.pc.in
index 5fe7c28cb..ecf8705a1 100644
--- a/elementary.pc.in
+++ b/elementary.pc.in
@@ -8,5 +8,6 @@ Description: Mobile device touchscreen widget library
8Requires: @requirement_elm@ 8Requires: @requirement_elm@
9Version: @VERSION@ 9Version: @VERSION@
10Libs: -L${libdir} -lelementary 10Libs: -L${libdir} -lelementary
11Libs.private: @dlopen_libs@ @my_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@ @ELEMENTARY_FB_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ 11Libs.private: @dlopen_libs@ @my_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@
12Cflags: -I${includedir} -I${includedir}/elementary @ELEMENTARY_CFLAGS@ @ELEMENTARY_X_CFLAGS@ @ELEMENTARY_FB_CFLAGS@ @ELEMENTARY_WINCE_CFLAGS@ @ELEMENTARY_EDBUS_CFLAGS@ 12@ELEMENTARY_FB_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@
13Cflags: -I${includedir} -I${includedir}/elementary @ELEMENTARY_CFLAGS@ @ELEMENTARY_X_CFLAGS@ @ELEMENTARY_FB_CFLAGS@ @ELEMENTARY_WINCE_CFLAGS@ @ELEMENTARY_EDBUS_CFLAGS@ @ELEMENTARY_EFREET_CFLAGS@
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 7d3be9ac6..a6fe54cb7 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -13,7 +13,8 @@ AM_CPPFLAGS = \
13@ELEMENTARY_FB_CFLAGS@ \ 13@ELEMENTARY_FB_CFLAGS@ \
14@ELEMENTARY_WIN32_CFLAGS@ \ 14@ELEMENTARY_WIN32_CFLAGS@ \
15@ELEMENTARY_WINCE_CFLAGS@ \ 15@ELEMENTARY_WINCE_CFLAGS@ \
16@ELEMENTARY_EDBUS_CFLAGS@ 16@ELEMENTARY_EDBUS_CFLAGS@ \
17@ELEMENTARY_EFREET_CFLAGS@
17 18
18if ELEMENTARY_WINDOWS_BUILD 19if ELEMENTARY_WINDOWS_BUILD
19AM_CPPFLAGS += -DELEMENTARY_BUILD 20AM_CPPFLAGS += -DELEMENTARY_BUILD
@@ -57,7 +58,10 @@ test_separator.c \
57test_scroller.c \ 58test_scroller.c \
58test_spinner.c \ 59test_spinner.c \
59test_index.c \ 60test_index.c \
60test_photocam.c 61test_photocam.c \
62test_photo.c \
63test_icon_desktops.c
64
61elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la 65elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la
62elementary_test_LDFLAGS = 66elementary_test_LDFLAGS =
63 67
diff --git a/src/bin/test.c b/src/bin/test.c
index f6c4dcf2d..41f629498 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -48,6 +48,8 @@ void test_scroller(void *data, Evas_Object *obj, void *event_info);
48void test_spinner(void *data, Evas_Object *obj, void *event_info); 48void test_spinner(void *data, Evas_Object *obj, void *event_info);
49void test_index(void *data, Evas_Object *obj, void *event_info); 49void test_index(void *data, Evas_Object *obj, void *event_info);
50void test_photocam(void *data, Evas_Object *obj, void *event_info); 50void test_photocam(void *data, Evas_Object *obj, void *event_info);
51void test_photo(void *data, Evas_Object *obj, void *event_info);
52void test_icon_desktops(void *data, Evas_Object *obj, void *event_info);
51 53
52static void 54static void
53my_win_del(void *data, Evas_Object *obj, void *event_info) 55my_win_del(void *data, Evas_Object *obj, void *event_info)
@@ -177,6 +179,8 @@ my_win_main(void)
177 elm_list_item_append(li, "Spinner", NULL, NULL, test_spinner, NULL); 179 elm_list_item_append(li, "Spinner", NULL, NULL, test_spinner, NULL);
178 elm_list_item_append(li, "Index", NULL, NULL, test_index, NULL); 180 elm_list_item_append(li, "Index", NULL, NULL, test_index, NULL);
179 elm_list_item_append(li, "Photocam", NULL, NULL, test_photocam, NULL); 181 elm_list_item_append(li, "Photocam", NULL, NULL, test_photocam, NULL);
182 elm_list_item_append(li, "Photo", NULL, NULL, test_photo, NULL);
183 elm_list_item_append(li, "Icon Desktops", NULL, NULL, test_icon_desktops, NULL);
180 184
181 elm_list_go(li); 185 elm_list_go(li);
182 186
diff --git a/src/bin/test_icon_desktops.c b/src/bin/test_icon_desktops.c
new file mode 100644
index 000000000..dae810e84
--- /dev/null
+++ b/src/bin/test_icon_desktops.c
@@ -0,0 +1,112 @@
1#include <Elementary.h>
2
3static Elm_Genlist_Item_Class it_desk;
4
5static char *
6desk_gl_label_get(const void *data, Evas_Object *obj, const char *part)
7{
8#ifdef ELM_EFREET
9 Efreet_Desktop *d = (Efreet_Desktop *)data;
10 return strdup(d->name);
11#else
12 return NULL;
13#endif
14}
15static Evas_Object *
16desk_gl_icon_get(const void *data, Evas_Object *obj, const char *part)
17{
18 // FIXME: elm_icon should grok this
19#ifdef ELM_EFREET
20 Efreet_Desktop *d = (Efreet_Desktop *)data;
21 char *path;
22 Evas_Object *ic;
23 ic = elm_icon_add(obj);
24 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
25 if (!(!strcmp(part, "elm.swallow.icon"))) return ic;
26 if (!d->icon) return ic;
27 path = efreet_icon_path_find("default", d->icon, 48);
28 if (!path)
29 {
30 path = efreet_icon_path_find("hicolor", d->icon, 48);
31 if (!path)
32 {
33 path = efreet_icon_path_find("gnome", d->icon, 48);
34 if (!path)
35 {
36 path = efreet_icon_path_find("Human", d->icon, 48);
37 }
38 }
39 }
40 if (path)
41 {
42 elm_icon_file_set(ic, path, NULL);
43 free(path);
44 return ic;
45 }
46 return ic;
47#else
48 return NULL;
49#endif
50}
51static void
52desk_gl_del(const void *data, Evas_Object *obj)
53{
54#ifdef ELM_EFREET
55 Efreet_Desktop *d = (Efreet_Desktop *)data;
56 efreet_desktop_free(d);
57#endif
58}
59
60static void
61desktop_sel(void *data, Evas_Object *obj, void *event_info)
62{
63 printf("sel\n");
64}
65
66void
67test_icon_desktops(void *data, Evas_Object *obj, void *event_info)
68{
69 Evas_Object *win, *bg, *gl;
70 Eina_List *desktops, *l;
71
72 win = elm_win_add(NULL, "icon_desktops", ELM_WIN_BASIC);
73 elm_win_title_set(win, "Icon Desktops");
74 elm_win_autodel_set(win, 1);
75
76 bg = elm_bg_add(win);
77 evas_object_size_hint_weight_set(bg, 1.0, 1.0);
78 elm_win_resize_object_add(win, bg);
79 evas_object_show(bg);
80
81 it_desk.item_style = "default";
82 it_desk.func.label_get = desk_gl_label_get;
83 it_desk.func.icon_get = desk_gl_icon_get;
84 it_desk.func.state_get = NULL;
85 it_desk.func.del = desk_gl_del;
86
87 gl = elm_genlist_add(win);
88 evas_object_size_hint_weight_set(gl, 1.0, 1.0);
89 elm_win_resize_object_add(win, gl);
90 evas_object_show(gl);
91
92#ifdef ELM_EFREET
93 elm_need_efreet();
94 desktops = efreet_util_desktop_name_glob_list("*");
95 if (desktops)
96 {
97 Efreet_Desktop *d;
98
99 EINA_LIST_FOREACH(desktops, l, d)
100 {
101 elm_genlist_item_append(gl, &it_desk, d,
102 NULL, ELM_GENLIST_ITEM_NONE,
103 desktop_sel, NULL);
104// efreet_desktop_free(d);
105 }
106 eina_list_free(desktops);
107 }
108#endif
109
110 evas_object_resize(win, 320, 480);
111 evas_object_show(win);
112}
diff --git a/src/bin/test_photo.c b/src/bin/test_photo.c
new file mode 100644
index 000000000..8ff178b99
--- /dev/null
+++ b/src/bin/test_photo.c
@@ -0,0 +1,63 @@
1#include <Elementary.h>
2
3void
4test_photo(void *data, Evas_Object *obj, void *event_info)
5{
6 Evas_Object *win, *bg, *sc, *tb, *ph;
7 int i, j, n;
8 char buf[PATH_MAX];
9 const char *img[9] =
10 {
11 "panel_01.jpg",
12 "plant_01.jpg",
13 "rock_01.jpg",
14 "rock_02.jpg",
15 "sky_01.jpg",
16 "sky_02.jpg",
17 "sky_03.jpg",
18 "sky_04.jpg",
19 "wood_01.jpg"
20 };
21
22 win = elm_win_add(NULL, "photo", ELM_WIN_BASIC);
23 elm_win_title_set(win, "Photo");
24 elm_win_autodel_set(win, 1);
25
26 bg = elm_bg_add(win);
27 evas_object_size_hint_weight_set(bg, 1.0, 1.0);
28 elm_win_resize_object_add(win, bg);
29 evas_object_show(bg);
30
31 tb = elm_table_add(win);
32 evas_object_size_hint_weight_set(tb, 1.0, 1.0);
33
34 n = 0;
35 for (j = 0; j < 12; j++)
36 {
37 for (i = 0; i < 12; i++)
38 {
39 ph = elm_photo_add(win);
40 snprintf(buf, sizeof(buf), "%s/images/%s",
41 PACKAGE_DATA_DIR, img[n]);
42 n++;
43 if (n >= 9) n = 0;
44 elm_photo_file_set(ph, buf);
45 evas_object_size_hint_weight_set(ph, 1.0, 1.0);
46 evas_object_size_hint_align_set(ph, -1.0, -1.0);
47 elm_photo_size_set(ph, 80);
48 elm_table_pack(tb, ph, i, j, 1, 1);
49 evas_object_show(ph);
50 }
51 }
52
53 sc = elm_scroller_add(win);
54 evas_object_size_hint_weight_set(sc, 1.0, 1.0);
55 elm_win_resize_object_add(win, sc);
56
57 elm_scroller_content_set(sc, tb);
58 evas_object_show(tb);
59 evas_object_show(sc);
60
61 evas_object_resize(win, 300, 300);
62 evas_object_show(win);
63}
diff --git a/src/bin/test_photocam.c b/src/bin/test_photocam.c
index ad2f23d1e..6ea046cfc 100644
--- a/src/bin/test_photocam.c
+++ b/src/bin/test_photocam.c
@@ -12,8 +12,8 @@ test_photocam(void *data, Evas_Object *obj, void *event_info)
12 "/home/raster/t3.jpg" 12 "/home/raster/t3.jpg"
13 }; 13 };
14 14
15 win = elm_win_add(NULL, "photo", ELM_WIN_BASIC); 15 win = elm_win_add(NULL, "photocam", ELM_WIN_BASIC);
16 elm_win_title_set(win, "Photo"); 16 elm_win_title_set(win, "Photocam");
17 elm_win_autodel_set(win, 1); 17 elm_win_autodel_set(win, 1);
18 18
19 bg = elm_bg_add(win); 19 bg = elm_bg_add(win);
@@ -25,7 +25,7 @@ test_photocam(void *data, Evas_Object *obj, void *event_info)
25 evas_object_size_hint_weight_set(ph, 1.0, 1.0); 25 evas_object_size_hint_weight_set(ph, 1.0, 1.0);
26 elm_win_resize_object_add(win, ph); 26 elm_win_resize_object_add(win, ph);
27 27
28 elm_photocam_file_set(ph, img[1]); 28 elm_photocam_file_set(ph, img[2]);
29 29
30 evas_object_show(ph); 30 evas_object_show(ph);
31 31
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index a0165e112..c7bde1c71 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -15,6 +15,7 @@
15@ELM_WIN32_DEF@ ELM_WIN32 15@ELM_WIN32_DEF@ ELM_WIN32
16@ELM_WINCE_DEF@ ELM_WINCE 16@ELM_WINCE_DEF@ ELM_WINCE
17@ELM_EDBUS_DEF@ ELM_EDBUS 17@ELM_EDBUS_DEF@ ELM_EDBUS
18@ELM_EFREET_DEF@ ELM_EFREET
18@ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H 19@ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H
19@ELM_LIBINTL_H_DEF@ ELM_LIBINTL_H 20@ELM_LIBINTL_H_DEF@ ELM_LIBINTL_H
20 21
@@ -75,6 +76,12 @@
75# include <E_Hal.h> 76# include <E_Hal.h>
76#endif 77#endif
77 78
79#ifdef ELM_EFREET
80# include <Efreet.h>
81# include <Efreet_Mime.h>
82# include <Efreet_Trash.h>
83#endif
84
78#ifdef EAPI 85#ifdef EAPI
79# undef EAPI 86# undef EAPI
80#endif 87#endif
@@ -161,6 +168,9 @@ extern "C" {
161 EAPI void elm_quicklaunch_cleanup(void); 168 EAPI void elm_quicklaunch_cleanup(void);
162 EAPI int elm_quicklaunch_fallback(int argc, char **argv); 169 EAPI int elm_quicklaunch_fallback(int argc, char **argv);
163 EAPI char *elm_quicklaunch_exe_path_get(const char *exe); 170 EAPI char *elm_quicklaunch_exe_path_get(const char *exe);
171
172 EAPI void elm_need_efreet(void);
173 EAPI void elm_need_e_dbus(void);
164 174
165 EAPI void elm_object_scale_set(Evas_Object *obj, double scale); 175 EAPI void elm_object_scale_set(Evas_Object *obj, double scale);
166 EAPI double elm_object_scale_get(const Evas_Object *obj); 176 EAPI double elm_object_scale_get(const Evas_Object *obj);
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index a69660a6b..6f473ebfb 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -13,7 +13,8 @@ AM_CPPFLAGS = \
13@ELEMENTARY_FB_CFLAGS@ \ 13@ELEMENTARY_FB_CFLAGS@ \
14@ELEMENTARY_WIN32_CFLAGS@ \ 14@ELEMENTARY_WIN32_CFLAGS@ \
15@ELEMENTARY_WINCE_CFLAGS@ \ 15@ELEMENTARY_WINCE_CFLAGS@ \
16@ELEMENTARY_EDBUS_CFLAGS@ 16@ELEMENTARY_EDBUS_CFLAGS@ \
17@ELEMENTARY_EFREET_CFLAGS@
17 18
18if ELEMENTARY_WINDOWS_BUILD 19if ELEMENTARY_WINDOWS_BUILD
19AM_CPPFLAGS += -DELEMENTARY_BUILD 20AM_CPPFLAGS += -DELEMENTARY_BUILD
@@ -79,5 +80,5 @@ els_icon.h
79 80
80 81
81libelementary_la_CFLAGS = 82libelementary_la_CFLAGS =
82libelementary_la_LIBADD = @my_libs@ @dlopen_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@ @ELEMENTARY_FB_LIBS@ @ELEMENTARY_WIN32_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ 83libelementary_la_LIBADD = @my_libs@ @dlopen_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@ @ELEMENTARY_FB_LIBS@ @ELEMENTARY_WIN32_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@
83libelementary_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ 84libelementary_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c
index 24170a02f..8db228c53 100644
--- a/src/lib/elm_main.c
+++ b/src/lib/elm_main.c
@@ -348,6 +348,76 @@ elm_shutdown(void)
348 elm_quicklaunch_shutdown(); 348 elm_quicklaunch_shutdown();
349} 349}
350 350
351#ifdef ELM_EDBUS
352static Eina_Bool _elm_need_e_dbus = 0;
353#endif
354EAPI void
355elm_need_e_dbus(void)
356{
357#ifdef ELM_EDBUS
358 if (_elm_need_e_dbus) return;
359 _elm_need_e_dbus = 1;
360 e_dbus_init();
361#endif
362}
363
364static void
365_elm_unneed_e_dbus(void)
366{
367#ifdef ELM_EDBUS
368 if (_elm_need_e_dbus)
369 {
370 _elm_need_e_dbus = 0;
371 e_dbus_shutdown();
372 }
373#endif
374}
375
376#ifdef ELM_EFREET
377static Eina_Bool _elm_need_efreet = 0;
378#endif
379EAPI void
380elm_need_efreet(void)
381{
382#ifdef ELM_EFREET
383 if (_elm_need_efreet) return;
384 _elm_need_efreet = 1;
385 efreet_init();
386 efreet_util_init();
387 efreet_mime_init();
388 efreet_trash_init();
389 /*
390 {
391 Eina_List **list;
392
393 list = efreet_icon_extra_list_get();
394 if (list)
395 {
396 e_user_dir_concat_static(buf, "icons");
397 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
398 e_prefix_data_concat_static(buf, "data/icons");
399 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
400 }
401 }
402 */
403#endif
404}
405
406static void
407_elm_unneed_efreet(void)
408{
409#ifdef ELM_EDBUS
410 if (_elm_need_efreet)
411 {
412 _elm_need_efreet = 0;
413 efreet_trash_shutdown();
414 efreet_mime_shutdown();
415 efreet_util_shutdown();
416 efreet_shutdown();
417 }
418#endif
419}
420
351EAPI void 421EAPI void
352elm_quicklaunch_init(int argc, char **argv) 422elm_quicklaunch_init(int argc, char **argv)
353{ 423{
@@ -370,7 +440,7 @@ elm_quicklaunch_init(int argc, char **argv)
370 evas_init(); 440 evas_init();
371 edje_init(); 441 edje_init();
372 ecore_evas_init(); // FIXME: check errors 442 ecore_evas_init(); // FIXME: check errors
373 443
374 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL); 444 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
375 445
376 _elm_appname = strdup(ecore_file_file_get(argv[0])); 446 _elm_appname = strdup(ecore_file_file_get(argv[0]));
@@ -641,6 +711,8 @@ elm_quicklaunch_shutdown(void)
641 711
642 free(_elm_config); 712 free(_elm_config);
643 free(_elm_appname); 713 free(_elm_appname);
714 _elm_unneed_efreet();
715 _elm_unneed_e_dbus();
644 ecore_evas_shutdown(); 716 ecore_evas_shutdown();
645 edje_shutdown(); 717 edje_shutdown();
646 evas_shutdown(); 718 evas_shutdown();