ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Interfaces/PluginInterfaces.cs
Revision: 682
Committed: Mon Jun 17 08:27:34 2013 UTC (9 years, 5 months ago) by william
File size: 5044 byte(s)
Log Message:
+ fix-up null plugins

File Contents

# User Rev Content
1 william 83 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using System.Diagnostics;
6 william 88 using RomCheater.PluginFramework.Core;
7 william 399 using RomCheater.PluginFramework.Events;
8 william 440 using WeifenLuo.WinFormsUI.Docking;
9 william 83
10     namespace RomCheater.PluginFramework.Interfaces
11     {
12 william 680 #region t
13     public interface IExposedPluginData : IAcceptPEData
14     {
15     void SetAcceptedProcess(Process proc);
16     void SetAcceptedConfig(IConfigPlugin config);
17 william 679
18 william 680 void SetAcceptedProcessAndConfig(IAcceptsProcessAndConfig iapc);
19 william 679
20 william 680 }
21 william 679
22 william 680
23     #endregion
24    
25 william 399 #region IPluginBase
26 william 682 public interface IPluginBase : IPluginName, IPluginDescription, IPluginID, IToString, IPluginRefresh, IExposedPluginData
27     {
28     bool IsNullPlugin { get; }
29     bool IsGenericPlugin { get; }
30     }
31 william 94 #region IPluginBase SubMembers
32     public interface IToString { string ToString(); }
33     public interface IPluginName { string Name { get; } }
34     public interface IPluginDescription { string Description { get; } }
35     public interface IPluginID { Guid ID { get; } }
36 william 329 public interface IPluginRefresh { void Reload(); void Reload(bool silent); }
37 william 83 #endregion
38 william 94 #endregion
39 william 83 #region IConfigPlugin
40 william 399 public interface IConfigPlugin : IPluginBase, IAcceptsReadOnlyMemoryRange, ISearchInProgress, IAcceptsMemorySearch
41 william 83 {
42 william 682 List<ProcContainer> ValidProcessesForPlugin { get; }
43 william 83 }
44     #endregion
45     #region IInputPlugin
46     public interface IInputPlugin : IPluginBase
47     {
48     }
49     #endregion
50     #region IWindowPlugin
51     public interface IWindowPlugin : IPluginBase
52     {
53     }
54     #endregion
55 william 437 #region IUserControlPlugin
56     public interface IUserControlPlugin : IPluginBase
57     {
58 william 440 void Show();
59     void Show(DockPanel dockPanel);
60     void Show(DockPanel dockPanel, DockState dockState);
61     void Config();
62 william 437 }
63     #endregion
64 william 83 #region IPluginLoader
65     public interface IPluginLoader
66     {
67     void LoadPlugins();
68 william 366 void LoadPlugins(bool silent);
69 william 83 List<IConfigPlugin> LoadedConfigPlugins { get; }
70     List<IInputPlugin> LoadedInputPlugins { get; }
71     List<IWindowPlugin> LoadedWindowPlugins { get; }
72 william 437 List<IUserControlPlugin> LoadedUserControlPlugins { get; }
73    
74 william 87 IConfigPlugin GetConfigPlugin(string t);
75     IInputPlugin GetInputPlugin(string t);
76     IWindowPlugin GetWindowPlugin(string t);
77    
78 william 86 string ToString();
79 william 83 }
80     #endregion
81 william 234 #region AcceptsPlugin
82 william 228 public interface IAcceptsPlugin<TPlugin>
83     where TPlugin : IPluginBase
84 william 153 {
85 william 228 TPlugin AcceptedPlugin { get; set; }
86 william 153 }
87 william 357 public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { }
88 william 477 public interface IAcceptsProcess : IAcceptsProcess<Process> { }
89     public interface IAcceptsProcess<TProcess>
90     where TProcess : Process
91     {
92     TProcess AcceptedProcess { get; set; }
93     }
94 william 234 #endregion
95 william 477 public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { }
96 william 357 public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { }
97 william 389
98 william 477 public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process
99 william 389 {
100 william 477 public AcceptedProcessAndConfig() : this(null, default(TProcess)) { }
101     public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; }
102     #region IAcceptsProcessAndConfig<TProcess> members
103     #endregion
104 william 389
105     #region IAcceptsPlugin<IConfigPlugin> Members
106     public IConfigPlugin AcceptedPlugin { get; set; }
107     #endregion
108    
109 william 477 #region IAcceptsProcess<TProcess> Members
110     public TProcess AcceptedProcess { get; set; }
111 william 389 #endregion
112     }
113 william 477 public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig
114     {
115     public AcceptedProcessAndConfig() : this(null, null) { }
116     public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; }
117 william 389
118 william 477 #region IAcceptsProcess<Process> Members
119     public Process AcceptedProcess { get; set; }
120     #endregion
121     #region IAcceptsPlugin<IConfigPlugin> Members
122     public IConfigPlugin AcceptedPlugin { get; set; }
123     #endregion
124     }
125    
126 william 196 public interface IAcceptsProcessPID
127     {
128     int ProcessPID { get; set; }
129     }
130 william 198 public interface IAcceptsMemoryRange
131     {
132 william 574 ulong MemoryRangeStart { get; set; }
133     ulong MemoryRangeSize { get; set; }
134 william 198 }
135 william 389 public interface IAcceptsReadOnlyMemoryRange
136     {
137 william 590 ulong MemoryRangeStart { get; }
138     ulong MemoryRangeSize { get; }
139 william 389 }
140 william 228 public interface IOutputsData<TData> { TData Data { get; } }
141 william 444 public interface ISearchInProgress
142     {
143     bool SearchInProgess { get; }
144     Guid SearchGuid { get; }
145     }
146 william 83 }