diff --git a/src/tests/apps/Jamfile b/src/tests/apps/Jamfile index f99274294e..65d8f0d62b 100644 --- a/src/tests/apps/Jamfile +++ b/src/tests/apps/Jamfile @@ -4,4 +4,5 @@ SubInclude HAIKU_TOP src tests apps fake_app_server ; SubInclude HAIKU_TOP src tests apps installer ; SubInclude HAIKU_TOP src tests apps miniterminal ; SubInclude HAIKU_TOP src tests apps partitioner ; +SubInclude HAIKU_TOP src tests apps terminal_replicant ; diff --git a/src/tests/apps/terminal_replicant/Jamfile b/src/tests/apps/terminal_replicant/Jamfile new file mode 100644 index 0000000000..9dcf3fa206 --- /dev/null +++ b/src/tests/apps/terminal_replicant/Jamfile @@ -0,0 +1,12 @@ +SubDir HAIKU_TOP src tests apps terminal_replicant ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +SubDirHdrs [ FDirName $(HAIKU_TOP) src apps terminal ] ; + +Application RepliTerminal : + main.cpp + : be + ; + +SEARCH on [ FGristFiles TermView.h ] = [ FDirName $(HAIKU_TOP) src apps terminal ] ; diff --git a/src/tests/apps/terminal_replicant/main.cpp b/src/tests/apps/terminal_replicant/main.cpp new file mode 100644 index 0000000000..8ff9342f3d --- /dev/null +++ b/src/tests/apps/terminal_replicant/main.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "TermConst.h" +#include "TermView.h" + +class App : public BApplication { +public: + App(); +}; + + +class Window : public BWindow { +public: + Window(); + void AttachTermView(); +private: + BShelf *fShelf; +}; + + +int main() +{ + App app; + app.Run(); + return 0; +} + + +// App +App::App() + :BApplication("application/x-vnd-terminal-replicant") +{ + Window *window = new Window(); + window->Show(); +} + + +// Window +Window::Window() + :BWindow(BRect(20, 20, 300, 300), "RepliTerminal", + B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS|B_QUIT_ON_WINDOW_CLOSE) +{ + AttachTermView(); +} + + +void +Window::AttachTermView() +{ + // BMessage containing the class name and the app_signature + // for Terminal and TermView + BMessage message; + message.AddString("class", "TermView"); + message.AddString("add_on", TERM_SIGNATURE); + + BView *termView = dynamic_cast(instantiate_object(&message)); + + if (termView != NULL) { + termView->SetResizingMode(B_FOLLOW_ALL); + AddChild(termView); + + termView->ResizeToPreferred(); + } +}