Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision caad59aaedb0d9190a12111b1fd41fed41df0d07)
+++ uspace/app/edit/edit.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -40,5 +40,5 @@
 #include <vfs/vfs.h>
 #include <io/console.h>
-#include <io/color.h>
+#include <io/style.h>
 #include <io/keycode.h>
 #include <errno.h>
@@ -100,5 +100,6 @@
 static bool cursor_visible;
 
-static int scr_rows, scr_columns;
+static ipcarg_t scr_rows;
+static ipcarg_t scr_columns;
 
 #define ROW_BUF_SIZE 4096
@@ -505,8 +506,8 @@
 	asprintf(&str, "%s: %s", prompt, init_value);
 	status_display(str);
-	console_goto(con, 1 + str_length(str), scr_rows - 1);
+	console_set_pos(con, 1 + str_length(str), scr_rows - 1);
 	free(str);
 
-	console_set_color(con, COLOR_WHITE, COLOR_BLACK, 0);
+	console_set_style(con, STYLE_INVERTED);
 
 	max_len = min(INFNAME_MAX_LEN, scr_columns - 4 - str_length(prompt));
@@ -552,5 +553,5 @@
 	str = wstr_to_astr(buffer);
 
-	console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+	console_set_style(con, STYLE_NORMAL);
 
 	return str;
@@ -671,5 +672,4 @@
 {
 	int sh_rows, rows;
-	int i, j;
 
 	sheet_get_num_rows(&doc.sh, &sh_rows);
@@ -678,11 +678,13 @@
 	/* Draw rows from the sheet. */
 
-	console_goto(con, 0, 0);
+	console_set_pos(con, 0, 0);
 	pane_row_range_display(0, rows);
 
 	/* Clear the remaining rows if file is short. */
-
+	
+	int i;
+	ipcarg_t j;
 	for (i = rows; i < pane.rows; ++i) {
-		console_goto(con, 0, i);
+		console_set_pos(con, 0, i);
 		for (j = 0; j < scr_columns; ++j)
 			putchar(' ');
@@ -736,5 +738,5 @@
 	/* Draw rows from the sheet. */
 
-	console_goto(con, 0, 0);
+	console_set_pos(con, 0, 0);
 	for (i = r0; i < r1; ++i) {
 		/* Starting point for row display */
@@ -756,9 +758,9 @@
 		    coord_cmp(&rbc, &csel_end) < 0) {
 			fflush(stdout);
-			console_set_color(con, COLOR_BLACK, COLOR_RED, 0);
+			console_set_style(con, STYLE_SELECTED);
 			fflush(stdout);
 		}
 
-		console_goto(con, 0, i);
+		console_set_pos(con, 0, i);
 		size = str_size(row_buf);
 		pos = 0;
@@ -767,5 +769,5 @@
 			if ((csel_start.row == rbc.row) && (csel_start.column == s_column)) {
 				fflush(stdout);
-				console_set_color(con, COLOR_BLACK, COLOR_RED, 0);
+				console_set_style(con, STYLE_SELECTED);
 				fflush(stdout);
 			}
@@ -773,5 +775,5 @@
 			if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) {
 				fflush(stdout);
-				console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+				console_set_style(con, STYLE_NORMAL);
 				fflush(stdout);
 			}
@@ -793,5 +795,5 @@
 		if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) {
 			fflush(stdout);
-			console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+			console_set_style(con, STYLE_NORMAL);
 			fflush(stdout);
 		}
@@ -807,5 +809,5 @@
 			putchar(' ');
 		fflush(stdout);
-		console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+		console_set_style(con, STYLE_NORMAL);
 	}
 
@@ -824,11 +826,11 @@
 	const char *fname = (doc.file_name != NULL) ? doc.file_name : "<unnamed>";
 
-	console_goto(con, 0, scr_rows - 1);
-	console_set_color(con, COLOR_WHITE, COLOR_BLACK, 0);
+	console_set_pos(con, 0, scr_rows - 1);
+	console_set_style(con, STYLE_INVERTED);
 	int n = printf(" %d, %d: File '%s'. Ctrl-Q Quit  Ctrl-S Save  "
 	    "Ctrl-E Save As", coord.row, coord.column, fname);
 	printf("%*s", scr_columns - 1 - n, "");
 	fflush(stdout);
-	console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+	console_set_style(con, STYLE_NORMAL);
 
 	pane.rflags |= REDRAW_CARET;
