This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via a2f97569d98cda1ac080fbe73de4fa58fa5ae10b (commit) from a2550171ddb5623635256c50ffa60e5e20d6b2dd (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/a2f97569d98cda1ac080fbe73de4fa58fa5ae...
commit a2f97569d98cda1ac080fbe73de4fa58fa5ae10b Author: Cyril Hrubis metan@ucw.cz Date: Fri Nov 4 13:05:07 2011 +0100
Move the progress callback to the core.
diff --git a/include/filters/GP_Filter.h b/include/core/GP_ProgressCallback.h similarity index 87% copy from include/filters/GP_Filter.h copy to include/core/GP_ProgressCallback.h index 74637ab..72857ce 100644 --- a/include/filters/GP_Filter.h +++ b/include/core/GP_ProgressCallback.h @@ -22,20 +22,23 @@
/*
- Common filters typedefs and includes. + Progress callback implementation.
- */ + Progress callbacks serves two purposes + + - ability to visibly show algorithm progress + - ability to correctly abort operation in the middle of processing
-#ifndef GP_FILTERS_FILTER_H -#define GP_FILTERS_FILTER_H + */
-#include "core/GP_Context.h" +#ifndef CORE_GP_PROGRESSCALLBACK_H +#define CORE_GP_PROGRESSCALLBACK_H
/* * Progress callback * * Non zero return value from callback will abort current operation - * free memory and return NULL from filter. + * free memory and return NULL from filter/loader... */ typedef struct GP_ProgressCallback { float percentage; @@ -66,4 +69,4 @@ static inline void GP_ProgressCallbackDone(GP_ProgressCallback *callback) callback->callback(callback); }
-#endif /* FILTERS_GP_FILTER_H */ +#endif /* CORE_GP_PROGRESSCALBACK_H */ diff --git a/include/filters/GP_Filter.h b/include/filters/GP_Filter.h index 74637ab..e986ae6 100644 --- a/include/filters/GP_Filter.h +++ b/include/filters/GP_Filter.h @@ -26,44 +26,10 @@
*/
-#ifndef GP_FILTERS_FILTER_H -#define GP_FILTERS_FILTER_H +#ifndef FILTERS_GP_FILTER_H +#define FILTERS_GP_FILTER_H
#include "core/GP_Context.h" - -/* - * Progress callback - * - * Non zero return value from callback will abort current operation - * free memory and return NULL from filter. - */ -typedef struct GP_ProgressCallback { - float percentage; - int (*callback)(struct GP_ProgressCallback *self); - void *priv; -} GP_ProgressCallback; - -static inline int GP_ProgressCallbackReport(GP_ProgressCallback *callback, - unsigned int val, unsigned int max, - unsigned int mul __attribute__((unused))) -{ - if (callback == NULL) - return 0; - - if (val % 100) - return 0; - - callback->percentage = 100.00 * val / max; - return callback->callback(callback); -} - -static inline void GP_ProgressCallbackDone(GP_ProgressCallback *callback) -{ - if (callback == NULL) - return; - - callback->percentage = 100; - callback->callback(callback); -} +#include "core/GP_ProgressCallback.h"
#endif /* FILTERS_GP_FILTER_H */
-----------------------------------------------------------------------
Summary of changes: .../GP_Filter.h => core/GP_ProgressCallback.h} | 17 +++++--- include/filters/GP_Filter.h | 40 +------------------ 2 files changed, 13 insertions(+), 44 deletions(-) copy include/{filters/GP_Filter.h => core/GP_ProgressCallback.h} (87%)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.