[banshee] [MeeGo.Panel] Update libmoblin-panel binding



commit ca1a5934f5369ec5cd205e034f99ca551ff993d2
Author: Aaron Bockover <abockover novell com>
Date:   Mon Mar 22 14:10:53 2010 -0400

    [MeeGo.Panel] Update libmoblin-panel binding
    
    Calling the managed stuff MeeGo.Panel (renamed from Mutter) since
    it's not really Mutter (provided by mutter-moblin), and the API will
    change names upstream from a Moblin namespace to a MeeGo one soon.

 src/Extensions/Banshee.MeeGo/Banshee.MeeGo.csproj  |   10 +-
 .../Banshee.MeeGo/Banshee.MeeGo.dll.config         |    2 +-
 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs      |    3 +-
 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs    |    5 +-
 src/Extensions/Banshee.MeeGo/Makefile.am           |    8 +-
 .../PanelButtonState.cs}                           |   23 +--
 .../{Mutter => MeeGo.Panel}/PanelClient.cs         |  149 +++++++++++++-------
 .../{Mutter => MeeGo.Panel}/PanelGtk.cs            |   18 ++-
 .../SetPositionHandler.cs}                         |   19 ++--
 .../{Mutter => MeeGo.Panel}/SetSizeHandler.cs      |    7 +-
 10 files changed, 146 insertions(+), 98 deletions(-)
---
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.csproj b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.csproj
index 4029cc4..cedd4d8 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.csproj
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.csproj
@@ -80,18 +80,20 @@
     </MonoDevelop>
   </ProjectExtensions>
   <ItemGroup>
+    <Compile Include="MeeGo.Panel\PanelClient.cs" />
+    <Compile Include="MeeGo.Panel\PanelGtk.cs" />
+    <Compile Include="MeeGo.Panel\SetSizeHandler.cs" /> 
+    <Compile Include="MeeGo.Panel\SetPositionHandler.cs" /> 
+    <Compile Include="MeeGo.Panel\PanelButtonState.cs" />
     <Compile Include="Banshee.MeeGo\MeeGoService.cs" />
     <Compile Include="Banshee.MeeGo\MediaPanelContents.cs" />
-    <Compile Include="Mutter\PanelClient.cs" />
-    <Compile Include="Mutter\PanelGtk.cs" />
-    <Compile Include="Banshee.MeeGo\SearchEntry.cs" />
+	<Compile Include="Banshee.MeeGo\SearchEntry.cs" />
     <Compile Include="Banshee.MeeGo\SearchHeader.cs" />
     <Compile Include="Banshee.MeeGo\PlayQueueBox.cs" />
     <Compile Include="Banshee.MeeGo\PlaybackBox.cs" />
     <Compile Include="Banshee.MeeGo\MeeGoTrackInfoDisplay.cs" />
     <Compile Include="Banshee.MeeGo\RecentAlbumsList.cs" />
     <Compile Include="Banshee.MeeGo\MeeGoPanel.cs" />
-    <Compile Include="Mutter\SetSizeHandler.cs" />
     <Compile Include="Banshee.MeeGo\RecentAlbumsView.cs" />
   </ItemGroup>
 </Project>
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.dll.config b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.dll.config
index 932d63a..6b344f2 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.dll.config
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo.dll.config
@@ -1,3 +1,3 @@
 <configuration>
-  <dllmap dll="libmoblin-panel-gtk" target="libmoblin-panel-gtk.so.0"/>
+  <dllmap dll="libmoblin-panel" target="libmoblin-panel.so.0"/>
 </configuration>
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
index 24db2f6..a11da7b 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
@@ -27,7 +27,8 @@
 using System;
 
 using Gtk;
-using Mutter;
+using MeeGo.Panel;
+
 using Hyena;
 using Banshee.Base;
 
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
index dd481dc..a268548 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
@@ -28,6 +28,7 @@
 
 using System;
 using Gtk;
+using MeeGo.Panel;
 
 using Hyena;
 
@@ -38,8 +39,6 @@ using Banshee.ServiceStack;
 using Banshee.MediaEngine;
 using Banshee.Gui;
 
-using Mutter;
-
 namespace Banshee.MeeGo
 {
     public class MeeGoService : IExtensionService
@@ -175,7 +174,7 @@ namespace Banshee.MeeGo
             elements_service.PrimaryWindow.Maximize ();
             elements_service.PrimaryWindow.Present ();
             if (MeeGoPanel.Instance != null && MeeGoPanel.Instance.ToolbarPanel != null) {
-                MeeGoPanel.Instance.ToolbarPanel.RequestHide ();
+                MeeGoPanel.Instance.ToolbarPanel.Hide ();
             }
         }
 
