void
ewl_widget_appearance_set(Ewl_Widget *w, char *appearance)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
DCHECK_PARAM_PTR("appearance", appearance);
DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
/* make sure we have something to do */
if (w->appearance && !strcmp(appearance, w->appearance))
DLEAVE_FUNCTION(DLEVEL_STABLE);
/*
* The base appearance is used for determining the theme key of the
* widget. Intentionally lose a reference to the ecore string to keep a
* reference cached for later re-use.
*/
w->appearance = ecore_string_instance(appearance);
if (!w->appearance)
DRETURN(DLEVEL_STABLE);
/*
* Recreate the visible components of the widget if necessary.
*/
if (REALIZED(w)) {
ewl_widget_unrealize(w);
ewl_widget_realize(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
}