[Xfce4-commits] <parole:bluesabre/gtk3> Drop the now-useless power-manager plugin.

Sean Davis noreply at xfce.org
Sun Aug 11 15:17:02 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 40f1e1d4dee8c8e2e0b8da2c198f946e6e42ade5 (commit)
       from 99548fb13d88e71aff2ad2e86fc47463f2227f16 (commit)

commit 40f1e1d4dee8c8e2e0b8da2c198f946e6e42ade5
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Tue Mar 5 18:29:50 2013 -0500

    Drop the now-useless power-manager plugin.

 configure.ac.in                                    |   12 --
 po/POTFILES.in                                     |    1 -
 src/plugins/Makefile.am                            |    6 +-
 src/plugins/power-manager/Makefile.am              |   49 -----
 src/plugins/power-manager/power-manager-plugin.c   |   45 -----
 src/plugins/power-manager/power-manager-provider.c |  213 --------------------
 src/plugins/power-manager/power-manager-provider.h |   44 ----
 src/plugins/power-manager/power-manager.desktop.in |    6 -
 8 files changed, 1 insertion(+), 375 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index e5530a5..19f0dd5 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -231,14 +231,6 @@ AC_MSG_CHECKING([whether to build the system tray plugin])
 AM_CONDITIONAL([PAROLE_TRAY_PLUGIN], [test x"$ac_tray_plugin" = x"yes"])
 AC_MSG_RESULT([$ac_tray_plugin])
 
