@ -23,10 +23,10 @@
# include <algorithm>
# include <config.h>
# include < qpopupmenu.h>
# include < qtimer.h>
# include < qpushbutton.h>
# include < qslider.h>
# include < t qpopupmenu.h>
# include < t qtimer.h>
# include < t qpushbutton.h>
# include < t qslider.h>
class KXMLGUIClient ; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient
# include <klibloader.h>
@ -72,17 +72,17 @@ KDE_NO_CDTOR_EXPORT KMPlayerPartStatic::~KMPlayerPartStatic () {
struct KMPLAYER_NO_EXPORT GroupPredicate {
const KMPlayerPart * m_part ;
const QString & m_group ;
const T QString & m_group ;
bool m_get_any ;
GroupPredicate ( const KMPlayerPart * part , const QString & group , bool b = false )
GroupPredicate ( const KMPlayerPart * part , const T QString & group , bool b = false )
: m_part ( part ) , m_group ( group ) , m_get_any ( b ) { }
bool operator ( ) ( const KMPlayerPart * part ) const {
return ( ( m_get_any & & part ! = m_part & &
! part - > master ( ) & & ! part - > url ( ) . isEmpty ( ) ) | |
( m_part - > allowRedir ( part - > m_docbase ) & &
( part - > m_group = = m_group | |
part - > m_group = = QString: : fromLatin1( " _master " ) | |
m_group = = QString: : fromLatin1( " _master " ) ) & &
part - > m_group = = T QString: : tq fromLatin1( " _master " ) | |
m_group = = T QString: : tq fromLatin1( " _master " ) ) & &
( part - > m_features & KMPlayerPart : : Feat_Viewer ) ! =
( m_part - > m_features & KMPlayerPart : : Feat_Viewer ) ) ) ;
}
@ -97,9 +97,9 @@ public:
KMPlayerFactory ( ) ;
virtual ~ KMPlayerFactory ( ) ;
virtual KParts : : Part * createPartObject
( QWidget * w parent, const char * wname ,
QObject * parent, const char * name ,
const char * className , const QStringList & args ) ;
( T QWidget * w tq parent, const char * wname ,
T QObject * tq parent, const char * name ,
const char * className , const T QStringList & args ) ;
static KInstance * instance ( ) { return s_instance ; }
private :
static KInstance * s_instance ;
@ -118,27 +118,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerFactory::~KMPlayerFactory () {
}
KDE_NO_EXPORT KParts : : Part * KMPlayerFactory : : createPartObject
( QWidget * w parent, const char * wname ,
QObject * parent, const char * name ,
const char * cls , const QStringList & args ) {
( T QWidget * w tq parent, const char * wname ,
T QObject * tq parent, const char * name ,
const char * cls , const T QStringList & args ) {
kdDebug ( ) < < " KMPlayerFactory::createPartObject " < < cls < < endl ;
return new KMPlayerPart ( w parent, wname , parent, name , args ) ;
return new KMPlayerPart ( w tq parent, wname , tq parent, name , args ) ;
}
//-----------------------------------------------------------------------------
static bool getBoolValue ( const QString & value ) {
return ( value . lower ( ) ! = QString: : fromLatin1( " false " ) & &
value . lower ( ) ! = QString: : fromLatin1( " off " ) & &
value . lower ( ) ! = QString: : fromLatin1( " 0 " ) ) ;
static bool getBoolValue ( const T QString & value ) {
return ( value . lower ( ) ! = T QString: : tq fromLatin1( " false " ) & &
value . lower ( ) ! = T QString: : tq fromLatin1( " off " ) & &
value . lower ( ) ! = T QString: : tq fromLatin1( " 0 " ) ) ;
}
# define SET_FEAT_ON(f) { m_features |= f; turned_off_features &= ~f; }
# define SET_FEAT_OFF(f) { m_features &= ~f; turned_off_features |= f; }
KDE_NO_CDTOR_EXPORT KMPlayerPart : : KMPlayerPart ( QWidget * w parent, const char * wname ,
QObject * parent, const char * name , const QStringList & args )
: PartBase ( w parent, wname , parent, name , new KConfig ( " kmplayerrc " ) ) ,
KDE_NO_CDTOR_EXPORT KMPlayerPart : : KMPlayerPart ( T QWidget * w tq parent, const char * wname ,
T QObject * tq parent, const char * name , const T QStringList & args )
: PartBase ( w tq parent, wname , tq parent, name , new KConfig ( " kmplayerrc " ) ) ,
m_master ( 0L ) ,
m_browserextension ( new KMPlayerBrowserExtension ( this ) ) ,
m_liveconnectextension ( new KMPlayerLiveConnectExtension ( this ) ) ,
@ -154,27 +154,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_sources [ " hrefsource " ] = ( new KMPlayerHRefSource ( this ) ) ;
# ifdef HAVE_NSPR
KMPlayer : : NpPlayer * npp = ( KMPlayer : : NpPlayer * ) players ( ) [ " npp " ] ;
connect ( npp , SIGNAL ( evaluate ( const QString & , QString & ) ) ,
m_liveconnectextension , SLOT ( evaluate ( const QString & , QString & ) ) ) ;
connect ( npp , SIGNAL ( openUrl ( const KURL & , const QString & ) ) ,
connect ( npp , TQT_ SIGNAL ( evaluate ( const T QString & , T QString & ) ) ,
m_liveconnectextension , TQT_ SLOT ( evaluate ( const T QString & , T QString & ) ) ) ;
connect ( npp , TQT_ SIGNAL ( openUrl ( const KURL & , const T QString & ) ) ,
m_browserextension ,
SLOT ( slotRequestOpenURL ( const KURL & , const QString & ) ) ) ;
TQT_ SLOT ( slotRequestOpenURL ( const KURL & , const T QString & ) ) ) ;
# endif
/*KAction *playact =*/ new KAction ( i18n ( " P&lay " ) , QString ( " player_play " ) , KShortcut ( ) , this , SLOT( play ( ) ) , actionCollection ( ) , " play " ) ;
/*KAction *pauseact =*/ new KAction ( i18n ( " &Pause " ) , QString ( " player_pause " ) , KShortcut ( ) , this , SLOT( pause ( ) ) , actionCollection ( ) , " pause " ) ;
/*KAction *stopact =*/ new KAction ( i18n ( " &Stop " ) , QString ( " player_stop " ) , KShortcut ( ) , this , SLOT( stop ( ) ) , actionCollection ( ) , " stop " ) ;
new KAction ( i18n ( " Increase Volume " ) , QString ( " player_volume " ) , KShortcut ( ) , this , SLOT ( increaseVolume ( ) ) , actionCollection ( ) , " edit_volume_up " ) ;
new KAction ( i18n ( " Decrease Volume " ) , QString ( " player_volume " ) , KShortcut ( ) , this , SLOT ( decreaseVolume ( ) ) , actionCollection ( ) , " edit_volume_down " ) ;
/*KAction *playact =*/ new KAction ( i18n ( " P&lay " ) , T QString ( " player_play " ) , KShortcut ( ) , this , TQT_ SLOT( play ( ) ) , actionCollection ( ) , " play " ) ;
/*KAction *pauseact =*/ new KAction ( i18n ( " &Pause " ) , T QString ( " player_pause " ) , KShortcut ( ) , this , TQT_ SLOT( pause ( ) ) , actionCollection ( ) , " pause " ) ;
/*KAction *stopact =*/ new KAction ( i18n ( " &Stop " ) , T QString ( " player_stop " ) , KShortcut ( ) , this , TQT_ SLOT( stop ( ) ) , actionCollection ( ) , " stop " ) ;
new KAction ( i18n ( " Increase Volume " ) , T QString ( " player_volume " ) , KShortcut ( ) , this , TQT_ SLOT ( increaseVolume ( ) ) , actionCollection ( ) , " edit_volume_up " ) ;
new KAction ( i18n ( " Decrease Volume " ) , T QString ( " player_volume " ) , KShortcut ( ) , this , TQT_ SLOT ( decreaseVolume ( ) ) , actionCollection ( ) , " edit_volume_down " ) ;
Source * urlsource = m_sources [ " urlsource " ] ;
KMPlayer : : ControlPanel * panel = m_view - > controlPanel ( ) ;
QStringList: : const_iterator it = args . begin ( ) ;
QStringList: : const_iterator end = args . end ( ) ;
T QStringList: : const_iterator it = args . begin ( ) ;
T QStringList: : const_iterator end = args . end ( ) ;
int turned_off_features = 0 ;
for ( ; it ! = end ; + + it ) {
int equalPos = ( * it ) . find( " = " ) ;
int equalPos = ( * it ) . tq find( " = " ) ;
if ( equalPos > 0 ) {
QString name = ( * it ) . left ( equalPos ) . lower ( ) ;
QString value = ( * it ) . right ( ( * it ) . length ( ) - equalPos - 1 ) ;
T QString name = ( * it ) . left ( equalPos ) . lower ( ) ;
T QString value = ( * it ) . right ( ( * it ) . length ( ) - equalPos - 1 ) ;
if ( value . at ( 0 ) = = ' \" ' )
value = value . right ( value . length ( ) - 1 ) ;
if ( value . at ( value . length ( ) - 1 ) = = ' \" ' )
@ -184,121 +184,121 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
urlsource - > setURL ( KURL ( value ) ) ;
urlsource - > setIdentified ( false ) ;
m_havehref = true ;
} else if ( name = = QString: : fromLatin1( " width " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " width " ) ) {
m_noresize = true ;
} else if ( name = = QString: : fromLatin1( " height " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " height " ) ) {
m_noresize = true ;
} else if ( name = = QString: : fromLatin1( " type " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " type " ) ) {
urlsource - > document ( ) - > mrl ( ) - > mimetype = value ;
} else if ( name = = QString: : fromLatin1( " controls " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " controls " ) ) {
//http://service.real.com/help/library/guides/production8/realpgd.htm?src=noref,rnhmpg_080301,rnhmtn,nosrc
//http://service.real.com/help/library/guides/production8/htmfiles/control.htm
QStringList sl = QStringList: : split ( QChar ( ' , ' ) , value ) ;
QStringList: : const_iterator it = sl . begin ( ) ;
const QStringList: : const_iterator e = sl . end ( ) ;
for ( QStringList: : const_iterator i = sl . begin ( ) ; i ! = e ; + + i ) {
QString val_lower ( ( * i ) . lower ( ) ) ;
if ( val_lower = = QString: : fromLatin1( " imagewindow " ) ) {
T QStringList sl = T QStringList: : split ( T QChar ( ' , ' ) , value ) ;
T QStringList: : const_iterator it = sl . begin ( ) ;
const T QStringList: : const_iterator e = sl . end ( ) ;
for ( T QStringList: : const_iterator i = sl . begin ( ) ; i ! = e ; + + i ) {
T QString val_lower ( ( * i ) . lower ( ) ) ;
if ( val_lower = = T QString: : tq fromLatin1( " imagewindow " ) ) {
SET_FEAT_ON ( Feat_ImageWindow | Feat_Viewer )
} else if ( val_lower = = QString: : fromLatin1( " all " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " all " ) ) {
m_features = ( Feat_Controls | Feat_StatusBar ) ;
} else if ( val_lower = = QString: : fromLatin1( " tacctrl " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " tacctrl " ) ) {
SET_FEAT_ON ( Feat_Label )
} else if ( val_lower = = QString: : fromLatin1( " controlpanel " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " controlpanel " ) ) {
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " infovolumepanel " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " infovolumepanel " ) ) {
SET_FEAT_ON ( Feat_Controls ) // TODO
} else if ( val_lower = = QString: : fromLatin1( " positionfield " ) | |
val_lower = = QString: : fromLatin1( " positionslider " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " positionfield " ) | |
val_lower = = T QString: : tq fromLatin1( " positionslider " ) ) {
setAutoControls ( false ) ;
panel - > positionSlider ( ) - > show ( ) ;
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " homectrl " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " homectrl " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_config ) - > show ( ) ;
} else if ( val_lower = = QString: : fromLatin1( " mutectrl " ) | |
val_lower = = QString: : fromLatin1( " mutevolume " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " mutectrl " ) | |
val_lower = = T QString: : tq fromLatin1( " mutevolume " ) ) {
setAutoControls ( false ) ;
panel - > volumeBar ( ) - > setMinimumSize ( QSize ( 20 , panel - > volumeBar ( ) - > minimumSize ( ) . height ( ) ) ) ;
panel - > volumeBar ( ) - > setMinimumSize ( T QSize ( 20 , panel - > volumeBar ( ) - > tq minimumSize ( ) . height ( ) ) ) ;
panel - > volumeBar ( ) - > show ( ) ;
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " rwctrl " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " rwctrl " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_back ) - > show ( ) ; // rewind ?
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " ffctrl " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " ffctrl " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_forward ) - > show ( ) ;
m_features = Feat_Controls ;
} else if ( val_lower = = QString: : fromLatin1( " stopbutton " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " stopbutton " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_stop ) - > show ( ) ;
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " playbutton " ) | |
val_lower = = QString: : fromLatin1( " playonlybutton " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " playbutton " ) | |
val_lower = = T QString: : tq fromLatin1( " playonlybutton " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_play ) - > show ( ) ;
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " pausebutton " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " pausebutton " ) ) {
setAutoControls ( false ) ;
panel - > button ( KMPlayer : : ControlPanel : : button_pause ) - > show ( ) ;
SET_FEAT_ON ( Feat_Controls )
} else if ( val_lower = = QString: : fromLatin1( " statusbar " ) | |
val_lower = = QString: : fromLatin1( " statusfield " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " statusbar " ) | |
val_lower = = T QString: : tq fromLatin1( " statusfield " ) ) {
SET_FEAT_ON ( Feat_StatusBar )
} else if ( val_lower = = QString: : fromLatin1( " infopanel " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " infopanel " ) ) {
SET_FEAT_ON ( Feat_InfoPanel )
} else if ( val_lower = = QString: : fromLatin1( " playlist " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " playlist " ) ) {
SET_FEAT_ON ( Feat_PlayList )
} else if ( val_lower = = QString: : fromLatin1( " volumeslider " ) ) {
} else if ( val_lower = = T QString: : tq fromLatin1( " volumeslider " ) ) {
SET_FEAT_ON ( Feat_VolumeSlider )
setAutoControls ( false ) ;
panel - > volumeBar ( ) - > show ( ) ;
panel - > volumeBar ( ) - > setMinimumSize ( QSize ( 20 , panel - > volumeBar ( ) - > minimumSize ( ) . height ( ) ) ) ;
panel - > volumeBar ( ) - > setMinimumSize ( T QSize ( 20 , panel - > volumeBar ( ) - > tq minimumSize ( ) . height ( ) ) ) ;
}
}
} else if ( name = = QString: : fromLatin1( " uimode " ) ) {
QString val_lower ( value . lower ( ) ) ;
if ( val_lower = = QString: : fromLatin1( " full " ) )
} else if ( name = = T QString: : tq fromLatin1( " uimode " ) ) {
T QString val_lower ( value . lower ( ) ) ;
if ( val_lower = = T QString: : tq fromLatin1( " full " ) )
SET_FEAT_ON ( Feat_All & ~ ( Feat_PlayList | Feat_ImageWindow ) )
// TODO: invisible, none, mini
} else if ( name = = QString: : fromLatin1( " nolabels " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " nolabels " ) ) {
SET_FEAT_OFF ( Feat_Label )
} else if ( name = = QString: : fromLatin1( " nocontrols " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " nocontrols " ) ) {
SET_FEAT_OFF ( Feat_Controls | Feat_VolumeSlider )
} else if ( name = = QString: : fromLatin1( " showdisplay " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " showdisplay " ) ) {
// the author name, the clip name, and the copyright information
if ( getBoolValue ( value ) )
SET_FEAT_ON ( Feat_InfoPanel )
else
SET_FEAT_OFF ( Feat_InfoPanel )
} else if ( name = = QString: : fromLatin1( " showcontrols " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " showcontrols " ) ) {
if ( getBoolValue ( value ) )
SET_FEAT_ON ( Feat_Viewer | Feat_Controls )
else
SET_FEAT_OFF ( Feat_Controls | Feat_VolumeSlider )
} else if ( name = = QString: : fromLatin1( " showstatusbar " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " showstatusbar " ) ) {
if ( getBoolValue ( value ) )
SET_FEAT_ON ( Feat_Viewer | Feat_StatusBar )
else
SET_FEAT_OFF ( Feat_StatusBar )
// else showcaptioning/showgotobar/showpositioncontrols/showtracker
} else if ( name = = QString: : fromLatin1( " console " ) ) {
m_group = value . isEmpty ( ) ? QString: : fromLatin1( " _anonymous " ) : value ;
} else if ( name = = QString: : fromLatin1( " __khtml__pluginbaseurl " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " console " ) ) {
m_group = value . isEmpty ( ) ? T QString: : tq fromLatin1( " _anonymous " ) : value ;
} else if ( name = = T QString: : tq fromLatin1( " __khtml__pluginbaseurl " ) ) {
m_docbase = KURL ( value ) ;
} else if ( name = = QString: : fromLatin1( " src " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " src " ) ) {
m_src_url = value ;
} else if ( name = = QString: : fromLatin1( " filename " ) ) {
} else if ( name = = T QString: : tq fromLatin1( " filename " ) ) {
m_file_name = value ;
} else if ( name = = QString: : fromLatin1 ( " fullscreenmode " ) ) {
} else if ( name = = T QString: : tq fromLatin1 ( " fullscreenmode " ) ) {
show_fullscreen = getBoolValue ( value ) ;
} else if ( name = = QString: : fromLatin1 ( " autostart " ) ) {
} else if ( name = = T QString: : tq fromLatin1 ( " autostart " ) ) {
urlsource - > setAutoPlay ( getBoolValue ( value ) ) ;
}
// volume/clicktoplay/transparentatstart/animationatstart
// autorewind/displaysize/border
if ( name . startsWith ( QString: : fromLatin1 ( " __khtml__ " ) ) )
if ( name . startsWith ( T QString: : tq fromLatin1 ( " __khtml__ " ) ) )
name = name . mid ( 9 ) ;
convertNode < KMPlayer : : Element > ( urlsource - > document ( ) ) - > setAttribute ( name , value ) ;
}
@ -311,11 +311,11 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
//KParts::Part::setWidget (m_view);
setXMLFile ( " kmplayerpartui.rc " ) ;
panel - > zoomMenu ( ) - > connectItem ( KMPlayer : : ControlPanel : : menu_zoom50 ,
this , SLOT ( setMenuZoom ( int ) ) ) ;
this , TQT_ SLOT ( setMenuZoom ( int ) ) ) ;
panel - > zoomMenu ( ) - > connectItem ( KMPlayer : : ControlPanel : : menu_zoom100 ,
this , SLOT ( setMenuZoom ( int ) ) ) ;
this , TQT_ SLOT ( setMenuZoom ( int ) ) ) ;
panel - > zoomMenu ( ) - > connectItem ( KMPlayer : : ControlPanel : : menu_zoom150 ,
this , SLOT ( setMenuZoom ( int ) ) ) ;
this , TQT_ SLOT ( setMenuZoom ( int ) ) ) ;
m_view - > setNoInfoMessages ( m_features ! = Feat_InfoPanel ) ;
if ( m_features = = Feat_InfoPanel )
@ -332,7 +332,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
else
m_view - > setControlPanelMode ( KMPlayer : : View : : CP_AutoHide ) ;
}
bool group_member = ! m_group . isEmpty ( ) & & m_group ! = QString: : fromLatin1( " _unique " ) & & m_features ! = Feat_Unknown ;
bool group_member = ! m_group . isEmpty ( ) & & m_group ! = T QString: : tq fromLatin1( " _unique " ) & & m_features ! = Feat_Unknown ;
if ( ! group_member | | m_features & Feat_Viewer ) {
// not part of a group or we're the viewer
setProcess ( " mplayer " ) ;
@ -340,9 +340,9 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
connectPanel ( m_view - > controlPanel ( ) ) ;
if ( m_features & Feat_StatusBar ) {
last_time_left = 0 ;
connect ( this , SIGNAL ( positioned ( int , int ) ) ,
this , SLOT ( statusPosition ( int , int ) ) ) ;
m_view - > statusBar ( ) - > insertItem ( QString ( " --:-- " ) , 1 , 0 , true ) ;
connect ( this , TQT_ SIGNAL ( positioned ( int , int ) ) ,
this , TQT_ SLOT ( statusPosition ( int , int ) ) ) ;
m_view - > statusBar ( ) - > insertItem ( T QString ( " --:-- " ) , 1 , 0 , true ) ;
}
}
if ( group_member ) {
@ -362,7 +362,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_group . truncate ( 0 ) ;
kmplayerpart_static - > partlist . push_back ( this ) ;
QWidget * pwidget = view ( ) - > parentWidget ( ) ;
T QWidget * pwidget = view ( ) - > tq parentWidget ( ) ;
if ( pwidget ) {
m_view - > viewArea ( ) - > setPaletteBackgroundColor ( pwidget - > paletteBackgroundColor ( ) ) ;
m_view - > viewer ( ) - > setBackgroundColor ( pwidget - > paletteBackgroundColor ( ) ) ;
@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerPart::setAutoControls (bool b) {
m_view - > controlPanel ( ) - > setAutoControls ( b ) ;
}
KDE_NO_EXPORT void KMPlayerPart : : viewerPartDestroyed ( QObject * o ) {
KDE_NO_EXPORT void KMPlayerPart : : viewerPartDestroyed ( T QObject * o ) {
if ( o = = m_master )
m_master = 0L ;
kdDebug ( ) < < " KMPlayerPart( " < < this < < " )::viewerPartDestroyed " < < endl ;
@ -434,16 +434,16 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
url = KURL ( m_docbase , m_file_name ) ; // fix misdetected SRC attr
else if ( _url ! = m_docbase ) {
url = _url ;
if ( ! m_file_name . isEmpty ( ) & & _url . url ( ) . find ( m_file_name ) < 0 ) {
if ( ! m_file_name . isEmpty ( ) & & _url . url ( ) . tq find ( m_file_name ) < 0 ) {
KURL u ( m_file_name ) ;
if ( ( u . protocol ( ) = = QString ( " mms " ) ) | |
if ( ( u . protocol ( ) = = T QString ( " mms " ) ) | |
_url . protocol ( ) . isEmpty ( ) ) {
// see if we somehow have to merge these
int p = _url . port ( ) ;
if ( p > 0 )
u . setPort ( p ) ;
if ( u . path ( ) . isEmpty ( ) )
u . setPath ( QChar ( ' / ' ) + _url . host ( ) ) ;
u . setPath ( T QChar ( ' / ' ) + _url . host ( ) ) ;
if ( allowRedir ( u ) ) {
url = u ;
kdDebug ( ) < < " KMPlayerPart::openURL compose " < < m_file_name < < " " < < _url . url ( ) < < " -> " < < u . url ( ) < < endl ;
@ -469,7 +469,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
if ( url . isEmpty ( ) ) {
if ( ! m_master & & ! ( m_features & Feat_Viewer ) )
// no master set, wait for a viewer to attach or timeout
QTimer: : singleShot ( 50 , this , SLOT ( waitForImageWindowTimeOut ( ) ) ) ;
T QTimer: : singleShot ( 50 , this , TQT_ SLOT ( waitForImageWindowTimeOut ( ) ) ) ;
return true ;
}
if ( ! m_group . isEmpty ( ) & & ! ( m_features & Feat_Viewer ) ) {
@ -479,7 +479,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
i = std : : find_if ( + + i , e , pred ) )
if ( ( * i ) - > url ( ) . isEmpty ( ) ) // image window created w/o url
return ( * i ) - > openURL ( _url ) ;
QTimer: : singleShot ( 50 , this , SLOT ( waitForImageWindowTimeOut ( ) ) ) ;
T QTimer: : singleShot ( 50 , this , TQT_ SLOT ( waitForImageWindowTimeOut ( ) ) ) ;
//kdError () << "Not the ImageWindow and no ImageWindow found" << endl;
return true ;
}
@ -549,17 +549,17 @@ KDE_NO_EXPORT void KMPlayerPart::connectToPart (KMPlayerPart * m) {
if ( m_features & Feat_InfoPanel )
m - > connectInfoPanel ( m_view - > infoPanel ( ) ) ;
connectSource ( m_source , m - > source ( ) ) ;
connect ( m , SIGNAL ( destroyed ( QObject * ) ) ,
this , SLOT ( viewerPartDestroyed ( QObject * ) ) ) ;
connect ( m , SIGNAL ( processChanged ( const char * ) ) ,
this , SLOT ( viewerPartProcessChanged ( const char * ) ) ) ;
connect ( m , SIGNAL ( sourceChanged ( KMPlayer : : Source * , KMPlayer : : Source * ) ) ,
this , SLOT ( viewerPartSourceChanged ( KMPlayer : : Source * , KMPlayer : : Source * ) ) ) ;
connect ( m , TQT_ SIGNAL ( destroyed ( T QObject * ) ) ,
this , TQT_ SLOT ( viewerPartDestroyed ( T QObject * ) ) ) ;
connect ( m , TQT_ SIGNAL ( processChanged ( const char * ) ) ,
this , TQT_ SLOT ( viewerPartProcessChanged ( const char * ) ) ) ;
connect ( m , TQT_ SIGNAL ( sourceChanged ( KMPlayer : : Source * , KMPlayer : : Source * ) ) ,
this , TQT_ SLOT ( viewerPartSourceChanged ( KMPlayer : : Source * , KMPlayer : : Source * ) ) ) ;
if ( m_features & Feat_StatusBar ) {
last_time_left = 0 ;
connect ( m , SIGNAL ( positioned ( int , int ) ) ,
this , SLOT ( statusPosition ( int , int ) ) ) ;
m_view - > statusBar ( ) - > insertItem ( QString ( " --:-- " ) , 1 , 0 , true ) ;
connect ( m , TQT_ SIGNAL ( positioned ( int , int ) ) ,
this , TQT_ SLOT ( statusPosition ( int , int ) ) ) ;
m_view - > statusBar ( ) - > insertItem ( T QString ( " --:-- " ) , 1 , 0 , true ) ;
}
}
@ -568,7 +568,7 @@ KDE_NO_EXPORT void KMPlayerPart::setLoaded (int percentage) {
if ( percentage < 100 ) {
m_browserextension - > setLoadingProgress ( percentage ) ;
m_browserextension - > infoMessage
( QString: : number ( percentage ) + i18n ( " % Cache fill " ) ) ;
( T QString: : number ( percentage ) + i18n ( " % Cache fill " ) ) ;
}
}
@ -631,7 +631,7 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
int left = ( length - pos ) / 10 ;
if ( left ! = last_time_left ) {
last_time_left = left ;
QString text ( " --:-- " ) ;
T QString text ( " --:-- " ) ;
if ( left > 0 ) {
int h = left / 3600 ;
int m = ( left % 3600 ) / 60 ;
@ -647,11 +647,11 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
//---------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension : : KMPlayerBrowserExtension ( KMPlayerPart * parent)
: KParts : : BrowserExtension ( parent, " KMPlayer Browser Extension " ) {
KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension : : KMPlayerBrowserExtension ( KMPlayerPart * tq parent)
: KParts : : BrowserExtension ( tq parent, " KMPlayer Browser Extension " ) {
}
KDE_NO_EXPORT void KMPlayerBrowserExtension : : urlChanged ( const QString & url ) {
KDE_NO_EXPORT void KMPlayerBrowserExtension : : urlChanged ( const T QString & url ) {
emit setLocationBarURL ( url ) ;
}
@ -659,25 +659,25 @@ KDE_NO_EXPORT void KMPlayerBrowserExtension::setLoadingProgress (int percentage)
emit loadingProgress ( percentage ) ;
}
KDE_NO_EXPORT void KMPlayerBrowserExtension : : saveState ( QDataStream & stream ) {
stream < < static_cast < PartBase * > ( parent ( ) ) - > url ( ) . url ( ) ;
KDE_NO_EXPORT void KMPlayerBrowserExtension : : saveState ( T QDataStream & stream ) {
stream < < static_cast < PartBase * > ( tq parent ( ) ) - > url ( ) . url ( ) ;
}
KDE_NO_EXPORT void KMPlayerBrowserExtension : : restoreState ( QDataStream & stream ) {
QString url ;
KDE_NO_EXPORT void KMPlayerBrowserExtension : : restoreState ( T QDataStream & stream ) {
T QString url ;
stream > > url ;
static_cast < PartBase * > ( parent ( ) ) - > openURL ( KURL ( url ) ) ;
static_cast < PartBase * > ( tq parent ( ) ) - > openURL ( KURL ( url ) ) ;
}
KDE_NO_EXPORT void KMPlayerBrowserExtension : : requestOpenURL ( const KURL & url , const QString & target , const QString & service ) {
KDE_NO_EXPORT void KMPlayerBrowserExtension : : requestOpenURL ( const KURL & url , const T QString & target , const T QString & service ) {
KParts : : URLArgs args ;
args . frameName = target ;
args . serviceType = service ;
emit openURLRequest ( url , args ) ;
}
KDE_NO_EXPORT void KMPlayerBrowserExtension : : slotRequestOpenURL ( const KURL & url , const QString & target ) {
requestOpenURL ( url , target , QString ( ) ) ;
KDE_NO_EXPORT void KMPlayerBrowserExtension : : slotRequestOpenURL ( const KURL & url , const T QString & target ) {
requestOpenURL ( url , target , T QString ( ) ) ;
}
//---------------------------------------------------------------------
@ -746,14 +746,14 @@ static const JSCommandEntry JSCommandList [] = {
{ " GetEntryCopyright " , notsupported , " (c) " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetEntryTitle " , notsupported , " title " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetFullScreen " , isfullscreen , 0L , KParts : : LiveConnectExtension : : TypeBool } ,
{ " GetImage Status" , notsupported , " false " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " GetImage tq Status" , notsupported , " false " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " GetLastErrorMoreInfoURL " , notsupported , " no error " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetLastErrorRMACode " , notsupported , " 0 " , KParts : : LiveConnectExtension : : TypeNumber } ,
{ " GetLastErrorSeverity " , notsupported , " 6 " , KParts : : LiveConnectExtension : : TypeNumber } ,
{ " GetLastErrorUserCode " , notsupported , " 0 " , KParts : : LiveConnectExtension : : TypeNumber } ,
{ " GetLastErrorUserString " , notsupported , " no error " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetLastMessage " , notsupported , " no error " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetLast Status" , notsupported , " no error " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetLast tq Status" , notsupported , " no error " , KParts : : LiveConnectExtension : : TypeString } ,
{ " GetLength " , length , 0L , KParts : : LiveConnectExtension : : TypeNumber } ,
{ " GetLiveState " , notsupported , " false " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " GetLoop " , isloop , 0L , KParts : : LiveConnectExtension : : TypeBool } ,
@ -802,7 +802,7 @@ static const JSCommandEntry JSCommandList [] = {
{ " SetDoubleSize " , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetFileName " , setsource , 0L , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetFullScreen " , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetImage Status" , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetImage tq Status" , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetLoop " , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetMaintainAspect " , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
{ " SetMute " , notsupported , " true " , KParts : : LiveConnectExtension : : TypeBool } ,
@ -847,13 +847,13 @@ static const JSCommandEntry * getJSCommandEntry (const char * name, int start =
return & JSCommandList [ mid ] ;
}
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension : : KMPlayerLiveConnectExtension ( KMPlayerPart * parent)
: KParts : : LiveConnectExtension ( parent) , player ( parent) ,
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension : : KMPlayerLiveConnectExtension ( KMPlayerPart * tq parent)
: KParts : : LiveConnectExtension ( tq parent) , player ( tq parent) ,
lastJSCommandEntry ( 0L ) ,
m_started ( false ) ,
m_enablefinish ( false ) ,
m_evaluating ( false ) {
connect ( parent, SIGNAL ( started ( KIO : : Job * ) ) , this , SLOT ( started ( ) ) ) ;
connect ( tq parent, TQT_ SIGNAL ( started ( KIO : : Job * ) ) , this , TQT_ SLOT ( started ( ) ) ) ;
}
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension : : ~ KMPlayerLiveConnectExtension ( ) {
@ -867,7 +867,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::started () {
KDE_NO_EXPORT void KMPlayerLiveConnectExtension : : finished ( ) {
if ( m_started & & m_enablefinish ) {
KParts : : LiveConnectExtension : : ArgList args ;
args . push_back ( qMakePair ( KParts : : LiveConnectExtension : : TypeString , QString( " if (window.onFinished) onFinished(); " ) ) ) ;
args . push_back ( qMakePair ( KParts : : LiveConnectExtension : : TypeString , T QString( " if (window.onFinished) onFinished(); " ) ) ) ;
emit partEvent ( 0 , " eval " , args ) ;
m_started = true ;
m_enablefinish = false ;
@ -875,14 +875,14 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () {
}
KDE_NO_EXPORT void KMPlayerLiveConnectExtension : : evaluate (
const QString & scr , QString & result ) {
QString script ( scr ) ;
const T QString & scr , T QString & result ) {
T QString script ( scr ) ;
KParts : : LiveConnectExtension : : ArgList args ;
script = script . replace ( ' \\ ' , " \\ \\ " ) ;
script = script . replace ( ' \n ' , " \\ n " ) ;
script = script . replace ( ' \r ' , " " ) ;
script = script . replace ( ' " ' , " \\ \" " ) ;
script = QString ( " this.__kmplayer__res=eval( \" %1 \" ) " ) . arg ( script ) ;
script = script . tq replace ( ' \\ ' , " \\ \\ " ) ;
script = script . tq replace ( ' \n ' , " \\ n " ) ;
script = script . tq replace ( ' \r ' , " " ) ;
script = script . tq replace ( ' " ' , " \\ \" " ) ;
script = T QString ( " this.__kmplayer__res=eval( \" %1 \" ) " ) . arg ( script ) ;
args . push_back ( qMakePair ( KParts : : LiveConnectExtension : : TypeString , script ) ) ;
script_result = " undefined " ;
@ -893,9 +893,9 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate (
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension : : get
( const unsigned long id , const QString & name ,
( const unsigned long id , const T QString & name ,
KParts : : LiveConnectExtension : : Type & type ,
unsigned long & rid , QString & rval )
unsigned long & rid , T QString & rval )
{
if ( name . startsWith ( " __kmplayer__obj_ " ) ) {
if ( m_evaluating )
@ -919,11 +919,11 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
break ;
case prop_volume :
if ( player - > view ( ) )
rval = QString: : number ( player - > process ( ) - > viewer ( ) - > view ( ) - > controlPanel ( ) - > volumeBar ( ) - > value ( ) ) ;
rval = T QString: : number ( player - > process ( ) - > viewer ( ) - > view ( ) - > controlPanel ( ) - > volumeBar ( ) - > value ( ) ) ;
break ;
case prop_error :
type = KParts : : LiveConnectExtension : : TypeNumber ;
rval = QString: : number ( 0 ) ;
rval = T QString: : number ( 0 ) ;
break ;
default :
lastJSCommandEntry = entry ;
@ -933,7 +933,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension : : put
( const unsigned long , const QString & name , const QString & val ) {
( const unsigned long , const T QString & name , const T QString & val ) {
if ( name = = " __kmplayer__res " ) {
script_result = val ;
return true ;
@ -964,9 +964,9 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension : : call
( const unsigned long id , const QString & name ,
const QStringList & args , KParts : : LiveConnectExtension : : Type & type ,
unsigned long & rid , QString & rval ) {
( const unsigned long id , const T QString & name ,
const T QStringList & args , KParts : : LiveConnectExtension : : Type & type ,
unsigned long & rid , T QString & rval ) {
const JSCommandEntry * entry = lastJSCommandEntry ;
const char * str = name . ascii ( ) ;
if ( ! entry | | strcmp ( entry - > name , str ) )
@ -1017,8 +1017,8 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break ;
case showcontrolpanel :
if ( args . size ( ) & &
( args . first ( ) = = QString: : fromLatin1 ( " 0 " ) | |
args . first ( ) = = QString: : fromLatin1 ( " false " ) ) )
( args . first ( ) = = T QString: : tq fromLatin1 ( " 0 " ) | |
args . first ( ) = = T QString: : tq fromLatin1 ( " false " ) ) )
static_cast < KMPlayer : : View * > ( player - > view ( ) ) - > setControlPanelMode ( KMPlayer : : View : : CP_Hide ) ;
else
static_cast < KMPlayer : : View * > ( player - > view ( ) ) - > setControlPanelMode ( KMPlayer : : View : : CP_Show ) ;
@ -1073,7 +1073,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break ;
case volume :
if ( player - > view ( ) )
rval = QString: : number ( player - > process ( ) - > viewer ( ) - > view ( ) - > controlPanel ( ) - > volumeBar ( ) - > value ( ) ) ;
rval = T QString: : number ( player - > process ( ) - > viewer ( ) - > view ( ) - > controlPanel ( ) - > volumeBar ( ) - > value ( ) ) ;
break ;
default :
return false ;
@ -1088,7 +1088,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::setSize (int w, int h) {
KMPlayer : : View * view = static_cast < KMPlayer : : View * > ( player - > view ( ) ) ;
if ( view - > controlPanelMode ( ) = = KMPlayer : : View : : CP_Show )
h + = view - > controlPanel ( ) - > height ( ) ;
QString jscode ;
T QString jscode ;
jscode . sprintf ( " try { eval( \" this.setAttribute('WIDTH',%d);this.setAttribute('HEIGHT',%d) \" ); } catch(e){} " , w , h ) ;
KParts : : LiveConnectExtension : : ArgList args ;
args . push_back ( qMakePair ( KParts : : LiveConnectExtension : : TypeString , jscode ) ) ;
@ -1115,7 +1115,7 @@ KDE_NO_EXPORT bool KMPlayerHRefSource::hasLength () {
return false ;
}
KDE_NO_EXPORT bool KMPlayerHRefSource : : processOutput ( const QString & /*str*/ ) {
KDE_NO_EXPORT bool KMPlayerHRefSource : : processOutput ( const T QString & /*str*/ ) {
//return Source::processOutput (str);
return true ;
}
@ -1131,7 +1131,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::setURL (const KURL & url) {
KDE_NO_EXPORT void KMPlayerHRefSource : : play ( ) {
kdDebug ( ) < < " KMPlayerHRefSource::play " < < m_url . url ( ) < < endl ;
Source * src = m_player - > sources ( ) [ " urlsource " ] ;
QString target = src - > document ( ) - > document ( ) - >
T QString target = src - > document ( ) - > document ( ) - >
getAttribute ( StringPool : : attr_target ) ;
if ( ! target . isEmpty ( ) ) {
KMPlayer : : Mrl * mrl = src - > document ( ) - > mrl ( ) ;
@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void KMPlayerHRefSource::play () {
KDE_NO_EXPORT void KMPlayerHRefSource : : activate ( ) {
m_player - > stop ( ) ;
if ( m_finished ) {
QTimer: : singleShot ( 0 , this , SLOT ( finished ( ) ) ) ;
T QTimer: : singleShot ( 0 , this , TQT_ SLOT ( finished ( ) ) ) ;
return ;
}
init ( ) ;
m_player - > setProcess ( " mplayer " ) ;
if ( m_player - > process ( ) - > grabPicture ( m_url , 0 ) )
connect ( m_player - > process ( ) , SIGNAL ( grabReady ( const QString & ) ) ,
this , SLOT ( grabReady ( const QString & ) ) ) ;
connect ( m_player - > process ( ) , TQT_ SIGNAL ( grabReady ( const T QString & ) ) ,
this , TQT_ SLOT ( grabReady ( const T QString & ) ) ) ;
else {
setURL ( KURL ( ) ) ;
QTimer: : singleShot ( 0 , this , SLOT ( play ( ) ) ) ;
T QTimer: : singleShot ( 0 , this , TQT_ SLOT ( play ( ) ) ) ;
}
}
@ -1161,7 +1161,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::clear () {
setURL ( KURL ( ) ) ;
}
KDE_NO_EXPORT void KMPlayerHRefSource : : grabReady ( const QString & path ) {
KDE_NO_EXPORT void KMPlayerHRefSource : : grabReady ( const T QString & path ) {
kdDebug ( ) < < " KMPlayerHRefSource::grabReady( " < < path < < " ) " < < endl ;
m_finished = true ;
m_grabfile = path ;
@ -1174,23 +1174,23 @@ KDE_NO_EXPORT void KMPlayerHRefSource::finished () {
if ( ! view ) return ;
if ( ! view - > setPicture ( m_grabfile ) ) {
clear ( ) ;
QTimer: : singleShot ( 0 , this , SLOT ( play ( ) ) ) ;
T QTimer: : singleShot ( 0 , this , TQT_ SLOT ( play ( ) ) ) ;
return ;
}
if ( view - > viewer ( ) )
connect ( view , SIGNAL ( pictureClicked ( ) ) , this , SLOT ( play ( ) ) ) ;
connect ( view , TQT_ SIGNAL ( pictureClicked ( ) ) , this , TQT_ SLOT ( play ( ) ) ) ;
}
KDE_NO_EXPORT void KMPlayerHRefSource : : deactivate ( ) {
kdDebug ( ) < < " KMPlayerHRefSource::deactivate() " < < endl ;
KMPlayer : : View * view = static_cast < KMPlayer : : View * > ( m_player - > view ( ) ) ;
if ( ! view ) return ;
view - > setPicture ( QString ( ) ) ;
view - > setPicture ( T QString ( ) ) ;
if ( view - > viewer ( ) )
disconnect ( view , SIGNAL ( pictureClicked ( ) ) , this , SLOT ( play ( ) ) ) ;
disconnect ( view , TQT_ SIGNAL ( pictureClicked ( ) ) , this , TQT_ SLOT ( play ( ) ) ) ;
}
KDE_NO_EXPORT QString KMPlayerHRefSource : : prettyName ( ) {
KDE_NO_EXPORT T QString KMPlayerHRefSource : : prettyName ( ) {
return i18n ( " WEB " ) ;
}