@@ -844,5 +846,5 @@
 
 	spt_get_coord(&caret_pt, &coord);
-	console_goto(con, coord.column - pane.sh_column,
+	console_set_pos(con, coord.column - pane.sh_column,
 	    coord.row - pane.sh_row);
 }
@@ -1149,9 +1151,9 @@
 static void status_display(char const *str)
 {
-	console_goto(con, 0, scr_rows - 1);
-	console_set_color(con, COLOR_WHITE, COLOR_BLACK, 0);
+	console_set_pos(con, 0, scr_rows - 1);
+	console_set_style(con, STYLE_INVERTED);
 	printf(" %*s ", -(scr_columns - 3), str);
 	fflush(stdout);
-	console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
+	console_set_style(con, STYLE_NORMAL);
 
 	pane.rflags |= REDRAW_CARET;
Index: uspace/app/tester/console/console1.c
===================================================================
--- uspace/app/tester/console/console1.c	(revision caad59aaedb0d9190a12111b1fd41fed41df0d07)
+++ uspace/app/tester/console/console1.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -53,11 +53,17 @@
 		fflush(stdout);
 		console_set_style(fphone(stdout), STYLE_NORMAL);
-		printf("normal ");
+		printf(" normal ");
 		fflush(stdout);
 		console_set_style(fphone(stdout), STYLE_EMPHASIS);
-		printf("emphasized");
+		printf(" emphasized ");
+		fflush(stdout);
+		console_set_style(fphone(stdout), STYLE_INVERTED);
+		printf(" inverted ");
+		fflush(stdout);
+		console_set_style(fphone(stdout), STYLE_SELECTED);
+		printf(" selected ");
 		fflush(stdout);
 		console_set_style(fphone(stdout), STYLE_NORMAL);
-		printf(".\n");
+		printf("\n");
 		
 		unsigned int i;
@@ -73,5 +79,5 @@
 			}
 			fflush(stdout);
-			console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
+			console_set_style(fphone(stdout), STYLE_NORMAL);
 			putchar('\n');
 		}
@@ -86,5 +92,5 @@
 			}
 			fflush(stdout);
-			console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
+			console_set_style(fphone(stdout), STYLE_NORMAL);
 			putchar('\n');
 		}
@@ -94,5 +100,5 @@
 		for (i = 0; i < 255; i += 16) {
 			fflush(stdout);
-			console_set_rgb_color(fphone(stdout), 0xffffff, i << 16);
+			console_set_rgb_color(fphone(stdout), (255 - i) << 16, i << 16);
 			putchar('X');
 		}
@@ -103,5 +109,5 @@
 		for (i = 0; i < 255; i += 16) {
 			fflush(stdout);
-			console_set_rgb_color(fphone(stdout), 0xffffff, i << 8);
+			console_set_rgb_color(fphone(stdout), (255 - i) << 8, i << 8);
 			putchar('X');
 		}
@@ -112,9 +118,9 @@
 		for (i = 0; i < 255; i += 16) {
 			fflush(stdout);
-			console_set_rgb_color(fphone(stdout), 0xffffff, i);
+			console_set_rgb_color(fphone(stdout), 255 - i, i);
 			putchar('X');
 		}
 		fflush(stdout);
-		console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
+		console_set_style(fphone(stdout), STYLE_NORMAL);
 		putchar('\n');
 	}
Index: uspace/app/tetris/screen.c
===================================================================
--- uspace/app/tetris/screen.c	(revision caad59aaedb0d9190a12111b1fd41fed41df0d07)
+++ uspace/app/tetris/screen.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -53,7 +53,9 @@
 #include <vfs/vfs.h>
 #include <async.h>
+#include <bool.h>
+#include <io/console.h>
+#include <io/style.h>
 #include "screen.h"
 #include "tetris.h"
-#include <io/console.h>
 
 #define STOP  (B_COLS - 3)
@@ -63,5 +65,5 @@
 static int isset;               /* true => terminal is in game mode */
 
-static int use_color;		/* true => use colors */
+static bool use_color;          /* true => use colors */
 
 static const struct shape *lastshape;
@@ -81,5 +83,5 @@
 {
 	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), 0xf0f0f0,
+	console_set_rgb_color(fphone(stdout), 0xffffff,
 	    use_color ? color : 0x000000);
 }
