1 // Baulk - qtermwidget Reimplement - BaulkTerm
3 // Baulk - Copyright (C) 2008 - Jacob Alexander
5 // Baulk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // any later version, including version 3 of the License.
10 // Baulk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <QCloseEvent>
27 #include <QMainWindow>
28 #include <QResizeEvent>
30 #include <QVBoxLayout>
33 #include <baulkwidget.h>
34 #include <baulkwindow.h>
36 #include <builddefines.h>
37 #include <qtermwidget.h>
39 #include "rightclickmenu.h"
40 #include "terminalcolour.h"
42 //! Additional functionality for qtermwidget
43 class BaulkTerm
: public BaulkWidget
{
47 //! Default Constructor
49 * \param startNow 1 for starting the terminal right away, 0 for starting later
50 * \see startShellProgram
51 * \param standalone true if the terminal is started in standalone mode, false if used as a library
53 BaulkTerm( int startNow
= 1, bool standalone
= false, QWidget
*parent
= 0 );
57 virtual bool processCommandArgs();
60 void startShellProgram();
63 bool useDaemon() const { return daemonEnabled
; }
64 QString
listenName() const { return daemonListenName
; }
68 void newTerminal( bool useMainWindow
= false );
75 QTermWidget
*mainTerm
;
76 QList
<QTermWidget
*> termList
;
78 QVBoxLayout
*termLayout
;
80 //! Terminal Right Click Menu
81 BaulkTermRightClickMenu
*rightClickMenu
;
83 //! Configuration File Pointer
86 //! Configuration Settings
96 QString daemonListenName
;
105 QString shellProgram
;
106 QStringList environmentVariables
;
109 TerminalColour foreground
;
110 TerminalColour background
;
111 TerminalColour black
;
113 TerminalColour green
;
114 TerminalColour yellow
;
116 TerminalColour magenta
;
118 TerminalColour white
;
120 //! Intensive Colours
121 TerminalColour intForeground
;
122 TerminalColour intBackground
;
123 TerminalColour intBlack
;
124 TerminalColour intRed
;
125 TerminalColour intGreen
;
126 TerminalColour intYellow
;
127 TerminalColour intBlue
;
128 TerminalColour intMagenta
;
129 TerminalColour intCyan
;
130 TerminalColour intWhite
;
133 //! Configuration Functions
134 void configurationDefaults();
135 void configurationLoad();
136 void configurationSave();
137 void configurationSet();
143 void xMouseInput( int, int, int, int );
144 void rightClickAction();
146 void updateMainWindowTitle( QString title
);
148 void removeTerminalFromList( QTermWidget
*terminal
= 0 );
149 void removeTerminalViaUserClose();
151 void changeTransparency( qreal opacity
, qreal fadeOpacity
);
154 virtual void changeEvent( QEvent
*event
);
155 virtual void resizeEvent( QResizeEvent
*event
);
156 virtual void closeEvent( QCloseEvent
*event
);
160 void removedTerminal();