From 48e0d2824f79489e28b027d3e7affcc218817bba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Sep 2019 19:39:02 +0300 Subject: m_ieview support removed from Pascal source code --- plugins/HistoryPlusPlus/historypp.dpr | 1 - plugins/HistoryPlusPlus/hpp_external.pas | 377 --------------------------- plugins/HistoryPlusPlus/hpp_externalgrid.pas | 5 - plugins/HistoryPlusPlus/hpp_forms.pas | 6 - plugins/HistoryPlusPlus/hpp_opt_dialog.pas | 30 +-- plugins/HistoryPlusPlus/hpp_opt_dialog.rc | 1 - 6 files changed, 1 insertion(+), 419 deletions(-) delete mode 100644 plugins/HistoryPlusPlus/hpp_external.pas (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index a9843a5d2a..b89c75c664 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -60,7 +60,6 @@ uses hpp_mescatcher in 'hpp_mescatcher.pas', CustomizeFiltersForm in 'CustomizeFiltersForm.pas' {fmCustomizeFilters}, CustomizeToolbar in 'CustomizeToolbar.pas' {fmCustomizeToolbar}, - hpp_external in 'hpp_external.pas', hpp_externalgrid in 'hpp_externalgrid.pas', hpp_richedit in 'hpp_richedit.pas', hpp_olesmileys in 'hpp_olesmileys.pas', diff --git a/plugins/HistoryPlusPlus/hpp_external.pas b/plugins/HistoryPlusPlus/hpp_external.pas deleted file mode 100644 index 5c61e363fb..0000000000 --- a/plugins/HistoryPlusPlus/hpp_external.pas +++ /dev/null @@ -1,377 +0,0 @@ -(* - History++ plugin for Miranda IM: the free IM client for Microsoft* Windows* - - Copyright (C) 2006-2009 theMIROn, 2003-2006 Art Fedorov. - History+ parts (C) 2001 Christian Kastner - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*) - -unit hpp_external; - -interface - -uses - Classes, Windows, - m_api, - hpp_externalgrid; - -type - TExternalGrids = class(TObject) - private - FGrids: array[TExGridMode] of TList; - procedure SetGroupLinked(Value: Boolean); - public - constructor Create; - destructor Destroy; override; - procedure Add(const ExtGrid: TExternalGrid; GridMode: TExGridMode); - function Find(Handle: HWND; GridMode: TExGridMode): TExternalGrid; - function Delete(Handle: HWND; GridMode: TExGridMode): Boolean; - function Clear(GridMode: TExGridMode): Boolean; - procedure Perform(Msg: Cardinal; wParam: WPARAM; lParam: LPARAM); - property GroupLinked: Boolean write SetGroupLinked; - end; - - -const - MS_HPP_EG_WINDOW = 'History++/ExtGrid/NewWindow'; - MS_HPP_EG_EVENT = 'History++/ExtGrid/Event'; - MS_HPP_EG_NAVIGATE = 'History++/ExtGrid/Navigate'; - ME_HPP_EG_OPTIONSCHANGED = 'History++/ExtGrid/OptionsChanged'; - -var - ImitateIEView: boolean; - ExternalGrids: TExternalGrids; - -procedure RegisterExtGridServices; -procedure UnregisterExtGridServices; - -implementation - -uses - hpp_global, hpp_database; - -{$include m_ieview.inc} - -var - hExtOptChangedIE, hExtOptChanged: THandle; - -function _ExtWindow(wParam:WPARAM; lParam: LPARAM; GridMode: TExGridMode): uint_ptr; -var - par: PIEVIEWWINDOW; - ExtGrid: TExternalGrid; - ControlID: Cardinal; -begin - Result := 0; - //try - par := PIEVIEWWINDOW(lParam); - Assert(par <> nil, 'Empty IEVIEWWINDOW structure'); - case par.iType of - IEW_CREATE: begin - {$IFDEF DEBUG} - OutputDebugString('IEW_CREATE'); - {$ENDIF} - case par.dwMode of - IEWM_TABSRMM: ControlID := 1006; // IDC_LOG from tabSRMM - IEWM_SCRIVER: ControlID := 1001; // IDC_LOG from Scriver - IEWM_MUCC: ControlID := 0; - IEWM_CHAT: ControlID := 0; - IEWM_HISTORY: ControlID := 0; - else ControlID := 0; - end; - ExtGrid := TExternalGrid.Create(par.Parent,ControlID); - case par.dwMode of - IEWM_MUCC,IEWM_CHAT: begin - ExtGrid.ShowHeaders := False; - ExtGrid.GroupLinked := False; - ExtGrid.ShowBookmarks := False; - end; - IEWM_HISTORY: - ExtGrid.GroupLinked := False; - end; - ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy); - ExternalGrids.Add(ExtGrid,GridMode); - par.Hwnd := ExtGrid.GridHandle; - end; - IEW_DESTROY: begin - {$IFDEF DEBUG} - OutputDebugString('IEW_DESTROY'); - {$ENDIF} - ExternalGrids.Delete(par.Hwnd,GridMode); - end; - IEW_SETPOS: begin - {$IFDEF DEBUG} - OutputDebugString('IEW_SETPOS'); - {$ENDIF} - ExtGrid := ExternalGrids.Find(par.Hwnd,GridMode); - if ExtGrid <> nil then - ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy); - end; - IEW_SCROLLBOTTOM: begin - {$IFDEF DEBUG} - OutputDebugString('IEW_SCROLLBOTTOM'); - {$ENDIF} - ExtGrid := ExternalGrids.Find(par.Hwnd,GridMode); - if ExtGrid <> nil then - ExtGrid.ScrollToBottom; - end; - end; - //except - //end; -end; - -function ExtWindowNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl; -begin - Result := _ExtWindow(wParam,lParam,gmNative); -end; - -function ExtWindowIEView(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl; -begin - Result := _ExtWindow(wParam,lParam,gmIEView); -end; - -function _ExtEvent(wParam:WPARAM; lParam: LPARAM; GridMode: TExGridMode): uint_ptr; cdecl; -var - event: PIEVIEWEVENT; - customEvent: PIEVIEWEVENTDATA; - UsedCodepage: Cardinal; - hDBNext: THandle; - eventCount: Integer; - ExtGrid: TExternalGrid; - CustomItem: TExtCustomItem; -begin - Result := 0; - //try - {$IFDEF DEBUG} - OutputDebugString('MS_IEVIEW_EVENT'); - {$ENDIF} - event := PIEVIEWEVENT(lParam); - Assert(event <> nil, 'Empty IEVIEWEVENT structure'); - ExtGrid := ExternalGrids.Find(event.Hwnd,GridMode); - if ExtGrid = nil then exit; - case event.iType of - IEE_LOG_DB_EVENTS: begin - if event.cbSize >= IEVIEWEVENT_SIZE_V2 then - UsedCodepage := event.Codepage - else - UsedCodepage := CP_ACP; - eventCount := event.Count; - hDBNext := event.Event.hDBEventFirst; - ExtGrid.BeginUpdate; - while (eventCount <> 0) and (hDBNext <> 0) do - begin - ExtGrid.AddEvent(event.hContact, hDBNext, UsedCodepage, - boolean(event.dwFlags and IEEF_RTL), - not boolean(event.dwFlags and IEEF_NO_SCROLLING)); - if eventCount > 0 then Dec(eventCount); - if eventCount <> 0 then - hDBNext := db_event_next(event.hContact,hDBNext); - end; - ExtGrid.EndUpdate; - end; - IEE_LOG_MEM_EVENTS: begin - if event.cbSize >= IEVIEWEVENT_SIZE_V2 then - UsedCodepage := event.Codepage - else - UsedCodepage := CP_ACP; - eventCount := event.Count; - customEvent := event.Event.eventData; - ExtGrid.BeginUpdate; - while (eventCount <> 0) and (customEvent <> nil) do - begin - if boolean(customEvent.dwFlags and IEEDF_UNICODE_TEXT) then - SetString(CustomItem.Text,customEvent.Text.w,lstrlenW(customEvent.Text.w)) - else - CustomItem.Text := AnsiToWideString(AnsiString(customEvent.Text.a),UsedCodepage); - if boolean(customEvent.dwFlags and IEEDF_UNICODE_NICK) then - SetString(CustomItem.Nick,customEvent.Nick.w,lstrlenW(customEvent.Nick.w)) - else - CustomItem.Nick := AnsiToWideString(AnsiString(customEvent.Nick.a),UsedCodepage); - CustomItem.Sent := boolean(customEvent.bIsMe); - CustomItem.Time := customEvent.time; - ExtGrid.AddCustomEvent(event.hContact, CustomItem, UsedCodepage, - boolean(event.dwFlags and IEEF_RTL), - not boolean(event.dwFlags and IEEF_NO_SCROLLING)); - if eventCount > 0 then Dec(eventCount); - customEvent := customEvent.next; - end; - ExtGrid.EndUpdate; - end; - IEE_CLEAR_LOG: begin - ExtGrid.BeginUpdate; - ExtGrid.Clear; - ExtGrid.EndUpdate; - end; - IEE_GET_SELECTION: begin - Result := uint_ptr(ExtGrid.GetSelection(boolean(event.dwFlags and IEEF_NO_UNICODE))); - end; - IEE_SAVE_DOCUMENT: begin - ExtGrid.SaveSelected; - end; - end; - //except - //end; -end; - -function ExtEventNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl; -begin - Result := _ExtEvent(wParam,lParam,gmNative); -end; - -function ExtEventIEView(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl; -begin - Result := _ExtEvent(wParam,lParam,gmIEView); -end; - -function ExtNavigate(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl; -begin - Result := 0; - //try - {$IFDEF DEBUG} - OutputDebugString('MS_IEVIEW_NAVIGATE'); - {$ENDIF} - //except - //end; -end; - -procedure RegisterExtGridServices; -begin - ExternalGrids := TExternalGrids.Create; - ImitateIEView := GetDBBool(hppDBName,'IEViewAPI',false); - if ImitateIEView then - begin - CreateServiceFunction(MS_IEVIEW_WINDOW,@ExtWindowIEView); - CreateServiceFunction(MS_IEVIEW_EVENT,@ExtEventIEView); - CreateServiceFunction(MS_IEVIEW_NAVIGATE,@ExtNavigate); - hExtOptChangedIE := CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED); - end; - CreateServiceFunction(MS_HPP_EG_WINDOW,@ExtWindowNative); - CreateServiceFunction(MS_HPP_EG_EVENT,@ExtEventNative); - CreateServiceFunction(MS_HPP_EG_NAVIGATE,@ExtNavigate); - hExtOptChanged := CreateHookableEvent(ME_HPP_EG_OPTIONSCHANGED); -end; - -procedure UnregisterExtGridServices; -begin - if ImitateIEView then - begin - DestroyHookableEvent(hExtOptChangedIE); - end; - DestroyHookableEvent(hExtOptChanged); - ExternalGrids.Destroy; -end; - -constructor TExternalGrids.Create; -var - GridMode: TExGridMode; -begin - for GridMode := Low(TExGridMode) to High(TExGridMode) do - FGrids[GridMode] := TList.Create; -end; - -destructor TExternalGrids.Destroy; -var - GridMode: TExGridMode; -begin - for GridMode := Low(TExGridMode) to High(TExGridMode) do begin - Clear(GridMode); - FGrids[GridMode].Free; - end; - inherited; -end; - -procedure TExternalGrids.Add(const ExtGrid: TExternalGrid; GridMode: TExGridMode); -begin - FGrids[GridMode].Add(ExtGrid); -end; - -function TExternalGrids.Find(Handle: HWND; GridMode: TExGridMode): TExternalGrid; -var - i: Integer; - ExtGrid: TExternalGrid; -begin - Result := nil; - for i := 0 to FGrids[GridMode].Count-1 do - begin - ExtGrid := TExternalGrid(FGrids[GridMode].Items[i]); - if ExtGrid.GridHandle = Handle then - begin - Result := ExtGrid; - break; - end; - end; -end; - -function TExternalGrids.Delete(Handle: HWND; GridMode: TExGridMode): Boolean; -var - i: Integer; - ExtGrid: TExternalGrid; -begin - Result := True; - for i := 0 to FGrids[GridMode].Count-1 do - begin - ExtGrid := TExternalGrid(FGrids[GridMode].Items[i]); - if ExtGrid.GridHandle = Handle then - begin - try - ExtGrid.Free; - except - Result := False; - end; - FGrids[GridMode].Delete(i); - break; - end; - end; -end; - -function TExternalGrids.Clear(GridMode: TExGridMode): Boolean; -var - i: Integer; - ExtGrid: TExternalGrid; -begin - Result := True; - for i := 0 to FGrids[GridMode].Count-1 do - begin - ExtGrid := TExternalGrid(FGrids[GridMode].Items[i]); - try - ExtGrid.Free; - except - Result := False; - end; - end; - FGrids[GridMode].Clear; -end; - -procedure TExternalGrids.Perform(Msg: Cardinal; wParam: WPARAM; lParam: LPARAM); -var - i: Integer; - GridMode: TExGridMode; -begin - for GridMode := Low(TExGridMode) to High(TExGridMode) do - for i := FGrids[GridMode].Count-1 downto 0 do - TExternalGrid(FGrids[GridMode].Items[i]).Perform(Msg,wParam,lParam); -end; - -procedure TExternalGrids.SetGroupLinked(Value: Boolean); -var - i: Integer; - GridMode: TExGridMode; -begin - for GridMode := Low(TExGridMode) to High(TExGridMode) do - for i := FGrids[GridMode].Count-1 downto 0 do - TExternalGrid(FGrids[GridMode].Items[i]).GroupLinked := Value; -end; - -end. diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index 0c9365961c..2a2e78a474 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -29,8 +29,6 @@ uses hpp_global, HistoryGrid, RichEdit, Menus, ShellAPI; type - TExGridMode = (gmNative, gmIEView); - PExtCustomItem = ^TExtCustomItem; TExtCustomItem = record @@ -85,7 +83,6 @@ type pmLink: TPopupMenu; miEventsFilter: TMenuItem; WasKeyPressed: Boolean; - FGridMode: TExGridMode; FUseHistoryRTLMode: Boolean; FExternalRTLMode: TRTLMode; FUseHistoryCodepage: Boolean; @@ -153,7 +150,6 @@ type procedure Clear; property ParentWindow: HWND read FParentWindow; property GridHandle: HWND read GetGridHandle; - property GridMode: TExGridMode read FGridMode write FGridMode; property UseHistoryRTLMode: Boolean read FUseHistoryRTLMode write SetUseHistoryRTLMode; property UseHistoryCodepage: Boolean read FUseHistoryCodepage write SetUseHistoryCodepage; function Perform(Msg: Cardinal; WParam:WPARAM; LParam: LPARAM): LRESULT; @@ -350,7 +346,6 @@ constructor TExternalGrid.Create(AParentWindow: HWND; ControlID: Cardinal = 0); begin FParentWindow := AParentWindow; WasKeyPressed := False; - FGridMode := gmNative; FUseHistoryRTLMode := False; FExternalRTLMode := hppRTLDefault; FUseHistoryCodepage := False; diff --git a/plugins/HistoryPlusPlus/hpp_forms.pas b/plugins/HistoryPlusPlus/hpp_forms.pas index 8d4803c984..0b0ff75b43 100644 --- a/plugins/HistoryPlusPlus/hpp_forms.pas +++ b/plugins/HistoryPlusPlus/hpp_forms.pas @@ -59,7 +59,6 @@ implementation uses hpp_services, hpp_opt_dialog, hpp_database, hpp_mescatcher, HistoryForm, GlobalSearch, m_api, - {$IFNDEF NO_EXTERNALGRID}hpp_external,{$ENDIF} CustomizeFiltersForm, CustomizeToolbar; {procedure AddMenu(M: TMenuItem; FromM,ToM: TPopupMenu; Index: integer); @@ -215,11 +214,6 @@ begin // we are going backwards here because history forms way want to // close themselves on the message, so we would have AVs if go from 0 to Count - - {$IFNDEF NO_EXTERNALGRID} - ExternalGrids.Perform(Msg,wParam,lParam); - {$ENDIF} - for i := HstWindowList.Count - 1 downto 0 do begin if Assigned(THistoryFrm(HstWindowList[i]).EventDetailForm) then diff --git a/plugins/HistoryPlusPlus/hpp_opt_dialog.pas b/plugins/HistoryPlusPlus/hpp_opt_dialog.pas index ce3bc0e47a..9a0d2ba09b 100644 --- a/plugins/HistoryPlusPlus/hpp_opt_dialog.pas +++ b/plugins/HistoryPlusPlus/hpp_opt_dialog.pas @@ -39,8 +39,7 @@ implementation uses Messages, CommCtrl, m_api, - hpp_global, hpp_options, hpp_services, hpp_database - {$IFNDEF NO_EXTERNALGRID}, hpp_external{$ENDIF}, + hpp_global, hpp_options, hpp_services, hpp_database, HistoryForm, GlobalSearch; const @@ -58,7 +57,6 @@ const IDC_AVATARSHISTORY = 205; // "Display chanage avatars" checkbox ID_MESSAGELOG_GROUP = 300; // "Message log options" group - IDC_IEVIEWAPI = 301; // "Imitate IEView API" checkbox IDC_GROUPLOGITEMS = 302; // "Group messages" checkbox IDC_DISABLEBORDER = 303; // "Disable border" checkbox IDC_DISABLESCROLL = 304; // "Disable scrollbar" checkbox @@ -122,7 +120,6 @@ begin if GetChecked(IDC_GROUPHISTITEMS) <> GetDBBool(hppDBName,'GroupHistoryItems',false) then exit; {$IFNDEF NO_EXTERNALGRID} - if GetChecked(IDC_IEVIEWAPI) <> GetDBBool(hppDBName,'IEViewAPI',false) then exit; if GetChecked(IDC_GROUPLOGITEMS) <> GetDBBool(hppDBName,'GroupLogItems',false) then exit; if GetChecked(IDC_DISABLEBORDER) <> GetDBBool(hppDBName,'NoLogBorder',false) then exit; if GetChecked(IDC_DISABLESCROLL) <> GetDBBool(hppDBName,'NoLogScrollBar',false) then exit; @@ -181,30 +178,6 @@ begin THistoryFrm(HstWindowList[i]).hg.GroupLinked := Checked; end; - {$IFNDEF NO_EXTERNALGRID} - Checked := GetChecked(IDC_IEVIEWAPI); - if Checked <> GetDBBool(hppDBName,'IEViewAPI',false) then - WriteDBBool(hppDBName,'IEViewAPI',Checked); - ShowRestart := ShowRestart or (Checked <> ImitateIEView); - - Checked := GetChecked(IDC_GROUPLOGITEMS); - if Checked <> GetDBBool(hppDBName,'GroupLogItems',false) then - begin - WriteDBBool(hppDBName,'GroupLogItems',Checked); - ExternalGrids.GroupLinked := Checked; - end; - - Checked := GetChecked(IDC_DISABLEBORDER); - if Checked <> GetDBBool(hppDBName,'NoLogBorder',false) then - WriteDBBool(hppDBName,'NoLogBorder',Checked); - //ShowRestart := ShowRestart or (Checked <> DisableLogBorder); - - Checked := GetChecked(IDC_DISABLESCROLL); - if Checked <> GetDBBool(hppDBName,'NoLogScrollBar',false) then - WriteDBBool(hppDBName,'NoLogScrollBar',Checked); - //ShowRestart := ShowRestart or (Checked <> DisableLogScrollbar); - {$ENDIF} - if ShowRestart then ShowWindow(GetDlgItem(hDlg,ID_NEED_RESTART),SW_SHOW) else @@ -235,7 +208,6 @@ begin SetChecked(IDC_RECENTONTOP,GetDBBool(hppDBName,'SortOrder',false)); SetChecked(IDC_GROUPHISTITEMS,GetDBBool(hppDBName,'GroupHistoryItems',false)); - SetChecked(IDC_IEVIEWAPI ,GetDBBool(hppDBName,'IEViewAPI',false)); SetChecked(IDC_GROUPLOGITEMS,GetDBBool(hppDBName,'GroupLogItems',false)); SetChecked(IDC_DISABLEBORDER,GetDBBool(hppDBName,'NoLogBorder',false)); SetChecked(IDC_DISABLESCROLL,GetDBBool(hppDBName,'NoLogScrollBar',false)); diff --git a/plugins/HistoryPlusPlus/hpp_opt_dialog.rc b/plugins/HistoryPlusPlus/hpp_opt_dialog.rc index 68321f40e2..d1e946a00a 100644 --- a/plugins/HistoryPlusPlus/hpp_opt_dialog.rc +++ b/plugins/HistoryPlusPlus/hpp_opt_dialog.rc @@ -21,7 +21,6 @@ FONT 8, "MS SHELL DLG" CONTROL "Display changed avatars", 205, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 64, 140, 11 CONTROL "Message log options", 300, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 160, 82, 148, 55 - CONTROL "Imitate IEView API", 301, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 92, 140, 11 CONTROL "Group messages", 302, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 102, 140, 11 CONTROL "Disable border", 303, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 112, 140, 11 CONTROL "Disable scroll bar", 304, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 122, 140, 11 -- cgit v1.2.3