Index: uspace/lib/c/include/device/graph_dev.h
===================================================================
--- uspace/lib/c/include/device/graph_dev.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/device/graph_dev.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,49 @@
+/*
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_DEVICE_GRAPH_DEV_H_
+#define LIBC_DEVICE_GRAPH_DEV_H_
+
+#include <async.h>
+
+typedef enum {
+	GRAPH_DEV_CONNECT = 0
+} graph_dev_method_t;
+
+extern int graph_dev_connect(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/charfield.h
===================================================================
--- uspace/lib/c/include/io/charfield.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/charfield.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2006 Josef Cejka
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_CHARFIELD_H_
+#define LIBC_IO_CHARFIELD_H_
+
+#include <sys/types.h>
+#include <bool.h>
+#include <io/color.h>
+#include <io/style.h>
+#include <io/pixel.h>
+
+typedef enum {
+	CHAR_FLAG_NONE = 0,
+	CHAR_FLAG_DIRTY = 1
+} char_flags_t;
+
+typedef enum {
+	CHAR_ATTR_STYLE,
+	CHAR_ATTR_INDEX,
+	CHAR_ATTR_RGB
+} char_attr_type_t;
+
+typedef struct {
+	console_color_t bgcolor;
+	console_color_t fgcolor;
+	console_color_attr_t attr;
+} char_attr_index_t;
+
+typedef struct {
+	pixel_t bgcolor;
+	pixel_t fgcolor;
+} char_attr_rgb_t;
+
+typedef union {
+	console_style_t style;
+	char_attr_index_t index;
+	char_attr_rgb_t rgb;
+} char_attr_val_t;
+
+typedef struct {
+	char_attr_type_t type;
+	char_attr_val_t val;
+} char_attrs_t;
+
+typedef struct {
+	wchar_t ch;
+	char_attrs_t attrs;
+	char_flags_t flags;
+} charfield_t;
+
+static inline bool attrs_same(char_attrs_t a1, char_attrs_t a2)
+{
+	if (a1.type != a2.type)
+		return false;
+	
+	switch (a1.type) {
+	case CHAR_ATTR_STYLE:
+		return (a1.val.style == a2.val.style);
+	case CHAR_ATTR_INDEX:
+		return (a1.val.index.bgcolor == a2.val.index.bgcolor)
+		    && (a1.val.index.fgcolor == a2.val.index.fgcolor)
+		    && (a1.val.index.attr == a2.val.index.attr);
+	case CHAR_ATTR_RGB:
+		return (a1.val.rgb.bgcolor == a2.val.rgb.bgcolor)
+		    && (a1.val.rgb.fgcolor == a2.val.rgb.fgcolor);
+	}
+	
+	return false;
+}
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/chargrid.h
===================================================================
--- uspace/lib/c/include/io/chargrid.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/chargrid.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2011 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 libc
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef LIBC_IO_CHARGRID_H_
+#define LIBC_IO_CHARGRID_H_
+
+#include <sys/types.h>
+#include <io/charfield.h>
+
+typedef enum {
+	CHARGRID_FLAG_NONE = 0,
+	CHARGRID_FLAG_SHARED = 1
+} chargrid_flag_t;
+
+typedef struct {
+	size_t size;            /**< Structure size */
+	chargrid_flag_t flags;  /**< Screenbuffer flags */
+	
+	sysarg_t cols;          /**< Number of columns */
+	sysarg_t rows;          /**< Number of rows */
+	
+	sysarg_t col;           /**< Current column */
+	sysarg_t row;           /**< Current row */
+	bool cursor_visible;    /**< Cursor visibility */
+	
+	char_attrs_t attrs;     /**< Current attributes */
+	
+	sysarg_t top_row;       /**< The first row in the cyclic buffer */
+	charfield_t data[];     /**< Screen contents (cyclic buffer) */
+} chargrid_t;
+
+static inline charfield_t *chargrid_charfield_at(chargrid_t *chargrid,
+    sysarg_t col, sysarg_t row)
+{
+	return chargrid->data +
+	    ((row + chargrid->top_row) % chargrid->rows) * chargrid->cols +
+	    col;
+}
+
+extern chargrid_t *chargrid_create(sysarg_t, sysarg_t,
+    chargrid_flag_t);
+extern void chargrid_destroy(chargrid_t *);
+
+extern bool chargrid_cursor_at(chargrid_t *, sysarg_t, sysarg_t);
+
+extern sysarg_t chargrid_get_top_row(chargrid_t *);
+
+extern sysarg_t chargrid_putchar(chargrid_t *, wchar_t, bool);
+extern sysarg_t chargrid_newline(chargrid_t *);
+extern sysarg_t chargrid_tabstop(chargrid_t *, sysarg_t);
+extern sysarg_t chargrid_backspace(chargrid_t *);
+
+extern void chargrid_clear(chargrid_t *);
+extern void chargrid_clear_row(chargrid_t *, sysarg_t);
+
+extern void chargrid_set_cursor(chargrid_t *, sysarg_t, sysarg_t);
+extern void chargrid_set_cursor_visibility(chargrid_t *, bool);
+extern bool chargrid_get_cursor_visibility(chargrid_t *);
+
+extern void chargrid_get_cursor(chargrid_t *, sysarg_t *, sysarg_t *);
+
+extern void chargrid_set_style(chargrid_t *, console_style_t);
+extern void chargrid_set_color(chargrid_t *, console_color_t,
+    console_color_t, console_color_attr_t);
+extern void chargrid_set_rgb_color(chargrid_t *, pixel_t, pixel_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/mode.h
===================================================================
--- uspace/lib/c/include/io/mode.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/mode.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,76 @@
+/*
+ * 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 libc
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef LIBC_IO_MODE_H_
+#define LIBC_IO_MODE_H_
+
+#include <abi/fb/visuals.h>
+#include <sys/types.h>
+#include <adt/list.h>
+#include <io/pixel.h>
+#include <io/charfield.h>
+
+typedef struct {
+	sysarg_t width;
+	sysarg_t height;
+} aspect_ratio_t;
+
+typedef union {
+	visual_t pixel_visual;
+	char_attr_type_t field_visual;
+} cell_visual_t;
+
+typedef struct {
+	sysarg_t index;
+	sysarg_t version;
+	
+	sysarg_t refresh_rate;
+	aspect_ratio_t screen_aspect;
+	sysarg_t screen_width;
+	sysarg_t screen_height;
+	
+	aspect_ratio_t cell_aspect;
+	cell_visual_t cell_visual;
+} vslmode_t;
+
+typedef struct {
+	link_t link;
+	vslmode_t mode;
+} vslmode_list_element_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/output.h
===================================================================
--- uspace/lib/c/include/io/output.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/output.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_OUTPUT_H_
+#define LIBC_IO_OUTPUT_H_
+
+#include <ipc/output.h>
+#include <io/chargrid.h>
+#include <io/console.h>
+
+extern int output_yield(async_sess_t *);
+extern int output_claim(async_sess_t *);
+extern int output_get_dimensions(async_sess_t *, sysarg_t *, sysarg_t *);
+extern int output_get_caps(async_sess_t *, console_caps_t *);
+
+extern frontbuf_handle_t output_frontbuf_create(async_sess_t *, chargrid_t *);
+
+extern int output_cursor_update(async_sess_t *, frontbuf_handle_t);
+extern int output_set_style(async_sess_t *, console_style_t);
+
+extern int output_update(async_sess_t *, frontbuf_handle_t);
+extern int output_damage(async_sess_t *, frontbuf_handle_t,
+    sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/pixel.h
===================================================================
--- uspace/lib/c/include/io/pixel.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/pixel.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,58 @@
+/*
+ * 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 libc
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef LIBC_IO_PIXEL_H_
+#define LIBC_IO_PIXEL_H_
+
+#include <sys/types.h>
+
+#define NARROW(channel, bits) \
+	((channel) >> (8 - (bits)))
+
+#define ALPHA(pixel)  ((pixel) >> 24)
+#define RED(pixel)    (((pixel) & 0x00ff0000) >> 16)
+#define GREEN(pixel)  (((pixel) & 0x0000ff00) >> 8)
+#define BLUE(pixel)   ((pixel) & 0x000000ff)
+
+#define PIXEL(a, r, g, b) \
+	((((a) & 0xff) << 24) | (((r) & 0xff) << 16) | \
+	(((g) & 0xff) << 8) | ((b) & 0xff))
+
+typedef uint32_t pixel_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/pixelmap.h
===================================================================
--- uspace/lib/c/include/io/pixelmap.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/pixelmap.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,87 @@
+/*
+ * 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 libc
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef LIBC_IO_PIXELMAP_H_
+#define LIBC_IO_PIXELMAP_H_
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <io/pixel.h>
+
+typedef struct {
+	sysarg_t width;
+	sysarg_t height;
+	pixel_t *data;
+} pixelmap_t;
+
+static inline pixel_t *pixelmap_pixel_at(
+    pixelmap_t *pixelmap,
+    sysarg_t x,
+    sysarg_t y)
+{
+	size_t offset = y * pixelmap->width + x;
+	pixel_t *pixel = pixelmap->data + offset;
+	return pixel;
+}
+
+static inline void pixelmap_put_pixel(
+    pixelmap_t * pixelmap,
+    sysarg_t x,
+    sysarg_t y,
+    pixel_t pixel)
+{
+	pixel_t *target = pixelmap_pixel_at(pixelmap, x, y);
+	if (target != NULL) {
+		*target = pixel;
+	}
+}
+
+static inline pixel_t pixelmap_get_pixel(
+    pixelmap_t *pixelmap,
+    sysarg_t x,
+    sysarg_t y)
+{
+	pixel_t *source = pixelmap_pixel_at(pixelmap, x, y);
+	if (source != NULL) {
+		return *source;
+	} else {
+		return 0;
+	}
+}
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/visualizer.h
===================================================================
--- uspace/lib/c/include/io/visualizer.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/visualizer.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,60 @@
+/*
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_VISUALIZER_H_
+#define LIBC_IO_VISUALIZER_H_
+
+#include <sys/types.h>
+#include <async.h>
+#include <io/mode.h>
+
+extern int visualizer_claim(async_sess_t *, sysarg_t);
+extern int visualizer_yield(async_sess_t *);
+
+extern int visualizer_enumerate_modes(async_sess_t *, vslmode_t *, sysarg_t);
+extern int visualizer_get_default_mode(async_sess_t *, vslmode_t *);
+extern int visualizer_get_current_mode(async_sess_t *, vslmode_t *);
+extern int visualizer_get_mode(async_sess_t *, vslmode_t *, sysarg_t);
+extern int visualizer_set_mode(async_sess_t *, sysarg_t, sysarg_t, void *);
+
+extern int visualizer_update_damaged_region(async_sess_t *,
+    sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+
+extern int visualizer_suspend(async_sess_t *);
+extern int visualizer_wakeup(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/window.h
===================================================================
--- uspace/lib/c/include/io/window.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/io/window.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,115 @@
+/*
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_WINDOW_H_
+#define LIBC_IO_WINDOW_H_
+
+#include <bool.h>
+#include <sys/types.h>
+#include <async.h>
+#include <loc.h>
+#include <io/console.h>
+
+typedef enum {
+	POS_UPDATE,
+	POS_PRESS,
+	POS_RELEASE
+} pos_event_type_t;
+
+typedef struct {
+	sysarg_t pos_id;
+	pos_event_type_t type;
+	sysarg_t btn_num;
+	sysarg_t hpos;
+	sysarg_t vpos;
+} pos_event_t;
+
+typedef struct {
+	sysarg_t object;
+	sysarg_t slot;
+	sysarg_t argument;
+} sig_event_t;
+
+typedef struct {
+	sysarg_t width;
+	sysarg_t height;
+} rsz_event_t;
+
+typedef enum {
+	ET_KEYBOARD_EVENT,
+	ET_POSITION_EVENT,
+	ET_SIGNAL_EVENT,
+	ET_WINDOW_RESIZE,
+	ET_WINDOW_REFRESH,
+	ET_WINDOW_DAMAGE,
+	ET_WINDOW_CLOSE
+} window_event_type_t;
+
+typedef union {
+	kbd_event_t kbd;
+	pos_event_t pos;
+	sig_event_t sig;
+	rsz_event_t rsz;
+} window_event_data_t;
+
+typedef struct {
+	link_t link;
+	window_event_type_t type;
+	window_event_data_t data;
+} window_event_t;
+
+typedef enum {
+	GF_EMPTY = 0,
+	GF_MOVE_X = 1,
+	GF_MOVE_Y = 2,
+	GF_RESIZE_X = 4,
+	GF_RESIZE_Y = 8,
+	GF_SCALE_X = 16,
+	GF_SCALE_Y = 32
+} window_grab_flags_t;
+
+extern int win_register(async_sess_t *, service_id_t *, service_id_t *);
+
+extern int win_get_event(async_sess_t *, window_event_t *);
+
+extern int win_damage(async_sess_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern int win_grab(async_sess_t *, sysarg_t, sysarg_t);
+extern int win_resize(async_sess_t *, sysarg_t, sysarg_t, void *);
+extern int win_close(async_sess_t *);
+extern int win_close_request(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ipc/dev_iface.h
===================================================================
--- uspace/lib/c/include/ipc/dev_iface.h	(revision 9f5cf682316ed39433d78a5a4d75f3d62faf22be)
+++ uspace/lib/c/include/ipc/dev_iface.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -38,4 +38,7 @@
 	/** Character device interface */
 	CHAR_DEV_IFACE,
+
+	/** Graphic device interface */
+	GRAPH_DEV_IFACE,
 	
 	/** Network interface controller interface */
Index: uspace/lib/c/include/ipc/graph.h
===================================================================
--- uspace/lib/c/include/ipc/graph.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/ipc/graph.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,74 @@
+/*
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_GRAPH_H_
+#define LIBC_IPC_GRAPH_H_
+
+#include <ipc/common.h>
+
+typedef enum {
+	VISUALIZER_CLAIM = IPC_FIRST_USER_METHOD,
+	VISUALIZER_YIELD,
+	
+	VISUALIZER_ENUMERATE_MODES,
+	VISUALIZER_GET_DEFAULT_MODE,
+	VISUALIZER_GET_CURRENT_MODE,
+	VISUALIZER_GET_MODE,
+	VISUALIZER_SET_MODE,
+	
+	VISUALIZER_UPDATE_DAMAGED_REGION,
+	
+	VISUALIZER_SUSPEND,
+	VISUALIZER_WAKE_UP,
+} visualizer_request_t;
+
+typedef enum {
+	VISUALIZER_MODE_CHANGE = IPC_FIRST_USER_METHOD,
+	VISUALIZER_DISCONNECT
+} visualizer_notif_t;
+
+typedef enum {
+	RENDERER_REQ_NONE = IPC_FIRST_USER_METHOD,
+	// TODO: similar interface as provides libsoftrend
+} renderer_request_t;
+
+typedef enum {
+	RENDERER_NOTIF_NONE = IPC_FIRST_USER_METHOD,
+	// TODO: similar interface as provides libsoftrend
+} renderer_notif_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ipc/output.h
===================================================================
--- uspace/lib/c/include/ipc/output.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/ipc/output.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2012 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 libcipc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_OUTPUT_H_
+#define LIBC_IPC_OUTPUT_H_
+
+#include <ipc/common.h>
+
+typedef sysarg_t frontbuf_handle_t;
+
+typedef enum {
+	OUTPUT_YIELD = IPC_FIRST_USER_METHOD,
+	OUTPUT_CLAIM,
+	OUTPUT_GET_DIMENSIONS,
+	OUTPUT_GET_CAPS,
+	
+	OUTPUT_FRONTBUF_CREATE,
+	OUTPUT_FRONTBUF_DESTROY,
+	
+	OUTPUT_CURSOR_UPDATE,
+	OUTPUT_SET_STYLE,
+	OUTPUT_SET_COLOR,
+	OUTPUT_SET_RGB_COLOR,
+	
+	OUTPUT_UPDATE,
+	OUTPUT_DAMAGE
+} output_request_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/c/include/ipc/window.h
===================================================================
--- uspace/lib/c/include/ipc/window.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
+++ uspace/lib/c/include/ipc/window.h	(revision 7d27f422ee7822eb3b75e43fd8ced187eb45d3f3)
@@ -0,0 +1,53 @@
+/*
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_WINDOW_H_
+#define LIBC_IPC_WINDOW_H_
+
+#include <ipc/vfs.h>
+
+typedef enum {
+	WINDOW_REGISTER = IPC_FIRST_USER_METHOD,
+	WINDOW_GET_EVENT,
+	WINDOW_DAMAGE,
+	WINDOW_GRAB,
+	WINDOW_RESIZE,
+	WINDOW_CLOSE,
+	WINDOW_CLOSE_REQUEST
+} window_request_t;
+
+#endif
+
+/** @}
+ */