@@ -88,5 +90,5 @@
 {
 	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), 0, 0xf0f0f0);
+	console_set_style(fphone(stdout), STYLE_NORMAL);
 }
 
@@ -118,8 +120,8 @@
 }
 
-void moveto(int r, int c)
+void moveto(ipcarg_t r, ipcarg_t c)
 {
 	fflush(stdout);
-	console_goto(fphone(stdout), c, r);
+	console_set_pos(fphone(stdout), c, r);
 }
 
@@ -131,13 +133,12 @@
 }
 
-static int get_display_color_sup(void)
-{
-	int rc;
-	int ccap;
-
-	rc = console_get_color_cap(fphone(stdout), &ccap);
+static bool get_display_color_sup(void)
+{
+	ipcarg_t ccap;
+	int rc = console_get_color_cap(fphone(stdout), &ccap);
+	
 	if (rc != 0)
-		return 0;
-
+		return false;
+	
 	return (ccap >= CONSOLE_CCAP_RGB);
 }
@@ -308,5 +309,5 @@
  * (We need its length in case we have to overwrite with blanks.)
  */
-void scr_msg(char *s, int set)
+void scr_msg(char *s, bool set)
 {
 	int l = str_size(s);
Index: uspace/app/tetris/screen.h
===================================================================
--- uspace/app/tetris/screen.h	(revision caad59aaedb0d9190a12111b1fd41fed41df0d07)
+++ uspace/app/tetris/screen.h	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -48,14 +48,16 @@
 
 #include <sys/types.h>
+#include <ipc/ipc.h>
 #include <async.h>
+#include <bool.h>
 
 typedef struct {
-	int ws_row;
-	int ws_col;
+	ipcarg_t ws_row;
+	ipcarg_t ws_col;
 } winsize_t;
 
 extern winsize_t winsize;
 
-extern void moveto(int r, int c);
+extern void moveto(ipcarg_t r, ipcarg_t c);
 extern void clear_screen(void);
 
@@ -65,5 +67,5 @@
 extern void scr_end(void);
 extern void scr_init(void);
-extern void scr_msg(char *, int);
+extern void scr_msg(char *, bool);
 extern void scr_set(void);
 extern void scr_update(void);
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision caad59aaedb0d9190a12111b1fd41fed41df0d07)
+++ uspace/app/top/screen.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -37,5 +37,7 @@
 
 #include <stdio.h>
+#include <ipc/ipc.h>
 #include <io/console.h>
+#include <io/style.h>
 #include <vfs/vfs.h>
 #include <stdarg.h>
@@ -45,10 +47,82 @@
 #include "top.h"
 
-#define WHITE  0xf0f0f0
-#define BLACK  0x000000
-
-static int rows;
-static int colls;
-static int up_rows;
+static ipcarg_t warn_col = 0;
+static ipcarg_t warn_row = 0;
+
+static void screen_style_normal(void)
+{
+	fflush(stdout);
+	console_set_style(fphone(stdout), STYLE_NORMAL);
+}
+
+static void screen_style_inverted(void)
+{
+	fflush(stdout);
+	console_set_style(fphone(stdout), STYLE_INVERTED);
+}
+
+static void screen_moveto(ipcarg_t col, ipcarg_t row)
+{
+	fflush(stdout);
+	console_set_pos(fphone(stdout), col, row);
+}
+
+static void screen_get_pos(ipcarg_t *col, ipcarg_t *row)
+{
+	fflush(stdout);
+	console_get_pos(fphone(stdout), col, row);
+}
+
+static void screen_get_size(ipcarg_t *col, ipcarg_t *row)
+{
+	fflush(stdout);
+	console_get_size(fphone(stdout), col, row);
+}
+
+static void screen_restart(bool clear)
+{
+	screen_style_normal();
+	
+	if (clear) {
+		fflush(stdout);
+		console_clear(fphone(stdout));
+	}
+	
+	screen_moveto(0, 0);
+}
+
+static void screen_newline(void)
+{
+	ipcarg_t cols;
+	ipcarg_t rows;
+	screen_get_size(&cols, &rows);
+	
+	ipcarg_t c;
+	ipcarg_t r;
+	screen_get_pos(&c, &r);
+	
+	ipcarg_t i;
+	for (i = c + 1; i < cols; i++)
+		puts(" ");
+	
+	if (r + 1 < rows)
+		puts("\n");
+}
+
+void screen_init(void)
+{
+	fflush(stdout);
+	console_cursor_visibility(fphone(stdout), false);
+	
+	screen_restart(true);
+}
+
+void screen_done(void)
+{
+	screen_restart(true);
+	
+	fflush(stdout);
+	console_cursor_visibility(fphone(stdout), true);
+}
 
 static void print_float(fixed_float ffloat, unsigned int precision)
@@ -64,60 +138,17 @@
 }
 
