summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2014-09-25 08:47:18 +0200
committerSebastian Dransfeld <sd@tango.flipp.net>2014-09-25 08:47:45 +0200
commit793fd5e84775931cf491bf81ccbbee174feda05c (patch)
treeae7a7eb7692bad4944abc0e9dabd9f17bf4cef99
parentc700192736ef2ca8975a050e5be207df9f19f62c (diff)
efreet: Implement fields added by desktop spec 1.1
-rw-r--r--src/bin/efreet/efreet_desktop_cache_create.c7
-rw-r--r--src/lib/efreet/efreet_cache.c26
-rw-r--r--src/lib/efreet/efreet_cache_private.h2
-rw-r--r--src/lib/efreet/efreet_desktop.c146
-rw-r--r--src/lib/efreet/efreet_desktop.h26
5 files changed, 206 insertions, 1 deletions
diff --git a/src/bin/efreet/efreet_desktop_cache_create.c b/src/bin/efreet/efreet_desktop_cache_create.c
index ff0a106437..4fa3ef4397 100644
--- a/src/bin/efreet/efreet_desktop_cache_create.c
+++ b/src/bin/efreet/efreet_desktop_cache_create.c
@@ -40,6 +40,7 @@ static Eina_Hash *generic_name = NULL;
40static Eina_Hash *comment = NULL; 40static Eina_Hash *comment = NULL;
41static Eina_Hash *exec = NULL; 41static Eina_Hash *exec = NULL;
42static Eina_Hash *environments = NULL; 42static Eina_Hash *environments = NULL;
43static Eina_Hash *keywords = NULL;
43 44
44static int 45static int
45cache_add(const char *path, const char *file_id, int priority EINA_UNUSED, int *changed) 46cache_add(const char *path, const char *file_id, int priority EINA_UNUSED, int *changed)
@@ -112,6 +113,7 @@ cache_add(const char *path, const char *file_id, int priority EINA_UNUSED, int *
112 array->array[array->array_count++] = desk->orig_path; \ 113 array->array[array->array_count++] = desk->orig_path; \
113 eina_hash_set((hash), data, array); \ 114 eina_hash_set((hash), data, array); \
114 } 115 }
116 /* Desktop Spec 1.0 */
115 ADD_LIST(desk->mime_types, mime_types); 117 ADD_LIST(desk->mime_types, mime_types);
116 ADD_LIST(desk->categories, categories); 118 ADD_LIST(desk->categories, categories);
117 ADD_ELEM(desk->startup_wm_class, startup_wm_class); 119 ADD_ELEM(desk->startup_wm_class, startup_wm_class);
@@ -123,6 +125,8 @@ cache_add(const char *path, const char *file_id, int priority EINA_UNUSED, int *
123 ADD_LIST(desk->not_show_in, environments); 125 ADD_LIST(desk->not_show_in, environments);
124 eina_hash_add(file_ids, file_id, desk->orig_path); 126 eina_hash_add(file_ids, file_id, desk->orig_path);
125 eina_hash_add(desktops, desk->orig_path, desk); 127 eina_hash_add(desktops, desk->orig_path, desk);
128 /* Desktop Spec 1.1 */
129 ADD_LIST(desk->keywords, keywords);
126 } 130 }
127 else 131 else
128 efreet_desktop_free(desk); 132 efreet_desktop_free(desk);
@@ -388,6 +392,7 @@ main(int argc, char **argv)
388 comment = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free)); 392 comment = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free));
389 exec = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free)); 393 exec = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free));
390 environments = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free)); 394 environments = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free));
395 keywords = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_array_string_free));
391 396
392 dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(), 397 dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
393 "applications"); 398 "applications");
@@ -438,6 +443,7 @@ main(int argc, char **argv)
438 STORE_HASH_ARRAY(comment); 443 STORE_HASH_ARRAY(comment);
439 STORE_HASH_ARRAY(exec); 444 STORE_HASH_ARRAY(exec);
440 STORE_HASH_ARRAY(environments); 445 STORE_HASH_ARRAY(environments);
446 STORE_HASH_ARRAY(keywords);
441 if (eina_hash_population(file_ids) > 0) 447 if (eina_hash_population(file_ids) > 0)
442 { 448 {
443 hash.hash = file_ids; 449 hash.hash = file_ids;
@@ -452,6 +458,7 @@ main(int argc, char **argv)
452 eina_hash_free(comment); 458 eina_hash_free(comment);
453 eina_hash_free(exec); 459 eina_hash_free(exec);
454 eina_hash_free(environments); 460 eina_hash_free(environments);
461 eina_hash_free(keywords);
455 462
456 if (old_file_ids) 463 if (old_file_ids)
457 { 464 {
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index db29e17b4b..23c9e4462f 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -71,6 +71,7 @@ static const char *theme_name = NULL;
71 71
72static Eet_Data_Descriptor *version_edd = NULL; 72static Eet_Data_Descriptor *version_edd = NULL;
73static Eet_Data_Descriptor *desktop_edd = NULL; 73static Eet_Data_Descriptor *desktop_edd = NULL;
74static Eet_Data_Descriptor *desktop_action_edd = NULL;
74static Eet_Data_Descriptor *hash_array_string_edd = NULL; 75static Eet_Data_Descriptor *hash_array_string_edd = NULL;
75static Eet_Data_Descriptor *array_string_edd = NULL; 76static Eet_Data_Descriptor *array_string_edd = NULL;
76static Eet_Data_Descriptor *hash_string_edd = NULL; 77static Eet_Data_Descriptor *hash_string_edd = NULL;
@@ -429,6 +430,7 @@ efreet_cache_edd_shutdown(void)
429{ 430{
430 EDD_SHUTDOWN(version_edd); 431 EDD_SHUTDOWN(version_edd);
431 EDD_SHUTDOWN(desktop_edd); 432 EDD_SHUTDOWN(desktop_edd);
433 EDD_SHUTDOWN(desktop_action_edd);
432 EDD_SHUTDOWN(hash_array_string_edd); 434 EDD_SHUTDOWN(hash_array_string_edd);
433 EDD_SHUTDOWN(array_string_edd); 435 EDD_SHUTDOWN(array_string_edd);
434 EDD_SHUTDOWN(hash_string_edd); 436 EDD_SHUTDOWN(hash_string_edd);
@@ -607,10 +609,21 @@ efreet_desktop_edd(void)
607 609
608 if (desktop_edd) return desktop_edd; 610 if (desktop_edd) return desktop_edd;
609 611
612 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Efreet_Desktop_Action);
613 desktop_action_edd = eet_data_descriptor_file_new(&eddc);
614 if (!desktop_action_edd) return NULL;
615
616 /* Desktop Spec 1.1 */
617 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_action_edd, Efreet_Desktop_Action, "key", key, EET_T_STRING);
618 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_action_edd, Efreet_Desktop_Action, "name", name, EET_T_STRING);
619 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_action_edd, Efreet_Desktop_Action, "icon", icon, EET_T_STRING);
620 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_action_edd, Efreet_Desktop_Action, "exec", exec, EET_T_STRING);
621
610 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Efreet_Cache_Desktop); 622 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Efreet_Cache_Desktop);
611 desktop_edd = eet_data_descriptor_file_new(&eddc); 623 desktop_edd = eet_data_descriptor_file_new(&eddc);
612 if (!desktop_edd) return NULL; 624 if (!desktop_edd) return NULL;
613 625
626 /* Desktop Spec 1.0 */
614 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "type", desktop.type, EET_T_INT); 627 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "type", desktop.type, EET_T_INT);
615 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "version", desktop.version, EET_T_STRING); 628 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "version", desktop.version, EET_T_STRING);
616 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "orig_path", desktop.orig_path, EET_T_STRING); 629 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "orig_path", desktop.orig_path, EET_T_STRING);
@@ -634,6 +647,13 @@ efreet_desktop_edd(void)
634 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "terminal", desktop.terminal, EET_T_UCHAR); 647 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "terminal", desktop.terminal, EET_T_UCHAR);
635 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "startup_notify", desktop.startup_notify, EET_T_UCHAR); 648 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "startup_notify", desktop.startup_notify, EET_T_UCHAR);
636 649
650 /* Desktop Spec 1.1 */
651 EET_DATA_DESCRIPTOR_ADD_BASIC(desktop_edd, Efreet_Cache_Desktop, "dbus_activatable", desktop.dbus_activatable, EET_T_UCHAR);
652 EET_DATA_DESCRIPTOR_ADD_LIST(desktop_edd, Efreet_Cache_Desktop,
653 "actions", desktop.actions, desktop_action_edd);
654 eet_data_descriptor_element_add(desktop_edd, "implements", EET_T_STRING, EET_G_LIST, offsetof(Efreet_Cache_Desktop, desktop.implements), 0, NULL, NULL);
655 eet_data_descriptor_element_add(desktop_edd, "keywords", EET_T_STRING, EET_G_LIST, offsetof(Efreet_Cache_Desktop, desktop.keywords), 0, NULL, NULL);
656
637 return desktop_edd; 657 return desktop_edd;
638} 658}
639 659
@@ -886,11 +906,17 @@ efreet_cache_desktop_free(Efreet_Desktop *desktop)
886 } 906 }
887 } 907 }
888 908
909 /* Desktop Spec 1.0 */
889 eina_list_free(desktop->only_show_in); 910 eina_list_free(desktop->only_show_in);
890 eina_list_free(desktop->not_show_in); 911 eina_list_free(desktop->not_show_in);
891 eina_list_free(desktop->categories); 912 eina_list_free(desktop->categories);
892 eina_list_free(desktop->mime_types); 913 eina_list_free(desktop->mime_types);
893 IF_FREE_HASH(desktop->x); 914 IF_FREE_HASH(desktop->x);
915 /* Desktop Spec 1.1 */
916 eina_list_free(desktop->actions);
917 eina_list_free(desktop->implements);
918 eina_list_free(desktop->keywords);
919
894 free(desktop); 920 free(desktop);
895 eina_lock_release(&_lock); 921 eina_lock_release(&_lock);
896} 922}
diff --git a/src/lib/efreet/efreet_cache_private.h b/src/lib/efreet/efreet_cache_private.h
index 9729215f9e..af178baaad 100644
--- a/src/lib/efreet/efreet_cache_private.h
+++ b/src/lib/efreet/efreet_cache_private.h
@@ -1,7 +1,7 @@
1#ifndef EFREET_CACHE_PRIVATE_H 1#ifndef EFREET_CACHE_PRIVATE_H
2#define EFREET_CACHE_PRIVATE_H 2#define EFREET_CACHE_PRIVATE_H
3 3
4#define EFREET_DESKTOP_CACHE_MAJOR 1 4#define EFREET_DESKTOP_CACHE_MAJOR 2
5#define EFREET_DESKTOP_CACHE_MINOR 0 5#define EFREET_DESKTOP_CACHE_MINOR 0
6#define EFREET_DESKTOP_UTILS_CACHE_MAJOR 1 6#define EFREET_DESKTOP_UTILS_CACHE_MAJOR 1
7#define EFREET_DESKTOP_UTILS_CACHE_MINOR 0 7#define EFREET_DESKTOP_UTILS_CACHE_MINOR 0
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index 6f0be5b422..f857de8fa7 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -52,8 +52,11 @@ static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str)
52static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info); 52static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info);
53static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, 53static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop,
54 Efreet_Ini *ini); 54 Efreet_Ini *ini);
55static Eina_List *efreet_desktop_action_fields_parse(Efreet_Ini *ini, const char *val);
55static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop, 56static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop,
56 Efreet_Ini *ini); 57 Efreet_Ini *ini);
58static void efreet_desktop_action_fields_save(Efreet_Desktop *desktop,
59 Efreet_Ini *ini);
57static void *efreet_desktop_link_fields_parse(Efreet_Desktop *desktop, 60static void *efreet_desktop_link_fields_parse(Efreet_Desktop *desktop,
58 Efreet_Ini *ini); 61 Efreet_Ini *ini);
59static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop, 62static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop,
@@ -349,6 +352,9 @@ efreet_desktop_free(Efreet_Desktop *desktop)
349 } 352 }
350 else 353 else
351 { 354 {
355 Efreet_Desktop_Action *action;
356
357 /* Desktop Spec 1.0 */
352 IF_FREE(desktop->orig_path); 358 IF_FREE(desktop->orig_path);
353 359
354 IF_FREE(desktop->version); 360 IF_FREE(desktop->version);
@@ -378,6 +384,19 @@ efreet_desktop_free(Efreet_Desktop *desktop)
378 if (info->free_func) 384 if (info->free_func)
379 info->free_func(desktop->type_data); 385 info->free_func(desktop->type_data);
380 } 386 }
387
388 /* Desktop Spec 1.1 */
389 EINA_LIST_FREE(desktop->actions, action)
390 {
391 free(action->key);
392 free(action->name);
393 free(action->icon);
394 free(action->exec);
395 free(action);
396 }
397 IF_FREE_LIST(desktop->implements, eina_stringshare_del);
398 IF_FREE_LIST(desktop->keywords, eina_stringshare_del);
399
381 free(desktop); 400 free(desktop);
382 } 401 }
383 eina_lock_release(&_lock); 402 eina_lock_release(&_lock);
@@ -710,6 +729,7 @@ efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini
710{ 729{
711 const char *val; 730 const char *val;
712 731
732 /* Desktop Spec 1.0 */
713 val = efreet_ini_string_get(ini, "TryExec"); 733 val = efreet_ini_string_get(ini, "TryExec");
714 if (val) desktop->try_exec = strdup(val); 734 if (val) desktop->try_exec = strdup(val);
715 735
@@ -731,11 +751,61 @@ efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini
731 desktop->terminal = efreet_ini_boolean_get(ini, "Terminal"); 751 desktop->terminal = efreet_ini_boolean_get(ini, "Terminal");
732 desktop->startup_notify = efreet_ini_boolean_get(ini, "StartupNotify"); 752 desktop->startup_notify = efreet_ini_boolean_get(ini, "StartupNotify");
733 753
754 /* Desktop Spec 1.1 */
755 val = efreet_ini_string_get(ini, "Actions");
756 if (val)
757 desktop->actions = efreet_desktop_action_fields_parse(ini, val);
758 val = efreet_ini_string_get(ini, "Keywords");
759 if (val)
760 desktop->keywords = efreet_desktop_string_list_parse(val);
761
734 return NULL; 762 return NULL;
735} 763}
736 764
737/** 765/**
738 * @internal 766 * @internal
767 * @param key the key to look up Desktop Action entry
768 * @return list of Desktop Actions
769 */
770static Eina_List *
771efreet_desktop_action_fields_parse(Efreet_Ini *ini, const char *actions)
772{
773 Eina_List *l;
774 Eina_List *ret = NULL;
775 const char *section;
776 const char *key;
777
778 // TODO: section = efreet_ini_section_get(ini);
779 section = "Desktop Entry";
780
781 l = efreet_desktop_string_list_parse(actions);
782 EINA_LIST_FREE(l, key)
783 {
784 char entry[4096];
785 Efreet_Desktop_Action *act;
786
787 snprintf(entry, sizeof(entry), "Desktop Action %s", key);
788
789 if (!efreet_ini_section_set(ini, entry)) continue;
790
791 act = NEW(Efreet_Desktop_Action, 1);
792 if (!act) continue;
793 ret = eina_list_append(ret, act);
794 act->key = strdup(key);
795 act->name = eina_strdup(efreet_ini_localestring_get(ini, "Name"));
796 act->icon = eina_strdup(efreet_ini_localestring_get(ini, "Icon"));
797 act->exec = eina_strdup(efreet_ini_string_get(ini, "Exec"));
798
799 /* TODO: Non-standard keys OnlyShowIn, NotShowIn used by Unity */
800
801 eina_stringshare_del(key);
802 }
803 efreet_ini_section_set(ini, section);
804 return ret;
805}
806
807/**
808 * @internal
739 * @param desktop the Efreet_Desktop to save fields from 809 * @param desktop the Efreet_Desktop to save fields from
740 * @param ini the Efreet_Ini to save fields to 810 * @param ini the Efreet_Ini to save fields to
741 * @return Returns no value 811 * @return Returns no value
@@ -746,6 +816,7 @@ efreet_desktop_application_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
746{ 816{
747 char *val; 817 char *val;
748 818
819 /* Desktop Spec 1.0 */
749 if (desktop->try_exec) 820 if (desktop->try_exec)
750 efreet_ini_string_set(ini, "TryExec", desktop->try_exec); 821 efreet_ini_string_set(ini, "TryExec", desktop->try_exec);
751 822
@@ -780,6 +851,60 @@ efreet_desktop_application_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
780 851
781 efreet_ini_boolean_set(ini, "Terminal", desktop->terminal); 852 efreet_ini_boolean_set(ini, "Terminal", desktop->terminal);
782 efreet_ini_boolean_set(ini, "StartupNotify", desktop->startup_notify); 853 efreet_ini_boolean_set(ini, "StartupNotify", desktop->startup_notify);
854
855 /* Desktop Spec 1.1 */
856 if (desktop->actions)
857 efreet_desktop_action_fields_save(desktop, ini);
858 if (desktop->keywords)
859 {
860 val = efreet_desktop_string_list_join(desktop->keywords);
861 if (val)
862 {
863 efreet_ini_string_set(ini, "Keywords", val);
864 free(val);
865 }
866 }
867}
868
869/**
870 * @internal
871 * @param desktop the Efreet_Desktop to save fields from
872 * @param ini the Efreet_Ini to save fields to
873 * @return Returns no value
874 * @brief Save action specific desktop fields
875 */
876static void
877efreet_desktop_action_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
878{
879 Eina_List *actions = NULL, *l;
880 const char *section;
881 char *join;
882 Efreet_Desktop_Action *action;
883
884 // TODO: section = efreet_ini_section_get(ini);
885 section = "Desktop Entry";
886
887 EINA_LIST_FOREACH(desktop->actions, l, action)
888 {
889 char entry[4096];
890
891 actions = eina_list_append(actions, action->key);
892 snprintf(entry, sizeof(entry), "Desktop Action %s", action->key);
893 efreet_ini_section_add(ini, entry);
894 efreet_ini_section_set(ini, entry);
895
896 efreet_ini_localestring_set(ini, "Name", action->name);
897 efreet_ini_localestring_set(ini, "Icon", action->icon);
898 efreet_ini_string_set(ini, "Exec", action->exec);
899 }
900 efreet_ini_section_set(ini, section);
901 join = efreet_desktop_string_list_join(actions);
902 if (join)
903 {
904 efreet_ini_string_set(ini, "Actions", join);
905 free(join);
906 }
907 eina_list_free(actions);
783} 908}
784 909
785/** 910/**
@@ -824,6 +949,7 @@ efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini)
824{ 949{
825 const char *val; 950 const char *val;
826 951
952 /* Desktop Spec 1.0 */
827 val = efreet_ini_localestring_get(ini, "Name"); 953 val = efreet_ini_localestring_get(ini, "Name");
828#ifndef STRICT_SPEC 954#ifndef STRICT_SPEC
829 if (!val) val = efreet_ini_localestring_get(ini, "_Name"); 955 if (!val) val = efreet_ini_localestring_get(ini, "_Name");
@@ -855,6 +981,10 @@ efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini)
855 val = efreet_ini_string_get(ini, "NotShowIn"); 981 val = efreet_ini_string_get(ini, "NotShowIn");
856 if (val) desktop->not_show_in = efreet_desktop_string_list_parse(val); 982 if (val) desktop->not_show_in = efreet_desktop_string_list_parse(val);
857 983
984 /* Desktop Spec 1.1 */
985 desktop->dbus_activatable = efreet_ini_boolean_get(ini, "DBusActivatable");
986 val = efreet_ini_string_get(ini, "Implements");
987 if (val) desktop->implements = efreet_desktop_string_list_parse(val);
858 return 1; 988 return 1;
859} 989}
860 990
@@ -870,6 +1000,7 @@ efreet_desktop_generic_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
870{ 1000{
871 const char *val; 1001 const char *val;
872 1002
1003 /* Desktop Spec 1.0 */
873 if (desktop->name) 1004 if (desktop->name)
874 { 1005 {
875 efreet_ini_localestring_set(ini, "Name", desktop->name); 1006 efreet_ini_localestring_set(ini, "Name", desktop->name);
@@ -904,6 +1035,20 @@ efreet_desktop_generic_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
904 1035
905 if (desktop->x) eina_hash_foreach(desktop->x, efreet_desktop_x_fields_save, 1036 if (desktop->x) eina_hash_foreach(desktop->x, efreet_desktop_x_fields_save,
906 ini); 1037 ini);
1038
1039 /* Desktop Spec 1.1 */
1040 efreet_ini_boolean_set(ini, "DBusActivatable", desktop->dbus_activatable);
1041 if (desktop->implements)
1042 {
1043 char *join;
1044
1045 join = efreet_desktop_string_list_join(desktop->implements);
1046 if (join)
1047 {
1048 efreet_ini_string_set(ini, "Implements", join);
1049 free(join);
1050 }
1051 }
907} 1052}
908 1053
909/** 1054/**
@@ -997,3 +1142,4 @@ efreet_desktop_environment_check(Efreet_Desktop *desktop)
997 1142
998 return 1; 1143 return 1;
999} 1144}
1145
diff --git a/src/lib/efreet/efreet_desktop.h b/src/lib/efreet/efreet_desktop.h
index fae8bac256..8f2c30a4e6 100644
--- a/src/lib/efreet/efreet_desktop.h
+++ b/src/lib/efreet/efreet_desktop.h
@@ -30,6 +30,12 @@ EAPI extern int EFREET_EVENT_DESKTOP_CACHE_UPDATE;
30EAPI extern int EFREET_EVENT_DESKTOP_CACHE_BUILD; 30EAPI extern int EFREET_EVENT_DESKTOP_CACHE_BUILD;
31 31
32/** 32/**
33 * Efreet_Desktop_Action
34 * @since 1.12
35 */
36typedef struct _Efreet_Desktop_Action Efreet_Desktop_Action;
37
38/**
33 * Efreet_Desktop 39 * Efreet_Desktop
34 */ 40 */
35typedef struct _Efreet_Desktop Efreet_Desktop; 41typedef struct _Efreet_Desktop Efreet_Desktop;
@@ -62,11 +68,25 @@ typedef void (*Efreet_Desktop_Type_Save_Cb) (Efreet_Desktop *desktop, Efreet_Ini
62typedef void *(*Efreet_Desktop_Type_Free_Cb) (void *data); 68typedef void *(*Efreet_Desktop_Type_Free_Cb) (void *data);
63 69
64/** 70/**
71 * Efreet_Desktop_Action
72 * @brief an action described in a .desktop file
73 * @since 1.12
74 */
75struct _Efreet_Desktop_Action
76{
77 char *key; /**< Key to identify the action */
78 char *name; /**< Specific name of the action */
79 char *icon; /**< Icon to display */
80 char *exec; /**< Program to execute */
81};
82
83/**
65 * Efreet_Desktop 84 * Efreet_Desktop
66 * @brief a parsed representation of a .desktop file 85 * @brief a parsed representation of a .desktop file
67 */ 86 */
68struct _Efreet_Desktop 87struct _Efreet_Desktop
69{ 88{
89 /* Desktop Spec 1.0 */
70 int type; /**< type of desktop file */ 90 int type; /**< type of desktop file */
71 91
72 int ref; /**< reference count - internal */ 92 int ref; /**< reference count - internal */
@@ -102,6 +122,12 @@ struct _Efreet_Desktop
102 122
103 Eina_Hash *x; /**< Keep track of all user extensions, keys that begin with X- */ 123 Eina_Hash *x; /**< Keep track of all user extensions, keys that begin with X- */
104 void *type_data; /**< Type specific data for custom types */ 124 void *type_data; /**< Type specific data for custom types */
125
126 /* Desktop Spec 1.1 */
127 unsigned char dbus_activatable; /**< Activate application by dbus, not Exec. @since 1.12 */
128 Eina_List *actions; /**< List of Efreet_Desktop_Actions, application actions. @since 1.12 */
129 Eina_List *implements; /**< Interfaces which is file implements. @since 1.12 */
130 Eina_List *keywords; /**< Keywords which describe this entry. @since 1.12 */
105}; 131};
106 132
107 133