Skip to content

Commit f15932f

Browse files
author
delphidabbler
committed
Updated ExternalObj.ridl, JavaScript and UWBExternal to remove support for donate() function.
donate() function is no longer used now that Donate dialogue box has been removed. Bumped external object to version 13.
1 parent 87c2146 commit f15932f

File tree

3 files changed

+15
-44
lines changed

3 files changed

+15
-44
lines changed

Src/ExternalObj.ridl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[
1414
uuid(DA95AEFB-3FB5-4A9E-9F9D-A53DD05CA7D4),
15-
version(12.0),
15+
version(13.0),
1616
helpstring("CodeSnip DOM External Object Extender Type Library"),
1717
custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 117441012),
1818
custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1219706147)
@@ -24,19 +24,19 @@ library ExternalObj
2424
importlib("stdole2.tlb");
2525

2626
/*
27-
* V12 interface of extension to browser DOM's "external" object.
27+
* V13 interface of extension to browser DOM's "external" object.
2828
*/
29-
interface IWBExternal12;
29+
interface IWBExternal13;
3030

3131

3232
[
3333
uuid(BA971829-ED4D-4092-BCAE-4B5DB1A2D74A),
34-
version(12.0),
34+
version(13.0),
3535
helpstring("DOM external object extender"),
3636
dual,
3737
oleautomation
3838
]
39-
interface IWBExternal12: IDispatch
39+
interface IWBExternal13: IDispatch
4040
{
4141
/*
4242
* Update database from internet.
@@ -66,12 +66,6 @@ library ExternalObj
6666
[id(0x0000006C)]
6767
HRESULT _stdcall EditSnippet([in] BSTR SnippetName);
6868

69-
/*
70-
* Displays Donate dialog box.
71-
*/
72-
[id(0x0000006D)]
73-
HRESULT _stdcall Donate(void);
74-
7569
/*
7670
* Display identified category.
7771
* @param CatID [in] ID of category to display.

Src/Res/Scripts/external.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ function editSnippet(snippet) {
6565
return false;
6666
}
6767

68-
/*
69-
* Calls external object to get host application to display Donate dialog box.
70-
* @return False.
71-
*/
72-
function donate() {
73-
external.Donate();
74-
return false;
75-
}
76-
7768
/*
7869
* Calls external object to get host application to start Snippets Editor ready
7970
* for a new snippet to be entered.
@@ -86,7 +77,7 @@ function newSnippet() {
8677

8778
/*
8879
* Calls external object to get host application to display the CodeSnip news
89-
* feed.
80+
* blog.
9081
* @return False.
9182
*/
9283
function showNews() {

Src/UWBExternal.pas

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface
3434
/// <para>The methods a declared in the type library that is defined in
3535
/// External.idl.</para>
3636
/// </remarks>
37-
TWBExternal = class(TAutoIntfObject, IWBExternal12, ISetNotifier)
37+
TWBExternal = class(TAutoIntfObject, IWBExternal13, ISetNotifier)
3838
strict private
3939
var
4040
/// <summary>Object used to call application code in response to
@@ -77,43 +77,39 @@ TWBExternal = class(TAutoIntfObject, IWBExternal12, ISetNotifier)
7777
/// </param>
7878
/// <remarks>
7979
/// <para>The named snippet must be user defined.</para>
80-
/// <para>Method of IWBExternal12.</para>
80+
/// <para>Method of IWBExternal13.</para>
8181
/// </remarks>
8282
procedure EditSnippet(const SnippetName: WideString); safecall;
8383

84-
/// <summary>Displays the Donate dialogue box.</summary>
85-
/// <remarks>Method of IWBExternal12.</remarks>
86-
procedure Donate; safecall;
87-
8884
/// <summary>Displays a named category.</summary>
8985
/// <param name="CatID">WideString [in] ID of category to be displayed.
9086
/// </param>
9187
/// <param name="NewTab">WordBool [in] Whether to display category in a new
9288
/// tab.</param>
93-
/// <remarks>Method of IWBExternal12.</remarks>
89+
/// <remarks>Method of IWBExternal13.</remarks>
9490
procedure DisplayCategory(const CatID: WideString; NewTab: WordBool);
9591
safecall;
9692

9793
/// <summary>Opens Snippet Editor ready to create a new snippet.</summary>
98-
/// <remarks>Method of IWBExternal12.</remarks>
94+
/// <remarks>Method of IWBExternal13.</remarks>
9995
procedure NewSnippet; safecall;
10096

10197
/// <summary>Shows latest news items from CodeSnip news feed.</summary>
102-
/// <remarks>Method of IWBExternal12.</remarks>
98+
/// <remarks>Method of IWBExternal13.</remarks>
10399
procedure ShowNews; safecall;
104100

105101
/// <summary>Checks for program updates.</summary>
106-
/// <remarks>Method of IWBExternal12.</remarks>
102+
/// <remarks>Method of IWBExternal13.</remarks>
107103
procedure CheckForUpdates; safecall;
108104

109105
/// <summary>Displays the program's About Box.</summary>
110-
/// <remarks>Method of IWBExternal12.</remarks>
106+
/// <remarks>Method of IWBExternal13.</remarks>
111107
procedure ShowAboutBox; safecall;
112108

113109
/// <summary>Displays specified page of the Preferences dialogue.</summary>
114110
/// <param name="ClsName">WideString [in] Class name of the frame that
115111
/// implements the required preferences page.</param>
116-
/// <remarks>Method of IWBExternal12.</remarks>
112+
/// <remarks>Method of IWBExternal13.</remarks>
117113
procedure ShowPrefsPage(const ClsName: WideString); safecall;
118114

119115
/// <summary>Records the notifier object that is used to call application
@@ -166,7 +162,7 @@ constructor TWBExternal.Create;
166162
ExeName := TAppInfo.AppExeFilePath;
167163
OleCheck(LoadTypeLib(PWideChar(ExeName), TypeLib));
168164
// Create the object using type library
169-
inherited Create(TypeLib, IWBExternal12);
165+
inherited Create(TypeLib, IWBExternal13);
170166
end;
171167

172168
procedure TWBExternal.DisplayCategory(const CatID: WideString;
@@ -191,16 +187,6 @@ procedure TWBExternal.DisplaySnippet(const SnippetName: WideString;
191187
end;
192188
end;
193189

194-
procedure TWBExternal.Donate;
195-
begin
196-
try
197-
if Assigned(fNotifier) then
198-
fNotifier.Donate;
199-
except
200-
HandleException;
201-
end;
202-
end;
203-
204190
procedure TWBExternal.EditSnippet(const SnippetName: WideString);
205191
begin
206192
try

0 commit comments

Comments
 (0)