Index: uspace/lib/draw/codec/tga.c
===================================================================
--- uspace/lib/draw/codec/tga.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/codec/tga.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -40,5 +40,5 @@
 #include <stdbool.h>
 #include <pixconv.h>
-#include "tga.h"
+#include <draw/codec.h>
 
 typedef struct {
Index: uspace/lib/draw/codec/tga.gz.c
===================================================================
--- uspace/lib/draw/codec/tga.gz.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/codec/tga.gz.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -37,6 +37,5 @@
 #include <gzip.h>
 #include <stdlib.h>
-#include "tga.gz.h"
-#include "tga.h"
+#include <draw/codec.h>
 
 /** Decode gzipped Truevision TGA format
Index: uspace/lib/draw/codec/tga.gz.h
===================================================================
--- uspace/lib/draw/codec/tga.gz.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_CODEC_TGA_GZ_H_
-#define DRAW_CODEC_TGA_GZ_H_
-
-#include <stddef.h>
-#include "../surface.h"
-
-extern surface_t *decode_tga_gz(void *, size_t, surface_flags_t);
-extern bool encode_tga_gz(surface_t *, void **, size_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/codec/tga.h
===================================================================
--- uspace/lib/draw/codec/tga.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_CODEC_TGA_H_
-#define DRAW_CODEC_TGA_H_
-
-#include <stddef.h>
-#include "../surface.h"
-
-extern surface_t *decode_tga(void *, size_t, surface_flags_t);
-extern bool encode_tga(surface_t *, void **, size_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/codec/webp.c
===================================================================
--- uspace/lib/draw/codec/webp.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/codec/webp.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -42,5 +42,5 @@
 #include <stdint.h>
 #include <abi/fourcc.h>
-#include "webp.h"
+#include <draw/codec.h>
 
 /** Check for input buffer overrun condition */
Index: uspace/lib/draw/codec/webp.h
===================================================================
--- uspace/lib/draw/codec/webp.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_CODEC_WEBP_H_
-#define DRAW_CODEC_WEBP_H_
-
-#include <stddef.h>
-#include "../surface.h"
-
-extern surface_t *decode_webp(void *, size_t, surface_flags_t);
-extern bool encode_webp(surface_t *, void **, size_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/cursor.c
===================================================================
--- uspace/lib/draw/cursor.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/cursor.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -36,6 +36,5 @@
 #include <stdlib.h>
 
-#include "cursor.h"
-#include "cursor/embedded.h"
+#include <draw/cursor.h>
 
 void cursor_init(cursor_t *cursor, cursor_decoder_type_t decoder, char *path)
Index: uspace/lib/draw/cursor.h
===================================================================
--- uspace/lib/draw/cursor.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_CURSOR_H_
-#define DRAW_CURSOR_H_
-
-#include <stdint.h>
-
-#include "surface.h"
-
-typedef enum {
-	CURSOR_DECODER_EMBEDDED
-} cursor_decoder_type_t;
-
-typedef struct {
-	void (*init)(char *, uint8_t *, void **);
-	surface_t *(*render)(uint8_t);
-	void (*release)(void *);
-} cursor_decoder_t;
-
-typedef struct cursor {
-	uint8_t state_count;
-	surface_t **states;
-	cursor_decoder_t *decoder;
-	void *decoder_data;
-} cursor_t;
-
-extern void cursor_init(cursor_t *, cursor_decoder_type_t, char *);
-extern void cursor_release(cursor_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/cursor/embedded.c
===================================================================
--- uspace/lib/draw/cursor/embedded.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/cursor/embedded.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -39,7 +39,7 @@
 #include <stdlib.h>
 
-#include "../gfx/cursor-11x18.h"
-#include "embedded.h"
-#include "../surface.h"
+#include <draw/gfx.h>
+#include <draw/cursor.h>
+#include <draw/surface.h>
 
 static void cde_init(char *path, uint8_t *state_count, void **data)
Index: uspace/lib/draw/cursor/embedded.h
===================================================================
--- uspace/lib/draw/cursor/embedded.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_CURSOR_EMBEDDED_H_
-#define DRAW_CURSOR_EMBEDDED_H_
-
-#include "../cursor.h"
-
-extern cursor_decoder_t cd_embedded;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/drawctx.c
===================================================================
--- uspace/lib/draw/drawctx.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/drawctx.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -38,5 +38,5 @@
 #include <stdlib.h>
 
-#include "drawctx.h"
+#include <draw/drawctx.h>
 
 void drawctx_init(drawctx_t *context, surface_t *surface)
Index: uspace/lib/draw/drawctx.h
===================================================================
--- uspace/lib/draw/drawctx.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_DRAWCTX_H_
-#define DRAW_DRAWCTX_H_
-
-#include <stdbool.h>
-
-#include <compose.h>
-
-#include "surface.h"
-#include "source.h"
-#include "path.h"
-#include "font.h"
-
-struct drawctx {
-	link_t link;
-	list_t list;
-
-	surface_t *surface;
-	compose_t compose;
-	surface_t *mask;
-	source_t *source;
-	font_t *font;
-
-	bool shall_clip;
-	sysarg_t clip_x;
-	sysarg_t clip_y;
-	sysarg_t clip_width;
-	sysarg_t clip_height;
-};
-
-extern void drawctx_init(drawctx_t *, surface_t *);
-
-extern void drawctx_save(drawctx_t *);
-extern void drawctx_restore(drawctx_t *);
-
-extern void drawctx_set_compose(drawctx_t *, compose_t);
-extern void drawctx_set_clip(drawctx_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
-extern void drawctx_set_mask(drawctx_t *, surface_t *);
-extern void drawctx_set_source(drawctx_t *, source_t *);
-extern void drawctx_set_font(drawctx_t *, font_t *);
-
-extern void drawctx_transfer(drawctx_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
-extern void drawctx_stroke(drawctx_t *, path_t *);
-extern void drawctx_fill(drawctx_t *, path_t *);
-extern void drawctx_print(drawctx_t *, const char *, sysarg_t, sysarg_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/font.c
===================================================================
--- uspace/lib/draw/font.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/font.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -39,7 +39,6 @@
 #include <str.h>
 
-#include "font.h"
-#include "font/embedded.h"
-#include "drawctx.h"
+#include <draw/font.h>
+#include <draw/drawctx.h>
 
 font_t *font_create(font_backend_t *backend, void *backend_data)
Index: uspace/lib/draw/font.h
===================================================================
--- uspace/lib/draw/font.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,125 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * Copyright (c) 2014 Martin Sucha
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_FONT_H_
-#define DRAW_FONT_H_
-
-#include <stdint.h>
-
-#include "surface.h"
-#include "source.h"
-
-struct drawctx;
-typedef struct drawctx drawctx_t;
-
-typedef int metric_t;
-
-typedef struct {
-	/* Horizontal distance between origin and left side of the glyph */
-	metric_t left_side_bearing;
-
-	/* Width of the actual glyph drawn */
-	metric_t width;
-
-	/*
-	 * Horizontal distance between right side of the glyph and origin
-	 * of the next glyph
-	 */
-	metric_t right_side_bearing;
-
-	/*
-	 * Vertical distance between baseline and top of the glyph
-	 * (positive to top)
-	 */
-	metric_t ascender;
-
-	/* Height of the actual glyph drawn */
-	metric_t height;
-} glyph_metrics_t;
-
-static inline metric_t glyph_metrics_get_descender(glyph_metrics_t *gm)
-{
-	return gm->height - gm->ascender;
-}
-
-static inline metric_t glyph_metrics_get_advancement(glyph_metrics_t *gm)
-{
-	return gm->left_side_bearing + gm->width + gm->right_side_bearing;
-}
-
-typedef struct {
-	/* Distance between top of the line and baseline */
-	metric_t ascender;
-
-	/* Distance between baseline and bottom of the line */
-	metric_t descender;
-
-	/* Distance between bottom of the line and top of the next line */
-	metric_t leading;
-} font_metrics_t;
-
-typedef uint32_t glyph_id_t;
-
-typedef struct {
-	errno_t (*get_font_metrics)(void *, font_metrics_t *);
-	errno_t (*resolve_glyph)(void *, wchar_t, glyph_id_t *);
-	errno_t (*get_glyph_metrics)(void *, glyph_id_t, glyph_metrics_t *);
-	errno_t (*render_glyph)(void *, drawctx_t *, source_t *, sysarg_t,
-	    sysarg_t, glyph_id_t);
-	void (*release)(void *);
-} font_backend_t;
-
-typedef struct {
-	font_backend_t *backend;
-	void *backend_data;
-} font_t;
-
-extern font_t *font_create(font_backend_t *, void *);
-extern errno_t font_get_metrics(font_t *, font_metrics_t *);
-extern errno_t font_resolve_glyph(font_t *, wchar_t, glyph_id_t *);
-extern errno_t font_get_glyph_metrics(font_t *, glyph_id_t, glyph_metrics_t *);
-extern errno_t font_render_glyph(font_t *, drawctx_t *, source_t *,
-    sysarg_t, sysarg_t, glyph_id_t);
-extern void font_release(font_t *);
-
-extern errno_t font_get_box(font_t *, char *, sysarg_t *, sysarg_t *);
-extern errno_t font_draw_text(font_t *, drawctx_t *, source_t *, const char *,
-    sysarg_t, sysarg_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/font/bitmap_backend.c
===================================================================
--- uspace/lib/draw/font/bitmap_backend.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/font/bitmap_backend.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -38,7 +38,6 @@
 #include <stdlib.h>
 
-#include "../font.h"
-#include "../drawctx.h"
-#include "bitmap_backend.h"
+#include <draw/font.h>
+#include <draw/drawctx.h>
 
 typedef struct {
Index: uspace/lib/draw/font/bitmap_backend.h
===================================================================
--- uspace/lib/draw/font/bitmap_backend.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * Copyright (c) 2014 Martin Sucha
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_FONT_BITMAP_BACKEND_H_
-#define DRAW_FONT_BITMAP_BACKEND_H_
-
-#include <stdint.h>
-
-#include "../font.h"
-#include "../surface.h"
-#include "../source.h"
-
-typedef struct {
-	errno_t (*resolve_glyph)(void *, const wchar_t, glyph_id_t *);
-	errno_t (*load_glyph_surface)(void *, glyph_id_t, surface_t **);
-	errno_t (*load_glyph_metrics)(void *, glyph_id_t, glyph_metrics_t *);
-	void (*release)(void *);
-} bitmap_font_decoder_t;
-
-extern errno_t bitmap_font_create(bitmap_font_decoder_t *, void *, uint32_t,
-    font_metrics_t, uint16_t, font_t **);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/font/embedded.c
===================================================================
--- uspace/lib/draw/font/embedded.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/font/embedded.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -39,8 +39,7 @@
 #include <stdlib.h>
 
-#include "../gfx/font-8x16.h"
-#include "embedded.h"
-#include "../drawctx.h"
-#include "bitmap_backend.h"
+#include <draw/gfx.h>
+#include <draw/font.h>
+#include <draw/drawctx.h>
 
 static errno_t fde_resolve_glyph(void *unused, const wchar_t chr,
Index: uspace/lib/draw/font/embedded.h
===================================================================
--- uspace/lib/draw/font/embedded.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_FONT_EMBEDDED_H_
-#define DRAW_FONT_EMBEDDED_H_
-
-#include "../font.h"
-
-extern errno_t embedded_font_create(font_t **, uint16_t points);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/font/pcf.c
===================================================================
--- uspace/lib/draw/font/pcf.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/font/pcf.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -44,7 +44,6 @@
 #include <str.h>
 
-#include "pcf.h"
-#include "../drawctx.h"
-#include "bitmap_backend.h"
+#include <draw/font.h>
+#include <draw/drawctx.h>
 
 #define PCF_TABLE_ACCELERATORS 0x02
Index: uspace/lib/draw/font/pcf.h
===================================================================
--- uspace/lib/draw/font/pcf.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Sucha
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_FONT_PBF_H_
-#define DRAW_FONT_PBF_H_
-
-#include "../font.h"
-
-extern errno_t pcf_font_create(font_t **, char *path, uint16_t points);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/gfx/cursor-11x18.c
===================================================================
--- uspace/lib/draw/gfx/cursor-11x18.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/gfx/cursor-11x18.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -34,5 +34,5 @@
  */
 
-#include "cursor-11x18.h"
+#include <draw/gfx.h>
 
 uint8_t cursor_texture[] = {
Index: uspace/lib/draw/gfx/cursor-11x18.h
===================================================================
--- uspace/lib/draw/gfx/cursor-11x18.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2008 Martin Decky
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/** @file
- */
-
-#ifndef CURSOR_11X18_H_
-#define CURSOR_11X18_H_
-
-#include <stdint.h>
-
-#define CURSOR_WIDTH   11
-#define CURSOR_HEIGHT  18
-
-extern uint8_t cursor_texture[];
-extern uint8_t cursor_mask[];
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/gfx/font-8x16.c
===================================================================
--- uspace/lib/draw/gfx/font-8x16.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/gfx/font-8x16.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -35,5 +35,5 @@
 
 #include <stdint.h>
-#include "font-8x16.h"
+#include <draw/gfx.h>
 
 /** Convert character to font glyph index
Index: uspace/lib/draw/gfx/font-8x16.h
===================================================================
--- uspace/lib/draw/gfx/font-8x16.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * Copyright (c) 2005 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/** @file
- */
-
-#ifndef FONT_8X16_H_
-#define FONT_8X16_H_
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-#define FONT_GLYPHS     2899
-#define FONT_WIDTH      8
-#define FONT_SCANLINES  16
-#define FONT_ASCENDER   12
-
-extern uint16_t fb_font_glyph(const wchar_t, bool *);
-extern uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES];
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/include/draw/codec.h
===================================================================
--- uspace/lib/draw/include/draw/codec.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/codec.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014 Martin Decky
+ * Copyright (c) 2011 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_CODEC_H_
+#define DRAW_CODEC_H_
+
+#include <stddef.h>
+#include "surface.h"
+
+extern surface_t *decode_tga_gz(void *, size_t, surface_flags_t);
+extern bool encode_tga_gz(surface_t *, void **, size_t *);
+extern surface_t *decode_tga(void *, size_t, surface_flags_t);
+extern bool encode_tga(surface_t *, void **, size_t *);
+extern surface_t *decode_webp(void *, size_t, surface_flags_t);
+extern bool encode_webp(surface_t *, void **, size_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/cursor.h
===================================================================
--- uspace/lib/draw/include/draw/cursor.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/cursor.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_CURSOR_H_
+#define DRAW_CURSOR_H_
+
+#include <stdint.h>
+
+#include "surface.h"
+
+typedef enum {
+	CURSOR_DECODER_EMBEDDED
+} cursor_decoder_type_t;
+
+typedef struct {
+	void (*init)(char *, uint8_t *, void **);
+	surface_t *(*render)(uint8_t);
+	void (*release)(void *);
+} cursor_decoder_t;
+
+typedef struct cursor {
+	uint8_t state_count;
+	surface_t **states;
+	cursor_decoder_t *decoder;
+	void *decoder_data;
+} cursor_t;
+
+extern cursor_decoder_t cd_embedded;
+
+extern void cursor_init(cursor_t *, cursor_decoder_type_t, char *);
+extern void cursor_release(cursor_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/drawctx.h
===================================================================
--- uspace/lib/draw/include/draw/drawctx.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/drawctx.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_DRAWCTX_H_
+#define DRAW_DRAWCTX_H_
+
+#include <stdbool.h>
+
+#include <compose.h>
+
+#include "surface.h"
+#include "source.h"
+#include "path.h"
+#include "font.h"
+
+struct drawctx {
+	link_t link;
+	list_t list;
+
+	surface_t *surface;
+	compose_t compose;
+	surface_t *mask;
+	source_t *source;
+	font_t *font;
+
+	bool shall_clip;
+	sysarg_t clip_x;
+	sysarg_t clip_y;
+	sysarg_t clip_width;
+	sysarg_t clip_height;
+};
+
+extern void drawctx_init(drawctx_t *, surface_t *);
+
+extern void drawctx_save(drawctx_t *);
+extern void drawctx_restore(drawctx_t *);
+
+extern void drawctx_set_compose(drawctx_t *, compose_t);
+extern void drawctx_set_clip(drawctx_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern void drawctx_set_mask(drawctx_t *, surface_t *);
+extern void drawctx_set_source(drawctx_t *, source_t *);
+extern void drawctx_set_font(drawctx_t *, font_t *);
+
+extern void drawctx_transfer(drawctx_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern void drawctx_stroke(drawctx_t *, path_t *);
+extern void drawctx_fill(drawctx_t *, path_t *);
+extern void drawctx_print(drawctx_t *, const char *, sysarg_t, sysarg_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/font.h
===================================================================
--- uspace/lib/draw/include/draw/font.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/font.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * Copyright (c) 2014 Martin Sucha
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_FONT_H_
+#define DRAW_FONT_H_
+
+#include <stdint.h>
+
+#include "font.h"
+#include "surface.h"
+#include "source.h"
+
+struct drawctx;
+typedef struct drawctx drawctx_t;
+
+typedef int metric_t;
+
+typedef struct {
+	/* Horizontal distance between origin and left side of the glyph */
+	metric_t left_side_bearing;
+
+	/* Width of the actual glyph drawn */
+	metric_t width;
+
+	/*
+	 * Horizontal distance between right side of the glyph and origin
+	 * of the next glyph
+	 */
+	metric_t right_side_bearing;
+
+	/*
+	 * Vertical distance between baseline and top of the glyph
+	 * (positive to top)
+	 */
+	metric_t ascender;
+
+	/* Height of the actual glyph drawn */
+	metric_t height;
+} glyph_metrics_t;
+
+static inline metric_t glyph_metrics_get_descender(glyph_metrics_t *gm)
+{
+	return gm->height - gm->ascender;
+}
+
+static inline metric_t glyph_metrics_get_advancement(glyph_metrics_t *gm)
+{
+	return gm->left_side_bearing + gm->width + gm->right_side_bearing;
+}
+
+typedef struct {
+	/* Distance between top of the line and baseline */
+	metric_t ascender;
+
+	/* Distance between baseline and bottom of the line */
+	metric_t descender;
+
+	/* Distance between bottom of the line and top of the next line */
+	metric_t leading;
+} font_metrics_t;
+
+typedef uint32_t glyph_id_t;
+
+typedef struct {
+	errno_t (*get_font_metrics)(void *, font_metrics_t *);
+	errno_t (*resolve_glyph)(void *, wchar_t, glyph_id_t *);
+	errno_t (*get_glyph_metrics)(void *, glyph_id_t, glyph_metrics_t *);
+	errno_t (*render_glyph)(void *, drawctx_t *, source_t *, sysarg_t,
+	    sysarg_t, glyph_id_t);
+	void (*release)(void *);
+} font_backend_t;
+
+typedef struct {
+	font_backend_t *backend;
+	void *backend_data;
+} font_t;
+
+typedef struct {
+	errno_t (*resolve_glyph)(void *, const wchar_t, glyph_id_t *);
+	errno_t (*load_glyph_surface)(void *, glyph_id_t, surface_t **);
+	errno_t (*load_glyph_metrics)(void *, glyph_id_t, glyph_metrics_t *);
+	void (*release)(void *);
+} bitmap_font_decoder_t;
+
+extern font_t *font_create(font_backend_t *, void *);
+extern errno_t font_get_metrics(font_t *, font_metrics_t *);
+extern errno_t font_resolve_glyph(font_t *, wchar_t, glyph_id_t *);
+extern errno_t font_get_glyph_metrics(font_t *, glyph_id_t, glyph_metrics_t *);
+extern errno_t font_render_glyph(font_t *, drawctx_t *, source_t *,
+    sysarg_t, sysarg_t, glyph_id_t);
+extern void font_release(font_t *);
+
+extern errno_t font_get_box(font_t *, char *, sysarg_t *, sysarg_t *);
+extern errno_t font_draw_text(font_t *, drawctx_t *, source_t *, const char *,
+    sysarg_t, sysarg_t);
+
+extern errno_t bitmap_font_create(bitmap_font_decoder_t *, void *, uint32_t,
+    font_metrics_t, uint16_t, font_t **);
+extern errno_t embedded_font_create(font_t **, uint16_t points);
+extern errno_t pcf_font_create(font_t **, char *path, uint16_t points);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/gfx.h
===================================================================
--- uspace/lib/draw/include/draw/gfx.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/gfx.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2008 Martin Decky
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/** @file
+ */
+
+#ifndef GFX_H_
+#define GFX_H_
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#define CURSOR_WIDTH   11
+#define CURSOR_HEIGHT  18
+
+#define FONT_GLYPHS     2899
+#define FONT_WIDTH      8
+#define FONT_SCANLINES  16
+#define FONT_ASCENDER   12
+
+extern uint8_t cursor_texture[];
+extern uint8_t cursor_mask[];
+
+extern uint16_t fb_font_glyph(const wchar_t, bool *);
+extern uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES];
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/path.h
===================================================================
--- uspace/lib/draw/include/draw/path.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/path.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_PATH_H_
+#define DRAW_PATH_H_
+
+#include <adt/list.h>
+
+typedef enum {
+	PATH_STEP_MOVETO,
+	PATH_STEP_LINETO
+} path_step_type_t;
+
+typedef struct {
+	link_t link;
+	path_step_type_t type;
+	double to_x;
+	double to_y;
+} path_step_t;
+
+struct path;
+typedef struct path path_t;
+
+extern void path_init(path_t *);
+extern void path_clear(path_t *);
+
+extern void path_get_cursor(path_t *, double *, double *);
+
+extern void path_move_to(path_t *, double, double);
+extern void path_line_to(path_t *, double, double);
+
+extern void path_rectangle(path_t *, double, double, double, double);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/source.h
===================================================================
--- uspace/lib/draw/include/draw/source.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/source.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_SOURCE_H_
+#define DRAW_SOURCE_H_
+
+#include <stdbool.h>
+
+#include <transform.h>
+#include <filter.h>
+#include <io/pixelmap.h>
+
+#include "surface.h"
+
+typedef struct source {
+	transform_t transform;
+	filter_t filter;
+
+	pixel_t color;
+	surface_t *texture;
+	pixelmap_extend_t texture_extend;
+
+	pixel_t alpha;
+	surface_t *mask;
+	pixelmap_extend_t mask_extend;
+} source_t;
+
+extern void source_init(source_t *);
+
+extern void source_set_transform(source_t *, transform_t);
+extern void source_reset_transform(source_t *);
+
+extern void source_set_filter(source_t *, filter_t);
+
+extern void source_set_color(source_t *, pixel_t);
+extern void source_set_texture(source_t *, surface_t *, pixelmap_extend_t);
+
+extern void source_set_alpha(source_t *, pixel_t);
+extern void source_set_mask(source_t *, surface_t *, pixelmap_extend_t);
+
+extern bool source_is_fast(source_t *);
+extern pixel_t *source_direct_access(source_t *, double, double);
+extern pixel_t source_determine_pixel(source_t *, double, double);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/include/draw/surface.h
===================================================================
--- uspace/lib/draw/include/draw/surface.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
+++ uspace/lib/draw/include/draw/surface.h	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * Copyright (c) 2012 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup draw
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DRAW_SURFACE_H_
+#define DRAW_SURFACE_H_
+
+#include <stdbool.h>
+#include <io/pixelmap.h>
+
+struct surface;
+typedef struct surface surface_t;
+
+typedef sysarg_t surface_coord_t;
+
+typedef enum {
+	SURFACE_FLAG_NONE = 0,
+	SURFACE_FLAG_SHARED = 1
+} surface_flags_t;
+
+extern surface_t *surface_create(surface_coord_t, surface_coord_t, pixel_t *, surface_flags_t);
+extern void surface_destroy(surface_t *);
+
+extern bool surface_is_shared(surface_t *);
+extern pixel_t *surface_direct_access(surface_t *);
+extern pixelmap_t *surface_pixmap_access(surface_t *);
+extern void surface_get_resolution(surface_t *, surface_coord_t *, surface_coord_t *);
+extern void surface_get_damaged_region(surface_t *, surface_coord_t *, surface_coord_t *,
+    surface_coord_t *, surface_coord_t *);
+extern void surface_add_damaged_region(surface_t *, surface_coord_t, surface_coord_t,
+    surface_coord_t, surface_coord_t);
+extern void surface_reset_damaged_region(surface_t *);
+
+extern void surface_put_pixel(surface_t *, surface_coord_t, surface_coord_t, pixel_t);
+extern pixel_t surface_get_pixel(surface_t *, surface_coord_t, surface_coord_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/draw/path.c
===================================================================
--- uspace/lib/draw/path.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/path.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -37,5 +37,5 @@
 #include <stdlib.h>
 
-#include "path.h"
+#include <draw/path.h>
 
 struct path {
Index: uspace/lib/draw/path.h
===================================================================
--- uspace/lib/draw/path.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_PATH_H_
-#define DRAW_PATH_H_
-
-#include <adt/list.h>
-
-typedef enum {
-	PATH_STEP_MOVETO,
-	PATH_STEP_LINETO
-} path_step_type_t;
-
-typedef struct {
-	link_t link;
-	path_step_type_t type;
-	double to_x;
-	double to_y;
-} path_step_t;
-
-struct path;
-typedef struct path path_t;
-
-extern void path_init(path_t *);
-extern void path_clear(path_t *);
-
-extern void path_get_cursor(path_t *, double *, double *);
-
-extern void path_move_to(path_t *, double, double);
-extern void path_line_to(path_t *, double, double);
-
-extern void path_rectangle(path_t *, double, double, double, double);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/source.c
===================================================================
--- uspace/lib/draw/source.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/source.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -36,5 +36,5 @@
 #include <assert.h>
 
-#include "source.h"
+#include <draw/source.h>
 
 void source_init(source_t *source)
Index: uspace/lib/draw/source.h
===================================================================
--- uspace/lib/draw/source.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_SOURCE_H_
-#define DRAW_SOURCE_H_
-
-#include <stdbool.h>
-
-#include <transform.h>
-#include <filter.h>
-#include <io/pixelmap.h>
-
-#include "surface.h"
-
-typedef struct source {
-	transform_t transform;
-	filter_t filter;
-
-	pixel_t color;
-	surface_t *texture;
-	pixelmap_extend_t texture_extend;
-
-	pixel_t alpha;
-	surface_t *mask;
-	pixelmap_extend_t mask_extend;
-} source_t;
-
-extern void source_init(source_t *);
-
-extern void source_set_transform(source_t *, transform_t);
-extern void source_reset_transform(source_t *);
-
-extern void source_set_filter(source_t *, filter_t);
-
-extern void source_set_color(source_t *, pixel_t);
-extern void source_set_texture(source_t *, surface_t *, pixelmap_extend_t);
-
-extern void source_set_alpha(source_t *, pixel_t);
-extern void source_set_mask(source_t *, surface_t *, pixelmap_extend_t);
-
-extern bool source_is_fast(source_t *);
-extern pixel_t *source_direct_access(source_t *, double, double);
-extern pixel_t source_determine_pixel(source_t *, double, double);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/draw/surface.c
===================================================================
--- uspace/lib/draw/surface.c	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ uspace/lib/draw/surface.c	(revision aeba7675fc6a092d45343fd8ca5cddf8aa3e374d)
@@ -39,5 +39,5 @@
 #include <assert.h>
 #include <stdlib.h>
-#include "surface.h"
+#include <draw/surface.h>
 
 struct surface {
Index: uspace/lib/draw/surface.h
===================================================================
--- uspace/lib/draw/surface.h	(revision dd500c26d08a5e01581111bd204d1724c4b2696a)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * Copyright (c) 2012 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup draw
- * @{
- */
-/**
- * @file
- */
-
-#ifndef DRAW_SURFACE_H_
-#define DRAW_SURFACE_H_
-
-#include <stdbool.h>
-#include <io/pixelmap.h>
-
-struct surface;
-typedef struct surface surface_t;
-
-typedef sysarg_t surface_coord_t;
-
-typedef enum {
-	SURFACE_FLAG_NONE = 0,
-	SURFACE_FLAG_SHARED = 1
-} surface_flags_t;
-
-extern surface_t *surface_create(surface_coord_t, surface_coord_t, pixel_t *, surface_flags_t);
-extern void surface_destroy(surface_t *);
-
-extern bool surface_is_shared(surface_t *);
-extern pixel_t *surface_direct_access(surface_t *);
-extern pixelmap_t *surface_pixmap_access(surface_t *);
-extern void surface_get_resolution(surface_t *, surface_coord_t *, surface_coord_t *);
-extern void surface_get_damaged_region(surface_t *, surface_coord_t *, surface_coord_t *,
-    surface_coord_t *, surface_coord_t *);
-extern void surface_add_damaged_region(surface_t *, surface_coord_t, surface_coord_t,
-    surface_coord_t, surface_coord_t);
-extern void surface_reset_damaged_region(surface_t *);
-
-extern void surface_put_pixel(surface_t *, surface_coord_t, surface_coord_t, pixel_t);
-extern pixel_t surface_get_pixel(surface_t *, surface_coord_t, surface_coord_t);
-
-#endif
-
-/** @}
- */
