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