TrueCryptExplorer for FAR

A place where plug-in developers can share their knowledge and experience.
Locked
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

TrueCryptExplorer for FAR

Post by pepak »

I am crrently trying to adapt [url=http://forums.truecrypt.org/viewtopic.p ... 7&start=98]OTFExplorer[/quote] to work as a FAR plugin. I expect it would be simple enough to get it to work as a MultiArc subplugin, but one reason I wanted to write it as a "full" plugin is that I want to learn some C (I have never studied it, all my knowledge of C comes from reading other people's code and from the fact that many languages uses a syntax similar to C's). I would appreciate some help from people who are more knowledgeable about both FAR Plugin Programming and C Language Programming than I am.

Right now I have implemented these exports:

SetStartupInfo - read settings from the registry and save FSF and FarInfo for future use

GetPluginInfo - register menu item (unused for now) and command prefix

GetMinFarVersion - require FAR v1.70 (just in case)

OpenFilePlugin - ask for password and try to connect to the encrypted container

OpenPlugin - if activated through command prefix, read filename and try to connect to it just like in OpenFilePlugin

ClosePlugin - free memory

GetFindData - read directory and file information for the requested directory

FreeFindData - free memory allocated in GetFindData

SetDirectory - check for directory existence; if it exists, store the new full path for future use

Other functions will be added later.

Most of the stuff I have now works, more or less (that is, the program doesn't crash and the displayed texts seem to be correct). But I noticed several issues I don't know how to solve:

- I can't get anything to display in the title of my plugin's panel (or the title of the FAR window, for that matter). I mean, where regular file panel shows "C:\Documents and Settings" (and title shows "{C:\Documents and Settings} - Far"), my plugin doesn't display anything and the title is just "{} - Far". How do I get FAR to display e.g. "TrueCrypt:\Some\Secret\Directory"?

- All other file panels show directories in CAPS and in white color, as per my Panel Modes and Color Highlighting. In my TCexp plugin, directories use regular file color and case "as is'. Why?

- Is there some FAR function which would process a path for me? I mean, let's say I am in "\Some\Directory" and receive a call to SetDirectory(plugin, "..\Other\Dir"). I could do all the processing myself, but I expect FAR must already use some function which would take "\Some\Directory\..\Other\Dir" and return "\Some\Other\Dir".

That's all the questions for now.
You do not have the required permissions to view the files attached to this post.
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

pepak
1 & 2: You need to implement GetOpenPluginInfo and set the Flags to at leat OPIF_USEHIGHLIGHTING and fill the PanelTitle and CurDir for the title.

3. No such function is available.
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Post by pepak »

Thanks. Unimplemented GetOpenPluginInfo explains the first two issues. I don't need to worry about them right now then.

As for the third question: And could such a function be implemented? I would expect it to be at least as useful as CmpName().
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

pepak
We dont have such a function in FAR we use WinAPI for that. So you will have to implement it yourself if that is really needed or try to use GetFullPathName - as it does not check if the path is real it might work for you with some adjustments.
Locked