diff options
author | Jens Granseuer <jensgr@gmx.net> | 2008-04-07 18:42:48 +0000 |
---|---|---|
committer | Jens Granseuer <jensg@src.gnome.org> | 2008-04-07 18:42:48 +0000 |
commit | f0de1cff34c7693602dc65d1403e39f4f6eed0f9 (patch) | |
tree | e4964a32a7703cb0350b201e1a772d3814d97eef /plugins | |
parent | 3a5440a29f7870f7760fa39e9ffea7442739db07 (diff) | |
download | gnome-settings-daemon-f0de1cff34c7693602dc65d1403e39f4f6eed0f9.tar.gz |
Remove the Thinkpad driver again. See bug #524425 for some discussion.
2008-04-07 Jens Granseuer <jensgr@gmx.net>
Remove the Thinkpad driver again. See bug #524425 for some discussion.
* configure.ac:
* plugins/media-keys/actions/Makefile.am:
* plugins/media-keys/actions/acme-volume-thinkpad.c:
* plugins/media-keys/actions/acme-volume-thinkpad.h:
* plugins/media-keys/actions/acme-volume.c: (acme_volume_new): remove
extra Thinkpad support
svn path=/trunk/; revision=273
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/media-keys/actions/Makefile.am | 7 | ||||
-rw-r--r-- | plugins/media-keys/actions/acme-volume-thinkpad.c | 117 | ||||
-rw-r--r-- | plugins/media-keys/actions/acme-volume-thinkpad.h | 47 | ||||
-rw-r--r-- | plugins/media-keys/actions/acme-volume.c | 14 |
4 files changed, 0 insertions, 185 deletions
diff --git a/plugins/media-keys/actions/Makefile.am b/plugins/media-keys/actions/Makefile.am index 4b9f1c22..706e0a24 100644 --- a/plugins/media-keys/actions/Makefile.am +++ b/plugins/media-keys/actions/Makefile.am @@ -61,13 +61,6 @@ endif # HAVE_OSS endif # HAVE_ALSA endif # HAVE_GSTREAMER -if ENABLE_IBM_THINKPAD -libacme_la_SOURCES += \ - acme-volume-thinkpad.c \ - acme-volume-thinkpad.h \ - $(NULL) -endif - gladedir = $(pkgdatadir) glade_DATA = \ acme.glade \ diff --git a/plugins/media-keys/actions/acme-volume-thinkpad.c b/plugins/media-keys/actions/acme-volume-thinkpad.c deleted file mode 100644 index 6fbe60ce..00000000 --- a/plugins/media-keys/actions/acme-volume-thinkpad.c +++ /dev/null @@ -1,117 +0,0 @@ -/* acme-volume-thinkpad.c - - Adds Thinkpad speaker volume reading. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - By Lorne Applebaum <4lorne@gmail.com> -*/ - -#include "config.h" -#include <stdio.h> -#include "acme-volume-thinkpad.h" - -static GObjectClass *parent_class = NULL; - -G_DEFINE_TYPE (AcmeVolumeThinkpad, acme_volume_thinkpad, ACME_TYPE_VOLUME) - -/* Parses the ACPI data found at /proc/acpi/ibm/volume. It typically - looks like - -level: 3 -mute: off -commands: up, down, mute -commands: level <level> (<level> is 0-15) - - -The ibm-acpi kernel driver is required */ -static gboolean -acme_volume_thinkpad_parse_acpi (int *level, gboolean *mute_status) -{ - FILE *fd; - char mute_string [4]; - - fd = fopen (ACME_VOLUME_THINKPAD_ACPI_PATH, "r"); - if (fd == 0) - return FALSE; - - - if (fscanf (fd, "level: %d mute: %3s", level, mute_string) != 2) - { - fclose (fd); - return FALSE; - } - - *mute_status = strcmp (mute_string, "off"); - - fclose (fd); - return TRUE; -} - -static void -acme_volume_thinkpad_set_mute (AcmeVolume *vol, gboolean val) -{ - /* No need to set anything. Hardware takes care of it. */ -} - -static gboolean -acme_volume_thinkpad_get_mute (AcmeVolume *vol) -{ - int volume; - gboolean mute; - if (acme_volume_thinkpad_parse_acpi (&volume, &mute)) - return mute; - return FALSE; -} - -static int -acme_volume_thinkpad_get_volume (AcmeVolume *vol) -{ - int volume; - gboolean mute; - if (acme_volume_thinkpad_parse_acpi (&volume, &mute)) - { - /* Convert to a volume between 0 and 100. The ibm-acpi - driver outputs a value between 0 and 15 */ - return CLAMP (volume*7, 0, 100); - } - else - return 0; -} - -static void -acme_volume_thinkpad_set_volume (AcmeVolume *vol, int val) -{ - /* No need to set anything. Hardware takes care of it. */ -} - -static void -acme_volume_thinkpad_init (AcmeVolumeThinkpad *self) -{ -} - -static void -acme_volume_thinkpad_class_init (AcmeVolumeThinkpadClass *klass) -{ - AcmeVolumeClass *volume_class = ACME_VOLUME_CLASS (klass); - - parent_class = g_type_class_peek_parent (klass); - - volume_class->set_volume = acme_volume_thinkpad_set_volume; - volume_class->get_volume = acme_volume_thinkpad_get_volume; - volume_class->set_mute = acme_volume_thinkpad_set_mute; - volume_class->get_mute = acme_volume_thinkpad_get_mute; -} diff --git a/plugins/media-keys/actions/acme-volume-thinkpad.h b/plugins/media-keys/actions/acme-volume-thinkpad.h deleted file mode 100644 index 82b927d8..00000000 --- a/plugins/media-keys/actions/acme-volume-thinkpad.h +++ /dev/null @@ -1,47 +0,0 @@ - /* acme-volume-thinkpad.h - - Adds Thinkpad speaker volume support. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - By Lorne Applebaum <4lorne@gmail.com> - - */ - -#include <glib.h> -#include <glib-object.h> -#include "acme-volume.h" - -#define ACME_TYPE_VOLUME_THINKPAD (acme_volume_thinkpad_get_type ()) -#define ACME_VOLUME_THINKPAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ACME_TYPE_VOLUME_THINKPAD, AcmeVolumeThinkpad)) -#define ACME_VOLUME_THINKPAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ACME_TYPE_VOLUME_THINKPAD, AcmeVolumeThinkpadClass)) -#define ACME_IS_VOLUME_THINKPAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ACME_TYPE_VOLUME_THINKPAD)) -#define ACME_VOLUME_THINKPAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ACME_TYPE_VOLUME_THINKPAD, AcmeVolumeThinkpadClass)) - -typedef struct AcmeVolumeThinkpad AcmeVolumeThinkpad; -typedef struct AcmeVolumeThinkpadClass AcmeVolumeThinkpadClass; - -struct AcmeVolumeThinkpad { - AcmeVolume parent; -}; - -struct AcmeVolumeThinkpadClass { - AcmeVolumeClass parent; -}; - -GType acme_volume_thinkpad_get_type (void); - -#define ACME_VOLUME_THINKPAD_ACPI_PATH "/proc/acpi/ibm/volume" diff --git a/plugins/media-keys/actions/acme-volume.c b/plugins/media-keys/actions/acme-volume.c index ca811282..0170b170 100644 --- a/plugins/media-keys/actions/acme-volume.c +++ b/plugins/media-keys/actions/acme-volume.c @@ -31,9 +31,6 @@ #ifdef HAVE_GSTREAMER #include "acme-volume-gstreamer.h" #endif -#ifdef ENABLE_IBM_THINKPAD -#include "acme-volume-thinkpad.h" -#endif static GObjectClass *parent_class = NULL; @@ -102,17 +99,6 @@ AcmeVolume *acme_volume_new (void) { AcmeVolume *vol; -#ifdef ENABLE_IBM_THINKPAD - /* Check if we should be doing ThinkPad speaker volume handling - rather than the software stuff. Checking for the existence - of /proc/acpi/ibm/volume put in place by the ibm-acpi - kernel driver */ - if (g_file_test (ACME_VOLUME_THINKPAD_ACPI_PATH, G_FILE_TEST_IS_REGULAR)) - { - vol = ACME_VOLUME (g_object_new (acme_volume_thinkpad_get_type (), NULL)); - return vol; - } -#endif #ifdef HAVE_GSTREAMER vol = ACME_VOLUME (g_object_new (acme_volume_gstreamer_get_type (), NULL)); return vol; |