From 2bbb9971bf1711850504d93828f571e27147abc7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Mar 2013 20:10:26 +0000 Subject: MS_DB_EVENT_* services' calls removed from pascal sources git-svn-id: http://svn.miranda-ng.org/main/trunk@4262 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryPlusPlus/EmptyHistoryForm.pas | 6 +- plugins/HistoryPlusPlus/GlobalSearch.pas | 2 +- plugins/HistoryPlusPlus/HistoryForm.pas | 26 +-- plugins/HistoryPlusPlus/historypp.dpr | 2 +- plugins/HistoryPlusPlus/historypp.dproj | 244 +++++++++++++++++++++++++ plugins/HistoryPlusPlus/hpp_bookmarks.pas | 14 +- plugins/HistoryPlusPlus/hpp_events.pas | 8 +- plugins/HistoryPlusPlus/hpp_external.pas | 2 +- plugins/HistoryPlusPlus/hpp_externalgrid.pas | 7 +- plugins/HistoryPlusPlus/hpp_searchthread.pas | 8 +- plugins/HistoryPlusPlus/hpp_services.pas | 4 +- plugins/HistoryPlusPlus/hpp_sessionsthread.pas | 6 +- 12 files changed, 286 insertions(+), 43 deletions(-) create mode 100644 plugins/HistoryPlusPlus/historypp.dproj (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas index 699e88df51..e6235fd9f9 100644 --- a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas +++ b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas @@ -290,12 +290,12 @@ var hDBEvent,prevhDbEvent: THandle; begin BookmarkServer.Contacts[hContact].Clear; - hDBEvent := CallService(MS_DB_EVENT_FINDLAST,hContact,0); + hDBEvent := db_event_last(hContact); SetSafetyMode(False); while hDBEvent <> 0 do begin - prevhDbEvent := CallService(MS_DB_EVENT_FINDPREV,hDBEvent,0); - if CallService(MS_DB_EVENT_DELETE,hContact,hDBEvent) = 0 then + prevhDbEvent := db_event_prev(hDBEvent); + if db_event_delete(hContact,hDBEvent) = 0 then hDBEvent := prevhDbEvent else hDBEvent := 0; diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas index da86686671..2c0c6bc7b1 100644 --- a/plugins/HistoryPlusPlus/GlobalSearch.pas +++ b/plugins/HistoryPlusPlus/GlobalSearch.pas @@ -1190,7 +1190,7 @@ var begin si := GetSearchItem(Index); if (FormState = gsDelete) and (si.hDBEvent <> 0) then - CallService(MS_DB_EVENT_DELETE, si.Contact.Handle, si.hDBEvent); + db_event_delete(si.Contact.Handle, si.hDBEvent); if FFiltered then Index := FilterHistory[Index]; DeleteEventFromLists(Index); diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index e657c09fd7..0cdca49b7a 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -471,7 +471,7 @@ implementation uses EventDetailForm, PassForm, hpp_options, hpp_services, hpp_eventfilters, - hpp_database, hpp_contacts, hpp_itemprocess, hpp_events, hpp_forms, hpp_richedit, + hpp_database, hpp_contacts, hpp_itemprocess, hpp_events, hpp_forms, hpp_richedit, hpp_messages, hpp_bookmarks, Checksum, CustomizeFiltersForm, CustomizeToolbar; {$R *.DFM} @@ -594,7 +594,7 @@ procedure THistoryFrm.LoadHistory(Sender: TObject); LineIdx: Integer; ToRead: Integer; begin - HistoryLength := CallService(MS_DB_EVENT_GETCOUNT, hContact, 0); + HistoryLength := db_event_count(hContact); if HistoryLength = -1 then begin // contact is missing @@ -604,14 +604,14 @@ procedure THistoryFrm.LoadHistory(Sender: TObject); SetLength(History, HistoryLength); if HistoryLength = 0 then Exit; - hDBEvent := CallService(MS_DB_EVENT_FINDLAST, hContact, 0); + hDBEvent := db_event_last(hContact); History[HistoryLength - 1] := NotZero(hDBEvent); { if NeedhDBEvent = 0 then toRead := Max(0,HistoryLength-hppLoadBlock-1) else toRead := 0; } ToRead := Max(0, HistoryLength - hppFirstLoadBlock - 1); LineIdx := HistoryLength - 2; repeat - hDBEvent := CallService(MS_DB_EVENT_FINDPREV, hDBEvent, 0); + hDBEvent := db_event_prev(hDBEvent); History[LineIdx] := NotZero(hDBEvent); { if NeedhDBEvent = hDbEvent then begin Result := HistoryLength-LineIdx-1; @@ -1513,7 +1513,7 @@ begin if fromRowIdx > HistoryLength - 1 then begin fromRowIdx := HistoryLength - 1; - hDBEvent := CallService(MS_DB_EVENT_FINDLAST, hContact, 0); + hDBEvent := db_event_last(hContact); History[fromRowIdx] := hDBEvent; end else @@ -1522,7 +1522,7 @@ begin begin if History[ridx] <> 0 then break; - hDBEvent := CallService(MS_DB_EVENT_FINDPREV, hDBEvent, 0); + hDBEvent := db_event_prev(hDBEvent); History[ridx] := NotZero(hDBEvent); end; end @@ -1531,7 +1531,7 @@ begin if tillRowIdx < 0 then begin tillRowIdx := 0; - hDBEvent := CallService(MS_DB_EVENT_FINDFIRST, hContact, 0); + hDBEvent := db_event_first(hContact); History[tillRowIdx] := hDBEvent; end else @@ -1540,7 +1540,7 @@ begin begin if History[ridx] <> 0 then break; - hDBEvent := CallService(MS_DB_EVENT_FINDNEXT, hDBEvent, 0); + hDBEvent := db_event_next(hDBEvent); History[ridx] := NotZero(hDBEvent); end; end; @@ -1860,15 +1860,15 @@ begin begin // routine is called from DeleteAll if FormState = gsDelete then begin // probably unnecessary considering prev check - hDBEvent := CallService(MS_DB_EVENT_FINDFIRST, hContact, 0); - CallService(MS_DB_EVENT_DELETE, hContact, hDBEvent); + hDBEvent := db_event_first(hContact); + db_event_delete(hContact, hDBEvent); end; end else begin idx := GridIndexToHistory(Index); if (FormState = gsDelete) and (History[idx] <> 0) then - CallService(MS_DB_EVENT_DELETE, hContact, History[idx]); + db_event_delete(hContact, History[idx]); DeleteEventFromSessions(idx); DeleteHistoryItem(idx); end; @@ -2085,7 +2085,7 @@ begin begin if Sessions[idx].hDBEventLast = hDBEvent then begin - hDBEvent := CallService(MS_DB_EVENT_FINDPREV, hDBEvent, 0); + hDBEvent := db_event_prev(hDBEvent); if hDBEvent <> 0 then begin Sessions[idx].hDBEventLast := hDBEvent; @@ -2144,7 +2144,7 @@ begin Sessions[idx].TimestampLast := 0; Exit; end; - hDBEvent := CallService(MS_DB_EVENT_FINDNEXT, hDBEvent, 0); + hDBEvent := db_event_next(hDBEvent); if hDBEvent <> 0 then begin Sessions[idx].hDBEventFirst := hDBEvent; diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 45573f1314..2430605be8 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -496,7 +496,7 @@ var res: Integer; begin Result := 0; - count := CallService(MS_DB_EVENT_GETCOUNT, awParam, 0); + count := db_event_count(THandle(awParam)); if (PrevShowHistoryCount xor ShowHistoryCount) or (count <> MenuCount) then begin ZeroMemory(@menuitem, SizeOf(menuItem)); diff --git a/plugins/HistoryPlusPlus/historypp.dproj b/plugins/HistoryPlusPlus/historypp.dproj new file mode 100644 index 0000000000..b11475abd0 --- /dev/null +++ b/plugins/HistoryPlusPlus/historypp.dproj @@ -0,0 +1,244 @@ + + + {96A80EED-B5F9-4F77-A788-278EBF602BE9} + historypp.dpr + True + Release + 3 + Library + VCL + 13.4 + Win64 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + 1049 + false + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace) + 00400000 + false + true + false + false + false + + + Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + true + 1033 + + + true + Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + + + false + false + 0 + RELEASE;$(DCC_Define) + + + ..\..\bin10\temp\res\ + ..\..\include\delphi;..\..\plugins\ExternalAPI\delphi;$(DCC_UnitSearchPath) + ..\..\bin10\Release64\Plugins\ + ..\..\bin10\Release64\Plugins\ + true + ..\..\bin10\Release64\Obj\hpp\ + ..\..\bin10\Release64\Obj\hpp\ + None + 1033 + + + ..\..\include\delphi;..\..\plugins\ExternalAPI\delphi;$(DCC_UnitSearchPath) + true + ..\..\bin10\Release\Plugins\ + ..\..\bin10\temp\res\ + ..\..\bin10\Release\Plugins\ + 1033 + ..\..\bin10\Release\Obj\hpp\ + None + ..\..\bin10\Release\Obj\hpp\ + + + DEBUG;$(DCC_Define) + false + true + + + true + None + 1033 + + + + MainSource + + +
hpp_resource.res
+
+ +
hpp_res_ver.res
+
+ +
hpp_opt_dialog.res
+
+ + + + + + + + + + + +
HistoryFrm
+
+ +
EventDetailsFrm
+
+ +
EmptyHistoryFrm
+
+ +
fmPass
+
+ +
fmPassNew
+
+ +
fmPassCheck
+
+ +
fmGlobalSearch
+
+ + + + + + + + + + +
fmCustomizeFilters
+
+ +
fmCustomizeToolbar
+
+ + + + + + + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + + + + + historypp.dpr + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + True + True + + + 12 + + + +
diff --git a/plugins/HistoryPlusPlus/hpp_bookmarks.pas b/plugins/HistoryPlusPlus/hpp_bookmarks.pas index 7db2328e91..5d0ec98640 100644 --- a/plugins/HistoryPlusPlus/hpp_bookmarks.pas +++ b/plugins/HistoryPlusPlus/hpp_bookmarks.pas @@ -521,7 +521,7 @@ begin ped^.hDBEvent := EventData.hDBEvent; ped^.CRC32 := EventData.CRC32; ped^.Timestamp := EventData.Timestamp; - ItemExists := (CallService(MS_DB_EVENT_GETBLOBSIZE, EventData.hDBEvent, 0) >= 0); + ItemExists := (db_event_getBlobSize(EventData.hDBEvent) >= 0); ItemCorrect := false; // added by Awkward, default value if ItemExists then begin @@ -607,11 +607,11 @@ var begin Result := false; - hDBEvent := CallService(MS_DB_EVENT_FINDFIRST, Contact.hContact, 0); + hDBEvent := db_event_first(Contact.hContact); if hDBEvent = 0 then exit; first_ts := GetEventTimestamp(hDBEvent); - hDBEvent := CallService(MS_DB_EVENT_FINDLAST, Contact.hContact, 0); + hDBEvent := db_event_last(Contact.hContact); if hDBEvent = 0 then exit; last_ts := GetEventTimestamp(hDBEvent); @@ -622,7 +622,7 @@ begin if StartFromFirst then begin - hDBEvent := CallService(MS_DB_EVENT_FINDFIRST, Contact.hContact, 0); + hDBEvent := db_event_first(Contact.hContact); while hDBEvent <> 0 do begin cur_ts := GetEventTimestamp(hDBEvent); @@ -634,12 +634,12 @@ begin Result := True; break; end; - hDBEvent := CallService(MS_DB_EVENT_FINDNEXT, hDBEvent, 0); + hDBEvent := db_event_next(hDBEvent); end; end else begin - hDBEvent := CallService(MS_DB_EVENT_FINDLAST, Contact.hContact, 0); + hDBEvent := db_event_last(Contact.hContact); while hDBEvent <> 0 do begin cur_ts := GetEventTimestamp(hDBEvent); @@ -651,7 +651,7 @@ begin Result := True; break; end; - hDBEvent := CallService(MS_DB_EVENT_FINDPREV, hDBEvent, 0); + hDBEvent := db_event_prev(hDBEvent); end; end; end; diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index 66d9e7228c..7c7ff4da53 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -255,7 +255,7 @@ begin ZeroMemory(@RecentEventInfo, SizeOf(RecentEventInfo)); RecentEventInfo.cbSize := SizeOf(RecentEventInfo); RecentEventInfo.cbBlob := 0; - CallService(MS_DB_EVENT_GET, hDBEvent, LPARAM(@RecentEventInfo)); + db_event_get(hDBEvent, @RecentEventInfo); RecentEvent := hDBEvent; end; Result := RecentEventInfo.timestamp; @@ -270,7 +270,7 @@ begin ZeroMemory(@RecentEventInfo, SizeOf(RecentEventInfo)); RecentEventInfo.cbSize := SizeOf(RecentEventInfo); RecentEventInfo.cbBlob := 0; - CallService(MS_DB_EVENT_GET, hDBEvent, LPARAM(@RecentEventInfo)); + db_event_get(hDBEvent, @RecentEventInfo); RecentEvent := hDBEvent; end; Result := GetMessageType(RecentEventInfo,EventIndex); @@ -432,7 +432,7 @@ var begin ZeroMemory(@Result, SizeOf(Result)); Result.cbSize := SizeOf(Result); - BlobSize := CallService(MS_DB_EVENT_GETBLOBSIZE, hDBEvent, 0); + BlobSize := db_event_getBlobSize(hDBEvent); if BlobSize > 0 then begin EventBuffer.Allocate(BlobSize); @@ -441,7 +441,7 @@ begin else BlobSize := 0; Result.cbBlob := BlobSize; - if CallService(MS_DB_EVENT_GET, hDBEvent, LPARAM(@Result)) = 0 then + if db_event_get(hDBEvent, @Result) = 0 then Result.cbBlob := BlobSize else Result.cbBlob := 0; diff --git a/plugins/HistoryPlusPlus/hpp_external.pas b/plugins/HistoryPlusPlus/hpp_external.pas index 97224d6355..95ea03a1bf 100644 --- a/plugins/HistoryPlusPlus/hpp_external.pas +++ b/plugins/HistoryPlusPlus/hpp_external.pas @@ -178,7 +178,7 @@ begin not boolean(event.dwFlags and IEEF_NO_SCROLLING)); if eventCount > 0 then Dec(eventCount); if eventCount <> 0 then - hDBNext := CallService(MS_DB_EVENT_FINDNEXT,hDBNext,0); + hDBNext := db_event_next(hDBNext); end; ExtGrid.EndUpdate; end; diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index 932b968219..3b499b5769 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -541,14 +541,13 @@ begin MessageTypesToDWord([mtMessage, mtUrl]) > 0) then begin if (not Item.IsRead) then - CallService(MS_DB_EVENT_MARKREAD, Items[Index].hContact, - Items[Index].hDBEvent); + db_event_markRead(Items[Index].hContact, Items[Index].hDBEvent); CallService(MS_CLIST_REMOVEEVENT, Items[Index].hContact, Items[Index].hDBEvent); end else if (not Item.IsRead) and (MessageTypesToDWord(Item.MessageType) and MessageTypesToDWord([mtStatus, mtNickChange, mtAvatarChange]) > 0) then begin - CallService(MS_DB_EVENT_MARKREAD, Items[Index].hContact, Items[Index].hDBEvent); + db_event_markRead(Items[Index].hContact, Items[Index].hDBEvent); end; end; @@ -980,7 +979,7 @@ end; procedure TExternalGrid.GridItemDelete(Sender: TObject; Index: Integer); begin if (FGridState = gsDelete) and (Items[Index].hDBEvent <> 0) and (not Items[Index].Custom) then - CallService(MS_DB_EVENT_DELETE, Items[Index].hContact, Items[Index].hDBEvent); + db_event_delete(Items[Index].hContact, Items[Index].hDBEvent); if Index <> High(Items) then begin Finalize(Items[Index]); diff --git a/plugins/HistoryPlusPlus/hpp_searchthread.pas b/plugins/HistoryPlusPlus/hpp_searchthread.pas index 7d1669a5e4..30effa8ae4 100644 --- a/plugins/HistoryPlusPlus/hpp_searchthread.pas +++ b/plugins/HistoryPlusPlus/hpp_searchthread.pas @@ -204,7 +204,7 @@ procedure TSearchThread.BuildContactsList; SetLength(Contacts, Length(Contacts) + 1); Contacts[High(Contacts)].hContact := Cont; Contacts[High(Contacts)].Timestamp := 0; - hDB := CallService(MS_DB_EVENT_FINDLAST, Cont, 0); + hDB := db_event_last(Cont); if hDB <> 0 then begin Contacts[High(Contacts)].Timestamp := GetEventTimestamp(hDB); @@ -415,7 +415,7 @@ end; function TSearchThread.GetItemsCount(hContact: THandle): Integer; begin - Result := CallService(MS_DB_EVENT_GETCOUNT, hContact, 0); + Result := db_event_count(hContact); end; procedure TSearchThread.IncProgress; @@ -432,12 +432,12 @@ begin CurContactCP := GetContactCodePage(Contact); CurContact := Contact; DoMessage(HM_STRD_NEXTCONTACT, wParam(Contact), lParam(GetContactsCount)); - hDBEvent := CallService(MS_DB_EVENT_FINDLAST, Contact, 0); + hDBEvent := db_event_last(Contact); while (hDBEvent <> 0) and (not Terminated) do begin if SearchEvent(hDBEvent) then SendItem(hDBEvent); - hDBEvent := CallService(MS_DB_EVENT_FINDPREV, hDBEvent, 0); + hDBEvent := db_event_prev(hDBEvent); end; SendBatch; end; diff --git a/plugins/HistoryPlusPlus/hpp_services.pas b/plugins/HistoryPlusPlus/hpp_services.pas index 6b2d2310d7..84944c3c40 100644 --- a/plugins/HistoryPlusPlus/hpp_services.pas +++ b/plugins/HistoryPlusPlus/hpp_services.pas @@ -197,12 +197,12 @@ begin if Assigned(POpenEventParams(wParam)) then begin oep := POpenEventParams(wParam)^; - hDbEvent := CallService(MS_DB_EVENT_FINDLAST, oep.hContact, 0); + hDbEvent := db_event_last(oep.hContact); item := 0; sel := -1; while (hDbEvent <> oep.hDbEvent) and (hDbEvent <> 0) do begin - hDbEvent := CallService(MS_DB_EVENT_FINDPREV, hDbEvent, 0); + hDbEvent := db_event_prev(hDbEvent); Inc(item); end; if hDbEvent = oep.hDbEvent then diff --git a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas index c6d55c13b8..57535d7004 100644 --- a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas +++ b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas @@ -176,13 +176,13 @@ begin FirstBatch := True; try DoMessage(HM_SESS_PREPARE, 0, 0); - hDBEvent := CallService(MS_DB_EVENT_FINDFIRST, FContact, 0); + hDBEvent := db_event_first(FContact); while (hDBEvent <> 0) and not Terminated do begin ZeroMemory(@Event, SizeOf(Event)); Event.cbSize := SizeOf(Event); Event.cbBlob := 0; - CallService(MS_DB_EVENT_GET, hDBEvent, LPARAM(@Event)); + db_event_get(hDBEvent, @Event); CurTime := Event.Timestamp; if PrevTime = 0 then begin @@ -209,7 +209,7 @@ begin Inc(Count); PrevTime := CurTime; end; - hDBEvent := CallService(MS_DB_EVENT_FINDNEXT, hDBEvent, 0); + hDBEvent := db_event_next(hDBEvent); end; SendItem(FirstEvent, LastEvent, FirstTimestamp, LastTimestamp, Count); SendBatch; -- cgit v1.2.3