xref: /haiku/src/apps/terminal/TermApp.h (revision 5b41331f1100c78541d87b7ad5a15d5652acb079)
1d3dc729fSAxel Dörfler /*
2*5b41331fSSiarzhuk Zharski  * Copyright 2001-2013, 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  *
6*5b41331fSSiarzhuk Zharski  * Distributed under the terms of the MIT License.
7d3dc729fSAxel Dörfler  *
8*5b41331fSSiarzhuk Zharski  * Authors:
9*5b41331fSSiarzhuk Zharski  *		Kian Duffy, myob@users.sourceforge.net
10*5b41331fSSiarzhuk Zharski  *		Siarzhuk Zharski, zharik@gmx.li
11d3dc729fSAxel Dörfler  */
127f108511SAxel Dörfler #ifndef TERM_APP_H
137f108511SAxel Dörfler #define TERM_APP_H
14d3dc729fSAxel Dörfler 
15d3dc729fSAxel Dörfler 
167f108511SAxel Dörfler #include <Application.h>
178989d8a5SStephan Aßmus #include <Catalog.h>
18d18fc399SAdrien Destugues #include <File.h>
19d3dc729fSAxel Dörfler #include <String.h>
20d3dc729fSAxel Dörfler 
21fe256869SSiarzhuk Zharski #include "Colors.h"
2291eec68cSIngo Weinhold 
23bb4632f1SStefano Ceccherini class Arguments;
24d3dc729fSAxel Dörfler class BRect;
25702e4be8SStefano Ceccherini class BWindow;
2691eec68cSIngo Weinhold 
2791eec68cSIngo Weinhold 
287f108511SAxel Dörfler class TermApp : public BApplication {
29d3dc729fSAxel Dörfler public:
3076649c03SAxel Dörfler 								TermApp();
317f108511SAxel Dörfler 	virtual						~TermApp();
32d3dc729fSAxel Dörfler 
33fe256869SSiarzhuk Zharski 	static const rgb_color*		DefaultPalette()
34fe256869SSiarzhuk Zharski 									{ return fDefaultPalette; }
357f108511SAxel Dörfler protected:
36490f7858SIngo Weinhold 	virtual	void				ReadyToRun();
37490f7858SIngo Weinhold 	virtual bool				QuitRequested();
38490f7858SIngo Weinhold 	virtual	void				Quit();
39490f7858SIngo Weinhold 	virtual	void				MessageReceived(BMessage* message);
40490f7858SIngo Weinhold 	virtual	void				RefsReceived(BMessage* message);
41490f7858SIngo Weinhold 	virtual	void				ArgvReceived(int32 argc, char** argv);
42d3dc729fSAxel Dörfler 
43d3dc729fSAxel Dörfler private:
44105093fdSIngo Weinhold 			status_t			_MakeTermWindow();
45d3dc729fSAxel Dörfler 
46dbc03773SIngo Weinhold 			void				_HandleChildCleanup();
47dbc03773SIngo Weinhold 	static	void				_SigChildHandler(int signal, void* data);
48dbc03773SIngo Weinhold 	static	status_t			_ChildCleanupThread(void* data);
49dbc03773SIngo Weinhold 
507f108511SAxel Dörfler 			void				_Usage(char *name);
51fe256869SSiarzhuk Zharski 			void				_InitDefaultPalette();
5291eec68cSIngo Weinhold private:
53265fea4aSFrançois Revol 			bool				fStartFullscreen;
540d5dea62SAxel Dörfler 			BString				fWindowTitle;
5585f69514SStefano Ceccherini 
56702e4be8SStefano Ceccherini 			BWindow*			fTermWindow;
57bb4632f1SStefano Ceccherini 			Arguments*			fArgs;
58fe256869SSiarzhuk Zharski 	static	rgb_color			fDefaultPalette[kTermColorCount];
59d3dc729fSAxel Dörfler };
60d3dc729fSAxel Dörfler 
6191eec68cSIngo Weinhold 
627f108511SAxel Dörfler #endif	// TERM_APP_H
63