summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_utils.h
blob: d0e3909e02a249223a8a2f57241f73e9be905afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#ifndef EFREET_UTILS_H
#define EFREET_UTILS_H

/**
 * @file efreet_utils.h
 * @brief Contains utility functions to ease usage of Efreet.
 *        FDO desktop entry specificiation.
 * @addtogroup Efreet_Utils Efreet utilities for FDO
 * @ingroup Efreet
 *
 * @{
 */


/**
 * Returns the fdo file id for a given path. If the file isn't inside
 * a default fdo path it will return NULL.
 *
 * @param path The path to find the file id for
 *
 * @return File id for path or NULL
 */
EFREET_API const char *efreet_util_path_to_file_id(const char *path);


/**
 * Find all desktops for a given mime type
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param mime the mime type
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_mime_list(const char *mime);


/**
 * Find all desktops for a given wm class
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param wmname the wm name
 * @param wmclass the wm class
 * @return a list of desktops
 */
EFREET_API Efreet_Desktop *efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass);

/**
 * Find a desktop by file id
 *
 * return value must be freed by efreet_desktop_free
 *
 * @param file_id the file id
 * @return a desktop
 */
EFREET_API Efreet_Desktop *efreet_util_desktop_file_id_find(const char *file_id);

/**
 * Find a desktop by exec
 *
 * return value must be freed by efreet_desktop_free
 *
 * @param exec the exec name
 * @return a desktop
 */
EFREET_API Efreet_Desktop *efreet_util_desktop_exec_find(const char *exec);

/**
 * Find a desktop by name
 *
 * return value must be freed by efreet_desktop_free
 *
 * @param name the name
 * @return a desktop
 */
EFREET_API Efreet_Desktop *efreet_util_desktop_name_find(const char *name);

/**
 * Find a desktop by generic name
 *
 * return value must be freed by efreet_desktop_free
 *
 * @param generic_name the generic name
 * @return a desktop
 */
EFREET_API Efreet_Desktop *efreet_util_desktop_generic_name_find(const char *generic_name);


/**
 * Find all desktops where name matches a glob pattern
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param glob the pattern to match
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_name_glob_list(const char *glob);

/**
 * Find all desktops where exec matches a glob pattern
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param glob the pattern to match
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_exec_glob_list(const char *glob);

/**
 * Find all desktops where generic name matches a glob pattern
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param glob the pattern to match
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_generic_name_glob_list(const char *glob);

/**
 * Find all desktops where comment matches a glob pattern
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param glob the pattern to match
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_comment_glob_list(const char *glob);


/**
 * Find all desktop categories
 * This list must be freed using EINA_LIST_FREE
 *
 * @return an Eina_List of category names (const char *)
 */
EFREET_API Eina_List *efreet_util_desktop_categories_list(void);

/**
 * Find all desktops in a given category
 *
 * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
 *
 * @param category the category name
 * @return a list of desktops
 */
EFREET_API Eina_List *efreet_util_desktop_category_list(const char *category);


/**
 * Returns a list of .menu files found in the various config dirs.
 * @return An eina list of menu file paths (const char *). This must be freed with EINA_LIST_FREE.
 */
EFREET_API Eina_List *efreet_util_menus_find(void);

/**
 * Find all known desktop environments
 * This list must be freed using EINA_LIST_FREE
 * @since 1.12
 *
 * @return an Eina_List of desktop environments names (const char *)
 */
EFREET_API Eina_List *efreet_util_desktop_environments_list(void);


/**
 * @}
 */
#endif