-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[servers/console] Add new activate flag
This flag is to be used by cludio, and by cluido only, to ensure that the cluido console is always made visible when created; other servers have a lower pirority. This is important to give the user a decent experience when running e.g. the chaos Docker container, using a pre-compiled chaos .iso image etc. Closes #45; there are still some issues with the kernel log console (as being created by the log server) not being visible, but I will create a separate issue for that before merging this one.
- Loading branch information
Showing
6 changed files
with
53 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
// Abstract: Console library. | ||
// Author: Per Lundberg <[email protected]> | ||
// | ||
// © Copyright 1999-2000 chaos development | ||
// © Copyright 2013 chaos development | ||
// © Copyright 2015-2016 chaos development | ||
// © Copyright 1999 chaos development | ||
|
||
// See The chaos Programming Reference Manual for more information about the functions in this library. | ||
|
||
|
@@ -52,10 +50,10 @@ return_type console_init(console_structure_type *console_structure, tag_type *ta | |
|
||
// Allocate and open a new console with the specified attributes. | ||
|
||
// FIXME: If input parameters are all zero (except for mode_type), a default mode with the requested type should be set and the | ||
// attributes of that mode should be returned. | ||
return_type console_open(console_structure_type *console_structure, unsigned int width, unsigned int height, unsigned int depth, | ||
int mode_type) | ||
// FIXME: If input parameters are all zero (except for mode_type), a default mode with the requested | ||
// type should be set and the attributes of that mode should be returned. | ||
return_type console_open(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height, unsigned int depth, int mode_type, bool activate) | ||
{ | ||
if (!console_structure->initialised) | ||
{ | ||
|
@@ -67,6 +65,7 @@ return_type console_open(console_structure_type *console_structure, unsigned int | |
console_attribute.height = height; | ||
console_attribute.depth = depth; | ||
console_attribute.mode_type = mode_type; | ||
console_attribute.activate = activate; | ||
|
||
message_parameter_type message_parameter; | ||
message_parameter.protocol = IPC_PROTOCOL_CONSOLE; | ||
|
@@ -82,8 +81,8 @@ return_type console_open(console_structure_type *console_structure, unsigned int | |
} | ||
|
||
// Change the attributes of the current console. | ||
return_type console_mode_set(console_structure_type *console_structure, unsigned int width, unsigned int height, | ||
unsigned int depth, int mode_type) | ||
return_type console_mode_set(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height, unsigned int depth, int mode_type) | ||
{ | ||
if (!console_structure->initialised) | ||
{ | ||
|
@@ -109,7 +108,8 @@ return_type console_mode_set(console_structure_type *console_structure, unsigned | |
} | ||
|
||
// Change the size (text rows and columns, not mode!) of the current console. | ||
return_type console_resize(console_structure_type *console_structure, unsigned int width, unsigned int height) | ||
return_type console_resize(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height) | ||
{ | ||
if (!console_structure->initialised) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
// Abstract: Function definitions for the console library. | ||
// Author: Per Lundberg <[email protected]> | ||
// | ||
// © Copyright 1999-2000 chaos development | ||
// © Copyright 2013 chaos development | ||
// © Copyright 2015-2016 chaos development | ||
// © Copyright 1999 chaos development | ||
|
||
#pragma once | ||
|
||
|
@@ -12,22 +10,29 @@ | |
|
||
C_EXTERN_BEGIN | ||
|
||
extern return_type console_init(console_structure_type *console_structure, tag_type *tag, unsigned int connection_class); | ||
extern return_type console_open(console_structure_type *console_structure, unsigned int width, unsigned int height, | ||
unsigned int depth, int mode_type); | ||
extern return_type console_mode_set(console_structure_type *console_structure, unsigned int width, unsigned int height, | ||
unsigned int depth, int mode_type); | ||
extern return_type console_init(console_structure_type *console_structure, tag_type *tag, | ||
unsigned int connection_class); | ||
extern return_type console_open(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height, unsigned int depth, int mode_type, bool activate); | ||
extern return_type console_mode_set(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height, unsigned int depth, int mode_type); | ||
|
||
extern return_type console_resize(console_structure_type *console_structure, unsigned int width, unsigned int height); | ||
extern return_type console_resize(console_structure_type *console_structure, unsigned int width, | ||
unsigned int height); | ||
extern return_type console_print(console_structure_type *console_structure, const char *string); | ||
extern return_type console_print_formatted(console_structure_type *console_structure, const char *string, ...); | ||
extern return_type console_print_formatted(console_structure_type *console_structure, | ||
const char *string, ...); | ||
// __attribute__ ((format (printf, 1, 2))); | ||
extern return_type console_clear(console_structure_type *console_structure); | ||
extern return_type console_cursor_move(console_structure_type *console_structure, unsigned int x, unsigned int y); | ||
extern return_type console_attribute_set(console_structure_type *console_structure, int foreground, int background, int attributes); | ||
extern return_type console_cursor_appearance_set(console_structure_type *console_structure, bool visibility, bool block); | ||
extern return_type console_cursor_move(console_structure_type *console_structure, unsigned int x, | ||
unsigned int y); | ||
extern return_type console_attribute_set(console_structure_type *console_structure, int foreground, | ||
int background, int attributes); | ||
extern return_type console_cursor_appearance_set(console_structure_type *console_structure, | ||
bool visibility, bool block); | ||
extern return_type console_use_keyboard(console_structure_type *console_structure, bool which, int type); | ||
extern return_type console_use_mouse(console_structure_type *console_structure, bool which); | ||
extern return_type console_event_wait(console_structure_type *console_structure, void *event_data, int *type, bool block); | ||
extern return_type console_event_wait(console_structure_type *console_structure, void *event_data, | ||
int *type, bool block); | ||
|
||
C_EXTERN_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// Abstract: Console server IPC message types. | ||
// Author: Per Lundberg <[email protected]> | ||
// | ||
// © Copyright 1999-2000 chaos development | ||
// © Copyright 2013-2017 chaos development | ||
// © Copyright 1999 chaos development | ||
|
||
#pragma once | ||
|
||
|
@@ -51,8 +50,22 @@ typedef struct | |
// Physical console attribute type. | ||
typedef struct | ||
{ | ||
// The width in pixels (for VIDEO_MODE_TYPE_GRAPHIC) or characters (for VIDEO_MODE_TYPE_TEXT) | ||
// of the console being opened. | ||
unsigned int width; | ||
|
||
// The height in pixels (for VIDEO_MODE_TYPE_GRAPHIC) or lines (for VIDEO_MODE_TYPE_TEXT) | ||
// of the console being opened. | ||
unsigned int height; | ||
|
||
// For VIDEO_MODE_TYPE_GRAPHIC, indicates the depth in bits (15, 16, 24 etc) of the mode being | ||
// requested. | ||
unsigned int depth; | ||
|
||
// Set to either VIDEO_MODE_TYPE_TEXT or VIDEO_MODE_TYPE_GRAPHIC. | ||
unsigned int mode_type; | ||
|
||
// Indicates that the console should be activated upon creation. Can only be done once; if | ||
// there is already an active console, this flag will be ignored by the console server. | ||
bool activate; | ||
} ipc_console_attribute_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters