elementary/theme, widget, win, toolbar, thumb, toggle, util, box - removed white spaces

SVN revision: 58249
This commit is contained in:
ChunEon Park 2011-04-01 11:20:18 +00:00
parent 71d2f4b067
commit 22588576be
9 changed files with 952 additions and 952 deletions

View File

@ -141,7 +141,7 @@ elm_table_add(Evas_Object *parent)
Widget_Data *wd; Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "table"); ELM_SET_WIDTYPE(widtype, "table");
elm_widget_type_set(obj, "table"); elm_widget_type_set(obj, "table");
elm_widget_sub_object_add(parent, obj); elm_widget_sub_object_add(parent, obj);
@ -155,7 +155,7 @@ elm_table_add(Evas_Object *parent)
wd->tbl = evas_object_table_add(e); wd->tbl = evas_object_table_add(e);
evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS, evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj); _changed_size_hints, obj);
elm_widget_resize_object_set(obj, wd->tbl); elm_widget_resize_object_set(obj, wd->tbl);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);

View File

@ -26,21 +26,21 @@ _elm_theme_clear(Elm_Theme *th)
eina_stringshare_del(p); eina_stringshare_del(p);
if (th->cache) if (th->cache)
{ {
eina_hash_free(th->cache); eina_hash_free(th->cache);
th->cache = NULL; th->cache = NULL;
} }
if (th->theme) if (th->theme)
{ {
eina_stringshare_del(th->theme); eina_stringshare_del(th->theme);
th->theme = NULL; th->theme = NULL;
} }
if (th->ref_theme) if (th->ref_theme)
{ {
th->ref_theme->referrers = th->ref_theme->referrers =
eina_list_remove(th->ref_theme->referrers, th); eina_list_remove(th->ref_theme->referrers, th);
elm_theme_free(th->ref_theme); elm_theme_free(th->ref_theme);
th->ref_theme = NULL; th->ref_theme = NULL;
} }
} }
static const char * static const char *
@ -50,12 +50,12 @@ _elm_theme_find_try(Elm_Theme *th, const char *f, const char *group)
if (edje_file_group_exists(f, group)) if (edje_file_group_exists(f, group))
{ {
file = eina_stringshare_add(f); file = eina_stringshare_add(f);
if (file) if (file)
{ {
eina_hash_add(th->cache, group, file); eina_hash_add(th->cache, group, file);
return file; return file;
} }
} }
return NULL; return NULL;
} }
@ -72,8 +72,8 @@ _elm_theme_theme_element_try(Elm_Theme *th, const char *home, const char *f, con
return _elm_theme_find_try(th, f, group); return _elm_theme_find_try(th, f, group);
else if (((f[0] == '~') && (f[1] == '/'))) else if (((f[0] == '~') && (f[1] == '/')))
{ {
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
return _elm_theme_find_try(th, buf, group); return _elm_theme_find_try(th, buf, group);
} }
snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f);
file = _elm_theme_find_try(th, buf, group); file = _elm_theme_find_try(th, buf, group);
@ -94,23 +94,23 @@ _elm_theme_group_file_find(Elm_Theme *th, const char *group)
if (file) return file; if (file) return file;
if (!home) if (!home)
{ {
home = getenv("HOME"); home = getenv("HOME");
if (!home) home = ""; if (!home) home = "";
} }
EINA_LIST_FOREACH(th->overlay, l, f) EINA_LIST_FOREACH(th->overlay, l, f)
{ {
file = _elm_theme_theme_element_try(th, home, f, group); file = _elm_theme_theme_element_try(th, home, f, group);
if (file) return file; if (file) return file;
} }
EINA_LIST_FOREACH(th->themes, l, f) EINA_LIST_FOREACH(th->themes, l, f)
{ {
file = _elm_theme_theme_element_try(th, home, f, group); file = _elm_theme_theme_element_try(th, home, f, group);
if (file) return file; if (file) return file;
} }
EINA_LIST_FOREACH(th->extension, l, f) EINA_LIST_FOREACH(th->extension, l, f)
{ {
file = _elm_theme_theme_element_try(th, home, f, group); file = _elm_theme_theme_element_try(th, home, f, group);
if (file) return file; if (file) return file;
} }
if (th->ref_theme) return _elm_theme_group_file_find(th->ref_theme, group); if (th->ref_theme) return _elm_theme_group_file_find(th->ref_theme, group);
return NULL; return NULL;
@ -144,8 +144,8 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
file = _elm_theme_group_file_find(th, buf2); file = _elm_theme_group_file_find(th, buf2);
if (file) if (file)
{ {
ok = edje_object_file_set(o, file, buf2); ok = edje_object_file_set(o, file, buf2);
if (ok) return EINA_TRUE; if (ok) return EINA_TRUE;
else else
DBG("could not set theme group '%s' from file '%s': %s", DBG("could not set theme group '%s' from file '%s': %s",
buf2, file, edje_load_error_str(edje_object_load_error_get(o))); buf2, file, edje_load_error_str(edje_object_load_error_get(o)));
@ -172,9 +172,9 @@ _elm_theme_icon_set(Elm_Theme *th, Evas_Object *o, const char *group, const char
file = _elm_theme_group_file_find(th, buf2); file = _elm_theme_group_file_find(th, buf2);
if (file) if (file)
{ {
_els_smart_icon_file_edje_set(o, file, buf2); _els_smart_icon_file_edje_set(o, file, buf2);
_els_smart_icon_size_get(o, &w, &h); _els_smart_icon_size_get(o, &w, &h);
if (w > 0) return EINA_TRUE; if (w > 0) return EINA_TRUE;
} }
snprintf(buf2, sizeof(buf2), "elm/icon/%s/default", group); snprintf(buf2, sizeof(buf2), "elm/icon/%s/default", group);
file = _elm_theme_group_file_find(th, buf2); file = _elm_theme_group_file_find(th, buf2);
@ -224,8 +224,8 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
p = eina_list_data_get(eina_list_last(names)); p = eina_list_data_get(eina_list_last(names));
if ((!p) || ((p) && (strcmp(p, "default")))) if ((!p) || ((p) && (strcmp(p, "default"))))
{ {
p = eina_stringshare_add("default"); p = eina_stringshare_add("default");
if (p) names = eina_list_append(names, p); if (p) names = eina_list_append(names, p);
} }
if (th->cache) eina_hash_free(th->cache); if (th->cache) eina_hash_free(th->cache);
th->cache = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del)); th->cache = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
@ -244,7 +244,7 @@ _elm_theme_shutdown(void)
/** /**
* Create a new specific theme * Create a new specific theme
* *
* This creates an empty specific theme that only uses the default theme. A * This creates an empty specific theme that only uses the default theme. A
* specific theme has its own private set of extensions and overlays too * specific theme has its own private set of extensions and overlays too
* (which are empty by default). Specific themes do not fall back to themes * (which are empty by default). Specific themes do not fall back to themes
@ -256,7 +256,7 @@ _elm_theme_shutdown(void)
* actually apply it yet. The child of the scroller will have a specific * actually apply it yet. The child of the scroller will have a specific
* theme set to show this preview before the user decides to apply it to all * theme set to show this preview before the user decides to apply it to all
* applications). * applications).
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI Elm_Theme * EAPI Elm_Theme *
@ -272,11 +272,11 @@ elm_theme_new(void)
/** /**
* Free a specific theme * Free a specific theme
* *
* @param th The theme to free * @param th The theme to free
* *
* This frees a theme created with elm_theme_new(). * This frees a theme created with elm_theme_new().
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -294,10 +294,10 @@ elm_theme_free(Elm_Theme *th)
/** /**
* Copy the theme fom the source to the destination theme * Copy the theme fom the source to the destination theme
* *
* @param th The source theme to copy from * @param th The source theme to copy from
* @param thdst The destination theme to copy data to * @param thdst The destination theme to copy data to
* *
* This makes a one-time static copy of all the theme config, extensions * This makes a one-time static copy of all the theme config, extensions
* and overlays from @p th to @p thdst. If @p th references a theme, then * and overlays from @p th to @p thdst. If @p th references a theme, then
* @p thdst is also set to reference it, with all the theme settings, * @p thdst is also set to reference it, with all the theme settings,
@ -308,31 +308,31 @@ elm_theme_copy(Elm_Theme *th, Elm_Theme *thdst)
{ {
const Eina_List *l; const Eina_List *l;
const char *f; const char *f;
if (!th) th = &(theme_default); if (!th) th = &(theme_default);
if (!thdst) thdst = &(theme_default); if (!thdst) thdst = &(theme_default);
_elm_theme_clear(thdst); _elm_theme_clear(thdst);
if (th->ref_theme) if (th->ref_theme)
{ {
thdst->ref_theme = th->ref_theme; thdst->ref_theme = th->ref_theme;
thdst->ref_theme->referrers = thdst->ref_theme->referrers =
eina_list_append(thdst->ref_theme->referrers, thdst); eina_list_append(thdst->ref_theme->referrers, thdst);
thdst->ref_theme->ref++; thdst->ref_theme->ref++;
} }
EINA_LIST_FOREACH(th->overlay, l, f) EINA_LIST_FOREACH(th->overlay, l, f)
{ {
const char *s = eina_stringshare_add(f); const char *s = eina_stringshare_add(f);
if (s) thdst->overlay = eina_list_append(thdst->overlay, s); if (s) thdst->overlay = eina_list_append(thdst->overlay, s);
} }
EINA_LIST_FOREACH(th->themes, l, f) EINA_LIST_FOREACH(th->themes, l, f)
{ {
const char *s = eina_stringshare_add(f); const char *s = eina_stringshare_add(f);
if (s) thdst->themes = eina_list_append(thdst->themes, s); if (s) thdst->themes = eina_list_append(thdst->themes, s);
} }
EINA_LIST_FOREACH(th->extension, l, f) EINA_LIST_FOREACH(th->extension, l, f)
{ {
const char *s = eina_stringshare_add(f); const char *s = eina_stringshare_add(f);
if (s) thdst->extension = eina_list_append(thdst->extension, s); if (s) thdst->extension = eina_list_append(thdst->extension, s);
} }
if (th->theme) thdst->theme = eina_stringshare_add(th->theme); if (th->theme) thdst->theme = eina_stringshare_add(th->theme);
elm_theme_flush(thdst); elm_theme_flush(thdst);
@ -340,10 +340,10 @@ elm_theme_copy(Elm_Theme *th, Elm_Theme *thdst)
/** /**
* Tell the source theme to reference the ref theme * Tell the source theme to reference the ref theme
* *
* @param th The theme that will do the referencing * @param th The theme that will do the referencing
* @param thref The theme that is the reference source * @param thref The theme that is the reference source
* *
* This clears @p th to be empty and then sets it to refer to @p thref * This clears @p th to be empty and then sets it to refer to @p thref
* so @p th acts as an override to @p thdst, but where its overrides * so @p th acts as an override to @p thdst, but where its overrides
* don't apply, it will fall through to @pthref for configuration. * don't apply, it will fall through to @pthref for configuration.
@ -357,8 +357,8 @@ elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
_elm_theme_clear(th); _elm_theme_clear(th);
if (thref) if (thref)
{ {
thref->referrers = eina_list_append(thref->referrers, th); thref->referrers = eina_list_append(thref->referrers, th);
thref->ref++; thref->ref++;
} }
th->ref_theme = thref; th->ref_theme = thref;
elm_theme_flush(th); elm_theme_flush(th);
@ -366,10 +366,10 @@ elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
/** /**
* Return the theme referred to * Return the theme referred to
* *
* @param th The theme to get the reference from * @param th The theme to get the reference from
* @return The referenced theme handle * @return The referenced theme handle
* *
* This gets the theme set as the reference theme by elm_theme_ref_set(). * This gets the theme set as the reference theme by elm_theme_ref_set().
* If no theme is set as a reference, NULL is returned. * If no theme is set as a reference, NULL is returned.
*/ */
@ -382,9 +382,9 @@ elm_theme_ref_get(Elm_Theme *th)
/** /**
* Return the default theme * Return the default theme
* *
* @return The default theme handle * @return The default theme handle
* *
* This returns the internal default theme setup handle that all widgets * This returns the internal default theme setup handle that all widgets
* use implicitly unless a specific theme is set. This is also often use * use implicitly unless a specific theme is set. This is also often use
* as a shorthand of NULL. * as a shorthand of NULL.
@ -400,7 +400,7 @@ elm_theme_default_get(void)
* *
* @param th The theme to add to, or if NULL, the default theme * @param th The theme to add to, or if NULL, the default theme
* @param item The Edje file path to be used * @param item The Edje file path to be used
* *
* Use this if your application needs to provide some custom overlay theme * Use this if your application needs to provide some custom overlay theme
* (An Edje file that replaces some default styles of widgets) where adding * (An Edje file that replaces some default styles of widgets) where adding
* new styles, or changing system theme configuration is not possible. Do * new styles, or changing system theme configuration is not possible. Do
@ -429,7 +429,7 @@ elm_theme_overlay_add(Elm_Theme *th, const char *item)
* @param item The name of the theme overlay * @param item The name of the theme overlay
* *
* See elm_theme_overlay_add(). * See elm_theme_overlay_add().
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -441,12 +441,12 @@ elm_theme_overlay_del(Elm_Theme *th, const char *item)
if (!th) th = &(theme_default); if (!th) th = &(theme_default);
s = eina_stringshare_add(item); s = eina_stringshare_add(item);
EINA_LIST_FOREACH(th->overlay, l, f) EINA_LIST_FOREACH(th->overlay, l, f)
if (f == s) if (f == s)
{ {
eina_stringshare_del(f); eina_stringshare_del(f);
th->overlay = eina_list_remove_list(th->overlay, (Eina_List *)l); th->overlay = eina_list_remove_list(th->overlay, (Eina_List *)l);
break; break;
} }
eina_stringshare_del(s); eina_stringshare_del(s);
elm_theme_flush(th); elm_theme_flush(th);
} }
@ -467,7 +467,7 @@ elm_theme_overlay_del(Elm_Theme *th, const char *item)
* path to be search after the default theme. The use of this call is * path to be search after the default theme. The use of this call is
* encouraged when default styles do not meet the needs of the application. * encouraged when default styles do not meet the needs of the application.
* Use this call instead of elm_theme_overlay_add() for almost all cases. * Use this call instead of elm_theme_overlay_add() for almost all cases.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -485,7 +485,7 @@ elm_theme_extension_add(Elm_Theme *th, const char *item)
* *
* @param th The theme to delete from, or if NULL, the default theme * @param th The theme to delete from, or if NULL, the default theme
* @param item The name of the theme extension * @param item The name of the theme extension
* *
* See elm_theme_extension_add(). * See elm_theme_extension_add().
* *
* @ingroup Theme * @ingroup Theme
@ -499,29 +499,29 @@ elm_theme_extension_del(Elm_Theme *th, const char *item)
if (!th) th = &(theme_default); if (!th) th = &(theme_default);
s = eina_stringshare_add(item); s = eina_stringshare_add(item);
EINA_LIST_FOREACH(th->extension, l, f) EINA_LIST_FOREACH(th->extension, l, f)
if (f == s) if (f == s)
{ {
eina_stringshare_del(f); eina_stringshare_del(f);
th->extension = eina_list_remove_list(th->extension, (Eina_List *)l); th->extension = eina_list_remove_list(th->extension, (Eina_List *)l);
break; break;
} }
eina_stringshare_del(s); eina_stringshare_del(s);
elm_theme_flush(th); elm_theme_flush(th);
} }
/** /**
* Set the theme search order for the given theme * Set the theme search order for the given theme
* *
* @param th The theme to set the search order, or if NULL, the default theme * @param th The theme to set the search order, or if NULL, the default theme
* @param theme Theme search string * @param theme Theme search string
* *
* This sets the search string for the theme in path-notation from first * This sets the search string for the theme in path-notation from first
* theme to search, to last, delimited by the : character. Example: * theme to search, to last, delimited by the : character. Example:
* *
* "shiny:/path/to/file.edj:default" * "shiny:/path/to/file.edj:default"
* *
* See the ELM_THEME environment variable for more information. * See the ELM_THEME environment variable for more information.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -539,12 +539,12 @@ elm_theme_set(Elm_Theme *th, const char *theme)
/** /**
* Return the theme search order * Return the theme search order
* *
* @param th The theme to get the search order, or if NULL, the default theme * @param th The theme to get the search order, or if NULL, the default theme
* @return The internal search order path * @return The internal search order path
* *
* See elm_theme_set() for more information. * See elm_theme_set() for more information.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI const char * EAPI const char *
@ -578,10 +578,10 @@ elm_theme_get(Elm_Theme *th)
/** /**
* Return a list of theme elements to be used in a theme. * Return a list of theme elements to be used in a theme.
* *
* @param th Theme to get the list of theme elements from. * @param th Theme to get the list of theme elements from.
* @return The internal list of theme elements * @return The internal list of theme elements
* *
* This returns the internal list of theme elements (will only be valid as * This returns the internal list of theme elements (will only be valid as
* long as the theme is not modified by elm_theme_set() or theme is not * long as the theme is not modified by elm_theme_set() or theme is not
* freed by elm_theme_free(). This is a list of strings which must not be * freed by elm_theme_free(). This is a list of strings which must not be
@ -597,11 +597,11 @@ elm_theme_list_get(const Elm_Theme *th)
/** /**
* Return the full patrh for a theme element * Return the full patrh for a theme element
* *
* @param f The theme element name * @param f The theme element name
* @param in_search_path Pointer to a boolean to indicate if item is in the search path or not * @param in_search_path Pointer to a boolean to indicate if item is in the search path or not
* @return The full path to the file found. * @return The full path to the file found.
* *
* This returns a string you should free with free() on success, NULL on * This returns a string you should free with free() on success, NULL on
* failure. This will search for the given theme element, and if it is a * failure. This will search for the given theme element, and if it is a
* full or relative path element or a simple searchable name. The returned * full or relative path element or a simple searchable name. The returned
@ -616,19 +616,19 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
{ {
static const char *home = NULL; static const char *home = NULL;
char buf[PATH_MAX]; char buf[PATH_MAX];
if (!f) if (!f)
{ {
if (in_search_path) *in_search_path = EINA_FALSE; if (in_search_path) *in_search_path = EINA_FALSE;
return NULL; return NULL;
} }
if (!home) if (!home)
{ {
home = getenv("HOME"); home = getenv("HOME");
if (!home) home = ""; if (!home) home = "";
} }
if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) || if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) ||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) || ((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) ||
((isalpha(f[0])) && (f[1] == ':'))) ((isalpha(f[0])) && (f[1] == ':')))
@ -639,7 +639,7 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
else if (((f[0] == '~') && (f[1] == '/'))) else if (((f[0] == '~') && (f[1] == '/')))
{ {
if (in_search_path) *in_search_path = EINA_FALSE; if (in_search_path) *in_search_path = EINA_FALSE;
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
return strdup(buf); return strdup(buf);
} }
snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f);
@ -648,23 +648,23 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
if (in_search_path) *in_search_path = EINA_TRUE; if (in_search_path) *in_search_path = EINA_TRUE;
return strdup(buf); return strdup(buf);
} }
snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f); snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f);
if (ecore_file_exists(buf)) if (ecore_file_exists(buf))
{ {
if (in_search_path) *in_search_path = EINA_TRUE; if (in_search_path) *in_search_path = EINA_TRUE;
return strdup(buf); return strdup(buf);
} }
if (in_search_path) *in_search_path = EINA_FALSE; if (in_search_path) *in_search_path = EINA_FALSE;
return NULL; return NULL;
} }
/** /**
* Flush the current theme. * Flush the current theme.
* *
* @param th Theme to flush * @param th Theme to flush
* *
* This flushes caches that let elementary know where to find theme elements * This flushes caches that let elementary know where to find theme elements
* in the given theme. If @p th is NULL, then the default theme is flushed. * in the given theme. If @p th is NULL, then the default theme is flushed.
* Call this call if source theme data has changed in such a way as to * Call this call if source theme data has changed in such a way as to
@ -690,10 +690,10 @@ elm_theme_flush(Elm_Theme *th)
/** /**
* This flushes all themes (default and specific ones). * This flushes all themes (default and specific ones).
* *
* This will flush all themes in the current application context, by calling * This will flush all themes in the current application context, by calling
* elm_theme_flush() on each of them. * elm_theme_flush() on each of them.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -701,7 +701,7 @@ elm_theme_full_flush(void)
{ {
Eina_List *l; Eina_List *l;
Elm_Theme *th; Elm_Theme *th;
EINA_LIST_FOREACH(themes, l, th) EINA_LIST_FOREACH(themes, l, th)
{ {
elm_theme_flush(th); elm_theme_flush(th);
@ -722,7 +722,7 @@ elm_theme_all_set(const char *theme)
{ {
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
static Ecore_X_Atom atom = 0; static Ecore_X_Atom atom = 0;
if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THEME"); if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THEME");
ecore_x_window_prop_string_set(ecore_x_window_root_first_get(), ecore_x_window_prop_string_set(ecore_x_window_root_first_get(),
atom, theme); atom, theme);
@ -732,12 +732,12 @@ elm_theme_all_set(const char *theme)
/** /**
* Return a list of theme elements in the theme search path * Return a list of theme elements in the theme search path
* *
* @return A list of strings that are the theme element names. * @return A list of strings that are the theme element names.
* *
* This lists all available theme files in the standard Elementary search path * This lists all available theme files in the standard Elementary search path
* for theme elements, and returns them in alphabetical order as theme * for theme elements, and returns them in alphabetical order as theme
* element names in a list of strings. Free this with * element names in a list of strings. Free this with
* elm_theme_name_available_list_free() when you are done with the list. * elm_theme_name_available_list_free() when you are done with the list.
*/ */
EAPI Eina_List * EAPI Eina_List *
@ -747,13 +747,13 @@ elm_theme_name_available_list_new(void)
Eina_List *dir, *l; Eina_List *dir, *l;
char buf[PATH_MAX], *file, *s, *th; char buf[PATH_MAX], *file, *s, *th;
static const char *home = NULL; static const char *home = NULL;
if (!home) if (!home)
{ {
home = getenv("HOME"); home = getenv("HOME");
if (!home) home = ""; if (!home) home = "";
} }
snprintf(buf, sizeof(buf), "%s/.elementary/themes", home); snprintf(buf, sizeof(buf), "%s/.elementary/themes", home);
dir = ecore_file_ls(buf); dir = ecore_file_ls(buf);
EINA_LIST_FREE(dir, file) EINA_LIST_FREE(dir, file)
@ -784,7 +784,7 @@ elm_theme_name_available_list_new(void)
if ((s) && (!strcasecmp(s, ".edj"))) if ((s) && (!strcasecmp(s, ".edj")))
{ {
int dup; int dup;
th = strdup(file); th = strdup(file);
s = strchr(th, '.'); s = strchr(th, '.');
*s = 0; *s = 0;
@ -809,8 +809,8 @@ elm_theme_name_available_list_new(void)
/** /**
* Free the list returned by elm_theme_name_available_list_new() * Free the list returned by elm_theme_name_available_list_new()
* *
* This frees the list of themes returned by * This frees the list of themes returned by
* elm_theme_name_available_list_new(). Once freed the list should no longer * elm_theme_name_available_list_new(). Once freed the list should no longer
* be used. a new list mys be created. * be used. a new list mys be created.
*/ */
@ -823,19 +823,19 @@ elm_theme_name_available_list_free(Eina_List *list)
/** /**
* Set a specific theme to be used for this object and its children * Set a specific theme to be used for this object and its children
* *
* @param obj The object to set the theme on * @param obj The object to set the theme on
* @param th The theme to set * @param th The theme to set
* *
* This sets a specific theme that will be used for the given object and any * This sets a specific theme that will be used for the given object and any
* child objects it has. If @p th is NULL then the theme to be used is * child objects it has. If @p th is NULL then the theme to be used is
* cleared and the object will inherit its theme from its parent (which * cleared and the object will inherit its theme from its parent (which
* ultimately will use the default theme if no specific themes are set). * ultimately will use the default theme if no specific themes are set).
* *
* Use special themes with great care as this will annoy users and make * Use special themes with great care as this will annoy users and make
* configuration difficult. Avoid any custom themes at all if it can be * configuration difficult. Avoid any custom themes at all if it can be
* helped. * helped.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI void EAPI void
@ -847,15 +847,15 @@ elm_object_theme_set(Evas_Object *obj, Elm_Theme *th)
/** /**
* Get the specific theme to be used * Get the specific theme to be used
* *
* @param obj The object to get the specific theme from * @param obj The object to get the specific theme from
* @return The specifc theme set. * @return The specifc theme set.
* *
* This will return a specific theme set, or NULL if no specific theme is * This will return a specific theme set, or NULL if no specific theme is
* set on that object. It will not return inherited themes from parents, only * set on that object. It will not return inherited themes from parents, only
* the specific theme set for that specific object. See elm_object_theme_set() * the specific theme set for that specific object. See elm_object_theme_set()
* for more information. * for more information.
* *
* @ingroup Theme * @ingroup Theme
*/ */
EAPI Elm_Theme * EAPI Elm_Theme *

View File

@ -38,9 +38,9 @@ struct _Widget_Data
const char *key; const char *key;
struct struct
{ {
int id; int id;
const char *file; const char *file;
const char *key; const char *key;
} thumb; } thumb;
Ecore_Event_Handler *eeh; Ecore_Event_Handler *eeh;
Elm_Thumb_Animation_Setting anim_setting; Elm_Thumb_Animation_Setting anim_setting;
@ -60,16 +60,16 @@ static const char *widtype = NULL;
#define SIG_LOAD_ERROR "load,error" #define SIG_LOAD_ERROR "load,error"
#define SIG_PRESS "press" #define SIG_PRESS "press"
static const Evas_Smart_Cb_Description _signals[] = static const Evas_Smart_Cb_Description _signals[] =
{ {
{SIG_CLICKED, ""}, {SIG_CLICKED, ""},
{SIG_CLICKED_DOUBLE, ""}, {SIG_CLICKED_DOUBLE, ""},
{SIG_GENERATE_ERROR, ""}, {SIG_GENERATE_ERROR, ""},
{SIG_GENERATE_START, ""}, {SIG_GENERATE_START, ""},
{SIG_GENERATE_STOP, ""}, {SIG_GENERATE_STOP, ""},
{SIG_LOAD_ERROR, ""}, {SIG_LOAD_ERROR, ""},
{SIG_PRESS, ""}, {SIG_PRESS, ""},
{NULL, NULL} {NULL, NULL}
}; };
#define EDJE_SIGNAL_GENERATE_START "elm,thumb,generate,start" #define EDJE_SIGNAL_GENERATE_START "elm,thumb,generate,start"
@ -105,7 +105,7 @@ static void
_theme_hook(Evas_Object *obj) _theme_hook(Evas_Object *obj)
{ {
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
_elm_theme_object_set(obj, wd->frame, "thumb", "base", _elm_theme_object_set(obj, wd->frame, "thumb", "base",
elm_widget_style_get(obj)); elm_widget_style_get(obj));
} }
@ -156,52 +156,52 @@ _finished_thumb(Widget_Data *wd, const char *thumb_path, const char *thumb_key)
evas = evas_object_evas_get(wd->self); evas = evas_object_evas_get(wd->self);
if ((wd->view) && (wd->is_video ^ wd->was_video)) if ((wd->view) && (wd->is_video ^ wd->was_video))
{ {
evas_object_del(wd->view); evas_object_del(wd->view);
wd->view = NULL; wd->view = NULL;
} }
wd->was_video = wd->is_video; wd->was_video = wd->is_video;
if ((wd->is_video) && if ((wd->is_video) &&
(ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET)) (ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET))
{ {
if (!wd->view) if (!wd->view)
{ {
wd->view = edje_object_add(evas); wd->view = edje_object_add(evas);
if (!wd->view) if (!wd->view)
{ {
ERR("could not create edje object"); ERR("could not create edje object");
goto err; goto err;
} }
new_view = EINA_TRUE; new_view = EINA_TRUE;
} }
if (!edje_object_file_set(wd->view, thumb_path, "movie/thumb")) if (!edje_object_file_set(wd->view, thumb_path, "movie/thumb"))
{ {
ERR("could not set file=%s key=%s for %s", thumb_path, thumb_key, ERR("could not set file=%s key=%s for %s", thumb_path, thumb_key,
wd->file); wd->file);
goto view_err; goto view_err;
} }
} }
else else
{ {
if (!wd->view) if (!wd->view)
{ {
wd->view = evas_object_image_filled_add(evas); wd->view = evas_object_image_filled_add(evas);
if (!wd->view) if (!wd->view)
{ {
ERR("could not create image object"); ERR("could not create image object");
goto err; goto err;
} }
new_view = EINA_TRUE; new_view = EINA_TRUE;
} }
evas_object_image_file_set(wd->view, thumb_path, thumb_key); evas_object_image_file_set(wd->view, thumb_path, thumb_key);
r = evas_object_image_load_error_get(wd->view); r = evas_object_image_load_error_get(wd->view);
if (r != EVAS_LOAD_ERROR_NONE) if (r != EVAS_LOAD_ERROR_NONE)
{ {
ERR("%s: %s", thumb_path, evas_load_error_str(r)); ERR("%s: %s", thumb_path, evas_load_error_str(r));
goto view_err; goto view_err;
} }
} }
if (new_view) elm_widget_sub_object_add(wd->self, wd->view); if (new_view) elm_widget_sub_object_add(wd->self, wd->view);
@ -235,8 +235,8 @@ _finished_thumb_cb(void *data, Ethumb_Client *c __UNUSED__, int id, const char *
if (success) if (success)
{ {
_finished_thumb(wd, thumb_path, thumb_key); _finished_thumb(wd, thumb_path, thumb_key);
return; return;
} }
ERR("could not generate thumbnail for %s (key: %s)", file, key ? key : ""); ERR("could not generate thumbnail for %s (key: %s)", file, key ? key : "");
@ -250,7 +250,7 @@ _thumb_apply(Widget_Data *wd)
if (wd->thumb.id > 0) if (wd->thumb.id > 0)
{ {
ethumb_client_generate_cancel ethumb_client_generate_cancel
(_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL); (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
wd->thumb.id = -1; wd->thumb.id = -1;
} }
@ -259,26 +259,26 @@ _thumb_apply(Widget_Data *wd)
ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key); ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key);
if (ethumb_client_thumb_exists(_elm_ethumb_client)) if (ethumb_client_thumb_exists(_elm_ethumb_client))
{ {
const char *thumb_path, *thumb_key; const char *thumb_path, *thumb_key;
wd->thumb.id = -1; wd->thumb.id = -1;
ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path, ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
&thumb_key); &thumb_key);
_finished_thumb(wd, thumb_path, thumb_key); _finished_thumb(wd, thumb_path, thumb_key);
return; return;
} }
else if ((wd->thumb.id = ethumb_client_generate else if ((wd->thumb.id = ethumb_client_generate
(_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1) (_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1)
{ {
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm"); edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm");
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm"); edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm");
evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL); evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
} }
else else
{ {
wd->thumb.id = -1; wd->thumb.id = -1;
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm"); edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL); evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
} }
} }
@ -296,13 +296,13 @@ _thumb_show(Widget_Data *wd)
if (elm_thumb_ethumb_client_connected()) if (elm_thumb_ethumb_client_connected())
{ {
_thumb_apply(wd); _thumb_apply(wd);
return; return;
} }
if (!wd->eeh) if (!wd->eeh)
wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT,
_thumb_apply_cb, wd); _thumb_apply_cb, wd);
} }
static void static void
@ -320,18 +320,18 @@ _thumb_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
if (wd->thumb.id >= 0) if (wd->thumb.id >= 0)
{ {
ethumb_client_generate_cancel ethumb_client_generate_cancel
(_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL); (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
wd->thumb.id = -1; wd->thumb.id = -1;
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm"); edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL); evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
} }
if (wd->eeh) if (wd->eeh)
{ {
ecore_event_handler_del(wd->eeh); ecore_event_handler_del(wd->eeh);
wd->eeh = NULL; wd->eeh = NULL;
} }
} }
@ -347,9 +347,9 @@ _connect_cb(void *data __UNUSED__, Ethumb_Client *c, Eina_Bool success)
{ {
if (success) if (success)
{ {
ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL); ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
_elm_ethumb_connected = EINA_TRUE; _elm_ethumb_connected = EINA_TRUE;
ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL); ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
} }
else else
_elm_ethumb_client = NULL; _elm_ethumb_client = NULL;
@ -426,7 +426,7 @@ elm_thumb_add(Evas_Object *parent)
Evas_Coord minw, minh; Evas_Coord minw, minh;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "thumb"); ELM_SET_WIDTYPE(widtype, "thumb");
elm_widget_type_set(obj, "thumb"); elm_widget_type_set(obj, "thumb");
elm_widget_sub_object_add(parent, obj); elm_widget_sub_object_add(parent, obj);
@ -454,13 +454,13 @@ elm_thumb_add(Evas_Object *parent)
#ifdef HAVE_ELEMENTARY_ETHUMB #ifdef HAVE_ELEMENTARY_ETHUMB
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
_mouse_down_cb, wd); _mouse_down_cb, wd);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP, evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
_mouse_up_cb, wd); _mouse_up_cb, wd);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
_thumb_show_cb, wd); _thumb_show_cb, wd);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
_thumb_hide_cb, wd); _thumb_hide_cb, wd);
#endif #endif
// TODO: convert Elementary to subclassing of Evas_Smart_Class // TODO: convert Elementary to subclassing of Evas_Smart_Class
@ -526,25 +526,25 @@ elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key)
if (file_replaced) if (file_replaced)
{ {
int prefix_size; int prefix_size;
const char **ext, *ptr; const char **ext, *ptr;
static const char *extensions[] = static const char *extensions[] =
{ {
".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
}; };
prefix_size = eina_stringshare_strlen(wd->file) - 4; prefix_size = eina_stringshare_strlen(wd->file) - 4;
if (prefix_size >= 0) if (prefix_size >= 0)
{ {
ptr = wd->file + prefix_size; ptr = wd->file + prefix_size;
wd->is_video = EINA_FALSE; wd->is_video = EINA_FALSE;
for (ext = extensions; *ext; ext++) for (ext = extensions; *ext; ext++)
if (!strcasecmp(ptr, *ext)) if (!strcasecmp(ptr, *ext))
{ {
wd->is_video = EINA_TRUE; wd->is_video = EINA_TRUE;
break; break;
} }
} }
} }
eina_stringshare_replace(&(wd->thumb.file), NULL); eina_stringshare_replace(&(wd->thumb.file), NULL);
@ -730,10 +730,10 @@ elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
wd->edit = edit; wd->edit = edit;
if (wd->edit) if (wd->edit)
elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE, elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
_elm_thumb_dropcb, obj); _elm_thumb_dropcb, obj);
else else
elm_drop_target_del(obj); elm_drop_target_del(obj);
return EINA_TRUE; return EINA_TRUE;
} }

