git-svn-id: svn://db.shs.com.ru/pip@253 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -65,6 +65,15 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
int main (int argc, char * argv[]) {
|
int main (int argc, char * argv[]) {
|
||||||
|
int in[8], out[8];
|
||||||
|
memset(in, 0, 4*8);
|
||||||
|
memset(out, 0, 4*8);
|
||||||
|
for (int i = 0; i <= 0xF; ++i) {
|
||||||
|
for (int b = 0; b < 4; ++b) out[b] = (i >> b) & 1;
|
||||||
|
for (int b = 0; b < 4; ++b) PICout(0) << " " << out[b];
|
||||||
|
PICout(0) << PICoutManipulators::NewLine;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
PIScreen screen;
|
PIScreen screen;
|
||||||
PITerminal term;
|
PITerminal term;
|
||||||
TileTerminal tt(&term);
|
TileTerminal tt(&term);
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ void readConsole(int x, int y, int w, int h) {
|
|||||||
bs.X = w;
|
bs.X = w;
|
||||||
bs.Y = h;
|
bs.Y = h;
|
||||||
bc.X = bc.Y = 0;
|
bc.X = bc.Y = 0;
|
||||||
|
memset(chars, 0, w * h * sizeof(CHAR_INFO));
|
||||||
ReadConsoleOutput(console, chars, bs, bc, &(sbi.srWindow));
|
ReadConsoleOutput(console, chars, bs, bc, &(sbi.srWindow));
|
||||||
for (int i = 0; i < h; ++i)
|
for (int i = 0; i < h; ++i)
|
||||||
for (int j = 0; j < w; ++j)
|
for (int j = 0; j < w; ++j)
|
||||||
@@ -115,8 +116,11 @@ void resizeConsole(int w, int h) {
|
|||||||
con_w = w;
|
con_w = w;
|
||||||
con_h = h;
|
con_h = h;
|
||||||
GetConsoleScreenBufferInfo(console, &sbi);
|
GetConsoleScreenBufferInfo(console, &sbi);
|
||||||
|
sbi.srWindow.Left = 0;
|
||||||
sbi.srWindow.Right = sbi.srWindow.Left + w - 1;
|
sbi.srWindow.Right = sbi.srWindow.Left + w - 1;
|
||||||
sbi.srWindow.Bottom = sbi.srWindow.Top + h - 1;
|
sbi.srWindow.Bottom = sbi.srWindow.Top + h - 1;
|
||||||
|
COORD sz; sz.X = w; sz.Y = h;
|
||||||
|
SetConsoleScreenBufferSize(console, sz);
|
||||||
SetConsoleWindowInfo(console, TRUE, &(sbi.srWindow));
|
SetConsoleWindowInfo(console, TRUE, &(sbi.srWindow));
|
||||||
//system(("mode CON: COLS=" + PIString::fromNumber(w) + " LINES=" + PIString::fromNumber(h)).dataAscii());
|
//system(("mode CON: COLS=" + PIString::fromNumber(w) + " LINES=" + PIString::fromNumber(h)).dataAscii());
|
||||||
resizeCells(w, h);
|
resizeCells(w, h);
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ void PITerminal::destroy() {
|
|||||||
waitForFinish(1000);
|
waitForFinish(1000);
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
if (PRIVATE->pi.hProcess) {
|
if (PRIVATE->pi.hProcess) {
|
||||||
piCout << "term";
|
//piCout << "term";
|
||||||
//TerminateProcess(PRIVATE->pi.hProcess, 0);
|
//TerminateProcess(PRIVATE->pi.hProcess, 0);
|
||||||
GenerateConsoleCtrlEvent(CTRL_C_EVENT, PRIVATE->pi.dwProcessId);
|
GenerateConsoleCtrlEvent(CTRL_C_EVENT, PRIVATE->pi.dwProcessId);
|
||||||
CloseHandle(PRIVATE->pi.hProcess);
|
CloseHandle(PRIVATE->pi.hProcess);
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ PIPeer::PeerData::PeerData(const PIString & n): PIObject(n) {
|
|||||||
PIPeer::PeerData::~PeerData() {
|
PIPeer::PeerData::~PeerData() {
|
||||||
dt_in.stop();
|
dt_in.stop();
|
||||||
dt_out.stop();
|
dt_out.stop();
|
||||||
t.stop(true);
|
t.stop();
|
||||||
|
if (!t.waitForFinish(1000))
|
||||||
|
t.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,17 +29,18 @@ Daemon::Remote::~Remote() {
|
|||||||
|
|
||||||
void Daemon::Remote::shellOpen() {
|
void Daemon::Remote::shellOpen() {
|
||||||
if (term) return;
|
if (term) return;
|
||||||
|
piCoutObj << "shell open";
|
||||||
term = new PITerminal();
|
term = new PITerminal();
|
||||||
term->initialize();
|
term->initialize();
|
||||||
term_timer.start(40);
|
term_timer.start(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Daemon::Remote::shellClose() {
|
void Daemon::Remote::shellClose() {
|
||||||
if (!term) return;
|
if (!term) return;
|
||||||
//piCoutObj << "shellClose ...";
|
piCoutObj << "shell close";
|
||||||
term_timer.stop();
|
term_timer.stop();
|
||||||
term_timer.waitForFinish(100);
|
term_timer.waitForFinish(1000);
|
||||||
term->destroy();
|
term->destroy();
|
||||||
delete term;
|
delete term;
|
||||||
term = 0;
|
term = 0;
|
||||||
@@ -62,8 +63,11 @@ void Daemon::Remote::shellKeySend(PIKbdListener::KeyEvent k) {
|
|||||||
void Daemon::Remote::termTimerTick() {
|
void Daemon::Remote::termTimerTick() {
|
||||||
if (!term) return;
|
if (!term) return;
|
||||||
PIVector<PIVector<PIScreenTypes::Cell> > cells = term->content();
|
PIVector<PIVector<PIScreenTypes::Cell> > cells = term->content();
|
||||||
|
if (pcells == cells) return;
|
||||||
|
pcells = cells;
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
ba << int(ShellContent) << cells;
|
ba << int(ShellContent) << cells;
|
||||||
|
//piCout << ba.size_s() << pcells.back().back().symbol.unicode16Code() << cells.back().back().symbol.unicode16Code();
|
||||||
sendRequest(name(), ba);
|
sendRequest(name(), ba);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,6 +599,7 @@ void Daemon::connectToDaemon(const PIString & dn) {
|
|||||||
|
|
||||||
|
|
||||||
void Daemon::disconnect() {
|
void Daemon::disconnect() {
|
||||||
|
screen->enableExitCapture(PIKbdListener::F10);
|
||||||
conn_name.clear();
|
conn_name.clear();
|
||||||
mode = rmNone;
|
mode = rmNone;
|
||||||
showMainList();
|
showMainList();
|
||||||
@@ -821,6 +826,7 @@ void Daemon::sendDirToRemote(Remote * r) {
|
|||||||
void Daemon::requestOpenShell() {
|
void Daemon::requestOpenShell() {
|
||||||
Remote * r = remotes.value(conn_name, 0);
|
Remote * r = remotes.value(conn_name, 0);
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
|
screen->disableExitCapture();
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
ba << int(ShellOpen);
|
ba << int(ShellOpen);
|
||||||
send(conn_name, ba);
|
send(conn_name, ba);
|
||||||
@@ -830,6 +836,7 @@ void Daemon::requestOpenShell() {
|
|||||||
void Daemon::requestCloseShell() {
|
void Daemon::requestCloseShell() {
|
||||||
Remote * r = remotes.value(conn_name, 0);
|
Remote * r = remotes.value(conn_name, 0);
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
|
screen->enableExitCapture(PIKbdListener::F10);
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
ba << int(ShellClose);
|
ba << int(ShellClose);
|
||||||
send(conn_name, ba);
|
send(conn_name, ba);
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ private:
|
|||||||
|
|
||||||
PIDir dir_my;
|
PIDir dir_my;
|
||||||
PIVector<PIFile::FileInfo> my_filelist;
|
PIVector<PIFile::FileInfo> my_filelist;
|
||||||
|
PIVector<PIVector<PIScreenTypes::Cell> > pcells;
|
||||||
PIFileTransfer ft;
|
PIFileTransfer ft;
|
||||||
PIStringList _fl;
|
PIStringList _fl;
|
||||||
PacketType action;
|
PacketType action;
|
||||||
|
|||||||
Reference in New Issue
Block a user