• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision12807 (tree)
Zeit2008-04-29 02:06:39
Autorstefankueng

Log Message

Patch from Roger Lipscombe:
Add example issue tracker COM providers and documentation.

Ändern Zusammenfassung

Diff

--- trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyIssuesForm.Designer.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyIssuesForm.Designer.cs (revision 12807)
@@ -0,0 +1,104 @@
1+namespace ExampleCsPlugin
2+{
3+ partial class MyIssuesForm
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.okButton = new System.Windows.Forms.Button();
32+ this.cancelButton = new System.Windows.Forms.Button();
33+ this.listView1 = new System.Windows.Forms.ListView();
34+ this.SuspendLayout();
35+ //
36+ // okButton
37+ //
38+ this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
39+ this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
40+ this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
41+ this.okButton.Location = new System.Drawing.Point(215, 200);
42+ this.okButton.Name = "okButton";
43+ this.okButton.Size = new System.Drawing.Size(75, 23);
44+ this.okButton.TabIndex = 0;
45+ this.okButton.Text = "OK";
46+ this.okButton.UseVisualStyleBackColor = true;
47+ this.okButton.Click += new System.EventHandler(this.okButton_Click);
48+ //
49+ // cancelButton
50+ //
51+ this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
52+ this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
53+ this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
54+ this.cancelButton.Location = new System.Drawing.Point(296, 200);
55+ this.cancelButton.Name = "cancelButton";
56+ this.cancelButton.Size = new System.Drawing.Size(75, 23);
57+ this.cancelButton.TabIndex = 1;
58+ this.cancelButton.Text = "Cancel";
59+ this.cancelButton.UseVisualStyleBackColor = true;
60+ //
61+ // listView1
62+ //
63+ this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
64+ | System.Windows.Forms.AnchorStyles.Left)
65+ | System.Windows.Forms.AnchorStyles.Right)));
66+ this.listView1.CheckBoxes = true;
67+ this.listView1.FullRowSelect = true;
68+ this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
69+ this.listView1.Location = new System.Drawing.Point(12, 12);
70+ this.listView1.Name = "listView1";
71+ this.listView1.Size = new System.Drawing.Size(359, 182);
72+ this.listView1.TabIndex = 2;
73+ this.listView1.UseCompatibleStateImageBehavior = false;
74+ this.listView1.View = System.Windows.Forms.View.Details;
75+ //
76+ // MyIssuesForm
77+ //
78+ this.AcceptButton = this.okButton;
79+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
80+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
81+ this.CancelButton = this.cancelButton;
82+ this.ClientSize = new System.Drawing.Size(383, 235);
83+ this.Controls.Add(this.listView1);
84+ this.Controls.Add(this.cancelButton);
85+ this.Controls.Add(this.okButton);
86+ this.MaximizeBox = false;
87+ this.MinimizeBox = false;
88+ this.Name = "MyIssuesForm";
89+ this.ShowIcon = false;
90+ this.ShowInTaskbar = false;
91+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
92+ this.Text = "MyIssuesForm";
93+ this.Load += new System.EventHandler(this.MyIssuesForm_Load);
94+ this.ResumeLayout(false);
95+
96+ }
97+
98+ #endregion
99+
100+ private System.Windows.Forms.Button okButton;
101+ private System.Windows.Forms.Button cancelButton;
102+ private System.Windows.Forms.ListView listView1;
103+ }
104+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyIssuesForm.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyIssuesForm.cs (revision 12807)
@@ -0,0 +1,62 @@
1+using System;
2+using System.Collections;
3+using System.Collections.Generic;
4+using System.ComponentModel;
5+using System.Data;
6+using System.Drawing;
7+using System.Linq;
8+using System.Text;
9+using System.Windows.Forms;
10+using System.Xml;
11+
12+namespace ExampleCsPlugin
13+{
14+ partial class MyIssuesForm : Form
15+ {
16+ private readonly IEnumerable<TicketItem> _tickets;
17+ private readonly List<TicketItem> _ticketsAffected = new List<TicketItem>();
18+
19+ public MyIssuesForm(IEnumerable<TicketItem> tickets)
20+ {
21+ InitializeComponent();
22+ _tickets = tickets;
23+ }
24+
25+ public IEnumerable<TicketItem> TicketsFixed
26+ {
27+ get { return _ticketsAffected; }
28+ }
29+
30+ private void MyIssuesForm_Load(object sender, EventArgs e)
31+ {
32+ listView1.Columns.Add("");
33+ listView1.Columns.Add("#");
34+ listView1.Columns.Add("Summary");
35+
36+ foreach(TicketItem ticketItem in _tickets)
37+ {
38+ ListViewItem lvi = new ListViewItem();
39+ lvi.Text = "";
40+ lvi.SubItems.Add(ticketItem.Number.ToString());
41+ lvi.SubItems.Add(ticketItem.Summary);
42+ lvi.Tag = ticketItem;
43+
44+ listView1.Items.Add(lvi);
45+ }
46+
47+ listView1.Columns[0].Width = -1;
48+ listView1.Columns[1].Width = -1;
49+ listView1.Columns[2].Width = -1;
50+ }
51+
52+ private void okButton_Click(object sender, EventArgs e)
53+ {
54+ foreach (ListViewItem lvi in listView1.Items)
55+ {
56+ TicketItem ticketItem = lvi.Tag as TicketItem;
57+ if (ticketItem != null && lvi.Checked)
58+ _ticketsAffected.Add(ticketItem);
59+ }
60+ }
61+ }
62+}
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyPlugin.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/MyPlugin.cs (revision 12807)
@@ -0,0 +1,47 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Text;
4+using System.Windows.Forms;
5+using System.Runtime.InteropServices;
6+
7+namespace ExampleCsPlugin
8+{
9+ [ComVisible(true),
10+ Guid("5870B3F1-8393-4c83-ACED-1D5E803A4F2B"),
11+ ClassInterface(ClassInterfaceType.None)]
12+ public class MyPlugin : Interop.BugTraqProvider.IBugTraqProvider
13+ {
14+ public bool ValidateParameters(IntPtr hParentWnd, string parameters)
15+ {
16+ return true;
17+ }
18+
19+ public string GetLinkText(IntPtr hParentWnd, string parameters)
20+ {
21+ return "Choose Issue";
22+ }
23+
24+ public string GetCommitMessage(IntPtr hParentWnd, string parameters, string originalMessage)
25+ {
26+ List<TicketItem> tickets = new List<TicketItem>();
27+ tickets.Add(new TicketItem(12, "Service doesn't start on Windows Vista"));
28+ tickets.Add(new TicketItem(19, "About box doesn't render correctly in large fonts mode"));
29+
30+ MyIssuesForm form = new MyIssuesForm(tickets);
31+ if (form.ShowDialog() != DialogResult.OK)
32+ return originalMessage;
33+
34+ StringBuilder result = new StringBuilder(originalMessage);
35+ if (originalMessage.Length != 0 && !originalMessage.EndsWith("\n"))
36+ result.AppendLine();
37+
38+ foreach (TicketItem ticket in form.TicketsFixed)
39+ {
40+ result.AppendFormat("Fixed #{0}: {1}", ticket.Number, ticket.Summary);
41+ result.AppendLine();
42+ }
43+
44+ return result.ToString();
45+ }
46+ }
47+}
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/Properties/AssemblyInfo.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/Properties/AssemblyInfo.cs (revision 12807)
@@ -0,0 +1,36 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+using System.Runtime.InteropServices;
4+
5+// General Information about an assembly is controlled through the following
6+// set of attributes. Change these attribute values to modify the information
7+// associated with an assembly.
8+[assembly: AssemblyTitle("ExampleCsPlugin")]
9+[assembly: AssemblyDescription("")]
10+[assembly: AssemblyConfiguration("")]
11+[assembly: AssemblyCompany("")]
12+[assembly: AssemblyProduct("ExampleCsPlugin")]
13+[assembly: AssemblyCopyright("Copyright © 2008")]
14+[assembly: AssemblyTrademark("")]
15+[assembly: AssemblyCulture("")]
16+
17+// Setting ComVisible to false makes the types in this assembly not visible
18+// to COM components. If you need to access a type in this assembly from
19+// COM, set the ComVisible attribute to true on that type.
20+[assembly: ComVisible(false)]
21+
22+// The following GUID is for the ID of the typelib if this project is exposed to COM
23+[assembly: Guid("74d36841-2d8c-4a3d-a557-85cda90481b7")]
24+
25+// Version information for an assembly consists of the following four values:
26+//
27+// Major Version
28+// Minor Version
29+// Build Number
30+// Revision
31+//
32+// You can specify all the values or you can default the Build and Revision Numbers
33+// by using the '*' as shown below:
34+// [assembly: AssemblyVersion("1.0.*")]
35+[assembly: AssemblyVersion("1.0.0.0")]
36+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/TicketItem.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/ExampleCsPlugin/TicketItem.cs (revision 12807)
@@ -0,0 +1,24 @@
1+namespace ExampleCsPlugin
2+{
3+ internal class TicketItem
4+ {
5+ private readonly int _ticketNumber;
6+ private readonly string _ticketSummary;
7+
8+ public TicketItem(int ticketNumber, string ticketSummary)
9+ {
10+ _ticketNumber = ticketNumber;
11+ _ticketSummary = ticketSummary;
12+ }
13+
14+ public int Number
15+ {
16+ get { return _ticketNumber; }
17+ }
18+
19+ public string Summary
20+ {
21+ get { return _ticketSummary; }
22+ }
23+ }
24+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/Interop.BugTraqProvider/IBugTraqProvider.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/Interop.BugTraqProvider/IBugTraqProvider.cs (revision 12807)
@@ -0,0 +1,19 @@
1+using System;
2+using System.Runtime.InteropServices;
3+
4+namespace Interop.BugTraqProvider
5+{
6+ [ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsDual), Guid("298B927B-7220-423C-B7B4-6E241F00CD93")]
7+ public interface IBugTraqProvider
8+ {
9+ [return: MarshalAs(UnmanagedType.VariantBool)]
10+ bool ValidateParameters(IntPtr hParentWnd, [MarshalAs(UnmanagedType.BStr)] string parameters);
11+
12+ [return: MarshalAs(UnmanagedType.BStr)]
13+ string GetLinkText(IntPtr hParentWnd, [MarshalAs(UnmanagedType.BStr)] string parameters);
14+
15+ [return: MarshalAs(UnmanagedType.BStr)]
16+ string GetCommitMessage(IntPtr hParentWnd, [MarshalAs(UnmanagedType.BStr)] string parameters,
17+ [MarshalAs(UnmanagedType.BStr)] string originalMessage);
18+ }
19+}
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/Interop.BugTraqProvider/Properties/AssemblyInfo.cs (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/Interop.BugTraqProvider/Properties/AssemblyInfo.cs (revision 12807)
@@ -0,0 +1,36 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+using System.Runtime.InteropServices;
4+
5+// General Information about an assembly is controlled through the following
6+// set of attributes. Change these attribute values to modify the information
7+// associated with an assembly.
8+[assembly: AssemblyTitle("Interop.BugTraqProvider")]
9+[assembly: AssemblyDescription("Interop assembly for the IBugTraqProvider interface")]
10+[assembly: AssemblyConfiguration("")]
11+[assembly: AssemblyCompany("")]
12+[assembly: AssemblyProduct("Interop.BugTraqProvider")]
13+[assembly: AssemblyCopyright("Copyright (c) 2008 TortoiseSVN")]
14+[assembly: AssemblyTrademark("")]
15+[assembly: AssemblyCulture("")]
16+
17+// Setting ComVisible to false makes the types in this assembly not visible
18+// to COM components. If you need to access a type in this assembly from
19+// COM, set the ComVisible attribute to true on that type.
20+[assembly: ComVisible(false)]
21+
22+// The following GUID is for the ID of the typelib if this project is exposed to COM
23+[assembly: Guid("c1d886e0-f7ff-4926-bb34-41515d289c9d")]
24+
25+// Version information for an assembly consists of the following four values:
26+//
27+// Major Version
28+// Minor Version
29+// Build Number
30+// Revision
31+//
32+// You can specify all the values or you can default the Build and Revision Numbers
33+// by using the '*' as shown below:
34+// [assembly: AssemblyVersion("1.0.*")]
35+[assembly: AssemblyVersion("1.0.0.0")]
36+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/inc/IBugTraqProvider_h.h (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/inc/IBugTraqProvider_h.h (revision 12807)
@@ -0,0 +1,238 @@
1+
2+
3+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
4+
5+
6+ /* File created by MIDL compiler version 7.00.0500 */
7+/* at Mon Apr 28 14:05:17 2008
8+ */
9+/* Compiler settings for .\IBugTraqProvider.idl:
10+ Oicf, W1, Zp8, env=Win32 (32b run)
11+ protocol : dce , ms_ext, c_ext, robust
12+ error checks: allocation ref bounds_check enum stub_data
13+ VC __declspec() decoration level:
14+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
15+ DECLSPEC_UUID(), MIDL_INTERFACE()
16+*/
17+//@@MIDL_FILE_HEADING( )
18+
19+#pragma warning( disable: 4049 ) /* more than 64k source lines */
20+
21+
22+/* verify that the <rpcndr.h> version is high enough to compile this file*/
23+#ifndef __REQUIRED_RPCNDR_H_VERSION__
24+#define __REQUIRED_RPCNDR_H_VERSION__ 475
25+#endif
26+
27+#include "rpc.h"
28+#include "rpcndr.h"
29+
30+#ifndef __RPCNDR_H_VERSION__
31+#error this stub requires an updated version of <rpcndr.h>
32+#endif // __RPCNDR_H_VERSION__
33+
34+#ifndef COM_NO_WINDOWS_H
35+#include "windows.h"
36+#include "ole2.h"
37+#endif /*COM_NO_WINDOWS_H*/
38+
39+#ifndef __IBugTraqProvider_h_h__
40+#define __IBugTraqProvider_h_h__
41+
42+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
43+#pragma once
44+#endif
45+
46+/* Forward Declarations */
47+
48+#ifndef __IBugTraqProvider_FWD_DEFINED__
49+#define __IBugTraqProvider_FWD_DEFINED__
50+typedef interface IBugTraqProvider IBugTraqProvider;
51+#endif /* __IBugTraqProvider_FWD_DEFINED__ */
52+
53+
54+/* header files for imported files */
55+#include "oaidl.h"
56+#include "ocidl.h"
57+
58+#ifdef __cplusplus
59+extern "C"{
60+#endif
61+
62+
63+#ifndef __IBugTraqProvider_INTERFACE_DEFINED__
64+#define __IBugTraqProvider_INTERFACE_DEFINED__
65+
66+/* interface IBugTraqProvider */
67+/* [unique][helpstring][nonextensible][dual][uuid][object] */
68+
69+
70+EXTERN_C const IID IID_IBugTraqProvider;
71+
72+#if defined(__cplusplus) && !defined(CINTERFACE)
73+
74+ MIDL_INTERFACE("298B927B-7220-423C-B7B4-6E241F00CD93")
75+ IBugTraqProvider : public IDispatch
76+ {
77+ public:
78+ virtual HRESULT STDMETHODCALLTYPE ValidateParameters(
79+ /* [in] */ HWND hParentWnd,
80+ /* [in] */ BSTR parameters,
81+ /* [retval][out] */ VARIANT_BOOL *valid) = 0;
82+
83+ virtual HRESULT STDMETHODCALLTYPE GetLinkText(
84+ /* [in] */ HWND hParentWnd,
85+ /* [in] */ BSTR parameters,
86+ /* [retval][out] */ BSTR *linkText) = 0;
87+
88+ virtual HRESULT STDMETHODCALLTYPE GetCommitMessage(
89+ /* [in] */ HWND hParentWnd,
90+ /* [in] */ BSTR parameters,
91+ /* [in] */ BSTR originalMessage,
92+ /* [retval][out] */ BSTR *newMessage) = 0;
93+
94+ };
95+
96+#else /* C style interface */
97+
98+ typedef struct IBugTraqProviderVtbl
99+ {
100+ BEGIN_INTERFACE
101+
102+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
103+ IBugTraqProvider * This,
104+ /* [in] */ REFIID riid,
105+ /* [iid_is][out] */
106+ __RPC__deref_out void **ppvObject);
107+
108+ ULONG ( STDMETHODCALLTYPE *AddRef )(
109+ IBugTraqProvider * This);
110+
111+ ULONG ( STDMETHODCALLTYPE *Release )(
112+ IBugTraqProvider * This);
113+
114+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
115+ IBugTraqProvider * This,
116+ /* [out] */ UINT *pctinfo);
117+
118+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
119+ IBugTraqProvider * This,
120+ /* [in] */ UINT iTInfo,
121+ /* [in] */ LCID lcid,
122+ /* [out] */ ITypeInfo **ppTInfo);
123+
124+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
125+ IBugTraqProvider * This,
126+ /* [in] */ REFIID riid,
127+ /* [size_is][in] */ LPOLESTR *rgszNames,
128+ /* [range][in] */ UINT cNames,
129+ /* [in] */ LCID lcid,
130+ /* [size_is][out] */ DISPID *rgDispId);
131+
132+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
133+ IBugTraqProvider * This,
134+ /* [in] */ DISPID dispIdMember,
135+ /* [in] */ REFIID riid,
136+ /* [in] */ LCID lcid,
137+ /* [in] */ WORD wFlags,
138+ /* [out][in] */ DISPPARAMS *pDispParams,
139+ /* [out] */ VARIANT *pVarResult,
140+ /* [out] */ EXCEPINFO *pExcepInfo,
141+ /* [out] */ UINT *puArgErr);
142+
143+ HRESULT ( STDMETHODCALLTYPE *ValidateParameters )(
144+ IBugTraqProvider * This,
145+ /* [in] */ HWND hParentWnd,
146+ /* [in] */ BSTR parameters,
147+ /* [retval][out] */ VARIANT_BOOL *valid);
148+
149+ HRESULT ( STDMETHODCALLTYPE *GetLinkText )(
150+ IBugTraqProvider * This,
151+ /* [in] */ HWND hParentWnd,
152+ /* [in] */ BSTR parameters,
153+ /* [retval][out] */ BSTR *linkText);
154+
155+ HRESULT ( STDMETHODCALLTYPE *GetCommitMessage )(
156+ IBugTraqProvider * This,
157+ /* [in] */ HWND hParentWnd,
158+ /* [in] */ BSTR parameters,
159+ /* [in] */ BSTR originalMessage,
160+ /* [retval][out] */ BSTR *newMessage);
161+
162+ END_INTERFACE
163+ } IBugTraqProviderVtbl;
164+
165+ interface IBugTraqProvider
166+ {
167+ CONST_VTBL struct IBugTraqProviderVtbl *lpVtbl;
168+ };
169+
170+
171+
172+#ifdef COBJMACROS
173+
174+
175+#define IBugTraqProvider_QueryInterface(This,riid,ppvObject) \
176+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
177+
178+#define IBugTraqProvider_AddRef(This) \
179+ ( (This)->lpVtbl -> AddRef(This) )
180+
181+#define IBugTraqProvider_Release(This) \
182+ ( (This)->lpVtbl -> Release(This) )
183+
184+
185+#define IBugTraqProvider_GetTypeInfoCount(This,pctinfo) \
186+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
187+
188+#define IBugTraqProvider_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
189+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
190+
191+#define IBugTraqProvider_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
192+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
193+
194+#define IBugTraqProvider_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
195+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
196+
197+
198+#define IBugTraqProvider_ValidateParameters(This,hParentWnd,parameters,valid) \
199+ ( (This)->lpVtbl -> ValidateParameters(This,hParentWnd,parameters,valid) )
200+
201+#define IBugTraqProvider_GetLinkText(This,hParentWnd,parameters,linkText) \
202+ ( (This)->lpVtbl -> GetLinkText(This,hParentWnd,parameters,linkText) )
203+
204+#define IBugTraqProvider_GetCommitMessage(This,hParentWnd,parameters,originalMessage,newMessage) \
205+ ( (This)->lpVtbl -> GetCommitMessage(This,hParentWnd,parameters,originalMessage,newMessage) )
206+
207+#endif /* COBJMACROS */
208+
209+
210+#endif /* C style interface */
211+
212+
213+
214+
215+#endif /* __IBugTraqProvider_INTERFACE_DEFINED__ */
216+
217+
218+/* Additional Prototypes for ALL interfaces */
219+
220+unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
221+unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
222+unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
223+void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
224+
225+unsigned long __RPC_USER HWND_UserSize( unsigned long *, unsigned long , HWND * );
226+unsigned char * __RPC_USER HWND_UserMarshal( unsigned long *, unsigned char *, HWND * );
227+unsigned char * __RPC_USER HWND_UserUnmarshal(unsigned long *, unsigned char *, HWND * );
228+void __RPC_USER HWND_UserFree( unsigned long *, HWND * );
229+
230+/* end of Additional Prototypes */
231+
232+#ifdef __cplusplus
233+}
234+#endif
235+
236+#endif
237+
238+
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/inc/IBugTraqProvider_i.c (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/inc/IBugTraqProvider_i.c (revision 12807)
@@ -0,0 +1,79 @@
1+
2+
3+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
4+
5+/* link this file in with the server and any clients */
6+
7+
8+ /* File created by MIDL compiler version 7.00.0500 */
9+/* at Mon Apr 28 14:05:17 2008
10+ */
11+/* Compiler settings for .\IBugTraqProvider.idl:
12+ Oicf, W1, Zp8, env=Win32 (32b run)
13+ protocol : dce , ms_ext, c_ext, robust
14+ error checks: allocation ref bounds_check enum stub_data
15+ VC __declspec() decoration level:
16+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
17+ DECLSPEC_UUID(), MIDL_INTERFACE()
18+*/
19+//@@MIDL_FILE_HEADING( )
20+
21+#pragma warning( disable: 4049 ) /* more than 64k source lines */
22+
23+
24+#ifdef __cplusplus
25+extern "C"{
26+#endif
27+
28+
29+#include <rpc.h>
30+#include <rpcndr.h>
31+
32+#ifdef _MIDL_USE_GUIDDEF_
33+
34+#ifndef INITGUID
35+#define INITGUID
36+#include <guiddef.h>
37+#undef INITGUID
38+#else
39+#include <guiddef.h>
40+#endif
41+
42+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
43+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
44+
45+#else // !_MIDL_USE_GUIDDEF_
46+
47+#ifndef __IID_DEFINED__
48+#define __IID_DEFINED__
49+
50+typedef struct _IID
51+{
52+ unsigned long x;
53+ unsigned short s1;
54+ unsigned short s2;
55+ unsigned char c[8];
56+} IID;
57+
58+#endif // __IID_DEFINED__
59+
60+#ifndef CLSID_DEFINED
61+#define CLSID_DEFINED
62+typedef IID CLSID;
63+#endif // CLSID_DEFINED
64+
65+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
66+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
67+
68+#endif !_MIDL_USE_GUIDDEF_
69+
70+MIDL_DEFINE_GUID(IID, IID_IBugTraqProvider,0x298B927B,0x7220,0x423C,0xB7,0xB4,0x6E,0x24,0x1F,0x00,0xCD,0x93);
71+
72+#undef MIDL_DEFINE_GUID
73+
74+#ifdef __cplusplus
75+}
76+#endif
77+
78+
79+
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/contrib/issue-tracker-plugins/issue-tracker-plugins.txt (nonexistent)
+++ trunk/contrib/issue-tracker-plugins/issue-tracker-plugins.txt (revision 12807)
@@ -0,0 +1,247 @@
1+Issue Tracker Plugins
2+=====================
3+
4+An issue tracker plugin is a COM object that implements the IBugTraqProvider
5+interface. It must also be registered as implementing the CATID_BugTraqProvider
6+component category.
7+
8+
9+Example Plugins
10+---------------
11+
12+There are two example plugins in this folder.
13+
14+ - ExampleAtlPlugin, written in C++, using ATL.
15+ - ExampleCsPlugin, written in C#.
16+
17+They get the list of available "issues" from a hard-coded list, rather than a
18+database or web service, but this should be sufficient to demonstrate the
19+plugin API.
20+
21+
22+Licensing and GPL compatibility
23+-------------------------------
24+
25+TortoiseSVN is licensed under the GNU General Public License (see the file
26+LICENSE for details).
27+
28+There is a specific exception for plugins that implement the issue tracker
29+plugin interfaces; these do not need to be GPL-licensed.
30+
31+
32+The IBugTraqProvider interface
33+------------------------------
34+
35+In the contrib\issue-tracker-plugins\inc directory, you'll find the following
36+files:
37+
38+ * IBugTraqProvider.idl
39+ This is a copy of the src\IBugTraqProvider\IBugTraqProvider.idl file; it's
40+ provided for reference, but you should not need to use it.
41+
42+ * IBugTraqProvider_h.h, IBugTraqProvider_i.c
43+ These are the files you'll probably use if you implement a plugin in C++.
44+
45+ * Interop.BugTraqProvider.dll
46+ Interop Assembly for implementing plugins in .NET. It's not yet a Primary
47+ Interop Assembly (PIA).
48+ The source code for this project is in the Interop.BugTraqProvider folder.
49+
50+
51+Walkthrough: Creating an issue tracker plugin in C#
52+---------------------------------------------------
53+
54+(This assumes a basic familiarity with creating Windows Forms applications).
55+
56+In Visual Studio 2005 or 2008, create a new "Class Library" project; give it a
57+name.
58+
59+Delete the "Class1" class; we'll create another one in a moment.
60+
61+Add a reference to the inc\Interop.BugTraqProvider.dll file.
62+
63+Create a new class named "MyPlugin".
64+
65+Derive MyPlugin from the Interop.BugTraqProvider.IBugTraqProvider interface,
66+and then implement the first two methods as follows:
67+
68+The ValidateParameters method should look like this:
69+
70+ public bool ValidateParameters(IntPtr hParentWnd, string parameters)
71+ {
72+ return true;
73+ }
74+
75+The GetLinkText method should look like this:
76+
77+ public string GetLinkText(IntPtr hParentWnd, string parameters)
78+ {
79+ return "Choose Issue";
80+ }
81+
82+We'll come back to GetCommitMessage shortly.
83+
84+The class also needs some attributes; it should look like this:
85+
86+ [ComVisible(true),
87+ Guid("PUT-GUID-HERE"),
88+ ClassInterface(ClassInterfaceType.None)]
89+ public class Provider : IBugTraqProvider
90+ {
91+ // etc.
92+
93+(Replace "PUT-GUID-HERE" with a new GUID).
94+
95+Add a class to hold our example ticket data:
96+
97+ internal class TicketItem
98+ {
99+ private readonly int _ticketNumber;
100+ private readonly string _ticketSummary;
101+
102+ public TicketItem(int ticketNumber, string ticketSummary)
103+ {
104+ _ticketNumber = ticketNumber;
105+ _ticketSummary = ticketSummary;
106+ }
107+
108+ public int Number
109+ {
110+ get { return _ticketNumber; }
111+ }
112+
113+ public string Summary
114+ {
115+ get { return _ticketSummary; }
116+ }
117+ }
118+
119+We can now implement the GetCommitMessage method as follows:
120+
121+ public string GetCommitMessage(IntPtr hParentWnd, string parameters, string originalMessage)
122+ {
123+ List<TicketItem> tickets = new List<TicketItem>();
124+ tickets.Add(new TicketItem(12, "Service doesn't start on Windows Vista"));
125+ tickets.Add(new TicketItem(19, "About box doesn't render correctly in large fonts mode"));
126+
127+ MyIssuesForm form = new MyIssuesForm(tickets);
128+ if (form.ShowDialog() != DialogResult.OK)
129+ return originalMessage;
130+
131+ StringBuilder result = new StringBuilder(originalMessage);
132+ if (originalMessage.Length != 0 && !originalMessage.EndsWith("\n"))
133+ result.AppendLine();
134+
135+ foreach (TicketItem ticket in form.TicketsFixed)
136+ {
137+ result.AppendFormat("Fixed #{0}: {1}", ticket.Number, ticket.Summary);
138+ result.AppendLine();
139+ }
140+
141+ return result.ToString();
142+ }
143+
144+This passes the list of open issues to the MyIssuesForm object, where the
145+user will be able to check those ones that she's fixed. These are available
146+through the TicketsFixed property.
147+
148+We use these to build a string that looks something like this:
149+
150+Fixed #12: Service doesn't start on Windows Vista.
151+
152+A commit message formatted like this will cause, (e.g.) Trac's post-commit
153+hook to close the tickets.
154+
155+Anything that the user has already entered into the commit message is left
156+there.
157+
158+Now we need a dialog box that displays the issues assigned to the
159+current user.
160+
161+Add a Windows Form item to your project. Name it "MyIssuesForm". Set the
162+following properties:
163+
164+ StartPosition = CenterParent
165+ MaximizeBox = False
166+ MinimizeBox = False
167+ ShowIcon = False
168+ ShowInTaskbar = False
169+
170+Put the usual OK and Cancel buttons on it; arrange them and wire them up
171+properly.
172+
173+Add a ListView control to the form and arrange it appropriately. Set the
174+following properties:
175+
176+ Checkboxes = True
177+ FullRowSelect = True
178+ View = Details
179+ HeaderStyle = Nonclickable
180+
181+Change the class so that it looks like this:
182+
183+ partial class MyIssuesForm : Form
184+ {
185+ private readonly IEnumerable<TicketItem> _tickets;
186+ private readonly List<TicketItem> _ticketsAffected = new List<TicketItem>();
187+
188+ public MyIssuesForm(IEnumerable<TicketItem> tickets)
189+ {
190+ InitializeComponent();
191+ _tickets = tickets;
192+ }
193+
194+ public IEnumerable<TicketItem> TicketsFixed
195+ {
196+ get { return _ticketsAffected; }
197+ }
198+
199+ // etc.
200+
201+Then implement some event handlers in MyIssuesForm as follows:
202+
203+ private void MyIssuesForm_Load(object sender, EventArgs e)
204+ {
205+ listView1.Columns.Add("");
206+ listView1.Columns.Add("#");
207+ listView1.Columns.Add("Summary");
208+
209+ foreach(TicketItem ticketItem in _tickets)
210+ {
211+ ListViewItem lvi = new ListViewItem();
212+ lvi.Text = "";
213+ lvi.SubItems.Add(ticketItem.Number.ToString());
214+ lvi.SubItems.Add(ticketItem.Summary);
215+ lvi.Tag = ticketItem;
216+
217+ listView1.Items.Add(lvi);
218+ }
219+
220+ listView1.Columns[0].Width = -1;
221+ listView1.Columns[1].Width = -1;
222+ listView1.Columns[2].Width = -1;
223+ }
224+
225+ private void okButton_Click(object sender, EventArgs e)
226+ {
227+ foreach (ListViewItem lvi in listView1.Items)
228+ {
229+ TicketItem ticketItem = lvi.Tag as TicketItem;
230+ if (ticketItem != null && lvi.Checked)
231+ _ticketsAffected.Add(ticketItem);
232+ }
233+ }
234+
235+Registering your new C# class can be done by using RegAsm from the command
236+line, as follows:
237+
238+ RegAsm bin\Debug\MyCsPlugin.dll /codebase /regfile:MyCsPlugin.reg
239+
240+You'll need to edit the .REG file, by adding another "Implemented Categories"
241+entry that looks like this:
242+
243+[HKEY_CLASSES_ROOT\CLSID\{PUT-GUID-HERE}\Implemented Categories\{3494FA92-B139-4730-9591-01135D5E7831}]
244+
245+Replace "PUT-GUID-HERE" with the same value you used earlier.
246+
247+Then, merge that .REG file into the registry, and your plugin is ready to go!
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Show on old repository browser