summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinevideowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
index 1d88cea..791818e 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
@@ -105,12 +105,27 @@ XineVideoWidget::~XineVideoWidget ( )
105void XineVideoWidget::clear ( ) 105void XineVideoWidget::clear ( )
106{ 106{
107 m_buff = 0; 107 m_buff = 0;
108 repaint ( false ); 108 repaint ( false );
109} 109}
110 110
111QSize XineVideoWidget::videoSize() const
112{
113 QSize s = size();
114 bool fs = ( s == qApp->desktop()->size() );
115
116 // if we are in fullscreen mode, do not rotate the video
117 // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!)
118 m_rotation = fs ? - qt_screen->transformOrientation() : 0;
119
120 if ( fs && qt_screen->isTransformed() )
121 s = qt_screen->mapToDevice( s );
122
123 return s;
124}
125
111void XineVideoWidget::paintEvent ( QPaintEvent * ) 126void XineVideoWidget::paintEvent ( QPaintEvent * )
112{ 127{
113 if ( m_buff == 0 ) { 128 if ( m_buff == 0 ) {
114 QPainter p ( this ); 129 QPainter p ( this );
115 p. fillRect ( rect ( ), black ); 130 p. fillRect ( rect ( ), black );
116 if ( m_logo ) 131 if ( m_logo )
@@ -248,23 +263,13 @@ void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl )
248 263
249 repaint ((( m_thisframe & m_lastframe ) != m_lastframe ) ? m_lastframe : m_thisframe, false ); 264 repaint ((( m_thisframe & m_lastframe ) != m_lastframe ) ? m_lastframe : m_thisframe, false );
250} 265}
251 266
252void XineVideoWidget::resizeEvent ( QResizeEvent * ) 267void XineVideoWidget::resizeEvent ( QResizeEvent * )
253{ 268{
254 QSize s = size ( ); 269 emit videoResized( videoSize() );
255 bool fs = ( s == qApp-> desktop ( )-> size ( ));
256
257 // if we are in fullscreen mode, do not rotate the video
258 // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!)
259 m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0;
260
261 if ( fs && qt_screen-> isTransformed ( ))
262 s = qt_screen-> mapToDevice ( s );
263
264 emit videoResized ( s );
265} 270}
266 271
267 272
268void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) 273void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ )
269{ 274{
270 emit clicked(); 275 emit clicked();