summaryrefslogtreecommitdiff
path: root/include/delphi
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 21:32:58 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 21:33:11 +0300
commitf719c8b921c7a46b76453476204224d40c682914 (patch)
treec6d92dc450893e7f5abe60c2046ec9c2d1e3db36 /include/delphi
parent16ad355c8bdc438c3107ee3ba3ad0bf0b8c395fa (diff)
int hLangpack/m_hLang removed and replaced with HPLUGIN
Diffstat (limited to 'include/delphi')
-rw-r--r--include/delphi/m_api.pas1
-rw-r--r--include/delphi/m_core.inc12
-rw-r--r--include/delphi/m_fontservice.inc51
-rw-r--r--include/delphi/m_genmenu.inc2
-rw-r--r--include/delphi/m_helpers.inc76
-rw-r--r--include/delphi/m_hotkeys.inc2
-rw-r--r--include/delphi/m_icolib.inc2
-rw-r--r--include/delphi/m_options.inc9
8 files changed, 42 insertions, 113 deletions
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas
index 2b41c77520..dc8c8ecced 100644
--- a/include/delphi/m_api.pas
+++ b/include/delphi/m_api.pas
@@ -258,7 +258,6 @@ initialization
g_plugin.m_hInst := hInstance;
g_plugin.m_pInfo := @PluginInfo;
RegisterPlugin(g_plugin);
- hLangpack := g_plugin.m_hLang;
finalization
UnregisterPlugin(g_plugin);
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index 7e913e2d7a..28653f3bd1 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -198,10 +198,10 @@ type
tagIconItemW = tIconItemW;
procedure mir_Icon_Register(hInst:HINST; const szSection:PAnsiChar; pIcons:pIconItem;
- iCount:size_t; prefix:PAnsiChar; hLangpack:int=0); stdcall;
+ iCount:size_t; prefix:PAnsiChar; pPlugin:Pointer); stdcall;
external CoreDLL name 'Icon_Register';
procedure mir_Icon_RegisterW(hInst:HINST; const szSection:PWideChar; pIcons:pIconItemW;
- iCount:size_t; prefix:PAnsiChar; hLangpack:int=0); stdcall;
+ iCount:size_t; prefix:PAnsiChar; pPlugin:Pointer); stdcall;
external CoreDLL name 'Icon_RegisterT';
///////////////////////////////////////////////////////////////////////////////
@@ -226,13 +226,13 @@ function LoadLangPack(const szLangPack:PWideChar):int; stdcall;
procedure ReloadLangpack(pszStr:PWideChar); stdcall;
external CoreDLL name 'ReloadLangpack';
-function TranslateA_LP(const str:PAnsiChar; hLang:int):PAnsiChar; stdcall;
+function TranslateA_LP(const str:PAnsiChar; pPlugin:Pointer):PAnsiChar; stdcall;
external CoreDLL name 'TranslateA_LP';
-function TranslateW_LP(const str:PWideChar; hLang:int):PWideChar; stdcall;
+function TranslateW_LP(const str:PWideChar; pPlugin:Pointer):PWideChar; stdcall;
external CoreDLL name 'TranslateW_LP';
-procedure TranslateMenu_LP(hMenu:HMENU; hLang:int); stdcall;
+procedure TranslateMenu_LP(hMenu:HMENU; pPlugin:Pointer); stdcall;
external CoreDLL name 'TranslateMenu_LP';
-procedure TranslateDialog_LP(hDlg:HWND; hLang:int); stdcall;
+procedure TranslateDialog_LP(hDlg:HWND; pPlugin:Pointer); stdcall;
external CoreDLL name 'TranslateDialog_LP';
function mir_hash(const key:pointer; len:uint):uint; stdcall;
diff --git a/include/delphi/m_fontservice.inc b/include/delphi/m_fontservice.inc
index c6dacc42e1..4c6f5c09f4 100644
--- a/include/delphi/m_fontservice.inc
+++ b/include/delphi/m_fontservice.inc
@@ -115,7 +115,7 @@ const
{ fired when a user modifies font settings, so reget your fonts }
ME_FONT_RELOAD:PAnsiChar = 'Font/Reload';
-function Font_Register(pFont:pFontID; hLang:int) : int; stdcall; external AppDll;
+function Font_Register(pFont:pFontID; pPlugin:Pointer) : int; stdcall; external AppDll;
function Font_Get(pGroup,pName:pAnsiChar; pFont:pLogFontA) : longint; stdcall; external AppDll;
type
@@ -151,54 +151,7 @@ const
{ fired when a user modifies font settings, so reget your fonts and colours }
ME_COLOUR_RELOAD:PAnsiChar = 'Colour/Reload';
-function Colour_Register(pColour:pColourID; hLang:int) : int; stdcall; external AppDll;
+function Colour_Register(pColour:pColourID; pPlugin:Pointer) : int; stdcall; external AppDll;
function Colour_Get(pGroup,pName:pAnsiChar) : longint; stdcall; external AppDll;
-//////////////////////////////////////////////////////////////////////////
-//
-// EFFECTS
-//
-type
- FONTEFFECT_tag = record
- effectIndex :byte;
- baseColour :dword; // ARGB
- secondaryColour:dword; // ARGB
- end;
- TFONTEFFECT = FONTEFFECT_tag;
-
-type
- EffectID_tag = record
- cbSize :int;
- group :array [0..63] of AnsiChar;
- name :array [0..63] of AnsiChar;
- dbSettingsGroup:array [0..31] of AnsiChar;
- setting :array [0..31] of AnsiChar;
- flags :dword;
- defeffect :TFONTEFFECT;
- order :int;
- value :TFONTEFFECT;
- end;
- PEffectID = ^TEffectID;
- TEffectID = EffectID_tag;
-
-type
- EffectIDW_tag = record
- cbSize :int;
- group :array [0..63] of WideChar;
- name :array [0..63] of WideChar;
- dbSettingsGroup:array [0..31] of AnsiChar;
- setting :array [0..31] of AnsiChar;
- flags :dword;
- defeffect :TFONTEFFECT;
- order :int;
- value :TFONTEFFECT;
- end;
- PEffectIDW = ^TEffectIDW;
- TEffectIDW = EffectIDW_tag;
-
-const
-// fired when a user modifies font settings, so reget your fonts and colours
-// wparam = lparam = 0
- ME_EFFECT_RELOAD:PAnsiChar = 'Effect/Reload';
-
{$ENDIF}
diff --git a/include/delphi/m_genmenu.inc b/include/delphi/m_genmenu.inc
index 15ee72abeb..5374a42731 100644
--- a/include/delphi/m_genmenu.inc
+++ b/include/delphi/m_genmenu.inc
@@ -156,7 +156,7 @@ type
szName :TCHAR;
flags :integer;
hIcon :HICON; // or hIcolibItem:THANDLE;
- hLangpack :int;
+ pPlugin :Pointer;
uid :MUUID;
end;
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index bea8231de3..cedf8998d5 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -29,7 +29,7 @@ function TranslateWideString(const sz:WideString):WideString;
function TranslateUnicodeString(sz: UnicodeString): UnicodeString;
procedure TranslateDialogDefault(hwndDlg: THANDLE);
procedure TranslateMenu(hMenu: HMENU);
-function Langpack_Register:int_ptr;
+function Langpack_Register:Pointer;
function CreateProtoServiceFunction(const szModule, szService: PAnsiChar; serviceProc: TMIRANDASERVICE): int_ptr;
@@ -61,16 +61,9 @@ function Options_Open(group,page,tab:PWideChar):int_ptr;
procedure MIcoTab_AddItem (hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
procedure MIcoTab_AddItemW(hwnd:HWND; lptzName:PWideChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
-function Crypto_RegisterEngine(pProvider:PCRYPTO_PROVIDER):THANDLE;
-procedure Crypto_EnumProviders(var numProvs:int; var pResult:array of PCRYPTO_PROVIDER);
-function Crypto_GetProvider(pszName:PAnsiChar):PCRYPTO_PROVIDER;
-
{$ELSE}
-var
- hLangpack:int = 0;
-
-function _Srmm_AddButton(bbdi:pBBButton;_hLang:int) : integer; stdcall;
+function _Srmm_AddButton(bbdi:pBBButton; pPlugin:Pointer) : integer; stdcall;
external AppDll name 'Srmm_AddButton';
function _AddMainMenuItem(mi:PMO_MenuItem) : HGENMENU; stdcall;
@@ -219,43 +212,43 @@ end;
function TranslateW(sz: PWideChar): PWideChar;
begin
- result:=TranslateW_LP(sz, hLangpack);
+ result:=TranslateW_LP(sz, @g_plugin);
end;
function Translate(sz: PAnsiChar): PAnsiChar;
begin
- result:=TranslateA_LP(sz, hLangpack);
+ result:=TranslateA_LP(sz, @g_plugin);
end;
function TranslateString(const sz:AnsiString):AnsiString;
begin
- Result:=AnsiString(TranslateA_LP(PAnsiChar(sz),hLangpack));
+ Result:=AnsiString(TranslateA_LP(PAnsiChar(sz),@g_plugin));
end;
function TranslateWideString(const sz:WideString):WideString;
begin
- Result:=WideString(TranslateW_LP(PWideChar(sz),hLangpack));
+ Result:=WideString(TranslateW_LP(PWideChar(sz),@g_plugin));
end;
function TranslateUnicodeString(sz: UnicodeString): UnicodeString;
begin
- Result:=UnicodeString(TranslateW_LP(PWideChar(sz),hLangpack));
+ Result:=UnicodeString(TranslateW_LP(PWideChar(sz),@g_plugin));
end;
procedure TranslateDialogDefault(hwndDlg: THANDLE);
begin
- TranslateDialog_LP(hwndDlg,hLangpack);
+ TranslateDialog_LP(hwndDlg,@g_plugin);
end;
procedure TranslateMenu(hMenu: HMENU);
begin
- TranslateMenu_LP(hMenu,hLangpack);
+ TranslateMenu_LP(hMenu,@g_plugin);
end;
-function Langpack_Register:int_ptr;
+function Langpack_Register:Pointer;
begin
cli := Clist_GetInterface();
- result := hLangpack;
+ result := @g_plugin;
end;
@@ -276,83 +269,83 @@ end;
function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=CallService(MS_CLIST_ADDCONTEXTFRAMEMENUITEM, 0,LPARAM(mi));
end;
function Menu_AddMainMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddMainMenuItem(mi);
end;
function Menu_AddContactMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddContactMenuItem(mi, nil);
end;
function Menu_AddStatusMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddStatusMenuItem(mi, nil);
end;
function Menu_AddProtoMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddProtoMenuItem(mi, nil);
end;
function Menu_AddTrayMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddTrayMenuItem(mi);
end;
function Hotkey_Register(hk:PHOTKEYDESC):int_ptr;
begin
- result:=_Hotkey_Register(hk, hLangpack);
+ result:=_Hotkey_Register(hk, @g_plugin);
end;
function Skin_AddIcon(si:PSKINICONDESC):THANDLE;
begin
- result:=IcoLib_AddIcon(si, hLangpack);
+ result:=IcoLib_AddIcon(si, @g_plugin);
end;
procedure Icon_Register(hInst:HINST; const szSection:PAnsiChar; pIcons:pIconItem; iCount:size_t; prefix:PAnsiChar);
begin
- mir_Icon_Register(hInst, szSection, pIcons, iCount, prefix, hLangpack);
+ mir_Icon_Register(hInst, szSection, pIcons, iCount, prefix, @g_plugin);
end;
procedure Icon_RegisterW(hInst:HINST; const szSection:PWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar);
begin
- mir_Icon_RegisterW(hInst, szSection, pIcons, iCount, prefix, hLangpack);
+ mir_Icon_RegisterW(hInst, szSection, pIcons, iCount, prefix, @g_plugin);
end;
procedure FontRegister(pFontID:pFontID);
begin
- Font_Register(pFontID, hLangpack);
+ Font_Register(pFontID, @g_plugin);
end;
procedure ColourRegister(pColorID:pColourID);
begin
- Colour_Register(pColorID, hLangpack);
+ Colour_Register(pColorID, @g_plugin);
end;
function TopToolbar_AddButton(pButton:PTTBButton):THANDLE;
begin
- result:=CallService(MS_TTB_ADDBUTTON, WPARAM(pButton), hLangpack);
+ result:=CallService(MS_TTB_ADDBUTTON, WPARAM(pButton), LPARAM(@g_plugin));
end;
function Options_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
begin
- result:=_Options_AddPage(wParam, odp, hLangpack);
+ result:=_Options_AddPage(wParam, odp, @g_plugin);
end;
function Options_Open(group,page,tab:PWideChar):int_ptr;
begin
- result:=_Options_Open(group,page,tab,hLangpack);
+ result:=_Options_Open(group,page,tab,@g_plugin);
end;
procedure MIcoTab_AddItem(hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
@@ -385,22 +378,7 @@ end;
procedure Srmm_AddButton(bbdi:pBBButton);
begin
- _Srmm_AddButton(bbdi,hLangpack);
-end;
-
-function Crypto_RegisterEngine(pProvider:PCRYPTO_PROVIDER):THANDLE;
-begin
- result:=THANDLE(CallService(MS_CRYPTO_REGISTER_ENGINE, hLangpack, LPARAM(pProvider)));
-end;
-
-procedure Crypto_EnumProviders(var numProvs:int; var pResult:array of PCRYPTO_PROVIDER);
-begin
- CallService(MS_CRYPTO_ENUM_PROVIDERS, WPARAM(numProvs), LPARAM(@pResult));
-end;
-
-function Crypto_GetProvider(pszName:PAnsiChar):PCRYPTO_PROVIDER;
-begin
- result:=PCRYPTO_PROVIDER(CallService(MS_CRYPTO_GET_PROVIDER, 0, LPARAM(pszName)));
+ _Srmm_AddButton(bbdi,@g_plugin);
end;
function UuidFromStringA(StringUuid:PAnsiChar; var Uuid:TGUID) : integer; stdcall; external 'Rpcrt4.dll';
diff --git a/include/delphi/m_hotkeys.inc b/include/delphi/m_hotkeys.inc
index ba3450f33c..4fb0cfc659 100644
--- a/include/delphi/m_hotkeys.inc
+++ b/include/delphi/m_hotkeys.inc
@@ -40,7 +40,7 @@ type
end;
-function _Hotkey_Register(hk:PHOTKEYDESC; _hLang:int): int; stdcall; external AppDll name 'Hotkey_Register';
+function _Hotkey_Register(hk:PHOTKEYDESC; pPlugin:Pointer): int; stdcall; external AppDll name 'Hotkey_Register';
function Hotkey_Unregister(hk:PAnsiChar): int; stdcall; external AppDll;
{
diff --git a/include/delphi/m_icolib.inc b/include/delphi/m_icolib.inc
index 89b1701b21..57e68e57ef 100644
--- a/include/delphi/m_icolib.inc
+++ b/include/delphi/m_icolib.inc
@@ -33,7 +33,7 @@ const
returns a handle to the newly added item
}
-function IcoLib_AddIcon(pIcon:PSKINICONDESC; iLang:int):THANDLE; stdcall;
+function IcoLib_AddIcon(pIcon:PSKINICONDESC; pPlugin:Pointer):THANDLE; stdcall;
external AppDLL name 'IcoLib_AddIcon';
{
diff --git a/include/delphi/m_options.inc b/include/delphi/m_options.inc
index 55d2411654..e3663cd8e9 100644
--- a/include/delphi/m_options.inc
+++ b/include/delphi/m_options.inc
@@ -58,8 +58,7 @@ type
szTab :TChar; // [TRANSLATED-BY-CORE]
pfnDlgProc :pointer;
pszTemplate :PAnsiChar;
- hInstance :THANDLE;
- hLangpack :int;
+ pPlugin :Pointer;
flags :dword; //
dwInitParam :LPARAM; // a value to pass to lParam of WM_INITDIALOG message
end;
@@ -73,9 +72,9 @@ const
const
PSM_GETBOLDFONT = WM_USER+102; //returns HFONT used for group box titles
-function _Options_AddPage(param:WPARAM; opts:POPTIONSDIALOGPAGE; lang:int) : int; stdcall; external AppDll name 'Options_AddPage';
+function _Options_AddPage(param:WPARAM; opts:POPTIONSDIALOGPAGE; lang:Pointer) : int; stdcall; external AppDll name 'Options_AddPage';
-function _Options_Open(group,page,tab:PWideChar; lang:int):int_ptr; stdcall; external AppDll name 'Options_Open';
-function _Options_OpenPage(group,page,tab:PWideChar; lang:int):HWND; stdcall; external AppDll name 'Options_OpenPage';
+function _Options_Open(group,page,tab:PWideChar; lang:Pointer):int_ptr; stdcall; external AppDll name 'Options_Open';
+function _Options_OpenPage(group,page,tab:PWideChar; lang:Pointer):HWND; stdcall; external AppDll name 'Options_OpenPage';
{$ENDIF}