Changeset 561 for trunk/src/activeqt/control
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/activeqt/control/control.pro
r2 r561 25 25 win32-g++:LIBS += -luuid 26 26 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 27 HEADERS = qaxaggregated.h \ 28 qaxbindable.h \ 29 qaxfactory.h \ 30 ../shared/qaxtypes.h 34 31 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 } 32 SOURCES = 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 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. -
trunk/src/activeqt/control/qaxbindable.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. -
trunk/src/activeqt/control/qaxbindable.h
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. -
trunk/src/activeqt/control/qaxfactory.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. … … 51 52 QT_BEGIN_NAMESPACE 52 53 53 extern charqAxModuleFilename[MAX_PATH];54 extern wchar_t qAxModuleFilename[MAX_PATH]; 54 55 55 56 /*! … … 278 279 279 280 if (licenseKey.isEmpty()) { 280 QString licFile(Q File::decodeName(qAxModuleFilename));281 QString licFile(QString::fromWCharArray(qAxModuleFilename)); 281 282 int lastDot = licFile.lastIndexOf(QLatin1Char('.')); 282 283 licFile = licFile.left(lastDot) + QLatin1String(".lic"); … … 361 362 } 362 363 363 extern charqAxModuleFilename[MAX_PATH];364 extern wchar_t qAxModuleFilename[MAX_PATH]; 364 365 365 366 /*! … … 373 374 QString QAxFactory::serverDirPath() 374 375 { 375 return QFileInfo(QString::from Local8Bit(qAxModuleFilename)).absolutePath();376 return QFileInfo(QString::fromWCharArray(qAxModuleFilename)).absolutePath(); 376 377 } 377 378 … … 385 386 QString QAxFactory::serverFilePath() 386 387 { 387 return QString::from Local8Bit(qAxModuleFilename);388 return QString::fromWCharArray(qAxModuleFilename); 388 389 } 389 390 … … 493 494 return false; 494 495 495 if (!QString::from Local8Bit(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe")))496 if (!QString::fromWCharArray(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe"))) 496 497 return false; 497 498 -
trunk/src/activeqt/control/qaxfactory.h
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. -
trunk/src/activeqt/control/qaxmain.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. -
trunk/src/activeqt/control/qaxserver.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. … … 64 65 HANDLE qAxInstance = 0; 65 66 ITypeLib *qAxTypeLibrary = 0; 66 charqAxModuleFilename[MAX_PATH];67 wchar_t qAxModuleFilename[MAX_PATH]; 67 68 bool qAxOutProcServer = false; 68 69 … … 91 92 for (int i = 0; i < keys.count(); ++i) { 92 93 QString key(keys.at(i)); 93 qRegisterMetaType((key + QLatin1 String("*")).toLatin1(), (void**)0);94 qRegisterMetaType((key + QLatin1Char('*')).toLatin1(), (void**)0); 94 95 } 95 96 } … … 117 118 InitializeCriticalSection(&qAxModuleSection); 118 119 119 libFile = QString::from Local8Bit(qAxModuleFilename);120 libFile = QString::fromWCharArray(qAxModuleFilename); 120 121 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) 122 123 return libFile; 123 124 124 125 int lastDot = libFile.lastIndexOf(QLatin1Char('.')); 125 126 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) 127 128 return libFile; 128 129 129 130 lastDot = libFile.lastIndexOf(QLatin1Char('.')); 130 131 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) 132 133 return libFile; 133 134 … … 208 209 { 209 210 qAxIsServer = false; 210 QString file = QString::from Local8Bit(qAxModuleFilename);211 QString path = file.left(file.lastIndexOf(QLatin1 String("\\"))+1);211 QString file = QString::fromWCharArray(qAxModuleFilename); 212 QString path = file.left(file.lastIndexOf(QLatin1Char('\\'))+1); 212 213 QString module = file.right(file.length() - path.length()); 213 module = module.left(module.lastIndexOf(QLatin1 String(".")));214 module = module.left(module.lastIndexOf(QLatin1Char('.'))); 214 215 215 216 const QString appId = qAxFactory()->appID().toString().toUpper(); … … 227 228 DWORD major = libAttr->wMajorVerNum; 228 229 DWORD minor = libAttr->wMinorVerNum; 229 typeLibVersion = QString::number((uint)major) + QLatin1 String(".") + QString::number((uint)minor);230 typeLibVersion = QString::number((uint)major) + QLatin1Char('.') + QString::number((uint)minor); 230 231 231 232 if (bRegister) 232 RegisterTypeLib(qAxTypeLibrary, ( TCHAR*)libFile.utf16(), 0);233 RegisterTypeLib(qAxTypeLibrary, (wchar_t*)libFile.utf16(), 0); 233 234 else 234 235 UnRegisterTypeLib(libAttr->guid, libAttr->wMajorVerNum, libAttr->wMinorVerNum, libAttr->lcid, libAttr->syskind); … … 272 273 273 274 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(); 275 276 if (classVersion.isNull()) 276 277 classVersion = QLatin1String("1.0"); 277 278 bool insertable = mo && !qstricmp(mo->classInfo(mo->indexOfClassInfo("Insertable")).value(), "yes"); 278 279 bool control = object->isWidgetType(); 279 const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1 String(".")));280 const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.'))); 280 281 uint olemisc = OLEMISC_SETCLIENTSITEFIRST 281 282 |OLEMISC_ACTIVATEWHENVISIBLE … … 288 289 olemisc |= OLEMISC_WANTSTOMENUMERGE; 289 290 290 settings.setValue(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));291 settings.setValue(QLatin1 String("/") + 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); 292 293 if (insertable) 293 settings.setValue(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));294 settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String(""))); 294 295 295 settings.setValue(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String("/."), className + QLatin1String(" Class"));296 settings.setValue(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."), classId);297 settings.setValue(QLatin1 String("/") + 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); 298 299 299 300 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)) 301 302 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"), appId); 302 303 if (control) … … 308 309 else 309 310 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/LocalServer32/."), 310 QLatin1 String("\"") + file + QLatin1String("\" -activex"));311 QLatin1Char('\"') + file + QLatin1String("\" -activex")); 311 312 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/."), control ? QLatin1String("1") : QLatin1String("0")); 312 313 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/1/."), QString::number(olemisc)); 313 314 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Programmable/."), QVariant(QLatin1String(""))); 314 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1 String("\"") +315 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1Char('\"') + 315 316 file + QLatin1String("\", 101")); 316 317 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 + QLatin1 String(".") + className);318 settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ProgID/."), module + QLatin1 String(".") + 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('.')))); 319 320 320 321 QString mime = QLatin1String(mo->classInfo(mo->indexOfClassInfo("MIME")).value()); … … 331 332 // Prepend '.' before extension, if required. 332 333 extension = extension.trimmed(); 333 if (extension[0] != Q Char(QLatin1Char('.')))334 extension = QLatin1 String(".") + extension;334 if (extension[0] != QLatin1Char('.')) 335 extension = QLatin1Char('.') + extension; 335 336 } 336 337 337 338 if (!extension.isEmpty()) { 338 settings.setValue(QLatin1 String("/") + extension + QLatin1String("/."), module + QLatin1String(".") + className);339 settings.setValue(QLatin1 String("/") + extension + QLatin1String("/Content Type"), mime);340 341 mime = mime.replace(QLatin1 String("/"), 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('\\')); 342 343 settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID"), classId); 343 344 settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension"), extension); … … 352 353 } 353 354 } else { 355 if (qAxOutProcServer) { 356 settings.remove(QLatin1String("/AppID/") + appId + QLatin1String("/.")); 357 settings.remove(QLatin1String("/AppID/") + module + QLatin1String(".EXE")); 358 } 354 359 QStringList keys = qAxFactory()->featureList(); 355 360 for (QStringList::Iterator key = keys.begin(); key != keys.end(); ++key) { … … 359 364 className = qax_clean_type(className, mo); 360 365 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(); 362 367 if (classVersion.isNull()) 363 368 classVersion = QLatin1String("1.0"); 364 const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1 String(".")));369 const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.'))); 365 370 366 371 qAxFactory()->unregisterClass(*key, &settings); 367 372 368 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/CLSID/."));369 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."));370 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."));371 settings.remove(QLatin1 String("/") + 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); 372 377 373 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."));374 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String("/CurVer/."));375 settings.remove(QLatin1 String("/") + module + QLatin1String(".") + className + QLatin1String("/."));376 settings.remove(QLatin1 String("/") + 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); 377 382 378 383 settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID")); … … 405 410 // Prepend '.' before extension, if required. 406 411 extension = extension.trimmed(); 407 if (extension[0] != Q Char(QLatin1Char('.')))408 extension = QLatin1String(".") + extension;412 if (extension[0] != QLatin1Char('.')) 413 extension.prepend(QLatin1Char('.')); 409 414 } 410 415 if (!extension.isEmpty()) { 411 settings.remove(QLatin1 String("/") + extension + QLatin1String("/Content Type"));412 settings.remove(QLatin1 String("/") + extension + QLatin1String("/."));413 settings.remove(QLatin1 String("/") + 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('\\')); 415 420 settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension")); 416 421 settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID")); … … 456 461 { "QPixmap", "IPictureDisp*" }, 457 462 { "QVariant", "VARIANT" }, 458 { "QVariantList", "SAFEARRAY(VARIANT)" },459 { "QList<QVariant>", "SAFEARRAY(VARIANT)" },463 { "QVariantList", "SAFEARRAY(VARIANT)" }, 464 { "QList<QVariant>", "SAFEARRAY(VARIANT)" }, 460 465 { "quint64", "CY" }, 461 466 { "qint64", "CY" }, … … 465 470 { "QStringList", "SAFEARRAY(BSTR)" }, 466 471 // 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" }, 469 474 #ifndef Q_CC_BOR 470 475 # if __REQUIRED_RPCNDR_H_VERSION__ >= Q_REQUIRED_RPCNDR_H_VERSION … … 579 584 if (mapping.contains(name)) { 580 585 int n = mapping.value(name); 581 newName = name + "_"+ QByteArray::number(n);586 newName = name + '_' + QByteArray::number(n); 582 587 mapping.insert(name, n+1); 583 588 } else { … … 687 692 QByteArray name(parameterNames.at(p)); 688 693 689 if (type.endsWith( "&")) {694 if (type.endsWith('&')) { 690 695 out = true; 691 696 type.truncate(type.length() - 1); … … 693 698 out = true; 694 699 type.truncate(type.length() - 1); 695 } else if (type.endsWith( "*") && !subtypes.contains(type)) {700 } else if (type.endsWith('*') && !subtypes.contains(type)) { 696 701 type.truncate(type.length() - 1); 697 702 } … … 702 707 type = convertTypes(type, ok); 703 708 if (!out) 704 prototype += "[in] " + type + " ";709 prototype += "[in] " + type + ' '; 705 710 else 706 prototype += "[in,out] " + type + " ";711 prototype += "[in,out] " + type + ' '; 707 712 708 713 if (out) 709 prototype += "*";714 prototype += '*'; 710 715 if (name.isEmpty()) 711 prototype += "p"+ QByteArray::number(p);716 prototype += 'p' + QByteArray::number(p); 712 717 else 713 718 prototype += "p_" + replaceKeyword(name); … … 729 734 int in = -1; 730 735 while (numDefArgs) { 731 in = ptype.lastIndexOf( "]", in);736 in = ptype.lastIndexOf(']', in); 732 737 ptype.replace(in, 1, ",optional]"); 733 738 in = ptype.indexOf(' ', in) + 1; 734 739 QByteArray type = ptype.mid(in, ptype.indexOf(' ', in) - in); 735 740 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); 737 742 ptype.replace(in, type.length(), QByteArray("VARIANT /*was: ") + type + "*/"); 738 743 --numDefArgs; … … 802 807 QByteArray key(enumerator.key(j)); 803 808 while (enumValues.contains(key)) { 804 key += "_";809 key += '_'; 805 810 } 806 811 enumValues.append(key); … … 823 828 enums.append("MousePointer"); 824 829 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; 841 846 out << "\t\tBusyCursor\t= " << Qt::BusyCursor << endl; 842 847 out << "\t};" << endl << endl; … … 845 850 enums.append("FocusPolicy"); 846 851 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; 851 856 out << "\t\tWheelFocus = " << Qt::WheelFocus << endl; 852 857 out << "\t};" << endl << endl; … … 878 883 out << "\t/****** Property is of unsupported datatype" << endl; 879 884 880 out << "\t\t[id(" << id << ")";885 out << "\t\t[id(" << id << ')'; 881 886 if (!property.isWritable()) 882 887 out << ", readonly"; … … 887 892 if (isBindable) 888 893 out << ", requestedit"; 889 if (defProp == Q String::fromLatin1(name.constData()))894 if (defProp == QLatin1String(name)) 890 895 out << ", uidefault"; 891 out << "] " << type << " " << name << ";"<< endl;896 out << "] " << type << ' ' << name << ';' << endl; 892 897 893 898 if (!ok) … … 940 945 outBuffer += "\t/****** Slot parameter uses unsupported datatype\n"; 941 946 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"; 943 948 944 949 if (!ok) … … 992 997 QList<QByteArray> parameterNames(signal.parameterNames()); 993 998 994 bool isDefault = defSignal == Q String::fromLatin1(name.constData());999 bool isDefault = defSignal == QLatin1String(name); 995 1000 name = renameOverloads(replaceKeyword(name)); 996 1001 bool ok = true; … … 1004 1009 out << "\t/****** Signal parameter uses unsupported datatype" << endl; 1005 1010 1006 out << "\t\t[id(" << id << ")";1011 out << "\t\t[id(" << id << ')'; 1007 1012 if (isDefault) 1008 1013 out << ", uidefault"; 1009 out << "] void " << name << "("<< ptype << ");" << endl;1014 out << "] void " << name << '(' << ptype << ");" << endl; 1010 1015 1011 1016 if (!ok) … … 1032 1037 if (classVersion) 1033 1038 out << "\t\tversion(" << classVersion << ")," << endl; 1034 out << "\t\tuuid(" << classID << ")";1039 out << "\t\tuuid(" << classID << ')'; 1035 1040 if (control) { 1036 1041 out << ", " << endl; … … 1044 1049 out << "\tcoclass " << cleanClassName << endl; 1045 1050 out << "\t{" << endl; 1046 out << "\t\t[default] dispinterface I" << cleanClassName << ";"<< endl;1051 out << "\t\t[default] dispinterface I" << cleanClassName << ';' << endl; 1047 1052 if (hasEvents) 1048 1053 out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << endl; … … 1068 1073 file.remove(); 1069 1074 1070 QString filebase = QString::from Local8Bit(qAxModuleFilename);1071 filebase = filebase.left(filebase.lastIndexOf(QLatin1 String(".")));1075 QString filebase = QString::fromWCharArray(qAxModuleFilename); 1076 filebase = filebase.left(filebase.lastIndexOf(QLatin1Char('.'))); 1072 1077 1073 1078 QString appID = qAxFactory()->appID().toString().toUpper(); … … 1104 1109 out << "** Interface definition generated for ActiveQt project" << endl; 1105 1110 out << "**" << endl; 1106 out << "** '" << qAxModuleFilename << "'"<< endl;1111 out << "** '" << QString::fromWCharArray(qAxModuleFilename) << '\'' << endl; 1107 1112 out << "**" << endl; 1108 1113 out << "** Created: " << QDateTime::currentDateTime().toString() << endl; … … 1122 1127 } 1123 1128 1124 out << "["<< endl;1129 out << '[' << endl; 1125 1130 out << "\tuuid(" << typeLibID << ")," << endl; 1126 1131 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; 1129 1134 out << "library " << typelib << "Lib" << endl; 1130 out << "{"<< endl;1135 out << '{' << endl; 1131 1136 out << "\timportlib(\"stdole32.tlb\");" << endl; 1132 1137 out << "\timportlib(\"stdole2.tlb\");" << endl << endl; … … 1189 1194 if (mo) { 1190 1195 QByteArray cleanType = qax_clean_type(*key, mo).toLatin1(); 1191 out << "\tcoclass " << cleanType << ";"<< endl;1196 out << "\tcoclass " << cleanType << ';' << endl; 1192 1197 subtypes.append(cleanType); 1193 subtypes.append(cleanType + "*");1194 1198 qRegisterMetaType(cleanType, (void**)0); 1195 qRegisterMetaType(cleanType + "*", (void**)0); 1199 cleanType += '*'; 1200 subtypes.append(cleanType); 1201 qRegisterMetaType(cleanType, (void**)0); 1196 1202 } 1197 1203 } … … 1226 1232 QByteArray cleanType = qax_clean_type(*key, mo).toLatin1(); 1227 1233 subtypes.append(cleanType); 1228 subtypes.append(cleanType + "*");1234 subtypes.append(cleanType + '*'); 1229 1235 res = classIDL(o, mo, QString::fromLatin1(className.constData()), isBindable, out); 1230 1236 delete o; -
trunk/src/activeqt/control/qaxserverbase.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. … … 789 790 while (!axbase && baseHwnd) { 790 791 #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); 796 793 #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); 802 795 #endif 803 796 … … 906 899 // hook into eventloop; this allows a server to create his own QApplication object 907 900 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()); 913 902 } 914 903 … … 984 973 HRESULT WINAPI CreateInstanceLic(IUnknown *pUnkOuter, IUnknown *pUnkReserved, REFIID iid, BSTR bKey, PVOID *ppObject) 985 974 { 986 QString licenseKey = QString::from Utf16((const ushort *)bKey);975 QString licenseKey = QString::fromWCharArray(bKey); 987 976 if (!qAxFactory()->validateLicenseKey(className, licenseKey)) 988 977 return CLASS_E_NOTLICENSED; … … 1304 1293 internalBind(); 1305 1294 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 } 1315 1300 qt.widget->setAttribute(Qt::WA_QuitOnClose, false); 1316 1301 qt.widget->move(0, 0); … … 1369 1354 { 1370 1355 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; 1379 1358 1380 1359 #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); 1386 1361 #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); 1392 1363 #endif 1393 1364 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); 1401 1368 } 1402 1369 … … 1404 1371 1405 1372 #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); 1411 1374 #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); 1417 1376 #endif 1418 1377 … … 1564 1523 } 1565 1524 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); 1571 1526 } 1572 1527 … … 1584 1539 cn += QString::number((int)ActiveXProc); 1585 1540 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); 1616 1554 } 1617 1555 LeaveCriticalSection(&createWindowSection); … … 1620 1558 1621 1559 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); 1634 1564 1635 1565 Q_ASSERT(m_hWnd == hWnd); … … 1677 1607 actionMap.insert(itemId, action); 1678 1608 } 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()); 1684 1610 } 1685 1611 if (oldMenu) … … 1727 1653 actionMap.insert(itemId, action); 1728 1654 } 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()); 1734 1656 } 1735 1657 … … 2398 2320 return res; 2399 2321 2400 name = QString::from Utf16((const ushort *)bname).toLatin1();2322 name = QString::fromWCharArray(bname).toLatin1(); 2401 2323 SysFreeString(bname); 2402 2324 } … … 2447 2369 if (index == -1) { 2448 2370 nameLength = name.length(); 2449 name += "(";2371 name += '('; 2450 2372 // no parameter - shortcut 2451 2373 if (!pDispParams->cArgs) 2452 index = mo->indexOfSlot((name + ")"));2374 index = mo->indexOfSlot((name + ')')); 2453 2375 // search 2454 2376 if (index == -1) { … … 2464 2386 QRegExp regexp(QLatin1String("_([0-9])\\(")); 2465 2387 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()) + '('; 2467 2389 int overload = regexp.cap(1).toInt() + 1; 2468 2390 … … 2560 2482 } else { 2561 2483 argv[p + 1] = const_cast<void*>(varp[p + 1].constData()); 2562 if (ptype.endsWith( "*")) {2484 if (ptype.endsWith('*')) { 2563 2485 argv_pointer[p + 1] = argv[p + 1]; 2564 2486 argv[p + 1] = argv_pointer + p + 1; … … 2591 2513 argv[0] = const_cast<void*>(varp[0].constData()); 2592 2514 } 2593 if (type.endsWith( "*")) {2515 if (type.endsWith('*')) { 2594 2516 argv_pointer[0] = argv[0]; 2595 2517 argv[0] = argv_pointer; … … 2800 2722 QByteArray qtarray; 2801 2723 if (hres == S_OK) { 2802 QString streamName = QString::from Utf16((const ushort *)stat.pwcsName);2724 QString streamName = QString::fromWCharArray(stat.pwcsName); 2803 2725 CoTaskMemFree(stat.pwcsName); 2804 2726 openAsText = streamName == QLatin1String("SomeStreamName"); … … 2941 2863 streamName += QLatin1String("_Stream4.2"); 2942 2864 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); 2944 2866 if (!spStream) // support for streams saved with 4.1 and earlier 2945 2867 pStg->OpenStream(L"SomeStreamName", 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &spStream); … … 2964 2886 streamName += QLatin1String("_Stream4.2"); 2965 2887 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); 2967 2889 if (!spStream) 2968 2890 return E_FAIL; … … 3080 3002 return E_NOTIMPL; 3081 3003 3082 currentFileName = QString::from Utf16(reinterpret_cast<const ushort *>(fileName));3004 currentFileName = QString::fromWCharArray(fileName); 3083 3005 return S_OK; 3084 3006 } … … 3098 3020 return E_OUTOFMEMORY; 3099 3021 3100 *currentFile = static_cast< WCHAR*>(malloc->Alloc(currentFileName.length() * 2));3022 *currentFile = static_cast<wchar_t *>(malloc->Alloc(currentFileName.length() * 2)); 3101 3023 malloc->Release(); 3102 3024 memcpy(*currentFile, currentFileName.unicode(), currentFileName.length() * 2); … … 3118 3040 } 3119 3041 3120 QString loadFileName = QString::from Utf16(reinterpret_cast<const ushort *>(fileName));3042 QString loadFileName = QString::fromWCharArray(fileName); 3121 3043 QString fileExtension = loadFileName.mid(loadFileName.lastIndexOf(QLatin1Char('.')) + 1); 3122 3044 QFile file(loadFileName); … … 3163 3085 } 3164 3086 3165 QString saveFileName = QString::from Utf16(reinterpret_cast<const ushort *>(fileName));3087 QString saveFileName = QString::fromWCharArray(fileName); 3166 3088 QString fileExtension = saveFileName.mid(saveFileName.lastIndexOf(QLatin1Char('.')) + 1); 3167 3089 QFile file(saveFileName); … … 3221 3143 bool bDeleteDC = false; 3222 3144 if (!hicTargetDev) { 3223 hicTargetDev = ::CreateDC A("DISPLAY", NULL, NULL, NULL);3145 hicTargetDev = ::CreateDC(L"DISPLAY", NULL, NULL, NULL); 3224 3146 bDeleteDC = (hicTargetDev != hdcDraw); 3225 3147 } … … 3384 3306 if (var.vt != VT_BSTR || !isWidget) 3385 3307 break; 3386 qt.widget->setWindowTitle(QString::from Utf16((const ushort *)var.bstrVal));3308 qt.widget->setWindowTitle(QString::fromWCharArray(var.bstrVal)); 3387 3309 break; 3388 3310 case DISPID_AMBIENT_FONT: … … 3582 3504 { 3583 3505 if (pMsg->message != WM_KEYDOWN || !isWidget) 3584 3506 return S_FALSE; 3585 3507 3586 3508 DWORD dwKeyMod = 0; 3587 3509 if (::GetKeyState(VK_SHIFT) < 0) 3588 3510 dwKeyMod |= 1; // KEYMOD_SHIFT 3589 3511 if (::GetKeyState(VK_CONTROL) < 0) 3590 3512 dwKeyMod |= 2; // KEYMOD_CONTROL 3591 3513 if (::GetKeyState(VK_MENU) < 0) 3592 3514 dwKeyMod |= 4; // KEYMOD_ALT 3593 3515 3594 3516 switch (LOWORD(pMsg->wParam)) { 3595 3517 case VK_TAB: 3596 3597 3598 3518 if (isUIActive) { 3519 bool shift = ::GetKeyState(VK_SHIFT) < 0; 3520 bool giveUp = true; 3599 3521 QWidget *curFocus = qt.widget->focusWidget(); 3600 3522 if (curFocus) { 3601 3523 if (shift) { 3602 3524 if (!curFocus->isWindow()) { 3603 3525 QWidget *nextFocus = curFocus->nextInFocusChain(); … … 3617 3539 giveUp = false; 3618 3540 ((HackWidget*)curFocus)->focusNextPrevChild(false); 3541 curFocus->window()->setAttribute(Qt::WA_KeyboardFocusChange); 3619 3542 } 3620 3543 } 3621 3544 } else { 3622 3545 QWidget *nextFocus = curFocus; 3623 3546 while (1) { … … 3628 3551 giveUp = false; 3629 3552 ((HackWidget*)curFocus)->focusNextPrevChild(true); 3553 curFocus->window()->setAttribute(Qt::WA_KeyboardFocusChange); 3630 3554 break; 3631 3555 } 3632 3556 } 3633 3557 } 3634 3558 } 3635 3636 3637 3638 3639 3640 3641 3642 3643 3559 if (giveUp) { 3560 HWND hwnd = ::GetParent(m_hWnd); 3561 ::SetFocus(hwnd); 3562 } else { 3563 return S_OK; 3564 } 3565 3566 } 3567 break; 3644 3568 3645 3569 case VK_LEFT: … … 3647 3571 case VK_UP: 3648 3572 case VK_DOWN: 3649 3650 3651 3573 if (isUIActive) 3574 return S_FALSE; 3575 break; 3652 3576 3653 3577 default: 3654 3578 if (isUIActive && qt.widget->focusWidget()) { 3655 3579 int state = Qt::NoButton; 3656 3657 3658 3659 3660 3661 3662 3663 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; 3664 3588 if (!(key >= 'A' && key <= 'Z') && !(key >= '0' && key <= '9')) 3665 3589 key = qt_translateKeyCode(pMsg->wParam); 3666 3590 3667 3668 3669 3670 3671 3672 3673 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; 3674 3598 } 3675 3599 3676 3600 if (!m_spClientSite) 3677 3601 return S_FALSE; 3678 3602 3679 3603 IOleControlSite *controlSite = 0; 3680 3604 m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&controlSite); 3681 3605 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 3684 3621 HRESULT hres = controlSite->TranslateAcceleratorW(pMsg, dwKeyMod); 3685 3686 3622 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 3688 3629 return hres; 3689 3630 } -
trunk/src/activeqt/control/qaxserverdll.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. … … 51 52 52 53 // in qaxserver.cpp 53 extern charqAxModuleFilename[MAX_PATH];54 extern wchar_t qAxModuleFilename[MAX_PATH]; 54 55 extern bool qAxIsServer; 55 56 extern ITypeLib *qAxTypeLibrary; … … 121 122 EXTERN_C BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) 122 123 { 123 GetModuleFileName A(hInstance, qAxModuleFilename, MAX_PATH-1);124 GetModuleFileName(hInstance, qAxModuleFilename, MAX_PATH); 124 125 qAxInstance = hInstance; 125 126 qAxIsServer = true; -
trunk/src/activeqt/control/qaxservermain.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the ActiveQt framework of the Qt Toolkit. … … 67 68 extern bool qAxIsServer; 68 69 extern bool qAxOutProcServer; 69 extern charqAxModuleFilename[MAX_PATH];70 extern wchar_t qAxModuleFilename[MAX_PATH]; 70 71 extern QString qAxInit(); 71 72 extern void qAxCleanup(); … … 106 107 { 107 108 dwThreadID = GetCurrentThreadId(); 108 hEventShutdown = CreateEvent A(0, false, false, 0);109 hEventShutdown = CreateEvent(0, false, false, 0); 109 110 if (hEventShutdown == 0) 110 111 return false; … … 204 205 205 206 qAxOutProcServer = true; 206 GetModuleFileName A(0, qAxModuleFilename, MAX_PATH-1);207 GetModuleFileName(0, qAxModuleFilename, MAX_PATH); 207 208 qAxInstance = hInstance; 208 209 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(); 217 211 QList<QByteArray> cmds = cmdParam.split(' '); 218 212 QByteArray unprocessed; … … 254 248 break; 255 249 } else { 256 unprocessed += cmds.at(i) + " ";250 unprocessed += cmds.at(i) + ' '; 257 251 } 258 252 }
Note:
See TracChangeset
for help on using the changeset viewer.