1 /* vim: set sw=4 ts=4 sts=4 et: */
7 * @brief Contains the structures and methods used to support the FDO icon
8 * theme specificiation.
9 * @addtogroup Efreet_Icon Efreet_Icon: The FDO Icon Theme
10 * Specification functions and structures
18 * The possible contexts for an icon directory
20 enum Efreet_Icon_Theme_Context
22 EFREET_ICON_THEME_CONTEXT_NONE,
23 EFREET_ICON_THEME_CONTEXT_ACTIONS,
24 EFREET_ICON_THEME_CONTEXT_DEVICES,
25 EFREET_ICON_THEME_CONTEXT_FILESYSTEMS,
26 EFREET_ICON_THEME_CONTEXT_MIMETYPES
30 * Efreet_icon_Theme_Context
32 typedef enum Efreet_Icon_Theme_Context Efreet_Icon_Theme_Context;
35 * The possible size types for an icon directory
37 enum Efreet_Icon_Size_Type
39 EFREET_ICON_SIZE_TYPE_NONE,
40 EFREET_ICON_SIZE_TYPE_FIXED,
41 EFREET_ICON_SIZE_TYPE_SCALABLE,
42 EFREET_ICON_SIZE_TYPE_THRESHOLD
46 * Efreet_Icon_Size_Type
48 typedef enum Efreet_Icon_Size_Type Efreet_Icon_Size_Type;
53 typedef struct Efreet_Icon_Theme Efreet_Icon_Theme;
57 * @brief contains all of the known information about a given theme
59 struct Efreet_Icon_Theme
63 const char *internal; /**< The internal theme name */
64 const char *name; /**< The user visible name */
65 } name; /**< The different names for the theme */
67 char *comment; /**< String describing the theme */
68 char *example_icon; /**< Icon to use as an example of the theme */
70 /* An icon theme can have multiple directories that store it's icons. We
71 * need to be able to find a search each one. */
73 Eina_List *paths; /**< The paths */
74 Eina_List *inherits; /**< Icon themes we inherit from */
75 Eina_List *directories; /**< List of subdirectories for this theme */
77 double last_cache_check; /**< Last time the cache was checked */
79 unsigned char hidden:1; /**< Should this theme be hidden from users */
80 unsigned char valid:1; /**< Have we seen an index for this theme */
81 unsigned char fake:1; /**< This isnt' a real theme but the user has
82 tried to query from it. We create the
83 fake one to give us the theme cache. */
87 * Efreet_Icon_Theme_Directory
89 typedef struct Efreet_Icon_Theme_Directory Efreet_Icon_Theme_Directory;
92 * Efreet_Icon_Theme_Directory
93 * @brief Contains all the information about a sub-directory of a theme
95 struct Efreet_Icon_Theme_Directory
97 char *name; /**< The directory name */
98 Efreet_Icon_Theme_Context context; /**< The type of icons in the dir */
99 Efreet_Icon_Size_Type type; /**< The size type for the icons */
103 unsigned int normal; /**< The size for this directory */
104 unsigned int min; /**< The minimum size for this directory */
105 unsigned int max; /**< The maximum size for this directory */
106 unsigned int threshold; /**< Size difference threshold */
107 } size; /**< The size settings for the icon theme */
113 typedef struct Efreet_Icon Efreet_Icon;
117 * @brief Contains all the information about a given icon
121 char *path; /**< Full path to the icon */
122 char *name; /**< Translated UTF8 string that can
123 be used for the icon name */
127 int x0, /**< x0 position */
128 y0, /**< y0 position */
129 x1, /**< x1 position */
130 y1; /**< y1 position */
131 } embedded_text_rectangle; /**< Rectangle where text can
132 be displayed on the icon */
134 Eina_List *attach_points; /**< List of points to be used as anchor
135 points for emblems/overlays */
137 unsigned int ref_count; /**< References to this icon */
138 unsigned char has_embedded_text_rectangle:1; /**< Was the embedded
145 typedef struct Efreet_Icon_Point Efreet_Icon_Point;
149 * @brief Stores an x, y point.
151 struct Efreet_Icon_Point
153 int x; /**< x coord */
154 int y; /**< y coord */
157 EAPI const char *efreet_icon_user_dir_get(void);
158 EAPI void efreet_icon_extension_add(const char *ext);
160 EAPI Eina_List **efreet_icon_extra_list_get(void);
161 EAPI Eina_List *efreet_icon_theme_list_get(void);
162 EAPI Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
163 EAPI Efreet_Icon *efreet_icon_find(const char *theme_name,
166 EAPI char *efreet_icon_list_find(const char *theme_name,
169 EAPI char *efreet_icon_path_find(const char *theme_name,
172 EAPI void efreet_icon_free(Efreet_Icon *icon);