Shell integration idea

Mikołaj Zalewski mikolaj at
Thu Jun 1 15:12:12 CDT 2006

   As a SoC project I'll try to improve the integration of wine with the 
Unix shells. My first step will be to implement the 
Trash. I've written some code that doesn't add any new features but 
shows how I want to add it. I'd like to know if this is a good design?
  The main idea is not to hard-code one implementation of things like 
the Trash into shell32 - not everything is standardized by the 
freedesktop and even if it would this might not work on other systems 
like MacOS X. We should allow for many implementations. The correct one 
is loaded depending on a registry settings (so that a winecfg entry can 
be added). My implementation uses COM objects as it's standard dlls 
provides support for such tasks. Currently there is one interface 
(IWineShellIntegration) that acts as a factory for specialized objects. 
That could also be implemented using COM Aggregation - when we do that 
we could use QueryInterface instead of GetIntegrationObejct.
  Some COM objects can run in the address space of the calling process - 
e.g. the trash can be implemented like that. For others it would be a 
waist of resources (e.g. there is no need for every process to watch is 
the file associations have changed) - it's enough to load them only 
once. The explorer seems to be a good candidate to create such objects.
  In the attached patch there is one specialized interface - the 
IWineTrash. The SHELL_DeleteFile[AW] is patched to use it - it shows a 
different icon if the file can be trashed (these are not the correct 
icons as wine's shell32 uses a message box instead of a special dialog) 
and calls the trash method then. Currently there is only one built-in 
trash that can't trash anything. (note that SHELL_DeleteFile is called 
in the folders that are decendents of My Computer. If choose delete on a 
file that is a decendent of the '/', it will be deleted without a warning).

Mikolaj Zalewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: integration.patch.gz
Type: application/x-gzip
Size: 4353 bytes
Desc: not available
Url :

More information about the wine-devel mailing list