SVN revision: 32339
This commit is contained in:
Sebastian Dransfeld 2007-11-04 09:32:35 +00:00
parent be1229247a
commit d15dcd181c
27 changed files with 260 additions and 226 deletions

View File

@ -41,6 +41,16 @@ fi
CFLAGS=$PCFLAGS CFLAGS=$PCFLAGS
AC_ARG_ENABLE(hidden-visibility,
[AC_HELP_STRING([--enable-hidden-visibility],[Enable hidden visibility])],
[enable_hidden_visibility=$enableval], [enable_hidden_visibility="auto"])
if test "x$enable_hidden_visibility" = "xyes" ; then
CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
else
AC_DEFINE(DEFAULT_VISIBLITY, 1, [Default visibility])
fi
AM_CONDITIONAL(DEFAULT_VISIBILITY, test "x$enable_hidden_visibility" != "xyes")
AC_SUBST(requirements) AC_SUBST(requirements)
AC_OUTPUT([ AC_OUTPUT([
efreet.pc efreet.pc

View File

@ -17,13 +17,16 @@ efreet_test_SOURCES = \
ef_data_dirs.c \ ef_data_dirs.c \
ef_icon_theme.c \ ef_icon_theme.c \
ef_ini.c \ ef_ini.c \
ef_locale.c \
ef_desktop.c \ ef_desktop.c \
ef_menu.c \ ef_menu.c \
ef_utils.c \
ef_mime.c \ ef_mime.c \
main.c main.c
if DEFAULT_VISIBILITY
efreet_test_SOURCES += \
ef_utils.c \
ef_locale.c
endif
efreet_spec_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet.la efreet_spec_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet.la
efreet_spec_test_LDADD = $(top_builddir)/src/lib/libefreet.la efreet_spec_test_LDADD = $(top_builddir)/src/lib/libefreet.la

View File

@ -5,7 +5,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include "../lib/efreet_private.h"
#define IF_FREE(x) do { if (x) free(x); x = NULL; } while (0);
#define NEW(x, c) calloc(c, sizeof(x))
static void _cb_command(void *data, Efreet_Desktop *desktop, char *exec, int remaining); static void _cb_command(void *data, Efreet_Desktop *desktop, char *exec, int remaining);

View File

@ -1,5 +1,4 @@
#include "Efreet.h" #include "Efreet.h"
#include "efreet_private.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@ -11,6 +10,7 @@
#define SIZE "128x128" #define SIZE "128x128"
#define THEME "Tango" #define THEME "Tango"
#define FREE(x) do { free(x); x = NULL; } while (0);
static void ef_icon_theme_themes_find(const char *search_dir, static void ef_icon_theme_themes_find(const char *search_dir,
Ecore_Hash *themes); Ecore_Hash *themes);

View File

@ -1,8 +1,8 @@
#include "Efreet.h" #include "Efreet.h"
#include "efreet_private.h"
#include "config.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
int int
ef_cb_ini_parse(void) ef_cb_ini_parse(void)

View File

@ -1,5 +1,8 @@
#include <Efreet.h> #include "Efreet.h"
#include "efreet_private.h" #include "efreet_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int int
ef_cb_locale(void) ef_cb_locale(void)

View File

@ -1,11 +1,13 @@
/* vim: set sw=4 ts=4 sts=4 et: */ /* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h" #include "Efreet.h"
#include "efreet_private.h" #include "config.h"
#include <stdio.h>
#include <unistd.h>
#if 0
static void static void
ef_menu_desktop_exec(Efreet_Menu *menu) ef_menu_desktop_exec(Efreet_Menu *menu)
{ {
#if 0
if (menu->entries) if (menu->entries)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
@ -22,8 +24,8 @@ ef_menu_desktop_exec(Efreet_Menu *menu)
while ((sub_menu = ecore_list_next(menu->sub_menus))) while ((sub_menu = ecore_list_next(menu->sub_menus)))
ef_menu_desktop_exec(sub_menu); ef_menu_desktop_exec(sub_menu);
} }
#endif
} }
#endif
int int
ef_cb_menu_get(void) ef_cb_menu_get(void)

View File

@ -1,8 +1,9 @@
/* vim: set sw=4 ts=4 sts=4 et: */ /* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h" #include "Efreet.h"
#include "Efreet_Mime.h" #include "Efreet_Mime.h"
#include "efreet_private.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>

View File

@ -1,23 +1,16 @@
/* vim: set sw=4 ts=4 sts=4 et: */ /* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h" #include "Efreet.h"
#include "efreet_private.h" #include "efreet_private.h"
#include <stdio.h>
int int
ef_cb_utils(void) ef_cb_utils(void)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
char *tmp1;
const char *tmp2; const char *tmp2;
if (!efreet_util_init()) return 0; if (!efreet_util_init()) return 0;
printf("\n"); printf("\n");
tmp1 = efreet_util_path_in_default("applications",
"/usr/share/applications/test.desktop");
if (tmp1)
{
printf("%s\n", tmp1);
free(tmp1);
}
tmp2 = efreet_util_path_to_file_id("/usr/share/applications/this/tmp/test.desktop"); tmp2 = efreet_util_path_to_file_id("/usr/share/applications/this/tmp/test.desktop");
if (tmp2) printf("%s\n", tmp2); if (tmp2) printf("%s\n", tmp2);

View File

@ -15,7 +15,10 @@ int ef_cb_efreet_icon_theme(void);
int ef_cb_efreet_icon_theme_list(void); int ef_cb_efreet_icon_theme_list(void);
int ef_cb_efreet_icon_match(void); int ef_cb_efreet_icon_match(void);
int ef_cb_ini_parse(void); int ef_cb_ini_parse(void);
int ef_cb_ini_long_line(void);
#if DEFAULT_VISIBILITY
int ef_cb_locale(void); int ef_cb_locale(void);
#endif
int ef_cb_desktop_parse(void); int ef_cb_desktop_parse(void);
int ef_cb_desktop_save(void); int ef_cb_desktop_save(void);
int ef_cb_desktop_command_get(void); int ef_cb_desktop_command_get(void);
@ -29,8 +32,9 @@ int ef_cb_menu_save(void);
#if 0 #if 0
int ef_cb_menu_edit(void); int ef_cb_menu_edit(void);
#endif #endif
int ef_cb_ini_long_line(void); #ifndef HIDDEN_VISIBILITY
int ef_cb_utils(void); int ef_cb_utils(void);
#endif
int ef_mime_cb_get(void); int ef_mime_cb_get(void);
typedef struct Efreet_Test Efreet_Test; typedef struct Efreet_Test Efreet_Test;
@ -51,7 +55,9 @@ static Efreet_Test tests[] = {
{"Icon Matching", ef_cb_efreet_icon_match}, {"Icon Matching", ef_cb_efreet_icon_match},
{"INI Parsing", ef_cb_ini_parse}, {"INI Parsing", ef_cb_ini_parse},
{"INI Long Line Parsing", ef_cb_ini_long_line}, {"INI Long Line Parsing", ef_cb_ini_long_line},
#if DEFAULT_VISIBILITY
{"Locale Parsing", ef_cb_locale}, {"Locale Parsing", ef_cb_locale},
#endif
{"Desktop Parsing", ef_cb_desktop_parse}, {"Desktop Parsing", ef_cb_desktop_parse},
{"Desktop Type Parsing", ef_cb_desktop_type_parse}, {"Desktop Type Parsing", ef_cb_desktop_type_parse},
{"Desktop Save", ef_cb_desktop_save}, {"Desktop Save", ef_cb_desktop_save},
@ -65,7 +71,9 @@ static Efreet_Test tests[] = {
#if 0 #if 0
{"Menu Edit", ef_cb_menu_edit}, {"Menu Edit", ef_cb_menu_edit},
#endif #endif
#if DEFAULT_VISIBILITY
{"Utils", ef_cb_utils}, {"Utils", ef_cb_utils},
#endif
{"Mime", ef_mime_cb_get}, {"Mime", ef_mime_cb_get},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -24,18 +24,40 @@
* @li Desktop Menu Specification * @li Desktop Menu Specification
*/ */
#ifdef EAPI
#undef EAPI
#endif
#ifdef _MSC_VER
# ifdef BUILDING_DLL
# define EAPI __declspec(dllexport)
# else
# define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "efreet_base.h" #include "efreet_base.h"
#include "efreet_ini.h"
#include "efreet_icon.h" #include "efreet_icon.h"
#include "efreet_desktop.h" #include "efreet_desktop.h"
#include "efreet_menu.h" #include "efreet_menu.h"
#include "efreet_utils.h" #include "efreet_utils.h"
int efreet_init(void); EAPI int efreet_init(void);
int efreet_shutdown(void); EAPI int efreet_shutdown(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -26,17 +26,17 @@ extern "C" {
* @{ * @{
*/ */
int efreet_mime_init(void); EAPI int efreet_mime_init(void);
void efreet_mime_shutdown(void); EAPI void efreet_mime_shutdown(void);
const char *efreet_mime_type_get(const char *file); EAPI const char *efreet_mime_type_get(const char *file);
const char *efreet_mime_magic_type_get(const char *file); EAPI const char *efreet_mime_magic_type_get(const char *file);
const char *efreet_mime_globs_type_get(const char *file); EAPI const char *efreet_mime_globs_type_get(const char *file);
const char *efreet_mime_special_type_get(const char *file); EAPI const char *efreet_mime_special_type_get(const char *file);
const char *efreet_mime_fallback_type_get(const char *file); EAPI const char *efreet_mime_fallback_type_get(const char *file);
char *efreet_mime_type_icon_get(const char *mime, const char *theme, EAPI char *efreet_mime_type_icon_get(const char *mime, const char *theme,
const char *size); const char *size);
/** /**
* @} * @}

View File

@ -15,7 +15,7 @@ static int efreet_parse_locale_setting(const char *env);
* @return Returns > 0 if the initialization was successful, 0 otherwise * @return Returns > 0 if the initialization was successful, 0 otherwise
* @brief Initializes the Efreet system * @brief Initializes the Efreet system
*/ */
int EAPI int
efreet_init(void) efreet_init(void)
{ {
if (init++) return init; if (init++) return init;
@ -34,7 +34,7 @@ efreet_init(void)
* @brief Shuts down Efreet if a balanced number of init/shutdown calls have * @brief Shuts down Efreet if a balanced number of init/shutdown calls have
* been made * been made
*/ */
int EAPI int
efreet_shutdown(void) efreet_shutdown(void)
{ {
if (--init) return init; if (--init) return init;

View File

@ -68,7 +68,7 @@ efreet_home_dir_get(void)
* @return Returns the XDG Data Home directory * @return Returns the XDG Data Home directory
* @brief Retrieves the XDG Data Home directory * @brief Retrieves the XDG Data Home directory
*/ */
const char * EAPI const char *
efreet_data_home_get(void) efreet_data_home_get(void)
{ {
if (xdg_data_home) return xdg_data_home; if (xdg_data_home) return xdg_data_home;
@ -85,7 +85,7 @@ efreet_data_home_get(void)
* list then the next call to efreet_data_dirs_get() will return your * list then the next call to efreet_data_dirs_get() will return your
* modified values. DO NOT free this list. * modified values. DO NOT free this list.
*/ */
Ecore_List * EAPI Ecore_List *
efreet_data_dirs_get(void) efreet_data_dirs_get(void)
{ {
if (xdg_data_dirs) return xdg_data_dirs; if (xdg_data_dirs) return xdg_data_dirs;
@ -98,7 +98,7 @@ efreet_data_dirs_get(void)
* @return Returns the XDG Config Home directory * @return Returns the XDG Config Home directory
* @brief Retrieves the XDG Config Home directory * @brief Retrieves the XDG Config Home directory
*/ */
const char * EAPI const char *
efreet_config_home_get(void) efreet_config_home_get(void)
{ {
if (xdg_config_home) return xdg_config_home; if (xdg_config_home) return xdg_config_home;
@ -115,7 +115,7 @@ efreet_config_home_get(void)
* list then the next call to efreet_config_dirs_get() will return your * list then the next call to efreet_config_dirs_get() will return your
* modified values. DO NOT free this list. * modified values. DO NOT free this list.
*/ */
Ecore_List * EAPI Ecore_List *
efreet_config_dirs_get(void) efreet_config_dirs_get(void)
{ {
if (xdg_config_dirs) return xdg_config_dirs; if (xdg_config_dirs) return xdg_config_dirs;
@ -127,7 +127,7 @@ efreet_config_dirs_get(void)
* @return Returns the XDG Cache Home directory * @return Returns the XDG Cache Home directory
* @brief Retrieves the XDG Cache Home directory * @brief Retrieves the XDG Cache Home directory
*/ */
const char * EAPI const char *
efreet_cache_home_get(void) efreet_cache_home_get(void)
{ {
if (xdg_cache_home) return xdg_cache_home; if (xdg_cache_home) return xdg_cache_home;

View File

@ -15,13 +15,13 @@
#include <Ecore.h> #include <Ecore.h>
#include <Ecore_Data.h> #include <Ecore_Data.h>
const char *efreet_data_home_get(void); EAPI const char *efreet_data_home_get(void);
Ecore_List *efreet_data_dirs_get(void); EAPI Ecore_List *efreet_data_dirs_get(void);
const char *efreet_config_home_get(void); EAPI const char *efreet_config_home_get(void);
Ecore_List *efreet_config_dirs_get(void); EAPI Ecore_List *efreet_config_dirs_get(void);
const char *efreet_cache_home_get(void); EAPI const char *efreet_cache_home_get(void);
/** /**
* @} * @}

View File

@ -28,9 +28,9 @@ static int efreet_desktop_command_file_id = 0;
static int init = 0; static int init = 0;
static int cache_flush = 0; static int cache_flush = 0;
int EFREET_DESKTOP_TYPE_APPLICATION = 0; EAPI int EFREET_DESKTOP_TYPE_APPLICATION = 0;
int EFREET_DESKTOP_TYPE_LINK = 0; EAPI int EFREET_DESKTOP_TYPE_LINK = 0;
int EFREET_DESKTOP_TYPE_DIRECTORY = 0; EAPI int EFREET_DESKTOP_TYPE_DIRECTORY = 0;
/** /**
* @internal * @internal
@ -49,6 +49,8 @@ struct Efreet_Desktop_Type_Info
static int efreet_desktop_read(Efreet_Desktop *desktop); static int efreet_desktop_read(Efreet_Desktop *desktop);
static void efreet_desktop_clear(Efreet_Desktop *desktop); static void efreet_desktop_clear(Efreet_Desktop *desktop);
static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str); static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str);
static Ecore_List *efreet_desktop_string_list_parse(const char *string);
static char *efreet_desktop_string_list_join(Ecore_List *list);
static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop, static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop,
@ -179,7 +181,7 @@ efreet_desktop_cache_check(Efreet_Desktop *desktop)
* @brief Gets a reference to an Efreet_Desktop structure representing the * @brief Gets a reference to an Efreet_Desktop structure representing the
* contents of @a file or NULL if @a file is not a valid .desktop file. * contents of @a file or NULL if @a file is not a valid .desktop file.
*/ */
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_desktop_get(const char *file) efreet_desktop_get(const char *file)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
@ -220,7 +222,7 @@ efreet_desktop_get(const char *file)
* @param desktop: The Efreet_Desktop to ref * @param desktop: The Efreet_Desktop to ref
* @return Returns the new reference count * @return Returns the new reference count
*/ */
int EAPI int
efreet_desktop_ref(Efreet_Desktop *desktop) efreet_desktop_ref(Efreet_Desktop *desktop)
{ {
if (!desktop) return 0; if (!desktop) return 0;
@ -233,7 +235,7 @@ efreet_desktop_ref(Efreet_Desktop *desktop)
* @return Returns a new empty_Efreet_Desktop on success, NULL on failure * @return Returns a new empty_Efreet_Desktop on success, NULL on failure
* @brief Creates a new empty Efreet_Desktop structure or NULL on failure * @brief Creates a new empty Efreet_Desktop structure or NULL on failure
*/ */
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_desktop_empty_new(const char *file) efreet_desktop_empty_new(const char *file)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
@ -256,7 +258,7 @@ efreet_desktop_empty_new(const char *file)
* @brief Creates a new Efreet_Desktop structure initialized from the * @brief Creates a new Efreet_Desktop structure initialized from the
* contents of @a file or NULL on failure * contents of @a file or NULL on failure
*/ */
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_desktop_new(const char *file) efreet_desktop_new(const char *file)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
@ -382,7 +384,7 @@ efreet_desktop_clear(Efreet_Desktop *desktop)
* @brief Saves any changes made to @a desktop back to the file on the * @brief Saves any changes made to @a desktop back to the file on the
* filesystem * filesystem
*/ */
int EAPI int
efreet_desktop_save(Efreet_Desktop *desktop) efreet_desktop_save(Efreet_Desktop *desktop)
{ {
Efreet_Desktop_Type_Info *info; Efreet_Desktop_Type_Info *info;
@ -444,7 +446,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Saves @a desktop to @a file * @brief Saves @a desktop to @a file
*/ */
int EAPI int
efreet_desktop_save_as(Efreet_Desktop *desktop, const char *file) efreet_desktop_save_as(Efreet_Desktop *desktop, const char *file)
{ {
if (desktop == ecore_hash_get(efreet_desktop_cache, desktop->orig_path)) if (desktop == ecore_hash_get(efreet_desktop_cache, desktop->orig_path))
@ -463,7 +465,7 @@ efreet_desktop_save_as(Efreet_Desktop *desktop, const char *file)
* @return Returns no value * @return Returns no value
* @brief Frees the Efreet_Desktop structure and all of it's data * @brief Frees the Efreet_Desktop structure and all of it's data
*/ */
void EAPI void
efreet_desktop_free(Efreet_Desktop *desktop) efreet_desktop_free(Efreet_Desktop *desktop)
{ {
if (!desktop) return; if (!desktop) return;
@ -512,7 +514,7 @@ efreet_desktop_free(Efreet_Desktop *desktop)
* @return Returns the Ecore_Exce for @a desktop * @return Returns the Ecore_Exce for @a desktop
* @brief Parses the @a desktop exec line and returns an Ecore_Exe. * @brief Parses the @a desktop exec line and returns an Ecore_Exe.
*/ */
void EAPI void
efreet_desktop_exec(Efreet_Desktop *desktop, Ecore_List *files, void *data) efreet_desktop_exec(Efreet_Desktop *desktop, Ecore_List *files, void *data)
{ {
efreet_desktop_command_get(desktop, files, efreet_desktop_exec_cb, data); efreet_desktop_command_get(desktop, files, efreet_desktop_exec_cb, data);
@ -527,11 +529,10 @@ efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
} }
/** /**
* @internal
* @param environment: the environment name * @param environment: the environment name
* @brief sets the global desktop environment name * @brief sets the global desktop environment name
*/ */
void EAPI void
efreet_desktop_environment_set(const char *environment) efreet_desktop_environment_set(const char *environment)
{ {
if (desktop_environment) ecore_string_release(desktop_environment); if (desktop_environment) ecore_string_release(desktop_environment);
@ -540,11 +541,10 @@ efreet_desktop_environment_set(const char *environment)
} }
/** /**
* @internal
* @return environment: the environment name * @return environment: the environment name
* @brief sets the global desktop environment name * @brief sets the global desktop environment name
*/ */
const char * EAPI const char *
efreet_desktop_environment_get(void) efreet_desktop_environment_get(void)
{ {
return desktop_environment; return desktop_environment;
@ -556,7 +556,7 @@ efreet_desktop_environment_get(void)
* @brief Retrieves the number of categories the given @a desktop belongs * @brief Retrieves the number of categories the given @a desktop belongs
* too * too
*/ */
unsigned int EAPI unsigned int
efreet_desktop_category_count_get(Efreet_Desktop *desktop) efreet_desktop_category_count_get(Efreet_Desktop *desktop)
{ {
if (!desktop || !desktop->categories) return 0; if (!desktop || !desktop->categories) return 0;
@ -568,7 +568,7 @@ efreet_desktop_category_count_get(Efreet_Desktop *desktop)
* @param category: the category name * @param category: the category name
* @brief add a category to a desktop * @brief add a category to a desktop
*/ */
void EAPI void
efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category) efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
{ {
if (!desktop) return; if (!desktop) return;
@ -593,7 +593,7 @@ efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
* @brief removes a category from a desktop * @brief removes a category from a desktop
* @return 1 if the desktop had his category listed, 0 otherwise * @return 1 if the desktop had his category listed, 0 otherwise
*/ */
int EAPI int
efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category) efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
{ {
int found = 0; int found = 0;
@ -617,7 +617,7 @@ efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
* @return Returns the id of the new type * @return Returns the id of the new type
* @brief Adds the given type to the list of types in the system * @brief Adds the given type to the list of types in the system
*/ */
int EAPI int
efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_func, efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_func,
Efreet_Desktop_Type_Save_Cb save_func, Efreet_Desktop_Type_Save_Cb save_func,
Efreet_Desktop_Type_Free_Cb free_func) Efreet_Desktop_Type_Free_Cb free_func)
@ -649,8 +649,8 @@ efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_fun
* *
* This allows applications to add non-standard types that behave exactly as standard types. * This allows applications to add non-standard types that behave exactly as standard types.
*/ */
int EAPI int
efreet_desktop_type_alias (int from_type, const char *alias) efreet_desktop_type_alias(int from_type, const char *alias)
{ {
Efreet_Desktop_Type_Info *info; Efreet_Desktop_Type_Info *info;
info = ecore_list_index_goto(efreet_desktop_types, from_type); info = ecore_list_index_goto(efreet_desktop_types, from_type);
@ -676,7 +676,7 @@ efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info)
* @param desktop the desktop * @param desktop the desktop
* @return type specific data, or NULL if there is none * @return type specific data, or NULL if there is none
*/ */
void * EAPI void *
efreet_desktop_type_data_get(Efreet_Desktop *desktop) efreet_desktop_type_data_get(Efreet_Desktop *desktop)
{ {
return desktop->type_data; return desktop->type_data;
@ -710,7 +710,7 @@ efreet_desktop_type_parse(const char *type_str)
* @return an Ecore_List of ecore string's * @return an Ecore_List of ecore string's
* @brief Parse ';' separate list of strings according to the desktop spec * @brief Parse ';' separate list of strings according to the desktop spec
*/ */
Ecore_List * static Ecore_List *
efreet_desktop_string_list_parse(const char *string) efreet_desktop_string_list_parse(const char *string)
{ {
Ecore_List *list; Ecore_List *list;
@ -754,7 +754,7 @@ efreet_desktop_string_list_parse(const char *string)
* @return a raw string list * @return a raw string list
* @brief Create a ';' separate list of strings according to the desktop spec * @brief Create a ';' separate list of strings according to the desktop spec
*/ */
char * static char *
efreet_desktop_string_list_join(Ecore_List *list) efreet_desktop_string_list_join(Ecore_List *list)
{ {
const char *tmp; const char *tmp;
@ -792,7 +792,7 @@ efreet_desktop_string_list_join(Ecore_List *list)
* it will force it to be re-read off disk next time efreet_desktop_get() is * it will force it to be re-read off disk next time efreet_desktop_get() is
* called. * called.
*/ */
void EAPI void
efreet_desktop_cache_flush(void) efreet_desktop_cache_flush(void)
{ {
cache_flush++; cache_flush++;
@ -1080,7 +1080,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Get a command to use to execute a desktop entry. * @brief Get a command to use to execute a desktop entry.
*/ */
int EAPI int
efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files, efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
Efreet_Desktop_Command_Cb func, void *data) Efreet_Desktop_Command_Cb func, void *data)
{ {
@ -1095,7 +1095,7 @@ efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
* *
* The returned list and each of its elements must be freed. * The returned list and each of its elements must be freed.
*/ */
Ecore_List * EAPI Ecore_List *
efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files) efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
{ {
Efreet_Desktop_Command *command; Efreet_Desktop_Command *command;
@ -1151,7 +1151,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
* @brief Get a command to use to execute a desktop entry, and receive progress * @brief Get a command to use to execute a desktop entry, and receive progress
* updates for downloading of remote URI's passed in. * updates for downloading of remote URI's passed in.
*/ */
int EAPI int
efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files, efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Command_Cb cb_command,
Efreet_Desktop_Progress_Cb cb_progress, Efreet_Desktop_Progress_Cb cb_progress,

View File

@ -2,8 +2,6 @@
#ifndef EFREET_DESKTOP_H #ifndef EFREET_DESKTOP_H
#define EFREET_DESKTOP_H #define EFREET_DESKTOP_H
#include "efreet_ini.h"
/** /**
* @file efreet_desktop.h * @file efreet_desktop.h
* @brief Contains the structures and methods used to support the * @brief Contains the structures and methods used to support the
@ -14,9 +12,9 @@
* @{ * @{
*/ */
extern int EFREET_DESKTOP_TYPE_APPLICATION; EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
extern int EFREET_DESKTOP_TYPE_LINK; EAPI extern int EFREET_DESKTOP_TYPE_LINK;
extern int EFREET_DESKTOP_TYPE_DIRECTORY; EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;
/** /**
* Efreet_Desktop_Type * Efreet_Desktop_Type
@ -99,49 +97,48 @@ struct Efreet_Desktop
void *type_data; /**< Type specific data for custom types */ void *type_data; /**< Type specific data for custom types */
}; };
Efreet_Desktop *efreet_desktop_get(const char *file); EAPI Efreet_Desktop *efreet_desktop_get(const char *file);
int efreet_desktop_ref(Efreet_Desktop *desktop); EAPI int efreet_desktop_ref(Efreet_Desktop *desktop);
Efreet_Desktop *efreet_desktop_empty_new(const char *file); EAPI Efreet_Desktop *efreet_desktop_empty_new(const char *file);
Efreet_Desktop *efreet_desktop_new(const char *file); EAPI Efreet_Desktop *efreet_desktop_new(const char *file);
void efreet_desktop_free(Efreet_Desktop *desktop); EAPI void efreet_desktop_free(Efreet_Desktop *desktop);
int efreet_desktop_save(Efreet_Desktop *desktop); EAPI int efreet_desktop_save(Efreet_Desktop *desktop);
int efreet_desktop_save_as(Efreet_Desktop *desktop, EAPI int efreet_desktop_save_as(Efreet_Desktop *desktop,
const char *file); const char *file);
void efreet_desktop_exec(Efreet_Desktop *desktop, EAPI void efreet_desktop_exec(Efreet_Desktop *desktop,
Ecore_List *files, void *data); Ecore_List *files, void *data);
void efreet_desktop_environment_set(const char *environment); EAPI void efreet_desktop_environment_set(const char *environment);
int efreet_desktop_command_progress_get(Efreet_Desktop *desktop, EAPI const char *efreet_desktop_environment_get(void);
EAPI int efreet_desktop_command_progress_get(Efreet_Desktop *desktop,
Ecore_List *files, Ecore_List *files,
Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Command_Cb cb_command,
Efreet_Desktop_Progress_Cb cb_prog, Efreet_Desktop_Progress_Cb cb_prog,
void *data); void *data);
int efreet_desktop_command_get(Efreet_Desktop *desktop, EAPI int efreet_desktop_command_get(Efreet_Desktop *desktop,
Ecore_List *files, Ecore_List *files,
Efreet_Desktop_Command_Cb func, Efreet_Desktop_Command_Cb func,
void *data); void *data);
Ecore_List * efreet_desktop_command_local_get(Efreet_Desktop *desktop, EAPI Ecore_List * efreet_desktop_command_local_get(Efreet_Desktop *desktop,
Ecore_List *files); Ecore_List *files);
unsigned int efreet_desktop_category_count_get(Efreet_Desktop *desktop); EAPI unsigned int efreet_desktop_category_count_get(Efreet_Desktop *desktop);
void efreet_desktop_category_add(Efreet_Desktop *desktop, EAPI void efreet_desktop_category_add(Efreet_Desktop *desktop,
const char *category); const char *category);
int efreet_desktop_category_del(Efreet_Desktop *desktop, EAPI int efreet_desktop_category_del(Efreet_Desktop *desktop,
const char *category); const char *category);
int efreet_desktop_type_add(const char *type, EAPI int efreet_desktop_type_add(const char *type,
Efreet_Desktop_Type_Parse_Cb parse_func, Efreet_Desktop_Type_Parse_Cb parse_func,
Efreet_Desktop_Type_Save_Cb save_func, Efreet_Desktop_Type_Save_Cb save_func,
Efreet_Desktop_Type_Free_Cb free_func); Efreet_Desktop_Type_Free_Cb free_func);
int efreet_desktop_type_alias (int from_type, EAPI int efreet_desktop_type_alias (int from_type,
const char *alias); const char *alias);
void *efreet_desktop_type_data_get(Efreet_Desktop *desktop); EAPI void *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
Ecore_List *efreet_desktop_string_list_parse(const char *string); EAPI void efreet_desktop_cache_flush(void);
char *efreet_desktop_string_list_join(Ecore_List *list);
void efreet_desktop_cache_flush(void);
/** /**
* @} * @}

View File

@ -164,7 +164,7 @@ efreet_icon_deprecated_user_dir_get(void)
return efreet_icon_deprecated_user_dir; return efreet_icon_deprecated_user_dir;
} }
const char * EAPI const char *
efreet_icon_user_dir_get(void) efreet_icon_user_dir_get(void)
{ {
const char *user; const char *user;
@ -185,7 +185,7 @@ efreet_icon_user_dir_get(void)
* @return Returns no value. * @return Returns no value.
* @brief Adds the given extension to the list of possible icon extensions * @brief Adds the given extension to the list of possible icon extensions
*/ */
void EAPI void
efreet_icon_extension_add(const char *ext) efreet_icon_extension_add(const char *ext)
{ {
ecore_list_prepend(efreet_icon_extensions, strdup(ext)); ecore_list_prepend(efreet_icon_extensions, strdup(ext));
@ -199,7 +199,7 @@ efreet_icon_extension_add(const char *ext)
* from first to last directory in this list. the strings in the list should * from first to last directory in this list. the strings in the list should
* be created with ecore_string_instance(). * be created with ecore_string_instance().
*/ */
Ecore_List * EAPI Ecore_List *
efreet_icon_extra_list_get(void) efreet_icon_extra_list_get(void)
{ {
return efreet_extra_icon_dirs; return efreet_extra_icon_dirs;
@ -211,7 +211,7 @@ efreet_icon_extra_list_get(void)
* @brief Retrieves all of the non-hidden icon themes available on the system. * @brief Retrieves all of the non-hidden icon themes available on the system.
* The returned list must be freed. Do not free the list data. * The returned list must be freed. Do not free the list data.
*/ */
Ecore_List * EAPI Ecore_List *
efreet_icon_theme_list_get(void) efreet_icon_theme_list_get(void)
{ {
Ecore_List *list, *theme_list; Ecore_List *list, *theme_list;
@ -248,7 +248,7 @@ efreet_icon_theme_list_get(void)
* none exists. * none exists.
* @brief Tries to get the icon theme structure for the given theme name * @brief Tries to get the icon theme structure for the given theme name
*/ */
Efreet_Icon_Theme * EAPI Efreet_Icon_Theme *
efreet_icon_theme_find(const char *theme_name) efreet_icon_theme_find(const char *theme_name)
{ {
const char *key; const char *key;
@ -330,7 +330,7 @@ efreet_icon_find_theme_check(const char *theme_name)
* @return Returns the path to the given icon or NULL if none found * @return Returns the path to the given icon or NULL if none found
* @brief Retrives the path to the given icon. * @brief Retrives the path to the given icon.
*/ */
char * EAPI char *
efreet_icon_path_find(const char *theme_name, const char *icon, const char *size) efreet_icon_path_find(const char *theme_name, const char *icon, const char *size)
{ {
struct stat st; struct stat st;
@ -398,7 +398,7 @@ efreet_icon_path_find(const char *theme_name, const char *icon, const char *size
* @note This function will search the given theme for all icons before falling * @note This function will search the given theme for all icons before falling
* back. This is useful when searching for mimetype icons. * back. This is useful when searching for mimetype icons.
*/ */
char * EAPI char *
efreet_icon_list_find(const char *theme_name, Ecore_List *icons, efreet_icon_list_find(const char *theme_name, Ecore_List *icons,
const char *size) const char *size)
{ {
@ -450,7 +450,7 @@ efreet_icon_list_find(const char *theme_name, Ecore_List *icons,
* if the icon is not found * if the icon is not found
* @brief Retrieves all of the information about the given icon. * @brief Retrieves all of the information about the given icon.
*/ */
Efreet_Icon * EAPI Efreet_Icon *
efreet_icon_find(const char *theme, const char *icon, const char *size) efreet_icon_find(const char *theme, const char *icon, const char *size)
{ {
char *path; char *path;
@ -961,7 +961,7 @@ efreet_icon_new(const char *path)
* @return Returns no value. * @return Returns no value.
* @brief Free's the given icon and all its internal data. * @brief Free's the given icon and all its internal data.
*/ */
void EAPI void
efreet_icon_free(Efreet_Icon *icon) efreet_icon_free(Efreet_Icon *icon)
{ {
if (!icon) return; if (!icon) return;

View File

@ -158,20 +158,22 @@ struct Efreet_Icon_Point
int y; /**< y coord */ int y; /**< y coord */
}; };
const char *efreet_icon_user_dir_get(void); EAPI const char *efreet_icon_user_dir_get(void);
void efreet_icon_extension_add(const char *ext); EAPI void efreet_icon_extension_add(const char *ext);
Ecore_List *efreet_icon_extra_list_get(void); EAPI Ecore_List *efreet_icon_extra_list_get(void);
Ecore_List *efreet_icon_theme_list_get(void); EAPI Ecore_List *efreet_icon_theme_list_get(void);
Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name); EAPI Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon, EAPI Efreet_Icon *efreet_icon_find(const char *theme_name,
const char *size); const char *icon,
char *efreet_icon_list_find(const char *theme_name, const char *size);
Ecore_List *icons, EAPI char *efreet_icon_list_find(const char *theme_name,
const char *size); Ecore_List *icons,
char *efreet_icon_path_find(const char *theme, const char *icon, const char *size);
const char *size); EAPI char *efreet_icon_path_find(const char *theme,
void efreet_icon_free(Efreet_Icon *icon); const char *icon,
const char *size);
EAPI void efreet_icon_free(Efreet_Icon *icon);
/** /**
* @} * @}

View File

@ -40,14 +40,13 @@ efreet_ini_shutdown(void)
} }
/** /**
* @internal
* @param file: The file to parse * @param file: The file to parse
* @return Returns a new Efreet_Ini structure initialized with the contents * @return Returns a new Efreet_Ini structure initialized with the contents
* of @a file, or NULL on memory allocation failure * of @a file, or NULL on memory allocation failure
* @brief Creates and initializes a new Ini structure with the contents of * @brief Creates and initializes a new Ini structure with the contents of
* @a file, or NULL on failure * @a file, or NULL on failure
*/ */
Efreet_Ini * EAPI Efreet_Ini *
efreet_ini_new(const char *file) efreet_ini_new(const char *file)
{ {
Efreet_Ini *ini; Efreet_Ini *ini;
@ -241,12 +240,11 @@ next_line:
} }
/** /**
* @internal
* @param ini: The Efreet_Ini to work with * @param ini: The Efreet_Ini to work with
* @return Returns no value * @return Returns no value
* @brief Frees the given Efree_Ini structure. * @brief Frees the given Efree_Ini structure.
*/ */
void EAPI void
efreet_ini_free(Efreet_Ini *ini) efreet_ini_free(Efreet_Ini *ini)
{ {
if (!ini) return; if (!ini) return;
@ -256,13 +254,12 @@ efreet_ini_free(Efreet_Ini *ini)
} }
/** /**
* @internal
* @param ini: The Efreet_Ini to work with * @param ini: The Efreet_Ini to work with
* @param file: The file to load * @param file: The file to load
* @return Returns no value * @return Returns no value
* @brief Saves the given Efree_Ini structure. * @brief Saves the given Efree_Ini structure.
*/ */
int EAPI int
efreet_ini_save(Efreet_Ini *ini, const char *file) efreet_ini_save(Efreet_Ini *ini, const char *file)
{ {
FILE *f; FILE *f;
@ -277,13 +274,12 @@ efreet_ini_save(Efreet_Ini *ini, const char *file)
} }
/** /**
* @internal
* @param ini: The Efreet_Ini to work with * @param ini: The Efreet_Ini to work with
* @param section: The section of the ini file we want to get values from * @param section: The section of the ini file we want to get values from
* @return Returns 1 if the section exists, otherwise 0 * @return Returns 1 if the section exists, otherwise 0
* @brief Sets the current working section of the ini file to @a section * @brief Sets the current working section of the ini file to @a section
*/ */
int EAPI int
efreet_ini_section_set(Efreet_Ini *ini, const char *section) efreet_ini_section_set(Efreet_Ini *ini, const char *section)
{ {
if (!ini || !ini->data || !section) return 0; if (!ini || !ini->data || !section) return 0;
@ -293,13 +289,12 @@ efreet_ini_section_set(Efreet_Ini *ini, const char *section)
} }
/** /**
* @internal
* @param ini: The Efreet_Ini to work with * @param ini: The Efreet_Ini to work with
* @param section: The section of the ini file we want to add * @param section: The section of the ini file we want to add
* @return Returns no value * @return Returns no value
* @brief Adds a new working section of the ini file to @a section * @brief Adds a new working section of the ini file to @a section
*/ */
void EAPI void
efreet_ini_section_add(Efreet_Ini *ini, const char *section) efreet_ini_section_add(Efreet_Ini *ini, const char *section)
{ {
Ecore_Hash *hash; Ecore_Hash *hash;
@ -321,14 +316,13 @@ efreet_ini_section_add(Efreet_Ini *ini, const char *section)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to lookup * @param key: The key to lookup
* @return Returns the string associated with the given key or NULL if not * @return Returns the string associated with the given key or NULL if not
* found. * found.
* @brief Retrieves the value for the given key or NULL if none found. * @brief Retrieves the value for the given key or NULL if none found.
*/ */
const char * EAPI const char *
efreet_ini_string_get(Efreet_Ini *ini, const char *key) efreet_ini_string_get(Efreet_Ini *ini, const char *key)
{ {
if (!ini || !key || !ini->section) return NULL; if (!ini || !key || !ini->section) return NULL;
@ -337,14 +331,13 @@ efreet_ini_string_get(Efreet_Ini *ini, const char *key)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to use * @param key: The key to use
* @param value: The value to set * @param value: The value to set
* @return Returns no value * @return Returns no value
* @brief Sets the value for the given key * @brief Sets the value for the given key
*/ */
void EAPI void
efreet_ini_string_set(Efreet_Ini *ini, const char *key, const char *value) efreet_ini_string_set(Efreet_Ini *ini, const char *key, const char *value)
{ {
if (!ini || !key || !ini->section) return; if (!ini || !key || !ini->section) return;
@ -353,14 +346,13 @@ efreet_ini_string_set(Efreet_Ini *ini, const char *key, const char *value)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to lookup * @param key: The key to lookup
* @return Returns the integer associated with the given key or -1 if not * @return Returns the integer associated with the given key or -1 if not
* found. * found.
* @brief Retrieves the value for the given key or -1 if none found. * @brief Retrieves the value for the given key or -1 if none found.
*/ */
int EAPI int
efreet_ini_int_get(Efreet_Ini *ini, const char *key) efreet_ini_int_get(Efreet_Ini *ini, const char *key)
{ {
const char *str; const char *str;
@ -374,14 +366,13 @@ efreet_ini_int_get(Efreet_Ini *ini, const char *key)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to use * @param key: The key to use
* @param value: The value to set * @param value: The value to set
* @return Returns no value * @return Returns no value
* @brief Sets the value for the given key * @brief Sets the value for the given key
*/ */
void EAPI void
efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value) efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value)
{ {
char str[12]; char str[12];
@ -393,14 +384,13 @@ efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to lookup * @param key: The key to lookup
* @return Returns the double associated with the given key or -1 if not * @return Returns the double associated with the given key or -1 if not
* found. * found.
* @brief Retrieves the value for the given key or -1 if none found. * @brief Retrieves the value for the given key or -1 if none found.
*/ */
double EAPI double
efreet_ini_double_get(Efreet_Ini *ini, const char *key) efreet_ini_double_get(Efreet_Ini *ini, const char *key)
{ {
const char *str; const char *str;
@ -414,14 +404,13 @@ efreet_ini_double_get(Efreet_Ini *ini, const char *key)
} }
/** /**
* @internal
* @param ini: The Efree_Ini to work with * @param ini: The Efree_Ini to work with
* @param key: The key to use * @param key: The key to use
* @param value: The value to set * @param value: The value to set
* @return Returns no value * @return Returns no value
* @brief Sets the value for the given key * @brief Sets the value for the given key
*/ */
void EAPI void
efreet_ini_double_set(Efreet_Ini *ini, const char *key, double value) efreet_ini_double_set(Efreet_Ini *ini, const char *key, double value)
{ {
char str[512]; char str[512];
@ -437,13 +426,12 @@ efreet_ini_double_set(Efreet_Ini *ini, const char *key, double value)
} }
/** /**
* @internal
* @param ini: The ini struct to work with * @param ini: The ini struct to work with
* @param key: The key to search for * @param key: The key to search for
* @return Returns 1 if the boolean is true, 0 otherwise * @return Returns 1 if the boolean is true, 0 otherwise
* @brief Retrieves the boolean value at key @a key from the ini @a ini * @brief Retrieves the boolean value at key @a key from the ini @a ini
*/ */
unsigned int EAPI unsigned int
efreet_ini_boolean_get(Efreet_Ini *ini, const char *key) efreet_ini_boolean_get(Efreet_Ini *ini, const char *key)
{ {
const char *str; const char *str;
@ -457,14 +445,13 @@ efreet_ini_boolean_get(Efreet_Ini *ini, const char *key)
} }
/** /**
* @internal
* @param ini: The ini struct to work with * @param ini: The ini struct to work with
* @param key: The key to use * @param key: The key to use
* @param value: The value to set * @param value: The value to set
* @return Returns no value * @return Returns no value
* @brief Sets the value for the given key * @brief Sets the value for the given key
*/ */
void EAPI void
efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value) efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value)
{ {
if (!ini || !key || !ini->section) return; if (!ini || !key || !ini->section) return;
@ -474,14 +461,13 @@ efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value)
} }
/** /**
* @internal
* @param ini: The ini struct to work with * @param ini: The ini struct to work with
* @param key: The key to search for * @param key: The key to search for
* @return Returns the utf8 encoded string associated with @a key, or NULL * @return Returns the utf8 encoded string associated with @a key, or NULL
* if none found * if none found
* @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found * @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
*/ */
const char * EAPI const char *
efreet_ini_localestring_get(Efreet_Ini *ini, const char *key) efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
{ {
const char *lang, *country, *modifier; const char *lang, *country, *modifier;
@ -541,14 +527,13 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
} }
/** /**
* @internal
* @param ini: The ini struct to work with * @param ini: The ini struct to work with
* @param key: The key to use * @param key: The key to use
* @param value: The value to set * @param value: The value to set
* @return Returns no value * @return Returns no value
* @brief Sets the value for the given key * @brief Sets the value for the given key
*/ */
void EAPI void
efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value) efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
{ {
const char *lang, *country, *modifier; const char *lang, *country, *modifier;

View File

@ -26,30 +26,30 @@ struct Efreet_Ini
Ecore_Hash *section; /**< currently selected section */ Ecore_Hash *section; /**< currently selected section */
}; };
Efreet_Ini *efreet_ini_new(const char *file); EAPI Efreet_Ini *efreet_ini_new(const char *file);
void efreet_ini_free(Efreet_Ini *ini); EAPI void efreet_ini_free(Efreet_Ini *ini);
int efreet_ini_save(Efreet_Ini *ini, const char *path); EAPI int efreet_ini_save(Efreet_Ini *ini, const char *path);
int efreet_ini_section_set(Efreet_Ini *ini, const char *section); EAPI int efreet_ini_section_set(Efreet_Ini *ini, const char *section);
void efreet_ini_section_add(Efreet_Ini *ini, const char *section); EAPI void efreet_ini_section_add(Efreet_Ini *ini, const char *section);
const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key); EAPI const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key);
void efreet_ini_string_set(Efreet_Ini *ini, const char *key, EAPI void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
const char *value); const char *value);
const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key); EAPI const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key);
void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, EAPI void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
const char *value); const char *value);
unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key); EAPI unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key);
void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, EAPI void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
unsigned int value); unsigned int value);
int efreet_ini_int_get(Efreet_Ini *ini, const char *key); EAPI int efreet_ini_int_get(Efreet_Ini *ini, const char *key);
void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value); EAPI void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value);
double efreet_ini_double_get(Efreet_Ini *ini, const char *key); EAPI double efreet_ini_double_get(Efreet_Ini *ini, const char *key);
void efreet_ini_double_set(Efreet_Ini *ini, const char *key, EAPI void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
double value); double value);
/** /**

View File

@ -486,7 +486,7 @@ efreet_menu_init(void)
* @brief Initialize legacy kde support. This function blocks while * @brief Initialize legacy kde support. This function blocks while
* the kde-config script is run. * the kde-config script is run.
*/ */
int EAPI int
efreet_menu_kde_legacy_init(void) efreet_menu_kde_legacy_init(void)
{ {
FILE *f; FILE *f;
@ -554,7 +554,7 @@ efreet_menu_shutdown(void)
ecore_string_shutdown(); ecore_string_shutdown();
} }
Efreet_Menu * EAPI Efreet_Menu *
efreet_menu_new(void) efreet_menu_new(void)
{ {
Efreet_Menu *menu; Efreet_Menu *menu;
@ -568,7 +568,7 @@ efreet_menu_new(void)
* NULL if none found * NULL if none found
* @brief Creates the default menu representation * @brief Creates the default menu representation
*/ */
Efreet_Menu * EAPI Efreet_Menu *
efreet_menu_get(void) efreet_menu_get(void)
{ {
char menu[PATH_MAX]; char menu[PATH_MAX];
@ -601,7 +601,7 @@ efreet_menu_get(void)
* failure * failure
* @brief Parses the given .menu file and creates the menu representation * @brief Parses the given .menu file and creates the menu representation
*/ */
Efreet_Menu * EAPI Efreet_Menu *
efreet_menu_parse(const char *path) efreet_menu_parse(const char *path)
{ {
Efreet_Xml *xml; Efreet_Xml *xml;
@ -683,7 +683,7 @@ efreet_menu_parse(const char *path)
* @return Returns 1 on success, 0 on failure * @return Returns 1 on success, 0 on failure
* @brief Saves the menu to file * @brief Saves the menu to file
*/ */
int EAPI int
efreet_menu_save(Efreet_Menu *menu, const char *path) efreet_menu_save(Efreet_Menu *menu, const char *path)
{ {
FILE *f; FILE *f;
@ -802,7 +802,7 @@ efreet_menu_save_indent(FILE *f, int indent)
* @brief Insert a desktop element in a menu structure. Only accepts desktop files * @brief Insert a desktop element in a menu structure. Only accepts desktop files
* in default directories. * in default directories.
*/ */
int EAPI int
efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos) efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
{ {
Efreet_Menu *entry; Efreet_Menu *entry;
@ -842,7 +842,7 @@ efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
* @brief Remove a desktop element in a menu structure. Only accepts desktop files * @brief Remove a desktop element in a menu structure. Only accepts desktop files
* in default directories. * in default directories.
*/ */
int EAPI int
efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop) efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
{ {
Efreet_Menu *entry; Efreet_Menu *entry;
@ -868,7 +868,7 @@ efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
* @return Returns no value * @return Returns no value
* @brief Dumps the contents of the menu to the command line * @brief Dumps the contents of the menu to the command line
*/ */
void EAPI void
efreet_menu_dump(Efreet_Menu *menu, const char *indent) efreet_menu_dump(Efreet_Menu *menu, const char *indent)
{ {
printf("%s%s: ", indent, menu->name); printf("%s%s: ", indent, menu->name);
@ -2503,7 +2503,7 @@ efreet_menu_entry_new(void)
* @return Returns no value * @return Returns no value
* @brief Frees the given structure * @brief Frees the given structure
*/ */
void EAPI void
efreet_menu_free(Efreet_Menu *entry) efreet_menu_free(Efreet_Menu *entry)
{ {
IF_RELEASE(entry->name); IF_RELEASE(entry->name);

View File

@ -49,18 +49,21 @@ struct Efreet_Menu
Ecore_List *entries; /**< The menu items */ Ecore_List *entries; /**< The menu items */
}; };
int efreet_menu_kde_legacy_init(void); EAPI int efreet_menu_kde_legacy_init(void);
Efreet_Menu *efreet_menu_new(void); EAPI Efreet_Menu *efreet_menu_new(void);
Efreet_Menu *efreet_menu_get(void); EAPI Efreet_Menu *efreet_menu_get(void);
Efreet_Menu *efreet_menu_parse(const char *path); EAPI Efreet_Menu *efreet_menu_parse(const char *path);
int efreet_menu_save(Efreet_Menu *menu, const char *path); EAPI int efreet_menu_save(Efreet_Menu *menu, const char *path);
void efreet_menu_free(Efreet_Menu *menu); EAPI void efreet_menu_free(Efreet_Menu *menu);
int efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos); EAPI int efreet_menu_desktop_insert(Efreet_Menu *menu,
int efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop); Efreet_Desktop *desktop,
int pos);
EAPI int efreet_menu_desktop_remove(Efreet_Menu *menu,
Efreet_Desktop *desktop);
void efreet_menu_dump(Efreet_Menu *menu, const char *indent); EAPI void efreet_menu_dump(Efreet_Menu *menu, const char *indent);
/** /**
* @} * @}

View File

@ -97,7 +97,7 @@ static void efreet_mime_cb_update_file(void *data,
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Initializes the efreet mime settings * @brief Initializes the efreet mime settings
*/ */
int EAPI int
efreet_mime_init(void) efreet_mime_init(void)
{ {
if (!ecore_init()) if (!ecore_init())
@ -126,7 +126,7 @@ efreet_mime_init(void)
* @return Returns no value * @return Returns no value
* @brief Cleans up the efreet mime settings system * @brief Cleans up the efreet mime settings system
*/ */
void EAPI void
efreet_mime_shutdown(void) efreet_mime_shutdown(void)
{ {
IF_FREE_LIST(globs); IF_FREE_LIST(globs);
@ -144,7 +144,7 @@ efreet_mime_shutdown(void)
* @return Returns mime type as a string * @return Returns mime type as a string
* @brief Retreive the mime type of a file * @brief Retreive the mime type of a file
*/ */
const char * EAPI const char *
efreet_mime_type_get(const char *file) efreet_mime_type_get(const char *file)
{ {
const char *type = NULL; const char *type = NULL;
@ -178,7 +178,7 @@ efreet_mime_type_get(const char *file)
* @return Returns mime type icon path as a string * @return Returns mime type icon path as a string
* @brief Retreive the mime type icon for a file * @brief Retreive the mime type icon for a file
*/ */
char * EAPI char *
efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size) efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
{ {
char *icon = NULL; char *icon = NULL;
@ -245,7 +245,7 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
* @return Returns mime type as a string * @return Returns mime type as a string
* @brief Retreive the mime type of a file using magic * @brief Retreive the mime type of a file using magic
*/ */
const char * EAPI const char *
efreet_mime_magic_type_get(const char *file) efreet_mime_magic_type_get(const char *file)
{ {
return efreet_mime_magic_check_priority(file, 0, 0); return efreet_mime_magic_check_priority(file, 0, 0);
@ -256,7 +256,7 @@ efreet_mime_magic_type_get(const char *file)
* @return Returns mime type as a string * @return Returns mime type as a string
* @brief Retreive the mime type of a file using globs * @brief Retreive the mime type of a file using globs
*/ */
const char * EAPI const char *
efreet_mime_globs_type_get(const char *file) efreet_mime_globs_type_get(const char *file)
{ {
Efreet_Mime_Glob *g; Efreet_Mime_Glob *g;
@ -310,7 +310,7 @@ efreet_mime_globs_type_get(const char *file)
* @return Returns mime type as a string * @return Returns mime type as a string
* @brief Retreive the special mime type of a file * @brief Retreive the special mime type of a file
*/ */
const char * EAPI const char *
efreet_mime_special_type_get(const char *file) efreet_mime_special_type_get(const char *file)
{ {
return efreet_mime_special_check(file); return efreet_mime_special_check(file);
@ -322,7 +322,7 @@ efreet_mime_special_type_get(const char *file)
* @return Returns mime type as a string * @return Returns mime type as a string
* @brief Retreive the fallback mime type of a file * @brief Retreive the fallback mime type of a file
*/ */
const char * EAPI const char *
efreet_mime_fallback_type_get(const char *file) efreet_mime_fallback_type_get(const char *file)
{ {
return efreet_mime_fallback_check(file); return efreet_mime_fallback_check(file);

View File

@ -207,6 +207,8 @@ size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
const char *efreet_desktop_environment_get(void); const char *efreet_desktop_environment_get(void);
const char *efreet_util_path_to_file_id(const char *path);
/** /**
* @} * @}
*/ */

View File

@ -48,6 +48,8 @@ struct Efreet_Util_Desktop
int priority; int priority;
}; };
static char *efreet_util_path_in_default(const char *section, const char *path);
static int efreet_util_cache_fill(void *data); static int efreet_util_cache_fill(void *data);
static void efreet_util_cache_add(const char *path, const char *file_id, int priority, int event); static void efreet_util_cache_add(const char *path, const char *file_id, int priority, int event);
static void efreet_util_cache_remove(const char *path, const char *file_id, int priority); static void efreet_util_cache_remove(const char *path, const char *file_id, int priority);
@ -90,10 +92,10 @@ static Ecore_List *monitors = NULL;
static int init = 0; static int init = 0;
int EFREET_EVENT_DESKTOP_LIST_CHANGE = 0; EAPI int EFREET_EVENT_DESKTOP_LIST_CHANGE = 0;
int EFREET_EVENT_DESKTOP_CHANGE = 0; EAPI int EFREET_EVENT_DESKTOP_CHANGE = 0;
int EAPI int
efreet_util_init(void) efreet_util_init(void)
{ {
Ecore_List *dirs; Ecore_List *dirs;
@ -143,7 +145,7 @@ efreet_util_init(void)
return init; return init;
} }
int EAPI int
efreet_util_shutdown(void) efreet_util_shutdown(void)
{ {
if (--init) return init; if (--init) return init;
@ -168,7 +170,7 @@ efreet_util_shutdown(void)
return init; return init;
} }
char * static char *
efreet_util_path_in_default(const char *section, const char *path) efreet_util_path_in_default(const char *section, const char *path)
{ {
Ecore_List *dirs; Ecore_List *dirs;
@ -237,7 +239,7 @@ efreet_util_path_to_file_id(const char *path)
return file_id; return file_id;
} }
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_mime_list(const char *mime) efreet_util_desktop_mime_list(const char *mime)
{ {
Efreet_Cache_Search_List search; Efreet_Cache_Search_List search;
@ -252,7 +254,7 @@ efreet_util_desktop_mime_list(const char *mime)
return search.list; return search.list;
} }
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass) efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass)
{ {
Efreet_Cache_Search search; Efreet_Cache_Search search;
@ -266,7 +268,7 @@ efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass)
return NULL; return NULL;
} }
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_util_desktop_file_id_find(const char *file_id) efreet_util_desktop_file_id_find(const char *file_id)
{ {
Efreet_Desktop *desktop = NULL; Efreet_Desktop *desktop = NULL;
@ -325,7 +327,7 @@ efreet_util_desktop_file_id_find(const char *file_id)
return desktop; return desktop;
} }
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_util_desktop_exec_find(const char *exec) efreet_util_desktop_exec_find(const char *exec)
{ {
Efreet_Cache_Search search; Efreet_Cache_Search search;
@ -339,7 +341,7 @@ efreet_util_desktop_exec_find(const char *exec)
return NULL; return NULL;
} }
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_util_desktop_name_find(const char *name) efreet_util_desktop_name_find(const char *name)
{ {
Efreet_Cache_Search search; Efreet_Cache_Search search;
@ -353,7 +355,7 @@ efreet_util_desktop_name_find(const char *name)
return NULL; return NULL;
} }
Efreet_Desktop * EAPI Efreet_Desktop *
efreet_util_desktop_generic_name_find(const char *generic_name) efreet_util_desktop_generic_name_find(const char *generic_name)
{ {
Efreet_Cache_Search search; Efreet_Cache_Search search;
@ -367,7 +369,7 @@ efreet_util_desktop_generic_name_find(const char *generic_name)
return NULL; return NULL;
} }
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_name_glob_list(const char *glob) efreet_util_desktop_name_glob_list(const char *glob)
{ {
Efreet_Cache_Search_List search; Efreet_Cache_Search_List search;
@ -381,7 +383,7 @@ efreet_util_desktop_name_glob_list(const char *glob)
return search.list; return search.list;
} }
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_exec_glob_list(const char *glob) efreet_util_desktop_exec_glob_list(const char *glob)
{ {
Efreet_Cache_Search_List search; Efreet_Cache_Search_List search;
@ -395,7 +397,7 @@ efreet_util_desktop_exec_glob_list(const char *glob)
return search.list; return search.list;
} }
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_generic_name_glob_list(const char *glob) efreet_util_desktop_generic_name_glob_list(const char *glob)
{ {
Efreet_Cache_Search_List search; Efreet_Cache_Search_List search;
@ -409,7 +411,7 @@ efreet_util_desktop_generic_name_glob_list(const char *glob)
return search.list; return search.list;
} }
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_comment_glob_list(const char *glob) efreet_util_desktop_comment_glob_list(const char *glob)
{ {
Efreet_Cache_Search_List search; Efreet_Cache_Search_List search;
@ -429,7 +431,7 @@ efreet_util_desktop_comment_glob_list(const char *glob)
* *
* @return an Ecore_List of category names (const char *) * @return an Ecore_List of category names (const char *)
*/ */
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_categories_list(void) efreet_util_desktop_categories_list(void)
{ {
return ecore_hash_keys(desktops_by_category); return ecore_hash_keys(desktops_by_category);
@ -443,7 +445,7 @@ efreet_util_desktop_categories_list(void)
* @param category the category name * @param category the category name
* @return a list of desktops * @return a list of desktops
*/ */
Ecore_List * EAPI Ecore_List *
efreet_util_desktop_category_list(const char *category) efreet_util_desktop_category_list(const char *category)
{ {
return ecore_hash_get(desktops_by_category, category); return ecore_hash_get(desktops_by_category, category);
@ -989,7 +991,7 @@ efreet_util_monitor_free(void *data)
* Returns a list of .menu files found in the various config dirs. * Returns a list of .menu files found in the various config dirs.
* @return An ecore list of menu file paths (const char *). This must be freed with ecore_list_destroy(). * @return An ecore list of menu file paths (const char *). This must be freed with ecore_list_destroy().
*/ */
Ecore_List * EAPI Ecore_List *
efreet_util_menus_find(void) efreet_util_menus_find(void)
{ {
Ecore_List *menus, *dirs; Ecore_List *menus, *dirs;

View File

@ -20,29 +20,28 @@ struct Efreet_Event_Desktop_Change
Efreet_Desktop_Change change; Efreet_Desktop_Change change;
}; };
char *efreet_util_path_in_default(const char *section, const char *path); EAPI int efreet_util_init(void);
const char *efreet_util_path_to_file_id(const char *path); EAPI int efreet_util_shutdown(void);
Ecore_List *efreet_util_desktop_mime_list(const char *mime); EAPI Ecore_List *efreet_util_desktop_mime_list(const char *mime);
Efreet_Desktop *efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass); EAPI Efreet_Desktop *efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass);
Efreet_Desktop *efreet_util_desktop_file_id_find(const char *file_id); EAPI Efreet_Desktop *efreet_util_desktop_file_id_find(const char *file_id);
Efreet_Desktop *efreet_util_desktop_exec_find(const char *exec); EAPI Efreet_Desktop *efreet_util_desktop_exec_find(const char *exec);
Efreet_Desktop *efreet_util_desktop_name_find(const char *name); EAPI Efreet_Desktop *efreet_util_desktop_name_find(const char *name);
Efreet_Desktop *efreet_util_desktop_generic_name_find(const char *generic_name); EAPI Efreet_Desktop *efreet_util_desktop_generic_name_find(const char *generic_name);
int efreet_util_init(void); EAPI Ecore_List *efreet_util_desktop_name_glob_list(const char *glob);
int efreet_util_shutdown(void); EAPI Ecore_List *efreet_util_desktop_exec_glob_list(const char *glob);
Ecore_List *efreet_util_desktop_name_glob_list(const char *glob); EAPI Ecore_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
Ecore_List *efreet_util_desktop_exec_glob_list(const char *glob); EAPI Ecore_List *efreet_util_desktop_comment_glob_list(const char *glob);
Ecore_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
Ecore_List *efreet_util_desktop_comment_glob_list(const char *glob);
Ecore_List *efreet_util_desktop_categories_list(void); EAPI Ecore_List *efreet_util_desktop_categories_list(void);
Ecore_List *efreet_util_desktop_category_list(const char *category); EAPI Ecore_List *efreet_util_desktop_category_list(const char *category);
Ecore_List *efreet_util_menus_find(void); EAPI Ecore_List *efreet_util_menus_find(void);
extern int EFREET_EVENT_DESKTOP_LIST_CHANGE;
extern int EFREET_EVENT_DESKTOP_CHANGE; EAPI extern int EFREET_EVENT_DESKTOP_LIST_CHANGE;
EAPI extern int EFREET_EVENT_DESKTOP_CHANGE;
#endif #endif