Changeset 651 for trunk/src/3rdparty


Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
46 edited
11 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp

    r561 r651  
    3838AbstractAudioEffect::AbstractAudioEffect(QObject *parent,
    3939                                         const QList<EffectParameter> &params)
    40     :   MediaNode::MediaNode(parent)
     40    :   MediaNode(parent)
     41    ,   m_params(params)
    4142    ,   m_player(0)
    42     ,   m_params(params)
    4343{
     44
    4445}
    4546
    46 QList<EffectParameter> AbstractAudioEffect::parameters() const
     47QList<Phonon::EffectParameter> AbstractAudioEffect::parameters() const
    4748{
    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;
    4955}
    5056
    51 QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam) const
     57QVariant AbstractAudioEffect::parameterValue(const Phonon::EffectParameter &queriedParam) const
    5258{
    5359    const QVariant &val = m_values.value(queriedParam.id());
     
    5965}
    6066
    61 void AbstractAudioEffect::setParameterValue(const EffectParameter &param,
     67void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter &param,
    6268                                            const QVariant &newValue)
    6369{
    6470    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
     80void AbstractAudioEffect::abstractPlayerChanged(AbstractPlayer *player)
     81{
     82    m_player = qobject_cast<AbstractMediaPlayer *>(player);
     83    m_effect.reset();
     84}
     85
     86void AbstractAudioEffect::stateChanged(Phonon::State newState,
     87                                       Phonon::State oldState)
     88{
     89    if (Phonon::LoadingState == oldState
     90        && Phonon::LoadingState != newState)
     91        createEffect();
    6892}
    6993
     
    7397    Q_ASSERT_X(!m_effect.data(), Q_FUNC_INFO, "Effect already created");
    7498
    75     AbstractMediaPlayer *const player =
    76         qobject_cast<AbstractMediaPlayer *>(mediaObject->abstractPlayer());
     99    abstractPlayerChanged(mediaObject->abstractPlayer());
    77100
    78     if (player) {
    79         m_player = player;
     101    connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
     102            SLOT(stateChanged(Phonon::State, Phonon::State)));
    80103
    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
     111void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject)
     112{
     113    mediaObject->disconnect(this);
     114    abstractPlayerChanged(0);
     115}
     116
     117void 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
     131void 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);
    86145        }
     146        Q_UNUSED(err)
    87147    }
    88148}
    89149
    90 void AbstractAudioEffect::disconnectMediaObject(MediaObject * /*mediaObject*/)
     150const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const
    91151{
    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;
    94159}
     160
     161int AbstractAudioEffect::parameterChanged(const EffectParameter &param,
     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
     184int AbstractAudioEffect::effectParameterChanged(
     185    const EffectParameter &param, const QVariant &value)
     186{
     187    // Default implementation
     188    Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters");
     189    return 0;
     190}
     191
    95192
    96193QT_END_NAMESPACE
  • trunk/src/3rdparty/phonon/mmf/abstractaudioeffect.h

    r561 r651  
    2424#include <AudioEffectBase.h>
    2525
    26 #include <Phonon/effectinterface.h>
    27 #include <Phonon/effectparameter.h>
     26#include <phonon/effectinterface.h>
    2827
    2928#include "audioplayer.h"
     29#include "effectparameter.h"
    3030#include "mmf_medianode.h"
    3131#include "mmf_videoplayer.h"
     32
     33class CMdaAudioOutputStream;
    3234
    3335QT_BEGIN_NAMESPACE
     
    3739namespace MMF
    3840{
     41class AbstractPlayer;
    3942class AbstractMediaPlayer;
    4043
     
    6467                        const QList<EffectParameter> &params);
    6568
    66     virtual QList<EffectParameter> parameters() const;
    67     virtual QVariant parameterValue(const EffectParameter &param) const;
    68     virtual void setParameterValue(const EffectParameter &,
     69    // Phonon::EffectInterface
     70    virtual QList<Phonon::EffectParameter> parameters() const;
     71    virtual QVariant parameterValue(const Phonon::EffectParameter &param) const;
     72    virtual void setParameterValue(const Phonon::EffectParameter &,
    6973                                   const QVariant &newValue);
    7074
    71     enum Type
     75    // Parameters which are shared by all effects
     76    enum CommonParameters
    7277    {
    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
    8180    };
     81
     82public Q_SLOTS:
     83    void abstractPlayerChanged(AbstractPlayer *player);
     84    void stateChanged(Phonon::State newState,
     85                      Phonon::State oldState);
    8286
    8387protected:
     
    8690    void disconnectMediaObject(MediaObject *mediaObject);
    8791
    88     virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player) = 0;
    89     virtual void applyParameters() = 0;
     92    virtual void createEffect(AudioPlayer::NativePlayer *player) = 0;
    9093
    91     virtual void parameterChanged(const int id,
    92                                   const QVariant &value) = 0;
     94    // Effect-specific parameter changed
     95    virtual int effectParameterChanged(const EffectParameter &param,
     96                                  const QVariant &value);
     97
     98private:
     99    void createEffect();
     100    void setEnabled(bool enabled);
     101    const EffectParameter& internalParameter(int id) const;
     102    int parameterChanged(const EffectParameter &param,
     103            const QVariant &value);
    93104
    94105protected:
     
    96107
    97108private:
     109    const QList<EffectParameter>    m_params;
    98110    AbstractMediaPlayer *           m_player;
    99     const QList<EffectParameter>    m_params;
    100111    QHash<int, QVariant>            m_values;
    101112};
     
    104115}
    105116
     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                                                                        \
     124void 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                                                                        \
     131C##Effect* Effect::concreteEffect()                                     \
     132{                                                                       \
     133    return static_cast<C##Effect *>(m_effect.data());                   \
     134}
     135
    106136QT_END_NAMESPACE
    107137
  • trunk/src/3rdparty/phonon/mmf/abstractplayer.h

    r561 r651  
    2020#define PHONON_MMF_ABSTRACTPLAYER_H
    2121
    22 #include <Phonon/phononnamespace.h>
    23 #include <Phonon/mediasource.h>
     22#include <phonon/phononnamespace.h>
     23#include <phonon/mediasource.h>
    2424
    2525#include <QObject>
     
    107107    void tick(qint64 time);
    108108    void bufferStatus(int percentFilled);
    109     void stateChanged(Phonon::State oldState,
    110                       Phonon::State newState);
     109    void stateChanged(Phonon::State newState,
     110                      Phonon::State oldState);
    111111    void metaDataChanged(const QMultiMap<QString, QString>& metaData);
    112112    void aboutToFinish();
  • trunk/src/3rdparty/phonon/mmf/audioequalizer.cpp

    r561 r651  
    2929*/
    3030
    31 AudioEqualizer::AudioEqualizer(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, createParams())
     31// Define functions which depend on concrete native effect class name
     32PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(AudioEqualizer)
     33
     34AudioEqualizer::AudioEqualizer(QObject *parent, const QList<EffectParameter>& parameters)
     35    :   AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
    3236{
     37
    3338}
    3439
    35 void AudioEqualizer::parameterChanged(const int pid,
     40int AudioEqualizer::effectParameterChanged(const EffectParameter &param,
    3641                                      const QVariant &value)
    3742{
    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;
    4350}
    4451
    45 void AudioEqualizer::connectAudioPlayer(AudioPlayer::NativePlayer *player)
     52
     53//-----------------------------------------------------------------------------
     54// Static functions
     55//-----------------------------------------------------------------------------
     56
     57const char* AudioEqualizer::description()
    4658{
    47     CAudioEqualizer *ptr = 0;
    48     QT_TRAP_THROWING(ptr = CAudioEqualizer::NewL(*player));
    49     m_effect.reset(ptr);
     59    return "Audio equalizer";
    5060}
    5161
    52 void AudioEqualizer::applyParameters()
     62bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream,
     63    QList<EffectParameter>& parameters)
    5364{
    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);
    60100        }
    61101    }
    62 }
    63102
    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;
    105104}
    106105
  • trunk/src/3rdparty/phonon/mmf/audioequalizer.h

    r561 r651  
    2222#include "abstractaudioeffect.h"
    2323
     24class CAudioEqualizer;
     25
    2426QT_BEGIN_NAMESPACE
    2527
     
    4042    Q_OBJECT
    4143public:
    42     AudioEqualizer(QObject *parent);
     44    AudioEqualizer(QObject *parent, const QList<EffectParameter> &parameters);
     45
     46    // Static interface required by EffectFactory
     47    static const char* description();
     48    static bool getParameters(CMdaAudioOutputStream *stream,
     49        QList<EffectParameter>& parameters);
    4350
    4451protected:
    4552    // AbstractAudioEffect
    46     virtual void connectAudioPlayer(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 &param,
     55                                      const QVariant &value);
    4956
    5057private:
    51     void setBandLevel(int band, int level);
    52 
    53 private:
    54     static QList<EffectParameter> createParams();
     58    CAudioEqualizer *concreteEffect();
    5559
    5660};
  • trunk/src/3rdparty/phonon/mmf/backend.cpp

    r561 r651  
    4646    : QObject(parent)
    4747    , m_ancestorMoveMonitor(new AncestorMoveMonitor(this))
     48    , m_effectFactory(new EffectFactory(this))
    4849{
    4950    TRACE_CONTEXT(Backend::Backend, EBackend);
     
    8283        Q_ASSERT(args.count() == 1);
    8384        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);
    8788    }
    8889    case VideoWidgetClass:
     
    106107    {
    107108        case EffectType:
    108             retval.append(EffectFactory::effectIndexes());
     109            retval.append(m_effectFactory->effectIndexes());
    109110            break;
    110111        case AudioOutputDeviceType:
     
    127128    switch (type) {
    128129        case EffectType:
    129             return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
     130            return m_effectFactory->audioEffectDescriptions(EffectFactory::Type(index));
    130131        case AudioOutputDeviceType:
    131132            return AudioOutput::audioOutputDescription(index);
  • trunk/src/3rdparty/phonon/mmf/backend.h

    r561 r651  
    2121
    2222#include "ancestormovemonitor.h"
     23#include "effectfactory.h"
    2324
    24 #include <Phonon/mediasource.h>
    25 #include <Phonon/backendinterface.h>
     25#include <phonon/mediasource.h>
     26#include <phonon/backendinterface.h>
    2627#include <QScopedPointer>
    2728
     
    5455private:
    5556    QScopedPointer<AncestorMoveMonitor> m_ancestorMoveMonitor;
     57    QScopedPointer<EffectFactory>       m_effectFactory;
    5658
    5759};
  • trunk/src/3rdparty/phonon/mmf/bassboost.cpp

    r561 r651  
    2525using namespace Phonon::MMF;
    2626
     27// Define functions which depend on concrete native effect class name
     28PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(BassBoost)
     29
    2730/*! \class MMF::BassBoost
    2831  \internal
    2932*/
    3033
    31 BassBoost::BassBoost(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent,
    32                                                                                 QList<EffectParameter>())
     34BassBoost::BassBoost(QObject *parent, const QList<EffectParameter> &parameters)
     35    :   AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
    3336{
     37
    3438}
    3539
    36 void BassBoost::parameterChanged(const int,
    37                                  const QVariant &)
     40//-----------------------------------------------------------------------------
     41// Static functions
     42//-----------------------------------------------------------------------------
     43
     44const char* BassBoost::description()
    3845{
    39     Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has not parameters");
     46    return "Bass boost";
    4047}
    4148
    42 void BassBoost::connectAudioPlayer(AudioPlayer::NativePlayer *player)
     49bool BassBoost::getParameters(CMdaAudioOutputStream *stream,
     50    QList<EffectParameter> &parameters)
    4351{
    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);
    5255}
    5356
  • trunk/src/3rdparty/phonon/mmf/bassboost.h

    r561 r651  
    2222#include "abstractaudioeffect.h"
    2323
     24class CBassBoost;
     25
    2426QT_BEGIN_NAMESPACE
    2527
     
    2931{
    3032/**
    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.
    3534 */
    3635class BassBoost : public AbstractAudioEffect
     
    3837    Q_OBJECT
    3938public:
    40     BassBoost(QObject *parent);
     39    BassBoost(QObject *parent, const QList<EffectParameter> &parameters);
     40
     41    // Static interface required by EffectFactory
     42    static const char* description();
     43    static bool getParameters(CMdaAudioOutputStream *stream,
     44        QList<EffectParameter>& parameters);
    4145
    4246protected:
    4347    // 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
     50private:
     51    CBassBoost *concreteEffect();
    4752
    4853};
  • trunk/src/3rdparty/phonon/mmf/effectfactory.cpp

    r561 r651  
    2020#include <QCoreApplication>
    2121
    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>
    3223
    3324#include "audioequalizer.h"
    3425#include "bassboost.h"
     26#include "environmentalreverb.h"
     27#include "loudness.h"
     28#include "stereowidening.h"
    3529
    3630#include "effectfactory.h"
     
    4539*/
    4640
    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 {
     41EffectFactory::EffectFactory(QObject *parent)
     42    :   QObject(parent)
     43    ,   m_initialized(false)
     44{
     45
     46}
     47
     48EffectFactory::~EffectFactory()
     49{
     50
     51}
     52
     53//-----------------------------------------------------------------------------
     54// Public functions
     55//-----------------------------------------------------------------------------
     56
     57AbstractAudioEffect *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
    6270    switch (type)
    6371    {
    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
     100QHash<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
     109QList<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
     135void 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.
     154class OutputStreamFactory : public MMdaAudioOutputStreamCallback
     155{
     156public:
     157    CMdaAudioOutputStream* create()
    92158    {
    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    }
     163private:
     164    void MaoscOpenComplete(TInt /*aError*/) { }
     165    void MaoscBufferCopied(TInt /*aError*/, const TDesC8& /*aBuffer*/) { }
     166    void MaoscPlayComplete(TInt /*aError*/) { }
     167};
     168
     169template<typename BackendNode>
     170EffectFactory::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
     206const 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();
    152211}
    153212
  • trunk/src/3rdparty/phonon/mmf/effectfactory.h

    r561 r651  
    2121
    2222#include "abstractaudioeffect.h"
     23#include "effectparameter.h"
    2324
    2425QT_BEGIN_NAMESPACE
     
    3233 * @short Contains utility functions related to effects.
    3334 */
    34 class EffectFactory
     35class EffectFactory : public QObject
    3536{
     37    Q_OBJECT
     38
    3639public:
     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
    3755    /**
    3856     * @short Creates an audio effect of type @p type.
    3957     */
    40     static AbstractAudioEffect *createAudioEffect(AbstractAudioEffect::Type type,
    41                                                   QObject *parent);
     58    AbstractAudioEffect *createAudioEffect(Type type, QObject *parent);
    4259
    4360    /**
     
    4764     * BackendInterface::objectDescriptionProperties().
    4865     */
    49     static QHash<QByteArray, QVariant> audioEffectDescriptions(AbstractAudioEffect::Type type);
     66    QHash<QByteArray, QVariant> audioEffectDescriptions(Type type);
    5067
    5168    /**
     
    5572     * BackendInterface::objectDescriptionIndexes().
    5673     */
    57     static QList<int> effectIndexes();
     74    QList<int> effectIndexes();
    5875
    5976private:
    60     static inline QHash<QByteArray, QVariant> constructEffectDescription(const QString &name,
    61                                                                          const QString &description);
     77    void initialize();
    6278
    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
     89private:
     90    bool                                m_initialized;
     91    QHash<Type, EffectData>             m_effectData;
     92
    6993};
     94
    7095}
    7196}
  • trunk/src/3rdparty/phonon/mmf/mediaobject.cpp

    r561 r651  
    298298    }
    299299
     300    if (oldPlayer)
     301        emit abstractPlayerChanged(0);
    300302    m_player.reset(newPlayer);
     303    emit abstractPlayerChanged(newPlayer);
    301304
    302305    if (oldPlayerHasVideo != hasVideo()) {
  • trunk/src/3rdparty/phonon/mmf/mediaobject.h

    r561 r651  
    2020#define PHONON_MMF_MEDIAOBJECT_H
    2121
    22 #include <Phonon/mediasource.h>
    23 #include <Phonon/mediaobjectinterface.h>
     22#include <phonon/mediasource.h>
     23#include <phonon/mediaobjectinterface.h>
    2424#include <QScopedPointer>
    2525#include <QTimer>
     
    9393
    9494Q_SIGNALS:
     95    void abstractPlayerChanged(AbstractPlayer *player);
    9596    void totalTimeChanged(qint64 length);
    9697    void hasVideoChanged(bool hasVideo);
     
    102103    void metaDataChanged(const QMultiMap<QString, QString>& metaData);
    103104    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);
    106107    void finished();
    107108    void tick(qint64 time);
  • trunk/src/3rdparty/phonon/mmf/mmf_medianode.h

    r561 r651  
    2121
    2222#include <QObject>
    23 #include <Phonon/effectinterface.h>
     23#include <phonon/effectinterface.h>
    2424#include "audioplayer.h"
    2525
  • trunk/src/3rdparty/phonon/mmf/utils.h

    r561 r651  
    4545class Utils
    4646{
    47     Q_DECLARE_TR_FUNCTIONS(Utils)
     47    Q_DECLARE_TR_FUNCTIONS(Phonon::MMF)
    4848
    4949public:
  • trunk/src/3rdparty/phonon/mmf/videooutput.h

    r561 r651  
    2525#include "defs.h"
    2626
    27 #include <Phonon/videowidget.h>
     27#include <phonon/videowidget.h>
    2828
    2929#include <e32std.h>
  • trunk/src/3rdparty/phonon/mmf/videowidget.h

    r561 r651  
    2424
    2525#include <QtGui/QWidget>
    26 #include <Phonon/videowidget.h>
    27 #include <Phonon/videowidgetinterface.h>
     26#include <phonon/videowidget.h>
     27#include <phonon/videowidgetinterface.h>
    2828
    2929QT_BEGIN_NAMESPACE
  • trunk/src/3rdparty/phonon/phonon/effectwidget.cpp

    r561 r651  
    1616    Lesser General Public License for more details.
    1717
    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
    1919    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
    2020
     
    152152                bool maxValueOk = false;
    153153                const int minValue = para.minimumValue().toInt(&minValueOk);
    154                 const int maxValue = para.minimumValue().toInt(&maxValueOk);
     154                const int maxValue = para.maximumValue().toInt(&maxValueOk);
    155155
    156156                sb->setRange(minValueOk ? minValue : DEFAULT_MIN_INT, maxValueOk ? maxValue : DEFAULT_MAX_INT);
  • trunk/src/3rdparty/webkit/JavaScriptCore/ChangeLog

    r561 r651  
    1010        (OpaqueJSClass::OpaqueJSClass):
    1111        (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:
    2312
    24132009-11-19  Thiago Macieira <thiago.macieira@nokia.com>
  • trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h

    r561 r651  
    4646#endif
    4747
    48 #if COMPILER(RVCT)
    49 #pragma arm
    50 #pragma Otime
    51 #pragma O3
    52 #endif
    53 
    5448namespace JSC {
    5549
  • trunk/src/3rdparty/webkit/VERSION

    r561 r651  
    99and has the sha1 checksum
    1010
    11         8f6992f4e8f027818429d428393b08068eca9ffa
     11        69dd29fbeb12d076741dce70ac6bc155101ccd6f
  • trunk/src/3rdparty/webkit/WebCore/ChangeLog

    r561 r651  
     12010-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
     162010-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
     302010-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
     532010-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
     622010-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
     742010-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
     832010-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
     952010-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
     1062010-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
     1212010-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
    11402010-01-13  Miikka Heikkinen <miikka.heikkinen@digia.com>
    2141
  • trunk/src/3rdparty/webkit/WebCore/WebCore.pro

    r637 r651  
    77    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB
    88    TARGET.CAPABILITY = All -Tcb
     9    TARGET.UID3 = 0x200267C2
    910
    1011    webkitlibs.sources = QtWebKit.dll
     
    1920    webkitlibs.pkg_prerules = vendorinfo
    2021
    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
    2427    # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
    2528    # 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
    2730}
    2831
     
    183186
    184187# Web Socket support.
    185 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
     188!contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=0
    186189
    187190# XSLT support with QtXmlPatterns
     
    27802783    FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
    27812784
    2782     QT += xmlpatterns
     2785    tobe|!tobe: QT += xmlpatterns
    27832786
    27842787    SOURCES += \
     
    34153418symbian {
    34163419    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
    34253422        }
    34263423    }
  • trunk/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp

    r561 r651  
    128128    QObject* obj = qtinst->getObject();
    129129    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());
    131131    QByteArray ba = objName.toAscii();
    132132
  • trunk/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp

    r561 r651  
    306306            } else {
    307307                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()));
    309309                if (type == String)
    310310                    dist = 0;
     
    330330                        if (objdist >= 0) {
    331331                            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());
    333333                            result.insert(id, v);
    334334                        }
     
    405405                    JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
    406406                    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());
    408408
    409409                    result.append(qstring);
     
    419419                    JSValue val = array->get(exec, i);
    420420                    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());
    422422
    423423                    result.append(qstring);
     
    428428                // Make a single length array
    429429                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());
    431431                QStringList result;
    432432                result.append(qstring);
     
    444444            } else {
    445445                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());
    447447                if (type == String)
    448448                    dist = 5;
     
    486486            } else if (type == String) {
    487487                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());
    489489
    490490                if (hint == QMetaType::QDateTime) {
     
    535535                // Attempt to convert.. a bit risky
    536536                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());
    538538
    539539                // this is of the form '/xxxxxx/i'
     
    555555            } else if (type == String) {
    556556                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());
    558558
    559559                QRegExp re(qstring);
  • trunk/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp

    r561 r651  
    217217#include "JSWebKitPoint.h"
    218218#include "JSWebKitTransitionEvent.h"
    219 #include "JSWebSocket.h"
    220219#include "JSWheelEvent.h"
    221220#include "JSWorker.h"
     
    248247/* Hash table */
    249248
    250 static const HashTableValue JSDOMWindowTableValues[297] =
     249static const HashTableValue JSDOMWindowTableValues[296] =
    251250{
    252251    { "screen", DontDelete|ReadOnly, (intptr_t)jsDOMWindowScreen, (intptr_t)0 },
     
    541540    { "Worker", DontDelete, (intptr_t)jsDOMWindowWorkerConstructor, (intptr_t)setJSDOMWindowWorkerConstructor },
    542541    { "SharedWorker", DontDelete, (intptr_t)jsDOMWindowSharedWorkerConstructor, (intptr_t)setJSDOMWindowSharedWorkerConstructor },
    543     { "WebSocket", DontDelete, (intptr_t)jsDOMWindowWebSocketConstructor, (intptr_t)setJSDOMWindowWebSocketConstructor },
    544542    { "Plugin", DontDelete, (intptr_t)jsDOMWindowPluginConstructor, (intptr_t)setJSDOMWindowPluginConstructor },
    545543    { "PluginArray", DontDelete, (intptr_t)jsDOMWindowPluginArrayConstructor, (intptr_t)setJSDOMWindowPluginArrayConstructor },
     
    589587    { 65535, JSDOMWindowTableValues, 0 };
    590588#else
    591     { 1068, 1023, JSDOMWindowTableValues, 0 };
     589    { 1067, 1023, JSDOMWindowTableValues, 0 };
    592590#endif
    593591
     
    32763274}
    32773275
    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 
    32863276JSValue jsDOMWindowPluginConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
    32873277{
     
    56775667    // Shadowing a built-in constructor
    56785668    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 constructor
    5686     static_cast<JSDOMWindow*>(thisObject)->putDirect(Identifier(exec, "WebSocket"), value);
    56875669}
    56885670
  • trunk/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h

    r561 r651  
    8383    JSC::JSValue worker(JSC::ExecState*) const;
    8484    JSC::JSValue sharedWorker(JSC::ExecState*) const;
    85     JSC::JSValue webSocket(JSC::ExecState*) const;
    8685    JSC::JSValue audio(JSC::ExecState*) const;
    8786
     
    680679JSC::JSValue jsDOMWindowSharedWorkerConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
    681680void 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);
    684681JSC::JSValue jsDOMWindowPluginConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
    685682void setJSDOMWindowPluginConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
  • trunk/src/3rdparty/webkit/WebCore/platform/PopupMenu.h

    r561 r651  
    4545    class QWebPopup;
    4646}
     47QT_BEGIN_NAMESPACE
     48class QGraphicsProxyWidget;
     49QT_END_NAMESPACE
    4750#elif PLATFORM(GTK)
    4851typedef struct _GtkMenu GtkMenu;
     
    148151    void populate(const IntRect&);
    149152    QWebPopup* m_popup;
     153    QGraphicsProxyWidget* m_proxy;
    150154#elif PLATFORM(WIN)
    151155    // ScrollBarClient
  • trunk/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp

    r561 r651  
    508508    }
    509509
    510     if (canBlitOnScroll() && !rootPreventsBlitting()) { // The main frame can just blit the WebView window
     510    if (canBlitOnScroll()) { // The main frame can just blit the WebView window
    511511       // FIXME: Find a way to blit subframes without blitting overlapping content
    512512       hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
     
    597597    if (m_scrollbarsAvoidingResizer && parent())
    598598        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 #endif
    607599
    608600    Widget::setParent(parentView);
  • trunk/src/3rdparty/webkit/WebCore/platform/ScrollView.h

    r561 r651  
    306306#endif
    307307
    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 #else
    315     bool rootPreventsBlitting() const { return false; }
    316 #endif
    317 
    318308#if PLATFORM(GTK)
    319309public:
  • trunk/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp

    r561 r651  
    22 * This file is part of the popup menu implementation for <select> elements in WebCore.
    33 *
     4 * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
    45 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
    56 * Copyright (C) 2006 Apple Computer, Inc.
     
    3637#include <QAction>
    3738#include <QDebug>
     39#include <QGraphicsProxyWidget>
     40#include <QGraphicsScene>
     41#include <QGraphicsView>
     42#include <QGraphicsWebView>
    3843#include <QListWidget>
    3944#include <QListWidgetItem>
     
    4752PopupMenu::PopupMenu(PopupMenuClient* client)
    4853    : m_popupClient(client)
     54    , m_proxy(0)
    4955{
    5056    m_popup = new QWebPopup(client);
     
    5359PopupMenu::~PopupMenu()
    5460{
    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;
    5665}
    5766
     
    93102    rect.setHeight(m_popup->sizeHint().height());
    94103
    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
    97116    m_popup->setCurrentIndex(index);
    98117    m_popup->exec();
  • trunk/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp

    r637 r651  
    2727#include <QInputContext>
    2828#include <QMouseEvent>
     29#include <QGraphicsProxyWidget>
    2930
    3031namespace WebCore {
     
    3637    Q_ASSERT(m_client);
    3738
     39#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5)
    3840    setFont(m_client->menuStyle().font().font());
     41#endif
    3942    connect(this, SIGNAL(activated(int)),
    4043            SLOT(activeChanged(int)), Qt::QueuedConnection);
     
    4447void QWebPopup::exec()
    4548{
     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
    4655    QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
    4756                      Qt::LeftButton, Qt::NoModifier);
    4857    QCoreApplication::sendEvent(this, &event);
     58#endif
    4959}
    5060
     
    7080
    7181    QComboBox::hidePopup();
     82   
     83    if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
     84        proxy->setVisible(false);
     85
    7286    if (!m_popupVisible)
    7387        return;
  • trunk/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp

    r561 r651  
    126126    : RenderTheme()
    127127    , m_page(page)
    128     , m_fallbackStyle(0)
    129128{
    130129    QPushButton button;
     
    136135    m_buttonFontPixelSize = fontInfo.pixelSize();
    137136#endif
     137
     138    m_fallbackStyle = QStyleFactory::create(QLatin1String("windows"));
    138139}
    139140
     
    144145
    145146// 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;
     147QStyle* RenderThemeQt::fallbackStyle() const
     148{
     149    return (m_fallbackStyle) ? m_fallbackStyle : QApplication::style();
    155150}
    156151
    157152QStyle* RenderThemeQt::qStyle() const
    158153{
     154#ifdef Q_WS_MAEMO_5
     155    return fallbackStyle();
     156#endif
     157
    159158    if (m_page) {
    160159        ChromeClientQt* client = static_cast<ChromeClientQt*>(m_page->chrome()->client());
     
    759758        option.state |= (isChecked(o) ? QStyle::State_On : QStyle::State_Off);
    760759
     760#ifdef Q_WS_MAEMO_5
     761    static QPalette lightGrayPalette(Qt::lightGray);
     762    option.palette = lightGrayPalette;
     763#else
    761764    // If the owner widget has a custom palette, use it
    762765    Page* page = o->document()->page();
     
    767770            option.palette = pageClient->palette();
    768771    }
     772#endif
    769773
    770774    return result;
  • trunk/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h

    r561 r651  
    139139
    140140    QStyle* qStyle() const;
    141     QStyle* fallbackStyle();
     141    QStyle* fallbackStyle() const;
    142142
    143143    Page* m_page;
  • trunk/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp

    r561 r651  
    3737void ScrollView::platformInit()
    3838{
    39     m_widgetsPreventingBlitting = 0;
    4039}
    4140
     
    4443}
    4544
    46 // Windowed plugins are using native windows and are thus preventing
    47 // 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 
    5645void ScrollView::platformAddChild(Widget*)
    5746{
    58     adjustWidgetsPreventingBlittingCount(1);
    5947}
    6048
     
    6250{
    6351    child->hide();
    64     adjustWidgetsPreventingBlittingCount(-1);
    6552}
    6653
  • trunk/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp

    r561 r651  
    127127    if (!m_windowRect.intersects(frameView->frameRect()))
    128128        setNPWindowIfNeeded();
     129
     130    // Make sure we get repainted afterwards. This is necessary for downward
     131    // scrolling to move the plugin widget properly.
     132    invalidate();
    129133}
    130134
     
    658662{
    659663    if (m_isWindowed) {
    660         platformWidget()->update(rect);
     664        if (platformWidget())
     665            platformWidget()->update(rect);
    661666        return;
    662667    }
  • trunk/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp

    r561 r651  
    281281    m_npWindow.width = m_windowRect.width();
    282282    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;
    285283   
    286284    PluginView::setCurrentPluginView(this);
  • trunk/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp

    r561 r651  
    8787    if (!client)
    8888        return 0;
    89     return client->ownerWidget()->winId();
     89    if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))
     90        return pluginParent->winId();
     91    return 0;
    9092#else
    9193    return client;
  • trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp

    r561 r651  
    13701370    fromPage = qMax(1, fromPage);
    13711371    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    }
    13721377
    13731378    if (printer->pageOrder() == QPrinter::LastPageFirst) {
  • trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp

    r561 r651  
    17091709    if (loader)
    17101710        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    }
    17131719    delete d;
    17141720}
  • trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp

    r561 r651  
    5757    view->setPage(0);
    5858}
     59
     60#ifdef Q_WS_MAEMO_5
     61#include "qabstractkineticscroller.h"
     62
     63class QWebViewKineticScroller : public QAbstractKineticScroller {
     64public:
     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
     82protected:
     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
    59159
    60160/*!
     
    154254#endif
    155255
     256#if defined(Q_WS_MAEMO_5)
     257    QAbstractKineticScroller* scroller = new QWebViewKineticScroller();
     258    scroller->setWidget(this);
     259#endif
    156260    setAcceptDrops(true);
    157261
  • trunk/src/3rdparty/webkit/WebKit/qt/ChangeLog

    r561 r651  
     12010-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
     112010-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
     352010-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
     452010-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
     542010-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
     682010-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
     962010-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
     1052009-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
    11152010-01-14  Simon Hausmann  <simon.hausmann@nokia.com>
    2116
  • trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r561 r651  
    282282    // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty
    283283    // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914.
    284     if (rc && result.isNull())
     284    if (rc && x.isNull())
    285285        result = String("");
    286286    else
  • trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp

    r561 r651  
    616616        }
    617617        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
    619624        webPageClient->setInputMethodEnabled(active);
    620625    }
  • trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r561 r651  
    22    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
    33    Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
     4    Copyright (C) 2010 Holger Hans Peter Freyther
    45
    56    This library is free software; you can redistribute it and/or
     
    155156
    156157    void originatingObjectInNetworkRequests();
     158    void testJSPrompt();
    157159
    158160private:
     
    17821784}
    17831785
     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 */
     1796class JSPromptPage : public QWebPage {
     1797    Q_OBJECT
     1798public:
     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
     1823void 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
    17841853QTEST_MAIN(tst_QWebPage)
    17851854#include "tst_qwebpage.moc"
Note: See TracChangeset for help on using the changeset viewer.