[Pommed-commits] r388 - in trunk: . pommed

jblache at alioth.debian.org jblache at alioth.debian.org
Mon Nov 26 10:31:11 UTC 2007


Author: jblache
Date: 2007-11-26 10:31:11 +0000 (Mon, 26 Nov 2007)
New Revision: 388

Added:
   trunk/pommed/video.c
   trunk/pommed/video.h
Modified:
   trunk/ChangeLog
   trunk/pommed/Makefile
   trunk/pommed/dbus.c
   trunk/pommed/dbus.h
   trunk/pommed/evdev.c
Log:
Add videoSwitch DBus notification.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-11-25 13:27:01 UTC (rev 387)
+++ trunk/ChangeLog	2007-11-26 10:31:11 UTC (rev 388)
@@ -3,6 +3,7 @@
 
 version 1.13:
 	- pommed: add an option to disable the beep on volume change.
+	- pommed: add the videoSwitch DBus notification.
 
 version 1.12:
 	- pommed: do not expect at least 3 evdevs at startup; there are

Modified: trunk/pommed/Makefile
===================================================================
--- trunk/pommed/Makefile	2007-11-25 13:27:01 UTC (rev 387)
+++ trunk/pommed/Makefile	2007-11-26 10:31:11 UTC (rev 388)
@@ -23,7 +23,8 @@
 
 LDFLAGS = -lz $(DBUS_LIBS) $(ALSA_LIBS) $(AUDIOFILE_LIBS) $(CONFUSE_LIBS)
 
-SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c dbus.c power.c beep.c \
+SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c \
+		dbus.c power.c beep.c video.c \
 		pmac/sysfs_backlight.c pmac/pmu.c \
 		pmac/kbd_backlight.c pmac/ambient.c
 
@@ -43,7 +44,8 @@
 
 LDFLAGS = -lz -lsmbios $(DBUS_LIBS) $(ALSA_LIBS) $(AUDIOFILE_LIBS) $(CONFUSE_LIBS)
 
-SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c dbus.c power.c beep.c \
+SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c \
+		dbus.c power.c beep.c video.c \
 		mactel/x1600_backlight.c mactel/gma950_backlight.c \
 		mactel/nv8600mgt_backlight.c \
 		mactel/kbd_backlight.c mactel/ambient.c mactel/acpi.c
@@ -60,7 +62,7 @@
 
 cd_eject.o: cd_eject.c cd_eject.h pommed.h conffile.h dbus.h
 
-evdev.o: evdev.c evdev.h pommed.h kbd_backlight.h lcd_backlight.h cd_eject.h conffile.h audio.h beep.h
+evdev.o: evdev.c evdev.h pommed.h kbd_backlight.h lcd_backlight.h cd_eject.h conffile.h audio.h video.h beep.h
 
 conffile.o: conffile.c conffile.h pommed.h lcd_backlight.h kbd_backlight.h cd_eject.h audio.h beep.h
 
@@ -72,7 +74,9 @@
 
 beep.o: beep.c beep.h pommed.h audio.h
 
+video.o: video.c video.h pommed.h dbus.h
 
+
 # PowerMac-specific files
 pmac/kbd_backlight.o: pmac/kbd_backlight.c kbd_auto.c kbd_backlight.h pommed.h ambient.h conffile.h dbus.h
 

Modified: trunk/pommed/dbus.c
===================================================================
--- trunk/pommed/dbus.c	2007-11-25 13:27:01 UTC (rev 387)
+++ trunk/pommed/dbus.c	2007-11-26 10:31:11 UTC (rev 388)
@@ -332,7 +332,44 @@
   dbus_message_unref(msg);
 }
 
+void
+mbpdbus_send_video_switch(void)
+{
+  DBusMessage *msg;
 
+  int ret;
+
+  if (conn == NULL)
+    return;
+
+  logdebug("DBus video switch\n");
+
+  msg = dbus_message_new_signal("/org/pommed/notify/videoSwitch",
+				"org.pommed.signal.videoSwitch",
+				"videoSwitch");
+  if (msg == NULL)
+    {
+      logdebug("Failed to create DBus message\n");
+
+      return;
+    }
+
+  ret = dbus_connection_send(conn, msg, NULL);
+  if (ret == FALSE)
+    {
+      logdebug("Could not send videoSwitch signal\n");
+
+      dbus_message_unref(msg);
+
+      return;
+    }
+
+  dbus_connection_flush(conn);
+
+  dbus_message_unref(msg);
+}
+
+
 static void
 process_lcd_getlevel_call(DBusMessage *req)
 {

Modified: trunk/pommed/dbus.h
===================================================================
--- trunk/pommed/dbus.h	2007-11-25 13:27:01 UTC (rev 387)
+++ trunk/pommed/dbus.h	2007-11-26 10:31:11 UTC (rev 388)
@@ -24,7 +24,10 @@
 void
 mbpdbus_send_cd_eject(void);
 
+void
+mbpdbus_send_video_switch(void);
 
+
 void
 mbpdbus_process_requests(void);
 

Modified: trunk/pommed/evdev.c
===================================================================
--- trunk/pommed/evdev.c	2007-11-25 13:27:01 UTC (rev 387)
+++ trunk/pommed/evdev.c	2007-11-26 10:31:11 UTC (rev 388)
@@ -49,6 +49,7 @@
 #include "lcd_backlight.h"
 #include "cd_eject.h"
 #include "audio.h"
+#include "video.h"
 #include "beep.h"
 
 
@@ -193,6 +194,8 @@
 
 	  case K_VIDEO_TOGGLE:
 	    logdebug("\nKEY: video toggle\n");
+
+	    video_switch();
 	    break;
 
 	  case K_KBD_BCK_OFF:

Added: trunk/pommed/video.c
===================================================================
--- trunk/pommed/video.c	                        (rev 0)
+++ trunk/pommed/video.c	2007-11-26 10:31:11 UTC (rev 388)
@@ -0,0 +1,35 @@
+/*
+ * pommed - Apple laptops hotkeys handler daemon
+ *
+ * $Id$
+ *
+ * Copyright (C) 2007 Julien BLACHE <jb at jblache.org>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+
+#include <syslog.h>
+
+#include "pommed.h"
+#include "dbus.h"
+#include "video.h"
+
+
+void
+video_switch(void)
+{
+  mbpdbus_send_video_switch();
+}


Property changes on: trunk/pommed/video.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/pommed/video.h
===================================================================
--- trunk/pommed/video.h	                        (rev 0)
+++ trunk/pommed/video.h	2007-11-26 10:31:11 UTC (rev 388)
@@ -0,0 +1,14 @@
+/*
+ * $Id$
+ */
+
+#ifndef __VIDEO_H__
+#define __VIDEO_H__
+
+
+void
+video_switch(void);
+
+
+#endif /* !__VIDEO_H__ */
+


Property changes on: trunk/pommed/video.h
___________________________________________________________________
Name: svn:keywords
   + Id




More information about the Pommed-commits mailing list