Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/console.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -71,8 +71,8 @@
 /** Information about framebuffer */
 struct {
-	int phone;      /**< Framebuffer phone */
-	ipcarg_t cols;  /**< Framebuffer columns */
-	ipcarg_t rows;  /**< Framebuffer rows */
-	int color_cap;  /**< Color capabilities (FB_CCAP_xxx) */
+	int phone;           /**< Framebuffer phone */
+	ipcarg_t cols;       /**< Framebuffer columns */
+	ipcarg_t rows;       /**< Framebuffer rows */
+	ipcarg_t color_cap;  /**< Color capabilities (FB_CCAP_xxx) */
 } fb_info;
 
@@ -99,7 +99,7 @@
 /** Information on row-span yet unsent to FB driver. */
 struct {
-	size_t col;  /**< Leftmost column of the span. */
-	size_t row;  /**< Row where the span lies. */
-	size_t cnt;  /**< Width of the span. */
+	ipcarg_t col;  /**< Leftmost column of the span. */
+	ipcarg_t row;  /**< Row where the span lies. */
+	ipcarg_t cnt;  /**< Width of the span. */
 } fb_pending;
 
@@ -117,5 +117,5 @@
 }
 
-static void curs_goto(size_t x, size_t y)
+static void curs_goto(ipcarg_t x, ipcarg_t y)
 {
 	async_msg_2(fb_info.phone, FB_CURSOR_GOTO, x, y);
@@ -147,15 +147,15 @@
 }
 
-static void set_style(int style)
+static void set_style(uint8_t style)
 {
 	async_msg_1(fb_info.phone, FB_SET_STYLE, style);
 }
 
-static void set_color(int fgcolor, int bgcolor, int flags)
+static void set_color(uint8_t fgcolor, uint8_t bgcolor, uint8_t flags)
 {
 	async_msg_3(fb_info.phone, FB_SET_COLOR, fgcolor, bgcolor, flags);
 }
 
-static void set_rgb_color(int fgcolor, int bgcolor)
+static void set_rgb_color(uint32_t fgcolor, uint32_t bgcolor)
 {
 	async_msg_2(fb_info.phone, FB_SET_RGB_COLOR, fgcolor, bgcolor); 
@@ -178,14 +178,23 @@
 }
 
-static int ccap_fb_to_con(int ccap_fb, int *ccap_con)
+static int ccap_fb_to_con(ipcarg_t ccap_fb, ipcarg_t *ccap_con)
 {
 	switch (ccap_fb) {
-	case FB_CCAP_NONE: *ccap_con = CONSOLE_CCAP_NONE; break;
-	case FB_CCAP_STYLE: *ccap_con = CONSOLE_CCAP_STYLE; break;
-	case FB_CCAP_INDEXED: *ccap_con = CONSOLE_CCAP_INDEXED; break;
-	case FB_CCAP_RGB: *ccap_con = CONSOLE_CCAP_RGB; break;
-	default: return EINVAL;
-	}
-
+	case FB_CCAP_NONE:
+		*ccap_con = CONSOLE_CCAP_NONE;
+		break;
+	case FB_CCAP_STYLE:
+		*ccap_con = CONSOLE_CCAP_STYLE;
+		break;
+	case FB_CCAP_INDEXED:
+		*ccap_con = CONSOLE_CCAP_INDEXED;
+		break;
+	case FB_CCAP_RGB:
+		*ccap_con = CONSOLE_CCAP_RGB;
+		break;
+	default:
+		return EINVAL;
+	}
+	
 	return EOK;
 }
@@ -226,5 +235,5 @@
  *
  */
-static void cell_mark_changed(size_t col, size_t row)
+static void cell_mark_changed(ipcarg_t col, ipcarg_t row)
 {
 	if (fb_pending.cnt != 0) {
@@ -253,5 +262,5 @@
 {
 	bool flush_cursor = false;
-
+	
 	switch (ch) {
 	case '\n':
@@ -297,5 +306,5 @@
 			async_msg_1(fb_info.phone, FB_SCROLL, 1);
 	}
-
+	
 	if (cons == active_console && flush_cursor)
 		curs_goto(cons->scr.position_x, cons->scr.position_y);
@@ -327,8 +336,4 @@
 	
 	if (cons != kernel_console) {
-		size_t x;
-		size_t y;
-		int rc = 0;
-		
 		async_serialize_start();
 		
@@ -344,4 +349,9 @@
 		set_attrs(&cons->scr.attrs);
 		curs_visibility(false);
+		
+		ipcarg_t x;
+		ipcarg_t y;
+		int rc = 0;
+		
 		if (interbuffer) {
 			for (y = 0; y < cons->scr.size_y; y++) {
@@ -390,5 +400,4 @@
 	/* Ignore parameters, the connection is already opened */
 	while (true) {
-		
 		ipc_call_t call;
 		ipc_callid_t callid = async_get_call(&call);
@@ -433,16 +442,11 @@
 static void mouse_events(ipc_callid_t iid, ipc_call_t *icall)
 {
-	int button, press;
-	int dx, dy;
-	int newcon;
-
 	/* Ignore parameters, the connection is already opened */
 	while (true) {
-
 		ipc_call_t call;
 		ipc_callid_t callid = async_get_call(&call);
-
+		
 		int retval;
-
+		
 		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
@@ -450,8 +454,6 @@
 			return;
 		case MEVENT_BUTTON:
-			button = IPC_GET_ARG1(call);
-			press = IPC_GET_ARG2(call);
-			if (button == 1) {
-				newcon = gcons_mouse_btn(press);
+			if (IPC_GET_ARG1(call) == 1) {
+				int newcon = gcons_mouse_btn((bool) IPC_GET_ARG2(call));
 				if (newcon != -1)
 					change_console(&consoles[newcon]);
@@ -460,7 +462,6 @@
 			break;
 		case MEVENT_MOVE:
-			dx = IPC_GET_ARG1(call);
-			dy = IPC_GET_ARG2(call);
-			gcons_mouse_move(dx, dy);
+			gcons_mouse_move((int) IPC_GET_ARG1(call),
+			    (int) IPC_GET_ARG2(call));
 			retval = 0;
 			break;
@@ -520,4 +521,5 @@
 	console_event_t ev;
 	fibril_mutex_lock(&input_mutex);
+	
 recheck:
 	while ((keybuffer_pop(&cons->keybuffer, &ev)) && (pos < size)) {
@@ -536,4 +538,5 @@
 		goto recheck;
 	}
+	
 	fibril_mutex_unlock(&input_mutex);
 }
@@ -542,6 +545,7 @@
 {
 	console_event_t ev;
-
+	
 	fibril_mutex_lock(&input_mutex);
+	
 recheck:
 	if (keybuffer_pop(&cons->keybuffer, &ev)) {
@@ -551,4 +555,5 @@
 		goto recheck;
 	}
+	
 	fibril_mutex_unlock(&input_mutex);
 }
@@ -580,6 +585,5 @@
 	ipcarg_t arg2;
 	ipcarg_t arg3;
-
-	int cons_ccap;
+	
 	int rc;
 	
@@ -622,5 +626,4 @@
 			if (cons == active_console) {
 				async_req_0_0(fb_info.phone, FB_FLUSH);
-				
 				curs_goto(cons->scr.position_x, cons->scr.position_y);
 			}
@@ -650,10 +653,9 @@
 			break;
 		case CONSOLE_GET_COLOR_CAP:
-			rc = ccap_fb_to_con(fb_info.color_cap, &cons_ccap);
+			rc = ccap_fb_to_con(fb_info.color_cap, &arg1);
 			if (rc != EOK) {
 				ipc_answer_0(callid, rc);
 				continue;
 			}
-			arg1 = cons_ccap;
 			break;
 		case CONSOLE_SET_STYLE:
@@ -714,5 +716,5 @@
 		return false;
 	}
-
+	
 	kbd_phone = fd_phone(input_fd);
 	if (kbd_phone < 0) {
@@ -720,5 +722,5 @@
 		return false;
 	}
-
+	
 	/* NB: The callback connection is slotted for removal */
 	ipcarg_t phonehash;
@@ -727,16 +729,16 @@
 		return false;
 	}
-
+	
 	async_new_connection(phonehash, 0, NULL, keyboard_events);
-
+	
 	/* Connect to mouse device */
 	mouse_phone = -1;
 	int mouse_fd = open("/dev/hid_in/mouse", O_RDONLY);
-
+	
 	if (mouse_fd < 0) {
 		printf(NAME ": Notice - failed opening %s\n", "/dev/hid_in/mouse");
 		goto skip_mouse;
 	}
-
+	
 	mouse_phone = fd_phone(mouse_fd);
 	if (mouse_phone < 0) {
@@ -744,5 +746,5 @@
 		goto skip_mouse;
 	}
-
+	
 	if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from mouse device\n");
@@ -750,8 +752,8 @@
 		goto skip_mouse;
 	}
-
+	
 	async_new_connection(phonehash, 0, NULL, mouse_events);
 skip_mouse:
-
+	
 	/* Connect to framebuffer driver */
 	fb_info.phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VIDEO, 0, 0);
@@ -760,5 +762,5 @@
 		return -1;
 	}
-
+	
 	/* Register driver */
 	int rc = devmap_driver_register(NAME, client_connection);
@@ -772,9 +774,7 @@
 	
 	/* Synchronize, the gcons could put something in queue */
-	ipcarg_t color_cap;
 	async_req_0_0(fb_info.phone, FB_FLUSH);
 	async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.cols, &fb_info.rows);
-	async_req_0_1(fb_info.phone, FB_GET_COLOR_CAP, &color_cap);
-	fb_info.color_cap = color_cap;
+	async_req_0_1(fb_info.phone, FB_GET_COLOR_CAP, &fb_info.color_cap);
 	
 	/* Set up shared memory buffer. */
Index: uspace/srv/hid/console/gcons.c
===================================================================
--- uspace/srv/hid/console/gcons.c	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/gcons.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -54,5 +54,30 @@
 #define STATUS_HEIGHT  48
 
-#define MAIN_COLOR  0xffffff
+#define COLOR_MAIN        0xffffff
+#define COLOR_FOREGROUND  0x202020
+#define COLOR_BACKGROUND  0xffffff
+
+extern char _binary_gfx_helenos_ppm_start[0];
+extern int _binary_gfx_helenos_ppm_size;
+extern char _binary_gfx_nameic_ppm_start[0];
+extern int _binary_gfx_nameic_ppm_size;
+
+extern char _binary_gfx_anim_1_ppm_start[0];
+extern int _binary_gfx_anim_1_ppm_size;
+extern char _binary_gfx_anim_2_ppm_start[0];
+extern int _binary_gfx_anim_2_ppm_size;
+extern char _binary_gfx_anim_3_ppm_start[0];
+extern int _binary_gfx_anim_3_ppm_size;
+extern char _binary_gfx_anim_4_ppm_start[0];
+extern int _binary_gfx_anim_4_ppm_size;
+
+extern char _binary_gfx_cons_selected_ppm_start[0];
+extern int _binary_gfx_cons_selected_ppm_size;
+extern char _binary_gfx_cons_idle_ppm_start[0];
+extern int _binary_gfx_cons_idle_ppm_size;
+extern char _binary_gfx_cons_has_data_ppm_start[0];
+extern int _binary_gfx_cons_has_data_ppm_size;
+extern char _binary_gfx_cons_kernel_ppm_start[0];
+extern int _binary_gfx_cons_kernel_ppm_size;
 
 static bool use_gcons = false;
@@ -82,10 +107,10 @@
 static size_t active_console = 0;
 
-size_t mouse_x;
-size_t mouse_y;
-
-bool btn_pressed;
-size_t btn_x;
-size_t btn_y;
+static ipcarg_t mouse_x = 0;
+static ipcarg_t mouse_y= 0;
+
+static bool btn_pressed = false;
+static ipcarg_t btn_x = 0;
+static ipcarg_t btn_y = 0;
 
 static void vp_switch(int vp)
@@ -95,5 +120,5 @@
 
 /** Create view port */
-static int vp_create(size_t x, size_t y, size_t width, size_t height)
+static int vp_create(ipcarg_t x, ipcarg_t y, ipcarg_t width, ipcarg_t height)
 {
 	return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y,
@@ -112,5 +137,5 @@
 
 /** Transparent putchar */
-static void tran_putch(wchar_t ch, size_t col, size_t row)
+static void tran_putch(wchar_t ch, ipcarg_t col, ipcarg_t row)
 {
 	async_msg_3(fbphone, FB_PUTCHAR, ch, col, row);
@@ -259,14 +284,17 @@
 void gcons_mouse_move(ssize_t dx, ssize_t dy)
 {
-	mouse_x = limit(mouse_x + dx, 0, xres);
-	mouse_y = limit(mouse_y + dy, 0, yres);
-
+	ssize_t nx = (ssize_t) mouse_x + dx;
+	ssize_t ny = (ssize_t) mouse_y + dy;
+	
+	mouse_x = (size_t) limit(nx, 0, xres);
+	mouse_y = (size_t) limit(ny, 0, yres);
+	
 	if (active_console != KERNEL_CONSOLE)
 		async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y);
 }
 
-static int gcons_find_conbut(int x, int y)
-{
-	int status_start = STATUS_START + (xres - 800) / 2;
+static int gcons_find_conbut(ipcarg_t x, ipcarg_t y)
+{
+	ipcarg_t status_start = STATUS_START + (xres - 800) / 2;
 	
 	if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT))
@@ -278,8 +306,14 @@
 	if (x >= status_start + (STATUS_WIDTH + STATUS_SPACE) * CONSOLE_COUNT)
 		return -1;
+	
 	if (((x - status_start) % (STATUS_WIDTH + STATUS_SPACE)) < STATUS_SPACE)
 		return -1;
 	
-	return (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);
+	ipcarg_t btn = (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);
+	
+	if (btn < CONSOLE_COUNT)
+		return btn;
+	
+	return -1;
 }
 
@@ -287,11 +321,15 @@
  *
  * @param state New state (true - pressed, false - depressed)
+ *
  */
 int gcons_mouse_btn(bool state)
 {
-	int conbut;
+	/* Ignore mouse clicks if no buttons
+	   are drawn at all */
+	if (xres < 800)
+		return -1;
 	
 	if (state) {
-		conbut = gcons_find_conbut(mouse_x, mouse_y);
+		int conbut = gcons_find_conbut(mouse_x, mouse_y);
 		if (conbut != -1) {
 			btn_pressed = true;
@@ -307,5 +345,5 @@
 	btn_pressed = false;
 	
-	conbut = gcons_find_conbut(mouse_x, mouse_y);
+	int conbut = gcons_find_conbut(mouse_x, mouse_y);
 	if (conbut == gcons_find_conbut(btn_x, btn_y))
 		return conbut;
@@ -313,5 +351,4 @@
 	return -1;
 }
-
 
 /** Draw a PPM pixmap to framebuffer
@@ -321,12 +358,10 @@
  * @param x Coordinate of upper left corner
  * @param y Coordinate of upper left corner
- */
-static void draw_pixmap(char *logo, size_t size, int x, int y)
-{
-	char *shm;
-	int rc;
-	
+ *
+ */
+static void draw_pixmap(char *logo, size_t size, ipcarg_t x, ipcarg_t y)
+{
 	/* Create area */
-	shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
+	char *shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
 	    MAP_ANONYMOUS, 0, 0);
 	if (shm == MAP_FAILED)
@@ -336,5 +371,5 @@
 	
 	/* Send area */
-	rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
+	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
 	if (rc)
 		goto exit;
@@ -356,19 +391,12 @@
 }
 
-extern char _binary_gfx_helenos_ppm_start[0];
-extern int _binary_gfx_helenos_ppm_size;
-extern char _binary_gfx_nameic_ppm_start[0];
-extern int _binary_gfx_nameic_ppm_size;
-
 /** Redraws console graphics */
 void gcons_redraw_console(void)
 {
-	int i;
-	
 	if (!use_gcons)
 		return;
 	
 	vp_switch(0);
-	set_rgb_color(MAIN_COLOR, MAIN_COLOR);
+	set_rgb_color(COLOR_MAIN, COLOR_MAIN);
 	clear();
 	draw_pixmap(_binary_gfx_helenos_ppm_start,
@@ -377,4 +405,5 @@
 	    (size_t) &_binary_gfx_nameic_ppm_size, 5, 17);
 	
+	unsigned int i;
 	for (i = 0; i < CONSOLE_COUNT; i++)
 		redraw_state(i);
@@ -393,10 +422,6 @@
 static int make_pixmap(char *data, size_t size)
 {
-	char *shm;
-	int rc;
-	int pxid = -1;
-	
 	/* Create area */
-	shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
+	char *shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
 	    MAP_ANONYMOUS, 0, 0);
 	if (shm == MAP_FAILED)
@@ -405,6 +430,8 @@
 	memcpy(shm, data, size);
 	
+	int pxid = -1;
+	
 	/* Send area */
-	rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
+	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
 	if (rc)
 		goto exit;
@@ -432,16 +459,8 @@
 }
 
-extern char _binary_gfx_anim_1_ppm_start[0];
-extern int _binary_gfx_anim_1_ppm_size;
-extern char _binary_gfx_anim_2_ppm_start[0];
-extern int _binary_gfx_anim_2_ppm_size;
-extern char _binary_gfx_anim_3_ppm_start[0];
-extern int _binary_gfx_anim_3_ppm_size;
-extern char _binary_gfx_anim_4_ppm_start[0];
-extern int _binary_gfx_anim_4_ppm_size;
-
 static void make_anim(void)
 {
-	int an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]);
+	int an = async_req_1_0(fbphone, FB_ANIM_CREATE,
+	    cstatus_vp[KERNEL_CONSOLE]);
 	if (an < 0)
 		return;
@@ -467,13 +486,4 @@
 	animation = an;
 }
-
-extern char _binary_gfx_cons_selected_ppm_start[0];
-extern int _binary_gfx_cons_selected_ppm_size;
-extern char _binary_gfx_cons_idle_ppm_start[0];
-extern int _binary_gfx_cons_idle_ppm_size;
-extern char _binary_gfx_cons_has_data_ppm_start[0];
-extern int _binary_gfx_cons_has_data_ppm_size;
-extern char _binary_gfx_cons_kernel_ppm_start[0];
-extern int _binary_gfx_cons_kernel_ppm_size;
 
 /** Initialize nice graphical console environment */
@@ -500,5 +510,5 @@
 	
 	/* Create status buttons */
-	size_t status_start = STATUS_START + (xres - 800) / 2;
+	ipcarg_t status_start = STATUS_START + (xres - 800) / 2;
 	size_t i;
 	for (i = 0; i < CONSOLE_COUNT; i++) {
@@ -511,5 +521,5 @@
 		
 		vp_switch(cstatus_vp[i]);
-		set_rgb_color(0x202020, 0xffffff);
+		set_rgb_color(COLOR_FOREGROUND, COLOR_BACKGROUND);
 	}
 	
Index: uspace/srv/hid/console/gcons.h
===================================================================
--- uspace/srv/hid/console/gcons.h	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/gcons.h	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -38,15 +38,15 @@
 #include <sys/types.h>
 
-void gcons_init(int phone);
+void gcons_init(int);
 
 void gcons_redraw_console(void);
-void gcons_change_console(size_t index);
-void gcons_notify_char(size_t index);
+void gcons_change_console(size_t);
+void gcons_notify_char(size_t);
 void gcons_in_kernel(void);
 
-void gcons_notify_connect(size_t index);
-void gcons_notify_disconnect(size_t index);
+void gcons_notify_connect(size_t);
+void gcons_notify_disconnect(size_t);
 
-void gcons_mouse_move(ssize_t dx, ssize_t dy);
+void gcons_mouse_move(ssize_t, ssize_t);
 int gcons_mouse_btn(bool state);
 
Index: uspace/srv/hid/console/keybuffer.h
===================================================================
--- uspace/srv/hid/console/keybuffer.h	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/keybuffer.h	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -47,7 +47,7 @@
 typedef struct {
 	console_event_t fifo[KEYBUFFER_SIZE];
-	unsigned long head;
-	unsigned long tail;
-	unsigned long items;
+	size_t head;
+	size_t tail;
+	size_t items;
 } keybuffer_t;
 
Index: uspace/srv/hid/console/screenbuffer.c
===================================================================
--- uspace/srv/hid/console/screenbuffer.c	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/screenbuffer.c	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -67,5 +67,6 @@
  *
  */
-screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y)
+screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, ipcarg_t size_x,
+    ipcarg_t size_y)
 {
 	scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y);
@@ -109,7 +110,7 @@
  *
  */
-void screenbuffer_clear_line(screenbuffer_t *scr, size_t line)
+void screenbuffer_clear_line(screenbuffer_t *scr, ipcarg_t line)
 {
-	size_t x;
+	ipcarg_t x;
 	
 	for (x = 0; x < scr->size_x; x++) {
@@ -140,5 +141,5 @@
  *
  */
-void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y)
+void screenbuffer_goto(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
 {
 	scr->position_x = x % scr->size_x;
@@ -166,5 +167,6 @@
  *
  */
-void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color, uint8_t bg_color, uint8_t flags)
+void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color,
+    uint8_t bg_color, uint8_t flags)
 {
 	scr->attrs.t = at_idx;
@@ -181,5 +183,6 @@
  *
  */
-void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color, uint32_t bg_color)
+void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color,
+    uint32_t bg_color)
 {
 	scr->attrs.t = at_rgb;
Index: uspace/srv/hid/console/screenbuffer.h
===================================================================
--- uspace/srv/hid/console/screenbuffer.h	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/srv/hid/console/screenbuffer.h	(revision 9f1362d4e7eaaca0f48042dc579d07341d14e38a)
@@ -38,7 +38,8 @@
 #include <stdint.h>
 #include <sys/types.h>
+#include <ipc/ipc.h>
 #include <bool.h>
 
-#define DEFAULT_FOREGROUND  0x0       /**< default console foreground color */
+#define DEFAULT_FOREGROUND  0x000000  /**< default console foreground color */
 #define DEFAULT_BACKGROUND  0xf0f0f0  /**< default console background color */
 
@@ -82,10 +83,10 @@
 	keyfield_t *buffer;      /**< Screen content - characters and
 	                              their attributes (used as a circular buffer) */
-	size_t size_x;           /**< Number of columns  */
-	size_t size_y;           /**< Number of rows */
+	ipcarg_t size_x;         /**< Number of columns  */
+	ipcarg_t size_y;         /**< Number of rows */
 	
 	/** Coordinates of last printed character for determining cursor position */
-	size_t position_x;
-	size_t position_y;
+	ipcarg_t position_x;
+	ipcarg_t position_y;
 	
 	attrs_t attrs;           /**< Current attributes. */
@@ -107,5 +108,5 @@
  *
  */
-static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y)
+static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
 {
 	return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
@@ -140,17 +141,14 @@
 }
 
+extern void screenbuffer_putchar(screenbuffer_t *, wchar_t);
+extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t);
 
-void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c);
-screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y);
-
-void screenbuffer_clear(screenbuffer_t *scr);
-void screenbuffer_clear_line(screenbuffer_t *scr, size_t line);
-void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest);
-void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y);
-void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style);
-void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color,
-    uint8_t bg_color, uint8_t attr);
-void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color,
-    uint32_t bg_color);
+extern void screenbuffer_clear(screenbuffer_t *);
+extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t);
+extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *);
+extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t);
+extern void screenbuffer_set_style(screenbuffer_t *, uint8_t);
+extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t);
+extern void screenbuffer_set_rgb_color(screenbuffer_t *, uint32_t, uint32_t);
 
 #endif
