summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-07-24 14:50:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-07-24 14:50:37 +0300
commit1ecb5424cdf72be85d0c016f650d29cf62447c83 (patch)
tree5b23dc2f2919de56a240aeb467c6500d7c513ed3
parent103de9c164934b2393dfcba7011625f90c8a2097 (diff)
code cleaning
-rw-r--r--include/delphi/m_database.inc3
-rw-r--r--include/delphi/m_utils.inc49
-rw-r--r--include/m_database.h8
-rw-r--r--include/m_utils.h7
-rw-r--r--plugins/Watrack/watrack.dpr1
5 files changed, 9 insertions, 59 deletions
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc
index 1dd6902549..fee5eac3cb 100644
--- a/include/delphi/m_database.inc
+++ b/include/delphi/m_database.inc
@@ -275,14 +275,13 @@ Returns -1 on error (e.g., event type already registred), 0 on success
type
PDBEVENTTYPEDESCR = ^TDBEVENTTYPEDESCR;
TDBEVENTTYPEDESCR = record
- cbSize :int; // structure size in bytes
module :PAnsiChar; // event module name
+ flags :dword; // flags, combination of the DETF_*
eventType :int; // event id, unique for this module (actually, word size)
descr :PAnsiChar; // event type description (i.e. "File Transfer")
textService:PAnsiChar; // service name for MS_DB_EVENT_GETTEXT (0.8+, default Module+'/GetEventText'+EvtID)
iconService:PAnsiChar; // service name for MS_DB_EVENT_GETICON (0.8+, default Module+'/GetEventIcon'+EvtID)
eventIcon :THANDLE; // icolib handle to eventicon (0.8+, default 'eventicon_'+Module+EvtID)
- flags :dword; // flags, combination of the DETF_*
end;
const
diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc
index 67bf5c473f..d308287544 100644
--- a/include/delphi/m_utils.inc
+++ b/include/delphi/m_utils.inc
@@ -57,13 +57,6 @@ type
TDIALOGRESIZERPROC = function(hwndDlg: THANDLE; lParam: LPARAM; urc: PUTILRESIZECONTROL): int; cdecl;
- PCountryListEntry = ^TCountryListEntry;
- TCountryListEntry = record
- id : int;
- szName : PAnsiChar;
- ISOcode: array [0..2] of AnsiChar;
- end;
-
{
Affect : Open a URL in the user's default web browser, see notes
Notes : bOpenInWindow should be zero to open the URL in the browoser window
@@ -90,48 +83,6 @@ procedure Utils_OpenUrlW(const url:PWideChar; bOpenInWindow:BYTE=1); stdcall;
function Utils_ResizeDialog(hwndDlg:THANDLE; hInst:HINST; pTemplate:PAnsiChar; pFunc:TDIALOGRESIZERPROC; lParam:LPARAM=0) : int; stdcall;
external CoreDLL name 'Utils_ResizeDialog';
- {
- wParam : countryID
- lParam : 0
- Affect : Get the name of a country given it's number, e.g. 44 = UK
- Returns: Returns a pointer to a string containing the country name on success
- NULL(0) on failure
- Version: v0.1.2.0+
- }
-const
- MS_UTILS_GETCOUNTRYBYNUMBER:PAnsiChar = 'Utils/GetCountryByNumber';
-
- {
- Gets the name of a country given its ISO code v0.1.2.0+
- wParam = (char*)ISOcode
- lParam = 0
- Returns a pointer to the string containing the country name on success,
- or NULL on failure
- }
- MS_UTILS_GETCOUNTRYBYISOCODE:PAnsiChar = 'Utils/GetCountryByISOCode';
-
- {
- wParam : Pointer to an int to be filled with count -- !TODO! test.
- lParam : Pointer to an PCountryListEntry, see notes
- Affect : Get the full list of country IDs, see notes
- Returns: 0 always
- Notes : the list is sorted alphabetically by name, on the assumption
- it's quicker to search numbers that are out of outer, than strings
- that are out of order. a NULL(0) entry terminates
- -
- Neither wParam or lParam can be NULL(0)
- -
- lParam is filled with the first entry, it can be accessed as a pointer,
- to get the next entry, increment the pointer by sizeof(Pointer) NOT
- sizeof(TCountryList), only increment the pointer as many times as
- given by iCount.
- -
- this data can NOT be copied if an array of TCountryListEntry's is passed
- so don't try it.
- Version: v0.1.2.0+
- }
- MS_UTILS_GETCOUNTRYLIST:PAnsiChar = 'Utils/GetCountryList';
-
//******************************* Window lists *******************************
{
diff --git a/include/m_database.h b/include/m_database.h
index 38761c1a03..3a72dba2f0 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -477,18 +477,16 @@ typedef struct {
//
// Returns -1 on error (e.g., event type already registred), 0 on success
-typedef struct
+struct DBEVENTTYPEDESCR
{
- int cbSize; // structure size in bytes
LPSTR module; // event module name
+ DWORD flags; // flags, combination of the DETF_*
int eventType; // event id, unique for this module
LPSTR descr; // event type description (i.e. "File Transfer")
LPSTR textService; // service name for MS_DB_EVENT_GETTEXT (0.8+, default Module+'/GetEventText'+EvtID)
LPSTR iconService; // service name for MS_DB_EVENT_GETICON (0.8+, default Module+'/GetEventIcon'+EvtID)
HANDLE eventIcon; // icolib handle to eventicon (0.8+, default 'eventicon_'+Module+EvtID)
- DWORD flags; // flags, combination of the DETF_*
-}
- DBEVENTTYPEDESCR;
+};
// constants for default event behaviour
#define DETF_HISTORY 1 // show event in history
diff --git a/include/m_utils.h b/include/m_utils.h
index e287a89975..9026e49a71 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -107,11 +107,14 @@ Neither wParam nor lParam can be NULL.
The list is sorted alphabetically by country name, on the assumption that it's
quicker to search numbers out of order than it is to search names out of order
*/
-struct CountryListEntry {
+
+struct CountryListEntry
+{
int id;
- const char *szName;
char ISOcode[3];
+ const char *szName;
};
+
#define MS_UTILS_GETCOUNTRYLIST "Utils/GetCountryList"
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Watrack/watrack.dpr b/plugins/Watrack/watrack.dpr
index b12c5cdb4b..b4016d950a 100644
--- a/plugins/Watrack/watrack.dpr
+++ b/plugins/Watrack/watrack.dpr
@@ -526,7 +526,6 @@ begin
IsMultiThread:=true;
// Register WATrack events
- dbetd.cbSize :=SizeOf(TDBEVENTTYPEDESCR);
dbetd.module :=PluginShort;
dbetd.textService:=nil;
dbetd.iconService:=nil;