xref: /haiku/src/apps/terminal/TermApp.h (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 /*
2  * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
3  * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files or portions
7  * thereof (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so, subject
11  * to the following conditions:
12  *
13  *  * Redistributions of source code must retain the above copyright notice,
14  *    this list of conditions and the following disclaimer.
15  *
16  *  * Redistributions in binary form must reproduce the above copyright notice
17  *    in the  binary, as well as this list of conditions and the following
18  *    disclaimer in the documentation and/or other materials provided with
19  *    the distribution.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27  * THE SOFTWARE.
28  *
29  */
30 
31 #ifndef TERMAPP_H
32 #define TERMAPP_H
33 
34 #include <app/Application.h>
35 #include <String.h>
36 
37 extern int pfd;
38 extern char *ptyname;
39 
40 class TermWindow;
41 class TermParse;
42 class BRect;
43 class AboutDlg;
44 
45 class TermApp : public BApplication
46 {
47 public:
48                TermApp();
49                ~TermApp();
50 
51 private:
52   /*
53    * Hook functions
54    */
55   void          ReadyToRun();
56   void          Quit();
57   void			AboutRequested();
58   void          MessageReceived(BMessage* msg);
59   void          RefsReceived(BMessage *message);
60   void          ArgvReceived(int32 argc, char **argv);
61 
62   /*
63    * Public Member functions.
64    */
65   void          MakeTermWindow (BRect &frame);
66   void          RunNewTerm (void);
67   void          SwitchTerm(void);
68   void          ActivateTermWindow(team_id id);
69 
70   void          Usage(char *name);
71 
72 private:
73   bool          IsMinimize (team_id);
74 
75   int		fRows, fCols, fXpos, fYpos;
76   BString	fWindowTitle;
77   int		fWindowNumber;
78   rgb_color	fFg, fBg, fCurFg, fCurBg, fSelFg, fSelbg;
79   rgb_color	fImfg, fImbg, fImSel;
80 
81   TermWindow    *fTermWindow;
82   TermParse     *fTermParse;
83   BRect         fTermFrame;
84   AboutDlg	*fAboutPanel;
85 
86   BString	CommandLine;
87 
88 };
89 
90 #endif
91 
92