xref: /haiku/src/tests/apps/miniterminal/MiniView.h (revision 42244cf30eecf46a9e9e45953b0cc05870f765c1)
1160bd2ffSMichael Lotz #ifndef _MINI_TERMINAL_H_
2160bd2ffSMichael Lotz #define _MINI_TERMINAL_H_
3160bd2ffSMichael Lotz 
4fa784894SMichael Lotz #include <MessageFilter.h>
5fa784894SMichael Lotz 
6160bd2ffSMichael Lotz #include "ViewBuffer.h"
7160bd2ffSMichael Lotz #include "Console.h"
8160bd2ffSMichael Lotz 
9*42244cf3SIngo Weinhold class Arguments;
10*42244cf3SIngo Weinhold 
11160bd2ffSMichael Lotz class MiniView : public ViewBuffer {
12160bd2ffSMichael Lotz public:
13*42244cf3SIngo Weinhold 							MiniView(const Arguments &args);
14160bd2ffSMichael Lotz virtual						~MiniView();
15160bd2ffSMichael Lotz 
16160bd2ffSMichael Lotz 		void				Start();
17160bd2ffSMichael Lotz 		status_t			OpenTTY();
18160bd2ffSMichael Lotz 		status_t			SpawnThreads();
1952e1c3c0SMichael Lotz 
2052e1c3c0SMichael Lotz virtual	void				FrameResized(float width, float height);
21160bd2ffSMichael Lotz virtual	void				KeyDown(const char *bytes, int32 numBytes);
22160bd2ffSMichael Lotz 
23fa784894SMichael Lotz private:
24fa784894SMichael Lotz static	int32				ConsoleWriter(void *arg);
25fa784894SMichael Lotz static	int32				ExecuteShell(void *arg);
26fa784894SMichael Lotz static	filter_result		MessageFilter(BMessage *message, BHandler **target, BMessageFilter *filter);
27fa784894SMichael Lotz 
28*42244cf3SIngo Weinhold 		const Arguments		&fArguments;
29160bd2ffSMichael Lotz 		Console				*fConsole;
30160bd2ffSMichael Lotz 		int					fMasterFD;
31160bd2ffSMichael Lotz 		int					fSlaveFD;
3252e1c3c0SMichael Lotz 		thread_id			fShellExecutor;
33160bd2ffSMichael Lotz 		thread_id			fShellProcess;
34160bd2ffSMichael Lotz 		thread_id			fConsoleWriter;
35160bd2ffSMichael Lotz };
36160bd2ffSMichael Lotz 
37160bd2ffSMichael Lotz #endif
38