-# Power Manager
-#--------------------------
-AC_ARG_ENABLE([power-manager-plugin], AC_HELP_STRING([--disable-power-manager-plugin], [Don't build the power manager plugin]),
-  [ac_power_manager_plugin=$enableval], [ac_power_manager_plugin=yes])
-AC_MSG_CHECKING([whether to build the power manager plugin])
-AM_CONDITIONAL([POWER_MANAGER_PLUGIN], [test x"$ac_power_manager_plugin" = x"yes"])
-AC_MSG_RESULT([$ac_power_manager_plugin])
-
 #=======================================================#
 #              Check for debugging support              #
 #=======================================================#
@@ -273,7 +265,6 @@ src/plugins/Makefile
 src/plugins/sample/Makefile
 src/plugins/notify/Makefile
 src/plugins/tray/Makefile
-src/plugins/power-manager/Makefile
 docs/Makefile
 docs/plugin-api/version.xml
 docs/plugin-api/Makefile
@@ -304,9 +295,6 @@ echo "
         echo "
         System Tray icon:               ${ac_tray_plugin}" 
 
-        echo "
-        Power Manager:                  ${ac_power_manager_plugin}
-
 ------------------------------------------------------
 
 Configuration finished, type make to compile"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1b92d58..aa47f17 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -28,4 +28,3 @@ src/plugins/tray/tray-plugin.c
 src/plugins/tray/tray-provider.c
 src/plugins/tray/tray-provider.h
 src/plugins/tray/system-tray.desktop.in
-src/plugins/power-manager/power-manager.desktop.in
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 14fa33c..7b2439b 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -6,8 +6,4 @@ endif
 
 if PAROLE_NOTIFY_PLUGIN
 SUBDIRS+=notify
-endif
-
-if POWER_MANAGER_PLUGIN
-SUBDIRS+=power-manager
-endif
+endif
\ No newline at end of file
diff --git a/src/plugins/power-manager/Makefile.am b/src/plugins/power-manager/Makefile.am
deleted file mode 100644
index f95a79a..0000000
--- a/src/plugins/power-manager/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-INCLUDES =					\
-	-I$(top_builddir)			\
-	-I$(top_srcdir)				\
-	-I$(top_srcdir)/src			\
-	-DG_LOG_DOMAIN=\"power-manager_plugin\" \
-	-DLIBEXECDIR=\"$(libexecdir)\"		\
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
-
-pluginsdir = 					\
-	$(libdir)/parole-$(PAROLE_VERSION_API)
-
-plugins_LTLIBRARIES =				\
-	power-manager-plugin.la
-
-power_manager_plugin_la_SOURCES =		\
-	power-manager-plugin.c			\
-	power-manager-provider.c		\
-	power-manager-provider.h
-
-power_manager_plugin_la_CFLAGS =		\
-	$(PLATFORM_CFLAGS)			\
-	$(GTK_CFLAGS)				\
-	$(LIBXFCE4UTIL_CFLAGS)			\
-	$(DBUS_GLIB_CFLAGS)
-
-power_manager_plugin_la_LIBADD = 		\
-	$(top_builddir)/src/misc/libparole.la	\
-	$(LIBXFCE4UTIL_LIBS)			\
-	$(DBUS_GLIB_LIBS)
-
-power_manager_plugin_la_LDFLAGS =		\
-	-avoid-version				\
-	-export-dynamic				\
-	-module					\
-	$(PLATFORM_LDFLAGS)
-
-#
-# .desktop file
-#
-desktop_in_files = power-manager.desktop.in
-desktopdir = $(datadir)/parole/parole-plugins-$(PAROLE_VERSION_API)
-desktop_DATA =  $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = 		  	\
-	$(desktop_in_files)
-    
-DISTCLEANFILES = 		\
-	$(desktop_DATA)
diff --git a/src/plugins/power-manager/power-manager-plugin.c b/src/plugins/power-manager/power-manager-plugin.c
deleted file mode 100644
index 8482fa6..0000000
--- a/src/plugins/power-manager/power-manager-plugin.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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 Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <libxfce4util/libxfce4util.h>
-
-#include "power-manager-provider.h"
-
-G_MODULE_EXPORT GType	parole_plugin_initialize (ParoleProviderPlugin *plugin);
-						  
-G_MODULE_EXPORT void	parole_plugin_shutdown   (void);
-
-G_MODULE_EXPORT GType
-parole_plugin_initialize (ParoleProviderPlugin *plugin)
-{
-    xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-    pm_provider_register_type (plugin);
-    return PM_TYPE_PROVIDER;
-}
-
-G_MODULE_EXPORT void
-parole_plugin_shutdown (void)
-{
-    
-}
diff --git a/src/plugins/power-manager/power-manager-provider.c b/src/plugins/power-manager/power-manager-provider.c
deleted file mode 100644
index 5e7f679..0000000
--- a/src/plugins/power-manager/power-manager-provider.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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 Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <dbus/dbus-glib.h>
-
-#include <libxfce4util/libxfce4util.h>
-
-#include "power-manager-provider.h"
-
-static void   pm_provider_iface_init 	   (ParoleProviderPluginIface *iface);
-static void   pm_provider_finalize         (GObject 	              *object);
-
-
-struct _PmProviderClass
-{
-    GObjectClass 	  parent_class;
-};
-
-struct _PmProvider
-{
-    GObject      	  parent;
-    
-    
-    DBusGConnection 	 *bus;
-    DBusGProxy           *proxy;
-    ParoleProviderPlayer *player;
-    guint 		  cookie;
-    gboolean		  inhibitted;
-};
-
-PAROLE_DEFINE_TYPE_WITH_CODE (PmProvider, 
-			      pm_provider, 
-			      G_TYPE_OBJECT,
-			      PAROLE_IMPLEMENT_INTERFACE (PAROLE_TYPE_PROVIDER_PLUGIN, 
-							  pm_provider_iface_init));
-
-static void
-pm_provider_inhibit (PmProvider *provider)
-{
-    GError *error = NULL;
-    
-#ifdef debug
-    if ( G_UNLIKELY (provider->inhibitted) )
-    {
-	g_warning ("Power manager already inhibitted!!!");
-	return;
-    }
-#endif
-
-    if ( provider->proxy )
-    {
-	TRACE ("Inhibit");
-	provider->inhibitted = dbus_g_proxy_call (provider->proxy, "Inhibit", &error,
-						  G_TYPE_STRING , "Parole",
-						  G_TYPE_STRING, "Playing DVD",
-						  G_TYPE_INVALID, 
-						  G_TYPE_UINT, &provider->cookie,
-						  G_TYPE_INVALID);
-    }
-
-    if ( error )
-    {
-	g_warning ("Unable to inhibit the power manager : %s", error->message);
-	g_error_free (error);
-    }
-}
-
-static void
-pm_provider_uninhibit (PmProvider *provider)
-{
-    if ( provider->inhibitted && provider->cookie != 0 && provider->proxy )
-    {
-	GError *error = NULL;
-	
-	TRACE ("UnInhibit");
-	
-	dbus_g_proxy_call (provider->proxy, "UnInhibit", &error,
-			   G_TYPE_UINT, provider->cookie,
-			   G_TYPE_INVALID,
-			   G_TYPE_INVALID);
-			   
-	if ( error )
-	{
-	    g_warning ("Unable to inhibit the power manager : %s", error->message);
-	    g_error_free (error);
-	}
-	
-	provider->inhibitted = FALSE;
-	provider->cookie = 0;
-    }
-}
-
-static void
-pm_provider_state_changed_cb (ParoleProviderPlayer *player, 
-			      const ParoleStream *stream, 
-			      ParoleState state, 
-			      PmProvider *provider)
-{
-    ParoleMediaType media_type;
-    
-    g_object_get (G_OBJECT (stream),
-		  "media-type", &media_type,
-		  NULL);
-    
-    if ( (state == PAROLE_STATE_PLAYING) && 
-	 ( media_type == PAROLE_MEDIA_TYPE_VCD || 
-	   media_type == PAROLE_MEDIA_TYPE_DVB || 
-	   media_type == PAROLE_MEDIA_TYPE_DVD) )
-    {
-	pm_provider_inhibit (provider);
-    }
-    else
-    {
-	pm_provider_uninhibit (provider);
-    }
-}
-							  
-static gboolean pm_provider_is_configurable (ParoleProviderPlugin *plugin)
-{
-    return FALSE;
-}
-
-static void
-pm_provider_set_player (ParoleProviderPlugin *plugin, ParoleProviderPlayer *player)
-{
-    PmProvider *provider;
-    provider = PM_PROVIDER (plugin);
-    
-    provider->player = player;
-    
-    g_signal_connect (player, "state-changed", 
-		      G_CALLBACK (pm_provider_state_changed_cb), provider);
-}
-
-static void
-pm_provider_iface_init (ParoleProviderPluginIface *iface)
-{
-    iface->get_is_configurable = pm_provider_is_configurable;
-    iface->set_player = pm_provider_set_player;
-}
-
-static void pm_provider_class_init (PmProviderClass *klass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-    
-    gobject_class->finalize = pm_provider_finalize;
-}
-
-static void pm_provider_init (PmProvider *provider)
-{
-    GError *error = NULL;
-    provider->player = NULL;
-    provider->cookie = 0;
-    provider->proxy = NULL;
-    provider->inhibitted = FALSE;
-    
-    provider->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-    
-    if ( error )
-    {
-	g_warning ("Unable to get session bus : %s", error->message);
-	g_error_free (error);
-	return;
-    }
-    
-    provider->proxy = dbus_g_proxy_new_for_name (provider->bus,
-						 "org.freedesktop.PowerManagement",
-						 "/org/freedesktop/PowerManagement/Inhibit",
-						 "org.freedesktop.PowerManagement.Inhibit");
-    
-    if ( !provider->proxy )
-    {
-	g_warning ("Unable to get proxy for interface 'org.freedesktop.PowerManagement.Inhibit'");
-    }
-}
-
-static void pm_provider_finalize (GObject *object)
-{
-    PmProvider *provider;
-    
-    provider = PM_PROVIDER (object);
-
-    pm_provider_uninhibit (provider);
-    
-    if ( provider->proxy )
-	g_object_unref (provider->proxy);
-    
-    if ( provider->bus )
-	dbus_g_connection_unref (provider->bus);
-    
-    G_OBJECT_CLASS (pm_provider_parent_class)->finalize (object);
-}
diff --git a/src/plugins/power-manager/power-manager-provider.h b/src/plugins/power-manager/power-manager-provider.h
deleted file mode 100644
index cfc0544..0000000
--- a/src/plugins/power-manager/power-manager-provider.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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 Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef PM_PROVIDER_H_
-#define PM_PROVIDER_H_
-
-#include <src/misc/parole.h>
-
-G_BEGIN_DECLS
-
-typedef struct _PmProviderClass PmProviderClass;
-typedef struct _PmProvider      PmProvider;
-
-#define PM_TYPE_PROVIDER             (pm_provider_get_type ())
-#define PM_PROVIDER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), PM_TYPE_PROVIDER, PmProvider))
-#define PM_PROVIDER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), PM_TYPE_PROVIDER, PmProviderClass))
-#define PM_IS_PROVIDER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PM_TYPE_PROVIDER))
-#define PM_IS_PROVIDER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), PM_TYPE_PROVIDER))
-#define PM_PROVIDER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), PM_TYPE_PROVIDER, PmProviderClass))
-
-GType pm_provider_get_type      	(void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-void  pm_provider_register_type	(ParoleProviderPlugin *plugin);
-
-G_END_DECLS
-
-#endif /*PM_PROVIDER_H_*/
diff --git a/src/plugins/power-manager/power-manager.desktop.in b/src/plugins/power-manager/power-manager.desktop.in
deleted file mode 100644
index 4dbb26f..0000000
--- a/src/plugins/power-manager/power-manager.desktop.in
+++ /dev/null
@@ -1,6 +0,0 @@
-[Parole Plugin]
-Module=power-manager-plugin
-_Name=Power Manager Plugin
-_Description=Inhibit Power Manager from suspending the machine while playing DVD.
-Authors=Ali Abdallah aliov at xfce.org
-Website=http://goodies.xfce.org/projects/applications/parole


More information about the Xfce4-commits mailing list