summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:41:40 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:43:04 -0400
commit760fb0326cece1a3bc024a0c5db7c54119316bb5 (patch)
tree709c22a7c2e868a92782930b39c8961b23b5959a /src/lib/ecore_x
parent48bfcd106f7c355e8e921b66b286562009dad858 (diff)
ecore-xcb: Add implementation for missing API function
This patch adds an xcb implementation for missing ecore_x_randr_edid_display_serial_get function @fix Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index e7245005f7..8cef0eecbd 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -1,8 +1,5 @@
1/* TODO: List of missing functions 1/* TODO: List of missing functions
2 * 2 *
3 * ecore_x_randr_edid_display_ascii_get
4 * ecore_x_randr_edid_display_serial_get
5 * ecore_x_randr_edid_dpms_standby_available_get
6 * ecore_x_randr_edid_dpms_suspend_available_get 3 * ecore_x_randr_edid_dpms_suspend_available_get
7 * ecore_x_randr_edid_dpms_off_available_get 4 * ecore_x_randr_edid_dpms_off_available_get
8 * ecore_x_randr_edid_display_aspect_ratio_preferred_get 5 * ecore_x_randr_edid_display_aspect_ratio_preferred_get
@@ -3002,6 +2999,38 @@ ecore_x_randr_edid_display_ascii_get(unsigned char *edid, unsigned long edid_len
3002 return NULL; 2999 return NULL;
3003} 3000}
3004 3001
3002EAPI char *
3003ecore_x_randr_edid_display_serial_get(unsigned char *edid, unsigned long edid_length)
3004{
3005#ifdef ECORE_XCB_RANDR
3006 unsigned char *block = NULL;
3007 int version = 0;
3008
3009 version = ecore_x_randr_edid_version_get(edid, edid_length);
3010 if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
3011
3012 _ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
3013 {
3014 if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xff)
3015 {
3016 char *serial = NULL, *p = NULL;
3017 const char *edid_serial;
3018
3019 edid_serial = (const char *)block + 5;
3020
3021 if (!(serial = malloc(14))) return NULL;
3022 strncpy(serial, edid_serial, 13);
3023 serial[13] = 0;
3024 for (p = serial; *p; p++)
3025 if ((*p < ' ') || (*p > '~')) *p = 0;
3026
3027 return serial;
3028 }
3029 }
3030#endif
3031 return NULL;
3032}
3033
3005EAPI Eina_Bool 3034EAPI Eina_Bool
3006ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length) 3035ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length)
3007{ 3036{