Commit 572bed2e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding forgotten files.

parent 4eeb736a
/*****************************************************************************
* main.cpp: VLMC main
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/** \file
* This file contain the main function.
* It will initialize the QT application,
* and start it.
*/
#include "config.h"
#include "MainWindow.h"
#include "ProjectManager.h"
#include <QApplication>
#include <QColor>
#include <QPalette>
/**
* VLMC Entry point
* \brief this is the VLMC entry point
* \param argc
* \param argv
* \return Return value of vlmc
*/
int
VLMCmain( int argc, char **argv )
{
QApplication app( argc, argv );
app.setApplicationName( "vlmc" );
app.setOrganizationName( "vlmc" );
app.setOrganizationDomain( "vlmc.org" );
app.setApplicationVersion( PROJECT_VERSION );
#ifdef Q_OS_WIN
QFile css(":/styles/windows");
if ( css.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QString styleSheet = css.readAll();
if ( styleSheet != "" )
app.setStyleSheet( styleSheet );
}
#endif
// Creating the color palette
QPalette p;
p.setColor( QPalette::WindowText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::Button, QColor( 104, 103, 103, 255 ) );
p.setColor( QPalette::Light, QColor( 156, 155, 155, 255 ) );
p.setColor( QPalette::Midlight, QColor( 130, 129, 129, 255 ) );
p.setColor( QPalette::Dark, QColor( 52, 51, 51, 255 ) );
p.setColor( QPalette::Mid, QColor( 69, 68, 68, 255 ) );
p.setColor( QPalette::Text, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::BrightText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::ButtonText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::Base, QColor( 104, 103, 103, 255 ) );
p.setColor( QPalette::Window, QColor( 73, 72, 72, 255 ) );
p.setColor( QPalette::Shadow, QColor( 0, 0, 0, 255 ) );
p.setColor( QPalette::AlternateBase, QColor( 52, 51, 51, 255 ) );
p.setColor( QPalette::ToolTipBase, QColor( 255, 255, 220, 255 ) );
p.setColor( QPalette::ToolTipText, QColor( 0, 0, 0, 255 ) );
p.setColor( QPalette::WindowText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::WindowText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::WindowText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::WindowText, QColor( 255, 255, 255, 255 ) );
p.setColor( QPalette::Link, QColor( 177, 202, 0, 255 ) );
p.setColor( QPalette::LinkVisited, QColor( 177, 202, 0, 255 ) );
app.setPalette( p );
MainWindow w;
if ( argc > 1 )
ProjectManager::getInstance()->loadProject( argv[argc - 1] );
w.show();
return app.exec();
}
/*****************************************************************************
* vlmc.cpp: VLMC launcher for unix
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "config.h"
#include <QtDebug>
#include <sys/wait.h>
#include <unistd.h>
int VLMCmain( int , char** );
int main( int argc, char **argv )
{
#ifdef WITH_CRASHHANDLER
while ( true )
{
pid_t pid = fork();
if ( pid < 0 )
qFatal("Can't fork to launch VLMC. Exiting.");
if ( pid == 0 )
return VLMCmain( argc, argv );
else
{
int status;
wait( &status );
if ( WIFEXITED(status) )
{
int ret = WEXITSTATUS( status );
if ( ret == 2 )
continue ;
else
break ;
}
else
{
qCritical() << "Unhandled crash.";
break ;
}
}
}
#else
return VLMCmain( argc, argv );
#endif
}
/*****************************************************************************
* winvlmc.cpp: VLMC launcher for win32
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <windows.h>
int VLMCmain( int, char** );
LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
{
if(IsDebuggerPresent())
{
//If a debugger is present, pass the exception to the debugger with EXCEPTION_CONTINUE_SEARCH
return EXCEPTION_CONTINUE_SEARCH;
}
//TODO: get backtrace
//TODO: relaunch ?
return 0;
}
int main( int argc, char **argv )
{
return VLMCmain( argc, argv );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment