Changeset 436 in vbox for trunk/src/VBox
- Timestamp:
- Jan 30, 2007 3:42:55 PM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r358 r436 1083 1083 AutoReaderLock alock (this); 1084 1084 1085 ComObjPtr < USBDeviceCollection> collection;1085 ComObjPtr <OUSBDeviceCollection> collection; 1086 1086 collection.createObject(); 1087 1087 collection->init (mUSBDevices); … … 1776 1776 1777 1777 case DeviceType_DVDDevice: 1778 { 1778 1779 SumLed.u32 |= readAndClearLed(mapIDELeds[2]); 1779 1780 break; 1781 } 1780 1782 1781 1783 case DeviceType_HardDiskDevice: 1784 { 1782 1785 SumLed.u32 |= readAndClearLed(mapIDELeds[0]); 1783 1786 SumLed.u32 |= readAndClearLed(mapIDELeds[1]); 1784 1787 SumLed.u32 |= readAndClearLed(mapIDELeds[3]); 1785 1788 break; 1789 } 1786 1790 1787 1791 case DeviceType_NetworkDevice: … … 1789 1793 for (unsigned i = 0; i < ELEMENTS(mapNetworkLeds); i++) 1790 1794 SumLed.u32 |= readAndClearLed(mapNetworkLeds[i]); 1795 break; 1796 } 1797 1798 case DeviceType_USBDevice: 1799 { 1800 /// @todo (r=dmik) 1801 // USB_DEVICE_ACTIVITY 1791 1802 break; 1792 1803 } … … 1869 1880 1870 1881 /* Find it. */ 1871 ComObjPtr < USBDevice> device;1882 ComObjPtr <OUSBDevice> device; 1872 1883 USBDeviceList::iterator it = mUSBDevices.begin(); 1873 1884 while (it != mUSBDevices.end()) … … 3141 3152 3142 3153 /* Find the device. */ 3143 ComObjPtr < USBDevice> device;3154 ComObjPtr <OUSBDevice> device; 3144 3155 USBDeviceList::iterator it = mUSBDevices.begin(); 3145 3156 while (it != mUSBDevices.end()) … … 4067 4078 if (VBOX_SUCCESS (vrc)) 4068 4079 { 4069 /* Create a USBDevice and add it to the device list */4070 ComObjPtr < USBDevice> device;4080 /* Create a OUSBDevice and add it to the device list */ 4081 ComObjPtr <OUSBDevice> device; 4071 4082 device.createObject(); 4072 4083 HRESULT hrc = device->init (aHostDevice); -
trunk/src/VBox/Main/MachineImpl.cpp
r202 r436 1362 1362 tr ("Invalid boot position: %lu (must be in range [1, %lu])"), 1363 1363 aPosition, SchemaDefs::MaxBootPosition); 1364 1365 if (aDevice == DeviceType_USBDevice) 1366 return setError (E_FAIL, 1367 tr ("Booting from USB devices is not currently supported")); 1364 1368 1365 1369 AutoCaller autoCaller (this); -
trunk/src/VBox/Main/Makefile
r1 r436 539 539 540 540 testidl: $(IDLFILE) $(IDLTYPELIB) 541 testidlhdr: $(IDLHEADER) 541 542 542 543 else -
trunk/src/VBox/Main/USBDeviceImpl.cpp
r1 r436 26 26 ///////////////////////////////////////////////////////////////////////////// 27 27 28 USBDevice::USBDevice()28 OUSBDevice::OUSBDevice() 29 29 { 30 30 mVendorId = 0; … … 36 36 } 37 37 38 USBDevice::~USBDevice()38 OUSBDevice::~OUSBDevice() 39 39 { 40 40 } … … 50 50 * @param aUSBDevice The USB device (interface) to clone. 51 51 */ 52 HRESULT USBDevice::init(IUSBDevice *aUSBDevice)52 HRESULT OUSBDevice::init(IUSBDevice *aUSBDevice) 53 53 { 54 54 AutoLock lock(this); … … 101 101 * @param aId Address of result variable. 102 102 */ 103 STDMETHODIMP USBDevice::COMGETTER(Id)(GUIDPARAMOUT aId)103 STDMETHODIMP OUSBDevice::COMGETTER(Id)(GUIDPARAMOUT aId) 104 104 { 105 105 if (!aId) … … 120 120 * @param aVendorId Where to store the vendor id. 121 121 */ 122 STDMETHODIMP USBDevice::COMGETTER(VendorId)(USHORT *aVendorId)122 STDMETHODIMP OUSBDevice::COMGETTER(VendorId)(USHORT *aVendorId) 123 123 { 124 124 if (!aVendorId) … … 139 139 * @param aProductId Where to store the product id. 140 140 */ 141 STDMETHODIMP USBDevice::COMGETTER(ProductId)(USHORT *aProductId)141 STDMETHODIMP OUSBDevice::COMGETTER(ProductId)(USHORT *aProductId) 142 142 { 143 143 if (!aProductId) … … 158 158 * @param aRevision Where to store the revision BCD. 159 159 */ 160 STDMETHODIMP USBDevice::COMGETTER(Revision)(USHORT *aRevision)160 STDMETHODIMP OUSBDevice::COMGETTER(Revision)(USHORT *aRevision) 161 161 { 162 162 if (!aRevision) … … 176 176 * @param aManufacturer Where to put the return string. 177 177 */ 178 STDMETHODIMP USBDevice::COMGETTER(Manufacturer)(BSTR *aManufacturer)178 STDMETHODIMP OUSBDevice::COMGETTER(Manufacturer)(BSTR *aManufacturer) 179 179 { 180 180 if (!aManufacturer) … … 195 195 * @param aProduct Where to put the return string. 196 196 */ 197 STDMETHODIMP USBDevice::COMGETTER(Product)(BSTR *aProduct)197 STDMETHODIMP OUSBDevice::COMGETTER(Product)(BSTR *aProduct) 198 198 { 199 199 if (!aProduct) … … 214 214 * @param aSerialNumber Where to put the return string. 215 215 */ 216 STDMETHODIMP USBDevice::COMGETTER(SerialNumber)(BSTR *aSerialNumber)216 STDMETHODIMP OUSBDevice::COMGETTER(SerialNumber)(BSTR *aSerialNumber) 217 217 { 218 218 if (!aSerialNumber) … … 233 233 * @param aAddress Where to put the return string. 234 234 */ 235 STDMETHODIMP USBDevice::COMGETTER(Address)(BSTR *aAddress)235 STDMETHODIMP OUSBDevice::COMGETTER(Address)(BSTR *aAddress) 236 236 { 237 237 if (!aAddress) … … 245 245 } 246 246 247 STDMETHODIMP USBDevice::COMGETTER(Port)(USHORT *aPort)247 STDMETHODIMP OUSBDevice::COMGETTER(Port)(USHORT *aPort) 248 248 { 249 249 if (!aPort) … … 257 257 } 258 258 259 STDMETHODIMP USBDevice::COMGETTER(Remote)(BOOL *aRemote)259 STDMETHODIMP OUSBDevice::COMGETTER(Remote)(BOOL *aRemote) 260 260 { 261 261 if (!aRemote) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r359 r436 263 263 <const name="NetworkDevice" value="4"> 264 264 <desc>Network device.</desc> 265 </const> 266 <const name="USBDevice" value="5"> 267 <desc>USB device.</desc> 265 268 </const> 266 269 </enum> … … 5483 5486 buffer does not have to be aligned and lockable. 5484 5487 5485 The callee is also allowed to use the memory buffer 5486 pointed to by the vram parameter. For non linear 5487 modes (such as text and standard VGA), the parameter 5488 is NULL and must not be used. When using it, all the 5489 IFramebuffer implementation has to do is return the 5490 same pointer as the Address property. It is recommended 5491 to use it as it will remove one copy operation. 5488 The callee is also allowed to use the guest video memory 5489 buffer (pointed to by the @a vram parameter) directly instead 5490 of allocating its own buffer. To indicate that the framebuffer 5491 wants to use the guest video memory, its <link to="#address"/> 5492 implementation must return the same address as it gets in 5493 the @a vram parameter of this method. 5494 5495 For non linear modes (such as text and standard VGA), the 5496 @vram parameter is NULL and must not be used. When it's not 5497 NULL, it is recommended to use it to access the guest video 5498 memory instead of creating a separate buffer as it will at 5499 least remove one copy operation. 5492 5500 5493 5501 The caller checks if the call was successful 5494 via IFramebuffer property 'PixelFormat'. 5495 5496 Note: The method is called by IDisplay under the Framebuffer lock. 5502 via the <link to="#pixelFormat"/> property. 5503 5504 <note> 5505 This method is called by IDisplay under the IFramebuffer 5506 lock. 5507 </note> 5497 5508 </desc> 5498 5509 <param name="pixelFormat" type="FramebufferPixelFormat" dir="in"> 5499 <desc> Specifies the pixel format of the surface (bppand layout)</desc>5510 <desc>Pixel format of the surface (BPP and layout)</desc> 5500 5511 </param> 5501 5512 <param name="vram" type="unsigned long" dir="in"> 5502 <desc>Pointer to originalguest VRAM (NULL for non linear modes)</desc>5513 <desc>Pointer to the guest VRAM (NULL for non linear modes)</desc> 5503 5514 </param> 5504 5515 <param name="lineSize" type="unsigned long" dir="in"/> -
trunk/src/VBox/Main/include/Collection.h
r1 r436 257 257 258 258 /** 259 * This macro declares an enumerator class and a collection class for the 260 * given item class. The namespace of the collection class remains opened after 261 * this macro is expanded (i.e. no closing brace with semicolon), thus allowing 262 * one to declare extra collection class members. This namespace 263 * must be closed by the COM_DECL_READONLY_ENUM_AND_COLLECTION_END macro. 264 * 265 * For example, given a 'SomeItem' argument, this macro will declare the 266 * following: 267 * 268 * <code> 269 * class SomeItemEnumerator : public 270 * IfaceVectorEnumerator <ISomeItemEnumerator, ISomeItem, ComObjPtr <SomeItem>, 271 * SomeItemEnumerator> {...}; 259 * This macro declares an enumerator class and a collection class that stores 260 * elements of the given class @a itemcls that implements the given 261 * interface @a iface 262 * 263 * The the @a itemcls class must be either a ComObjPtr or a ComPtr template 264 * instantiation with the argument being a class that implements the @a iface 265 * interface. 266 * 267 * The namespace of the collection class remains opened after 268 * this macro is expanded (i.e. no closing brace with semicolon), which 269 * allows to declare extra collection class members. This namespace 270 * must be closed by the COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END macro. 271 * 272 * For example, given |ComObjPtr <OSomeItem>|, |ISomeItem|| and |OSomeItem| 273 * arguments, this macro will generate the following code: 274 * 275 * <code> 276 * class OSomeItemEnumerator : public 277 * IfaceVectorEnumerator <ISomeItemEnumerator, ISomeItem, ComObjPtr <OSomeItem>, 278 * OSomeItemEnumerator> 279 * {...}; 272 280 * class SomeItemCollection : public 273 * ReadonlyIfaceVector <ISomeItemCollection, ISomeItem, ComObjPtr <SomeItem>, 274 * SomeItemEnumerator, SomeItemCollection> { 281 * ReadonlyIfaceVector <ISomeItemCollection, ISomeItem, ComObjPtr <OSomeItem>, 282 * OSomeItemEnumerator, OSomeItemCollection> 283 * {...}; 275 284 * </code> 276 285 * 277 286 * i.e. it assumes that ISomeItemEnumerator, ISomeItem and ISomeItemCollection 278 * are existing interfaces, and SomeItem implements the ISomeItem interface.287 * are existing interfaces, and OSomeItem implements the ISomeItem interface. 279 288 * It also assumes, that std::list passed to SomeItemCollection::init() 280 * stores objects of |ComObjPtr <SomeItem>| class, i.e. safe pointers around 281 * SomeItem instances. 282 * 283 * See descriptions of the above two templates for more info. 289 * stores objects of the @a itemcls class (|ComObjPtr <OSomeItem>| in the 290 * example above). 291 * 292 * See descriptions of the above IfaceVectorEnumerator and 293 * ReadonlyIfaceVector templates for more info. 284 294 * 285 295 * The generated class also inherits the VirtualBoxSupportTranslation template, … … 288 298 * 289 299 * The macro is best to be placed in the header after SomeItem class 290 * declaration. The COM_DECL_READONLY_ENUM_AND_COLLECTION_END macro must follow 291 * all extra member declarations of the collection class, or right after this 292 * macro if the collection doesn't have extra members. 293 * 294 * @param c component class implementing the interface of items to be stored 295 * in the collection 296 */ 297 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) \ 298 class c##Enumerator \ 299 : public IfaceVectorEnumerator \ 300 <I##c##Enumerator, I##c, ComObjPtr <c>, c##Enumerator> \ 301 , public VirtualBoxSupportTranslation <c##Enumerator> \ 302 { \ 303 NS_DECL_ISUPPORTS \ 304 public: static const wchar_t *getComponentName() { \ 305 return WSTR_LITERAL (c) L"Enumerator"; \ 306 } \ 307 }; \ 308 class c##Collection \ 309 : public ReadonlyIfaceVector \ 310 <I##c##Collection, I##c, I##c##Enumerator, ComObjPtr <c>, c##Enumerator, \ 311 c##Collection> \ 312 , public VirtualBoxSupportTranslation <c##Collection> \ 313 { \ 314 NS_DECL_ISUPPORTS \ 315 public: static const wchar_t *getComponentName() { \ 316 return WSTR_LITERAL (c) L"Collection"; \ 317 } 318 319 /** 320 * This macro is a counterpart to COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN 321 * and must be always used to finalize the collection declaration started 322 * by that macro. 323 * 324 * Currently the macro just expands to the closing brace with semicolon, 325 * but this might change in the future. 326 */ 327 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) \ 328 }; 329 330 /** 331 * This is a "shortcut" macro, for convenience. It expands exactly to: 332 * <code> 333 * COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) 334 * COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) 335 * </code> 336 */ 337 #define COM_DECL_READONLY_ENUM_AND_COLLECTION(c) \ 338 COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) \ 339 COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) 340 341 /** 342 * This macro declares an enumerator class and a collection class for the 343 * given item class and interface. The namespace of the collection class remains 344 * opened after this macro is expanded (i.e. no closing brace with semicolon), 345 * thus allowing one to declare extra collection class members. This namespace 346 * must be closed by the COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END macro. 347 * 348 * For example, given a 'SomeItem' and a 'ISomeItem' arguments, this macro will 349 * declare the following: 350 * 351 * <code> 352 * class SomeItemEnumerator_ComponentName {...}; 353 * class SomeItemCollection_ComponentName {...}; 354 * 355 * class SomeItemEnumerator : public 356 * IfaceVectorEnumerator <ISomeItemEnumerator, ISomeItem, ComPtr <ISomeItem>, 357 * SomeItemEnumerator_ComponentName> {...}; 358 * class SomeItemCollection : public 359 * ReadonlyIfaceVector <ISomeItemCollection, ISomeItem, ComPtr <ISomeItem>, 360 * SomeItemEnumerator, SomeItemCollection_ComponentName> {...}; 361 * </code> 362 * 363 * i.e. it assumes that ISomeItemEnumerator, ISomeItem and ISomeItemCollection 364 * are existing interfaces. It also assumes, that std::list passed to 365 * SomeItemCollection::init() stores objects of |ComPtr <ISomeItem>| class, i.e 366 * safe ISomeItem interface pointers. 367 * 368 * See descriptions of the above two templates for more info. 369 * 370 * The generated class also inherits the VirtualBoxSupportTranslation template, 371 * providing the support for translation of string constants within class 372 * members. 373 * 374 * The macro is best to be placed in the header after SomeItem class 375 * declaration. The COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END macro must follow 376 * all extra member declarations of the collection class, or right after this 377 * macro if the collection doesn't have extra members. 378 * 379 * @param prefix the prefix prepended to the generated collection and 380 * enumerator classes 381 * @param iface interface class 382 */ 383 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN(prefix, iface) \ 300 * declaration. The COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END macro must 301 * follow all extra member declarations of the collection class, or right 302 * after this macro if the collection doesn't have extra members. 303 * 304 * @param itemcls Either ComObjPtr or ComPtr for the class that implements 305 * the given interface of items to be stored in the 306 * collection 307 * @param iface Interface of items implemented by the @a itemcls class 308 * @param prefix Prefix to apply to generated enumerator and collection 309 * names. 310 */ 311 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN(itemcls, iface, prefix) \ 384 312 class prefix##Enumerator \ 385 313 : public IfaceVectorEnumerator \ 386 <iface##Enumerator, iface, ComPtr <iface>, prefix##Enumerator> \314 <iface##Enumerator, iface, itemcls, prefix##Enumerator> \ 387 315 , public VirtualBoxSupportTranslation <prefix##Enumerator> \ 388 316 { \ … … 394 322 class prefix##Collection \ 395 323 : public ReadonlyIfaceVector \ 396 <iface##Collection, iface, iface##Enumerator, ComPtr <iface>, prefix##Enumerator, \324 <iface##Collection, iface, iface##Enumerator, itemcls, prefix##Enumerator, \ 397 325 prefix##Collection> \ 398 326 , public VirtualBoxSupportTranslation <prefix##Collection> \ … … 404 332 405 333 /** 334 * This macro is a counterpart to COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN 335 * and must be always used to finalize the collection declaration started 336 * by that macro. 337 * 338 * Currently the macro just expands to the closing brace with semicolon, 339 * but this might change in the future. 340 */ 341 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END(itemcls, iface, prefix) \ 342 }; 343 344 /** 345 * This is a "shortcut" macro, for convenience. It expands exactly to: 346 * <code> 347 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN(itemcls, iface, prefix) 348 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END(itemcls, iface, prefix) 349 * </code> 350 */ 351 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_EX(itemcls, iface, prefix) \ 352 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (itemcls, iface, prefix) \ 353 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (itemcls, iface, prefix) 354 355 /** 356 * This macro declares an enumerator class and a collection class for the 357 * given item class @a c. 358 * 359 * It's a convenience macro that deduces all arguments to the 360 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN macro from a single @a c 361 * class name argument. Given a class named |SomeItem|, this macro is 362 * equivalent to 363 * <code> 364 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <SomeItem>, ISomeItem, SomeItem) 365 * </code> 366 * and will generate the following code: 367 * <code> 368 * class OSomeItemEnumerator : public 369 * IfaceVectorEnumerator <ISomeItemEnumerator, ISomeItem, ComObjPtr <SomeItem>, 370 * SomeItemEnumerator> 371 * {...}; 372 * class SomeItemCollection : public 373 * ReadonlyIfaceVector <ISomeItemCollection, ISomeItem, ComObjPtr <SomeItem>, 374 * SomeItemEnumerator, SomeItemCollection> 375 * {...}; 376 * </code> 377 * 378 * See COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN for the detailed 379 * description. 380 * 381 * The macro is best to be placed in the header after SomeItem class 382 * declaration. The COM_DECL_READONLY_ENUM_AND_COLLECTION_END macro must follow 383 * all extra member declarations of the collection class, or right after this 384 * macro if the collection doesn't have extra members. 385 * 386 * @param c Component class implementing the interface of items to be stored 387 * in the collection 388 */ 389 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) \ 390 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <c>, I##c, c) 391 392 /** 393 * This macro is a counterpart to COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN 394 * and must be always used to finalize the collection declaration started 395 * by that macro. 396 * 397 * This is a "shortcut" macro that expands exactly to: 398 * <code> 399 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <c>, I##c, c) 400 * </code> 401 */ 402 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) \ 403 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <c>, I##c, c) 404 405 /** 406 * This is a "shortcut" macro, for convenience. It expands exactly to: 407 * <code> 408 * COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) 409 * COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) 410 * </code> 411 */ 412 #define COM_DECL_READONLY_ENUM_AND_COLLECTION(c) \ 413 COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN(c) \ 414 COM_DECL_READONLY_ENUM_AND_COLLECTION_END(c) 415 416 /** 417 * This macro declares an enumerator class and a collection class for the 418 * given item interface @a iface prefixed with the given @a prefix. 419 * 420 * It's a convenience macro that deduces all arguments to the 421 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN macro from the two given 422 * @a iface and @a prefix arguments. Given an interface named |ISomeItem|, 423 * and a prefix SomeItem this macro is equivalent to 424 * <code> 425 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComPtr <ISomeItem>, ISomeItem, SomeItem) 426 * </code> 427 * and will generate the following code: 428 * <code> 429 * class OSomeItemEnumerator : public 430 * IfaceVectorEnumerator <ISomeItemEnumerator, ISomeItem, ComPtr <ISomeItem>, 431 * SomeItemEnumerator> 432 * {...}; 433 * class SomeItemCollection : public 434 * ReadonlyIfaceVector <ISomeItemCollection, ISomeItem, ComPtr <ISomeItem>, 435 * SomeItemEnumerator, SomeItemCollection> 436 * {...}; 437 * </code> 438 * 439 * See COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN for the detailed 440 * description. 441 * 442 * The macro is best to be placed in the header after SomeItem class 443 * declaration. The COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END macro must follow 444 * all extra member declarations of the collection class, or right after this 445 * macro if the collection doesn't have extra members. 446 * 447 * @param prefix Prefix prepended to the generated collection and 448 * enumerator classes 449 * @param iface Interface class 450 */ 451 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN(prefix, iface) \ 452 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComPtr <iface>, iface, prefix) 453 454 /** 406 455 * This macro is a counterpart to COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN 407 456 * and must be always used to finalize the collection declaration started 408 457 * by that macro. 409 * 410 * Currently the macro just expands to the closing brace with semicolon, 411 * but this might change in the future. 458 * 459 * This is a "shortcut" macro that expands exactly to: 460 * <code> 461 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <c>, I##c, c) 462 * </code> 412 463 */ 413 464 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END(prefix, iface) \ 414 };465 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComPtr <iface>, iface, prefix) 415 466 416 467 /** … … 422 473 */ 423 474 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_AS(prefix, iface) \ 424 COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN (prefix, iface) \425 COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END (prefix, iface)475 COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN (prefix, iface) \ 476 COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END (prefix, iface) 426 477 427 478 #ifdef __WIN__ 428 479 480 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX(itemcls, iface, prefix) 429 481 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION(c) 430 482 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(prefix, iface) 483 431 484 #else // !__WIN__ 432 485 … … 434 487 * This macro defines nsISupports implementations (i.e. QueryInterface(), 435 488 * AddRef() and Release()) for the enumerator and collection classes 436 * declared by the COM_DECL_READONLY_ENUM_AND_COLLECTION macro. 489 * declared by the COM_DECL_READONLY_ENUM_AND_COLLECTION_EX, 490 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN and 491 * COM_DECL_READONLY_ENUM_AND_COLLECTION_EX macros. 492 * 493 * See COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN for the detailed 494 * description. 437 495 * 438 496 * The macro should be placed in one of the source files. … … 442 500 * so expands to nothing on Win32. 443 501 * 444 * @param c component class implementing the item interface 445 */ 446 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION(c) \ 447 NS_DECL_CLASSINFO(c##Collection) \ 448 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(c##Collection, I##c##Collection) \ 449 NS_DECL_CLASSINFO(c##Enumerator) \ 450 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(c##Enumerator, I##c##Enumerator) 451 452 /** 453 * This macro defines nsISupports implementations (i.e. QueryInterface(), 454 * AddRef() and Release()) for the enumerator and collection classes 455 * declared by the COM_DECL_READONLY_ENUM_AND_COLLECTION_AS macro. 456 * 457 * The macro should be placed in one of the source files. 458 * 459 * @note 460 * this macro is XPCOM-specific and not necessary for MS COM, 461 * so expands to nothing on Win32. 462 * 463 * @param prefix the prefix prepended to the generated collection and 464 * enumerator classes 465 * @param iface interface class 466 */ 467 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(prefix, iface) \ 502 * @param itemcls Either ComObjPtr or ComPtr for the class that implements 503 * the given interface of items to be stored in the 504 * collection 505 * @param iface Interface of items implemented by the @a itemcls class 506 * @param prefix Prefix to apply to generated enumerator and collection 507 * names. 508 */ 509 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX(itemcls, iface, prefix) \ 468 510 NS_DECL_CLASSINFO(prefix##Collection) \ 469 511 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(prefix##Collection, iface##Collection) \ … … 471 513 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(prefix##Enumerator, iface##Enumerator) 472 514 515 /** 516 * This macro defines nsISupports implementations (i.e. QueryInterface(), 517 * AddRef() and Release()) for the enumerator and collection classes 518 * declared by the COM_DECL_READONLY_ENUM_AND_COLLECTION, 519 * COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN and 520 * COM_DECL_READONLY_ENUM_AND_COLLECTION_END macros. 521 * 522 * See COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN for the detailed 523 * description. 524 * 525 * The macro should be placed in one of the source files. 526 * 527 * @note 528 * this macro is XPCOM-specific and not necessary for MS COM, 529 * so expands to nothing on Win32. 530 * 531 * @param c Component class implementing the interface of items to be stored 532 * in the collection 533 */ 534 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION(c) \ 535 COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX (0, I##c, c) 536 537 /** 538 * This macro defines nsISupports implementations (i.e. QueryInterface(), 539 * AddRef() and Release()) for the enumerator and collection classes 540 * declared by the COM_DECL_READONLY_ENUM_AND_COLLECTION_AS, 541 * COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN and 542 * COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_END macros. 543 * 544 * See COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN for the detailed 545 * description. 546 * 547 * The macro should be placed in one of the source files. 548 * 549 * @note 550 * this macro is XPCOM-specific and not necessary for MS COM, 551 * so expands to nothing on Win32. 552 * 553 * @param prefix Prefix prepended to the generated collection and 554 * enumerator classes 555 * @param iface Interface class 556 */ 557 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(prefix, iface) \ 558 COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX (0, iface, prefix) 559 473 560 #endif // !__WIN__ 474 561 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r235 r436 31 31 class Display; 32 32 class MachineDebugger; 33 class USBDevice;33 class OUSBDevice; 34 34 class RemoteUSBDevice; 35 35 class SharedFolder; … … 323 323 private: 324 324 325 typedef std::list <ComObjPtr < USBDevice> > USBDeviceList;325 typedef std::list <ComObjPtr <OUSBDevice> > USBDeviceList; 326 326 typedef std::list <ComObjPtr <RemoteUSBDevice> > RemoteUSBDeviceList; 327 327 typedef std::list <ComObjPtr <SharedFolder> > SharedFolderList; -
trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h
r1 r436 128 128 }; 129 129 130 131 /// @todo (dmik) give a less stupid name and move to Collection.h 132 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_FOR_BEGIN(c, iface) \ 133 class c##Enumerator \ 134 : public IfaceVectorEnumerator \ 135 <iface##Enumerator, iface, ComObjPtr <c>, c##Enumerator> \ 136 , public VirtualBoxSupportTranslation <c##Enumerator> \ 137 { \ 138 NS_DECL_ISUPPORTS \ 139 public: static const wchar_t *getComponentName() { \ 140 return WSTR_LITERAL (c) L"Enumerator"; \ 141 } \ 142 }; \ 143 class c##Collection \ 144 : public ReadonlyIfaceVector \ 145 <iface##Collection, iface, iface##Enumerator, ComObjPtr <c>, c##Enumerator, \ 146 c##Collection> \ 147 , public VirtualBoxSupportTranslation <c##Collection> \ 148 { \ 149 NS_DECL_ISUPPORTS \ 150 public: static const wchar_t *getComponentName() { \ 151 return WSTR_LITERAL (c) L"Collection"; \ 152 } 153 154 #define COM_DECL_READONLY_ENUM_AND_COLLECTION_FOR_END(c, iface) \ 155 }; 156 157 #ifdef __WIN__ 158 159 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_FOR(c, iface) 160 161 #else // !__WIN__ 162 163 #define COM_IMPL_READONLY_ENUM_AND_COLLECTION_FOR(c, iface) \ 164 NS_DECL_CLASSINFO(c##Collection) \ 165 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(c##Collection, iface##Collection) \ 166 NS_DECL_CLASSINFO(c##Enumerator) \ 167 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(c##Enumerator, iface##Enumerator) 168 169 #endif 170 171 COM_DECL_READONLY_ENUM_AND_COLLECTION_FOR_BEGIN (RemoteUSBDevice, IHostUSBDevice) 130 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice) 172 131 173 132 STDMETHOD(FindById) (INPTR GUIDPARAM aId, IHostUSBDevice **aDevice) … … 226 185 } 227 186 228 COM_DECL_READONLY_ENUM_AND_COLLECTION_ FOR_END (RemoteUSBDevice, IHostUSBDevice)187 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice) 229 188 230 189 -
trunk/src/VBox/Main/include/USBDeviceFilterImpl.h
r1 r436 279 279 * Separate IUSBDeviceCollection implementation that is constructed from a list of 280 280 * IUSBDevice instances (as opposed to a collection defined in IUSBDeviceImpl.h 281 * constructed from USBDevice lists).281 * constructed from OUSBDevice lists). 282 282 */ 283 283 COM_DECL_READONLY_ENUM_AND_COLLECTION_AS_BEGIN (IfaceUSBDevice, IUSBDevice) -
trunk/src/VBox/Main/include/USBDeviceImpl.h
r1 r436 31 31 * Generally this contains much less information. 32 32 */ 33 class ATL_NO_VTABLE USBDevice :34 public VirtualBoxSupportErrorInfoImpl< USBDevice, IUSBDevice>,35 public VirtualBoxSupportTranslation< USBDevice>,33 class ATL_NO_VTABLE OUSBDevice : 34 public VirtualBoxSupportErrorInfoImpl<OUSBDevice, IUSBDevice>, 35 public VirtualBoxSupportTranslation<OUSBDevice>, 36 36 public VirtualBoxBase, 37 37 public IUSBDevice … … 39 39 public: 40 40 41 USBDevice();42 virtual ~ USBDevice();41 OUSBDevice(); 42 virtual ~OUSBDevice(); 43 43 44 DECLARE_NOT_AGGREGATABLE( USBDevice)44 DECLARE_NOT_AGGREGATABLE(OUSBDevice) 45 45 46 46 DECLARE_PROTECT_FINAL_CONSTRUCT() 47 47 48 BEGIN_COM_MAP( USBDevice)48 BEGIN_COM_MAP(OUSBDevice) 49 49 COM_INTERFACE_ENTRY(ISupportErrorInfo) 50 50 COM_INTERFACE_ENTRY(IUSBDevice) … … 98 98 }; 99 99 100 COM_DECL_READONLY_ENUM_AND_COLLECTION_ BEGIN (USBDevice)100 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <OUSBDevice>, IUSBDevice, OUSBDevice) 101 101 102 102 STDMETHOD(FindById) (INPTR GUIDPARAM aId, IUSBDevice **aDevice) … … 121 121 122 122 if (!found) 123 return setError (E_INVALIDARG, USBDeviceCollection::tr (123 return setError (E_INVALIDARG, OUSBDeviceCollection::tr ( 124 124 "Could not find a USB device with UUID {%s}"), 125 125 idToFind.toString().raw()); … … 148 148 149 149 if (!found) 150 return setError (E_INVALIDARG, USBDeviceCollection::tr (150 return setError (E_INVALIDARG, OUSBDeviceCollection::tr ( 151 151 "Could not find a USB device with address '%ls'"), 152 152 aAddress); … … 155 155 } 156 156 157 COM_DECL_READONLY_ENUM_AND_COLLECTION_E ND (USBDevice)157 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <OUSBDevice>, IUSBDevice, OUSBDevice) 158 158 159 159 #endif // ____H_USBDEVICEIMPL -
trunk/src/VBox/Main/linux/module.cpp
r1 r436 57 57 NS_DECL_CLASSINFO(CombinedProgress) 58 58 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(CombinedProgress, IProgress) 59 NS_DECL_CLASSINFO( USBDevice)60 NS_IMPL_THREADSAFE_ISUPPORTS1_CI( USBDevice, IUSBDevice)59 NS_DECL_CLASSINFO(OUSBDevice) 60 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(OUSBDevice, IUSBDevice) 61 61 NS_DECL_CLASSINFO(RemoteUSBDevice) 62 62 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(RemoteUSBDevice, IHostUSBDevice) … … 71 71 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Console, IConsole) 72 72 73 COM_IMPL_READONLY_ENUM_AND_COLLECTION (USBDevice)74 COM_IMPL_READONLY_ENUM_AND_COLLECTION_ FOR(RemoteUSBDevice, IHostUSBDevice)73 COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX(ComObjPtr <OUSBDevice>, IUSBDevice, OUSBDevice) 74 COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX(ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice) 75 75 COM_IMPL_READONLY_ENUM_AND_COLLECTION(SharedFolder) 76 76
Note:
See TracChangeset
for help on using the changeset viewer.