-static void screen_resume_normal(void)
-{
-	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), 0, WHITE);
-}
-
-static void screen_moveto(int r, int c)
-{
-	fflush(stdout);
-	console_goto(fphone(stdout), c, r);
-}
-
-static void screen_clear(void)
-{
-	console_clear(fphone(stdout));
-	screen_moveto(0, 0);
-	up_rows = 0;
-	fflush(stdout);
-}
-
-void screen_init(void)
-{
-	console_cursor_visibility(fphone(stdout), 0);
-	screen_resume_normal();
-	screen_clear();
-	
-	console_get_size(fphone(stdout), &colls, &rows);
-}
-
-void screen_done(void)
-{
-	screen_resume_normal();
-	screen_clear();
-	console_cursor_visibility(fphone(stdout), 1);
-}
-
-static inline void print_time(data_t *data)
-{
-	printf("%02lu:%02lu:%02lu ", data->hours, data->minutes, data->seconds);
-}
-
-static inline void print_uptime(data_t *data)
-{
-	printf("up %u days, %02u:%02u:%02u, ", data->udays, data->uhours,
-	    data->uminutes, data->useconds);
-}
-
-static inline void print_load(data_t *data)
-{
-	printf("load avarage: ");
+static inline void print_global_head(data_t *data)
+{
+	printf("top - %02lu:%02lu:%02lu up %u days, %02u:%02u:%02u, load avarage:",
+	    data->hours, data->minutes, data->seconds,
+	    data->udays, data->uhours, data->uminutes, data->useconds);
 	
 	size_t i;
 	for (i = 0; i < data->load_count; i++) {
+		puts(" ");
 		stats_print_load_fragment(data->load[i], 2);
-		printf(" ");
-	}
+	}
+	
+	screen_newline();
 }
 
@@ -125,4 +156,5 @@
 {
 	printf("tasks: %u total", data->tasks_count);
+	screen_newline();
 }
 
@@ -137,5 +169,4 @@
 	size_t invalid = 0;
 	
-	
 	size_t i;
 	for (i = 0; i < data->threads_count; i++) {
@@ -167,4 +198,5 @@
 	    "%u other, %u invalid",
 	    total, running, ready, sleeping, lingering, other, invalid);
+	screen_newline();
 }
 
@@ -178,13 +210,13 @@
 			    data->cpus[i].id, data->cpus[i].frequency_mhz,
 			    data->cpus[i].busy_ticks, data->cpus[i].idle_ticks);
-			printf(", idle: ");
+			puts(", idle: ");
 			print_float(data->cpus_perc[i].idle, 2);
-			printf("%%, busy: ");
+			puts("%, busy: ");
 			print_float(data->cpus_perc[i].busy, 2);
-			printf("%%\n");
+			puts("%");
 		} else
-			printf("cpu%u inactive\n", data->cpus[i].id);
-		
-		up_rows++;
+			printf("cpu%u inactive", data->cpus[i].id);
+		
+		screen_newline();
 	}
 }
@@ -209,13 +241,27 @@
 	    PRIu64 "%c used, %" PRIu64 "%c free", total, total_suffix,
 	    unavail, unavail_suffix, used, used_suffix, free, free_suffix);
