Well, the VFS is finally here and it's going to grow. I will not describe here the full guide to make your own module, if you want to make one, please contact me, it will require probably more cooperation.
The Concept
VFS (Virtual File System) modules (plugins) are small libraries which include a functionality for access to a remote filesystem or explore the contents of a packed archive. The main goal is to access the virtual filesystem in the same way like it was local filesystem. User should be able to perform basic operations such as directory tree browsing, copying, deleting... The modules have unified API which they communicate with the host application (Tux Commander here) and they could be used also in other file managers (sharing the modules vice versa).
Implementation
The host application is searching for available modules on program start in these locations: /usr/lib/tuxcmd, /usr/local/lib/tuxcmd, ~/.tuxcmd/plugins and ./plugins and tries to load each module. If the module is successfully loaded, the new submenu will appear under the Plugins menu. At this time, there's only the About item, but in the future, the other items will appear (plugin actions, configuration dialogs). For testing purposes there's also a Test plugin dialog where you can try to open the URI with the selected module and test/debug the functionality.
Each module can provide access to the archives and/or to the remote services. You can use integrated Connection Manager to define new connections, which are using the services of the VFS modules.
If the modules aren't loaded on startup, please run tuxcmd with parameter --debug and watch the debug log, you should see what happened. Additionally you can run ldd on each module to see if there are all required libraries available in your system.
Development
The modules are standard unix shared objects (dynamic libraries) and they're loaded dynamically from the host application. You can write your own modules in any programming language, if they could generate compatible so libraries (e.g. gcc, Kylix, FPC, maybe Mono?). If you are using Pascal or other non-C languages you have to use the cdecl directive or such equivalent. If the module is dependent on some other system libraries not present in the system running in, it will simply display an error message to the debug log and the module will not be present in the application.
There are two modules available in the sources: gnome-vfs and null. You can use the null module to start making your own plugin, there is a skeleton of all functions used in the current version of VFS API. With included Makefile, you can easily compile the module and test the binary version. You can also take a look to the file uVFSprototypes.pas, there are simple comments to each function used in the API. Please note that the API is not fully stable yet, there will be probably some minor changes in the future, mostly for better error handling. I will not describe here detailed comments for each function, maybe when the VSF API v3 will be finished (corrected and working stable VFS API).
|