diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ExternalAPI/delphi/m_ieview.inc | 207 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_ieview.h | 2 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/historypp.dpr | 7 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_external.pas | 371 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_externalgrid.pas | 5 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_forms.pas | 6 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_opt_dialog.pas | 24 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_opt_dialog.rc | 6 | ||||
-rw-r--r-- | plugins/IEHistory/src/dlgHandlers.cpp | 9 | ||||
-rw-r--r-- | plugins/Popup/src/history.cpp | 14 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 4 | ||||
-rw-r--r-- | plugins/Scriver/src/msgutils.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 2 |
14 files changed, 632 insertions, 34 deletions
diff --git a/plugins/ExternalAPI/delphi/m_ieview.inc b/plugins/ExternalAPI/delphi/m_ieview.inc new file mode 100644 index 0000000000..c0e203241c --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_ieview.inc @@ -0,0 +1,207 @@ +{
+ IEView Plugin for Miranda IM
+ Copyright (C) 2005 Piotr Piastucki
+
+ 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.
+}
+
+{$IFNDEF M_IEVIEW}
+{$DEFINE M_IEVIEW}
+
+const
+ MS_IEVIEW_WINDOW = 'IEVIEW/NewWindow';
+ MS_IEVIEW_EVENT = 'IEVIEW/Event';
+ MS_IEVIEW_NAVIGATE = 'IEVIEW/Navigate';
+
+ ME_IEVIEW_OPTIONSCHANGED = 'IEVIEW/OptionsChanged';
+(*
+ MS_IEVIEW_UTILS = 'IEVIEW/Utils';
+ MS_IEVIEW_SHOWSMILEYSELECTION = 'IEVIEW/ShowSmileySelection';
+ ME_IEVIEW_NOTIFICATION = 'IEVIEW/Notification';
+*)
+ IEW_CREATE = 1; // create new window (control)
+ IEW_DESTROY = 2; // destroy control
+ IEW_SETPOS = 3; // set window position and size
+ IEW_SCROLLBOTTOM = 4; // scroll text to bottom
+
+ IEWM_SRMM = 0; // regular SRMM
+ IEWM_TABSRMM = 1; // TabSRMM-compatible HTML builder
+ IEWM_HTML = 2; // HTML
+ IEWM_SCRIVER = 3; // HTML
+ IEWM_MUCC = 4; // MUCC group chats GUI
+ IEWM_CHAT = 5; // chat.dll group chats GUI
+ IEWM_HISTORY = 6; // history viewer
+ IEWM_BROWSER = 256; // empty browser window
+
+type
+ PIEVIEWWINDOW = ^TIEVIEWWINDOW;
+ TIEVIEWWINDOW = record
+ iType : int; // one of IEW_* values
+ dwMode : dword; // compatibility mode - one of IEWM_* values
+ dwFlags: dword; // flags, one of IEWF_* values
+ parent : HWND; // parent window HWND
+ hwnd : HWND; // IEW_CREATE returns WebBrowser control's HWND here
+ x : int; // IE control horizontal position
+ y : int; // IE control vertical position
+ cx : int; // IE control horizontal size
+ cy : int; // IE control vertical size
+ end;
+
+const
+ IEEDF_UNICODE = 1; // if set pszText is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_TEXT = 1; // if set pszText is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_NICK = 2; // if set pszNick is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_TEXT2 = 4; // if set pszText2 is a pointer to wchar_t string instead of AnsiChar string
+// The following flags are valid only for message events (IEED_EVENT_MESSAGE)
+ IEEDF_FORMAT_FONT = $00000100; // if set pszFont (font name) is valid and should be used
+ IEEDF_FORMAT_SIZE = $00000200; // if set fontSize is valid and should be used
+ IEEDF_FORMAT_COLOR = $00000400; // if set color is valid and should be used
+ IEEDF_FORMAT_STYLE = $00000800; // if set fontSize is valid and should be used
+
+ IEEDF_READ = $00001000; // if set
+ IEEDF_SENT = $00002000; // if set
+ IEEDF_RTL = $00004000; // if set
+
+ IEED_EVENT_MESSAGE = $0001; // message
+ IEED_EVENT_STATUSCHANGE = $0002; // status change
+ IEED_EVENT_FILE = $0003; // file
+ IEED_EVENT_ERRMSG = $0005; // error message
+ IEED_EVENT_SYSTEM = $0006; // system event
+
+ IEED_MUCC_EVENT_MESSAGE = $0001; // message
+ IEED_MUCC_EVENT_TOPIC = $0002; // topic change
+ IEED_MUCC_EVENT_JOINED = $0003; // user joined
+ IEED_MUCC_EVENT_LEFT = $0004; // user left
+ IEED_MUCC_EVENT_ERROR = $0005; // error
+
+// MUCC-related dwData bit flags
+ IEEDD_MUCC_SHOW_NICK = $00000001;
+ IEEDD_MUCC_MSG_ON_NEW_LINE = $00000002;
+ IEEDD_MUCC_SHOW_DATE = $00000010;
+ IEEDD_MUCC_SHOW_TIME = $00000020;
+ IEEDD_MUCC_SECONDS = $00000040;
+ IEEDD_MUCC_LONG_DATE = $00000080;
+
+ IEED_GC_EVENT_HIGHLIGHT = $8000;
+ IEED_GC_EVENT_MESSAGE = $0001;
+ IEED_GC_EVENT_TOPIC = $0002;
+ IEED_GC_EVENT_JOIN = $0003;
+ IEED_GC_EVENT_PART = $0004;
+ IEED_GC_EVENT_QUIT = $0006;
+ IEED_GC_EVENT_NICK = $0007;
+ IEED_GC_EVENT_ACTION = $0008;
+ IEED_GC_EVENT_KICK = $0009;
+ IEED_GC_EVENT_NOTICE = $000A;
+ IEED_GC_EVENT_INFORMATION = $000B;
+ IEED_GC_EVENT_ADDSTATUS = $000C;
+ IEED_GC_EVENT_REMOVESTATUS = $000D;
+
+// GC-related dwData bit flags
+ IEEDD_GC_SHOW_NICK = $00000001;
+ IEEDD_GC_SHOW_TIME = $00000002;
+ IEEDD_GC_SHOW_ICON = $00000004;
+ IEEDD_GC_MSG_ON_NEW_LINE = $00001000;
+
+ IE_FONT_BOLD = $000100; // Bold font flag
+ IE_FONT_ITALIC = $000200; // Italic font flag
+ IE_FONT_UNDERLINE = $000400; // Underlined font flags
+
+type
+ PtagIEVIEWEVENTDATA = ^TtagIEVIEWEVENTDATA;
+ TtagIEVIEWEVENTDATA = record
+ iType :int; // Event type, one of MUCC_EVENT_* values
+ dwFlags :dword; // Event flags - IEEF_*
+ fontName :PAnsiChar; // Text font name
+ fontSize :int; // Text font size (in pixels)
+ fontStyle:int; // Text font style (combination of IE_FONT_* flags)
+ color :TCOLORREF; // Text color
+ Nick :TChar; // Nick, usage depends on type of event
+ Text :TChar; // Text, usage depends on type of event
+ dwData :dword; // dword data e.g. status
+ bIsMe :bool; // TRUE if the event is related to the user
+ time :dword; // Time of the event
+ next :PtagIEVIEWEVENTDATA;
+ Text2 :TChar; // Text, usage depends on type of event
+ end;
+ PIEVIEWEVENTDATA = PtagIEVIEWEVENTDATA;
+ TIEVIEWEVENTDATA = TtagIEVIEWEVENTDATA;
+
+const
+ IEE_LOG_DB_EVENTS = 1; // log specified number of DB events
+ IEE_CLEAR_LOG = 2; // clear log
+ IEE_GET_SELECTION = 3; // get selected text
+ IEE_SAVE_DOCUMENT = 4; // save current document
+ IEE_LOG_MEM_EVENTS = 5; // log specified number of IEView events
+
+ IEEF_RTL = 1; // turn on RTL support
+ IEEF_NO_UNICODE = 2; // disable Unicode support
+ IEEF_NO_SCROLLING = 4; // do not scroll logs to bottom
+
+type
+ tagIEVIEWEVENT = record
+ case byte of
+ 0: (hDbEventFirst:TMEVENT);
+ 1: (eventData :PIEVIEWEVENTDATA);
+ end;
+
+ PIEVIEWEVENT = ^TIEVIEWEVENT;
+ TIEVIEWEVENT = record
+ iType :int; // one of IEE_* values
+ dwFlags :dword; // one of IEEF_* values
+ hwnd :HWND; // HWND returned by IEW_CREATE
+ hContact :TMCONTACT; // contact
+ Event :tagIEVIEWEVENT; // first event to log, when IEE_LOG_EVENTS
+ // returns it will contain the last event
+ // actually logged or NULL if no event was logged
+ count :int; // number of events to log
+ codepage :int; // ANSI codepage
+ pszProto :PAnsiChar;
+ end;
+(*
+type
+ PIEVIEWSHOWSMILEYSEL = ^TIEVIEWSHOWSMILEYSEL;
+ TIEVIEWSHOWSMILEYSEL = record
+ cbSize : int; // size of the structure
+ Protocolname : PAnsiChar; // protocol to use... if you have defined a protocol,
+ // u can use your own protocol name. Smiley add will
+ // automatically select the smileypack that is
+ // defined for your protocol. Or, use "Standard" for
+ // standard smiley set. Or "ICQ", "MSN" if you
+ // prefer those icons. If not found or NULL:
+ // "Standard" will be used
+ xPosition : int; // Postition to place the selectwindow
+ yPosition : int;
+ Direction : int; // Direction (i.e. size upwards/downwards/etc) of
+ // the window 0, 1, 2, 3
+ hwndTarget : HWND; // Window, where to send the message when smiley is
+ // selected.
+ targetMessage: dword; // Target message, to be sent.
+ targetWParam : LPARAM; // Target WParam to be sent (LParam will be AnsiChar*
+ // to select smiley) see the example file.
+ end;
+*)
+const
+ IEN_NAVIGATE = 1; // navigate to the given destination
+ IENF_UNICODE = 1; // if set urlW is used instead of urlW
+
+type
+ IEVIEWNAVIGATE = record
+ iType :int; // one of IEN_* values
+ dwFlags:dword; // one of IEEF_* values
+ hwnd :HWND; // HWND returned by IEW_CREATE
+ url :TChar; // Text, usage depends on type of event
+end;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h index 107ff4edac..4b197aca34 100644 --- a/plugins/ExternalAPI/m_ieview.h +++ b/plugins/ExternalAPI/m_ieview.h @@ -44,7 +44,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct IEVIEWWINDOW
{
- int cbSize; // size of the strusture
int iType; // one of IEW_* values
DWORD dwMode; // compatibility mode - one of IEWM_* values
DWORD dwFlags; // flags, one of IEWF_* values
@@ -165,7 +164,6 @@ struct IEVIEWEVENT struct IEVIEWNAVIGATE
{
- int cbSize; // size of the strusture
int iType; // one of IEN_* values
DWORD dwFlags; // one of IEEF_* values
HWND hwnd; // HWND returned by IEW_CREATE
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 76ffa71c01..a9843a5d2a 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -60,6 +60,7 @@ 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',
@@ -153,6 +154,9 @@ begin HookModulesLoad := HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoad);
HookOptInit := HookEvent(ME_OPT_INITIALISE, OnOptInit);
hppRegisterServices;
+{$IFNDEF NO_EXTERNALGRID}
+ RegisterExtGridServices;
+{$ENDIF}
hppRegisterMainWindow;
Result := 0;
end;
@@ -183,6 +187,9 @@ begin try
// destroy hidden main window
hppUnregisterMainWindow;
+ {$IFNDEF NO_EXTERNALGRID}
+ UnregisterExtGridServices;
+ {$ENDIF}
// unregistering events
hppUnregisterServices;
// unregister bookmarks
diff --git a/plugins/HistoryPlusPlus/hpp_external.pas b/plugins/HistoryPlusPlus/hpp_external.pas new file mode 100644 index 0000000000..cac074543f --- /dev/null +++ b/plugins/HistoryPlusPlus/hpp_external.pas @@ -0,0 +1,371 @@ +(*
+ 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
+ UsedCodepage := event.Codepage;
+ 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
+ UsedCodepage := event.Codepage;
+ 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 2a2e78a474..0c9365961c 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -29,6 +29,8 @@ uses hpp_global, HistoryGrid, RichEdit, Menus, ShellAPI;
type
+ TExGridMode = (gmNative, gmIEView);
+
PExtCustomItem = ^TExtCustomItem;
TExtCustomItem = record
@@ -83,6 +85,7 @@ type pmLink: TPopupMenu;
miEventsFilter: TMenuItem;
WasKeyPressed: Boolean;
+ FGridMode: TExGridMode;
FUseHistoryRTLMode: Boolean;
FExternalRTLMode: TRTLMode;
FUseHistoryCodepage: Boolean;
@@ -150,6 +153,7 @@ 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;
@@ -346,6 +350,7 @@ 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 0b0ff75b43..8d4803c984 100644 --- a/plugins/HistoryPlusPlus/hpp_forms.pas +++ b/plugins/HistoryPlusPlus/hpp_forms.pas @@ -59,6 +59,7 @@ 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);
@@ -214,6 +215,11 @@ 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 8f11f03fc7..25281bed1f 100644 --- a/plugins/HistoryPlusPlus/hpp_opt_dialog.pas +++ b/plugins/HistoryPlusPlus/hpp_opt_dialog.pas @@ -39,7 +39,8 @@ implementation uses
Messages, CommCtrl,
m_api,
- hpp_global, hpp_options, hpp_services, hpp_database,
+ hpp_global, hpp_options, hpp_services, hpp_database
+ {$IFNDEF NO_EXTERNALGRID}, hpp_external{$ENDIF},
HistoryForm, GlobalSearch;
const
@@ -119,9 +120,11 @@ begin if GetChecked(IDC_RECENTONTOP) <> GetDBBool(hppDBName,'SortOrder',false) then exit;
if GetChecked(IDC_GROUPHISTITEMS) <> GetDBBool(hppDBName,'GroupHistoryItems',false) then exit;
+ {$IFNDEF NO_EXTERNALGRID}
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;
+ {$ENDIF}
Result := False;
end;
@@ -176,6 +179,25 @@ begin THistoryFrm(HstWindowList[i]).hg.GroupLinked := Checked;
end;
+ {$IFNDEF NO_EXTERNALGRID}
+ 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
diff --git a/plugins/HistoryPlusPlus/hpp_opt_dialog.rc b/plugins/HistoryPlusPlus/hpp_opt_dialog.rc index d1e946a00a..02bd0dfe50 100644 --- a/plugins/HistoryPlusPlus/hpp_opt_dialog.rc +++ b/plugins/HistoryPlusPlus/hpp_opt_dialog.rc @@ -21,9 +21,9 @@ 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 "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
+ CONTROL "Group messages", 302, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 92, 140, 11
+ CONTROL "Disable border", 303, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 102, 140, 11
+ CONTROL "Disable scroll bar", 304, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 112, 140, 11
CONTROL "History view options", 500, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 6, 82, 148, 55
CONTROL "Recent events on top", 501, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 12, 92, 140, 11
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 3feef25f7b..281232363c 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -94,8 +94,7 @@ int MoveIeView(HWND hWnd) {
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
if (data) {
- IEVIEWWINDOW ieWnd = { 0 };
- ieWnd.cbSize = sizeof(ieWnd);
+ IEVIEWWINDOW ieWnd = {};
ieWnd.parent = hWnd;
ieWnd.hwnd = data->hIEView;
ieWnd.iType = IEW_SETPOS;
@@ -108,8 +107,7 @@ int MoveIeView(HWND hWnd) int DestroyIEView(HWND hWnd)
{
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
- IEVIEWWINDOW ieWnd = { 0 };
- ieWnd.cbSize = sizeof(ieWnd);
+ IEVIEWWINDOW ieWnd = {};
ieWnd.parent = hWnd;
ieWnd.hwnd = data->hIEView;
ieWnd.iType = IEW_DESTROY;
@@ -319,8 +317,7 @@ int LoadNext(HWND hWnd) int ScrollToBottom(HWND hWnd)
{
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
- IEVIEWWINDOW ieWnd = { 0 };
- ieWnd.cbSize = sizeof(ieWnd);
+ IEVIEWWINDOW ieWnd = {};
ieWnd.iType = IEW_SCROLLBOTTOM;
ieWnd.hwnd = data->hIEView;
ieWnd.parent = hWnd;
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index 92afe9a947..e0460aafab 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -138,14 +138,10 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara logType = LOG_HPP;
ShowWindow(GetDlgItem(hwnd, IDC_POPUP_LIST), SW_HIDE);
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_CREATE;
- ieWindow.dwFlags = 0;
ieWindow.dwMode = IEWM_MUCC;
ieWindow.parent = hwnd;
- ieWindow.x = 0;
- ieWindow.y = 0;
ieWindow.cx = 100;
ieWindow.cy = 100;
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
@@ -158,7 +154,6 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara pt.y = rcLst.top;
ScreenToClient(hwnd, &pt);
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
ieWindow.iType = IEW_SETPOS;
ieWindow.parent = hwnd;
ieWindow.hwnd = hwndLog;
@@ -295,8 +290,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara rcLst.left, rcLst.top, rcLst.right - rcLst.left, rcLst.bottom - rcLst.top,
SWP_NOZORDER | SWP_DEFERERASE | SWP_SHOWWINDOW);
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_SETPOS;
ieWindow.parent = hwnd;
ieWindow.hwnd = hwndLog;
@@ -382,10 +376,8 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara case WM_DESTROY:
if (logType == LOG_HPP) {
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_DESTROY;
- ieWindow.dwFlags = 0;
ieWindow.dwMode = IEWM_TABSRMM;
ieWindow.parent = hwnd;
ieWindow.hwnd = hwndLog;
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 02224330c0..087a78859a 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -631,7 +631,6 @@ void CMsgDialog::StreamInEvents(MEVENT hDbEventFirst, int count, int bAppend) // IEVIew MOD Begin
if (m_hwndIeview != nullptr) {
IEVIEWEVENT evt;
- IEVIEWWINDOW ieWindow = {};
evt.dwFlags = (m_bUseRtl) ? IEEF_RTL : 0;
evt.hwnd = m_hwndIeview;
evt.hContact = m_hContact;
@@ -646,8 +645,7 @@ void CMsgDialog::StreamInEvents(MEVENT hDbEventFirst, int count, int bAppend) CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt);
m_hDbEventLast = evt.hDbEventFirst != 0 ? evt.hDbEventFirst : m_hDbEventLast;
- memset(&ieWindow, 0, sizeof(ieWindow));
- ieWindow.cbSize = sizeof(ieWindow);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_SCROLLBOTTOM;
ieWindow.hwnd = m_hwndIeview;
CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow);
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index d69eb28703..34bde9dbdc 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -221,8 +221,7 @@ void CMsgDialog::Reattach(HWND hwndContainer) void CMsgDialog::ScrollToBottom() { if (m_hwndIeview != nullptr) { - IEVIEWWINDOW ieWindow; - ieWindow.cbSize = sizeof(IEVIEWWINDOW); + IEVIEWWINDOW ieWindow = {}; ieWindow.iType = IEW_SCROLLBOTTOM; ieWindow.hwnd = m_hwndIeview; CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index bde2b28a3f..c0b6a04f2f 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -798,15 +798,13 @@ void CMsgDialog::OnDestroy() // clean up IEView and H++ log windows
if (m_hwndIEView != nullptr) {
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_DESTROY;
ieWindow.hwnd = m_hwndIEView;
CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow);
}
if (m_hwndHPP) {
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ IEVIEWWINDOW ieWindow = {};
ieWindow.iType = IEW_DESTROY;
ieWindow.hwnd = m_hwndHPP;
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index f2a45e76d1..5d9ed3f914 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1478,7 +1478,6 @@ void CMsgDialog::SetMessageLog() if (iLogMode == WANT_IEVIEW_LOG && m_hwndIEView == nullptr) { IEVIEWWINDOW ieWindow = {}; - ieWindow.cbSize = sizeof(IEVIEWWINDOW); ieWindow.iType = IEW_CREATE; ieWindow.dwMode = IEWM_TABSRMM; ieWindow.parent = m_hwnd; @@ -1491,7 +1490,6 @@ void CMsgDialog::SetMessageLog() } else if (iLogMode == WANT_HPP_LOG && m_hwndHPP == nullptr) { IEVIEWWINDOW ieWindow = {}; - ieWindow.cbSize = sizeof(IEVIEWWINDOW); ieWindow.iType = IEW_CREATE; ieWindow.dwMode = IEWM_TABSRMM; ieWindow.parent = m_hwnd; |