1 /* 2 * Copyright 2001-2013, Haiku. 3 * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net> 4 * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. 5 * 6 * Distributed under the terms of the MIT License. 7 * 8 * Authors: 9 * Kian Duffy, myob@users.sourceforge.net 10 * Siarzhuk Zharski, zharik@gmx.li 11 */ 12 #ifndef TERM_APP_H 13 #define TERM_APP_H 14 15 16 #include <Application.h> 17 #include <Catalog.h> 18 #include <File.h> 19 #include <String.h> 20 21 #include "Colors.h" 22 23 class Arguments; 24 class BRect; 25 class BWindow; 26 27 28 class TermApp : public BApplication { 29 public: 30 TermApp(); 31 virtual ~TermApp(); 32 33 static const rgb_color* DefaultPalette() 34 { return fDefaultPalette; } 35 protected: 36 virtual void ReadyToRun(); 37 virtual bool QuitRequested(); 38 virtual void Quit(); 39 virtual void MessageReceived(BMessage* message); 40 virtual void RefsReceived(BMessage* message); 41 virtual void ArgvReceived(int32 argc, char** argv); 42 43 private: 44 status_t _MakeTermWindow(); 45 46 static void _SigChildHandler(int signal, void* data); 47 static status_t _ChildCleanupThreadEntry(void* data); 48 status_t _ChildCleanupThread(); 49 50 void _Usage(char *name); 51 void _InitDefaultPalette(); 52 private: 53 thread_id fChildCleanupThread; 54 bool fTerminating; 55 bool fStartFullscreen; 56 BString fWindowTitle; 57 58 BWindow* fTermWindow; 59 Arguments* fArgs; 60 static rgb_color fDefaultPalette[kTermColorCount]; 61 }; 62 63 64 #endif // TERM_APP_H 65