/***************************************************************************
 *   $Id: main.cpp,v 1.1.1.1.2.2 2017-12-19 09:34:47 giacomo Exp $
 *                                                                         *
 *   Copyright (C) 2009 Claudio Scafuri                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include <TApplication>
#include "shutterlhpil.h"
#include <tutil.h>
#include <X11/Xlib.h>
#include <QX11Info>
#include <elettracolors.h>
#include <TSplashScreen>

#define CVSVERSION "$Name:  $"

int main(int argc, char ** argv) {
    const char *cvs_version = CVSVERSION;
    TApplication a(argc, argv);
    a.setApplicationVersion(cvs_version);
    a.setPalette(EPalette("fermi"));
    a.setApplicationName("shutterlhpil");
    a.setProperty("author", "Giacomo");
    a.setProperty("mail", "giacomo.strangolino@elettra.eu");
    a.setProperty("phone", "375-8073");
    a.setProperty("office", "T2PT025");

    TUtil::instance()->setLoggingTarget(argv[0]);
    TSplashScreen splash;

    Shutterlhpil mw;
    mw.setWindowTitle("Pil/Lh Shutters");
    mw.show();
    splash.finish(&mw);

    /* register to window manager */
    Display *disp = QX11Info::display();
    Window root_win = (Window) mw.winId();
    XSetCommand(disp, root_win, argv, argc);

    return a.exec();
}