diff options
Diffstat (limited to 'src/lib/ecore_x/xcb/ecore_xcb_randr.c')
-rw-r--r-- | src/lib/ecore_x/xcb/ecore_xcb_randr.c | 32 |
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 | |||
2970 | return NULL; | 2970 | return NULL; |
2971 | } | 2971 | } |
2972 | 2972 | ||
2973 | EAPI char * | ||
2974 | ecore_x_randr_edid_display_ascii_get(unsigned char *edid, unsigned long edid_length) | ||
2975 | { | ||
2976 | #ifdef ECORE_XCB_RANDR | ||
2977 | unsigned char *block = NULL; | ||
2978 | int version = 0; | ||
2979 | |||
2980 | version = ecore_x_randr_edid_version_get(edid, edid_length); | ||
2981 | if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL; | ||
2982 | |||
2983 | _ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block) | ||
2984 | { | ||
2985 | if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfe) | ||
2986 | { | ||
2987 | char *ascii = NULL, *p = NULL; | ||
2988 | const char *edid_ascii; | ||
2989 | |||
2990 | edid_ascii = (const char *)block + 5; | ||
2991 | |||
2992 | if (!(ascii = malloc(14))) return NULL; | ||
2993 | strncpy(ascii, edid_ascii, 13); | ||
2994 | ascii[13] = 0; | ||
2995 | for (p = ascii; *p; p++) | ||
2996 | if ((*p < ' ') || (*p > '~')) *p = 0; | ||
2997 | |||
2998 | return ascii; | ||
2999 | } | ||
3000 | } | ||
3001 | #endif | ||
3002 | return NULL; | ||
3003 | } | ||
3004 | |||
2973 | EAPI Eina_Bool | 3005 | EAPI Eina_Bool |
2974 | ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length) | 3006 | ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length) |
2975 | { | 3007 | { |