1 /*****************************************************************************
2 * qt4.hpp : QT4 interface
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
27 #include <vlc_interface.h>
28 #include <vlc_playlist.h>
34 class DialogsProvider;
41 playlist_t *p_playlist;
42 msg_subscription_t *p_sub; ///< Subscription to the message bank
45 int i_saved_height, i_saved_width;
50 #define THEPL p_intf->p_sys->p_playlist
51 #define QPL_LOCK vlc_mutex_lock( &THEPL->object_lock );
52 #define QPL_UNLOCK vlc_mutex_unlock( &THEPL->object_lock );
54 #define THEDP DialogsProvider::getInstance()
55 #define THEMIM MainInputManager::getInstance( NULL )
57 #define qfu( i ) QString::fromUtf8( i )
58 #define qtr( i ) QString::fromUtf8( _(i) )
59 #define qtu( i ) i.toUtf8().data()
60 #define qta( i ) i.toAscii().data()
62 #define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) )
63 #define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )
64 #define ON_TIMEOUT( act ) CONNECT( THEDP->fixed_timer, timeout(), this, act )
66 #define BUTTON_SET( button, text, tooltip ) \
67 button->setText( text ); \
68 button->setToolTip( tooltip );
70 #define BUTTON_SET_ACT( button, text, tooltip, thisslot ) \
71 BUTTON_SET( button, text, tooltip ); \
72 BUTTONACT( button, thisslot );
74 #define BUTTON_SET_IMG( button, text, image, tooltip ) \
75 BUTTON_SET( button, text, tooltip ); \
76 button->setIcon( QIcon( ":/pixmaps/"#image ) );
78 #define BUTTON_SET_ACT_I( button, text, image, tooltip, thisslot ) \
79 BUTTON_SET_IMG( button, text, image, tooltip ); \
80 BUTTONACT( button, thisslot );
82 static int DialogEvent_Type = QEvent::User + 1;
83 static int PLUndockEvent_Type = QEvent::User + 2;
84 static int PLDockEvent_Type = QEvent::User + 3;
86 class DialogEvent : public QEvent
89 DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
90 QEvent( (QEvent::Type)(DialogEvent_Type) )
96 virtual ~DialogEvent() {};
99 intf_dialog_args_t *p_arg;
102 /* Ugly to put it here, but don't want more files ... */
104 class BasePlaylistWidget : public QFrame
107 BasePlaylistWidget( intf_thread_t *_p_i ) : p_intf( _p_i) {};
108 virtual ~BasePlaylistWidget() {};
110 intf_thread_t *p_intf;