source: trunk/src/3rdparty/phonon/mmf/videooutput_surface.cpp

Last change on this file was 769, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

File size: 2.5 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#include <QResizeEvent>
20
21#include <QtCore/private/qcore_symbian_p.h> // for qt_TRect2QRect
22#include <QtGui/private/qwidget_p.h> // to access QWExtra
23
24#include "utils.h"
25#include "videooutput_surface.h"
26
27QT_BEGIN_NAMESPACE
28
29using namespace Phonon;
30using namespace Phonon::MMF;
31
32SurfaceVideoOutput::SurfaceVideoOutput(QWidget *parent)
33 : AbstractVideoOutput(parent)
34{
35 TRACE_CONTEXT(SurfaceVideoOutput::SurfaceVideoOutput, EVideoInternal);
36 TRACE_ENTRY("parent 0x%08x", parent);
37
38 qt_widget_private(this)->createExtra();
39 qt_widget_private(this)->extraData()->nativePaintMode = QWExtra::Disable;
40
41 TRACE_EXIT_0();
42}
43
44SurfaceVideoOutput::~SurfaceVideoOutput()
45{
46 TRACE_CONTEXT(SurfaceVideoOutput::~SurfaceVideoOutput, EVideoInternal);
47 TRACE_ENTRY_0();
48
49 TRACE_EXIT_0();
50}
51
52//-----------------------------------------------------------------------------
53// Public functions
54//-----------------------------------------------------------------------------
55
56
57//-----------------------------------------------------------------------------
58// Private functions
59//-----------------------------------------------------------------------------
60
61void MMF::SurfaceVideoOutput::resizeEvent(QResizeEvent *event)
62{
63 TRACE_CONTEXT(SurfaceVideoOutput::resizeEvent, EVideoInternal);
64 TRACE("%d %d -> %d %d",
65 event->oldSize().width(), event->oldSize().height(),
66 event->size().width(), event->size().height());
67
68 if (event->size() != event->oldSize())
69 emit videoWindowSizeChanged();
70}
71
72bool MMF::SurfaceVideoOutput::event(QEvent *event)
73{
74 TRACE_CONTEXT(SurfaceVideoOutput::event, EVideoInternal);
75
76 if (event->type() == QEvent::WinIdChange) {
77 TRACE_0("WinIdChange");
78 emit videoWindowChanged();
79 return true;
80 } else {
81 return QWidget::event(event);
82 }
83}
84
85
86QT_END_NAMESPACE
87
Note: See TracBrowser for help on using the repository browser.