summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-09 11:21:50 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-09 11:21:50 +0000
commitc19923ea294b8143471de5c567c62b4e558b2005 (patch)
tree30dcd3b5dee0edff2527f35947bca02932b45bda
parentd6f51161612cf03c1aba04d0a93b963b7d486ed2 (diff)
- added helper for Icon_Register
- hLangpack made Integer, as it should be - minor changes git-svn-id: http://svn.miranda-ng.org/main/trunk@3934 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/delphi/m_api.pas7
-rw-r--r--include/delphi/m_core.inc31
-rw-r--r--include/delphi/m_helpers.inc13
-rw-r--r--include/delphi/m_system.inc7
-rw-r--r--include/delphi/m_timezones.inc17
5 files changed, 56 insertions, 19 deletions
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas
index 44cd82c311..df759fecf9 100644
--- a/include/delphi/m_api.pas
+++ b/include/delphi/m_api.pas
@@ -42,13 +42,12 @@ interface
{$ENDIF}
uses
- Windows;//, FreeImage;
+ Windows,Messages;//, FreeImage;
// often used
const
strCList:PAnsiChar = 'CList';
const
- WM_USER = $0400; // from Messages
NM_FIRST = 0; // from CommCtrl
// RichEdit definitions
@@ -253,8 +252,8 @@ var
implementation
-const
- hLangpack:THANDLE = 0;
+var
+ hLangpack : integer = 0;
{$undef M_API_UNIT}
{$include m_helpers.inc}
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index 84c5760282..55f77b39be 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -251,6 +251,37 @@ function SetExceptionFilter(pMirandaExceptFilter:pfnExceptionFilter):pfnExceptio
///////////////////////////////////////////////////////////////////////////////
+// icons support
+
+type
+ pIconItem = ^tIconItem;
+ tIconItem = record
+ szDescr:pAnsiChar;
+ szName :pAnsiChar;
+ defIconID,
+ size :int;
+ hIcolib:THANDLE;
+ end;
+ tagIconItem = tIconItem;
+
+ pIconItemW = ^tIconItemW;
+ tIconItemW = record
+ szDescr:pWideChar;
+ szName :pAnsiChar;
+ defIconID,
+ size :int;
+ hIcolib:THANDLE;
+ end;
+ tagIconItemW = tIconItemW;
+
+procedure mir_Icon_Register(hInst:HINST; const szSection:pAnsiChar; pIcons:pIconItem;
+ iCount:size_t; prefix:PAnsiChar; hLangpack:int); stdcall;
+ external CoreDLL name 'Icon_Register';
+procedure mir_Icon_RegisterT(hInst:HINST; const szSection:pWideChar; pIcons:pIconItemW;
+ iCount:size_t; prefix:PAnsiChar; hLangpack:int); stdcall;
+ external CoreDLL name 'Icon_RegisterT';
+
+///////////////////////////////////////////////////////////////////////////////
// language packs support
const
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index bc1668598b..8ea0da211d 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -25,6 +25,9 @@ function WindowList_Broadcast(hList: THandle; message: int; wParam: WPARAM; lPar
function Utils_SaveWindowPosition(hWnd: THandle; hContact: THandle; const szModule, szNamePrefix: PAnsiChar): int_ptr;
function Utils_RestoreWindowPosition(hWnd: THandle; hContact: THandle; Flags: int; const szModule, szNamePrefix: PAnsiChar): int_ptr;
+procedure Icon_Register(hInst:HINST; const szSection:pAnsiChar; pIcons:pIconItem; iCount:size_t; prefix:PAnsiChar=nil);
+procedure Icon_RegisterT(hInst:HINST; const szSection:pWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar=nil);
+
function mir_hashstr(const key:pAnsiChar):uint; {inline;}
function mir_hashstrW(const key:pWideChar):uint; {inline;}
function lrtrim(str:pAnsiChar):pAnsiChar; {inline}
@@ -476,6 +479,16 @@ begin
CallService(MS_FONT_REGISTERW, WPARAM(pFontID), hLangpack);
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);
+end;
+
+procedure Icon_RegisterT(hInst:HINST; const szSection:pWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar);
+begin
+ mir_Icon_RegisterT(hInst, szSection, pIcons, iCount, prefix, hLangpack);
+end;
+
procedure ColourRegister(pColorID:pColourID);
begin
CallService(MS_COLOUR_REGISTERA, WPARAM(pColorID), hLangpack);
diff --git a/include/delphi/m_system.inc b/include/delphi/m_system.inc
index a59723bc05..642c7ab557 100644
--- a/include/delphi/m_system.inc
+++ b/include/delphi/m_system.inc
@@ -33,13 +33,6 @@ const
MIRANDACLASS = 'Miranda';
{$ENDIF}
-// set the default compatibility lever for Miranda 0.4.x
-{$IFNDEF MIRANDA_VER}
-{$DEFINE MIRANDA_VER}
-const
- MIRANDA_VER = $0400;
-{$ENDIF}
-
{ miranda/system/modulesloaded
called after all modules have been successfully initialised
wParam=lParam=0
diff --git a/include/delphi/m_timezones.inc b/include/delphi/m_timezones.inc
index f73627cea7..8ee937d4ed 100644
--- a/include/delphi/m_timezones.inc
+++ b/include/delphi/m_timezones.inc
@@ -48,18 +48,19 @@ type
printDateTime:function(hTZ:THANDLE; szFormat:TChar; szDest:TChar;
cbDest:int; dwFlags:dword):int; cdecl;
- printTimeStamp:function(hTZ:THANDLE; ts:mir_time; szFormat:TChar; szDest:TChar;
- cbDest:int; dwFlags:dword):int; cdecl;
+ printTimeStamp:function(hTZ:THANDLE; ts:mir_time; szFormat:TChar; szDest:TChar;
+ cbDest:int; dwFlags:dword):int; cdecl;
- prepareList :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl;
- selectListItem :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl;
- storeListResults:procedure(hContact:THANDLE; hWnd:HWND; dwFlags:dword); cdecl;
+ prepareList :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl;
+ selectListItem :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl;
+ storeListResults:procedure(hContact:THANDLE; hWnd:HWND; dwFlags:dword); cdecl;
- getTimeZoneTime:function(hTZ:THANDLE; var st:SYSTEMTIME):int; cdecl;
- timeStampToTimeZoneTimeStamp:function(hTZ:THANDLE; ts:mir_time):time_t; cdecl;
+ getTimeZoneTime:function(hTZ:THANDLE; var st:SYSTEMTIME):int; cdecl;
+ timeStampToTimeZoneTimeStamp:function(hTZ:THANDLE; ts:mir_time):time_t; cdecl;
getTzi:function(hTZ:THANDLE):PTimeZoneInformation; cdecl;
- getTzName:function(hTZ:THANDLE):TChar;
+ getTzName:function(hTZ:THANDLE):TChar; cdecl;
+ getTzDescription:function(TZName:TChar):TChar; cdecl;
end;
// every protocol should declare this variable to use the Time API