- Timestamp:
- Jun 5, 2008 8:01:41 AM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h
r9381 r9401 10 10 11 11 /* 12 * Copyright (C) 2006-200 7Sun Microsystems, Inc.12 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 13 13 * 14 14 * This file is part of VirtualBox Open Source Edition (OSE), as … … 80 80 #undef ASSERT 81 81 82 #include <qstring.h> 83 #include <quuid.h> 84 #include <q3valuevector.h> 82 /* Qt includes */ 83 #include <QString> 84 #include <QUuid> 85 #include <QVector> 85 86 86 87 #include <iprt/memory> // for auto_copy_ptr … … 228 229 229 230 template <typename QT, typename CT> 230 static void ToSafeArray (const Q 3ValueVector <QT> &aVec, com::SafeArray <CT> &aArr)231 static void ToSafeArray (const QVector <QT> &aVec, com::SafeArray <CT> &aArr) 231 232 { 232 233 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 234 235 235 236 template <typename CT, typename QT> 236 static void FromSafeArray (const com::SafeArray <CT> &aArr, Q 3ValueVector <QT> &aVec)237 static void FromSafeArray (const com::SafeArray <CT> &aArr, QVector <QT> &aVec) 237 238 { 238 239 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 240 241 241 242 template <typename QT, typename CT> 242 static void ToSafeArray (const Q 3ValueVector <QT *> &aVec, com::SafeArray <CT *> &aArr)243 static void ToSafeArray (const QVector <QT *> &aVec, com::SafeArray <CT *> &aArr) 243 244 { 244 245 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 246 247 247 248 template <typename CT, typename QT> 248 static void FromSafeArray (const com::SafeArray <CT *> &aArr, Q 3ValueVector <QT *> &aVec)249 static void FromSafeArray (const com::SafeArray <CT *> &aArr, QVector <QT *> &aVec) 249 250 { 250 251 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 254 255 255 256 template <typename T> 256 static void ToSafeArray (const Q 3ValueVector <T> &aVec, com::SafeArray <T> &aArr)257 static void ToSafeArray (const QVector <T> &aVec, com::SafeArray <T> &aArr) 257 258 { 258 259 aArr.reset (aVec.size()); 259 260 size_t i = 0; 260 for (typename Q 3ValueVector <T>::const_iterator it = aVec.begin();261 for (typename QVector <T>::const_iterator it = aVec.begin(); 261 262 it != aVec.end(); ++ it, ++ i) 262 263 aArr [i] = *it; … … 264 265 265 266 template <typename T> 266 static void FromSafeArray (const com::SafeArray <T> &aArr, Q 3ValueVector <T> &aVec)267 { 268 aVec = Q 3ValueVector <T> (aArr.size());267 static void FromSafeArray (const com::SafeArray <T> &aArr, QVector <T> &aVec) 268 { 269 aVec = QVector <T> (aArr.size()); 269 270 size_t i = 0; 270 for (typename Q 3ValueVector <T>::iterator it = aVec.begin();271 for (typename QVector <T>::iterator it = aVec.begin(); 271 272 it != aVec.end(); ++ it, ++ i) 272 273 *it = aArr [i]; … … 275 276 /* Arrays of strings */ 276 277 277 static void ToSafeArray (const Q 3ValueVector <QString> &aVec,278 static void ToSafeArray (const QVector <QString> &aVec, 278 279 com::SafeArray <BSTR> &aArr); 279 280 static void FromSafeArray (const com::SafeArray <BSTR> &aArr, 280 Q 3ValueVector <QString> &aVec);281 QVector <QString> &aVec); 281 282 282 283 /* Arrays of interface pointers. Note: we need a separate pair of names … … 290 291 291 292 template <class CI, class I> 292 static void ToSafeIfaceArray (const Q 3ValueVector <CI> &aVec,293 static void ToSafeIfaceArray (const QVector <CI> &aVec, 293 294 com::SafeIfaceArray <I> &aArr) 294 295 { 295 296 aArr.reset (aVec.size()); 296 297 size_t i = 0; 297 for (typename Q 3ValueVector <CI>::const_iterator it = aVec.begin();298 for (typename QVector <CI>::const_iterator it = aVec.begin(); 298 299 it != aVec.end(); ++ it, ++ i) 299 300 { … … 306 307 template <class I, class CI> 307 308 static void FromSafeIfaceArray (const com::SafeIfaceArray <I> &aArr, 308 Q 3ValueVector <CI> &aVec)309 { 310 aVec = Q 3ValueVector <CI> (aArr.size());309 QVector <CI> &aVec) 310 { 311 aVec = QVector <CI> (aArr.size()); 311 312 size_t i = 0; 312 for (typename Q 3ValueVector <CI>::iterator it = aVec.begin();313 for (typename QVector <CI>::iterator it = aVec.begin(); 313 314 it != aVec.end(); ++ it, ++ i) 314 315 (*it).attach (aArr [i]); -
trunk/src/VBox/Frontends/VirtualBox4/include/COMWrappers.xsl
r8155 r9401 11 11 12 12 /* 13 Copyright (C) 2006-200 7Sun Microsystems, Inc.13 Copyright (C) 2006-2008 Sun Microsystems, Inc. 14 14 15 15 This file is part of VirtualBox Open Source Edition (OSE), as … … 238 238 (//param[@safearray='yes' and not(../@internal='yes') and @type=current()/@name]) 239 239 "> 240 <xsl:text>typedef Q 3ValueVector <C</xsl:text>240 <xsl:text>typedef QVector <C</xsl:text> 241 241 <xsl:value-of select="substring(@name,2)"/> 242 242 <xsl:text>> C</xsl:text> … … 1154 1154 <xsl:otherwise> 1155 1155 <xsl:if test="../@safearray"> 1156 <xsl:text>Q 3ValueVector <</xsl:text>1156 <xsl:text>QVector <</xsl:text> 1157 1157 </xsl:if> 1158 1158 <xsl:choose> … … 1555 1555 <xsl:if test="(name()='attribute' and $isSetter) or 1556 1556 (name()='param' and @dir='in')"> 1557 <!-- convert Q 3ValueVector to SafeArray -->1557 <!-- convert QVector to SafeArray --> 1558 1558 <xsl:choose> 1559 1559 <!-- interface types need special treatment here --> … … 1581 1581 <xsl:if test="(name()='attribute' and not($isSetter)) or 1582 1582 (name()='param' and (@dir='out' or @dir='return'))"> 1583 <!-- convert SafeArray to Q 3ValueVector -->1583 <!-- convert SafeArray to QVector --> 1584 1584 <xsl:choose> 1585 1585 <!-- interface types need special treatment here --> -
trunk/src/VBox/Frontends/VirtualBox4/src/COMDefs.cpp
r8155 r9401 6 6 7 7 /* 8 * Copyright (C) 2006-200 7Sun Microsystems, Inc.8 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 #else /* !defined (VBOX_WITH_XPCOM) */ 28 28 29 #include <qobject.h> 29 /* Qt includes */ 30 #include <QObject> 30 31 #include <qsocketnotifier.h> 31 32 … … 64 65 mEventQ = eq; 65 66 mNotifier = new QSocketNotifier (mEventQ->GetEventQueueSelectFD(), 66 QSocketNotifier::Read, this, 67 "XPCOMEventQSocketNotifier"); 67 QSocketNotifier::Read, this); 68 68 QObject::connect (mNotifier, SIGNAL (activated (int)), 69 69 this, SLOT (processEvents())); … … 187 187 188 188 /* static */ 189 void COMBase::ToSafeArray (const Q 3ValueVector <QString> &aVec,189 void COMBase::ToSafeArray (const QVector <QString> &aVec, 190 190 com::SafeArray <BSTR> &aArr) 191 191 { 192 192 aArr.reset (aVec.size()); 193 193 size_t i = 0; 194 for (Q 3ValueVector <QString>::const_iterator it = aVec.begin();194 for (QVector <QString>::const_iterator it = aVec.begin(); 195 195 it != aVec.end(); ++ it, ++ i) 196 aArr [i] = SysAllocString ((const OLECHAR *) (*it).u cs2());196 aArr [i] = SysAllocString ((const OLECHAR *) (*it).utf16()); 197 197 } 198 198 199 199 /* static */ 200 200 void COMBase::FromSafeArray (const com::SafeArray <BSTR> &aArr, 201 Q 3ValueVector <QString> &aVec)202 { 203 aVec = Q 3ValueVector <QString> (aArr.size());201 QVector <QString> &aVec) 202 { 203 aVec = QVector <QString> (aArr.size()); 204 204 size_t i = 0; 205 for (Q 3ValueVector <QString>::iterator it = aVec.begin();205 for (QVector <QString>::iterator it = aVec.begin(); 206 206 it != aVec.end(); ++ it, ++ i) 207 *it = QString::fromU cs2(aArr [i]);207 *it = QString::fromUtf16 (aArr [i]); 208 208 } 209 209 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r9362 r9401 38 38 * of the Main API) 39 39 * 40 * 6. src/VBox/Installer/win32/VirtualBox_TypeLib.xsl => 40 * 6. src/VBox/Frontends/VirtualBox4/include/COMWrappers.xsl => 41 * out/<platform>/obj/src/VBox/Frontends/VirtualBox4/VirtualBox/include/COMWrappers.h 42 * (smart Qt-based C++ wrapper classes for COM interfaces 43 * of the Main API) 44 * 45 * 7. src/VBox/Installer/win32/VirtualBox_TypeLib.xsl => 41 46 * out/<platform>/obj/src/VBox/Installer/win32/VirtualBox_TypeLib.wxi 42 47 * (Main API TypeLib block for the WiX installer)
Note:
See TracChangeset
for help on using the changeset viewer.