summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-01-04 21:06:36 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2013-01-05 16:46:28 +0000
commitb174f9e3b9a2f4e40d5b796c70d078aa8173176b (patch)
tree030099a332a65c49474d8b8ed5d0f25f5602d3b5
parent2e52a968183061ab509be5603ce4b025da39c5f5 (diff)
downloadcogl-b174f9e3b9a2f4e40d5b796c70d078aa8173176b.tar.gz
cogl-sharp: Comment a bit our method generation code
-rwxr-xr-xcogl-sharp/parse-gir.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py
index 073ee236..abc0d30c 100755
--- a/cogl-sharp/parse-gir.py
+++ b/cogl-sharp/parse-gir.py
@@ -334,10 +334,29 @@ def generate_method(node, overrides, fo):
return_str = 'return ' if (cs_return_value != 'void') else ''
+ # native symbol declaration
fo.write(" [DllImport(\"cogl2.dll\")]\n")
fo.write(" public static extern %s %s(%s);\n\n" %
(native_return_value, native_method_name, ", ".join(native_params)))
+ # C# wrapper
+ #
+ # We support 2 types of functions:
+ #
+ # 1. simple wrappers (can return values as well)
+ #
+ # public void SetColor(ref Color color)
+ # {
+ # cogl_pipeline_set_color(handle, ref color);
+ # }
+ #
+ # 2. functions that return an object we need to wrap in a C# instance
+ #
+ # public Texture GetLayerTexture(int layer_index)
+ # {
+ # IntPtr p = cogl_pipeline_get_layer_texture(handle, layer_index);
+ # return new Texture(p);
+ # }
fo.write(" public %s %s(%s)\n" %
(cs_return_value, cs_method_name, ", ".join(cs_params)))
fo.write(" {\n")