return the user_data pointer on uninstall. Eases language binding work.

2004-08-30  Manish Singh  <yosh@gimp.org>

        * libgimp/gimpprogress.[ch] (gimp_progress_uninstall): return the
        user_data pointer on uninstall. Eases language binding work.
This commit is contained in:
Manish Singh 2004-08-30 18:36:43 +00:00 committed by Manish Singh
parent 5d720209ae
commit 13d9596812
3 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2004-08-30 Manish Singh <yosh@gimp.org>
* libgimp/gimpprogress.[ch] (gimp_progress_uninstall): return the
user_data pointer on uninstall. Eases language binding work.
2004-08-30 Sven Neumann <sven@gimp.org> 2004-08-30 Sven Neumann <sven@gimp.org>
* libgimp/gimpbrushmenu.c (gimp_brush_select_preview_draw): fixed * libgimp/gimpbrushmenu.c (gimp_brush_select_preview_draw): fixed

View file

@ -123,26 +123,31 @@ gimp_progress_install (GimpProgressStartCallback start_callback,
return NULL; return NULL;
} }
void gpointer
gimp_progress_uninstall (const gchar *progress_callback) gimp_progress_uninstall (const gchar *progress_callback)
{ {
GimpProgressData *progress_data; GimpProgressData *progress_data;
gpointer user_data;
g_return_if_fail (progress_callback != NULL); g_return_val_if_fail (progress_callback != NULL, NULL);
g_return_if_fail (gimp_progress_ht != NULL); g_return_val_if_fail (gimp_progress_ht != NULL, NULL);
progress_data = g_hash_table_lookup (gimp_progress_ht, progress_callback); progress_data = g_hash_table_lookup (gimp_progress_ht, progress_callback);
if (! progress_data) if (! progress_data)
{ {
g_warning ("Can't find internal progress data"); g_warning ("Can't find internal progress data");
return; return NULL;
} }
_gimp_progress_uninstall (progress_callback); _gimp_progress_uninstall (progress_callback);
gimp_uninstall_temp_proc (progress_callback); gimp_uninstall_temp_proc (progress_callback);
user_data = progress_data->data;
g_hash_table_remove (gimp_progress_ht, progress_callback); g_hash_table_remove (gimp_progress_ht, progress_callback);
return user_data;
} }

View file

@ -40,7 +40,7 @@ const gchar * gimp_progress_install (GimpProgressStartCallback start_callback,
GimpProgressTextCallback text_callback, GimpProgressTextCallback text_callback,
GimpProgressValueCallback value_callback, GimpProgressValueCallback value_callback,
gpointer user_data); gpointer user_data);
void gimp_progress_uninstall (const gchar *progress_callback); gpointer gimp_progress_uninstall (const gchar *progress_callback);
G_END_DECLS G_END_DECLS