[vlmc-devel] commit: Adding forgotten files. (Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Sat Mar 20 16:29:34 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Fri Mar 19 00:40:47 2010 +0100| [572bed2ef54c9cd3f22695f2dcc79aed0771b626] | committer: Hugo Beauzee-Luyssen 

Adding forgotten files.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=572bed2ef54c9cd3f22695f2dcc79aed0771b626
---

 src/Main/guimain.cpp |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/Main/vlmc.cpp    |   65 ++++++++++++++++++++++++++++++++++
 src/Main/winvlmc.cpp |   42 ++++++++++++++++++++++
 3 files changed, 201 insertions(+), 0 deletions(-)

diff --git a/src/Main/guimain.cpp b/src/Main/guimain.cpp
new file mode 100644
index 0000000..78278b7
--- /dev/null
+++ b/src/Main/guimain.cpp
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * main.cpp: VLMC main
+ *****************************************************************************
+ * Copyright (C) 2008-2009 the VLMC team
+ *
+ * Authors: Ludovic Fauvet <etix at 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();
+}
diff --git a/src/Main/vlmc.cpp b/src/Main/vlmc.cpp
new file mode 100644
index 0000000..5130dc6
--- /dev/null
+++ b/src/Main/vlmc.cpp
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * vlmc.cpp: VLMC launcher for unix
+ *****************************************************************************
+ * Copyright (C) 2008-2010 VideoLAN
+ *
+ * Authors: Hugo Beauzee-Luyssen <hugo at 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
+}
diff --git a/src/Main/winvlmc.cpp b/src/Main/winvlmc.cpp
new file mode 100644
index 0000000..0af8aae
--- /dev/null
+++ b/src/Main/winvlmc.cpp
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * winvlmc.cpp: VLMC launcher for win32
+ *****************************************************************************
+ * Copyright (C) 2008-2010 VideoLAN
+ *
+ * Authors: Hugo Beauzee-Luyssen <hugo at 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 );
+}



More information about the Vlmc-devel mailing list