forked from enlightenment/efl
parent
82a7290a4a
commit
6bc4fbac26
|
@ -166,15 +166,15 @@ extern "C"
|
||||||
EAPI int ecore_desktop_paths_init(void);
|
EAPI int ecore_desktop_paths_init(void);
|
||||||
EAPI void ecore_desktop_paths_extras_clear(void);
|
EAPI void ecore_desktop_paths_extras_clear(void);
|
||||||
EAPI void ecore_desktop_paths_prepend_user(Ecore_Desktop_Paths_Type
|
EAPI void ecore_desktop_paths_prepend_user(Ecore_Desktop_Paths_Type
|
||||||
type, char *paths);
|
type, const char *paths);
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_prepend_system(Ecore_Desktop_Paths_Type type,
|
ecore_desktop_paths_prepend_system(Ecore_Desktop_Paths_Type type,
|
||||||
char *paths);
|
const char *paths);
|
||||||
EAPI void ecore_desktop_paths_append_user(Ecore_Desktop_Paths_Type
|
EAPI void ecore_desktop_paths_append_user(Ecore_Desktop_Paths_Type
|
||||||
type, char *paths);
|
type, const char *paths);
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_append_system(Ecore_Desktop_Paths_Type type,
|
ecore_desktop_paths_append_system(Ecore_Desktop_Paths_Type type,
|
||||||
char *paths);
|
const char *paths);
|
||||||
EAPI void ecore_desktop_paths_regen(void);
|
EAPI void ecore_desktop_paths_regen(void);
|
||||||
char *ecore_desktop_paths_file_find(Ecore_List * paths,
|
char *ecore_desktop_paths_file_find(Ecore_List * paths,
|
||||||
const char *file, int sub,
|
const char *file, int sub,
|
||||||
|
@ -228,16 +228,16 @@ extern "C"
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_menu_for_each(void (*func)
|
ecore_desktop_menu_for_each(void (*func)
|
||||||
(char *name, char *path, char *directory, Ecore_Hash * apps));
|
(const char *name, const char *path, const char *directory, Ecore_Hash * apps));
|
||||||
Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file);
|
Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file);
|
||||||
|
|
||||||
Ecore_Desktop_Tree *ecore_desktop_tree_new(char *buffer);
|
Ecore_Desktop_Tree *ecore_desktop_tree_new(char *buffer);
|
||||||
Ecore_Desktop_Tree *ecore_desktop_tree_add(Ecore_Desktop_Tree * tree,
|
Ecore_Desktop_Tree *ecore_desktop_tree_add(Ecore_Desktop_Tree * tree,
|
||||||
char *element);
|
const char *element);
|
||||||
void ecore_desktop_tree_track(Ecore_Desktop_Tree * tree,
|
void ecore_desktop_tree_track(Ecore_Desktop_Tree * tree,
|
||||||
void *element);
|
void *element);
|
||||||
Ecore_Desktop_Tree *ecore_desktop_tree_extend(Ecore_Desktop_Tree * tree,
|
Ecore_Desktop_Tree *ecore_desktop_tree_extend(Ecore_Desktop_Tree * tree,
|
||||||
char *element);
|
const char *element);
|
||||||
Ecore_Desktop_Tree *ecore_desktop_tree_insert(Ecore_Desktop_Tree * tree,
|
Ecore_Desktop_Tree *ecore_desktop_tree_insert(Ecore_Desktop_Tree * tree,
|
||||||
int before, void *element,
|
int before, void *element,
|
||||||
Ecore_Desktop_Tree_Element_Type
|
Ecore_Desktop_Tree_Element_Type
|
||||||
|
|
|
@ -765,6 +765,7 @@ ecore_desktop_destroy(Ecore_Desktop * desktop)
|
||||||
{
|
{
|
||||||
/* This is just a dummy, because these structures are cached. */
|
/* This is just a dummy, because these structures are cached. */
|
||||||
/* Later versions of the cache may reference count, then this will be useful. */
|
/* Later versions of the cache may reference count, then this will be useful. */
|
||||||
|
desktop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -868,7 +869,8 @@ if (files)
|
||||||
if (fill)
|
if (fill)
|
||||||
{
|
{
|
||||||
Ecore_DList *command;
|
Ecore_DList *command;
|
||||||
char *p, *t, buf[PATH_MAX + 10], *big_buf = NULL;
|
char *p, buf[PATH_MAX + 10], *big_buf = NULL;
|
||||||
|
const char *t;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
command = ecore_dlist_new();
|
command = ecore_dlist_new();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "Ecore_Desktop.h"
|
#include "Ecore_Desktop.h"
|
||||||
#include "ecore_desktop_private.h"
|
#include "ecore_desktop_private.h"
|
||||||
|
#include "ecore_private.h"
|
||||||
|
|
||||||
//#define DEBUG 1
|
//#define DEBUG 1
|
||||||
|
|
||||||
|
@ -356,7 +357,7 @@ ecore_desktop_icon_theme_list(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_desktop_icon_theme_list_add(void *data, const char *path)
|
_ecore_desktop_icon_theme_list_add(void *data __UNUSED__, const char *path)
|
||||||
{
|
{
|
||||||
char icn[PATH_MAX];
|
char icn[PATH_MAX];
|
||||||
|
|
||||||
|
@ -434,11 +435,11 @@ ecore_desktop_icon_shutdown()
|
||||||
* @ingroup Ecore_Desktop_Icon_Group
|
* @ingroup Ecore_Desktop_Icon_Group
|
||||||
*/
|
*/
|
||||||
Ecore_Desktop_Icon_Theme *
|
Ecore_Desktop_Icon_Theme *
|
||||||
ecore_desktop_icon_theme_get(const char *icon_theme, const char *lang)
|
ecore_desktop_icon_theme_get(const char *icon_theme, const char *lang __UNUSED__)
|
||||||
{
|
{
|
||||||
Ecore_Desktop_Icon_Theme *result = NULL;
|
Ecore_Desktop_Icon_Theme *result = NULL;
|
||||||
char *theme_path = NULL, *theme_dir = NULL;
|
char *theme_path = NULL, *theme_dir = NULL;
|
||||||
char *value;
|
const char *value;
|
||||||
Ecore_List *Directories;
|
Ecore_List *Directories;
|
||||||
char *directory;
|
char *directory;
|
||||||
|
|
||||||
|
@ -518,7 +519,7 @@ ecore_desktop_icon_theme_get(const char *icon_theme, const char *lang)
|
||||||
dir = calloc(1, sizeof (Ecore_Desktop_Icon_Theme_Directory));
|
dir = calloc(1, sizeof (Ecore_Desktop_Icon_Theme_Directory));
|
||||||
if ((dir) && (sub_group))
|
if ((dir) && (sub_group))
|
||||||
{
|
{
|
||||||
char *size, *minsize, *maxsize, *threshold;
|
const char *size, *minsize, *maxsize, *threshold;
|
||||||
char full_path[PATH_MAX];
|
char full_path[PATH_MAX];
|
||||||
|
|
||||||
dir->path = strdup(directory);
|
dir->path = strdup(directory);
|
||||||
|
@ -595,6 +596,8 @@ ecore_desktop_icon_theme_destroy(Ecore_Desktop_Icon_Theme * icon_theme)
|
||||||
{
|
{
|
||||||
/* This is just a dummy, because these structures are cached. */
|
/* This is just a dummy, because these structures are cached. */
|
||||||
/* Later versions of the cache may reference count, then this will be useful. */
|
/* Later versions of the cache may reference count, then this will be useful. */
|
||||||
|
|
||||||
|
icon_theme = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "Ecore_Desktop.h"
|
#include "Ecore_Desktop.h"
|
||||||
#include "ecore_desktop_private.h"
|
#include "ecore_desktop_private.h"
|
||||||
|
#include "ecore_private.h"
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -61,7 +62,7 @@ static int _ecore_desktop_menu_make_apps(const void *data,
|
||||||
static Ecore_Desktop_Tree *_ecore_desktop_menu_get0(char *file,
|
static Ecore_Desktop_Tree *_ecore_desktop_menu_get0(char *file,
|
||||||
Ecore_Desktop_Tree *
|
Ecore_Desktop_Tree *
|
||||||
merge_stack, int level);
|
merge_stack, int level);
|
||||||
static Ecore_Desktop_Tree *_ecore_desktop_menu_create_menu();
|
static Ecore_Desktop_Tree *_ecore_desktop_menu_create_menu(void);
|
||||||
static int _ecore_desktop_menu_unxml(const void *data,
|
static int _ecore_desktop_menu_unxml(const void *data,
|
||||||
Ecore_Desktop_Tree * tree,
|
Ecore_Desktop_Tree * tree,
|
||||||
int element, int level);
|
int element, int level);
|
||||||
|
@ -79,8 +80,8 @@ static void _ecore_desktop_menu_unxml_rules(Ecore_Desktop_Tree * rules,
|
||||||
static void _ecore_desktop_menu_unxml_moves(Ecore_Desktop_Tree * menu,
|
static void _ecore_desktop_menu_unxml_moves(Ecore_Desktop_Tree * menu,
|
||||||
Ecore_Desktop_Tree * tree);
|
Ecore_Desktop_Tree * tree);
|
||||||
static void _ecore_desktop_menu_add_dirs(Ecore_Desktop_Tree * tree,
|
static void _ecore_desktop_menu_add_dirs(Ecore_Desktop_Tree * tree,
|
||||||
Ecore_List * paths, char *pre,
|
Ecore_List * paths, const char *pre,
|
||||||
char *post, char *extra,
|
const char *post, char *extra,
|
||||||
int element);
|
int element);
|
||||||
static int _ecore_desktop_menu_expand_apps(struct
|
static int _ecore_desktop_menu_expand_apps(struct
|
||||||
_ecore_desktop_menu_unxml_data
|
_ecore_desktop_menu_unxml_data
|
||||||
|
@ -119,7 +120,7 @@ static int _ecore_desktop_menu_apply_rules(struct
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_menu_for_each(void (*func)
|
ecore_desktop_menu_for_each(void (*func)
|
||||||
(char *name, char *path, char *directory, Ecore_Hash * apps))
|
(const char *name, const char *path, const char *directory, Ecore_Hash * apps))
|
||||||
{
|
{
|
||||||
char *menu_file;
|
char *menu_file;
|
||||||
|
|
||||||
|
@ -162,7 +163,7 @@ ecore_desktop_menu_for_each(void (*func)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_desktop_menu_make_apps(const void *data, Ecore_Desktop_Tree * tree,
|
_ecore_desktop_menu_make_apps(const void *data, Ecore_Desktop_Tree * tree,
|
||||||
int element, int level)
|
int element, int level __UNUSED__)
|
||||||
{
|
{
|
||||||
if (tree->elements[element].type == ECORE_DESKTOP_TREE_ELEMENT_TYPE_STRING)
|
if (tree->elements[element].type == ECORE_DESKTOP_TREE_ELEMENT_TYPE_STRING)
|
||||||
{
|
{
|
||||||
|
@ -592,9 +593,7 @@ _ecore_desktop_menu_unxml(const void *data, Ecore_Desktop_Tree * tree,
|
||||||
(((char *)sub->elements[1].
|
(((char *)sub->elements[1].
|
||||||
element)[0] != '<'))
|
element)[0] != '<'))
|
||||||
{
|
{
|
||||||
char
|
char temp[PATH_MAX];
|
||||||
|
|
||||||
temp[PATH_MAX];
|
|
||||||
|
|
||||||
sprintf(temp, "%s %s",
|
sprintf(temp, "%s %s",
|
||||||
(char *)sub->
|
(char *)sub->
|
||||||
|
@ -1043,7 +1042,7 @@ _ecore_desktop_menu_unxml_moves(Ecore_Desktop_Tree * menu,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_desktop_menu_add_dirs(Ecore_Desktop_Tree * tree, Ecore_List * paths,
|
_ecore_desktop_menu_add_dirs(Ecore_Desktop_Tree * tree, Ecore_List * paths,
|
||||||
char *pre, char *post, char *extra, int element)
|
const char *pre, const char *post __UNUSED__, char *extra, int element __UNUSED__)
|
||||||
{
|
{
|
||||||
char t[PATH_MAX], *this_path;
|
char t[PATH_MAX], *this_path;
|
||||||
|
|
||||||
|
@ -1362,7 +1361,7 @@ _ecore_desktop_menu_merge(const void *data, Ecore_Desktop_Tree * tree,
|
||||||
static int
|
static int
|
||||||
_ecore_desktop_menu_expand_default_dirs(const void *data,
|
_ecore_desktop_menu_expand_default_dirs(const void *data,
|
||||||
Ecore_Desktop_Tree * tree, int element,
|
Ecore_Desktop_Tree * tree, int element,
|
||||||
int level)
|
int level __UNUSED__)
|
||||||
{
|
{
|
||||||
struct _ecore_desktop_menu_unxml_data *unxml_data;
|
struct _ecore_desktop_menu_unxml_data *unxml_data;
|
||||||
Ecore_Desktop_Tree *merge;
|
Ecore_Desktop_Tree *merge;
|
||||||
|
|
|
@ -47,17 +47,17 @@ Ecore_List *ecore_desktop_paths_xsessions = NULL;
|
||||||
|
|
||||||
|
|
||||||
static Ecore_List *_ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
static Ecore_List *_ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
||||||
char *before, char *env_home,
|
const char *before, const char *env_home,
|
||||||
char *env, char *env_home_default,
|
const char *env, const char *env_home_default,
|
||||||
char *env_default, char *type,
|
const char *env_default, const char *type,
|
||||||
char *gnome_extra, char *kde);
|
const char *gnome_extra, const char *kde);
|
||||||
static void _ecore_desktop_paths_massage_path(char *path, char *home,
|
static void _ecore_desktop_paths_massage_path(char *path, char *home,
|
||||||
char *first,
|
char *first,
|
||||||
char *second);
|
char *second);
|
||||||
static void _ecore_desktop_paths_check_and_add(Ecore_List * paths,
|
static void _ecore_desktop_paths_check_and_add(Ecore_List * paths,
|
||||||
char *path);
|
const char *path);
|
||||||
static void _ecore_desktop_paths_create();
|
static void _ecore_desktop_paths_create(void);
|
||||||
static void _ecore_desktop_paths_destroy();
|
static void _ecore_desktop_paths_destroy(void);
|
||||||
|
|
||||||
static Ecore_List *gnome_data = NULL;
|
static Ecore_List *gnome_data = NULL;
|
||||||
static Ecore_List *prepend_user_paths[ECORE_DESKTOP_PATHS_MAX];
|
static Ecore_List *prepend_user_paths[ECORE_DESKTOP_PATHS_MAX];
|
||||||
|
@ -325,28 +325,28 @@ ecore_desktop_paths_extras_clear(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_prepend_user(Ecore_Desktop_Paths_Type type, char *paths)
|
ecore_desktop_paths_prepend_user(Ecore_Desktop_Paths_Type type, const char *paths)
|
||||||
{
|
{
|
||||||
if (prepend_user_paths[type])
|
if (prepend_user_paths[type])
|
||||||
ecore_list_append(prepend_user_paths[type], strdup(paths));
|
ecore_list_append(prepend_user_paths[type], strdup(paths));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_prepend_system(Ecore_Desktop_Paths_Type type, char *paths)
|
ecore_desktop_paths_prepend_system(Ecore_Desktop_Paths_Type type, const char *paths)
|
||||||
{
|
{
|
||||||
if (prepend_system_paths[type])
|
if (prepend_system_paths[type])
|
||||||
ecore_list_append(prepend_system_paths[type], strdup(paths));
|
ecore_list_append(prepend_system_paths[type], strdup(paths));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_append_user(Ecore_Desktop_Paths_Type type, char *paths)
|
ecore_desktop_paths_append_user(Ecore_Desktop_Paths_Type type, const char *paths)
|
||||||
{
|
{
|
||||||
if (append_user_paths[type])
|
if (append_user_paths[type])
|
||||||
ecore_list_append(append_user_paths[type], strdup(paths));
|
ecore_list_append(append_user_paths[type], strdup(paths));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_desktop_paths_append_system(Ecore_Desktop_Paths_Type type, char *paths)
|
ecore_desktop_paths_append_system(Ecore_Desktop_Paths_Type type, const char *paths)
|
||||||
{
|
{
|
||||||
if (append_system_paths[type])
|
if (append_system_paths[type])
|
||||||
ecore_list_append(append_system_paths[type], strdup(paths));
|
ecore_list_append(append_system_paths[type], strdup(paths));
|
||||||
|
@ -413,9 +413,9 @@ icons=pathlist
|
||||||
|
|
||||||
static Ecore_List *
|
static Ecore_List *
|
||||||
_ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
_ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
||||||
char *before, char *env_home, char *env,
|
const char *before, const char *env_home, const char *env,
|
||||||
char *env_home_default, char *env_default, char *type,
|
const char *env_home_default, const char *env_default, const char *type,
|
||||||
char *gnome_extra, char *kde)
|
const char *gnome_extra, const char *kde)
|
||||||
{
|
{
|
||||||
Ecore_List *paths = NULL;
|
Ecore_List *paths = NULL;
|
||||||
Ecore_List *types = NULL;
|
Ecore_List *types = NULL;
|
||||||
|
@ -441,6 +441,8 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
||||||
#ifdef KDE_SUPPORT
|
#ifdef KDE_SUPPORT
|
||||||
if (kde)
|
if (kde)
|
||||||
kdes = ecore_desktop_paths_to_list(kde);
|
kdes = ecore_desktop_paths_to_list(kde);
|
||||||
|
#else
|
||||||
|
kde = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (before)
|
if (before)
|
||||||
|
@ -477,7 +479,7 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
||||||
|
|
||||||
if (env_home)
|
if (env_home)
|
||||||
{
|
{
|
||||||
char *value;
|
const char *value;
|
||||||
|
|
||||||
value = getenv(env_home);
|
value = getenv(env_home);
|
||||||
if ((value == NULL) || (value[0] == '\0'))
|
if ((value == NULL) || (value[0] == '\0'))
|
||||||
|
@ -538,7 +540,7 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
||||||
|
|
||||||
if (env)
|
if (env)
|
||||||
{
|
{
|
||||||
char *value;
|
const char *value;
|
||||||
|
|
||||||
value = getenv(env);
|
value = getenv(env);
|
||||||
if ((value == NULL) || (value[0] == '\0'))
|
if ((value == NULL) || (value[0] == '\0'))
|
||||||
|
@ -703,7 +705,7 @@ _ecore_desktop_paths_massage_path(char *path, char *home, char *first,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_desktop_paths_check_and_add(Ecore_List * paths, char *path)
|
_ecore_desktop_paths_check_and_add(Ecore_List * paths, const char *path)
|
||||||
{
|
{
|
||||||
struct stat path_stat;
|
struct stat path_stat;
|
||||||
char *this_path;
|
char *this_path;
|
||||||
|
|
|
@ -51,7 +51,7 @@ ecore_desktop_tree_new(char *buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
Ecore_Desktop_Tree *
|
Ecore_Desktop_Tree *
|
||||||
ecore_desktop_tree_add(Ecore_Desktop_Tree * tree, char *element)
|
ecore_desktop_tree_add(Ecore_Desktop_Tree * tree, const char *element)
|
||||||
{
|
{
|
||||||
tree->elements =
|
tree->elements =
|
||||||
(Ecore_Desktop_Tree_Element *) realloc(tree->elements,
|
(Ecore_Desktop_Tree_Element *) realloc(tree->elements,
|
||||||
|
@ -59,13 +59,13 @@ ecore_desktop_tree_add(Ecore_Desktop_Tree * tree, char *element)
|
||||||
1) *
|
1) *
|
||||||
sizeof
|
sizeof
|
||||||
(Ecore_Desktop_Tree_Element));
|
(Ecore_Desktop_Tree_Element));
|
||||||
tree->elements[tree->size].element = element;
|
tree->elements[tree->size].element = (char*)element;
|
||||||
tree->elements[tree->size++].type = ECORE_DESKTOP_TREE_ELEMENT_TYPE_STRING;
|
tree->elements[tree->size++].type = ECORE_DESKTOP_TREE_ELEMENT_TYPE_STRING;
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ecore_Desktop_Tree *
|
Ecore_Desktop_Tree *
|
||||||
ecore_desktop_tree_extend(Ecore_Desktop_Tree * tree, char *element)
|
ecore_desktop_tree_extend(Ecore_Desktop_Tree * tree, const char *element)
|
||||||
{
|
{
|
||||||
tree->buffers =
|
tree->buffers =
|
||||||
(char **)realloc(tree->buffers,
|
(char **)realloc(tree->buffers,
|
||||||
|
|
Loading…
Reference in New Issue