summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Taylor <rob.taylor@codethink.co.uk>2007-09-24 18:07:44 +0100
committerRob Taylor <rob.taylor@codethink.co.uk>2007-09-24 18:07:44 +0100
commitcfa3c5ee97c159742685c1c0c8012ae7c078aa41 (patch)
tree856f645c9616d1047773326e822231b59432c3f5
parent7920baf543a25504697bb711ef59d150bcd8ed10 (diff)
Support pre hal 0.5.10 org.freedesktop.Hal.Device.LaptopPanel.SetBrightness
Pre 0.5.10, SetBrightness returned an int32, in newer hal it returns uint32 for consistency. This patch will build the backlight plugin supporting pre 0.5.10 if the libhal installed at buildtime is pre 0.5.10 # Please enter the commit message for your changes. # (Comment lines starting with '#' will not be included) # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: configure.in # modified: plugins/glue/backlight/ohm-plugin-backlight.c # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # docs/index.html # docs/reference/libohm/html/ # docs/reference/libohm/libohm-decl-list.txt # docs/reference/libohm/libohm-decl.txt # docs/reference/libohm/libohm-overrides.txt # docs/reference/libohm/libohm-sections.txt # docs/reference/libohm/libohm-undocumented.txt # docs/reference/libohm/libohm.types # docs/reference/libohm/tmpl/ # docs/reference/libohm/xml/ # docs/reference/ohm-plugin/html/ # docs/reference/ohm-plugin/ohm-plugin-decl.txt # docs/reference/ohm-plugin/ohm-plugin-undocumented.txt # docs/reference/ohm-plugin/tmpl/ # docs/reference/ohm-plugin/xml/ # gtk-doc.make # local-ohm.patch
-rw-r--r--configure.in4
-rw-r--r--plugins/glue/backlight/ohm-plugin-backlight.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 1a4ecdd..6adc831 100644
--- a/configure.in
+++ b/configure.in
@@ -101,6 +101,10 @@ PKG_CHECK_MODULES(HAL, hal >= 0.5.7)
AC_SUBST(HAL_CFLAGS)
AC_SUBST(HAL_LIBS)
+if pkg-config --atleast-version=0.5.10 hal; then
+ AC_DEFINE(HAL_SET_BRIGHTNESS_UNSIGNED, 1, [org.freedesktop.Hal.Device.LaptopPanel.SetBrightness returns UINT32])
+fi
+
PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.10.0 gdk-x11-2.0 >= 2.10.0)
AC_SUBST(GDK_CFLAGS)
AC_SUBST(GDK_LIBS)
diff --git a/plugins/glue/backlight/ohm-plugin-backlight.c b/plugins/glue/backlight/ohm-plugin-backlight.c
index ee64036..e5c0388 100644
--- a/plugins/glue/backlight/ohm-plugin-backlight.c
+++ b/plugins/glue/backlight/ohm-plugin-backlight.c
@@ -66,11 +66,20 @@ backlight_set_brightness (OhmPlugin *plugin, guint brightness)
/* get the brightness from HAL */
error = NULL;
+#ifdef HAL_SET_BRIGHTNESS_UNSIGNED
ret = dbus_g_proxy_call (proxy, "SetBrightness", &error,
G_TYPE_INT, (int)brightness,
G_TYPE_INVALID,
G_TYPE_UINT, &retval,
G_TYPE_INVALID);
+#else
+ ret = dbus_g_proxy_call (proxy, "SetBrightness", &error,
+ G_TYPE_INT, (int)brightness,
+ G_TYPE_INVALID,
+ G_TYPE_INT, &retval,
+ G_TYPE_INVALID);
+#endif
+
if (error != NULL) {
g_printerr ("Error: %s\n", error->message);
g_error_free (error);