Some work on the gui console support for the text runtime configuration.
- vncserv.cc: Fixed sdl font issue. - Don't check for mouse toggle event if console is active. - Added support for blinking cursor. - Added stubs in the gui code to reduce BX_USE_TEXTCONIG usage in x.cc.
This commit is contained in:
parent
5f5f40e3d6
commit
c0f6caa03b
@ -632,6 +632,8 @@ bx_bool bx_gui_c::mouse_toggle_check(Bit32u key, bx_bool pressed)
|
|||||||
Bit32u newstate;
|
Bit32u newstate;
|
||||||
bx_bool toggle = 0;
|
bx_bool toggle = 0;
|
||||||
|
|
||||||
|
if (console_running())
|
||||||
|
return 0;
|
||||||
newstate = toggle_keystate;
|
newstate = toggle_keystate;
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
newstate |= key;
|
newstate |= key;
|
||||||
@ -1096,9 +1098,8 @@ void bx_gui_c::console_init(void)
|
|||||||
memset(&console.tminfo, 0, sizeof(bx_vga_tminfo_t));
|
memset(&console.tminfo, 0, sizeof(bx_vga_tminfo_t));
|
||||||
console.tminfo.line_offset = 160;
|
console.tminfo.line_offset = 160;
|
||||||
console.tminfo.line_compare = 1023;
|
console.tminfo.line_compare = 1023;
|
||||||
console.tminfo.cs_start = 14;
|
console.tminfo.cs_start = 0x2e;
|
||||||
console.tminfo.cs_end = 15;
|
console.tminfo.cs_end = 0x0f;
|
||||||
console.tminfo.blink_flags = BX_TEXT_BLINK_MODE | BX_TEXT_BLINK_STATE;
|
|
||||||
console.tminfo.actl_palette[7] = 0x07;
|
console.tminfo.actl_palette[7] = 0x07;
|
||||||
dimension_update(720, 400, 16, 9, 8);
|
dimension_update(720, 400, 16, 9, 8);
|
||||||
console.n_keys = 0;
|
console.n_keys = 0;
|
||||||
@ -1179,11 +1180,12 @@ char* bx_gui_c::bx_gets(char *s, int size)
|
|||||||
{
|
{
|
||||||
char keystr[2];
|
char keystr[2];
|
||||||
int pos = 0, done = 0;
|
int pos = 0, done = 0;
|
||||||
|
int cs_counter = 1, cs_visible = 0;
|
||||||
|
|
||||||
keystr[1] = 0;
|
keystr[1] = 0;
|
||||||
do {
|
do {
|
||||||
handle_events();
|
handle_events();
|
||||||
while ((console.n_keys > 0) && !done) {
|
while (console.n_keys > 0) {
|
||||||
if ((console.keys[0] >= 0x20) && (pos < (size-1))) {
|
if ((console.keys[0] >= 0x20) && (pos < (size-1))) {
|
||||||
s[pos++] = console.keys[0];
|
s[pos++] = console.keys[0];
|
||||||
keystr[0] = console.keys[0];
|
keystr[0] = console.keys[0];
|
||||||
@ -1206,7 +1208,18 @@ char* bx_gui_c::bx_gets(char *s, int size)
|
|||||||
#else
|
#else
|
||||||
msleep(25);
|
msleep(25);
|
||||||
#endif
|
#endif
|
||||||
|
if (--cs_counter == 0) {
|
||||||
|
cs_counter = 10;
|
||||||
|
cs_visible ^= 1;
|
||||||
|
if (cs_visible) {
|
||||||
|
console.tminfo.cs_start &= ~0x20;
|
||||||
|
} else {
|
||||||
|
console.tminfo.cs_start |= 0x20;
|
||||||
|
}
|
||||||
|
console_refresh(0);
|
||||||
|
}
|
||||||
} while (!done);
|
} while (!done);
|
||||||
|
console.tminfo.cs_start |= 0x20;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -165,10 +165,15 @@ public:
|
|||||||
#if BX_USE_TEXTCONFIG
|
#if BX_USE_TEXTCONFIG
|
||||||
// gui console support
|
// gui console support
|
||||||
bx_bool has_gui_console(void) {return console.present;}
|
bx_bool has_gui_console(void) {return console.present;}
|
||||||
|
bx_bool console_running(void) {return console.running;}
|
||||||
void console_refresh(bx_bool force);
|
void console_refresh(bx_bool force);
|
||||||
void console_key_enq(Bit8u key);
|
void console_key_enq(Bit8u key);
|
||||||
int bx_printf(const char *s);
|
int bx_printf(const char *s);
|
||||||
char* bx_gets(char *s, int size);
|
char* bx_gets(char *s, int size);
|
||||||
|
#else
|
||||||
|
bx_bool console_running(void) {return 0;}
|
||||||
|
void console_refresh(bx_bool force) {}
|
||||||
|
void console_key_enq(Bit8u key) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -195,6 +200,8 @@ protected:
|
|||||||
// gui console support
|
// gui console support
|
||||||
void console_init(void);
|
void console_init(void);
|
||||||
void console_cleanup(void);
|
void console_cleanup(void);
|
||||||
|
#else
|
||||||
|
void console_cleanup(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// header bar buttons
|
// header bar buttons
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// Donald Becker
|
// Donald Becker
|
||||||
// http://www.psyon.org
|
// http://www.psyon.org
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2015 The Bochs Project
|
// Copyright (C) 2001-2017 The Bochs Project
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
@ -52,11 +52,7 @@
|
|||||||
|
|
||||||
#include "icon_bochs.h"
|
#include "icon_bochs.h"
|
||||||
#include "font/vga.bitmap.h"
|
#include "font/vga.bitmap.h"
|
||||||
#if (BX_WITH_SDL || BX_WITH_SDL2 || BX_WITH_RFB) && !BX_PLUGINS
|
|
||||||
extern unsigned char sdl_font8x8[256][8];
|
|
||||||
#else
|
|
||||||
#include "sdl.h" // 8x8 font for status text
|
#include "sdl.h" // 8x8 font for status text
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_LIBVNCSERVER
|
#define HAVE_LIBVNCSERVER
|
||||||
|
|
||||||
|
@ -841,12 +841,9 @@ void bx_x_gui_c::handle_events(void)
|
|||||||
y = 0;
|
y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BX_USE_TEXTCONFIG
|
if (console_running()) {
|
||||||
if (console.running) {
|
|
||||||
console_refresh(1);
|
console_refresh(1);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
DEV_vga_redraw_area((unsigned) expose_event->x, y,
|
DEV_vga_redraw_area((unsigned) expose_event->x, y,
|
||||||
(unsigned) expose_event->width, height);
|
(unsigned) expose_event->width, height);
|
||||||
}
|
}
|
||||||
@ -1028,9 +1025,8 @@ void bx_x_gui_c::send_mouse_status(void)
|
|||||||
BX_DEBUG(("XXX: prev=(%d,%d) curr=(%d,%d)",
|
BX_DEBUG(("XXX: prev=(%d,%d) curr=(%d,%d)",
|
||||||
prev_x, prev_y, current_x, current_y));
|
prev_x, prev_y, current_x, current_y));
|
||||||
|
|
||||||
#if BX_USE_TEXTCONFIG
|
if (console_running()) return;
|
||||||
if (console.running) return;
|
|
||||||
#endif
|
|
||||||
if (x11_mouse_mode_absxy) {
|
if (x11_mouse_mode_absxy) {
|
||||||
if ((current_y >= (int)bx_headerbar_y) && (current_y < (int)(dimension_y + bx_headerbar_y))) {
|
if ((current_y >= (int)bx_headerbar_y) && (current_y < (int)(dimension_y + bx_headerbar_y))) {
|
||||||
dx = current_x * 0x7fff / dimension_x;
|
dx = current_x * 0x7fff / dimension_x;
|
||||||
@ -1075,15 +1071,13 @@ void bx_x_gui_c::xkeypress(KeySym keysym, int press_release)
|
|||||||
Bit32u key_event;
|
Bit32u key_event;
|
||||||
bx_bool mouse_toggle = 0;
|
bx_bool mouse_toggle = 0;
|
||||||
|
|
||||||
#if BX_USE_TEXTCONFIG
|
if (console_running() && !press_release) {
|
||||||
if (console.running && !press_release) {
|
|
||||||
if (((keysym >= XK_space) && (keysym <= XK_asciitilde)) ||
|
if (((keysym >= XK_space) && (keysym <= XK_asciitilde)) ||
|
||||||
(keysym == XK_Return) || (keysym == XK_BackSpace)) {
|
(keysym == XK_Return) || (keysym == XK_BackSpace)) {
|
||||||
console_key_enq((Bit8u)(keysym & 0xff));
|
console_key_enq((Bit8u)(keysym & 0xff));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if ((keysym == XK_Control_L) || (keysym == XK_Control_R)) {
|
if ((keysym == XK_Control_L) || (keysym == XK_Control_R)) {
|
||||||
mouse_toggle = mouse_toggle_check(BX_MT_KEY_CTRL, !press_release);
|
mouse_toggle = mouse_toggle_check(BX_MT_KEY_CTRL, !press_release);
|
||||||
} else if (keysym == XK_Alt_L) {
|
} else if (keysym == XK_Alt_L) {
|
||||||
@ -1899,10 +1893,8 @@ void bx_x_gui_c::headerbar_click(int x)
|
|||||||
else
|
else
|
||||||
xorigin = dimension_x - bx_headerbar_entry[i].xorigin;
|
xorigin = dimension_x - bx_headerbar_entry[i].xorigin;
|
||||||
if ((x>=xorigin) && (x<(xorigin+int(bx_headerbar_entry[i].xdim)))) {
|
if ((x>=xorigin) && (x<(xorigin+int(bx_headerbar_entry[i].xdim)))) {
|
||||||
#if BX_USE_TEXTCONFIG
|
if (console_running() && (i != power_hbar_id))
|
||||||
if (console.running && (i != power_hbar_id))
|
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
bx_headerbar_entry[i].f();
|
bx_headerbar_entry[i].f();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2152,11 +2144,9 @@ void bx_x_gui_c::set_display_mode(disp_mode_t newmode)
|
|||||||
if (disp_mode == newmode) return;
|
if (disp_mode == newmode) return;
|
||||||
// remember the display mode for next time
|
// remember the display mode for next time
|
||||||
disp_mode = newmode;
|
disp_mode = newmode;
|
||||||
#if BX_USE_TEXTCONFIG
|
if ((newmode == DISP_MODE_SIM) && console_running()) {
|
||||||
if ((newmode == DISP_MODE_SIM) && console.running) {
|
|
||||||
console_cleanup();
|
console_cleanup();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// X11 control class
|
// X11 control class
|
||||||
|
Loading…
Reference in New Issue
Block a user