-}
-
-static inline void print_tasks(data_t *data, int row)
-{
-	size_t i;
-	for (i = 0; i < data->tasks_count; i++, row++) {
-		if (row > rows)
-			break;
-		
+	screen_newline();
+}
+
+static inline void print_task_head(void)
+{
+	screen_style_inverted();
+	printf("      ID  Threads      Mem      %%Mem %%uCycles %%kCycles  Name");
+	screen_newline();
+	screen_style_normal();
+}
+
+static inline void print_tasks(data_t *data)
+{
+	ipcarg_t cols;
+	ipcarg_t rows;
+	screen_get_size(&cols, &rows);
+	
+	ipcarg_t col;
+	ipcarg_t row;
+	screen_get_pos(&col, &row);
+	
+	size_t i;
+	for (i = 0; (i < data->tasks_count) && (row < rows); i++, row++) {
 		uint64_t virtmem;
 		char virtmem_suffix;
@@ -224,53 +270,38 @@
 		printf("%8" PRIu64 " %8u %8" PRIu64 "%c ", data->tasks[i].task_id,
 		    data->tasks[i].threads, virtmem, virtmem_suffix);
-		printf("   ");
+		puts("   ");
 		print_float(data->tasks_perc[i].virtmem, 2);
-		printf("%%   ");
+		puts("%   ");
 		print_float(data->tasks_perc[i].ucycles, 2);
-		printf("%%   ");
+		puts("%   ");
 		print_float(data->tasks_perc[i].kcycles, 2);
-		printf("%% %s\n", data->tasks[i].name);
-	}
-}
-
-static inline void print_task_head(void)
-{
-	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), WHITE, BLACK);
-	
-	printf("      ID  Threads      Mem      %%Mem %%uCycles %%kCycles  Name");
-	
-	int i;
-	for (i = 61; i < colls; ++i)
-		printf(" ");
-	
-	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), BLACK, WHITE);
+		printf("%% %s", data->tasks[i].name);
+		
+		screen_newline();
+	}
 }
 
 static inline void print_ipc_head(void)
 {
-	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), WHITE, BLACK);
-	
+	screen_style_inverted();
 	printf("      ID Calls sent Calls recv Answs sent Answs recv  IRQn recv       Forw Name");
-	
-	int i;
-	for (i = 80; i < colls; ++i)
-		printf(" ");
-	
-	fflush(stdout);
-	console_set_rgb_color(fphone(stdout), BLACK, WHITE);
-}
-
-static inline void print_ipc(data_t *data, int row)
-{
-	size_t i;
-	for (i = 0; i < data->tasks_count; i++, row++) {
-		if (row > rows)
-			break;
-		
+	screen_newline();
+	screen_style_normal();
+}
+
+static inline void print_ipc(data_t *data)
+{
+	ipcarg_t cols;
+	ipcarg_t rows;
+	screen_get_size(&cols, &rows);
+	
+	ipcarg_t col;
+	ipcarg_t row;
+	screen_get_pos(&col, &row);
+	
+	size_t i;
+	for (i = 0; (i < data->tasks_count) && (row < rows); i++, row++) {
 		printf("%8" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64
-		     " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %s\n",
+		     " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %s",
 		     data->tasks[i].task_id, data->tasks[i].ipc_info.call_sent,
 		     data->tasks[i].ipc_info.call_recieved,
@@ -279,4 +310,6 @@
 		     data->tasks[i].ipc_info.irq_notif_recieved,
 		     data->tasks[i].ipc_info.forwarded, data->tasks[i].name);
+		
+		screen_newline();
 	}
 }
@@ -284,42 +317,21 @@
 void print_data(data_t *data)
 {
-	screen_clear();
-	fflush(stdout);
-	
-	printf("top - ");
-	print_time(data);
-	print_uptime(data);
-	print_load(data);
-	
-	printf("\n");
-	up_rows++;
-	
+	screen_restart(false);
+	print_global_head(data);
 	print_task_summary(data);
-	
-	printf("\n");
-	up_rows++;
-	
 	print_thread_summary(data);
-	
-	printf("\n");
-	up_rows++;
-	
 	print_cpu_info(data);
 	print_physmem_info(data);
 	
-	printf("\n");
-	up_rows++;
-	
 	/* Empty row for warnings */
-	printf("\n");
+	screen_get_pos(&warn_col, &warn_row);
+	screen_newline();
 	
 	if (operation_type == OP_IPC) {
 		print_ipc_head();
-		printf("\n");
-		print_ipc(data, up_rows);
+		print_ipc(data);
 	} else {
 		print_task_head();
-		printf("\n");
-		print_tasks(data, up_rows);
+		print_tasks(data);
 	}
 	
@@ -329,5 +341,5 @@
 void print_warning(const char *fmt, ...)
 {
-	screen_moveto(up_rows, 0);
+	screen_moveto(warn_col, warn_row);
 	
 	va_list args;
@@ -336,4 +348,5 @@
 	va_end(args);
 	
+	screen_newline();
 	fflush(stdout);
 }
