summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-15 20:51:11 (UTC)
committer harlekin <harlekin>2002-08-15 20:51:11 (UTC)
commitbe99f951c39d19a6e9923103434afdb293741d35 (patch) (unidiff)
tree4fe4d6cc51eee0bbdd53c9b353624d104929f08b
parent157b5b1209b656960fc0b27fc077eb36a77b2c3f (diff)
downloadopie-be99f951c39d19a6e9923103434afdb293741d35.zip
opie-be99f951c39d19a6e9923103434afdb293741d35.tar.gz
opie-be99f951c39d19a6e9923103434afdb293741d35.tar.bz2
click in fullscreen leeds to going back to the normal videowidget now
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp37
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp68
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.h15
5 files changed, 67 insertions, 56 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 93819f2..22afe19 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -73,3 +73,3 @@ void MediaPlayer::setPlaying( bool play ) {
73 if ( !play ) { 73 if ( !play ) {
74 //mediaPlayerState->setPaused( TRUE ); 74 // mediaPlayerState->setPaused( FALSE );
75 return; 75 return;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 238770b..c2080e6 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -86,3 +86,5 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
86 videoFrame = new XineVideoWidget ( this, "Video frame" ); 86 videoFrame = new XineVideoWidget ( this, "Video frame" );
87
87 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); 88 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
89 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
88 90
@@ -345,4 +347,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
345 } else { 347 } else {
346 // setToggleButton( i, TRUE ); 348 return;
347 // mediaPlayerState->setPlaying( videoButtons[i].isDown );
348 } 349 }
@@ -380,16 +381,22 @@ void VideoWidget::showEvent( QShowEvent* ) {
380 381
382 void VideoWidget::backToNormal() {
383 mediaPlayerState->setFullscreen( FALSE );
384 makeVisible();
385 }
386
381void VideoWidget::makeVisible() { 387void VideoWidget::makeVisible() {
382 if ( mediaPlayerState->fullscreen() ) { 388 if ( mediaPlayerState->fullscreen() ) {
383 setBackgroundMode( QWidget::NoBackground ); 389 setBackgroundMode( QWidget::NoBackground );
384 showFullScreen(); 390 showFullScreen();
385 resize( qApp->desktop()->size() ); 391 resize( qApp->desktop()->size() );
386 slider->hide(); 392 slider->hide();
387 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 393 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
388 } else { 394
389 showNormal(); 395 } else {
390 showMaximized(); 396 showNormal();
391 slider->show(); 397 showMaximized();
392 videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); 398 slider->show();
393 qApp->processEvents(); 399 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
394 } 400 qApp->processEvents();
401 }
395} 402}
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index b35558b..990fa5f 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -68,2 +68,3 @@ public slots:
68 void makeVisible(); 68 void makeVisible();
69 void backToNormal();
69 void setPosition( long ); 70 void setPosition( long );
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
index d65006b..3e28e54 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
@@ -3,3 +3,3 @@
3                This file is part of the Opie Project 3                This file is part of the Opie Project
4 4
5              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 5              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
@@ -31,3 +31,3 @@
31 Boston, MA 02111-1307, USA. 31 Boston, MA 02111-1307, USA.
32 32
33*/ 33*/
@@ -52,3 +52,3 @@ static inline void memcpy_rev ( void *dst, void *src, size_t len )
52 52
53 len >>= 1; 53 len >>= 1;
54 while ( len-- ) 54 while ( len-- )
@@ -69,5 +69,5 @@ static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t st
69 len >>= 1; 69 len >>= 1;
70 70
71 ((char *) src ) += ( len * step ); 71 ((char *) src ) += ( len * step );
72 72
73 while ( len-- ) { 73 while ( len-- ) {
@@ -115,5 +115,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
115// qWarning ( "paintevent\n" ); 115// qWarning ( "paintevent\n" );
116 116
117 QArray <QRect> qt_bug_workaround_clip_rects; 117 QArray <QRect> qt_bug_workaround_clip_rects;
118 118
119 { 119 {
@@ -125,5 +125,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
125 uchar *frame = m_buff; // rot == 0 ? m_buff : m_buff + ( m_thisframe. height ( ) - 1 ) * m_bytes_per_line_frame; 125 uchar *frame = m_buff; // rot == 0 ? m_buff : m_buff + ( m_thisframe. height ( ) - 1 ) * m_bytes_per_line_frame;
126 126
127 QRect framerect = qt_screen-> mapToDevice ( QRect ( mapToGlobal ( m_thisframe. topLeft ( )), m_thisframe. size ( )), QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); 127 QRect framerect = qt_screen-> mapToDevice ( QRect ( mapToGlobal ( m_thisframe. topLeft ( )), m_thisframe. size ( )), QSize ( qt_screen-> width ( ), qt_screen-> height ( )));
128 128
129 qt_bug_workaround_clip_rects. resize ( dp. numRects ( )); 129 qt_bug_workaround_clip_rects. resize ( dp. numRects ( ));
@@ -132,8 +132,8 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
132 const QRect &clip = dp. rect ( i ); 132 const QRect &clip = dp. rect ( i );
133 133
134 qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); 134 qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( )));
135 135
136 uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); 136 uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb );
137 uchar *src = frame; 137 uchar *src = frame;
138 138
139 switch ( rot ) { 139 switch ( rot ) {
@@ -149,3 +149,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
149 uint clipwidth = clip. width ( ) * m_bytes_per_pixel; 149 uint clipwidth = clip. width ( ) * m_bytes_per_pixel;
150 150
151 if ( clip. left ( ) < framerect. left ( )) 151 if ( clip. left ( ) < framerect. left ( ))
@@ -154,3 +154,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
154 rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; 154 rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth;
155 155
156 framefill = clipwidth - ( leftfill + rightfill ); 156 framefill = clipwidth - ( leftfill + rightfill );
@@ -164,3 +164,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
164 memset ( dst, 0, leftfill ); 164 memset ( dst, 0, leftfill );
165 165
166 if ( framefill ) { 166 if ( framefill ) {
@@ -172,3 +172,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
172 } 172 }
173 } 173 }
174 if ( rightfill ) 174 if ( rightfill )
@@ -176,5 +176,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
176 } 176 }
177 177
178 dst += m_bytes_per_line_fb; 178 dst += m_bytes_per_line_fb;
179 179
180 switch ( rot ) { 180 switch ( rot ) {
@@ -188,3 +188,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
188 } 188 }
189 //qWarning ( " ||| painting |||" ); 189 //qWarning ( " ||| painting |||" );
190 { 190 {
@@ -193,3 +193,3 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
193 193
194 for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { 194 for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) {
195 p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) ); 195 p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) );
@@ -233,7 +233,7 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * )
233 bool fs = ( s == qApp-> desktop ( )-> size ( )); 233 bool fs = ( s == qApp-> desktop ( )-> size ( ));
234 234
235 m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; 235 m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0;
236 236
237 if ( fs && qt_screen-> isTransformed ( )) { 237 if ( fs && qt_screen-> isTransformed ( )) {
238 s = qt_screen-> mapToDevice ( s ); 238 s = qt_screen-> mapToDevice ( s );
239 } 239 }
@@ -241,3 +241,3 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * )
241// qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation ); 241// qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation );
242 242
243 emit videoResized ( s ); 243 emit videoResized ( s );
@@ -249,7 +249,8 @@ void XineVideoWidget::mousePressEvent ( QMouseEvent *me )
249 QWidget *p = parentWidget ( ); 249 QWidget *p = parentWidget ( );
250 250
251 if ( p ) { 251 if ( p ) {
252 QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); 252 // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( ));
253 253
254 QApplication::sendEvent ( p, &pme ); 254 // QApplication::sendEvent ( p, &pme );
255 // emit clicked();
255 } 256 }
@@ -260,7 +261,8 @@ void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me )
260 QWidget *p = parentWidget ( ); 261 QWidget *p = parentWidget ( );
261 262
262 if ( p ) { 263 if ( p ) {
263 QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); 264 // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( ));
264 265
265 QApplication::sendEvent ( p, &pme ); 266 // QApplication::sendEvent ( p, &pme );
267 emit clicked();
266 } 268 }
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h
index 2fc627d..c5101da 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.h
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.h
@@ -49,3 +49,3 @@ public:
49 void clear() ; 49 void clear() ;
50 50
51protected: 51protected:
@@ -54,11 +54,12 @@ protected:
54 54
55 void mousePressEvent ( QMouseEvent *e ); 55 void mousePressEvent ( QMouseEvent *e );
56 void mouseReleaseEvent ( QMouseEvent *e ); 56 void mouseReleaseEvent ( QMouseEvent *e );
57 57
58signals: 58signals:
59 void videoResized ( const QSize &s ); 59 void clicked();
60 60 void videoResized ( const QSize &s );
61
61private: 62private:
62 QRect m_lastframe; 63 QRect m_lastframe;
63 QRect m_thisframe; 64 QRect m_thisframe;
64 65