1300829Sgrehan/*- 2300829Sgrehan * Copyright (c) 2015 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com> 3300829Sgrehan * All rights reserved. 4300829Sgrehan * 5300829Sgrehan * Redistribution and use in source and binary forms, with or without 6300829Sgrehan * modification, are permitted provided that the following conditions 7300829Sgrehan * are met: 8300829Sgrehan * 1. Redistributions of source code must retain the above copyright 9300829Sgrehan * notice, this list of conditions and the following disclaimer. 10300829Sgrehan * 2. Redistributions in binary form must reproduce the above copyright 11300829Sgrehan * notice, this list of conditions and the following disclaimer in the 12300829Sgrehan * documentation and/or other materials provided with the distribution. 13300829Sgrehan * 14300829Sgrehan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 15300829Sgrehan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16300829Sgrehan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17300829Sgrehan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18300829Sgrehan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19300829Sgrehan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20300829Sgrehan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21300829Sgrehan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22300829Sgrehan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23300829Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24300829Sgrehan * SUCH DAMAGE. 25300829Sgrehan * 26300829Sgrehan * $FreeBSD: releng/11.0/usr.sbin/bhyve/console.h 302408 2016-07-08 00:04:57Z gjb $ 27300829Sgrehan */ 28300829Sgrehan 29300829Sgrehan#ifndef _CONSOLE_H_ 30300829Sgrehan#define _CONSOLE_H_ 31300829Sgrehan 32300829Sgrehanstruct bhyvegc; 33300829Sgrehan 34300829Sgrehantypedef void (*fb_render_func_t)(struct bhyvegc *gc, void *arg); 35300829Sgrehantypedef void (*kbd_event_func_t)(int down, uint32_t keysym, void *arg); 36300829Sgrehantypedef void (*ptr_event_func_t)(uint8_t mask, int x, int y, void *arg); 37300829Sgrehan 38300829Sgrehanvoid console_init(int w, int h, void *fbaddr); 39300829Sgrehan 40300829Sgrehanvoid console_set_fbaddr(void *fbaddr); 41300829Sgrehan 42300829Sgrehanstruct bhyvegc_image *console_get_image(void); 43300829Sgrehan 44300829Sgrehanvoid console_fb_register(fb_render_func_t render_cb, void *arg); 45300829Sgrehanvoid console_refresh(void); 46300829Sgrehan 47300829Sgrehanvoid console_kbd_register(kbd_event_func_t event_cb, void *arg, int pri); 48300829Sgrehanvoid console_key_event(int down, uint32_t keysym); 49300829Sgrehan 50300829Sgrehanvoid console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri); 51300829Sgrehanvoid console_ptr_event(uint8_t button, int x, int y); 52300829Sgrehan 53300829Sgrehan#endif /* _CONSOLE_H_ */ 54