[cogl/wip/cogl-sharp: 31/35] cogl-sharp: Generate as much as possible of OnScreen



commit b310b19677ff5644343bb06dcf17dfdf659c86bf
Author: Damien Lespiau <damien lespiau intel com>
Date:   Tue Oct 9 19:59:38 2012 +0100

    cogl-sharp: Generate as much as possible of OnScreen
    
    For now, this does not include the resize callbacks, nor the swap
    region.

 cogl-sharp/Makefile.am  |    1 +
 cogl-sharp/OnScreen.cs  |   18 +-----------
 cogl-sharp/_OnScreen.cs |   74 +++++++++++++++++++++++++++++++++++++++++++++++
 cogl-sharp/parse-gir.py |    6 +++-
 4 files changed, 81 insertions(+), 18 deletions(-)
---
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am
index f89ff42..a026072 100644
--- a/cogl-sharp/Makefile.am
+++ b/cogl-sharp/Makefile.am
@@ -20,6 +20,7 @@ sources =			\
 	Matrix.cs		\
 	Object.cs		\
 	OnScreen.cs		\
+	_OnScreen.cs		\
 	Pipeline.cs		\
 	_Pipeline.cs		\
 	PipelineAlphaFunc.cs	\
diff --git a/cogl-sharp/OnScreen.cs b/cogl-sharp/OnScreen.cs
index dd6d66a..226eefc 100644
--- a/cogl-sharp/OnScreen.cs
+++ b/cogl-sharp/OnScreen.cs
@@ -28,7 +28,7 @@ using System.Runtime.InteropServices;
 
 namespace Cogl
 {
-    public sealed class OnScreen : FrameBuffer
+    public sealed partial class OnScreen : FrameBuffer
     {
         public OnScreen(IntPtr h) : base(h) {}
 
@@ -40,21 +40,5 @@ namespace Cogl
         {
             handle = cogl_onscreen_new(ctx.Handle, width, height);
         }
-
-        [DllImport("cogl2.dll")]
-        private static extern IntPtr cogl_onscreen_show(IntPtr p);
-
-        public void Show()
-        {
-            cogl_onscreen_show(handle);
-        }
-
-        [DllImport("cogl2.dll")]
-        private static extern IntPtr cogl_onscreen_swap_buffers(IntPtr p);
-
-        public void SwapBuffers()
-        {
-            cogl_onscreen_swap_buffers(handle);
-        }
     }
 }
diff --git a/cogl-sharp/_OnScreen.cs b/cogl-sharp/_OnScreen.cs
new file mode 100644
index 0000000..0c019cd
--- /dev/null
+++ b/cogl-sharp/_OnScreen.cs
@@ -0,0 +1,74 @@
+/* This file has been generated by parse-gir.py, do not hand edit */
+using System;
+using System.Runtime.InteropServices;
+
+namespace Cogl
+{
+    public partial class OnScreen
+    {
+        [DllImport("cogl2.dll")]
+        public static extern bool cogl_onscreen_get_resizable(IntPtr o);
+
+        public bool GetResizable()
+        {
+            return cogl_onscreen_get_resizable(handle);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_hide(IntPtr o);
+
+        public void Hide()
+        {
+            cogl_onscreen_hide(handle);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_remove_resize_handler(IntPtr o, uint id);
+
+        public void RemoveResizeHandler(uint id)
+        {
+            cogl_onscreen_remove_resize_handler(handle, id);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_remove_swap_buffers_callback(IntPtr o, uint id);
+
+        public void RemoveSwapBuffersCallback(uint id)
+        {
+            cogl_onscreen_remove_swap_buffers_callback(handle, id);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_set_resizable(IntPtr o, bool resizable);
+
+        public void SetResizable(bool resizable)
+        {
+            cogl_onscreen_set_resizable(handle, resizable);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_set_swap_throttled(IntPtr o, bool throttled);
+
+        public void SetSwapThrottled(bool throttled)
+        {
+            cogl_onscreen_set_swap_throttled(handle, throttled);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_show(IntPtr o);
+
+        public void Show()
+        {
+            cogl_onscreen_show(handle);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern void cogl_onscreen_swap_buffers(IntPtr o);
+
+        public void SwapBuffers()
+        {
+            cogl_onscreen_swap_buffers(handle);
+        }
+
+    }
+}
diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py
index 42d86f2..afe0b46 100755
--- a/cogl-sharp/parse-gir.py
+++ b/cogl-sharp/parse-gir.py
@@ -22,6 +22,7 @@ enum_types = (
 # object types to dump (.gir names)
 object_types = (
     "Framebuffer",
+    "Onscreen",
     "Pipeline",
     "Texture",
 )
@@ -49,7 +50,10 @@ name_overrides = {
         )
     },
     'Onscreen': {
-        'class': 'OnScreen'
+        'class': 'OnScreen',
+        'blacklist': (
+            'swap_region',
+        )
     },
     'Offscreen': {
         'class': 'OffScreen'



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