2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script.c (resolve_alpha_func): Fix the ClutterAlphaFunc resolution function.
This commit is contained in:
parent
b1ed23e0df
commit
475fcc64a7
@ -1,3 +1,8 @@
|
||||
2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-script.c (resolve_alpha_func): Fix the
|
||||
ClutterAlphaFunc resolution function.
|
||||
|
||||
2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* tests/Makefile.am:
|
||||
|
@ -187,6 +187,8 @@ resolve_alpha_func (const gchar *name)
|
||||
if (!module)
|
||||
module = g_module_open (NULL, 0);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT, "Looking for `%s' alpha function", name);
|
||||
|
||||
if (g_module_symbol (module, name, (gpointer) &func))
|
||||
return func;
|
||||
|
||||
@ -195,21 +197,18 @@ resolve_alpha_func (const gchar *name)
|
||||
for (i = 0; name[i] != '\0'; i++)
|
||||
{
|
||||
c = name[i];
|
||||
/* skip if uppercase, first or previous is uppercase */
|
||||
if ((c == '-') ||
|
||||
(c == g_ascii_toupper (c) &&
|
||||
i > 0 && name[i-1] != g_ascii_toupper (name[i-1])) ||
|
||||
(i > 2 && name[i] == g_ascii_toupper (name[i]) &&
|
||||
name[i-1] == g_ascii_toupper (name[i-1]) &&
|
||||
name[i-2] == g_ascii_toupper (name[i-2])))
|
||||
g_string_append_c (symbol_name, '_');
|
||||
|
||||
g_string_append_c (symbol_name, g_ascii_tolower (c));
|
||||
if (name[i] == '-')
|
||||
g_string_append_c (symbol_name, '_');
|
||||
else
|
||||
g_string_append_c (symbol_name, g_ascii_tolower (name[i]));
|
||||
}
|
||||
g_string_append (symbol_name, "_func");
|
||||
|
||||
symbol = g_string_free (symbol_name, FALSE);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT, "Looking for `%s' alpha function", symbol);
|
||||
|
||||
if (!g_module_symbol (module, symbol, (gpointer)&func))
|
||||
func = NULL;
|
||||
|
||||
|
@ -32,7 +32,7 @@ static const gchar *test_behaviour =
|
||||
" \"opacity-end\" : 0,"
|
||||
" \"alpha\" : {"
|
||||
" \"timeline\" : \"main-timeline\","
|
||||
" \"function\" : \"ramp\""
|
||||
" \"function\" : \"ramp-inc\""
|
||||
" }"
|
||||
" }"
|
||||
"]";
|
||||
|
Loading…
Reference in New Issue
Block a user