[WIP] Partial profile image restructure

Trying to make the DisplayView and ProfileIcon
image drawing logic more generic so that it will
work with NVIDIA, AMD , Intel and Windows video
card drivers. Having to reverse engineer the amazing
wok that Soroush did with this stuff. I just know that
I'm going to break this before I fix it, but I really think
this is needed in order for this new video card
separation refactoring to work. This is going to take a
while I feel!
This commit is contained in:
Terry MacDonald
2021-06-24 22:14:39 +12:00
parent ac5d51bb12
commit 5cb0984637
4 changed files with 103 additions and 34 deletions

View File

@ -13,12 +13,27 @@ using IWshRuntimeLibrary;
namespace DisplayMagicianShared
{
public struct ScreenPosition
{
public int ScreenX;
public int ScreenY;
public int ScreenWidth;
public int ScreenHeight;
public Orientation ScreenOrientation;
public Rotation ScreenRotation;
public string Name;
public bool IsPrimary;
public bool Colour;
}
public class ProfileItem : IComparable
{
private static List<ProfileItem> _allSavedProfiles = new List<ProfileItem>();
private ProfileIcon _profileIcon;
private Bitmap _profileBitmap, _profileShortcutBitmap;
private List<string> _profileDisplayIdentifiers = new List<string>();
private List<ScreenPosition> _screens;
internal static string AppDataPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DisplayMagician");
private static readonly string uuidV4Regex = @"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$";
@ -26,7 +41,7 @@ namespace DisplayMagicianShared
private string _uuid = "";
private bool _isPossible = false;
private Keys _hotkey = Keys.None;
#region JsonConverterBitmap
internal class CustomBitmapConverter : JsonConverter
@ -180,6 +195,20 @@ namespace DisplayMagicianShared
}
[JsonIgnore]
public virtual List<ScreenPosition> Screens
{
get
{
if (_screens.Count == 0)
{
_screens = GetScreenPositions();
}
return _screens;
}
}
public string SavedProfileIconCacheFilename { get; set; }
public virtual List<string> ProfileDisplayIdentifiers
@ -546,6 +575,11 @@ namespace DisplayMagicianShared
}
}
public virtual List<ScreenPosition> GetScreenPositions()
{
return new List<ScreenPosition>();
}
}
// Custom Equality comparer for the Profile class