weston/clients
Bryce Harrington e776f2a4d9 config-parser: Add weston_config_section_get_color
Previously weston_config_section_get_uint was serving dual purpose for
parsing both unsigned decimal integer values (ids, counts, seconds,
etc.)  and hexadecimal values (colors), by relying on strtoul's
auto-detection mechanism.

However, this usage is unable to catch certain kinds of error
conditions, such as specifying a negative number where an unsigned
should be used.  And for colors in particular, it would misparse hex
values if the leading 0x was omitted.  E.g. "background-color=99999999"
would render a near-black background (effectively 0x05f5e0ff) instead of
medium grey, and "background-color=ffffffff" would be treated as an
error rather than white.  "background-color=0x01234567",
"background-color=01234567", and "background-color=1234567" each
resulted in the value being parsed as hexadecimal, octal, and decimal
respectively, resulting in colors 0x01234567, 0x00053977, and 0x0012d687
being displayed.

This new routine forces hexadecimal to be used in all cases when parsing
color values, so "0x01234567" and "01234567" result in the same color
value, "99999999" is grey, and "ffffffff" is white.  It also requires
exactly 8 or 10 digits (other lengths likely indicate typos), or the
value "0" (black).

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-07-26 15:57:14 -07:00
..
calibrator.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
clickdot.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
cliptest.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
confine.c clients/confine: Toggle maximized state with 'm' 2016-07-26 17:21:15 +08:00
desktop-shell.c config-parser: Add weston_config_section_get_color 2016-07-26 15:57:14 -07:00
dnd.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
editor.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
eventdemo.c eventdemo: use %u for uint32_t printing 2016-05-16 15:01:45 +03:00
flower.c client: fix spelling mistake 2016-04-05 16:00:21 -07:00
fullscreen.c clients: Use zalloc 2016-03-09 22:54:54 -08:00
gears.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
image.c cosmetic: Remove a few double semicolons 2015-10-07 11:22:03 -07:00
ivi-shell-user-interface.c config-parser: Add weston_config_section_get_color 2016-07-26 15:57:14 -07:00
keyboard.c keyboard: Only set toplevel when there is a valid output 2016-06-27 14:23:05 +03:00
multi-resource.c multi-resource: Check for no digits in time description 2016-07-08 18:05:56 -07:00
nested-client.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
nested.c clients/nested: use weston_check_egl_extension over strstr 2016-07-22 15:29:04 +01:00
presentation-shm.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
resizor.c clients/resizor: Use pointer locking for resizing window 2016-07-26 17:21:15 +08:00
scaler.c clients/scaler: migrate to wp_viewporter 2016-06-09 11:07:22 +03:00
screenshot.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
simple-damage.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
simple-dmabuf-intel.c clients/dmabuf-intel: use three buffers 2016-06-17 11:30:37 +03:00
simple-dmabuf-v4l.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
simple-egl.c clients/simple-egl: use weston_check_egl_extension over strstr 2016-07-22 15:29:17 +01:00
simple-shm.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
simple-touch.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
smoke.c client: fix spelling mistake 2016-04-05 16:00:21 -07:00
stacking.c clients: Correct drawing glitch in stacking demo 2015-10-21 16:57:47 -05:00
subsurfaces.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
terminal.c terminal: Document console codes less cryptically 2016-06-16 11:10:35 -07:00
transformed.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
weston-info.c weston-info: look for the right wp_presentation 2016-04-22 10:43:40 +03:00
weston-simple-im.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
window.c window: Add API for manually set confine region 2016-07-26 17:21:15 +08:00
window.h window: Add API for manually set confine region 2016-07-26 17:21:15 +08:00