[gnome-settings-daemon] Add special handling for wacom OLED labels starting with base64:



commit 6023bb865f77501bcfbac24539d07da16b7dacba
Author: Przemo Firszt <przemo firszt eu>
Date:   Fri May 17 19:04:36 2013 +0100

    Add special handling for wacom OLED labels starting with base64:
    
    This patch is the first step to use icons for Intuos4 OLEDs. All labels starting
    with MAGIC_BASE64 string "base64:" are passed to helper without modification
    except stripping the magic part. This will allow to store icons in the same way
    we currently store labels.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700499

 plugins/wacom/gsd-wacom-oled.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-oled.c b/plugins/wacom/gsd-wacom-oled.c
index 1eb9464..e610e92 100644
--- a/plugins/wacom/gsd-wacom-oled.c
+++ b/plugins/wacom/gsd-wacom-oled.c
@@ -31,7 +31,8 @@
 #include "gsd-wacom-device.h"
 #include "gsd-wacom-oled.h"
 
-#define MAGIC_BASE64        "base64:"        /*Label starting with base64: is treated as already encoded*/
+#define MAGIC_BASE64           "base64:"               /*Label starting with base64: is treated as already 
encoded*/
+#define MAGIC_BASE64_LEN       strlen(MAGIC_BASE64)
 
 static void
 oled_scramble_icon (guchar* image)
@@ -252,7 +253,11 @@ set_oled (GsdWacomDevice   *device,
        button_id_1 = g_strdup (button_id);
        button_id_short = (int)button_id_1[6];
        button_id_short = button_id_short - 'A' - 1;
-       buffer = oled_encode_image (label);
+
+       if (g_str_has_prefix (label, MAGIC_BASE64))
+               buffer = g_strdup (label + MAGIC_BASE64_LEN);
+       else
+               buffer = oled_encode_image (label);
 
        path = gsd_wacom_device_get_path (device);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]