diff --git a/src/Extensions/Banshee.MeeGo/Makefile.am b/src/Extensions/Banshee.MeeGo/Makefile.am
index 9e946a3..71129e4 100644
--- a/src/Extensions/Banshee.MeeGo/Makefile.am
+++ b/src/Extensions/Banshee.MeeGo/Makefile.am
@@ -16,9 +16,11 @@ SOURCES =  \
 	Banshee.MeeGo/RecentAlbumsView.cs \
 	Banshee.MeeGo/SearchEntry.cs \
 	Banshee.MeeGo/SearchHeader.cs \
-	Mutter/PanelClient.cs \
-	Mutter/PanelGtk.cs \
-	Mutter/SetSizeHandler.cs
+	MeeGo.Panel/PanelClient.cs \
+	MeeGo.Panel/PanelGtk.cs \
+	MeeGo.Panel/SetSizeHandler.cs \
+	MeeGo.Panel/SetPositionHandler.cs \
+	MeeGo.Panel/PanelButtonState.cs
 
 RESOURCES = Banshee.MeeGo.addin.xml
 
diff --git a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelButtonState.cs
similarity index 75%
copy from src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
copy to src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelButtonState.cs
index a9c1159..604189e 100644
--- a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
+++ b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelButtonState.cs
@@ -1,10 +1,10 @@
 //
-// SetSizeHandler.cs
+// PanelButtonState.cs
 //
 // Author:
 //   Aaron Bockover <abockover novell com>
 //
