[longomatch] Use the extension method in Multimedia to retrieve the window handle



commit 209305c4d4590d61a634c4a428b265b0ec75791c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Apr 17 12:24:26 2015 +0200

    Use the extension method in Multimedia to retrieve the window handle

 LongoMatch.GUI.Multimedia/Gui/VideoWindow.cs       |   11 +-----
 LongoMatch.Multimedia/LongoMatch.Multimedia.csproj |    1 +
 LongoMatch.Multimedia/Makefile.am                  |    3 +-
 LongoMatch.Multimedia/Utils/WindowHandle.cs        |   34 ++++++++++++++++++++
 4 files changed, 39 insertions(+), 10 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/VideoWindow.cs b/LongoMatch.GUI.Multimedia/Gui/VideoWindow.cs
index e345869..efac1c4 100644
--- a/LongoMatch.GUI.Multimedia/Gui/VideoWindow.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/VideoWindow.cs
@@ -19,6 +19,7 @@ using System;
 using System.Runtime.InteropServices;
 using Gtk;
 using LongoMatch.Core.Interfaces.GUI;
+using LongoMatch.Multimedia.Utils;
 
 namespace LongoMatch.Gui
 {
@@ -67,7 +68,7 @@ namespace LongoMatch.Gui
 
                public IntPtr WindowHandle {
                        get {
-                               return GetWindowHandle (drawingWindow.GdkWindow);
+                               return drawingWindow.GdkWindow.GetWindowHandle ();
                        }
                }
 
@@ -142,14 +143,6 @@ namespace LongoMatch.Gui
                {
                        
                }
-
-               [DllImport ("libcesarplayer.dll")]
-               static extern IntPtr lgm_get_window_handle (IntPtr window);
-
-               IntPtr GetWindowHandle (Gdk.Window window)
-               {
-                       return lgm_get_window_handle (window.Handle);
-               }
        }
 }
 
diff --git a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj 
b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
index bd087b5..0568b18 100644
--- a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
+++ b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
@@ -51,6 +51,7 @@
     <Compile Include="..\AssemblyInfo\AssemblyInfo.cs">
       <Link>AssemblyInfo.cs</Link>
     </Compile>
+    <Compile Include="Utils\WindowHandle.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Capturer\" />
diff --git a/LongoMatch.Multimedia/Makefile.am b/LongoMatch.Multimedia/Makefile.am
index 554d5d2..b37d293 100644
--- a/LongoMatch.Multimedia/Makefile.am
+++ b/LongoMatch.Multimedia/Makefile.am
@@ -23,7 +23,8 @@ SOURCES = ../AssemblyInfo/AssemblyInfo.cs \
        Utils/GStreamer.cs \
        Utils/GstDiscoverer.cs \
        Utils/MultimediaFactory.cs \
-       Utils/TimeString.cs
+       Utils/TimeString.cs \
+       Utils/WindowHandle.cs
 
 DLLCONFIG = LongoMatch.Multimedia.dll.config
 
diff --git a/LongoMatch.Multimedia/Utils/WindowHandle.cs b/LongoMatch.Multimedia/Utils/WindowHandle.cs
new file mode 100644
index 0000000..fd8b4a2
--- /dev/null
+++ b/LongoMatch.Multimedia/Utils/WindowHandle.cs
@@ -0,0 +1,34 @@
+//
+//  Copyright (C) 2014 Andoni Morales Alastruey
+//
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using System.Runtime.InteropServices;
+
+namespace LongoMatch.Multimedia.Utils
+{
+       public static class WindowHandle
+       {
+               [DllImport ("libcesarplayer.dll")]
+               static extern IntPtr lgm_get_window_handle (IntPtr window);
+
+               public static IntPtr GetWindowHandle (this Gdk.Window window)
+               {
+                       return lgm_get_window_handle (window.Handle);
+               }
+       }
+}
+


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