banshee r4720 - in trunk/banshee: . build build/m4/banshee src/Backends src/Backends/Banshee.Osx src/Backends/Banshee.Osx/Banshee.OsxBackend src/Backends/Banshee.Osx/Resources src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.NotificationArea
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4720 - in trunk/banshee: . build build/m4/banshee src/Backends src/Backends/Banshee.Osx src/Backends/Banshee.Osx/Banshee.OsxBackend src/Backends/Banshee.Osx/Resources src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.NotificationArea
- Date: Wed, 22 Oct 2008 19:16:55 +0000 (UTC)
Author: abock
Date: Wed Oct 22 19:16:55 2008
New Revision: 4720
URL: http://svn.gnome.org/viewvc/banshee?rev=4720&view=rev
Log:
2008-10-22 Aaron Bockover <abock gnome org>
Patch from Eoin Hennessy <eoin randomrules org> (BGO #557190)
* src/Backends/Banshee.OSX: Added OSX backend. Consists of a service
that uses ige-mac-integration-sharp to bind the gtk menu to the
global menu, make menus more osx-like etc.. and a hardware manager,
which rigth now, doesn't do anything
* src/Extensions/Banshee.NotificationArea/Makefile.am: Disable the
NotificationArea extension on OSX as the 'close-to-tray' behaviour it adds
doesn't really make sense on OSX.
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs:
Swapping the rendering order of source icon and title fixes a
rendering glitch on OSX where the icon for a source's first child is
not rendered.
Added:
trunk/banshee/src/Backends/Banshee.Osx/ (props changed)
trunk/banshee/src/Backends/Banshee.Osx/Banshee.Osx.addin.xml
trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/
trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/HardwareManager.cs
trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/OsxService.cs
trunk/banshee/src/Backends/Banshee.Osx/Makefile.am
trunk/banshee/src/Backends/Banshee.Osx/Resources/
trunk/banshee/src/Backends/Banshee.Osx/Resources/osx-ui-actions-layout.xml
Modified:
trunk/banshee/ChangeLog
trunk/banshee/build/build.environment.mk
trunk/banshee/build/m4/banshee/osx.m4
trunk/banshee/configure.ac
trunk/banshee/src/Backends/Makefile.am
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am
Modified: trunk/banshee/build/build.environment.mk
==============================================================================
--- trunk/banshee/build/build.environment.mk (original)
+++ trunk/banshee/build/build.environment.mk Wed Oct 22 19:16:55 2008
@@ -26,7 +26,7 @@
LINK_BOO = $(BOO_LIBS)
LINK_WEBKIT = $(WEBKIT_LIBS)
LINK_MONOTORRENT_DBUS = $(MONOTORRENT_DBUS_LIBS)
-
+LINK_IGEMACINTEGRATION = $(IGEMACINTEGRATIONSHARP_LIBS)
LINK_MONO_ADDINS_DEPS = $(MONO_ADDINS_LIBS)
LINK_MONO_ADDINS_SETUP_DEPS = $(MONO_ADDINS_SETUP_LIBS)
LINK_MONO_ADDINS_GUI_DEPS = $(MONO_ADDINS_GUI_LIBS)
@@ -141,9 +141,9 @@
REF_BACKEND_GSTREAMER = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_GLIB)
REF_BACKEND_UNIX = $(LINK_BANSHEE_CORE_DEPS) $(LINK_MONO_POSIX)
REF_BACKEND_HAL = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_DBUS)
+REF_BACKEND_OSX = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_IGEMACINTEGRATION)
REF_BACKEND_BNPX11 = $(LINK_EXTENSION_NOWPLAYING_DEPS)
-
# Build rules
# Ignoring 0278 due to a bug in gmcs:
# http://bugzilla.ximian.com/show_bug.cgi?id=79998
Modified: trunk/banshee/build/m4/banshee/osx.m4
==============================================================================
--- trunk/banshee/build/m4/banshee/osx.m4 (original)
+++ trunk/banshee/build/m4/banshee/osx.m4 Wed Oct 22 19:16:55 2008
@@ -1,21 +1,21 @@
AC_DEFUN([BANSHEE_CHECK_OSX],
[
- IGEMACINTEGRATIONSHARP_REQUIRED=0.6
+ IGEMACINTEGRATIONSHARP_REQUIRED=0.8.2
AC_ARG_ENABLE(osx, AC_HELP_STRING([--enable-osx], [Enable OSX support]), enable_osx=$enableval, enable_osx="no")
if test "x$enable_osx" = "xyes"; then
- dnl FIXME: detect osx
- have_osx="yes"
+ dnl FIXME: detect osx
+ have_osx="yes"
- PKG_CHECK_MODULES(IGEMACINTEGRATIONSHARP,
- ige-mac-integration-sharp >= $IGEMACINTEGRATIONSHARP_REQUIRED,
- have_igemacintegrationsharp=yes, have_igemacintegrationsharp=no)
+ PKG_CHECK_MODULES(IGEMACINTEGRATIONSHARP,
+ ige-mac-integration-sharp >= $IGEMACINTEGRATIONSHARP_REQUIRED,
+ have_igemacintegrationsharp=yes, have_igemacintegrationsharp=no)
- if test "x$have_igemacintegrationsharp" = "xno"; then
- AC_MSG_ERROR([ige-mac-integration-sharp was not found or is not up to date. Please install ige-mac-integration-sharp of at least version $IGEMACINTEGRATIONSHARP_REQUIRED])
- fi
- AC_SUBST(IGEMACINTEGRATIONSHARP_LIBS)
+ if test "x$have_igemacintegrationsharp" = "xno"; then
+ AC_MSG_ERROR([ige-mac-integration-sharp was not found or is not up to date. Please install ige-mac-integration-sharp of at least version $IGEMACINTEGRATIONSHARP_REQUIRED])
+ fi
+ AC_SUBST(IGEMACINTEGRATIONSHARP_LIBS)
fi
AM_CONDITIONAL(ENABLE_OSX, test "x$have_osx" = "xyes")
Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac (original)
+++ trunk/banshee/configure.ac Wed Oct 22 19:16:55 2008
@@ -185,6 +185,7 @@
src/Backends/Banshee.GStreamer/Makefile
src/Backends/Banshee.Hal/Makefile
src/Backends/Banshee.Unix/Makefile
+src/Backends/Banshee.Osx/Makefile
src/Backends/Banshee.NowPlaying.X11/Makefile
src/Backends/Banshee.NowPlaying.X11/libbnpx11/Makefile
Added: trunk/banshee/src/Backends/Banshee.Osx/Banshee.Osx.addin.xml
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Osx/Banshee.Osx.addin.xml Wed Oct 22 19:16:55 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Addin
+ id="Banshee.Osx"
+ version="1.0"
+ compatVersion="1.0"
+ copyright="Â 2008 Eoin Hennessy. Licensed under the MIT X11 license."
+ category="required:Backends"
+ description="Backend providers for the OSX platform. Includes general OSX integration."
+ defaultEnabled="true">
+
+ <Dependencies>
+ <Addin id="Banshee.Core" version="1.0"/>
+ <Addin id="Banshee.Services" version="1.0"/>
+ </Dependencies>
+
+ <Extension path="/Banshee/ServiceManager/Service">
+ <Service class="Banshee.OsxBackend.OsxService"/>
+ </Extension>
+
+ <Extension path="/Banshee/Platform/HardwareManager">
+ <HardwareManager class="Banshee.OsxBackend.HardwareManager"/>
+ </Extension>
+</Addin>
Added: trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/HardwareManager.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/HardwareManager.cs Wed Oct 22 19:16:55 2008
@@ -0,0 +1,72 @@
+//
+// HardwareManager.cs
+//
+// Author:
+// Eoin Hennessy <eoin randomrules org>
+//
+// Copyright (C) 2008 Eoin Hennessy
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+using Hyena;
+using Banshee.Hardware;
+
+namespace Banshee.OsxBackend
+{
+ public sealed class HardwareManager : IHardwareManager
+ {
+ public event DeviceAddedHandler DeviceAdded;
+ public event DeviceRemovedHandler DeviceRemoved;
+
+ public void Dispose ()
+ {
+ }
+
+ public IEnumerable<IDevice> GetAllDevices ()
+ {
+ yield break;
+ }
+
+ private IEnumerable<T> GetAllBlockDevices<T> () where T : IBlockDevice
+ {
+ yield break;
+ }
+
+ public IEnumerable<IBlockDevice> GetAllBlockDevices ()
+ {
+ return GetAllBlockDevices<IBlockDevice> ();
+ }
+
+ public IEnumerable<ICdromDevice> GetAllCdromDevices ()
+ {
+ return GetAllBlockDevices<ICdromDevice> ();
+ }
+
+ public IEnumerable<IDiskDevice> GetAllDiskDevices ()
+ {
+ return GetAllBlockDevices<IDiskDevice> ();
+ }
+ }
+}
+
Added: trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/OsxService.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Osx/Banshee.OsxBackend/OsxService.cs Wed Oct 22 19:16:55 2008
@@ -0,0 +1,208 @@
+//
+// OsxService.cs
+//
+// Author:
+// Eoin Hennessy <eoin randomrules org>
+//
+// Copyright (C) 2008 Eoin Hennessy
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using Gtk;
+using Mono.Unix;
+
+using Banshee.ServiceStack;
+using Banshee.Gui;
+
+using IgeMacIntegration;
+
+namespace Banshee.OsxBackend
+{
+ public class OsxService : IExtensionService, IDisposable
+ {
+ private GtkElementsService elements_service;
+ private InterfaceActionService interface_action_service;
+ private uint ui_manager_id;
+ private bool disposed;
+
+ void IExtensionService.Initialize ()
+ {
+ elements_service = ServiceManager.Get<GtkElementsService> ();
+ interface_action_service = ServiceManager.Get<InterfaceActionService> ();
+
+ if (!ServiceStartup ()) {
+ ServiceManager.ServiceStarted += OnServiceStarted;
+ }
+ }
+
+ private void OnServiceStarted (ServiceStartedArgs args)
+ {
+ if (args.Service is Banshee.Gui.InterfaceActionService) {
+ interface_action_service = (InterfaceActionService)args.Service;
+ } else if (args.Service is GtkElementsService) {
+ elements_service = (GtkElementsService)args.Service;
+ }
+
+ ServiceStartup ();
+ }
+
+ private bool ServiceStartup ()
+ {
+ if (elements_service == null || interface_action_service == null) {
+ return false;
+ }
+
+ Initialize ();
+ ServiceManager.ServiceStarted -= OnServiceStarted;
+
+ return true;
+ }
+
+
+ void Initialize ()
+ {
+ // add close action
+ interface_action_service.GlobalActions.Add (new ActionEntry [] {
+ new ActionEntry ("CloseAction", Stock.Close,
+ Catalog.GetString ("_Close"), "<Control>W",
+ Catalog.GetString ("Close"), CloseWindow)
+ });
+
+ // merge close menu item
+ ui_manager_id = interface_action_service.UIManager.AddUiFromResource ("osx-ui-actions-layout.xml");
+ RegisterCloseHandler ();
+
+ elements_service.PrimaryWindow.WindowStateEvent += WindowStateHandler;
+
+ // bind gtk menu to globel osx menu
+ BindMenuBar ();
+
+ // make menu more osx-like
+ AdjustMainMenu ();
+
+ // add dock handlers
+ IgeMacDock doc = new IgeMacDock();
+ doc.Clicked += OnDockClicked;
+ doc.QuitActivate += OnDockQuitActivated;
+ }
+
+ public void Dispose ()
+ {
+ if (disposed) {
+ return;
+ }
+
+ elements_service.PrimaryWindowClose = null;
+
+ interface_action_service.GlobalActions.Remove ("CloseAction");
+ interface_action_service.UIManager.RemoveUi (ui_manager_id);
+
+ disposed = true;
+ }
+
+ string IService.ServiceName {
+ get { return "OsxService"; }
+ }
+
+ private void OnDockClicked (object o, System.EventArgs args)
+ {
+ SetWindowVisibility (true);
+ }
+
+ private void OnDockQuitActivated (object o, System.EventArgs args)
+ {
+ Banshee.ServiceStack.Application.Shutdown ();
+ }
+
+ private void BindMenuBar ()
+ {
+ UIManager ui = interface_action_service.UIManager;
+
+ // retreive and hide the gtk menu
+ MenuShell menu = (MenuShell) ui.GetWidget ("/MainMenu");
+ menu.Hide ();
+
+ // bind menu
+ IgeMacMenu.MenuBar = menu;
+ }
+
+ private void AdjustMainMenu () {
+ UIManager ui = interface_action_service.UIManager;
+
+ MenuItem about_item = ui.GetWidget ("/MainMenu/HelpMenu/About") as MenuItem;
+ MenuItem prefs_item = ui.GetWidget ("/MainMenu/EditMenu/Preferences") as MenuItem;
+ MenuItem quit_item = ui.GetWidget ("/MainMenu/MediaMenu/Quit") as MenuItem;
+
+ IgeMacMenuGroup about_group = IgeMacMenu.AddAppMenuGroup ();
+ IgeMacMenuGroup prefs_group = IgeMacMenu.AddAppMenuGroup ();
+
+ IgeMacMenu.QuitMenuItem = quit_item;
+
+ about_group.AddMenuItem (about_item, null);
+ prefs_group.AddMenuItem (prefs_item, null);
+ }
+
+ private void RegisterCloseHandler ()
+ {
+ if (elements_service.PrimaryWindowClose == null) {
+ elements_service.PrimaryWindowClose = OnPrimaryWindowClose;
+ }
+ }
+
+ private bool OnPrimaryWindowClose ()
+ {
+ CloseWindow (null, null);
+ return true;
+ }
+
+ private void CloseWindow (object o, EventArgs args)
+ {
+ SetWindowVisibility(false);
+ }
+
+ private void SetCloseMenuItemSensitivity (bool sensitivity) {
+ UIManager ui = interface_action_service.UIManager;
+ MenuItem close_item = ui.GetWidget ("/MainMenu/MediaMenu/ClosePlaceholder/Close") as MenuItem;
+ close_item.Sensitive = sensitivity;
+ }
+
+ private void SetWindowVisibility (bool visible)
+ {
+ SetCloseMenuItemSensitivity(visible);
+ if (elements_service.PrimaryWindow.Visible != visible) {
+ elements_service.PrimaryWindow.ToggleVisibility ();
+ }
+ }
+
+ private void WindowStateHandler (object obj, WindowStateEventArgs args) {
+ switch (args.Event.NewWindowState) {
+ case Gdk.WindowState.Iconified:
+ SetCloseMenuItemSensitivity(false);
+ break;
+ case (Gdk.WindowState) 0:
+ SetCloseMenuItemSensitivity(true);
+ break;
+ }
+ }
+ }
+}
Added: trunk/banshee/src/Backends/Banshee.Osx/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Osx/Makefile.am Wed Oct 22 19:16:55 2008
@@ -0,0 +1,20 @@
+ASSEMBLY = Banshee.Osx
+TARGET = library
+LINK = $(REF_BACKEND_OSX)
+INSTALL_DIR = $(BACKENDS_INSTALL_DIR)
+
+SOURCES = \
+ Banshee.OsxBackend/OsxService.cs \
+ Banshee.OsxBackend/HardwareManager.cs
+
+RESOURCES = \
+ Banshee.Osx.addin.xml \
+ Resources/osx-ui-actions-layout.xml
+
+if ENABLE_OSX
+include $(top_srcdir)/build/build.mk
+else
+EXTRA_DIST = $(SOURCES) $(RESOURCES)
+endif
+
+MAINTAINERCLEANFILES = Makefile.in
Added: trunk/banshee/src/Backends/Banshee.Osx/Resources/osx-ui-actions-layout.xml
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Osx/Resources/osx-ui-actions-layout.xml Wed Oct 22 19:16:55 2008
@@ -0,0 +1,10 @@
+<ui>
+ <!-- This menu gets merged into the main menu to add the close window item -->
+ <menubar name="MainMenu">
+ <menu name="MediaMenu" action="MediaMenuAction">
+ <placeholder name="ClosePlaceholder">
+ <menuitem name="Close" action="CloseAction"/>
+ </placeholder>
+ </menu>
+ </menubar>
+</ui>
Modified: trunk/banshee/src/Backends/Makefile.am
==============================================================================
--- trunk/banshee/src/Backends/Makefile.am (original)
+++ trunk/banshee/src/Backends/Makefile.am Wed Oct 22 19:16:55 2008
@@ -3,7 +3,8 @@
Banshee.Gnome \
Banshee.GStreamer \
Banshee.Unix \
- Banshee.NowPlaying.X11
+ Banshee.NowPlaying.X11 \
+ Banshee.Osx
MAINTAINERCLEANFILES = Makefile.in
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs Wed Oct 22 19:16:55 2008
@@ -175,18 +175,18 @@
title_layout.GetPixelSize (out title_layout_width, out title_layout_height);
Gdk.GC main_gc = widget.Style.TextGC (state);
-
- if (icon != null) {
- drawable.DrawPixbuf (main_gc, icon, 0, 0,
- cell_area.X, Middle (cell_area, icon.Height),
- icon.Width, icon.Height, RgbDither.None, 0, 0);
- }
drawable.DrawLayout (main_gc,
cell_area.X + (icon == null ? 0 : icon.Width) + 6,
Middle (cell_area, title_layout_height),
title_layout);
+ if (icon != null) {
+ drawable.DrawPixbuf (main_gc, icon, 0, 0,
+ cell_area.X, Middle (cell_area, icon.Height),
+ icon.Width, icon.Height, RgbDither.None, 0, 0);
+ }
+
if (hide_counts) {
return;
}
Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am (original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am Wed Oct 22 19:16:55 2008
@@ -26,8 +26,10 @@
Resources/Banshee.NotificationArea.addin.xml \
Resources/NotificationAreaMenu.xml
+if ENABLE_OSX
+EXTRA_DIST = $(SOURCES) $(RESOURCES)
+else
include $(top_srcdir)/build/build.mk
-
module_SCRIPTS += Banshee.NotificationArea.dll.config
EXTRA_DIST += Banshee.NotificationArea.dll.config $(REAL_NOTIFY_SHARP_SOURCES)
-
+endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]