snippet: Add a 'replace' string

If present, the 'replace' string will be used instead of whatever code
would normally be invoked for that hook point. It will also replace
any previous snippets.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts
2011-11-25 14:36:31 +00:00
committed by Robert Bragg
parent 0fdd5690c6
commit 717e96b304
7 changed files with 110 additions and 4 deletions

View File

@ -154,6 +154,42 @@ cogl_snippet_set_pre (CoglSnippet *snippet,
const char *
cogl_snippet_get_pre (CoglSnippet *snippet);
#define cogl_snippet_set_replace cogl_snippet_set_replace_EXP
/**
* cogl_snippet_set_replace:
* @snippet: A #CoglSnippet
* @replace: The new source string for the replace section of this snippet.
*
* Sets a source string that will be used instead of any generated
* source code or any previous snippets for this hook point. Please
* see the documentation of each hook point in #CoglPipeline for a
* description of how this string should be used.
*
* This function should only be called before the snippet is attached
* to its first pipeline. After that the snippet should be considered
* immutable.
*
* Since: 1.10
* Stability: Unstable
*/
void
cogl_snippet_set_replace (CoglSnippet *snippet,
const char *replace);
#define cogl_snippet_get_replace cogl_snippet_get_replace_EXP
/**
* cogl_snippet_get_replace:
* @snippet: A #CoglSnippet
*
* Return value: the source string that was set with
* cogl_snippet_set_replace() or %NULL if none was set.
*
* Since: 1.10
* Stability: Unstable
*/
const char *
cogl_snippet_get_replace (CoglSnippet *snippet);
#define cogl_snippet_set_post cogl_snippet_set_post_EXP
/**
* cogl_snippet_set_post: