qvlcapp.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * qvlcapp.hpp : A few helpers
00003  *****************************************************************************
00004  * Copyright (C) 2008 the VideoLAN team
00005  * $Id: bfd8a90599fad8ae6b9f11a7774deba4fb54c92e $
00006  *
00007  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 
00025 #ifndef _QVLC_APP_H_
00026 #define _QVLC_APP_H_
00027 
00028 #include <QApplication>
00029 #include <QEvent>
00030 
00031 #if defined(Q_WS_WIN)
00032 #   include <windows.h>
00033 #   include <vlc_common.h>
00034 #   include <vlc_interface.h>
00035 #   include "qt4.hpp"
00036 #   include "input_manager.hpp"
00037 #endif
00038 
00039 class QVLCApp : public QApplication
00040 {
00041     Q_OBJECT
00042 
00043 public:
00044     QVLCApp( int & argc, char ** argv ) : QApplication( argc, argv, true )
00045     {
00046         connect( this, SIGNAL(quitSignal()), this, SLOT(quit()) );
00047     }
00048 
00049     static void triggerQuit()
00050     {
00051          QVLCApp *app = qobject_cast<QVLCApp*>( instance() );
00052          if ( app )
00053              emit app->quitSignal();
00054     }
00055 
00056 #if defined (Q_WS_X11)
00057      QVLCApp( Display *dp, int & argc, char ** argv )
00058          : QApplication( dp, argc, argv )
00059      {
00060         connect( this, SIGNAL(quitSignal()), this, SLOT(quit()) );
00061      }
00062 #endif
00063 
00064 signals:
00065     void quitSignal();
00066 
00067 };
00068 
00069 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6