void _cogl_pango_glyph_cache_add_reorganize_callback (CoglPangoGlyphCache *cache, GHookFunc func, void *user_data) { GHook *hook = g_hook_alloc (&cache->reorganize_callbacks); hook->func = func; hook->data = user_data; g_hook_prepend (&cache->reorganize_callbacks, hook); }
void _cogl_atlas_add_reorganize_callback (CoglAtlas *atlas, GHookFunc pre_callback, GHookFunc post_callback, void *user_data) { if (pre_callback) { GHook *hook = g_hook_alloc (&atlas->post_reorganize_callbacks); hook->func = pre_callback; hook->data = user_data; g_hook_prepend (&atlas->pre_reorganize_callbacks, hook); } if (post_callback) { GHook *hook = g_hook_alloc (&atlas->pre_reorganize_callbacks); hook->func = post_callback; hook->data = user_data; g_hook_prepend (&atlas->post_reorganize_callbacks, hook); } }
/* prefs_add_notifier: * registers pref change notifier */ void prefs_add_notifier(const gchar * pref_name, GHookFunc func) { GHook * hook; struct prefs_value * value; const gchar * value_key; gboolean found_pref; found_pref = g_hash_table_lookup_extended( prefs_hash, pref_name, (gpointer*)&value_key, (gpointer*)&value); g_assert(found_pref); /* setup new hook for this preference */ hook = g_hook_alloc(&value->change_hook); hook->func = func; hook->data = (gpointer)value_key; g_hook_prepend(&value->change_hook, hook); }