# Old manifest: 3649d8e9194809a5792fbfef45ea3a270701ea41 # New manifest: 6aa1cdaab92b7d65331cf57835f639e4a2d19f6b # Summary of changes: # # patch src/colinux/os/winnt/user/console-nt/head.cpp # from 4624f876f6464e748446f90f7f1e41b614b4f6fe # to e9213404e8f32046819322a9963d81efe5c56ef9 # # patch src/colinux/os/winnt/user/console-nt/widget.cpp # from 460d26e22a48a5b558f8519f326f5947191a8c05 # to 41d433724fb4ecf4031ed03d4665aaa417019d67 # # patch src/colinux/os/winnt/user/console-nt/widget.h # from f0cd4a7f90fb8e674cff9f519006e4c69945e63c # to 86c8d4f9a8200358f31d70b9bb36db811d88747a # # patch src/colinux/user/console-base/console.cpp # from 7500d4e6290107f0b6a7224df7e9294be1095bf8 # to 973e8ec51e3bb9d29bdce3246879ea611ba95f8f # # patch src/colinux/user/console-base/console.h # from 815b617c79fbc8accec23f909cb8785f02030ae7 # to 427381d613d661623d6a5db08455d6fc5a50c760 # # patch src/colinux/user/console-base/widget.cpp # from 9b10592a1c518fbb995622150fd70068ed3f1301 # to 3ff73f5cc4384aa28512bdc7db6e60c497ec60ee # # patch src/colinux/user/console-base/widget.h # from 5e517971d275501fb3be0c18e5da694471c0a4f5 # to 7c32280ba33ce5980a4ba5abf4e696141f9bbaf8 # --- src/colinux/os/winnt/user/console-nt/head.cpp +++ src/colinux/os/winnt/user/console-nt/head.cpp @@ -18,23 +18,6 @@ COLINUX_DEFINE_MODULE("colinux-console-nt"); -#if 0 -static HHOOK current_hook; -static LRESULT CALLBACK -keyboard_hook(int nCode, WPARAM wParam, LPARAM lParam) -{ - co_scan_code_t sc; - sc.code = (lParam >> 16) & 0xff; - sc.down = (lParam & (1 << 31)) ? 0 : 1; - - co_user_console_handle_scancode(sc); - - co_debug(" scancode...\n"); - - return CallNextHookEx(current_hook, nCode, wParam, lParam); -} -#endif - int main(int argc, char **argv) { --- src/colinux/os/winnt/user/console-nt/widget.cpp +++ src/colinux/os/winnt/user/console-nt/widget.cpp @@ -187,7 +187,10 @@ } co_rc_t -console_widget_NT_t::op_scroll_up(co_console_unit &T, co_console_unit &B, co_console_unit &L) +console_widget_NT_t::op_scroll_up( + const co_console_unit &T, + const co_console_unit &B, + const co_console_unit &L) { SMALL_RECT r; COORD c; @@ -207,7 +210,10 @@ } co_rc_t -console_widget_NT_t::op_scroll_down(co_console_unit &T, co_console_unit &B, co_console_unit &L) +console_widget_NT_t::op_scroll_down( + const co_console_unit &T, + const co_console_unit &B, + const co_console_unit &L) { SMALL_RECT r; COORD c; @@ -227,7 +230,11 @@ } co_rc_t -console_widget_NT_t::op_putcs(co_console_unit &Y, co_console_unit &X, co_console_character *D, co_console_unit &C) +console_widget_NT_t::op_putcs( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character *D, + const co_console_unit &C) { int count; @@ -262,7 +266,10 @@ } co_rc_t -console_widget_NT_t::op_putc(co_console_unit &Y, co_console_unit &X, co_console_character &C) +console_widget_NT_t::op_putc( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character &C) { SMALL_RECT r; COORD c; @@ -285,7 +288,8 @@ } co_rc_t -console_widget_NT_t::op_cursor(co_cursor_pos_t & P) +console_widget_NT_t::op_cursor( + const co_cursor_pos_t & P) { COORD c; c.X = P.x; @@ -295,8 +296,12 @@ } co_rc_t -console_widget_NT_t::op_clear(co_console_unit &T, co_console_unit &L, co_console_unit &B, co_console_unit &R, - co_console_character charattr) +console_widget_NT_t::op_clear( + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R, + const co_console_character charattr) { SMALL_RECT r; CHAR_INFO *s; @@ -334,9 +338,13 @@ } co_rc_t -console_widget_NT_t::op_bmove(co_console_unit &Y, co_console_unit &X, - co_console_unit &T, co_console_unit &L, - co_console_unit &B, co_console_unit &R) +console_widget_NT_t::op_bmove( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R) { SMALL_RECT r; COORD c; @@ -355,7 +359,10 @@ } co_rc_t -console_widget_NT_t::op_invert(co_console_unit &Y, co_console_unit &X, co_console_unit &C) +console_widget_NT_t::op_invert( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &C) { #if 0 SMALL_RECT r = region; --- src/colinux/os/winnt/user/console-nt/widget.h +++ src/colinux/os/winnt/user/console-nt/widget.h @@ -41,17 +41,42 @@ CONSOLE_CURSOR_INFO cursor; unsigned keyed; - co_rc_t op_scroll_up(co_console_unit &topRow, co_console_unit &bottomRow, co_console_unit &lines); - co_rc_t op_scroll_down(co_console_unit &topRow, co_console_unit &bottomRow, co_console_unit &lines); - co_rc_t op_putcs(co_console_unit &Y, co_console_unit &X, co_console_character *data, co_console_unit &length); - co_rc_t op_putc(co_console_unit &Y, co_console_unit &X, co_console_character &charattr); - co_rc_t op_cursor(co_cursor_pos_t & position); - co_rc_t op_clear(co_console_unit &T, co_console_unit &L, - co_console_unit &B, co_console_unit &R, co_console_character charattr); - co_rc_t op_bmove(co_console_unit &Y, co_console_unit &X, - co_console_unit &T, co_console_unit &L, - co_console_unit &B, co_console_unit &R); - co_rc_t op_invert(co_console_unit &Y, co_console_unit &X, co_console_unit &C); + co_rc_t op_scroll_up( + const co_console_unit &topRow, + const co_console_unit &bottomRow, + const co_console_unit &lines); + co_rc_t op_scroll_down( + const co_console_unit &topRow, + const co_console_unit &bottomRow, + const co_console_unit &lines); + co_rc_t op_putcs( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character *data, + const co_console_unit &length); + co_rc_t op_putc( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character &charattr); + co_rc_t op_cursor( + const co_cursor_pos_t &position); + co_rc_t op_clear( + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R, + const co_console_character charattr); + co_rc_t op_bmove( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R); + co_rc_t op_invert( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &C); }; #endif --- src/colinux/user/console-base/console.cpp +++ src/colinux/user/console-base/console.cpp @@ -186,7 +186,7 @@ return CO_RC(OK); } -co_rc_t console_window_t::online(bool ON) +co_rc_t console_window_t::online(const bool ON) { if (ON) { if (online()) @@ -269,7 +269,7 @@ } void - console_window_t::event(co_message_t & message) +console_window_t::event(co_message_t & message) { switch (message.from) { @@ -279,7 +279,7 @@ console_message = (typeof(console_message)) (message.data); - widget->event(console_message); + widget->event(*console_message); break; } @@ -332,7 +332,7 @@ } void - console_window_t::handle_scancode(co_scan_code_t sc) + console_window_t::handle_scancode(const co_scan_code_t sc) { if (state != CO_CONSOLE_STATE_ATTACHED) return; @@ -363,7 +363,7 @@ } void - console_window_t::log(const char *format, ...) + console_window_t::log(const char *format, ...) const { char buf[0x100]; --- src/colinux/user/console-base/console.h +++ src/colinux/user/console-base/console.h @@ -42,21 +42,21 @@ co_rc_t start(); co_rc_t attach(); - co_rc_t attach_anyhow(co_id_t id); + co_rc_t attach_anyhow(const co_id_t id); co_rc_t detach(); void event(co_message_t & message); - void handle_scancode(co_scan_code_t sc); + void handle_scancode(const co_scan_code_t sc); - void log(const char *format, ...); + void log(const char *format, ...) const; co_rc_t loop(); bool online() { return state != CO_CONSOLE_STATE_OFFLINE; } - co_rc_t online(bool); + co_rc_t online(const bool); protected: co_console_start_parameters_t start_parameters; --- src/colinux/user/console-base/widget.cpp +++ src/colinux/user/console-base/widget.cpp @@ -45,7 +45,7 @@ #define NOISY 0 -co_rc_t console_widget_t::event(co_console_message_t * message) // UPDATE: & message +co_rc_t console_widget_t::event(co_console_message_t & message) { co_rc_t rc; @@ -53,11 +53,11 @@ if (!console) { return CO_RC(ERROR); } - rc = co_console_op(console, message); + rc = co_console_op(console, &message); if (!CO_OK(rc)) return rc; - switch (message->type) { + switch (message.type) { case CO_OPERATION_CONSOLE_STARTUP: #if NOISY co_debug("CO_OPERATION_CONSOLE_STARTUP\n"); @@ -77,28 +77,28 @@ #if NOISY co_debug("CO_OPERATION_CONSOLE_PUTC\n"); #endif - return op_putc(message->putc.y, message->putc.x, - message->putc.charattr); + return op_putc(message.putc.y, message.putc.x, + message.putc.charattr); case CO_OPERATION_CONSOLE_PUTCS: #if NOISY co_debug("CO_OPERATION_CONSOLE_PUTCS\n"); #endif - return op_putcs(message->putcs.y, message->putcs.x, - message->putcs.data, message->putcs.count); + return op_putcs(message.putcs.y, message.putcs.x, + message.putcs.data, message.putcs.count); case CO_OPERATION_CONSOLE_SCROLL_UP: #if NOISY co_debug("CO_OPERATION_CONSOLE_SCROLL_UP\n"); #endif - return op_scroll_up(message->scroll.top, message->scroll.bottom, - message->scroll.lines); + return op_scroll_up(message.scroll.top, message.scroll.bottom, + message.scroll.lines); case CO_OPERATION_CONSOLE_SCROLL_DOWN: #if NOISY co_debug("CO_OPERATION_CONSOLE_SCROLL_DOWN\n"); #endif - return op_scroll_down(message->scroll.top, message->scroll.bottom, - message->scroll.lines); + return op_scroll_down(message.scroll.top, message.scroll.bottom, + message.scroll.lines); case CO_OPERATION_CONSOLE_CURSOR_DRAW: case CO_OPERATION_CONSOLE_CURSOR_MOVE: @@ -106,22 +106,22 @@ #if NOISY co_debug("CO_OPERATION_CONSOLE_CURSOR_\n"); #endif - return op_cursor(message->cursor); + return op_cursor(message.cursor); case CO_OPERATION_CONSOLE_CLEAR: #if NOISY co_debug("CO_OPERATION_CONSOLE_CLEAR\n"); #endif - return op_clear(message->clear.top, message->clear.left, - message->clear.bottom, message->clear.right, - message->clear.charattr); + return op_clear(message.clear.top, message.clear.left, + message.clear.bottom, message.clear.right, + message.clear.charattr); case CO_OPERATION_CONSOLE_BMOVE: #if NOISY co_debug("CO_OPERATION_CONSOLE_BMOVE\n"); #endif - return op_bmove(message->bmove.row, message->bmove.column, - message->bmove.top, message->bmove.left, - message->bmove.bottom, message->bmove.right); + return op_bmove(message.bmove.row, message.bmove.column, + message.bmove.top, message.bmove.left, + message.bmove.bottom, message.bmove.right); case CO_OPERATION_CONSOLE_SWITCH: #if NOISY co_debug("CO_OPERATION_CONSOLE_SWITCH\n"); @@ -158,14 +158,14 @@ #endif break; case CO_OPERATION_CONSOLE_INVERT_REGION: - return op_invert(message->invert.y, message->invert.x, - message->invert.count); + return op_invert(message.invert.y, message.invert.x, + message.invert.count); #if NOISY co_debug("CO_OPERATION_CONSOLE_INVERT_REGION\n"); #endif break; default: - co_debug("CO_OPERATION_CONSOLE_%d\n", message->type); + co_debug("CO_OPERATION_CONSOLE_%d\n", message.type); } return CO_RC(ERROR); --- src/colinux/user/console-base/widget.h +++ src/colinux/user/console-base/widget.h @@ -14,14 +14,16 @@ extern "C" { #include -} class console_widget_t { +} + +class console_widget_t { public: console_widget_t(); virtual ~ console_widget_t() = 0; void co_console(co_console_t * _console); co_console_t *co_console(); - co_rc_t event(co_console_message_t * message); + co_rc_t event(co_console_message_t & message); void redraw(); virtual co_rc_t loop() = 0; @@ -38,41 +40,42 @@ virtual void draw() = 0; - virtual co_rc_t op_scroll_up(co_console_unit &topRow, - co_console_unit &bottomRow, - co_console_unit &lines) = 0; - - virtual co_rc_t op_scroll_down(co_console_unit &topRow, - co_console_unit &bottomRow, - co_console_unit &lines) = 0; - - virtual co_rc_t op_putcs(co_console_unit &Y, - co_console_unit &X, - co_console_character *data, - co_console_unit &length) = 0; - - virtual co_rc_t op_putc(co_console_unit &Y, - co_console_unit &X, - co_console_character &charattr) = 0; - - virtual co_rc_t op_cursor(co_cursor_pos_t & position) = 0; - - virtual co_rc_t op_clear(co_console_unit &T, - co_console_unit &L, - co_console_unit &B, - co_console_unit &R, - co_console_character charattr) = 0; - - virtual co_rc_t op_bmove(co_console_unit &Y, - co_console_unit &X, - co_console_unit &T, - co_console_unit &L, - co_console_unit &B, - co_console_unit &R) = 0; - - virtual co_rc_t op_invert(co_console_unit &Y, - co_console_unit &X, - co_console_unit &C) = 0; + virtual co_rc_t op_scroll_up( + const co_console_unit &topRow, + const co_console_unit &bottomRow, + const co_console_unit &lines) = 0; + virtual co_rc_t op_scroll_down( + const co_console_unit &topRow, + const co_console_unit &bottomRow, + const co_console_unit &lines) = 0; + virtual co_rc_t op_putcs( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character *data, + const co_console_unit &length) = 0; + virtual co_rc_t op_putc( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_character &charattr) = 0; + virtual co_rc_t op_cursor( + const co_cursor_pos_t & position) = 0; + virtual co_rc_t op_clear( + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R, + const co_console_character charattr) = 0; + virtual co_rc_t op_bmove( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &T, + const co_console_unit &L, + const co_console_unit &B, + const co_console_unit &R) = 0; + virtual co_rc_t op_invert( + const co_console_unit &Y, + const co_console_unit &X, + const co_console_unit &C) = 0; }; extern "C" console_widget_t * co_console_widget_create();