mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: C header files to plugins SDK
This commit is contained in:
parent
3308b65c14
commit
e4c6dee27a
5 changed files with 385 additions and 50 deletions
50
sdk/common.h
Normal file
50
sdk/common.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#ifdef __GNUC__
|
||||
|
||||
#ifndef __stdcall
|
||||
#define __stdcall __attribute__((stdcall))
|
||||
#endif
|
||||
|
||||
#define MAX_PATH 260
|
||||
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef void *HANDLE;
|
||||
typedef HANDLE HICON;
|
||||
typedef HANDLE HBITMAP;
|
||||
typedef HANDLE HWND;
|
||||
typedef int BOOL;
|
||||
typedef char CHAR;
|
||||
typedef wchar_t WCHAR;
|
||||
|
||||
typedef struct _FILETIME {
|
||||
DWORD dwLowDateTime;
|
||||
DWORD dwHighDateTime;
|
||||
} FILETIME,*PFILETIME,*LPFILETIME;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAA {
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
CHAR cFileName[MAX_PATH];
|
||||
CHAR cAlternateFileName[14];
|
||||
} WIN32_FIND_DATAA,*LPWIN32_FIND_DATAA;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAW {
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
WCHAR cFileName[MAX_PATH];
|
||||
WCHAR cAlternateFileName[14];
|
||||
} WIN32_FIND_DATAW,*LPWIN32_FIND_DATAW;
|
||||
|
||||
#endif
|
||||
172
sdk/wcxplugin.h
Normal file
172
sdk/wcxplugin.h
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
#include "common.h"
|
||||
|
||||
/* Contents of file wcxhead.h */
|
||||
/* It contains definitions of error codes, flags and callbacks */
|
||||
|
||||
/* Error codes returned to calling application */
|
||||
#define E_END_ARCHIVE 10 /* No more files in archive */
|
||||
#define E_NO_MEMORY 11 /* Not enough memory */
|
||||
#define E_BAD_DATA 12 /* Data is bad */
|
||||
#define E_BAD_ARCHIVE 13 /* CRC error in archive data */
|
||||
#define E_UNKNOWN_FORMAT 14 /* Archive format unknown */
|
||||
#define E_EOPEN 15 /* Cannot open existing file */
|
||||
#define E_ECREATE 16 /* Cannot create file */
|
||||
#define E_ECLOSE 17 /* Error closing file */
|
||||
#define E_EREAD 18 /* Error reading from file */
|
||||
#define E_EWRITE 19 /* Error writing to file */
|
||||
#define E_SMALL_BUF 20 /* Buffer too small */
|
||||
#define E_EABORTED 21 /* Function aborted by user */
|
||||
#define E_NO_FILES 22 /* No files found */
|
||||
#define E_TOO_MANY_FILES 23 /* Too many files to pack */
|
||||
#define E_NOT_SUPPORTED 24 /* Function not supported */
|
||||
|
||||
/* flags for unpacking */
|
||||
#define PK_OM_LIST 0
|
||||
#define PK_OM_EXTRACT 1
|
||||
|
||||
/* flags for ProcessFile */
|
||||
#define PK_SKIP 0 /* Skip this file */
|
||||
#define PK_TEST 1 /* Test file integrity */
|
||||
#define PK_EXTRACT 2 /* Extract to disk */
|
||||
|
||||
/* Flags passed through ChangeVolProc */
|
||||
#define PK_VOL_ASK 0 /* Ask user for location of next volume */
|
||||
#define PK_VOL_NOTIFY 1 /* Notify app that next volume will be unpacked */
|
||||
|
||||
/* Flags for packing */
|
||||
|
||||
/* For PackFiles */
|
||||
#define PK_PACK_MOVE_FILES 1 /* Delete original after packing */
|
||||
#define PK_PACK_SAVE_PATHS 2 /* Save path names of files */
|
||||
#define PK_PACK_ENCRYPT 4 /* Ask user for password, then encrypt */
|
||||
|
||||
/* Returned by GetPackCaps */
|
||||
#define PK_CAPS_NEW 1 /* Can create new archives */
|
||||
#define PK_CAPS_MODIFY 2 /* Can modify exisiting archives */
|
||||
#define PK_CAPS_MULTIPLE 4 /* Archive can contain multiple files */
|
||||
#define PK_CAPS_DELETE 8 /* Can delete files */
|
||||
#define PK_CAPS_OPTIONS 16 /* Has options dialog */
|
||||
#define PK_CAPS_MEMPACK 32 /* Supports packing in memory */
|
||||
#define PK_CAPS_BY_CONTENT 64 /* Detect archive type by content */
|
||||
#define PK_CAPS_SEARCHTEXT 128 /* Allow searching for text in archives */
|
||||
/* created with this plugin} */
|
||||
#define PK_CAPS_HIDE 256 /* Show as normal files (hide packer */
|
||||
/* icon), open with Ctrl+PgDn, not Enter*/
|
||||
#define PK_CAPS_ENCRYPT 512 /* Plugin supports PK_PACK_ENCRYPT option*/
|
||||
|
||||
/* Flags for packing in memory */
|
||||
#define MEM_OPTIONS_WANTHEADERS 1 /* Return archive headers with packed data */
|
||||
|
||||
/* Errors returned by PackToMem */
|
||||
#define MEMPACK_OK 0 /* Function call finished OK, but there is more data */
|
||||
#define MEMPACK_DONE 1 /* Function call finished OK, there is no more data */
|
||||
|
||||
#define PK_CRYPT_SAVE_PASSWORD 1
|
||||
#define PK_CRYPT_LOAD_PASSWORD 2
|
||||
#define PK_CRYPT_LOAD_PASSWORD_NO_UI 3 // Load password only if master password has already been entered!
|
||||
#define PK_CRYPT_COPY_PASSWORD 4 // Copy encrypted password to new archive name
|
||||
#define PK_CRYPT_MOVE_PASSWORD 5 // Move password when renaming an archive
|
||||
#define PK_CRYPT_DELETE_PASSWORD 6 // Delete password
|
||||
|
||||
#define PK_CRYPTOPT_MASTERPASS_SET 1 // The user already has a master password defined
|
||||
|
||||
typedef struct {
|
||||
char ArcName[260];
|
||||
char FileName[260];
|
||||
int Flags;
|
||||
int PackSize;
|
||||
int UnpSize;
|
||||
int HostOS;
|
||||
int FileCRC;
|
||||
int FileTime;
|
||||
int UnpVer;
|
||||
int Method;
|
||||
int FileAttr;
|
||||
char* CmtBuf;
|
||||
int CmtBufSize;
|
||||
int CmtSize;
|
||||
int CmtState;
|
||||
} tHeaderData;
|
||||
|
||||
typedef struct {
|
||||
char ArcName[1024];
|
||||
char FileName[1024];
|
||||
int Flags;
|
||||
unsigned int PackSize;
|
||||
unsigned int PackSizeHigh;
|
||||
unsigned int UnpSize;
|
||||
unsigned int UnpSizeHigh;
|
||||
int HostOS;
|
||||
int FileCRC;
|
||||
int FileTime;
|
||||
int UnpVer;
|
||||
int Method;
|
||||
int FileAttr;
|
||||
char* CmtBuf;
|
||||
int CmtBufSize;
|
||||
int CmtSize;
|
||||
int CmtState;
|
||||
char Reserved[1024];
|
||||
} tHeaderDataEx;
|
||||
|
||||
typedef struct {
|
||||
WCHAR ArcName[1024];
|
||||
WCHAR FileName[1024];
|
||||
int Flags;
|
||||
unsigned int PackSize;
|
||||
unsigned int PackSizeHigh;
|
||||
unsigned int UnpSize;
|
||||
unsigned int UnpSizeHigh;
|
||||
int HostOS;
|
||||
int FileCRC;
|
||||
int FileTime;
|
||||
int UnpVer;
|
||||
int Method;
|
||||
int FileAttr;
|
||||
char* CmtBuf;
|
||||
int CmtBufSize;
|
||||
int CmtSize;
|
||||
int CmtState;
|
||||
char Reserved[1024];
|
||||
} tHeaderDataExW;
|
||||
|
||||
typedef struct {
|
||||
char* ArcName;
|
||||
int OpenMode;
|
||||
int OpenResult;
|
||||
char* CmtBuf;
|
||||
int CmtBufSize;
|
||||
int CmtSize;
|
||||
int CmtState;
|
||||
} tOpenArchiveData;
|
||||
|
||||
typedef struct {
|
||||
WCHAR* ArcName;
|
||||
int OpenMode;
|
||||
int OpenResult;
|
||||
WCHAR* CmtBuf;
|
||||
int CmtBufSize;
|
||||
int CmtSize;
|
||||
int CmtState;
|
||||
} tOpenArchiveDataW;
|
||||
|
||||
typedef struct {
|
||||
int size;
|
||||
DWORD PluginInterfaceVersionLow;
|
||||
DWORD PluginInterfaceVersionHi;
|
||||
char DefaultIniName[MAX_PATH];
|
||||
} PackDefaultParamStruct;
|
||||
|
||||
/* Definition of callback functions called by the DLL
|
||||
Ask to swap disk for multi-volume archive */
|
||||
typedef int (__stdcall *tChangeVolProc)(char *ArcName,int Mode);
|
||||
typedef int (__stdcall *tChangeVolProcW)(WCHAR *ArcName,int Mode);
|
||||
/* Notify that data is processed - used for progress dialog */
|
||||
typedef int (__stdcall *tProcessDataProc)(char *FileName,int Size);
|
||||
typedef int (__stdcall *tProcessDataProcW)(WCHAR *FileName,int Size);
|
||||
typedef int (__stdcall *tPkCryptProc)(int CryptoNr,int Mode,
|
||||
char* ArchiveName,char* Password,int maxlen);
|
||||
typedef int (__stdcall *tPkCryptProcW)(int CryptoNr,int Mode,
|
||||
WCHAR* ArchiveName,WCHAR* Password,int maxlen);
|
||||
|
||||
|
||||
99
sdk/wdxplugin.h
Normal file
99
sdk/wdxplugin.h
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
#include "common.h"
|
||||
|
||||
// Contents of file contplug.h version 2.0
|
||||
|
||||
#define ft_nomorefields 0
|
||||
#define ft_numeric_32 1
|
||||
#define ft_numeric_64 2
|
||||
#define ft_numeric_floating 3
|
||||
#define ft_date 4
|
||||
#define ft_time 5
|
||||
#define ft_boolean 6
|
||||
#define ft_multiplechoice 7
|
||||
#define ft_string 8
|
||||
#define ft_fulltext 9
|
||||
#define ft_datetime 10
|
||||
#define ft_stringw 11
|
||||
|
||||
// for ContentGetValue
|
||||
#define ft_nosuchfield -1 // error, invalid field number given
|
||||
#define ft_fileerror -2 // file i/o error
|
||||
#define ft_fieldempty -3 // field valid, but empty
|
||||
|
||||
#define ft_ondemand -4 // field will be retrieved only when user presses <SPACEBAR>
|
||||
#define ft_notsupported -5 // function not supported
|
||||
#define ft_setcancel -6 // user clicked cancel in field editor
|
||||
#define ft_delayed 0 // field takes a long time to extract -> try again in background
|
||||
|
||||
// for ContentSetValue
|
||||
#define ft_setsuccess 0 // setting of the attribute succeeded
|
||||
|
||||
// for ContentGetSupportedFieldFlags
|
||||
#define contflags_edit 1
|
||||
#define contflags_substsize 2
|
||||
|
||||
#define contflags_substdatetime 4
|
||||
#define contflags_substdate 6
|
||||
#define contflags_substtime 8
|
||||
#define contflags_substattributes 10
|
||||
#define contflags_substattributestr 12
|
||||
#define contflags_passthrough_size_float 14
|
||||
#define contflags_substmask 14
|
||||
#define contflags_fieldedit 16
|
||||
|
||||
#define contst_readnewdir 1
|
||||
#define contst_refreshpressed 2
|
||||
#define contst_showhint 4
|
||||
|
||||
#define setflags_first_attribute 1 // First attribute of this file
|
||||
#define setflags_last_attribute 2 // Last attribute of this file
|
||||
|
||||
#define setflags_only_date 4 // Only set the date of the datetime value!
|
||||
|
||||
#define editflags_initialize 1 // The data passed to the plugin may be used to
|
||||
// initialize the edit dialog
|
||||
|
||||
#define CONTENT_DELAYIFSLOW 1 // ContentGetValue called in foreground
|
||||
#define CONTENT_PASSTHROUGH 2 // If requested via contflags_passthrough_size_float: The size
|
||||
// is passed in as floating value, TC expects correct value
|
||||
|
||||
// from the given units value, and optionally a text string
|
||||
|
||||
typedef struct {
|
||||
int size;
|
||||
DWORD PluginInterfaceVersionLow;
|
||||
DWORD PluginInterfaceVersionHi;
|
||||
char DefaultIniName[MAX_PATH];
|
||||
} ContentDefaultParamStruct;
|
||||
|
||||
typedef struct {
|
||||
|
||||
WORD wYear;
|
||||
WORD wMonth;
|
||||
WORD wDay;
|
||||
} tdateformat,*pdateformat;
|
||||
|
||||
typedef struct {
|
||||
WORD wHour;
|
||||
WORD wMinute;
|
||||
WORD wSecond;
|
||||
} ttimeformat,*ptimeformat;
|
||||
|
||||
int __stdcall ContentGetDetectString(char* DetectString,int maxlen);
|
||||
int __stdcall ContentGetSupportedField(int FieldIndex,char* FieldName,char* Units,int maxlen);
|
||||
int __stdcall ContentGetValue(char* FileName,int FieldIndex,int UnitIndex,void* FieldValue,int maxlen,int flags);
|
||||
int __stdcall ContentGetValueW(WCHAR* FileName,int FieldIndex,int UnitIndex,void* FieldValue,int maxlen,int flags);
|
||||
|
||||
void __stdcall ContentSetDefaultParams(ContentDefaultParamStruct* dps);
|
||||
void __stdcall ContentPluginUnloading(void);
|
||||
void __stdcall ContentStopGetValue(char* FileName);
|
||||
void __stdcall ContentStopGetValueW(WCHAR* FileName);
|
||||
int __stdcall ContentGetDefaultSortOrder(int FieldIndex);
|
||||
int __stdcall ContentGetSupportedFieldFlags(int FieldIndex);
|
||||
int __stdcall ContentSetValue(char* FileName,int FieldIndex,int UnitIndex,int FieldType,void* FieldValue,int flags);
|
||||
int __stdcall ContentSetValueW(WCHAR* FileName,int FieldIndex,int UnitIndex,int FieldType,void* FieldValue,int flags);
|
||||
|
||||
int __stdcall ContentEditValue(HWND ParentWin,int FieldIndex,int UnitIndex,int FieldType,
|
||||
void* FieldValue,int maxlen,int flags,char* langidentifier);
|
||||
void __stdcall ContentSendStateInformation(int state,char* path);
|
||||
void __stdcall ContentSendStateInformationW(int state,WCHAR* path);
|
||||
|
|
@ -1,53 +1,4 @@
|
|||
#ifdef __GNUC__
|
||||
|
||||
#ifndef __stdcall
|
||||
#define __stdcall __attribute__((stdcall))
|
||||
#endif
|
||||
|
||||
#define MAX_PATH 260
|
||||
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef void *HANDLE;
|
||||
typedef HANDLE HICON;
|
||||
typedef HANDLE HBITMAP;
|
||||
typedef HANDLE HWND;
|
||||
typedef int BOOL;
|
||||
typedef char CHAR;
|
||||
typedef wchar_t WCHAR;
|
||||
|
||||
typedef struct _FILETIME {
|
||||
DWORD dwLowDateTime;
|
||||
DWORD dwHighDateTime;
|
||||
} FILETIME,*PFILETIME,*LPFILETIME;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAA {
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
CHAR cFileName[MAX_PATH];
|
||||
CHAR cAlternateFileName[14];
|
||||
} WIN32_FIND_DATAA,*LPWIN32_FIND_DATAA;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAW {
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
WCHAR cFileName[MAX_PATH];
|
||||
WCHAR cAlternateFileName[14];
|
||||
} WIN32_FIND_DATAW,*LPWIN32_FIND_DATAW;
|
||||
|
||||
#endif
|
||||
#include "common.h"
|
||||
|
||||
// contents of fsplugin.h version 2.0 (30.Jan.2009)
|
||||
|
||||
|
|
|
|||
63
sdk/wlxplugin.h
Normal file
63
sdk/wlxplugin.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include "common.h"
|
||||
|
||||
/* Contents of file listplug.h */
|
||||
|
||||
#define lc_copy 1
|
||||
#define lc_newparams 2
|
||||
#define lc_selectall 3
|
||||
#define lc_setpercent 4
|
||||
|
||||
#define lcp_wraptext 1
|
||||
#define lcp_fittowindow 2
|
||||
#define lcp_ansi 4
|
||||
#define lcp_ascii 8
|
||||
#define lcp_variable 12
|
||||
#define lcp_forceshow 16
|
||||
#define lcp_fitlargeronly 32
|
||||
#define lcp_center 64
|
||||
|
||||
#define lcs_findfirst 1
|
||||
#define lcs_matchcase 2
|
||||
#define lcs_wholewords 4
|
||||
#define lcs_backwards 8
|
||||
|
||||
#define itm_percent 0xFFFE
|
||||
#define itm_fontstyle 0xFFFD
|
||||
#define itm_wrap 0xFFFC
|
||||
#define itm_fit 0xFFFB
|
||||
#define itm_next 0xFFFA
|
||||
#define itm_center 0xFFF9
|
||||
|
||||
#define LISTPLUGIN_OK 0
|
||||
|
||||
#define LISTPLUGIN_ERROR 1
|
||||
|
||||
typedef struct {
|
||||
int size;
|
||||
DWORD PluginInterfaceVersionLow;
|
||||
DWORD PluginInterfaceVersionHi;
|
||||
char DefaultIniName[MAX_PATH];
|
||||
} ListDefaultParamStruct;
|
||||
|
||||
HWND __stdcall ListLoad(HWND ParentWin,char* FileToLoad,int ShowFlags);
|
||||
HWND __stdcall ListLoadW(HWND ParentWin,WCHAR* FileToLoad,int ShowFlags);
|
||||
int __stdcall ListLoadNext(HWND ParentWin,HWND PluginWin,char* FileToLoad,int ShowFlags);
|
||||
int __stdcall ListLoadNextW(HWND ParentWin,HWND PluginWin,WCHAR* FileToLoad,int ShowFlags);
|
||||
void __stdcall ListCloseWindow(HWND ListWin);
|
||||
void __stdcall ListGetDetectString(char* DetectString,int maxlen);
|
||||
int __stdcall ListSearchText(HWND ListWin,char* SearchString,int SearchParameter);
|
||||
int __stdcall ListSearchTextW(HWND ListWin,WCHAR* SearchString,int SearchParameter);
|
||||
|
||||
int __stdcall ListSearchDialog(HWND ListWin,int FindNext);
|
||||
int __stdcall ListSendCommand(HWND ListWin,int Command,int Parameter);
|
||||
int __stdcall ListPrint(HWND ListWin,char* FileToPrint,char* DefPrinter,
|
||||
int PrintFlags,RECT* Margins);
|
||||
int __stdcall ListPrintW(HWND ListWin,WCHAR* FileToPrint,WCHAR* DefPrinter,
|
||||
int PrintFlags,RECT* Margins);
|
||||
int __stdcall ListNotificationReceived(HWND ListWin,int Message,WPARAM wParam,LPARAM lParam);
|
||||
void __stdcall ListSetDefaultParams(ListDefaultParamStruct* dps);
|
||||
HBITMAP __stdcall ListGetPreviewBitmap(char* FileToLoad,int width,int height,
|
||||
|
||||
char* contentbuf,int contentbuflen);
|
||||
HBITMAP __stdcall ListGetPreviewBitmapW(WCHAR* FileToLoad,int width,int height,
|
||||
char* contentbuf,int contentbuflen);
|
||||
Loading…
Add table
Add a link
Reference in a new issue