View File

@ -41,8 +41,8 @@ static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
static const char SIG_CHANGED[] = "changed"; static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _signals[] = { static const Evas_Smart_Cb_Description _signals[] = {
{SIG_CHANGED, ""}, {SIG_CHANGED, ""},
{NULL, NULL} {NULL, NULL}
}; };
static Eina_Bool static Eina_Bool
@ -93,13 +93,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
if (!wd) return; if (!wd) return;
if (elm_widget_focus_get(obj)) if (elm_widget_focus_get(obj))
{ {
edje_object_signal_emit(wd->tgl, "elm,action,focus", "elm"); edje_object_signal_emit(wd->tgl, "elm,action,focus", "elm");
evas_object_focus_set(wd->tgl, EINA_TRUE); evas_object_focus_set(wd->tgl, EINA_TRUE);
} }
else else
{ {
edje_object_signal_emit(wd->tgl, "elm,action,unfocus", "elm"); edje_object_signal_emit(wd->tgl, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->tgl, EINA_FALSE); evas_object_focus_set(wd->tgl, EINA_FALSE);
} }
} }
@ -172,12 +172,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
if (!wd) return; if (!wd) return;
if (sub == wd->icon) if (sub == wd->icon)
{ {
edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm");
evas_object_event_callback_del_full evas_object_event_callback_del_full
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
wd->icon = NULL; wd->icon = NULL;
edje_object_message_signal_process(wd->tgl); edje_object_message_signal_process(wd->tgl);
_sizing_eval(obj); _sizing_eval(obj);
} }
} }
@ -218,7 +218,7 @@ elm_toggle_add(Evas_Object *parent)
Widget_Data *wd; Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "toggle"); ELM_SET_WIDTYPE(widtype, "toggle");
elm_widget_type_set(obj, "toggle"); elm_widget_type_set(obj, "toggle");
elm_widget_sub_object_add(parent, obj); elm_widget_sub_object_add(parent, obj);
@ -318,12 +318,12 @@ elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon)
wd->icon = icon; wd->icon = icon;
if (icon) if (icon)
{ {
elm_widget_sub_object_add(obj, icon); elm_widget_sub_object_add(obj, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj); _changed_size_hints, obj);
edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon); edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon);
edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->tgl); edje_object_message_signal_process(wd->tgl);
} }
_sizing_eval(obj); _sizing_eval(obj);
} }
@ -431,12 +431,12 @@ elm_toggle_state_set(Evas_Object *obj, Eina_Bool state)
if (!wd) return; if (!wd) return;
if (state != wd->state) if (state != wd->state)
{ {
wd->state = state; wd->state = state;
if (wd->statep) *wd->statep = wd->state; if (wd->statep) *wd->statep = wd->state;
if (wd->state) if (wd->state)
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
else else
edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
} }
} }
@ -473,15 +473,15 @@ elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
if (!wd) return; if (!wd) return;
if (statep) if (statep)
{ {
wd->statep = statep; wd->statep = statep;
if (*wd->statep != wd->state) if (*wd->statep != wd->state)
{ {
wd->state = *wd->statep; wd->state = *wd->statep;
if (wd->state) if (wd->state)
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
else else
edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm"); edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
} }
} }
else else
wd->statep = NULL; wd->statep = NULL;

