Changeset 561 for trunk/src/activeqt


Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/activeqt/container/container.pro

    r2 r561  
    2222win32-g++:LIBS += -luuid
    2323
    24 contains(QT_EDITION, OpenSource|Console) {
    25     message( "You are not licensed to use ActiveQt." )
    26 } else {
    27     HEADERS         = ../control/qaxaggregated.h \
    28                       qaxbase.h \
    29                       qaxwidget.h \
    30                       qaxobject.h \
    31                       qaxscript.h \
    32                       qaxselect.h \
    33                       ../shared/qaxtypes.h
     24HEADERS =   ../control/qaxaggregated.h \
     25            qaxbase.h \
     26            qaxwidget.h \
     27            qaxobject.h \
     28            qaxscript.h \
     29            qaxselect.h \
     30            ../shared/qaxtypes.h
    3431
    35     SOURCES         = qaxbase.cpp \
    36                       qaxdump.cpp \
    37                       qaxwidget.cpp \
    38                       qaxobject.cpp \
    39                       qaxscript.cpp \
    40                       qaxscriptwrapper.cpp \
    41                       qaxselect.cpp \
    42                       ../shared/qaxtypes.cpp
     32SOURCES =  qaxbase.cpp \
     33            qaxdump.cpp \
     34            qaxwidget.cpp \
     35            qaxobject.cpp \
     36            qaxscript.cpp \
     37            qaxscriptwrapper.cpp \
     38            qaxselect.cpp \
     39            ../shared/qaxtypes.cpp
    4340
    44     FORMS           = qaxselect.ui
    45 }
     41FORMS =     qaxselect.ui
  • trunk/src/activeqt/container/qaxbase.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    4041//#define QAX_NO_CLASSINFO
    4142
    42 #ifndef UNICODE
    43 #define UNICODE
    44 #endif
    45 
    4643#define QT_CHECK_STATE
    4744
     
    175172        // get the Dispatch ID from the object
    176173        QString unicodeName = QLatin1String(name);
    177         OLECHAR *names = (TCHAR*)unicodeName.utf16();
     174        OLECHAR *names = (wchar_t*)unicodeName.utf16();
    178175        disp->GetIDsOfNames(IID_NULL, &names, 1, LOCALE_USER_DEFAULT, &dispid);
    179176        if (dispid != DISPID_UNKNOWN)
     
    422419                    } else {
    423420                        argv[p + 1] = const_cast<void*>(varp[p + 1].constData());
    424                         if (ptype.endsWith("*")) {
     421                        if (ptype.endsWith('*')) {
    425422                            argv_pointer[p + 1] = argv[p + 1];
    426423                            argv[p + 1] = argv_pointer + p + 1;
     
    639636    typeinfo->GetNames(dispID, &names, 1, &cNames);
    640637    if (cNames) {
    641         propname = QString::fromUtf16((const ushort *)names).toLatin1();
     638        propname = QString::fromWCharArray(names).toLatin1();
    642639        SysFreeString(names);
    643640    }
     
    649646    const QMetaProperty prop = mo->property(index);
    650647    propsignal += prop.typeName();
    651     propsignal += ")";
     648    propsignal += ')';
    652649    addProperty(dispID, propname, propsignal);
    653650
     
    913910    \brief the name of the COM object wrapped by this QAxBase object.
    914911
    915     Setting this property initilializes the COM object. Any COM object
     912    Setting this property initializes the COM object. Any COM object
    916913    previously set is shut down.
    917914
     
    973970        if (uuid.isNull()) {
    974971            CLSID clsid;
    975             HRESULT res = CLSIDFromProgID((WCHAR*)c.utf16(), &clsid);
     972            HRESULT res = CLSIDFromProgID((wchar_t*)c.utf16(), &clsid);
    976973            if (res == S_OK)
    977974                search = QUuid(clsid).toString();
     
    11381135                    if (!verb.lpszVerbName)
    11391136                        continue;
    1140                     QString verbName = QString::fromUtf16((const ushort *)verb.lpszVerbName);
     1137                    QString verbName = QString::fromWCharArray(verb.lpszVerbName);
    11411138                    if (!verbName.isEmpty())
    11421139                        d->verbs.insert(verbName, verb.lVerb);
     
    12661263                BSTR licenseKey;
    12671264                factory2->RequestLicKey(0, &licenseKey);
    1268                 QString qlicenseKey = QString::fromUtf16((const ushort *)licenseKey);
     1265                QString qlicenseKey = QString::fromWCharArray(licenseKey);
    12691266                SysFreeString(licenseKey);
    12701267                qWarning("Use license key is '%s' to create object on unlicensed machine.",
     
    12761273                BSTR licenseKey;
    12771274                factory2->RequestLicKey(0, &licenseKey);
    1278                 QString qlicenseKey = QString::fromUtf16((const ushort *)licenseKey);
     1275                QString qlicenseKey = QString::fromWCharArray(licenseKey);
    12791276                SysFreeString(licenseKey);
    12801277
     
    14361433    serverInfo.dwReserved2 = 0;
    14371434    serverInfo.pAuthInfo = &authInfo;
    1438     serverInfo.pwszName = (WCHAR*)server.utf16();
     1435    serverInfo.pwszName = (wchar_t*)server.utf16();
    14391436
    14401437    IClassFactory *factory = 0;
     
    16611658    void addProperty(const QByteArray &type, const QByteArray &name, uint flags)
    16621659    {
     1660        QByteArray propertyType(type);
     1661        if (propertyType.endsWith('&'))
     1662            propertyType.chop(1);
     1663
    16631664        Property &prop = property_list[name];
    1664         if (!type.isEmpty() && type != "HRESULT") {
    1665             prop.type = replaceType(type);
    1666             if (prop.type != type)
    1667                 prop.realType = type;
     1665        if (!propertyType.isEmpty() && propertyType != "HRESULT") {
     1666            prop.type = replaceType(propertyType);
     1667            if (prop.type != propertyType)
     1668                prop.realType = propertyType;
    16681669        }
    16691670        if (flags & Writable)
     
    17441745        return 0;
    17451746
    1746     className = QString::fromUtf16((const ushort *)bstr);
     1747    className = QString::fromWCharArray(bstr);
    17471748    SysFreeString(bstr);
    17481749
     
    17651766        return 0;
    17661767
    1767     className = QString::fromUtf16((const ushort *)bstr);
     1768    className = QString::fromWCharArray(bstr);
    17681769    SysFreeString(bstr);
    17691770
     
    17921793
    17931794            interfaceInfo->GetDocumentation(-1, &bstr, 0, 0, 0);
    1794             QString interfaceName = QString::fromUtf16((const ushort *)bstr);
     1795            QString interfaceName = QString::fromWCharArray(bstr);
    17951796            SysFreeString(bstr);
    17961797            QByteArray key;
     
    18401841        BSTR bstr;
    18411842        typelib->GetDocumentation(-1, &bstr, 0, 0, 0);
    1842         current_typelib = QString::fromUtf16((const ushort *)bstr).toLatin1();
     1843        current_typelib = QString::fromWCharArray(bstr).toLatin1();
    18431844        SysFreeString(bstr);
    18441845    }
     
    18881889            BSTR typelibname = 0;
    18891890            usertypelib->GetDocumentation(-1, &typelibname, 0, 0, 0);
    1890             QByteArray typeLibName = QString::fromUtf16((const ushort *)typelibname).toLatin1();
     1891            QByteArray typeLibName = QString::fromWCharArray(typelibname).toLatin1();
    18911892            SysFreeString(typelibname);
    18921893
     
    18941895            BSTR usertypename = 0;
    18951896            usertypelib->GetDocumentation(index, &usertypename, 0, 0, 0);
    1896             QByteArray userTypeName = QString::fromUtf16((const ushort *)usertypename).toLatin1();
     1897            QByteArray userTypeName = QString::fromWCharArray(usertypename).toLatin1();
    18971898            SysFreeString(usertypename);
    18981899
     
    20432044        case VT_UINT:
    20442045        case VT_CY:
    2045             str += "&";
     2046            str += '&';
    20462047            break;
    20472048        case VT_PTR:
    20482049            if (str == "QFont" || str == "QPixmap") {
    2049                 str += "&";
     2050                str += '&';
    20502051                break;
    20512052            } else if (str == "void*") {
     
    20562057        default:
    20572058            if (str == "QColor")
    2058                 str += "&";
     2059                str += '&';
    20592060            else if (str == "QDateTime")
    2060                 str += "&";
     2061                str += '&';
    20612062            else if (str == "QVariantList")
    2062                 str += "&";
     2063                str += '&';
    20632064            else if (str == "QByteArray")
    2064                 str += "&";
     2065                str += '&';
    20652066            else if (str == "QStringList")
    2066                 str += "&";
     2067                str += '&';
    20672068            else if (!str.isEmpty() && hasEnum(str))
    2068                 str += "&";
     2069                str += '&';
    20692070            else if (!str.isEmpty() && str != "QFont" && str != "QPixmap" && str != "QVariant")
    2070                 str += "*";
     2071                str += '*';
    20712072        }
    20722073        break;
     
    20862087            str = guessTypes(tdesc.lpadesc->tdescElem, info, function);
    20872088            if (!str.isEmpty())
    2088                 str = "QList<" + str + ">";
     2089                str = "QList<" + str + '>';
    20892090            break;
    20902091        }
     
    20942095        if (!str.isEmpty()) {
    20952096            for (int index = 0; index < tdesc.lpadesc->cDims; ++index)
    2096                 str += "[" + QByteArray::number((int)tdesc.lpadesc->rgbounds[index].cElements) + "]";
     2097                str += '[' + QByteArray::number((int)tdesc.lpadesc->rgbounds[index].cElements) + ']';
    20972098        }
    20982099        break;
     
    21112112
    21122113    if (tdesc.vt & VT_BYREF)
    2113         str += "&";
     2114        str += '&';
    21142115
    21152116    str.replace("&*", "**");
     
    21382139                QString coClassIDstr = iidnames.value(QLatin1String("/CLSID/") + coClassID + QLatin1String("/Default"), coClassID).toString();
    21392140                addClassInfo("CoClass", coClassIDstr.isEmpty() ? coClassID.toLatin1() : coClassIDstr.toLatin1());
    2140                 QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + "." + QByteArray::number(typeattr->wMinorVerNum);
     2141                QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + '.' + QByteArray::number(typeattr->wMinorVerNum);
    21412142                if (version != "0.0")
    21422143                    addClassInfo("Version", version);
     
    21712172                QString version = *vit;
    21722173                ++vit;
    2173                 tlfile = controls.value(QLatin1String("/") + version + QLatin1String("/0/win32/.")).toString();
     2174                tlfile = controls.value(QLatin1Char('/') + version + QLatin1String("/0/win32/.")).toString();
    21742175            }
    21752176            controls.endGroup();
     
    22842285            QByteArray enumName;
    22852286            if (typelib->GetDocumentation(i, &enumname, 0, 0, 0) == S_OK) {
    2286                 enumName = QString::fromUtf16((const ushort *)enumname).toLatin1();
     2287                enumName = QString::fromWCharArray(enumname).toLatin1();
    22872288                SysFreeString(enumname);
    22882289            } else {
     
    23072308                        enuminfo->GetNames(memid, &valuename, 1, &maxNamesOut);
    23082309                        if (maxNamesOut) {
    2309                             valueName = QString::fromUtf16((const ushort *)valuename).toLatin1();
     2310                            valueName = QString::fromWCharArray(valuename).toLatin1();
    23102311                            SysFreeString(valuename);
    23112312                        } else {
     
    23442345    QByteArray signalName(function);
    23452346    signalName += "Changed";
    2346     QByteArray signalProto = signalName + "(" + replaceType(type) + ")";
     2347    QByteArray signalProto = signalName + '(' + replaceType(type) + ')';
    23472348    if (!hasSignal(signalProto))
    23482349        addSignal(signalProto, function);
     
    23612362        prototype[0] = toupper(prototype[0]);
    23622363    }
    2363     prototype = set + prototype + "(" + propertyType(property) + ")";
     2364    prototype = set + prototype + '(' + propertyType(property) + ')';
    23642365    if (!hasSlot(prototype))
    23652366        addSlot(0, prototype, property);
     
    23782379    }
    23792380
    2380     prototype = function + "(";
     2381    prototype = function + '(';
    23812382    if (funcdesc->invkind == INVOKE_FUNC && type == hresult)
    23822383        type = 0;
     
    23922393        QByteArray ptype = guessTypes(tdesc, typeinfo, function);
    23932394        if (pdesc.wParamFlags & PARAMFLAG_FRETVAL) {
    2394             if (ptype.endsWith("&")) {
     2395            if (ptype.endsWith('&')) {
    23952396                ptype.truncate(ptype.length() - 1);
    23962397            } else if (ptype.endsWith("**")) {
     
    24002401        } else {
    24012402            prototype += ptype;
    2402             if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith("&") && !ptype.endsWith("**"))
    2403                 prototype += "&";
     2403            if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith('&') && !ptype.endsWith("**"))
     2404                prototype += '&';
    24042405            if (optional || pdesc.wParamFlags & PARAMFLAG_FOPT)
    24052406                paramName += "=0";
     
    24112412        }
    24122413        if (p < funcdesc->cParams && !(pdesc.wParamFlags & PARAMFLAG_FRETVAL))
    2413             prototype += ",";
     2414            prototype += ',';
    24142415    }
    24152416
    24162417    if (!prototype.isEmpty()) {
    2417         if (prototype.right(1) == ",") {
     2418        if (prototype.endsWith(',')) {
    24182419            if (funcdesc->invkind == INVOKE_PROPERTYPUT && p == funcdesc->cParams) {
    24192420                TYPEDESC tdesc = funcdesc->lprgelemdescParam[p-1].tdesc;
    24202421                QByteArray ptype = guessTypes(tdesc, typeinfo, function);
    24212422                prototype += ptype;
    2422                 prototype += ")";
     2423                prototype += ')';
    24232424                parameters << "rhs";
    24242425            } else {
     
    24262427            }
    24272428        } else {
    2428             prototype += ")";
     2429            prototype += ')';
    24292430        }
    24302431    }
     
    24642465        int p;
    24652466        for (p = 0; p < (int)maxNamesOut; ++p) {
    2466             names << QString::fromUtf16((const ushort *)bstrNames[p]).toLatin1();
     2467            names << QString::fromWCharArray(bstrNames[p]).toLatin1();
    24672468            SysFreeString(bstrNames[p]);
    24682469        }
     
    25742575                    if (defargs) {
    25752576                        parameters.takeLast();
    2576                         int lastParam = prototype.lastIndexOf(",");
     2577                        int lastParam = prototype.lastIndexOf(',');
    25772578                        if (lastParam == -1)
    2578                             lastParam = prototype.indexOf("(") + 1;
     2579                            lastParam = prototype.indexOf('(') + 1;
    25792580                        prototype.truncate(lastParam);
    2580                         prototype += ")";
     2581                        prototype += ')';
    25812582                    }
    25822583                } while (defargs);
     
    25912592        BSTR bstrDocu;
    25922593        info->GetDocumentation(funcdesc->memid, 0, &bstrDocu, 0, 0);
    2593         QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
     2594        QString strDocu = QString::fromWCharArray(bstrDocu);
    25942595        SysFreeString(bstrDocu);
    25952596        if (!!strDocu)
    2596             desc += "[" + strDocu + "]";
    2597         desc += "\n";
     2597            desc += '[' + strDocu + ']';
     2598        desc += '\n';
    25982599#endif
    25992600        typeinfo->ReleaseFuncDesc(funcdesc);
     
    26382639        uint flags = 0;
    26392640
    2640         variableName = QString::fromUtf16((const ushort *)bstrName).toLatin1();
     2641        variableName = QString::fromWCharArray(bstrName).toLatin1();
    26412642        SysFreeString(bstrName);
    26422643
     
    26742675        BSTR bstrDocu;
    26752676        info->GetDocumentation(vardesc->memid, 0, &bstrDocu, 0, 0);
    2676         QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
     2677        QString strDocu = QString::fromWCharArray(bstrDocu);
    26772678        SysFreeString(bstrDocu);
    26782679        if (!!strDocu)
    2679             desc += "[" + strDocu + "]";
    2680         desc += "\n";
     2680            desc += '[' + strDocu + ']';
     2681        desc += '\n';
    26812682#endif
    26822683        typeinfo->ReleaseVarDesc(vardesc);
     
    27972798        int p;
    27982799        for (p = 0; p < (int)maxNamesOut; ++p) {
    2799             names << QString::fromUtf16((const ushort *)bstrNames[p]).toLatin1();
     2800            names << QString::fromWCharArray(bstrNames[p]).toLatin1();
    28002801            SysFreeString(bstrNames[p]);
    28012802        }
     
    28212822        BSTR bstrDocu;
    28222823        eventinfo->GetDocumentation(funcdesc->memid, 0, &bstrDocu, 0, 0);
    2823         QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
     2824        QString strDocu = QString::fromWCharArray(bstrDocu);
    28242825        SysFreeString(bstrDocu);
    28252826        if (!!strDocu)
    2826             desc += "[" + strDocu + "]";
    2827         desc += "\n";
     2827            desc += '[' + strDocu + ']';
     2828        desc += '\n';
    28282829#endif
    28292830        eventinfo->ReleaseFuncDesc(funcdesc);
     
    29792980            BSTR bstr;
    29802981            typelib->GetDocumentation(-1, &bstr, 0, 0, 0);
    2981             current_typelib = QString::fromUtf16((const ushort *)bstr).toLatin1();
     2982            current_typelib = QString::fromWCharArray(bstr).toLatin1();
    29822983            SysFreeString(bstr);
    29832984        }
     
    32053206
    32063207static QMetaObject qaxobject_staticMetaObject = {
    3207     &QObject::staticMetaObject, qt_meta_stringdata_QAxBase,
    3208         qt_meta_data_QAxBase, 0
     3208    { &QObject::staticMetaObject, qt_meta_stringdata_QAxBase,
     3209        qt_meta_data_QAxBase, 0 }
    32093210};
    32103211static QMetaObject qaxwidget_staticMetaObject = {
    3211     &QWidget::staticMetaObject, qt_meta_stringdata_QAxBase,
    3212         qt_meta_data_QAxBase, 0
     3212    { &QWidget::staticMetaObject, qt_meta_stringdata_QAxBase,
     3213        qt_meta_data_QAxBase, 0 }
    32133214};
    32143215
     
    33883389
    33893390                code = exc->wCode ? exc->wCode : exc->scode;
    3390                 source = QString::fromUtf16((const ushort *)exc->bstrSource);
    3391                 desc = QString::fromUtf16((const ushort *)exc->bstrDescription);
    3392                 help = QString::fromUtf16((const ushort *)exc->bstrHelpFile);
     3391                source = QString::fromWCharArray(exc->bstrSource);
     3392                desc = QString::fromWCharArray(exc->bstrDescription);
     3393                help = QString::fromWCharArray(exc->bstrHelpFile);
    33933394                uint helpContext = exc->dwHelpContext;
    33943395
     
    36933694            id = internalInvoke(call, id, v);
    36943695            break;
     3696        default:
     3697            break;
    36953698        }
    36963699        break;
     
    37063709    case QMetaObject::QueryPropertyUser:
    37073710        id -= mo->propertyCount();
     3711        break;
     3712    default:
    37083713        break;
    37093714    }
     
    39063911                paramType = d->metaobj->paramType(normFunction, i, &out);
    39073912
    3908             if (!parse && d->useMetaObject && var.type() == QVariant::String || var.type() == QVariant::ByteArray) {
     3913            if ((!parse && d->useMetaObject && var.type() == QVariant::String) || var.type() == QVariant::ByteArray) {
    39093914                int enumIndex =mo->indexOfEnumerator(paramType);
    39103915                if (enumIndex != -1) {
     
    42254230            return E_POINTER;
    42264231
    4227         QString property = QString::fromUtf16((const ushort *)name);
     4232        QString property = QString::fromWCharArray(name);
    42284233        QVariant qvar = map.value(property);
    42294234        QVariantToVARIANT(qvar, *var);
     
    42344239        if (!var)
    42354240            return E_POINTER;
    4236         QString property = QString::fromUtf16((const ushort *)name);
     4241        QString property = QString::fromWCharArray(name);
    42374242        QVariant qvar = VARIANTToQVariant(*var, 0);
    42384243        map[property] = qvar;
     
    43954400        QObject *object = qObject();
    43964401        if (QMetaType::type(cn))
    4397             qvar = QVariant(qRegisterMetaType<QObject*>(cn + "*"), &object);
    4398 //            qVariantSetValue(qvar, qObject(), cn + "*");
     4402            qvar = QVariant(qRegisterMetaType<QObject*>(cn + '*'), &object);
     4403//            qVariantSetValue(qvar, qObject(), cn + '*');
    43994404    }
    44004405
  • trunk/src/activeqt/container/qaxbase.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxdump.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    6768        ulong helpContext;
    6869        HRESULT hres = typeInfo->GetDocumentation(memId, 0, &docStringBstr, &helpContext, &helpFileBstr);
    69         QString docString = QString::fromUtf16((const ushort *)docStringBstr);
    70         QString helpFile = QString::fromUtf16((const ushort *)helpFileBstr);
     70        QString docString = QString::fromWCharArray(docStringBstr);
     71        QString helpFile = QString::fromWCharArray(helpFileBstr);
    7172        SysFreeString(docStringBstr);
    7273        SysFreeString(helpFileBstr);
     
    9596
    9697        if (p < parameterNames.count())
    97             prototype += " " + parameterNames.at(p);
     98            prototype += ' ' + parameterNames.at(p);
    9899         
    99100        if (numDefArgs >= parameterTypes.count() - p)
     
    102103            prototype += ", ";
    103104    }
    104     prototype += ")";
     105    prototype += ')';
    105106
    106107    return prototype;
     
    197198            prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames());
    198199            QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
    199                              QString::fromLatin1(returntype.constData()) + QLatin1String(" ") +
    200                              QString::fromLatin1(name.constData()) + QLatin1String(" ") +
     200                             QLatin1String(returntype.constData()) + QLatin1Char(' ') +
     201                             QLatin1String(name.constData()) + QLatin1Char(' ') +
    201202                             QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [slot]</tt></h3>\n");
    202203            prototype = namedPrototype(slot.parameterTypes(), QList<QByteArray>());
     
    221222                }
    222223                if (returntype != "void")
    223                     detail += QString::fromLatin1(returntype.constData()) + QLatin1String(" result = ");
    224                 detail += QLatin1String("object->") + QString::fromLatin1(functionToCall.constData()) +
    225                           QLatin1String("(\"" + name + prototype + "\"");
     224                    detail += QLatin1String(returntype.constData()) + QLatin1String(" result = ");
     225                detail += QLatin1String("object->") + QLatin1String(functionToCall.constData()) +
     226                          QLatin1String("(\"" + name + prototype + '\"');
    226227                if (hasParams)
    227228                    detail += QLatin1String(", params");
    228                 detail += QLatin1String(")");
     229                detail += QLatin1Char(')');
    229230                if (returntype != "void" && returntype != "QAxObject *" && returntype != "QVariant")
    230                     detail += QLatin1String(".") + QString::fromLatin1(toType(returntype));
     231                    detail += QLatin1Char('.') + QLatin1String(toType(returntype));
    231232                detail += QLatin1String(";</pre>\n");
    232233            } else {
     
    263264            stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
    264265
    265             QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>void ") +
    266                              QString::fromLatin1(name.constData()) + QLatin1String(" ") +
    267                              QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
     266            QString detail = QLatin1String("<h3><a name=") + QLatin1String(name.constData()) + QLatin1String("></a>void ") +
     267                             QLatin1String(name.constData()) + QLatin1Char(' ') +
     268                             QLatin1String(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
    268269            if (typeLib) {
    269270                interCount = 0;
     
    312313            stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl;
    313314            QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
    314                              QString::fromLatin1(type.constData()) +
    315                              QLatin1String(" ") + QString::fromLatin1(name.constData()) + QLatin1String("</h3>\n");
     315                             QLatin1String(type.constData()) +
     316                             QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
    316317            detail += docuFromName(typeInfo, QString::fromLatin1(name));
    317318            QVariant::Type vartype = QVariant::nameToType(type);
     
    327328                    detail += QLatin1String("\tint val = ");
    328329                else
    329                     detail += QLatin1String("\t") + QString::fromLatin1(type.constData()) + QLatin1String(" val = ");
    330                 detail += QLatin1String("object->property(\"") + QString::fromLatin1(name.constData()) +
    331                           QLatin1String("\").") + QString::fromLatin1(toType(type).constData()) + QLatin1String(";\n");
     330                    detail += QLatin1Char('\t') + QLatin1String(type.constData()) + QLatin1String(" val = ");
     331                detail += QLatin1String("object->property(\"") + QLatin1String(name.constData()) +
     332                          QLatin1String("\").") + QLatin1String(toType(type).constData()) + QLatin1String(";\n");
    332333                detail += QLatin1String("</pre>\n");
    333334            } else if (type == "IDispatch*" || type == "IUnknown*") {
    334335                detail += QLatin1String("<p>Get the subobject using querySubObject:<pre>\n");
    335                 detail += QLatin1String("\tQAxObject *") + QString::fromLatin1(name.constData()) +
    336                           QLatin1String(" = object->querySubObject(\"") + QString::fromLatin1(name.constData()) + QLatin1String("\");\n");
     336                detail += QLatin1String("\tQAxObject *") + QLatin1String(name.constData()) +
     337                          QLatin1String(" = object->querySubObject(\"") + QLatin1String(name.constData()) + QLatin1String("\");\n");
    337338                detail += QLatin1String("</pre>\n");
    338339            } else {
  • trunk/src/activeqt/container/qaxobject.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    3839****************************************************************************/
    3940
    40 #ifndef UNICODE
    41 #define UNICODE
    42 #endif
    43 
    4441#include "qaxobject.h"
    4542
     
    127124
    128125/*!
    129     \reimp
     126    \internal
    130127*/
    131128const QMetaObject *QAxObject::metaObject() const
     
    135132
    136133/*!
    137     \reimp
     134    \internal
    138135*/
    139136const QMetaObject *QAxObject::parentMetaObject() const
     
    153150
    154151/*!
    155     \reimp
     152    \internal
    156153*/
    157154const char *QAxObject::className() const
     
    161158
    162159/*!
    163     \reimp
     160    \internal
    164161*/
    165162int QAxObject::qt_metacall(QMetaObject::Call call, int id, void **v)
  • trunk/src/activeqt/container/qaxobject.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxscript.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    3839****************************************************************************/
    3940
    40 #ifndef UNICODE
    41 #define UNICODE
    42 #endif
    43 
    4441#include "qaxscript.h"
    4542
     
    195192        return E_POINTER;
    196193   
    197     QAxBase *object = script->findObject(QString::fromUtf16((const ushort*)pstrName));
     194    QAxBase *object = script->findObject(QString::fromWCharArray(pstrName));
    198195    if (!object)
    199196        return TYPE_E_ELEMENTNOTFOUND;
     
    237234    if (exception)
    238235        emit script->finished(exception->wCode,
    239         QString::fromUtf16((const ushort*)exception->bstrSource),
    240         QString::fromUtf16((const ushort*)exception->bstrDescription),
    241         QString::fromUtf16((const ushort*)exception->bstrHelpFile)
     236        QString::fromWCharArray(exception->bstrSource),
     237        QString::fromWCharArray(exception->bstrDescription),
     238        QString::fromWCharArray(exception->bstrHelpFile)
    242239                            );
    243240    return S_OK;
     
    288285    HRESULT hres = error->GetSourceLineText(&bstrLineText);
    289286    if (hres == S_OK) {
    290         lineText = QString::fromUtf16((const ushort*)bstrLineText);
     287        lineText = QString::fromWCharArray(bstrLineText);
    291288        SysFreeString(bstrLineText);
    292289    }
     
    295292    SysFreeString(exception.bstrHelpFile);
    296293
    297     emit script->error(exception.wCode, QString::fromUtf16((const ushort*)exception.bstrDescription), lineNumber, lineText);
     294    emit script->error(exception.wCode, QString::fromWCharArray(exception.bstrDescription), lineNumber, lineText);
    298295   
    299296    return S_OK;
     
    464461   
    465462    CLSID clsid;
    466     HRESULT hres = CLSIDFromProgID((WCHAR*)script_language.utf16(), &clsid);
     463    HRESULT hres = CLSIDFromProgID((wchar_t*)script_language.utf16(), &clsid);
    467464    if(FAILED(hres))
    468465        return false;
     
    610607        return;
    611608   
    612     engine->AddNamedItem((WCHAR*)name.utf16(), SCRIPTITEM_ISSOURCE|SCRIPTITEM_ISVISIBLE);
     609    engine->AddNamedItem((wchar_t*)name.utf16(), SCRIPTITEM_ISSOURCE|SCRIPTITEM_ISVISIBLE);
    613610#endif
    614611}
     
    11741171   
    11751172    CLSID clsid;
    1176     HRESULT hres = CLSIDFromProgID((WCHAR*)name.utf16(), &clsid);
     1173    HRESULT hres = CLSIDFromProgID((wchar_t*)name.utf16(), &clsid);
    11771174    if (hres != S_OK)
    11781175        return false;
     
    12041201       
    12051202        allFiles += QLatin1String(" *") + engine.extension;
    1206         specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1String(")");
    1207     }
    1208     allFiles += QLatin1String(")");
     1203        specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1Char(')');
     1204    }
     1205    allFiles += QLatin1Char(')');
    12091206   
    12101207    return allFiles + specialFiles + QLatin1String(";;All Files (*.*)");
  • trunk/src/activeqt/container/qaxscript.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxscriptwrapper.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxselect.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    5354    {
    5455        HKEY classes_key;
    55         QT_WA_INLINE(
    56             RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &classes_key),
    57             RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_READ, &classes_key));
     56        RegOpenKeyEx(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &classes_key);
    5857        if (!classes_key)
    5958            return;
     
    6160        DWORD index = 0;
    6261        LONG result = 0;
    63         TCHAR buffer[256];
    64         DWORD szBuffer = sizeof(buffer);
     62        wchar_t buffer[256];
     63        DWORD szBuffer = sizeof(buffer) / sizeof(wchar_t);
    6564        FILETIME ft;
    6665        do {
    67             result = QT_WA_INLINE(
    68                 RegEnumKeyExW(classes_key, index, (wchar_t*)&buffer, &szBuffer, 0, 0, 0, &ft),
    69                 RegEnumKeyExA(classes_key, index, (char*)&buffer, &szBuffer, 0, 0, 0, &ft));
    70             szBuffer = sizeof(buffer);
     66            result = RegEnumKeyEx(classes_key, index, buffer, &szBuffer, 0, 0, 0, &ft);
     67            szBuffer = sizeof(buffer) / sizeof(wchar_t);
    7168            if (result == ERROR_SUCCESS) {
    7269                HKEY sub_key;
    73                 QString clsid = QT_WA_INLINE(QString::fromUtf16((ushort*)buffer), QString::fromLocal8Bit((char*)buffer));
    74                 result = QT_WA_INLINE(
    75                     RegOpenKeyExW(classes_key, reinterpret_cast<const wchar_t *>(QString(clsid + "\\Control").utf16()), 0, KEY_READ, &sub_key),
    76                     RegOpenKeyA(classes_key, QString(clsid + QLatin1String("\\Control")).toLocal8Bit(), &sub_key));
     70                QString clsid = QString::fromWCharArray(buffer);
     71                result = RegOpenKeyEx(classes_key, reinterpret_cast<const wchar_t *>(QString(clsid + "\\Control").utf16()), 0, KEY_READ, &sub_key);
    7772                if (result == ERROR_SUCCESS) {
    7873                    RegCloseKey(sub_key);
    79                     QT_WA_INLINE(
    80                         RegistryQueryValueW(classes_key, buffer, (LPBYTE)buffer, &szBuffer),
    81                         RegQueryValueA(classes_key, (char*)buffer, (char*)buffer, (LONG*)&szBuffer));
    82                     QString name = QT_WA_INLINE(QString::fromUtf16((ushort*)buffer, szBuffer / sizeof(TCHAR)) , QString::fromLocal8Bit((char*)buffer, szBuffer));
     74                    RegistryQueryValue(classes_key, buffer, (LPBYTE)buffer, &szBuffer);
     75                    QString name = QString::fromWCharArray(buffer);
    8376
    8477                    controls << name;
     
    8780                result = ERROR_SUCCESS;
    8881            }
    89             szBuffer = sizeof(buffer);
     82            szBuffer = sizeof(buffer) / sizeof(wchar_t);
    9083            ++index;
    9184        } while (result == ERROR_SUCCESS);
     
    9487    }
    9588
    96     LONG RegistryQueryValueW(HKEY hKey, LPCWSTR lpSubKey, LPBYTE lpData, LPDWORD lpcbData)
     89    LONG RegistryQueryValue(HKEY hKey, LPCWSTR lpSubKey, LPBYTE lpData, LPDWORD lpcbData)
    9790    {
    9891        LONG ret = ERROR_FILE_NOT_FOUND;
    9992        HKEY hSubKey = NULL;
    100         RegOpenKeyExW(hKey, lpSubKey, 0, KEY_READ, &hSubKey);
     93        RegOpenKeyEx(hKey, lpSubKey, 0, KEY_READ, &hSubKey);
    10194        if (hSubKey) {
    102             ret = RegQueryValueExW(hSubKey, 0, 0, 0, lpData, lpcbData);
     95            ret = RegQueryValueEx(hSubKey, 0, 0, 0, lpData, lpcbData);
    10396            RegCloseKey(hSubKey);
    10497        }
  • trunk/src/activeqt/container/qaxselect.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxselect.ui

    r2 r561  
    44**
    55** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    6 ** Contact: Qt Software Information (qt-info@nokia.com)
     6** All rights reserved.
     7** Contact: Nokia Corporation (qt-info@nokia.com)
    78**
    89** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/container/qaxwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    3839****************************************************************************/
    3940
    40 #ifndef UNICODE
    41 #define UNICODE
    42 #endif
    43 
    44 
    4541#include "qaxwidget.h"
    4642
     
    124120
    125121    int qt_metacall(QMetaObject::Call, int isignal, void **argv);
     122    void* qt_metacast(const char *clname);
     123
    126124    inline QAxClientSite *clientSite() const
    127125    {
     
    384382
    385383private:
    386 #if !defined(Q_OS_WINCE)
     384#if !defined(Q_WS_WINCE)
    387385    struct OleMenuItem {
    388386        OleMenuItem(HMENU hm = 0, int ID = 0, QMenu *menu = 0)
     
    409407
    410408    DWORD m_dwOleObject;
    411 #if !defined(Q_OS_WINCE)
     409#if !defined(Q_WS_WINCE)
    412410    HWND m_menuOwner;
    413411#endif
     
    418416    QAxWidget *widget;
    419417    QAxHostWidget *host;
    420 #if !defined(Q_OS_WINCE)
     418#if !defined(Q_WS_WINCE)
    421419    QPointer<QMenuBar> menuBar;
    422420    QMap<QAction*,OleMenuItem> menuItemMap;
     
    468466#error "Fix QAbstractEventDispatcher::setEventFilter"
    469467#endif
    470 #if defined(Q_OS_WINCE)
     468#if defined(Q_WS_WINCE)
    471469static int filter_ref = 0;
    472470#else
    473 static const char *qaxatom = "QAxContainer4_Atom";
     471static const wchar_t *qaxatom = L"QAxContainer4_Atom";
    474472#endif
    475473
     
    484482        QAxHostWidget *host = 0;
    485483        while (!host && hwnd) {
    486             host = qobject_cast<QAxHostWidget*>(QWidget::find(hwnd));
     484            QWidget *widget = QWidget::find(hwnd);
     485            if (widget && widget->inherits("QAxHostWidget"))
     486                host = qobject_cast<QAxHostWidget*>(widget);
    487487            hwnd = ::GetParent(hwnd);
    488488        }
     
    533533
    534534QAxClientSite::QAxClientSite(QAxWidget *c)
    535 : ref(1), widget(c), host(0), eventTranslated(true)
     535: eventTranslated(true), ref(1), widget(c), host(0)
    536536{
    537537    aggregatedObject = widget->createAggregate();
     
    552552
    553553    m_dwOleObject = 0;
    554 #if !defined(Q_OS_WINCE)
     554#if !defined(Q_WS_WINCE)
    555555    m_menuOwner = 0;
    556556    menuBar = 0;
     
    715715        HRESULT result = m_spOleObject->GetUserType(USERCLASSTYPE_SHORT, &userType);
    716716        if (result == S_OK) {
    717             widget->setWindowTitle(QString::fromUtf16((const ushort *)userType));
     717            widget->setWindowTitle(QString::fromWCharArray(userType));
    718718            CoTaskMemFree(userType);
    719719        }
     
    982982HRESULT WINAPI QAxClientSite::TranslateAccelerator(LPMSG lpMsg, DWORD /*grfModifiers*/)
    983983{
    984     eventTranslated = false;
    985984    if (lpMsg->message == WM_KEYDOWN && !lpMsg->wParam)
    986985        return S_OK;
    987     QT_WA_INLINE(
    988         SendMessage(host->winId(), lpMsg->message, lpMsg->wParam, lpMsg->lParam),
    989         SendMessageA(host->winId(), lpMsg->message, lpMsg->wParam, lpMsg->lParam)
    990     );
     986
     987    bool ActiveQtDetected = false;
     988    bool fromInProcServer = false;
     989#ifdef GWLP_USERDATA
     990    LONG_PTR serverType = GetWindowLongPtr(lpMsg->hwnd, GWLP_USERDATA);
     991#else
     992    LONG serverType = GetWindowLong(lpMsg->hwnd, GWL_USERDATA);
     993#endif
     994    if (serverType == QAX_INPROC_SERVER) {
     995        ActiveQtDetected = true;
     996        fromInProcServer = true;
     997    } else if (serverType == QAX_OUTPROC_SERVER) {
     998        ActiveQtDetected = true;
     999        fromInProcServer = false;
     1000    }
     1001
     1002    eventTranslated = false;
     1003    if (!ActiveQtDetected || !fromInProcServer) {
     1004        // if the request is coming from an out-of-proc server or a non ActiveQt server,
     1005        // we send the message to the host window. This will make sure this key event
     1006        // comes to Qt for processing.
     1007        SendMessage(host->winId(), lpMsg->message, lpMsg->wParam, lpMsg->lParam);
     1008        if (ActiveQtDetected && !fromInProcServer) {
     1009            // ActiveQt based servers will need further processing of the event
     1010            // (eg. <SPACE> key for a checkbox), so we return false.
     1011            return S_FALSE;
     1012        }
     1013    }
     1014    // ActiveQt based in-processes-servers will handle the event properly, so
     1015    // we dont need to send this key event to the host.
    9911016    return S_OK;
    9921017}
     
    11331158
    11341159//**** IOleInPlaceFrame
    1135 #if defined(Q_OS_WINCE)
     1160#if defined(Q_WS_WINCE)
    11361161HRESULT WINAPI QAxClientSite::InsertMenus(HMENU /*hmenuShared*/, LPOLEMENUGROUPWIDTHS /*lpMenuWidths*/)
    11371162{
     
    11741199}
    11751200
    1176 static int menuItemEntry(HMENU menu, int index, MENUITEMINFOA item, QString &text, QPixmap &/*icon*/)
     1201static int menuItemEntry(HMENU menu, int index, MENUITEMINFO item, QString &text, QPixmap &/*icon*/)
    11771202{
    11781203    if (item.fType == MFT_STRING && item.cch) {
    1179         char *titlebuf = new char[item.cch+1];
     1204        wchar_t *titlebuf = new wchar_t[item.cch + 1];
    11801205        item.dwTypeData = titlebuf;
    11811206        item.cch++;
    1182         ::GetMenuItemInfoA(menu, index, true, &item);
    1183         text = QString::fromLocal8Bit(titlebuf);
    1184         delete []titlebuf;
     1207        ::GetMenuItemInfo(menu, index, true, &item);
     1208        text = QString::fromWCharArray(titlebuf);
     1209        delete [] titlebuf;
    11851210        return MFT_STRING;
    11861211    }
     
    11921217        QPixmap pixmap(1,1);
    11931218        QSize sz(MAP_LOGHIM_TO_PIX(bmsize.cx, pixmap.logicalDpiX()),
    1194             MAP_LOGHIM_TO_PIX(bmsize.cy, pixmap.logicalDpiY()));
     1219                 MAP_LOGHIM_TO_PIX(bmsize.cy, pixmap.logicalDpiY()));
    11951220
    11961221        pixmap.resize(bmsize.cx, bmsize.cy);
     
    12161241        popup = new QMenu(parent);
    12171242    for (int i = 0; i < count; ++i) {
    1218         MENUITEMINFOA item;
    1219         memset(&item, 0, sizeof(MENUITEMINFOA));
    1220         item.cbSize = sizeof(MENUITEMINFOA);
     1243        MENUITEMINFO item;
     1244        memset(&item, 0, sizeof(MENUITEMINFO));
     1245        item.cbSize = sizeof(MENUITEMINFO);
    12211246        item.fMask = MIIM_ID | MIIM_TYPE | MIIM_SUBMENU;
    1222         ::GetMenuItemInfoA(subMenu, i, true, &item);
     1247        ::GetMenuItemInfo(subMenu, i, true, &item);
    12231248
    12241249        QAction *action = 0;
     
    12961321        int count = GetMenuItemCount(hmenuShared);
    12971322        for (int i = 0; i < count; ++i) {
    1298             MENUITEMINFOA item;
    1299             memset(&item, 0, sizeof(MENUITEMINFOA));
    1300             item.cbSize = sizeof(MENUITEMINFOA);
     1323            MENUITEMINFO item;
     1324            memset(&item, 0, sizeof(MENUITEMINFO));
     1325            item.cbSize = sizeof(MENUITEMINFO);
    13011326            item.fMask = MIIM_ID | MIIM_TYPE | MIIM_SUBMENU;
    1302             ::GetMenuItemInfoA(hmenuShared, i, true, &item);
     1327            ::GetMenuItemInfo(hmenuShared, i, true, &item);
    13031328
    13041329            QAction *action = 0;
     
    13801405    OleMenuItem oleItem = menuItemMap.value(action);
    13811406    if (oleItem.hMenu)
    1382         ::PostMessageA(m_menuOwner, WM_COMMAND, oleItem.id, 0);
     1407        ::PostMessage(m_menuOwner, WM_COMMAND, oleItem.id, 0);
    13831408    return -1;
    13841409#endif
     
    14051430HRESULT WINAPI QAxClientSite::SetStatusText(LPCOLESTR pszStatusText)
    14061431{
    1407     QStatusTipEvent tip(QString::fromUtf16((const ushort *)(BSTR)pszStatusText));
     1432    QStatusTipEvent tip(QString::fromWCharArray(pszStatusText));
    14081433    QApplication::sendEvent(widget, &tip);
    14091434    return S_OK;
     
    14141439HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable)
    14151440{
     1441#if !defined(Q_OS_WINCE)
     1442    LockWindowUpdate(host->window()->winId());
     1443#endif
    14161444    EnableWindow(host->window()->winId(), fEnable);
    14171445
     
    14241452    }
    14251453    qt_win_ignoreNextMouseReleaseEvent = false;
    1426 
     1454#if !defined(Q_OS_WINCE)
     1455    LockWindowUpdate(0);
     1456#endif
    14271457    return S_OK;
    14281458}
     
    15121542{
    15131543    AX_DEBUG(QAxClientSite::SetActiveObject);
    1514 
    1515     if (pszObjName && widget)
    1516         widget->setWindowTitle(QString::fromUtf16((const ushort *)(BSTR)pszObjName));
     1544   
     1545    Q_UNUSED(pszObjName);
     1546    // we are ignoring the name of the object, as suggested by MSDN documentation
     1547    // for IOleInPlaceUIWindow::SetActiveObject().
    15171548
    15181549    if (m_spInPlaceActiveObject) {
     
    16241655        return axhost->qt_metacall(call, isignal, argv);
    16251656    return -1;
     1657}
     1658
     1659void* QAxHostWidget::qt_metacast(const char *clname)
     1660{
     1661    if (!clname) return 0;
     1662    if (!qstrcmp(clname,"QAxHostWidget"))
     1663        return static_cast<void*>(const_cast< QAxHostWidget*>(this));
     1664    return QWidget::qt_metacast(clname);
    16261665}
    16271666
     
    19531992
    19541993#if !defined(Q_OS_WINCE)
    1955     ATOM filter_ref = FindAtomA(qaxatom);
     1994    ATOM filter_ref = FindAtom(qaxatom);
    19561995#endif
    19571996    if (!filter_ref)
    19581997        previous_filter = QAbstractEventDispatcher::instance()->setEventFilter(axc_FilterProc);
    19591998#if !defined(Q_OS_WINCE)
    1960     AddAtomA(qaxatom);
     1999    AddAtom(qaxatom);
    19612000#else
    19622001    ++filter_ref;
     
    19932032    if (!control().isEmpty()) {
    19942033#if !defined(Q_OS_WINCE)
    1995         ATOM filter_ref = FindAtomA(qaxatom);
     2034        ATOM filter_ref = FindAtom(qaxatom);
    19962035        if (filter_ref)
    19972036            DeleteAtom(filter_ref);
    1998         filter_ref = FindAtomA(qaxatom);
     2037        filter_ref = FindAtom(qaxatom);
    19992038        if (!filter_ref) {
    20002039#else
     
    20432082
    20442083/*!
    2045     \reimp
     2084    \internal
    20462085*/
    20472086const QMetaObject *QAxWidget::metaObject() const
     
    20512090
    20522091/*!
    2053     \reimp
     2092    \internal
    20542093*/
    20552094const QMetaObject *QAxWidget::parentMetaObject() const
     
    20692108
    20702109/*!
    2071     \reimp
     2110    \internal
    20722111*/
    20732112const char *QAxWidget::className() const
     
    20772116
    20782117/*!
    2079     \reimp
     2118    \internal
    20802119*/
    20812120int QAxWidget::qt_metacall(QMetaObject::Call call, int id, void **v)
  • trunk/src/activeqt/container/qaxwidget.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/control.pro

    r2 r561  
    2525win32-g++:LIBS += -luuid
    2626
    27 contains(QT_EDITION, OpenSource|Console) {
    28     message( "You are not licensed to use ActiveQt." )
    29 } else {
    30     HEADERS     = qaxaggregated.h \
    31                   qaxbindable.h \
    32                   qaxfactory.h \
    33                   ../shared/qaxtypes.h
     27HEADERS =   qaxaggregated.h \
     28            qaxbindable.h \
     29            qaxfactory.h \
     30            ../shared/qaxtypes.h
    3431
    35     SOURCES     = qaxserver.cpp \
    36                   qaxserverbase.cpp \
    37                   qaxbindable.cpp \
    38                   qaxfactory.cpp \
    39                   qaxservermain.cpp \
    40                   qaxserverdll.cpp \
    41                   qaxmain.cpp \
    42                   ../shared/qaxtypes.cpp
    43 }
     32SOURCES =   qaxserver.cpp \
     33            qaxserverbase.cpp \
     34            qaxbindable.cpp \
     35            qaxfactory.cpp \
     36            qaxservermain.cpp \
     37            qaxserverdll.cpp \
     38            qaxmain.cpp \
     39            ../shared/qaxtypes.cpp
  • trunk/src/activeqt/control/qaxaggregated.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/qaxbindable.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/qaxbindable.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/qaxfactory.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    5152QT_BEGIN_NAMESPACE
    5253
    53 extern char qAxModuleFilename[MAX_PATH];
     54extern wchar_t qAxModuleFilename[MAX_PATH];
    5455
    5556/*!
     
    278279
    279280    if (licenseKey.isEmpty()) {
    280         QString licFile(QFile::decodeName(qAxModuleFilename));
     281        QString licFile(QString::fromWCharArray(qAxModuleFilename));
    281282        int lastDot = licFile.lastIndexOf(QLatin1Char('.'));
    282283        licFile = licFile.left(lastDot) + QLatin1String(".lic");
     
    361362}
    362363
    363 extern char qAxModuleFilename[MAX_PATH];
     364extern wchar_t qAxModuleFilename[MAX_PATH];
    364365
    365366/*!
     
    373374QString QAxFactory::serverDirPath()
    374375{
    375     return QFileInfo(QString::fromLocal8Bit(qAxModuleFilename)).absolutePath();
     376    return QFileInfo(QString::fromWCharArray(qAxModuleFilename)).absolutePath();
    376377}
    377378
     
    385386QString QAxFactory::serverFilePath()
    386387{
    387     return QString::fromLocal8Bit(qAxModuleFilename);
     388    return QString::fromWCharArray(qAxModuleFilename);
    388389}
    389390
     
    493494        return false;
    494495
    495     if (!QString::fromLocal8Bit(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe")))
     496    if (!QString::fromWCharArray(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe")))
    496497        return false;
    497498
  • trunk/src/activeqt/control/qaxfactory.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/qaxmain.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
  • trunk/src/activeqt/control/qaxserver.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    6465HANDLE qAxInstance = 0;
    6566ITypeLib *qAxTypeLibrary = 0;
    66 char qAxModuleFilename[MAX_PATH];
     67wchar_t qAxModuleFilename[MAX_PATH];
    6768bool qAxOutProcServer = false;
    6869
     
    9192        for (int i = 0; i < keys.count(); ++i) {
    9293            QString key(keys.at(i));
    93             qRegisterMetaType((key + QLatin1String("*")).toLatin1(), (void**)0);
     94            qRegisterMetaType((key + QLatin1Char('*')).toLatin1(), (void**)0);
    9495        }
    9596    }
     
    117118    InitializeCriticalSection(&qAxModuleSection);
    118119   
    119     libFile = QString::fromLocal8Bit(qAxModuleFilename);
     120    libFile = QString::fromWCharArray(qAxModuleFilename);
    120121    libFile = libFile.toLower();
    121     if (LoadTypeLibEx((TCHAR*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
     122    if (LoadTypeLibEx((wchar_t*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
    122123        return libFile;
    123124
    124125    int lastDot = libFile.lastIndexOf(QLatin1Char('.'));
    125126    libFile = libFile.left(lastDot) + QLatin1String(".tlb");
    126     if (LoadTypeLibEx((TCHAR*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
     127    if (LoadTypeLibEx((wchar_t*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
    127128        return libFile;
    128129
    129130    lastDot = libFile.lastIndexOf(QLatin1Char('.'));
    130131    libFile = libFile.left(lastDot) + QLatin1String(".olb");
    131     if (LoadTypeLibEx((TCHAR*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
     132    if (LoadTypeLibEx((wchar_t*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
    132133        return libFile;
    133134
     
    208209{
    209210    qAxIsServer = false;
    210     QString file = QString::fromLocal8Bit(qAxModuleFilename);
    211     QString path = file.left(file.lastIndexOf(QLatin1String("\\"))+1);
     211    QString file = QString::fromWCharArray(qAxModuleFilename);
     212    QString path = file.left(file.lastIndexOf(QLatin1Char('\\'))+1);
    212213    QString module = file.right(file.length() - path.length());
    213     module = module.left(module.lastIndexOf(QLatin1String(".")));
     214    module = module.left(module.lastIndexOf(QLatin1Char('.')));
    214215   
    215216    const QString appId = qAxFactory()->appID().toString().toUpper();
     
    227228    DWORD major = libAttr->wMajorVerNum;
    228229    DWORD minor = libAttr->wMinorVerNum;
    229     typeLibVersion = QString::number((uint)major) + QLatin1String(".") + QString::number((uint)minor);
     230    typeLibVersion = QString::number((uint)major) + QLatin1Char('.') + QString::number((uint)minor);
    230231
    231232    if (bRegister)
    232         RegisterTypeLib(qAxTypeLibrary, (TCHAR*)libFile.utf16(), 0);
     233        RegisterTypeLib(qAxTypeLibrary, (wchar_t*)libFile.utf16(), 0);
    233234    else
    234235        UnRegisterTypeLib(libAttr->guid, libAttr->wMajorVerNum, libAttr->wMinorVerNum, libAttr->lcid, libAttr->syskind);
     
    272273
    273274            if (object) { // don't register subobject classes
    274                 QString classVersion = mo ? QString(QLatin1String(mo->classInfo(mo->indexOfClassInfo("Version")).value())) : QString();
     275                QString classVersion = mo ? QString::fromLatin1(mo->classInfo(mo->indexOfClassInfo("Version")).value()) : QString();
    275276                if (classVersion.isNull())
    276277                    classVersion = QLatin1String("1.0");
    277278                bool insertable = mo && !qstricmp(mo->classInfo(mo->indexOfClassInfo("Insertable")).value(), "yes");
    278279                bool control = object->isWidgetType();
    279                 const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1String(".")));
     280                const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.')));
    280281                uint olemisc = OLEMISC_SETCLIENTSITEFIRST
    281282                    |OLEMISC_ACTIVATEWHENVISIBLE
     
    288289                    olemisc |= OLEMISC_WANTSTOMENUMERGE;
    289290               
    290                 settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));
    291                 settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/CLSID/."), classId);
     291                settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));
     292                settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."), classId);
    292293                if (insertable)
    293                     settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));
     294                    settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));
    294295               
    295                 settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/."), className + QLatin1String(" Class"));
    296                 settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."), classId);
    297                 settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CurVer/."), module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion);
     296                settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."), className + QLatin1String(" Class"));
     297                settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."), classId);
     298                settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."), module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
    298299               
    299300                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/."), className + QLatin1String(" Class"));
    300                 if (file.right(3).toLower() == QLatin1String("exe"))
     301                if (file.endsWith(QLatin1String("exe"), Qt::CaseInsensitive))
    301302                    settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"), appId);
    302303                if (control)
     
    308309                else
    309310                    settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/LocalServer32/."),
    310                                       QLatin1String("\"") + file + QLatin1String("\" -activex"));
     311                                      QLatin1Char('\"') + file + QLatin1String("\" -activex"));
    311312                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/."), control ? QLatin1String("1") : QLatin1String("0"));
    312313                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/1/."), QString::number(olemisc));
    313314                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Programmable/."), QVariant(QLatin1String("")));
    314                 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1String("\"") +
     315                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1Char('\"') +
    315316                                  file + QLatin1String("\", 101"));
    316317                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/TypeLib/."), libId); settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Version/."), classVersion);
    317                 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/VersionIndependentProgID/."), module + QLatin1String(".") + className);
    318                 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ProgID/."), module + QLatin1String(".") + className + QLatin1String(".") + classVersion.left(classVersion.indexOf(QLatin1Char('.'))));
     318                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/VersionIndependentProgID/."), module + QLatin1Char('.') + className);
     319                settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ProgID/."), module + QLatin1Char('.') + className + QLatin1Char('.') + classVersion.left(classVersion.indexOf(QLatin1Char('.'))));
    319320
    320321                QString mime = QLatin1String(mo->classInfo(mo->indexOfClassInfo("MIME")).value());
     
    331332                            // Prepend '.' before extension, if required.
    332333                            extension = extension.trimmed();
    333                             if (extension[0] != QChar(QLatin1Char('.')))
    334                                 extension = QLatin1String(".") + extension;
     334                            if (extension[0] != QLatin1Char('.'))
     335                                extension = QLatin1Char('.') + extension;
    335336                        }
    336337
    337338                        if (!extension.isEmpty()) {
    338                             settings.setValue(QLatin1String("/") + extension + QLatin1String("/."), module + QLatin1String(".") + className);
    339                             settings.setValue(QLatin1String("/") + extension + QLatin1String("/Content Type"), mime);
    340 
    341                             mime = mime.replace(QLatin1String("/"), QLatin1String("\\"));
     339                            settings.setValue(QLatin1Char('/') + extension + QLatin1String("/."), module + QLatin1Char('.') + className);
     340                            settings.setValue(QLatin1Char('/') + extension + QLatin1String("/Content Type"), mime);
     341
     342                            mime = mime.replace(QLatin1Char('/'), QLatin1Char('\\'));
    342343                            settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID"), classId);
    343344                            settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension"), extension);
     
    352353        }
    353354    } else {
     355        if (qAxOutProcServer) {
     356            settings.remove(QLatin1String("/AppID/") + appId + QLatin1String("/."));
     357            settings.remove(QLatin1String("/AppID/") + module + QLatin1String(".EXE"));
     358        }
    354359        QStringList keys = qAxFactory()->featureList();
    355360        for (QStringList::Iterator key = keys.begin(); key != keys.end(); ++key) {
     
    359364            className = qax_clean_type(className, mo);
    360365           
    361             QString classVersion = mo ? QString(QLatin1String(mo->classInfo(mo->indexOfClassInfo("Version")).value())) : QString();
     366            QString classVersion = mo ? QString::fromLatin1(mo->classInfo(mo->indexOfClassInfo("Version")).value()) : QString();
    362367            if (classVersion.isNull())
    363368                classVersion = QLatin1String("1.0");
    364             const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1String(".")));
     369            const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.')));
    365370           
    366371            qAxFactory()->unregisterClass(*key, &settings);
    367372           
    368             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/CLSID/."));
    369             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."));
    370             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."));
    371             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion);
     373            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."));
     374            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."));
     375            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."));
     376            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
    372377           
    373             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."));
    374             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CurVer/."));
    375             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/."));
    376             settings.remove(QLatin1String("/") + module + QLatin1String(".") + className);
     378            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."));
     379            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."));
     380            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."));
     381            settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className);
    377382           
    378383            settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"));
     
    405410                        // Prepend '.' before extension, if required.
    406411                        extension = extension.trimmed();
    407                         if (extension[0] != QChar(QLatin1Char('.')))
    408                             extension = QLatin1String(".") + extension;
     412                        if (extension[0] != QLatin1Char('.'))
     413                            extension.prepend(QLatin1Char('.'));
    409414                    }
    410415                    if (!extension.isEmpty()) {
    411                         settings.remove(QLatin1String("/") + extension + QLatin1String("/Content Type"));
    412                         settings.remove(QLatin1String("/") + extension + QLatin1String("/."));
    413                         settings.remove(QLatin1String("/") + extension);
    414                         mime = mime.replace(QLatin1String("/"), QLatin1String("\\"));
     416                        settings.remove(QLatin1Char('/') + extension + QLatin1String("/Content Type"));
     417                        settings.remove(QLatin1Char('/') + extension + QLatin1String("/."));
     418                        settings.remove(QLatin1Char('/') + extension);
     419                        mime.replace(QLatin1Char('/'), QLatin1Char('\\'));
    415420                        settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension"));
    416421                        settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID"));
     
    456461    { "QPixmap",        "IPictureDisp*" },
    457462    { "QVariant",       "VARIANT" },
    458     { "QVariantList",   "SAFEARRAY(VARIANT)" },
    459     { "QList<QVariant>","SAFEARRAY(VARIANT)" },
     463    { "QVariantList",    "SAFEARRAY(VARIANT)" },
     464    { "QList<QVariant>", "SAFEARRAY(VARIANT)" },
    460465    { "quint64",        "CY" },
    461466    { "qint64",         "CY" },
     
    465470    { "QStringList",    "SAFEARRAY(BSTR)" },
    466471    // Userdefined Qt datatypes - some not on Borland though
    467     { "QCursor",        "enum MousePointer" },
    468     { "Qt::FocusPolicy","enum FocusPolicy" },
     472    { "QCursor",         "enum MousePointer" },
     473    { "Qt::FocusPolicy", "enum FocusPolicy" },
    469474#ifndef Q_CC_BOR
    470475# if __REQUIRED_RPCNDR_H_VERSION__ >= Q_REQUIRED_RPCNDR_H_VERSION
     
    579584    if (mapping.contains(name)) {
    580585        int n = mapping.value(name);
    581         newName = name + "_" + QByteArray::number(n);
     586        newName = name + '_' + QByteArray::number(n);
    582587        mapping.insert(name, n+1);
    583588    } else {
     
    687692        QByteArray name(parameterNames.at(p));
    688693       
    689         if (type.endsWith("&")) {
     694        if (type.endsWith('&')) {
    690695            out = true;
    691696            type.truncate(type.length() - 1);
     
    693698            out = true;
    694699            type.truncate(type.length() - 1);
    695         } else if (type.endsWith("*") && !subtypes.contains(type)) {
     700        } else if (type.endsWith('*') && !subtypes.contains(type)) {
    696701            type.truncate(type.length() - 1);
    697702        }
     
    702707        type = convertTypes(type, ok);
    703708        if (!out)
    704             prototype += "[in] " + type + " ";
     709            prototype += "[in] " + type + ' ';
    705710        else
    706             prototype += "[in,out] " + type + " ";
     711            prototype += "[in,out] " + type + ' ';
    707712       
    708713        if (out)
    709             prototype += "*";
     714            prototype += '*';
    710715        if (name.isEmpty())
    711             prototype += "p" + QByteArray::number(p);
     716            prototype += 'p' + QByteArray::number(p);
    712717        else
    713718            prototype += "p_" + replaceKeyword(name);
     
    729734    int in = -1;
    730735    while (numDefArgs) {
    731         in = ptype.lastIndexOf("]", in);
     736        in = ptype.lastIndexOf(']', in);
    732737        ptype.replace(in, 1, ",optional]");
    733738        in = ptype.indexOf(' ', in) + 1;
    734739        QByteArray type = ptype.mid(in, ptype.indexOf(' ', in) - in);
    735740        if (type == "enum")
    736             type += " " + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
     741            type += ' ' + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
    737742        ptype.replace(in, type.length(), QByteArray("VARIANT /*was: ") + type + "*/");
    738743        --numDefArgs;
     
    802807            QByteArray key(enumerator.key(j));
    803808            while (enumValues.contains(key)) {
    804                 key += "_";
     809                key += '_';
    805810            }
    806811            enumValues.append(key);
     
    823828        enums.append("MousePointer");
    824829        out << "\tenum MousePointer {" << endl;
    825         out << "\t\tArrowCursor             = " << Qt::ArrowCursor << "," << endl;
    826         out << "\t\tUpArrowCursor           = " << Qt::UpArrowCursor << "," << endl;
    827         out << "\t\tCrossCursor             = " << Qt::CrossCursor << "," << endl;
    828         out << "\t\tWaitCursor              = " << Qt::WaitCursor << "," << endl;
    829         out << "\t\tIBeamCursor             = " << Qt::IBeamCursor << "," << endl;
    830         out << "\t\tSizeVerCursor           = " << Qt::SizeVerCursor << "," << endl;
    831         out << "\t\tSizeHorCursor           = " << Qt::SizeHorCursor << "," << endl;
    832         out << "\t\tSizeBDiagCursor         = " << Qt::SizeBDiagCursor << "," << endl;
    833         out << "\t\tSizeFDiagCursor         = " << Qt::SizeFDiagCursor << "," << endl;
    834         out << "\t\tSizeAllCursor           = " << Qt::SizeAllCursor << "," << endl;
    835         out << "\t\tBlankCursor             = " << Qt::BlankCursor << "," << endl;
    836         out << "\t\tSplitVCursor            = " << Qt::SplitVCursor << "," << endl;
    837         out << "\t\tSplitHCursor            = " << Qt::SplitHCursor << "," << endl;
    838         out << "\t\tPointingHandCursor      = " << Qt::PointingHandCursor << "," << endl;
    839         out << "\t\tForbiddenCursor         = " << Qt::ForbiddenCursor << "," << endl;
    840         out << "\t\tWhatsThisCursor         = " << Qt::WhatsThisCursor << "," << endl;
     830        out << "\t\tArrowCursor             = " << Qt::ArrowCursor << ',' << endl;
     831        out << "\t\tUpArrowCursor           = " << Qt::UpArrowCursor << ',' << endl;
     832        out << "\t\tCrossCursor             = " << Qt::CrossCursor << ',' << endl;
     833        out << "\t\tWaitCursor              = " << Qt::WaitCursor << ',' << endl;
     834        out << "\t\tIBeamCursor             = " << Qt::IBeamCursor << ',' << endl;
     835        out << "\t\tSizeVerCursor           = " << Qt::SizeVerCursor << ',' << endl;
     836        out << "\t\tSizeHorCursor           = " << Qt::SizeHorCursor << ',' << endl;
     837        out << "\t\tSizeBDiagCursor         = " << Qt::SizeBDiagCursor << ',' << endl;
     838        out << "\t\tSizeFDiagCursor         = " << Qt::SizeFDiagCursor << ',' << endl;
     839        out << "\t\tSizeAllCursor           = " << Qt::SizeAllCursor << ',' << endl;
     840        out << "\t\tBlankCursor             = " << Qt::BlankCursor << ',' << endl;
     841        out << "\t\tSplitVCursor            = " << Qt::SplitVCursor << ',' << endl;
     842        out << "\t\tSplitHCursor            = " << Qt::SplitHCursor << ',' << endl;
     843        out << "\t\tPointingHandCursor      = " << Qt::PointingHandCursor << ',' << endl;
     844        out << "\t\tForbiddenCursor         = " << Qt::ForbiddenCursor << ',' << endl;
     845        out << "\t\tWhatsThisCursor         = " << Qt::WhatsThisCursor << ',' << endl;
    841846        out << "\t\tBusyCursor\t= " << Qt::BusyCursor << endl;
    842847        out << "\t};" << endl << endl;
     
    845850        enums.append("FocusPolicy");
    846851        out << "\tenum FocusPolicy {" << endl;
    847         out << "\t\tNoFocus             = " << Qt::NoFocus << "," << endl;
    848         out << "\t\tTabFocus            = " << Qt::TabFocus << "," << endl;
    849         out << "\t\tClickFocus          = " << Qt::ClickFocus << "," << endl;
    850         out << "\t\tStrongFocus         = " << Qt::StrongFocus << "," << endl;
     852        out << "\t\tNoFocus             = " << Qt::NoFocus << ',' << endl;
     853        out << "\t\tTabFocus            = " << Qt::TabFocus << ',' << endl;
     854        out << "\t\tClickFocus          = " << Qt::ClickFocus << ',' << endl;
     855        out << "\t\tStrongFocus         = " << Qt::StrongFocus << ',' << endl;
    851856        out << "\t\tWheelFocus          = " << Qt::WheelFocus << endl;
    852857        out << "\t};" << endl << endl;
     
    878883            out << "\t/****** Property is of unsupported datatype" << endl;
    879884       
    880         out << "\t\t[id(" << id << ")";
     885        out << "\t\t[id(" << id << ')';
    881886        if (!property.isWritable())
    882887            out << ", readonly";
     
    887892        if (isBindable)
    888893            out << ", requestedit";
    889         if (defProp == QString::fromLatin1(name.constData()))
     894        if (defProp == QLatin1String(name))
    890895            out << ", uidefault";
    891         out << "] " << type << " " << name << ";" << endl;
     896        out << "] " << type << ' ' << name << ';' << endl;
    892897       
    893898        if (!ok)
     
    940945            outBuffer += "\t/****** Slot parameter uses unsupported datatype\n";
    941946       
    942         outBuffer += "\t\t[id(" + QString::number(id).toLatin1() + ")] " + type + " " + name + "(" + ptype + ");\n";
     947        outBuffer += "\t\t[id(" + QString::number(id).toLatin1() + ")] " + type + ' ' + name + '(' + ptype + ");\n";
    943948       
    944949        if (!ok)
     
    992997            QList<QByteArray> parameterNames(signal.parameterNames());
    993998           
    994             bool isDefault = defSignal == QString::fromLatin1(name.constData());
     999            bool isDefault = defSignal == QLatin1String(name);
    9951000            name = renameOverloads(replaceKeyword(name));
    9961001            bool ok = true;
     
    10041009                out << "\t/****** Signal parameter uses unsupported datatype" << endl;
    10051010           
    1006             out << "\t\t[id(" << id << ")";
     1011            out << "\t\t[id(" << id << ')';
    10071012            if (isDefault)
    10081013                out << ", uidefault";
    1009             out << "] void " << name << "(" << ptype << ");" << endl;
     1014            out << "] void " << name << '(' << ptype << ");" << endl;
    10101015           
    10111016            if (!ok)
     
    10321037    if (classVersion)
    10331038        out << "\t\tversion(" << classVersion << ")," << endl;
    1034     out << "\t\tuuid(" << classID << ")";
     1039    out << "\t\tuuid(" << classID << ')';
    10351040    if (control) {
    10361041        out << ", " << endl;
     
    10441049    out << "\tcoclass " << cleanClassName << endl;
    10451050    out << "\t{" << endl;
    1046     out << "\t\t[default] dispinterface I" << cleanClassName << ";" << endl;
     1051    out << "\t\t[default] dispinterface I" << cleanClassName << ';' << endl;
    10471052    if (hasEvents)
    10481053        out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << endl;
     
    10681073    file.remove();
    10691074   
    1070     QString filebase = QString::fromLocal8Bit(qAxModuleFilename);
    1071     filebase = filebase.left(filebase.lastIndexOf(QLatin1String(".")));
     1075    QString filebase = QString::fromWCharArray(qAxModuleFilename);
     1076    filebase = filebase.left(filebase.lastIndexOf(QLatin1Char('.')));
    10721077   
    10731078    QString appID = qAxFactory()->appID().toString().toUpper();
     
    11041109    out << "** Interface definition generated for ActiveQt project" << endl;
    11051110    out << "**" << endl;
    1106     out << "**     '" << qAxModuleFilename << "'" << endl;
     1111    out << "**     '" << QString::fromWCharArray(qAxModuleFilename) << '\'' << endl;
    11071112    out << "**" << endl;
    11081113    out << "** Created:  " << QDateTime::currentDateTime().toString() << endl;
     
    11221127    }
    11231128   
    1124     out << "[" << endl;
     1129    out << '[' << endl;
    11251130    out << "\tuuid(" << typeLibID << ")," << endl;
    11261131    out << "\tversion(" << version << ")," << endl;
    1127     out << "\thelpstring(\"" << typelib << " " << version << " Type Library\")" << endl;
    1128     out << "]" << endl;
     1132    out << "\thelpstring(\"" << typelib << ' ' << version << " Type Library\")" << endl;
     1133    out << ']' << endl;
    11291134    out << "library " << typelib << "Lib" << endl;
    1130     out << "{" << endl;
     1135    out << '{' << endl;
    11311136    out << "\timportlib(\"stdole32.tlb\");" << endl;
    11321137    out << "\timportlib(\"stdole2.tlb\");" << endl << endl;
     
    11891194        if (mo) {
    11901195            QByteArray cleanType = qax_clean_type(*key, mo).toLatin1();
    1191             out << "\tcoclass " << cleanType << ";" << endl;
     1196            out << "\tcoclass " << cleanType << ';' << endl;
    11921197            subtypes.append(cleanType);
    1193             subtypes.append(cleanType + "*");
    11941198            qRegisterMetaType(cleanType, (void**)0);
    1195             qRegisterMetaType(cleanType + "*", (void**)0);
     1199            cleanType += '*';
     1200            subtypes.append(cleanType);
     1201            qRegisterMetaType(cleanType, (void**)0);
    11961202        }
    11971203    }
     
    12261232        QByteArray cleanType = qax_clean_type(*key, mo).toLatin1();
    12271233        subtypes.append(cleanType);
    1228         subtypes.append(cleanType + "*");
     1234        subtypes.append(cleanType + '*');
    12291235        res = classIDL(o, mo, QString::fromLatin1(className.constData()), isBindable, out);
    12301236        delete o;
  • trunk/src/activeqt/control/qaxserverbase.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    789790    while (!axbase && baseHwnd) {
    790791#ifdef GWLP_USERDATA
    791         QT_WA({
    792             axbase = (QAxServerBase*)GetWindowLongPtrW(baseHwnd, GWLP_USERDATA);
    793         }, {
    794             axbase = (QAxServerBase*)GetWindowLongPtrA(baseHwnd, GWLP_USERDATA);
    795         });
     792        axbase = (QAxServerBase*)GetWindowLongPtr(baseHwnd, GWLP_USERDATA);
    796793#else
    797         QT_WA({
    798             axbase = (QAxServerBase*)GetWindowLongW(baseHwnd, GWL_USERDATA);
    799         }, {
    800             axbase = (QAxServerBase*)GetWindowLongA(baseHwnd, GWL_USERDATA);
    801         });
     794        axbase = (QAxServerBase*)GetWindowLong(baseHwnd, GWL_USERDATA);
    802795#endif
    803796
     
    906899        // hook into eventloop; this allows a server to create his own QApplication object
    907900        if (!qax_hhook && qax_ownQApp) {
    908             QT_WA({
    909                 qax_hhook = SetWindowsHookExW(WH_GETMESSAGE, axs_FilterProc, 0, GetCurrentThreadId());
    910             }, {
    911                 qax_hhook = SetWindowsHookExA(WH_GETMESSAGE, axs_FilterProc, 0, GetCurrentThreadId());
    912             });
     901            qax_hhook = SetWindowsHookEx(WH_GETMESSAGE, axs_FilterProc, 0, GetCurrentThreadId());
    913902        }
    914903
     
    984973    HRESULT WINAPI CreateInstanceLic(IUnknown *pUnkOuter, IUnknown *pUnkReserved, REFIID iid, BSTR bKey, PVOID *ppObject)
    985974    {
    986         QString licenseKey = QString::fromUtf16((const ushort *)bKey);
     975        QString licenseKey = QString::fromWCharArray(bKey);
    987976        if (!qAxFactory()->validateLicenseKey(className, licenseKey))
    988977            return CLASS_E_NOTLICENSED;
     
    13041293    internalBind();
    13051294    if (isWidget) {
    1306         if (!stayTopLevel) {
    1307             QEvent e(QEvent::EmbeddingControl);
    1308             QApplication::sendEvent(qt.widget, &e);
    1309             QT_WA({
    1310                 ::SetWindowLongW(qt.widget->winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
    1311             }, {
    1312                 ::SetWindowLongA(qt.widget->winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
    1313             });
    1314         }
     1295        if (!stayTopLevel) {
     1296            QEvent e(QEvent::EmbeddingControl);
     1297            QApplication::sendEvent(qt.widget, &e);
     1298            ::SetWindowLong(qt.widget->winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
     1299        }
    13151300        qt.widget->setAttribute(Qt::WA_QuitOnClose, false);
    13161301        qt.widget->move(0, 0);
     
    13691354{
    13701355    if (uMsg == WM_CREATE) {
    1371         QAxServerBase *that;
    1372         QT_WA({
    1373             CREATESTRUCTW *cs = (CREATESTRUCTW*)lParam;
    1374             that = (QAxServerBase*)cs->lpCreateParams;
    1375         }, {
    1376             CREATESTRUCTA *cs = (CREATESTRUCTA*)lParam;
    1377             that = (QAxServerBase*)cs->lpCreateParams;
    1378         });
     1356        CREATESTRUCT *cs = (CREATESTRUCT*)lParam;
     1357        QAxServerBase *that = (QAxServerBase*)cs->lpCreateParams;
    13791358
    13801359#ifdef GWLP_USERDATA
    1381         QT_WA({
    1382             SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)that);
    1383         }, {
    1384             SetWindowLongPtrA(hWnd, GWLP_USERDATA, (LONG_PTR)that);
    1385         });
     1360        SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)that);
    13861361#else
    1387         QT_WA({
    1388             SetWindowLongW(hWnd, GWL_USERDATA, (LONG)that);
    1389         }, {
    1390             SetWindowLongA(hWnd, GWL_USERDATA, (LONG)that);
    1391         });
     1362        SetWindowLong(hWnd, GWL_USERDATA, (LONG)that);
    13921363#endif
    13931364
    1394         that->m_hWnd = hWnd;
    1395 
    1396         QT_WA({
    1397             return ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
    1398         }, {
    1399             return ::DefWindowProcA(hWnd, uMsg, wParam, lParam);
    1400         });
     1365        that->m_hWnd = hWnd;
     1366
     1367        return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
    14011368    }
    14021369
     
    14041371
    14051372#ifdef GWLP_USERDATA
    1406     QT_WA({
    1407         that = (QAxServerBase*)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
    1408     }, {
    1409         that = (QAxServerBase*)GetWindowLongPtrA(hWnd, GWLP_USERDATA);
    1410     });
     1373    that = (QAxServerBase*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
    14111374#else
    1412     QT_WA({
    1413         that = (QAxServerBase*)GetWindowLongW(hWnd, GWL_USERDATA);
    1414     }, {
    1415         that = (QAxServerBase*)GetWindowLongA(hWnd, GWL_USERDATA);
    1416     });
     1375    that = (QAxServerBase*)GetWindowLong(hWnd, GWL_USERDATA);
    14171376#endif
    14181377
     
    15641523    }
    15651524
    1566     QT_WA({
    1567         return ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
    1568     }, {
    1569         return ::DefWindowProcA(hWnd, uMsg, wParam, lParam);
    1570     });
     1525    return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
    15711526}
    15721527
     
    15841539    cn += QString::number((int)ActiveXProc);
    15851540    if (!atom) {
    1586         QT_WA({
    1587             WNDCLASSW wcTemp;
    1588             wcTemp.style = CS_DBLCLKS;
    1589             wcTemp.cbClsExtra = 0;
    1590             wcTemp.cbWndExtra = 0;
    1591             wcTemp.hbrBackground = 0;
    1592             wcTemp.hCursor = 0;
    1593             wcTemp.hIcon = 0;
    1594             wcTemp.hInstance = hInst;
    1595             wcTemp.lpszClassName = (wchar_t*)cn.utf16();
    1596             wcTemp.lpszMenuName = 0;
    1597             wcTemp.lpfnWndProc = ActiveXProc;
    1598 
    1599             atom = RegisterClassW(&wcTemp);
    1600         }, {
    1601             QByteArray cna = cn.toLatin1();
    1602             WNDCLASSA wcTemp;
    1603             wcTemp.style = CS_DBLCLKS;
    1604             wcTemp.cbClsExtra = 0;
    1605             wcTemp.cbWndExtra = 0;
    1606             wcTemp.hbrBackground = 0;
    1607             wcTemp.hCursor = 0;
    1608             wcTemp.hIcon = 0;
    1609             wcTemp.hInstance = hInst;
    1610             wcTemp.lpszClassName = cna.data();
    1611             wcTemp.lpszMenuName = 0;
    1612             wcTemp.lpfnWndProc = ActiveXProc;
    1613 
    1614             atom = RegisterClassA(&wcTemp);
    1615         });
     1541        WNDCLASS wcTemp;
     1542        wcTemp.style = CS_DBLCLKS;
     1543        wcTemp.cbClsExtra = 0;
     1544        wcTemp.cbWndExtra = 0;
     1545        wcTemp.hbrBackground = 0;
     1546        wcTemp.hCursor = 0;
     1547        wcTemp.hIcon = 0;
     1548        wcTemp.hInstance = hInst;
     1549        wcTemp.lpszClassName = (wchar_t*)cn.utf16();
     1550        wcTemp.lpszMenuName = 0;
     1551        wcTemp.lpfnWndProc = ActiveXProc;
     1552
     1553        atom = RegisterClass(&wcTemp);
    16161554    }
    16171555    LeaveCriticalSection(&createWindowSection);
     
    16201558
    16211559    Q_ASSERT(!m_hWnd);
    1622     HWND hWnd = 0;
    1623     QT_WA({
    1624         hWnd = ::CreateWindowW((wchar_t*)cn.utf16(), 0,
    1625             WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
    1626             rcPos.left, rcPos.top, rcPos.right - rcPos.left,
    1627             rcPos.bottom - rcPos.top, hWndParent, 0, hInst, this);
    1628     }, {
    1629         hWnd = ::CreateWindowA(cn.toLatin1().data(), 0,
    1630             WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
    1631             rcPos.left, rcPos.top, rcPos.right - rcPos.left,
    1632             rcPos.bottom - rcPos.top, hWndParent, 0, hInst, this);
    1633     });
     1560    HWND hWnd = ::CreateWindow((wchar_t*)cn.utf16(), 0,
     1561                               WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
     1562                               rcPos.left, rcPos.top, rcPos.right - rcPos.left,
     1563                               rcPos.bottom - rcPos.top, hWndParent, 0, hInst, this);
    16341564
    16351565    Q_ASSERT(m_hWnd == hWnd);
     
    16771607            actionMap.insert(itemId, action);
    16781608        }
    1679         QT_WA({
    1680             AppendMenuW(popupMenu, flags, itemId, (TCHAR*)action->text().utf16());
    1681         }, {
    1682             AppendMenuA(popupMenu, flags, itemId, action->text().toLocal8Bit());
    1683         });
     1609        AppendMenu(popupMenu, flags, itemId, (const wchar_t *)action->text().utf16());
    16841610    }
    16851611    if (oldMenu)
     
    17271653            actionMap.insert(itemId, action);
    17281654        }
    1729         QT_WA({
    1730             AppendMenuW(hmenuShared, flags, itemId, (TCHAR*)action->text().utf16());
    1731         } , {
    1732             AppendMenuA(hmenuShared, flags, itemId, action->text().toLocal8Bit());
    1733         });
     1655        AppendMenu(hmenuShared, flags, itemId, (const wchar_t *)action->text().utf16());
    17341656    }
    17351657
     
    23982320                return res;
    23992321
    2400             name = QString::fromUtf16((const ushort *)bname).toLatin1();
     2322            name = QString::fromWCharArray(bname).toLatin1();
    24012323            SysFreeString(bname);
    24022324        }
     
    24472369            if (index == -1) {
    24482370                nameLength = name.length();
    2449                 name += "(";
     2371                name += '(';
    24502372                // no parameter - shortcut
    24512373                if (!pDispParams->cArgs)
    2452                     index = mo->indexOfSlot((name + ")"));
     2374                    index = mo->indexOfSlot((name + ')'));
    24532375                // search
    24542376                if (index == -1) {
     
    24642386                        QRegExp regexp(QLatin1String("_([0-9])\\("));
    24652387                        if (regexp.lastIndexIn(QString::fromLatin1(name.constData())) != -1) {
    2466                             name = name.left(name.length() - regexp.cap(0).length()) + "(";
     2388                            name = name.left(name.length() - regexp.cap(0).length()) + '(';
    24672389                            int overload = regexp.cap(1).toInt() + 1;
    24682390
     
    25602482                    } else {
    25612483                        argv[p + 1] = const_cast<void*>(varp[p + 1].constData());
    2562                         if (ptype.endsWith("*")) {
     2484                        if (ptype.endsWith('*')) {
    25632485                            argv_pointer[p + 1] = argv[p + 1];
    25642486                            argv[p + 1] = argv_pointer + p + 1;
     
    25912513                    argv[0] = const_cast<void*>(varp[0].constData());
    25922514                }
    2593                 if (type.endsWith("*")) {
     2515                if (type.endsWith('*')) {
    25942516                    argv_pointer[0] = argv[0];
    25952517                    argv[0] = argv_pointer;
     
    28002722    QByteArray qtarray;
    28012723    if (hres == S_OK) {
    2802         QString streamName = QString::fromUtf16((const ushort *)stat.pwcsName);
     2724        QString streamName = QString::fromWCharArray(stat.pwcsName);
    28032725        CoTaskMemFree(stat.pwcsName);
    28042726        openAsText = streamName == QLatin1String("SomeStreamName");
     
    29412863    streamName += QLatin1String("_Stream4.2");
    29422864
    2943     pStg->OpenStream((const WCHAR *)streamName.utf16(), 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &spStream);
     2865    pStg->OpenStream((const wchar_t *)streamName.utf16(), 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &spStream);
    29442866    if (!spStream) // support for streams saved with 4.1 and earlier
    29452867        pStg->OpenStream(L"SomeStreamName", 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &spStream);
     
    29642886    streamName += QLatin1String("_Stream4.2");
    29652887
    2966     pStg->CreateStream((const WCHAR *)streamName.utf16(), STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &spStream);
     2888    pStg->CreateStream((const wchar_t *)streamName.utf16(), STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &spStream);
    29672889    if (!spStream)
    29682890        return E_FAIL;
     
    30803002        return E_NOTIMPL;
    30813003
    3082     currentFileName = QString::fromUtf16(reinterpret_cast<const ushort *>(fileName));
     3004    currentFileName = QString::fromWCharArray(fileName);
    30833005    return S_OK;
    30843006}
     
    30983020        return E_OUTOFMEMORY;
    30993021
    3100     *currentFile = static_cast<WCHAR *>(malloc->Alloc(currentFileName.length() * 2));
     3022    *currentFile = static_cast<wchar_t *>(malloc->Alloc(currentFileName.length() * 2));
    31013023    malloc->Release();
    31023024    memcpy(*currentFile, currentFileName.unicode(), currentFileName.length() * 2);
     
    31183040    }
    31193041
    3120     QString loadFileName = QString::fromUtf16(reinterpret_cast<const ushort *>(fileName));
     3042    QString loadFileName = QString::fromWCharArray(fileName);
    31213043    QString fileExtension = loadFileName.mid(loadFileName.lastIndexOf(QLatin1Char('.')) + 1);
    31223044    QFile file(loadFileName);
     
    31633085    }
    31643086
    3165     QString saveFileName = QString::fromUtf16(reinterpret_cast<const ushort *>(fileName));
     3087    QString saveFileName = QString::fromWCharArray(fileName);
    31663088    QString fileExtension = saveFileName.mid(saveFileName.lastIndexOf(QLatin1Char('.')) + 1);
    31673089    QFile file(saveFileName);
     
    32213143    bool bDeleteDC = false;
    32223144    if (!hicTargetDev) {
    3223         hicTargetDev = ::CreateDCA("DISPLAY", NULL, NULL, NULL);
     3145        hicTargetDev = ::CreateDC(L"DISPLAY", NULL, NULL, NULL);
    32243146        bDeleteDC = (hicTargetDev != hdcDraw);
    32253147    }
     
    33843306        if (var.vt != VT_BSTR || !isWidget)
    33853307            break;
    3386         qt.widget->setWindowTitle(QString::fromUtf16((const ushort *)var.bstrVal));
     3308        qt.widget->setWindowTitle(QString::fromWCharArray(var.bstrVal));
    33873309        break;
    33883310    case DISPID_AMBIENT_FONT:
     
    35823504{
    35833505    if (pMsg->message != WM_KEYDOWN || !isWidget)
    3584         return S_FALSE;
     3506        return S_FALSE;
    35853507
    35863508    DWORD dwKeyMod = 0;
    35873509    if (::GetKeyState(VK_SHIFT) < 0)
    3588         dwKeyMod |= 1;  // KEYMOD_SHIFT
     3510        dwKeyMod |= 1;  // KEYMOD_SHIFT
    35893511    if (::GetKeyState(VK_CONTROL) < 0)
    3590         dwKeyMod |= 2;  // KEYMOD_CONTROL
     3512        dwKeyMod |= 2;  // KEYMOD_CONTROL
    35913513    if (::GetKeyState(VK_MENU) < 0)
    3592         dwKeyMod |= 4;  // KEYMOD_ALT
     3514        dwKeyMod |= 4;  // KEYMOD_ALT
    35933515
    35943516    switch (LOWORD(pMsg->wParam)) {
    35953517    case VK_TAB:
    3596         if (isUIActive) {
    3597             bool shift = ::GetKeyState(VK_SHIFT) < 0;
    3598             bool giveUp = true;
     3518        if (isUIActive) {
     3519            bool shift = ::GetKeyState(VK_SHIFT) < 0;
     3520            bool giveUp = true;
    35993521            QWidget *curFocus = qt.widget->focusWidget();
    36003522            if (curFocus) {
    3601                 if (shift) {
     3523                if (shift) {
    36023524                    if (!curFocus->isWindow()) {
    36033525                        QWidget *nextFocus = curFocus->nextInFocusChain();
     
    36173539                            giveUp = false;
    36183540                            ((HackWidget*)curFocus)->focusNextPrevChild(false);
     3541                            curFocus->window()->setAttribute(Qt::WA_KeyboardFocusChange);
    36193542                        }
    36203543                    }
    3621                 } else {
     3544                } else {
    36223545                    QWidget *nextFocus = curFocus;
    36233546                    while (1) {
     
    36283551                            giveUp = false;
    36293552                            ((HackWidget*)curFocus)->focusNextPrevChild(true);
     3553                            curFocus->window()->setAttribute(Qt::WA_KeyboardFocusChange);
    36303554                            break;
    36313555                        }
    36323556                    }
    3633                 }
     3557                }
    36343558            }
    3635             if (giveUp) {
    3636                 HWND hwnd = ::GetParent(m_hWnd);
    3637                 ::SetFocus(hwnd);
    3638             } else {
    3639                 return S_OK;
    3640             }
    3641 
    3642         }
    3643         break;
     3559            if (giveUp) {
     3560                HWND hwnd = ::GetParent(m_hWnd);
     3561                ::SetFocus(hwnd);
     3562            } else {
     3563                return S_OK;
     3564            }
     3565
     3566        }
     3567        break;
    36443568
    36453569    case VK_LEFT:
     
    36473571    case VK_UP:
    36483572    case VK_DOWN:
    3649         if (isUIActive)
    3650             return S_FALSE;
    3651         break;
     3573        if (isUIActive)
     3574            return S_FALSE;
     3575        break;
    36523576
    36533577    default:
    3654         if (isUIActive && qt.widget->focusWidget()) {
     3578        if (isUIActive && qt.widget->focusWidget()) {
    36553579            int state = Qt::NoButton;
    3656             if (dwKeyMod & 1)
    3657                 state |= Qt::ShiftModifier;
    3658             if (dwKeyMod & 2)
    3659                 state |= Qt::ControlModifier;
    3660             if (dwKeyMod & 4)
    3661                 state |= Qt::AltModifier;
    3662 
    3663             int key = pMsg->wParam;
     3580            if (dwKeyMod & 1)
     3581                state |= Qt::ShiftModifier;
     3582            if (dwKeyMod & 2)
     3583                state |= Qt::ControlModifier;
     3584            if (dwKeyMod & 4)
     3585                state |= Qt::AltModifier;
     3586
     3587            int key = pMsg->wParam;
    36643588            if (!(key >= 'A' && key <= 'Z') && !(key >= '0' && key <= '9'))
    36653589                key = qt_translateKeyCode(pMsg->wParam);
    36663590
    3667             QKeyEvent override(QEvent::ShortcutOverride, key, (Qt::KeyboardModifiers)state);
    3668             override.ignore();
    3669             QApplication::sendEvent(qt.widget->focusWidget(), &override);
    3670             if (override.isAccepted())
    3671                 return S_FALSE;
    3672         }
    3673         break;
     3591            QKeyEvent override(QEvent::ShortcutOverride, key, (Qt::KeyboardModifiers)state);
     3592            override.ignore();
     3593            QApplication::sendEvent(qt.widget->focusWidget(), &override);
     3594            if (override.isAccepted())
     3595                return S_FALSE;
     3596        }
     3597        break;
    36743598    }
    36753599
    36763600    if (!m_spClientSite)
    3677         return S_FALSE;
     3601        return S_FALSE;
    36783602
    36793603    IOleControlSite *controlSite = 0;
    36803604    m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&controlSite);
    36813605    if (!controlSite)
    3682         return S_FALSE;
    3683 
     3606        return S_FALSE;
     3607    bool resetUserData = false;
     3608    // set server type in the user-data of the window.
     3609#ifdef GWLP_USERDATA
     3610    LONG_PTR serverType = QAX_INPROC_SERVER;
     3611#else
     3612    LONG serverType = QAX_INPROC_SERVER;
     3613#endif
     3614    if (qAxOutProcServer)
     3615        serverType = QAX_OUTPROC_SERVER;
     3616#ifdef GWLP_USERDATA
     3617    LONG_PTR oldData = SetWindowLongPtr(pMsg->hwnd, GWLP_USERDATA, serverType);
     3618#else
     3619    LONG oldData = SetWindowLong(pMsg->hwnd, GWL_USERDATA, serverType);
     3620#endif
    36843621    HRESULT hres = controlSite->TranslateAcceleratorW(pMsg, dwKeyMod);
    3685 
    36863622    controlSite->Release();
    3687 
     3623    // reset the user-data for the window.
     3624#ifdef GWLP_USERDATA
     3625    SetWindowLongPtr(pMsg->hwnd, GWLP_USERDATA, oldData);
     3626#else
     3627    SetWindowLong(pMsg->hwnd, GWL_USERDATA, oldData);
     3628#endif
    36883629    return hres;
    36893630}
  • trunk/src/activeqt/control/qaxserverdll.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    5152
    5253// in qaxserver.cpp
    53 extern char qAxModuleFilename[MAX_PATH];
     54extern wchar_t qAxModuleFilename[MAX_PATH];
    5455extern bool qAxIsServer;
    5556extern ITypeLib *qAxTypeLibrary;
     
    121122EXTERN_C BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved)
    122123{
    123     GetModuleFileNameA(hInstance, qAxModuleFilename, MAX_PATH-1);
     124    GetModuleFileName(hInstance, qAxModuleFilename, MAX_PATH);
    124125    qAxInstance = hInstance;
    125126    qAxIsServer = true;
  • trunk/src/activeqt/control/qaxservermain.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    6768extern bool qAxIsServer;
    6869extern bool qAxOutProcServer;
    69 extern char qAxModuleFilename[MAX_PATH];
     70extern wchar_t qAxModuleFilename[MAX_PATH];
    7071extern QString qAxInit();
    7172extern void qAxCleanup();
     
    106107{
    107108    dwThreadID = GetCurrentThreadId();
    108     hEventShutdown = CreateEventA(0, false, false, 0);
     109    hEventShutdown = CreateEvent(0, false, false, 0);
    109110    if (hEventShutdown == 0)
    110111        return false;
     
    204205
    205206    qAxOutProcServer = true;
    206     GetModuleFileNameA(0, qAxModuleFilename, MAX_PATH-1);
     207    GetModuleFileName(0, qAxModuleFilename, MAX_PATH);
    207208    qAxInstance = hInstance;
    208209
    209     QByteArray cmdParam;
    210     QT_WA({
    211         LPTSTR cmdline = GetCommandLineW();
    212         cmdParam = QString::fromUtf16((const ushort *)cmdline).toLocal8Bit();
    213     }, {
    214         cmdParam = GetCommandLineA();
    215     });
    216    
     210    QByteArray cmdParam = QString::fromWCharArray(GetCommandLine()).toLocal8Bit();
    217211    QList<QByteArray> cmds = cmdParam.split(' ');
    218212    QByteArray unprocessed;
     
    254248            break;
    255249        } else {
    256             unprocessed += cmds.at(i) + " ";
     250            unprocessed += cmds.at(i) + ' ';
    257251        }
    258252    }
  • trunk/src/activeqt/shared/qaxtypes.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    3839****************************************************************************/
    3940
    40 #ifndef UNICODE
    41 #define UNICODE
    42 #endif
    43 
    44 
    4541#include <ocidl.h>
    4642#include <olectl.h>
     
    124120    f->get_Underline(&underline);
    125121    f->get_Weight(&weight);
    126     QFont font(QString::fromUtf16((const ushort *)name), size.Lo/9750, weight / 97, italic);
     122    QFont font(QString::fromWCharArray(name), size.Lo/9750, weight / 97, italic);
    127123    font.setBold(bold);
    128124    font.setStrikeOut(strike);
     
    558554                if (maxColumns) {
    559555                    is2D = true;
    560                     SAFEARRAYBOUND rgsabound[2] = {0};
     556                    SAFEARRAYBOUND rgsabound[2] = { {0} };
    561557                    rgsabound[0].cElements = count;
    562558                    rgsabound[1].cElements = maxColumns;
     
    926922    switch(arg.vt) {
    927923    case VT_BSTR:
    928         var = QString::fromUtf16((const ushort *)arg.bstrVal);
     924        var = QString::fromWCharArray(arg.bstrVal);
    929925        break;
    930926    case VT_BSTR|VT_BYREF:
    931         var = QString::fromUtf16((const ushort *)*arg.pbstrVal);
     927        var = QString::fromWCharArray(*arg.pbstrVal);
    932928        break;
    933929    case VT_BOOL:
     
    11121108                    QObject *qObj = iface->qObject();
    11131109                    iface->Release();
    1114                     var = QVariant(qRegisterMetaType<QObject*>(qObj ? QByteArray(qObj->metaObject()->className()) + "*" : typeName), &qObj);
     1110                    var = QVariant(qRegisterMetaType<QObject*>(qObj ? QByteArray(qObj->metaObject()->className()) + '*' : typeName), &qObj);
    11151111                } else
    11161112#endif
     
    12461242                BSTR bstr;
    12471243                SafeArrayGetElement(array, &i, &bstr);
    1248                 strings << QString::fromUtf16((const ushort *)bstr);
     1244                strings << QString::fromWCharArray(bstr);
    12491245                SysFreeString(bstr);
    12501246            }
  • trunk/src/activeqt/shared/qaxtypes.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the ActiveQt framework of the Qt Toolkit.
     
    9091extern void clearVARIANT(VARIANT *var);
    9192
     93#define QAX_INPROC_SERVER  (0x51540001)
     94#define QAX_OUTPROC_SERVER (0x51540002)
     95
    9296QT_END_NAMESPACE
    9397#endif // QT_NO_WIN_ACTIVEQT
Note: See TracChangeset for help on using the changeset viewer.