-// Copyright 2009 Novell, Inc.
+// Copyright 2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,12 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-using System;
-
-namespace Mutter
+namespace MeeGo.Panel
 {
-    public delegate void SetSizeHandler (object o, SetSizeArgs args);
-
-    public class SetSizeArgs : GLib.SignalArgs {
-        public uint Width {
-            get { return (uint)Args[0]; }
-        }
-
-        public uint Height {
-            get { return (uint)Args[1]; }
-        }
+    public enum PanelButtonState
+    {
+        Normal = 0,
+        Hidden,
+        Insensitive
     }
 }
diff --git a/src/Extensions/Banshee.MeeGo/Mutter/PanelClient.cs b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelClient.cs
similarity index 54%
rename from src/Extensions/Banshee.MeeGo/Mutter/PanelClient.cs
rename to src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelClient.cs
index 596cc34..4a58090 100644
--- a/src/Extensions/Banshee.MeeGo/Mutter/PanelClient.cs
+++ b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelClient.cs
@@ -4,7 +4,7 @@
 // Author:
 //   Aaron Bockover <abockover novell com>
 //
-// Copyright 2009 Novell, Inc.
+// Copyright 2009-2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -27,11 +27,11 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Mutter
+namespace MeeGo.Panel
 {
     public class PanelClient : GLib.Object
     {
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern IntPtr mpl_panel_client_get_type ();
 
         public static new GLib.GType GType {
@@ -47,34 +47,50 @@ namespace Mutter
         {
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
-        private static extern void mpl_panel_client_request_show (IntPtr panel);
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_unload (IntPtr panel);
 
-        public void RequestShow ()
+        public void Unload ()
         {
-            mpl_panel_client_request_show (Handle);
+            mpl_panel_client_unload (Handle);
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
-        private static extern void mpl_panel_client_request_hide (IntPtr panel);
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_ready (IntPtr panel);
 
-        public void RequestHide ()
+        public void Ready ()
         {
-            mpl_panel_client_request_hide (Handle);
+            mpl_panel_client_ready (Handle);
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
-        private static extern void mpl_panel_client_request_focus (IntPtr panel);
+        [DllImport ("libmoblin-panel")]
+        private static extern bool mpl_panel_client_set_delayed_ready (IntPtr panel, bool delayed);
 
-        public void RequestFocus ()
+        public bool SetDelayedReady (bool delayed)
         {
-            mpl_panel_client_request_focus (Handle);
+            return mpl_panel_client_set_delayed_ready (Handle, delayed);
+        }
+
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_show (IntPtr panel);
+
+        public void Show ()
+        {
+            mpl_panel_client_show (Handle);
+        }
+
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_hide (IntPtr panel);
+
+        public void Hide ()
+        {
+            mpl_panel_client_hide (Handle);
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern void mpl_panel_client_set_height_request (IntPtr panel, uint height);
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern uint mpl_panel_client_get_height_request (IntPtr panel);
 
         public uint HeightRequest {
@@ -82,33 +98,78 @@ namespace Mutter
             set { mpl_panel_client_set_height_request (Handle, value); }
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_request_focus (IntPtr panel);
+
+        public void RequestFocus ()
+        {
+            mpl_panel_client_request_focus (Handle);
+        }
+
+        [DllImport ("libmoblin-panel")]
         private static extern void mpl_panel_client_request_button_style (IntPtr panel, string style);
 
-        public string ButtonStyleRequest {
-            set { mpl_panel_client_request_button_style (Handle, value); }
+        public void RequestButtonStyle (string style)
+        {
+            mpl_panel_client_request_button_style (Handle, style);
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern void mpl_panel_client_request_tooltip (IntPtr panel, string tooltip);
 
-        public string TooltipRequest {
-            set { mpl_panel_client_request_tooltip (Handle, value); }
+        public void RequestTooltip (string tooltip)
+        {
+            mpl_panel_client_request_tooltip (Handle, tooltip);
+        }
+        
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_request_button_state (IntPtr panel, PanelButtonState state);
+
+        public void RequestButtonState (PanelButtonState state)
+        {
+            mpl_panel_client_request_button_state (Handle, state);
+        }
+
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_client_request_modality (IntPtr panel, bool modal);
+
+        public void RequestModality (bool modal)
+        {
+            mpl_panel_client_request_modality (Handle, modal);
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern uint mpl_panel_client_get_xid (IntPtr panel);
 
         public uint Xid {
             get { return mpl_panel_client_get_xid (Handle); }
         }
 
+        [DllImport ("libmoblin-panel")]
+        private static extern bool mpl_panel_client_is_windowless (IntPtr panel);
+
+        public bool IsWindowless {
+            get { return mpl_panel_client_is_windowless (Handle); }
+        }
+        
+        [GLib.Signal ("unload")]
+        public event SetSizeHandler UnloadEvent {
+            add { GLib.Signal.Lookup (this, "unload").AddDelegate (value); }
+            remove { GLib.Signal.Lookup (this, "unload").RemoveDelegate (value); }
+        }
+
         [GLib.Signal ("set-size")]
         public event SetSizeHandler SetSizeEvent {
             add { GLib.Signal.Lookup (this, "set-size", typeof (SetSizeArgs)).AddDelegate (value); }
             remove { GLib.Signal.Lookup (this, "set-size", typeof (SetSizeArgs)).RemoveDelegate (value); }
         }
 
+        [GLib.Signal ("set-position")]
+        public event SetPositionHandler SetPositionEvent {
+            add { GLib.Signal.Lookup (this, "set-position", typeof (SetPositionArgs)).AddDelegate (value); }
+            remove { GLib.Signal.Lookup (this, "set-position", typeof (SetPositionArgs)).RemoveDelegate (value); }
+        }
+
         [GLib.Signal ("show-begin")]
         public event EventHandler ShowBeginEvent {
             add { GLib.Signal.Lookup (this, "show-begin").AddDelegate (value); }
@@ -121,6 +182,12 @@ namespace Mutter
             remove { GLib.Signal.Lookup (this, "show-end").RemoveDelegate (value); }
         }
 
+        [GLib.Signal ("show")]
+        public event EventHandler ShowEvent {
+            add { GLib.Signal.Lookup (this, "show").AddDelegate (value); }
+            remove { GLib.Signal.Lookup (this, "show").RemoveDelegate (value); }
+        }
+
         [GLib.Signal ("hide-begin")]
         public event EventHandler HideBeginEvent {
             add { GLib.Signal.Lookup (this, "hide-begin").AddDelegate (value); }
@@ -133,36 +200,10 @@ namespace Mutter
             remove { GLib.Signal.Lookup (this, "hide-end").RemoveDelegate (value); }
         }
 
-        [GLib.Signal ("request-show")]
-        public event EventHandler RequestShowEvent {
-            add { GLib.Signal.Lookup (this, "request-show").AddDelegate (value); }
-            remove { GLib.Signal.Lookup (this, "request-show").RemoveDelegate (value); }
-        }
-
-        [GLib.Signal ("request-hide")]
-        public event EventHandler RequestHideEvent {
-            add { GLib.Signal.Lookup (this, "request-hide").AddDelegate (value); }
-            remove { GLib.Signal.Lookup (this, "request-hide").RemoveDelegate (value); }
-        }
-
-        [GLib.Signal ("request-focus")]
-        public event EventHandler RequestFocusEvent {
-            add { GLib.Signal.Lookup (this, "request-focus").AddDelegate (value); }
-            remove { GLib.Signal.Lookup (this, "request-focus").RemoveDelegate (value); }
-        }
-
-        // FIXME: need to define an delegate and args class
-
-        [GLib.Signal ("request-button-style")]
-        public event EventHandler RequestButtonStyleEvent {
-            add { GLib.Signal.Lookup (this, "request-button-style").AddDelegate (value); }
-            remove { GLib.Signal.Lookup (this, "request-button-style").RemoveDelegate (value); }
-        }
-
-        [GLib.Signal ("request-tooltip")]
-        public event EventHandler RequestTooltipEvent {
-            add { GLib.Signal.Lookup (this, "request-tooltip").AddDelegate (value); }
-            remove { GLib.Signal.Lookup (this, "request-tooltip").RemoveDelegate (value); }
+        [GLib.Signal ("hide")]
+        public event EventHandler HideEvent {
+            add { GLib.Signal.Lookup (this, "hide").AddDelegate (value); }
+            remove { GLib.Signal.Lookup (this, "hide").RemoveDelegate (value); }
         }
     }
 }
diff --git a/src/Extensions/Banshee.MeeGo/Mutter/PanelGtk.cs b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelGtk.cs
similarity index 83%
rename from src/Extensions/Banshee.MeeGo/Mutter/PanelGtk.cs
rename to src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelGtk.cs
index 4ae1f6f..68e0e3d 100644
--- a/src/Extensions/Banshee.MeeGo/Mutter/PanelGtk.cs
+++ b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/PanelGtk.cs
@@ -4,7 +4,7 @@
 // Author:
 //   Aaron Bockover <abockover novell com>
 //
-// Copyright 2009 Novell, Inc.
+// Copyright 2009-2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -29,18 +29,18 @@ using System.Runtime.InteropServices;
 
 using Gtk;
 
-namespace Mutter
+namespace MeeGo.Panel
 {
     public class PanelGtk : PanelClient
     {
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern IntPtr mpl_panel_gtk_get_type ();
 
         public static new GLib.GType GType {
             get { return new GLib.GType (mpl_panel_gtk_get_type ()); }
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
         private static extern IntPtr mpl_panel_gtk_new (string name, string tooltip, string stylesheet,
             string button_style, bool with_toolbar_service);
 
@@ -54,7 +54,15 @@ namespace Mutter
         {
         }
 
-        [DllImport ("libmoblin-panel-gtk")]
+        [DllImport ("libmoblin-panel")]
+        private static extern void mpl_panel_gtk_set_child (IntPtr panel, IntPtr child);
+
+        public void SetChild (Widget child)
+        {
+            mpl_panel_gtk_set_child (Handle, child == null ? IntPtr.Zero : child.Handle);
+        }
+
+        [DllImport ("libmoblin-panel")]
         private static extern IntPtr mpl_panel_gtk_get_window (IntPtr panel);
 
         private Container container_window;
diff --git a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetPositionHandler.cs
similarity index 77%
copy from src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
copy to src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetPositionHandler.cs
index a9c1159..3fab1b6 100644
--- a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
+++ b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetPositionHandler.cs
@@ -1,10 +1,10 @@
 //
-// SetSizeHandler.cs
+// SetPositionHandler.cs
 //
 // Author:
 //   Aaron Bockover <abockover novell com>
 //
-// Copyright 2009 Novell, Inc.
+// Copyright 2009-2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -26,17 +26,18 @@
 
 using System;
 
-namespace Mutter
+namespace MeeGo.Panel
 {
-    public delegate void SetSizeHandler (object o, SetSizeArgs args);
+    public delegate void SetPositionHandler (object o, SetPositionArgs args);
 
-    public class SetSizeArgs : GLib.SignalArgs {
-        public uint Width {
-            get { return (uint)Args[0]; }
+    public class SetPositionArgs : GLib.SignalArgs
+    {
+        public int X {
+            get { return (int)Args[0]; }
         }
 
-        public uint Height {
-            get { return (uint)Args[1]; }
+        public int Y {
+            get { return (int)Args[1]; }
         }
     }
 }
diff --git a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetSizeHandler.cs
similarity index 92%
rename from src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
rename to src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetSizeHandler.cs
index a9c1159..a4bb3a5 100644
--- a/src/Extensions/Banshee.MeeGo/Mutter/SetSizeHandler.cs
+++ b/src/Extensions/Banshee.MeeGo/MeeGo.Panel/SetSizeHandler.cs
@@ -4,7 +4,7 @@
 // Author:
 //   Aaron Bockover <abockover novell com>
 //
-// Copyright 2009 Novell, Inc.
+// Copyright 2009-2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -26,11 +26,12 @@
 
 using System;
 
-namespace Mutter
+namespace MeeGo.Panel
 {
     public delegate void SetSizeHandler (object o, SetSizeArgs args);
 
-    public class SetSizeArgs : GLib.SignalArgs {
+    public class SetSizeArgs : GLib.SignalArgs
+    {
         public uint Width {
             get { return (uint)Args[0]; }
         }



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