Initial commit: Complete open-source Decal rebuild
All 5 phases of the open-source Decal rebuild: Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil) Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters - Decal.Core, DecalControls, DecalRender, D3DService Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL Phase 4: DenAgent WinForms tray application Phase 5: WiX installer and build script 25 C# projects building with 0 errors. Native C++ projects require VS 2022 + Windows SDK (x86). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
d1442e3747
1382 changed files with 170725 additions and 0 deletions
229
Managed/Decal.Adapter/Decal.Adapter.Wrappers/ButtonWrapper.cs
Normal file
229
Managed/Decal.Adapter/Decal.Adapter.Wrappers/ButtonWrapper.cs
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using Decal.Adapter.Support;
|
||||
using Decal.Interop.Inject;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
public class ButtonWrapper : ControlWrapperBase<ButtonClass>
|
||||
{
|
||||
private EventHandler<ControlEventArgs> evtClick;
|
||||
|
||||
private EventHandler<ControlEventArgs> evtCancel;
|
||||
|
||||
private EventHandler<ControlEventArgs> evtDestroy;
|
||||
|
||||
private EventHandler<ControlEventArgs> evtHit;
|
||||
|
||||
private EventHandler<ControlEventArgs> evtUnhit;
|
||||
|
||||
private int myBackground;
|
||||
|
||||
public Color Matte
|
||||
{
|
||||
get
|
||||
{
|
||||
return Util.ColorFromBGR(base.Control.Matte);
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Control.Matte = Util.ColorToBGR(value);
|
||||
}
|
||||
}
|
||||
|
||||
public int Background
|
||||
{
|
||||
get
|
||||
{
|
||||
return myBackground;
|
||||
}
|
||||
set
|
||||
{
|
||||
myBackground = value;
|
||||
base.Control.SetBackground(myBackground);
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<ControlEventArgs> Click
|
||||
{
|
||||
add
|
||||
{
|
||||
if (evtClick == null)
|
||||
{
|
||||
base.Control.Accepted += ClickEvent;
|
||||
}
|
||||
evtClick = (EventHandler<ControlEventArgs>)Delegate.Combine(evtClick, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, value);
|
||||
if (evtClick == null)
|
||||
{
|
||||
base.Control.Accepted -= ClickEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<ControlEventArgs> Canceled
|
||||
{
|
||||
add
|
||||
{
|
||||
if (evtCancel == null)
|
||||
{
|
||||
base.Control.Canceled += CanceledEvent;
|
||||
}
|
||||
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Combine(evtCancel, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, value);
|
||||
if (evtCancel == null)
|
||||
{
|
||||
base.Control.Canceled -= CanceledEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<ControlEventArgs> Destroy
|
||||
{
|
||||
add
|
||||
{
|
||||
if (evtDestroy == null)
|
||||
{
|
||||
base.Control.Destroy += DestroyEvent;
|
||||
}
|
||||
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
|
||||
if (evtDestroy == null)
|
||||
{
|
||||
base.Control.Destroy -= DestroyEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<ControlEventArgs> Hit
|
||||
{
|
||||
add
|
||||
{
|
||||
if (evtHit == null)
|
||||
{
|
||||
base.Control.Hit += HitEvent;
|
||||
}
|
||||
evtHit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtHit, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, value);
|
||||
if (evtHit == null)
|
||||
{
|
||||
base.Control.Hit -= HitEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<ControlEventArgs> Unhit
|
||||
{
|
||||
add
|
||||
{
|
||||
if (evtUnhit == null)
|
||||
{
|
||||
base.Control.Unhit += UnhitEvent;
|
||||
}
|
||||
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtUnhit, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, value);
|
||||
if (evtUnhit == null)
|
||||
{
|
||||
base.Control.Unhit -= UnhitEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (evtClick != null)
|
||||
{
|
||||
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, evtClick);
|
||||
base.Control.Accepted -= ClickEvent;
|
||||
}
|
||||
if (evtCancel != null)
|
||||
{
|
||||
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, evtCancel);
|
||||
base.Control.Canceled -= CanceledEvent;
|
||||
}
|
||||
if (evtDestroy != null)
|
||||
{
|
||||
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
|
||||
base.Control.Destroy -= DestroyEvent;
|
||||
}
|
||||
if (evtHit != null)
|
||||
{
|
||||
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, evtHit);
|
||||
base.Control.Hit -= HitEvent;
|
||||
}
|
||||
if (evtUnhit != null)
|
||||
{
|
||||
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, evtUnhit);
|
||||
base.Control.Unhit -= UnhitEvent;
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
public void SetImages(int released, int pressed)
|
||||
{
|
||||
SetImages(0, released, pressed);
|
||||
}
|
||||
|
||||
public void SetImages(int module, int released, int pressed)
|
||||
{
|
||||
base.Control.SetImages(module, released, pressed);
|
||||
}
|
||||
|
||||
private void ClickEvent(int ID)
|
||||
{
|
||||
if (evtClick != null)
|
||||
{
|
||||
evtClick(this, new ControlEventArgs(ID));
|
||||
}
|
||||
}
|
||||
|
||||
private void UnhitEvent(int ID)
|
||||
{
|
||||
if (evtUnhit != null)
|
||||
{
|
||||
evtUnhit(this, new ControlEventArgs(ID));
|
||||
}
|
||||
}
|
||||
|
||||
private void HitEvent(int ID)
|
||||
{
|
||||
if (evtHit != null)
|
||||
{
|
||||
evtHit(this, new ControlEventArgs(ID));
|
||||
}
|
||||
}
|
||||
|
||||
private void DestroyEvent(int ID)
|
||||
{
|
||||
if (evtDestroy != null)
|
||||
{
|
||||
evtDestroy(this, new ControlEventArgs(ID));
|
||||
}
|
||||
}
|
||||
|
||||
private void CanceledEvent(int ID)
|
||||
{
|
||||
if (evtCancel != null)
|
||||
{
|
||||
evtCancel(this, new ControlEventArgs(ID));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue