mirror of
https://github.com/ZuneDev/Xune.git
synced 2026-07-27 13:13:10 -07:00
Simplified usages
This commit is contained in:
@@ -37,6 +37,6 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
internal static uint ToUInt32(DataCookie handle) => handle.m_value;
|
||||
|
||||
public static DataCookie ReserveSlot() => DataCookie.FromUInt32(KeyAllocator.ReserveSlot());
|
||||
public static DataCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_arExtraModes = DisplayMode.EmptyModes;
|
||||
this.m_arAllModes = DisplayMode.EmptyModes;
|
||||
this.m_modeCurrent = new DisplayMode();
|
||||
this.m_nCurrentValid = (DisplayModeFlags)0;
|
||||
this.m_nCurrentValid = 0;
|
||||
}
|
||||
|
||||
public string DeviceName => this.m_stDeviceName;
|
||||
@@ -100,7 +100,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
nCompleteCheck = this.m_nCurrentValid;
|
||||
DisplayMode[] array = fAllowAllModes ? this.m_arAllModes : this.m_arExtraModes;
|
||||
DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer();
|
||||
if (Array.BinarySearch<DisplayMode>(array, modeDesired, (IComparer<DisplayMode>)renderModeComparer) >= 0)
|
||||
if (Array.BinarySearch<DisplayMode>(array, modeDesired, renderModeComparer) >= 0)
|
||||
{
|
||||
modeComplete = modeDesired;
|
||||
nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate;
|
||||
@@ -108,11 +108,11 @@ namespace Microsoft.Iris.Render.Internal
|
||||
else
|
||||
{
|
||||
modeComplete = this.m_modeDesktop;
|
||||
int num = Display.ComputeRank(this.m_modeDesktop, modeDesired, nCheck);
|
||||
int num = ComputeRank(this.m_modeDesktop, modeDesired, nCheck);
|
||||
nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate;
|
||||
foreach (DisplayMode arSupportedMode in this.m_arSupportedModes)
|
||||
{
|
||||
int rank = Display.ComputeRank(arSupportedMode, modeDesired, nCheck);
|
||||
int rank = ComputeRank(arSupportedMode, modeDesired, nCheck);
|
||||
if (rank >= num)
|
||||
{
|
||||
modeComplete = arSupportedMode;
|
||||
@@ -139,8 +139,8 @@ namespace Microsoft.Iris.Render.Internal
|
||||
public bool ChangeFullScreenResolution(DisplayMode modeChanges, DisplayModeFlags nValid)
|
||||
{
|
||||
bool flag = false;
|
||||
Debug2.Validate(modeChanges.sizePhysicalPxl.Width == 0 && modeChanges.sizePhysicalPxl.Height == 0 || modeChanges.sizePhysicalPxl.Width > 0 && modeChanges.sizePhysicalPxl.Height > 0, typeof(ArgumentException), (object)"Must specify physical 0 x 0 or a positive size", (object)typeof(ArgumentOutOfRangeException));
|
||||
Debug2.Validate(modeChanges.sizeLogicalPxl.Width == 0 && modeChanges.sizeLogicalPxl.Height == 0 || modeChanges.sizeLogicalPxl.Width > 0 && modeChanges.sizeLogicalPxl.Height > 0, typeof(ArgumentException), (object)"Must specify logical 0 x 0 or a positive size", (object)typeof(ArgumentOutOfRangeException));
|
||||
Debug2.Validate(modeChanges.sizePhysicalPxl.Width == 0 && modeChanges.sizePhysicalPxl.Height == 0 || modeChanges.sizePhysicalPxl.Width > 0 && modeChanges.sizePhysicalPxl.Height > 0, typeof(ArgumentException), "Must specify physical 0 x 0 or a positive size", typeof(ArgumentOutOfRangeException));
|
||||
Debug2.Validate(modeChanges.sizeLogicalPxl.Width == 0 && modeChanges.sizeLogicalPxl.Height == 0 || modeChanges.sizeLogicalPxl.Width > 0 && modeChanges.sizeLogicalPxl.Height > 0, typeof(ArgumentException), "Must specify logical 0 x 0 or a positive size", typeof(ArgumentOutOfRangeException));
|
||||
Debug2.Validate(modeChanges.nRefreshRate >= 0 && modeChanges.nRefreshRate < 1000, typeof(ArgumentException), "Must have valid refresh rate");
|
||||
DisplayMode modeCurrent = this.m_modeCurrent;
|
||||
this.m_modeCurrent.ChangeFrom(modeChanges, nValid);
|
||||
@@ -190,9 +190,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Size size = new Size(modeDesired.sizePhysicalPxl.Width - modeValid.sizePhysicalPxl.Width, modeDesired.sizePhysicalPxl.Height - modeValid.sizePhysicalPxl.Height);
|
||||
if (modeValid.sizePhysicalPxl.Width < 640 && modeValid.sizePhysicalPxl.Height < 480 || size.Width >= 0 && size.Height >= 0)
|
||||
{
|
||||
float flValue1 = Math.Abs((float)size.Width / (float)modeValid.sizePhysicalPxl.Width);
|
||||
float flValue2 = Math.Abs((float)size.Height / (float)modeValid.sizePhysicalPxl.Height);
|
||||
int num2 = 2000 - (int)(1000.0 * (double)Math2.Clamp(flValue1, 0.0f, 1f) + 1000.0 * (double)Math2.Clamp(flValue2, 0.0f, 1f));
|
||||
float flValue1 = Math.Abs(size.Width / (float)modeValid.sizePhysicalPxl.Width);
|
||||
float flValue2 = Math.Abs(size.Height / (float)modeValid.sizePhysicalPxl.Height);
|
||||
int num2 = 2000 - (int)(1000.0 * Math2.Clamp(flValue1, 0.0f, 1f) + 1000.0 * Math2.Clamp(flValue2, 0.0f, 1f));
|
||||
if (num2 < 0)
|
||||
num2 = 0;
|
||||
num1 += num2;
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (fInDispose && this.m_remoteManager != null)
|
||||
this.m_remoteManager.Dispose();
|
||||
this.m_remoteManager = (RemoteDesktopManager)null;
|
||||
this.m_remoteManager = null;
|
||||
base.Dispose(fInDispose);
|
||||
}
|
||||
|
||||
public IDisplay PrimaryDisplay => (IDisplay)this.m_info.primaryDisplay;
|
||||
public IDisplay PrimaryDisplay => m_info.primaryDisplay;
|
||||
|
||||
public DisplayMode[] ExtraModes
|
||||
{
|
||||
@@ -75,11 +75,11 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
internal RemoteDesktopManager RemoteStub => this.m_remoteManager;
|
||||
|
||||
public IDisplay DisplayFromDeviceName(string stDeviceName) => (IDisplay)this.DisplayFromName(stDeviceName);
|
||||
public IDisplay DisplayFromDeviceName(string stDeviceName) => this.DisplayFromName(stDeviceName);
|
||||
|
||||
private Display DisplayFromName(string stDeviceName)
|
||||
{
|
||||
Display display1 = (Display)null;
|
||||
Display display1 = null;
|
||||
if (!string.IsNullOrEmpty(stDeviceName))
|
||||
{
|
||||
foreach (Display display2 in this.m_info.displays)
|
||||
@@ -101,17 +101,17 @@ namespace Microsoft.Iris.Render.Internal
|
||||
if ((int)idDisplay == (int)display.UniqueId)
|
||||
return display;
|
||||
}
|
||||
return (Display)null;
|
||||
return null;
|
||||
}
|
||||
|
||||
RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteManager.RenderHandle;
|
||||
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteManager = (RemoteDesktopManager)null;
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteManager = null;
|
||||
|
||||
void IDesktopManagerCallback.OnBeginEnumMonitorInfo(RENDERHANDLE target)
|
||||
{
|
||||
this.m_infoRebuilding = new DisplayManager.DisplayInfo();
|
||||
this.m_dispRebuildLastAdded = (Display)null;
|
||||
this.m_dispRebuildLastAdded = null;
|
||||
this.m_alRebuildSupportedModes = new ArrayList();
|
||||
this.m_alRebuildAllModes = new ArrayList();
|
||||
}
|
||||
@@ -124,13 +124,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_infoRebuilding.primaryDisplay = display;
|
||||
}
|
||||
this.m_info = this.m_infoRebuilding;
|
||||
this.m_infoRebuilding = (DisplayManager.DisplayInfo)null;
|
||||
this.m_dispRebuildLastAdded = (Display)null;
|
||||
this.m_alRebuildSupportedModes = (ArrayList)null;
|
||||
this.m_alRebuildAllModes = (ArrayList)null;
|
||||
this.m_infoRebuilding = null;
|
||||
this.m_dispRebuildLastAdded = null;
|
||||
this.m_alRebuildSupportedModes = null;
|
||||
this.m_alRebuildAllModes = null;
|
||||
if (this.DisplayChange == null || this.m_fPendingChangeNotification)
|
||||
return;
|
||||
this.m_session.DeferredInvoke((Delegate)new DeferredHandler(this.DeliverDisplayChangeNotification), (object)null, DeferredInvokePriority.Normal);
|
||||
this.m_session.DeferredInvoke(new DeferredHandler(this.DeliverDisplayChangeNotification), null, DeferredInvokePriority.Normal);
|
||||
this.m_fPendingChangeNotification = true;
|
||||
}
|
||||
|
||||
@@ -139,12 +139,12 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Message* pmsgRaw)
|
||||
{
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)pmsgRaw, ref DisplayManager.s_ByteOrder_MonitorInfoCallbackMsg, typeof(DisplayManager.MonitorInfoCallbackMsg), 0, 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)pmsgRaw, ref s_ByteOrder_MonitorInfoCallbackMsg, typeof(DisplayManager.MonitorInfoCallbackMsg), 0, 0);
|
||||
Display display = this.ConvertMonitorInfo((DisplayManager.MonitorInfoCallbackMsg*)pmsgRaw);
|
||||
this.m_dispRebuildLastAdded = display;
|
||||
this.m_alRebuildSupportedModes.Clear();
|
||||
this.m_alRebuildAllModes.Clear();
|
||||
this.m_infoRebuilding.displays.Add((object)display);
|
||||
this.m_infoRebuilding.displays.Add(display);
|
||||
}
|
||||
|
||||
void IDesktopManagerCallback.OnBeginDisplayModes(RENDERHANDLE target)
|
||||
@@ -164,9 +164,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
displayMode.fInterlaced = rmodeAdd.Interlaced;
|
||||
displayMode.fTvMode = false;
|
||||
if (fSupported)
|
||||
this.m_alRebuildSupportedModes.Add((object)displayMode);
|
||||
this.m_alRebuildSupportedModes.Add(displayMode);
|
||||
else
|
||||
this.m_alRebuildAllModes.Add((object)displayMode);
|
||||
this.m_alRebuildAllModes.Add(displayMode);
|
||||
}
|
||||
|
||||
void IDesktopManagerCallback.OnEndDisplayModes(RENDERHANDLE target)
|
||||
@@ -191,13 +191,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_fPendingChangeNotification = false;
|
||||
if (this.DisplayChange == null)
|
||||
return;
|
||||
this.DisplayChange((object)this, EventArgs.Empty);
|
||||
this.DisplayChange(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private unsafe Display ConvertMonitorInfo(DisplayManager.MonitorInfoCallbackMsg* pmsg)
|
||||
{
|
||||
string stringUni1 = Marshal.PtrToStringUni(new IntPtr((void*)&pmsg->pad_szDevice1));
|
||||
Display display = (Display)null;
|
||||
string stringUni1 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szDevice1));
|
||||
Display display = null;
|
||||
if (this.m_info != null)
|
||||
display = this.DisplayFromName(stringUni1);
|
||||
if (display == null)
|
||||
@@ -215,7 +215,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
modeDesktop.nRefreshRate = pmsg->nRefreshRate;
|
||||
modeDesktop.fInterlaced = pmsg->fInterlaced != 0U;
|
||||
modeDesktop.fTvMode = false;
|
||||
string stringUni2 = Marshal.PtrToStringUni(new IntPtr((void*)&pmsg->pad_szMonitorPnP1));
|
||||
string stringUni2 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szMonitorPnP1));
|
||||
display.UpdateMonitorInfo(rcMonitor, rcWork, fPrimary, nTvFormat, stringUni2, modeDesktop);
|
||||
return display;
|
||||
}
|
||||
@@ -227,9 +227,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer();
|
||||
arSupportedModes = (DisplayMode[])this.m_alRebuildSupportedModes.ToArray(typeof(DisplayMode));
|
||||
Array.Sort<DisplayMode>(arSupportedModes, (IComparer<DisplayMode>)renderModeComparer);
|
||||
Array.Sort<DisplayMode>(arSupportedModes, renderModeComparer);
|
||||
arAllModes = (DisplayMode[])this.m_alRebuildAllModes.ToArray(typeof(DisplayMode));
|
||||
Array.Sort<DisplayMode>(arAllModes, (IComparer<DisplayMode>)renderModeComparer);
|
||||
Array.Sort<DisplayMode>(arAllModes, renderModeComparer);
|
||||
Vector<DisplayMode> vector = new Vector<DisplayMode>();
|
||||
int length = this.m_arExtraModes.Length;
|
||||
List<int>[] intListArray = new List<int>[length];
|
||||
@@ -238,7 +238,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
for (int index1 = 0; index1 < this.m_alRebuildAllModes.Count; ++index1)
|
||||
{
|
||||
DisplayMode alRebuildAllMode = (DisplayMode)this.m_alRebuildAllModes[index1];
|
||||
if (Array.BinarySearch<DisplayMode>(arSupportedModes, alRebuildAllMode, (IComparer<DisplayMode>)renderModeComparer) < 0)
|
||||
if (Array.BinarySearch<DisplayMode>(arSupportedModes, alRebuildAllMode, renderModeComparer) < 0)
|
||||
{
|
||||
for (int index2 = 0; index2 < this.m_arExtraModes.Length; ++index2)
|
||||
{
|
||||
@@ -246,7 +246,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
if (DisplayMode.CompareRenderModes(alRebuildAllMode, arExtraMode) == 0)
|
||||
{
|
||||
vector.Add(alRebuildAllMode);
|
||||
intListArray[index2] = (List<int>)null;
|
||||
intListArray[index2] = null;
|
||||
}
|
||||
else if (DisplayMode.CompareSimilarModes(alRebuildAllMode, arExtraMode) == 0)
|
||||
intListArray[index2]?.Add(index1);
|
||||
@@ -262,7 +262,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
}
|
||||
}
|
||||
arExtraModes = vector.ToArray();
|
||||
Array.Sort<DisplayMode>(arExtraModes, (IComparer<DisplayMode>)renderModeComparer);
|
||||
Array.Sort<DisplayMode>(arExtraModes, renderModeComparer);
|
||||
}
|
||||
|
||||
private class DisplayInfo
|
||||
|
||||
@@ -38,6 +38,6 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
internal static uint ToUInt32(EventCookie handle) => handle.m_value;
|
||||
|
||||
public static EventCookie ReserveSlot() => EventCookie.FromUInt32(KeyAllocator.ReserveSlot());
|
||||
public static EventCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace Microsoft.Iris.Render.Internal
|
||||
public HwndHostWindow(RenderWindow winParent)
|
||||
{
|
||||
ProtocolSplashDesktopNt ntDesktopProtocol = winParent.Session.NtDesktopProtocol;
|
||||
this.m_remoteWindow = ntDesktopProtocol.BuildRemoteHwndHostWindow((IRenderHandleOwner)this, winParent.RemoteStub, ntDesktopProtocol.LocalHwndHostWindowCallbackHandle);
|
||||
this.m_clrBackground = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue);
|
||||
this.m_remoteWindow = ntDesktopProtocol.BuildRemoteHwndHostWindow(this, winParent.RemoteStub, ntDesktopProtocol.LocalHwndHostWindowCallbackHandle);
|
||||
this.m_clrBackground = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool fInDispose)
|
||||
@@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
if (fInDispose && this.m_remoteWindow != null)
|
||||
{
|
||||
this.m_remoteWindow.Dispose();
|
||||
this.m_remoteWindow = (RemoteHwndHostWindow)null;
|
||||
this.m_remoteWindow = null;
|
||||
}
|
||||
base.Dispose(fInDispose);
|
||||
}
|
||||
@@ -106,11 +106,11 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_hwnd = hWnd;
|
||||
if (this.m_eventHandleChanged == null)
|
||||
return;
|
||||
this.m_eventHandleChanged((object)this, EventArgs.Empty);
|
||||
this.m_eventHandleChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle;
|
||||
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = (RemoteHwndHostWindow)null;
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (fInDispose && this.m_remoteInputRouter != null)
|
||||
this.m_remoteInputRouter.Dispose();
|
||||
this.m_remoteInputRouter = (RemoteInputRouter)null;
|
||||
this.m_remoteInputRouter = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -54,38 +54,38 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteInputRouter.RenderHandle;
|
||||
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteInputRouter = (RemoteInputRouter)null;
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteInputRouter = null;
|
||||
|
||||
unsafe void IInputCallback.OnInput(RENDERHANDLE target, Message* inputInfoPtr)
|
||||
{
|
||||
InputSystem.RemoteCallbackMessage* remoteCallbackMessagePtr = (InputSystem.RemoteCallbackMessage*)inputInfoPtr;
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_RemoteCallbackMessage, typeof(InputSystem.RemoteCallbackMessage), 0, 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_RemoteCallbackMessage, typeof(InputSystem.RemoteCallbackMessage), 0, 0);
|
||||
switch (remoteCallbackMessagePtr->ownerMessage)
|
||||
{
|
||||
case 1:
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_KeyboardCommandMessage, typeof(InputSystem.KeyboardCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_KeyboardCommandMessage, typeof(InputSystem.KeyboardCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
this.HandleKeyboardInput((InputSystem.KeyboardCommandMessage*)remoteCallbackMessagePtr);
|
||||
break;
|
||||
case 2:
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_HIDCommandMessage, typeof(InputSystem.HIDCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_HIDCommandMessage, typeof(InputSystem.HIDCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
this.HandleHIDCommandInput((InputSystem.HIDCommandMessage*)remoteCallbackMessagePtr);
|
||||
break;
|
||||
case 3:
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_AppCommandMessage, typeof(InputSystem.AppCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_AppCommandMessage, typeof(InputSystem.AppCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
this.HandleAppCommandInput((InputSystem.AppCommandMessage*)remoteCallbackMessagePtr);
|
||||
break;
|
||||
case 4:
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_WindowInputCallbackMessage, typeof(InputSystem.WindowInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_WindowInputCallbackMessage, typeof(InputSystem.WindowInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
this.HandleWindowInput((InputSystem.WindowInputCallbackMessage*)remoteCallbackMessagePtr);
|
||||
break;
|
||||
case 5:
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_DragInputCallbackMessage, typeof(InputSystem.DragInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_DragInputCallbackMessage, typeof(InputSystem.DragInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0);
|
||||
this.HandleDragInput((InputSystem.DragInputCallbackMessage*)remoteCallbackMessagePtr);
|
||||
break;
|
||||
default:
|
||||
@@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
public void UnregisterRawInputCallbacks()
|
||||
{
|
||||
this.m_inputHandlers = (IRawInputCallbacks)null;
|
||||
this.m_inputHandlers = null;
|
||||
this.m_maskInputHandlers = InputHandlerFlags.None;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (!this.IsRegisteredForInputType(InputHandlerFlags.Mouse))
|
||||
return;
|
||||
RawMouseData args = new RawMouseData(this.m_session.TryGetHandleOwner(msg->subjectValue), this.m_session.TryGetHandleOwner(msg->naturalValue), msg->positionXOffset, msg->positionYOffset, msg->naturalXOffset, msg->naturalYOffset, msg->physicalXOffset, msg->physicalYOffset, msg->screenXOffset, msg->screenYOffset, (MouseButtons)msg->buttonFlag, (int)msg->wheelDelta);
|
||||
RawMouseData args = new RawMouseData(this.m_session.TryGetHandleOwner(msg->subjectValue), this.m_session.TryGetHandleOwner(msg->naturalValue), msg->positionXOffset, msg->positionYOffset, msg->naturalXOffset, msg->naturalYOffset, msg->physicalXOffset, msg->physicalYOffset, msg->screenXOffset, msg->screenYOffset, (MouseButtons)msg->buttonFlag, msg->wheelDelta);
|
||||
this.m_inputHandlers.HandleRawMouseInput(msg->messageValue, (InputModifiers)msg->modifiersValue, ref args);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
private static int s_idxKeyGen;
|
||||
|
||||
internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref KeyAllocator.s_idxKeyGen);
|
||||
internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref s_idxKeyGen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
internal class Math2
|
||||
{
|
||||
public static int FindPowerOf2(int nValue) => Math2.FindPowerOf2(nValue, 1);
|
||||
public static int FindPowerOf2(int nValue) => FindPowerOf2(nValue, 1);
|
||||
|
||||
public static int FindPowerOf2(int nValue, int nStart)
|
||||
{
|
||||
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
return num;
|
||||
}
|
||||
|
||||
public static int RoundUp(float flValue) => (int)((double)flValue + 0.5);
|
||||
public static int RoundUp(float flValue) => (int)(flValue + 0.5);
|
||||
|
||||
public static int Clamp(int nValue, int nMin, int nMax)
|
||||
{
|
||||
@@ -29,15 +29,15 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
public static float Clamp(float flValue, float flMin, float flMax)
|
||||
{
|
||||
if ((double)flValue < (double)flMin)
|
||||
if (flValue < (double)flMin)
|
||||
return flMin;
|
||||
return (double)flValue > (double)flMax ? flMax : flValue;
|
||||
return flValue > (double)flMax ? flMax : flValue;
|
||||
}
|
||||
|
||||
public static bool WithinEpsilon(float flValue1, float flValue2)
|
||||
{
|
||||
float num = flValue1 - flValue2;
|
||||
return -9.99999974737875E-06 <= (double)num && (double)num <= 9.99999974737875E-06;
|
||||
return -9.99999974737875E-06 <= num && num <= 9.99999974737875E-06;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@ namespace Microsoft.Iris.Render.Internal
|
||||
private GCHandle m_hndOwner;
|
||||
|
||||
public ObjectTracker(RenderSession session, object objOwner)
|
||||
: this(session, ObjectTracker.ThreadMode.Private, objOwner)
|
||||
: this(session, ThreadMode.Private, objOwner)
|
||||
{
|
||||
}
|
||||
|
||||
public ObjectTracker(RenderSession session, ObjectTracker.ThreadMode nMode, object objOwner)
|
||||
{
|
||||
Debug2.Validate(session != null || nMode != ObjectTracker.ThreadMode.Private, typeof(ArgumentException), "must specify a session for private trackers");
|
||||
Debug2.Validate(objOwner != null || nMode == ObjectTracker.ThreadMode.Master, typeof(ArgumentException), "must specify an owner (except mater tracker)");
|
||||
if (nMode == ObjectTracker.ThreadMode.Private)
|
||||
Debug2.Validate(session != null || nMode != ThreadMode.Private, typeof(ArgumentException), "must specify a session for private trackers");
|
||||
Debug2.Validate(objOwner != null || nMode == ThreadMode.Master, typeof(ArgumentException), "must specify an owner (except mater tracker)");
|
||||
if (nMode == ThreadMode.Private)
|
||||
ObjectTrackerGroup.RegisterChildTracker(this);
|
||||
this.m_nMode = nMode;
|
||||
this.m_idxNextIdentity = 1;
|
||||
@@ -47,7 +47,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
get
|
||||
{
|
||||
object obj = (object)null;
|
||||
object obj = null;
|
||||
if (this.m_hndOwner.IsAllocated)
|
||||
obj = this.m_hndOwner.Target;
|
||||
return obj;
|
||||
@@ -60,12 +60,12 @@ namespace Microsoft.Iris.Render.Internal
|
||||
lock (this)
|
||||
{
|
||||
num = this.m_idxNextIdentity++;
|
||||
this.AddObject((object)num, o);
|
||||
this.AddObject(num, o);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public void RemoveObject(int nIdentity) => this.RemoveKey((object)nIdentity);
|
||||
public void RemoveObject(int nIdentity) => this.RemoveKey(nIdentity);
|
||||
|
||||
public object Find(int nIdentity) => this.Find((object)nIdentity);
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
internal static class ObjectTrackerGroup
|
||||
{
|
||||
private static ObjectTracker s_objectTrackerGroup = new ObjectTracker((RenderSession)null, ObjectTracker.ThreadMode.Master, (object)null);
|
||||
private static ObjectTracker s_objectTrackerGroup = new ObjectTracker(null, ObjectTracker.ThreadMode.Master, null);
|
||||
|
||||
internal static void RegisterChildTracker(ObjectTracker trackerToAdd) => ObjectTrackerGroup.s_objectTrackerGroup.AddObject((object)trackerToAdd);
|
||||
internal static void RegisterChildTracker(ObjectTracker trackerToAdd) => s_objectTrackerGroup.AddObject(trackerToAdd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_currentRequestId = 0U;
|
||||
this.m_graphicsCapsList = new Vector<GraphicsCaps>();
|
||||
this.m_soundCapsList = new Vector<SoundCaps>();
|
||||
this.m_remoteObject = ownerSession.RenderingProtocol.BuildRemoteRenderCaps((IRenderHandleOwner)this, ownerSession.RenderingProtocol.LocalRenderCapsCallbackHandle);
|
||||
this.m_remoteObject = ownerSession.RenderingProtocol.BuildRemoteRenderCaps(this, ownerSession.RenderingProtocol.LocalRenderCapsCallbackHandle);
|
||||
}
|
||||
|
||||
internal bool HasValidCaps => this.m_hasValidCaps;
|
||||
@@ -51,12 +51,12 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (this.CapsAvailable == null)
|
||||
return;
|
||||
this.CapsAvailable((object)this, EventArgs.Empty);
|
||||
this.CapsAvailable(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle;
|
||||
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = (RemoteRenderCaps)null;
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null;
|
||||
|
||||
void IRenderCapsCallback.OnBeginCapsCheck(RENDERHANDLE target, uint cookie)
|
||||
{
|
||||
|
||||
@@ -31,16 +31,16 @@ namespace Microsoft.Iris.Render.Internal
|
||||
private ContextID m_localContextId;
|
||||
private ContextID m_engineContextId;
|
||||
|
||||
static RenderEngine() => RenderEngine.s_contexts = new BitArray((int)RenderEngine.s_maxContextId + 1);
|
||||
static RenderEngine() => s_contexts = new BitArray((int)s_maxContextId + 1);
|
||||
|
||||
internal RenderEngine(IrisEngineInfo engineInfo, IRenderHost renderHost)
|
||||
{
|
||||
Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo));
|
||||
Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost));
|
||||
this.m_engineInfo = engineInfo;
|
||||
this.m_engineContextId = RenderEngine.AllocateContextId();
|
||||
this.m_localContextId = RenderEngine.AllocateContextId();
|
||||
this.m_primaryToken = new RenderToken((EngineInfo)engineInfo, this.m_localContextId, this.m_engineContextId, RENDERGROUP.NULL);
|
||||
this.m_engineContextId = AllocateContextId();
|
||||
this.m_localContextId = AllocateContextId();
|
||||
this.m_primaryToken = new RenderToken(engineInfo, this.m_localContextId, this.m_engineContextId, RENDERGROUP.NULL);
|
||||
this.m_messagingSession = new MessagingSession(renderHost, this.m_primaryToken);
|
||||
this.m_messagingSession.Connect();
|
||||
this.m_renderSession = new RenderSession(this);
|
||||
@@ -76,14 +76,14 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_messagingSession.Disconnect();
|
||||
this.m_messagingSession.Dispose();
|
||||
}
|
||||
RenderEngine.FreeContextId(this.m_localContextId);
|
||||
RenderEngine.FreeContextId(this.m_engineContextId);
|
||||
FreeContextId(this.m_localContextId);
|
||||
FreeContextId(this.m_engineContextId);
|
||||
}
|
||||
this.m_soundDevice = (SoundDevice)null;
|
||||
this.m_displayManager = (DisplayManager)null;
|
||||
this.m_renderWindow = (RenderWindow)null;
|
||||
this.m_renderSession = (RenderSession)null;
|
||||
this.m_messagingSession = (MessagingSession)null;
|
||||
this.m_soundDevice = null;
|
||||
this.m_displayManager = null;
|
||||
this.m_renderWindow = null;
|
||||
this.m_renderSession = null;
|
||||
this.m_messagingSession = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -112,15 +112,15 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
private MessagingSession MessagingSession => this.m_messagingSession;
|
||||
|
||||
IRenderSession IRenderEngine.Session => (IRenderSession)this.m_renderSession;
|
||||
IRenderSession IRenderEngine.Session => m_renderSession;
|
||||
|
||||
internal RenderSession Session => this.m_renderSession;
|
||||
|
||||
IRenderWindow IRenderEngine.Window => (IRenderWindow)this.m_renderWindow;
|
||||
IRenderWindow IRenderEngine.Window => m_renderWindow;
|
||||
|
||||
internal RenderWindow Window => this.m_renderWindow;
|
||||
|
||||
IDisplayManager IRenderEngine.DisplayManager => (IDisplayManager)this.m_displayManager;
|
||||
IDisplayManager IRenderEngine.DisplayManager => m_displayManager;
|
||||
|
||||
public DisplayManager DisplayManager => this.m_displayManager;
|
||||
|
||||
@@ -207,14 +207,14 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
private void OnRenderWindowCreated(object sender, EventArgs args)
|
||||
{
|
||||
SoundDevice soundDevice = (SoundDevice)null;
|
||||
SoundDevice soundDevice = null;
|
||||
switch (this.m_typeSound)
|
||||
{
|
||||
case SoundDeviceType.None:
|
||||
this.m_soundDevice = soundDevice;
|
||||
break;
|
||||
case SoundDeviceType.DirectSound8:
|
||||
soundDevice = (SoundDevice)new Ds8SoundDevice(this.m_renderSession, (IRenderWindow)this.m_renderWindow);
|
||||
soundDevice = new Ds8SoundDevice(this.m_renderSession, m_renderWindow);
|
||||
goto case SoundDeviceType.None;
|
||||
case SoundDeviceType.WaveAudio:
|
||||
case SoundDeviceType.XAudio:
|
||||
@@ -229,17 +229,17 @@ namespace Microsoft.Iris.Render.Internal
|
||||
internal static ContextID AllocateContextId()
|
||||
{
|
||||
uint num1 = 0;
|
||||
lock (RenderEngine.s_contexts)
|
||||
lock (s_contexts)
|
||||
{
|
||||
for (int index = 0; (long)index < (long)RenderEngine.s_maxContextId; ++index)
|
||||
for (int index = 0; index < s_maxContextId; ++index)
|
||||
{
|
||||
uint num2 = RenderEngine.s_contextIdSeed++;
|
||||
if (RenderEngine.s_contextIdSeed > RenderEngine.s_maxContextId)
|
||||
RenderEngine.s_contextIdSeed = 1U;
|
||||
if (!RenderEngine.s_contexts[(int)num2])
|
||||
uint num2 = s_contextIdSeed++;
|
||||
if (s_contextIdSeed > s_maxContextId)
|
||||
s_contextIdSeed = 1U;
|
||||
if (!s_contexts[(int)num2])
|
||||
{
|
||||
num1 = num2;
|
||||
RenderEngine.s_contexts[(int)num1] = true;
|
||||
s_contexts[(int)num1] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -251,9 +251,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
private static void FreeContextId(ContextID contextId)
|
||||
{
|
||||
uint uint32 = ContextID.ToUInt32(contextId);
|
||||
Debug2.Validate(RenderEngine.s_contexts[(int)uint32], typeof(InvalidOperationException), "ContextID is not in use");
|
||||
lock (RenderEngine.s_contexts)
|
||||
RenderEngine.s_contexts[(int)uint32] = false;
|
||||
Debug2.Validate(s_contexts[(int)uint32], typeof(InvalidOperationException), "ContextID is not in use");
|
||||
lock (s_contexts)
|
||||
s_contexts[(int)uint32] = false;
|
||||
}
|
||||
|
||||
protected override void Invariant()
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_protocolRenderingLocal = ProtocolSplashRendering.Bind(this.Messaging.WindowingPort);
|
||||
this.m_renderEngine = renderEngine;
|
||||
this.m_visPropManager = new VisualPropertyManager();
|
||||
this.m_cacheManager = (ObjectCacheManager)null;
|
||||
this.m_cacheManager = null;
|
||||
}
|
||||
|
||||
internal void Initialize() => this.m_animationSystem = new AnimationSystem(this);
|
||||
@@ -55,9 +55,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
try
|
||||
{
|
||||
if (fInDispose && this.m_animationSystem != null)
|
||||
this.m_animationSystem.UnregisterUsage((object)this);
|
||||
this.m_animationSystem.UnregisterUsage(this);
|
||||
this.UnregisterOwningThread();
|
||||
this.m_animationSystem = (AnimationSystem)null;
|
||||
this.m_animationSystem = null;
|
||||
this.m_visPropManager.Dispose();
|
||||
}
|
||||
finally
|
||||
@@ -66,15 +66,15 @@ namespace Microsoft.Iris.Render.Internal
|
||||
}
|
||||
}
|
||||
|
||||
IGraphicsDevice IRenderSession.GraphicsDevice => (IGraphicsDevice)this.m_renderEngine.Window.GraphicsDevice;
|
||||
IGraphicsDevice IRenderSession.GraphicsDevice => m_renderEngine.Window.GraphicsDevice;
|
||||
|
||||
ISoundDevice IRenderSession.SoundDevice => (ISoundDevice)this.m_renderEngine.SoundDevice;
|
||||
ISoundDevice IRenderSession.SoundDevice => m_renderEngine.SoundDevice;
|
||||
|
||||
internal SoundDevice SoundDevice => this.m_renderEngine.SoundDevice;
|
||||
|
||||
IAnimationSystem IRenderSession.AnimationSystem => (IAnimationSystem)this.m_animationSystem;
|
||||
IAnimationSystem IRenderSession.AnimationSystem => m_animationSystem;
|
||||
|
||||
IInputSystem IRenderSession.InputSystem => (IInputSystem)this.m_renderEngine.InputSystem;
|
||||
IInputSystem IRenderSession.InputSystem => m_renderEngine.InputSystem;
|
||||
|
||||
internal MessagingSession Messaging => this.m_owningSession;
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
EffectTemplate effectTemplate = this.m_renderEngine.Window.GraphicsDevice.CreateEffectTemplate(stName);
|
||||
effectTemplate.RegisterUsage(objUser);
|
||||
return (IEffectTemplate)effectTemplate;
|
||||
return effectTemplate;
|
||||
}
|
||||
|
||||
public IVideoStream CreateVideoStream(object objUser)
|
||||
@@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
VideoStream videoStream = new VideoStream(this, this.m_renderEngine.Window.GraphicsDevice);
|
||||
videoStream.RegisterUsage(objUser);
|
||||
return (IVideoStream)videoStream;
|
||||
return videoStream;
|
||||
}
|
||||
|
||||
public IVisualContainer CreateVisualContainer(
|
||||
@@ -121,7 +121,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
object objOwnerData)
|
||||
{
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
VisualContainer visualContainer = (VisualContainer)null;
|
||||
VisualContainer visualContainer = null;
|
||||
if (this.m_cacheContainer != null)
|
||||
{
|
||||
visualContainer = (VisualContainer)this.m_cacheContainer.Remove(objUser);
|
||||
@@ -135,7 +135,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
visualContainer.RegisterUsage(objUser);
|
||||
visualContainer.Cache = this.m_cacheContainer;
|
||||
}
|
||||
return (IVisualContainer)visualContainer;
|
||||
return visualContainer;
|
||||
}
|
||||
|
||||
public ICamera CreateCamera(object objUser)
|
||||
@@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
Camera camera = new Camera(this);
|
||||
camera.RegisterUsage(objUser);
|
||||
return (ICamera)camera;
|
||||
return camera;
|
||||
}
|
||||
|
||||
public IGradient CreateGradient(object objUser)
|
||||
@@ -151,13 +151,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
Gradient gradient = new Gradient(this, this.m_renderEngine.Window.GraphicsDevice.RemoteDevice);
|
||||
gradient.RegisterUsage(objUser);
|
||||
return (IGradient)gradient;
|
||||
return gradient;
|
||||
}
|
||||
|
||||
public ISprite CreateSprite(object objUser, object objOwnerData)
|
||||
{
|
||||
Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser));
|
||||
Sprite sprite = (Sprite)null;
|
||||
Sprite sprite = null;
|
||||
if (this.m_cacheSprite != null)
|
||||
{
|
||||
sprite = (Sprite)this.m_cacheSprite.Remove(objUser);
|
||||
@@ -170,7 +170,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
sprite.RegisterUsage(objUser);
|
||||
sprite.Cache = this.m_cacheSprite;
|
||||
}
|
||||
return (ISprite)sprite;
|
||||
return sprite;
|
||||
}
|
||||
|
||||
public IImage CreateImage(
|
||||
@@ -182,7 +182,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Debug2.Validate(handler != null, typeof(InvalidOperationException), "Invalid handler");
|
||||
Image image = this.m_renderEngine.Window.GraphicsDevice.CreateImage(identifier, handler);
|
||||
image.RegisterUsage(objUser);
|
||||
return (IImage)image;
|
||||
return image;
|
||||
}
|
||||
|
||||
internal GraphicsCaps GetGraphicsCaps(GraphicsDeviceType type)
|
||||
@@ -197,7 +197,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
private void RegisterOwningThread() => this.m_owningSession = MessagingSession.Current;
|
||||
|
||||
private void UnregisterOwningThread() => this.m_owningSession = (MessagingSession)null;
|
||||
private void UnregisterOwningThread() => this.m_owningSession = null;
|
||||
|
||||
internal void AssertOwningThread()
|
||||
{
|
||||
@@ -240,13 +240,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
this.m_cacheManager.UnregisterCache(this.m_cacheSprite);
|
||||
this.m_cacheSprite.Dispose();
|
||||
this.m_cacheSprite = (Microsoft.Iris.Render.Common.ObjectCache)null;
|
||||
this.m_cacheSprite = null;
|
||||
}
|
||||
if (this.m_cacheContainer == null)
|
||||
return;
|
||||
this.m_cacheManager.UnregisterCache(this.m_cacheContainer);
|
||||
this.m_cacheContainer.Dispose();
|
||||
this.m_cacheContainer = (Microsoft.Iris.Render.Common.ObjectCache)null;
|
||||
this.m_cacheContainer = null;
|
||||
}
|
||||
|
||||
internal RENDERHANDLE AllocateRenderHandle(IRenderHandleOwner owner) => this.RenderingPort.AllocHandle(owner);
|
||||
@@ -260,7 +260,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
bool fEnumDisplayModes)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.NtDesktopProtocol.BuildRemoteDesktopManager((IRenderHandleOwner)owner, this.NtDesktopProtocol.LocalDesktopManagerCallbackHandle, fEnumDisplayModes);
|
||||
return this.NtDesktopProtocol.BuildRemoteDesktopManager(owner, this.NtDesktopProtocol.LocalDesktopManagerCallbackHandle, fEnumDisplayModes);
|
||||
}
|
||||
|
||||
internal RemoteFormWindow BuildRemoteFormWindow(
|
||||
@@ -268,7 +268,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
DisplayManager displayManager)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.NtDesktopProtocol.BuildRemoteFormWindow((IRenderHandleOwner)window, displayManager.RemoteStub, this.DesktopProtocol.LocalFormWindowCallbackHandle);
|
||||
return this.NtDesktopProtocol.BuildRemoteFormWindow(window, displayManager.RemoteStub, this.DesktopProtocol.LocalFormWindowCallbackHandle);
|
||||
}
|
||||
|
||||
internal RemoteInputRouter BuildRemoteInputRouter(
|
||||
@@ -276,20 +276,20 @@ namespace Microsoft.Iris.Render.Internal
|
||||
RenderWindow window)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
RemoteInputRouter remoteInputRouter = this.DesktopProtocol.BuildRemoteInputRouter((IRenderHandleOwner)inputSystem, this.DesktopProtocol.LocalInputCallbackHandle);
|
||||
RemoteInputRouter remoteInputRouter = this.DesktopProtocol.BuildRemoteInputRouter(inputSystem, this.DesktopProtocol.LocalInputCallbackHandle);
|
||||
remoteInputRouter?.SendRegisterWithInputSource(this.WindowingPort.DefaultGroupID, ((IRenderHandleOwner)window).RenderHandle);
|
||||
return remoteInputRouter;
|
||||
}
|
||||
|
||||
internal RemoteNtDevice BuildRemoteNtDevice(NtGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteNtDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
internal RemoteNtDevice BuildRemoteNtDevice(NtGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteNtDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
|
||||
internal RemoteGdiDevice BuildRemoteGdiDevice(GdiGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteGdiDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
internal RemoteGdiDevice BuildRemoteGdiDevice(GdiGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteGdiDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
|
||||
internal RemoteNullDevice BuildRemoteNullDevice(
|
||||
NullGraphicsDevice device,
|
||||
bool fUseSplitWindowingPort)
|
||||
{
|
||||
return fUseSplitWindowingPort ? this.LocalRenderingProtocol.BuildRemoteNullDevice((IRenderHandleOwner)device, this.LocalRenderingProtocol.LocalDeviceCallbackHandle) : this.RenderingProtocol.BuildRemoteNullDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
return fUseSplitWindowingPort ? this.LocalRenderingProtocol.BuildRemoteNullDevice(device, this.LocalRenderingProtocol.LocalDeviceCallbackHandle) : this.RenderingProtocol.BuildRemoteNullDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle);
|
||||
}
|
||||
|
||||
internal unsafe DataBuffer BuildDataBuffer(IntPtr pData, uint cbSize) => new DataBuffer(this.RenderingPort, pData.ToPointer(), cbSize);
|
||||
@@ -301,29 +301,29 @@ namespace Microsoft.Iris.Render.Internal
|
||||
Dx9GraphicsDevice dx9Device,
|
||||
DataBuffer dataBuffer)
|
||||
{
|
||||
return this.RenderingProtocol.BuildRemoteDx9EffectResource((IRenderHandleOwner)effectResource, dx9Device.RemoteDevice, dataBuffer.RemoteStub);
|
||||
return this.RenderingProtocol.BuildRemoteDx9EffectResource(effectResource, dx9Device.RemoteDevice, dataBuffer.RemoteStub);
|
||||
}
|
||||
|
||||
internal RemoteDx9Effect BuildRemoteDx9Effect(Dx9Effect effect) => RemoteDx9Effect.Create(this.RenderingProtocol, (IRenderHandleOwner)effect);
|
||||
internal RemoteDx9Effect BuildRemoteDx9Effect(Dx9Effect effect) => RemoteDx9Effect.Create(this.RenderingProtocol, effect);
|
||||
|
||||
internal RemoteGdiEffect BuildRemoteGdiEffect(GdiEffect effect) => RemoteGdiEffect.Create(this.NtRenderingProtocol, (IRenderHandleOwner)effect);
|
||||
internal RemoteGdiEffect BuildRemoteGdiEffect(GdiEffect effect) => RemoteGdiEffect.Create(this.NtRenderingProtocol, effect);
|
||||
|
||||
internal RemoteCamera BuildRemoteCamera(Camera camera) => this.RenderingProtocol.BuildRemoteCamera((IRenderHandleOwner)camera);
|
||||
internal RemoteCamera BuildRemoteCamera(Camera camera) => this.RenderingProtocol.BuildRemoteCamera(camera);
|
||||
|
||||
internal RemoteVisualContainer BuildRemoteVisualContainer(Visual visual) => this.RenderingProtocol.BuildRemoteVisualContainer((IRenderHandleOwner)visual);
|
||||
internal RemoteVisualContainer BuildRemoteVisualContainer(Visual visual) => this.RenderingProtocol.BuildRemoteVisualContainer(visual);
|
||||
|
||||
internal RemoteSprite BuildRemoteSprite(Sprite sprite, RenderWindow window)
|
||||
{
|
||||
switch (window.GraphicsDeviceType)
|
||||
{
|
||||
case GraphicsDeviceType.Gdi:
|
||||
return (RemoteSprite)this.NtRenderingProtocol.BuildRemoteGdiSprite((IRenderHandleOwner)sprite);
|
||||
return this.NtRenderingProtocol.BuildRemoteGdiSprite(sprite);
|
||||
case GraphicsDeviceType.Direct3D9:
|
||||
case GraphicsDeviceType.XeDirectX9:
|
||||
return (RemoteSprite)this.RenderingProtocol.BuildRemoteDx9Sprite((IRenderHandleOwner)sprite);
|
||||
return this.RenderingProtocol.BuildRemoteDx9Sprite(sprite);
|
||||
default:
|
||||
Debug2.Throw(false, "Unrecognized device type: {0}", (object)window.GraphicsDeviceType);
|
||||
return (RemoteSprite)null;
|
||||
Debug2.Throw(false, "Unrecognized device type: {0}", window.GraphicsDeviceType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
AnimationSystem owner)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.RenderingProtocol.BuildRemoteAnimationManager((IRenderHandleOwner)owner);
|
||||
return this.RenderingProtocol.BuildRemoteAnimationManager(owner);
|
||||
}
|
||||
|
||||
public RemoteAnimation BuildRemoteAnimation(
|
||||
@@ -343,7 +343,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
AnimationInputType animationType)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.RenderingProtocol.BuildRemoteAnimation((IRenderHandleOwner)owner, animationType, this.RenderingProtocol.LocalAnimationCallbackHandle);
|
||||
return this.RenderingProtocol.BuildRemoteAnimation(owner, animationType, this.RenderingProtocol.LocalAnimationCallbackHandle);
|
||||
}
|
||||
|
||||
public RemoteExternalAnimationInput BuildRemoteExternalAnimationInput(
|
||||
@@ -351,7 +351,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
uint uniqueId)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.RenderingProtocol.BuildRemoteExternalAnimationInput((IRenderHandleOwner)owner, uniqueId);
|
||||
return this.RenderingProtocol.BuildRemoteExternalAnimationInput(owner, uniqueId);
|
||||
}
|
||||
|
||||
public RemoteAnimationInputProvider BuildRemoteAnimationInputProvider(
|
||||
@@ -359,7 +359,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
uint externalAnimationInputId)
|
||||
{
|
||||
Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread");
|
||||
return this.RenderingProtocol.BuildRemoteAnimationInputProvider((IRenderHandleOwner)owner, externalAnimationInputId);
|
||||
return this.RenderingProtocol.BuildRemoteAnimationInputProvider(owner, externalAnimationInputId);
|
||||
}
|
||||
|
||||
protected override void Invariant()
|
||||
|
||||
@@ -113,10 +113,10 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_fSessionHasDisplay = true;
|
||||
this.m_fSessionLocked = false;
|
||||
this.m_szDefault = new Size(640, 480);
|
||||
this.m_clrOutlineAllColor = new ColorF((int)byte.MaxValue, 0, (int)byte.MaxValue, 0);
|
||||
this.m_clrOutlineMarkedColor = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, 0, 0);
|
||||
this.m_clrOutlineAllColor = new ColorF(byte.MaxValue, 0, byte.MaxValue, 0);
|
||||
this.m_clrOutlineMarkedColor = new ColorF(byte.MaxValue, byte.MaxValue, 0, 0);
|
||||
this.m_mapShutdownHooks = new SmartMap<RenderWindow.ShutdownHookInfo>();
|
||||
this.m_nextShutdownHookId = (ushort)1;
|
||||
this.m_nextShutdownHookId = 1;
|
||||
this.m_nMouseLockCount = 0;
|
||||
this.SetFullScreenExclusive(false);
|
||||
}
|
||||
@@ -128,16 +128,16 @@ namespace Microsoft.Iris.Render.Internal
|
||||
GraphicsDeviceType graphicsDeviceType,
|
||||
GraphicsRenderingQuality renderingQuality)
|
||||
{
|
||||
GraphicsDevice graphicsDevice = (GraphicsDevice)null;
|
||||
GraphicsDevice graphicsDevice = null;
|
||||
EngineApi.IFC(FormApi.SpGdiplusInit());
|
||||
this.m_graphicsDeviceType = graphicsDeviceType;
|
||||
switch (this.m_graphicsDeviceType)
|
||||
{
|
||||
case GraphicsDeviceType.Gdi:
|
||||
this.m_device = (GraphicsDevice)new GdiGraphicsDevice(session);
|
||||
this.m_device = new GdiGraphicsDevice(session);
|
||||
break;
|
||||
case GraphicsDeviceType.Direct3D9:
|
||||
this.m_device = (GraphicsDevice)new NtGraphicsDevice(session, renderingQuality);
|
||||
this.m_device = new NtGraphicsDevice(session, renderingQuality);
|
||||
break;
|
||||
}
|
||||
return graphicsDevice;
|
||||
@@ -146,8 +146,8 @@ namespace Microsoft.Iris.Render.Internal
|
||||
internal void Dispose()
|
||||
{
|
||||
this.Visible = false;
|
||||
this.m_remoteWindow.SendSetRoot((RemoteVisual)null);
|
||||
this.m_rootVisual.UnregisterUsage((object)this);
|
||||
this.m_remoteWindow.SendSetRoot(null);
|
||||
this.m_rootVisual.UnregisterUsage(this);
|
||||
this.StopRendering();
|
||||
}
|
||||
|
||||
@@ -156,19 +156,19 @@ namespace Microsoft.Iris.Render.Internal
|
||||
if (this.m_device != null)
|
||||
{
|
||||
this.m_device.Dispose();
|
||||
this.m_device = (GraphicsDevice)null;
|
||||
this.m_device = null;
|
||||
}
|
||||
if (this.m_remoteWindow != null)
|
||||
{
|
||||
this.m_remoteWindow.Dispose();
|
||||
this.m_remoteWindow = (RemoteFormWindow)null;
|
||||
this.m_remoteWindow = null;
|
||||
}
|
||||
EngineApi.IFC(FormApi.SpGdiplusUninit());
|
||||
}
|
||||
|
||||
RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle;
|
||||
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = (RemoteFormWindow)null;
|
||||
void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null;
|
||||
|
||||
internal RemoteFormWindow RemoteStub => this.m_remoteWindow;
|
||||
|
||||
@@ -312,13 +312,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
IDisplay IRenderWindow.CurrentDisplay
|
||||
{
|
||||
get => this.m_currentDisplay == null ? this.m_displayManager.PrimaryDisplay : (IDisplay)this.m_currentDisplay;
|
||||
get => this.m_currentDisplay == null ? this.m_displayManager.PrimaryDisplay : m_currentDisplay;
|
||||
set => this.SetCurrentDisplay(value);
|
||||
}
|
||||
|
||||
private void SetCurrentDisplay(IDisplay inputIDisplay)
|
||||
{
|
||||
Debug2.Validate(inputIDisplay is Display, (Type)null, "CurrentDisplay.set param MUST be a valid Display object");
|
||||
Debug2.Validate(inputIDisplay is Display, null, "CurrentDisplay.set param MUST be a valid Display object");
|
||||
Display display = this.m_displayManager.DisplayFromUniqueId((inputIDisplay as Display).UniqueId);
|
||||
if (display == null)
|
||||
return;
|
||||
@@ -380,9 +380,9 @@ namespace Microsoft.Iris.Render.Internal
|
||||
set => this.m_remoteWindow.INPROC_SendSetAppNotifyWindow(value);
|
||||
}
|
||||
|
||||
IVisualContainer IRenderWindow.VisualRoot => (IVisualContainer)this.m_rootVisual;
|
||||
IVisualContainer IRenderWindow.VisualRoot => m_rootVisual;
|
||||
|
||||
TreeNode ITreeOwner.Root => (TreeNode)this.m_rootVisual;
|
||||
TreeNode ITreeOwner.Root => m_rootVisual;
|
||||
|
||||
internal bool IsClosing => this.m_fClosing;
|
||||
|
||||
@@ -464,7 +464,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (this.WindowCreatedEvent == null)
|
||||
return;
|
||||
this.WindowCreatedEvent((object)this, EventArgs.Empty);
|
||||
this.WindowCreatedEvent(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void OnForwardWndMsg(uint msg, IntPtr wParam, IntPtr lParam)
|
||||
@@ -617,11 +617,11 @@ namespace Microsoft.Iris.Render.Internal
|
||||
if (fCanAdd)
|
||||
{
|
||||
ushort uIdMsg = this.m_nextShutdownHookId++;
|
||||
this.m_mapShutdownHooks.SetValue((uint)uIdMsg, desired);
|
||||
this.m_mapShutdownHooks.SetValue(uIdMsg, desired);
|
||||
this.m_remoteWindow.SendEnableShellShutdownHook(hookName, uIdMsg);
|
||||
}
|
||||
else
|
||||
desired = (RenderWindow.ShutdownHookInfo)null;
|
||||
desired = null;
|
||||
return desired;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
RenderWindow.FormStateCallbackMsg* stateCallbackMsgPtr = (RenderWindow.FormStateCallbackMsg*)pmsgRaw;
|
||||
if (this.m_session.IsForeignByteOrderOnWindowing)
|
||||
MarshalHelper.SwapByteOrder((byte*)stateCallbackMsgPtr, ref RenderWindow.s_ByteOrder_FormStateCallbackMsg, typeof(RenderWindow.FormStateCallbackMsg), 0, 0);
|
||||
MarshalHelper.SwapByteOrder((byte*)stateCallbackMsgPtr, ref s_ByteOrder_FormStateCallbackMsg, typeof(RenderWindow.FormStateCallbackMsg), 0, 0);
|
||||
uint num = 0;
|
||||
if (this.m_currentDisplay != null)
|
||||
num = this.m_currentDisplay.UniqueId;
|
||||
@@ -713,7 +713,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.OnLocationChanged();
|
||||
if (flag5)
|
||||
{
|
||||
this.m_rootVisual.Size = new Vector2((float)this.m_nWidth, (float)this.m_nHeight);
|
||||
this.m_rootVisual.Size = new Vector2(m_nWidth, m_nHeight);
|
||||
this.OnSizeChanged();
|
||||
}
|
||||
if (((int)stateCallbackMsgPtr->uRecentlyChanged & 1) != 0)
|
||||
@@ -734,15 +734,15 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (this.m_partialDropData == null)
|
||||
this.m_partialDropData = new ArrayList();
|
||||
this.m_partialDropData.Add((object)file);
|
||||
this.m_partialDropData.Add(file);
|
||||
}
|
||||
|
||||
void IFormWindowCallback.OnDropComplete(RENDERHANDLE target)
|
||||
{
|
||||
if (this.m_partialDropData == null || this.m_partialDropData.Count <= 0)
|
||||
return;
|
||||
IEnumerable partialDropData = (IEnumerable)this.m_partialDropData;
|
||||
this.m_partialDropData = (ArrayList)null;
|
||||
IEnumerable partialDropData = m_partialDropData;
|
||||
this.m_partialDropData = null;
|
||||
this.OnDroppedFiles(partialDropData);
|
||||
}
|
||||
|
||||
@@ -763,16 +763,16 @@ namespace Microsoft.Iris.Render.Internal
|
||||
ushort hookId)
|
||||
{
|
||||
RenderWindow.ShutdownHookInfo shutdownHookInfo;
|
||||
if (!this.m_mapShutdownHooks.TryGetValue((uint)hookId, out shutdownHookInfo))
|
||||
if (!this.m_mapShutdownHooks.TryGetValue(hookId, out shutdownHookInfo))
|
||||
return;
|
||||
shutdownHookInfo.OnHook((object)this, EventArgs.Empty);
|
||||
shutdownHookInfo.OnHook(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
void IFormWindowCallback.OnNativeScreensave(
|
||||
RENDERHANDLE target,
|
||||
bool fStartScreensave)
|
||||
{
|
||||
this.m_session.DeferredInvoke((Delegate)new DeferredHandler(this.DoNativeScreensave), (object)fStartScreensave, DeferredInvokePriority.Idle);
|
||||
this.m_session.DeferredInvoke(new DeferredHandler(this.DoNativeScreensave), fStartScreensave, DeferredInvokePriority.Idle);
|
||||
}
|
||||
|
||||
private void DoNativeScreensave(object objParam) => this.OnNativeScreensave((bool)objParam);
|
||||
@@ -792,13 +792,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (this.RendererSuspendedEvent == null)
|
||||
return;
|
||||
this.RendererSuspendedEvent((object)this.m_device, new RenderWindow.RendererSuspendedArgs(fSuspended));
|
||||
this.RendererSuspendedEvent(m_device, new RenderWindow.RendererSuspendedArgs(fSuspended));
|
||||
}
|
||||
|
||||
internal RenderWindow.RenderFlags GlobalRenderFlags
|
||||
{
|
||||
get => this.m_renderFlags;
|
||||
set => this.SetGlobalRenderFlags(value, RenderWindow.RenderFlags.All);
|
||||
set => this.SetGlobalRenderFlags(value, RenderFlags.All);
|
||||
}
|
||||
|
||||
internal bool SetGlobalRenderFlags(
|
||||
@@ -843,10 +843,10 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_remoteWindow.SendCreateRootContainer();
|
||||
this.m_remoteWindow.SendSetHitMasks(1U, 2U, 4U, 8U);
|
||||
RemoteVisual remoteVisual;
|
||||
this.m_rootVisual = new VisualContainer(true, this.m_session, this, (object)null, out remoteVisual);
|
||||
this.m_rootVisual.RegisterUsage((object)this);
|
||||
this.m_rootVisual = new VisualContainer(true, this.m_session, this, null, out remoteVisual);
|
||||
this.m_rootVisual.RegisterUsage(this);
|
||||
this.m_remoteWindow.SendSetRoot(remoteVisual);
|
||||
this.m_rootVisual.Size = new Vector2((float)this.m_nWidth, (float)this.m_nHeight);
|
||||
this.m_rootVisual.Size = new Vector2(m_nWidth, m_nHeight);
|
||||
}
|
||||
|
||||
void IRenderWindow.ClientToScreen(ref Point point)
|
||||
@@ -930,7 +930,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (this.m_stkWaitCursors == null)
|
||||
this.m_stkWaitCursors = new Stack();
|
||||
this.m_stkWaitCursors.Push((object)cursor);
|
||||
this.m_stkWaitCursors.Push(cursor);
|
||||
this.UpdateCursors();
|
||||
}
|
||||
|
||||
@@ -975,18 +975,18 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
if (!this.m_session.IsValid)
|
||||
return;
|
||||
Debug2.Validate(edges != null, (Type)null, "Must pass non-null edges set");
|
||||
Debug2.Validate(edges.Length == 4, (Type)null, "Must pass exactly 4 edges, LTRB");
|
||||
Debug2.Validate(edges != null, null, "Must pass non-null edges set");
|
||||
Debug2.Validate(edges.Length == 4, null, "Must pass exactly 4 edges, LTRB");
|
||||
for (int index = 0; index < 4; ++index)
|
||||
{
|
||||
Debug2.Validate(edges[index].ModuleName != null, (Type)null, "Must pass non-null ModuleName:" + index.ToString());
|
||||
Debug2.Validate(edges[index].ResourceName != null, (Type)null, "Must pass non-null ResourceName:" + index.ToString());
|
||||
Debug2.Validate(edges[index].ModuleName != null, null, "Must pass non-null ModuleName:" + index.ToString());
|
||||
Debug2.Validate(edges[index].ResourceName != null, null, "Must pass non-null ResourceName:" + index.ToString());
|
||||
}
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[1].ModuleName), (Type)null, "Module names differ - not supported");
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[2].ModuleName), (Type)null, "Module names differ - not supported");
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[3].ModuleName), (Type)null, "Module names differ - not supported");
|
||||
Debug2.Validate(edges[0].SplitPoints == edges[2].SplitPoints, (Type)null, "L+R splits differ - not supported");
|
||||
Debug2.Validate(edges[1].SplitPoints == edges[3].SplitPoints, (Type)null, "T+B splits differ - not supported");
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[1].ModuleName), null, "Module names differ - not supported");
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[2].ModuleName), null, "Module names differ - not supported");
|
||||
Debug2.Validate(string.Equals(edges[0].ModuleName, edges[3].ModuleName), null, "Module names differ - not supported");
|
||||
Debug2.Validate(edges[0].SplitPoints == edges[2].SplitPoints, null, "L+R splits differ - not supported");
|
||||
Debug2.Validate(edges[1].SplitPoints == edges[3].SplitPoints, null, "T+B splits differ - not supported");
|
||||
Inset insetSplits = new Inset(edges[1].SplitPoints.Left, edges[0].SplitPoints.Top, edges[1].SplitPoints.Right, edges[0].SplitPoints.Bottom);
|
||||
this.m_remoteWindow.SendSetEdgeImageParts(fActiveEdges, edges[0].ModuleName, edges[0].ResourceName, edges[1].ResourceName, edges[2].ResourceName, edges[3].ResourceName, insetSplits);
|
||||
}
|
||||
@@ -1047,7 +1047,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
this.m_remoteWindow.SendTemporarilyExitExclusiveMode();
|
||||
}
|
||||
|
||||
public IHwndHostWindow CreateHwndHostWindow() => (IHwndHostWindow)new HwndHostWindow(this);
|
||||
public IHwndHostWindow CreateHwndHostWindow() => new HwndHostWindow(this);
|
||||
|
||||
public void UnlockForegroundWindow()
|
||||
{
|
||||
@@ -1092,7 +1092,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
Cursor cursor1 = Cursor.NullCursor;
|
||||
Cursor nullCursor = Cursor.NullCursor;
|
||||
Cursor cursor2 = (Cursor)null;
|
||||
Cursor cursor2 = null;
|
||||
if (this.m_stkWaitCursors != null && this.m_stkWaitCursors.Count > 0)
|
||||
cursor2 = this.m_stkWaitCursors.Peek() as Cursor;
|
||||
Cursor cursor3;
|
||||
|
||||
@@ -74,13 +74,13 @@ namespace Microsoft.Iris.Render.Internal
|
||||
public static IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
|
||||
private static readonly string[] s_rgsMessageNames = new string[0];
|
||||
|
||||
public static Win32Api.COLORREF ARGB(byte a, byte r, byte g, byte b) => new Win32Api.COLORREF((uint)((int)a << 24 | (int)b << 16 | (int)g << 8) | (uint)r);
|
||||
public static Win32Api.COLORREF ARGB(byte a, byte r, byte g, byte b) => new Win32Api.COLORREF((uint)(a << 24 | b << 16 | g << 8) | r);
|
||||
|
||||
public static Win32Api.COLORREF RGB(byte r, byte g, byte b) => new Win32Api.COLORREF((uint)((int)b << 16 | (int)g << 8) | (uint)r);
|
||||
public static Win32Api.COLORREF RGB(byte r, byte g, byte b) => new Win32Api.COLORREF((uint)(b << 16 | g << 8) | r);
|
||||
|
||||
public static Win32Api.COLORREF RGB(int r, int g, int b) => Win32Api.RGB((byte)r, (byte)g, (byte)b);
|
||||
public static Win32Api.COLORREF RGB(int r, int g, int b) => RGB((byte)r, (byte)g, (byte)b);
|
||||
|
||||
public static int GetRValue(Win32Api.COLORREF cr) => (int)cr.cr & (int)byte.MaxValue;
|
||||
public static int GetRValue(Win32Api.COLORREF cr) => (int)cr.cr & byte.MaxValue;
|
||||
|
||||
public static int GetGValue(Win32Api.COLORREF cr) => (int)((cr.cr & 65280U) >> 8);
|
||||
|
||||
@@ -202,31 +202,31 @@ namespace Microsoft.Iris.Render.Internal
|
||||
internal static uint GetSystemPageSize()
|
||||
{
|
||||
Win32Api.SYSTEM_INFO info;
|
||||
Win32Api.GetSystemInfo(out info);
|
||||
GetSystemInfo(out info);
|
||||
return info.dwPageSize;
|
||||
}
|
||||
|
||||
internal static string DumpMessage(uint uMsg) => Win32Api.DumpMessageWorker(uMsg) ?? "UNKNOWN MESSAGE";
|
||||
internal static string DumpMessage(uint uMsg) => DumpMessageWorker(uMsg) ?? "UNKNOWN MESSAGE";
|
||||
|
||||
private static string DumpMessageWorker(uint uMsg)
|
||||
{
|
||||
Win32Api.InitMessageDump();
|
||||
if ((long)uMsg >= (long)Win32Api.s_rgsMessageNames.Length)
|
||||
return (string)null;
|
||||
string rgsMessageName = Win32Api.s_rgsMessageNames[(IntPtr)uMsg];
|
||||
InitMessageDump();
|
||||
if (uMsg >= s_rgsMessageNames.Length)
|
||||
return null;
|
||||
string rgsMessageName = s_rgsMessageNames[(IntPtr)uMsg];
|
||||
if (rgsMessageName != null)
|
||||
return rgsMessageName;
|
||||
uint num = uMsg;
|
||||
while (uMsg > 0U)
|
||||
{
|
||||
--num;
|
||||
rgsMessageName = Win32Api.s_rgsMessageNames[(IntPtr)num];
|
||||
rgsMessageName = s_rgsMessageNames[(IntPtr)num];
|
||||
if (rgsMessageName != null)
|
||||
break;
|
||||
}
|
||||
if (rgsMessageName == null)
|
||||
return (string)null;
|
||||
return string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0} + {1}", (object)rgsMessageName, (object)(uint)((int)uMsg - (int)num));
|
||||
return null;
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0} + {1}", rgsMessageName, (uint)((int)uMsg - (int)num));
|
||||
}
|
||||
|
||||
private static void InitMessageDump()
|
||||
@@ -249,7 +249,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
{
|
||||
public IntPtr h;
|
||||
|
||||
public bool IsValid => this.h != Win32Api.INVALID_HANDLE_VALUE;
|
||||
public bool IsValid => this.h != INVALID_HANDLE_VALUE;
|
||||
|
||||
public static Win32Api.HANDLE NULL => new Win32Api.HANDLE()
|
||||
{
|
||||
@@ -258,7 +258,7 @@ namespace Microsoft.Iris.Render.Internal
|
||||
|
||||
public static Win32Api.HANDLE INVALID => new Win32Api.HANDLE()
|
||||
{
|
||||
h = Win32Api.INVALID_HANDLE_VALUE
|
||||
h = INVALID_HANDLE_VALUE
|
||||
};
|
||||
|
||||
public static bool operator ==(Win32Api.HANDLE hl, Win32Api.HANDLE hr) => hl.h == hr.h;
|
||||
|
||||
Reference in New Issue
Block a user