aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:39:33 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:39:33 -0400
commit48bfcd106f7c355e8e921b66b286562009dad858 (patch)
treefc7ab08e52a5d3e068c43b402d798c5a28808365 /src
parentecore-xcb: Add implementation for missing API function (diff)
downloadefl-48bfcd106f7c355e8e921b66b286562009dad858.tar.gz
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 <cpmichael@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index ad50ddaab2..e7245005f7 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)
{