r4925 - in /vdr/vdr-plugin-xineliboutput/trunk/debian: changelog control patches/00list patches/01_gnome-screensaver.dpatch
tschmidt at users.alioth.debian.org
tschmidt at users.alioth.debian.org
Wed Jul 4 19:26:04 UTC 2007
Author: tschmidt
Date: Wed Jul 4 19:26:04 2007
New Revision: 4925
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/?sc=1&rev=4925
Log:
* Added 01_gnome-screensaver.dpatch
* Build-Depend on libdbus-glib-1-dev
Added:
vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch (with props)
Modified:
vdr/vdr-plugin-xineliboutput/trunk/debian/changelog
vdr/vdr-plugin-xineliboutput/trunk/debian/control
vdr/vdr-plugin-xineliboutput/trunk/debian/patches/00list
Modified: vdr/vdr-plugin-xineliboutput/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/debian/changelog?rev=4925&op=diff
==============================================================================
--- vdr/vdr-plugin-xineliboutput/trunk/debian/changelog (original)
+++ vdr/vdr-plugin-xineliboutput/trunk/debian/changelog Wed Jul 4 19:26:04 2007
@@ -1,3 +1,10 @@
+vdr-plugin-xineliboutput (1.0.0~rc2-4) UNRELEASED; urgency=low
+
+ * Added 01_gnome-screensaver.dpatch
+ * Build-Depend on libdbus-glib-1-dev
+
+ -- Thomas Schmidt <tschmidt at debian.org> Mon, 2 Jul 2007 21:47:02 +0200
+
vdr-plugin-xineliboutput (1.0.0~rc2-3) unstable; urgency=low
* As suggested by Reinhard Tartler, force a tighter dependency on libxine1
Modified: vdr/vdr-plugin-xineliboutput/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/debian/control?rev=4925&op=diff
==============================================================================
--- vdr/vdr-plugin-xineliboutput/trunk/debian/control (original)
+++ vdr/vdr-plugin-xineliboutput/trunk/debian/control Wed Jul 4 19:26:04 2007
@@ -3,7 +3,7 @@
Priority: extra
Maintainer: Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org>
Uploaders: Tobias Grimm <tg at e-tobi.net>, Thomas Schmidt <tschmidt at debian.org>, Thomas Günther <tom at toms-cafe.de>
-Build-Depends: debhelper (>> 4.1.16), dpatch, vdr-dev (>= 1.4.5-2), libxine-dev (<< 1.1.8), libxine-dev (>= 1.1.7), libjpeg62-dev, libxv-dev, libx11-dev, libxext-dev, sharutils
+Build-Depends: debhelper (>> 4.1.16), dpatch, vdr-dev (>= 1.4.5-2), libxine-dev (<< 1.1.8), libxine-dev (>= 1.1.7), libjpeg62-dev, libxv-dev, libx11-dev, libxext-dev, sharutils, libdbus-glib-1-dev
Standards-Version: 3.7.2
XS-Vcs-Svn: svn://svn.debian.org/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/
XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/
Modified: vdr/vdr-plugin-xineliboutput/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/debian/patches/00list?rev=4925&op=diff
==============================================================================
--- vdr/vdr-plugin-xineliboutput/trunk/debian/patches/00list (original)
+++ vdr/vdr-plugin-xineliboutput/trunk/debian/patches/00list Wed Jul 4 19:26:04 2007
@@ -1,3 +1,4 @@
+01_gnome-screensaver
02_vdr-include-path
10_nosignal
90_xineliboutput-1.0.0rc2-1.5.3
Added: vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch?rev=4925&op=file
==============================================================================
--- vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch (added)
+++ vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch Wed Jul 4 19:26:04 2007
@@ -1,0 +1,271 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_gnome-screensaver.dpatch by Alex Stansfield <mailing-lists at jinkies.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allows vdr-sxfe to disable gnome-screensaver
+
+ at DPATCH@
+diff -urNad vdr-plugin-xineliboutput-1.0.0~rc2~/Makefile vdr-plugin-xineliboutput-1.0.0~rc2/Makefile
+--- vdr-plugin-xineliboutput-1.0.0~rc2~/Makefile 2007-05-18 13:10:37.000000000 +0200
++++ vdr-plugin-xineliboutput-1.0.0~rc2/Makefile 2007-07-02 21:42:19.000000000 +0200
+@@ -27,6 +27,9 @@
+
+ ifeq ($(XINELIBOUTPUT_X11), 1)
+ #$(warning Detected X11)
++
++ # Check for DBUS libs, if they exist we'll compile gnome screensaver support
++ XINELIBOUTPUT_DBUS = $(shell (pkg-config --exists dbus-glib-1 >/dev/null 2>&1 && echo "1") || echo "0")
+ else
+ $(warning ********************************************************)
+ $(warning X11 not detected ! X11 frontends will not be compiled. )
+@@ -46,6 +49,7 @@
+
+ USE_ICONV = 1
+ #XINELIBOUTPUT_X11 = 1
++#XINELIBOUTPUT_DBUS = 1
+ #XINELIBOUTPUT_FB = 1
+ #XINELIBOUTPUT_XINEPLUGIN = 1
+ #XINELIBOUTPUT_VDRPLUGIN = 1
+@@ -233,6 +237,14 @@
+ DEFINES += -DSTARTUP_IMAGE_FILE='"$(STARTUP_IMAGE_FILE)"'
+ endif
+
++# dbus define, libs and includes for gnome screensaver support
++ifeq ($(XINELIBOUTPUT_DBUS), 1)
++ DEFINES += -DHAVE_DBUS_GLIB
++ LIBS_DBUS += $(shell pkg-config --libs dbus-glib-1 2>/dev/null)
++ INCLUDES += $(shell pkg-config --cflags dbus-glib-1 2>/dev/null)
++endif
++
++
+
+ ###
+ ### configuration
+@@ -259,8 +271,13 @@
+ endif
+
+ ifeq ($(XINELIBOUTPUT_X11), 1)
+- OBJS_SXFE_SO = xine_sxfe_frontend.o xine/post.o
+- OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o tools/vdrdiscovery_standalone.o
++ ifeq ($(XINELIBOUTPUT_DBUS), 1)
++ OBJS_SXFE_SO = xine_sxfe_frontend.o xine/post.o gnome_screensaver.o
++ OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o tools/vdrdiscovery_standalone.o gnome_screensaver.o
++ else
++ OBJS_SXFE_SO = xine_sxfe_frontend.o xine/post.o
++ OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o tools/vdrdiscovery_standalone.o
++ endif
+ else
+ OBJS_SXFE_SO =
+ OBJS_SXFE =
+@@ -330,7 +347,7 @@
+
+ xine_sxfe_frontend.o: xine_sxfe_frontend.c xine_frontend.c xine_frontend.h \
+ xine_input_vdr.h xine_osd_command.h xine/post.h logdefs.h \
+- xineliboutput.c
++ xineliboutput.c gnome_screensaver.c
+ $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_sxfe_frontend.c
+ xine_fbfe_frontend.o: xine_fbfe_frontend.c xine_frontend.c xine_frontend.h \
+ xine_input_vdr.h xine_osd_command.h xine/post.h logdefs.h \
+@@ -339,13 +356,15 @@
+ xine_sxfe_frontend_standalone.o: xine_sxfe_frontend.c xine_frontend.c \
+ xine_frontend.h xine_input_vdr.h xine_osd_command.h \
+ xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \
+- xineliboutput.c tools/vdrdiscovery.h
++ xineliboutput.c tools/vdrdiscovery.h gnome_screensaver.c
+ $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) xine_sxfe_frontend.c -o $@
+ xine_fbfe_frontend_standalone.o: xine_fbfe_frontend.c xine_frontend.c \
+ xine_frontend.h xine_input_vdr.h xine_osd_command.h \
+ xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \
+ xineliboutput.c tools/vdrdiscovery.h
+ $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) xine_fbfe_frontend.c -o $@
++gnome_screensaver.o: gnome_screensaver.c gnome_screensaver.h
++ $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) gnome_screensaver.c
+
+
+ ###
+@@ -383,11 +402,11 @@
+
+ ifeq ($(XINELIBOUTPUT_X11), 1)
+ $(VDRPLUGIN_SXFE_SO): $(OBJS_SXFE_SO)
+- $(CC) $(CFLAGS) $(LDFLAGS_SO) $(OBJS_SXFE_SO) $(LIBS_X11) $(LIBS_XINE) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS_SO) $(OBJS_SXFE_SO) $(LIBS_X11) ${LIBS_DBUS} $(LIBS_XINE) -o $@
+ @-rm -rf $(LIBDIR)/$(VDRPLUGIN_SXFE_SO).$(VERSION)
+ @cp $@ $(LIBDIR)/$(VDRPLUGIN_SXFE_SO).$(VERSION)
+ $(VDRSXFE): $(OBJS_SXFE)
+- $(CC) -g $(OBJS_SXFE) $(LIBS_X11) -ljpeg $(LIBS_XINE) -o $@
++ $(CC) -g $(OBJS_SXFE) $(LIBS_X11) ${LIBS_DBUS} -ljpeg $(LIBS_XINE) -o $@
+ endif
+
+ ifeq ($(XINELIBOUTPUT_FB), 1)
+diff -urNad vdr-plugin-xineliboutput-1.0.0~rc2~/gnome_screensaver.c vdr-plugin-xineliboutput-1.0.0~rc2/gnome_screensaver.c
+--- vdr-plugin-xineliboutput-1.0.0~rc2~/gnome_screensaver.c 1970-01-01 01:00:00.000000000 +0100
++++ vdr-plugin-xineliboutput-1.0.0~rc2/gnome_screensaver.c 2007-07-02 21:42:19.000000000 +0200
+@@ -0,0 +1,122 @@
++/*
++ * gnome_screensaver.c v0.0.7
++ *
++ * Enable/Disable the GNOME screensaver
++ * Supports GNOME screensaver API 2.14 and 2.15
++ *
++ * Call gnome_screensaver_control(1) to enable and
++ * gnome_screensaver_control(0) to disable
++ *
++ */
++
++#include <stdlib.h>
++#include <unistd.h>
++#include <dbus/dbus-glib.h>
++#include <stdio.h>
++#include <stdarg.h>
++#include <string.h>
++
++#define NEED_x_syslog
++#define LOG_MODULENAME "[vdr-fe] "
++
++#include "logdefs.h"
++#include "gnome_screensaver.h"
++
++#define GS_SERVICE "org.gnome.ScreenSaver"
++#define GS_PATH "/org/gnome/ScreenSaver"
++#define GS_INTERFACE "org.gnome.ScreenSaver"
++
++#define GS_APPLICATION_NAME "vdr-sxfe"
++#define GS_REASON_FOR_INHIBIT "Watching TV"
++
++// Log Messages
++#define MSG_OpenBusConnectionError "Failed to open connection to bus: %s"
++#define MSG_RemoteMethodException "Caught remote method exception %s: %s"
++#define MSG_GnomeAPI215Failed "GNOME screensaver 2.15 API failed, trying 2.14 API"
++#define MSG_GError "Error: %s"
++#define MSG_GNOMEScreensaverEnabled "GNOME screensaver enabled"
++#define MSG_GNOMEScreensaverDisabled "GNOME screensaver disabled"
++
++static guint32 cookie;
++
++void gnome_screensaver_control(int enable)
++{
++ DBusGConnection *connection;
++ GError *error;
++ DBusGProxy *proxy;
++ gboolean ret;
++
++ g_type_init();
++
++ /* Get a connection to the session bus */
++ error = NULL;
++ connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
++ if (connection == NULL) {
++ LOGERR(MSG_OpenBusConnectionError, error->message);
++ g_error_free(error);
++ return;
++ }
++
++ /* Create a proxy object */
++ proxy = dbus_g_proxy_new_for_name(connection,
++ GS_SERVICE, GS_PATH, GS_INTERFACE);
++
++ /* Enable the screensaver */
++ if (enable) {
++ /* First call the GNOME screensaver 2.15 API method */
++ error = NULL;
++ ret =
++ dbus_g_proxy_call(proxy, "UnInhibit", &error, G_TYPE_UINT,
++ cookie, G_TYPE_INVALID, G_TYPE_INVALID);
++
++ /* If this fails, try the GNOME screensaver 2.14 API */
++ if (!ret && error->domain == DBUS_GERROR
++ && error->code == DBUS_GERROR_UNKNOWN_METHOD) {
++ LOGERR(MSG_GnomeAPI215Failed);
++ g_error_free(error);
++ error = NULL;
++ ret =
++ dbus_g_proxy_call(proxy, "AllowActivation", &error,
++ G_TYPE_INVALID, G_TYPE_INVALID);
++ }
++ }
++ /* Disable the screensaver */
++ else {
++ /* First call the GNOME screensaver 2.15 API method */
++ error = NULL;
++ ret =
++ dbus_g_proxy_call(proxy, "Inhibit", &error, G_TYPE_STRING,
++ GS_APPLICATION_NAME, G_TYPE_STRING,
++ GS_REASON_FOR_INHIBIT, G_TYPE_INVALID,
++ G_TYPE_UINT, cookie, G_TYPE_INVALID);
++
++ /* If this fails, try the GNOME screensaver 2.14 API */
++ if (!ret && error->domain == DBUS_GERROR
++ && error->code == DBUS_GERROR_UNKNOWN_METHOD) {
++ LOGERR(MSG_GnomeAPI215Failed);
++ g_error_free(error);
++ error = NULL;
++ ret =
++ dbus_g_proxy_call(proxy, "InhibitActivation", &error,
++ G_TYPE_STRING, GS_REASON_FOR_INHIBIT,
++ G_TYPE_INVALID, G_TYPE_INVALID);
++ }
++ }
++
++ if (!ret) {
++ /* Check if it's a remote exception or a regular GError */
++ if (error->domain == DBUS_GERROR
++ && error->code == DBUS_GERROR_REMOTE_EXCEPTION) {
++ LOGERR(MSG_RemoteMethodException, dbus_g_error_get_name(error), error->message);
++ }
++ else {
++ LOGERR(MSG_GError, error->message);
++ }
++ g_error_free(error);
++ }
++ else {
++ LOGMSG(enable ? MSG_GNOMEScreensaverEnabled : MSG_GNOMEScreensaverDisabled);
++ }
++
++ g_object_unref(proxy);
++}
+diff -urNad vdr-plugin-xineliboutput-1.0.0~rc2~/gnome_screensaver.h vdr-plugin-xineliboutput-1.0.0~rc2/gnome_screensaver.h
+--- vdr-plugin-xineliboutput-1.0.0~rc2~/gnome_screensaver.h 1970-01-01 01:00:00.000000000 +0100
++++ vdr-plugin-xineliboutput-1.0.0~rc2/gnome_screensaver.h 2007-07-02 21:42:19.000000000 +0200
+@@ -0,0 +1,6 @@
++#ifndef _GNOME_SCREENSAVER_H
++#define _GNOME_SCREENSAVER_H
++
++extern void gnome_screensaver_control(int enable);
++
++#endif /* !_GNOME_SCREENSAVER_H */
+diff -urNad vdr-plugin-xineliboutput-1.0.0~rc2~/xine_sxfe_frontend.c vdr-plugin-xineliboutput-1.0.0~rc2/xine_sxfe_frontend.c
+--- vdr-plugin-xineliboutput-1.0.0~rc2~/xine_sxfe_frontend.c 2007-03-17 13:41:21.000000000 +0100
++++ vdr-plugin-xineliboutput-1.0.0~rc2/xine_sxfe_frontend.c 2007-07-02 21:42:19.000000000 +0200
+@@ -63,6 +63,10 @@
+
+ #include "xine_frontend.h"
+ #include "xine/post.h"
++
++#ifdef HAVE_DBUS_GLIB
++# include "gnome_screensaver.h"
++#endif
+
+ #define MWM_HINTS_DECORATIONS (1L << 1)
+ #define PROP_MWM_HINTS_ELEMENTS 5
+@@ -561,6 +565,10 @@
+ }
+ #endif
+
++#ifdef HAVE_DBUS_GLIB
++ gnome_screensaver_control(0);
++#endif
++
+ this->xine_visual_type = XINE_VISUAL_TYPE_X11;
+ this->vis.display = this->display;
+ this->vis.screen = this->screen;
+@@ -881,6 +889,10 @@
+
+ if(this && this->display) {
+
++#ifdef HAVE_DBUS_GLIB
++ gnome_screensaver_control(1);
++#endif
++
+ if(this->xine)
+ this->fe.xine_exit(this_gen);
+
Propchange: vdr/vdr-plugin-xineliboutput/trunk/debian/patches/01_gnome-screensaver.dpatch
------------------------------------------------------------------------------
svn:executable = *
More information about the pkg-vdr-dvb-changes
mailing list