View File

@ -99,7 +99,7 @@ _elm_toolbar_icon_size_get(Widget_Data *wd)
const char *icon_size = edje_object_data_get( const char *icon_size = edje_object_data_get(
elm_smart_scroller_edje_object_get(wd->scr), "icon_size"); elm_smart_scroller_edje_object_get(wd->scr), "icon_size");
if (icon_size) if (icon_size)
return atoi(icon_size); return atoi(icon_size);
return _elm_config->icon_size; return _elm_config->icon_size;
} }
@ -178,19 +178,19 @@ _menu_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __U
{ {
// avoid hide being emitted during object deletion // avoid hide being emitted during object deletion
evas_object_event_callback_del_full evas_object_event_callback_del_full
(obj, EVAS_CALLBACK_HIDE, _menu_hide, data); (obj, EVAS_CALLBACK_HIDE, _menu_hide, data);
} }
static void static void
_menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) _menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{ {
Elm_Toolbar_Item *it = data; Elm_Toolbar_Item *it = data;
Evas_Coord x,y,w,h; Evas_Coord x,y,w,h;
Widget_Data *wd = elm_widget_data_get(it->base.widget); Widget_Data *wd = elm_widget_data_get(it->base.widget);
if ((!wd) || (!wd->menu_parent)) return; if ((!wd) || (!wd->menu_parent)) return;
evas_object_geometry_get(it->base.view, &x, &y, &w, &h); evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
elm_menu_move(it->o_menu, x, y+h); elm_menu_move(it->o_menu, x, y+h);
} }
static void static void
@ -222,7 +222,7 @@ _item_del(Elm_Toolbar_Item *it)
EINA_LIST_FREE(it->states, it_state) EINA_LIST_FREE(it->states, it_state)
{ {
if (it->icon == it_state->icon) if (it->icon == it_state->icon)
it->icon = NULL; it->icon = NULL;
eina_stringshare_del(it_state->label); eina_stringshare_del(it_state->label);
eina_stringshare_del(it_state->icon_str); eina_stringshare_del(it_state->icon_str);
if (it_state->icon) evas_object_del(it_state->icon); if (it_state->icon) evas_object_del(it_state->icon);
@ -251,7 +251,7 @@ _del_pre_hook(Evas_Object *obj)
it = next; it = next;
} }
if (wd->more_item) if (wd->more_item)
_item_del(wd->more_item); _item_del(wd->more_item);
} }
static void static void
@ -306,14 +306,14 @@ _theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_
edje_object_part_text_set(view, "elm.text", it->label); edje_object_part_text_set(view, "elm.text", it->label);
} }
else else
_elm_theme_object_set(obj, view, "toolbar", "separator", style); _elm_theme_object_set(obj, view, "toolbar", "separator", style);
mw = mh = -1; mw = mh = -1;
if (!it->separator) if (!it->separator)
elm_coords_finger_size_adjust(1, &mw, 1, &mh); elm_coords_finger_size_adjust(1, &mw, 1, &mh);
edje_object_size_min_restricted_calc(view, &mw, &mh, mw, mh); edje_object_size_min_restricted_calc(view, &mw, &mh, mw, mh);
if (!it->separator) if (!it->separator)
elm_coords_finger_size_adjust(1, &mw, 1, &mh); elm_coords_finger_size_adjust(1, &mw, 1, &mh);
evas_object_size_hint_min_set(view, mw, mh); evas_object_size_hint_min_set(view, mw, mh);
} }
@ -326,7 +326,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
EINA_INLIST_FOREACH(wd->items, it) EINA_INLIST_FOREACH(wd->items, it)
_mirrored_set_item(obj, it, mirrored); _mirrored_set_item(obj, it, mirrored);
if (wd->more_item) if (wd->more_item)
_mirrored_set_item(obj, wd->more_item, mirrored); _mirrored_set_item(obj, wd->more_item, mirrored);
} }
static void static void
@ -346,7 +346,7 @@ _theme_hook(Evas_Object *obj)
EINA_INLIST_FOREACH(wd->items, it) EINA_INLIST_FOREACH(wd->items, it)
_theme_hook_item(obj, it, scale, wd->icon_size); _theme_hook_item(obj, it, scale, wd->icon_size);
if (wd->more_item) if (wd->more_item)
_theme_hook_item(obj, wd->more_item, scale, wd->icon_size); _theme_hook_item(obj, wd->more_item, scale, wd->icon_size);
_sizing_eval(obj); _sizing_eval(obj);
} }
@ -375,10 +375,10 @@ _sizing_eval(Evas_Object *obj)
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
switch (wd->shrink_mode) switch (wd->shrink_mode)
{ {
case ELM_TOOLBAR_SHRINK_MENU: /* fallthrough */ case ELM_TOOLBAR_SHRINK_MENU: /* fallthrough */
case ELM_TOOLBAR_SHRINK_HIDE: /* fallthrough */ case ELM_TOOLBAR_SHRINK_HIDE: /* fallthrough */
case ELM_TOOLBAR_SHRINK_SCROLL: minw = w - vw; break; case ELM_TOOLBAR_SHRINK_SCROLL: minw = w - vw; break;
case ELM_TOOLBAR_SHRINK_NONE: minw = minw_bx + (w - vw); break; case ELM_TOOLBAR_SHRINK_NONE: minw = minw_bx + (w - vw); break;
} }
minh = minh + (h - vh); minh = minh + (h - vh);
evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_min_set(obj, minw, minh);
@ -473,7 +473,7 @@ _resize_job(void *data)
_fix_items_visibility(wd, &iw, vw); _fix_items_visibility(wd, &iw, vw);
evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &more_w, NULL); evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &more_w, NULL);
if (iw - more_w <= vw) if (iw - more_w <= vw)
iw -= more_w; iw -= more_w;
/* All items are removed from the box object, since removing individual /* All items are removed from the box object, since removing individual
* items won't trigger a resize. Items are be readded below. */ * items won't trigger a resize. Items are be readded below. */
@ -488,7 +488,7 @@ _resize_job(void *data)
EINA_INLIST_FOREACH(wd->items, it) EINA_INLIST_FOREACH(wd->items, it)
{ {
if (!it->prio.visible) if (!it->prio.visible)
{ {
if (it->separator) if (it->separator)
elm_menu_item_separator_add(menu, NULL); elm_menu_item_separator_add(menu, NULL);
@ -502,7 +502,7 @@ _resize_job(void *data)
} }
evas_object_hide(it->base.view); evas_object_hide(it->base.view);
} }
else else
{ {
evas_object_box_append(wd->bx, it->base.view); evas_object_box_append(wd->bx, it->base.view);
evas_object_show(it->base.view); evas_object_show(it->base.view);
@ -535,13 +535,13 @@ _resize_job(void *data)
{ {
EINA_INLIST_FOREACH(wd->items, it) EINA_INLIST_FOREACH(wd->items, it)
{ {
if (!it->prio.visible) if (!it->prio.visible)
evas_object_hide(it->base.view); evas_object_hide(it->base.view);
else else
{ {
evas_object_box_append(wd->bx, it->base.view); evas_object_box_append(wd->bx, it->base.view);
evas_object_show(it->base.view); evas_object_show(it->base.view);
} }
} }
} }
else else
@ -582,7 +582,7 @@ _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event
{ {
Widget_Data *wd = elm_widget_data_get(data); Widget_Data *wd = elm_widget_data_get(data);
if (!wd->resize_job) if (!wd->resize_job)
wd->resize_job = ecore_job_add(_resize_job, data); wd->resize_job = ecore_job_add(_resize_job, data);
} }
static void static void
@ -657,9 +657,9 @@ _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb f
edje_object_signal_callback_add(it->base.view, "elm,action,click", "elm", edje_object_signal_callback_add(it->base.view, "elm,action,click", "elm",
_select, it); _select, it);
edje_object_signal_callback_add(it->base.view, "elm,mouse,in", "elm", edje_object_signal_callback_add(it->base.view, "elm,mouse,in", "elm",
_mouse_in, it); _mouse_in, it);
edje_object_signal_callback_add(it->base.view, "elm,mouse,out", "elm", edje_object_signal_callback_add(it->base.view, "elm,mouse,out", "elm",
_mouse_out, it); _mouse_out, it);
elm_widget_sub_object_add(obj, it->base.view); elm_widget_sub_object_add(obj, it->base.view);
if (it->icon) if (it->icon)
{ {
@ -702,7 +702,7 @@ elm_toolbar_add(Evas_Object *parent)
Widget_Data *wd; Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "toolbar"); ELM_SET_WIDTYPE(widtype, "toolbar");
elm_widget_type_set(obj, "toolbar"); elm_widget_type_set(obj, "toolbar");
elm_widget_sub_object_add(parent, obj); elm_widget_sub_object_add(parent, obj);
@ -722,8 +722,8 @@ elm_toolbar_add(Evas_Object *parent)
EINA_FALSE); EINA_FALSE);
elm_widget_resize_object_set(obj, wd->scr); elm_widget_resize_object_set(obj, wd->scr);
elm_smart_scroller_policy_set(wd->scr, elm_smart_scroller_policy_set(wd->scr,
ELM_SMART_SCROLLER_POLICY_AUTO, ELM_SMART_SCROLLER_POLICY_AUTO,
ELM_SMART_SCROLLER_POLICY_OFF); ELM_SMART_SCROLLER_POLICY_OFF);
wd->icon_size = _elm_toolbar_icon_size_get(wd); wd->icon_size = _elm_toolbar_icon_size_get(wd);
@ -824,7 +824,7 @@ _elm_toolbar_item_state_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, v
it_state = eina_list_data_get(it->current_state); it_state = eina_list_data_get(it->current_state);
if (it_state->func) if (it_state->func)
it_state->func((void *)it_state->data, obj, event_info); it_state->func((void *)it_state->data, obj, event_info);
} }
/** /**
@ -849,7 +849,7 @@ elm_toolbar_item_state_next(Elm_Toolbar_Item *item)
next_state = eina_list_next(item->current_state); next_state = eina_list_next(item->current_state);
if (!next_state) if (!next_state)
next_state = eina_list_next(item->states); next_state = eina_list_next(item->states);
return eina_list_data_get(next_state); return eina_list_data_get(next_state);
} }
@ -875,7 +875,7 @@ elm_toolbar_item_state_prev(Elm_Toolbar_Item *item)
prev_state = eina_list_prev(item->current_state); prev_state = eina_list_prev(item->current_state);
if ((!prev_state) || (prev_state == item->states)) if ((!prev_state) || (prev_state == item->states))
prev_state = eina_list_last(item->states); prev_state = eina_list_last(item->states);
return eina_list_data_get(prev_state); return eina_list_data_get(prev_state);
} }
@ -926,7 +926,7 @@ elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state)
if (!next_state) return EINA_FALSE; if (!next_state) return EINA_FALSE;
} }
else else
next_state = it->states; next_state = it->states;
if (next_state == it->current_state) return EINA_TRUE; if (next_state == it->current_state) return EINA_TRUE;
@ -944,9 +944,9 @@ elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state)
wd->icon_size, "elm,state,icon_set,backward"); wd->icon_size, "elm,state,icon_set,backward");
} }
if (it->disabled) if (it->disabled)
elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
else else
elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm"); elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm");
it->current_state = next_state; it->current_state = next_state;
return EINA_TRUE; return EINA_TRUE;
@ -1061,7 +1061,7 @@ elm_toolbar_item_state_del(Elm_Toolbar_Item *item, Elm_Toolbar_Item_State *state
del_state = eina_list_data_find_list(item->states, state); del_state = eina_list_data_find_list(item->states, state);
if (del_state == item->states) return EINA_FALSE; if (del_state == item->states) return EINA_FALSE;
if (del_state == item->current_state) if (del_state == item->current_state)
elm_toolbar_item_state_unset(item); elm_toolbar_item_state_unset(item);
eina_stringshare_del(state->label); eina_stringshare_del(state->label);
eina_stringshare_del(state->icon_str); eina_stringshare_del(state->icon_str);
@ -1177,7 +1177,7 @@ elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Toolbar_Item *after, const c
if (!it) return NULL; if (!it) return NULL;
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET(after)); EINA_INLIST_GET(after));
evas_object_box_insert_after(wd->bx, it->base.view, after->base.view); evas_object_box_insert_after(wd->bx, it->base.view, after->base.view);
evas_object_show(it->base.view); evas_object_show(it->base.view);
_sizing_eval(obj); _sizing_eval(obj);
@ -1292,9 +1292,9 @@ EAPI void
elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority) elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority)
{ {
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
if (item->prio.priority == priority) return; if (item->prio.priority == priority) return;
item->prio.priority = priority; item->prio.priority = priority;
_resize(item->base.widget, NULL, NULL, NULL); _resize(item->base.widget, NULL, NULL, NULL);
} }
/** /**
@ -1386,7 +1386,7 @@ _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal)
_elm_toolbar_item_label_set_cb, item); _elm_toolbar_item_label_set_cb, item);
} }
else else
_elm_toolbar_item_label_update(item); _elm_toolbar_item_label_update(item);
_resize(item->base.widget, NULL, NULL, NULL); _resize(item->base.widget, NULL, NULL, NULL);
} }
@ -1425,7 +1425,7 @@ _elm_toolbar_item_icon_update(Elm_Toolbar_Item *item)
EINA_LIST_FOREACH(item->states, l, it_state) EINA_LIST_FOREACH(item->states, l, it_state)
if (it_state->icon == old_icon) if (it_state->icon == old_icon)
return; return;
evas_object_del(old_icon); evas_object_del(old_icon);
} }
@ -1509,7 +1509,7 @@ _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Ob
const char *s; const char *s;
if (icon_str) if (icon_str)
eina_stringshare_replace(&item->icon_str, icon_str); eina_stringshare_replace(&item->icon_str, icon_str);
else else
{ {
eina_stringshare_del(item->icon_str); eina_stringshare_del(item->icon_str);
@ -1542,7 +1542,7 @@ _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Ob
_elm_toolbar_item_icon_set_cb, item); _elm_toolbar_item_icon_set_cb, item);
} }
else else
_elm_toolbar_item_icon_update(item); _elm_toolbar_item_icon_update(item);
_resize(obj, NULL, NULL, NULL); _resize(obj, NULL, NULL, NULL);
} }
@ -1576,8 +1576,8 @@ elm_toolbar_item_icon_set(Elm_Toolbar_Item *item, const char *icon)
icon_obj = elm_icon_add(obj); icon_obj = elm_icon_add(obj);
if (!icon_obj) return; if (!icon_obj) return;
if (_item_icon_set(icon_obj, "toolbar/", icon)) if (_item_icon_set(icon_obj, "toolbar/", icon))
_elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size, _elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size,
"elm,state,icon_set"); "elm,state,icon_set");
else else
{ {
_elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0, _elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0,
@ -1722,7 +1722,7 @@ elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mod
elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_OFF); elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_OFF);
wd->more_item = _item_new(obj, "more_menu", "More", wd->more_item = _item_new(obj, "more_menu", "More",
NULL, NULL); NULL, NULL);
} }
else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE) else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF,
@ -1812,7 +1812,7 @@ elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent)
elm_menu_parent_set(it->o_menu, wd->menu_parent); elm_menu_parent_set(it->o_menu, wd->menu_parent);
} }
if ((wd->more_item) && (wd->more_item->o_menu)) if ((wd->more_item) && (wd->more_item->o_menu))
elm_menu_parent_set(wd->more_item->o_menu, wd->menu_parent); elm_menu_parent_set(wd->more_item->o_menu, wd->menu_parent);
} }
/** /**
@ -2253,7 +2253,7 @@ elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order)
EINA_INLIST_FOREACH(wd->items, it) EINA_INLIST_FOREACH(wd->items, it)
elm_icon_order_lookup_set(it->icon, order); elm_icon_order_lookup_set(it->icon, order);
if (wd->more_item) if (wd->more_item)
elm_icon_order_lookup_set(wd->more_item->icon, order); elm_icon_order_lookup_set(wd->more_item->icon, order);
} }
/** /**

View File

@ -19,14 +19,14 @@ _str_append(char *str, const char *txt, int *len, int *alloc)
if (txt_len <= 0) return str; if (txt_len <= 0) return str;
if ((*len + txt_len) >= *alloc) if ((*len + txt_len) >= *alloc)
{ {
char *str2; char *str2;
int alloc2; int alloc2;
alloc2 = *alloc + txt_len + 128; alloc2 = *alloc + txt_len + 128;
str2 = realloc(str, alloc2); str2 = realloc(str, alloc2);
if (!str2) return str; if (!str2) return str;
*alloc = alloc2; *alloc = alloc2;
str = str2; str = str2;
} }
strcpy(str + *len, txt); strcpy(str + *len, txt);
*len += txt_len; *len += txt_len;
@ -47,114 +47,114 @@ _elm_util_mkup_to_text(const char *mkup)
s = p; s = p;
for (;;) for (;;)
{ {
if ((!*p) || if ((!*p) ||
(tag_end) || (esc_end) || (tag_end) || (esc_end) ||
(tag_start) || (esc_start)) (tag_start) || (esc_start))
{ {
if (tag_end) if (tag_end)
{ {
char *ttag; char *ttag;
ttag = malloc(tag_end - tag_start); ttag = malloc(tag_end - tag_start);
if (ttag) if (ttag)
{ {
_str_ncpy(ttag, tag_start + 1, tag_end - tag_start - 1); _str_ncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
ttag[tag_end - tag_start - 1] = 0; ttag[tag_end - tag_start - 1] = 0;
if (!strcmp(ttag, "br")) if (!strcmp(ttag, "br"))
str = _str_append(str, "\n", &str_len, &str_alloc); str = _str_append(str, "\n", &str_len, &str_alloc);
else if (!strcmp(ttag, "\n")) else if (!strcmp(ttag, "\n"))
str = _str_append(str, "\n", &str_len, &str_alloc); str = _str_append(str, "\n", &str_len, &str_alloc);
else if (!strcmp(ttag, "\\n")) else if (!strcmp(ttag, "\\n"))
str = _str_append(str, "\n", &str_len, &str_alloc); str = _str_append(str, "\n", &str_len, &str_alloc);
else if (!strcmp(ttag, "\t")) else if (!strcmp(ttag, "\t"))
str = _str_append(str, "\t", &str_len, &str_alloc); str = _str_append(str, "\t", &str_len, &str_alloc);
else if (!strcmp(ttag, "\\t")) else if (!strcmp(ttag, "\\t"))
str = _str_append(str, "\t", &str_len, &str_alloc); str = _str_append(str, "\t", &str_len, &str_alloc);
else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */ else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */
str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc); str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc);
free(ttag); free(ttag);
} }
tag_start = tag_end = NULL; tag_start = tag_end = NULL;
} }
else if (esc_end) else if (esc_end)
{ {
ts = malloc(esc_end - esc_start + 1); ts = malloc(esc_end - esc_start + 1);
if (ts) if (ts)
{ {
const char *esc; const char *esc;
_str_ncpy(ts, esc_start, esc_end - esc_start); _str_ncpy(ts, esc_start, esc_end - esc_start);
ts[esc_end - esc_start] = 0; ts[esc_end - esc_start] = 0;
esc = evas_textblock_escape_string_get(ts); esc = evas_textblock_escape_string_get(ts);
if (esc) if (esc)
str = _str_append(str, esc, &str_len, &str_alloc); str = _str_append(str, esc, &str_len, &str_alloc);
free(ts); free(ts);
} }
esc_start = esc_end = NULL; esc_start = esc_end = NULL;
} }
else if ((!*p) && (s)) else if ((!*p) && (s))
{ {
ts = malloc(p - s + 1); ts = malloc(p - s + 1);
if (ts) if (ts)
{ {
_str_ncpy(ts, s, p - s); _str_ncpy(ts, s, p - s);
ts[p - s] = 0; ts[p - s] = 0;
str = _str_append(str, ts, &str_len, &str_alloc); str = _str_append(str, ts, &str_len, &str_alloc);
free(ts); free(ts);
} }
break; break;
} }
} }
if (*p == '<') if (*p == '<')
{ {
if ((s) && (!esc_start)) if ((s) && (!esc_start))
{ {
tag_start = p; tag_start = p;
tag_end = NULL; tag_end = NULL;
ts = malloc(p - s + 1); ts = malloc(p - s + 1);
if (ts) if (ts)
{ {
_str_ncpy(ts, s, p - s); _str_ncpy(ts, s, p - s);
ts[p - s] = 0; ts[p - s] = 0;
str = _str_append(str, ts, &str_len, &str_alloc); str = _str_append(str, ts, &str_len, &str_alloc);
free(ts); free(ts);
} }
s = NULL; s = NULL;
} }
} }
else if (*p == '>') else if (*p == '>')
{ {
if (tag_start) if (tag_start)
{ {
tag_end = p; tag_end = p;
s = p + 1; s = p + 1;
} }
} }
else if (*p == '&') else if (*p == '&')
{ {
if ((s) && (!tag_start)) if ((s) && (!tag_start))
{ {
esc_start = p; esc_start = p;
esc_end = NULL; esc_end = NULL;
ts = malloc(p - s + 1); ts = malloc(p - s + 1);
if (ts) if (ts)
{ {
_str_ncpy(ts, s, p - s); _str_ncpy(ts, s, p - s);
ts[p - s] = 0; ts[p - s] = 0;
str = _str_append(str, ts, &str_len, &str_alloc); str = _str_append(str, ts, &str_len, &str_alloc);
free(ts); free(ts);
} }
s = NULL; s = NULL;
} }
} }
else if (*p == ';') else if (*p == ';')
{ {
if (esc_start) if (esc_start)
{ {
esc_end = p; esc_end = p;
s = p + 1; s = p + 1;
} }
} }
p++; p++;
} }
return str; return str;
} }
@ -169,29 +169,29 @@ _elm_util_text_to_mkup(const char *text)
if (!text) return NULL; if (!text) return NULL;
for (;;) for (;;)
{ {
pos = pos2; pos = pos2;
pos2 = evas_string_char_next_get((char *)(text), pos2, &ch); pos2 = evas_string_char_next_get((char *)(text), pos2, &ch);
if ((ch <= 0) || (pos2 <= 0)) break; if ((ch <= 0) || (pos2 <= 0)) break;
if (ch == '\n') if (ch == '\n')
str = _str_append(str, "<br>", &str_len, &str_alloc); str = _str_append(str, "<br>", &str_len, &str_alloc);
else if (ch == '\t') else if (ch == '\t')
str = _str_append(str, "<\t>", &str_len, &str_alloc); str = _str_append(str, "<\t>", &str_len, &str_alloc);
else if (ch == '<') else if (ch == '<')
str = _str_append(str, "&lt;", &str_len, &str_alloc); str = _str_append(str, "&lt;", &str_len, &str_alloc);
else if (ch == '>') else if (ch == '>')
str = _str_append(str, "&gt;", &str_len, &str_alloc); str = _str_append(str, "&gt;", &str_len, &str_alloc);
else if (ch == '&') else if (ch == '&')
str = _str_append(str, "&amp;", &str_len, &str_alloc); str = _str_append(str, "&amp;", &str_len, &str_alloc);
else if (ch == 0x2029) /* PS */ else if (ch == 0x2029) /* PS */
str = _str_append(str, "<ps>", &str_len, &str_alloc); str = _str_append(str, "<ps>", &str_len, &str_alloc);
else else
{ {
char tstr[16]; char tstr[16];
_str_ncpy(tstr, text + pos, pos2 - pos); _str_ncpy(tstr, text + pos, pos2 - pos);
tstr[pos2 - pos] = 0; tstr[pos2 - pos] = 0;
str = _str_append(str, tstr, &str_len, &str_alloc); str = _str_append(str, tstr, &str_len, &str_alloc);
} }
} }
return str; return str;
} }

