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 e90eda658220809b70c37e954d2624e3cfdcd5ea (commit) from aaa7f50197c97d3b9b7f5d30cbe1f91c51f52384 (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/e90eda658220809b70c37e954d2624e3cfdcd...
commit e90eda658220809b70c37e954d2624e3cfdcd5ea Author: Cyril Hrubis metan@ucw.cz Date: Sat Nov 10 17:27:32 2012 +0100
doc: Move ProgressCallback to core, add example.
diff --git a/doc/basic_types.txt b/doc/basic_types.txt index f02688a..1542083 100644 --- a/doc/basic_types.txt +++ b/doc/basic_types.txt @@ -88,33 +88,3 @@ void GP_ColorLoadContextPixels(GP_Pixel pixels[], GP_Context *context); Loads array of 'GP_Pixel' of size 'GP_COL_MAX', the array is then used with the GP_Color enum as 'pixels[GP_COL_BLACK]'.
-Progress Callback -~~~~~~~~~~~~~~~~~ - -The 'GP_ProgressCallback' is a structure that stores user-defined callback -function and user-defined pointer and percentage. - -It is passed as last parameter to functions that would take some time to -complete and adds capability to track the operation progress as well as to -abort the operation. - -Currently it's used for filters and loaders. - -[source,c] -------------------------------------------------------------------------------- -typdedef struct GP_ProgressCallback { - float percentage; - int (*callback)(struct GP_ProgressCallback *self); - void *priv; -} GP_ProgressCallback; -------------------------------------------------------------------------------- - -If non 'NULL' progress callback structure is passed to a function, the -callback function is periodically called and the percentage is updated. - -The return value from callback could abort the function execution. If non zero -value is returned operation is aborted, all memory freed etc. and in case of -bitmap loaders 'errno' is set to 'ECANCELED'. - -The callback, if supported, is the last parameter of a function. - diff --git a/doc/core.txt b/doc/core.txt index fdb8056..3e20ee2 100644 --- a/doc/core.txt +++ b/doc/core.txt @@ -56,6 +56,39 @@ Value clamping macros.
NOTE: this header is not included by including the 'GP.h' header.
+Progress Callback +~~~~~~~~~~~~~~~~~ + +The 'GP_ProgressCallback' is a structure that stores user-defined callback +function and user-defined pointer and percentage. + +It is passed as last parameter to functions that would take some time to +complete and adds capability to track the operation progress as well as to +abort the operation. + +Currently it's used for filters and loaders. + +[source,c] +------------------------------------------------------------------------------- +typdedef struct GP_ProgressCallback { + float percentage; + int (*callback)(struct GP_ProgressCallback *self); + void *priv; +} GP_ProgressCallback; +------------------------------------------------------------------------------- + +If non 'NULL' progress callback structure is passed to a function, the +callback function is periodically called and the percentage is updated. + +The return value from callback could abort the function execution. If non zero +value is returned operation is aborted, all memory freed etc. and in case of +bitmap loaders 'errno' is set to 'ECANCELED'. + +The callback, if supported, is the last parameter of a function. + +For example usage see progress callback +link:example_loaders_progress_callback.html[example]. + Temporary Buffer Allocator ~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/example_loaders_progress_callback.txt b/doc/example_loaders_progress_callback.txt new file mode 100644 index 0000000..7da5160 --- /dev/null +++ b/doc/example_loaders_progress_callback.txt @@ -0,0 +1,7 @@ +Graphics Backend Example +------------------------ + +[source,c] +------------------------------------------------------------------ +include::../demos/c_simple/loaders.c[] +------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes: doc/basic_types.txt | 30 ------------------ doc/core.txt | 33 ++++++++++++++++++++ ...d.txt => example_loaders_progress_callback.txt} | 2 +- 3 files changed, 34 insertions(+), 31 deletions(-) copy doc/{example_backend.txt => example_loaders_progress_callback.txt} (80%)
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.