diff --git a/src/tests/apps/miniterminal/MiniApp.cpp b/src/tests/apps/miniterminal/MiniApp.cpp index ba2375a848..b0a69f9965 100644 --- a/src/tests/apps/miniterminal/MiniApp.cpp +++ b/src/tests/apps/miniterminal/MiniApp.cpp @@ -5,14 +5,15 @@ * Distributed under the Haiku License. */ +#include #include "MiniApp.h" #include "MiniWin.h" #include "MiniView.h" -MiniApp::MiniApp() +MiniApp::MiniApp(BRect bounds) : BApplication("application/x-vnd.Haiku.MiniTerminal") { - fWindow = new MiniWin(BRect(50, 50, 630, 435).OffsetToCopy(640, 480)); + fWindow = new MiniWin(bounds); fWindow->Show(); } @@ -30,9 +31,26 @@ MiniApp::~MiniApp() int -main(void) +main(int argc, const char *argv[]) { - MiniApp *app = new MiniApp(); + BRect bounds(50, 50, 630, 435); + + if (argc >= 3) { + BPoint offset; + sscanf(argv[1], "%f", &offset.x); + sscanf(argv[2], "%f", &offset.y); + bounds.OffsetTo(offset); + } + + if (argc >= 5) { + BPoint size; + sscanf(argv[3], "%f", &size.x); + sscanf(argv[4], "%f", &size.y); + bounds.right = bounds.left + size.x; + bounds.bottom = bounds.top + size.y; + } + + MiniApp *app = new MiniApp(bounds); app->Run(); delete app; return 0; diff --git a/src/tests/apps/miniterminal/MiniApp.h b/src/tests/apps/miniterminal/MiniApp.h index 58dbc92cdb..574ea6f14d 100644 --- a/src/tests/apps/miniterminal/MiniApp.h +++ b/src/tests/apps/miniterminal/MiniApp.h @@ -7,7 +7,7 @@ class MiniWin; class MiniApp : public BApplication { public: - MiniApp(); + MiniApp(BRect bounds); virtual ~MiniApp(); virtual void ReadyToRun(); diff --git a/src/tests/apps/miniterminal/MiniView.cpp b/src/tests/apps/miniterminal/MiniView.cpp index fce8cc4382..9c5f7c4a8a 100644 --- a/src/tests/apps/miniterminal/MiniView.cpp +++ b/src/tests/apps/miniterminal/MiniView.cpp @@ -90,9 +90,9 @@ MiniView::Start() setsid(); // move our stdin and stdout to the console - dup2(fSlaveFD, 0); + /*dup2(fSlaveFD, 0); dup2(fSlaveFD, 1); - dup2(fSlaveFD, 2); + dup2(fSlaveFD, 2);*/ if (SpawnThreads() != B_OK) TRACE(("error in SpawnThreads\n"));