View File

@ -32,15 +32,15 @@ struct _Smart_Data
void (*theme_func) (Evas_Object *obj); void (*theme_func) (Evas_Object *obj);
Eina_Bool (*event_func) (Evas_Object *obj, Evas_Object *source, Evas_Callback_Type type, void *event_info); Eina_Bool (*event_func) (Evas_Object *obj, Evas_Object *source, Evas_Callback_Type type, void *event_info);
void (*signal_func) (Evas_Object *obj, const char *emission, void (*signal_func) (Evas_Object *obj, const char *emission,
const char *source); const char *source);
void (*callback_add_func) (Evas_Object *obj, const char *emission, void (*callback_add_func) (Evas_Object *obj, const char *emission,
const char *source, void (*func) (void *data, const char *source, void (*func) (void *data,
Evas_Object *o, const char *emission, Evas_Object *o, const char *emission,
const char *source), void *data); const char *source), void *data);
void (*callback_del_func) (Evas_Object *obj, const char *emission, void (*callback_del_func) (Evas_Object *obj, const char *emission,
const char *source, void (*func) (void *data, const char *source, void (*func) (void *data,
Evas_Object *o, const char *emission, Evas_Object *o, const char *emission,
const char *source), void *data); const char *source), void *data);
void (*changed_func) (Evas_Object *obj); void (*changed_func) (Evas_Object *obj);
Eina_Bool (*focus_next_func) (const Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool (*focus_next_func) (const Evas_Object *obj, Elm_Focus_Direction dir,
Evas_Object **next); Evas_Object **next);
@ -200,30 +200,30 @@ static void
_propagate_x_drag_lock(Evas_Object *obj, int dir) _propagate_x_drag_lock(Evas_Object *obj, int dir)
{ {
INTERNAL_ENTRY INTERNAL_ENTRY
if (sd->parent_obj) if (sd->parent_obj)
{ {
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj); Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
if (sd2) if (sd2)
{ {
sd2->child_drag_x_locked += dir; sd2->child_drag_x_locked += dir;
_propagate_x_drag_lock(sd->parent_obj, dir); _propagate_x_drag_lock(sd->parent_obj, dir);
} }
} }
} }
static void static void
_propagate_y_drag_lock(Evas_Object *obj, int dir) _propagate_y_drag_lock(Evas_Object *obj, int dir)
{ {
INTERNAL_ENTRY INTERNAL_ENTRY
if (sd->parent_obj) if (sd->parent_obj)
{ {
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj); Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
if (sd2) if (sd2)
{ {
sd2->child_drag_y_locked += dir; sd2->child_drag_y_locked += dir;
_propagate_y_drag_lock(sd->parent_obj, dir); _propagate_y_drag_lock(sd->parent_obj, dir);
} }
} }
} }
static void static void
@ -235,26 +235,26 @@ _propagate_event(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_i
switch (type) switch (type)
{ {
case EVAS_CALLBACK_KEY_DOWN: case EVAS_CALLBACK_KEY_DOWN:
{ {
Evas_Event_Key_Down *ev = event_info; Evas_Event_Key_Down *ev = event_info;
event_flags = &(ev->event_flags); event_flags = &(ev->event_flags);
break; break;
} }
case EVAS_CALLBACK_KEY_UP: case EVAS_CALLBACK_KEY_UP:
{ {
Evas_Event_Key_Up *ev = event_info; Evas_Event_Key_Up *ev = event_info;
event_flags = &(ev->event_flags); event_flags = &(ev->event_flags);
break; break;
} }
case EVAS_CALLBACK_MOUSE_WHEEL: case EVAS_CALLBACK_MOUSE_WHEEL:
{ {
Evas_Event_Mouse_Wheel *ev = event_info; Evas_Event_Mouse_Wheel *ev = event_info;
event_flags = &(ev->event_flags); event_flags = &(ev->event_flags);
break; break;
} }
default: default:
break; break;
} }
elm_widget_event_propagate(obj, type, event_info, event_flags); elm_widget_event_propagate(obj, type, event_info, event_flags);
@ -271,21 +271,21 @@ _parent_focus(Evas_Object *obj)
if (sd->focused) return; if (sd->focused) return;
if (o) if (o)
{ {
unsigned int i = 0; unsigned int i = 0;
Evas_Object *ret; Evas_Object *ret;
ret = _newest_focus_order_get(o, &i, EINA_TRUE); ret = _newest_focus_order_get(o, &i, EINA_TRUE);
/* we don't want to bump a common widget ancestor's /* we don't want to bump a common widget ancestor's
focus_order *twice* while parent focusing */ focus_order *twice* while parent focusing */
if (!ret || (!i) || (i != focus_order)) if (!ret || (!i) || (i != focus_order))
_parent_focus(o); _parent_focus(o);
} }
if (!sd->focus_order_on_calc) if (!sd->focus_order_on_calc)
return; /* we don't want to override it if by means of any of the return; /* we don't want to override it if by means of any of the
callbacks below one gets to calculate our order callbacks below one gets to calculate our order
first. */ first. */
focus_order++; focus_order++;
sd->focus_order = focus_order; sd->focus_order = focus_order;
@ -511,7 +511,7 @@ elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force)
} }
if (!force) return; if (!force) return;
EINA_LIST_FOREACH(sd->subobjs, l, child) EINA_LIST_FOREACH(sd->subobjs, l, child)
elm_widget_theme_specific(child, th, force); elm_widget_theme_specific(child, th, force);
if (sd->resize_obj) elm_widget_theme(sd->resize_obj); if (sd->resize_obj) elm_widget_theme(sd->resize_obj);
if (sd->hover_obj) elm_widget_theme(sd->hover_obj); if (sd->hover_obj) elm_widget_theme(sd->hover_obj);
EINA_LIST_FOREACH(sd->tooltips, l, tt) elm_tooltip_theme(tt); EINA_LIST_FOREACH(sd->tooltips, l, tt) elm_tooltip_theme(tt);
@ -562,8 +562,8 @@ elm_widget_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
API_ENTRY return; API_ENTRY return;
if (sd->is_mirrored != mirrored) if (sd->is_mirrored != mirrored)
{ {
sd->is_mirrored = mirrored; sd->is_mirrored = mirrored;
elm_widget_theme(obj); elm_widget_theme(obj);
} }
} }
@ -582,7 +582,7 @@ _elm_widget_mirrored_reload(Evas_Object *obj)
Eina_Bool mirrored = elm_mirrored_get(); Eina_Bool mirrored = elm_mirrored_get();
if (elm_widget_mirrored_automatic_get(obj) && (sd->is_mirrored != mirrored)) if (elm_widget_mirrored_automatic_get(obj) && (sd->is_mirrored != mirrored))
{ {
sd->is_mirrored = mirrored; sd->is_mirrored = mirrored;
} }
} }
@ -613,7 +613,7 @@ elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
API_ENTRY return; API_ENTRY return;
if (sd->mirrored_auto_mode != automatic) if (sd->mirrored_auto_mode != automatic)
{ {
sd->mirrored_auto_mode = automatic; sd->mirrored_auto_mode = automatic;
if (automatic) if (automatic)
{ {
@ -739,7 +739,7 @@ elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
sd->subobjs = eina_list_append(sd->subobjs, sobj); sd->subobjs = eina_list_append(sd->subobjs, sobj);
evas_object_data_set(sobj, "elm-parent", obj); evas_object_data_set(sobj, "elm-parent", obj);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd); evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
if (_elm_widget_is(sobj)) if (_elm_widget_is(sobj))
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE, _sub_obj_hide, sd); evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE, _sub_obj_hide, sd);
evas_object_smart_callback_call(obj, "sub-object-add", sobj); evas_object_smart_callback_call(obj, "sub-object-add", sobj);
@ -760,20 +760,20 @@ elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj)
sobj_parent = evas_object_data_del(sobj, "elm-parent"); sobj_parent = evas_object_data_del(sobj, "elm-parent");
if (sobj_parent != obj) if (sobj_parent != obj)
{ {
static int abort_on_warn = -1; static int abort_on_warn = -1;
ERR("removing sub object %p from parent %p, " ERR("removing sub object %p from parent %p, "
"but elm-parent is different %p!", "but elm-parent is different %p!",
sobj, obj, sobj_parent); sobj, obj, sobj_parent);
if (EINA_UNLIKELY(abort_on_warn == -1)) if (EINA_UNLIKELY(abort_on_warn == -1))
{ {
if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1; if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
else abort_on_warn = 0; else abort_on_warn = 0;
} }
if (abort_on_warn == 1) abort(); if (abort_on_warn == 1) abort();
} }
if (!sd->child_can_focus) if (!sd->child_can_focus)
{ {
if (_is_focusable(sobj)) sd->child_can_focus = 0; if (_is_focusable(sobj)) sd->child_can_focus = 0;
} }
if (_elm_widget_is(sobj)) if (_elm_widget_is(sobj))
{ {
@ -807,20 +807,20 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
// orphan previous resize obj // orphan previous resize obj
if (sd->resize_obj) if (sd->resize_obj)
{ {
evas_object_clip_unset(sd->resize_obj); evas_object_clip_unset(sd->resize_obj);
evas_object_data_del(sd->resize_obj, "elm-parent"); evas_object_data_del(sd->resize_obj, "elm-parent");
if (_elm_widget_is(sd->resize_obj)) if (_elm_widget_is(sd->resize_obj))
{ {
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
if (sd2) sd2->parent_obj = NULL; if (sd2) sd2->parent_obj = NULL;
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_HIDE, evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_HIDE,
_sub_obj_hide, sd); _sub_obj_hide, sd);
} }
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_DEL, evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd); _sub_obj_del, sd);
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN, evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
_sub_obj_mouse_down, sd); _sub_obj_mouse_down, sd);
evas_object_smart_member_del(sd->resize_obj); evas_object_smart_member_del(sd->resize_obj);
if (_elm_widget_is(sd->resize_obj)) if (_elm_widget_is(sd->resize_obj))
{ {
if (elm_widget_focus_get(sd->resize_obj)) _unfocus_parents(obj); if (elm_widget_focus_get(sd->resize_obj)) _unfocus_parents(obj);
@ -851,22 +851,22 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
sd->resize_obj = sobj; sd->resize_obj = sobj;
if (sd->resize_obj) if (sd->resize_obj)
{ {
if (_elm_widget_is(sd->resize_obj)) if (_elm_widget_is(sd->resize_obj))
{ {
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
if (sd2) sd2->parent_obj = obj; if (sd2) sd2->parent_obj = obj;
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE, evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE,
_sub_obj_hide, sd); _sub_obj_hide, sd);
} }
evas_object_clip_set(sobj, evas_object_clip_get(obj)); evas_object_clip_set(sobj, evas_object_clip_get(obj));
evas_object_smart_member_add(sobj, obj); evas_object_smart_member_add(sobj, obj);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd); _sub_obj_del, sd);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN, evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
_sub_obj_mouse_down, sd); _sub_obj_mouse_down, sd);
_smart_reconfigure(sd); _smart_reconfigure(sd);
evas_object_data_set(sobj, "elm-parent", obj); evas_object_data_set(sobj, "elm-parent", obj);
evas_object_smart_callback_call(obj, "sub-object-add", sobj); evas_object_smart_callback_call(obj, "sub-object-add", sobj);
if (_elm_widget_is(sobj)) if (_elm_widget_is(sobj))
{ {
if (elm_widget_focus_get(sobj)) _focus_parents(obj); if (elm_widget_focus_get(sobj)) _focus_parents(obj);
@ -880,15 +880,15 @@ elm_widget_hover_object_set(Evas_Object *obj, Evas_Object *sobj)
API_ENTRY return; API_ENTRY return;
if (sd->hover_obj) if (sd->hover_obj)
{ {
evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL, evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd); _sub_obj_del, sd);
} }
sd->hover_obj = sobj; sd->hover_obj = sobj;
if (sd->hover_obj) if (sd->hover_obj)
{ {
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd); _sub_obj_del, sd);
_smart_reconfigure(sd); _smart_reconfigure(sd);
} }
} }
@ -980,8 +980,8 @@ elm_widget_focused_object_get(const Evas_Object *obj)
if (!sd->focused) return NULL; if (!sd->focused) return NULL;
EINA_LIST_FOREACH(sd->subobjs, l, subobj) EINA_LIST_FOREACH(sd->subobjs, l, subobj)
{ {
Evas_Object *fobj = elm_widget_focused_object_get(subobj); Evas_Object *fobj = elm_widget_focused_object_get(subobj);
if (fobj) return fobj; if (fobj) return fobj;
} }
return (Evas_Object *)obj; return (Evas_Object *)obj;
} }
@ -1007,23 +1007,23 @@ elm_widget_parent_widget_get(const Evas_Object *obj)
if (_elm_widget_is(obj)) if (_elm_widget_is(obj))
{ {
Smart_Data *sd = evas_object_smart_data_get(obj); Smart_Data *sd = evas_object_smart_data_get(obj);
if (!sd) return NULL; if (!sd) return NULL;
parent = sd->parent_obj; parent = sd->parent_obj;
} }
else else
{ {
parent = evas_object_data_get(obj, "elm-parent"); parent = evas_object_data_get(obj, "elm-parent");
if (!parent) parent = evas_object_smart_parent_get(obj); if (!parent) parent = evas_object_smart_parent_get(obj);
} }
while (parent) while (parent)
{ {
Evas_Object *elm_parent; Evas_Object *elm_parent;
if (_elm_widget_is(parent)) break; if (_elm_widget_is(parent)) break;
elm_parent = evas_object_data_get(parent, "elm-parent"); elm_parent = evas_object_data_get(parent, "elm-parent");
if (elm_parent) parent = elm_parent; if (elm_parent) parent = elm_parent;
else parent = evas_object_smart_parent_get(parent); else parent = evas_object_smart_parent_get(parent);
} }
return parent; return parent;
} }
@ -1079,7 +1079,7 @@ elm_widget_event_propagate(Evas_Object *obj, Evas_Callback_Type type, void *even
{ {
if (ecd->func((void *)ecd->data, parent, obj, type, event_info) || if (ecd->func((void *)ecd->data, parent, obj, type, event_info) ||
(event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD))) (event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD)))
return EINA_TRUE; return EINA_TRUE;
} }
parent = sd->parent_obj; parent = sd->parent_obj;
} }
@ -1492,60 +1492,60 @@ elm_widget_focus_set(Evas_Object *obj, int first)
{ {
focus_order++; focus_order++;
sd->focus_order = focus_order; sd->focus_order = focus_order;
sd->focused = EINA_TRUE; sd->focused = EINA_TRUE;
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
} }
if (sd->focus_func) if (sd->focus_func)
{ {
sd->focus_func(obj); sd->focus_func(obj);
return; return;
} }
else else
{ {
if (first) if (first)
{ {
if ((_is_focusable(sd->resize_obj)) && if ((_is_focusable(sd->resize_obj)) &&
(!elm_widget_disabled_get(sd->resize_obj))) (!elm_widget_disabled_get(sd->resize_obj)))
{ {
elm_widget_focus_set(sd->resize_obj, first); elm_widget_focus_set(sd->resize_obj, first);
} }
else else
{ {
const Eina_List *l; const Eina_List *l;
Evas_Object *child; Evas_Object *child;
EINA_LIST_FOREACH(sd->subobjs, l, child) EINA_LIST_FOREACH(sd->subobjs, l, child)
{ {
if ((_is_focusable(child)) && if ((_is_focusable(child)) &&
(!elm_widget_disabled_get(child))) (!elm_widget_disabled_get(child)))
{ {
elm_widget_focus_set(child, first); elm_widget_focus_set(child, first);
break; break;
} }
} }
} }
} }
else else
{ {
const Eina_List *l; const Eina_List *l;
Evas_Object *child; Evas_Object *child;
EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child) EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
{ {
if ((_is_focusable(child)) && if ((_is_focusable(child)) &&
(!elm_widget_disabled_get(child))) (!elm_widget_disabled_get(child)))
{ {
elm_widget_focus_set(child, first); elm_widget_focus_set(child, first);
break; break;
} }
} }
if (!l) if (!l)
{ {
if ((_is_focusable(sd->resize_obj)) && if ((_is_focusable(sd->resize_obj)) &&
(!elm_widget_disabled_get(sd->resize_obj))) (!elm_widget_disabled_get(sd->resize_obj)))
{ {
elm_widget_focus_set(sd->resize_obj, first); elm_widget_focus_set(sd->resize_obj, first);
} }
} }
} }
} }
} }
@ -1562,19 +1562,19 @@ elm_widget_focused_object_clear(Evas_Object *obj)
API_ENTRY return; API_ENTRY return;
if (!sd->focused) return; if (!sd->focused) return;
if (elm_widget_focus_get(sd->resize_obj)) if (elm_widget_focus_get(sd->resize_obj))
elm_widget_focused_object_clear(sd->resize_obj); elm_widget_focused_object_clear(sd->resize_obj);
else else
{ {
const Eina_List *l; const Eina_List *l;
Evas_Object *child; Evas_Object *child;
EINA_LIST_FOREACH(sd->subobjs, l, child) EINA_LIST_FOREACH(sd->subobjs, l, child)
{ {
if (elm_widget_focus_get(child)) if (elm_widget_focus_get(child))
{ {
elm_widget_focused_object_clear(child); elm_widget_focused_object_clear(child);
break; break;
} }
} }
} }
sd->focused = EINA_FALSE; sd->focused = EINA_FALSE;
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
@ -1592,33 +1592,33 @@ elm_widget_focus_steal(Evas_Object *obj)
parent = obj; parent = obj;
for (;;) for (;;)
{ {
o = elm_widget_parent_get(parent); o = elm_widget_parent_get(parent);
if (!o) break; if (!o) break;
sd = evas_object_smart_data_get(o); sd = evas_object_smart_data_get(o);
if (sd->focused) break; if (sd->focused) break;
parent = o; parent = o;
} }
if (!elm_widget_parent_get(parent)) if (!elm_widget_parent_get(parent))
elm_widget_focused_object_clear(parent); elm_widget_focused_object_clear(parent);
else else
{ {
parent = elm_widget_parent_get(parent); parent = elm_widget_parent_get(parent);
sd = evas_object_smart_data_get(parent); sd = evas_object_smart_data_get(parent);
if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj))) if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj)))
elm_widget_focused_object_clear(sd->resize_obj); elm_widget_focused_object_clear(sd->resize_obj);
else else
{ {
const Eina_List *l; const Eina_List *l;
Evas_Object *child; Evas_Object *child;
EINA_LIST_FOREACH(sd->subobjs, l, child) EINA_LIST_FOREACH(sd->subobjs, l, child)
{ {
if (elm_widget_focus_get(child)) if (elm_widget_focus_get(child))
{ {
elm_widget_focused_object_clear(child); elm_widget_focused_object_clear(child);
break; break;
} }
} }
} }
} }
_parent_focus(obj); _parent_focus(obj);
return; return;
@ -1649,15 +1649,15 @@ elm_widget_disabled_set(Evas_Object *obj, int disabled)
sd->disabled = disabled; sd->disabled = disabled;
if (sd->focused) if (sd->focused)
{ {
Evas_Object *o, *parent; Evas_Object *o, *parent;
parent = obj; parent = obj;
for (;;) for (;;)
{ {
o = elm_widget_parent_get(parent); o = elm_widget_parent_get(parent);
if (!o) break; if (!o) break;
parent = o; parent = o;
} }
if (elm_widget_focus_get(obj)) if (elm_widget_focus_get(obj))
elm_widget_focus_cycle(parent, ELM_FOCUS_NEXT); elm_widget_focus_cycle(parent, ELM_FOCUS_NEXT);
} }
@ -1684,7 +1684,7 @@ elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Co
sd->rw = w; sd->rw = w;
sd->rh = h; sd->rh = h;
if (sd->on_show_region_func) if (sd->on_show_region_func)
sd->on_show_region_func(sd->on_show_region_data, obj); sd->on_show_region_func(sd->on_show_region_data, obj);
do do
{ {
@ -1766,7 +1766,7 @@ elm_widget_scroll_hold_push(Evas_Object *obj)
API_ENTRY return; API_ENTRY return;
sd->scroll_hold++; sd->scroll_hold++;
if (sd->scroll_hold == 1) if (sd->scroll_hold == 1)
evas_object_smart_callback_call(obj, "scroll-hold-on", obj); evas_object_smart_callback_call(obj, "scroll-hold-on", obj);
if (sd->parent_obj) elm_widget_scroll_hold_push(sd->parent_obj); if (sd->parent_obj) elm_widget_scroll_hold_push(sd->parent_obj);
// FIXME: on delete/reparent hold pop // FIXME: on delete/reparent hold pop
} }
@ -1778,7 +1778,7 @@ elm_widget_scroll_hold_pop(Evas_Object *obj)
sd->scroll_hold--; sd->scroll_hold--;
if (sd->scroll_hold < 0) sd->scroll_hold = 0; if (sd->scroll_hold < 0) sd->scroll_hold = 0;
if (!sd->scroll_hold) if (!sd->scroll_hold)
evas_object_smart_callback_call(obj, "scroll-hold-off", obj); evas_object_smart_callback_call(obj, "scroll-hold-off", obj);
if (sd->parent_obj) elm_widget_scroll_hold_pop(sd->parent_obj); if (sd->parent_obj) elm_widget_scroll_hold_pop(sd->parent_obj);
} }
@ -1795,7 +1795,7 @@ elm_widget_scroll_freeze_push(Evas_Object *obj)
API_ENTRY return; API_ENTRY return;
sd->scroll_freeze++; sd->scroll_freeze++;
if (sd->scroll_freeze == 1) if (sd->scroll_freeze == 1)
evas_object_smart_callback_call(obj, "scroll-freeze-on", obj); evas_object_smart_callback_call(obj, "scroll-freeze-on", obj);
if (sd->parent_obj) elm_widget_scroll_freeze_push(sd->parent_obj); if (sd->parent_obj) elm_widget_scroll_freeze_push(sd->parent_obj);
// FIXME: on delete/reparent freeze pop // FIXME: on delete/reparent freeze pop
} }
@ -1807,7 +1807,7 @@ elm_widget_scroll_freeze_pop(Evas_Object *obj)
sd->scroll_freeze--; sd->scroll_freeze--;
if (sd->scroll_freeze < 0) sd->scroll_freeze = 0; if (sd->scroll_freeze < 0) sd->scroll_freeze = 0;
if (!sd->scroll_freeze) if (!sd->scroll_freeze)
evas_object_smart_callback_call(obj, "scroll-freeze-off", obj); evas_object_smart_callback_call(obj, "scroll-freeze-off", obj);
if (sd->parent_obj) elm_widget_scroll_freeze_pop(sd->parent_obj); if (sd->parent_obj) elm_widget_scroll_freeze_pop(sd->parent_obj);
} }
@ -1825,8 +1825,8 @@ elm_widget_scale_set(Evas_Object *obj, double scale)
if (scale <= 0.0) scale = 0.0; if (scale <= 0.0) scale = 0.0;
if (sd->scale != scale) if (sd->scale != scale)
{ {
sd->scale = scale; sd->scale = scale;
elm_widget_theme(obj); elm_widget_theme(obj);
} }
} }
@ -1837,10 +1837,10 @@ elm_widget_scale_get(const Evas_Object *obj)
// FIXME: save walking up the tree by storing/caching parent scale // FIXME: save walking up the tree by storing/caching parent scale
if (sd->scale == 0.0) if (sd->scale == 0.0)
{ {
if (sd->parent_obj) if (sd->parent_obj)
return elm_widget_scale_get(sd->parent_obj); return elm_widget_scale_get(sd->parent_obj);
else else
return 1.0; return 1.0;
} }
return sd->scale; return sd->scale;
} }
@ -1865,9 +1865,9 @@ elm_widget_theme_get(const Evas_Object *obj)
if (!sd->theme) if (!sd->theme)
{ {
if (sd->parent_obj) if (sd->parent_obj)
return elm_widget_theme_get(sd->parent_obj); return elm_widget_theme_get(sd->parent_obj);
else else
return NULL; return NULL;
} }
return sd->theme; return sd->theme;
} }
@ -1878,7 +1878,7 @@ elm_widget_style_set(Evas_Object *obj, const char *style)
API_ENTRY return; API_ENTRY return;
if (eina_stringshare_replace(&sd->style, style)) if (eina_stringshare_replace(&sd->style, style))
elm_widget_theme(obj); elm_widget_theme(obj);
} }
EAPI const char * EAPI const char *
@ -1999,7 +1999,7 @@ elm_widget_type_check(const Evas_Object *obj, const char *type)
{ {
provided = evas_object_type_get(obj); provided = evas_object_type_get(obj);
if ((!provided) || (!provided[0])) if ((!provided) || (!provided[0]))
provided = "(unknown)"; provided = "(unknown)";
} }
ERR("Passing Object: %p, of type: '%s' when expecting type: '%s'", obj, provided, expected); ERR("Passing Object: %p, of type: '%s' when expecting type: '%s'", obj, provided, expected);
if (abort_on_warn == -1) if (abort_on_warn == -1)
@ -2030,19 +2030,19 @@ elm_widget_stringlist_get(const char *str)
if (!str) return NULL; if (!str) return NULL;
for (b = s = str; 1; s++) for (b = s = str; 1; s++)
{ {
if ((*s == ' ') || (!*s)) if ((*s == ' ') || (!*s))
{ {
char *t = malloc(s - b + 1); char *t = malloc(s - b + 1);
if (t) if (t)
{ {
strncpy(t, b, s - b); strncpy(t, b, s - b);
t[s - b] = 0; t[s - b] = 0;
list = eina_list_append(list, eina_stringshare_add(t)); list = eina_list_append(list, eina_stringshare_add(t));
free(t); free(t);
} }
b = s + 1; b = s + 1;
} }
if (!*s) break; if (!*s) break;
} }
return list; return list;
} }
@ -2264,8 +2264,8 @@ _elm_widget_item_tooltip_text_set(Elm_Widget_Item *item, const char *text)
text = eina_stringshare_add(text); text = eina_stringshare_add(text);
_elm_widget_item_tooltip_content_cb_set _elm_widget_item_tooltip_content_cb_set
(item, _elm_widget_item_tooltip_label_create, text, (item, _elm_widget_item_tooltip_label_create, text,
_elm_widget_item_tooltip_label_del_cb); _elm_widget_item_tooltip_label_del_cb);
} }
static Evas_Object * static Evas_Object *
@ -2326,15 +2326,15 @@ _elm_widget_item_tooltip_content_cb_set(Elm_Widget_Item *item, Elm_Tooltip_Item_
wit->del_cb = del_cb; wit->del_cb = del_cb;
elm_object_sub_tooltip_content_cb_set elm_object_sub_tooltip_content_cb_set
(item->view, item->widget, _elm_widget_item_tooltip_create, wit, (item->view, item->widget, _elm_widget_item_tooltip_create, wit,
_elm_widget_item_tooltip_del_cb); _elm_widget_item_tooltip_del_cb);
return; return;
error_noitem: error_noitem:
if (del_cb) del_cb((void *)data, NULL, item); if (del_cb) del_cb((void *)data, NULL, item);
return; return;
error: error:
if (del_cb) del_cb((void *)data, item->widget, item); if (del_cb) del_cb((void *)data, item->widget, item);
} }
@ -2507,12 +2507,12 @@ _smart_reconfigure(Smart_Data *sd)
if (sd->resize_obj) if (sd->resize_obj)
{ {
evas_object_move(sd->resize_obj, sd->x, sd->y); evas_object_move(sd->resize_obj, sd->x, sd->y);
evas_object_resize(sd->resize_obj, sd->w, sd->h); evas_object_resize(sd->resize_obj, sd->w, sd->h);
} }
if (sd->hover_obj) if (sd->hover_obj)
{ {
evas_object_move(sd->hover_obj, sd->x, sd->y); evas_object_move(sd->hover_obj, sd->x, sd->y);
evas_object_resize(sd->hover_obj, sd->w, sd->h); evas_object_resize(sd->hover_obj, sd->w, sd->h);
} }
} }
@ -2553,7 +2553,7 @@ _newest_focus_order_get(Evas_Object *obj, unsigned int *newest_focus_order, Eina
if (can_focus_only) if (can_focus_only)
{ {
if ((!best) || (!elm_widget_can_focus_get(best))) if ((!best) || (!elm_widget_can_focus_get(best)))
return NULL; return NULL;
} }
return best; return best;
} }
@ -2593,25 +2593,25 @@ _smart_del(Evas_Object *obj)
if (sd->del_pre_func) sd->del_pre_func(obj); if (sd->del_pre_func) sd->del_pre_func(obj);
if (sd->resize_obj) if (sd->resize_obj)
{ {
sobj = sd->resize_obj; sobj = sd->resize_obj;
sd->resize_obj = NULL; sd->resize_obj = NULL;
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd); evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
evas_object_del(sobj); evas_object_del(sobj);
} }
if (sd->hover_obj) if (sd->hover_obj)
{ {
sobj = sd->hover_obj; sobj = sd->hover_obj;
sd->hover_obj = NULL; sd->hover_obj = NULL;
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd); evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
evas_object_del(sobj); evas_object_del(sobj);
} }
EINA_LIST_FREE(sd->subobjs, sobj) EINA_LIST_FREE(sd->subobjs, sobj)
{ {
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd); evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
evas_object_del(sobj); evas_object_del(sobj);
} }
eina_list_free(sd->tooltips); /* should be empty anyway */ eina_list_free(sd->tooltips); /* should be empty anyway */
eina_list_free(sd->cursors); /* should be empty anyway */ eina_list_free(sd->cursors); /* should be empty anyway */
@ -2739,9 +2739,9 @@ _smart_init(void)
{ {
if (_e_smart) return; if (_e_smart) return;
{ {
static const Evas_Smart_Class sc = static const Evas_Smart_Class sc =
{ {
SMART_NAME, SMART_NAME,
EVAS_SMART_CLASS_VERSION, EVAS_SMART_CLASS_VERSION,
_smart_add, _smart_add,
_smart_del, _smart_del,
@ -2759,8 +2759,8 @@ _smart_init(void)
NULL, NULL,
NULL, NULL,
NULL NULL
}; };
_e_smart = evas_smart_class_new(&sc); _e_smart = evas_smart_class_new(&sc);
} }
} }
@ -2778,7 +2778,7 @@ _sub_obj_tree_dump(const Evas_Object *obj, int lvl)
{ {
Eina_List *l; Eina_List *l;
INTERNAL_ENTRY INTERNAL_ENTRY
printf("+ %s(%p)\n", sd->type, obj); printf("+ %s(%p)\n", sd->type, obj);
if (sd->resize_obj) if (sd->resize_obj)
_sub_obj_tree_dump(sd->resize_obj, lvl + 1); _sub_obj_tree_dump(sd->resize_obj, lvl + 1);
EINA_LIST_FOREACH(sd->subobjs, l, obj) EINA_LIST_FOREACH(sd->subobjs, l, obj)
@ -2798,7 +2798,7 @@ _sub_obj_tree_dot_dump(const Evas_Object *obj, FILE *output)
return; return;
INTERNAL_ENTRY INTERNAL_ENTRY
Eina_Bool visible = evas_object_visible_get(obj); Eina_Bool visible = evas_object_visible_get(obj);
Eina_Bool disabled = elm_widget_disabled_get(obj); Eina_Bool disabled = elm_widget_disabled_get(obj);
Eina_Bool focused = elm_widget_focus_get(obj); Eina_Bool focused = elm_widget_focus_get(obj);
Eina_Bool can_focus = elm_widget_can_focus_get(obj); Eina_Bool can_focus = elm_widget_can_focus_get(obj);
@ -2822,13 +2822,13 @@ _sub_obj_tree_dot_dump(const Evas_Object *obj, FILE *output)
sd->focus_order); sd->focus_order);
if (focused) if (focused)
fprintf(output, ", style=bold"); fprintf(output, ", style=bold");
if (!visible) if (!visible)
fprintf(output, ", fontcolor=gray28"); fprintf(output, ", fontcolor=gray28");
if ((disabled) || (!visible)) if ((disabled) || (!visible))
fprintf(output, ", color=gray"); fprintf(output, ", color=gray");
fprintf(output, " ];\n"); fprintf(output, " ];\n");

View File

@ -228,30 +228,30 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job); if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job); if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
while (((child = evas_object_bottom_get(win->evas))) && while (((child = evas_object_bottom_get(win->evas))) &&
(child != obj)) (child != obj))
{ {
evas_object_del(child); evas_object_del(child);
} }
while (((child = evas_object_top_get(win->evas))) && while (((child = evas_object_top_get(win->evas))) &&
(child != obj)) (child != obj))
{ {
evas_object_del(child); evas_object_del(child);
} }
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
if (win->client_message_handler) if (win->client_message_handler)
ecore_event_handler_del(win->client_message_handler); ecore_event_handler_del(win->client_message_handler);
#endif #endif
// FIXME: Why are we flushing edje on every window destroy ?? // FIXME: Why are we flushing edje on every window destroy ??
// edje_file_cache_flush(); // edje_file_cache_flush();
// edje_collection_cache_flush(); // edje_collection_cache_flush();
// evas_image_cache_flush(win->evas); // evas_image_cache_flush(win->evas);
// evas_font_cache_flush(win->evas); // evas_font_cache_flush(win->evas);
// FIXME: we are in the del handler for the object and delete the canvas // FIXME: we are in the del handler for the object and delete the canvas
// that lives under it from the handler... nasty. deferring doesn't help either // that lives under it from the handler... nasty. deferring doesn't help either
ecore_job_add(_deferred_ecore_evas_free, win->ee); ecore_job_add(_deferred_ecore_evas_free, win->ee);
_elm_win_deferred_free++; _elm_win_deferred_free++;
// ecore_evas_free(win->ee); // ecore_evas_free(win->ee);
_elm_win_focus_highlight_shutdown(win); _elm_win_focus_highlight_shutdown(win);
eina_stringshare_del(win->focus_highlight.style); eina_stringshare_del(win->focus_highlight.style);
@ -265,7 +265,7 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
edje_collection_cache_flush(); edje_collection_cache_flush();
evas_image_cache_flush(e); evas_image_cache_flush(e);
evas_font_cache_flush(e); evas_font_cache_flush(e);
elm_exit(); elm_exit();
} }
} }
@ -290,11 +290,11 @@ static void
_elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{ {
Elm_Win *win = data; Elm_Win *win = data;
if (ecore_evas_override_get(win->ee)) if (ecore_evas_override_get(win->ee))
{ {
Evas_Coord x, y; Evas_Coord x, y;
evas_object_geometry_get(obj, &x, &y, NULL, NULL); evas_object_geometry_get(obj, &x, &y, NULL, NULL);
win->screen.x = x; win->screen.x = x;
win->screen.y = y; win->screen.y = y;
@ -333,8 +333,8 @@ _elm_win_resize_job(void *data)
evas_object_resize(win->win_obj, w, h); evas_object_resize(win->win_obj, w, h);
EINA_LIST_FOREACH(win->subobjs, l, obj) EINA_LIST_FOREACH(win->subobjs, l, obj)
{ {
evas_object_move(obj, 0, 0); evas_object_move(obj, 0, 0);
evas_object_resize(obj, w, h); evas_object_resize(obj, w, h);
} }
} }
@ -359,23 +359,23 @@ _elm_win_xwindow_get(Elm_Win *win)
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11)) else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
{ {
if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee); if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11)) else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
{ {
if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee); if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee);
} }
else if (ENGINE_COMPARE(ELM_XRENDER_X11)) else if (ENGINE_COMPARE(ELM_XRENDER_X11))
{ {
if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee); if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
} }
else if (ENGINE_COMPARE(ELM_OPENGL_X11)) else if (ENGINE_COMPARE(ELM_OPENGL_X11))
{ {
if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee); if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32)) else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
{ {
if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee); if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee);
} }
#undef ENGINE_COMPARE #undef ENGINE_COMPARE
} }
@ -388,14 +388,14 @@ _elm_win_xwin_update(Elm_Win *win)
_elm_win_xwindow_get(win); _elm_win_xwindow_get(win);
if (win->parent) if (win->parent)
{ {
Elm_Win *win2; Elm_Win *win2;
win2 = elm_widget_data_get(win->parent); win2 = elm_widget_data_get(win->parent);
if (win2) if (win2)
{ {
if (win->xwin) if (win->xwin)
ecore_x_icccm_transient_for_set(win->xwin, win2->xwin); ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
} }
} }
if (!win->xwin) return; /* nothing more to do */ if (!win->xwin) return; /* nothing more to do */
@ -403,52 +403,52 @@ _elm_win_xwin_update(Elm_Win *win)
switch (win->type) switch (win->type)
{ {
case ELM_WIN_BASIC: case ELM_WIN_BASIC:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
break; break;
case ELM_WIN_DIALOG_BASIC: case ELM_WIN_DIALOG_BASIC:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
break; break;
case ELM_WIN_DESKTOP: case ELM_WIN_DESKTOP:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
break; break;
case ELM_WIN_DOCK: case ELM_WIN_DOCK:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
break; break;
case ELM_WIN_TOOLBAR: case ELM_WIN_TOOLBAR:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
break; break;
case ELM_WIN_MENU: case ELM_WIN_MENU:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
break; break;
case ELM_WIN_UTILITY: case ELM_WIN_UTILITY:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
break; break;
case ELM_WIN_SPLASH: case ELM_WIN_SPLASH:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
break; break;
case ELM_WIN_DROPDOWN_MENU: case ELM_WIN_DROPDOWN_MENU:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
break; break;
case ELM_WIN_POPUP_MENU: case ELM_WIN_POPUP_MENU:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
break; break;
case ELM_WIN_TOOLTIP: case ELM_WIN_TOOLTIP:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
break; break;
case ELM_WIN_NOTIFICATION: case ELM_WIN_NOTIFICATION:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
break; break;
case ELM_WIN_COMBO: case ELM_WIN_COMBO:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
break; break;
case ELM_WIN_DND: case ELM_WIN_DND:
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND); ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
break; break;
default: default:
break; break;
} }
ecore_x_e_virtual_keyboard_state_set ecore_x_e_virtual_keyboard_state_set
(win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode); (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
} }
#endif #endif
@ -465,23 +465,23 @@ _elm_win_eval_subobjs(Evas_Object *obj)
EINA_LIST_FOREACH(win->subobjs, l, child) EINA_LIST_FOREACH(win->subobjs, l, child)
{ {
evas_object_size_hint_weight_get(child, &wx, &wy); evas_object_size_hint_weight_get(child, &wx, &wy);
if (wx == 0.0) xx = 0; if (wx == 0.0) xx = 0;
if (wy == 0.0) xy = 0; if (wy == 0.0) xy = 0;
evas_object_size_hint_min_get(child, &w, &h); evas_object_size_hint_min_get(child, &w, &h);
if (w < 1) w = -1; if (w < 1) w = -1;
if (h < 1) h = -1; if (h < 1) h = -1;
if (w > minw) minw = w; if (w > minw) minw = w;
if (h > minh) minh = h; if (h > minh) minh = h;
evas_object_size_hint_max_get(child, &w, &h); evas_object_size_hint_max_get(child, &w, &h);
if (w < 1) w = -1; if (w < 1) w = -1;
if (h < 1) h = -1; if (h < 1) h = -1;
if (maxw == -1) maxw = w; if (maxw == -1) maxw = w;
else if ((w > 0) && (w < maxw)) maxw = w; else if ((w > 0) && (w < maxw)) maxw = w;
if (maxh == -1) maxh = h; if (maxh == -1) maxh = h;
else if ((h > 0) && (h < maxh)) maxh = h; else if ((h > 0) && (h < maxh)) maxh = h;
} }
if (!xx) maxw = minw; if (!xx) maxw = minw;
else maxw = 32767; else maxw = 32767;
@ -611,11 +611,11 @@ _elm_win_focus_target_callbacks_add(Elm_Win *win)
Evas_Object *obj = win->focus_highlight.cur.target; Evas_Object *obj = win->focus_highlight.cur.target;
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
_elm_win_focus_target_move, win); _elm_win_focus_target_move, win);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
_elm_win_focus_target_resize, win); _elm_win_focus_target_resize, win);
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
_elm_win_focus_target_del, win); _elm_win_focus_target_del, win);
} }
static void static void
@ -624,11 +624,11 @@ _elm_win_focus_target_callbacks_del(Elm_Win *win)
Evas_Object *obj = win->focus_highlight.cur.target; Evas_Object *obj = win->focus_highlight.cur.target;
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
_elm_win_focus_target_move, win); _elm_win_focus_target_move, win);
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
_elm_win_focus_target_resize, win); _elm_win_focus_target_resize, win);
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
_elm_win_focus_target_del, win); _elm_win_focus_target_del, win);
} }
static Evas_Object * static Evas_Object *
@ -736,12 +736,12 @@ _elm_win_focus_highlight_shutdown(Elm_Win *win)
win->focus_highlight.top = NULL; win->focus_highlight.top = NULL;
} }
evas_event_callback_del_full(win->evas, evas_event_callback_del_full(win->evas,
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
_elm_win_object_focus_in, win); _elm_win_object_focus_in, win);
evas_event_callback_del_full(win->evas, evas_event_callback_del_full(win->evas,
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
_elm_win_object_focus_out, win); _elm_win_object_focus_out, win);
} }
static void static void
@ -917,7 +917,7 @@ _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, voi
Evas_Event_Key_Down *ev = event_info; Evas_Event_Key_Down *ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
return; return;
if ((strcmp(ev->keyname, "F12")) || if ((strcmp(ev->keyname, "F12")) ||
@ -960,23 +960,23 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
#define FALLBACK_TRY(engine) \ #define FALLBACK_TRY(engine) \
if (!win->ee) \ if (!win->ee) \
do { \ do { \
CRITICAL(engine " engine creation failed. Trying software X11."); \ CRITICAL(engine " engine creation failed. Trying software X11."); \
win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \ win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
} while (0) } while (0)
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name)) #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
if (ENGINE_COMPARE(ELM_SOFTWARE_X11)) if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
{ {
win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
win->client_message_handler = ecore_event_handler_add win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win); (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif #endif
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_FB)) else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
{ {
win->ee = ecore_evas_fb_new(NULL, 0, 1, 1); win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
FALLBACK_TRY("Sofware FB"); FALLBACK_TRY("Sofware FB");
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB)) else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
@ -986,81 +986,81 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11)) else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
{ {
win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1); win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("Sofware-16"); FALLBACK_TRY("Sofware-16");
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
win->client_message_handler = ecore_event_handler_add win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win); (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif #endif
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11)) else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
{ {
win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1); win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("Sofware-8"); FALLBACK_TRY("Sofware-8");
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
win->client_message_handler = ecore_event_handler_add win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win); (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif #endif
} }
else if (ENGINE_COMPARE(ELM_XRENDER_X11)) else if (ENGINE_COMPARE(ELM_XRENDER_X11))
{ {
win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1); win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("XRender"); FALLBACK_TRY("XRender");
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
win->client_message_handler = ecore_event_handler_add win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win); (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif #endif
} }
else if (ENGINE_COMPARE(ELM_OPENGL_X11)) else if (ENGINE_COMPARE(ELM_OPENGL_X11))
{ {
win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1); win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("OpenGL"); FALLBACK_TRY("OpenGL");
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
win->client_message_handler = ecore_event_handler_add win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win); (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif #endif
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32)) else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
{ {
win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1); win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
FALLBACK_TRY("Sofware Win32"); FALLBACK_TRY("Sofware Win32");
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE)) else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{ {
win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1); win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
FALLBACK_TRY("Sofware-16-WinCE"); FALLBACK_TRY("Sofware-16-WinCE");
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL)) else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
{ {
win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1); win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
FALLBACK_TRY("Sofware SDL"); FALLBACK_TRY("Sofware SDL");
} }
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL)) else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
{ {
win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1); win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
FALLBACK_TRY("Sofware-16-SDL"); FALLBACK_TRY("Sofware-16-SDL");
} }
else if (ENGINE_COMPARE(ELM_OPENGL_SDL)) else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
{ {
win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0); win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
FALLBACK_TRY("OpenGL SDL"); FALLBACK_TRY("OpenGL SDL");
} }
#undef FALLBACK_TRY #undef FALLBACK_TRY
if (!win->ee) if (!win->ee)
{ {
ERR("Cannot create window."); ERR("Cannot create window.");
free(win); free(win);
return NULL; return NULL;
} }
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(win); _elm_win_xwindow_get(win);
#endif #endif
if ((_elm_config->bgpixmap) && (!_elm_config->compositing)) if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE); ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
// bg pixmap done by x - has other issues like can be redrawn by x before it // bg pixmap done by x - has other issues like can be redrawn by x before it
// is filled/ready by app // is filled/ready by app
// ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN); // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
win->type = type; win->type = type;
win->parent = parent; win->parent = parent;
@ -1087,15 +1087,15 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
evas_object_intercept_show_callback_add(win->win_obj, evas_object_intercept_show_callback_add(win->win_obj,
_elm_win_obj_intercept_show, win); _elm_win_obj_intercept_show, win);
ecore_evas_object_associate(win->ee, win->win_obj, ecore_evas_object_associate(win->ee, win->win_obj,
ECORE_EVAS_OBJECT_ASSOCIATE_BASE | ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
ECORE_EVAS_OBJECT_ASSOCIATE_STACK | ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER); ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW, evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
_elm_win_obj_callback_show, win); _elm_win_obj_callback_show, win);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL, evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
_elm_win_obj_callback_del, win); _elm_win_obj_callback_del, win);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE, evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
_elm_win_obj_callback_move, win); _elm_win_obj_callback_move, win);
ecore_evas_name_class_set(win->ee, name, _elm_appname); ecore_evas_name_class_set(win->ee, name, _elm_appname);
ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request); ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
@ -1106,7 +1106,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024)); evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024)); evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath) EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
evas_font_path_append(win->evas, fontpath); evas_font_path_append(win->evas, fontpath);
if (!_elm_config->font_hinting) if (!_elm_config->font_hinting)
evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE); evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
else if (_elm_config->font_hinting == 1) else if (_elm_config->font_hinting == 1)
@ -1122,7 +1122,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
if (ENGINE_COMPARE(ELM_SOFTWARE_FB)) if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
{ {
ecore_evas_fullscreen_set(win->ee, 1); ecore_evas_fullscreen_set(win->ee, 1);
} }
#undef ENGINE_COMPARE #undef ENGINE_COMPARE
@ -1413,16 +1413,16 @@ elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
if (win->xwin) if (win->xwin)
{ {
if (alpha) if (alpha)
{ {
if (!_elm_config->compositing) if (!_elm_config->compositing)
elm_win_shaped_set(obj, alpha); elm_win_shaped_set(obj, alpha);
else else
ecore_evas_alpha_set(win->ee, alpha); ecore_evas_alpha_set(win->ee, alpha);
} }
else else
ecore_evas_alpha_set(win->ee, alpha); ecore_evas_alpha_set(win->ee, alpha);
_elm_win_xwin_update(win); _elm_win_xwin_update(win);
} }
else else
#endif #endif
@ -1466,8 +1466,8 @@ elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
if (win->xwin) if (win->xwin)
{ {
ecore_evas_transparent_set(win->ee, transparent); ecore_evas_transparent_set(win->ee, transparent);
_elm_win_xwin_update(win); _elm_win_xwin_update(win);
} }
else else
#endif #endif
@ -1552,14 +1552,14 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) || if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE)) ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{ {
// these engines... can ONLY be fullscreen // these engines... can ONLY be fullscreen
return; return;
} }
else else
{ {
ecore_evas_fullscreen_set(win->ee, fullscreen); ecore_evas_fullscreen_set(win->ee, fullscreen);
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(win); _elm_win_xwin_update(win);
#endif #endif
} }
#undef ENGINE_COMPARE #undef ENGINE_COMPARE
@ -1585,12 +1585,12 @@ elm_win_fullscreen_get(const Evas_Object *obj)
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) || if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE)) ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{ {
// these engines... can ONLY be fullscreen // these engines... can ONLY be fullscreen
return EINA_TRUE; return EINA_TRUE;
} }
else else
{ {
return ecore_evas_fullscreen_get(win->ee); return ecore_evas_fullscreen_get(win->ee);
} }
#undef ENGINE_COMPARE #undef ENGINE_COMPARE
} }
@ -1860,7 +1860,7 @@ elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
#ifdef HAVE_ELEMENTARY_X #ifdef HAVE_ELEMENTARY_X
if (win->xwin) if (win->xwin)
ecore_x_e_virtual_keyboard_state_set ecore_x_e_virtual_keyboard_state_set
(win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode); (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
#endif #endif
} }
@ -2203,23 +2203,23 @@ elm_win_quickpanel_zone_get(const Evas_Object *obj)
/** /**
* Set the window to be skipped by keyboard focus * Set the window to be skipped by keyboard focus
* *
* This sets the window to be skipped by normal keyboard input. This means * This sets the window to be skipped by normal keyboard input. This means
* a window manager will be asked to not focus this window as well as omit * a window manager will be asked to not focus this window as well as omit
* it from things like the taskbar, pager, "alt-tab" list etc. etc. * it from things like the taskbar, pager, "alt-tab" list etc. etc.
* *
* Call this and enable it on a window BEFORE you show it for the first time, * Call this and enable it on a window BEFORE you show it for the first time,
* otherwise it may have no effect. * otherwise it may have no effect.
* *
* Use this for windows that have only output information or might only be * Use this for windows that have only output information or might only be
* interacted with by the mouse or fingers, and never for typing input. * interacted with by the mouse or fingers, and never for typing input.
* Be careful that this may have side-effects like making the window * Be careful that this may have side-effects like making the window
* non-accessible in some cases unless the window is specially handled. Use * non-accessible in some cases unless the window is specially handled. Use
* this with care. * this with care.
* *
* @param obj The window object * @param obj The window object
* @param skip The skip flag state (EINA_TRUE if it is to be skipped) * @param skip The skip flag state (EINA_TRUE if it is to be skipped)
* *
* @ingroup Win * @ingroup Win
*/ */
EAPI void EAPI void
@ -2236,7 +2236,7 @@ elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
if (win->xwin) if (win->xwin)
{ {
Ecore_X_Window_State states[2]; Ecore_X_Window_State states[2];
ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0); ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER; states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
@ -2248,17 +2248,17 @@ elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
/** /**
* Send a command to the windowing environment * Send a command to the windowing environment
* *
* This is intended to work in touchscreen or small screen device environments * This is intended to work in touchscreen or small screen device environments
* where there is a more simplistic window management policy in place. This * where there is a more simplistic window management policy in place. This
* uses the window object indicated to select which part of the environment * uses the window object indicated to select which part of the environment
* to control (the part that this window lives in), and provides a command * to control (the part that this window lives in), and provides a command
* and an optional parameter structure (use NULL for this if not needed). * and an optional parameter structure (use NULL for this if not needed).
* *
* @param obj The window object that lives in the environment to control * @param obj The window object that lives in the environment to control
* @param command The command to send * @param command The command to send
* @param params Optional parameters for the command * @param params Optional parameters for the command
* *
* @ingroup Win * @ingroup Win
*/ */
EAPI void EAPI void
@ -2275,19 +2275,19 @@ elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *
switch (command) switch (command)
{ {
case ELM_ILLUME_COMMAND_FOCUS_BACK: case ELM_ILLUME_COMMAND_FOCUS_BACK:
ecore_x_e_illume_focus_back_send(win->xwin); ecore_x_e_illume_focus_back_send(win->xwin);
break; break;
case ELM_ILLUME_COMMAND_FOCUS_FORWARD: case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
ecore_x_e_illume_focus_forward_send(win->xwin); ecore_x_e_illume_focus_forward_send(win->xwin);
break; break;
case ELM_ILLUME_COMMAND_FOCUS_HOME: case ELM_ILLUME_COMMAND_FOCUS_HOME:
ecore_x_e_illume_focus_home_send(win->xwin); ecore_x_e_illume_focus_home_send(win->xwin);
break; break;
case ELM_ILLUME_COMMAND_CLOSE: case ELM_ILLUME_COMMAND_CLOSE:
ecore_x_e_illume_close_send(win->xwin); ecore_x_e_illume_close_send(win->xwin);
break; break;
default: default:
break; break;
} }
} }
#endif #endif
@ -2470,10 +2470,10 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
Evas_Object *sub = event_info; Evas_Object *sub = event_info;
if (sub == wd->content) if (sub == wd->content)
{ {
evas_object_event_callback_del_full evas_object_event_callback_del_full
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
wd->content = NULL; wd->content = NULL;
_sizing_eval(obj); _sizing_eval(obj);
} }
} }
@ -2560,10 +2560,10 @@ elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
wd->content = content; wd->content = content;
if (content) if (content)
{ {
elm_widget_sub_object_add(obj, content); elm_widget_sub_object_add(obj, content);
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj); _changed_size_hints, obj);
edje_object_part_swallow(wd->frm, "elm.swallow.content", content); edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
} }
_sizing_eval(obj); _sizing_eval(obj);
} }

View File

@ -13,33 +13,33 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
minh = 0; minh = 0;
if (homogeneous) if (homogeneous)
{ {
EINA_LIST_FOREACH(priv->children, l, opt) EINA_LIST_FOREACH(priv->children, l, opt)
{ {
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
if (minh < mnh) minh = mnh; if (minh < mnh) minh = mnh;
if (minw < mnw) minw = mnw; if (minw < mnw) minw = mnw;
} }
if (horizontal) if (horizontal)
minw *= eina_list_count(priv->children); minw *= eina_list_count(priv->children);
else else
minh *= eina_list_count(priv->children); minh *= eina_list_count(priv->children);
} }
else else
{ {
EINA_LIST_FOREACH(priv->children, l, opt) EINA_LIST_FOREACH(priv->children, l, opt)
{ {
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
if (horizontal) if (horizontal)
{ {
if (minh < mnh) minh = mnh; if (minh < mnh) minh = mnh;
minw += mnw; minw += mnw;
} }
else else
{ {
if (minw < mnw) minw = mnw; if (minw < mnw) minw = mnw;
minh += mnh; minh += mnh;
} }
} }
} }
evas_object_size_hint_min_set(box, minw, minh); evas_object_size_hint_min_set(box, minw, minh);
} }
@ -64,41 +64,41 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
count = eina_list_count(priv->children); count = eina_list_count(priv->children);
if (w < minw) if (w < minw)
{ {
x = x + ((w - minw) * (1.0 - ax)); x = x + ((w - minw) * (1.0 - ax));
w = minw; w = minw;
} }
if (h < minh) if (h < minh)
{ {
y = y + ((h - minh) * (1.0 - ay)); y = y + ((h - minh) * (1.0 - ay));
h = minh; h = minh;
} }
EINA_LIST_FOREACH(priv->children, l, opt) EINA_LIST_FOREACH(priv->children, l, opt)
{ {
double wx, wy; double wx, wy;
evas_object_size_hint_weight_get(opt->obj, &wx, &wy); evas_object_size_hint_weight_get(opt->obj, &wx, &wy);
if (horizontal) if (horizontal)
{ {
if (wx > 0.0) expand++; if (wx > 0.0) expand++;
} }
else else
{ {
if (wy > 0.0) expand++; if (wy > 0.0) expand++;
} }
} }
if (!expand) if (!expand)
{ {
evas_object_size_hint_align_get(o, &ax, &ay); evas_object_size_hint_align_get(o, &ax, &ay);
if (horizontal) if (horizontal)
{ {
x += (double)(w - minw) * ax; x += (double)(w - minw) * ax;
w = minw; w = minw;
} }
else else
{ {
y += (double)(h - minh) * ay; y += (double)(h - minh) * ay;
h = minh; h = minh;
} }
} }
wdif = w - minw; wdif = w - minw;
hdif = h - minh; hdif = h - minh;
@ -110,36 +110,36 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
double wx, wy; double wx, wy;
int fw, fh, xw, xh; int fw, fh, xw, xh;
obj = opt->obj; obj = opt->obj;
evas_object_size_hint_align_get(obj, &ax, &ay); evas_object_size_hint_align_get(obj, &ax, &ay);
evas_object_size_hint_weight_get(obj, &wx, &wy); evas_object_size_hint_weight_get(obj, &wx, &wy);
evas_object_size_hint_min_get(obj, &mnw, &mnh); evas_object_size_hint_min_get(obj, &mnw, &mnh);
evas_object_size_hint_max_get(obj, &mxw, &mxh); evas_object_size_hint_max_get(obj, &mxw, &mxh);
fw = fh = 0; fw = fh = 0;
xw = xh = 0; xw = xh = 0;
if (ax == -1.0) {fw = 1; ax = 0.5;} if (ax == -1.0) {fw = 1; ax = 0.5;}
if (ay == -1.0) {fh = 1; ay = 0.5;} if (ay == -1.0) {fh = 1; ay = 0.5;}
if (wx > 0.0) xw = 1; if (wx > 0.0) xw = 1;
if (wy > 0.0) xh = 1; if (wy > 0.0) xh = 1;
if (horizontal) if (horizontal)
{ {
Evas_Coord ww, hh, ow, oh; Evas_Coord ww, hh, ow, oh;
if (homogeneous) if (homogeneous)
{ {
ww = (w / (Evas_Coord)count); ww = (w / (Evas_Coord)count);
} }
else else
{ {
ww = mnw; ww = mnw;
if ((expand > 0) && (xw)) if ((expand > 0) && (xw))
{ {
if (expand == 1) ow = wdif; if (expand == 1) ow = wdif;
else ow = (w - minw) / expand; else ow = (w - minw) / expand;
wdif -= ow; wdif -= ow;
ww += ow; ww += ow;
} }
} }
hh = h; hh = h;
ow = mnw; ow = mnw;
if (fw) ow = ww; if (fw) ow = ww;
@ -148,31 +148,31 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
if (fh) oh = hh; if (fh) oh = hh;
if ((mxh >= 0) && (mxh < oh)) oh = mxh; if ((mxh >= 0) && (mxh < oh)) oh = mxh;
evas_object_move(obj, evas_object_move(obj,
((!rtl) ? (xx) : (x + (w - (xx - x) - ww))) ((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
+ (Evas_Coord)(((double)(ww - ow)) * ax), + (Evas_Coord)(((double)(ww - ow)) * ax),
yy + (Evas_Coord)(((double)(hh - oh)) * ay)); yy + (Evas_Coord)(((double)(hh - oh)) * ay));
evas_object_resize(obj, ow, oh); evas_object_resize(obj, ow, oh);
xx += ww; xx += ww;
} }
else else
{ {
Evas_Coord ww, hh, ow, oh; Evas_Coord ww, hh, ow, oh;
if (homogeneous) if (homogeneous)
{ {
hh = (h / (Evas_Coord)count); hh = (h / (Evas_Coord)count);
} }
else else
{ {
hh = mnh; hh = mnh;
if ((expand > 0) && (xh)) if ((expand > 0) && (xh))
{ {
if (expand == 1) oh = hdif; if (expand == 1) oh = hdif;
else oh = (h - minh) / expand; else oh = (h - minh) / expand;
hdif -= oh; hdif -= oh;
hh += oh; hh += oh;
} }
} }
ww = w; ww = w;
ow = mnw; ow = mnw;
if (fw) ow = ww; if (fw) ow = ww;
@ -181,11 +181,11 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
if (fh) oh = hh; if (fh) oh = hh;
if ((mxh >= 0) && (mxh < oh)) oh = mxh; if ((mxh >= 0) && (mxh < oh)) oh = mxh;
evas_object_move(obj, evas_object_move(obj,
xx + (Evas_Coord)(((double)(ww - ow)) * ax), xx + (Evas_Coord)(((double)(ww - ow)) * ax),
yy + (Evas_Coord)(((double)(hh - oh)) * ay)); yy + (Evas_Coord)(((double)(hh - oh)) * ay));
evas_object_resize(obj, ow, oh); evas_object_resize(obj, ow, oh);
yy += hh; yy += hh;
} }
} }
} }