diff options
author | George Hazan <george.hazan@gmail.com> | 2016-10-03 16:48:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-10-03 16:48:12 +0000 |
commit | 0976190894d653d5062f8ef6befabf46218f2d24 (patch) | |
tree | 4a26f4baa9a535256d7220a0c04a698390cab4e5 /include/delphi | |
parent | 3c4ccf82586be6b22380df2bc35ae4770f91651f (diff) |
- inlined helpers for fonts, colors & effects creation replaced with functions;
- services for getting fonts, colors & effects removed;
- some memory corruptions removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@17347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi')
-rw-r--r-- | include/delphi/m_fontservice.inc | 51 | ||||
-rw-r--r-- | include/delphi/m_helpers.inc | 31 |
2 files changed, 9 insertions, 73 deletions
diff --git a/include/delphi/m_fontservice.inc b/include/delphi/m_fontservice.inc index b93f7cf653..c6dacc42e1 100644 --- a/include/delphi/m_fontservice.inc +++ b/include/delphi/m_fontservice.inc @@ -112,22 +112,12 @@ type PFontIDW = ^TFontIDW;
const
- { register a font }
- { wparam = pointer to FontID structure}
- { lparam = hLangpack }
- MS_FONT_REGISTERA:PAnsiChar = 'Font/Register';
- MS_FONT_REGISTERW:PAnsiChar = 'Font/RegisterW';
-
- { get a font }
- { wparam = pointer to FontID structure (only name and group matter) }
- { lParam = pointer to LOGFONT structure }
- { returns the font's colour }
- MS_FONT_GETA:PAnsiChar = 'Font/Get';
- MS_FONT_GETW:PAnsiChar = 'Font/GetW';
-
{ 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_Get(pGroup,pName:pAnsiChar; pFont:pLogFontA) : longint; stdcall; external AppDll;
+
type
PColourID_tag = ^TColourID_tag;
TColourID_tag = record
@@ -158,29 +148,11 @@ type PColourIDW = ^TColourIDW;
const
- { register a colour (this should be used for everything except actual text colour for registered fonts) }
- { [note - a colour with name 'Background' has special meaning and will be used as the background colour of }
- { the font list box in the options, for the given group] }
- { wparam = pointer to ColourID structure }
- { lparam = hLangpack }
- MS_COLOUR_REGISTERA:PAnsiChar = 'Colour/Register';
- MS_COLOUR_REGISTERW:PAnsiChar = 'Colour/RegisterW';
-
- { get a colour }
- { wparam = pointer to ColourID structure (only name and group matter) }
- { returns the colour (as COLORREF), or -1 if not found }
- MS_COLOUR_GETA:PAnsiChar = 'Colour/Get';
- MS_COLOUR_GETW:PAnsiChar = 'Colour/GetW';
-
{ fired when a user modifies font settings, so reget your fonts and colours }
ME_COLOUR_RELOAD:PAnsiChar = 'Colour/Reload';
-var
- MS_FONT_REGISTER :PAnsiChar absolute MS_FONT_REGISTERW;
- MS_FONT_GET :PAnsiChar absolute MS_FONT_GETW;
- MS_COLOUR_REGISTER:PAnsiChar absolute MS_COLOUR_REGISTERW;
- MS_COLOUR_GET :PAnsiChar absolute MS_COLOUR_GETW;
-
+function Colour_Register(pColour:pColourID; hLang:int) : int; stdcall; external AppDll;
+function Colour_Get(pGroup,pName:pAnsiChar) : longint; stdcall; external AppDll;
//////////////////////////////////////////////////////////////////////////
//
@@ -225,19 +197,6 @@ type TEffectIDW = EffectIDW_tag;
const
-// register an effect
-// wparam = (EffectID *)&effect_id
-// lparam = hLangpack
- MS_EFFECT_REGISTERA:PAnsiChar = 'Effect/Register';
- MS_EFFECT_REGISTERW:PAnsiChar = 'Effect/RegisterW';
-
-// get a effect
-// wparam = (EffectID *)&effect_id (only name and group matter)
-// lparam = (FONTEFFECT *)&effect
-// rerturns 0, or -1 if not found
- MS_EFFECT_GET :PAnsiChar = 'Effect/Get';
- MS_EFFECT_GETW:PAnsiChar = 'Effect/GetW';
-
// fired when a user modifies font settings, so reget your fonts and colours
// wparam = lparam = 0
ME_EFFECT_RELOAD:PAnsiChar = 'Effect/Reload';
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index 62bdd92c10..f923dcc8d9 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -60,14 +60,8 @@ function Skin_AddIcon(si:PSKINICONDESC):THANDLE; procedure Icon_Register (hInst:HINST; const szSection:PAnsiChar; pIcons:pIconItem ; iCount:size_t; prefix:PAnsiChar);
procedure Icon_RegisterW(hInst:HINST; const szSection:PWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar);
-procedure FontRegister (pFontID:pFontID);
-procedure FontRegisterW(pFontID:pFontIDW);
-
-procedure ColourRegister (pColorID:pColourID);
-procedure ColourRegisterW(pColorID:pColourIDW);
-
-procedure EffectRegister (pEffectID:pEffectID);
-procedure EffectRegisterW(pEffectID:pEffectIDW);
+procedure FontRegister(pFontID:pFontID);
+procedure ColourRegister(pColorID:pColourID);
function TopToolbar_AddButton(pButton:PTTBButton):THANDLE;
@@ -421,29 +415,12 @@ end; procedure FontRegister(pFontID:pFontID);
begin
- CallService(MS_FONT_REGISTERA, WPARAM(pFontID), hLangpack);
-end;
-procedure FontRegisterW(pFontID:pFontIDW);
-begin
- CallService(MS_FONT_REGISTERW, WPARAM(pFontID), hLangpack);
+ Font_Register(pFontID, hLangpack);
end;
procedure ColourRegister(pColorID:pColourID);
begin
- CallService(MS_COLOUR_REGISTERA, WPARAM(pColorID), hLangpack);
-end;
-procedure ColourRegisterW(pColorID:pColourIDW);
-begin
- CallService(MS_COLOUR_REGISTERW, WPARAM(pColorID), hLangpack);
-end;
-
-procedure EffectRegister(pEffectID:pEffectID);
-begin
- CallService(MS_EFFECT_REGISTERA, WPARAM(pEffectID), hLangpack);
-end;
-procedure EffectRegisterW(pEffectID:pEffectIDW);
-begin
- CallService(MS_EFFECT_REGISTERW, WPARAM(pEffectID), hLangpack);
+ Colour_Register(pColorID, hLangpack);
end;
function TopToolbar_AddButton(pButton:PTTBButton):THANDLE;
|