devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=48bfcd106f7c355e8e921b66b286562009dad858

commit 48bfcd106f7c355e8e921b66b286562009dad858
Author: Chris Michael <cpmich...@osg.samsung.com>
Date:   Tue Apr 5 09:39:33 2016 -0400

    ecore-xcb: Add implementation for missing API function
    
    This patch adds an xcb implementation for missing
    ecore_x_randr_edid_display_ascii_get function
    
    @fix
    
    Signed-off-by: Chris Michael <cpmich...@osg.samsung.com>
---
 src/lib/ecore_x/xcb/ecore_xcb_randr.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c 
b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index ad50dda..e724500 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -2970,6 +2970,38 @@ ecore_x_randr_edid_display_name_get(unsigned char *edid, 
unsigned long edid_leng
    return NULL;
 }
 
+EAPI char *
+ecore_x_randr_edid_display_ascii_get(unsigned char *edid, unsigned long 
edid_length) 
+{
+#ifdef ECORE_XCB_RANDR
+   unsigned char *block = NULL;
+   int version = 0;
+
+   version = ecore_x_randr_edid_version_get(edid, edid_length);
+   if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
+
+   _ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
+     {
+        if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfe)
+          {
+             char *ascii = NULL, *p = NULL;
+             const char *edid_ascii;
+
+             edid_ascii = (const char *)block + 5;
+
+             if (!(ascii = malloc(14))) return NULL;
+             strncpy(ascii, edid_ascii, 13);
+             ascii[13] = 0;
+             for (p = ascii; *p; p++)
+               if ((*p < ' ') || (*p > '~')) *p = 0;
+
+             return ascii;
+          }
+     }
+#endif
+   return NULL;
+}
+
 EAPI Eina_Bool
 ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long 
edid_length)
 {

-- 


Reply via email to