Changeset 651 for trunk/src/3rdparty
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 46 edited
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
r561 r651 38 38 AbstractAudioEffect::AbstractAudioEffect(QObject *parent, 39 39 const QList<EffectParameter> ¶ms) 40 : MediaNode::MediaNode(parent) 40 : MediaNode(parent) 41 , m_params(params) 41 42 , m_player(0) 42 , m_params(params)43 43 { 44 44 45 } 45 46 46 QList< EffectParameter> AbstractAudioEffect::parameters() const47 QList<Phonon::EffectParameter> AbstractAudioEffect::parameters() const 47 48 { 48 return m_params; 49 // Convert from QList<MMF::EffectParameter> to QList<Phonon::EffectParameter> 50 QList<Phonon::EffectParameter> result; 51 EffectParameter param; 52 foreach (param, m_params) 53 result += param; 54 return result; 49 55 } 50 56 51 QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam) const57 QVariant AbstractAudioEffect::parameterValue(const Phonon::EffectParameter &queriedParam) const 52 58 { 53 59 const QVariant &val = m_values.value(queriedParam.id()); … … 59 65 } 60 66 61 void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m,67 void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m, 62 68 const QVariant &newValue) 63 69 { 64 70 m_values.insert(param.id(), newValue); 65 parameterChanged(param.id(), newValue); 66 // TODO: handle audio effect errors 67 TRAP_IGNORE(m_effect->ApplyL()); 71 72 if (m_effect.data()) { 73 const EffectParameter& internalParam = internalParameter(param.id()); 74 int err = parameterChanged(internalParam, newValue); 75 // TODO: handle audio effect errors 76 Q_UNUSED(err); 77 } 78 } 79 80 void AbstractAudioEffect::abstractPlayerChanged(AbstractPlayer *player) 81 { 82 m_player = qobject_cast<AbstractMediaPlayer *>(player); 83 m_effect.reset(); 84 } 85 86 void AbstractAudioEffect::stateChanged(Phonon::State newState, 87 Phonon::State oldState) 88 { 89 if (Phonon::LoadingState == oldState 90 && Phonon::LoadingState != newState) 91 createEffect(); 68 92 } 69 93 … … 73 97 Q_ASSERT_X(!m_effect.data(), Q_FUNC_INFO, "Effect already created"); 74 98 75 AbstractMediaPlayer *const player = 76 qobject_cast<AbstractMediaPlayer *>(mediaObject->abstractPlayer()); 99 abstractPlayerChanged(mediaObject->abstractPlayer()); 77 100 78 if (player) {79 m_player = player;101 connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 102 SLOT(stateChanged(Phonon::State, Phonon::State))); 80 103 81 if (AudioPlayer *audioPlayer = qobject_cast<AudioPlayer *>(player)) { 82 connectAudioPlayer(audioPlayer->nativePlayer()); 83 applyParameters(); 84 // TODO: handle audio effect errors 85 TRAP_IGNORE(m_effect->EnableL()); 104 connect(mediaObject, SIGNAL(abstractPlayerChanged(AbstractPlayer *)), 105 SLOT(abstractPlayerChanged(AbstractPlayer *))); 106 107 if (mediaObject->state() != Phonon::LoadingState) 108 createEffect(); 109 } 110 111 void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject) 112 { 113 mediaObject->disconnect(this); 114 abstractPlayerChanged(0); 115 } 116 117 void AbstractAudioEffect::setEnabled(bool enabled) 118 { 119 TInt err = KErrNone; 120 121 if (enabled) 122 // TODO: handle audio effect errors 123 TRAP(err, m_effect->EnableL()) 124 else 125 // TODO: handle audio effect errors 126 TRAP(err, m_effect->DisableL()) 127 128 Q_UNUSED(err); 129 } 130 131 void AbstractAudioEffect::createEffect() 132 { 133 Q_ASSERT_X(m_player, Q_FUNC_INFO, "Invalid media player pointer"); 134 135 if (AudioPlayer *audioPlayer = qobject_cast<AudioPlayer *>(m_player)) { 136 createEffect(audioPlayer->nativePlayer()); 137 } 138 139 if (m_effect.data()) { 140 EffectParameter param; 141 int err = 0; 142 foreach (param, m_params) { 143 const QVariant value = parameterValue(param); 144 err = parameterChanged(param, value); 86 145 } 146 Q_UNUSED(err) 87 147 } 88 148 } 89 149 90 void AbstractAudioEffect::disconnectMediaObject(MediaObject * /*mediaObject*/) 150 const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const 91 151 { 92 m_player = 0; 93 m_effect.reset(); 152 const EffectParameter *result = 0; 153 for (int i=0; i<m_params.count() && !result; ++i) { 154 if (m_params[i].id() == id) 155 result = &m_params[i]; 156 } 157 Q_ASSERT_X(result, Q_FUNC_INFO, "Parameter not found"); 158 return *result; 94 159 } 160 161 int AbstractAudioEffect::parameterChanged(const EffectParameter ¶m, 162 const QVariant &value) 163 { 164 int err = 0; 165 166 switch (param.id()) { 167 case ParameterEnable: 168 setEnabled(value.toBool()); 169 break; 170 default: 171 { 172 const EffectParameter& internalParam = internalParameter(param.id()); 173 err = effectParameterChanged(internalParam, value); 174 } 175 break; 176 } 177 178 if (!err) 179 TRAP(err, m_effect->ApplyL()); 180 181 return err; 182 } 183 184 int AbstractAudioEffect::effectParameterChanged( 185 const EffectParameter ¶m, const QVariant &value) 186 { 187 // Default implementation 188 Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters"); 189 return 0; 190 } 191 95 192 96 193 QT_END_NAMESPACE -
trunk/src/3rdparty/phonon/mmf/abstractaudioeffect.h
r561 r651 24 24 #include <AudioEffectBase.h> 25 25 26 #include <Phonon/effectinterface.h> 27 #include <Phonon/effectparameter.h> 26 #include <phonon/effectinterface.h> 28 27 29 28 #include "audioplayer.h" 29 #include "effectparameter.h" 30 30 #include "mmf_medianode.h" 31 31 #include "mmf_videoplayer.h" 32 33 class CMdaAudioOutputStream; 32 34 33 35 QT_BEGIN_NAMESPACE … … 37 39 namespace MMF 38 40 { 41 class AbstractPlayer; 39 42 class AbstractMediaPlayer; 40 43 … … 64 67 const QList<EffectParameter> ¶ms); 65 68 66 virtual QList<EffectParameter> parameters() const; 67 virtual QVariant parameterValue(const EffectParameter ¶m) const; 68 virtual void setParameterValue(const EffectParameter &, 69 // Phonon::EffectInterface 70 virtual QList<Phonon::EffectParameter> parameters() const; 71 virtual QVariant parameterValue(const Phonon::EffectParameter ¶m) const; 72 virtual void setParameterValue(const Phonon::EffectParameter &, 69 73 const QVariant &newValue); 70 74 71 enum Type 75 // Parameters which are shared by all effects 76 enum CommonParameters 72 77 { 73 EffectAudioEqualizer = 1, 74 EffectBassBoost, 75 EffectDistanceAttenuation, 76 EffectEnvironmentalReverb, 77 EffectListenerOrientation, 78 EffectLoudness, 79 EffectSourceOrientation, 80 EffectStereoWidening 78 ParameterEnable = 0, 79 ParameterBase // must be last entry in enum 81 80 }; 81 82 public Q_SLOTS: 83 void abstractPlayerChanged(AbstractPlayer *player); 84 void stateChanged(Phonon::State newState, 85 Phonon::State oldState); 82 86 83 87 protected: … … 86 90 void disconnectMediaObject(MediaObject *mediaObject); 87 91 88 virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player) = 0; 89 virtual void applyParameters() = 0; 92 virtual void createEffect(AudioPlayer::NativePlayer *player) = 0; 90 93 91 virtual void parameterChanged(const int id, 92 const QVariant &value) = 0; 94 // Effect-specific parameter changed 95 virtual int effectParameterChanged(const EffectParameter ¶m, 96 const QVariant &value); 97 98 private: 99 void createEffect(); 100 void setEnabled(bool enabled); 101 const EffectParameter& internalParameter(int id) const; 102 int parameterChanged(const EffectParameter ¶m, 103 const QVariant &value); 93 104 94 105 protected: … … 96 107 97 108 private: 109 const QList<EffectParameter> m_params; 98 110 AbstractMediaPlayer * m_player; 99 const QList<EffectParameter> m_params;100 111 QHash<int, QVariant> m_values; 101 112 }; … … 104 115 } 105 116 117 118 // Macro for defining functions which depend on the native class name 119 // for each of the effects. Using this reduces repetition of boilerplate 120 // in the implementations of the backend effect nodes. 121 122 #define PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Effect) \ 123 \ 124 void Effect##::createEffect(AudioPlayer::NativePlayer *player) \ 125 { \ 126 C##Effect *ptr = 0; \ 127 QT_TRAP_THROWING(ptr = C##Effect::NewL(*player)); \ 128 m_effect.reset(ptr); \ 129 } \ 130 \ 131 C##Effect* Effect::concreteEffect() \ 132 { \ 133 return static_cast<C##Effect *>(m_effect.data()); \ 134 } 135 106 136 QT_END_NAMESPACE 107 137 -
trunk/src/3rdparty/phonon/mmf/abstractplayer.h
r561 r651 20 20 #define PHONON_MMF_ABSTRACTPLAYER_H 21 21 22 #include < Phonon/phononnamespace.h>23 #include < Phonon/mediasource.h>22 #include <phonon/phononnamespace.h> 23 #include <phonon/mediasource.h> 24 24 25 25 #include <QObject> … … 107 107 void tick(qint64 time); 108 108 void bufferStatus(int percentFilled); 109 void stateChanged(Phonon::State oldState,110 Phonon::State newState);109 void stateChanged(Phonon::State newState, 110 Phonon::State oldState); 111 111 void metaDataChanged(const QMultiMap<QString, QString>& metaData); 112 112 void aboutToFinish(); -
trunk/src/3rdparty/phonon/mmf/audioequalizer.cpp
r561 r651 29 29 */ 30 30 31 AudioEqualizer::AudioEqualizer(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, createParams()) 31 // Define functions which depend on concrete native effect class name 32 PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(AudioEqualizer) 33 34 AudioEqualizer::AudioEqualizer(QObject *parent, const QList<EffectParameter>& parameters) 35 : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) 32 36 { 37 33 38 } 34 39 35 void AudioEqualizer::parameterChanged(const int pid,40 int AudioEqualizer::effectParameterChanged(const EffectParameter ¶m, 36 41 const QVariant &value) 37 42 { 38 if (m_effect.data()) { 39 const int band = pid; 40 const int level = value.toInt(); 41 setBandLevel(band, level); 42 } 43 const int band = param.id() - ParameterBase + 1; 44 45 const qreal externalLevel = value.toReal(); 46 const int internalLevel = param.toInternalValue(externalLevel); 47 48 TRAPD(err, concreteEffect()->SetBandLevelL(band, internalLevel)); 49 return err; 43 50 } 44 51 45 void AudioEqualizer::connectAudioPlayer(AudioPlayer::NativePlayer *player) 52 53 //----------------------------------------------------------------------------- 54 // Static functions 55 //----------------------------------------------------------------------------- 56 57 const char* AudioEqualizer::description() 46 58 { 47 CAudioEqualizer *ptr = 0; 48 QT_TRAP_THROWING(ptr = CAudioEqualizer::NewL(*player)); 49 m_effect.reset(ptr); 59 return "Audio equalizer"; 50 60 } 51 61 52 void AudioEqualizer::applyParameters() 62 bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream, 63 QList<EffectParameter>& parameters) 53 64 { 54 if (m_effect.data()) { 55 EffectParameter param; 56 foreach (param, parameters()) { 57 const int band = param.id(); 58 const int level = parameterValue(param).toInt(); 59 setBandLevel(band, level); 65 bool supported = false; 66 67 QScopedPointer<CAudioEqualizer> effect; 68 TRAPD(err, effect.reset(CAudioEqualizer::NewL(*stream))); 69 70 if (KErrNone == err) { 71 supported = true; 72 73 TInt32 dbMin; 74 TInt32 dbMax; 75 effect->DbLevelLimits(dbMin, dbMax); 76 77 const int bandCount = effect->NumberOfBands(); 78 79 for (int i = 0; i < bandCount; ++i) { 80 // For some reason, band IDs are 1-based, as opposed to the 81 // 0-based indices used in just about other Symbian API...! 82 const int band = i + 1; 83 84 const qint32 hz = effect->CenterFrequency(band); 85 86 // We pass a floating-point parameter range of -1.0 to +1.0 for 87 // each band in order to work around a limitation in 88 // Phonon::EffectWidget. See documentation of EffectParameter 89 // for more details. 90 EffectParameter param( 91 /* parameterId */ ParameterBase + i, 92 /* name */ tr("%1 Hz").arg(hz), 93 /* hints */ EffectParameter::LogarithmicHint, 94 /* defaultValue */ QVariant(qreal(0.0)), 95 /* minimumValue */ QVariant(qreal(-1.0)), 96 /* maximumValue */ QVariant(qreal(+1.0))); 97 98 param.setInternalRange(dbMin, dbMax); 99 parameters.append(param); 60 100 } 61 101 } 62 }63 102 64 void AudioEqualizer::setBandLevel(int band, int level) 65 { 66 CAudioEqualizer *const effect = static_cast<CAudioEqualizer *>(m_effect.data()); 67 // TODO: handle audio effect errors 68 TRAP_IGNORE(effect->SetBandLevelL(band, level)); 69 } 70 71 QList<EffectParameter> AudioEqualizer::createParams() 72 { 73 QList<EffectParameter> retval; 74 75 // We temporarily create an AudioPlayer, and run the effect on it, so 76 // we can extract the readonly data we need. 77 AudioPlayer dummyPlayer; 78 79 CAudioEqualizer *eqPtr = 0; 80 QT_TRAP_THROWING(eqPtr = CAudioEqualizer::NewL(*dummyPlayer.nativePlayer())); 81 QScopedPointer<CAudioEqualizer> e(eqPtr); 82 83 TInt32 dbMin; 84 TInt32 dbMax; 85 e->DbLevelLimits(dbMin, dbMax); 86 87 const int bandCount = e->NumberOfBands(); 88 89 for (int i = 0; i < bandCount; ++i) { 90 const qint32 hz = e->CenterFrequency(i); 91 92 const qint32 defVol = e->BandLevel(i); 93 94 retval.append(EffectParameter(i, 95 tr("Frequency band, %1 Hz").arg(hz), 96 EffectParameter::LogarithmicHint, 97 QVariant(qint32(defVol)), 98 QVariant(qint32(dbMin)), 99 QVariant(qint32(dbMax)), 100 QVariantList(), 101 QString())); 102 } 103 104 return retval; 103 return supported; 105 104 } 106 105 -
trunk/src/3rdparty/phonon/mmf/audioequalizer.h
r561 r651 22 22 #include "abstractaudioeffect.h" 23 23 24 class CAudioEqualizer; 25 24 26 QT_BEGIN_NAMESPACE 25 27 … … 40 42 Q_OBJECT 41 43 public: 42 AudioEqualizer(QObject *parent); 44 AudioEqualizer(QObject *parent, const QList<EffectParameter> ¶meters); 45 46 // Static interface required by EffectFactory 47 static const char* description(); 48 static bool getParameters(CMdaAudioOutputStream *stream, 49 QList<EffectParameter>& parameters); 43 50 44 51 protected: 45 52 // AbstractAudioEffect 46 virtual void c onnectAudioPlayer(AudioPlayer::NativePlayer *player);47 virtual void applyParameters();48 virtual void parameterChanged(const int id,const QVariant &value);53 virtual void createEffect(AudioPlayer::NativePlayer *player); 54 virtual int effectParameterChanged(const EffectParameter ¶m, 55 const QVariant &value); 49 56 50 57 private: 51 void setBandLevel(int band, int level); 52 53 private: 54 static QList<EffectParameter> createParams(); 58 CAudioEqualizer *concreteEffect(); 55 59 56 60 }; -
trunk/src/3rdparty/phonon/mmf/backend.cpp
r561 r651 46 46 : QObject(parent) 47 47 , m_ancestorMoveMonitor(new AncestorMoveMonitor(this)) 48 , m_effectFactory(new EffectFactory(this)) 48 49 { 49 50 TRACE_CONTEXT(Backend::Backend, EBackend); … … 82 83 Q_ASSERT(args.count() == 1); 83 84 Q_ASSERT(args.first().type() == QVariant::Int); 84 const AbstractAudioEffect::Type effect = AbstractAudioEffect::Type(args.first().toInt());85 86 return EffectFactory::createAudioEffect(effect, parent);85 const EffectFactory::Type type = 86 static_cast<EffectFactory::Type>(args.first().toInt()); 87 return m_effectFactory->createAudioEffect(type, parent); 87 88 } 88 89 case VideoWidgetClass: … … 106 107 { 107 108 case EffectType: 108 retval.append( EffectFactory::effectIndexes());109 retval.append(m_effectFactory->effectIndexes()); 109 110 break; 110 111 case AudioOutputDeviceType: … … 127 128 switch (type) { 128 129 case EffectType: 129 return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));130 return m_effectFactory->audioEffectDescriptions(EffectFactory::Type(index)); 130 131 case AudioOutputDeviceType: 131 132 return AudioOutput::audioOutputDescription(index); -
trunk/src/3rdparty/phonon/mmf/backend.h
r561 r651 21 21 22 22 #include "ancestormovemonitor.h" 23 #include "effectfactory.h" 23 24 24 #include < Phonon/mediasource.h>25 #include < Phonon/backendinterface.h>25 #include <phonon/mediasource.h> 26 #include <phonon/backendinterface.h> 26 27 #include <QScopedPointer> 27 28 … … 54 55 private: 55 56 QScopedPointer<AncestorMoveMonitor> m_ancestorMoveMonitor; 57 QScopedPointer<EffectFactory> m_effectFactory; 56 58 57 59 }; -
trunk/src/3rdparty/phonon/mmf/bassboost.cpp
r561 r651 25 25 using namespace Phonon::MMF; 26 26 27 // Define functions which depend on concrete native effect class name 28 PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(BassBoost) 29 27 30 /*! \class MMF::BassBoost 28 31 \internal 29 32 */ 30 33 31 BassBoost::BassBoost(QObject *parent ) : AbstractAudioEffect::AbstractAudioEffect(parent,32 QList<EffectParameter>())34 BassBoost::BassBoost(QObject *parent, const QList<EffectParameter> ¶meters) 35 : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) 33 36 { 37 34 38 } 35 39 36 void BassBoost::parameterChanged(const int, 37 const QVariant &) 40 //----------------------------------------------------------------------------- 41 // Static functions 42 //----------------------------------------------------------------------------- 43 44 const char* BassBoost::description() 38 45 { 39 Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has not parameters");46 return "Bass boost"; 40 47 } 41 48 42 void BassBoost::connectAudioPlayer(AudioPlayer::NativePlayer *player) 49 bool BassBoost::getParameters(CMdaAudioOutputStream *stream, 50 QList<EffectParameter> ¶meters) 43 51 { 44 CBassBoost *ptr = 0; 45 QT_TRAP_THROWING(ptr = CBassBoost::NewL(*player)); 46 m_effect.reset(ptr); 47 } 48 49 void BassBoost::applyParameters() 50 { 51 // No parameters to apply 52 QScopedPointer<CBassBoost> effect; 53 TRAPD(err, effect.reset(CBassBoost::NewL(*stream))); 54 return (KErrNone == err); 52 55 } 53 56 -
trunk/src/3rdparty/phonon/mmf/bassboost.h
r561 r651 22 22 #include "abstractaudioeffect.h" 23 23 24 class CBassBoost; 25 24 26 QT_BEGIN_NAMESPACE 25 27 … … 29 31 { 30 32 /** 31 * @short An "bass boost" effect. 32 * 33 * The documentation does not say what "bass boost" is, neither has it anykind 34 * of setting. It's an on or off thing. 33 * @short A "bass boost" effect. 35 34 */ 36 35 class BassBoost : public AbstractAudioEffect … … 38 37 Q_OBJECT 39 38 public: 40 BassBoost(QObject *parent); 39 BassBoost(QObject *parent, const QList<EffectParameter> ¶meters); 40 41 // Static interface required by EffectFactory 42 static const char* description(); 43 static bool getParameters(CMdaAudioOutputStream *stream, 44 QList<EffectParameter>& parameters); 41 45 42 46 protected: 43 47 // AbstractAudioEffect 44 virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player); 45 virtual void applyParameters(); 46 virtual void parameterChanged(const int id, const QVariant &value); 48 virtual void createEffect(AudioPlayer::NativePlayer *player); 49 50 private: 51 CBassBoost *concreteEffect(); 47 52 48 53 }; -
trunk/src/3rdparty/phonon/mmf/effectfactory.cpp
r561 r651 20 20 #include <QCoreApplication> 21 21 22 #include <AudioEqualizerBase.h> 23 #include <BassBoostBase.h> 24 #include <DistanceAttenuationBase.h> 25 #include <DopplerBase.h> 26 #include <EnvironmentalReverbBase.h> 27 #include <ListenerOrientationBase.h> 28 #include <LocationBase.h> 29 #include <LoudnessBase.h> 30 #include <SourceOrientationBase.h> 31 #include <StereoWideningBase.h> 22 #include <mdaaudiooutputstream.h> 32 23 33 24 #include "audioequalizer.h" 34 25 #include "bassboost.h" 26 #include "environmentalreverb.h" 27 #include "loudness.h" 28 #include "stereowidening.h" 35 29 36 30 #include "effectfactory.h" … … 45 39 */ 46 40 47 QHash<QByteArray, QVariant> EffectFactory::constructEffectDescription(const QString &name, 48 const QString &description) 49 { 50 QHash<QByteArray, QVariant> retval; 51 52 retval.insert("name", name); 53 retval.insert("description", description); 54 retval.insert("available", true); 55 56 return retval; 57 } 58 59 60 QHash<QByteArray, QVariant> EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type type) 61 { 41 EffectFactory::EffectFactory(QObject *parent) 42 : QObject(parent) 43 , m_initialized(false) 44 { 45 46 } 47 48 EffectFactory::~EffectFactory() 49 { 50 51 } 52 53 //----------------------------------------------------------------------------- 54 // Public functions 55 //----------------------------------------------------------------------------- 56 57 AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, 58 QObject *parent) 59 { 60 // Lazily initialize 61 if (!m_initialized) 62 initialize(); 63 64 Q_ASSERT(parent); 65 66 const QList<EffectParameter>& parameters = data(type).m_parameters; 67 68 AbstractAudioEffect *effect = 0; 69 62 70 switch (type) 63 71 { 64 case AbstractAudioEffect::EffectAudioEqualizer: 65 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Audio Equalizer"), "Audio equalizer."); 66 case AbstractAudioEffect::EffectBassBoost: 67 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass Boost"), "Bass boost."); 68 case AbstractAudioEffect::EffectDistanceAttenuation: 69 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); 70 case AbstractAudioEffect::EffectEnvironmentalReverb: 71 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); 72 case AbstractAudioEffect::EffectListenerOrientation: 73 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); 74 case AbstractAudioEffect::EffectLoudness: 75 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Loudness"), "Loudness."); 76 case AbstractAudioEffect::EffectSourceOrientation: 77 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Source Orientation"), "Source Orientation."); 78 case AbstractAudioEffect::EffectStereoWidening: 79 return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Stereo Widening"), "Stereo Widening."); 80 } 81 82 Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect type."); 83 return QHash<QByteArray, QVariant>(); 84 } 85 86 AbstractAudioEffect *EffectFactory::createAudioEffect(AbstractAudioEffect::Type type, 87 QObject *parent) 88 { 89 Q_ASSERT(parent); 90 91 switch (type) 72 case TypeBassBoost: 73 effect = new BassBoost(parent, parameters); 74 break; 75 case TypeAudioEqualizer: 76 effect = new AudioEqualizer(parent, parameters); 77 break; 78 case TypeEnvironmentalReverb: 79 effect = new EnvironmentalReverb(parent, parameters); 80 break; 81 case TypeLoudness: 82 effect = new Loudness(parent, parameters); 83 break; 84 case TypeStereoWidening: 85 effect = new StereoWidening(parent, parameters); 86 break; 87 88 // Not implemented 89 case TypeDistanceAttenuation: 90 case TypeListenerOrientation: 91 case TypeSourceOrientation: 92 // Fall through 93 default: 94 Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect"); 95 } 96 97 return effect; 98 } 99 100 QHash<QByteArray, QVariant> EffectFactory::audioEffectDescriptions(Type type) 101 { 102 // Lazily initialize 103 if (!m_initialized) 104 initialize(); 105 106 return data(type).m_descriptions; 107 } 108 109 QList<int> EffectFactory::effectIndexes() 110 { 111 // Lazily initialize 112 if (!m_initialized) 113 initialize(); 114 115 QList<int> result; 116 117 QHash<Type, EffectData>::const_iterator i = m_effectData.begin(); 118 for ( ; i != m_effectData.end(); ++i) 119 if (i.value().m_supported) 120 result.append(i.key()); 121 122 return result; 123 } 124 125 //----------------------------------------------------------------------------- 126 // Private functions 127 //----------------------------------------------------------------------------- 128 129 #define INITIALIZE_EFFECT(Effect) \ 130 { \ 131 EffectData data = getData<Effect>(); \ 132 m_effectData.insert(Type##Effect, data); \ 133 } 134 135 void EffectFactory::initialize() 136 { 137 Q_ASSERT_X(!m_initialized, Q_FUNC_INFO, "Already initialized"); 138 139 INITIALIZE_EFFECT(AudioEqualizer) 140 INITIALIZE_EFFECT(BassBoost) 141 INITIALIZE_EFFECT(EnvironmentalReverb) 142 INITIALIZE_EFFECT(Loudness) 143 INITIALIZE_EFFECT(StereoWidening) 144 145 m_initialized = true; 146 } 147 148 // This class is just a wrapper which allows us to instantiate a 149 // CMdaAudioOutputStream object. This is done in order to allow the 150 // effects API to query the DevSound implementation, to discover 151 // which effects are supported and what parameters they take. 152 // Ideally, we would use CMMFDevSound directly, but this class is not 153 // available in the public S60 SDK. 154 class OutputStreamFactory : public MMdaAudioOutputStreamCallback 155 { 156 public: 157 CMdaAudioOutputStream* create() 92 158 { 93 case AbstractAudioEffect::EffectBassBoost: 94 return new BassBoost(parent); 95 case AbstractAudioEffect::EffectAudioEqualizer: 96 return new AudioEqualizer(parent); 97 case AbstractAudioEffect::EffectDistanceAttenuation: 98 case AbstractAudioEffect::EffectEnvironmentalReverb: 99 case AbstractAudioEffect::EffectListenerOrientation: 100 case AbstractAudioEffect::EffectLoudness: 101 case AbstractAudioEffect::EffectSourceOrientation: 102 case AbstractAudioEffect::EffectStereoWidening: 103 ; 104 } 105 106 Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect."); 107 return 0; 108 } 109 110 template<typename TEffect> 111 bool isEffectSupported() 112 { 113 AudioPlayer audioPlayer; 114 115 QScopedPointer<TEffect> eff; 116 TRAPD(errorCode, eff.reset(TEffect::NewL(*audioPlayer.nativePlayer()))); 117 118 return errorCode != KErrNone; 119 } 120 121 QList<int> EffectFactory::effectIndexes() 122 { 123 QList<int> retval; 124 125 if (isEffectSupported<CAudioEqualizer>()) 126 retval.append(AbstractAudioEffect::EffectAudioEqualizer); 127 128 if (isEffectSupported<CBassBoost>()) 129 retval.append(AbstractAudioEffect::EffectBassBoost); 130 131 /* We haven't implemented these yet. 132 if (isEffectSupported<CDistanceAttenuation>()) 133 retval.append(AbstractAudioEffect::EffectDistanceAttenuation); 134 135 if (isEffectSupported<CEnvironmentalReverb>()) 136 retval.append(AbstractAudioEffect::EffectEnvironmentalReverb); 137 138 if (isEffectSupported<CLoudness>()) 139 retval.append(AbstractAudioEffect::EffectLoudness); 140 141 if (isEffectSupported<CListenerOrientation>()) 142 retval.append(AbstractAudioEffect::EffectListenerOrientation); 143 144 if (isEffectSupported<CSourceOrientation>()) 145 retval.append(AbstractAudioEffect::EffectSourceOrientation); 146 147 if (isEffectSupported<CStereoWidening>()) 148 retval.append(AbstractAudioEffect::EffectStereoWidening); 149 */ 150 151 return retval; 159 CMdaAudioOutputStream* stream = 0; 160 QT_TRAP_THROWING(stream = CMdaAudioOutputStream::NewL(*this)); 161 return stream; 162 } 163 private: 164 void MaoscOpenComplete(TInt /*aError*/) { } 165 void MaoscBufferCopied(TInt /*aError*/, const TDesC8& /*aBuffer*/) { } 166 void MaoscPlayComplete(TInt /*aError*/) { } 167 }; 168 169 template<typename BackendNode> 170 EffectFactory::EffectData EffectFactory::getData() 171 { 172 EffectData data; 173 174 // Create a temporary CMdaAudioOutputStream object, so that the effects 175 // API can query DevSound to discover which effects are supported. 176 OutputStreamFactory streamFactory; 177 QScopedPointer<CMdaAudioOutputStream> stream(streamFactory.create()); 178 179 EffectParameter param( 180 /* parameterId */ AbstractAudioEffect::ParameterEnable, 181 /* name */ tr("Enabled"), 182 /* hints */ EffectParameter::ToggledHint, 183 /* defaultValue */ QVariant(bool(true))); 184 data.m_parameters.append(param); 185 186 if (data.m_supported = BackendNode::getParameters 187 (stream.data(), data.m_parameters)) { 188 const QString description = QCoreApplication::translate 189 ("Phonon::MMF::EffectFactory", BackendNode::description()); 190 data.m_descriptions.insert("name", description); 191 data.m_descriptions.insert("description", description); 192 data.m_descriptions.insert("available", true); 193 } 194 195 // Sanity check to ensure that all parameter IDs are unique 196 QSet<int> ids; 197 foreach (param, data.m_parameters) { 198 Q_ASSERT_X(ids.find(param.id()) == ids.end(), Q_FUNC_INFO, 199 "Parameter list contains duplicates"); 200 ids.insert(param.id()); 201 } 202 203 return data; 204 } 205 206 const EffectFactory::EffectData& EffectFactory::data(Type type) const 207 { 208 QHash<Type, EffectData>::const_iterator i = m_effectData.find(type); 209 Q_ASSERT_X(i != m_effectData.end(), Q_FUNC_INFO, "Effect data not found"); 210 return i.value(); 152 211 } 153 212 -
trunk/src/3rdparty/phonon/mmf/effectfactory.h
r561 r651 21 21 22 22 #include "abstractaudioeffect.h" 23 #include "effectparameter.h" 23 24 24 25 QT_BEGIN_NAMESPACE … … 32 33 * @short Contains utility functions related to effects. 33 34 */ 34 class EffectFactory 35 class EffectFactory : public QObject 35 36 { 37 Q_OBJECT 38 36 39 public: 40 EffectFactory(QObject *parent); 41 ~EffectFactory(); 42 43 enum Type 44 { 45 TypeAudioEqualizer = 0 46 , TypeBassBoost 47 , TypeDistanceAttenuation 48 , TypeEnvironmentalReverb 49 , TypeListenerOrientation 50 , TypeLoudness 51 , TypeSourceOrientation 52 , TypeStereoWidening 53 }; 54 37 55 /** 38 56 * @short Creates an audio effect of type @p type. 39 57 */ 40 static AbstractAudioEffect *createAudioEffect(AbstractAudioEffect::Type type, 41 QObject *parent); 58 AbstractAudioEffect *createAudioEffect(Type type, QObject *parent); 42 59 43 60 /** … … 47 64 * BackendInterface::objectDescriptionProperties(). 48 65 */ 49 static QHash<QByteArray, QVariant> audioEffectDescriptions(AbstractAudioEffect::Type type);66 QHash<QByteArray, QVariant> audioEffectDescriptions(Type type); 50 67 51 68 /** … … 55 72 * BackendInterface::objectDescriptionIndexes(). 56 73 */ 57 staticQList<int> effectIndexes();74 QList<int> effectIndexes(); 58 75 59 76 private: 60 static inline QHash<QByteArray, QVariant> constructEffectDescription(const QString &name, 61 const QString &description); 77 void initialize(); 62 78 63 /** 64 * This class is not supposed to be instantiated, so disable 65 * the default constructor. 66 */ 67 inline EffectFactory(); 68 Q_DISABLE_COPY(EffectFactory) 79 struct EffectData 80 { 81 bool m_supported; 82 QHash<QByteArray, QVariant> m_descriptions; 83 QList<EffectParameter> m_parameters; 84 }; 85 86 template<typename BackendNode> EffectData getData(); 87 const EffectData& data(Type type) const; 88 89 private: 90 bool m_initialized; 91 QHash<Type, EffectData> m_effectData; 92 69 93 }; 94 70 95 } 71 96 } -
trunk/src/3rdparty/phonon/mmf/mediaobject.cpp
r561 r651 298 298 } 299 299 300 if (oldPlayer) 301 emit abstractPlayerChanged(0); 300 302 m_player.reset(newPlayer); 303 emit abstractPlayerChanged(newPlayer); 301 304 302 305 if (oldPlayerHasVideo != hasVideo()) { -
trunk/src/3rdparty/phonon/mmf/mediaobject.h
r561 r651 20 20 #define PHONON_MMF_MEDIAOBJECT_H 21 21 22 #include < Phonon/mediasource.h>23 #include < Phonon/mediaobjectinterface.h>22 #include <phonon/mediasource.h> 23 #include <phonon/mediaobjectinterface.h> 24 24 #include <QScopedPointer> 25 25 #include <QTimer> … … 93 93 94 94 Q_SIGNALS: 95 void abstractPlayerChanged(AbstractPlayer *player); 95 96 void totalTimeChanged(qint64 length); 96 97 void hasVideoChanged(bool hasVideo); … … 102 103 void metaDataChanged(const QMultiMap<QString, QString>& metaData); 103 104 void currentSourceChanged(const MediaSource& source); 104 void stateChanged(Phonon::State oldState,105 Phonon::State newState);105 void stateChanged(Phonon::State newState, 106 Phonon::State oldState); 106 107 void finished(); 107 108 void tick(qint64 time); -
trunk/src/3rdparty/phonon/mmf/mmf_medianode.h
r561 r651 21 21 22 22 #include <QObject> 23 #include < Phonon/effectinterface.h>23 #include <phonon/effectinterface.h> 24 24 #include "audioplayer.h" 25 25 -
trunk/src/3rdparty/phonon/mmf/utils.h
r561 r651 45 45 class Utils 46 46 { 47 Q_DECLARE_TR_FUNCTIONS( Utils)47 Q_DECLARE_TR_FUNCTIONS(Phonon::MMF) 48 48 49 49 public: -
trunk/src/3rdparty/phonon/mmf/videooutput.h
r561 r651 25 25 #include "defs.h" 26 26 27 #include < Phonon/videowidget.h>27 #include <phonon/videowidget.h> 28 28 29 29 #include <e32std.h> -
trunk/src/3rdparty/phonon/mmf/videowidget.h
r561 r651 24 24 25 25 #include <QtGui/QWidget> 26 #include < Phonon/videowidget.h>27 #include < Phonon/videowidgetinterface.h>26 #include <phonon/videowidget.h> 27 #include <phonon/videowidgetinterface.h> 28 28 29 29 QT_BEGIN_NAMESPACE -
trunk/src/3rdparty/phonon/phonon/effectwidget.cpp
r561 r651 16 16 Lesser General Public License for more details. 17 17 18 You should have received a copy of the GNU Lesser General Public 18 You should have received a copy of the GNU Lesser General Public 19 19 License along with this library. If not, see <http://www.gnu.org/licenses/>. 20 20 … … 152 152 bool maxValueOk = false; 153 153 const int minValue = para.minimumValue().toInt(&minValueOk); 154 const int maxValue = para.m inimumValue().toInt(&maxValueOk);154 const int maxValue = para.maximumValue().toInt(&maxValueOk); 155 155 156 156 sb->setRange(minValueOk ? minValue : DEFAULT_MIN_INT, maxValueOk ? maxValue : DEFAULT_MAX_INT); -
trunk/src/3rdparty/webkit/JavaScriptCore/ChangeLog
r561 r651 10 10 (OpaqueJSClass::OpaqueJSClass): 11 11 (OpaqueJSClassContextData::OpaqueJSClassContextData): 12 13 2010-01-07 Norbert Leser <norbert.leser@nokia.com>14 15 Reviewed by NOBODY (OOPS!).16 17 Added time-based optimization and increased optimization level to O3,18 conditionally for COMPILER(RVCT),19 for increasing performance of JavaScript execution.20 (Default settings are Ospace and O2)21 22 * runtime/Structure.h:23 12 24 13 2009-11-19 Thiago Macieira <thiago.macieira@nokia.com> -
trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
r561 r651 46 46 #endif 47 47 48 #if COMPILER(RVCT)49 #pragma arm50 #pragma Otime51 #pragma O352 #endif53 54 48 namespace JSC { 55 49 -
trunk/src/3rdparty/webkit/VERSION
r561 r651 9 9 and has the sha1 checksum 10 10 11 8f6992f4e8f027818429d428393b08068eca9ffa11 69dd29fbeb12d076741dce70ac6bc155101ccd6f -
trunk/src/3rdparty/webkit/WebCore/ChangeLog
r561 r651 1 2010-02-01 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Use the fallback style on Maemo 5 6 7 https://bugs.webkit.org/show_bug.cgi?id=34376 8 9 * platform/qt/RenderThemeQt.cpp: 10 (WebCore::RenderThemeQt::RenderThemeQt): 11 (WebCore::RenderThemeQt::fallbackStyle): 12 (WebCore::RenderThemeQt::qStyle): 13 (WebCore::RenderThemeQt::setPaletteFromPageClientIfExists): 14 * platform/qt/RenderThemeQt.h: 15 16 2010-01-29 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> 17 18 Reviewed by Simon Hausmann. 19 20 [Qt] Speed up the WebCore::String -> QString conversion 21 22 Use QString(const QChar *, int len) constructor instead of QString::fromUtf16 to 23 avoid BOM checks and byteswapping. 24 25 * bridge/qt/qt_class.cpp: 26 (JSC::Bindings::QtClass::fieldNamed): 27 * bridge/qt/qt_runtime.cpp: 28 (JSC::Bindings::convertValueToQVariant): 29 30 2010-01-14 Andreas Kling <andreas.kling@nokia.com> 31 32 Reviewed by Kenneth Rohde Christiansen. 33 34 [Qt] Enable scrolling optimization for pages with embedded widgets 35 36 https://bugs.webkit.org/show_bug.cgi?id=33373 37 38 Added a basic manual test for scrolling of embedded QWidgets. 39 40 * manual-tests/qt/qtplugin-scrolling.html: Added. 41 * platform/ScrollView.cpp: 42 (WebCore::ScrollView::scrollContents): 43 (WebCore::ScrollView::setParent): 44 * platform/ScrollView.h: 45 * platform/qt/ScrollViewQt.cpp: 46 (WebCore::ScrollView::platformInit): 47 (WebCore::ScrollView::platformAddChild): 48 (WebCore::ScrollView::platformRemoveChild): 49 * plugins/qt/PluginViewQt.cpp: 50 (WebCore::PluginView::updatePluginWidget): 51 (WebCore::PluginView::invalidateRect): 52 53 2010-01-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> 54 55 Reviewed by Simon Hausmann. 56 57 [Qt] Turn off websocket support by default for Qt 4.6.x 58 https://bugs.webkit.org/show_bug.cgi?id=34284 59 60 * WebCore.pro: 61 62 2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> 63 64 Reviewed by Simon Hausmann. 65 66 [Qt] JavaScript prompt is currently broken. 67 https://bugs.webkit.org/show_bug.cgi?id=30914 68 69 Remove the manual test case in favor of an automated 70 test case in WebKit/qt/tests/qwebpage. 71 72 * manual-tests/qt/java-script-prompt.html: Removed. 73 74 2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com> 75 76 Reviewed by Simon Hausmann. 77 78 [Qt] Phone backup support for QtWebkit for Symbian devices. 79 https://bugs.webkit.org/show_bug.cgi?id=34077 80 81 * WebCore.pro: 82 83 2010-01-21 Thiago Macieira <thiago.macieira@nokia.com> 84 85 Reviewed by Simon Hausmann. 86 87 [Qt] Fix incorrect dependency to QtXmlPatterns in generated include/QtWebKit/QtWebKit header 88 89 The generated file includes QtXmlPatterns/QtXmlPatterns, which is neither used/required by 90 the public QtWebKit API nor will it be available if Qt is configured with -no-xmlpatterns. 91 92 * WebCore.pro: Trick syncqt to believe that xmlpatterns is not a dependency, so that it's not 93 included in the generated file. It'll still be used and linked to with this trick. 94 95 2010-01-17 Srinidhi Shreedhara <srinidhi.shreedhara@nokia.com> 96 97 Reviewed by Simon Hausmann. 98 99 [Qt] [Symbian] SetWindow call in npapi plugin does not happen when the cooridnates are negative 100 https://bugs.webkit.org/show_bug.cgi?id=33573 101 102 * plugins/symbian/PluginViewSymbian.cpp: 103 (WebCore::PluginView::setNPWindowIfNeeded): Remove tests for negative 104 coordinates for early return. 105 106 2010-01-14 Norbert Leser <norbert.leser@nokia.com> 107 108 Reviewed by Laszlo Gombos. 109 110 Platform Symbian specific: 111 Added time-based optimization (-Otime) and increased optimization level to -O3, 112 conditionally for RVCT compiler (for ARM), for increasing performance 113 (primarily affecting JavaScript execution). 114 Default settings are -Ospace and -O2. 115 116 No new tests needed because no new funtionality is introduced, 117 only potential regression on existing tests needs to be evaluated. 118 119 * WebCore.pro: 120 121 2010-01-13 Girish Ramakrishnan <girish@forwardbias.in> 122 123 Reviewed by Simon Hausmann. 124 125 [Qt/Win] Flash in QGraphicsWebView does not process hover correctly. 126 127 https://bugs.webkit.org/show_bug.cgi?id=33591 128 129 Mouse hover does not work as expected with the flash in some sites. 130 - http://www.bbc.co.uk/ Hover over the map 131 - http://www.barbie.com/ Hover over the menu items (Games, Videos) 132 The problem appears to be that Flash queries NPNVnetscapeWindow on every 133 mouse hover. I do not how flash uses this value but returning 0 when flash 134 is in windowless mode solves the problem (When using QGraphicsWebView we 135 inject wmode opaque, thereby putting the plugin in windowless mode). 136 137 * plugins/win/PluginViewWin.cpp: 138 (windowHandleForPageClient): 139 1 140 2010-01-13 Miikka Heikkinen <miikka.heikkinen@digia.com> 2 141 -
trunk/src/3rdparty/webkit/WebCore/WebCore.pro
r637 r651 7 7 TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB 8 8 TARGET.CAPABILITY = All -Tcb 9 TARGET.UID3 = 0x200267C2 9 10 10 11 webkitlibs.sources = QtWebKit.dll … … 19 20 webkitlibs.pkg_prerules = vendorinfo 20 21 21 DEPLOYMENT += webkitlibs 22 23 TARGET.UID3 = 0x200267C2 22 webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml 23 webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) 24 25 DEPLOYMENT += webkitlibs webkitbackup 26 24 27 # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target. 25 28 # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. 26 MMP_RULES += "LINKEROPTION armcc --rw-base 0xE00000"29 QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000 27 30 } 28 31 … … 183 186 184 187 # Web Socket support. 185 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS= 1188 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=0 186 189 187 190 # XSLT support with QtXmlPatterns … … 2780 2783 FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1 2781 2784 2782 QT += xmlpatterns2785 tobe|!tobe: QT += xmlpatterns 2783 2786 2784 2787 SOURCES += \ … … 3415 3418 symbian { 3416 3419 shared { 3417 contains(MMP_RULES, defBlock) { 3418 MMP_RULES -= defBlock 3419 3420 MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" \ 3421 "DEFFILE ../WebKit/qt/symbian/bwins/$${TARGET}.def" \ 3422 "$${LITERAL_HASH}elif defined EABI" \ 3423 "DEFFILE ../WebKit/qt/symbian/eabi/$${TARGET}.def" \ 3424 "$${LITERAL_HASH}endif" 3420 contains(CONFIG, def_files) { 3421 defFilePath=../WebKit/qt/symbian 3425 3422 } 3426 3423 } -
trunk/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp
r561 r651 128 128 QObject* obj = qtinst->getObject(); 129 129 UString ustring = identifier.ustring(); 130 QString objName( QString::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size()));130 QString objName((const QChar*)ustring.rep()->data(), ustring.size()); 131 131 QByteArray ba = objName.toAscii(); 132 132 -
trunk/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
r561 r651 306 306 } else { 307 307 UString ustring = value.toString(exec); 308 ret = QVariant(QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size()));308 ret = QVariant(QString((const QChar*)ustring.rep()->data(), ustring.size())); 309 309 if (type == String) 310 310 dist = 0; … … 330 330 if (objdist >= 0) { 331 331 UString ustring = (*it).ustring(); 332 QString id = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());332 QString id = QString((const QChar*)ustring.rep()->data(), ustring.size()); 333 333 result.insert(id, v); 334 334 } … … 405 405 JSValue val = rtarray->getConcreteArray()->valueAt(exec, i); 406 406 UString ustring = val.toString(exec); 407 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());407 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 408 408 409 409 result.append(qstring); … … 419 419 JSValue val = array->get(exec, i); 420 420 UString ustring = val.toString(exec); 421 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());421 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 422 422 423 423 result.append(qstring); … … 428 428 // Make a single length array 429 429 UString ustring = value.toString(exec); 430 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());430 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 431 431 QStringList result; 432 432 result.append(qstring); … … 444 444 } else { 445 445 UString ustring = value.toString(exec); 446 ret = QVariant(QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size()).toLatin1());446 ret = QVariant(QString((const QChar*)ustring.rep()->data(), ustring.size()).toLatin1()); 447 447 if (type == String) 448 448 dist = 5; … … 486 486 } else if (type == String) { 487 487 UString ustring = value.toString(exec); 488 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());488 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 489 489 490 490 if (hint == QMetaType::QDateTime) { … … 535 535 // Attempt to convert.. a bit risky 536 536 UString ustring = value.toString(exec); 537 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());537 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 538 538 539 539 // this is of the form '/xxxxxx/i' … … 555 555 } else if (type == String) { 556 556 UString ustring = value.toString(exec); 557 QString qstring = QString ::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());557 QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size()); 558 558 559 559 QRegExp re(qstring); -
trunk/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
r561 r651 217 217 #include "JSWebKitPoint.h" 218 218 #include "JSWebKitTransitionEvent.h" 219 #include "JSWebSocket.h"220 219 #include "JSWheelEvent.h" 221 220 #include "JSWorker.h" … … 248 247 /* Hash table */ 249 248 250 static const HashTableValue JSDOMWindowTableValues[29 7] =249 static const HashTableValue JSDOMWindowTableValues[296] = 251 250 { 252 251 { "screen", DontDelete|ReadOnly, (intptr_t)jsDOMWindowScreen, (intptr_t)0 }, … … 541 540 { "Worker", DontDelete, (intptr_t)jsDOMWindowWorkerConstructor, (intptr_t)setJSDOMWindowWorkerConstructor }, 542 541 { "SharedWorker", DontDelete, (intptr_t)jsDOMWindowSharedWorkerConstructor, (intptr_t)setJSDOMWindowSharedWorkerConstructor }, 543 { "WebSocket", DontDelete, (intptr_t)jsDOMWindowWebSocketConstructor, (intptr_t)setJSDOMWindowWebSocketConstructor },544 542 { "Plugin", DontDelete, (intptr_t)jsDOMWindowPluginConstructor, (intptr_t)setJSDOMWindowPluginConstructor }, 545 543 { "PluginArray", DontDelete, (intptr_t)jsDOMWindowPluginArrayConstructor, (intptr_t)setJSDOMWindowPluginArrayConstructor }, … … 589 587 { 65535, JSDOMWindowTableValues, 0 }; 590 588 #else 591 { 106 8, 1023, JSDOMWindowTableValues, 0 };589 { 1067, 1023, JSDOMWindowTableValues, 0 }; 592 590 #endif 593 591 … … 3276 3274 } 3277 3275 3278 JSValue jsDOMWindowWebSocketConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)3279 {3280 JSDOMWindow* castedThis = static_cast<JSDOMWindow*>(asObject(slot.slotBase()));3281 if (!castedThis->allowsAccessFrom(exec))3282 return jsUndefined();3283 return castedThis->webSocket(exec);3284 }3285 3286 3276 JSValue jsDOMWindowPluginConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot) 3287 3277 { … … 5677 5667 // Shadowing a built-in constructor 5678 5668 static_cast<JSDOMWindow*>(thisObject)->putDirect(Identifier(exec, "SharedWorker"), value); 5679 }5680 5681 void setJSDOMWindowWebSocketConstructor(ExecState* exec, JSObject* thisObject, JSValue value)5682 {5683 if (!static_cast<JSDOMWindow*>(thisObject)->allowsAccessFrom(exec))5684 return;5685 // Shadowing a built-in constructor5686 static_cast<JSDOMWindow*>(thisObject)->putDirect(Identifier(exec, "WebSocket"), value);5687 5669 } 5688 5670 -
trunk/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
r561 r651 83 83 JSC::JSValue worker(JSC::ExecState*) const; 84 84 JSC::JSValue sharedWorker(JSC::ExecState*) const; 85 JSC::JSValue webSocket(JSC::ExecState*) const;86 85 JSC::JSValue audio(JSC::ExecState*) const; 87 86 … … 680 679 JSC::JSValue jsDOMWindowSharedWorkerConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); 681 680 void setJSDOMWindowSharedWorkerConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); 682 JSC::JSValue jsDOMWindowWebSocketConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);683 void setJSDOMWindowWebSocketConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);684 681 JSC::JSValue jsDOMWindowPluginConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); 685 682 void setJSDOMWindowPluginConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); -
trunk/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
r561 r651 45 45 class QWebPopup; 46 46 } 47 QT_BEGIN_NAMESPACE 48 class QGraphicsProxyWidget; 49 QT_END_NAMESPACE 47 50 #elif PLATFORM(GTK) 48 51 typedef struct _GtkMenu GtkMenu; … … 148 151 void populate(const IntRect&); 149 152 QWebPopup* m_popup; 153 QGraphicsProxyWidget* m_proxy; 150 154 #elif PLATFORM(WIN) 151 155 // ScrollBarClient -
trunk/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
r561 r651 508 508 } 509 509 510 if (canBlitOnScroll() && !rootPreventsBlitting()) { // The main frame can just blit the WebView window510 if (canBlitOnScroll()) { // The main frame can just blit the WebView window 511 511 // FIXME: Find a way to blit subframes without blitting overlapping content 512 512 hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect); … … 597 597 if (m_scrollbarsAvoidingResizer && parent()) 598 598 parent()->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer); 599 600 #if PLATFORM(QT)601 if (m_widgetsPreventingBlitting && parent())602 parent()->adjustWidgetsPreventingBlittingCount(-m_widgetsPreventingBlitting);603 604 if (m_widgetsPreventingBlitting && parentView)605 parentView->adjustWidgetsPreventingBlittingCount(m_widgetsPreventingBlitting);606 #endif607 599 608 600 Widget::setParent(parentView); -
trunk/src/3rdparty/webkit/WebCore/platform/ScrollView.h
r561 r651 306 306 #endif 307 307 308 #if PLATFORM(QT)309 public:310 void adjustWidgetsPreventingBlittingCount(int delta);311 private:312 bool rootPreventsBlitting() const { return root()->m_widgetsPreventingBlitting > 0; }313 unsigned m_widgetsPreventingBlitting;314 #else315 bool rootPreventsBlitting() const { return false; }316 #endif317 318 308 #if PLATFORM(GTK) 319 309 public: -
trunk/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
r561 r651 2 2 * This file is part of the popup menu implementation for <select> elements in WebCore. 3 3 * 4 * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 5 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 5 6 * Copyright (C) 2006 Apple Computer, Inc. … … 36 37 #include <QAction> 37 38 #include <QDebug> 39 #include <QGraphicsProxyWidget> 40 #include <QGraphicsScene> 41 #include <QGraphicsView> 42 #include <QGraphicsWebView> 38 43 #include <QListWidget> 39 44 #include <QListWidgetItem> … … 47 52 PopupMenu::PopupMenu(PopupMenuClient* client) 48 53 : m_popupClient(client) 54 , m_proxy(0) 49 55 { 50 56 m_popup = new QWebPopup(client); … … 53 59 PopupMenu::~PopupMenu() 54 60 { 55 delete m_popup; 61 // If we create a proxy, then the deletion of the proxy and the 62 // combo will be done by the proxy's parent (QGraphicsWebView) 63 if (!m_proxy) 64 delete m_popup; 56 65 } 57 66 … … 93 102 rect.setHeight(m_popup->sizeHint().height()); 94 103 95 m_popup->setParent(client->ownerWidget()); 96 m_popup->setGeometry(rect); 104 if (QGraphicsView* view = qobject_cast<QGraphicsView*>(client->ownerWidget())) { 105 if (!m_proxy) { 106 m_proxy = new QGraphicsProxyWidget(qobject_cast<QGraphicsWebView*>(client->pluginParent())); 107 m_proxy->setWidget(m_popup); 108 } else 109 m_proxy->setVisible(true); 110 m_proxy->setGeometry(rect); 111 } else { 112 m_popup->setParent(client->ownerWidget()); 113 m_popup->setGeometry(rect); 114 } 115 97 116 m_popup->setCurrentIndex(index); 98 117 m_popup->exec(); -
trunk/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
r637 r651 27 27 #include <QInputContext> 28 28 #include <QMouseEvent> 29 #include <QGraphicsProxyWidget> 29 30 30 31 namespace WebCore { … … 36 37 Q_ASSERT(m_client); 37 38 39 #if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5) 38 40 setFont(m_client->menuStyle().font().font()); 41 #endif 39 42 connect(this, SIGNAL(activated(int)), 40 43 SLOT(activeChanged(int)), Qt::QueuedConnection); … … 44 47 void QWebPopup::exec() 45 48 { 49 // QCursor::pos() is not a great idea for a touch screen, but we don't need the coordinates 50 // as comboboxes with Qt on Maemo 5 come up in their full width on the screen. 51 // On the other platforms it's okay to use QCursor::pos(). 52 #if defined(Q_WS_MAEMO_5) 53 showPopup(); 54 #else 46 55 QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton, 47 56 Qt::LeftButton, Qt::NoModifier); 48 57 QCoreApplication::sendEvent(this, &event); 58 #endif 49 59 } 50 60 … … 70 80 71 81 QComboBox::hidePopup(); 82 83 if (QGraphicsProxyWidget* proxy = graphicsProxyWidget()) 84 proxy->setVisible(false); 85 72 86 if (!m_popupVisible) 73 87 return; -
trunk/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
r561 r651 126 126 : RenderTheme() 127 127 , m_page(page) 128 , m_fallbackStyle(0)129 128 { 130 129 QPushButton button; … … 136 135 m_buttonFontPixelSize = fontInfo.pixelSize(); 137 136 #endif 137 138 m_fallbackStyle = QStyleFactory::create(QLatin1String("windows")); 138 139 } 139 140 … … 144 145 145 146 // for some widget painting, we need to fallback to Windows style 146 QStyle* RenderThemeQt::fallbackStyle() 147 { 148 if (!m_fallbackStyle) 149 m_fallbackStyle = QStyleFactory::create(QLatin1String("windows")); 150 151 if (!m_fallbackStyle) 152 m_fallbackStyle = QApplication::style(); 153 154 return m_fallbackStyle; 147 QStyle* RenderThemeQt::fallbackStyle() const 148 { 149 return (m_fallbackStyle) ? m_fallbackStyle : QApplication::style(); 155 150 } 156 151 157 152 QStyle* RenderThemeQt::qStyle() const 158 153 { 154 #ifdef Q_WS_MAEMO_5 155 return fallbackStyle(); 156 #endif 157 159 158 if (m_page) { 160 159 ChromeClientQt* client = static_cast<ChromeClientQt*>(m_page->chrome()->client()); … … 759 758 option.state |= (isChecked(o) ? QStyle::State_On : QStyle::State_Off); 760 759 760 #ifdef Q_WS_MAEMO_5 761 static QPalette lightGrayPalette(Qt::lightGray); 762 option.palette = lightGrayPalette; 763 #else 761 764 // If the owner widget has a custom palette, use it 762 765 Page* page = o->document()->page(); … … 767 770 option.palette = pageClient->palette(); 768 771 } 772 #endif 769 773 770 774 return result; -
trunk/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
r561 r651 139 139 140 140 QStyle* qStyle() const; 141 QStyle* fallbackStyle() ;141 QStyle* fallbackStyle() const; 142 142 143 143 Page* m_page; -
trunk/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
r561 r651 37 37 void ScrollView::platformInit() 38 38 { 39 m_widgetsPreventingBlitting = 0;40 39 } 41 40 … … 44 43 } 45 44 46 // Windowed plugins are using native windows and are thus preventing47 // us from doing any kind of scrolling optimization.48 49 void ScrollView::adjustWidgetsPreventingBlittingCount(int delta)50 {51 m_widgetsPreventingBlitting += delta;52 if (parent())53 parent()->adjustWidgetsPreventingBlittingCount(delta);54 }55 56 45 void ScrollView::platformAddChild(Widget*) 57 46 { 58 adjustWidgetsPreventingBlittingCount(1);59 47 } 60 48 … … 62 50 { 63 51 child->hide(); 64 adjustWidgetsPreventingBlittingCount(-1);65 52 } 66 53 -
trunk/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
r561 r651 127 127 if (!m_windowRect.intersects(frameView->frameRect())) 128 128 setNPWindowIfNeeded(); 129 130 // Make sure we get repainted afterwards. This is necessary for downward 131 // scrolling to move the plugin widget properly. 132 invalidate(); 129 133 } 130 134 … … 658 662 { 659 663 if (m_isWindowed) { 660 platformWidget()->update(rect); 664 if (platformWidget()) 665 platformWidget()->update(rect); 661 666 return; 662 667 } -
trunk/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
r561 r651 281 281 m_npWindow.width = m_windowRect.width(); 282 282 m_npWindow.height = m_windowRect.height(); 283 if (m_npWindow.x < 0 || m_npWindow.y < 0 || m_npWindow.width <= 0 || m_npWindow.height <= 0)284 return;285 283 286 284 PluginView::setCurrentPluginView(this); -
trunk/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
r561 r651 87 87 if (!client) 88 88 return 0; 89 return client->ownerWidget()->winId(); 89 if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent())) 90 return pluginParent->winId(); 91 return 0; 90 92 #else 91 93 return client; -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
r561 r651 1370 1370 fromPage = qMax(1, fromPage); 1371 1371 toPage = qMin(printContext.pageCount(), toPage); 1372 if (toPage < fromPage) { 1373 // if the user entered a page range outside the actual number 1374 // of printable pages, just return 1375 return; 1376 } 1372 1377 1373 1378 if (printer->pageOrder() == QPrinter::LastPageFirst) { -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
r561 r651 1709 1709 if (loader) 1710 1710 loader->detachFromParent(); 1711 if (d->inspector) 1712 d->inspector->setPage(0); 1711 if (d->inspector) { 1712 // Since we have to delete an internal inspector, 1713 // call setInspector(0) directly to prevent potential crashes 1714 if (d->inspectorIsInternalOnly) 1715 d->setInspector(0); 1716 else 1717 d->inspector->setPage(0); 1718 } 1713 1719 delete d; 1714 1720 } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
r561 r651 57 57 view->setPage(0); 58 58 } 59 60 #ifdef Q_WS_MAEMO_5 61 #include "qabstractkineticscroller.h" 62 63 class QWebViewKineticScroller : public QAbstractKineticScroller { 64 public: 65 QWebViewKineticScroller() : QAbstractKineticScroller() {} 66 // remember the frame where the button was pressed 67 bool eventFilter(QObject* o, QEvent* ev) 68 { 69 switch (ev->type()) { 70 case QEvent::MouseButtonPress: { 71 QWebFrame* hitFrame = scrollingFrameAt(static_cast<QMouseEvent*>(ev)->pos()); 72 if (hitFrame) 73 m_frame = hitFrame; 74 break; 75 } 76 default: 77 break; 78 } 79 return QAbstractKineticScroller::eventFilter(o, ev); 80 } 81 82 protected: 83 QWebFrame* currentFrame() const 84 { 85 if (!m_frame.isNull()) 86 return m_frame.data(); 87 88 QWebView* view = static_cast<QWebView*>(widget()); 89 QWebFrame* frame = view->page()->mainFrame(); 90 return frame; 91 } 92 93 // Returns the innermost frame at the given position that can scroll. 94 QWebFrame* scrollingFrameAt(const QPoint& pos) const 95 { 96 QWebView* view = static_cast<QWebView*>(widget()); 97 QWebFrame* mainFrame = view->page()->mainFrame(); 98 QWebFrame* hitFrame = mainFrame->hitTestContent(pos).frame(); 99 QSize range = hitFrame->contentsSize() - hitFrame->geometry().size(); 100 101 while (hitFrame && range.width() <= 1 && range.height() <= 1) 102 hitFrame = hitFrame->parentFrame(); 103 104 return hitFrame; 105 } 106 107 void attachToWidget() 108 { 109 QWebView* view = static_cast<QWebView*>(widget()); 110 QWebFrame* mainFrame = view->page()->mainFrame(); 111 m_oldHorizontalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Horizontal); 112 m_oldVerticalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Vertical); 113 mainFrame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); 114 mainFrame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); 115 view->installEventFilter(this); 116 } 117 118 void removeFromWidget() 119 { 120 QWebView* view = static_cast<QWebView*>(widget()); 121 view->removeEventFilter(this); 122 QWebFrame* mainFrame = view->page()->mainFrame(); 123 mainFrame->setScrollBarPolicy(Qt::Vertical, m_oldVerticalScrollBarPolicy); 124 mainFrame->setScrollBarPolicy(Qt::Horizontal, m_oldHorizontalScrollBarPolicy); 125 } 126 127 QRect positionRange() const 128 { 129 QRect r; 130 QWebFrame* frame = currentFrame(); 131 r.setSize(frame->contentsSize() - frame->geometry().size()); 132 return r; 133 } 134 135 QPoint position() const 136 { 137 QWebFrame* frame = currentFrame(); 138 return frame->scrollPosition(); 139 } 140 141 QSize viewportSize() const 142 { 143 return static_cast<QWebView*>(widget())->page()->viewportSize(); 144 } 145 146 void setPosition(const QPoint& point, const QPoint& /* overShootDelta */) 147 { 148 QWebFrame* frame = currentFrame(); 149 frame->setScrollPosition(point); 150 } 151 152 QPointer<QWebFrame> m_frame; 153 Qt::ScrollBarPolicy m_oldVerticalScrollBarPolicy; 154 Qt::ScrollBarPolicy m_oldHorizontalScrollBarPolicy; 155 }; 156 157 #endif // Q_WS_MAEMO_5 158 59 159 60 160 /*! … … 154 254 #endif 155 255 256 #if defined(Q_WS_MAEMO_5) 257 QAbstractKineticScroller* scroller = new QWebViewKineticScroller(); 258 scroller->setWidget(this); 259 #endif 156 260 setAcceptDrops(true); 157 261 -
trunk/src/3rdparty/webkit/WebKit/qt/ChangeLog
r561 r651 1 2010-01-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Reviewed by Simon Hausmann. 4 5 Do not set the combobox font on Maemo5 and S60; use the 6 default instead. 7 8 * WebCoreSupport/QtFallbackWebPopup.cpp: 9 (WebCore::QtFallbackWebPopup::populate): 10 11 2010-01-28 Andreas Kling <andreas.kling@nokia.com> 12 13 Reviewed by Kenneth Rohde Christiansen. 14 15 [Qt] Support kinetic scrolling on Maemo 5 16 17 https://bugs.webkit.org/show_bug.cgi?id=34267 18 19 Patch by Ralf Engels <ralf.engels@nokia.com> and 20 Robert Griebl <rgriebl@trolltech.com> 21 22 * Api/qwebview.cpp: 23 (QWebViewKineticScroller::QWebViewKineticScroller): 24 (QWebViewKineticScroller::eventFilter): 25 (QWebViewKineticScroller::currentFrame): 26 (QWebViewKineticScroller::scrollingFrameAt): 27 (QWebViewKineticScroller::attachToWidget): 28 (QWebViewKineticScroller::removeFromWidget): 29 (QWebViewKineticScroller::positionRange): 30 (QWebViewKineticScroller::position): 31 (QWebViewKineticScroller::viewportSize): 32 (QWebViewKineticScroller::setPosition): 33 (QWebView::QWebView): 34 35 2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 36 37 Reviewed by Simon Hausmann 38 39 Disable auto-uppercase and predictive text on Maemo5, just like the 40 build-in MicroB Browser. 41 42 * WebCoreSupport/EditorClientQt.cpp: 43 (WebCore::EditorClientQt::setInputMethodState): 44 45 2010-01-28 Trond Kjernåsen <trond@trolltech.com> 46 47 Reviewed by Simon Hausmann. 48 49 [Qt] Fix for endless print loop when printing web pages 50 51 * Api/qwebframe.cpp: 52 (QWebFrame::print): 53 54 2010-01-26 Simon Hausmann <simon.hausmann@nokia.com> 55 56 Reviewed by Kenneth Rohde Christiansen. 57 58 [Qt] Show comboboxes on Maemo 5 59 https://bugs.webkit.org/show_bug.cgi?id=34088 60 61 Don't try to show the combobox by simulating a mouse event from QCursor::pos() to 62 get the combobox position right. The position on Maemo 5 is independent from the mouse 63 and there's no QCursor::pos(). 64 65 * WebCoreSupport/QtFallbackWebPopup.cpp: 66 (WebCore::QtFallbackWebPopup::show): 67 68 2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> 69 70 Reviewed by Simon Hausmann. 71 72 [Qt] JavaScript prompt is currently broken 73 https://bugs.webkit.org/show_bug.cgi?id=30914 74 75 In r52152 a patch was landed to convert a null QString 76 to an empty WebCore::String in case the prompt was accepted 77 but the default implementation returned the null QString. 78 79 The patch tried to avoid assign to result twice and 80 was not checking the QString if it is null but the default 81 value. This lead to always returning an empty string on 82 successful prompts. Fix it by checking the variable 'x' 83 for isNull. 84 85 The manual test case used didn't cover the case of non 86 empty input, replace it with an automatic test case that 87 should cover all cases. 88 89 * WebCoreSupport/ChromeClientQt.cpp: 90 (WebCore::ChromeClientQt::runJavaScriptPrompt): Fix the bug. 91 * tests/qwebpage/tst_qwebpage.cpp: Add automatic test case 92 (JSPromptPage::JSPromptPage): 93 (JSPromptPage::javaScriptPrompt): 94 (tst_QWebPage::testJSPrompt): 95 96 2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com> 97 98 Reviewed by Simon Hausmann. 99 100 [Qt] Phone backup support for QtWebkit for Symbian devices. 101 https://bugs.webkit.org/show_bug.cgi?id=34077 102 103 * symbian/backup_registration.xml: Added. 104 105 2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 106 107 Reviewed by Kenneth Rohde Christiansen. 108 109 [Qt] Fix QWebInspector destruction problem. 110 https://bugs.webkit.org/show_bug.cgi?id=31664 111 112 * Api/qwebpage.cpp: 113 (QWebPage::~QWebPage): 114 1 115 2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> 2 116 -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r561 r651 282 282 // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty 283 283 // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914. 284 if (rc && result.isNull())284 if (rc && x.isNull()) 285 285 result = String(""); 286 286 else -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r561 r651 616 616 } 617 617 webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); 618 #endif 618 #ifdef Q_WS_MAEMO_5 619 // Maemo 5 MicroB Browser disables auto-uppercase and predictive text, thus, so do we. 620 webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true); 621 webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true); 622 #endif // Q_WS_MAEMO_5 623 #endif // QT_VERSION check 619 624 webPageClient->setInputMethodEnabled(active); 620 625 } -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r561 r651 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 Copyright (C) 2010 Holger Hans Peter Freyther 4 5 5 6 This library is free software; you can redistribute it and/or … … 155 156 156 157 void originatingObjectInNetworkRequests(); 158 void testJSPrompt(); 157 159 158 160 private: … … 1782 1784 } 1783 1785 1786 /** 1787 * Test fixups for https://bugs.webkit.org/show_bug.cgi?id=30914 1788 * 1789 * From JS we test the following conditions. 1790 * 1791 * OK + QString() => SUCCESS, empty string (but not null) 1792 * OK + "text" => SUCCESS, "text" 1793 * CANCEL + QString() => CANCEL, null string 1794 * CANCEL + "text" => CANCEL, null string 1795 */ 1796 class JSPromptPage : public QWebPage { 1797 Q_OBJECT 1798 public: 1799 JSPromptPage() 1800 {} 1801 1802 bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result) 1803 { 1804 if (msg == QLatin1String("test1")) { 1805 *result = QString(); 1806 return true; 1807 } else if (msg == QLatin1String("test2")) { 1808 *result = QLatin1String("text"); 1809 return true; 1810 } else if (msg == QLatin1String("test3")) { 1811 *result = QString(); 1812 return false; 1813 } else if (msg == QLatin1String("test4")) { 1814 *result = QLatin1String("text"); 1815 return false; 1816 } 1817 1818 qFatal("Unknown msg."); 1819 return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result); 1820 } 1821 }; 1822 1823 void tst_QWebPage::testJSPrompt() 1824 { 1825 JSPromptPage page; 1826 bool res; 1827 1828 // OK + QString() 1829 res = page.mainFrame()->evaluateJavaScript( 1830 "var retval = prompt('test1');" 1831 "retval=='' && retval.length == 0;").toBool(); 1832 QVERIFY(res); 1833 1834 // OK + "text" 1835 res = page.mainFrame()->evaluateJavaScript( 1836 "var retval = prompt('test2');" 1837 "retval=='text' && retval.length == 4;").toBool(); 1838 QVERIFY(res); 1839 1840 // Cancel + QString() 1841 res = page.mainFrame()->evaluateJavaScript( 1842 "var retval = prompt('test3');" 1843 "retval===null;").toBool(); 1844 QVERIFY(res); 1845 1846 // Cancel + "text" 1847 res = page.mainFrame()->evaluateJavaScript( 1848 "var retval = prompt('test4');" 1849 "retval===null;").toBool(); 1850 QVERIFY(res); 1851 } 1852 1784 1853 QTEST_MAIN(tst_QWebPage) 1785 1854 #include "tst_qwebpage.moc"
Note:
See TracChangeset
for help on using the changeset viewer.