Class | Fox::FXFileDict |
In: |
rdoc-sources/FXFileDict.rb
|
Parent: | FXDict |
The File Association dictionary associates a file extension with a File Association record which contains command name, mime type, icons, and other information about the file type. The icons referenced by the file association are managed by the Icon Dictionary; this guarantees that each icon is loaded only once into memory. The associations are determined by the information by the FOX Registry settings; each entry under the FILETYPES registry section comprises the command line, extension name, large icon, small icon, and mime type:
command ';' extension ';' bigicon [ ':' bigiconopen ] ';' icon [ ':' iconopen ] ';' mime
For example, the binding for "jpg" could be:
xv %s &;JPEG Image;bigimage.xpm;miniimage.xpm;image/jpeg
The association for a file name is determined by first looking at the entire file name, then at the whole extension, and then at sub-extensions. For example, "name.tar.gz", "tar.gz", and "gz" can each be given a different file association. Directory names may also be given associations; there is no command-line association for a directory, however. The association for a directory is found by first checking the whole pathname, then checking the pathname less the first component, and so on. So, "/usr/local/include", "/local/include", and "/include" can each be given their own file associations. If the above lookup procedure has not found a file association, the system uses a fallback associations: for files, the fallback association is determined by the binding "defaultfilebinding". For directories, the "defaultdirbinding" is used, and for executables the "defaultexecbinding" is used.
iconDict | [RW] | Current icon search path [FXIconDict] |
iconPath | [RW] | Current icon search path [String] |
settings | [RW] | Settings database [FXSettings] |
Construct a dictionary that maps file extensions to file associations. If db is not nil, the specified settings database is used as a source for the bindings. Otherwise, the application registry settings are used.
app: Application [FXApp]
db: | Settings database [FXSettings] |