4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2011 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see
20 * <http://www.gnu.org/licenses/>.
25 * Neil Roberts <neil@linux.intel.com>
28 #ifndef __COGL_PIPELINE_SNIPPET_PRIVATE_H
29 #define __COGL_PIPELINE_SNIPPET_PRIVATE_H
31 #include "cogl-snippet.h"
32 #include "cogl-queue.h"
34 typedef struct _CoglPipelineSnippet CoglPipelineSnippet;
36 COGL_LIST_HEAD (CoglPipelineSnippetList, CoglPipelineSnippet);
38 struct _CoglPipelineSnippet
40 COGL_LIST_ENTRY (CoglPipelineSnippet) list_node;
45 /* Arguments to pass to _cogl_pipeline_snippet_generate_code() */
48 CoglPipelineSnippetList *snippets;
50 /* Only snippets at this hook point will be used */
53 /* The final function to chain on to after all of the snippets code
55 const char *chain_function;
57 /* The name of the final generated function */
58 const char *final_name;
60 /* A prefix to insert before each generate function name */
61 const char *function_prefix;
63 /* The return type of all of the functions, or NULL to use void */
64 const char *return_type;
66 /* A variable to return from the functions. The snippets are
67 expected to modify this variable. Ignored if return_type is
69 const char *return_variable;
71 /* If this is TRUE then it won't allocate a separate variable for
72 the return value. Instead it is expected that the snippet will
73 modify one of the argument variables directly and that will be
75 gboolean return_variable_is_argument;
77 /* The argument names or NULL if there are none */
78 const char *arguments;
80 /* The argument types or NULL */
81 const char *argument_declarations;
83 /* The string to generate the source into */
85 } CoglPipelineSnippetData;
88 _cogl_pipeline_snippet_generate_code (const CoglPipelineSnippetData *data);
91 _cogl_pipeline_snippet_list_free (CoglPipelineSnippetList *list);
94 _cogl_pipeline_snippet_list_add (CoglPipelineSnippetList *list,
95 CoglSnippet *snippet);
98 _cogl_pipeline_snippet_list_copy (CoglPipelineSnippetList *dst,
99 const CoglPipelineSnippetList *src);
102 _cogl_pipeline_snippet_list_hash (CoglPipelineSnippetList *list,
106 _cogl_pipeline_snippet_list_equal (CoglPipelineSnippetList *list0,
107 CoglPipelineSnippetList *list1);
109 #endif /* __COGL_PIPELINE_SNIPPET_PRIVATE_H */