1d3dc729fSAxel Dörfler /* 291eec68cSIngo Weinhold * Copyright 2001-2010, Haiku. 3d3dc729fSAxel Dörfler * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net> 4d3dc729fSAxel Dörfler * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. 5d3dc729fSAxel Dörfler * 6d3dc729fSAxel Dörfler * Permission is hereby granted, free of charge, to any person obtaining 7d3dc729fSAxel Dörfler * a copy of this software and associated documentation files or portions 8d3dc729fSAxel Dörfler * thereof (the "Software"), to deal in the Software without restriction, 9d3dc729fSAxel Dörfler * including without limitation the rights to use, copy, modify, merge, 10d3dc729fSAxel Dörfler * publish, distribute, sublicense, and/or sell copies of the Software, 11d3dc729fSAxel Dörfler * and to permit persons to whom the Software is furnished to do so, subject 12d3dc729fSAxel Dörfler * to the following conditions: 13d3dc729fSAxel Dörfler * 14d3dc729fSAxel Dörfler * * Redistributions of source code must retain the above copyright notice, 15d3dc729fSAxel Dörfler * this list of conditions and the following disclaimer. 16d3dc729fSAxel Dörfler * 17d3dc729fSAxel Dörfler * * Redistributions in binary form must reproduce the above copyright notice 18d3dc729fSAxel Dörfler * in the binary, as well as this list of conditions and the following 19d3dc729fSAxel Dörfler * disclaimer in the documentation and/or other materials provided with 20d3dc729fSAxel Dörfler * the distribution. 21d3dc729fSAxel Dörfler * 22d3dc729fSAxel Dörfler * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23d3dc729fSAxel Dörfler * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24d3dc729fSAxel Dörfler * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25d3dc729fSAxel Dörfler * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26d3dc729fSAxel Dörfler * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27d3dc729fSAxel Dörfler * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28d3dc729fSAxel Dörfler * THE SOFTWARE. 29d3dc729fSAxel Dörfler * 30d3dc729fSAxel Dörfler */ 317f108511SAxel Dörfler #ifndef TERM_APP_H 327f108511SAxel Dörfler #define TERM_APP_H 33d3dc729fSAxel Dörfler 34d3dc729fSAxel Dörfler 357f108511SAxel Dörfler #include <Application.h> 368989d8a5SStephan Aßmus #include <Catalog.h> 37d18fc399SAdrien Destugues #include <File.h> 38d3dc729fSAxel Dörfler #include <String.h> 39d3dc729fSAxel Dörfler 4091eec68cSIngo Weinhold 41bb4632f1SStefano Ceccherini class Arguments; 42d3dc729fSAxel Dörfler class BRect; 43702e4be8SStefano Ceccherini class BWindow; 4491eec68cSIngo Weinhold 4591eec68cSIngo Weinhold 467f108511SAxel Dörfler class TermApp : public BApplication { 47d3dc729fSAxel Dörfler public: 4876649c03SAxel Dörfler TermApp(); 497f108511SAxel Dörfler virtual ~TermApp(); 50d3dc729fSAxel Dörfler 517f108511SAxel Dörfler protected: 52490f7858SIngo Weinhold virtual void ReadyToRun(); 53490f7858SIngo Weinhold virtual bool QuitRequested(); 54490f7858SIngo Weinhold virtual void Quit(); 55490f7858SIngo Weinhold virtual void AboutRequested(); 56490f7858SIngo Weinhold virtual void MessageReceived(BMessage* message); 57490f7858SIngo Weinhold virtual void RefsReceived(BMessage* message); 58490f7858SIngo Weinhold virtual void ArgvReceived(int32 argc, char** argv); 59d3dc729fSAxel Dörfler 60d3dc729fSAxel Dörfler private: 61*105093fdSIngo Weinhold status_t _MakeTermWindow(); 62d3dc729fSAxel Dörfler 63dbc03773SIngo Weinhold void _HandleChildCleanup(); 64dbc03773SIngo Weinhold static void _SigChildHandler(int signal, void* data); 65dbc03773SIngo Weinhold static status_t _ChildCleanupThread(void* data); 66dbc03773SIngo Weinhold 677f108511SAxel Dörfler void _Usage(char *name); 687f108511SAxel Dörfler 6991eec68cSIngo Weinhold private: 70265fea4aSFrançois Revol bool fStartFullscreen; 710d5dea62SAxel Dörfler BString fWindowTitle; 7285f69514SStefano Ceccherini 73702e4be8SStefano Ceccherini BWindow* fTermWindow; 74bb4632f1SStefano Ceccherini Arguments* fArgs; 75d3dc729fSAxel Dörfler }; 76d3dc729fSAxel Dörfler 7791eec68cSIngo Weinhold 787f108511SAxel Dörfler #endif // TERM_APP_H 79