Exemplo n.º 1
0
void
efreet_cache_shutdown(void)
{
    Efreet_Old_Cache *d;

    IF_RELEASE(theme_name);

    icon_cache = efreet_cache_close(icon_cache);
    icon_theme_cache = efreet_cache_close(icon_theme_cache);

    IF_FREE_HASH(themes);
    IF_FREE_HASH(icons);
    IF_FREE_HASH(fallbacks);

    IF_FREE_HASH_CB(desktops, EINA_FREE_CB(efreet_cache_desktop_free));
    desktop_cache = efreet_cache_close(desktop_cache);
    IF_RELEASE(desktop_cache_file);

    efreet_cache_edd_shutdown();
    IF_RELEASE(icon_theme_cache_file);

    if (old_desktop_caches)
        ERR("This application has not properly closed all its desktop references!");
    EINA_LIST_FREE(old_desktop_caches, d)
    {
        eina_hash_free(d->hash);
        eet_close(d->ef);
        free(d);
    }
Exemplo n.º 2
0
EAPI int
efreet_mime_shutdown(void)
{
    if (--_efreet_mime_init_count != 0)
        return _efreet_mime_init_count;

    efreet_mime_icons_debug();

    IF_RELEASE(_mime_inode_symlink);
    IF_RELEASE(_mime_inode_fifo);
    IF_RELEASE(_mime_inode_chardevice);
    IF_RELEASE(_mime_inode_blockdevice);
    IF_RELEASE(_mime_inode_socket);
    IF_RELEASE(_mime_inode_mountpoint);
    IF_RELEASE(_mime_inode_directory);
    IF_RELEASE(_mime_application_x_executable);
    IF_RELEASE(_mime_application_octet_stream);
    IF_RELEASE(_mime_text_plain);

    IF_FREE_LIST(globs, efreet_mime_glob_free);
    IF_FREE_LIST(magics, efreet_mime_magic_free);
    IF_FREE_HASH(monitors);
    IF_FREE_HASH(wild);
    IF_FREE_HASH(mime_icons);
    eina_log_domain_unregister(_efreet_mime_log_dom);
    _efreet_mime_log_dom = -1;
    efreet_shutdown();
    ecore_file_shutdown();
    ecore_shutdown();

    return _efreet_mime_init_count;
}
Exemplo n.º 3
0
/**
 * @return Returns no value.
 * @brief Shuts down the icon theme system
 */
void
ewl_icon_theme_shutdown(void)
{
        DENTER_FUNCTION(DLEVEL_STABLE);

        IF_FREE_HASH(ewl_icon_theme_cache);
        IF_FREE_HASH(ewl_icon_fallback_theme_cache);

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Exemplo n.º 4
0
/**
 * @return Returns no value
 * @brief Shuts down the io manager system
 */
void
ewl_io_manager_shutdown(void)
{
        DENTER_FUNCTION(DLEVEL_STABLE);

        IF_FREE_HASH(ewl_io_manager_ext_icon_map);
        IF_FREE_HASH(ewl_io_manager_plugins);
        if (ewl_io_manager_path)
        {
                ecore_path_group_del(ewl_io_manager_path);
                ewl_io_manager_path = 0;
        }

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Exemplo n.º 5
0
/**
 * @internal
 * @returns the number of initializations left for this system
 * @brief Attempts to shut down the subsystem if nothing else is using it
 */
void
efreet_desktop_shutdown(void)
{
    Efreet_Desktop_Type_Info *info;
    char *dir;

    if (efreet_desktop_exe_handler) ecore_event_handler_del(efreet_desktop_exe_handler);
    IF_RELEASE(desktop_environment);
    IF_FREE_HASH(efreet_desktop_cache);
    while (efreet_desktop_types)
    {
        info = eina_list_data_get(efreet_desktop_types);
        efreet_desktop_type_info_free(info);
        efreet_desktop_types = eina_list_remove_list(efreet_desktop_types,
                                                     efreet_desktop_types);
    }
    EINA_LIST_FREE(efreet_desktop_dirs, dir)
        eina_stringshare_del(dir);
    if (cache_monitor) ecore_file_monitor_del(cache_monitor);
    if (change_monitors) eina_hash_free(change_monitors);
    if (cache) eet_close(cache);
    efreet_desktop_edd_shutdown(desktop_edd);
    ecore_file_shutdown();
    eina_log_domain_unregister(_efreet_desktop_log_dom);
    IF_RELEASE(cache_file);
    IF_RELEASE(cache_dirs);
    if (efreet_desktop_job) ecore_job_del(efreet_desktop_job);
    efreet_desktop_job = NULL;
}
Exemplo n.º 6
0
/**
 * @return Returns no value
 * @brief Called when the icon theme is changed so we can clean up any
 * caching we have in place
 */
void
ewl_icon_theme_theme_change(void)
{
        const char *icon_theme;

        DENTER_FUNCTION(DLEVEL_STABLE);

        icon_theme = ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_ICON_THEME);

        /* check if this is an edje theme */
        if (icon_theme && (!strncasecmp(icon_theme + (strlen(icon_theme) - 4),
                                              ".edj", 4)))
                ewl_icon_theme_is_edje = 1;
        else
                ewl_icon_theme_is_edje = 0;

        /* destroy the cache and re-create it */
        IF_FREE_HASH(ewl_icon_theme_cache);

        ewl_icon_theme_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
        ecore_hash_free_key_cb_set(ewl_icon_theme_cache, ewl_icon_theme_cb_free);
        ecore_hash_free_value_cb_set(ewl_icon_theme_cache, free);

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Exemplo n.º 7
0
/**
 * @internal
 * @param datadirs List of XDG data dirs
 * @param datahome Path to XDG data home directory
 * @return Returns no value
 * @brief Read all glob files in XDG data/home dirs.
 * Also reads the /etc/mime.types file.
 */
static void
efreet_mime_load_globs(Eina_List *datadirs, const char *datahome)
{
    Eina_List *l;
    char buf[4096];
    const char *datadir = NULL;

    IF_FREE_HASH(wild);
    wild = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
    while (globs)
    {
        efreet_mime_glob_free(eina_list_data_get(globs));
        globs = eina_list_remove_list(globs, globs);
    }

    /*
     * This is here for legacy reasons.  It is mentioned briefly
     * in the spec and seems to still be quite valid.  It is
     * loaded first so the globs files will override anything
     * in here.
    */
    efreet_mime_mime_types_load("/etc/mime.types");

    datadir = datahome;
    snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
    efreet_mime_shared_mimeinfo_globs_load(buf);

    EINA_LIST_FOREACH(datadirs, l, datadir)
    {
        snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
        efreet_mime_shared_mimeinfo_globs_load(buf);
    }
Exemplo n.º 8
0
EAPI void
efreet_ini_free(Efreet_Ini *ini)
{
    if (!ini) return;

    IF_FREE_HASH(ini->data);
    FREE(ini);
}
Exemplo n.º 9
0
/**
 * @internal
 * @return Returns no value
 * @brief Shuts the context system down
 */
void
ewl_text_context_shutdown(void)
{
        DENTER_FUNCTION(DLEVEL_STABLE);

        IF_FREE_HASH(context_hash);

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Exemplo n.º 10
0
int
efreet_util_shutdown(void)
{
    if (--init) return init;

    eina_log_domain_unregister(_efreet_utils_log_dom);
    IF_FREE_HASH(file_id_by_desktop_path);
    cache = efreet_cache_close(cache);
    IF_RELEASE(cache_file);
    return init;
}
Exemplo n.º 11
0
/**
 * @internal
 * @return Returns no value
 * @brief Shuts down the icon system
 */
void
efreet_icon_shutdown(void)
{
    IF_RELEASE(efreet_icon_user_dir);
    IF_RELEASE(efreet_icon_deprecated_user_dir);

    IF_FREE_LIST(efreet_icon_extensions, eina_stringshare_del);
    efreet_extra_icon_dirs = eina_list_free(efreet_extra_icon_dirs);

    eina_log_domain_unregister(_efreet_icon_log_dom);
    _efreet_icon_log_dom = -1;
    IF_FREE_HASH(change_monitors);
}
Exemplo n.º 12
0
/**
 * @internal
 * @returns the number of initializations left for this system
 * @brief Attempts to shut down the subsystem if nothing else is using it
 */
void
efreet_desktop_shutdown(void)
{
    Efreet_Desktop_Type_Info *info;

    IF_RELEASE(desktop_environment);
    EINA_LIST_FREE(efreet_desktop_types, info)
        efreet_desktop_type_info_free(info);
    IF_FREE_HASH(change_monitors);
#ifdef HAVE_EVIL
    evil_sockets_shutdown();
#endif
    eina_log_domain_unregister(_efreet_desktop_log_dom);
    _efreet_desktop_log_dom = -1;
}
Exemplo n.º 13
0
EAPI void
efreet_desktop_free(Efreet_Desktop *desktop)
{
    if (!desktop) return;

    desktop->ref--;
    if (desktop->ref > 0) return;

    if (desktop->eet)
    {
        efreet_cache_desktop_free(desktop);
    }
    else
    {
        IF_FREE(desktop->orig_path);

        IF_FREE(desktop->version);
        IF_FREE(desktop->name);
        IF_FREE(desktop->generic_name);
        IF_FREE(desktop->comment);
        IF_FREE(desktop->icon);
        IF_FREE(desktop->url);

        IF_FREE(desktop->try_exec);
        IF_FREE(desktop->exec);
        IF_FREE(desktop->path);
        IF_FREE(desktop->startup_wm_class);

        IF_FREE_LIST(desktop->only_show_in, eina_stringshare_del);
        IF_FREE_LIST(desktop->not_show_in, eina_stringshare_del);

        IF_FREE_LIST(desktop->categories, eina_stringshare_del);
        IF_FREE_LIST(desktop->mime_types, eina_stringshare_del);

        IF_FREE_HASH(desktop->x);

        if (desktop->type_data)
        {
            Efreet_Desktop_Type_Info *info;
            info = eina_list_nth(efreet_desktop_types, desktop->type);
            if (info->free_func)
                info->free_func(desktop->type_data);
        }
        free(desktop);
    }
}