elm_theme_flush(th);
}
+EAPI const Eina_List *
+elm_theme_overlay_list_get(Elm_Theme *th)
+{
+ if (!th) th = &(theme_default);
+ return th->overlay;
+}
+
EAPI void
elm_theme_extension_add(Elm_Theme *th, const char *item)
{
elm_theme_flush(th);
}
+EAPI const Eina_List *
+elm_theme_extension_list_get(Elm_Theme *th)
+{
+ if (!th) th = &(theme_default);
+ return th->extension;
+}
+
EAPI void
elm_theme_set(Elm_Theme *th, const char *theme)
{
EAPI void elm_theme_overlay_del(Elm_Theme *th, const char *item);
/**
+ * Get the list of registered overlays for the given theme
+ *
+ * @param th The theme from which to get the overlays
+ * @return List of theme overlays. Do not free it.
+ *
+ * @see elm_theme_overlay_add()
+ */
+EAPI const Eina_List *elm_theme_overlay_list_get(Elm_Theme *th);
+
+/**
* Appends a theme extension to the list of extensions.
*
* @param th The theme to add to, or if NULL, the default theme
EAPI void elm_theme_extension_del(Elm_Theme *th, const char *item);
/**
+ * Get the list of registered extensions for the given theme
+ *
+ * @param th The theme from which to get the extensions
+ * @return List of theme extensions. Do not free it.
+ *
+ * @see elm_theme_extension_add()
+ */
+EAPI const Eina_List *elm_theme_extension_list_get(Elm_Theme *th);
+
+/**
* Set the theme search order for the given theme
*
* @param th The theme to set the search order, or if NULL, the default theme
{ NULL, NULL }
};
-static void
-_theme_hook(Evas_Object *obj)
+static char *
+_webkit_theme_find(const Eina_List *list)
{
-#ifdef HAVE_ELEMENTARY_WEB
- Elm_Theme *theme = elm_object_theme_get(obj);
- Widget_Data *wd = elm_widget_data_get(obj);
- const Eina_List *themes, *l;
+ const Eina_List *l;
const char *th;
- char *view_theme = NULL;
- themes = elm_theme_list_get(theme);
- EINA_LIST_FOREACH(themes, l, th)
+ EINA_LIST_FOREACH(list, l, th)
{
char *path = elm_theme_list_item_path_get(th, NULL);
if (!path) continue;
if (edje_file_group_exists(path, "webkit/base"))
- {
- view_theme = path;
- break;
- }
+ return path;
free(path);
}
+ return NULL;
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+#ifdef HAVE_ELEMENTARY_WEB
+ Elm_Theme *theme = elm_object_theme_get(obj);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ const Eina_List *themes;
+ char *view_theme = NULL;
+
+ themes = elm_theme_overlay_list_get(theme);
+ view_theme = _webkit_theme_find(themes);
+ if (view_theme) goto set;
+
+ themes = elm_theme_list_get(theme);
+ view_theme = _webkit_theme_find(themes);
+ if (view_theme) goto set;
+
+ themes = elm_theme_extension_list_get(theme);
+ view_theme = _webkit_theme_find(themes);
+
+set:
if (view_theme)
{
ewk_view_theme_set(wd->ewk_view, view_theme);