📄 console.h
字号:
#ifndef _CONSOLE_H
#define _CONSOLE_H
class process;
#include "driver.h"
#include "drvreq.h"
#define WHITE 0x0700
#define cout _console_obj
#define endl '\n'
class console: public driver
{
private:
int row;
int col;
ushort *base;
ushort attr;
public:
console (char* name);
~console ();
console& operator<<(char* _s);
console& operator<<(uchar _c);
console& operator<<(uint _i);
void scroll();
void update_cursor();
inline console& operator<<(char _c)
{
return *this<<(uchar)_c;
}
inline console& operator<<(int _i)
{
if(_i < 0 ) {*this<<'-';_i = -_i;}
return *this<<(uint)_i;
}
inline console& operator<<(ushort _i)
{
return *this<<(uint)_i;
}
inline console& operator<<(short _i)
{
if(_i < 0 ) {*this<<'-';_i = -_i;}
return *this<<(uint)_i;
}
inline console& operator<<(ulong _i)
{
return *this<<(uint)_i;
}
inline console& operator<<(long _i)
{
if(_i < 0) {*this<<'-';_i = -_i;}
return *this<<(uint)_i;
}
inline void clrscr()
{
memset_w(base,(' '|attr),80*25);
row = col = 0;
update_cursor();
}
inline void gotoxy(int x,int y)
{
col = x;
row = y * 80;
update_cursor();
}
inline console& operator<<(float _f)
{
return *this;
}
inline console& operator<<(double _d)
{
return *this;
}
inline console& operator<<(ldouble _d)
{
return *this;
}
void dispnum(uint num,int base);
};
int console_main(void *arg);
extern console _console_obj;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -