1 // BaulkTerm - Standalone Binary
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/>.
18 #include <QApplication>
24 #include "baulkterm.h"
26 /// Baulk Declaration for use in handler.h
30 #include <compositing.h>
33 * @author Jacob Alexander (HaaTa)
35 * First point of entry, which passes to baulk.h.
36 * Captures all debug output for this instance of Baulk.
38 int main( int argc
, char *argv
[] ) {
40 qInstallMsgHandler( handler
);
42 // Compositing Information
45 Colormap colormap
= 0;
46 getDisplayInformation( display
, visual
, colormap
);
49 InformationClient
*client
;
51 // Qt GUI Application start with compositing information
52 QApplication
*app
= new QApplication( display
, argc
, argv
, (Qt::HANDLE
)visual
, (Qt::HANDLE
)colormap
);
53 baulk
= new BaulkTerm( 0 );
54 if ( baulk
->processCommandArgs() ) {
55 if ( baulk
->useDaemon() ) {
56 QString serverListenName
= "BaulkTermServ"; // TODO Put in config
58 // Daemon Quit Event Connection
59 InformationServer
*serv
= new InformationServer( serverListenName
);
60 //QObject::connect( serv, SIGNAL( destroyed() ), app, SLOT( quit() ));
61 QObject::connect( serv
, SIGNAL( startNewHostInstance() ), baulk
, SLOT( newTerminal() ) );
65 client
= new InformationClient( serverListenName
);
68 // Start Terminal through generic pathway (via the connection above)
69 client
->requestStartNewHostInstance();
72 if ( !baulk
->useDaemon() ) {
73 baulk
->startShellProgram();
74 baulk
->setStyleSheet("QWidget {"
87 int reTurn
= app
->exec();