[cogl/wip/cogl-sharp: 41/51] cogl-sharp: Add Context to the list of known types



commit 7e42974ec072355d1a59747115899db058d7bd30
Author: Damien Lespiau <damien lespiau intel com>
Date:   Sun Nov 4 00:47:35 2012 +0000

    cogl-sharp: Add Context to the list of known types
    
    This allows to generate Framebuffer.GetContext()

 cogl-sharp/Context.cs      |    2 +-
 cogl-sharp/Makefile.am     |    1 +
 cogl-sharp/_Context.cs     |   10 ++++++++++
 cogl-sharp/_FrameBuffer.cs |    9 +++++++++
 cogl-sharp/parse-gir.py    |    1 +
 5 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/cogl-sharp/Context.cs b/cogl-sharp/Context.cs
index 6665a86..e4cec39 100644
--- a/cogl-sharp/Context.cs
+++ b/cogl-sharp/Context.cs
@@ -28,7 +28,7 @@ using System.Runtime.InteropServices;
 
 namespace Cogl
 {
-    public sealed class Context : Cogl.Object
+    public sealed partial class Context : Cogl.Object
     {
 
         public Context(IntPtr h) : base(h) {}
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am
index 16c340d..60a060d 100644
--- a/cogl-sharp/Makefile.am
+++ b/cogl-sharp/Makefile.am
@@ -13,6 +13,7 @@ sources =			\
 	Color.cs		\
 	ColorMask.cs		\
 	Context.cs		\
+	_Context.cs		\
 	Driver.cs		\
 	Exception.cs		\
 	FrameBuffer.cs		\
diff --git a/cogl-sharp/_Context.cs b/cogl-sharp/_Context.cs
new file mode 100644
index 0000000..7a17cb0
--- /dev/null
+++ b/cogl-sharp/_Context.cs
@@ -0,0 +1,10 @@
+/* This file has been generated by parse-gir.py, do not hand edit */
+using System;
+using System.Runtime.InteropServices;
+
+namespace Cogl
+{
+    public partial class Context
+    {
+    }
+}
diff --git a/cogl-sharp/_FrameBuffer.cs b/cogl-sharp/_FrameBuffer.cs
index 55b240b..8f40e5c 100644
--- a/cogl-sharp/_FrameBuffer.cs
+++ b/cogl-sharp/_FrameBuffer.cs
@@ -103,6 +103,15 @@ namespace Cogl
         }
 
         [DllImport("cogl2.dll")]
+        public static extern IntPtr cogl_framebuffer_get_context(IntPtr o);
+
+        public Context GetContext()
+        {
+            IntPtr p = cogl_framebuffer_get_context(handle);
+            return new Context(p);
+        }
+
+        [DllImport("cogl2.dll")]
         public static extern IntPtr cogl_framebuffer_get_depth_texture(IntPtr o);
 
         public Texture GetDepthTexture()
diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py
index f945de4..b6cc13b 100755
--- a/cogl-sharp/parse-gir.py
+++ b/cogl-sharp/parse-gir.py
@@ -24,6 +24,7 @@ enum_types = (
 
 # object types to dump (.gir names)
 object_types = (
+    "Context",
     "Framebuffer",
     "Onscreen",
     "OnscreenTemplate",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]