qt4.hpp 2.2 KB
Newer Older
Clément Stenac's avatar
Clément Stenac committed
1 2 3
/*****************************************************************************
 * qt4.hpp : QT4 interface
 ****************************************************************************
4 5
 * Copyright (C) 2006 the VideoLAN team
 * $Id$
Clément Stenac's avatar
Clément Stenac committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 *
 * Authors: Clément Stenac <zorglub@videolan.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. *****************************************************************************/

#ifndef _QVLC_H_
#define _QVLC_H_

#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <QEvent>

class QApplication;
31
class QMenu;
Clément Stenac's avatar
Clément Stenac committed
32 33
class MainInterface;
class DialogsProvider;
34
class VideoWidget;
35

Clément Stenac's avatar
Clément Stenac committed
36 37 38 39
struct intf_sys_t
{
    QApplication *p_app;
    MainInterface *p_mi;
40
    playlist_t *p_playlist;
Clément Stenac's avatar
Clément Stenac committed
41
    msg_subscription_t *p_sub; ///< Subscription to the message bank
42 43 44

    VideoWidget *p_video;
    int i_saved_height, i_saved_width;
45 46

    QMenu * p_popup_menu;
Clément Stenac's avatar
Clément Stenac committed
47 48
};

49
#define THEPL p_intf->p_sys->p_playlist
50
#define THEDP DialogsProvider::getInstance()
51
#define THEMIM MainInputManager::getInstance( NULL )
52

53
#define qfu( i ) QString::fromUtf8( i )
54
#define qtr( i ) QString::fromUtf8( _(i) )
Clément Stenac's avatar
Clément Stenac committed
55 56
#define qtu( i ) i.toUtf8().data()
#define qta( i ) i.toAscii().data()
57

Clément Stenac's avatar
Clément Stenac committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
static int DialogEvent_Type = QEvent::User + 1;

class DialogEvent : public QEvent
{
public:
    DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
                 QEvent( (QEvent::Type)(DialogEvent_Type) )
    {
        i_dialog = _i_dialog;
        i_arg = _i_arg;
        p_arg = _p_arg;
    };
    virtual ~DialogEvent() {};

    int i_arg, i_dialog;
    intf_dialog_args_t *p_arg;
};

#endif