forked from enlightenment/efl
elementary/theme, widget, win, toolbar, thumb, toggle, util, box - removed white spaces
SVN revision: 58249
This commit is contained in:
parent
71d2f4b067
commit
22588576be
|
@ -141,7 +141,7 @@ elm_table_add(Evas_Object *parent)
|
|||
Widget_Data *wd;
|
||||
|
||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||
|
||||
|
||||
ELM_SET_WIDTYPE(widtype, "table");
|
||||
elm_widget_type_set(obj, "table");
|
||||
elm_widget_sub_object_add(parent, obj);
|
||||
|
@ -155,7 +155,7 @@ elm_table_add(Evas_Object *parent)
|
|||
|
||||
wd->tbl = evas_object_table_add(e);
|
||||
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);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
|
|
@ -26,21 +26,21 @@ _elm_theme_clear(Elm_Theme *th)
|
|||
eina_stringshare_del(p);
|
||||
if (th->cache)
|
||||
{
|
||||
eina_hash_free(th->cache);
|
||||
th->cache = NULL;
|
||||
eina_hash_free(th->cache);
|
||||
th->cache = NULL;
|
||||
}
|
||||
if (th->theme)
|
||||
{
|
||||
eina_stringshare_del(th->theme);
|
||||
th->theme = NULL;
|
||||
}
|
||||
if (th->ref_theme)
|
||||
{
|
||||
th->ref_theme->referrers =
|
||||
eina_list_remove(th->ref_theme->referrers, th);
|
||||
elm_theme_free(th->ref_theme);
|
||||
th->ref_theme = NULL;
|
||||
}
|
||||
if (th->ref_theme)
|
||||
{
|
||||
th->ref_theme->referrers =
|
||||
eina_list_remove(th->ref_theme->referrers, th);
|
||||
elm_theme_free(th->ref_theme);
|
||||
th->ref_theme = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
file = eina_stringshare_add(f);
|
||||
if (file)
|
||||
{
|
||||
eina_hash_add(th->cache, group, file);
|
||||
return file;
|
||||
}
|
||||
file = eina_stringshare_add(f);
|
||||
if (file)
|
||||
{
|
||||
eina_hash_add(th->cache, group, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
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);
|
||||
else if (((f[0] == '~') && (f[1] == '/')))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
|
||||
return _elm_theme_find_try(th, buf, group);
|
||||
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
|
||||
return _elm_theme_find_try(th, buf, group);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f);
|
||||
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 (!home)
|
||||
{
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
}
|
||||
EINA_LIST_FOREACH(th->overlay, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
EINA_LIST_FOREACH(th->themes, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
EINA_LIST_FOREACH(th->extension, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(th, home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
if (th->ref_theme) return _elm_theme_group_file_find(th->ref_theme, group);
|
||||
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);
|
||||
if (file)
|
||||
{
|
||||
ok = edje_object_file_set(o, file, buf2);
|
||||
if (ok) return EINA_TRUE;
|
||||
ok = edje_object_file_set(o, file, buf2);
|
||||
if (ok) return EINA_TRUE;
|
||||
else
|
||||
DBG("could not set theme group '%s' from file '%s': %s",
|
||||
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);
|
||||
if (file)
|
||||
{
|
||||
_els_smart_icon_file_edje_set(o, file, buf2);
|
||||
_els_smart_icon_size_get(o, &w, &h);
|
||||
if (w > 0) return EINA_TRUE;
|
||||
_els_smart_icon_file_edje_set(o, file, buf2);
|
||||
_els_smart_icon_size_get(o, &w, &h);
|
||||
if (w > 0) return EINA_TRUE;
|
||||
}
|
||||
snprintf(buf2, sizeof(buf2), "elm/icon/%s/default", group);
|
||||
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));
|
||||
if ((!p) || ((p) && (strcmp(p, "default"))))
|
||||
{
|
||||
p = eina_stringshare_add("default");
|
||||
if (p) names = eina_list_append(names, p);
|
||||
p = eina_stringshare_add("default");
|
||||
if (p) names = eina_list_append(names, p);
|
||||
}
|
||||
if (th->cache) eina_hash_free(th->cache);
|
||||
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
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* (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
|
||||
* theme set to show this preview before the user decides to apply it to all
|
||||
* applications).
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI Elm_Theme *
|
||||
|
@ -272,11 +272,11 @@ elm_theme_new(void)
|
|||
|
||||
/**
|
||||
* Free a specific theme
|
||||
*
|
||||
*
|
||||
* @param th The theme to free
|
||||
*
|
||||
*
|
||||
* This frees a theme created with elm_theme_new().
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -294,10 +294,10 @@ elm_theme_free(Elm_Theme *th)
|
|||
|
||||
/**
|
||||
* Copy the theme fom the source to the destination theme
|
||||
*
|
||||
*
|
||||
* @param th The source theme to copy from
|
||||
* @param thdst The destination theme to copy data to
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* @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 char *f;
|
||||
|
||||
|
||||
if (!th) th = &(theme_default);
|
||||
if (!thdst) thdst = &(theme_default);
|
||||
_elm_theme_clear(thdst);
|
||||
if (th->ref_theme)
|
||||
{
|
||||
thdst->ref_theme = th->ref_theme;
|
||||
thdst->ref_theme->referrers =
|
||||
eina_list_append(thdst->ref_theme->referrers, thdst);
|
||||
thdst->ref_theme->ref++;
|
||||
thdst->ref_theme = th->ref_theme;
|
||||
thdst->ref_theme->referrers =
|
||||
eina_list_append(thdst->ref_theme->referrers, thdst);
|
||||
thdst->ref_theme->ref++;
|
||||
}
|
||||
EINA_LIST_FOREACH(th->overlay, l, f)
|
||||
{
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->overlay = eina_list_append(thdst->overlay, s);
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->overlay = eina_list_append(thdst->overlay, s);
|
||||
}
|
||||
EINA_LIST_FOREACH(th->themes, l, f)
|
||||
{
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->themes = eina_list_append(thdst->themes, s);
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->themes = eina_list_append(thdst->themes, s);
|
||||
}
|
||||
EINA_LIST_FOREACH(th->extension, l, f)
|
||||
{
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->extension = eina_list_append(thdst->extension, s);
|
||||
const char *s = eina_stringshare_add(f);
|
||||
if (s) thdst->extension = eina_list_append(thdst->extension, s);
|
||||
}
|
||||
if (th->theme) thdst->theme = eina_stringshare_add(th->theme);
|
||||
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
|
||||
*
|
||||
*
|
||||
* @param th The theme that will do the referencing
|
||||
* @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
|
||||
* 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.
|
||||
|
@ -357,8 +357,8 @@ elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
|
|||
_elm_theme_clear(th);
|
||||
if (thref)
|
||||
{
|
||||
thref->referrers = eina_list_append(thref->referrers, th);
|
||||
thref->ref++;
|
||||
thref->referrers = eina_list_append(thref->referrers, th);
|
||||
thref->ref++;
|
||||
}
|
||||
th->ref_theme = thref;
|
||||
elm_theme_flush(th);
|
||||
|
@ -366,10 +366,10 @@ elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
|
|||
|
||||
/**
|
||||
* Return the theme referred to
|
||||
*
|
||||
*
|
||||
* @param th The theme to get the reference from
|
||||
* @return The referenced theme handle
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
@ -382,9 +382,9 @@ elm_theme_ref_get(Elm_Theme *th)
|
|||
|
||||
/**
|
||||
* Return the default theme
|
||||
*
|
||||
*
|
||||
* @return The default theme handle
|
||||
*
|
||||
*
|
||||
* This returns the internal default theme setup handle that all widgets
|
||||
* use implicitly unless a specific theme is set. This is also often use
|
||||
* 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 item The Edje file path to be used
|
||||
*
|
||||
*
|
||||
* Use this if your application needs to provide some custom overlay theme
|
||||
* (An Edje file that replaces some default styles of widgets) where adding
|
||||
* 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
|
||||
*
|
||||
* See elm_theme_overlay_add().
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -441,12 +441,12 @@ elm_theme_overlay_del(Elm_Theme *th, const char *item)
|
|||
if (!th) th = &(theme_default);
|
||||
s = eina_stringshare_add(item);
|
||||
EINA_LIST_FOREACH(th->overlay, l, f)
|
||||
if (f == s)
|
||||
{
|
||||
eina_stringshare_del(f);
|
||||
th->overlay = eina_list_remove_list(th->overlay, (Eina_List *)l);
|
||||
break;
|
||||
}
|
||||
if (f == s)
|
||||
{
|
||||
eina_stringshare_del(f);
|
||||
th->overlay = eina_list_remove_list(th->overlay, (Eina_List *)l);
|
||||
break;
|
||||
}
|
||||
eina_stringshare_del(s);
|
||||
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
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
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 item The name of the theme extension
|
||||
*
|
||||
*
|
||||
* See elm_theme_extension_add().
|
||||
*
|
||||
* @ingroup Theme
|
||||
|
@ -499,29 +499,29 @@ elm_theme_extension_del(Elm_Theme *th, const char *item)
|
|||
if (!th) th = &(theme_default);
|
||||
s = eina_stringshare_add(item);
|
||||
EINA_LIST_FOREACH(th->extension, l, f)
|
||||
if (f == s)
|
||||
{
|
||||
eina_stringshare_del(f);
|
||||
th->extension = eina_list_remove_list(th->extension, (Eina_List *)l);
|
||||
break;
|
||||
}
|
||||
if (f == s)
|
||||
{
|
||||
eina_stringshare_del(f);
|
||||
th->extension = eina_list_remove_list(th->extension, (Eina_List *)l);
|
||||
break;
|
||||
}
|
||||
eina_stringshare_del(s);
|
||||
elm_theme_flush(th);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the theme search order for the given theme
|
||||
*
|
||||
*
|
||||
* @param th The theme to set the search order, or if NULL, the default theme
|
||||
* @param theme Theme search string
|
||||
*
|
||||
*
|
||||
* This sets the search string for the theme in path-notation from first
|
||||
* theme to search, to last, delimited by the : character. Example:
|
||||
*
|
||||
*
|
||||
* "shiny:/path/to/file.edj:default"
|
||||
*
|
||||
*
|
||||
* See the ELM_THEME environment variable for more information.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -539,12 +539,12 @@ elm_theme_set(Elm_Theme *th, const char *theme)
|
|||
|
||||
/**
|
||||
* Return the theme search order
|
||||
*
|
||||
*
|
||||
* @param th The theme to get the search order, or if NULL, the default theme
|
||||
* @return The internal search order path
|
||||
*
|
||||
*
|
||||
* See elm_theme_set() for more information.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
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.
|
||||
*
|
||||
*
|
||||
* @param th Theme to get the list of theme elements from.
|
||||
* @return The internal list of theme elements
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* @return The full path to the file found.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
|
||||
if (!f)
|
||||
{
|
||||
if (in_search_path) *in_search_path = EINA_FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (!home)
|
||||
{
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
}
|
||||
|
||||
|
||||
if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) ||
|
||||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) ||
|
||||
((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] == '/')))
|
||||
{
|
||||
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);
|
||||
}
|
||||
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;
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f);
|
||||
if (ecore_file_exists(buf))
|
||||
{
|
||||
if (in_search_path) *in_search_path = EINA_TRUE;
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
|
||||
if (in_search_path) *in_search_path = EINA_FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush the current theme.
|
||||
*
|
||||
*
|
||||
* @param th Theme to flush
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
* 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 will flush all themes in the current application context, by calling
|
||||
* elm_theme_flush() on each of them.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -701,7 +701,7 @@ elm_theme_full_flush(void)
|
|||
{
|
||||
Eina_List *l;
|
||||
Elm_Theme *th;
|
||||
|
||||
|
||||
EINA_LIST_FOREACH(themes, l, th)
|
||||
{
|
||||
elm_theme_flush(th);
|
||||
|
@ -722,7 +722,7 @@ elm_theme_all_set(const char *theme)
|
|||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
static Ecore_X_Atom atom = 0;
|
||||
|
||||
|
||||
if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THEME");
|
||||
ecore_x_window_prop_string_set(ecore_x_window_root_first_get(),
|
||||
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 strings that are the theme element names.
|
||||
*
|
||||
*
|
||||
* This lists all available theme files in the standard Elementary search path
|
||||
* 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.
|
||||
*/
|
||||
EAPI Eina_List *
|
||||
|
@ -747,13 +747,13 @@ elm_theme_name_available_list_new(void)
|
|||
Eina_List *dir, *l;
|
||||
char buf[PATH_MAX], *file, *s, *th;
|
||||
static const char *home = NULL;
|
||||
|
||||
|
||||
if (!home)
|
||||
{
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
}
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/themes", home);
|
||||
dir = ecore_file_ls(buf);
|
||||
EINA_LIST_FREE(dir, file)
|
||||
|
@ -784,7 +784,7 @@ elm_theme_name_available_list_new(void)
|
|||
if ((s) && (!strcasecmp(s, ".edj")))
|
||||
{
|
||||
int dup;
|
||||
|
||||
|
||||
th = strdup(file);
|
||||
s = strchr(th, '.');
|
||||
*s = 0;
|
||||
|
@ -809,8 +809,8 @@ elm_theme_name_available_list_new(void)
|
|||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* @param obj The object to set the theme on
|
||||
* @param th The theme to set
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* cleared and the object will inherit its theme from its parent (which
|
||||
* 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
|
||||
* configuration difficult. Avoid any custom themes at all if it can be
|
||||
* helped.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -847,15 +847,15 @@ elm_object_theme_set(Evas_Object *obj, Elm_Theme *th)
|
|||
|
||||
/**
|
||||
* Get the specific theme to be used
|
||||
*
|
||||
*
|
||||
* @param obj The object to get the specific theme from
|
||||
* @return The specifc theme set.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the specific theme set for that specific object. See elm_object_theme_set()
|
||||
* for more information.
|
||||
*
|
||||
*
|
||||
* @ingroup Theme
|
||||
*/
|
||||
EAPI Elm_Theme *
|
||||
|
|
|
@ -38,9 +38,9 @@ struct _Widget_Data
|
|||
const char *key;
|
||||
struct
|
||||
{
|
||||
int id;
|
||||
const char *file;
|
||||
const char *key;
|
||||
int id;
|
||||
const char *file;
|
||||
const char *key;
|
||||
} thumb;
|
||||
Ecore_Event_Handler *eeh;
|
||||
Elm_Thumb_Animation_Setting anim_setting;
|
||||
|
@ -60,16 +60,16 @@ static const char *widtype = NULL;
|
|||
#define SIG_LOAD_ERROR "load,error"
|
||||
#define SIG_PRESS "press"
|
||||
|
||||
static const Evas_Smart_Cb_Description _signals[] =
|
||||
static const Evas_Smart_Cb_Description _signals[] =
|
||||
{
|
||||
{SIG_CLICKED, ""},
|
||||
{SIG_CLICKED_DOUBLE, ""},
|
||||
{SIG_GENERATE_ERROR, ""},
|
||||
{SIG_GENERATE_START, ""},
|
||||
{SIG_GENERATE_STOP, ""},
|
||||
{SIG_LOAD_ERROR, ""},
|
||||
{SIG_PRESS, ""},
|
||||
{NULL, NULL}
|
||||
{SIG_CLICKED, ""},
|
||||
{SIG_CLICKED_DOUBLE, ""},
|
||||
{SIG_GENERATE_ERROR, ""},
|
||||
{SIG_GENERATE_START, ""},
|
||||
{SIG_GENERATE_STOP, ""},
|
||||
{SIG_LOAD_ERROR, ""},
|
||||
{SIG_PRESS, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
#define EDJE_SIGNAL_GENERATE_START "elm,thumb,generate,start"
|
||||
|
@ -105,7 +105,7 @@ static void
|
|||
_theme_hook(Evas_Object *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));
|
||||
}
|
||||
|
||||
|
@ -156,52 +156,52 @@ _finished_thumb(Widget_Data *wd, const char *thumb_path, const char *thumb_key)
|
|||
evas = evas_object_evas_get(wd->self);
|
||||
if ((wd->view) && (wd->is_video ^ wd->was_video))
|
||||
{
|
||||
evas_object_del(wd->view);
|
||||
wd->view = NULL;
|
||||
evas_object_del(wd->view);
|
||||
wd->view = NULL;
|
||||
}
|
||||
wd->was_video = wd->is_video;
|
||||
|
||||
if ((wd->is_video) &&
|
||||
(ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET))
|
||||
{
|
||||
if (!wd->view)
|
||||
{
|
||||
wd->view = edje_object_add(evas);
|
||||
if (!wd->view)
|
||||
{
|
||||
ERR("could not create edje object");
|
||||
goto err;
|
||||
}
|
||||
new_view = EINA_TRUE;
|
||||
}
|
||||
if (!wd->view)
|
||||
{
|
||||
wd->view = edje_object_add(evas);
|
||||
if (!wd->view)
|
||||
{
|
||||
ERR("could not create edje object");
|
||||
goto err;
|
||||
}
|
||||
new_view = EINA_TRUE;
|
||||
}
|
||||
|
||||
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,
|
||||
wd->file);
|
||||
goto view_err;
|
||||
}
|
||||
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,
|
||||
wd->file);
|
||||
goto view_err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!wd->view)
|
||||
{
|
||||
wd->view = evas_object_image_filled_add(evas);
|
||||
if (!wd->view)
|
||||
{
|
||||
ERR("could not create image object");
|
||||
goto err;
|
||||
}
|
||||
new_view = EINA_TRUE;
|
||||
}
|
||||
if (!wd->view)
|
||||
{
|
||||
wd->view = evas_object_image_filled_add(evas);
|
||||
if (!wd->view)
|
||||
{
|
||||
ERR("could not create image object");
|
||||
goto err;
|
||||
}
|
||||
new_view = EINA_TRUE;
|
||||
}
|
||||
|
||||
evas_object_image_file_set(wd->view, thumb_path, thumb_key);
|
||||
r = evas_object_image_load_error_get(wd->view);
|
||||
if (r != EVAS_LOAD_ERROR_NONE)
|
||||
{
|
||||
ERR("%s: %s", thumb_path, evas_load_error_str(r));
|
||||
goto view_err;
|
||||
}
|
||||
evas_object_image_file_set(wd->view, thumb_path, thumb_key);
|
||||
r = evas_object_image_load_error_get(wd->view);
|
||||
if (r != EVAS_LOAD_ERROR_NONE)
|
||||
{
|
||||
ERR("%s: %s", thumb_path, evas_load_error_str(r));
|
||||
goto view_err;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
_finished_thumb(wd, thumb_path, thumb_key);
|
||||
return;
|
||||
_finished_thumb(wd, thumb_path, thumb_key);
|
||||
return;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -259,26 +259,26 @@ _thumb_apply(Widget_Data *wd)
|
|||
ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key);
|
||||
if (ethumb_client_thumb_exists(_elm_ethumb_client))
|
||||
{
|
||||
const char *thumb_path, *thumb_key;
|
||||
const char *thumb_path, *thumb_key;
|
||||
|
||||
wd->thumb.id = -1;
|
||||
ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
|
||||
&thumb_key);
|
||||
_finished_thumb(wd, thumb_path, thumb_key);
|
||||
return;
|
||||
wd->thumb.id = -1;
|
||||
ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
|
||||
&thumb_key);
|
||||
_finished_thumb(wd, thumb_path, thumb_key);
|
||||
return;
|
||||
}
|
||||
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_GENERATE_START, "elm");
|
||||
evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm");
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm");
|
||||
evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->thumb.id = -1;
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
|
||||
evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
|
||||
wd->thumb.id = -1;
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
|
||||
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())
|
||||
{
|
||||
_thumb_apply(wd);
|
||||
return;
|
||||
_thumb_apply(wd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wd->eeh)
|
||||
wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT,
|
||||
_thumb_apply_cb, wd);
|
||||
_thumb_apply_cb, wd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -320,18 +320,18 @@ _thumb_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
|
||||
if (wd->thumb.id >= 0)
|
||||
{
|
||||
ethumb_client_generate_cancel
|
||||
(_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
|
||||
wd->thumb.id = -1;
|
||||
ethumb_client_generate_cancel
|
||||
(_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
|
||||
wd->thumb.id = -1;
|
||||
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
|
||||
evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
|
||||
edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
|
||||
evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
|
||||
}
|
||||
|
||||
if (wd->eeh)
|
||||
{
|
||||
ecore_event_handler_del(wd->eeh);
|
||||
wd->eeh = NULL;
|
||||
ecore_event_handler_del(wd->eeh);
|
||||
wd->eeh = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,9 +347,9 @@ _connect_cb(void *data __UNUSED__, Ethumb_Client *c, Eina_Bool success)
|
|||
{
|
||||
if (success)
|
||||
{
|
||||
ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
|
||||
_elm_ethumb_connected = EINA_TRUE;
|
||||
ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
|
||||
ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
|
||||
_elm_ethumb_connected = EINA_TRUE;
|
||||
ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
|
||||
}
|
||||
else
|
||||
_elm_ethumb_client = NULL;
|
||||
|
@ -426,7 +426,7 @@ elm_thumb_add(Evas_Object *parent)
|
|||
Evas_Coord minw, minh;
|
||||
|
||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||
|
||||
|
||||
ELM_SET_WIDTYPE(widtype, "thumb");
|
||||
elm_widget_type_set(obj, "thumb");
|
||||
elm_widget_sub_object_add(parent, obj);
|
||||
|
@ -454,13 +454,13 @@ elm_thumb_add(Evas_Object *parent)
|
|||
|
||||
#ifdef HAVE_ELEMENTARY_ETHUMB
|
||||
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,
|
||||
_mouse_up_cb, wd);
|
||||
_mouse_up_cb, wd);
|
||||
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,
|
||||
_thumb_hide_cb, wd);
|
||||
_thumb_hide_cb, wd);
|
||||
#endif
|
||||
|
||||
// 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)
|
||||
{
|
||||
int prefix_size;
|
||||
const char **ext, *ptr;
|
||||
static const char *extensions[] =
|
||||
int prefix_size;
|
||||
const char **ext, *ptr;
|
||||
static const char *extensions[] =
|
||||
{
|
||||
".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
|
||||
};
|
||||
|
||||
prefix_size = eina_stringshare_strlen(wd->file) - 4;
|
||||
if (prefix_size >= 0)
|
||||
{
|
||||
ptr = wd->file + prefix_size;
|
||||
wd->is_video = EINA_FALSE;
|
||||
for (ext = extensions; *ext; ext++)
|
||||
if (!strcasecmp(ptr, *ext))
|
||||
{
|
||||
wd->is_video = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
prefix_size = eina_stringshare_strlen(wd->file) - 4;
|
||||
if (prefix_size >= 0)
|
||||
{
|
||||
ptr = wd->file + prefix_size;
|
||||
wd->is_video = EINA_FALSE;
|
||||
for (ext = extensions; *ext; ext++)
|
||||
if (!strcasecmp(ptr, *ext))
|
||||
{
|
||||
wd->is_video = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eina_stringshare_replace(&(wd->thumb.file), NULL);
|
||||
|
@ -730,10 +730,10 @@ elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
|
|||
|
||||
wd->edit = edit;
|
||||
if (wd->edit)
|
||||
elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
|
||||
_elm_thumb_dropcb, obj);
|
||||
elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
|
||||
_elm_thumb_dropcb, obj);
|
||||
else
|
||||
elm_drop_target_del(obj);
|
||||
elm_drop_target_del(obj);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
|
|||
|
||||
static const char SIG_CHANGED[] = "changed";
|
||||
static const Evas_Smart_Cb_Description _signals[] = {
|
||||
{SIG_CHANGED, ""},
|
||||
{NULL, NULL}
|
||||
{SIG_CHANGED, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -93,13 +93,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
if (elm_widget_focus_get(obj))
|
||||
{
|
||||
edje_object_signal_emit(wd->tgl, "elm,action,focus", "elm");
|
||||
evas_object_focus_set(wd->tgl, EINA_TRUE);
|
||||
edje_object_signal_emit(wd->tgl, "elm,action,focus", "elm");
|
||||
evas_object_focus_set(wd->tgl, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(wd->tgl, "elm,action,unfocus", "elm");
|
||||
evas_object_focus_set(wd->tgl, EINA_FALSE);
|
||||
edje_object_signal_emit(wd->tgl, "elm,action,unfocus", "elm");
|
||||
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 (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
_sizing_eval(obj);
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ elm_toggle_add(Evas_Object *parent)
|
|||
Widget_Data *wd;
|
||||
|
||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||
|
||||
|
||||
ELM_SET_WIDTYPE(widtype, "toggle");
|
||||
elm_widget_type_set(obj, "toggle");
|
||||
elm_widget_sub_object_add(parent, obj);
|
||||
|
@ -318,12 +318,12 @@ elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
wd->icon = icon;
|
||||
if (icon)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, icon);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon);
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
elm_widget_sub_object_add(obj, icon);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon);
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -431,12 +431,12 @@ elm_toggle_state_set(Evas_Object *obj, Eina_Bool state)
|
|||
if (!wd) return;
|
||||
if (state != wd->state)
|
||||
{
|
||||
wd->state = state;
|
||||
if (wd->statep) *wd->statep = wd->state;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
|
||||
wd->state = state;
|
||||
if (wd->statep) *wd->statep = wd->state;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
|
||||
else
|
||||
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 (statep)
|
||||
{
|
||||
wd->statep = statep;
|
||||
if (*wd->statep != wd->state)
|
||||
{
|
||||
wd->state = *wd->statep;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
|
||||
}
|
||||
wd->statep = statep;
|
||||
if (*wd->statep != wd->state)
|
||||
{
|
||||
wd->state = *wd->statep;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,on", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
|
||||
}
|
||||
}
|
||||
else
|
||||
wd->statep = NULL;
|
||||
|
|
|
@ -99,7 +99,7 @@ _elm_toolbar_icon_size_get(Widget_Data *wd)
|
|||
const char *icon_size = edje_object_data_get(
|
||||
elm_smart_scroller_edje_object_get(wd->scr), "icon_size");
|
||||
if (icon_size)
|
||||
return atoi(icon_size);
|
||||
return atoi(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
|
||||
evas_object_event_callback_del_full
|
||||
(obj, EVAS_CALLBACK_HIDE, _menu_hide, data);
|
||||
(obj, EVAS_CALLBACK_HIDE, _menu_hide, data);
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Elm_Toolbar_Item *it = data;
|
||||
Evas_Coord x,y,w,h;
|
||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
||||
Elm_Toolbar_Item *it = data;
|
||||
Evas_Coord x,y,w,h;
|
||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
||||
|
||||
if ((!wd) || (!wd->menu_parent)) return;
|
||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
||||
elm_menu_move(it->o_menu, x, y+h);
|
||||
if ((!wd) || (!wd->menu_parent)) return;
|
||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
||||
elm_menu_move(it->o_menu, x, y+h);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -222,7 +222,7 @@ _item_del(Elm_Toolbar_Item *it)
|
|||
EINA_LIST_FREE(it->states, it_state)
|
||||
{
|
||||
if (it->icon == it_state->icon)
|
||||
it->icon = NULL;
|
||||
it->icon = NULL;
|
||||
eina_stringshare_del(it_state->label);
|
||||
eina_stringshare_del(it_state->icon_str);
|
||||
if (it_state->icon) evas_object_del(it_state->icon);
|
||||
|
@ -251,7 +251,7 @@ _del_pre_hook(Evas_Object *obj)
|
|||
it = next;
|
||||
}
|
||||
if (wd->more_item)
|
||||
_item_del(wd->more_item);
|
||||
_item_del(wd->more_item);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
_elm_theme_object_set(obj, view, "toolbar", "separator", style);
|
||||
_elm_theme_object_set(obj, view, "toolbar", "separator", style);
|
||||
|
||||
mw = mh = -1;
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
|
|||
EINA_INLIST_FOREACH(wd->items, it)
|
||||
_mirrored_set_item(obj, it, mirrored);
|
||||
if (wd->more_item)
|
||||
_mirrored_set_item(obj, wd->more_item, mirrored);
|
||||
_mirrored_set_item(obj, wd->more_item, mirrored);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -346,7 +346,7 @@ _theme_hook(Evas_Object *obj)
|
|||
EINA_INLIST_FOREACH(wd->items, it)
|
||||
_theme_hook_item(obj, it, scale, wd->icon_size);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -375,10 +375,10 @@ _sizing_eval(Evas_Object *obj)
|
|||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||
switch (wd->shrink_mode)
|
||||
{
|
||||
case ELM_TOOLBAR_SHRINK_MENU: /* fallthrough */
|
||||
case ELM_TOOLBAR_SHRINK_HIDE: /* fallthrough */
|
||||
case ELM_TOOLBAR_SHRINK_SCROLL: minw = w - vw; break;
|
||||
case ELM_TOOLBAR_SHRINK_NONE: minw = minw_bx + (w - vw); break;
|
||||
case ELM_TOOLBAR_SHRINK_MENU: /* fallthrough */
|
||||
case ELM_TOOLBAR_SHRINK_HIDE: /* fallthrough */
|
||||
case ELM_TOOLBAR_SHRINK_SCROLL: minw = w - vw; break;
|
||||
case ELM_TOOLBAR_SHRINK_NONE: minw = minw_bx + (w - vw); break;
|
||||
}
|
||||
minh = minh + (h - vh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
@ -473,7 +473,7 @@ _resize_job(void *data)
|
|||
_fix_items_visibility(wd, &iw, vw);
|
||||
evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &more_w, NULL);
|
||||
if (iw - more_w <= vw)
|
||||
iw -= more_w;
|
||||
iw -= more_w;
|
||||
|
||||
/* All items are removed from the box object, since removing individual
|
||||
* 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)
|
||||
{
|
||||
if (!it->prio.visible)
|
||||
if (!it->prio.visible)
|
||||
{
|
||||
if (it->separator)
|
||||
elm_menu_item_separator_add(menu, NULL);
|
||||
|
@ -502,7 +502,7 @@ _resize_job(void *data)
|
|||
}
|
||||
evas_object_hide(it->base.view);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
evas_object_box_append(wd->bx, it->base.view);
|
||||
evas_object_show(it->base.view);
|
||||
|
@ -535,13 +535,13 @@ _resize_job(void *data)
|
|||
{
|
||||
EINA_INLIST_FOREACH(wd->items, it)
|
||||
{
|
||||
if (!it->prio.visible)
|
||||
evas_object_hide(it->base.view);
|
||||
else
|
||||
{
|
||||
evas_object_box_append(wd->bx, it->base.view);
|
||||
evas_object_show(it->base.view);
|
||||
}
|
||||
if (!it->prio.visible)
|
||||
evas_object_hide(it->base.view);
|
||||
else
|
||||
{
|
||||
evas_object_box_append(wd->bx, it->base.view);
|
||||
evas_object_show(it->base.view);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
if (!wd->resize_job)
|
||||
wd->resize_job = ecore_job_add(_resize_job, data);
|
||||
wd->resize_job = ecore_job_add(_resize_job, data);
|
||||
}
|
||||
|
||||
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",
|
||||
_select, it);
|
||||
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",
|
||||
_mouse_out, it);
|
||||
_mouse_out, it);
|
||||
elm_widget_sub_object_add(obj, it->base.view);
|
||||
if (it->icon)
|
||||
{
|
||||
|
@ -702,7 +702,7 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
Widget_Data *wd;
|
||||
|
||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||
|
||||
|
||||
ELM_SET_WIDTYPE(widtype, "toolbar");
|
||||
elm_widget_type_set(obj, "toolbar");
|
||||
elm_widget_sub_object_add(parent, obj);
|
||||
|
@ -722,8 +722,8 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
EINA_FALSE);
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
elm_smart_scroller_policy_set(wd->scr,
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
|
||||
|
||||
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);
|
||||
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);
|
||||
if (!next_state)
|
||||
next_state = eina_list_next(item->states);
|
||||
next_state = eina_list_next(item->states);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -926,7 +926,7 @@ elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state)
|
|||
if (!next_state) return EINA_FALSE;
|
||||
}
|
||||
else
|
||||
next_state = it->states;
|
||||
next_state = it->states;
|
||||
|
||||
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");
|
||||
}
|
||||
if (it->disabled)
|
||||
elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
|
||||
elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
|
||||
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;
|
||||
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);
|
||||
if (del_state == item->states) return EINA_FALSE;
|
||||
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->icon_str);
|
||||
|
@ -1177,7 +1177,7 @@ elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Toolbar_Item *after, const c
|
|||
if (!it) return NULL;
|
||||
|
||||
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_show(it->base.view);
|
||||
_sizing_eval(obj);
|
||||
|
@ -1292,9 +1292,9 @@ EAPI void
|
|||
elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority)
|
||||
{
|
||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||
if (item->prio.priority == priority) return;
|
||||
item->prio.priority = priority;
|
||||
_resize(item->base.widget, NULL, NULL, NULL);
|
||||
if (item->prio.priority == priority) return;
|
||||
item->prio.priority = priority;
|
||||
_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);
|
||||
}
|
||||
else
|
||||
_elm_toolbar_item_label_update(item);
|
||||
_elm_toolbar_item_label_update(item);
|
||||
_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)
|
||||
if (it_state->icon == old_icon)
|
||||
return;
|
||||
return;
|
||||
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;
|
||||
|
||||
if (icon_str)
|
||||
eina_stringshare_replace(&item->icon_str, icon_str);
|
||||
eina_stringshare_replace(&item->icon_str, icon_str);
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
_elm_toolbar_item_icon_update(item);
|
||||
_elm_toolbar_item_icon_update(item);
|
||||
_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);
|
||||
if (!icon_obj) return;
|
||||
if (_item_icon_set(icon_obj, "toolbar/", icon))
|
||||
_elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size,
|
||||
"elm,state,icon_set");
|
||||
_elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size,
|
||||
"elm,state,icon_set");
|
||||
else
|
||||
{
|
||||
_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);
|
||||
|
||||
wd->more_item = _item_new(obj, "more_menu", "More",
|
||||
NULL, NULL);
|
||||
NULL, NULL);
|
||||
}
|
||||
else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
|
||||
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);
|
||||
}
|
||||
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)
|
||||
elm_icon_order_lookup_set(it->icon, order);
|
||||
if (wd->more_item)
|
||||
elm_icon_order_lookup_set(wd->more_item->icon, order);
|
||||
elm_icon_order_lookup_set(wd->more_item->icon, order);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,14 +19,14 @@ _str_append(char *str, const char *txt, int *len, int *alloc)
|
|||
if (txt_len <= 0) return str;
|
||||
if ((*len + txt_len) >= *alloc)
|
||||
{
|
||||
char *str2;
|
||||
int alloc2;
|
||||
char *str2;
|
||||
int alloc2;
|
||||
|
||||
alloc2 = *alloc + txt_len + 128;
|
||||
str2 = realloc(str, alloc2);
|
||||
if (!str2) return str;
|
||||
*alloc = alloc2;
|
||||
str = str2;
|
||||
alloc2 = *alloc + txt_len + 128;
|
||||
str2 = realloc(str, alloc2);
|
||||
if (!str2) return str;
|
||||
*alloc = alloc2;
|
||||
str = str2;
|
||||
}
|
||||
strcpy(str + *len, txt);
|
||||
*len += txt_len;
|
||||
|
@ -47,114 +47,114 @@ _elm_util_mkup_to_text(const char *mkup)
|
|||
s = p;
|
||||
for (;;)
|
||||
{
|
||||
if ((!*p) ||
|
||||
(tag_end) || (esc_end) ||
|
||||
(tag_start) || (esc_start))
|
||||
{
|
||||
if (tag_end)
|
||||
{
|
||||
char *ttag;
|
||||
if ((!*p) ||
|
||||
(tag_end) || (esc_end) ||
|
||||
(tag_start) || (esc_start))
|
||||
{
|
||||
if (tag_end)
|
||||
{
|
||||
char *ttag;
|
||||
|
||||
ttag = malloc(tag_end - tag_start);
|
||||
if (ttag)
|
||||
{
|
||||
_str_ncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
|
||||
ttag[tag_end - tag_start - 1] = 0;
|
||||
if (!strcmp(ttag, "br"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */
|
||||
str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc);
|
||||
free(ttag);
|
||||
}
|
||||
tag_start = tag_end = NULL;
|
||||
}
|
||||
else if (esc_end)
|
||||
{
|
||||
ts = malloc(esc_end - esc_start + 1);
|
||||
if (ts)
|
||||
{
|
||||
const char *esc;
|
||||
_str_ncpy(ts, esc_start, esc_end - esc_start);
|
||||
ts[esc_end - esc_start] = 0;
|
||||
esc = evas_textblock_escape_string_get(ts);
|
||||
if (esc)
|
||||
str = _str_append(str, esc, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
esc_start = esc_end = NULL;
|
||||
}
|
||||
else if ((!*p) && (s))
|
||||
{
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
ttag = malloc(tag_end - tag_start);
|
||||
if (ttag)
|
||||
{
|
||||
_str_ncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
|
||||
ttag[tag_end - tag_start - 1] = 0;
|
||||
if (!strcmp(ttag, "br"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */
|
||||
str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc);
|
||||
free(ttag);
|
||||
}
|
||||
tag_start = tag_end = NULL;
|
||||
}
|
||||
else if (esc_end)
|
||||
{
|
||||
ts = malloc(esc_end - esc_start + 1);
|
||||
if (ts)
|
||||
{
|
||||
const char *esc;
|
||||
_str_ncpy(ts, esc_start, esc_end - esc_start);
|
||||
ts[esc_end - esc_start] = 0;
|
||||
esc = evas_textblock_escape_string_get(ts);
|
||||
if (esc)
|
||||
str = _str_append(str, esc, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
esc_start = esc_end = NULL;
|
||||
}
|
||||
else if ((!*p) && (s))
|
||||
{
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*p == '<')
|
||||
{
|
||||
if ((s) && (!esc_start))
|
||||
{
|
||||
tag_start = p;
|
||||
tag_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == '>')
|
||||
{
|
||||
if (tag_start)
|
||||
{
|
||||
tag_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
else if (*p == '&')
|
||||
{
|
||||
if ((s) && (!tag_start))
|
||||
{
|
||||
esc_start = p;
|
||||
esc_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == ';')
|
||||
{
|
||||
if (esc_start)
|
||||
{
|
||||
esc_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
if (*p == '<')
|
||||
{
|
||||
if ((s) && (!esc_start))
|
||||
{
|
||||
tag_start = p;
|
||||
tag_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == '>')
|
||||
{
|
||||
if (tag_start)
|
||||
{
|
||||
tag_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
else if (*p == '&')
|
||||
{
|
||||
if ((s) && (!tag_start))
|
||||
{
|
||||
esc_start = p;
|
||||
esc_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
_str_ncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == ';')
|
||||
{
|
||||
if (esc_start)
|
||||
{
|
||||
esc_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
@ -169,29 +169,29 @@ _elm_util_text_to_mkup(const char *text)
|
|||
if (!text) return NULL;
|
||||
for (;;)
|
||||
{
|
||||
pos = pos2;
|
||||
pos = pos2;
|
||||
pos2 = evas_string_char_next_get((char *)(text), pos2, &ch);
|
||||
if ((ch <= 0) || (pos2 <= 0)) break;
|
||||
if (ch == '\n')
|
||||
if (ch == '\n')
|
||||
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);
|
||||
else if (ch == '<')
|
||||
else if (ch == '<')
|
||||
str = _str_append(str, "<", &str_len, &str_alloc);
|
||||
else if (ch == '>')
|
||||
else if (ch == '>')
|
||||
str = _str_append(str, ">", &str_len, &str_alloc);
|
||||
else if (ch == '&')
|
||||
else if (ch == '&')
|
||||
str = _str_append(str, "&", &str_len, &str_alloc);
|
||||
else if (ch == 0x2029) /* PS */
|
||||
str = _str_append(str, "<ps>", &str_len, &str_alloc);
|
||||
else
|
||||
{
|
||||
char tstr[16];
|
||||
else
|
||||
{
|
||||
char tstr[16];
|
||||
|
||||
_str_ncpy(tstr, text + pos, pos2 - pos);
|
||||
tstr[pos2 - pos] = 0;
|
||||
str = _str_append(str, tstr, &str_len, &str_alloc);
|
||||
}
|
||||
_str_ncpy(tstr, text + pos, pos2 - pos);
|
||||
tstr[pos2 - pos] = 0;
|
||||
str = _str_append(str, tstr, &str_len, &str_alloc);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
@ -32,15 +32,15 @@ struct _Smart_Data
|
|||
void (*theme_func) (Evas_Object *obj);
|
||||
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,
|
||||
const char *source);
|
||||
const char *source);
|
||||
void (*callback_add_func) (Evas_Object *obj, const char *emission,
|
||||
const char *source, void (*func) (void *data,
|
||||
Evas_Object *o, const char *emission,
|
||||
const char *source), void *data);
|
||||
const char *source, void (*func) (void *data,
|
||||
Evas_Object *o, const char *emission,
|
||||
const char *source), void *data);
|
||||
void (*callback_del_func) (Evas_Object *obj, const char *emission,
|
||||
const char *source, void (*func) (void *data,
|
||||
Evas_Object *o, const char *emission,
|
||||
const char *source), void *data);
|
||||
const char *source, void (*func) (void *data,
|
||||
Evas_Object *o, const char *emission,
|
||||
const char *source), void *data);
|
||||
void (*changed_func) (Evas_Object *obj);
|
||||
Eina_Bool (*focus_next_func) (const Evas_Object *obj, Elm_Focus_Direction dir,
|
||||
Evas_Object **next);
|
||||
|
@ -200,30 +200,30 @@ static void
|
|||
_propagate_x_drag_lock(Evas_Object *obj, int dir)
|
||||
{
|
||||
INTERNAL_ENTRY
|
||||
if (sd->parent_obj)
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
|
||||
if (sd2)
|
||||
{
|
||||
sd2->child_drag_x_locked += dir;
|
||||
_propagate_x_drag_lock(sd->parent_obj, dir);
|
||||
}
|
||||
}
|
||||
if (sd->parent_obj)
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
|
||||
if (sd2)
|
||||
{
|
||||
sd2->child_drag_x_locked += dir;
|
||||
_propagate_x_drag_lock(sd->parent_obj, dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_propagate_y_drag_lock(Evas_Object *obj, int dir)
|
||||
{
|
||||
INTERNAL_ENTRY
|
||||
if (sd->parent_obj)
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
|
||||
if (sd2)
|
||||
{
|
||||
sd2->child_drag_y_locked += dir;
|
||||
_propagate_y_drag_lock(sd->parent_obj, dir);
|
||||
}
|
||||
}
|
||||
if (sd->parent_obj)
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
|
||||
if (sd2)
|
||||
{
|
||||
sd2->child_drag_y_locked += dir;
|
||||
_propagate_y_drag_lock(sd->parent_obj, dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -235,26 +235,26 @@ _propagate_event(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_i
|
|||
|
||||
switch (type)
|
||||
{
|
||||
case EVAS_CALLBACK_KEY_DOWN:
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
case EVAS_CALLBACK_KEY_UP:
|
||||
{
|
||||
Evas_Event_Key_Up *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
case EVAS_CALLBACK_MOUSE_WHEEL:
|
||||
{
|
||||
Evas_Event_Mouse_Wheel *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
case EVAS_CALLBACK_KEY_DOWN:
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
case EVAS_CALLBACK_KEY_UP:
|
||||
{
|
||||
Evas_Event_Key_Up *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
case EVAS_CALLBACK_MOUSE_WHEEL:
|
||||
{
|
||||
Evas_Event_Mouse_Wheel *ev = event_info;
|
||||
event_flags = &(ev->event_flags);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
elm_widget_event_propagate(obj, type, event_info, event_flags);
|
||||
|
@ -271,21 +271,21 @@ _parent_focus(Evas_Object *obj)
|
|||
if (sd->focused) return;
|
||||
if (o)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
Evas_Object *ret;
|
||||
unsigned int i = 0;
|
||||
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
|
||||
focus_order *twice* while parent focusing */
|
||||
if (!ret || (!i) || (i != focus_order))
|
||||
_parent_focus(o);
|
||||
/* we don't want to bump a common widget ancestor's
|
||||
focus_order *twice* while parent focusing */
|
||||
if (!ret || (!i) || (i != focus_order))
|
||||
_parent_focus(o);
|
||||
}
|
||||
|
||||
if (!sd->focus_order_on_calc)
|
||||
return; /* we don't want to override it if by means of any of the
|
||||
callbacks below one gets to calculate our order
|
||||
first. */
|
||||
callbacks below one gets to calculate our order
|
||||
first. */
|
||||
|
||||
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;
|
||||
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->hover_obj) elm_widget_theme(sd->hover_obj);
|
||||
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;
|
||||
if (sd->is_mirrored != mirrored)
|
||||
{
|
||||
sd->is_mirrored = mirrored;
|
||||
elm_widget_theme(obj);
|
||||
sd->is_mirrored = mirrored;
|
||||
elm_widget_theme(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@ _elm_widget_mirrored_reload(Evas_Object *obj)
|
|||
Eina_Bool mirrored = elm_mirrored_get();
|
||||
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;
|
||||
if (sd->mirrored_auto_mode != automatic)
|
||||
{
|
||||
sd->mirrored_auto_mode = automatic;
|
||||
sd->mirrored_auto_mode = 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);
|
||||
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))
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE, _sub_obj_hide, sd);
|
||||
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");
|
||||
if (sobj_parent != obj)
|
||||
{
|
||||
static int abort_on_warn = -1;
|
||||
ERR("removing sub object %p from parent %p, "
|
||||
"but elm-parent is different %p!",
|
||||
sobj, obj, sobj_parent);
|
||||
if (EINA_UNLIKELY(abort_on_warn == -1))
|
||||
{
|
||||
if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
|
||||
else abort_on_warn = 0;
|
||||
}
|
||||
if (abort_on_warn == 1) abort();
|
||||
static int abort_on_warn = -1;
|
||||
ERR("removing sub object %p from parent %p, "
|
||||
"but elm-parent is different %p!",
|
||||
sobj, obj, sobj_parent);
|
||||
if (EINA_UNLIKELY(abort_on_warn == -1))
|
||||
{
|
||||
if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
|
||||
else abort_on_warn = 0;
|
||||
}
|
||||
if (abort_on_warn == 1) abort();
|
||||
}
|
||||
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))
|
||||
{
|
||||
|
@ -807,20 +807,20 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
// orphan previous resize obj
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
evas_object_clip_unset(sd->resize_obj);
|
||||
evas_object_data_del(sd->resize_obj, "elm-parent");
|
||||
if (_elm_widget_is(sd->resize_obj))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
evas_object_clip_unset(sd->resize_obj);
|
||||
evas_object_data_del(sd->resize_obj, "elm-parent");
|
||||
if (_elm_widget_is(sd->resize_obj))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_HIDE,
|
||||
_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);
|
||||
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);
|
||||
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_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;
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
if (_elm_widget_is(sd->resize_obj))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = obj;
|
||||
if (_elm_widget_is(sd->resize_obj))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = obj;
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE,
|
||||
_sub_obj_hide, sd);
|
||||
}
|
||||
evas_object_clip_set(sobj, evas_object_clip_get(obj));
|
||||
evas_object_smart_member_add(sobj, obj);
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
|
||||
}
|
||||
evas_object_clip_set(sobj, evas_object_clip_get(obj));
|
||||
evas_object_smart_member_add(sobj, obj);
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
|
||||
_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);
|
||||
_smart_reconfigure(sd);
|
||||
evas_object_data_set(sobj, "elm-parent", obj);
|
||||
evas_object_smart_callback_call(obj, "sub-object-add", sobj);
|
||||
_smart_reconfigure(sd);
|
||||
evas_object_data_set(sobj, "elm-parent", obj);
|
||||
evas_object_smart_callback_call(obj, "sub-object-add", sobj);
|
||||
if (_elm_widget_is(sobj))
|
||||
{
|
||||
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;
|
||||
if (sd->hover_obj)
|
||||
{
|
||||
evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del, sd);
|
||||
evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del, sd);
|
||||
}
|
||||
sd->hover_obj = sobj;
|
||||
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);
|
||||
_smart_reconfigure(sd);
|
||||
_smart_reconfigure(sd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -980,8 +980,8 @@ elm_widget_focused_object_get(const Evas_Object *obj)
|
|||
if (!sd->focused) return NULL;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, subobj)
|
||||
{
|
||||
Evas_Object *fobj = elm_widget_focused_object_get(subobj);
|
||||
if (fobj) return fobj;
|
||||
Evas_Object *fobj = elm_widget_focused_object_get(subobj);
|
||||
if (fobj) return fobj;
|
||||
}
|
||||
return (Evas_Object *)obj;
|
||||
}
|
||||
|
@ -1007,23 +1007,23 @@ elm_widget_parent_widget_get(const Evas_Object *obj)
|
|||
|
||||
if (_elm_widget_is(obj))
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return NULL;
|
||||
parent = sd->parent_obj;
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return NULL;
|
||||
parent = sd->parent_obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent = evas_object_data_get(obj, "elm-parent");
|
||||
if (!parent) parent = evas_object_smart_parent_get(obj);
|
||||
parent = evas_object_data_get(obj, "elm-parent");
|
||||
if (!parent) parent = evas_object_smart_parent_get(obj);
|
||||
}
|
||||
|
||||
while (parent)
|
||||
{
|
||||
Evas_Object *elm_parent;
|
||||
if (_elm_widget_is(parent)) break;
|
||||
elm_parent = evas_object_data_get(parent, "elm-parent");
|
||||
Evas_Object *elm_parent;
|
||||
if (_elm_widget_is(parent)) break;
|
||||
elm_parent = evas_object_data_get(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;
|
||||
}
|
||||
|
@ -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) ||
|
||||
(event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD)))
|
||||
return EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
parent = sd->parent_obj;
|
||||
}
|
||||
|
@ -1492,60 +1492,60 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
|||
{
|
||||
focus_order++;
|
||||
sd->focus_order = focus_order;
|
||||
sd->focused = EINA_TRUE;
|
||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||
sd->focused = EINA_TRUE;
|
||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||
}
|
||||
if (sd->focus_func)
|
||||
{
|
||||
sd->focus_func(obj);
|
||||
return;
|
||||
sd->focus_func(obj);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
if ((_is_focusable(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if ((_is_focusable(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if ((_is_focusable(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
if ((_is_focusable(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first)
|
||||
{
|
||||
if ((_is_focusable(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if ((_is_focusable(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if ((_is_focusable(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
if ((_is_focusable(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1562,19 +1562,19 @@ elm_widget_focused_object_clear(Evas_Object *obj)
|
|||
API_ENTRY return;
|
||||
if (!sd->focused) return;
|
||||
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
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sd->focused = EINA_FALSE;
|
||||
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;
|
||||
for (;;)
|
||||
{
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
sd = evas_object_smart_data_get(o);
|
||||
if (sd->focused) break;
|
||||
parent = o;
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
sd = evas_object_smart_data_get(o);
|
||||
if (sd->focused) break;
|
||||
parent = o;
|
||||
}
|
||||
if (!elm_widget_parent_get(parent))
|
||||
elm_widget_focused_object_clear(parent);
|
||||
else
|
||||
{
|
||||
parent = elm_widget_parent_get(parent);
|
||||
sd = evas_object_smart_data_get(parent);
|
||||
parent = elm_widget_parent_get(parent);
|
||||
sd = evas_object_smart_data_get(parent);
|
||||
if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj)))
|
||||
elm_widget_focused_object_clear(sd->resize_obj);
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_parent_focus(obj);
|
||||
return;
|
||||
|
@ -1649,15 +1649,15 @@ elm_widget_disabled_set(Evas_Object *obj, int disabled)
|
|||
sd->disabled = disabled;
|
||||
if (sd->focused)
|
||||
{
|
||||
Evas_Object *o, *parent;
|
||||
Evas_Object *o, *parent;
|
||||
|
||||
parent = obj;
|
||||
for (;;)
|
||||
{
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
parent = o;
|
||||
}
|
||||
parent = obj;
|
||||
for (;;)
|
||||
{
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
parent = o;
|
||||
}
|
||||
if (elm_widget_focus_get(obj))
|
||||
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->rh = h;
|
||||
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
|
||||
{
|
||||
|
@ -1766,7 +1766,7 @@ elm_widget_scroll_hold_push(Evas_Object *obj)
|
|||
API_ENTRY return;
|
||||
sd->scroll_hold++;
|
||||
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);
|
||||
// FIXME: on delete/reparent hold pop
|
||||
}
|
||||
|
@ -1778,7 +1778,7 @@ elm_widget_scroll_hold_pop(Evas_Object *obj)
|
|||
sd->scroll_hold--;
|
||||
if (sd->scroll_hold < 0) sd->scroll_hold = 0;
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1795,7 +1795,7 @@ elm_widget_scroll_freeze_push(Evas_Object *obj)
|
|||
API_ENTRY return;
|
||||
sd->scroll_freeze++;
|
||||
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);
|
||||
// FIXME: on delete/reparent freeze pop
|
||||
}
|
||||
|
@ -1807,7 +1807,7 @@ elm_widget_scroll_freeze_pop(Evas_Object *obj)
|
|||
sd->scroll_freeze--;
|
||||
if (sd->scroll_freeze < 0) sd->scroll_freeze = 0;
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1825,8 +1825,8 @@ elm_widget_scale_set(Evas_Object *obj, double scale)
|
|||
if (scale <= 0.0) scale = 0.0;
|
||||
if (sd->scale != scale)
|
||||
{
|
||||
sd->scale = scale;
|
||||
elm_widget_theme(obj);
|
||||
sd->scale = scale;
|
||||
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
|
||||
if (sd->scale == 0.0)
|
||||
{
|
||||
if (sd->parent_obj)
|
||||
return elm_widget_scale_get(sd->parent_obj);
|
||||
else
|
||||
return 1.0;
|
||||
if (sd->parent_obj)
|
||||
return elm_widget_scale_get(sd->parent_obj);
|
||||
else
|
||||
return 1.0;
|
||||
}
|
||||
return sd->scale;
|
||||
}
|
||||
|
@ -1865,9 +1865,9 @@ elm_widget_theme_get(const Evas_Object *obj)
|
|||
if (!sd->theme)
|
||||
{
|
||||
if (sd->parent_obj)
|
||||
return elm_widget_theme_get(sd->parent_obj);
|
||||
return elm_widget_theme_get(sd->parent_obj);
|
||||
else
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
return sd->theme;
|
||||
}
|
||||
|
@ -1878,7 +1878,7 @@ elm_widget_style_set(Evas_Object *obj, const char *style)
|
|||
API_ENTRY return;
|
||||
|
||||
if (eina_stringshare_replace(&sd->style, style))
|
||||
elm_widget_theme(obj);
|
||||
elm_widget_theme(obj);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
|
@ -1999,7 +1999,7 @@ elm_widget_type_check(const Evas_Object *obj, const char *type)
|
|||
{
|
||||
provided = evas_object_type_get(obj);
|
||||
if ((!provided) || (!provided[0]))
|
||||
provided = "(unknown)";
|
||||
provided = "(unknown)";
|
||||
}
|
||||
ERR("Passing Object: %p, of type: '%s' when expecting type: '%s'", obj, provided, expected);
|
||||
if (abort_on_warn == -1)
|
||||
|
@ -2030,19 +2030,19 @@ elm_widget_stringlist_get(const char *str)
|
|||
if (!str) return NULL;
|
||||
for (b = s = str; 1; s++)
|
||||
{
|
||||
if ((*s == ' ') || (!*s))
|
||||
{
|
||||
char *t = malloc(s - b + 1);
|
||||
if (t)
|
||||
{
|
||||
strncpy(t, b, s - b);
|
||||
t[s - b] = 0;
|
||||
list = eina_list_append(list, eina_stringshare_add(t));
|
||||
free(t);
|
||||
}
|
||||
b = s + 1;
|
||||
}
|
||||
if (!*s) break;
|
||||
if ((*s == ' ') || (!*s))
|
||||
{
|
||||
char *t = malloc(s - b + 1);
|
||||
if (t)
|
||||
{
|
||||
strncpy(t, b, s - b);
|
||||
t[s - b] = 0;
|
||||
list = eina_list_append(list, eina_stringshare_add(t));
|
||||
free(t);
|
||||
}
|
||||
b = s + 1;
|
||||
}
|
||||
if (!*s) break;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
@ -2264,8 +2264,8 @@ _elm_widget_item_tooltip_text_set(Elm_Widget_Item *item, const char *text)
|
|||
|
||||
text = eina_stringshare_add(text);
|
||||
_elm_widget_item_tooltip_content_cb_set
|
||||
(item, _elm_widget_item_tooltip_label_create, text,
|
||||
_elm_widget_item_tooltip_label_del_cb);
|
||||
(item, _elm_widget_item_tooltip_label_create, text,
|
||||
_elm_widget_item_tooltip_label_del_cb);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
elm_object_sub_tooltip_content_cb_set
|
||||
(item->view, item->widget, _elm_widget_item_tooltip_create, wit,
|
||||
_elm_widget_item_tooltip_del_cb);
|
||||
(item->view, item->widget, _elm_widget_item_tooltip_create, wit,
|
||||
_elm_widget_item_tooltip_del_cb);
|
||||
|
||||
return;
|
||||
|
||||
error_noitem:
|
||||
error_noitem:
|
||||
if (del_cb) del_cb((void *)data, NULL, item);
|
||||
return;
|
||||
error:
|
||||
error:
|
||||
if (del_cb) del_cb((void *)data, item->widget, item);
|
||||
}
|
||||
|
||||
|
@ -2507,12 +2507,12 @@ _smart_reconfigure(Smart_Data *sd)
|
|||
if (sd->resize_obj)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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 ((!best) || (!elm_widget_can_focus_get(best)))
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
@ -2593,25 +2593,25 @@ _smart_del(Evas_Object *obj)
|
|||
if (sd->del_pre_func) sd->del_pre_func(obj);
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
sobj = sd->resize_obj;
|
||||
sd->resize_obj = NULL;
|
||||
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_del(sobj);
|
||||
sobj = sd->resize_obj;
|
||||
sd->resize_obj = NULL;
|
||||
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_del(sobj);
|
||||
}
|
||||
if (sd->hover_obj)
|
||||
{
|
||||
sobj = sd->hover_obj;
|
||||
sd->hover_obj = NULL;
|
||||
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_del(sobj);
|
||||
sobj = sd->hover_obj;
|
||||
sd->hover_obj = NULL;
|
||||
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_del(sobj);
|
||||
}
|
||||
EINA_LIST_FREE(sd->subobjs, sobj)
|
||||
{
|
||||
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_del(sobj);
|
||||
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_del(sobj);
|
||||
}
|
||||
eina_list_free(sd->tooltips); /* should be empty anyway */
|
||||
eina_list_free(sd->cursors); /* should be empty anyway */
|
||||
|
@ -2739,9 +2739,9 @@ _smart_init(void)
|
|||
{
|
||||
if (_e_smart) return;
|
||||
{
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
SMART_NAME,
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
SMART_NAME,
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
|
@ -2759,8 +2759,8 @@ _smart_init(void)
|
|||
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;
|
||||
INTERNAL_ENTRY
|
||||
printf("+ %s(%p)\n", sd->type, obj);
|
||||
printf("+ %s(%p)\n", sd->type, obj);
|
||||
if (sd->resize_obj)
|
||||
_sub_obj_tree_dump(sd->resize_obj, lvl + 1);
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, obj)
|
||||
|
@ -2798,7 +2798,7 @@ _sub_obj_tree_dot_dump(const Evas_Object *obj, FILE *output)
|
|||
return;
|
||||
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 focused = elm_widget_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);
|
||||
|
||||
if (focused)
|
||||
fprintf(output, ", style=bold");
|
||||
fprintf(output, ", style=bold");
|
||||
|
||||
if (!visible)
|
||||
fprintf(output, ", fontcolor=gray28");
|
||||
fprintf(output, ", fontcolor=gray28");
|
||||
|
||||
if ((disabled) || (!visible))
|
||||
fprintf(output, ", color=gray");
|
||||
fprintf(output, ", color=gray");
|
||||
|
||||
|
||||
fprintf(output, " ];\n");
|
||||
|
|
|
@ -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_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
|
||||
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))) &&
|
||||
(child != obj))
|
||||
(child != obj))
|
||||
{
|
||||
evas_object_del(child);
|
||||
evas_object_del(child);
|
||||
}
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->client_message_handler)
|
||||
ecore_event_handler_del(win->client_message_handler);
|
||||
#endif
|
||||
// FIXME: Why are we flushing edje on every window destroy ??
|
||||
// edje_file_cache_flush();
|
||||
// edje_collection_cache_flush();
|
||||
// evas_image_cache_flush(win->evas);
|
||||
// evas_font_cache_flush(win->evas);
|
||||
// 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
|
||||
// FIXME: Why are we flushing edje on every window destroy ??
|
||||
// edje_file_cache_flush();
|
||||
// edje_collection_cache_flush();
|
||||
// evas_image_cache_flush(win->evas);
|
||||
// evas_font_cache_flush(win->evas);
|
||||
// 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
|
||||
|
||||
ecore_job_add(_deferred_ecore_evas_free, win->ee);
|
||||
_elm_win_deferred_free++;
|
||||
// ecore_evas_free(win->ee);
|
||||
// ecore_evas_free(win->ee);
|
||||
|
||||
_elm_win_focus_highlight_shutdown(win);
|
||||
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();
|
||||
evas_image_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 *win = data;
|
||||
|
||||
|
||||
if (ecore_evas_override_get(win->ee))
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
win->screen.x = x;
|
||||
win->screen.y = y;
|
||||
|
@ -333,8 +333,8 @@ _elm_win_resize_job(void *data)
|
|||
evas_object_resize(win->win_obj, w, h);
|
||||
EINA_LIST_FOREACH(win->subobjs, l, obj)
|
||||
{
|
||||
evas_object_move(obj, 0, 0);
|
||||
evas_object_resize(obj, w, h);
|
||||
evas_object_move(obj, 0, 0);
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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
|
||||
}
|
||||
|
@ -388,14 +388,14 @@ _elm_win_xwin_update(Elm_Win *win)
|
|||
_elm_win_xwindow_get(win);
|
||||
if (win->parent)
|
||||
{
|
||||
Elm_Win *win2;
|
||||
Elm_Win *win2;
|
||||
|
||||
win2 = elm_widget_data_get(win->parent);
|
||||
if (win2)
|
||||
{
|
||||
if (win->xwin)
|
||||
ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
|
||||
}
|
||||
win2 = elm_widget_data_get(win->parent);
|
||||
if (win2)
|
||||
{
|
||||
if (win->xwin)
|
||||
ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
|
||||
}
|
||||
}
|
||||
|
||||
if (!win->xwin) return; /* nothing more to do */
|
||||
|
@ -403,52 +403,52 @@ _elm_win_xwin_update(Elm_Win *win)
|
|||
switch (win->type)
|
||||
{
|
||||
case ELM_WIN_BASIC:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
|
||||
break;
|
||||
case ELM_WIN_DIALOG_BASIC:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
|
||||
break;
|
||||
case ELM_WIN_DESKTOP:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
|
||||
break;
|
||||
case ELM_WIN_DOCK:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
|
||||
break;
|
||||
case ELM_WIN_TOOLBAR:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
|
||||
break;
|
||||
case ELM_WIN_MENU:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
|
||||
break;
|
||||
case ELM_WIN_UTILITY:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
|
||||
break;
|
||||
case ELM_WIN_SPLASH:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
|
||||
break;
|
||||
case ELM_WIN_DROPDOWN_MENU:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
|
||||
break;
|
||||
case ELM_WIN_POPUP_MENU:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
|
||||
break;
|
||||
case ELM_WIN_TOOLTIP:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
|
||||
break;
|
||||
case ELM_WIN_NOTIFICATION:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
|
||||
break;
|
||||
case ELM_WIN_COMBO:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
|
||||
break;
|
||||
case ELM_WIN_DND:
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
|
||||
break;
|
||||
ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
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
|
||||
|
||||
|
@ -465,23 +465,23 @@ _elm_win_eval_subobjs(Evas_Object *obj)
|
|||
|
||||
EINA_LIST_FOREACH(win->subobjs, l, child)
|
||||
{
|
||||
evas_object_size_hint_weight_get(child, &wx, &wy);
|
||||
if (wx == 0.0) xx = 0;
|
||||
if (wy == 0.0) xy = 0;
|
||||
evas_object_size_hint_weight_get(child, &wx, &wy);
|
||||
if (wx == 0.0) xx = 0;
|
||||
if (wy == 0.0) xy = 0;
|
||||
|
||||
evas_object_size_hint_min_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
if (w > minw) minw = w;
|
||||
if (h > minh) minh = h;
|
||||
evas_object_size_hint_min_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
if (w > minw) minw = w;
|
||||
if (h > minh) minh = h;
|
||||
|
||||
evas_object_size_hint_max_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
if (maxw == -1) maxw = w;
|
||||
else if ((w > 0) && (w < maxw)) maxw = w;
|
||||
if (maxh == -1) maxh = h;
|
||||
else if ((h > 0) && (h < maxh)) maxh = h;
|
||||
evas_object_size_hint_max_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
if (maxw == -1) maxw = w;
|
||||
else if ((w > 0) && (w < maxw)) maxw = w;
|
||||
if (maxh == -1) maxh = h;
|
||||
else if ((h > 0) && (h < maxh)) maxh = h;
|
||||
}
|
||||
if (!xx) maxw = minw;
|
||||
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_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,
|
||||
_elm_win_focus_target_resize, win);
|
||||
_elm_win_focus_target_resize, win);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
|
||||
_elm_win_focus_target_del, win);
|
||||
_elm_win_focus_target_del, win);
|
||||
}
|
||||
|
||||
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_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,
|
||||
_elm_win_focus_target_resize, win);
|
||||
_elm_win_focus_target_resize, win);
|
||||
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 *
|
||||
|
@ -736,12 +736,12 @@ _elm_win_focus_highlight_shutdown(Elm_Win *win)
|
|||
win->focus_highlight.top = NULL;
|
||||
}
|
||||
|
||||
evas_event_callback_del_full(win->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
||||
_elm_win_object_focus_in, win);
|
||||
evas_event_callback_del_full(win->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
||||
_elm_win_object_focus_out, win);
|
||||
evas_event_callback_del_full(win->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
||||
_elm_win_object_focus_in, win);
|
||||
evas_event_callback_del_full(win->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
||||
_elm_win_object_focus_out, win);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
return;
|
||||
return;
|
||||
|
||||
|
||||
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) \
|
||||
if (!win->ee) \
|
||||
do { \
|
||||
CRITICAL(engine " engine creation failed. Trying software X11."); \
|
||||
win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
|
||||
} while (0)
|
||||
do { \
|
||||
CRITICAL(engine " engine creation failed. Trying software X11."); \
|
||||
win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
|
||||
} while (0)
|
||||
|
||||
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
|
||||
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
|
||||
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
|
||||
}
|
||||
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");
|
||||
}
|
||||
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))
|
||||
{
|
||||
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");
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
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
|
||||
}
|
||||
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");
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
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
|
||||
}
|
||||
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");
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
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
|
||||
}
|
||||
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");
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
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
|
||||
}
|
||||
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");
|
||||
}
|
||||
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");
|
||||
}
|
||||
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");
|
||||
}
|
||||
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");
|
||||
}
|
||||
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");
|
||||
}
|
||||
#undef FALLBACK_TRY
|
||||
|
||||
if (!win->ee)
|
||||
{
|
||||
ERR("Cannot create window.");
|
||||
free(win);
|
||||
return NULL;
|
||||
ERR("Cannot create window.");
|
||||
free(win);
|
||||
return NULL;
|
||||
}
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
_elm_win_xwindow_get(win);
|
||||
#endif
|
||||
if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
|
||||
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
|
||||
// is filled/ready by app
|
||||
// ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
|
||||
// bg pixmap done by x - has other issues like can be redrawn by x before it
|
||||
// is filled/ready by app
|
||||
// ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
|
||||
|
||||
win->type = type;
|
||||
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,
|
||||
_elm_win_obj_intercept_show, win);
|
||||
ecore_evas_object_associate(win->ee, win->win_obj,
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
|
||||
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,
|
||||
_elm_win_obj_callback_del, win);
|
||||
_elm_win_obj_callback_del, win);
|
||||
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_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_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
|
||||
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)
|
||||
evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
|
||||
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))
|
||||
{
|
||||
ecore_evas_fullscreen_set(win->ee, 1);
|
||||
ecore_evas_fullscreen_set(win->ee, 1);
|
||||
}
|
||||
#undef ENGINE_COMPARE
|
||||
|
||||
|
@ -1413,16 +1413,16 @@ elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
|
|||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->xwin)
|
||||
{
|
||||
if (alpha)
|
||||
{
|
||||
if (!_elm_config->compositing)
|
||||
elm_win_shaped_set(obj, alpha);
|
||||
else
|
||||
ecore_evas_alpha_set(win->ee, alpha);
|
||||
}
|
||||
else
|
||||
ecore_evas_alpha_set(win->ee, alpha);
|
||||
_elm_win_xwin_update(win);
|
||||
if (alpha)
|
||||
{
|
||||
if (!_elm_config->compositing)
|
||||
elm_win_shaped_set(obj, alpha);
|
||||
else
|
||||
ecore_evas_alpha_set(win->ee, alpha);
|
||||
}
|
||||
else
|
||||
ecore_evas_alpha_set(win->ee, alpha);
|
||||
_elm_win_xwin_update(win);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -1466,8 +1466,8 @@ elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
|
|||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->xwin)
|
||||
{
|
||||
ecore_evas_transparent_set(win->ee, transparent);
|
||||
_elm_win_xwin_update(win);
|
||||
ecore_evas_transparent_set(win->ee, transparent);
|
||||
_elm_win_xwin_update(win);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -1552,14 +1552,14 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
|
|||
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
|
||||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
|
||||
{
|
||||
// these engines... can ONLY be fullscreen
|
||||
return;
|
||||
// these engines... can ONLY be fullscreen
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ecore_evas_fullscreen_set(win->ee, fullscreen);
|
||||
ecore_evas_fullscreen_set(win->ee, fullscreen);
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
_elm_win_xwin_update(win);
|
||||
_elm_win_xwin_update(win);
|
||||
#endif
|
||||
}
|
||||
#undef ENGINE_COMPARE
|
||||
|
@ -1585,12 +1585,12 @@ elm_win_fullscreen_get(const Evas_Object *obj)
|
|||
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
|
||||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
|
||||
{
|
||||
// these engines... can ONLY be fullscreen
|
||||
return EINA_TRUE;
|
||||
// these engines... can ONLY be fullscreen
|
||||
return EINA_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ecore_evas_fullscreen_get(win->ee);
|
||||
return ecore_evas_fullscreen_get(win->ee);
|
||||
}
|
||||
#undef ENGINE_COMPARE
|
||||
}
|
||||
|
@ -1860,7 +1860,7 @@ elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
|
|||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->xwin)
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -2203,23 +2203,23 @@ elm_win_quickpanel_zone_get(const Evas_Object *obj)
|
|||
|
||||
/**
|
||||
* Set the window to be skipped by keyboard focus
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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,
|
||||
* otherwise it may have no effect.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
* Be careful that this may have side-effects like making the window
|
||||
* non-accessible in some cases unless the window is specially handled. Use
|
||||
* this with care.
|
||||
*
|
||||
*
|
||||
* @param obj The window object
|
||||
* @param skip The skip flag state (EINA_TRUE if it is to be skipped)
|
||||
*
|
||||
*
|
||||
* @ingroup Win
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -2236,7 +2236,7 @@ elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
|
|||
if (win->xwin)
|
||||
{
|
||||
Ecore_X_Window_State states[2];
|
||||
|
||||
|
||||
ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
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
|
||||
*
|
||||
*
|
||||
* This is intended to work in touchscreen or small screen device environments
|
||||
* where there is a more simplistic window management policy in place. This
|
||||
* 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
|
||||
* 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 command The command to send
|
||||
* @param params Optional parameters for the command
|
||||
*
|
||||
*
|
||||
* @ingroup Win
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -2275,19 +2275,19 @@ elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *
|
|||
switch (command)
|
||||
{
|
||||
case ELM_ILLUME_COMMAND_FOCUS_BACK:
|
||||
ecore_x_e_illume_focus_back_send(win->xwin);
|
||||
break;
|
||||
ecore_x_e_illume_focus_back_send(win->xwin);
|
||||
break;
|
||||
case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
|
||||
ecore_x_e_illume_focus_forward_send(win->xwin);
|
||||
break;
|
||||
ecore_x_e_illume_focus_forward_send(win->xwin);
|
||||
break;
|
||||
case ELM_ILLUME_COMMAND_FOCUS_HOME:
|
||||
ecore_x_e_illume_focus_home_send(win->xwin);
|
||||
break;
|
||||
ecore_x_e_illume_focus_home_send(win->xwin);
|
||||
break;
|
||||
case ELM_ILLUME_COMMAND_CLOSE:
|
||||
ecore_x_e_illume_close_send(win->xwin);
|
||||
break;
|
||||
ecore_x_e_illume_close_send(win->xwin);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2470,10 +2470,10 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
|||
Evas_Object *sub = event_info;
|
||||
if (sub == wd->content)
|
||||
{
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2560,10 +2560,10 @@ elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
wd->content = content;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -13,33 +13,33 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
|
|||
minh = 0;
|
||||
if (homogeneous)
|
||||
{
|
||||
EINA_LIST_FOREACH(priv->children, l, opt)
|
||||
{
|
||||
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
|
||||
if (minh < mnh) minh = mnh;
|
||||
if (minw < mnw) minw = mnw;
|
||||
}
|
||||
if (horizontal)
|
||||
EINA_LIST_FOREACH(priv->children, l, opt)
|
||||
{
|
||||
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
|
||||
if (minh < mnh) minh = mnh;
|
||||
if (minw < mnw) minw = mnw;
|
||||
}
|
||||
if (horizontal)
|
||||
minw *= eina_list_count(priv->children);
|
||||
else
|
||||
else
|
||||
minh *= eina_list_count(priv->children);
|
||||
}
|
||||
else
|
||||
{
|
||||
EINA_LIST_FOREACH(priv->children, l, opt)
|
||||
{
|
||||
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
|
||||
if (horizontal)
|
||||
{
|
||||
if (minh < mnh) minh = mnh;
|
||||
minw += mnw;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minw < mnw) minw = mnw;
|
||||
minh += mnh;
|
||||
}
|
||||
}
|
||||
EINA_LIST_FOREACH(priv->children, l, opt)
|
||||
{
|
||||
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
|
||||
if (horizontal)
|
||||
{
|
||||
if (minh < mnh) minh = mnh;
|
||||
minw += mnw;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minw < mnw) minw = mnw;
|
||||
minh += mnh;
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
if (w < minw)
|
||||
{
|
||||
x = x + ((w - minw) * (1.0 - ax));
|
||||
w = minw;
|
||||
x = x + ((w - minw) * (1.0 - ax));
|
||||
w = minw;
|
||||
}
|
||||
if (h < minh)
|
||||
{
|
||||
y = y + ((h - minh) * (1.0 - ay));
|
||||
h = minh;
|
||||
y = y + ((h - minh) * (1.0 - ay));
|
||||
h = minh;
|
||||
}
|
||||
EINA_LIST_FOREACH(priv->children, l, opt)
|
||||
{
|
||||
double wx, wy;
|
||||
|
||||
evas_object_size_hint_weight_get(opt->obj, &wx, &wy);
|
||||
if (horizontal)
|
||||
{
|
||||
if (wx > 0.0) expand++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wy > 0.0) expand++;
|
||||
}
|
||||
evas_object_size_hint_weight_get(opt->obj, &wx, &wy);
|
||||
if (horizontal)
|
||||
{
|
||||
if (wx > 0.0) expand++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wy > 0.0) expand++;
|
||||
}
|
||||
}
|
||||
if (!expand)
|
||||
{
|
||||
evas_object_size_hint_align_get(o, &ax, &ay);
|
||||
if (horizontal)
|
||||
{
|
||||
x += (double)(w - minw) * ax;
|
||||
w = minw;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += (double)(h - minh) * ay;
|
||||
h = minh;
|
||||
}
|
||||
evas_object_size_hint_align_get(o, &ax, &ay);
|
||||
if (horizontal)
|
||||
{
|
||||
x += (double)(w - minw) * ax;
|
||||
w = minw;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += (double)(h - minh) * ay;
|
||||
h = minh;
|
||||
}
|
||||
}
|
||||
wdif = w - minw;
|
||||
hdif = h - minh;
|
||||
|
@ -110,36 +110,36 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
|
|||
double wx, wy;
|
||||
int fw, fh, xw, xh;
|
||||
|
||||
obj = opt->obj;
|
||||
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||
fw = fh = 0;
|
||||
xw = xh = 0;
|
||||
if (ax == -1.0) {fw = 1; ax = 0.5;}
|
||||
if (ay == -1.0) {fh = 1; ay = 0.5;}
|
||||
if (wx > 0.0) xw = 1;
|
||||
if (wy > 0.0) xh = 1;
|
||||
if (horizontal)
|
||||
{
|
||||
obj = opt->obj;
|
||||
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||
fw = fh = 0;
|
||||
xw = xh = 0;
|
||||
if (ax == -1.0) {fw = 1; ax = 0.5;}
|
||||
if (ay == -1.0) {fh = 1; ay = 0.5;}
|
||||
if (wx > 0.0) xw = 1;
|
||||
if (wy > 0.0) xh = 1;
|
||||
if (horizontal)
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
if (homogeneous)
|
||||
{
|
||||
ww = (w / (Evas_Coord)count);
|
||||
}
|
||||
else
|
||||
{
|
||||
ww = mnw;
|
||||
if ((expand > 0) && (xw))
|
||||
{
|
||||
if (expand == 1) ow = wdif;
|
||||
else ow = (w - minw) / expand;
|
||||
wdif -= ow;
|
||||
ww += ow;
|
||||
}
|
||||
}
|
||||
if (homogeneous)
|
||||
{
|
||||
ww = (w / (Evas_Coord)count);
|
||||
}
|
||||
else
|
||||
{
|
||||
ww = mnw;
|
||||
if ((expand > 0) && (xw))
|
||||
{
|
||||
if (expand == 1) ow = wdif;
|
||||
else ow = (w - minw) / expand;
|
||||
wdif -= ow;
|
||||
ww += ow;
|
||||
}
|
||||
}
|
||||
hh = h;
|
||||
ow = mnw;
|
||||
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 ((mxh >= 0) && (mxh < oh)) oh = mxh;
|
||||
evas_object_move(obj,
|
||||
((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
|
||||
+ (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||
((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
|
||||
+ (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||
evas_object_resize(obj, ow, oh);
|
||||
xx += ww;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
if (homogeneous)
|
||||
{
|
||||
hh = (h / (Evas_Coord)count);
|
||||
}
|
||||
else
|
||||
{
|
||||
hh = mnh;
|
||||
if ((expand > 0) && (xh))
|
||||
{
|
||||
if (expand == 1) oh = hdif;
|
||||
else oh = (h - minh) / expand;
|
||||
hdif -= oh;
|
||||
hh += oh;
|
||||
}
|
||||
}
|
||||
if (homogeneous)
|
||||
{
|
||||
hh = (h / (Evas_Coord)count);
|
||||
}
|
||||
else
|
||||
{
|
||||
hh = mnh;
|
||||
if ((expand > 0) && (xh))
|
||||
{
|
||||
if (expand == 1) oh = hdif;
|
||||
else oh = (h - minh) / expand;
|
||||
hdif -= oh;
|
||||
hh += oh;
|
||||
}
|
||||
}
|
||||
ww = w;
|
||||
ow = mnw;
|
||||
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 ((mxh >= 0) && (mxh < oh)) oh = mxh;
|
||||
evas_object_move(obj,
|
||||
xx + (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||
xx + (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||
evas_object_resize(obj, ow, oh);
|
||||
yy += hh;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue