Plugin interface descriptions for TC 7.5 (beta)

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Plugin interface descriptions for TC 7.5 (beta)

Post by *ghisler(Author) »

Last edited by ghisler(Author) on 2010-03-26, 10:18 UTC, edited 1 time in total.
Author of Total Commander
https://www.ghisler.com
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

About Unicode support: It is said in the interface description
Add the files cunicode.h and cunicode.cpp to your project.
However, cunicode.cpp includes fsplugin.h which is normally not used for WCX, WDX or WLX. So, should all plugin types use fsplugin.h?

In contentplugin.HLP -> contplug.h there is still the old version number in the comment
// Contents of file contplug.h version 1.5
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

There are two ways of creating Unicode plugins. The first is to add Unicode functions to an existing plugins.
The second is to use generic characters and compile an Ansi and a Unicode version of the plugin. If you can go this way you should do it.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed you are right - please remove the following definitions and functions for other plugin types:

#include "fsplugin.h"

extern tProgressProc ProgressProc;
extern tLogProc LogProc;
extern tRequestProc RequestProc;
extern tProgressProcW ProgressProcW;
extern tLogProcW LogProcW;
extern tRequestProcW RequestProcW;

ProgressProcT
LogProcT
RequestProcT
Author of Total Commander
https://www.ghisler.com
nyam
Member
Member
Posts: 175
Joined: 2003-06-09, 11:55 UTC
Location: Seoul, Korea
Contact:

Post by *nyam »

Happy to hear 'Unicode support'.

Thank you.
nyam
Member
Member
Posts: 175
Joined: 2003-06-09, 11:55 UTC
Location: Seoul, Korea
Contact:

Post by *nyam »

In listplugin.hlp, There're two ListGetPreviewBitmap' at 'listplug.h' topic.
I think that the later should be named 'ListGetPreviewBitmapW'.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You are right, thanks!
Author of Total Commander
https://www.ghisler.com
User avatar
ND
Member
Member
Posts: 150
Joined: 2006-04-10, 16:24 UTC
Location: Sibiu, RO

Post by *ND »

WCX Writer's Reference -> 5. Callbacks -> [face=courier]tPkCryptProc[/face]
vs.
[face=courier]wcxhead.h[/face] & [face=courier]wcxhead.pas[/face]

Unlike the other callback links, the [face=courier]tPkCryptProc[/face] goes to a function [face=courier]PkCryptProc()[/face] instead of the typedef.
This in itself is not a problem, but I found differences when compared with the source code.

In [face=courier]wcxhead.h[/face] the typedef [face=courier]tPkCryptProc[/face] has an additional [face=courier]int PluginNr[/face] as the first parameter:

Code: Select all

//wcxhead.h
typedef int (__stdcall *tPkCryptProc)(int PluginNr,int CryptoNr,int Mode,
             char* ArchiveName,char* Password,int maxlen);
In [face=courier]wcxhead.pas[/face] the type has a different name, but at least the parameters are the same as the help-file:

Code: Select all

{wcxhead.pas}
  TPkPluginCryptProc=function(CryptoNr:integer;mode:integer;ArchiveName,
    Password:pchar;maxlen:integer):integer; stdcall;
Except the name of one parameter is different in the help-file: [face=courier]CryptoNumber[/face] vs. [face=courier]CryptoNr[/face].
aNDreas Bolotă
The truth always carries the ambiguity of the words used to express it. (Frank Herbert, God Emperor of Dune)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks, I have just corrected the C documentation. There is indeed no PluginNr parameter for packer plugins.
Author of Total Commander
https://www.ghisler.com
User avatar
ND
Member
Member
Posts: 150
Joined: 2006-04-10, 16:24 UTC
Location: Sibiu, RO

Post by *ND »

ghisler(Author) wrote:Thanks, I have just corrected the C documentation. There is indeed no PluginNr parameter for packer plugins.
The Unicode typedef [face=courier]tPkCryptProcW[/face] still has the extra [face=courier]PluginNr[/face] parameter.

------------------------------------------

An additional thing I found is in the documentation of callback function [face=courier]PkCryptProc()[/face]: the return value mentions the constant [face=courier]FS_FILE_OK[/face] for "Success" which is not part of the documented Error codes (where directly the value "0" is given for this purpose). Since that constant is also missing from the source code files, I assume it's coming from the "fsplugin" sample?

------------------------------------------

Like with v2.12, I have made a conversion of the WCX Writer's Reference v2.20 documentation to CHM, which can be found here: http://geocities.com/kirnbie/wcx_knd/
aNDreas Bolotă
The truth always carries the ambiguity of the words used to express it. (Frank Herbert, God Emperor of Dune)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, it's just 0.
Author of Total Commander
https://www.ghisler.com
j
Member
Member
Posts: 124
Joined: 2009-04-13, 19:49 UTC

Post by *j »

It would be nice to mention that ft_stringw has to be used when returning Unicode strings in the "Unicode Support" section of the content plug-in help.

Thank you.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will add the following explanation:

Note: You need to return the type ft_stringw instead of ft_string for Unicode content in ContentGetValueW. This allows you to return either ANSI or Unicode content.
Author of Total Commander
https://www.ghisler.com
Summr
Junior Member
Junior Member
Posts: 19
Joined: 2009-07-19, 15:23 UTC
Location: Hungary

Post by *Summr »

Dear Christian!

I'd like to draw your attention that you use PChar for the parameters of the Ansi functions in fsplugin.pas, but PChar means PWideChar starting from Delphi 2009 so the types won't match. It would be better to use PAnsiChar there.

Best regards
Nyíri László from Hungary
Plugins: RamCopy, Transformer Framework
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, I do not have Delphi 2009, so I didn't know about that. Isn't it a compiler switch?
Author of Total Commander
https://www.ghisler.com
Post Reply