From ab33f58c69275df5cb31b557887b8853925371c9 Mon Sep 17 00:00:00 2001 From: Joshua Askharoun Date: Thu, 3 Mar 2022 08:40:19 -0600 Subject: [PATCH] Added UIX.RenderApi --- MicrosoftIris.sln | 10 +- UIX.RenderApi/AssemblyInfo.cs | 18 + UIX.RenderApi/Cn/CodeGenNameAttribute.cs | 20 + UIX.RenderApi/Cn/DisposeMethodAttribute.cs | 17 + UIX.RenderApi/Cn/GCCollectSafeAttribute.cs | 17 + UIX.RenderApi/Cn/PartialCollectAttribute.cs | 17 + UIX.RenderApi/Cn/ReflectionAttribute.cs | 17 + .../Cn/TypeInitializeDependencyAttribute.cs | 20 + UIX.RenderApi/IVector.cs | 12 + UIX.RenderApi/KeyValueEntry.cs | 21 + UIX.RenderApi/KeyValueEntry`2.cs | 21 + UIX.RenderApi/Map.cs | 329 ++++ UIX.RenderApi/Map`2.cs | 329 ++++ UIX.RenderApi/Microsoft/Iris/Input/Cursor.cs | 87 + .../Microsoft/Iris/Input/CursorID.cs | 31 + .../Microsoft/Iris/Input/IRawInputSite.cs | 13 + .../Microsoft/Iris/Input/InputDeviceType.cs | 16 + .../Microsoft/Iris/Input/InputHandlerFlags.cs | 22 + .../Microsoft/Iris/Input/InputModifiers.cs | 29 + .../Microsoft/Iris/Input/KeyAction.cs | 16 + .../Microsoft/Iris/Input/KeyboardMessageId.cs | 18 + UIX.RenderApi/Microsoft/Iris/Input/Keys.cs | 231 +++ .../Microsoft/Iris/Input/MouseButtons.cs | 23 + .../Microsoft/Iris/Input/RawDragData.cs | 28 + .../Microsoft/Iris/Input/RawHidData.cs | 31 + .../Microsoft/Iris/Input/RawKeyboardData.cs | 34 + .../Microsoft/Iris/Input/RawMouseData.cs | 56 + .../Iris/Libraries/OS/RegistryKey.cs | 114 ++ .../Microsoft/Iris/Library/InvariantString.cs | 199 ++ .../Microsoft/Iris/OS/Libraries/Win32Api.cs | 65 + .../Iris/Render/ActivationChangeHandler.cs | 10 + .../Microsoft/Iris/Render/AlphaOperation.cs | 17 + .../Iris/Render/Animation/Animation.cs | 73 + .../Iris/Render/Animation/AnimationGroup.cs | 47 + .../Animation/AnimationInputProvider.cs | 100 + .../Iris/Render/Animation/AnimationSystem.cs | 130 ++ .../Iris/Render/Animation/AnimationTarget.cs | 50 + .../Animation/ExternalAnimationInput.cs | 85 + .../Render/Animation/IActivatableObject.cs | 17 + .../Render/Animation/IAnimatableObject.cs | 19 + .../Render/Animation/KeyframeAnimation.cs | 567 ++++++ .../Render/Animation/ObjectAnimationInput.cs | 61 + .../Microsoft/Iris/Render/AnimationEvent.cs | 65 + .../Microsoft/Iris/Render/AnimationInput.cs | 77 + .../Iris/Render/AnimationInputType.cs | 17 + .../Iris/Render/AnimationInterpolation.cs | 21 + .../Iris/Render/AnimationKeyframe.cs | 37 + .../Iris/Render/AnimationResetBehavior.cs | 16 + .../Microsoft/Iris/Render/AnimationStage.cs | 18 + .../Iris/Render/AnimationTypeChannel.cs | 21 + .../Iris/Render/AnimationTypeMask.cs | 237 +++ .../Iris/Render/AsyncNotifyHandler.cs | 10 + .../Microsoft/Iris/Render/AxisAngle.cs | 51 + .../Iris/Render/BackBufferCapturedHandler.cs | 10 + .../Iris/Render/BezierInterpolation.cs | 24 + .../Microsoft/Iris/Render/BinaryOpCode.cs | 14 + .../Microsoft/Iris/Render/BinaryOperation.cs | 37 + .../Microsoft/Iris/Render/BlendElement.cs | 97 + .../Iris/Render/BrightnessElement.cs | 53 + .../Iris/Render/CapturedAnimationInput.cs | 44 + .../Microsoft/Iris/Render/CloseHandler.cs | 10 + .../Iris/Render/CloseRequestHandler.cs | 10 + .../Microsoft/Iris/Render/ColorElement.cs | 61 + UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs | 219 +++ .../Microsoft/Iris/Render/ColorOperation.cs | 25 + .../Iris/Render/Common/ByteBuilder.cs | 91 + .../Iris/Render/Common/CachedRenderObject.cs | 28 + .../Microsoft/Iris/Render/Common/Debug2.cs | 297 +++ .../Iris/Render/Common/DeferredHandler.cs | 10 + .../Iris/Render/Common/DeferredInvokeItem.cs | 35 + .../Iris/Render/Common/ObjectCache.cs | 127 ++ .../Iris/Render/Common/ObjectCacheManager.cs | 50 + .../Iris/Render/Common/RenderObject.cs | 46 + .../Iris/Render/Common/ResourceTracker.cs | 49 + .../Iris/Render/Common/SharedRenderObject.cs | 81 + .../Iris/Render/Common/SharedResource.cs | 56 + .../Iris/Render/Common/SharedResourceArray.cs | 56 + .../Iris/Render/Common/SmartMap`1.cs | 152 ++ .../Iris/Render/ComplexImageElement.cs | 155 ++ .../Iris/Render/ConstantAnimationInput.cs | 160 ++ .../Iris/Render/ContentNotification.cs | 14 + .../Iris/Render/ContentNotifyHandler.cs | 15 + .../Iris/Render/ContinuousAnimationInput.cs | 36 + .../Microsoft/Iris/Render/ContrastElement.cs | 53 + .../Microsoft/Iris/Render/CoordMap.cs | 51 + .../Iris/Render/CosineInterpolation.cs | 12 + .../Microsoft/Iris/Render/DebugCategory.cs | 51 + .../Iris/Render/DeferredInvokePriority.cs | 17 + .../Iris/Render/DesaturateElement.cs | 53 + .../Iris/Render/DestinationElement.cs | 82 + .../Microsoft/Iris/Render/DisplayMode.cs | 133 ++ .../Microsoft/Iris/Render/DisplayModeFlags.cs | 19 + .../Iris/Render/EaseInInterpolation.cs | 29 + .../Iris/Render/EaseOutInterpolation.cs | 29 + .../Iris/Render/EdgeDetectionElement.cs | 52 + .../Microsoft/Iris/Render/EffectElement.cs | 217 +++ .../Iris/Render/EffectElementCacheKeys.cs | 17 + .../Microsoft/Iris/Render/EffectInput.cs | 19 + .../Microsoft/Iris/Render/EffectInputType.cs | 23 + .../Microsoft/Iris/Render/EffectLayer.cs | 83 + .../Microsoft/Iris/Render/EffectOperation.cs | 27 + .../Iris/Render/EffectOperationType.cs | 26 + .../Microsoft/Iris/Render/EmbossDirection.cs | 14 + .../Microsoft/Iris/Render/EmbossElement.cs | 66 + .../Microsoft/Iris/Render/EngineInfo.cs | 20 + .../Microsoft/Iris/Render/EngineType.cs | 13 + .../Iris/Render/ExponentialInterpolation.cs | 24 + .../Render/Extensions/BitmapInformation.cs | 29 + .../Render/Extensions/CoordMapGenerator.cs | 30 + .../Iris/Render/Extensions/DataTracker.cs | 43 + .../Extensions/DebugCategoryEnabledSet.cs | 102 + .../Iris/Render/Extensions/DebugDefault.cs | 98 + .../Iris/Render/Extensions/DebugNone.cs | 51 + .../Iris/Render/Extensions/ExtensionsApi.cs | 134 ++ .../Render/Extensions/GradientInformation.cs | 24 + .../Iris/Render/Extensions/HSpBitmap.cs | 26 + .../Iris/Render/Extensions/ImageCache.cs | 285 +++ .../Iris/Render/Extensions/ImageCacheItem.cs | 285 +++ .../Iris/Render/Extensions/ImageCacheKey.cs | 37 + .../Iris/Render/Extensions/ImageData.cs | 17 + .../Iris/Render/Extensions/ImageHeader.cs | 19 + .../Render/Extensions/ImageInformation.cs | 17 + .../Iris/Render/Extensions/ImageLoader.cs | 357 ++++ .../Render/Extensions/ImageRequirements.cs | 87 + .../Iris/Render/Extensions/ModuleManager.cs | 73 + .../Render/Extensions/RegistryListener.cs | 116 ++ .../Iris/Render/Extensions/SoundData.cs | 90 + .../Iris/Render/Extensions/SoundLoader.cs | 53 + .../Render/Extensions/TraceRegistryHelper.cs | 79 + .../Iris/Render/Extensions/eDebug.cs | 522 +++++ .../Iris/Render/Extensions/eDebugApi.cs | 44 + .../Microsoft/Iris/Render/FilterMode.cs | 14 + .../Microsoft/Iris/Render/FormCloseReason.cs | 18 + .../Microsoft/Iris/Render/FormPlacement.cs | 15 + .../Microsoft/Iris/Render/FormStyleInfo.cs | 28 + .../Iris/Render/ForwardMessageHandler.cs | 12 + .../Iris/Render/GaussianBlurElement.cs | 84 + .../Microsoft/Iris/Render/GaussianBlurMode.cs | 15 + .../Render/Graphics/AncestorEnumerator.cs | 47 + .../Microsoft/Iris/Render/Graphics/Camera.cs | 185 ++ .../Render/Graphics/DataBufferCleanupInfo.cs | 16 + .../Iris/Render/Graphics/Dx9BlendElement.cs | 92 + .../Render/Graphics/Dx9BrightnessElement.cs | 29 + .../Iris/Render/Graphics/Dx9ColorElement.cs | 29 + .../Render/Graphics/Dx9ComplexImageElement.cs | 67 + .../Render/Graphics/Dx9ContrastElement.cs | 27 + .../Render/Graphics/Dx9DesaturateElement.cs | 30 + .../Render/Graphics/Dx9DestinationElement.cs | 56 + .../Graphics/Dx9EdgeDetectionElement.cs | 31 + .../Iris/Render/Graphics/Dx9Effect.cs | 46 + .../Iris/Render/Graphics/Dx9EffectBuilder.cs | 376 ++++ .../Iris/Render/Graphics/Dx9EffectManager.cs | 129 ++ .../Iris/Render/Graphics/Dx9EffectResource.cs | 396 ++++ .../Iris/Render/Graphics/Dx9EffectTemplate.cs | 92 + .../Iris/Render/Graphics/Dx9EmbossElement.cs | 38 + .../Render/Graphics/Dx9GaussianBlurElement.cs | 116 ++ .../Iris/Render/Graphics/Dx9GraphicsDevice.cs | 128 ++ .../Iris/Render/Graphics/Dx9HSLElement.cs | 46 + .../Iris/Render/Graphics/Dx9HSVElement.cs | 46 + .../Iris/Render/Graphics/Dx9ImageElement.cs | 44 + .../Render/Graphics/Dx9InterpolateElement.cs | 32 + .../Render/Graphics/Dx9InvAlphaElement.cs | 19 + .../Render/Graphics/Dx9InvColorElement.cs | 15 + .../Iris/Render/Graphics/Dx9InvertElement.cs | 15 + .../Render/Graphics/Dx9LightShaftElement.cs | 77 + .../Render/Graphics/Dx9PointLight2DElement.cs | 71 + .../Iris/Render/Graphics/Dx9SepiaElement.cs | 54 + .../Render/Graphics/Dx9SpotLight2DElement.cs | 98 + .../Iris/Render/Graphics/Dx9TextureInfo.cs | 20 + .../Render/Graphics/Dx9TextureRequirements.cs | 21 + .../Iris/Render/Graphics/Dx9VariableType.cs | 18 + .../Iris/Render/Graphics/Dx9VideoElement.cs | 31 + .../Iris/Render/Graphics/DynamicBlock.cs | 129 ++ .../Iris/Render/Graphics/DynamicBucket.cs | 215 +++ .../Iris/Render/Graphics/DynamicPool.cs | 491 +++++ .../Iris/Render/Graphics/DynamicPoolSet.cs | 97 + .../Iris/Render/Graphics/DynamicRow.cs | 381 ++++ .../Microsoft/Iris/Render/Graphics/Effect.cs | 548 ++++++ .../Iris/Render/Graphics/EffectProperty.cs | 142 ++ .../Render/Graphics/EffectPropertyType.cs | 23 + .../Render/Graphics/EffectRequirements.cs | 17 + .../Iris/Render/Graphics/EffectTemplate.cs | 138 ++ .../Iris/Render/Graphics/GdiEffect.cs | 23 + .../Iris/Render/Graphics/GdiEffectTemplate.cs | 80 + .../Iris/Render/Graphics/GdiEffectType.cs | 15 + .../Iris/Render/Graphics/GdiGraphicsDevice.cs | 183 ++ .../Iris/Render/Graphics/Gradient.cs | 115 ++ .../Iris/Render/Graphics/GraphicsDevice.cs | 255 +++ .../Iris/Render/Graphics/IDynamicBlock.cs | 15 + .../Render/Graphics/ISurfaceContentOwner.cs | 15 + .../Iris/Render/Graphics/ITreeOwner.cs | 13 + .../Render/Graphics/IVideoPoolNotification.cs | 15 + .../Microsoft/Iris/Render/Graphics/Image.cs | 274 +++ .../Iris/Render/Graphics/ImageLoadInfo.cs | 20 + .../Iris/Render/Graphics/NtGraphicsDevice.cs | 151 ++ .../Render/Graphics/NullGraphicsDevice.cs | 63 + .../Iris/Render/Graphics/PoolAllocMethod.cs | 17 + .../Microsoft/Iris/Render/Graphics/Sprite.cs | 226 +++ .../Microsoft/Iris/Render/Graphics/Surface.cs | 151 ++ .../Iris/Render/Graphics/SurfaceManager.cs | 222 +++ .../Iris/Render/Graphics/SurfacePool.cs | 221 +++ .../Graphics/SurfacePoolAllocationResult.cs | 16 + .../Render/Graphics/TextureVariableInfo.cs | 19 + .../Iris/Render/Graphics/TreeNode.cs | 271 +++ .../Render/Graphics/TreeNodeCollection.cs | 148 ++ .../Render/Graphics/TreeNodeEnumerator.cs | 43 + .../Iris/Render/Graphics/VariableInfo.cs | 17 + .../Iris/Render/Graphics/VariableScope.cs | 15 + .../Iris/Render/Graphics/VideoPool.cs | 71 + .../Iris/Render/Graphics/VideoZoomMode.cs | 16 + .../Microsoft/Iris/Render/Graphics/Visual.cs | 591 ++++++ .../Iris/Render/Graphics/VisualContainer.cs | 163 ++ .../Render/Graphics/VisualPropertyManager.cs | 246 +++ .../Iris/Render/GraphicsDeviceType.cs | 16 + .../Iris/Render/GraphicsRenderingQuality.cs | 14 + .../Microsoft/Iris/Render/HSLElement.cs | 81 + .../Microsoft/Iris/Render/HSVElement.cs | 81 + UIX.RenderApi/Microsoft/Iris/Render/HWND.cs | 58 + .../Microsoft/Iris/Render/IActivatable.cs | 12 + .../Microsoft/Iris/Render/IAnimatable.cs | 12 + .../Microsoft/Iris/Render/IAnimation.cs | 33 + .../Microsoft/Iris/Render/IAnimationGroup.cs | 12 + .../Iris/Render/IAnimationInputProvider.cs | 31 + .../Iris/Render/IAnimationPropertyMap.cs | 15 + .../Microsoft/Iris/Render/IAnimationSystem.cs | 35 + .../Microsoft/Iris/Render/ICamera.cs | 21 + UIX.RenderApi/Microsoft/Iris/Render/IDebug.cs | 31 + .../Iris/Render/IDeferredInvokeItem.cs | 13 + .../Microsoft/Iris/Render/IDisplay.cs | 46 + .../Microsoft/Iris/Render/IDisplayManager.cs | 17 + .../Microsoft/Iris/Render/IEffect.cs | 33 + .../Microsoft/Iris/Render/IEffectTemplate.cs | 21 + .../Iris/Render/IExternalAnimationInput.cs | 15 + .../Microsoft/Iris/Render/IGradient.cs | 21 + .../Microsoft/Iris/Render/IGraphicsDevice.cs | 29 + .../Microsoft/Iris/Render/IHwndHostWindow.cs | 25 + UIX.RenderApi/Microsoft/Iris/Render/IImage.cs | 21 + .../Microsoft/Iris/Render/IInputSystem.cs | 15 + .../Iris/Render/IKeyframeAnimation.cs | 50 + .../Iris/Render/IRawInputCallbacks.cs | 25 + .../Microsoft/Iris/Render/IRenderEngine.cs | 36 + .../Microsoft/Iris/Render/IRenderHost.cs | 15 + .../Microsoft/Iris/Render/IRenderObject.cs | 14 + .../Microsoft/Iris/Render/IRenderSession.cs | 35 + .../Microsoft/Iris/Render/IRenderWindow.cs | 139 ++ .../Iris/Render/ISharedRenderObject.cs | 17 + UIX.RenderApi/Microsoft/Iris/Render/ISound.cs | 15 + .../Microsoft/Iris/Render/ISoundBuffer.cs | 13 + .../Microsoft/Iris/Render/ISoundData.cs | 27 + .../Microsoft/Iris/Render/ISoundDevice.cs | 19 + .../Microsoft/Iris/Render/ISprite.cs | 41 + .../Microsoft/Iris/Render/IVideoStream.cs | 25 + .../Microsoft/Iris/Render/IVisual.cs | 25 + .../Microsoft/Iris/Render/IVisualContainer.cs | 55 + .../Microsoft/Iris/Render/IconFlags.cs | 18 + .../Microsoft/Iris/Render/ImageElement.cs | 76 + .../Microsoft/Iris/Render/ImageFormat.cs | 16 + UIX.RenderApi/Microsoft/Iris/Render/Inset.cs | 101 + .../Microsoft/Iris/Render/Internal/Bits.cs | 77 + .../Iris/Render/Internal/DataCookie.cs | 42 + .../Microsoft/Iris/Render/Internal/Display.cs | 290 +++ .../Iris/Render/Internal/DisplayManager.cs | 339 ++++ .../Iris/Render/Internal/EventCookie.cs | 42 + .../Microsoft/Iris/Render/Internal/FormApi.cs | 21 + .../Iris/Render/Internal/GraphicsCaps.cs | 27 + .../Microsoft/Iris/Render/Internal/HRESULT.cs | 38 + .../Iris/Render/Internal/HwndHostWindow.cs | 116 ++ .../Iris/Render/Internal/InputSystem.cs | 246 +++ .../Iris/Render/Internal/KeyAllocator.cs | 17 + .../Microsoft/Iris/Render/Internal/Math2.cs | 43 + .../Iris/Render/Internal/ObjectTracker.cs | 100 + .../Render/Internal/ObjectTrackerGroup.cs | 15 + .../Iris/Render/Internal/RenderCaps.cs | 95 + .../Iris/Render/Internal/RenderDisplayMode.cs | 37 + .../Iris/Render/Internal/RenderEngine.cs | 267 +++ .../Iris/Render/Internal/RenderSession.cs | 371 ++++ .../Iris/Render/Internal/RenderWindow.cs | 1190 ++++++++++++ .../Iris/Render/Internal/SoundCaps.cs | 18 + .../Render/Internal/StackIListEnumerator.cs | 31 + .../Iris/Render/Internal/Win32Api.cs | 393 ++++ .../Iris/Render/InterpolateElement.cs | 77 + .../Microsoft/Iris/Render/InvAlphaElement.cs | 13 + .../Microsoft/Iris/Render/InvColorElement.cs | 13 + .../Iris/Render/InvalidateContentHandler.cs | 10 + .../Microsoft/Iris/Render/InvertElement.cs | 23 + .../Microsoft/Iris/Render/IrisEngineInfo.cs | 42 + UIX.RenderApi/Microsoft/Iris/Render/Key.cs | 48 + .../Iris/Render/LightShaftElement.cs | 149 ++ .../Iris/Render/LinearInterpolation.cs | 12 + .../Microsoft/Iris/Render/LoadHandler.cs | 10 + .../Iris/Render/LocationChangedHandler.cs | 10 + .../Iris/Render/LogarithmicInterpolation.cs | 24 + .../Iris/Render/MonitorChangedHandler.cs | 10 + .../Microsoft/Iris/Render/MouseIdleHandler.cs | 10 + .../Microsoft/Iris/Render/MouseOptions.cs | 21 + .../Microsoft/Iris/Render/Orientation.cs | 14 + UIX.RenderApi/Microsoft/Iris/Render/Point.cs | 88 + .../Iris/Render/PointLight2DElement.cs | 116 ++ .../Microsoft/Iris/Render/Protocol/BLOBREF.cs | 31 + .../Iris/Render/Protocol/BatchCallback.cs | 10 + .../Iris/Render/Protocol/BlobInfo.cs | 151 ++ .../Iris/Render/Protocol/CallbackMessage.cs | 19 + .../Iris/Render/Protocol/ConnectionInfo.cs | 16 + .../Iris/Render/Protocol/ContextID.cs | 34 + .../Iris/Render/Protocol/DataBuffer.cs | 105 + .../Iris/Render/Protocol/DataBufferTracker.cs | 151 ++ .../Iris/Render/Protocol/EngineApi.cs | 263 +++ .../Iris/Render/Protocol/HandleGroup.cs | 367 ++++ .../Iris/Render/Protocol/HandleTable.cs | 179 ++ .../Iris/Render/Protocol/IChannel.cs | 17 + .../Render/Protocol/IRenderHandleOwner.cs | 15 + .../Iris/Render/Protocol/LocalChannel.cs | 50 + .../Render/Protocol/LocalConnectionInfo.cs | 15 + .../Iris/Render/Protocol/MarshalHelper.cs | 176 ++ .../Microsoft/Iris/Render/Protocol/Memory.cs | 99 + .../Microsoft/Iris/Render/Protocol/Message.cs | 18 + .../Iris/Render/Protocol/MessageBatchEntry.cs | 16 + .../Render/Protocol/MessageBatchHeader.cs | 17 + .../Render/Protocol/MessageCookieLayout.cs | 20 + .../Iris/Render/Protocol/MessageHeap.cs | 254 +++ .../Iris/Render/Protocol/MessagingSession.cs | 411 ++++ .../Iris/Render/Protocol/ObjectCache.cs | 80 + .../Iris/Render/Protocol/PortCallback.cs | 13 + .../Iris/Render/Protocol/ProtocolInstance.cs | 28 + .../Iris/Render/Protocol/RENDERGROUP.cs | 33 + .../Iris/Render/Protocol/RENDERHANDLE.cs | 33 + .../Render/Protocol/RelayConnectionInfo.cs | 26 + .../Iris/Render/Protocol/RemoteChannel.cs | 58 + .../Render/Protocol/RemoteConnectionInfo.cs | 19 + .../Protocol/RemoteConnectionInfoBase.cs | 37 + .../Iris/Render/Protocol/RemoteObject.cs | 72 + .../Iris/Render/Protocol/RenderException.cs | 79 + .../Iris/Render/Protocol/RenderPort.cs | 801 ++++++++ .../Iris/Render/Protocol/ShutdownReason.cs | 18 + .../Iris/Render/Protocol/TimeoutHandler.cs | 10 + .../Iris/Render/Protocol/TransportProtocol.cs | 19 + .../Splash/Desktop/IFormWindowCallback.cs | 46 + .../Splash/Desktop/IInputCallback.cs | 15 + .../Splash/Desktop/LocalFormWindowCallback.cs | 420 ++++ .../Splash/Desktop/LocalInputCallback.cs | 77 + .../Desktop/Nt/IDesktopManagerCallback.cs | 26 + .../Desktop/Nt/IHwndHostWindowCallback.cs | 15 + .../Desktop/Nt/LocalDesktopManagerCallback.cs | 207 ++ .../Desktop/Nt/LocalHwndHostWindowCallback.cs | 72 + .../Desktop/Nt/ProtocolSplashDesktopNt.cs | 89 + .../Splash/Desktop/Nt/RemoteDesktopManager.cs | 168 ++ .../Splash/Desktop/Nt/RemoteFormWindow.cs | 86 + .../Splash/Desktop/Nt/RemoteHwndHostWindow.cs | 235 +++ .../Splash/Desktop/ProtocolSplashDesktop.cs | 68 + .../Splash/Desktop/RemoteFormWindowBase.cs | 1312 +++++++++++++ .../Splash/Desktop/RemoteInputRouter.cs | 158 ++ .../Xenon/ProtocolSplashDesktopXenon.cs | 48 + .../Splash/Desktop/Xenon/RemoteFormWindow.cs | 83 + .../Splash/Messaging/IDataBufferCallback.cs | 15 + .../Splash/Messaging/IRenderPortCallback.cs | 17 + .../Messaging/LocalDataBufferCallback.cs | 74 + .../Messaging/LocalRenderPortCallback.cs | 145 ++ .../Messaging/ProtocolSplashMessaging.cs | 78 + .../Splash/Messaging/RemoteBroker.cs | 185 ++ .../Splash/Messaging/RemoteContext.cs | 220 +++ .../Splash/Messaging/RemoteContextRelay.cs | 181 ++ .../Splash/Messaging/RemoteDataBuffer.cs | 89 + .../Splash/Rendering/IAnimationCallback.cs | 15 + .../Splash/Rendering/IDeviceCallback.cs | 27 + .../Splash/Rendering/IRenderCapsCallback.cs | 22 + .../Splash/Rendering/ISoundBufferCallback.cs | 17 + .../Splash/Rendering/IVideoPoolCallback.cs | 23 + .../Rendering/LocalAnimationCallback.cs | 76 + .../Splash/Rendering/LocalDeviceCallback.cs | 188 ++ .../Rendering/LocalRenderCapsCallback.cs | 164 ++ .../Rendering/LocalSoundBufferCallback.cs | 103 + .../Rendering/LocalVideoPoolCallback.cs | 113 ++ .../Rendering/Nt/ProtocolSplashRenderingNt.cs | 94 + .../Rendering/Nt/RemoteDs8SoundDevice.cs | 77 + .../Splash/Rendering/Nt/RemoteGdiDevice.cs | 381 ++++ .../Splash/Rendering/Nt/RemoteGdiEffect.cs | 98 + .../Splash/Rendering/Nt/RemoteGdiSprite.cs | 78 + .../Splash/Rendering/Nt/RemoteNtDevice.cs | 269 +++ .../Rendering/Nt/RemoteWinSoundDevice.cs | 78 + .../Rendering/ProtocolSplashRendering.cs | 242 +++ .../Splash/Rendering/RemoteAnimation.cs | 1703 +++++++++++++++++ .../Rendering/RemoteAnimationInputProvider.cs | 470 +++++ .../Rendering/RemoteAnimationManager.cs | 190 ++ .../Splash/Rendering/RemoteCamera.cs | 259 +++ .../Splash/Rendering/RemoteDevice.cs | 299 +++ .../Splash/Rendering/RemoteDx9Device.cs | 162 ++ .../Splash/Rendering/RemoteDx9Effect.cs | 100 + .../Rendering/RemoteDx9EffectResource.cs | 521 +++++ .../Splash/Rendering/RemoteDx9Sprite.cs | 78 + .../Rendering/RemoteDynamicSurfaceFactory.cs | 219 +++ .../Splash/Rendering/RemoteEffect.cs | 373 ++++ .../Rendering/RemoteExternalAnimationInput.cs | 84 + .../Splash/Rendering/RemoteGradient.cs | 236 +++ .../Splash/Rendering/RemoteNullDevice.cs | 83 + .../Splash/Rendering/RemoteRasterizer.cs | 104 + .../Splash/Rendering/RemoteRenderCaps.cs | 121 ++ .../Protocols/Splash/Rendering/RemoteSound.cs | 109 ++ .../Splash/Rendering/RemoteSoundBuffer.cs | 90 + .../Splash/Rendering/RemoteSoundDevice.cs | 209 ++ .../Splash/Rendering/RemoteSprite.cs | 212 ++ .../Splash/Rendering/RemoteSurface.cs | 338 ++++ .../Splash/Rendering/RemoteSurfacePool.cs | 232 +++ .../Splash/Rendering/RemoteVideoPool.cs | 368 ++++ .../Splash/Rendering/RemoteVisual.cs | 648 +++++++ .../Splash/Rendering/RemoteVisualContainer.cs | 118 ++ .../Splash/Rendering/RemoteWaitCursor.cs | 272 +++ .../Splash/Rendering/RemoteWindow.cs | 235 +++ .../Xenon/ProtocolSplashRenderingXenon.cs | 63 + .../Rendering/Xenon/RemoteXAudSoundDevice.cs | 153 ++ .../Splash/Rendering/Xenon/RemoteXeDevice.cs | 86 + .../Microsoft/Iris/Render/Quaternion.cs | 131 ++ .../Microsoft/Iris/Render/Rectangle.cs | 204 ++ .../Microsoft/Iris/Render/RelativeSpace.cs | 15 + .../Iris/Render/Remote/ImageHeader.cs | 19 + .../Iris/Render/Remote/SoundHeader.cs | 23 + .../Microsoft/Iris/Render/RenderApi.cs | 55 + .../Microsoft/Iris/Render/RenderToken.cs | 44 + .../Iris/Render/SCurveInterpolation.cs | 24 + .../Microsoft/Iris/Render/SepiaElement.cs | 111 ++ .../Iris/Render/SessionActivateHandler.cs | 10 + .../Iris/Render/SessionConnectHandler.cs | 10 + .../Microsoft/Iris/Render/SetFocusHandler.cs | 10 + .../Microsoft/Iris/Render/ShadowEdgePart.cs | 15 + .../Microsoft/Iris/Render/ShowHandler.cs | 10 + .../Iris/Render/SineInterpolation.cs | 12 + UIX.RenderApi/Microsoft/Iris/Render/Size.cs | 110 ++ .../Iris/Render/SizeChangedHandler.cs | 10 + .../Iris/Render/Sound/Ds8SoundDevice.cs | 66 + .../Microsoft/Iris/Render/Sound/Sound.cs | 106 + .../Iris/Render/Sound/SoundBuffer.cs | 164 ++ .../Iris/Render/Sound/SoundDevice.cs | 129 ++ .../Iris/Render/Sound/SoundHeader.cs | 23 + .../Microsoft/Iris/Render/SoundCaps.cs | 15 + .../Microsoft/Iris/Render/SoundDataFormat.cs | 13 + .../Microsoft/Iris/Render/SoundDeviceType.cs | 16 + .../Iris/Render/SpotLight2DElement.cs | 160 ++ .../Microsoft/Iris/Render/SurfaceFormat.cs | 26 + .../Iris/Render/SurfaceFormatInfo.cs | 43 + .../Iris/Render/SysCommandHandler.cs | 12 + .../Microsoft/Iris/Render/TrackerBase.cs | 192 ++ .../Microsoft/Iris/Render/TvFormat.cs | 16 + .../Iris/Render/ValueEventCondition.cs | 17 + .../Microsoft/Iris/Render/Vector2.cs | 111 ++ .../Microsoft/Iris/Render/Vector3.cs | 134 ++ .../Microsoft/Iris/Render/Vector4.cs | 135 ++ .../Microsoft/Iris/Render/VideoElement.cs | 55 + .../Microsoft/Iris/Render/VideoStream.cs | 137 ++ .../Microsoft/Iris/Render/VisualOrder.cs | 17 + .../Microsoft/Iris/Render/WindowOptions.cs | 28 + .../Microsoft/Iris/Render/WindowState.cs | 15 + .../Iris/Render/WindowStateChangedHandler.cs | 10 + .../System/Collections/Generic/HashHelpers.cs | 118 ++ UIX.RenderApi/UIX.RenderApi.csproj | 518 +++++ UIX.RenderApi/Vector.cs | 200 ++ UIX.RenderApi/Vector`1.cs | 200 ++ UIX/UIX.csproj | 9 +- 456 files changed, 45568 insertions(+), 5 deletions(-) create mode 100644 UIX.RenderApi/AssemblyInfo.cs create mode 100644 UIX.RenderApi/Cn/CodeGenNameAttribute.cs create mode 100644 UIX.RenderApi/Cn/DisposeMethodAttribute.cs create mode 100644 UIX.RenderApi/Cn/GCCollectSafeAttribute.cs create mode 100644 UIX.RenderApi/Cn/PartialCollectAttribute.cs create mode 100644 UIX.RenderApi/Cn/ReflectionAttribute.cs create mode 100644 UIX.RenderApi/Cn/TypeInitializeDependencyAttribute.cs create mode 100644 UIX.RenderApi/IVector.cs create mode 100644 UIX.RenderApi/KeyValueEntry.cs create mode 100644 UIX.RenderApi/KeyValueEntry`2.cs create mode 100644 UIX.RenderApi/Map.cs create mode 100644 UIX.RenderApi/Map`2.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/Cursor.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/CursorID.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/IRawInputSite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/InputDeviceType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/InputHandlerFlags.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/InputModifiers.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/KeyAction.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/KeyboardMessageId.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/Keys.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/MouseButtons.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/RawDragData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/RawHidData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/RawKeyboardData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Input/RawMouseData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Libraries/OS/RegistryKey.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Library/InvariantString.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/OS/Libraries/Win32Api.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ActivationChangeHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AlphaOperation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/Animation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationGroup.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationSystem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationTarget.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/IActivatableObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/IAnimatableObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationEvent.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationInputType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationKeyframe.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationResetBehavior.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationStage.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeChannel.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeMask.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AsyncNotifyHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/AxisAngle.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BackBufferCapturedHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BezierInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BinaryOpCode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BinaryOperation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BlendElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/BrightnessElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/CapturedAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/CloseHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/CloseRequestHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ColorElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ColorOperation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/ByteBuilder.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/CachedRenderObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/Debug2.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCache.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCacheManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/RenderObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/ResourceTracker.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/SharedRenderObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResource.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResourceArray.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Common/SmartMap`1.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ComplexImageElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ConstantAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ContentNotification.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ContentNotifyHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ContinuousAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ContrastElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/CoordMap.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/CosineInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DebugCategory.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DeferredInvokePriority.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DesaturateElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DestinationElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DisplayMode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/DisplayModeFlags.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EaseInInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EaseOutInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EdgeDetectionElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectElementCacheKeys.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectInputType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectLayer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectOperation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EffectOperationType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EmbossDirection.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EmbossElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EngineInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/EngineType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ExponentialInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/BitmapInformation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/DataTracker.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugDefault.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugNone.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ExtensionsApi.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/GradientInformation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/HSpBitmap.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCache.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageHeader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageInformation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageLoader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageRequirements.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/ModuleManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/RegistryListener.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundLoader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/TraceRegistryHelper.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebug.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebugApi.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/FilterMode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/FormCloseReason.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/FormPlacement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/FormStyleInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ForwardMessageHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurMode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Camera.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DataBufferCleanupInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9Effect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureRequirements.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VariableType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBlock.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBucket.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPool.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicRow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Effect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectProperty.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectPropertyType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectRequirements.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectTemplate.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Gradient.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/IDynamicBlock.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/ISurfaceContentOwner.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/ITreeOwner.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/IVideoPoolNotification.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Image.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/ImageLoadInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/PoolAllocMethod.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Sprite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Surface.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfaceManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePool.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePoolAllocationResult.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/TextureVariableInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableScope.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoPool.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoZoomMode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/Visual.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualContainer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualPropertyManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/GraphicsDeviceType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/GraphicsRenderingQuality.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/HSLElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/HSVElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/HWND.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IActivatable.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimatable.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimationGroup.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimationInputProvider.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimationPropertyMap.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IAnimationSystem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ICamera.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IDebug.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IDeferredInvokeItem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IDisplay.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IDisplayManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IEffect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IEffectTemplate.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IExternalAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IGradient.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IGraphicsDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IHwndHostWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IImage.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IInputSystem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IKeyframeAnimation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRawInputCallbacks.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRenderEngine.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRenderHost.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRenderObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRenderSession.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IRenderWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISharedRenderObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISound.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISoundBuffer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISoundData.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ISprite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IVideoStream.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IVisual.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IVisualContainer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IconFlags.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ImageElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ImageFormat.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Inset.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/Bits.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/DataCookie.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/Display.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/DisplayManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/EventCookie.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/FormApi.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/GraphicsCaps.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/HRESULT.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/HwndHostWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/InputSystem.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/KeyAllocator.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/Math2.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTracker.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderCaps.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderDisplayMode.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderEngine.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderSession.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/SoundCaps.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/StackIListEnumerator.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Internal/Win32Api.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/InterpolateElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/InvAlphaElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/InvColorElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/InvalidateContentHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/InvertElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/IrisEngineInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Key.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/LightShaftElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/LinearInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/LoadHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/LocationChangedHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/LogarithmicInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/MonitorChangedHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/MouseIdleHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/MouseOptions.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Orientation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Point.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/PointLight2DElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/BLOBREF.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/BatchCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/BlobInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/CallbackMessage.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/ContextID.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBuffer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/EngineApi.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleGroup.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleTable.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/IChannel.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/IRenderHandleOwner.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalChannel.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalConnectionInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MarshalHelper.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/Memory.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/Message.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchEntry.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchHeader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageCookieLayout.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageHeap.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessagingSession.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/ObjectCache.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/PortCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/ProtocolInstance.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERGROUP.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERHANDLE.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RelayConnectionInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteChannel.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfoBase.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteObject.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderException.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderPort.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/ShutdownReason.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/TimeoutHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocol/TransportProtocol.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IFormWindowCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IInputCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IDesktopManagerCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IHwndHostWindowCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IDataBufferCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IRenderPortCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IAnimationCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IDeviceCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IRenderCapsCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ISoundBufferCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IVideoPoolCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteDs8SoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Quaternion.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Rectangle.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/RelativeSpace.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Remote/ImageHeader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Remote/SoundHeader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/RenderApi.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/RenderToken.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SCurveInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SepiaElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SessionActivateHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SessionConnectHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SetFocusHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ShadowEdgePart.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ShowHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SineInterpolation.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Size.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SizeChangedHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Sound/Sound.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundBuffer.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundDevice.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundHeader.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SoundCaps.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SoundDataFormat.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SoundDeviceType.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SpotLight2DElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormat.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormatInfo.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/SysCommandHandler.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/TrackerBase.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/TvFormat.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/ValueEventCondition.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/Vector4.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/VideoElement.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/VideoStream.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/VisualOrder.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/WindowOptions.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/WindowState.cs create mode 100644 UIX.RenderApi/Microsoft/Iris/Render/WindowStateChangedHandler.cs create mode 100644 UIX.RenderApi/System/Collections/Generic/HashHelpers.cs create mode 100644 UIX.RenderApi/UIX.RenderApi.csproj create mode 100644 UIX.RenderApi/Vector.cs create mode 100644 UIX.RenderApi/Vector`1.cs diff --git a/MicrosoftIris.sln b/MicrosoftIris.sln index 1bf2ef3..abaa0d4 100644 --- a/MicrosoftIris.sln +++ b/MicrosoftIris.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32112.339 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31727.386 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIX", "UIX\UIX.csproj", "{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIX.RenderApi", "UIX.RenderApi\UIX.RenderApi.csproj", "{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.ActiveCfg = Release|Any CPU {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.Build.0 = Release|Any CPU + {CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/UIX.RenderApi/AssemblyInfo.cs b/UIX.RenderApi/AssemblyInfo.cs new file mode 100644 index 0000000..2663a57 --- /dev/null +++ b/UIX.RenderApi/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +[assembly: ComVisible(false)] +[assembly: StringFreezing] +[assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyDescription("UIX.RenderApi.Skia")] +[assembly: AssemblyTitle("UIX.RenderApi.Skia")] +[assembly: CLSCompliant(false)] +[assembly: AssemblyDelaySign(true)] +[assembly: AssemblyFileVersion("4.8.0015.0")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyVersion("4.8.0.0")] +[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] diff --git a/UIX.RenderApi/Cn/CodeGenNameAttribute.cs b/UIX.RenderApi/Cn/CodeGenNameAttribute.cs new file mode 100644 index 0000000..8b60d5b --- /dev/null +++ b/UIX.RenderApi/Cn/CodeGenNameAttribute.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.CodeGenNameAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [Conditional("NEVER")] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field, AllowMultiple = false, Inherited = false)] + public class CodeGenNameAttribute : Attribute + { + public string Name; + + public CodeGenNameAttribute(string stName) => this.Name = stName; + } +} diff --git a/UIX.RenderApi/Cn/DisposeMethodAttribute.cs b/UIX.RenderApi/Cn/DisposeMethodAttribute.cs new file mode 100644 index 0000000..ece9e75 --- /dev/null +++ b/UIX.RenderApi/Cn/DisposeMethodAttribute.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.DisposeMethodAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [Conditional("NEVER")] + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] + public class DisposeMethodAttribute : Attribute + { + } +} diff --git a/UIX.RenderApi/Cn/GCCollectSafeAttribute.cs b/UIX.RenderApi/Cn/GCCollectSafeAttribute.cs new file mode 100644 index 0000000..41f4932 --- /dev/null +++ b/UIX.RenderApi/Cn/GCCollectSafeAttribute.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.GCCollectSafeAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [Conditional("NEVER")] + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] + public class GCCollectSafeAttribute : Attribute + { + } +} diff --git a/UIX.RenderApi/Cn/PartialCollectAttribute.cs b/UIX.RenderApi/Cn/PartialCollectAttribute.cs new file mode 100644 index 0000000..8122f89 --- /dev/null +++ b/UIX.RenderApi/Cn/PartialCollectAttribute.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.PartialCollectAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] + [Conditional("NEVER")] + public class PartialCollectAttribute : Attribute + { + } +} diff --git a/UIX.RenderApi/Cn/ReflectionAttribute.cs b/UIX.RenderApi/Cn/ReflectionAttribute.cs new file mode 100644 index 0000000..f0a8422 --- /dev/null +++ b/UIX.RenderApi/Cn/ReflectionAttribute.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.ReflectionAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] + [Conditional("NEVER")] + public class ReflectionAttribute : Attribute + { + } +} diff --git a/UIX.RenderApi/Cn/TypeInitializeDependencyAttribute.cs b/UIX.RenderApi/Cn/TypeInitializeDependencyAttribute.cs new file mode 100644 index 0000000..7c46446 --- /dev/null +++ b/UIX.RenderApi/Cn/TypeInitializeDependencyAttribute.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Cn.TypeInitializeDependencyAttribute +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Cn +{ + [Conditional("NEVER")] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] + public class TypeInitializeDependencyAttribute : Attribute + { + public Type Type; + + public TypeInitializeDependencyAttribute(Type type) => this.Type = type; + } +} diff --git a/UIX.RenderApi/IVector.cs b/UIX.RenderApi/IVector.cs new file mode 100644 index 0000000..0fbd92c --- /dev/null +++ b/UIX.RenderApi/IVector.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: IVector +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +public interface IVector +{ + int Count { get; } + + object this[int index] { get; } +} diff --git a/UIX.RenderApi/KeyValueEntry.cs b/UIX.RenderApi/KeyValueEntry.cs new file mode 100644 index 0000000..fa69ed3 --- /dev/null +++ b/UIX.RenderApi/KeyValueEntry.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: KeyValueEntry +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +public struct KeyValueEntry +{ + private object _key; + private object _value; + + public KeyValueEntry(object key, object value) + { + this._key = key; + this._value = value; + } + + public object Key => this._key; + + public object Value => this._value; +} diff --git a/UIX.RenderApi/KeyValueEntry`2.cs b/UIX.RenderApi/KeyValueEntry`2.cs new file mode 100644 index 0000000..5958e7f --- /dev/null +++ b/UIX.RenderApi/KeyValueEntry`2.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: KeyValueEntry`2 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +public struct KeyValueEntry +{ + private K _key; + private V _value; + + public KeyValueEntry(K key, V value) + { + this._key = key; + this._value = value; + } + + public K Key => this._key; + + public V Value => this._value; +} diff --git a/UIX.RenderApi/Map.cs b/UIX.RenderApi/Map.cs new file mode 100644 index 0000000..f5d1cb8 --- /dev/null +++ b/UIX.RenderApi/Map.cs @@ -0,0 +1,329 @@ +// Decompiled with JetBrains decompiler +// Type: Map +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections.Generic; + +public class Map +{ + private int[] _buckets; + private Map.Entry[] _entries; + private int _count; + private int _version; + private int _freeList; + private int _freeCount; + + public Map() + : this(0) + { + } + + public Map(int capacity) + { + if (capacity <= 0) + return; + this.Initialize(capacity); + } + + public int Count => this._count - this._freeCount; + + public Map.KeyCollection Keys => new Map.KeyCollection(this); + + public Map.ValueCollection Values => new Map.ValueCollection(this); + + public object this[object key] + { + get + { + int entry = this.FindEntry(key); + return entry >= 0 ? this._entries[entry].value : null; + } + set => this.Insert(key, value, false); + } + + public void Add(object key, object value) => this.Insert(key, value, true); + + public void Clear() + { + if (this._count <= 0) + return; + for (int index = 0; index < this._buckets.Length; ++index) + this._buckets[index] = -1; + Array.Clear(_entries, 0, this._count); + this._freeList = -1; + this._count = 0; + this._freeCount = 0; + } + + public bool ContainsKey(object key) => this.FindEntry(key) >= 0; + + public Map.Enumerator GetEnumerator() => new Map.Enumerator(this); + + private int FindEntry(object key) + { + if (this._buckets != null) + { + int num = this.GetKeyHashCode(key) & int.MaxValue; + for (int index = this._buckets[num % this._buckets.Length]; index >= 0; index = this._entries[index].next) + { + if (this._entries[index].hashCode == num && this.KeyEquals(this._entries[index].key, key)) + return index; + } + } + return -1; + } + + private void Initialize(int capacity) + { + int prime = HashHelpers.GetPrime(capacity); + this._buckets = new int[prime]; + for (int index = 0; index < this._buckets.Length; ++index) + this._buckets[index] = -1; + this._entries = new Map.Entry[prime]; + this._freeList = -1; + } + + private void Insert(object key, object value, bool add) + { + if (this._buckets == null) + this.Initialize(0); + int num = this.GetKeyHashCode(key) & int.MaxValue; + for (int index = this._buckets[num % this._buckets.Length]; index >= 0; index = this._entries[index].next) + { + if (this._entries[index].hashCode == num && this.KeyEquals(this._entries[index].key, key)) + { + if (add) + throw new ArgumentException("Adding duplicate entry to Dictionary"); + this._entries[index].value = value; + ++this._version; + return; + } + } + int index1; + if (this._freeCount > 0) + { + index1 = this._freeList; + this._freeList = this._entries[index1].next; + --this._freeCount; + } + else + { + if (this._count == this._entries.Length) + this.Resize(); + index1 = this._count; + ++this._count; + } + int index2 = num % this._buckets.Length; + this._entries[index1].hashCode = num; + this._entries[index1].next = this._buckets[index2]; + this._entries[index1].key = key; + this._entries[index1].value = value; + this._buckets[index2] = index1; + ++this._version; + } + + private void Resize() + { + int prime = HashHelpers.GetPrime(this._count * 2); + int[] numArray = new int[prime]; + for (int index = 0; index < numArray.Length; ++index) + numArray[index] = -1; + Map.Entry[] entryArray = new Map.Entry[prime]; + Array.Copy(_entries, 0, entryArray, 0, this._count); + for (int index1 = 0; index1 < this._count; ++index1) + { + int index2 = entryArray[index1].hashCode % prime; + entryArray[index1].next = numArray[index2]; + numArray[index2] = index1; + } + this._buckets = numArray; + this._entries = entryArray; + } + + public bool Remove(object key) + { + if (this._buckets != null) + { + int num = this.GetKeyHashCode(key) & int.MaxValue; + int index1 = num % this._buckets.Length; + int index2 = -1; + for (int index3 = this._buckets[index1]; index3 >= 0; index3 = this._entries[index3].next) + { + if (this._entries[index3].hashCode == num && this.KeyEquals(this._entries[index3].key, key)) + { + if (index2 < 0) + this._buckets[index1] = this._entries[index3].next; + else + this._entries[index2].next = this._entries[index3].next; + this._entries[index3].hashCode = -1; + this._entries[index3].next = this._freeList; + this._entries[index3].key = null; + this._entries[index3].value = null; + this._freeList = index3; + ++this._freeCount; + ++this._version; + return true; + } + index2 = index3; + } + } + return false; + } + + public bool TryGetValue(object key, out object value) + { + int entry = this.FindEntry(key); + if (entry >= 0) + { + value = this._entries[entry].value; + return true; + } + value = null; + return false; + } + + private bool KeyEquals(object x, object y) => x.Equals(y); + + private int GetKeyHashCode(object obj) => obj.GetHashCode(); + + public struct Enumerator + { + private Map _dictionary; + private int _version; + private int _index; + private KeyValueEntry _current; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = this._dictionary._version; + this._index = 0; + this._current = new KeyValueEntry(null, null); + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._current = new KeyValueEntry(this._dictionary._entries[this._index].key, this._dictionary._entries[this._index].value); + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._current = new KeyValueEntry(null, null); + return false; + } + + public KeyValueEntry Current => this._current; + } + + public struct KeyCollection + { + private Map _dictionary; + + public KeyCollection(Map dictionary) => this._dictionary = dictionary != null ? dictionary : throw new ArgumentNullException(nameof(dictionary)); + + public Map.KeyCollection.Enumerator GetEnumerator() => new Map.KeyCollection.Enumerator(this._dictionary); + + public int Count => this._dictionary.Count; + + public struct Enumerator + { + private Map _dictionary; + private int _index; + private int _version; + private object _currentKey; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = dictionary._version; + this._index = 0; + this._currentKey = null; + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._currentKey = this._dictionary._entries[this._index].key; + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._currentKey = null; + return false; + } + + public object Current => this._currentKey; + } + } + + public struct ValueCollection + { + private Map _dictionary; + + public ValueCollection(Map dictionary) => this._dictionary = dictionary != null ? dictionary : throw new ArgumentNullException(nameof(dictionary)); + + public Map.ValueCollection.Enumerator GetEnumerator() => new Map.ValueCollection.Enumerator(this._dictionary); + + public int Count => this._dictionary.Count; + + public struct Enumerator + { + private Map _dictionary; + private int _index; + private int _version; + private object _currentValue; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = dictionary._version; + this._index = 0; + this._currentValue = null; + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._currentValue = this._dictionary._entries[this._index].value; + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._currentValue = null; + return false; + } + + public object Current => this._currentValue; + } + } + + private struct Entry + { + public int hashCode; + public int next; + public object key; + public object value; + } +} diff --git a/UIX.RenderApi/Map`2.cs b/UIX.RenderApi/Map`2.cs new file mode 100644 index 0000000..c03497d --- /dev/null +++ b/UIX.RenderApi/Map`2.cs @@ -0,0 +1,329 @@ +// Decompiled with JetBrains decompiler +// Type: Map`2 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections.Generic; + +public class Map +{ + private int[] _buckets; + private Map.Entry[] _entries; + private int _count; + private int _version; + private int _freeList; + private int _freeCount; + + public Map() + : this(0) + { + } + + public Map(int capacity) + { + if (capacity <= 0) + return; + this.Initialize(capacity); + } + + public int Count => this._count - this._freeCount; + + public Map.KeyCollection Keys => new Map.KeyCollection(this); + + public Map.ValueCollection Values => new Map.ValueCollection(this); + + public V this[K key] + { + get + { + int entry = this.FindEntry(key); + return entry >= 0 ? this._entries[entry].value : default(V); + } + set => this.Insert(key, value, false); + } + + public void Add(K key, V value) => this.Insert(key, value, true); + + public void Clear() + { + if (this._count <= 0) + return; + for (int index = 0; index < this._buckets.Length; ++index) + this._buckets[index] = -1; + Array.Clear(_entries, 0, this._count); + this._freeList = -1; + this._count = 0; + this._freeCount = 0; + } + + public bool ContainsKey(K key) => this.FindEntry(key) >= 0; + + public Map.Enumerator GetEnumerator() => new Map.Enumerator(this); + + private int FindEntry(K key) + { + if (this._buckets != null) + { + int num = this.GetKeyHashCode(key) & int.MaxValue; + for (int index = this._buckets[num % this._buckets.Length]; index >= 0; index = this._entries[index].next) + { + if (this._entries[index].hashCode == num && this.KeyEquals(this._entries[index].key, key)) + return index; + } + } + return -1; + } + + private void Initialize(int capacity) + { + int prime = HashHelpers.GetPrime(capacity); + this._buckets = new int[prime]; + for (int index = 0; index < this._buckets.Length; ++index) + this._buckets[index] = -1; + this._entries = new Map.Entry[prime]; + this._freeList = -1; + } + + private void Insert(K key, V value, bool add) + { + if (this._buckets == null) + this.Initialize(0); + int num = this.GetKeyHashCode(key) & int.MaxValue; + for (int index = this._buckets[num % this._buckets.Length]; index >= 0; index = this._entries[index].next) + { + if (this._entries[index].hashCode == num && this.KeyEquals(this._entries[index].key, key)) + { + if (add) + throw new ArgumentException("Adding duplicate entry to Dictionary"); + this._entries[index].value = value; + ++this._version; + return; + } + } + int index1; + if (this._freeCount > 0) + { + index1 = this._freeList; + this._freeList = this._entries[index1].next; + --this._freeCount; + } + else + { + if (this._count == this._entries.Length) + this.Resize(); + index1 = this._count; + ++this._count; + } + int index2 = num % this._buckets.Length; + this._entries[index1].hashCode = num; + this._entries[index1].next = this._buckets[index2]; + this._entries[index1].key = key; + this._entries[index1].value = value; + this._buckets[index2] = index1; + ++this._version; + } + + private void Resize() + { + int prime = HashHelpers.GetPrime(this._count * 2); + int[] numArray = new int[prime]; + for (int index = 0; index < numArray.Length; ++index) + numArray[index] = -1; + Map.Entry[] entryArray = new Map.Entry[prime]; + Array.Copy(_entries, 0, entryArray, 0, this._count); + for (int index1 = 0; index1 < this._count; ++index1) + { + int index2 = entryArray[index1].hashCode % prime; + entryArray[index1].next = numArray[index2]; + numArray[index2] = index1; + } + this._buckets = numArray; + this._entries = entryArray; + } + + public bool Remove(K key) + { + if (this._buckets != null) + { + int num = this.GetKeyHashCode(key) & int.MaxValue; + int index1 = num % this._buckets.Length; + int index2 = -1; + for (int index3 = this._buckets[index1]; index3 >= 0; index3 = this._entries[index3].next) + { + if (this._entries[index3].hashCode == num && this.KeyEquals(this._entries[index3].key, key)) + { + if (index2 < 0) + this._buckets[index1] = this._entries[index3].next; + else + this._entries[index2].next = this._entries[index3].next; + this._entries[index3].hashCode = -1; + this._entries[index3].next = this._freeList; + this._entries[index3].key = default(K); + this._entries[index3].value = default(V); + this._freeList = index3; + ++this._freeCount; + ++this._version; + return true; + } + index2 = index3; + } + } + return false; + } + + public bool TryGetValue(K key, out V value) + { + int entry = this.FindEntry(key); + if (entry >= 0) + { + value = this._entries[entry].value; + return true; + } + value = default(V); + return false; + } + + private bool KeyEquals(K x, K y) => x.Equals(y); + + private int GetKeyHashCode(K obj) => obj.GetHashCode(); + + public struct Enumerator + { + private Map _dictionary; + private int _version; + private int _index; + private KeyValueEntry _current; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = this._dictionary._version; + this._index = 0; + this._current = new KeyValueEntry(default(K), default(V)); + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._current = new KeyValueEntry(this._dictionary._entries[this._index].key, this._dictionary._entries[this._index].value); + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._current = new KeyValueEntry(default(K), default(V)); + return false; + } + + public KeyValueEntry Current => this._current; + } + + public struct KeyCollection + { + private Map _dictionary; + + public KeyCollection(Map dictionary) => this._dictionary = dictionary != null ? dictionary : throw new ArgumentNullException(nameof(dictionary)); + + public Map.KeyCollection.Enumerator GetEnumerator() => new Map.KeyCollection.Enumerator(this._dictionary); + + public int Count => this._dictionary.Count; + + public struct Enumerator + { + private Map _dictionary; + private int _index; + private int _version; + private K _currentKey; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = dictionary._version; + this._index = 0; + this._currentKey = default(K); + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._currentKey = this._dictionary._entries[this._index].key; + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._currentKey = default(K); + return false; + } + + public K Current => this._currentKey; + } + } + + public struct ValueCollection + { + private Map _dictionary; + + public ValueCollection(Map dictionary) => this._dictionary = dictionary != null ? dictionary : throw new ArgumentNullException(nameof(dictionary)); + + public Map.ValueCollection.Enumerator GetEnumerator() => new Map.ValueCollection.Enumerator(this._dictionary); + + public int Count => this._dictionary.Count; + + public struct Enumerator + { + private Map _dictionary; + private int _index; + private int _version; + private V _currentValue; + + internal Enumerator(Map dictionary) + { + this._dictionary = dictionary; + this._version = dictionary._version; + this._index = 0; + this._currentValue = default(V); + } + + public bool MoveNext() + { + if (this._version != this._dictionary._version) + throw new InvalidOperationException("Dictionary was modified while enumerating"); + for (; (uint)this._index < (uint)this._dictionary._count; ++this._index) + { + if (this._dictionary._entries[this._index].hashCode >= 0) + { + this._currentValue = this._dictionary._entries[this._index].value; + ++this._index; + return true; + } + } + this._index = this._dictionary._count + 1; + this._currentValue = default(V); + return false; + } + + public V Current => this._currentValue; + } + } + + private struct Entry + { + public int hashCode; + public int next; + public K key; + public V value; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/Cursor.cs b/UIX.RenderApi/Microsoft/Iris/Input/Cursor.cs new file mode 100644 index 0000000..ead6095 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/Cursor.cs @@ -0,0 +1,87 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.Cursor +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public class Cursor + { + public const int NoneResourceId = 1; + public const int MoveResourceId = 2; + public const int CopyResourceId = 3; + public static readonly Cursor Arrow = new Cursor(32512, CursorID.Arrow); + public static readonly Cursor AppStarting = new Cursor(32550, CursorID.AppStarting); + public static readonly Cursor Crosshair = new Cursor(32515, CursorID.Crosshair); + public static readonly Cursor Default = Arrow; + public static readonly Cursor Hand = new Cursor(32649, CursorID.Hand); + public static readonly Cursor Help = new Cursor(32651, CursorID.Help); + public static readonly Cursor IBeam = new Cursor(32513, CursorID.IBeam); + public static readonly Cursor No = new Cursor(32648, CursorID.No); + public static readonly Cursor Size = new Cursor(32646, CursorID.Size); + public static readonly Cursor SizeNS = new Cursor(32645, CursorID.SizeNS); + public static readonly Cursor SizeWE = new Cursor(32644, CursorID.SizeWE); + public static readonly Cursor SizeNWSE = new Cursor(32642, CursorID.SizeNWSE); + public static readonly Cursor SizeNESW = new Cursor(32643, CursorID.SizeNESW); + public static readonly Cursor WaitCursor = new Cursor(32514, CursorID.Wait); + public static readonly Cursor UpArrow = new Cursor(32516, CursorID.UpArrow); + public static readonly Cursor NullCursor = new Cursor(0, CursorID.None); + public static readonly Cursor Cancel = new Cursor(1, CursorID.Cancel); + public static readonly Cursor Move = new Cursor(2, CursorID.Move); + public static readonly Cursor Copy = new Cursor(3, CursorID.Copy); + private int m_idResource; + private CursorID m_idCursor; + + public Cursor(int idResource, CursorID idCursor) + { + this.m_idResource = idResource; + this.m_idCursor = idCursor; + } + + public int ResourceId => this.m_idResource; + + public CursorID CursorID => this.m_idCursor; + + public static Cursor GetCursor(CursorID cursor) + { + switch (cursor) + { + case CursorID.Arrow: + return Arrow; + case CursorID.Cancel: + return Cancel; + case CursorID.Copy: + return Copy; + case CursorID.Crosshair: + return Crosshair; + case CursorID.IBeam: + return IBeam; + case CursorID.Hand: + return Hand; + case CursorID.Move: + return Move; + case CursorID.No: + return No; + case CursorID.None: + return NullCursor; + case CursorID.Size: + return Size; + case CursorID.SizeNS: + return SizeNS; + case CursorID.SizeWE: + return SizeWE; + case CursorID.SizeNWSE: + return SizeNWSE; + case CursorID.SizeNESW: + return SizeNESW; + case CursorID.UpArrow: + return UpArrow; + case CursorID.Wait: + return WaitCursor; + default: + return null; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/CursorID.cs b/UIX.RenderApi/Microsoft/Iris/Input/CursorID.cs new file mode 100644 index 0000000..8a949ab --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/CursorID.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.CursorID +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public enum CursorID + { + NotSpecified, + AppStarting, + Arrow, + Cancel, + Copy, + Crosshair, + IBeam, + Hand, + Help, + Move, + No, + None, + Size, + SizeNS, + SizeWE, + SizeNWSE, + SizeNESW, + UpArrow, + Wait, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/IRawInputSite.cs b/UIX.RenderApi/Microsoft/Iris/Input/IRawInputSite.cs new file mode 100644 index 0000000..8d7a226 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/IRawInputSite.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.IRawInputSite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public interface IRawInputSite + { + object OwnerData { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/InputDeviceType.cs b/UIX.RenderApi/Microsoft/Iris/Input/InputDeviceType.cs new file mode 100644 index 0000000..308022f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/InputDeviceType.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputDeviceType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public enum InputDeviceType + { + None, + Keyboard, + Mouse, + Other, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/InputHandlerFlags.cs b/UIX.RenderApi/Microsoft/Iris/Input/InputHandlerFlags.cs new file mode 100644 index 0000000..b7b6751 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/InputHandlerFlags.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputHandlerFlags +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Flags] + public enum InputHandlerFlags + { + None = 0, + Keyboard = 1, + Mouse = 2, + Drag = 4, + Hid = 8, + AppCommand = 16, // 0x00000010 + All = AppCommand | Hid | Drag | Mouse | Keyboard, // 0x0000001F + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/InputModifiers.cs b/UIX.RenderApi/Microsoft/Iris/Input/InputModifiers.cs new file mode 100644 index 0000000..26be9f5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/InputModifiers.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputModifiers +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Flags] + public enum InputModifiers + { + None = 0, + ControlKey = 1, + ShiftKey = 2, + AltKey = 4, + WindowsKey = 8, + LeftMouse = 16, // 0x00000010 + RightMouse = 32, // 0x00000020 + MiddleMouse = 64, // 0x00000040 + XMouse1 = 128, // 0x00000080 + XMouse2 = 256, // 0x00000100 + DoubleClick = 512, // 0x00000200 + AllKeys = WindowsKey | AltKey | ShiftKey | ControlKey, // 0x0000000F + AllButtons = XMouse2 | XMouse1 | MiddleMouse | RightMouse | LeftMouse, // 0x000001F0 + AllMouse = AllButtons | DoubleClick, // 0x000003F0 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/KeyAction.cs b/UIX.RenderApi/Microsoft/Iris/Input/KeyAction.cs new file mode 100644 index 0000000..6b7ed7c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/KeyAction.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyAction +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public enum KeyAction + { + None, + Up, + Down, + Character, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/KeyboardMessageId.cs b/UIX.RenderApi/Microsoft/Iris/Input/KeyboardMessageId.cs new file mode 100644 index 0000000..90f7cba --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/KeyboardMessageId.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyboardMessageId +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public enum KeyboardMessageId + { + Down, + Up, + Char, + SysDown, + SysUp, + SysChar, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/Keys.cs b/UIX.RenderApi/Microsoft/Iris/Input/Keys.cs new file mode 100644 index 0000000..2bf799a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/Keys.cs @@ -0,0 +1,231 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.Keys +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Input +{ + public enum Keys + { + Modifiers = -65536, // 0xFFFF0000 + None = 0, + LButton = 1, + RButton = 2, + Cancel = 3, + MButton = 4, + XButton1 = 5, + XButton2 = 6, + Back = 8, + Tab = 9, + LineFeed = 10, // 0x0000000A + Clear = 12, // 0x0000000C + Enter = 13, // 0x0000000D + Return = 13, // 0x0000000D + ShiftKey = 16, // 0x00000010 + ControlKey = 17, // 0x00000011 + Menu = 18, // 0x00000012 + Pause = 19, // 0x00000013 + Capital = 20, // 0x00000014 + CapsLock = 20, // 0x00000014 + HangulMode = 21, // 0x00000015 + KanaMode = 21, // 0x00000015 + JunjaMode = 23, // 0x00000017 + FinalMode = 24, // 0x00000018 + HanjaMode = 25, // 0x00000019 + KanjiMode = 25, // 0x00000019 + Escape = 27, // 0x0000001B + IMEConvert = 28, // 0x0000001C + IMENonconvert = 29, // 0x0000001D + IMEAccept = 30, // 0x0000001E + IMEModeChange = 31, // 0x0000001F + Space = 32, // 0x00000020 + PageUp = 33, // 0x00000021 + Prior = 33, // 0x00000021 + Next = 34, // 0x00000022 + PageDown = 34, // 0x00000022 + End = 35, // 0x00000023 + Home = 36, // 0x00000024 + Left = 37, // 0x00000025 + Up = 38, // 0x00000026 + Right = 39, // 0x00000027 + Down = 40, // 0x00000028 + Select = 41, // 0x00000029 + Print = 42, // 0x0000002A + Execute = 43, // 0x0000002B + PrintScreen = 44, // 0x0000002C + Snapshot = 44, // 0x0000002C + Insert = 45, // 0x0000002D + Delete = 46, // 0x0000002E + D0 = 48, // 0x00000030 + D1 = 49, // 0x00000031 + D2 = 50, // 0x00000032 + D3 = 51, // 0x00000033 + D4 = 52, // 0x00000034 + D5 = 53, // 0x00000035 + D6 = 54, // 0x00000036 + D7 = 55, // 0x00000037 + D8 = 56, // 0x00000038 + D9 = 57, // 0x00000039 + A = 65, // 0x00000041 + B = 66, // 0x00000042 + C = 67, // 0x00000043 + D = 68, // 0x00000044 + E = 69, // 0x00000045 + F = 70, // 0x00000046 + G = 71, // 0x00000047 + H = 72, // 0x00000048 + I = 73, // 0x00000049 + J = 74, // 0x0000004A + K = 75, // 0x0000004B + L = 76, // 0x0000004C + M = 77, // 0x0000004D + N = 78, // 0x0000004E + O = 79, // 0x0000004F + P = 80, // 0x00000050 + Q = 81, // 0x00000051 + R = 82, // 0x00000052 + S = 83, // 0x00000053 + T = 84, // 0x00000054 + U = 85, // 0x00000055 + V = 86, // 0x00000056 + W = 87, // 0x00000057 + X = 88, // 0x00000058 + Y = 89, // 0x00000059 + Z = 90, // 0x0000005A + LWin = 91, // 0x0000005B + RWin = 92, // 0x0000005C + Apps = 93, // 0x0000005D + NumPad0 = 96, // 0x00000060 + NumPad1 = 97, // 0x00000061 + NumPad2 = 98, // 0x00000062 + NumPad3 = 99, // 0x00000063 + NumPad4 = 100, // 0x00000064 + NumPad5 = 101, // 0x00000065 + NumPad6 = 102, // 0x00000066 + NumPad7 = 103, // 0x00000067 + NumPad8 = 104, // 0x00000068 + NumPad9 = 105, // 0x00000069 + Multiply = 106, // 0x0000006A + Add = 107, // 0x0000006B + Separator = 108, // 0x0000006C + Subtract = 109, // 0x0000006D + Decimal = 110, // 0x0000006E + Divide = 111, // 0x0000006F + F1 = 112, // 0x00000070 + F2 = 113, // 0x00000071 + F3 = 114, // 0x00000072 + F4 = 115, // 0x00000073 + F5 = 116, // 0x00000074 + F6 = 117, // 0x00000075 + F7 = 118, // 0x00000076 + F8 = 119, // 0x00000077 + F9 = 120, // 0x00000078 + F10 = 121, // 0x00000079 + F11 = 122, // 0x0000007A + F12 = 123, // 0x0000007B + F13 = 124, // 0x0000007C + F14 = 125, // 0x0000007D + F15 = 126, // 0x0000007E + F16 = 127, // 0x0000007F + F17 = 128, // 0x00000080 + F18 = 129, // 0x00000081 + F19 = 130, // 0x00000082 + F20 = 131, // 0x00000083 + F21 = 132, // 0x00000084 + F22 = 133, // 0x00000085 + F23 = 134, // 0x00000086 + F24 = 135, // 0x00000087 + NumLock = 144, // 0x00000090 + Scroll = 145, // 0x00000091 + LShiftKey = 160, // 0x000000A0 + RShiftKey = 161, // 0x000000A1 + LControlKey = 162, // 0x000000A2 + RControlKey = 163, // 0x000000A3 + LMenu = 164, // 0x000000A4 + RMenu = 165, // 0x000000A5 + BrowserBack = 166, // 0x000000A6 + BrowserForward = 167, // 0x000000A7 + BrowserRefresh = 168, // 0x000000A8 + BrowserStop = 169, // 0x000000A9 + BrowserSearch = 170, // 0x000000AA + BrowserFavorites = 171, // 0x000000AB + BrowserHome = 172, // 0x000000AC + VolumeMute = 173, // 0x000000AD + VolumeDown = 174, // 0x000000AE + VolumeUp = 175, // 0x000000AF + MediaNextTrack = 176, // 0x000000B0 + MediaPreviousTrack = 177, // 0x000000B1 + MediaStop = 178, // 0x000000B2 + MediaPlayPause = 179, // 0x000000B3 + LaunchMail = 180, // 0x000000B4 + SelectMedia = 181, // 0x000000B5 + LaunchApplication1 = 182, // 0x000000B6 + LaunchApplication2 = 183, // 0x000000B7 + OemSemicolon = 186, // 0x000000BA + OemPlus = 187, // 0x000000BB + OemComma = 188, // 0x000000BC + OemMinus = 189, // 0x000000BD + OemPeriod = 190, // 0x000000BE + OemQuestion = 191, // 0x000000BF + OemTilde = 192, // 0x000000C0 + OemOpenBrackets = 219, // 0x000000DB + OemPipe = 220, // 0x000000DC + OemCloseBrackets = 221, // 0x000000DD + OemQuotes = 222, // 0x000000DE + Oem8 = 223, // 0x000000DF + OemBackslash = 226, // 0x000000E2 + ProcessKey = 229, // 0x000000E5 + DBEKatakana = 241, // 0x000000F1 + DBEHiragana = 242, // 0x000000F2 + DBESBCSChar = 243, // 0x000000F3 + DBEDBCSChar = 244, // 0x000000F4 + DBERoman = 245, // 0x000000F5 + Attn = 246, // 0x000000F6 + DBENoroman = 246, // 0x000000F6 + Crsel = 247, // 0x000000F7 + Excel = 248, // 0x000000F8 + EraseEof = 249, // 0x000000F9 + Play = 250, // 0x000000FA + Zoom = 251, // 0x000000FB + NoName = 252, // 0x000000FC + Pa1 = 253, // 0x000000FD + OemClear = 254, // 0x000000FE + GamePadA = 22528, // 0x00005800 + GamePadB = 22529, // 0x00005801 + GamePadX = 22530, // 0x00005802 + GamePadY = 22531, // 0x00005803 + GamePadRShoulder = 22532, // 0x00005804 + GamePadLShoulder = 22533, // 0x00005805 + GamePadLTrigger = 22534, // 0x00005806 + GamePadRTrigger = 22535, // 0x00005807 + GamePadDPadUp = 22544, // 0x00005810 + GamePadDPadDown = 22545, // 0x00005811 + GamePadDPadLeft = 22546, // 0x00005812 + GamePadDPadRight = 22547, // 0x00005813 + GamePadStart = 22548, // 0x00005814 + GamePadLThumbPress = 22550, // 0x00005816 + GamePadRThumbPress = 22551, // 0x00005817 + GamePadLThumbUp = 22560, // 0x00005820 + GamePadLThumbDown = 22561, // 0x00005821 + GamePadLThumbRight = 22562, // 0x00005822 + GamePadLThumbLeft = 22563, // 0x00005823 + GamePadLThumbUpLeft = 22564, // 0x00005824 + GamePadLThumbUpRight = 22565, // 0x00005825 + GamePadLThumbDownRight = 22566, // 0x00005826 + GamePadLThumbDownLeft = 22567, // 0x00005827 + GamePadRThumbUp = 22576, // 0x00005830 + GamePadRThumbDown = 22577, // 0x00005831 + GamePadRThumbRight = 22578, // 0x00005832 + GamePadRThumbLeft = 22579, // 0x00005833 + GamePadRThumbUpLeft = 22580, // 0x00005834 + GamePadRThumbUpRight = 22581, // 0x00005835 + GamePadRThumbDownRight = 22582, // 0x00005836 + GamePadRThumbDownLeft = 22583, // 0x00005837 + GamePadBack = 22597, // 0x00005845 + KeyCode = 65535, // 0x0000FFFF + Shift = 65536, // 0x00010000 + Control = 131072, // 0x00020000 + Alt = 262144, // 0x00040000 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/MouseButtons.cs b/UIX.RenderApi/Microsoft/Iris/Input/MouseButtons.cs new file mode 100644 index 0000000..96df6f9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/MouseButtons.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseButtons +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Flags] + public enum MouseButtons + { + None = 0, + Left = 1, + Right = 2, + Middle = 4, + XButton1 = 8, + XButton2 = 16, // 0x00000010 + Primary = Left, // 0x00000001 + Secondary = XButton2 | XButton1 | Middle | Right, // 0x0000001E + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/RawDragData.cs b/UIX.RenderApi/Microsoft/Iris/Input/RawDragData.cs new file mode 100644 index 0000000..bf2f72f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/RawDragData.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.RawDragData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Input +{ + [Serializable] + public struct RawDragData + { + public IVisual _visCapture; + public int _positionX; + public int _positionY; + public IntPtr _pDataStream; + + public RawDragData(IVisual visCapture, int positionX, int positionY, IntPtr pDataStream) + { + this._visCapture = visCapture; + this._positionX = positionX; + this._positionY = positionY; + this._pDataStream = pDataStream; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/RawHidData.cs b/UIX.RenderApi/Microsoft/Iris/Input/RawHidData.cs new file mode 100644 index 0000000..170ac8b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/RawHidData.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.RawHidData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Serializable] + public struct RawHidData + { + public uint _commandCode; + public uint _usagePage; + public KeyAction _action; + public InputDeviceType _deviceType; + + public RawHidData( + uint commandCode, + uint usagePage, + KeyAction action, + InputDeviceType deviceType) + { + this._commandCode = commandCode; + this._usagePage = usagePage; + this._action = action; + this._deviceType = deviceType; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/RawKeyboardData.cs b/UIX.RenderApi/Microsoft/Iris/Input/RawKeyboardData.cs new file mode 100644 index 0000000..403dd4c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/RawKeyboardData.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.RawKeyboardData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Serializable] + public struct RawKeyboardData + { + public Keys _virtualKey; + public int _scanCode; + public uint _repCount; + public InputDeviceType _deviceType; + public ushort _flags; + + public RawKeyboardData( + Keys virtualKey, + int scanCode, + uint repCount, + ushort flags, + InputDeviceType deviceType) + { + this._virtualKey = virtualKey; + this._scanCode = scanCode; + this._repCount = repCount; + this._deviceType = deviceType; + this._flags = flags; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Input/RawMouseData.cs b/UIX.RenderApi/Microsoft/Iris/Input/RawMouseData.cs new file mode 100644 index 0000000..7136930 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Input/RawMouseData.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.RawMouseData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Input +{ + [Serializable] + public struct RawMouseData + { + public IVisual _visCapture; + public IVisual _visNatural; + public int _positionX; + public int _positionY; + public int _naturalX; + public int _naturalY; + public int _physicalX; + public int _physicalY; + public int _screenX; + public int _screenY; + public MouseButtons _button; + public int _wheelDelta; + + public RawMouseData( + IVisual visCapture, + IVisual visNatural, + int positionX, + int positionY, + int naturalX, + int naturalY, + int physicalX, + int physicalY, + int screenX, + int screenY, + MouseButtons button, + int wheelDelta) + { + this._visCapture = visCapture; + this._visNatural = visNatural; + this._positionX = positionX; + this._positionY = positionY; + this._naturalX = naturalX; + this._naturalY = naturalY; + this._physicalX = physicalX; + this._physicalY = physicalY; + this._screenX = screenX; + this._screenY = screenY; + this._button = button; + this._wheelDelta = wheelDelta; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Libraries/OS/RegistryKey.cs b/UIX.RenderApi/Microsoft/Iris/Libraries/OS/RegistryKey.cs new file mode 100644 index 0000000..2dbf1f0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Libraries/OS/RegistryKey.cs @@ -0,0 +1,114 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Libraries.OS.RegistryKey +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Security; + +namespace Microsoft.Iris.Libraries.OS +{ + [SuppressUnmanagedCodeSecurity] + internal class RegistryKey + { + private IntPtr _hkey; + public static IntPtr HKEY_CLASSES_ROOT = new IntPtr(int.MinValue); + public static IntPtr HKEY_CURRENT_USER = new IntPtr(-2147483647); + public static IntPtr HKEY_LOCAL_MACHINE = new IntPtr(-2147483646); + + private RegistryKey(IntPtr hkey) => this._hkey = hkey; + + ~RegistryKey() => this.Close(); + + public static RegistryKey Open(IntPtr hive, string path) => OpenWorker(hive, path); + + private static RegistryKey OpenWorker(IntPtr parentKey, string path) + { + RegistryKey registryKey = null; + IntPtr phkResult; + if (Win32Api.RegOpenKeyExW(parentKey, path, 0, 131097, out phkResult) == 0) + registryKey = new RegistryKey(phkResult); + return registryKey; + } + + public RegistryKey OpenSubKey(string path) => OpenWorker(this._hkey, path); + + public bool ReadByte(string valueName, out byte value) + { + bool flag = false; + value = 0; + int num = 0; + if (this.ReadInt(valueName, out num) && num >= 0 && num <= byte.MaxValue) + { + value = (byte)num; + flag = true; + } + return flag; + } + + public bool ReadBool(string valueName, out bool value) + { + bool flag = false; + value = false; + int num = 0; + if (this.ReadInt(valueName, out num)) + { + value = num != 0; + flag = true; + } + return flag; + } + + public bool ReadInt(string valueName, out int value) + { + bool flag = false; + value = 0; + int lpcbData = 4; + int lpType; + int lpData; + if (Win32Api.RegQueryValueExW(this._hkey, valueName, IntPtr.Zero, out lpType, out lpData, ref lpcbData) == 0 && lpType == 4) + { + value = lpData; + flag = true; + } + return flag; + } + + public bool ReadString(string valueName, out string value) + { + bool flag = false; + value = null; + int lpcbData = 0; + int lpType; + if (Win32Api.RegQueryValueExW(this._hkey, valueName, IntPtr.Zero, out lpType, null, ref lpcbData) == 0 && lpType == 1) + flag = this.ReadStringValueWorker(valueName, lpcbData, out value); + return flag; + } + + private bool ReadStringValueWorker(string valueName, int dataBytes, out string value) + { + value = null; + bool flag = false; + int length = dataBytes / 2; + char[] lpData = new char[length]; + int lpType; + if (Win32Api.RegQueryValueExW(this._hkey, valueName, IntPtr.Zero, out lpType, lpData, ref dataBytes) == 0 && lpType == 1) + { + if (lpData[length - 1] == char.MinValue) + --length; + value = new string(lpData, 0, length); + flag = true; + } + return flag; + } + + public void Close() + { + Win32Api.RegCloseKey(this._hkey); + this._hkey = IntPtr.Zero; + GC.SuppressFinalize(this); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Library/InvariantString.cs b/UIX.RenderApi/Microsoft/Iris/Library/InvariantString.cs new file mode 100644 index 0000000..b13247b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Library/InvariantString.cs @@ -0,0 +1,199 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.InvariantString +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections.Generic; +using System.Globalization; + +namespace Microsoft.Iris.Library +{ + public static class InvariantString + { + public static string Format(string format, object param) => string.Format(CultureInfo.InvariantCulture, format, param); + + public static string Format(string format, object[] param) => throw new Exception("Should never format with object array. Use one of the dedicated format methods"); + + public static string Format(string format, object param1, object param2) => string.Format(CultureInfo.InvariantCulture, format, param1, param2); + + public static string Format(string format, object param1, object param2, object param3) => string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3); + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6, + object param7) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6, + object param7, + object param8) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6, + object param7, + object param8, + object param9) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6, + object param7, + object param8, + object param9, + object param10) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); + } + + public static string Format( + string format, + object param1, + object param2, + object param3, + object param4, + object param5, + object param6, + object param7, + object param8, + object param9, + object param10, + object param11) + { + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); + } + + public static bool Equals(string leftName, string rightName) => string.Compare(leftName, rightName, StringComparison.Ordinal) == 0; + + public static bool EqualsI(string leftName, string rightName) => string.Compare(leftName, rightName, StringComparison.OrdinalIgnoreCase) == 0; + + public static bool StartsWith(string valueName, string prefixName) => valueName.StartsWith(prefixName, StringComparison.Ordinal); + + public static bool StartsWithI(string valueName, string prefixName) => valueName.StartsWith(prefixName, StringComparison.OrdinalIgnoreCase); + + public static bool EndsWith(string valueName, string suffixName) => valueName.EndsWith(suffixName, StringComparison.Ordinal); + + public static bool EndsWithI(string valueName, string suffixName) => valueName.EndsWith(suffixName, StringComparison.OrdinalIgnoreCase); + + public static string ValueToString(ushort v, string formatName) => v.ToString(formatName, CultureInfo.InvariantCulture); + + public static IEqualityComparer OrdinalIgnoreCaseComparer => OrdinalIgnoreCaseStringComparer.Instance; + + public static IEqualityComparer OrdinalComparer => OrdinalStringComparer.Instance; + + public class OrdinalStringComparer : IEqualityComparer + { + private static InvariantString.OrdinalStringComparer _instance; + + private OrdinalStringComparer() + { + } + + public static InvariantString.OrdinalStringComparer Instance + { + get + { + if (_instance == null) + _instance = new InvariantString.OrdinalStringComparer(); + return _instance; + } + } + + public int Compare(string x, string y) => string.Compare(x, y, StringComparison.Ordinal); + + public int GetHashCode(string obj) => obj.GetHashCode(); + + public bool Equals(string x, string y) => this.Compare(x, y) == 0; + } + + public class OrdinalIgnoreCaseStringComparer : IEqualityComparer + { + private static InvariantString.OrdinalIgnoreCaseStringComparer _instance; + + private OrdinalIgnoreCaseStringComparer() + { + } + + public static InvariantString.OrdinalIgnoreCaseStringComparer Instance + { + get + { + if (_instance == null) + _instance = new InvariantString.OrdinalIgnoreCaseStringComparer(); + return _instance; + } + } + + public int Compare(string x, string y) => string.Compare(x, y, StringComparison.OrdinalIgnoreCase); + + public int GetHashCode(string obj) => obj.ToLowerInvariant().GetHashCode(); + + public bool Equals(string x, string y) => this.Compare(x, y) == 0; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/OS/Libraries/Win32Api.cs b/UIX.RenderApi/Microsoft/Iris/OS/Libraries/Win32Api.cs new file mode 100644 index 0000000..81234b7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/OS/Libraries/Win32Api.cs @@ -0,0 +1,65 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.OS.Libraries.Win32Api +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace Microsoft.Iris.OS.Libraries +{ + [SuppressUnmanagedCodeSecurity] + internal sealed class Win32Api + { + public const uint ERROR_SUCCESS = 0; + public const uint ERROR_FILE_NOT_FOUND = 2; + public const uint ERROR_PATH_NOT_FOUND = 3; + public const uint ERROR_ACCESS_DENIED = 5; + public const uint ERROR_INVALID_HANDLE = 6; + public const uint ERROR_NOT_ENOUGH_MEMORY = 8; + public const uint ERROR_OUTOFMEMORY = 14; + public const uint ERROR_NOT_SUPPORTED = 50; + public const uint ERROR_INVALID_PARAMETER = 87; + public const uint ERROR_CALL_NOT_IMPLEMENTED = 120; + public const uint ERROR_MORE_DATA = 234; + public const uint ERROR_SERVICE_ALREADY_RUNNING = 1056; + public const uint ERROR_NOT_FOUND = 1168; + public const uint ERROR_NO_MATCH = 1169; + public const uint ERROR_SET_NOT_FOUND = 1170; + public const uint ERROR_SERVICE_DATABASE_LOCKED = 1055; + public const int KEY_READ = 131097; + public const int REG_SZ = 1; + public const int REG_DWORD = 4; + + [DllImport("Advapi32.dll", CharSet = CharSet.Unicode)] + public static extern int RegOpenKeyExW( + IntPtr hkey, + string lpSubKey, + int options, + int securityMask, + out IntPtr result); + + [DllImport("Advapi32.dll", CharSet = CharSet.Unicode)] + public static extern int RegQueryValueExW( + IntPtr hKey, + string lpValueName, + IntPtr reserved, + out int lpType, + char[] lpData, + ref int lpcbData); + + [DllImport("Advapi32.dll", CharSet = CharSet.Unicode)] + public static extern int RegQueryValueExW( + IntPtr hKey, + string lpValueName, + IntPtr reserved, + out int lpType, + out int lpData, + ref int lpcbData); + + [DllImport("Advapi32.dll")] + public static extern int RegCloseKey(IntPtr hkey); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ActivationChangeHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/ActivationChangeHandler.cs new file mode 100644 index 0000000..145b664 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ActivationChangeHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ActivationChangeHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void ActivationChangeHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AlphaOperation.cs b/UIX.RenderApi/Microsoft/Iris/Render/AlphaOperation.cs new file mode 100644 index 0000000..702a64a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AlphaOperation.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AlphaOperation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum AlphaOperation + { + Add, + Subtract, + Multiply, + Source1, + Source2, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/Animation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/Animation.cs new file mode 100644 index 0000000..bffb144 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/Animation.cs @@ -0,0 +1,73 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.Animation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; + +namespace Microsoft.Iris.Render.Animation +{ + internal abstract class Animation : + SharedRenderObject, + IAnimation, + ISharedRenderObject, + IAnimationCallback + { + public static readonly string OutputProperty = "Output"; + public static readonly string PlayMethod = "Play"; + public static readonly string PauseMethod = "Pause"; + public static readonly string ResetMethod = "Reset"; + public static readonly string FinishMethod = "Finish"; + public static readonly string NotifyMethod = "AsyncNotify"; + + internal Animation() + { + } + + public abstract int RepeatCount { get; set; } + + public abstract bool IsPlaying { get; } + + public abstract bool IsActive { get; } + + public abstract bool AutoReset { get; set; } + + public abstract AnimationResetBehavior ResetBehavior { get; set; } + + public abstract void Play(); + + public abstract void Pause(); + + public abstract void Reset(); + + public abstract void InstantAdvance(float advanceTime); + + public abstract void InstantFinish(); + + void IAnimationCallback.AsyncNotify(RENDERHANDLE target, int nCookie) + { + if (this.AsyncNotifyEvent == null) + return; + this.AsyncNotifyEvent(nCookie); + } + + public event AsyncNotifyHandler AsyncNotifyEvent; + + protected enum AnimatableProperties : uint + { + Output = 1, + } + + protected enum ActivatableMethods : uint + { + Play = 1, + Pause = 2, + Reset = 3, + Finish = 4, + Notify = 5, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationGroup.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationGroup.cs new file mode 100644 index 0000000..c748ee1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationGroup.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.AnimationGroup +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Animation +{ + internal class AnimationGroup : Microsoft.Iris.Render.Animation.Animation, IAnimationGroup, IAnimation, ISharedRenderObject + { + internal AnimationGroup(AnimationSystem owner) => throw new NotImplementedException("Not implemented yet"); + + public override int RepeatCount + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public override bool IsPlaying => throw new NotImplementedException(); + + public override bool IsActive => throw new NotImplementedException(); + + public override bool AutoReset + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public override AnimationResetBehavior ResetBehavior + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public override void Play() => throw new NotImplementedException(); + + public override void Pause() => throw new NotImplementedException(); + + public override void Reset() => throw new NotImplementedException(); + + public override void InstantAdvance(float advanceTime) => throw new NotImplementedException(); + + public override void InstantFinish() => throw new NotImplementedException(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs new file mode 100644 index 0000000..878f78c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.AnimationInputProvider +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Animation +{ + internal class AnimationInputProvider : + SharedRenderObject, + IAnimationInputProvider, + IAnimatable, + ISharedRenderObject, + IRenderHandleOwner + { + private RemoteAnimationInputProvider m_remoteObject; + private ExternalAnimationInput m_externalInput; + + internal AnimationInputProvider( + object objUser, + RenderSession session, + ExternalAnimationInput externalInput) + { + Debug2.Validate(externalInput != null, typeof(ArgumentNullException), nameof(externalInput)); + this.m_remoteObject = session.BuildRemoteAnimationInputProvider(this, externalInput.UniqueId); + this.m_externalInput = externalInput; + this.RegisterUsage(objUser); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (inDispose && this.m_remoteObject != null) + this.m_remoteObject.Dispose(); + this.m_remoteObject = null; + this.m_externalInput = null; + } + finally + { + base.Dispose(inDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; + + void IAnimationInputProvider.PublishFloat( + string propertyName, + float value) + { + this.m_remoteObject.SendPublishFloat(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName), value); + } + + void IAnimationInputProvider.PublishVector2( + string propertyName, + Vector2 value) + { + this.m_remoteObject.SendPublishVector2(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName), value); + } + + void IAnimationInputProvider.PublishVector3( + string propertyName, + Vector3 value) + { + this.m_remoteObject.SendPublishVector3(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName), value); + } + + void IAnimationInputProvider.PublishVector4( + string propertyName, + Vector4 value) + { + this.m_remoteObject.SendPublishVector4(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName), value); + } + + void IAnimationInputProvider.PublishQuaternion( + string propertyName, + Quaternion value) + { + this.m_remoteObject.SendPublishQuaternion(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName), value); + } + + void IAnimationInputProvider.RevokeFloat(string propertyName) => this.m_remoteObject.SendRevokeFloat(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName)); + + void IAnimationInputProvider.RevokeVector2(string propertyName) => this.m_remoteObject.SendRevokeVector2(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName)); + + void IAnimationInputProvider.RevokeVector3(string propertyName) => this.m_remoteObject.SendRevokeVector3(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName)); + + void IAnimationInputProvider.RevokeVector4(string propertyName) => this.m_remoteObject.SendRevokeVector4(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName)); + + void IAnimationInputProvider.RevokeQuaternion(string propertyName) => this.m_remoteObject.SendRevokeQuaternion(((IAnimatableObject)this.m_externalInput).GetPropertyId(propertyName)); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationSystem.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationSystem.cs new file mode 100644 index 0000000..a163712 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationSystem.cs @@ -0,0 +1,130 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.AnimationSystem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Animation +{ + internal class AnimationSystem : SharedRenderObject, IAnimationSystem, IRenderHandleOwner + { + private RenderSession m_ownerSession; + private RemoteAnimationManager m_remoteObject; + private int m_nUpdatesPerSecond; + private float m_flSpeedAdjustment; + private bool m_backCompat; + + internal AnimationSystem(RenderSession ownerSession) + { + this.m_ownerSession = ownerSession; + this.m_remoteObject = ownerSession.BuildRemoteAnimationManager(this); + this.m_flSpeedAdjustment = 1f; + this.m_backCompat = false; + this.RegisterUsage(ownerSession); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (inDispose && this.m_remoteObject != null) + this.m_remoteObject.Dispose(); + this.m_ownerSession = null; + this.m_remoteObject = null; + } + finally + { + base.Dispose(inDispose); + } + } + + internal RenderSession Session => this.m_ownerSession; + + public bool BackCompat + { + get => this.m_backCompat; + set => this.m_backCompat = value; + } + + IKeyframeAnimation IAnimationSystem.CreateKeyframeAnimation( + object objUser, + AnimationInput initialValue) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Debug2.Validate(initialValue != null, typeof(ArgumentNullException), nameof(initialValue)); + KeyframeAnimation keyframeAnimation = new KeyframeAnimation(this, initialValue); + keyframeAnimation.RegisterUsage(objUser); + return keyframeAnimation; + } + + IAnimationGroup IAnimationSystem.CreateAnimationGroup( + object objUser) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + AnimationGroup animationGroup = new AnimationGroup(this); + animationGroup.RegisterUsage(objUser); + return animationGroup; + } + + void IAnimationSystem.PulseTimeAdvance(int nAdvanceMs) => this.PulseTimeAdvance(nAdvanceMs); + + int IAnimationSystem.UpdatesPerSecond + { + get => this.m_nUpdatesPerSecond; + set + { + if (value == this.m_nUpdatesPerSecond) + return; + this.m_nUpdatesPerSecond = value; + this.m_remoteObject.SendSetAnimationRate(this.m_nUpdatesPerSecond); + } + } + + float IAnimationSystem.SpeedAdjustment + { + get => this.m_flSpeedAdjustment; + set + { + if (Math2.WithinEpsilon(this.m_flSpeedAdjustment, value)) + return; + this.m_flSpeedAdjustment = value; + this.m_remoteObject.SendSetGlobalSpeedAdjustment(this.m_flSpeedAdjustment); + } + } + + IExternalAnimationInput IAnimationSystem.CreateExternalAnimationInput( + object objUser, + IAnimationPropertyMap propertyMap) + { + return new ExternalAnimationInput(objUser, this.m_ownerSession, propertyMap); + } + + void IAnimationSystem.PauseAnimations() => this.m_remoteObject.SendSetGlobalSpeedAdjustment(0.0f); + + void IAnimationSystem.StepAnimations(int nAdvanceMs) => this.PulseTimeAdvance(nAdvanceMs); + + void IAnimationSystem.ResumeAnimations() => this.m_remoteObject.SendSetGlobalSpeedAdjustment(this.m_flSpeedAdjustment); + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; + + protected override void Invariant() + { + Debug2.Validate(this.m_remoteObject.IsValid, typeof(InvalidOperationException), "RemoteAnimationManager must be connected"); + this.m_ownerSession.AssertOwningThread(); + } + + private void PulseTimeAdvance(int nAdvanceMs) + { + Debug2.Validate(nAdvanceMs > 0, typeof(ArgumentOutOfRangeException), "advanceTime"); + this.m_remoteObject.SendPulseTimeAdvance(nAdvanceMs); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationTarget.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationTarget.cs new file mode 100644 index 0000000..7a60cf3 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/AnimationTarget.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.AnimationTarget +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System.Threading; + +namespace Microsoft.Iris.Render.Animation +{ + internal class AnimationTarget : RenderObject + { + private static int s_targetIdSeed; + private int m_targetId; + private IAnimatableObject m_object; + private string m_property; + + internal AnimationTarget(IAnimatableObject targetObject, string targetPropertyName) + { + int propertyType = (int)targetObject.GetPropertyType(targetPropertyName); + targetObject.RegisterUsage(this); + this.m_targetId = Interlocked.Increment(ref s_targetIdSeed); + this.m_object = targetObject; + this.m_property = targetPropertyName; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + this.m_object.UnregisterUsage(this); + this.m_object = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal int TargetId => this.m_targetId; + + internal IAnimatableObject TargetObject => this.m_object; + + internal string TargetPropertyName => this.m_property; + + internal AnimationInputType TargetPropertyType => this.m_object.GetPropertyType(this.m_property); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs new file mode 100644 index 0000000..1d67e6c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs @@ -0,0 +1,85 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.ExternalAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Animation +{ + internal class ExternalAnimationInput : + SharedRenderObject, + IExternalAnimationInput, + IAnimatableObject, + IAnimatable, + ISharedRenderObject, + IRenderHandleOwner + { + private static uint s_uniqueIdSeed = 1; + private uint m_uniqueId; + private RemoteExternalAnimationInput m_remoteObject; + private IAnimationPropertyMap m_propertyMap; + private RenderSession m_session; + + public ExternalAnimationInput( + object objUser, + RenderSession session, + IAnimationPropertyMap propertyMap) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Debug2.Validate(propertyMap != null, typeof(ArgumentNullException), nameof(propertyMap)); + this.m_uniqueId = s_uniqueIdSeed++; + this.m_propertyMap = propertyMap; + this.m_session = session; + this.m_remoteObject = session.BuildRemoteExternalAnimationInput(this, this.m_uniqueId); + this.RegisterUsage(objUser); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (inDispose && this.m_remoteObject != null) + this.m_remoteObject.Dispose(); + this.m_remoteObject = null; + this.m_propertyMap = null; + this.m_session = null; + } + finally + { + base.Dispose(inDispose); + } + } + + public uint UniqueId => this.m_uniqueId; + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() + { + this.m_uniqueId = 0U; + this.m_remoteObject = null; + } + + RENDERHANDLE IAnimatableObject.GetObjectId() => this.m_remoteObject.RenderHandle; + + uint IAnimatableObject.GetPropertyId(string propertyName) => this.m_propertyMap.GetPropertyId(propertyName); + + AnimationInputType IAnimatableObject.GetPropertyType( + string propertyName) + { + return this.m_propertyMap.GetPropertyType(propertyName); + } + + IAnimationInputProvider IExternalAnimationInput.CreateProvider( + object objUser) + { + return new AnimationInputProvider(objUser, this.m_session, this); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/IActivatableObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/IActivatableObject.cs new file mode 100644 index 0000000..e53006e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/IActivatableObject.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.IActivatableObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Animation +{ + internal interface IActivatableObject : IActivatable + { + RENDERHANDLE GetObjectId(); + + uint GetMethodId(string methodName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/IAnimatableObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/IAnimatableObject.cs new file mode 100644 index 0000000..f83b046 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/IAnimatableObject.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.IAnimatableObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Animation +{ + internal interface IAnimatableObject : IAnimatable, ISharedRenderObject + { + RENDERHANDLE GetObjectId(); + + uint GetPropertyId(string propertyName); + + AnimationInputType GetPropertyType(string propertyName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs new file mode 100644 index 0000000..5c83a76 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs @@ -0,0 +1,567 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.KeyframeAnimation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Animation +{ + internal class KeyframeAnimation : + Microsoft.Iris.Render.Animation.Animation, + IKeyframeAnimation, + IAnimation, + IRenderHandleOwner, + IAnimatableObject, + IAnimatable, + ISharedRenderObject, + IActivatableObject, + IActivatable + { + private static LinearInterpolation s_defaultInterpolation = new LinearInterpolation(); + private AnimationSystem m_animationSystem; + private RemoteAnimation m_remoteObject; + private AnimationInput m_reference; + private AnimationInput m_scale; + private AnimationInputType m_animationType; + private Vector m_keyframeList; + private Vector m_targetList; + private int m_repeatCount; + private bool m_isActive; + private bool m_isPlaying; + private bool m_autoReset; + private AnimationResetBehavior m_resetBehavior; + + internal KeyframeAnimation(AnimationSystem owner, AnimationInput initialValue) + { + this.m_animationSystem = owner; + this.m_reference = null; + this.m_scale = null; + this.m_animationType = initialValue.InputType; + this.m_keyframeList = new Vector(); + this.m_repeatCount = 0; + this.m_autoReset = false; + this.m_resetBehavior = AnimationResetBehavior.LeaveCurrent; + this.m_animationSystem.RegisterUsage(this); + this.m_remoteObject = owner.Session.BuildRemoteAnimation(this, this.m_animationType); + if (this.m_animationSystem.BackCompat) + return; + this.AddKeyframe(new AnimationKeyframe(0.0f, initialValue, s_defaultInterpolation)); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (inDispose) + { + this.RemoveAllEvents(); + this.RemoveAllTargets(); + if (this.m_keyframeList != null) + { + foreach (AnimationKeyframe keyframe in this.m_keyframeList) + keyframe.Value.UnregisterUsage(this); + this.m_keyframeList.Clear(); + } + if (this.m_remoteObject != null) + this.m_remoteObject.Dispose(); + this.m_animationSystem.UnregisterUsage(this); + } + this.m_remoteObject = null; + this.m_reference = null; + this.m_keyframeList = null; + this.m_targetList = null; + this.m_animationSystem = null; + } + finally + { + base.Dispose(inDispose); + } + } + + public override int RepeatCount + { + get => this.m_repeatCount; + set + { + if (this.m_repeatCount == value) + return; + this.m_remoteObject.SendSetRepeatCount(value); + this.m_repeatCount = value; + } + } + + public override bool IsPlaying => this.m_isPlaying; + + public override bool IsActive => this.m_isActive; + + public override bool AutoReset + { + get => this.m_autoReset; + set + { + if (this.m_autoReset == value) + return; + this.m_autoReset = value; + this.m_remoteObject.SendSetAutoReset(value); + } + } + + public override AnimationResetBehavior ResetBehavior + { + get => this.m_resetBehavior; + set + { + if (this.m_resetBehavior == value) + return; + this.m_resetBehavior = value; + this.m_remoteObject.SendSetResetBehavior(value); + } + } + + public override void Play() + { + this.m_isActive = true; + this.m_isPlaying = true; + this.m_remoteObject.SendPlay(); + } + + public override void Pause() + { + if (this.m_isActive) + this.m_isPlaying = false; + this.m_remoteObject.SendPause(); + } + + public override void Reset() + { + this.m_isActive = false; + this.m_isPlaying = false; + this.m_remoteObject.SendReset(); + } + + public override void InstantAdvance(float advanceTime) + { + Debug2.Validate(advanceTime >= 0.0, typeof(ArgumentOutOfRangeException), nameof(advanceTime)); + this.m_remoteObject.SendInstantAdvance(advanceTime); + } + + public override void InstantFinish() => this.m_remoteObject.SendInstantFinish(); + + public AnimationInputType Type => this.m_animationType; + + public AnimationInput InitialValue => this.GetKeyframe(0).Value; + + public int KeyframeCount => this.m_keyframeList.Count; + + public AnimationInput Reference + { + get => this.m_reference; + set + { + this.SendInput(-1, value); + this.m_reference = value; + } + } + + public AnimationInput Scale + { + get => this.m_scale; + set + { + this.SendInput(-2, value); + this.m_scale = value; + } + } + + void IKeyframeAnimation.AddKeyframe(AnimationKeyframe keyframe) + { + Debug2.Validate(keyframe != null, typeof(ArgumentNullException), nameof(keyframe)); + this.AddKeyframe(keyframe); + } + + internal void AddKeyframe(AnimationKeyframe keyframe) + { + this.m_keyframeList.Add(keyframe); + this.m_remoteObject.SendAddKeyframe(this.m_keyframeList.Count - 1, keyframe.Time); + this.SetKeyframe(this.m_keyframeList.Count - 1, keyframe, false); + } + + AnimationKeyframe IKeyframeAnimation.GetKeyframe( + int keyframeIndex) + { + Debug2.Validate(keyframeIndex >= 0 || keyframeIndex < this.m_keyframeList.Count, typeof(ArgumentOutOfRangeException), nameof(keyframeIndex)); + return this.GetKeyframe(keyframeIndex); + } + + internal AnimationKeyframe GetKeyframe(int keyframeIndex) => this.m_keyframeList[keyframeIndex] as AnimationKeyframe; + + void IKeyframeAnimation.SetKeyframe( + int keyframeIndex, + AnimationKeyframe keyframe) + { + Debug2.Validate(keyframe != null, typeof(ArgumentNullException), nameof(keyframe)); + Debug2.Validate(keyframeIndex >= 0 || keyframeIndex < this.m_keyframeList.Count, typeof(ArgumentOutOfRangeException), nameof(keyframeIndex)); + if (keyframeIndex == 0 && !this.m_animationSystem.BackCompat) + Debug2.Validate(keyframe.Time == 0.0, typeof(ArgumentException), "Cannot change the time for keyframe 0"); + this.SetKeyframe(keyframeIndex, keyframe, true); + } + + internal void SetKeyframe(int keyframeIndex, AnimationKeyframe keyframe, bool replaceKeyframe) + { + keyframe.Value.RegisterUsage(this); + if (replaceKeyframe) + { + AnimationKeyframe keyframe1 = (AnimationKeyframe)this.m_keyframeList[keyframeIndex]; + this.m_keyframeList.RemoveAt(keyframeIndex); + this.m_keyframeList.Insert(keyframeIndex, keyframe); + keyframe1.Value.UnregisterUsage(this); + } + this.m_remoteObject.SendSetKeyframeTime(keyframeIndex, keyframe.Time); + this.SendInput(keyframeIndex, keyframe.Value); + this.SendInterpolation(keyframeIndex, keyframe.Interpolation); + } + + void IKeyframeAnimation.AddTarget( + IAnimatable targetObject, + string targetPropertyName) + { + Debug2.Validate(targetObject is IAnimatableObject, typeof(ArgumentException), nameof(targetObject)); + this.AddTarget((IAnimatableObject)targetObject, targetPropertyName, null); + } + + void IKeyframeAnimation.AddTarget( + IAnimatable targetObject, + string targetPropertyName, + string targetMask) + { + Debug2.Validate(targetObject is IAnimatableObject, typeof(ArgumentException), nameof(targetObject)); + this.AddTarget((IAnimatableObject)targetObject, targetPropertyName, targetMask); + } + + internal void AddTarget( + IAnimatableObject targetObject, + string targetPropertyName, + string targetMaskSpec) + { + Debug2.Validate(targetObject != null, typeof(ArgumentNullException), nameof(targetObject)); + Debug2.Validate(targetPropertyName != null, typeof(ArgumentNullException), nameof(targetPropertyName)); + Debug2.Validate(!(targetObject is IAnimation), typeof(ArgumentException), "Animations can't be set as animation targets"); + AnimationTarget target = new AnimationTarget(targetObject, targetPropertyName); + AnimationTypeMask sourceMask = AnimationTypeMask.FromString(targetMaskSpec); + if (!sourceMask.CanMapFromType(this.m_animationType)) + throw new ArgumentException(string.Format("Mask cannot be applied to a {0} animation", m_animationType)); + if (!sourceMask.CanMapToType(target.TargetPropertyType)) + throw new ArgumentException(string.Format("Mask cannot be applied to a property of type {0}", target.TargetPropertyType)); + uint propertyInfo = this.GeneratePropertyInfo(target.TargetPropertyType, sourceMask); + this.m_remoteObject.SendAddTarget(target.TargetId, target.TargetObject.GetObjectId(), target.TargetObject.GetPropertyId(target.TargetPropertyName), propertyInfo); + if (this.m_targetList == null) + this.m_targetList = new Vector(); + this.m_targetList.Add(new KeyframeAnimation.AnimationTargetInfo(target, targetMaskSpec)); + } + + void IKeyframeAnimation.RemoveTarget( + IAnimatable targetObject, + string targetPropertyName, + string targetMaskSpec) + { + Debug2.Validate(targetObject != null, typeof(ArgumentNullException), nameof(targetObject)); + Debug2.Validate(targetPropertyName != null, typeof(ArgumentNullException), nameof(targetPropertyName)); + KeyframeAnimation.AnimationTargetInfo animationTargetInfo = null; + if (this.m_targetList != null) + { + foreach (KeyframeAnimation.AnimationTargetInfo target in this.m_targetList) + { + if (target.Target.TargetObject == targetObject && target.Target.TargetPropertyName == targetPropertyName && string.Compare(target.MaskSpec, targetMaskSpec, StringComparison.OrdinalIgnoreCase) == 0) + { + animationTargetInfo = target; + break; + } + } + } + if (animationTargetInfo == null) + return; + this.m_remoteObject.SendRemoveTarget(animationTargetInfo.Target.TargetId); + this.m_targetList.Remove(animationTargetInfo); + animationTargetInfo.Target.Dispose(); + } + + void IKeyframeAnimation.RemoveAllTargets() => this.RemoveAllTargets(); + + internal void RemoveAllTargets() + { + if (this.m_targetList == null) + return; + foreach (KeyframeAnimation.AnimationTargetInfo target in this.m_targetList) + { + this.m_remoteObject.SendRemoveTarget(target.Target.TargetId); + target.Target.Dispose(); + } + this.m_targetList.Clear(); + } + + void IKeyframeAnimation.AddStageEvent( + AnimationStage animationStage, + AnimationEvent animationEvent) + { + Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); + Debug2.Validate(animationStage < AnimationStage.Count, typeof(ArgumentException), "invalid animation stage"); + RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; + if (!(targetObjectId != RENDERHANDLE.NULL)) + return; + this.m_remoteObject.SendAddStageEvent(animationEvent.EventId, animationStage, targetObjectId, animationEvent.TargetMethodId, animationEvent.TargetMethodArg, animationEvent.InitialActivation, animationEvent.AllowRepeat); + } + + void IKeyframeAnimation.AddTimeEvent( + float absoluteTime, + AnimationEvent animationEvent) + { + Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); + Debug2.Validate(absoluteTime >= 0.0, typeof(ArgumentException), "absoluteTime value must be >= 0.0f"); + RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; + if (!(targetObjectId != RENDERHANDLE.NULL)) + return; + this.m_remoteObject.SendAddTimeEvent(animationEvent.EventId, absoluteTime, targetObjectId, animationEvent.TargetMethodId, animationEvent.TargetMethodArg, animationEvent.InitialActivation, animationEvent.AllowRepeat); + } + + void IKeyframeAnimation.AddProgressEvent( + float progress, + AnimationEvent animationEvent) + { + Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); + Debug2.Validate(progress >= 0.0 && progress <= 1.0, typeof(ArgumentException), "'progress' value must be between 0.0f and 1.0f"); + RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; + if (!(targetObjectId != RENDERHANDLE.NULL)) + return; + this.m_remoteObject.SendAddProgressEvent(animationEvent.EventId, progress, targetObjectId, animationEvent.TargetMethodId, animationEvent.TargetMethodArg, animationEvent.InitialActivation, animationEvent.AllowRepeat); + } + + void IKeyframeAnimation.AddValueEvent( + ValueEventCondition condition, + AnimationInput reference, + AnimationEvent animationEvent) + { + Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); + Debug2.Validate(reference != null, typeof(ArgumentNullException), nameof(reference)); + Debug2.Validate(condition < ValueEventCondition.Count, typeof(ArgumentNullException), nameof(condition)); + RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; + if (!(targetObjectId != RENDERHANDLE.NULL)) + return; + this.SendInput(-3, reference); + this.m_remoteObject.SendAddValueEvent(animationEvent.EventId, condition, targetObjectId, animationEvent.TargetMethodId, animationEvent.TargetMethodArg, animationEvent.InitialActivation, animationEvent.AllowRepeat); + } + + void IKeyframeAnimation.RemoveEvent(AnimationEvent animationEvent) + { + Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); + this.m_remoteObject.SendRemoveEvent(animationEvent.EventId); + } + + void IKeyframeAnimation.RemoveAllEvents() => this.RemoveAllEvents(); + + internal void RemoveAllEvents() => this.m_remoteObject.SendRemoveAllEvents(); + + RENDERHANDLE IAnimatableObject.GetObjectId() => ((IRenderHandleOwner)this).RenderHandle; + + uint IAnimatableObject.GetPropertyId(string propertyName) + { + if (string.Compare(propertyName, OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) + return 1; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: {0}", propertyName); + return 0; + } + + AnimationInputType IAnimatableObject.GetPropertyType( + string propertyName) + { + if (string.Compare(propertyName, OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) + return this.Type; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: {0}", propertyName); + return AnimationInputType.Float; + } + + RENDERHANDLE IActivatableObject.GetObjectId() => ((IRenderHandleOwner)this).RenderHandle; + + uint IActivatableObject.GetMethodId(string methodName) + { + if (string.Compare(methodName, PlayMethod, StringComparison.OrdinalIgnoreCase) == 0) + return 1; + if (string.Compare(methodName, PauseMethod, StringComparison.OrdinalIgnoreCase) == 0) + return 2; + if (string.Compare(methodName, ResetMethod, StringComparison.OrdinalIgnoreCase) == 0) + return 3; + if (string.Compare(methodName, FinishMethod, StringComparison.OrdinalIgnoreCase) == 0) + return 4; + if (string.Compare(methodName, NotifyMethod, StringComparison.OrdinalIgnoreCase) == 0) + return 5; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported method: {0}", methodName); + return 0; + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; + + private void SendInput(int keyframeIndex, AnimationInput input) + { + Debug2.Validate(input != null, typeof(ArgumentNullException), "keyframe.Value.InputType"); + Debug2.Validate(input.InputType == this.m_animationType, typeof(ArgumentException), "keyframe.Value.InputType"); + Debug2.Validate(input.InputType == AnimationInputType.Float || input.InputType == AnimationInputType.Vector2 || (input.InputType == AnimationInputType.Vector3 || input.InputType == AnimationInputType.Vector4) || input.InputType == AnimationInputType.Quaternion, typeof(ArgumentException), "keyframe.Value.InputType"); + int num; + switch (input) + { + case ConstantAnimationInput _: + case ContinuousAnimationInput _: + case CapturedAnimationInput _: + num = 1; + break; + default: + num = input is BinaryOperation ? 1 : 0; + break; + } + System.Type exceptionType = typeof(ArgumentException); + Debug2.Validate(num != 0, exceptionType, "Invalid animation input in keyframe"); + this.m_remoteObject.SendBeginAnimationInput(keyframeIndex); + this.SendInputWorker(keyframeIndex, input); + this.m_remoteObject.SendEndAnimationInput(keyframeIndex); + } + + private void SendInputWorker(int keyframeIndex, AnimationInput input) + { + switch (input) + { + case ConstantAnimationInput _: + ConstantAnimationInput constantAnimationInput = (ConstantAnimationInput)input; + switch (constantAnimationInput.InputType) + { + case AnimationInputType.Float: + this.m_remoteObject.SendSetFloat(keyframeIndex, (float)constantAnimationInput.RawValue); + return; + case AnimationInputType.Vector2: + this.m_remoteObject.SendSetVector2(keyframeIndex, (Vector2)constantAnimationInput.RawValue); + return; + case AnimationInputType.Vector3: + this.m_remoteObject.SendSetVector3(keyframeIndex, (Vector3)constantAnimationInput.RawValue); + return; + case AnimationInputType.Vector4: + this.m_remoteObject.SendSetVector4(keyframeIndex, (Vector4)constantAnimationInput.RawValue); + return; + case AnimationInputType.Quaternion: + this.m_remoteObject.SendSetQuaternion(keyframeIndex, (Quaternion)constantAnimationInput.RawValue); + return; + default: + Debug2.Throw(false, "Unexpected constant input type"); + return; + } + case CapturedAnimationInput _: + uint propertyInfo1 = this.GeneratePropertyInfo(input.SourceType, input.SourceMask); + CapturedAnimationInput capturedAnimationInput = (CapturedAnimationInput)input; + this.m_remoteObject.SendSetCaptured(keyframeIndex, capturedAnimationInput.ObjectId, capturedAnimationInput.PropertyId, propertyInfo1, capturedAnimationInput.RefreshOnRepeat); + break; + case ContinuousAnimationInput _: + uint propertyInfo2 = this.GeneratePropertyInfo(input.SourceType, input.SourceMask); + ContinuousAnimationInput continuousAnimationInput = (ContinuousAnimationInput)input; + this.m_remoteObject.SendSetContinuous(keyframeIndex, continuousAnimationInput.ObjectId, continuousAnimationInput.PropertyId, propertyInfo2); + break; + case BinaryOperation _: + BinaryOperation binaryOperation = (BinaryOperation)input; + this.SendInputWorker(keyframeIndex, binaryOperation.LeftOperand); + this.SendInputWorker(keyframeIndex, binaryOperation.RightOperand); + this.m_remoteObject.SendSetBinaryOperation(keyframeIndex, binaryOperation.Operation); + break; + default: + Debug2.Throw(false, "Unexpected animation input type!"); + break; + } + } + + private void SendInterpolation(int keyframeIndex, AnimationInterpolation interpolation) + { + int num; + switch (interpolation) + { + case LinearInterpolation _: + case ExponentialInterpolation _: + case LogarithmicInterpolation _: + case SCurveInterpolation _: + case SineInterpolation _: + case CosineInterpolation _: + case BezierInterpolation _: + case EaseInInterpolation _: + num = 1; + break; + default: + num = interpolation is EaseOutInterpolation ? 1 : 0; + break; + } + System.Type exceptionType = typeof(ArgumentException); + Debug2.Validate(num != 0, exceptionType, "Invalid interpolation in keyframe"); + int idxKeyframe = !this.m_animationSystem.BackCompat ? (keyframeIndex > 0 ? keyframeIndex - 1 : 0) : keyframeIndex; + switch (interpolation) + { + case LinearInterpolation _: + this.m_remoteObject.SendSetLinear(idxKeyframe, interpolation.UseSphericalCombination); + break; + case ExponentialInterpolation _: + ExponentialInterpolation exponentialInterpolation = (ExponentialInterpolation)interpolation; + this.m_remoteObject.SendSetExponential(idxKeyframe, interpolation.UseSphericalCombination, exponentialInterpolation.Weight); + break; + case LogarithmicInterpolation _: + LogarithmicInterpolation logarithmicInterpolation = (LogarithmicInterpolation)interpolation; + this.m_remoteObject.SendSetLogarithmic(idxKeyframe, interpolation.UseSphericalCombination, logarithmicInterpolation.Weight); + break; + case SCurveInterpolation _: + SCurveInterpolation scurveInterpolation = (SCurveInterpolation)interpolation; + this.m_remoteObject.SendSetSCurve(idxKeyframe, interpolation.UseSphericalCombination, scurveInterpolation.Weight); + break; + case SineInterpolation _: + this.m_remoteObject.SendSetSine(idxKeyframe, interpolation.UseSphericalCombination); + break; + case CosineInterpolation _: + this.m_remoteObject.SendSetCosine(idxKeyframe, interpolation.UseSphericalCombination); + break; + case BezierInterpolation _: + BezierInterpolation bezierInterpolation = (BezierInterpolation)interpolation; + this.m_remoteObject.SendSetBezier(idxKeyframe, interpolation.UseSphericalCombination, bezierInterpolation.ControlPoint1, bezierInterpolation.ControlPoint2); + break; + case EaseInInterpolation _: + EaseInInterpolation easeInInterpolation = (EaseInInterpolation)interpolation; + this.m_remoteObject.SendSetEaseIn(idxKeyframe, interpolation.UseSphericalCombination, easeInInterpolation.Weight, easeInInterpolation.Handle); + break; + case EaseOutInterpolation _: + EaseOutInterpolation outInterpolation = (EaseOutInterpolation)interpolation; + this.m_remoteObject.SendSetEaseOut(idxKeyframe, interpolation.UseSphericalCombination, outInterpolation.Weight, outInterpolation.Handle); + break; + default: + Debug2.Throw(false, "Unexpected interpolation!"); + break; + } + } + + private uint GeneratePropertyInfo(AnimationInputType sourceType, AnimationTypeMask sourceMask) => (uint)((int)(sourceType & (AnimationInputType.Vector4 | AnimationInputType.Quaternion)) << 19 | ((int)sourceMask.ChannelCount & 7) << 16 | sourceMask.MaskCode & ushort.MaxValue); + + private enum KeyframeSlots + { + ValueEvent = -3, // 0xFFFFFFFD + Scale = -2, // 0xFFFFFFFE + Reference = -1, // 0xFFFFFFFF + Default = 0, + } + + private class AnimationTargetInfo + { + internal AnimationTarget Target; + internal string MaskSpec; + + internal AnimationTargetInfo(AnimationTarget target, string maskSpec) + { + this.Target = target; + this.MaskSpec = maskSpec; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs new file mode 100644 index 0000000..32567f5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs @@ -0,0 +1,61 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Animation.ObjectAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Animation +{ + public abstract class ObjectAnimationInput : AnimationInput + { + private IAnimatableObject m_object; + private string m_propertyName; + + protected ObjectAnimationInput( + IAnimatable sourceObject, + string sourcePropertyName, + string sourceMaskSpec) + { + Debug2.Validate(sourceObject is IAnimatableObject, typeof(ArgumentException), nameof(sourceObject)); + Debug2.Validate(sourcePropertyName != null, typeof(ArgumentException), nameof(sourcePropertyName)); + AnimationTypeMask sourceMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.m_object = (IAnimatableObject)sourceObject; + this.m_propertyName = sourcePropertyName; + this.CommonCreate(this.m_object.GetPropertyType(this.m_propertyName), sourceMask); + } + + protected ObjectAnimationInput(IAnimation sourceAnimation, string sourceMaskSpec) + { + Debug2.Validate(sourceAnimation is IAnimatableObject, typeof(ArgumentException), nameof(sourceAnimation)); + AnimationTypeMask sourceMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.m_object = (IAnimatableObject)sourceAnimation; + this.m_propertyName = Animation.OutputProperty; + this.CommonCreate(this.m_object.GetPropertyType(this.m_propertyName), sourceMask); + } + + internal RENDERHANDLE ObjectId => this.m_object.GetObjectId(); + + internal uint PropertyId => this.m_object.GetPropertyId(this.m_propertyName); + + internal override void RegisterUsage(object user) + { + Debug2.Validate(this.m_object != null, typeof(ObjectDisposedException), "Source object doesn't exist anymore"); + this.m_object.RegisterUsage(user); + base.RegisterUsage(user); + } + + internal override void UnregisterUsage(object user) + { + Debug2.Validate(this.m_object != null, typeof(ObjectDisposedException), "Source object doesn't exist anymore"); + bool flag = this.m_object.UsageCount == 1; + this.m_object.UnregisterUsage(user); + if (flag) + this.m_object = null; + base.UnregisterUsage(user); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationEvent.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationEvent.cs new file mode 100644 index 0000000..6c29196 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationEvent.cs @@ -0,0 +1,65 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationEvent +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render +{ + public class AnimationEvent + { + private static int s_eventIdSeed = 1; + private uint m_eventId; + private IActivatableObject m_eventTarget; + private string m_eventMethodName; + private uint m_eventMethodArg; + private bool m_allowRepeat; + private bool m_initialActivation; + + public AnimationEvent(IActivatable eventTarget, string eventMethodName) + : this(eventTarget, eventMethodName, 0U) + { + } + + public AnimationEvent(IActivatable eventTarget, string eventMethodName, uint eventMethodArg) + { + Debug2.Validate(eventTarget != null, typeof(ArgumentNullException), nameof(eventTarget)); + Debug2.Validate(eventTarget is IActivatableObject, typeof(ArgumentException), nameof(eventTarget)); + Debug2.Validate(eventMethodName != null, typeof(ArgumentNullException), nameof(eventMethodName)); + this.m_eventId = AllocateEventId(); + this.m_eventTarget = (IActivatableObject)eventTarget; + this.m_eventMethodName = eventMethodName; + this.m_eventMethodArg = eventMethodArg; + this.m_allowRepeat = false; + } + + ~AnimationEvent() => this.m_eventTarget = null; + + internal uint EventId => this.m_eventId; + + internal RENDERHANDLE TargetObjectId => this.m_eventTarget.GetObjectId(); + + internal uint TargetMethodId => this.m_eventTarget.GetMethodId(this.m_eventMethodName); + + internal uint TargetMethodArg => this.m_eventMethodArg; + + public bool AllowRepeat + { + get => this.m_allowRepeat; + set => this.m_allowRepeat = value; + } + + public bool InitialActivation + { + get => this.m_initialActivation; + set => this.m_initialActivation = value; + } + + private static uint AllocateEventId() => (uint)s_eventIdSeed++; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInput.cs new file mode 100644 index 0000000..fc76690 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInput.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public abstract class AnimationInput + { + private AnimationInputType m_sourceType; + private AnimationInputType m_inputType; + private AnimationTypeMask m_sourceMask; + + protected void CommonCreate(AnimationInputType sourceType, AnimationTypeMask sourceMask) + { + Debug2.Validate(sourceMask.CanMapFromType(sourceType), typeof(ArgumentException), nameof(sourceMask)); + AnimationInputType animationInputType; + switch (sourceMask.ChannelCount) + { + case 0: + animationInputType = sourceType; + break; + case 1: + animationInputType = AnimationInputType.Float; + break; + case 2: + animationInputType = AnimationInputType.Vector2; + break; + case 3: + animationInputType = AnimationInputType.Vector3; + break; + case 4: + animationInputType = AnimationInputType.Vector4; + break; + default: + Debug2.Throw(false, "Masking is limited to four channels"); + animationInputType = sourceType; + break; + } + this.m_sourceType = sourceType; + this.m_sourceMask = sourceMask; + this.m_inputType = animationInputType; + } + + public AnimationInputType InputType => this.m_inputType; + + internal AnimationInputType SourceType => this.m_sourceType; + + internal AnimationTypeMask SourceMask => this.m_sourceMask; + + internal virtual void RegisterUsage(object user) + { + } + + internal virtual void UnregisterUsage(object user) + { + } + + public static AnimationInput operator +(AnimationInput left, AnimationInput right) + { + Debug2.Validate(left != null, typeof(ArgumentNullException), nameof(left)); + Debug2.Validate(right != null, typeof(ArgumentNullException), nameof(right)); + return new BinaryOperation(BinaryOpCode.Add, left, right); + } + + public static AnimationInput operator *(AnimationInput left, AnimationInput right) + { + Debug2.Validate(left != null, typeof(ArgumentNullException), nameof(left)); + Debug2.Validate(right != null, typeof(ArgumentNullException), nameof(right)); + return new BinaryOperation(BinaryOpCode.Multiply, left, right); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationInputType.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInputType.cs new file mode 100644 index 0000000..ca01a62 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInputType.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationInputType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum AnimationInputType + { + Float, + Vector2, + Vector3, + Vector4, + Quaternion, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInterpolation.cs new file mode 100644 index 0000000..0c3b94c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationInterpolation.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public abstract class AnimationInterpolation + { + private bool m_isSpherical; + + protected AnimationInterpolation() => this.m_isSpherical = false; + + public bool UseSphericalCombination + { + get => this.m_isSpherical; + set => this.m_isSpherical = value; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationKeyframe.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationKeyframe.cs new file mode 100644 index 0000000..4b3f346 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationKeyframe.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationKeyframe +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class AnimationKeyframe + { + private float m_time; + private AnimationInput m_value; + private AnimationInterpolation m_interpolation; + + public AnimationKeyframe( + float time, + AnimationInput value, + AnimationInterpolation interpolation) + { + Debug2.Validate(time >= 0.0, typeof(ArgumentException), "'time' must not be negative"); + Debug2.Validate(value != null, typeof(ArgumentNullException), nameof(value)); + Debug2.Validate(interpolation != null, typeof(ArgumentNullException), nameof(interpolation)); + this.m_time = time; + this.m_value = value; + this.m_interpolation = interpolation; + } + + public float Time => this.m_time; + + public AnimationInput Value => this.m_value; + + public AnimationInterpolation Interpolation => this.m_interpolation; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationResetBehavior.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationResetBehavior.cs new file mode 100644 index 0000000..204a4bc --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationResetBehavior.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationResetBehavior +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum AnimationResetBehavior : uint + { + LeaveCurrent, + SetInitialValue, + SetFinalValue, + Count, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationStage.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationStage.cs new file mode 100644 index 0000000..10a62ae --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationStage.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationStage +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum AnimationStage : uint + { + Start, + LoopStart, + LoopComplete, + Complete, + Reset, + Count, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeChannel.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeChannel.cs new file mode 100644 index 0000000..733205a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeChannel.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationTypeChannel +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum AnimationTypeChannel + { + O = 0, + R = 1, + X = 1, + G = 2, + Y = 2, + B = 3, + Z = 3, + A = 4, + W = 4, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeMask.cs b/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeMask.cs new file mode 100644 index 0000000..b545277 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AnimationTypeMask.cs @@ -0,0 +1,237 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AnimationTypeMask +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render +{ + public struct AnimationTypeMask + { + public static readonly AnimationTypeMask Default = new AnimationTypeMask(); + public static readonly AnimationTypeMask X = new AnimationTypeMask(AnimationTypeChannel.X); + public static readonly AnimationTypeMask Y = new AnimationTypeMask(AnimationTypeChannel.Y); + public static readonly AnimationTypeMask Z = new AnimationTypeMask(AnimationTypeChannel.Z); + public static readonly AnimationTypeMask W = new AnimationTypeMask(AnimationTypeChannel.W); + public static readonly AnimationTypeMask A = new AnimationTypeMask(AnimationTypeChannel.W); + public static readonly AnimationTypeMask R = new AnimationTypeMask(AnimationTypeChannel.X); + public static readonly AnimationTypeMask G = new AnimationTypeMask(AnimationTypeChannel.Y); + public static readonly AnimationTypeMask B = new AnimationTypeMask(AnimationTypeChannel.Z); + private byte m_channelCount; + private ushort m_maskCode; + + public AnimationTypeMask(AnimationTypeChannel channel0) + { + this.m_maskCode = 0; + this.m_channelCount = 1; + this[0] = channel0; + } + + public AnimationTypeMask(AnimationTypeChannel channel0, AnimationTypeChannel channel1) + { + this.m_maskCode = 0; + this.m_channelCount = 2; + this[0] = channel0; + this[1] = channel1; + } + + public AnimationTypeMask( + AnimationTypeChannel channel0, + AnimationTypeChannel channel1, + AnimationTypeChannel channel2) + { + this.m_maskCode = 0; + this.m_channelCount = 3; + this[0] = channel0; + this[1] = channel1; + this[2] = channel2; + } + + public AnimationTypeMask( + AnimationTypeChannel channel0, + AnimationTypeChannel channel1, + AnimationTypeChannel channel2, + AnimationTypeChannel channel3) + { + this.m_maskCode = 0; + this.m_channelCount = 4; + this[0] = channel0; + this[1] = channel1; + this[2] = channel2; + this[3] = channel3; + } + + public AnimationTypeChannel this[int channelIndex] + { + get => this.GetChannel(channelIndex); + set => this.SetChannel(channelIndex, value); + } + + internal ushort MaskCode => this.m_maskCode; + + public uint ChannelCount => m_channelCount & 7U; + + public static AnimationTypeMask FromString(string maskSpec) + { + AnimationTypeMask animationTypeMask; + if (string.IsNullOrEmpty(maskSpec)) + { + animationTypeMask = Default; + } + else + { + Debug2.Validate(maskSpec.Length > 0 && maskSpec.Length <= 4, typeof(ArgumentException), "Invalid mask spec"); + ArrayList arrayList = new ArrayList(); + for (int index = 0; index < maskSpec.Length; ++index) + { + switch (maskSpec[index]) + { + case '0': + arrayList.Add(AnimationTypeChannel.O); + break; + case 'A': + case 'a': + arrayList.Add(AnimationTypeChannel.W); + break; + case 'B': + case 'b': + arrayList.Add(AnimationTypeChannel.Z); + break; + case 'G': + case 'g': + arrayList.Add(AnimationTypeChannel.Y); + break; + case 'R': + case 'r': + arrayList.Add(AnimationTypeChannel.X); + break; + case 'W': + case 'w': + arrayList.Add(AnimationTypeChannel.W); + break; + case 'X': + case 'x': + arrayList.Add(AnimationTypeChannel.X); + break; + case 'Y': + case 'y': + arrayList.Add(AnimationTypeChannel.Y); + break; + case 'Z': + case 'z': + arrayList.Add(AnimationTypeChannel.Z); + break; + default: + Debug2.Validate(false, typeof(ArgumentException), "Invalid mask spec: {0}", maskSpec[index]); + break; + } + } + switch (arrayList.Count) + { + case 1: + animationTypeMask = new AnimationTypeMask((AnimationTypeChannel)arrayList[0]); + break; + case 2: + animationTypeMask = new AnimationTypeMask((AnimationTypeChannel)arrayList[0], (AnimationTypeChannel)arrayList[1]); + break; + case 3: + animationTypeMask = new AnimationTypeMask((AnimationTypeChannel)arrayList[0], (AnimationTypeChannel)arrayList[1], (AnimationTypeChannel)arrayList[2]); + break; + case 4: + animationTypeMask = new AnimationTypeMask((AnimationTypeChannel)arrayList[0], (AnimationTypeChannel)arrayList[1], (AnimationTypeChannel)arrayList[2], (AnimationTypeChannel)arrayList[3]); + break; + default: + Debug2.Throw(false, "Too many channels in mask spec!"); + animationTypeMask = Default; + break; + } + } + return animationTypeMask; + } + + public override bool Equals(object obj) => obj is AnimationTypeMask animationTypeMask && animationTypeMask.m_channelCount == m_channelCount && animationTypeMask.m_maskCode == m_maskCode; + + public override int GetHashCode() => this.m_channelCount.GetHashCode() ^ this.m_maskCode.GetHashCode(); + + internal bool CanMapFromType(AnimationInputType animationType) + { + bool flag = true; + AnimationTypeChannel animationTypeChannel; + switch (animationType) + { + case AnimationInputType.Float: + animationTypeChannel = AnimationTypeChannel.X; + break; + case AnimationInputType.Vector2: + animationTypeChannel = AnimationTypeChannel.Y; + break; + case AnimationInputType.Vector3: + animationTypeChannel = AnimationTypeChannel.Z; + break; + case AnimationInputType.Vector4: + case AnimationInputType.Quaternion: + animationTypeChannel = AnimationTypeChannel.W; + break; + default: + animationTypeChannel = AnimationTypeChannel.X; + flag = false; + break; + } + if (this.ChannelCount != 0U) + { + for (int channelIndex = 0; channelIndex < ChannelCount; ++channelIndex) + { + if (this[channelIndex] > animationTypeChannel) + flag = false; + } + } + return flag; + } + + internal bool CanMapToType(AnimationInputType animationType) + { + bool flag; + switch (this.ChannelCount) + { + case 0: + flag = true; + break; + case 1: + flag = animationType == AnimationInputType.Float; + break; + case 2: + flag = animationType == AnimationInputType.Vector2; + break; + case 3: + flag = animationType == AnimationInputType.Vector3; + break; + case 4: + flag = animationType == AnimationInputType.Vector4; + break; + default: + flag = false; + break; + } + return flag; + } + + private AnimationTypeChannel GetChannel(int channelIndex) + { + Debug2.Validate(channelIndex >= 0 && channelIndex <= 3, typeof(ArgumentOutOfRangeException), "Channel index must be between 0 and 3"); + return (AnimationTypeChannel)(m_maskCode >> channelIndex * 4 & 15); + } + + private void SetChannel(int channelIndex, AnimationTypeChannel channel) + { + Debug2.Validate(channelIndex >= 0 && channelIndex <= 3, typeof(ArgumentOutOfRangeException), "Channel index must be between 0 and 3"); + Debug2.Validate(channel >= AnimationTypeChannel.O && channel <= AnimationTypeChannel.W, typeof(ArgumentOutOfRangeException), nameof(channel)); + int num1 = (int)channel << channelIndex * 4; + int num2 = 15 << channelIndex * 4; + this.m_maskCode = (ushort)((m_maskCode & ~num2 | num1 & num2) & ushort.MaxValue); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AsyncNotifyHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/AsyncNotifyHandler.cs new file mode 100644 index 0000000..d9e82db --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AsyncNotifyHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AsyncNotifyHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void AsyncNotifyHandler(int nCookie); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/AxisAngle.cs b/UIX.RenderApi/Microsoft/Iris/Render/AxisAngle.cs new file mode 100644 index 0000000..79e1d9b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/AxisAngle.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.AxisAngle +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct AxisAngle + { + public static readonly AxisAngle Zero = new AxisAngle(new Vector3(0.0f, 0.0f, 0.0f), 0.0f); + public static readonly AxisAngle Identity = new AxisAngle(new Vector3(0.0f, 0.0f, 1f), 0.0f); + private Vector3 m_axis; + private float m_angle; + + public AxisAngle(Vector3 axis, float angle) + { + this.m_axis = axis; + this.m_angle = angle; + } + + public Vector3 Axis + { + get => this.m_axis; + set => this.m_axis = value; + } + + public float Angle + { + get => this.m_angle; + set => this.m_angle = value; + } + + public Quaternion ToQuaternion() => new Quaternion(this.m_axis, this.m_angle); + + public Vector4 ToVector4() => new Vector4(this.m_axis.X, this.m_axis.Y, this.m_axis.Z, this.m_angle); + + public override bool Equals(object obj) => obj is AxisAngle axisAngle && this == axisAngle; + + public static bool operator ==(AxisAngle left, AxisAngle right) => left.Axis == right.Axis && left.Angle == (double)right.Angle; + + public static bool operator !=(AxisAngle left, AxisAngle right) => !(left == right); + + public override int GetHashCode() => this.Axis.GetHashCode() ^ this.Angle.GetHashCode(); + + public override string ToString() => base.ToString(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BackBufferCapturedHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/BackBufferCapturedHandler.cs new file mode 100644 index 0000000..af4e939 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BackBufferCapturedHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BackBufferCapturedHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void BackBufferCapturedHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BezierInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/BezierInterpolation.cs new file mode 100644 index 0000000..4148e62 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BezierInterpolation.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BezierInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public sealed class BezierInterpolation : AnimationInterpolation + { + private float m_controlPoint1; + private float m_controlPoint2; + + public BezierInterpolation(float controlPoint1, float controlPoint2) + { + this.m_controlPoint1 = controlPoint1; + this.m_controlPoint2 = controlPoint2; + } + + internal float ControlPoint1 => this.m_controlPoint1; + + internal float ControlPoint2 => this.m_controlPoint2; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BinaryOpCode.cs b/UIX.RenderApi/Microsoft/Iris/Render/BinaryOpCode.cs new file mode 100644 index 0000000..64c89b2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BinaryOpCode.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BinaryOpCode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum BinaryOpCode + { + Add, + Multiply, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BinaryOperation.cs b/UIX.RenderApi/Microsoft/Iris/Render/BinaryOperation.cs new file mode 100644 index 0000000..78b6ee2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BinaryOperation.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BinaryOperation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public class BinaryOperation : AnimationInput + { + private AnimationInput m_leftInput; + private AnimationInput m_rightInput; + private BinaryOpCode m_opCode; + + public BinaryOperation( + BinaryOpCode opCode, + AnimationInput leftInput, + AnimationInput rightInput) + { + Debug2.Validate(leftInput != null, typeof(ArgumentNullException), nameof(leftInput)); + Debug2.Validate(rightInput != null, typeof(ArgumentNullException), nameof(rightInput)); + this.m_leftInput = leftInput; + this.m_rightInput = rightInput; + this.m_opCode = opCode; + this.CommonCreate(leftInput.InputType, AnimationTypeMask.Default); + } + + public BinaryOpCode Operation => this.m_opCode; + + public AnimationInput LeftOperand => this.m_leftInput; + + public AnimationInput RightOperand => this.m_rightInput; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BlendElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/BlendElement.cs new file mode 100644 index 0000000..d963c06 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BlendElement.cs @@ -0,0 +1,97 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BlendElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class BlendElement : EffectInput + { + private EffectInput m_effectInput1; + private EffectInput m_effectInput2; + private ColorOperation m_colorOperation; + private AlphaOperation m_alphaOperation; + + public BlendElement( + EffectInput effectInput1, + EffectInput effectInput2, + ColorOperation colorOperation, + AlphaOperation alphaOperation) + : this() + { + Debug2.Validate(effectInput1 != null, typeof(ArgumentNullException), nameof(effectInput1)); + Debug2.Validate(effectInput2 != null, typeof(ArgumentNullException), nameof(effectInput2)); + this.m_effectInput1 = effectInput1; + this.m_effectInput2 = effectInput2; + this.m_colorOperation = colorOperation; + this.m_alphaOperation = alphaOperation; + } + + public BlendElement( + EffectInput effectInput1, + EffectInput effectInput2, + ColorOperation colorOperation) + : this() + { + Debug2.Validate(effectInput1 != null, typeof(ArgumentNullException), nameof(effectInput1)); + Debug2.Validate(effectInput2 != null, typeof(ArgumentNullException), nameof(effectInput2)); + this.m_effectInput1 = effectInput1; + this.m_effectInput2 = effectInput2; + this.m_colorOperation = colorOperation; + } + + public BlendElement() + { + this.m_stName = "Blend"; + this.m_typeInput = EffectInputType.Blend; + this.m_alphaOperation = AlphaOperation.Source1; + } + + public EffectInput Input1 + { + get => this.m_effectInput1; + set => this.m_effectInput1 = value; + } + + public EffectInput Input2 + { + get => this.m_effectInput2; + set => this.m_effectInput2 = value; + } + + public ColorOperation ColorOperation + { + get => this.m_colorOperation; + set => this.m_colorOperation = value; + } + + public AlphaOperation AlphaOperation + { + get => this.m_alphaOperation; + set => this.m_alphaOperation = value; + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GenerateClassCacheKey(2, (byte)this.m_colorOperation, cacheKey); + this.GenerateClassCacheKey(2, (byte)this.m_alphaOperation, cacheKey); + this.m_effectInput1.AddCacheKey(cacheKey); + this.m_effectInput2.AddCacheKey(cacheKey); + } + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + 3 + 3 + this.m_effectInput1.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput2.PreProcessProperties(dictionary, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.m_effectInput1.Process(dictProperties) && this.m_effectInput2.Process(dictProperties); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/BrightnessElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/BrightnessElement.cs new file mode 100644 index 0000000..93b9ff6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/BrightnessElement.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.BrightnessElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class BrightnessElement : EffectOperation + { + internal const string BrightnessPropertyName = "Brightness"; + private float m_flBrightness; + private byte m_nBrightnessID; + + public BrightnessElement(string stName, float flBrightness) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flBrightness >= -1.0 && flBrightness <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Brightness is [-1..1]"); + this.m_flBrightness = flBrightness; + this.m_stName = stName; + } + + public BrightnessElement() => this.m_typeOperation = EffectOperationType.Brightness; + + public float Brightness + { + get => this.m_flBrightness; + set => this.m_flBrightness = value; + } + + internal byte BrightnessID => this.m_nBrightnessID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Brightness", 8, ref this.m_nBrightnessID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Brightness", EffectPropertyType.Float, m_flBrightness, this.m_nBrightnessID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Brightness", this.BrightnessID, this.Brightness, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/CapturedAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/CapturedAnimationInput.cs new file mode 100644 index 0000000..a6d6651 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/CapturedAnimationInput.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.CapturedAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; + +namespace Microsoft.Iris.Render +{ + public sealed class CapturedAnimationInput : ObjectAnimationInput + { + private bool m_refreshOnRepeat; + + public CapturedAnimationInput(IAnimatable sourceObject, string sourcePropertyName) + : this(sourceObject, sourcePropertyName, null) + { + } + + public CapturedAnimationInput( + IAnimatable sourceObject, + string sourcePropertyName, + string sourceMaskSpec) + : base(sourceObject, sourcePropertyName, sourceMaskSpec) + { + } + + public CapturedAnimationInput(IAnimation sourceAnimation) + : this(sourceAnimation, null) + { + } + + public CapturedAnimationInput(IAnimation sourceAnimation, string sourceMaskSpec) + : base(sourceAnimation, sourceMaskSpec) + { + } + + public bool RefreshOnRepeat + { + get => this.m_refreshOnRepeat; + set => this.m_refreshOnRepeat = value; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/CloseHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/CloseHandler.cs new file mode 100644 index 0000000..86fb709 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/CloseHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.CloseHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void CloseHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/CloseRequestHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/CloseRequestHandler.cs new file mode 100644 index 0000000..edae4d9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/CloseRequestHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.CloseRequestHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void CloseRequestHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ColorElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/ColorElement.cs new file mode 100644 index 0000000..d2a9c77 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ColorElement.cs @@ -0,0 +1,61 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ColorElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; + +namespace Microsoft.Iris.Render +{ + public class ColorElement : EffectInput + { + internal const string ColorPropertyName = "Color"; + private ColorF m_clrColor; + private byte m_nColorID; + private static ColorF s_defaultColor = new ColorF(0, 0, 0, 0); + + public ColorElement(string stName, ColorF clrSolid) + { + this.m_stName = stName; + this.m_typeInput = EffectInputType.Color; + this.m_clrColor = clrSolid; + } + + public ColorElement(string stName) + : this(stName, DefaultColor) + { + } + + public ColorElement() + : this("", DefaultColor) + { + } + + public ColorF Color + { + get => this.m_clrColor; + set => this.m_clrColor = value; + } + + internal byte ColorID => this.m_nColorID; + + internal static ColorF DefaultColor => s_defaultColor; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Color", 20, ref this.m_nColorID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Color", EffectPropertyType.Color, m_clrColor, this.m_nColorID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Color", this.ColorID, this.Color.ToVector4(), cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs b/UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs new file mode 100644 index 0000000..57a6f46 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs @@ -0,0 +1,219 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ColorF +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct ColorF + { + private const int ARGBAlphaShift = 24; + private const int ARGBRedShift = 16; + private const int ARGBGreenShift = 8; + private const int ARGBBlueShift = 0; + private float m_flA; + private float m_flR; + private float m_flG; + private float m_flB; + + public ColorF(int red, int green, int blue) => this = FromArgb(byte.MaxValue, red, green, blue); + + public ColorF(float red, float green, float blue) + { + this.m_flA = 1f; + this.m_flR = red; + this.m_flG = green; + this.m_flB = blue; + } + + public ColorF(int alpha, int red, int green, int blue) => this = FromArgb(alpha, red, green, blue); + + public ColorF(float alpha, float red, float green, float blue) + { + this.m_flA = alpha; + this.m_flR = red; + this.m_flG = green; + this.m_flB = blue; + } + + public float R + { + get => this.m_flR; + set => this.m_flR = value; + } + + public float G + { + get => this.m_flG; + set => this.m_flG = value; + } + + public float B + { + get => this.m_flB; + set => this.m_flB = value; + } + + public float A + { + get => this.m_flA; + set => this.m_flA = value; + } + + public uint PackedInt + { + get => (uint)(ChannelToByte(this.m_flA) << 24 | ChannelToByte(this.m_flR) << 16 | ChannelToByte(this.m_flG) << 8) | ChannelToByte(this.m_flB); + set => this = FromArgb(value); + } + + private static float CheckByte(int value, string name) + { + if (value < 0 || value > byte.MaxValue) + throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0 and 255.", value, name), name); + return value / (float)byte.MaxValue; + } + + private static byte ChannelToByte(float flChannel) => (byte)Math.Round(Math.Max(Math.Min(1f, flChannel), 0.0f) * (double)byte.MaxValue); + + private static uint MakeArgb(byte alpha, byte red, byte green, byte blue) => (uint)(red << 16 | green << 8 | blue | alpha << 24); + + internal static ColorF FromCOLORREF(Win32Api.COLORREF cr) => FromArgb(Win32Api.GetRValue(cr), Win32Api.GetGValue(cr), Win32Api.GetBValue(cr)); + + public static ColorF FromArgb(uint argb) => new ColorF((int)(argb >> 24) & byte.MaxValue, (int)(argb >> 16) & byte.MaxValue, (int)(argb >> 8) & byte.MaxValue, (int)argb & byte.MaxValue); + + public static ColorF FromArgb(int alpha, int red, int green, int blue) => new ColorF(CheckByte(alpha, nameof(alpha)), CheckByte(red, nameof(red)), CheckByte(green, nameof(green)), CheckByte(blue, nameof(blue))); + + public static ColorF FromArgb(int red, int green, int blue) => FromArgb(byte.MaxValue, red, green, blue); + + internal Win32Api.COLORREF ToCOLORREF() => Win32Api.RGB(ChannelToByte(this.m_flR), ChannelToByte(this.m_flG), ChannelToByte(this.m_flB)); + + internal Win32Api.COLORREF ToCOLORREF2() => Win32Api.ARGB(ChannelToByte(this.m_flA), ChannelToByte(this.m_flR), ChannelToByte(this.m_flG), ChannelToByte(this.m_flB)); + + internal float GetValue() + { + float num1 = this.m_flR; + float num2 = this.m_flR; + if (m_flG > (double)num1) + num1 = this.m_flG; + if (m_flB > (double)num1) + num1 = this.m_flB; + if (m_flG < (double)num2) + num2 = this.m_flG; + if (m_flB < (double)num2) + num2 = this.m_flB; + return (float)((num1 + (double)num2) / 2.0); + } + + internal float GetHue() + { + if (Math2.WithinEpsilon(this.m_flR, this.m_flG) && Math2.WithinEpsilon(this.m_flG, this.m_flB)) + return 0.0f; + float num1 = 0.0f; + float num2 = this.m_flR; + float num3 = this.m_flR; + if (m_flG > (double)num2) + num2 = this.m_flG; + if (m_flB > (double)num2) + num2 = this.m_flB; + if (m_flG < (double)num3) + num3 = this.m_flG; + if (m_flB < (double)num3) + num3 = this.m_flB; + float num4 = num2 - num3; + if (m_flR == (double)num2) + num1 = (this.m_flG - this.m_flB) / num4; + else if (m_flG == (double)num2) + num1 = (float)(2.0 + (m_flB - (double)this.m_flR) / num4); + else if (m_flB == (double)num2) + num1 = (float)(4.0 + (m_flR - (double)this.m_flG) / num4); + float num5 = num1 * 60f; + if (num5 < 0.0) + num5 += 360f; + return num5; + } + + internal float GetSaturation() + { + float num = 0.0f; + float flValue1 = this.m_flR; + float flValue2 = this.m_flR; + if (m_flG > (double)flValue1) + flValue1 = this.m_flG; + if (m_flB > (double)flValue1) + flValue1 = this.m_flB; + if (m_flG < (double)flValue2) + flValue2 = this.m_flG; + if (m_flB < (double)flValue2) + flValue2 = this.m_flB; + if (!Math2.WithinEpsilon(flValue1, flValue2)) + num = (flValue1 + (double)flValue2) / 2.0 > 0.5 ? (float)((flValue1 - (double)flValue2) / (2.0 - flValue1 - flValue2)) : (float)((flValue1 - (double)flValue2) / (flValue1 + (double)flValue2)); + return num; + } + + internal static ColorF FromHSV( + float flAlpha, + float flHue, + float flSaturation, + float flValue) + { + Debug2.Validate(flHue >= 0.0 && flHue < 360.0, typeof(ArgumentOutOfRangeException), nameof(flHue)); + Debug2.Validate(flSaturation >= 0.0 && flSaturation <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flSaturation)); + Debug2.Validate(flValue >= 0.0 && flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); + if (Math2.WithinEpsilon(flSaturation, 0.0f)) + return new ColorF(flAlpha, flValue, flValue, flValue); + float num1 = flHue / 60f; + int num2 = (int)Math.Floor(num1) % 6; + float num3 = num1 - num2; + float num4 = flValue * (1f - flSaturation); + float num5 = flValue * (float)(1.0 - num3 * (double)flSaturation); + float num6 = flValue * (float)(1.0 - (1.0 - num3) * flSaturation); + switch (num2) + { + case 0: + return new ColorF(flAlpha, flValue, num6, num4); + case 1: + return new ColorF(flAlpha, num5, flValue, num4); + case 2: + return new ColorF(flAlpha, num4, flValue, num6); + case 3: + return new ColorF(flAlpha, num4, num5, flValue); + case 4: + return new ColorF(flAlpha, num6, num4, flValue); + case 5: + return new ColorF(flAlpha, flValue, num4, num5); + default: + return new ColorF(flAlpha, 0.0f, 0.0f, 0.0f); + } + } + + public static bool operator ==(ColorF left, ColorF right) => Math2.WithinEpsilon(left.A, right.A) && Math2.WithinEpsilon(left.R, right.R) && Math2.WithinEpsilon(left.G, right.G) && Math2.WithinEpsilon(left.B, right.B); + + public static bool operator !=(ColorF left, ColorF right) => !Math2.WithinEpsilon(left.A, right.A) || !Math2.WithinEpsilon(left.R, right.R) || !Math2.WithinEpsilon(left.G, right.G) || !Math2.WithinEpsilon(left.B, right.B); + + public override bool Equals(object obj) => obj is ColorF colorF && this == colorF; + + public Vector4 ToVector4() => new Vector4(this.m_flR, this.m_flG, this.m_flB, this.m_flA); + + public static ColorF operator *(ColorF color, float value) => new ColorF(color.A * value, color.R * value, color.G * value, color.B * value); + + public static ColorF operator +(ColorF left, ColorF right) => new ColorF(left.A + right.A, left.R + right.R, left.G + right.G, left.B + right.B); + + public void Clamp() + { + this.m_flA = Math.Min(Math.Max(0.0f, this.m_flA), 1f); + this.m_flR = Math.Min(Math.Max(0.0f, this.m_flR), 1f); + this.m_flG = Math.Min(Math.Max(0.0f, this.m_flG), 1f); + this.m_flB = Math.Min(Math.Max(0.0f, this.m_flB), 1f); + } + + public override string ToString() => base.ToString(); + + public override int GetHashCode() => this.PackedInt.GetHashCode(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ColorOperation.cs b/UIX.RenderApi/Microsoft/Iris/Render/ColorOperation.cs new file mode 100644 index 0000000..54b41ea --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ColorOperation.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ColorOperation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum ColorOperation + { + Add = 0, + LinearDodge = 0, + Subtract = 1, + Multiply = 2, + Lighten = 3, + Darken = 4, + ColorDodge = 5, + ColorBurn = 6, + Screen = 7, + Overlay = 8, + SoftLight = 9, + HardLight = 10, // 0x0000000A + LinearBurn = 11, // 0x0000000B + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/ByteBuilder.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/ByteBuilder.cs new file mode 100644 index 0000000..60b2749 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/ByteBuilder.cs @@ -0,0 +1,91 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.ByteBuilder +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Common +{ + internal class ByteBuilder + { + private byte[] m_data; + private int m_nCurrentIndex; + private byte m_nHashCode; + + internal ByteBuilder(int nMaxSize) + { + this.m_data = new byte[nMaxSize]; + this.m_nCurrentIndex = 0; + this.m_nHashCode = 0; + } + + internal int Capacity => this.m_data.Length; + + internal int Size => this.m_nCurrentIndex; + + internal void AppendByte(byte data) + { + this.m_data[this.m_nCurrentIndex] = data; + ++this.m_nCurrentIndex; + } + + internal unsafe void AppendInt(int nData) + { + Marshal.Copy(new IntPtr(&nData), this.m_data, this.m_nCurrentIndex, 4); + this.m_nCurrentIndex += 4; + } + + internal unsafe void AppendFloat(float fData) + { + Marshal.Copy(new IntPtr(&fData), this.m_data, this.m_nCurrentIndex, 4); + this.m_nCurrentIndex += 4; + } + + internal unsafe void AppendVector(Vector2 vData) + { + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector2)); + this.m_nCurrentIndex += 8; + } + + internal unsafe void AppendVector(Vector3 vData) + { + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector3)); + this.m_nCurrentIndex += 12; + } + + internal unsafe void AppendVector(Vector4 vData) + { + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector4)); + this.m_nCurrentIndex += 16; + } + + internal void Reset() => this.m_nCurrentIndex = 0; + + public override int GetHashCode() + { + if (this.m_nHashCode != 0) + return m_nHashCode; + int num = 0; + for (int index = 0; index < this.m_nCurrentIndex; ++index) + num += this.m_data[index]; + this.m_nHashCode = (byte)num; + return m_nHashCode; + } + + public override bool Equals(object obj) + { + ByteBuilder byteBuilder = obj as ByteBuilder; + if (byteBuilder.Size != this.Size) + return false; + for (int index = 0; index < this.Size; ++index) + { + if (this.m_data[index] != byteBuilder.m_data[index]) + return false; + } + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/CachedRenderObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/CachedRenderObject.cs new file mode 100644 index 0000000..63032a2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/CachedRenderObject.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.CachedRenderObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Common +{ + internal abstract class CachedRenderObject : SharedRenderObject + { + private ObjectCache m_cache; + + internal ObjectCache Cache + { + get => this.m_cache; + set => this.m_cache = value; + } + + internal override void UnregisterUsage(object user) + { + if (this.UsageCount == 1 && this.m_cache != null && this.m_cache.Add(this)) + this.Reset(); + base.UnregisterUsage(user); + } + + internal abstract void Reset(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/Debug2.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/Debug2.cs new file mode 100644 index 0000000..e318118 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/Debug2.cs @@ -0,0 +1,297 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.Debug2 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; +using System.Globalization; + +namespace Microsoft.Iris.Render.Common +{ + internal static class Debug2 + { + private static IDebug s_debug; + + internal static IDebug Module + { + get => s_debug; + set => s_debug = value; + } + + [Conditional("DEBUG")] + internal static void Enter(string stBlock) + { + if (s_debug == null) + return; + s_debug.Enter(stBlock); + } + + [Conditional("DEBUG")] + internal static void Leave(string stBlock) + { + if (s_debug == null) + return; + s_debug.Leave(stBlock); + } + + [Conditional("DEBUG")] + internal static void Assert(bool condition, string stMessage) + { + if (condition || s_debug == null) + return; + s_debug.Assert(condition, stMessage); + } + + [Conditional("DEBUG")] + internal static void Assert(bool condition, string format, object arg1) + { + if (condition || s_debug == null) + return; + s_debug.Assert(condition, string.Format(format, arg1)); + } + + [Conditional("DEBUG")] + internal static void Assert(bool condition, string format, object arg1, object arg2) + { + if (condition || s_debug == null) + return; + s_debug.Assert(condition, string.Format(format, arg1, arg2)); + } + + internal static void Throw(bool condition, string format) + { + if (!condition) + { + if (s_debug != null) + s_debug.Throw(condition, format); + throw new InvalidOperationException(format); + } + } + + internal static void Throw(bool condition, string format, object arg1) + { + if (!condition) + { + if (s_debug != null) + s_debug.Throw(condition, string.Format(format, arg1)); + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, format, arg1)); + } + } + + internal static void Validate(bool condition, Type exceptionType, string arg1) + { + if (!condition) + { + if (exceptionType == null) + exceptionType = typeof(ArgumentException); + throw (Exception)Activator.CreateInstance(exceptionType, (object)arg1); + } + } + + internal static void Validate(bool condition, Type exceptionType, object arg1, object arg2) + { + if (!condition) + { + if (exceptionType == null) + exceptionType = typeof(ArgumentException); + throw (Exception)Activator.CreateInstance(exceptionType, arg1, arg2); + } + } + + [Conditional("DEBUG")] + internal static void Write(DebugCategory category, int verbosityLevel, string message) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.Write(category, verbosityLevel, message); + } + + [Conditional("DEBUG")] + internal static void WriteLine(DebugCategory category, int verbosityLevel, string format) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, format); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2, + object arg3) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2, + object arg3, + object arg4) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2, + object arg3, + object arg4, + object arg5) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2, + object arg3, + object arg4, + object arg5, + object arg6) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6)); + } + + [Conditional("DEBUG")] + internal static void WriteLine( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2, + object arg3, + object arg4, + object arg5, + object arg6, + object arg7) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7)); + } + + [Conditional("DEBUG")] + internal static void Indent(DebugCategory category, int verbosityLevel) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.Indent(category, verbosityLevel); + } + + [Conditional("DEBUG")] + internal static void Unindent(DebugCategory category, int verbosityLevel) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + return; + s_debug.Unindent(category, verbosityLevel); + } + + [Conditional("DEBUG")] + internal static void OpenBrace(DebugCategory category, int verbosityLevel) + { + } + + [Conditional("DEBUG")] + internal static void OpenBrace(DebugCategory category, int verbosityLevel, string format) + { + } + + [Conditional("DEBUG")] + internal static void OpenBrace( + DebugCategory category, + int verbosityLevel, + string format, + object arg1) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + ; + } + + [Conditional("DEBUG")] + internal static void OpenBrace( + DebugCategory category, + int verbosityLevel, + string format, + object arg1, + object arg2) + { + if (!IsCategoryEnabled(category, verbosityLevel)) + ; + } + + [Conditional("DEBUG")] + internal static void CloseBrace(DebugCategory category, int verbosityLevel) + { + } + + internal static bool IsCategoryEnabled(DebugCategory category, int verbosityLevel) => s_debug != null && s_debug.IsCategoryEnabled(category, verbosityLevel); + + internal static void DumpException(Debug2.ExceptionType exceptionType, Exception e) + { + switch (exceptionType) + { + default: + Exception innerException = e.InnerException; + break; + } + } + + public enum ExceptionType + { + NotHandled, + Recovered, + Ignored, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredHandler.cs new file mode 100644 index 0000000..3358510 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.DeferredHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Common +{ + internal delegate void DeferredHandler(object args); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs new file mode 100644 index 0000000..22489e9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.DeferredInvokeItem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Common +{ + internal class DeferredInvokeItem : IDeferredInvokeItem + { + private Delegate m_method; + private object m_args; + private SharedRenderObject m_owner; + + internal DeferredInvokeItem(SharedRenderObject owner, Delegate method, object args) + { + this.m_method = method; + this.m_args = args; + this.m_owner = owner; + if (this.m_owner == null) + return; + this.m_owner.RegisterUsage(this); + } + + public void Dispatch() + { + ((DeferredHandler)this.m_method)(this.m_args); + if (this.m_owner == null) + return; + this.m_owner.UnregisterUsage(this); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCache.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCache.cs new file mode 100644 index 0000000..b42d24b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCache.cs @@ -0,0 +1,127 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.ObjectCache +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Common +{ + internal class ObjectCache : RenderObject + { + private const int k_nReductionThreshold = 3; + private Vector m_listObjects; + private int m_nMaxCacheSize; + private int m_nMinCacheSize; + private int m_nStepSize; + private int m_cCacheMisses; + private int m_cCacheHits; + private bool m_fWasCacheFull; + private int m_cReductionRequests; + + internal ObjectCache(int nMinSize, int nMaxSize, int nStepSize) + { + this.m_listObjects = new Vector(nMinSize); + this.m_nMinCacheSize = nMinSize; + this.m_nMaxCacheSize = nMaxSize; + this.m_nStepSize = nStepSize; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + foreach (CachedRenderObject listObject in this.m_listObjects) + { + listObject.Cache = null; + listObject.UnregisterUsage(this); + } + } + this.m_listObjects = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal int Size => this.m_listObjects.Count; + + internal bool Add(CachedRenderObject obj) + { + if (this.m_listObjects.Count < this.m_listObjects.Capacity) + { + obj.RegisterUsage(this); + this.m_listObjects.Add(obj); + return true; + } + this.m_fWasCacheFull = true; + return false; + } + + internal CachedRenderObject Remove(object objUser) + { + if (this.m_listObjects.Count > 0) + { + ++this.m_cCacheHits; + int index = this.m_listObjects.Count - 1; + CachedRenderObject listObject = this.m_listObjects[index]; + this.m_listObjects.RemoveAt(index); + listObject.RegisterUsage(objUser); + listObject.UnregisterUsage(this); + return listObject; + } + ++this.m_cCacheMisses; + return null; + } + + internal void RemoveAll() + { + foreach (CachedRenderObject listObject in this.m_listObjects) + { + listObject.Cache = null; + listObject.UnregisterUsage(this); + } + this.m_listObjects.Clear(); + } + + internal void Update() + { + if (this.ShouldGrowCache()) + this.m_listObjects.Capacity = Math.Min(this.m_listObjects.Capacity + this.m_nStepSize, this.m_nMaxCacheSize); + else if (this.ShouldShrinkCache()) + { + if (this.m_cReductionRequests > 3) + { + int num = Math.Max(this.m_listObjects.Capacity - this.m_nStepSize, this.m_nMinCacheSize); + if (this.m_listObjects.Count - num > 0) + { + for (int index = this.m_listObjects.Count - 1; index >= num; --index) + { + CachedRenderObject listObject = this.m_listObjects[index]; + listObject.Cache = null; + listObject.UnregisterUsage(this); + this.m_listObjects.RemoveAt(index); + } + } + this.m_listObjects.Capacity = num; + this.m_cReductionRequests = 0; + } + else + ++this.m_cReductionRequests; + } + else + this.m_cReductionRequests = 0; + this.m_cCacheMisses = 0; + this.m_cCacheHits = 0; + this.m_fWasCacheFull = false; + } + + private bool ShouldGrowCache() => this.m_cCacheMisses > 0 && this.m_fWasCacheFull && this.m_listObjects.Capacity < this.m_nMaxCacheSize; + + private bool ShouldShrinkCache() => this.m_cCacheMisses + this.m_cCacheHits == 0 && this.m_listObjects.Capacity > this.m_nMinCacheSize; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCacheManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCacheManager.cs new file mode 100644 index 0000000..5eb62c0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/ObjectCacheManager.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.ObjectCacheManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Common +{ + internal class ObjectCacheManager + { + private RenderSession m_sesion; + private Vector m_listCaches; + private bool m_fPendingUpdateCache; + private readonly DeferredHandler m_cbUpdateCache; + + internal ObjectCacheManager(RenderSession session, int nInitialSize) + { + this.m_sesion = session; + this.m_listCaches = new Vector(nInitialSize); + this.m_cbUpdateCache = new DeferredHandler(this.UpdateCache); + } + + internal void RegisterCache(ObjectCache cache) + { + this.m_listCaches.Add(cache); + this.ScheduleUpdateCache(); + } + + internal void UnregisterCache(ObjectCache cache) => this.m_listCaches.Remove(cache); + + private void UpdateCache(object arg) + { + this.m_fPendingUpdateCache = false; + for (int index = this.m_listCaches.Count - 1; index >= 0; --index) + this.m_listCaches[index].Update(); + this.ScheduleUpdateCache(); + } + + private void ScheduleUpdateCache() + { + if (this.m_fPendingUpdateCache || this.m_listCaches.Count <= 0) + return; + this.m_sesion.DeferredInvoke(m_cbUpdateCache, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); + this.m_fPendingUpdateCache = true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/RenderObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/RenderObject.cs new file mode 100644 index 0000000..87a1b86 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/RenderObject.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.RenderObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Common +{ + internal abstract class RenderObject : IRenderObject, IDisposable + { + private bool m_fObjectDisposed; + + internal RenderObject() => this.m_fObjectDisposed = false; + + ~RenderObject() + { + if (this.m_fObjectDisposed) + return; + this.Dispose(false); + } + + public void Dispose() + { + if (this.m_fObjectDisposed) + return; + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool fInDispose) => this.m_fObjectDisposed = true; + + internal string DebugDescription + { + get => ""; + set + { + } + } + + [Conditional("DEBUG")] + protected virtual void Invariant() => Debug2.Validate(!this.m_fObjectDisposed, typeof(ObjectDisposedException), this.GetType().ToString()); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/ResourceTracker.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/ResourceTracker.cs new file mode 100644 index 0000000..bd7e152 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/ResourceTracker.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.ResourceTracker +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Common +{ + internal class ResourceTracker + { + private int m_cUsers; + private static uint s_uNextUsage; + private uint m_uLastUsage; + private ResourceTracker.UsageChangeHandler m_handler; + + internal ResourceTracker(ResourceTracker.UsageChangeHandler handler) => this.m_handler = handler; + + internal bool InUse => this.m_cUsers > 0; + + internal uint LastUsage => this.m_uLastUsage; + + internal void AddActiveUser(object oUser) + { + ++this.m_cUsers; + this.m_uLastUsage = uint.MaxValue; + if (this.m_cUsers != 1) + return; + this.NotifyUsageChange(true); + } + + internal void RemoveActiveUser(object oUser) + { + --this.m_cUsers; + if (this.m_cUsers != 0) + return; + this.m_uLastUsage = s_uNextUsage++; + this.NotifyUsageChange(false); + } + + protected virtual void NotifyUsageChange(bool fInUse) + { + if (this.m_handler == null) + return; + this.m_handler(fInUse); + } + + internal delegate void UsageChangeHandler(bool fInUse); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedRenderObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedRenderObject.cs new file mode 100644 index 0000000..4f7a332 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedRenderObject.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.SharedRenderObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Common +{ + internal class SharedRenderObject : ISharedRenderObject + { + private int m_cUsers; + + internal SharedRenderObject() + { + } + + ~SharedRenderObject() => this.Dispose(false); + + private void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool fInDispose) + { + } + + int ISharedRenderObject.UsageCount => this.m_cUsers; + + void ISharedRenderObject.RegisterUsage(object user) => this.RegisterUsage(user); + + void ISharedRenderObject.UnregisterUsage(object user) => this.UnregisterUsage(user); + + internal virtual void RegisterUsage(object user) => ++this.m_cUsers; + + internal virtual void UnregisterUsage(object user) + { + --this.m_cUsers; + if (this.m_cUsers != 0) + return; + this.Dispose(); + } + + internal int UsageCount => this.m_cUsers; + + [Conditional("DEBUG")] + public static void DEBUG_BeginTrackingObjects() + { + } + + [Conditional("DEBUG")] + public static void DEBUG_StopTrackingObjects() + { + } + + internal string DebugDescription + { + get => ""; + set + { + } + } + + [Conditional("DEBUG")] + protected virtual void Invariant() + { + } + + [Conditional("DEBUG")] + private void Invariant(bool fValidateUsers) + { + if (!fValidateUsers) + return; + Debug2.Validate(this.m_cUsers > 0, typeof(ObjectDisposedException), "No registered user"); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResource.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResource.cs new file mode 100644 index 0000000..405895e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResource.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.SharedResource +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; + +namespace Microsoft.Iris.Render.Common +{ + internal abstract class SharedResource : SharedRenderObject + { + protected RenderSession m_session; + private ResourceTracker m_resourceTracker; + + internal SharedResource(RenderSession session) => this.m_session = session; + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose) + return; + ResourceTracker resourceTracker1 = this.m_resourceTracker; + if (this.m_session == null || !this.m_session.IsValid) + return; + ResourceTracker resourceTracker2 = this.m_resourceTracker; + } + finally + { + base.Dispose(fInDispose); + } + } + + public bool InUse => this.m_resourceTracker != null && this.m_resourceTracker.InUse; + + public uint LastUsage => this.m_resourceTracker == null ? 0U : this.m_resourceTracker.LastUsage; + + public void AddActiveUser(object oUser) + { + if (this.m_resourceTracker == null) + this.m_resourceTracker = new ResourceTracker(new ResourceTracker.UsageChangeHandler(this.OnUsageChange)); + this.m_resourceTracker.AddActiveUser(oUser); + } + + public void RemoveActiveUser(object oUser) + { + this.m_resourceTracker.RemoveActiveUser(oUser); + if (this.m_resourceTracker.InUse) + return; + this.m_resourceTracker = null; + } + + protected abstract void OnUsageChange(bool fUsed); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResourceArray.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResourceArray.cs new file mode 100644 index 0000000..0724b73 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/SharedResourceArray.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.SharedResourceArray +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; + +namespace Microsoft.Iris.Render.Common +{ + internal class SharedResourceArray : SharedResource + { + private SharedResource[] m_rgResources; + + internal SharedResourceArray(SharedResource resource) + : base(null) + { + this.m_rgResources = new SharedResource[1]; + this.m_rgResources[0] = resource; + } + + internal SharedResourceArray(SharedResource[] rgResources) + : base(null) + => this.m_rgResources = rgResources; + + protected override void OnUsageChange(bool fUsed) + { + for (int index = 0; index < this.m_rgResources.Length; ++index) + { + if (this.m_rgResources[index] != null) + { + if (fUsed) + this.m_rgResources[index].AddActiveUser(this); + else + this.m_rgResources[index].RemoveActiveUser(this); + } + } + } + + internal override void RegisterUsage(object user) + { + base.RegisterUsage(user); + foreach (SharedRenderObject rgResource in this.m_rgResources) + rgResource.RegisterUsage(user); + } + + internal override void UnregisterUsage(object user) + { + foreach (SharedRenderObject rgResource in this.m_rgResources) + rgResource.UnregisterUsage(user); + base.UnregisterUsage(user); + } + + internal SharedResource[] Resources => this.m_rgResources; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Common/SmartMap`1.cs b/UIX.RenderApi/Microsoft/Iris/Render/Common/SmartMap`1.cs new file mode 100644 index 0000000..b706cbf --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Common/SmartMap`1.cs @@ -0,0 +1,152 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Common.SmartMap`1 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Common +{ + internal struct SmartMap + { + private SmartMap.Entry[] m_entryList; + + public int Count + { + get + { + int num = 0; + if (this.m_entryList != null) + num = this.m_entryList.Length; + return num; + } + } + + public bool IsEmpty => this.Count == 0; + + public bool Lookup(T desired, out uint key) + { + if (this.m_entryList != null) + { + foreach (SmartMap.Entry entry in this.m_entryList) + { + if (entry.oData.Equals(desired)) + { + key = entry.key; + return true; + } + } + } + key = 0U; + return false; + } + + public bool TryGetValue(uint key, out T value) + { + int index = this.IndexOf(key); + if (index >= 0) + { + value = this.m_entryList[index].oData; + return true; + } + value = default(T); + return false; + } + + public void Remove(uint key) + { + int slotIndex = this.IndexOf(key); + if (slotIndex < 0) + return; + this.Remove(slotIndex); + } + + public void SetValue(uint key, T value) + { + int index = this.IndexOf(key); + if (index >= 0) + this.m_entryList[index].oData = value; + else + this.Add(key, value, ~index); + } + + private int IndexOf(uint key) + { + if (this.m_entryList == null) + return -1; + uint num1 = uint.MaxValue; + int index1 = 0; + if (this.m_entryList.Length > 4) + { + int num2 = 0; + int num3 = this.m_entryList.Length - 1; + while (num2 <= num3) + { + index1 = (num3 + num2) / 2; + num1 = this.m_entryList[index1].key; + if ((int)key == (int)num1) + return index1; + if (key < num1) + num3 = index1 - 1; + else + num2 = index1 + 1; + } + } + else + { + for (int index2 = 0; index2 < this.m_entryList.Length; ++index2) + { + index1 = index2; + num1 = this.m_entryList[index1].key; + if ((int)key == (int)num1) + return index1; + if (key < num1) + break; + } + } + if (key > num1) + ++index1; + return ~index1; + } + + private void Add(uint key, T data, int slotIndex) + { + SmartMap.Entry[] entryArray; + if (this.m_entryList == null) + { + entryArray = new SmartMap.Entry[1]; + } + else + { + int length = this.m_entryList.Length; + entryArray = new SmartMap.Entry[length + 1]; + Array.Copy(m_entryList, entryArray, slotIndex); + Array.Copy(m_entryList, slotIndex, entryArray, slotIndex + 1, length - slotIndex); + } + this.m_entryList = entryArray; + this.m_entryList[slotIndex].key = key; + this.m_entryList[slotIndex].oData = data; + } + + private void Remove(int slotIndex) + { + int length = this.m_entryList.Length; + if (length > 0) + { + SmartMap.Entry[] entryArray = new SmartMap.Entry[length - 1]; + Array.Copy(m_entryList, entryArray, slotIndex); + Array.Copy(m_entryList, slotIndex + 1, entryArray, slotIndex, length - (slotIndex + 1)); + this.m_entryList = entryArray; + } + else + this.m_entryList = null; + } + + private struct Entry + { + internal uint key; + internal T oData; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ComplexImageElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/ComplexImageElement.cs new file mode 100644 index 0000000..c104e42 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ComplexImageElement.cs @@ -0,0 +1,155 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ComplexImageElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class ComplexImageElement : EffectInput + { + internal const string ImagePropertyName = "Image"; + internal const string MinFilterPropertyName = "MinFilter"; + internal const string MagFilterPropertyName = "MagFilter"; + internal const string CoordinateMapIndexPropertyName = "CoordinateMapIndex"; + internal const string ImageIndexPropertyName = "ImageIndex"; + private IImage[] m_rgImages; + private byte m_nImageID; + private FilterMode m_modeMinFilter; + private byte m_nMinFilterID; + private FilterMode m_modeMagFilter; + private byte m_nMagFilterID; + private byte m_idxCoordinateMap; + private byte m_nCoordinateMapID; + private byte m_idxImageIndex; + private byte m_nImageIndexID; + + public ComplexImageElement( + string stName, + IImage imgSource, + FilterMode ftrMinification, + FilterMode ftrMagnification, + byte idxCoordinateMap) + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(imgSource != null, typeof(ArgumentNullException), nameof(imgSource)); + this.m_typeInput = EffectInputType.ComplexImage; + this.m_stName = stName; + this.m_modeMinFilter = ftrMinification; + this.m_modeMagFilter = ftrMagnification; + this.m_idxCoordinateMap = idxCoordinateMap; + this.m_idxImageIndex = 0; + this.Image = imgSource; + } + + public ComplexImageElement( + string stName, + IImage[] imgSource, + FilterMode ftrMinification, + FilterMode ftrMagnification, + byte idxCoordinateMap, + byte idxImageIndex) + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentNullException), nameof(stName)); + Debug2.Validate(imgSource != null, typeof(ArgumentNullException), nameof(imgSource)); + Debug2.Validate(imgSource.Length > 0, typeof(ArgumentException), "ImgSource"); + Debug2.Validate(imgSource.Length > idxImageIndex, typeof(ArgumentOutOfRangeException), nameof(idxImageIndex)); + this.m_typeInput = EffectInputType.ComplexImage; + this.m_stName = stName; + this.m_modeMinFilter = ftrMinification; + this.m_modeMagFilter = ftrMagnification; + this.m_idxCoordinateMap = idxCoordinateMap; + this.m_idxImageIndex = idxImageIndex; + this.m_rgImages = imgSource; + } + + public IImage Image + { + get => this.m_rgImages == null || this.m_rgImages.Length < 1 ? null : this.m_rgImages[0]; + set + { + this.m_rgImages = new IImage[1]; + this.m_rgImages[0] = value; + } + } + + public IImage[] Images + { + get => this.m_rgImages; + set + { + Debug2.Validate(value.Length > 0, typeof(ArgumentException), nameof(Images)); + this.m_rgImages = value; + } + } + + internal byte ImageID => this.m_nImageID; + + public FilterMode MinFilter + { + get => this.m_modeMinFilter; + set => this.m_modeMinFilter = value; + } + + internal byte MinFilterID => this.m_nMinFilterID; + + public FilterMode MagFilter + { + get => this.m_modeMagFilter; + set => this.m_modeMagFilter = value; + } + + internal byte MagFilterID => this.m_nMagFilterID; + + public byte CoordinateMapIndex + { + get => this.m_idxCoordinateMap; + set => this.m_idxCoordinateMap = value; + } + + public byte CoordinateMapIndexID => this.m_nCoordinateMapID; + + public byte ImageIndex + { + get => this.m_idxImageIndex; + set => this.m_idxImageIndex = value; + } + + public byte ImageIndexID => this.m_nImageIndexID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MinFilter", 5, ref this.m_nMinFilterID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MagFilter", 5, ref this.m_nMagFilterID, ref nNextUniqueID); + this.AddEffectProperty(dictionary, "CoordinateMapIndex"); + this.m_nCoordinateMapID = nNextUniqueID++; + this.AddEffectProperty(dictionary, "Image"); + this.m_nImageID = nNextUniqueID++; + this.AddEffectProperty(dictionary, "ImageIndex"); + this.m_nImageIndexID = nNextUniqueID++; + return num; + } + + internal override bool Process(Map dictProperties) + { + if (!this.GenerateProperty("MinFilter", EffectPropertyType.Integer, (int)this.MinFilter, this.m_nMinFilterID, dictProperties) || !this.GenerateProperty("MagFilter", EffectPropertyType.Integer, (int)this.MagFilter, this.m_nMagFilterID, dictProperties) || (!this.GenerateProperty("CoordinateMapIndex", EffectPropertyType.Integer, (int)this.CoordinateMapIndex, this.m_nCoordinateMapID, dictProperties) || !this.GenerateProperty("ImageIndex", EffectPropertyType.Integer, (int)this.ImageIndex, this.m_nImageIndexID, dictProperties))) + return false; + SharedResource[] rgResources = new SharedResource[this.m_rgImages.Length]; + for (int index = 0; index < this.m_rgImages.Length; ++index) + rgResources[index] = (SharedResource)this.m_rgImages[index]; + return this.GenerateProperty("Image", EffectPropertyType.ImageArray, new SharedResourceArray(rgResources), this.m_nImageID, dictProperties); + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("MinFilter", this.MinFilterID, (byte)this.MinFilter, cacheKey); + this.GeneratePropertyCacheKey("MagFilter", this.MagFilterID, (byte)this.MagFilter, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ConstantAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/ConstantAnimationInput.cs new file mode 100644 index 0000000..3cd9398 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ConstantAnimationInput.cs @@ -0,0 +1,160 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ConstantAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; + +namespace Microsoft.Iris.Render +{ + public sealed class ConstantAnimationInput : AnimationInput + { + private object m_inputValue; + + public ConstantAnimationInput(float sourceValue) + : this(sourceValue, null) + { + } + + public ConstantAnimationInput(float sourceValue, string sourceMaskSpec) + { + AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.CommonCreate(AnimationInputType.Float, animationTypeMask); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); + } + + public ConstantAnimationInput(Vector2 sourceValue) + : this(sourceValue, null) + { + } + + public ConstantAnimationInput(Vector2 sourceValue, string sourceMaskSpec) + { + AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.CommonCreate(AnimationInputType.Vector2, animationTypeMask); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); + } + + public ConstantAnimationInput(Vector3 sourceValue) + : this(sourceValue, null) + { + } + + public ConstantAnimationInput(Vector3 sourceValue, string sourceMaskSpec) + { + AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.CommonCreate(AnimationInputType.Vector3, animationTypeMask); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); + } + + public ConstantAnimationInput(Vector4 sourceValue) + : this(sourceValue, null) + { + } + + public ConstantAnimationInput(Vector4 sourceValue, string sourceMaskSpec) + { + AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.CommonCreate(AnimationInputType.Vector4, animationTypeMask); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); + } + + public ConstantAnimationInput(Quaternion sourceValue) + : this(sourceValue, null) + { + } + + public ConstantAnimationInput(Quaternion sourceValue, string sourceMaskSpec) + { + AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); + this.CommonCreate(AnimationInputType.Quaternion, animationTypeMask); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); + } + + internal object RawValue => this.m_inputValue; + + private object ApplyMask(AnimationTypeMask mask, object value) + { + object obj = null; + if (mask.ChannelCount == 0U) + { + obj = value; + } + else + { + float[] numArray = new float[4]; + switch (value) + { + case float num: + numArray[0] = num; + numArray[1] = 0.0f; + numArray[2] = 0.0f; + numArray[3] = 0.0f; + break; + case Vector2 vector2: + numArray[0] = vector2.X; + numArray[1] = vector2.Y; + numArray[2] = 0.0f; + numArray[3] = 0.0f; + break; + case Vector3 vector3: + numArray[0] = vector3.X; + numArray[1] = vector3.Y; + numArray[2] = vector3.Z; + numArray[3] = 0.0f; + break; + case Vector4 vector4: + numArray[0] = vector4.X; + numArray[1] = vector4.Y; + numArray[2] = vector4.Z; + numArray[3] = vector4.W; + break; + case Quaternion quaternion: + numArray[0] = quaternion.X; + numArray[1] = quaternion.Y; + numArray[2] = quaternion.Z; + numArray[3] = quaternion.W; + break; + default: + Debug2.Throw(false, "Unsupported type: {0}", value.GetType()); + break; + } + switch (mask.ChannelCount) + { + case 1: + obj = (float)(mask[0] == AnimationTypeChannel.O ? 0.0 : numArray[(int)(mask[0] - 1)]); + break; + case 2: + obj = new Vector2() + { + X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), + Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]) + }; + break; + case 3: + obj = new Vector3() + { + X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), + Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]), + Z = (mask[2] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[2] - 1)]) + }; + break; + case 4: + obj = new Vector4() + { + X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), + Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]), + Z = (mask[2] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[2] - 1)]), + W = (mask[3] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[3] - 1)]) + }; + break; + default: + Debug2.Throw(false, "Only 4 channels are supported"); + break; + } + } + return obj; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ContentNotification.cs b/UIX.RenderApi/Microsoft/Iris/Render/ContentNotification.cs new file mode 100644 index 0000000..cb2f64d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ContentNotification.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ContentNotification +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum ContentNotification + { + Acquire, + Release, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ContentNotifyHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/ContentNotifyHandler.cs new file mode 100644 index 0000000..2b54b8d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ContentNotifyHandler.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ContentNotifyHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public delegate void ContentNotifyHandler( + ContentNotification Notification, + IImage image, + IntPtr data); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ContinuousAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/ContinuousAnimationInput.cs new file mode 100644 index 0000000..82c663b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ContinuousAnimationInput.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ContinuousAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; + +namespace Microsoft.Iris.Render +{ + public sealed class ContinuousAnimationInput : ObjectAnimationInput + { + public ContinuousAnimationInput(IAnimatable sourceObject, string sourcePropertyName) + : this(sourceObject, sourcePropertyName, null) + { + } + + public ContinuousAnimationInput( + IAnimatable sourceObject, + string sourcePropertyName, + string sourceMaskSpec) + : base(sourceObject, sourcePropertyName, sourceMaskSpec) + { + } + + public ContinuousAnimationInput(IAnimation sourceAnimation) + : this(sourceAnimation, null) + { + } + + public ContinuousAnimationInput(IAnimation sourceAnimation, string sourceMaskSpec) + : base(sourceAnimation, sourceMaskSpec) + { + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ContrastElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/ContrastElement.cs new file mode 100644 index 0000000..6730d34 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ContrastElement.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ContrastElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class ContrastElement : EffectOperation + { + internal const string ContrastPropertyName = "Contrast"; + private float m_flContrast; + private byte m_nContrastID; + + public ContrastElement(string stName, float flConstrastAdjust) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flConstrastAdjust >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Contrast [0..)"); + this.m_flContrast = flConstrastAdjust; + this.m_stName = stName; + } + + public ContrastElement() => this.m_typeOperation = EffectOperationType.Contrast; + + public float Contrast + { + get => this.m_flContrast; + set => this.m_flContrast = value; + } + + internal byte ContrastID => this.m_nContrastID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Contrast", 8, ref this.m_nContrastID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Contrast", EffectPropertyType.Float, m_flContrast, this.m_nContrastID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Contrast", this.ContrastID, this.Contrast, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/CoordMap.cs b/UIX.RenderApi/Microsoft/Iris/Render/CoordMap.cs new file mode 100644 index 0000000..03da016 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/CoordMap.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.CoordMap +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render +{ + public class CoordMap + { + private ArrayList m_alMaps; + + public CoordMap() => this.m_alMaps = new ArrayList(); + + public void AddValue(float flPosition, float flValue, Orientation or) + { + Debug2.Validate(flPosition >= 0.0, typeof(ArgumentOutOfRangeException), "flPosition cannot be less than 0.0f"); + Debug2.Validate(flValue >= 0.0, typeof(ArgumentOutOfRangeException), "flValue cannot be less than 0.0f"); + Debug2.Validate(flPosition <= 1.0, typeof(ArgumentOutOfRangeException), "flPosition cannot exceed 1.0f"); + Debug2.Validate(flValue <= 1.0, typeof(ArgumentOutOfRangeException), "flValue cannot exceed 1.0f"); + foreach (CoordMap.CoordMapSample alMap in this.m_alMaps) + { + if (or == alMap.Orientation) + Debug2.Validate(flPosition != (double)alMap.flPosition, typeof(ArgumentException), "CoordMap cannot have two entries with the same flPosition and the same Orientation"); + } + this.m_alMaps.Add(new CoordMap.CoordMapSample(flPosition, flValue, or)); + } + + public void Clear() => this.m_alMaps.Clear(); + + internal ArrayList RampSamples => this.m_alMaps; + + internal struct CoordMapSample + { + internal float flPosition; + internal float flValue; + internal Orientation Orientation; + + internal CoordMapSample(float pos, float val, Orientation or) + { + this.flPosition = pos; + this.flValue = val; + this.Orientation = or; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/CosineInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/CosineInterpolation.cs new file mode 100644 index 0000000..d0faf71 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/CosineInterpolation.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.CosineInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public sealed class CosineInterpolation : AnimationInterpolation + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DebugCategory.cs b/UIX.RenderApi/Microsoft/Iris/Render/DebugCategory.cs new file mode 100644 index 0000000..326acba --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DebugCategory.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DebugCategory +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum DebugCategory + { + Animation, + Critical, + Deprecated, + Dispatcher, + Dump, + Dx9Wrapper, + DynamicSurface, + Failure, + FormWindow, + GraphicsCache, + IFC, + ObjectCache, + Performance, + Profile, + Queues, + Render, + Sounds, + Surface, + SurfacePool, + SurfaceRestoration, + Timeouts, + Transport, + WindowState, + Effect, + HTTP, + ExternalCount, + Protocol, + RenderHost, + DumpException, + Focus, + Input, + TreeDisposal, + VisualSizePos, + Visual, + Painting, + RenderWindow, + ImageLoad, + ImageCache, + TotalCount, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DeferredInvokePriority.cs b/UIX.RenderApi/Microsoft/Iris/Render/DeferredInvokePriority.cs new file mode 100644 index 0000000..193fc63 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DeferredInvokePriority.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DeferredInvokePriority +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum DeferredInvokePriority + { + High, + Normal, + VisualUpdate, + Low, + Idle, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DesaturateElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/DesaturateElement.cs new file mode 100644 index 0000000..9286fd9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DesaturateElement.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DesaturateElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class DesaturateElement : EffectOperation + { + internal const string DesaturatePropertyName = "Desaturate"; + private float m_flDesaturate; + private byte m_nDesaturateID; + + public DesaturateElement(string stName, float flDesaturate) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flDesaturate >= 0.0 && flDesaturate <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for desaturate is [0,1]"); + this.m_flDesaturate = flDesaturate; + this.m_stName = stName; + } + + public DesaturateElement() => this.m_typeOperation = EffectOperationType.Desaturate; + + public float Desaturate + { + get => this.m_flDesaturate; + set => this.m_flDesaturate = value; + } + + internal byte DesaturateID => this.m_nDesaturateID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", 8, ref this.m_nDesaturateID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Desaturate", EffectPropertyType.Float, m_flDesaturate, this.m_nDesaturateID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Desaturate", this.DesaturateID, this.Desaturate, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DestinationElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/DestinationElement.cs new file mode 100644 index 0000000..df94062 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DestinationElement.cs @@ -0,0 +1,82 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DestinationElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class DestinationElement : EffectInput + { + internal const string DownsamplePropertyName = "Downsample"; + private const string DestinationPropertyName = "Destination"; + internal const string UVOffsetPropertyName = "UVOffset"; + private float m_flDownsample; + private byte m_nDownsampleID; + private byte m_nDestinationID; + private Vector2 m_UVOffset; + private byte m_nUVOffsetID; + + public DestinationElement() + : this(1f) + { + } + + public DestinationElement(float flDownsample) + { + Debug2.Validate(flDownsample >= 0.0 && flDownsample <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for downsample is [0,1]"); + this.m_stName = "Destination"; + this.m_typeInput = EffectInputType.Destination; + this.m_flDownsample = flDownsample; + } + + public float Downsample + { + get => this.m_flDownsample; + set => this.m_flDownsample = value; + } + + internal byte DownsampleID => this.m_nDownsampleID; + + internal byte DestinationID => this.m_nDestinationID; + + public Vector2 UVOffset + { + get => this.m_UVOffset; + set => this.m_UVOffset = value; + } + + internal byte UVOffsetID => this.m_nUVOffsetID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID); + this.AddEffectProperty(dictionary, "Destination"); + this.m_nDestinationID = nNextUniqueID++; + this.AddEffectProperty(dictionary, "Downsample"); + this.m_nDownsampleID = nNextUniqueID++; + return num + this.PreProcessProperty(dictionary, "UVOffset", 12, ref this.m_nUVOffsetID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) + { + if (!this.GenerateProperty("Destination", EffectPropertyType.Image, null, this.m_nDestinationID, dictProperties)) + return false; + dictProperties[this.GeneratePropertyPath("Destination")].IsDynamic = true; + return this.GenerateProperty("Downsample", EffectPropertyType.Float, m_flDownsample, this.m_nDownsampleID, dictProperties) && this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, m_UVOffset, this.m_nUVOffsetID, dictProperties); + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Downsample", this.DownsampleID, this.Downsample, cacheKey); + this.GeneratePropertyCacheKey("UVOffset", this.UVOffsetID, this.UVOffset, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DisplayMode.cs b/UIX.RenderApi/Microsoft/Iris/Render/DisplayMode.cs new file mode 100644 index 0000000..80c5315 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DisplayMode.cs @@ -0,0 +1,133 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DisplayMode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System.Collections.Generic; + +namespace Microsoft.Iris.Render +{ + public struct DisplayMode + { + public static readonly DisplayMode[] EmptyModes = new DisplayMode[0]; + public Size sizePhysicalPxl; + public Size sizeLogicalPxl; + public SurfaceFormat nFormat; + public int nRefreshRate; + public bool fInterlaced; + public bool fTvMode; + + public void ChangeFrom(DisplayMode modeChanges, DisplayModeFlags nChanges) + { + if (Bits.TestFlag((int)nChanges, 1)) + { + this.sizePhysicalPxl = modeChanges.sizePhysicalPxl; + this.sizeLogicalPxl = modeChanges.sizeLogicalPxl; + } + if (Bits.TestFlag((int)nChanges, 2)) + this.nFormat = modeChanges.nFormat; + if (Bits.TestFlag((int)nChanges, 4)) + { + this.nRefreshRate = modeChanges.nRefreshRate; + this.fInterlaced = modeChanges.fInterlaced; + } + if (!Bits.TestFlag((int)nChanges, 8)) + return; + this.fTvMode = modeChanges.fTvMode; + } + + public static bool operator ==(DisplayMode left, DisplayMode right) => left.sizePhysicalPxl == right.sizePhysicalPxl && left.sizeLogicalPxl == right.sizeLogicalPxl && (left.nFormat == right.nFormat && left.nRefreshRate == right.nRefreshRate) && left.fInterlaced == right.fInterlaced && left.fTvMode == right.fTvMode; + + public static bool operator !=(DisplayMode left, DisplayMode right) => left.sizePhysicalPxl != right.sizePhysicalPxl || left.sizeLogicalPxl != right.sizeLogicalPxl || (left.nFormat != right.nFormat || left.nRefreshRate != right.nRefreshRate) || left.fInterlaced != right.fInterlaced || left.fTvMode != right.fTvMode; + + public override bool Equals(object obj) => obj is DisplayMode displayMode && this == displayMode; + + public override int GetHashCode() => this.sizePhysicalPxl.GetHashCode() ^ this.sizeLogicalPxl.GetHashCode() ^ this.nFormat.GetHashCode() ^ this.nRefreshRate ^ this.fInterlaced.GetHashCode() ^ this.fTvMode.GetHashCode(); + + public static int CompareRenderModes(DisplayMode dmA, DisplayMode dmB) + { + if (SurfaceFormatInfo.GetBitsPerPixel(dmA.nFormat) >= SurfaceFormatInfo.GetBitsPerPixel(dmB.nFormat)) + { + if (SurfaceFormatInfo.GetBitsPerPixel(dmA.nFormat) <= SurfaceFormatInfo.GetBitsPerPixel(dmB.nFormat)) + { + if (dmA.sizePhysicalPxl.Width >= dmB.sizePhysicalPxl.Width) + { + if (dmA.sizePhysicalPxl.Width <= dmB.sizePhysicalPxl.Width) + { + if (dmA.sizePhysicalPxl.Height >= dmB.sizePhysicalPxl.Height) + { + if (dmA.sizePhysicalPxl.Height <= dmB.sizePhysicalPxl.Height) + { + if (dmA.nRefreshRate >= dmB.nRefreshRate) + { + if (dmA.nRefreshRate <= dmB.nRefreshRate) + { + if (dmA.fInterlaced || !dmB.fInterlaced) + { + if (!dmA.fInterlaced || dmB.fInterlaced) + return 0; + } + else + goto label_11; + } + } + else + goto label_11; + } + } + else + goto label_11; + } + } + else + goto label_11; + } + return 1; + } + label_11: + return -1; + } + + public static int CompareSimilarModes(DisplayMode dmA, DisplayMode dmB) + { + if (SurfaceFormatInfo.GetBitsPerPixel(dmA.nFormat) >= SurfaceFormatInfo.GetBitsPerPixel(dmB.nFormat)) + { + if (SurfaceFormatInfo.GetBitsPerPixel(dmA.nFormat) <= SurfaceFormatInfo.GetBitsPerPixel(dmB.nFormat)) + { + if (dmA.sizePhysicalPxl.Width >= dmB.sizePhysicalPxl.Width) + { + if (dmA.sizePhysicalPxl.Width <= dmB.sizePhysicalPxl.Width) + { + if (dmA.sizePhysicalPxl.Height >= dmB.sizePhysicalPxl.Height) + { + if (dmA.sizePhysicalPxl.Height <= dmB.sizePhysicalPxl.Height) + return 0; + } + else + goto label_7; + } + } + else + goto label_7; + } + return 1; + } + label_7: + return -1; + } + + public override string ToString() => base.ToString(); + + public class RenderModeComparer : IComparer + { + public int Compare(DisplayMode dmA, DisplayMode dmB) => CompareRenderModes(dmA, dmB); + } + + public class SimilarModeComparer : IComparer + { + public int Compare(DisplayMode dmA, DisplayMode dmB) => CompareSimilarModes(dmA, dmB); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/DisplayModeFlags.cs b/UIX.RenderApi/Microsoft/Iris/Render/DisplayModeFlags.cs new file mode 100644 index 0000000..49eb909 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/DisplayModeFlags.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.DisplayModeFlags +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Flags] + public enum DisplayModeFlags + { + Size = 1, + Format = 2, + RefreshRate = 4, + TvMode = 8, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EaseInInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/EaseInInterpolation.cs new file mode 100644 index 0000000..28c6232 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EaseInInterpolation.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EaseInInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class EaseInInterpolation : AnimationInterpolation + { + private float m_weight; + private float m_handle; + + public EaseInInterpolation(float weight, float handle) + { + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); + Debug2.Validate(handle > 0.0 && handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); + this.m_weight = weight; + this.m_handle = handle; + } + + internal float Weight => this.m_weight; + + internal float Handle => this.m_handle; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EaseOutInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/EaseOutInterpolation.cs new file mode 100644 index 0000000..dd3c3ce --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EaseOutInterpolation.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EaseOutInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class EaseOutInterpolation : AnimationInterpolation + { + private float m_weight; + private float m_handle; + + public EaseOutInterpolation(float weight, float handle) + { + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); + Debug2.Validate(handle > 0.0 && handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); + this.m_weight = weight; + this.m_handle = handle; + } + + internal float Weight => this.m_weight; + + internal float Handle => this.m_handle; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EdgeDetectionElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/EdgeDetectionElement.cs new file mode 100644 index 0000000..3c374f9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EdgeDetectionElement.cs @@ -0,0 +1,52 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EdgeDetectionElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class EdgeDetectionElement : EffectOperation + { + internal const string EdgeLimitPropertyName = "EdgeLimit"; + private float m_flEdgeLimit; + private byte m_nEdgeLimitID; + + public EdgeDetectionElement(string stName, float flEdgeLimit) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + this.m_stName = stName; + this.m_flEdgeLimit = flEdgeLimit; + } + + public EdgeDetectionElement() => this.m_typeOperation = EffectOperationType.EdgeDetection; + + public float EdgeLimit + { + get => this.m_flEdgeLimit; + set => this.m_flEdgeLimit = value; + } + + internal byte EdgeLimitID => this.m_nEdgeLimitID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "EdgeLimit", 8, ref this.m_nEdgeLimitID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("EdgeLimit", EffectPropertyType.Float, m_flEdgeLimit, this.m_nEdgeLimitID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("EdgeLimit", this.EdgeLimitID, this.EdgeLimit, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectElement.cs new file mode 100644 index 0000000..650ba35 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectElement.cs @@ -0,0 +1,217 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Render +{ + public abstract class EffectElement + { + protected const byte ClassKeySize = 3; + protected const byte FloatKeySize = 8; + protected const byte Vector2KeySize = 12; + protected const byte Vector3KeySize = 16; + protected const byte Vector4KeySize = 20; + protected const byte IntKeySize = 8; + protected const byte ByteKeySize = 5; + private const byte k_classCacheKeySize = 3; + private const byte k_propHeaderCacheKeySize = 4; + private const byte k_floatCacheKeySize = 8; + private const byte k_vec2CacheKeySize = 12; + private const byte k_vec3CacheKeySize = 16; + private const byte k_vec4CacheKeySize = 20; + private const byte k_byteCacheKeySize = 5; + private const byte k_intCacheKeySize = 8; + protected string m_stName; + protected Vector m_dynamicProps; + + public string Name + { + get => this.m_stName; + set => this.m_stName = value; + } + + internal abstract void AddCacheKey(ByteBuilder cacheKey); + + internal void GenerateClassCacheKey(byte nClass, byte nOperation, ByteBuilder cacheKey) + { + cacheKey.AppendByte(3); + cacheKey.AppendByte(nClass); + cacheKey.AppendByte(nOperation); + } + + internal void GeneratePropertyCacheKey( + string stProp, + byte nPropertyId, + byte nValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stProp)) + return; + cacheKey.AppendByte(5); + cacheKey.AppendByte(3); + cacheKey.AppendByte(9); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendByte(nValue); + } + + internal void GeneratePropertyCacheKey( + string stPropName, + byte nPropertyId, + int nValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stPropName)) + return; + cacheKey.AppendByte(8); + cacheKey.AppendByte(3); + cacheKey.AppendByte(0); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendInt(nValue); + } + + internal void GeneratePropertyCacheKey( + string stPropName, + byte nPropertyId, + float fValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stPropName)) + return; + cacheKey.AppendByte(8); + cacheKey.AppendByte(3); + cacheKey.AppendByte(1); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendFloat(fValue); + } + + internal void GeneratePropertyCacheKey( + string stPropName, + byte nPropertyId, + Vector2 vValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stPropName)) + return; + cacheKey.AppendByte(12); + cacheKey.AppendByte(3); + cacheKey.AppendByte(2); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendVector(vValue); + } + + internal void GeneratePropertyCacheKey( + string stPropName, + byte nPropertyId, + Vector3 vValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stPropName)) + return; + cacheKey.AppendByte(16); + cacheKey.AppendByte(3); + cacheKey.AppendByte(3); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendVector(vValue); + } + + internal void GeneratePropertyCacheKey( + string stPropName, + byte nPropertyId, + Vector4 vValue, + ByteBuilder cacheKey) + { + if (this.IsDynamicProperty(stPropName)) + return; + cacheKey.AppendByte(16); + cacheKey.AppendByte(3); + cacheKey.AppendByte(4); + cacheKey.AppendByte(nPropertyId); + cacheKey.AppendVector(vValue); + } + + protected string GeneratePropertyPath(string stPropertyName) => string.Format(CultureInfo.InvariantCulture, "{0}.{1}", m_stName, stPropertyName); + + internal bool GenerateProperty( + string stName, + EffectPropertyType eptType, + object oValue, + byte nID, + Map dictProperties) + { + string propertyPath = this.GeneratePropertyPath(stName); + if (dictProperties.ContainsKey(propertyPath)) + { + if (dictProperties[propertyPath] != null) + return false; + EffectProperty effectProperty = new EffectProperty(stName, eptType, true, oValue, nID); + dictProperties[propertyPath] = effectProperty; + effectProperty.IsDynamic = true; + } + else + { + EffectProperty effectProperty = new EffectProperty(stName, eptType, false, oValue, nID); + dictProperties.Add(propertyPath, effectProperty); + } + return true; + } + + protected void MarkDynamicProperty(string stProp) + { + if (this.m_dynamicProps == null) + this.m_dynamicProps = new Vector(5); + if (this.m_dynamicProps.Contains(stProp)) + return; + this.m_dynamicProps.Add(stProp); + } + + internal void AddEffectProperty(Map dictionary, string stProp) + { + string propertyPath = this.GeneratePropertyPath(stProp); + if (!dictionary.ContainsKey(propertyPath)) + dictionary.Add(propertyPath, null); + this.MarkDynamicProperty(stProp); + } + + internal bool IsDynamicProperty(string stProp) => this.m_dynamicProps != null && this.m_dynamicProps.Contains(stProp); + + internal bool VerifyDynamicProperty(Map dictionary, string stProperty) + { + string propertyPath = this.GeneratePropertyPath(stProperty); + if (!dictionary.ContainsKey(propertyPath)) + return false; + this.MarkDynamicProperty(stProperty); + return true; + } + + internal int PreProcessProperty( + Map dictionary, + string stProperty, + byte nPropSize, + ref byte nPropertyId, + ref byte nNextUniqueID) + { + int num = 0; + if (this.VerifyDynamicProperty(dictionary, stProperty)) + nPropertyId = nNextUniqueID++; + else + num = nPropSize; + return num; + } + + internal virtual bool Process(Map dictProperties) => true; + + internal virtual int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return 3; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectElementCacheKeys.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectElementCacheKeys.cs new file mode 100644 index 0000000..fa45fff --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectElementCacheKeys.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectElementCacheKeys +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + internal enum EffectElementCacheKeys : byte + { + Input, + Operation, + BlendOperation, + Property, + MaxValue, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectInput.cs new file mode 100644 index 0000000..1ad010d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectInput.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; + +namespace Microsoft.Iris.Render +{ + public abstract class EffectInput : EffectElement + { + internal EffectInputType m_typeInput; + + internal EffectInputType Type => this.m_typeInput; + + internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey(0, (byte)this.m_typeInput, cacheKey); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectInputType.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectInputType.cs new file mode 100644 index 0000000..0862b29 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectInputType.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectInputType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + internal enum EffectInputType : byte + { + Color = 1, + Image = 2, + Blend = 3, + Interpolate = 4, + Layer = 5, + ComplexImage = 6, + Video = 7, + Spotlight2D = 8, + PointLight2D = 9, + Destination = 10, // 0x0A + MaxValue = 11, // 0x0B + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectLayer.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectLayer.cs new file mode 100644 index 0000000..bb7fe9f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectLayer.cs @@ -0,0 +1,83 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectLayer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Render +{ + public class EffectLayer : EffectInput + { + internal EffectInput m_input; + internal IList m_listOperations; + + public EffectLayer(EffectInput inputElement, List listOperations) + : this() + { + Debug2.Validate(inputElement != null, typeof(ArgumentNullException), nameof(inputElement)); + Debug2.Validate(listOperations != null, typeof(ArgumentNullException), nameof(listOperations)); + this.m_input = inputElement; + this.m_listOperations = listOperations; + } + + public EffectLayer(EffectInput inputElement, EffectOperation efoOperation) + : this() + { + Debug2.Validate(inputElement != null, typeof(ArgumentNullException), nameof(inputElement)); + Debug2.Validate(efoOperation != null, typeof(ArgumentNullException), nameof(efoOperation)); + this.m_input = inputElement; + this.m_listOperations = new List(1); + this.m_listOperations.Add(efoOperation); + } + + public EffectLayer() => this.m_typeInput = EffectInputType.Layer; + + public EffectInput Input + { + get => this.m_input; + set => this.m_input = value; + } + + public IList Operations + { + get => this.m_listOperations; + set => this.m_listOperations = value; + } + + internal override bool Process(Map dictProperties) + { + if (!this.m_input.Process(dictProperties)) + return false; + foreach (EffectElement listOperation in m_listOperations) + { + if (!listOperation.Process(dictProperties)) + return false; + } + return true; + } + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_input.PreProcessProperties(dictionary, ref nNextUniqueID); + foreach (EffectOperation listOperation in m_listOperations) + num += listOperation.PreProcessProperties(dictionary, ref nNextUniqueID); + return num; + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.m_input.AddCacheKey(cacheKey); + foreach (EffectElement listOperation in m_listOperations) + listOperation.AddCacheKey(cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectOperation.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectOperation.cs new file mode 100644 index 0000000..9e59aac --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectOperation.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectOperation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; + +namespace Microsoft.Iris.Render +{ + public abstract class EffectOperation : EffectElement + { + protected EffectOperationType m_typeOperation; + + internal EffectOperationType Type => this.m_typeOperation; + + internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey(1, (byte)this.Type, cacheKey); + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return 3 + base.PreProcessProperties(dictionary, ref nNextUniqueID); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EffectOperationType.cs b/UIX.RenderApi/Microsoft/Iris/Render/EffectOperationType.cs new file mode 100644 index 0000000..5340d6f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EffectOperationType.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EffectOperationType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum EffectOperationType : byte + { + Brightness = 1, + Contrast = 2, + Desaturate = 3, + EdgeDetection = 4, + Emboss = 5, + GaussianBlur = 6, + HSL = 7, + HSV = 8, + InvAlpha = 9, + InvColor = 10, // 0x0A + Invert = 11, // 0x0B + LightShaft = 12, // 0x0C + Sepia = 13, // 0x0D + MaxValue = 14, // 0x0E + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EmbossDirection.cs b/UIX.RenderApi/Microsoft/Iris/Render/EmbossDirection.cs new file mode 100644 index 0000000..d653908 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EmbossDirection.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EmbossDirection +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum EmbossDirection + { + LeftToRight, + RightToLeft, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EmbossElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/EmbossElement.cs new file mode 100644 index 0000000..ec5ec43 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EmbossElement.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EmbossElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class EmbossElement : EffectOperation + { + internal const string DirectionPropertyName = "Direction"; + internal const string GrayLevelPropertyName = "GrayLevel"; + private EmbossDirection m_direction; + private byte m_nDirectionID; + private float m_flGrayLevel; + private byte m_nGrayLevelID; + + public EmbossElement(string stName, EmbossDirection direction, float flGrayLevel) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flGrayLevel >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for GrayLevel is >= 0"); + this.m_stName = stName; + this.m_direction = direction; + this.m_flGrayLevel = flGrayLevel; + } + + public EmbossElement() => this.m_typeOperation = EffectOperationType.Emboss; + + public EmbossDirection Direction + { + get => this.m_direction; + set => this.m_direction = value; + } + + internal byte DirectionID => this.m_nDirectionID; + + public float GrayLevel + { + get => this.m_flGrayLevel; + set => this.m_flGrayLevel = value; + } + + internal byte GrayLevelID => this.m_nGrayLevelID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Direction", 5, ref this.m_nDirectionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "GrayLevel", 8, ref this.m_nGrayLevelID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Direction", EffectPropertyType.Integer, m_direction, this.m_nDirectionID, dictProperties) && this.GenerateProperty("GrayLevel", EffectPropertyType.Float, m_flGrayLevel, this.m_nGrayLevelID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Direction", this.DirectionID, (byte)this.Direction, cacheKey); + this.GeneratePropertyCacheKey("GrayLevel", this.GrayLevelID, this.GrayLevel, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EngineInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/EngineInfo.cs new file mode 100644 index 0000000..2d66030 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EngineInfo.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EngineInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public abstract class EngineInfo + { + private EngineType m_engineType; + + protected EngineInfo(EngineType engineType) => this.m_engineType = engineType; + + internal EngineType Type => this.m_engineType; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/EngineType.cs b/UIX.RenderApi/Microsoft/Iris/Render/EngineType.cs new file mode 100644 index 0000000..507ea3e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/EngineType.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.EngineType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum EngineType + { + Iris, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ExponentialInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/ExponentialInterpolation.cs new file mode 100644 index 0000000..36ce32c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ExponentialInterpolation.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ExponentialInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class ExponentialInterpolation : AnimationInterpolation + { + private float m_weight; + + public ExponentialInterpolation(float weight) + { + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); + this.m_weight = weight; + } + + internal float Weight => this.m_weight; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/BitmapInformation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/BitmapInformation.cs new file mode 100644 index 0000000..a1521e7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/BitmapInformation.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.BitmapInformation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public class BitmapInformation : IDisposable + { + public ImageInformation imageInfo; + internal HSpBitmap hBitmap; + + public void Dispose() => this.ReleaseData(); + + private void ReleaseData() + { + if (!(this.hBitmap != HSpBitmap.NULL)) + return; + EngineApi.IFC(ExtensionsApi.SpBitmapDelete(this.hBitmap)); + this.hBitmap = HSpBitmap.NULL; + } + + public override string ToString() => base.ToString(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs new file mode 100644 index 0000000..a4d7846 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.CoordMapGenerator +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public static class CoordMapGenerator + { + public static CoordMap CreateSubrect(Size sizeImage, Rectangle rect) + { + Debug2.Validate(rect.Right <= sizeImage.Width, typeof(ArgumentOutOfRangeException), "Desired rect cannot extend beyond the image width"); + Debug2.Validate(rect.Bottom <= sizeImage.Height, typeof(ArgumentOutOfRangeException), "Desired rect cannot extend beyond the image height"); + CoordMap coordMap = new CoordMap(); + float flValue1 = rect.Left / (float)sizeImage.Width; + float flValue2 = rect.Right / (float)sizeImage.Width; + float flValue3 = rect.Top / (float)sizeImage.Height; + float flValue4 = rect.Bottom / (float)sizeImage.Height; + coordMap.AddValue(0.0f, flValue1, Orientation.Horizontal); + coordMap.AddValue(1f, flValue2, Orientation.Horizontal); + coordMap.AddValue(0.0f, flValue3, Orientation.Vertical); + coordMap.AddValue(1f, flValue4, Orientation.Vertical); + return coordMap; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DataTracker.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DataTracker.cs new file mode 100644 index 0000000..5ffa566 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DataTracker.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.DataTracker +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public class DataTracker : IDisposable + { + private Map m_dictData; + + public DataTracker() => this.m_dictData = new Map(); + + public void AddData(object o, IDisposable data) + { + Debug2.Validate(o != null, typeof(ArgumentNullException), "IRenderObject is invalid"); + Debug2.Validate(data != null, typeof(ArgumentNullException), "Data is invalid"); + Debug2.Validate(!this.m_dictData.ContainsKey(o), typeof(InvalidOperationException), "DataTracker only supports one resource per IRenderObject"); + this.m_dictData[o] = data; + } + + public void DisposeAndRemoveData(object o) + { + IDisposable disposable; + if (!this.m_dictData.TryGetValue(o, out disposable)) + return; + disposable.Dispose(); + this.m_dictData.Remove(o); + } + + public void Dispose() + { + foreach (IDisposable disposable in this.m_dictData.Values) + disposable.Dispose(); + this.m_dictData = null; + GC.SuppressFinalize(this); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs new file mode 100644 index 0000000..37efd10 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs @@ -0,0 +1,102 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.DebugCategoryEnabledSet +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Security; + +namespace Microsoft.Iris.Render.Extensions +{ + [SuppressUnmanagedCodeSecurity] + internal class DebugCategoryEnabledSet + { + private byte[] m_arbCache; + private TraceRegistryHelper m_registryHelper; + private bool m_invalidCache; + + internal DebugCategoryEnabledSet(TraceRegistryHelper registryHelper) + { + this.m_arbCache = new byte[38]; + for (int index = 0; index < this.m_arbCache.Length; ++index) + this.m_arbCache[index] = 0; + this.m_registryHelper = registryHelper; + this.m_invalidCache = true; + } + + public byte this[DebugCategory cat] + { + get => this.GetLevel(cat); + set => this.SetLevel(cat, value); + } + + public byte GetLevel(DebugCategory cat) + { + if (this.m_invalidCache) + this.Refresh(); + return this.m_arbCache[(int)cat]; + } + + public void SetLevel(DebugCategory cat, byte bValue) + { + if (this.m_arbCache[(int)cat] == bValue) + return; + SetExternalDebugLevel(cat, bValue); + this.m_arbCache[(int)cat] = bValue; + } + + public void SetLevel(DebugCategory cat, bool fValue) + { + byte bValue = fValue ? (byte)1 : (byte)0; + if (bValue != 0 && bValue <= this.GetLevel(cat)) + return; + this.SetLevel(cat, bValue); + } + + private void Refresh() + { + lock (this) + { + for (int index = 0; index < this.m_arbCache.Length; ++index) + { + DebugCategory cat = (DebugCategory)index; + byte externalDebugLevel = GetExternalDebugLevel(cat); + byte level = externalDebugLevel; + byte bValue; + if (this.m_registryHelper.ReadValuesFromRegistry && this.ReadDebugCategoryValueFromRegistry(cat, out bValue)) + level = bValue; + if (externalDebugLevel != level) + SetExternalDebugLevel(cat, level); + if (this.m_arbCache[index] != level) + this.m_arbCache[index] = level; + } + this.m_invalidCache = false; + } + } + + internal void Invalidate() + { + if (this.m_invalidCache) + return; + lock (this) + { + if (this.m_invalidCache) + return; + this.m_invalidCache = true; + } + } + + private bool ReadDebugCategoryValueFromRegistry(DebugCategory cat, out byte bValue) => this.m_registryHelper.ReadValueFromRegistry(cat.ToString(), out bValue); + + private static byte GetExternalDebugLevel(DebugCategory cat) => IsExternalCategory(cat) ? eDebugApi.DebugGetCategoryLevel(cat) : (byte)0; + + private static void SetExternalDebugLevel(DebugCategory cat, byte level) + { + if (!IsExternalCategory(cat)) + return; + eDebugApi.DebugSetCategoryLevel(cat, level); + } + + private static bool IsExternalCategory(DebugCategory cat) => (uint)cat < 25U; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugDefault.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugDefault.cs new file mode 100644 index 0000000..e8a02f0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugDefault.cs @@ -0,0 +1,98 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.DebugDefault +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections; +using System.Globalization; +using System.Threading; + +namespace Microsoft.Iris.Render.Extensions +{ + public class DebugDefault : IDebug, IDisposable + { + private eDebug m_eDebug; + private static ReaderWriterLock s_contextLock = new ReaderWriterLock(); + private static Map s_contextDict = new Map(); + + public DebugDefault() => this.m_eDebug = new eDebug(); + + void IDisposable.Dispose() + { + if (this.m_eDebug == null) + return; + this.m_eDebug.Dispose(); + this.m_eDebug = null; + } + + public static Stack CurrentContextStack + { + get + { + Stack stack = null; + s_contextLock.AcquireReaderLock(-1); + try + { + stack = s_contextDict[Thread.CurrentThread]; + } + finally + { + s_contextLock.ReleaseReaderLock(); + } + if (stack == null) + { + s_contextLock.AcquireWriterLock(-1); + try + { + stack = s_contextDict[Thread.CurrentThread]; + if (stack == null) + { + stack = new Stack(); + stack.Push(""); + s_contextDict[Thread.CurrentThread] = stack; + } + } + finally + { + s_contextLock.ReleaseWriterLock(); + } + } + return stack; + } + } + + void IDebug.Enter(string context) + { + if (context == null) + context = ""; + CurrentContextStack.Push(context); + this.m_eDebug.WriteLinePrefix = string.Format(CultureInfo.InvariantCulture, "[{0}]", context); + } + + void IDebug.Leave(string context) + { + Stack currentContextStack = CurrentContextStack; + this.m_eDebug.Assert(currentContextStack.Count > 0, "Context stack is empty"); + if (currentContextStack.Count > 0) + this.m_eDebug.WriteLinePrefix = string.Format(CultureInfo.InvariantCulture, "[{0}]", (string)currentContextStack.Peek()); + else + this.m_eDebug.WriteLinePrefix = null; + } + + void IDebug.Assert(bool condition, string message) => this.m_eDebug.Assert(condition, message); + + void IDebug.Throw(bool condition, string message) => this.m_eDebug.Prompt(condition, message, typeof(InvalidOperationException)); + + void IDebug.Write(DebugCategory category, int level, string message) => this.m_eDebug.Write(category, (byte)level, message); + + void IDebug.WriteLine(DebugCategory category, int level, string message) => this.m_eDebug.WriteLine(category, (byte)level, message); + + void IDebug.Indent(DebugCategory category, int level) => this.m_eDebug.Indent(category, (byte)level); + + void IDebug.Unindent(DebugCategory category, int level) => this.m_eDebug.Unindent(category, (byte)level); + + bool IDebug.IsCategoryEnabled(DebugCategory category, int level) => this.m_eDebug.IsCategoryEnabled(category, (byte)level); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugNone.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugNone.cs new file mode 100644 index 0000000..f4b0996 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/DebugNone.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.DebugNone +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public class DebugNone : IDebug, IDisposable + { + void IDisposable.Dispose() + { + } + + void IDebug.Enter(string stContext) + { + } + + void IDebug.Leave(string stContext) + { + } + + void IDebug.Assert(bool fCondition, string stMessage) + { + } + + void IDebug.Throw(bool fCondition, string stMessage) + { + } + + void IDebug.Write(DebugCategory nCategory, int nLevel, string stMessage) + { + } + + void IDebug.WriteLine(DebugCategory nCategory, int nLevel, string stMessage) + { + } + + void IDebug.Indent(DebugCategory nCategory, int nLevel) + { + } + + void IDebug.Unindent(DebugCategory nCategory, int nLevel) + { + } + + bool IDebug.IsCategoryEnabled(DebugCategory category, int nLevel) => false; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ExtensionsApi.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ExtensionsApi.cs new file mode 100644 index 0000000..d5c99c8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ExtensionsApi.cs @@ -0,0 +1,134 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ExtensionsApi +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace Microsoft.Iris.Render.Extensions +{ + [SuppressUnmanagedCodeSecurity] + public static class ExtensionsApi + { + private const string s_stExtensionsDll = "UIXRender.dll"; + internal const ushort WAVE_FORMAT_PCM = 1; + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + internal static extern HRESULT SpBitmapLoadFile( + string stFileName, + [MarshalAs(UnmanagedType.LPStruct), In] ImageRequirements req, + ExtensionsApi.BitmapOptions nOptions, + out HSpBitmap hBmp, + out ImageInformation info); + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + internal static extern HRESULT SpBitmapLoadRaw( + Size sizeActualPxl, + int nStride, + SurfaceFormat nFormat, + IntPtr pvData, + [MarshalAs(UnmanagedType.LPStruct), In] ImageRequirements req, + ExtensionsApi.BitmapOptions nOptions, + out HSpBitmap hBmp, + out ImageInformation info); + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + internal static extern HRESULT SpBitmapLoadResource( + Win32Api.HINSTANCE hinst, + string stName, + int nType, + [MarshalAs(UnmanagedType.LPStruct), In] ImageRequirements req, + ExtensionsApi.BitmapOptions nOptions, + out HSpBitmap hBmp, + out ImageInformation info); + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + internal static extern HRESULT SpBitmapLoadBuffer( + IntPtr pvSrc, + uint cbSize, + [MarshalAs(UnmanagedType.LPStruct), In] ImageRequirements req, + ExtensionsApi.BitmapOptions nOptions, + out HSpBitmap hBmp, + out ImageInformation info); + + [DllImport("UIXRender.dll")] + internal static extern HRESULT SpBitmapDelete(HSpBitmap hBmp); + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + internal static extern HRESULT SpSoundLoadBuffer( + IntPtr pBuffer, + int dwSize, + ExtensionsApi.SoundOptions options, + out ExtensionsApi.HSpSound hSound, + out ExtensionsApi.SoundInformation info); + + [DllImport("UIXRender.dll")] + internal static extern HRESULT SpSoundDispose( + ExtensionsApi.HSpSound hSound, + ExtensionsApi.SoundInformation info); + + [System.Flags] + internal enum BitmapOptions + { + None = 0, + Decode = 1, + Flip = 2, + Valid = Flip | Decode, // 0x00000003 + } + + [System.Flags] + internal enum SoundOptions + { + None = 0, + Decode = 1, + BigEndian = 2, + Valid = BigEndian | Decode, // 0x00000003 + } + + [ComVisible(false)] + public struct SoundHeader + { + public ushort wFormatTag; + public ushort nChannels; + public uint nSamplesPerSec; + public uint nAvgBytesPerSec; + public ushort nBlockAlign; + public ushort wBitsPerSample; + public ushort cbExtraData; + public uint cbDataSize; + } + + [ComVisible(false)] + public struct SoundData + { + public IntPtr rgData; + } + + [ComVisible(false)] + public struct SoundInformation + { + public ExtensionsApi.SoundHeader Header; + public ExtensionsApi.SoundData Data; + public static ExtensionsApi.SoundInformation NULL = new ExtensionsApi.SoundInformation(); + } + + [ComVisible(false)] + public struct HSpSound + { + public IntPtr h; + public static readonly ExtensionsApi.HSpSound NULL = new ExtensionsApi.HSpSound(); + + public static bool operator ==(ExtensionsApi.HSpSound hA, ExtensionsApi.HSpSound hB) => hA.h == hB.h; + + public static bool operator !=(ExtensionsApi.HSpSound hA, ExtensionsApi.HSpSound hB) => hA.h != hB.h; + + public override bool Equals(object oCompare) => oCompare is ExtensionsApi.HSpSound hspSound && this.h == hspSound.h; + + public override int GetHashCode() => (int)this.h.ToInt64(); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/GradientInformation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/GradientInformation.cs new file mode 100644 index 0000000..386d602 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/GradientInformation.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.GradientInformation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + public class GradientInformation : IDisposable + { + public ImageInformation imageInfo; + internal GCHandle gcData; + + void IDisposable.Dispose() + { + if (!this.gcData.IsAllocated) + return; + this.gcData.Free(); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/HSpBitmap.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/HSpBitmap.cs new file mode 100644 index 0000000..faf957d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/HSpBitmap.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.HSpBitmap +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + [ComVisible(false)] + internal struct HSpBitmap + { + internal IntPtr h; + internal static readonly HSpBitmap NULL = new HSpBitmap(); + + public static bool operator ==(HSpBitmap hA, HSpBitmap hB) => hA.h == hB.h; + + public static bool operator !=(HSpBitmap hA, HSpBitmap hB) => hA.h != hB.h; + + public override bool Equals(object oCompare) => oCompare is HSpBitmap hspBitmap && this.h == hspBitmap.h; + + public override int GetHashCode() => (int)this.h.ToInt64(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCache.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCache.cs new file mode 100644 index 0000000..09bd50a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCache.cs @@ -0,0 +1,285 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageCache +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Extensions +{ + public class ImageCache : IDisposable + { + private static readonly ImageCache.ObjectTest s_testCulling = new ImageCache.ObjectTest(CullingTest); + private static readonly ImageCache.ObjectTest s_testDisposeAll = new ImageCache.ObjectTest(DisposeAllTest); + private static readonly ImageCache.ObjectTest s_testObject = new ImageCache.ObjectTest(SpecificObjectTest); + private static readonly ImageCache.ObjectTest s_testDropImages = new ImageCache.ObjectTest(DropImageTest); + private Map m_objectsTable; + private Vector m_lruList; + private bool m_fObjectDisposed; + private string m_stName; + private bool m_fCleanupPending; + private bool m_fShuttingDown; + private int m_numItemsToKeep; + private TimeSpan m_tsCullingKeepTime; + private bool m_fUseCutoffTime; + private DateTime m_dtCullingCutoff; + private int m_numItemsInUse; + private int m_numItemsInCache; + + public ImageCache(IRenderSession session, string name) + { + this.m_stName = name; + this.m_numItemsToKeep = 100; + this.m_tsCullingKeepTime = new TimeSpan(0, 1, 0); + } + + ~ImageCache() + { + if (this.m_fObjectDisposed) + return; + this.Dispose(false); + } + + public void Dispose() + { + if (this.m_fObjectDisposed) + return; + this.Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool fInDispose) + { + if (!fInDispose) + return; + this.OnDispose(); + } + + protected virtual void OnDispose() + { + this.DisposeAllObjects(); + this.m_fObjectDisposed = true; + } + + public void DisposeAllObjects() + { + this.m_numItemsInCache = 0; + this.RemoveObjects(s_testDisposeAll, this); + } + + public void PrepareToShutdown() + { + this.m_numItemsInCache = 0; + this.RemoveObjects(s_testDropImages, this); + this.m_fCleanupPending = false; + this.m_fShuttingDown = true; + } + + public bool IsEmpty => this.m_objectsTable.Count == 0; + + public bool CleanupPending => this.m_fCleanupPending; + + protected void ClearCleanupPending() => this.m_fCleanupPending = false; + + public int NumItemsToKeep + { + get => this.m_numItemsToKeep; + set => this.m_numItemsToKeep = value; + } + + public TimeSpan ItemRetainTime + { + get => this.m_tsCullingKeepTime; + set => this.m_tsCullingKeepTime = value; + } + + public void Add(ImageCacheKey key, ImageCacheItem item) + { + Debug2.Validate(!this.m_fShuttingDown, typeof(InvalidOperationException), "Should not Add items to cache after starting shutdown sequence"); + Debug2.Validate(item.ImageCacheOwner == null, typeof(InvalidOperationException), "The given item is already part of a cache! double-add detected."); + if (this.m_objectsTable == null) + this.SetupObjectTable(); + this.m_objectsTable[key] = item; + this.m_lruList.Insert(0, new ImageCache.ImageCacheEntry(key, item)); + item.ImageCacheOwner = this; + this.ScheduleScavenge(); + } + + public void RemoveData(ImageCacheKey key) => ((ImageCacheItem)this.Find(key))?.RemoveData(); + + public void RemoveItem(ImageCacheItem item) => this.RemoveObjects(s_testObject, item); + + public void RemoveObjects(ImageCache.ObjectTest test, object paramObject) + { + if (this.m_objectsTable == null) + return; + ArrayList arrayList = null; + foreach (ImageCache.ImageCacheEntry lru in this.m_lruList) + { + ImageCacheItem imageCacheItem = lru.item; + if (test(imageCacheItem, paramObject)) + { + if (arrayList == null) + arrayList = new ArrayList(); + arrayList.Add(lru); + } + } + if (arrayList == null) + return; + foreach (ImageCache.ImageCacheEntry imageCacheEntry in arrayList) + { + this.m_lruList.Remove(imageCacheEntry); + this.m_objectsTable.Remove(imageCacheEntry.key); + imageCacheEntry.item.ImageCacheOwner = null; + imageCacheEntry.item.Dispose(); + } + } + + public ImageCacheItem Lookup(ImageCacheKey key) + { + ImageCacheItem imageCacheItem = (ImageCacheItem)this.Find(key); + if (imageCacheItem == null) + this.ScheduleScavenge(); + return imageCacheItem; + } + + public void CullObjects() + { + this.m_numItemsInUse = 0; + this.m_numItemsInCache = 0; + this.m_fUseCutoffTime = !this.m_tsCullingKeepTime.Equals(TimeSpan.Zero); + this.m_dtCullingCutoff = DateTime.UtcNow - this.m_tsCullingKeepTime; + this.RemoveObjects(s_testCulling, this); + this.m_fCleanupPending = false; + } + + [Conditional("DEBUG")] + protected void AssertOwningThread() + { + } + + protected virtual void SetupObjectTable() + { + if (this.m_objectsTable != null) + return; + this.m_objectsTable = new Map(); + this.m_lruList = new Vector(this.m_numItemsToKeep); + } + + private object Find(object key) + { + object obj = null; + if (this.m_objectsTable != null) + this.m_objectsTable.TryGetValue(key, out obj); + return obj; + } + + private bool ContainsKey(object key) + { + bool flag = false; + if (this.m_objectsTable != null) + flag = this.m_objectsTable.ContainsKey(key); + return flag; + } + + protected virtual void ScheduleScavenge() + { + if (this.m_fCleanupPending || this.m_fShuttingDown) + return; + this.m_fCleanupPending = true; + } + + private static bool DisposeAllTest(object subjectObject, object paramObject) + { + ImageCache imageCache = paramObject as ImageCache; + if (!(subjectObject is ImageCacheItem)) + return false; + ++imageCache.m_numItemsInCache; + return true; + } + + private static bool DropImageTest(object subjectObject, object paramObject) + { + ImageCache imageCache = paramObject as ImageCache; + if (subjectObject is ImageCacheItem imageCacheItem) + { + imageCacheItem.ReleaseImage(); + ++imageCache.m_numItemsInCache; + } + return false; + } + + private static bool CullingTest(object subjectObject, object paramObject) + { + ImageCache imageCache = paramObject as ImageCache; + if (subjectObject is ImageCacheItem imageCacheItem) + { + ++imageCache.m_numItemsInCache; + if (imageCacheItem.HasLoadsInProgress || imageCacheItem.InUse) + { + ++imageCache.m_numItemsInUse; + return false; + } + if (imageCache.m_numItemsInCache - imageCache.m_numItemsInUse > imageCache.m_numItemsToKeep || imageCache.m_fUseCutoffTime && imageCacheItem.IsOlder(imageCache.m_dtCullingCutoff)) + return true; + } + return false; + } + + private static bool SpecificObjectTest(object subjectObject, object paramObject) => subjectObject == paramObject; + + [Conditional("DEBUG")] + private void IncKeptItems() + { + } + + [Conditional("DEBUG")] + private void IncCulledItems() + { + } + + [Conditional("DEBUG")] + private void ClearActivityCounts() + { + } + + internal void UpdateLastUsedItem(ImageCacheItem item) + { + ImageCache.ImageCacheEntry inLruList = this.FindInLruList(item); + if (inLruList == null) + return; + this.m_lruList.Remove(inLruList); + this.m_lruList.Insert(0, inLruList); + } + + internal ImageCache.ImageCacheEntry FindInLruList(ImageCacheItem item) + { + foreach (ImageCache.ImageCacheEntry lru in this.m_lruList) + { + if (lru.MatchItem(item)) + return lru; + } + return null; + } + + public delegate bool ObjectTest(object subjectObject, object paramObject); + + internal class ImageCacheEntry + { + public ImageCacheKey key; + public ImageCacheItem item; + + public ImageCacheEntry(ImageCacheKey keyIn, ImageCacheItem itemIn) + { + this.key = keyIn; + this.item = itemIn; + } + + public bool MatchItem(ImageCacheItem itemToMatch) => itemToMatch == this.item; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs new file mode 100644 index 0000000..4540ed6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs @@ -0,0 +1,285 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageCacheItem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Extensions +{ + public class ImageCacheItem : IDisposable + { + private static TimeSpan s_tsUpdateThreshhold = new TimeSpan(0, 0, 2); + private bool m_fObjectDisposed; + private string m_stIdentifier; + private IImage m_image; + protected ImageRequirements m_req; + protected Size m_size; + protected BitmapInformation m_info; + protected IntPtr m_buffer; + protected uint m_length; + private int m_countUsers; + private int m_countLoadsInProgress; + private bool m_fFullLoadRequested; + private ArrayList m_prevLoadInfos; + private DateTime m_dtLastUsed; + private ImageCache m_owner; + + public ImageCacheItem( + IRenderSession renderSession, + string identifier, + IntPtr buffer, + uint length, + Size maxSize, + bool flippable, + bool antialiasEdges) + : this(renderSession, identifier, maxSize, flippable, antialiasEdges) + { + this.m_buffer = buffer; + this.m_length = length; + } + + public ImageCacheItem( + IRenderSession renderSession, + string identifier, + Size maxSize, + bool flippable, + bool antialiasEdges) + : this(renderSession, identifier) + { + this.m_req = new ImageRequirements(); + this.m_req.MaximumSize = maxSize; + this.m_req.Flippable = flippable; + this.m_req.AntialiasEdges = antialiasEdges; + } + + protected ImageCacheItem(IRenderSession renderSession, string identifier) + { + this.m_stIdentifier = identifier; + this.m_image = renderSession.CreateImage(this, this.m_stIdentifier, new ContentNotifyHandler(this.ReloadImage)); + this.UpdateLastUsedTime(); + } + + ~ImageCacheItem() => this.Dispose(false); + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool fInDispose) + { + if (!fInDispose) + return; + this.OnDispose(); + } + + protected virtual void OnDispose() + { + if (this.m_image != null) + { + this.m_image.UnregisterUsage(this); + this.m_image = null; + } + if (this.m_info != null) + { + this.m_info.Dispose(); + this.m_info = null; + } + this.m_fObjectDisposed = true; + } + + public virtual void ReleaseImage() + { + if (this.m_image == null) + return; + this.m_image.UnregisterUsage(this); + this.m_image = null; + } + + public int UsageCount => this.m_countUsers; + + public void RegisterUsage(object user) + { + this.AssertValidState(); + ++this.m_countUsers; + this.UpdateLastUsedTime(); + } + + public void UnregisterUsage(object user) + { + this.AssertValidState(); + --this.m_countUsers; + this.UpdateLastUsedTime(); + } + + public string Identifier => this.m_stIdentifier; + + public IImage RenderImage => this.m_image; + + public Size ImageSize + { + get + { + if (this.m_size.IsZero) + this.LoadBuffer(); + return this.m_size; + } + } + + public bool HasLoadsInProgress => this.m_countLoadsInProgress > 0; + + public bool InUse => this.m_image != null && this.m_image.UsageCount > 1 || this.m_countUsers > 0; + + public virtual void RemoveData() + { + if (this.HasLoadsInProgress) + { + if (this.m_prevLoadInfos == null) + this.m_prevLoadInfos = new ArrayList(); + this.m_prevLoadInfos.Add(m_info); + this.m_size = Size.Zero; + this.m_info = null; + } + else + { + this.m_size = Size.Zero; + if (this.m_info == null) + return; + this.m_info.Dispose(); + this.m_info = null; + } + } + + public virtual void StartLoad() => this.LoadBuffer(); + + protected void SetBuffer(IntPtr buffer, uint length) + { + this.m_buffer = buffer; + this.m_length = length; + } + + protected void SetSize(Size size) => this.m_size = size; + + internal void ReloadImage(ContentNotification notification, IImage image, IntPtr data) + { + switch (notification) + { + case ContentNotification.Acquire: + if (this.m_image == null) + break; + this.m_fFullLoadRequested = true; + this.LoadBuffer(); + break; + case ContentNotification.Release: + this.EndLoadImageData(); + break; + } + } + + private void LoadBuffer() + { + if (!this.EnsureBuffer()) + return; + this.ProcessBuffer(); + } + + protected bool ProcessBuffer() + { + this.UpdateLastUsedTime(); + return !this.m_fFullLoadRequested ? this.DoHeaderLoad() : this.BeginLoadImageData(); + } + + private bool BeginLoadImageData() + { + if (!this.DoImageLoad()) + return false; + ++this.m_countLoadsInProgress; + return true; + } + + private void EndLoadImageData() + { + this.AssertValidState(); + --this.m_countLoadsInProgress; + this.OnImageLoadComplete(); + if (!this.HasLoadsInProgress) + { + if (this.m_info != null) + { + this.m_info.Dispose(); + this.m_info = null; + } + if (this.m_prevLoadInfos != null) + { + foreach (BitmapInformation prevLoadInfo in this.m_prevLoadInfos) + prevLoadInfo?.Dispose(); + this.m_prevLoadInfos.Clear(); + this.m_prevLoadInfos = null; + } + } + this.UpdateLastUsedTime(); + } + + protected virtual bool EnsureBuffer() => true; + + protected virtual bool DoHeaderLoad() + { + ImageHeader header; + if (!(this.m_buffer != IntPtr.Zero) || this.m_length <= 0U || !ImageLoader.LoadHeader(this.m_buffer, (int)this.m_length, this.m_req, out header)) + return false; + this.SetSize(header.sizeActualPxl); + return true; + } + + protected virtual bool DoImageLoad() + { + BitmapInformation bitmapInfo = null; + bool flag = false; + if (this.m_image != null) + flag = !(this.m_buffer == IntPtr.Zero) ? ImageLoader.FromBuffer(this.m_image, this.m_buffer, (int)this.m_length, this.m_req.MaximumSize, this.m_req.Flippable, this.m_req.AntialiasEdges, this.m_req.BorderWidth, this.m_req.BorderColor, out bitmapInfo) : ImageLoader.FromFile(this.m_image, this.m_image.Identifier, this.m_req.MaximumSize, this.m_req.Flippable, this.m_req.AntialiasEdges, this.m_req.BorderWidth, this.m_req.BorderColor, out bitmapInfo); + if (flag) + { + this.m_info = bitmapInfo; + this.SetSize(this.m_info.imageInfo.Header.sizeActualPxl); + } + return flag; + } + + protected virtual void OnImageLoadComplete() + { + } + + internal ImageCache ImageCacheOwner + { + get => this.m_owner; + set => this.m_owner = value; + } + + protected void UpdateLastUsedTime() + { + this.AssertValidState(); + if (!(DateTime.UtcNow - this.m_dtLastUsed > s_tsUpdateThreshhold)) + return; + this.m_dtLastUsed = DateTime.UtcNow; + if (this.m_owner == null) + return; + this.m_owner.UpdateLastUsedItem(this); + } + + public bool IsOlder(DateTime dtCompare) + { + this.AssertValidState(); + return this.m_dtLastUsed < dtCompare; + } + + protected void AssertValidState() + { + } + + public override string ToString() => this.m_stIdentifier; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs new file mode 100644 index 0000000..bccf8f9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageCacheKey +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Extensions +{ + public class ImageCacheKey + { + private string m_stIdentifier; + private Size m_sizeMaxPxl; + private bool m_fFlippable; + private bool m_fAntialiasEdges; + protected int m_nHashCode; + + protected ImageCacheKey(string identifier) => this.m_stIdentifier = identifier; + + public ImageCacheKey(string identifier, Size maxSize, bool flippable, bool antialiasEdges) + { + this.m_stIdentifier = identifier; + this.m_sizeMaxPxl = maxSize; + this.m_fFlippable = flippable; + this.m_fAntialiasEdges = antialiasEdges; + this.m_nHashCode = this.m_stIdentifier.GetHashCode() + this.m_sizeMaxPxl.Width + this.m_sizeMaxPxl.Height + (this.m_fFlippable ? 1 : 0) + (this.m_fAntialiasEdges ? 1 : 0); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(this, obj)) + return true; + return obj is ImageCacheKey imageCacheKey && this.m_stIdentifier.Equals(imageCacheKey.m_stIdentifier) && (this.m_sizeMaxPxl == imageCacheKey.m_sizeMaxPxl && this.m_fFlippable == imageCacheKey.m_fFlippable) && this.m_fAntialiasEdges == imageCacheKey.m_fAntialiasEdges; + } + + public override int GetHashCode() => this.m_nHashCode; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageData.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageData.cs new file mode 100644 index 0000000..2e2c406 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageData.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + [ComVisible(false)] + public struct ImageData + { + public IntPtr rgData; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageHeader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageHeader.cs new file mode 100644 index 0000000..6747c8f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageHeader.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageHeader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + [ComVisible(false)] + public struct ImageHeader + { + public Size sizeActualPxl; + public Size sizeOriginalPxl; + public int nStride; + public SurfaceFormat nFormat; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageInformation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageInformation.cs new file mode 100644 index 0000000..97ae63c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageInformation.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageInformation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + [ComVisible(false)] + public struct ImageInformation + { + public ImageHeader Header; + public ImageData Data; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageLoader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageLoader.cs new file mode 100644 index 0000000..7e3e052 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageLoader.cs @@ -0,0 +1,357 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageLoader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + public static class ImageLoader + { + public static bool LoadHeader(IntPtr rgData, int length, out ImageHeader header) + { + ImageRequirements req = new ImageRequirements(); + return LoadHeader(rgData, length, req, out header); + } + + public static bool LoadHeader( + IntPtr rgData, + int length, + ImageRequirements req, + out ImageHeader header) + { + Debug2.Validate(rgData != IntPtr.Zero, typeof(ArgumentNullException), "Must provide valid data to load"); + Debug2.Validate(length > 0, typeof(ArgumentOutOfRangeException), "Must provide non-zero length data to load"); + Debug2.Validate(req != null, typeof(ArgumentNullException), "Must provide valid ImageRequirements"); + ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.None; + BitmapInformation bitmapInformation = new BitmapInformation(); + HRESULT hresult = new HRESULT(-1); + try + { + hresult = ExtensionsApi.SpBitmapLoadBuffer(rgData, (uint)length, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo); + if (!hresult.IsSuccess()) + header = new ImageHeader(); + else + header = bitmapInformation.imageInfo.Header; + } + finally + { + bitmapInformation.Dispose(); + } + return hresult.IsSuccess(); + } + + public static bool FromFile( + IImage image, + string filename, + Size maxSize, + bool flipRTL, + bool antialiasEdges, + int borderWidth, + ColorF borderColor, + out BitmapInformation bitmapInfo) + { + Debug2.Validate(image != null, typeof(ArgumentNullException), "Image must be valid"); + ImageRequirements req = new ImageRequirements(); + req.BorderWidth = borderWidth; + req.BorderColor = borderColor; + req.Flippable = flipRTL; + req.AntialiasEdges = antialiasEdges; + req.MaximumSize = maxSize; + ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.Decode; + if (flipRTL) + nOptions |= ExtensionsApi.BitmapOptions.Flip; + BitmapInformation bitmapInformation = new BitmapInformation(); + if (!ExtensionsApi.SpBitmapLoadFile(filename, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) + { + bitmapInfo = null; + return false; + } + bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); + if (flag) + { + bitmapInfo = bitmapInformation; + } + else + { + bitmapInfo = null; + bitmapInformation.Dispose(); + } + return flag; + } + + public static bool FromResource( + IImage image, + string moduleName, + string resourceID, + Size maxSize, + bool flipRTL, + bool antialiasEdges, + int borderWidth, + ColorF borderColor, + out BitmapInformation bitmapInfo) + { + Debug2.Validate(image != null, typeof(ArgumentNullException), "Image must be valid"); + ImageRequirements req = new ImageRequirements(); + req.BorderWidth = borderWidth; + req.BorderColor = borderColor; + req.Flippable = flipRTL; + req.AntialiasEdges = antialiasEdges; + req.MaximumSize = maxSize; + Win32Api.HINSTANCE hinst = ModuleManager.Instance.LoadModule(moduleName); + if (hinst == Win32Api.HINSTANCE.NULL) + { + bitmapInfo = null; + return false; + } + ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.Decode; + if (flipRTL) + nOptions |= ExtensionsApi.BitmapOptions.Flip; + BitmapInformation bitmapInformation = new BitmapInformation(); + if (!ExtensionsApi.SpBitmapLoadResource(hinst, resourceID, 10, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) + { + bitmapInfo = null; + return false; + } + bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); + if (flag) + { + bitmapInfo = bitmapInformation; + } + else + { + bitmapInfo = null; + bitmapInformation.Dispose(); + } + return flag; + } + + public static bool FromBuffer( + IImage image, + IntPtr buffer, + int length, + Size maxSize, + bool flipRTL, + bool antialiasEdges, + int borderWidth, + ColorF borderColor, + out BitmapInformation bitmapInfo) + { + Debug2.Validate(image != null, typeof(ArgumentNullException), "Image must be valid"); + Debug2.Validate(length > 0, typeof(ArgumentException), "Do not call for zero-length buffer"); + ImageRequirements req = new ImageRequirements(); + req.BorderWidth = borderWidth; + req.BorderColor = borderColor; + req.Flippable = flipRTL; + req.AntialiasEdges = antialiasEdges; + req.MaximumSize = maxSize; + ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.Decode; + if (flipRTL) + nOptions |= ExtensionsApi.BitmapOptions.Flip; + BitmapInformation bitmapInformation = new BitmapInformation(); + if (!ExtensionsApi.SpBitmapLoadBuffer(buffer, (uint)length, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) + { + bitmapInfo = null; + return false; + } + bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); + if (flag) + { + bitmapInfo = bitmapInformation; + } + else + { + bitmapInfo = null; + bitmapInformation.Dispose(); + } + return flag; + } + + public static bool FromRaw( + IImage image, + IntPtr buffer, + int length, + Size imageSize, + int stride, + SurfaceFormat format, + Size maxSize, + bool flipRTL, + bool antialiasEdges, + int borderWidth, + ColorF borderColor, + out BitmapInformation bitmapInfo) + { + Debug2.Validate(image != null, typeof(ArgumentNullException), "Image must be valid"); + Debug2.Validate(length > 0, typeof(ArgumentException), "Do not call for zero-length buffer"); + ImageRequirements req = new ImageRequirements(); + req.BorderWidth = borderWidth; + req.BorderColor = borderColor; + req.Flippable = flipRTL; + req.AntialiasEdges = antialiasEdges; + req.MaximumSize = maxSize; + ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.Decode; + if (flipRTL) + nOptions |= ExtensionsApi.BitmapOptions.Flip; + BitmapInformation bitmapInformation = new BitmapInformation(); + if (!ExtensionsApi.SpBitmapLoadRaw(imageSize, stride, format, buffer, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) + { + bitmapInfo = null; + return false; + } + bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); + if (flag) + { + bitmapInfo = bitmapInformation; + } + else + { + bitmapInfo = null; + bitmapInformation.Dispose(); + } + return flag; + } + + public static bool FromGradient( + IImage image, + Size sizeImage, + ImageFormat format, + ImageLoader.GradientValue[] horizontalRamp, + ImageLoader.GradientValue[] verticalRamp, + out GradientInformation gradientInfo) + { + Debug2.Validate(image != null, typeof(ArgumentException), "Image must be valid"); + Debug2.Validate(sizeImage.Width > 0 && sizeImage.Height > 0, typeof(ArgumentException), "Image size must be valid"); + Debug2.Validate(horizontalRamp != null || verticalRamp != null, typeof(ArgumentException), "Must provide at least one ramp"); + Debug2.Validate(format == ImageFormat.X8R8G8B8 || format == ImageFormat.A8R8G8B8 || format == ImageFormat.A8, typeof(ArgumentException), "Image format not supported"); + ValidateRamp(verticalRamp); + ValidateRamp(horizontalRamp); + SurfaceFormat nFormat = SurfaceFormatInfo.FromImageFormat(format); + int num1 = SurfaceFormatInfo.GetBitsPerPixel(nFormat) / 8; + int num2 = sizeImage.Width * num1; + int length = num2 * num1 * sizeImage.Height; + int num3 = 0; + byte[] numArray = new byte[length]; + for (int index = 0; index < sizeImage.Height; ++index) + { + ColorF colorF1 = new ColorF(0, 0, 0, 0); + if (verticalRamp != null) + { + float flValue = sizeImage.Height > 1 ? index / (float)(sizeImage.Height - 1) : 0.0f; + colorF1 = SampleGradient(verticalRamp, flValue); + colorF1.Clamp(); + } + int num4 = 0; + int num5 = 0; + while (num4 < sizeImage.Width) + { + ColorF colorF2 = colorF1; + if (horizontalRamp != null) + { + float flValue = sizeImage.Width > 1 ? num4 / (float)(sizeImage.Width - 1) : 0.0f; + colorF2 += SampleGradient(horizontalRamp, flValue); + colorF2.Clamp(); + } + switch (nFormat) + { + case SurfaceFormat.A8: + numArray[num3 + num5] = (byte)(colorF2.A * (double)byte.MaxValue); + break; + case SurfaceFormat.RGB32: + numArray[num3 + num5] = (byte)(colorF2.B * (double)byte.MaxValue); + numArray[num3 + num5 + 1] = (byte)(colorF2.G * (double)byte.MaxValue); + numArray[num3 + num5 + 2] = (byte)(colorF2.R * (double)byte.MaxValue); + numArray[num3 + num5 + 3] = byte.MaxValue; + break; + case SurfaceFormat.ARGB32: + numArray[num3 + num5] = (byte)(colorF2.B * (double)byte.MaxValue); + numArray[num3 + num5 + 1] = (byte)(colorF2.G * (double)byte.MaxValue); + numArray[num3 + num5 + 2] = (byte)(colorF2.R * (double)byte.MaxValue); + numArray[num3 + num5 + 3] = (byte)(colorF2.A * (double)byte.MaxValue); + break; + default: + Debug2.Throw(false, "Unsupported format type"); + break; + } + ++num4; + num5 += num1; + } + num3 += num2; + } + GradientInformation gradientInformation = new GradientInformation() + { + imageInfo = { + Header = { + sizeActualPxl = sizeImage, + sizeOriginalPxl = sizeImage, + nStride = num2, + nFormat = nFormat + } + }, + gcData = GCHandle.Alloc(numArray, GCHandleType.Pinned) + }; + gradientInformation.imageInfo.Data.rgData = gradientInformation.gcData.AddrOfPinnedObject(); + bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(gradientInformation.imageInfo.Header.nFormat), gradientInformation.imageInfo.Header.sizeActualPxl, gradientInformation.imageInfo.Header.nStride, gradientInformation.imageInfo.Data.rgData); + if (flag) + { + gradientInfo = gradientInformation; + } + else + { + gradientInfo = null; + ((IDisposable)gradientInformation).Dispose(); + } + return flag; + } + + private static ColorF SampleGradient( + ImageLoader.GradientValue[] rampValues, + float flValue) + { + if (rampValues.Length == 1) + return rampValues[0].value; + int index = 0; + ImageLoader.GradientValue rampValue1; + do + { + rampValue1 = rampValues[index++]; + } + while (index < rampValues.Length && flValue > (double)rampValues[index].position); + if (rampValues.Length <= index) + return rampValue1.value; + ImageLoader.GradientValue rampValue2 = rampValues[index]; + float num = (float)((flValue - (double)rampValue1.position) / (rampValue2.position - (double)rampValue1.position)); + return rampValue1.value * (1f - num) + rampValue2.value * num; + } + + private static void ValidateRamp(ImageLoader.GradientValue[] rampValues) + { + Debug2.Validate(rampValues == null || rampValues.Length > 0, typeof(ArgumentException), "Gradient must contain at least one sample point"); + if (rampValues == null) + return; + float num = 0.0f; + for (int index = 0; index < rampValues.Length; ++index) + { + Debug2.Validate(rampValues[index].position >= (double)num, typeof(ArgumentException), "Gradient ramp values must be monotomically increasing"); + Debug2.Validate(rampValues[index].position >= 0.0 && rampValues[index].position <= 1.0, typeof(ArgumentException), "Gradient ramp values must be [0, 1]"); + num = rampValues[index].position; + } + } + + public struct GradientValue + { + public float position; + public ColorF value; + + public GradientValue(float pos, ColorF val) + { + this.position = pos; + this.value = val; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageRequirements.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageRequirements.cs new file mode 100644 index 0000000..e063a64 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ImageRequirements.cs @@ -0,0 +1,87 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ImageRequirements +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Extensions +{ + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential)] + public class ImageRequirements + { + private ImageRequirements.Fields m_nMask; + private Size m_sizeMaximumPxl; + private int m_nBorderPxl; + private ColorF m_clrBorder; + + public Size MaximumSize + { + get => this.m_sizeMaximumPxl; + set + { + this.m_sizeMaximumPxl = value; + if (this.m_sizeMaximumPxl.IsZero) + this.m_nMask &= ~Fields.MaximumSize; + else + this.m_nMask |= Fields.MaximumSize; + } + } + + public bool Flippable + { + get => (this.m_nMask & Fields.Flippable) != Fields.None; + set + { + if (value) + this.m_nMask |= Fields.Flippable; + else + this.m_nMask &= ~Fields.Flippable; + } + } + + public int BorderWidth + { + get => this.m_nBorderPxl; + set + { + this.m_nBorderPxl = value; + if (this.m_nBorderPxl > 0) + this.m_nMask |= Fields.Border; + else + this.m_nMask &= ~Fields.Border; + } + } + + public ColorF BorderColor + { + get => this.m_clrBorder; + set => this.m_clrBorder = value; + } + + public bool AntialiasEdges + { + get => (this.m_nMask & Fields.AntialiasEdges) != Fields.None; + set + { + if (value) + this.m_nMask |= Fields.AntialiasEdges; + else + this.m_nMask &= ~Fields.AntialiasEdges; + } + } + + [Flags] + internal enum Fields + { + None = 0, + MaximumSize = 1, + Border = 2, + Flippable = 4, + AntialiasEdges = 16, // 0x00000010 + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ModuleManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ModuleManager.cs new file mode 100644 index 0000000..be271a4 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/ModuleManager.cs @@ -0,0 +1,73 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.ModuleManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + internal class ModuleManager + { + private static ModuleManager s_singleton; + private Map m_dictModules; + + ~ModuleManager() + { + if (this.m_dictModules == null) + return; + Map.ValueCollection.Enumerator enumerator = this.m_dictModules.Values.GetEnumerator(); + while (enumerator.MoveNext()) + Win32Api.FreeLibrary(enumerator.Current); + this.m_dictModules = null; + } + + public static ModuleManager Instance + { + get + { + if (s_singleton == null) + s_singleton = new ModuleManager(); + return s_singleton; + } + } + + public Win32Api.HINSTANCE LoadModule(string stModuleName) + { + if (this.m_dictModules == null) + this.m_dictModules = new Map(); + Win32Api.HINSTANCE hinstance; + if (this.m_dictModules.ContainsKey(stModuleName)) + { + hinstance = this.m_dictModules[stModuleName]; + } + else + { + hinstance = Win32Api.LoadLibraryEx(stModuleName, Win32Api.HANDLE.NULL, 2U); + Debug2.Validate(hinstance != Win32Api.HINSTANCE.NULL, typeof(ArgumentException), "Failed to load module {0}", stModuleName); + this.m_dictModules[stModuleName] = hinstance; + } + return hinstance; + } + + public void LoadResource( + Win32Api.HINSTANCE hInstance, + string resourceId, + out IntPtr resourceData, + out int resourceSize) + { + IntPtr resource = Win32Api.FindResource(hInstance.h, resourceId, new IntPtr(10)); + Debug2.Validate(resource != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to find resource {0} in the module", resourceId)); + IntPtr i = Win32Api.LoadResource(hInstance.h, resource); + Debug2.Validate(i != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to load resource {0} from the module", resourceId)); + IntPtr num1 = Win32Api.LockResource(i); + Debug2.Validate(num1 != IntPtr.Zero, typeof(InvalidOperationException), "Failed to aquire pointer to resource data"); + int num2 = Win32Api.SizeofResource(hInstance.h, resource); + resourceData = num1; + resourceSize = num2; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/RegistryListener.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/RegistryListener.cs new file mode 100644 index 0000000..944fcef --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/RegistryListener.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.RegistryListener +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Libraries.OS; +using Microsoft.Iris.Render.Internal; +using System; +using System.Globalization; +using System.Security; + +namespace Microsoft.Iris.Render.Extensions +{ + [SuppressUnmanagedCodeSecurity] + internal class RegistryListener : IDisposable + { + private Win32Api.WaitOrTimerCallBack m_RegistryChangeCallback; + private IntPtr m_hWaitHandle = IntPtr.Zero; + private Win32Api.HANDLE m_hRegEvent = Win32Api.HANDLE.NULL; + private IntPtr m_hkey = IntPtr.Zero; + private string m_stRegKey; + + public RegistryListener(string stKey) + { + this.m_stRegKey = stKey; + this.m_RegistryChangeCallback = new Win32Api.WaitOrTimerCallBack(this.OnRegistryChanged); + } + + ~RegistryListener() + { + } + + void IDisposable.Dispose() => this.StopListeningForRegistryChangeNotifications(); + + public bool ReadValueFromRegistry(string st, out int nValue) + { + nValue = 0; + RegistryKey registryKey = RegistryKey.Open(RegistryKey.HKEY_CURRENT_USER, this.m_stRegKey); + if (registryKey == null) + return false; + bool flag = registryKey.ReadInt(st, out nValue); + registryKey.Close(); + return flag; + } + + public bool ReadValueFromRegistry(string st, out byte bValue) + { + int nValue; + bool flag = this.ReadValueFromRegistry(st, out nValue); + bValue = (byte)nValue; + return flag; + } + + public bool ReadValueFromRegistry(string st, out bool fValue) + { + int nValue; + bool flag = this.ReadValueFromRegistry(st, out nValue); + fValue = nValue != 0; + return flag; + } + + internal void StartListeningForRegistryChanges() + { + lock (this) + { + this.StopListeningForRegistryChangeNotifications(); + this.m_hkey = IntPtr.Zero; + if (Win32Api.RegOpenKeyExW(Win32Api.HKEY_CURRENT_USER, this.m_stRegKey, 0, 16, out this.m_hkey) != 0) + return; + this.m_hRegEvent = Win32Api.CreateEvent(IntPtr.Zero, false, false, null); + int num = Win32Api.RegNotifyChangeKeyValue(this.m_hkey, true, 15, this.m_hRegEvent, true); + if (num != 0) + throw new Exception(string.Format(CultureInfo.InvariantCulture, "Unable to register key change handler: {0} (due to error {1})", m_stRegKey, num)); + IntPtr phNewWaitObject; + if (Win32Api.RegisterWaitForSingleObject(out phNewWaitObject, this.m_hRegEvent.h, this.m_RegistryChangeCallback, IntPtr.Zero, uint.MaxValue, 4U) == 0) + { + this.StopListeningForRegistryChangeNotifications(); + throw new Exception("Unable to register wait for object."); + } + this.m_hWaitHandle = phNewWaitObject; + } + } + + private void StopListeningForRegistryChangeNotifications() + { + lock (this) + { + if (this.m_hWaitHandle != IntPtr.Zero) + { + Win32Api.UnregisterWait(this.m_hWaitHandle); + this.m_hWaitHandle = IntPtr.Zero; + } + if (this.m_hRegEvent != Win32Api.HANDLE.NULL) + { + Win32Api.CloseHandle(this.m_hRegEvent); + this.m_hRegEvent = Win32Api.HANDLE.NULL; + } + if (!(this.m_hkey != IntPtr.Zero)) + return; + Win32Api.RegCloseKey(this.m_hkey); + this.m_hkey = IntPtr.Zero; + } + } + + public event EventHandler RegistryChanged; + + private void OnRegistryChanged(IntPtr ptrParameter, byte b) + { + this.StopListeningForRegistryChangeNotifications(); + if (this.RegistryChanged == null) + return; + this.RegistryChanged(this, EventArgs.Empty); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundData.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundData.cs new file mode 100644 index 0000000..5e71758 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundData.cs @@ -0,0 +1,90 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.SoundData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public class SoundData : ISoundData, IDisposable + { + private string m_moduleName; + private string m_resourceId; + private int m_usageCount; + private bool m_hasContent; + private ExtensionsApi.HSpSound m_soundHandle; + private ExtensionsApi.SoundInformation m_soundInfo; + + public SoundData(string moduleName, string resourceId) + { + Debug2.Validate(moduleName != null, typeof(ArgumentNullException), nameof(moduleName)); + Debug2.Validate(resourceId != null, typeof(ArgumentNullException), nameof(resourceId)); + this.m_moduleName = moduleName; + this.m_resourceId = resourceId; + this.m_usageCount = 0; + this.m_hasContent = false; + this.LoadSoundData(); + } + + ~SoundData() => this.Dispose(false); + + public void Dispose() + { + GC.SuppressFinalize(this); + this.Dispose(true); + } + + protected virtual void Dispose(bool fInDispose) + { + if (!this.m_hasContent) + return; + this.UnloadSoundData(); + } + + SoundDataFormat ISoundData.Format => SoundDataFormat.PCM; + + uint ISoundData.ChannelCount => m_soundInfo.Header.nChannels; + + uint ISoundData.SampleRate => this.m_soundInfo.Header.nSamplesPerSec; + + uint ISoundData.SampleSize => m_soundInfo.Header.wBitsPerSample; + + uint ISoundData.SampleCount => (uint)(m_soundInfo.Header.cbDataSize / (ulong)(m_soundInfo.Header.wBitsPerSample / 8)); + + IntPtr ISoundData.AcquireContent() + { + ++this.m_usageCount; + return this.m_soundInfo.Data.rgData; + } + + void ISoundData.ReleaseContent() => --this.m_usageCount; + + private void LoadSoundData() + { + if (this.m_hasContent) + return; + ExtensionsApi.HSpSound soundDataHandle; + ExtensionsApi.SoundInformation soundDataInfo; + SoundLoader.FromResource(this.m_moduleName, this.m_resourceId, out soundDataHandle, out soundDataInfo); + Debug2.Validate(soundDataInfo.Data.rgData != IntPtr.Zero, typeof(InvalidOperationException), "Failed to load data and no exception was thrown"); + Debug2.Validate(soundDataInfo.Header.wFormatTag == 1, typeof(ArgumentException), "Only PCM sound data is currently supported"); + Debug2.Validate(soundDataInfo.Header.nChannels >= 1 && soundDataInfo.Header.nChannels <= 2, typeof(ArgumentException), "Only mono/stereo sound data is currently supported"); + Debug2.Validate(soundDataInfo.Header.wBitsPerSample == 8 || soundDataInfo.Header.wBitsPerSample == 16, typeof(ArgumentException), "Only 8bps/16bps sound data is currently supported"); + Debug2.Validate((uint)(soundDataInfo.Header.cbDataSize / (ulong)(soundDataInfo.Header.wBitsPerSample / 8)) % soundDataInfo.Header.nChannels == 0U, typeof(ArgumentException), "Insufficient sample data"); + this.m_soundHandle = soundDataHandle; + this.m_soundInfo = soundDataInfo; + this.m_hasContent = true; + } + + private void UnloadSoundData() + { + if (!this.m_hasContent) + return; + this.m_hasContent = false; + SoundLoader.DisposeData(this.m_soundHandle, this.m_soundInfo); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundLoader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundLoader.cs new file mode 100644 index 0000000..20c2270 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/SoundLoader.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.SoundLoader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Extensions +{ + public static class SoundLoader + { + public static void FromResource( + string moduleName, + string resourceId, + out ExtensionsApi.HSpSound soundDataHandle, + out ExtensionsApi.SoundInformation soundDataInfo) + { + Win32Api.HINSTANCE hInstance = ModuleManager.Instance.LoadModule(moduleName); + Debug2.Validate(hInstance != Win32Api.HINSTANCE.NULL, typeof(ArgumentException), nameof(moduleName)); + IntPtr resourceData; + int resourceSize; + ModuleManager.Instance.LoadResource(hInstance, resourceId, out resourceData, out resourceSize); + FromMemory(resourceData, resourceSize, out soundDataHandle, out soundDataInfo); + } + + public static void FromMemory( + IntPtr rawSoundData, + int rawSoundDataSize, + out ExtensionsApi.HSpSound soundDataHandle, + out ExtensionsApi.SoundInformation soundDataInfo) + { + Debug2.Validate(rawSoundData != IntPtr.Zero, typeof(ArgumentNullException), nameof(rawSoundData)); + Debug2.Validate(rawSoundDataSize > 0, typeof(ArgumentException), "Invalid sound data size"); + ExtensionsApi.SoundOptions options = ExtensionsApi.SoundOptions.Decode; + ExtensionsApi.SoundInformation info = new ExtensionsApi.SoundInformation(); + ExtensionsApi.HSpSound hSound; + EngineApi.IFC(ExtensionsApi.SpSoundLoadBuffer(rawSoundData, rawSoundDataSize, options, out hSound, out info)); + soundDataHandle = hSound; + soundDataInfo = info; + } + + public static void DisposeData( + ExtensionsApi.HSpSound soundDataHandle, + ExtensionsApi.SoundInformation soundDataInfo) + { + EngineApi.IFC(ExtensionsApi.SpSoundDispose(soundDataHandle, soundDataInfo)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/TraceRegistryHelper.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/TraceRegistryHelper.cs new file mode 100644 index 0000000..60a584a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/TraceRegistryHelper.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.TraceRegistryHelper +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Extensions +{ + internal class TraceRegistryHelper : RegistryListener + { + private const string k_stReadValuesKey = "ReadValuesFromRegistry"; + private const string k_stSaveValuesKey = "SaveValuesToRegistry"; + private const string k_stTimedWriteLinesKey = "TimedWriteLines"; + private bool m_invalidCache; + private bool m_fReadValuesFromRegistry; + private bool m_fSaveValuesToRegistry; + + internal TraceRegistryHelper(string stRegKey) + : base(stRegKey) + => this.m_invalidCache = true; + + private void Refresh() + { + lock (this) + { + bool fValue; + if (this.ReadValueFromRegistry("ReadValuesFromRegistry", out fValue)) + this.m_fReadValuesFromRegistry = fValue; + if (this.ReadValueFromRegistry("SaveValuesToRegistry", out fValue)) + this.m_fSaveValuesToRegistry = fValue; + this.m_invalidCache = false; + } + } + + internal void Invalidate() + { + if (this.m_invalidCache) + return; + lock (this) + { + if (this.m_invalidCache) + return; + this.m_invalidCache = true; + } + } + + public bool ReadValuesFromRegistry + { + get + { + if (this.m_invalidCache) + this.Refresh(); + return this.m_fReadValuesFromRegistry; + } + set + { + if (this.m_fReadValuesFromRegistry == value) + return; + this.m_fReadValuesFromRegistry = value; + } + } + + public bool SaveValuesToRegistry + { + get + { + if (this.m_invalidCache) + this.Refresh(); + return this.m_fSaveValuesToRegistry; + } + set + { + if (this.m_fSaveValuesToRegistry == value) + return; + this.m_fSaveValuesToRegistry = value; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebug.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebug.cs new file mode 100644 index 0000000..735a565 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebug.cs @@ -0,0 +1,522 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.eDebug +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Collections; +using System.Diagnostics; +using System.Reflection; +using System.Security; +using System.Text; + +namespace Microsoft.Iris.Render.Extensions +{ + [SuppressUnmanagedCodeSecurity] + internal class eDebug + { + public const byte k_bDefaultTraceLevel = 1; + private bool m_fTimedWriteLines; + private bool m_fShowCategories; + private bool m_fAlwaysShowBraces; + private bool m_fOpenBracePending; + private DateTime m_dtStart; + private string m_stWriteLinePrefix; + private string m_stRendererWriteLinePrefix; + private string m_stIndent; + private Stack m_stackIndentStrings; + private byte m_bTraceLevelAdjustment; + private string m_stPendingWrite; + private int m_nMaxCategoryLength; + private DebugCategory m_pendingBraceCategory; + private string m_pendingBraceComment; + + internal eDebug() + { + this.m_stIndent = " "; + this.m_stackIndentStrings = new Stack(); + this.m_dtStart = DateTime.UtcNow; + this.m_fShowCategories = true; + this.m_bTraceLevelAdjustment = 0; + } + + internal void Dispose() + { + } + + public static void Break() + { + if (Debugger.IsAttached || !Win32Api.IsDebuggerPresent()) + Debugger.Break(); + else + Win32Api.DebugBreak(); + } + + public void Assert(bool fCondition) + { + if (!this.Assert(fCondition, "false", 2, null)) + return; + Break(); + } + + public void Assert(bool fCondition, string stMessage) + { + if (!this.Assert(fCondition, stMessage, 2, null)) + return; + Break(); + } + + public void Assert(bool fCondition, string stMessage, StackTrace stack) + { + if (!this.Assert(fCondition, stMessage, 0, stack)) + return; + Break(); + } + + public void Assert(Type type, object obj, string stMessage) + { + this.Prompt(type != null, "must pass a valid type", typeof(ArgumentNullException)); + if (!this.Assert(type.IsInstanceOfType(obj), stMessage, 2, null)) + return; + Break(); + } + + private bool Assert(bool fCondition, string stMessage, int cIgnoreFrames, StackTrace stack) + { + if (fCondition) + return false; + if (stack == null) + stack = new StackTrace(true); + return this.DisplayStackTrace("Iris Assert", stMessage, stack, cIgnoreFrames); + } + + public void Prompt(string stMessage) => this.Prompt(false, stMessage, null, null, 1); + + public void Prompt(string stMessage, Type type) => this.Prompt(false, stMessage, type, null, 1); + + public void Prompt(bool fCondition, string stMessage) => this.Prompt(fCondition, stMessage, null, null, 1); + + public void Prompt(bool fCondition, string stMessage, Type type) => this.Prompt(fCondition, stMessage, type, null, 1); + + public void Prompt(bool fCondition, string stMessage, Type type, object objSubject) => this.Prompt(fCondition, stMessage, type, objSubject, 1); + + private void Prompt( + bool fCondition, + string stMessage, + Type type, + object objSubject, + int cIgnoreFrames) + { + if (!fCondition) + { + StackTrace trace = new StackTrace(true); + if (this.DisplayStackTrace("Iris API Validation Error (Application error)", stMessage, trace, cIgnoreFrames + 1)) + Break(); + Exception exception; + if (type == null) + { + exception = new ArgumentException(stMessage); + } + else + { + object[] objArray; + if (objSubject != null) + objArray = new object[2] + { + stMessage, + objSubject + }; + else + objArray = new object[1] { stMessage }; + exception = (Exception)Activator.CreateInstance(type, objArray); + } + throw exception; + } + } + + public void PromptCompatibleArray(Array array, int indexStart, Type typeObject, int numItems) + { + this.Prompt(array != null, "Must have valid array", typeof(ArgumentNullException)); + this.Prompt(typeObject != null, "Must have valid Type", typeof(ArgumentNullException)); + this.Prompt(array.Rank == 1, "Array must have rank=1", typeof(RankException)); + this.Prompt(indexStart < array.Length || numItems == 0, "Must have valid index", typeof(ArgumentException)); + this.Prompt(indexStart >= 0, "Must have valid index", typeof(ArgumentOutOfRangeException)); + this.Prompt(indexStart + numItems <= array.Length, "Must have sufficient room in array", typeof(ArgumentOutOfRangeException)); + Type elementType = array.GetType().GetElementType(); + this.Prompt(typeObject == elementType || typeObject.IsSubclassOf(elementType), "Must be a compatible array type", typeof(ArrayTypeMismatchException)); + } + + public void PromptListContents(IList list, Type typeExpected) + { + this.Prompt(list != null, "Must have valid list", typeof(ArgumentNullException)); + this.Prompt(typeExpected != null, "Must have valid Type", typeof(ArgumentNullException)); + foreach (object obj in list) + this.Prompt(obj != null && typeExpected.IsAssignableFrom(obj.GetType()), "List should only contain {0}.", typeExpected); + } + + public void Write(DebugCategory cat, object oValue) + { + if (!this.IsCategoryEnabled(cat)) + return; + this.WriteWorker(cat, oValue); + } + + public void WriteLine(DebugCategory cat, object oValue) + { + if (!this.IsCategoryEnabled(cat)) + return; + this.WriteLineWorker(cat, oValue); + } + + public void Write(DebugCategory cat, byte bLevel, object oValue) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + this.WriteWorker(cat, oValue); + } + + public void WriteLine(DebugCategory cat, byte bLevel, object oValue) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + this.WriteLineWorker(cat, oValue); + } + + public void Write(DebugCategory cat, string stMessage) + { + if (!this.IsCategoryEnabled(cat)) + return; + this.WriteWorker(cat, stMessage); + } + + public void WriteLine(DebugCategory cat, string stMessage) + { + if (!this.IsCategoryEnabled(cat)) + return; + this.WriteLineWorker(cat, stMessage); + } + + public bool TimedWriteLines + { + get => this.m_fTimedWriteLines; + set + { + if (this.m_fTimedWriteLines == value) + return; + this.m_fTimedWriteLines = value; + eDebugApi.DebugSetTimedWriteLines(value); + } + } + + public bool ShowCategories + { + get => this.m_fShowCategories; + set + { + this.m_fShowCategories = value; + if (value) + return; + this.m_nMaxCategoryLength = 0; + } + } + + public bool AlwaysShowBraces + { + get => this.m_fAlwaysShowBraces; + set + { + this.m_fAlwaysShowBraces = value; + if (!value || !this.m_fOpenBracePending) + return; + this.FlushBraces(); + } + } + + public string WriteLinePrefix + { + get => this.m_stWriteLinePrefix; + set => this.m_stWriteLinePrefix = value; + } + + public string RendererWriteLinePrefix + { + get => this.m_stRendererWriteLinePrefix; + set + { + this.m_stRendererWriteLinePrefix = value; + eDebugApi.DebugSetWriteLinePrefix(value); + } + } + + public byte TraceLevelAdjustment + { + get => this.m_bTraceLevelAdjustment; + set => this.m_bTraceLevelAdjustment = value; + } + + public bool IsCategoryEnabled(DebugCategory cat) => false; + + public bool IsCategoryEnabled(DebugCategory cat, byte bLevel) => false; + + internal void EnableCategory(DebugCategory cat, bool fEnable) + { + } + + internal void EnableCategory(DebugCategory cat, byte bLevel) + { + } + + public string IndentString + { + get => this.m_stIndent; + set + { + if (!(this.m_stIndent != value)) + return; + this.m_stIndent = value; + int indentLevel = this.IndentLevel; + this.IndentLevel = 0; + this.IndentLevel = indentLevel; + } + } + + public void Indent(DebugCategory cat) => this.Indent(cat, 1); + + public void Indent(DebugCategory cat, byte bLevel) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + this.Indent(); + } + + public void Unindent(DebugCategory cat) => this.Unindent(cat, 1); + + public void Unindent(DebugCategory cat, byte bLevel) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + this.Unindent(); + } + + public int IndentLevel + { + get => this.m_stackIndentStrings.Count; + set + { + while (this.IndentLevel < value) + this.Indent(); + while (this.IndentLevel > value) + this.Unindent(); + } + } + + public void OpenBrace(DebugCategory cat) => this.OpenBrace(cat, null); + + public void OpenBrace(DebugCategory cat, string stComment) => this.OpenBrace(cat, 1, stComment); + + public void OpenBrace(DebugCategory cat, byte bLevel, string stComment) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + if (this.m_fOpenBracePending) + this.FlushBraces(); + if (stComment != null) + this.WriteLineWorker(cat, stComment); + if (!this.m_fAlwaysShowBraces) + { + this.m_fOpenBracePending = true; + this.m_pendingBraceCategory = cat; + this.m_pendingBraceComment = null; + } + else + { + this.WriteLineWorker(cat, "{"); + this.Indent(); + } + } + + public void DeferOpenBrace(DebugCategory cat) => this.DeferOpenBrace(cat, null); + + public void DeferOpenBrace(DebugCategory cat, string stComment) => this.DeferOpenBrace(cat, 1, stComment); + + public void DeferOpenBrace(DebugCategory cat, byte bLevel, string stComment) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + if (this.m_fOpenBracePending) + this.FlushBraces(); + this.m_fOpenBracePending = true; + this.m_pendingBraceCategory = cat; + this.m_pendingBraceComment = stComment; + } + + public void FlushBraces() + { + if (!this.m_fOpenBracePending) + return; + this.m_fOpenBracePending = false; + bool alwaysShowBraces = this.m_fAlwaysShowBraces; + this.m_fAlwaysShowBraces = true; + this.OpenBrace(this.m_pendingBraceCategory, this.m_pendingBraceComment); + this.m_fAlwaysShowBraces = alwaysShowBraces; + } + + public void CloseBrace(DebugCategory cat) => this.CloseBrace(cat, 1); + + public void CloseBrace(DebugCategory cat, byte bLevel) + { + if (!this.IsCategoryEnabled(cat, bLevel)) + return; + if (this.m_fOpenBracePending && cat == this.m_pendingBraceCategory) + { + this.m_fOpenBracePending = false; + this.m_pendingBraceComment = null; + } + else + { + this.Unindent(); + this.WriteLineWorker(cat, "}"); + } + } + + private bool DisplayStackTrace( + string title, + string stMessage, + StackTrace trace, + int cIgnoreFrames) + { + this.Prompt(trace != null, "Must pass a valid StackTrace", typeof(ArgumentNullException)); + StackFrame frame1 = trace.GetFrame(cIgnoreFrames); + string filename = frame1.GetFileName(); + int fileLineNumber = frame1.GetFileLineNumber(); + if (filename == null) + filename = ""; + StringBuilder stringBuilder = new StringBuilder(10240); + for (int index = cIgnoreFrames; index < trace.FrameCount; ++index) + { + StackFrame frame2 = trace.GetFrame(index); + stringBuilder.Append(frame2.GetILOffset()); + stringBuilder.Append("\t"); + string fileName = frame2.GetFileName(); + if (!string.IsNullOrEmpty(fileName)) + { + stringBuilder.Append(fileName); + stringBuilder.Append(","); + stringBuilder.Append(frame2.GetFileLineNumber()); + } + else + stringBuilder.Append(""); + stringBuilder.Append("\t"); + MethodBase method = frame2.GetMethod(); + Type reflectedType = method.ReflectedType; + if (reflectedType != null) + { + stringBuilder.Append(reflectedType.Name); + stringBuilder.Append("."); + } + else + stringBuilder.Append("::"); + stringBuilder.Append(method.Name); + stringBuilder.Append("\t"); + if (reflectedType != null) + { + AssemblyName assemblyName = new AssemblyName(reflectedType.Assembly.FullName); + stringBuilder.Append(assemblyName.Name); + } + else + { + Assembly entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null) + { + AssemblyName assemblyName = new AssemblyName(entryAssembly.FullName); + stringBuilder.Append(assemblyName.Name); + } + else + stringBuilder.Append(""); + } + stringBuilder.Append("\n"); + stringBuilder.Append("\t"); + } + string str = stringBuilder.ToString(); + this.OpenBrace(DebugCategory.Failure, string.Format("Assert: {0}", stMessage)); + this.WriteLine(DebugCategory.Failure, string.Format("Filename: {0}", filename)); + this.WriteLine(DebugCategory.Failure, string.Format("Line: {0}", fileLineNumber)); + this.OpenBrace(DebugCategory.Failure, string.Format("Stack trace:")); + this.WriteLine(DebugCategory.Failure, string.Format("Frame\tFile Name\tMethod Name\tAssembly", fileLineNumber)); + this.WriteLine(DebugCategory.Failure, str); + this.CloseBrace(DebugCategory.Failure); + this.CloseBrace(DebugCategory.Failure); + return eDebugApi.DebugDisplayErrorStack(stMessage, filename, fileLineNumber, title, str); + } + + private string CurrentIndentString => this.m_stackIndentStrings.Count == 0 ? string.Empty : (string)this.m_stackIndentStrings.Peek(); + + private void WriteWorker(DebugCategory cat, object oValue) + { + string str1 = null; + if (oValue != null) + str1 = oValue.ToString(); + this.m_stPendingWrite += str1; + if (this.m_stPendingWrite == null) + return; + int length1 = this.m_stPendingWrite.LastIndexOf('\n'); + if (length1 <= 0) + return; + int length2 = this.m_stPendingWrite.Length - length1 - 1; + if (length2 > 0) + { + string str2 = this.m_stPendingWrite.Substring(0, length1); + string str3 = this.m_stPendingWrite.Substring(length1 + 1, length2); + this.m_stPendingWrite = null; + this.WriteLineWorker(cat, str2); + this.m_stPendingWrite = str3; + } + else + { + string str2 = this.m_stPendingWrite.Substring(0, this.m_stPendingWrite.Length - 1); + this.m_stPendingWrite = null; + this.WriteLineWorker(cat, str2); + } + } + + private void WriteLineWorker(DebugCategory cat, object oValue) + { + if (this.m_fOpenBracePending) + this.FlushBraces(); + string str1 = null; + if (this.ShowCategories) + { + str1 = string.Format("[{0}] ", cat); + int length = str1.Length; + if (this.m_nMaxCategoryLength > length) + str1 = str1.PadLeft(this.m_nMaxCategoryLength); + else if (this.m_nMaxCategoryLength < length) + this.m_nMaxCategoryLength = length; + } + string str2 = this.m_stPendingWrite + oValue; + this.m_stPendingWrite = null; + string str3 = str2; + char[] chArray = new char[1] { '\n' }; + foreach (string str4 in str3.Split(chArray)) + { + string lpOutputString = this.WriteLinePrefix + str1 + this.CurrentIndentString + str4 + "\n"; + if (this.TimedWriteLines) + lpOutputString = this.PrefixCurrentTime(lpOutputString); + Win32Api.OutputDebugString(lpOutputString); + } + } + + private void Indent() => this.m_stackIndentStrings.Push(this.CurrentIndentString + this.m_stIndent); + + private void Unindent() + { + if (this.m_stackIndentStrings.Count <= 0) + return; + this.m_stackIndentStrings.Pop(); + } + + private string PrefixCurrentTime(object oValue) => oValue.ToString(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebugApi.cs b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebugApi.cs new file mode 100644 index 0000000..399ce7d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Extensions/eDebugApi.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Extensions.eDebugApi +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace Microsoft.Iris.Render.Extensions +{ + [SuppressUnmanagedCodeSecurity] + internal static class eDebugApi + { + private const string k_strEhDebugDllFileName = "UIXsup.dll"; + + static eDebugApi() + { + IntPtr h = Win32Api.LoadLibraryEx("UIXsup.dll", Win32Api.HANDLE.NULL, 0U).h; + } + + [DllImport("UIXsup.dll")] + internal static extern bool DebugDisplayErrorStack( + string stMessage, + string filename, + int line, + string title, + string stackTrace); + + [DllImport("UIXsup.dll")] + internal static extern void DebugSetTimedWriteLines(bool fEnabled); + + [DllImport("UIXsup.dll")] + internal static extern void DebugSetWriteLinePrefix(string stPrefix); + + [DllImport("UIXsup.dll")] + internal static extern byte DebugGetCategoryLevel(DebugCategory cat); + + [DllImport("UIXsup.dll")] + internal static extern void DebugSetCategoryLevel(DebugCategory cat, byte level); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/FilterMode.cs b/UIX.RenderApi/Microsoft/Iris/Render/FilterMode.cs new file mode 100644 index 0000000..829c2fd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/FilterMode.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.FilterMode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum FilterMode : byte + { + Point = 1, + Linear = 2, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/FormCloseReason.cs b/UIX.RenderApi/Microsoft/Iris/Render/FormCloseReason.cs new file mode 100644 index 0000000..6f4e5a7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/FormCloseReason.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.FormCloseReason +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum FormCloseReason + { + Unknown = -1, // 0xFFFFFFFF + ForcedClose = 0, + UserRequest = 1, + AutoRestart = 2, + RendererRequest = 3, + GenericError = 4, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/FormPlacement.cs b/UIX.RenderApi/Microsoft/Iris/Render/FormPlacement.cs new file mode 100644 index 0000000..fa668bb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/FormPlacement.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.FormPlacement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public struct FormPlacement + { + public Rectangle NormalPosition; + public Point MaximizedLocation; + public uint ShowState; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/FormStyleInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/FormStyleInfo.cs new file mode 100644 index 0000000..9080ca1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/FormStyleInfo.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.FormStyleInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public struct FormStyleInfo + { + public uint uStyleRestored; + public uint uExStyleRestored; + public uint uStyleMinimized; + public uint uExStyleMinimized; + public uint uStyleMaximized; + public uint uExStyleMaximized; + public uint uStyleFullscreen; + public uint uExStyleFullscreen; + + public override bool Equals(object o) => o is FormStyleInfo formStyleInfo && (int)this.uStyleRestored == (int)formStyleInfo.uStyleRestored && ((int)this.uExStyleRestored == (int)formStyleInfo.uExStyleRestored && (int)this.uStyleMinimized == (int)formStyleInfo.uStyleMinimized) && ((int)this.uExStyleMinimized == (int)formStyleInfo.uExStyleMinimized && (int)this.uStyleMaximized == (int)formStyleInfo.uStyleMaximized && ((int)this.uExStyleMaximized == (int)formStyleInfo.uExStyleMaximized && (int)this.uStyleFullscreen == (int)formStyleInfo.uStyleFullscreen)) && (int)this.uExStyleFullscreen == (int)formStyleInfo.uExStyleFullscreen; + + public override int GetHashCode() => (int)this.uStyleRestored ^ (int)this.uExStyleRestored; + + public static bool operator ==(FormStyleInfo fsi1, FormStyleInfo fsi2) => fsi1.Equals(fsi2); + + public static bool operator !=(FormStyleInfo fsi1, FormStyleInfo fsi2) => !(fsi1 == fsi2); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ForwardMessageHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/ForwardMessageHandler.cs new file mode 100644 index 0000000..f29f106 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ForwardMessageHandler.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ForwardMessageHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public delegate void ForwardMessageHandler(uint msg, IntPtr wParam, IntPtr lParam); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurElement.cs new file mode 100644 index 0000000..2f37f0b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurElement.cs @@ -0,0 +1,84 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.GaussianBlurElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class GaussianBlurElement : EffectOperation + { + internal const string ModePropertyName = "Mode"; + internal const string KernelRadiusPropertyName = "KernelRadius"; + internal const string BlurinessPropertyName = "Bluriness"; + private GaussianBlurMode m_blurMode; + private byte m_nModeID; + private int m_nKernelRadius; + private byte m_nKernelRadiusID; + private float m_flBluriness; + private byte m_nBlurinessID; + + public GaussianBlurElement(GaussianBlurMode blurMode, int nKernalRadius, float flBluriness) + { + Debug2.Validate(flBluriness > 0.0 && flBluriness <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); + Debug2.Validate(nKernalRadius >= 1 && nKernalRadius <= 6, typeof(ArgumentOutOfRangeException), "Valid range for KernelRadius is [1,6]"); + this.m_blurMode = blurMode; + this.m_nKernelRadius = nKernalRadius; + this.m_flBluriness = flBluriness; + this.m_typeOperation = EffectOperationType.GaussianBlur; + } + + public GaussianBlurElement() + { + this.m_blurMode = GaussianBlurMode.Normal; + this.m_nKernelRadius = 1; + this.m_flBluriness = 1.5f; + this.m_typeOperation = EffectOperationType.GaussianBlur; + } + + public GaussianBlurMode Mode + { + get => this.m_blurMode; + set => this.m_blurMode = value; + } + + public int KernelRadius + { + get => this.m_nKernelRadius; + set + { + Debug2.Validate(value >= 1 && value <= 6, typeof(ArgumentOutOfRangeException), "Valid range for KernelRadius is [1,6]"); + this.m_nKernelRadius = value; + } + } + + public float Bluriness + { + get => this.m_flBluriness; + set + { + Debug2.Validate(value > 0.0 && value <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); + this.m_flBluriness = value; + } + } + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Mode", 5, ref this.m_nModeID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "KernelRadius", 5, ref this.m_nKernelRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Bluriness", 8, ref this.m_nBlurinessID, ref nNextUniqueID); + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Mode", this.m_nModeID, (byte)this.m_blurMode, cacheKey); + this.GeneratePropertyCacheKey("KernelRadius", this.m_nKernelRadiusID, this.m_nKernelRadius, cacheKey); + this.GeneratePropertyCacheKey("Bluriness", this.m_nBlurinessID, this.m_flBluriness, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurMode.cs b/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurMode.cs new file mode 100644 index 0000000..9d11a76 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/GaussianBlurMode.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.GaussianBlurMode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum GaussianBlurMode + { + Normal, + Horizontal, + Vertical, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs new file mode 100644 index 0000000..e5efd52 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.AncestorEnumerator +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal struct AncestorEnumerator : IEnumerator, IEnumerable + { + private TreeNode m_nodeStart; + private TreeNode m_nodeCurrent; + private TreeNode m_nodeNext; + + internal AncestorEnumerator(TreeNode nodeStart) + { + this.m_nodeStart = nodeStart; + this.m_nodeCurrent = null; + this.m_nodeNext = this.m_nodeStart; + } + + object IEnumerator.Current => m_nodeCurrent; + + public TreeNode Current => this.m_nodeCurrent; + + IEnumerator IEnumerable.GetEnumerator() => this; + + public AncestorEnumerator GetEnumerator() => this; + + public void Reset() + { + this.m_nodeCurrent = null; + this.m_nodeNext = this.m_nodeStart; + } + + public bool MoveNext() + { + this.m_nodeCurrent = this.m_nodeNext; + if (this.m_nodeNext == null) + return false; + this.m_nodeNext = this.m_nodeNext.Parent; + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Camera.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Camera.cs new file mode 100644 index 0000000..6872b60 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Camera.cs @@ -0,0 +1,185 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Camera +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Camera : + SharedRenderObject, + ICamera, + IAnimatableObject, + IAnimatable, + ISharedRenderObject, + IRenderHandleOwner + { + public static readonly string EyeProperty = "CameraEye"; + public static readonly string AtProperty = "CameraAt"; + public static readonly string UpProperty = "CameraUp"; + public static readonly string ZnProperty = "CameraZn"; + private RenderSession m_session; + private RemoteCamera m_remoteCamera; + private Vector3 m_vEye; + private Vector3 m_vAt; + private Vector3 m_vUp; + private float m_flZn; + private bool m_fPerspective; + + internal Camera(RenderSession session) + { + this.m_session = session; + Debug2.Validate(this.m_session != null, typeof(ArgumentNullException), "Must have valid RenderSession"); + this.m_session.AssertOwningThread(); + this.m_remoteCamera = this.m_session.BuildRemoteCamera(this); + this.SetEye(new Vector3(0.0, 0.0, -4.0)); + this.SetAt(new Vector3(0.0, 0.0, 0.0)); + this.SetUp(new Vector3(0.0, 1.0, 0.0)); + this.SetZn(2f); + this.SetPerspective(true); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose || this.m_remoteCamera == null) + return; + this.m_remoteCamera.Dispose(); + this.m_remoteCamera = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteCamera.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteCamera = null; + + internal RemoteCamera RemoteStub => this.m_remoteCamera; + + Vector3 ICamera.Eye + { + get => this.m_vEye; + set => this.SetEye(value); + } + + Vector3 ICamera.At + { + get => this.m_vAt; + set => this.SetAt(value); + } + + Vector3 ICamera.Up + { + get => this.m_vUp; + set => this.SetUp(value); + } + + float ICamera.Zn + { + get => this.m_flZn; + set => this.SetZn(value); + } + + bool ICamera.Perspective + { + get => this.m_fPerspective; + set => this.SetPerspective(value); + } + + private void SetEye(Vector3 vEye) + { + if (!(this.m_vEye != vEye)) + return; + this.m_vEye = vEye; + if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) + return; + this.m_remoteCamera.SendSetEye(vEye); + } + + private void SetAt(Vector3 vAt) + { + if (!(this.m_vAt != vAt)) + return; + this.m_vAt = vAt; + if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) + return; + this.m_remoteCamera.SendSetAt(vAt); + } + + private void SetUp(Vector3 vUp) + { + if (!(this.m_vUp != vUp)) + return; + this.m_vUp = vUp; + if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) + return; + this.m_remoteCamera.SendSetUp(vUp); + } + + private void SetZn(float flZn) + { + if (m_flZn == (double)flZn) + return; + this.m_flZn = flZn; + if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) + return; + this.m_remoteCamera.SendSetZn(flZn); + } + + private void SetPerspective(bool fPerspective) + { + if (this.m_fPerspective == fPerspective) + return; + this.m_fPerspective = fPerspective; + if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) + return; + this.m_remoteCamera.SendSetPerspective(fPerspective); + } + + RENDERHANDLE IAnimatableObject.GetObjectId() => ((IRenderHandleOwner)this).RenderHandle; + + uint IAnimatableObject.GetPropertyId(string propertyName) + { + if (propertyName == EyeProperty) + return 1; + if (propertyName == AtProperty) + return 2; + if (propertyName == UpProperty) + return 3; + if (propertyName == ZnProperty) + return 4; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); + return 0; + } + + AnimationInputType IAnimatableObject.GetPropertyType( + string propertyName) + { + if (propertyName == EyeProperty || propertyName == AtProperty || propertyName == UpProperty) + return AnimationInputType.Vector3; + if (propertyName == ZnProperty) + return AnimationInputType.Float; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); + return AnimationInputType.Float; + } + + private enum AnimatableProperties : uint + { + Eye = 1, + At = 2, + Up = 3, + Zn = 4, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DataBufferCleanupInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DataBufferCleanupInfo.cs new file mode 100644 index 0000000..e2166fd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DataBufferCleanupInfo.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DataBufferCleanupInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class DataBufferCleanupInfo + { + public IntPtr rgConvertData; + public ImageLoadInfo imageLoadInfo; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs new file mode 100644 index 0000000..90c8367 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs @@ -0,0 +1,92 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9BlendElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render.Common; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9BlendElement + { + internal static void Generate( + BlendElement efiBlend, + string stBlendOutput1, + string stBlendOutput2, + ref Dx9EffectBuilder effectBuilder) + { + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiBlend.Name); + string str1 = null; + switch (efiBlend.ColorOperation) + { + case ColorOperation.Add: + str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Subtract: + str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = float3(abs({1}.rgb - {2}.rgb));\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Multiply: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb * {2}.rgb;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Lighten: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = max({1}.rgb, {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Darken: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = min({1}.rgb, {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.ColorDodge: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb / (1 - {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.ColorBurn: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) / {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Screen: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) * (1 - {2}.rgb));\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case ColorOperation.Overlay: + string localVariable1 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({1}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({1}.rgb - 0.5)) * (1 - {2}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable1); + break; + case ColorOperation.SoftLight: + string localVariable2 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (2 * (1 - (({1}.rgb / 2) + 0.25)) * (1 - {2}.rgb)))\r\n + (1 - {3}.rgb) * (2 * ({1}.rgb / 2 + 0.25) * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable2); + break; + case ColorOperation.HardLight: + string localVariable3 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({2}.rgb - 0.5)) * (1 - {1}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable3); + break; + case ColorOperation.LinearBurn: + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb - 1;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + default: + Debug2.Throw(false, "Unknown color blend operation"); + break; + } + string str2 = null; + switch (efiBlend.AlphaOperation) + { + case AlphaOperation.Add: + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a + {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case AlphaOperation.Subtract: + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a - {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case AlphaOperation.Multiply: + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a * {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); + break; + case AlphaOperation.Source1: + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1); + break; + case AlphaOperation.Source2: + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput2); + break; + default: + Debug2.Throw(false, "Unknown alpha blend operation"); + break; + } + effectBuilder.EmitPixelFragment(str1 + str2); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs new file mode 100644 index 0000000..0f6d396 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9BrightnessElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9BrightnessElement + { + internal static void Generate( + BrightnessElement efoBrightness, + ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo = new VariableInfo() + { + ID = efoBrightness.BrightnessID, + Type = Dx9VariableType.Float, + IsDynamic = efoBrightness.IsDynamicProperty("Brightness") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoBrightness.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoBrightness.Name); + variableInfo.DefaultValue = efoBrightness.Brightness; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // adjust brightness based on input\r\n {0}.rgb += float3({1}, {1}, {1});\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs new file mode 100644 index 0000000..ff6af80 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9ColorElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9ColorElement + { + internal static void Generate(ColorElement efiColor, ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo = new VariableInfo() + { + ID = efiColor.ColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efiColor.IsDynamicProperty("Color") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efiColor.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efiColor.Name); + variableInfo.DefaultValue = efiColor.Color.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo); + string name = variableInfo.Name; + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiColor.Name); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the color\r\n float4 {0} = {1};\r\n\r\n", effectBuilder.PixelShaderOutput, name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs new file mode 100644 index 0000000..a793366 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9ComplexImageElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9ComplexImageElement + { + internal static void Generate(ComplexImageElement efiImage, ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efiImage.MinFilterID, + Type = Dx9VariableType.Integer, + IsDynamic = efiImage.IsDynamicProperty("MinFilter") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efiImage.Name + "MinFilter") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efiImage.Name + "MinFilter"); + variableInfo1.DefaultValue = (int)efiImage.MinFilter; + effectBuilder.AddPropertyVariable(variableInfo1); + string name1 = variableInfo1.Name; + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efiImage.MagFilterID, + Type = Dx9VariableType.Integer, + IsDynamic = efiImage.IsDynamicProperty("MagFilter") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efiImage.Name + "MagFilter") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efiImage.Name + "MagFilter"); + variableInfo2.DefaultValue = (int)efiImage.MagFilter; + effectBuilder.AddPropertyVariable(variableInfo2); + string name2 = variableInfo2.Name; + effectBuilder.AddPropertyVariable(new VariableInfo() + { + ID = efiImage.CoordinateMapIndexID, + Type = Dx9VariableType.Integer, + IsDynamic = efiImage.IsDynamicProperty("CoordinateMapIndex"), + Name = null, + DefaultValue = (int)efiImage.CoordinateMapIndex + }); + Dx9TextureInfo dx9TextureInfo = effectBuilder.AllocateTexture(); + TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); + textureVariableInfo.ID = efiImage.ImageID; + textureVariableInfo.Type = Dx9VariableType.Texture; + textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiImage.Name); + textureVariableInfo.DefaultValue = efiImage.Image; + textureVariableInfo.SamplerName = dx9TextureInfo.Sampler; + textureVariableInfo.MinFilter = InvariantString.Format("<{0}>", name1); + textureVariableInfo.MagFilter = InvariantString.Format("<{0}>", name2); + textureVariableInfo.CoordinateMapID = efiImage.CoordinateMapIndexID; + textureVariableInfo.ImageIndexID = efiImage.ImageIndexID; + effectBuilder.AddPropertyVariable(textureVariableInfo); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiImage.Name); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, dx9TextureInfo.Sampler, dx9TextureInfo.TexCoordInput)); + effectBuilder.AddPropertyVariable(new VariableInfo() + { + ID = efiImage.ImageIndexID, + Type = Dx9VariableType.Integer, + IsDynamic = efiImage.IsDynamicProperty("ImageIndex"), + Name = null, + DefaultValue = (int)efiImage.ImageIndex + }); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs new file mode 100644 index 0000000..80d56eb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9ContrastElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9ContrastElement + { + internal static void Generate(ContrastElement efoContrast, ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo = new VariableInfo() + { + ID = efoContrast.ContrastID, + Type = Dx9VariableType.Float, + IsDynamic = efoContrast.IsDynamicProperty("Contrast") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoContrast.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoContrast.Name); + variableInfo.DefaultValue = efoContrast.Contrast; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // apply the gain factor \r\n {0}.rgb -= float3(0.5f, 0.5f, 0.5f)\r\n; {0}.rgb *= float3({1}, {1}, {1});\r\n {0}.rgb += float3(0.5f, 0.5f, 0.5f)\r\n; }}\r\n", effectBuilder.PixelShaderOutput, variableInfo.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs new file mode 100644 index 0000000..082a1d9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9DesaturateElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9DesaturateElement + { + internal static void Generate( + DesaturateElement efoDesaturate, + ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo = new VariableInfo() + { + ID = efoDesaturate.DesaturateID, + Type = Dx9VariableType.Float, + DefaultValue = efoDesaturate.Desaturate, + IsDynamic = efoDesaturate.IsDynamicProperty("Desaturate") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoDesaturate.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoDesaturate.Name); + effectBuilder.AddPropertyVariable(variableInfo); + string name = variableInfo.Name; + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Desaturate the value\r\n {{\r\n float3 vGray = {{.15, .55, .30}};\r\n float fLuminance = dot({0}.rgb, vGray);\r\n {0}.rgb = lerp({0}.rgb, fLuminance.rrr, {1});\r\n\r\n }}\r\n", effectBuilder.PixelShaderOutput, name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs new file mode 100644 index 0000000..d4de93b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9DestinationElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9DestinationElement + { + internal static void Generate( + DestinationElement efiDestination, + ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.AllocateTexture(); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.SampleBackbuffer, (int)efiDestination.DownsampleID); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.DisablePerspectiveCorrection, null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); + TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); + textureVariableInfo.ID = efiDestination.DestinationID; + textureVariableInfo.Type = Dx9VariableType.Texture; + textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiDestination.Name); + textureVariableInfo.DefaultValue = null; + textureVariableInfo.SamplerName = textureInfo.Sampler; + textureVariableInfo.MinFilter = "Linear"; + textureVariableInfo.MagFilter = "Linear"; + textureVariableInfo.CoordinateMapID = -1; + textureVariableInfo.ImageIndexID = -1; + effectBuilder.AddPropertyVariable(textureVariableInfo); + effectBuilder.AddPropertyVariable(new VariableInfo() + { + ID = efiDestination.DownsampleID, + Type = Dx9VariableType.Float, + IsDynamic = efiDestination.IsDynamicProperty("Downsample"), + Name = null, + DefaultValue = efiDestination.Downsample + }); + VariableInfo variableInfo = new VariableInfo() + { + ID = efiDestination.UVOffsetID, + Type = Dx9VariableType.Vector2, + IsDynamic = efiDestination.IsDynamicProperty("UVOffset") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, "UVOffset") : effectBuilder.GenerateGlobalConstant(variableInfo.Type, "UVOffset"); + variableInfo.DefaultValue = efiDestination.UVOffset; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Texture, efiDestination.Name); + if (variableInfo.IsDynamic || !efiDestination.UVOffset.IsApproximate(Vector2.Zero)) + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); + else + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs new file mode 100644 index 0000000..11c47d9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EdgeDetectionElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EdgeDetectionElement + { + internal static void Generate( + EdgeDetectionElement efoEdgeDetection, + ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); + VariableInfo variableInfo = new VariableInfo() + { + ID = efoEdgeDetection.EdgeLimitID, + Type = Dx9VariableType.Float, + IsDynamic = efoEdgeDetection.IsDynamicProperty("EdgeLimit") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoEdgeDetection.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoEdgeDetection.Name); + variableInfo.DefaultValue = efoEdgeDetection.EdgeLimit; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vBottomPixel = tex2D({1}, {2} + float2(0.0f, {3}.y));\r\n float currentAvg = {0}.r + {0}.g + {0}.b;\r\n currentAvg = currentAvg / 3.0f;\r\n float bottomAvg = vBottomPixel.r + vBottomPixel.g + vBottomPixel.b;\r\n bottomAvg = bottomAvg / 3.0f;\r\n float diff = abs(currentAvg - bottomAvg);\r\n // change color into black or white depending on what the delta is\r\n if (diff < {4})\r\n {{\r\n {0}.rgb = 1.0f;\r\n }}\r\n else\r\n {{\r\n {0}.rgb = 0.0f;\r\n }}\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9Effect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9Effect.cs new file mode 100644 index 0000000..8ee7932 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9Effect.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9Effect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocols.Splash.Rendering; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9Effect : Effect + { + internal Dx9Effect(Dx9EffectTemplate effectTemplate) + : base(effectTemplate) + => this.m_remoteEffect = this.m_effectTemplate.Session.BuildRemoteDx9Effect(this); + + internal Dx9EffectManager EffectManager => ((Dx9GraphicsDevice)this.m_effectTemplate.Device).EffectManager; + + internal override void RemoteEffect() + { + ((RemoteDx9Effect)this.m_remoteEffect).SendLoadEffectResource(((Dx9EffectTemplate)this.m_effectTemplate).EffectResource.RemoteStub); + this.Initialize(); + } + + internal override void SetProperty(string stPropertyName, Image image) + { + if (image != null) + { + Dx9EffectResource effectResource = ((Dx9EffectTemplate)this.m_effectTemplate).EffectResource; + image.GutterSize = effectResource.GutterSize; + } + base.SetProperty(stPropertyName, image); + } + + internal override void SetProperty(string stPropertyName, IImage[] images) + { + Dx9EffectResource effectResource = ((Dx9EffectTemplate)this.m_effectTemplate).EffectResource; + for (int index = 0; index < images.Length; ++index) + { + if (images[index] is Image image) + image.GutterSize = effectResource.GutterSize; + } + base.SetProperty(stPropertyName, images); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs new file mode 100644 index 0000000..4303218 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs @@ -0,0 +1,376 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EffectBuilder +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render.Internal; +using System.IO; +using System.Text; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EffectBuilder + { + private string m_stPixelOutput; + private StringBuilder m_sbPixelShader; + private StringBuilder m_sbVertexShader; + private StringBuilder m_sbDeclarations; + private StringBuilder m_sbEffect; + private Vector m_alPropertyVariables; + private int m_nUniqueVariableID; + private Vector m_alTextureInfos; + private Vector m_alGlobalVariables; + private Vector m_alIncludes; + private int m_cMaxSimultaneousTextures; + private int m_cMaxRenderTargets; + private int m_nRequirements; + + internal Dx9EffectBuilder(GraphicsCaps caps) + { + this.m_cMaxSimultaneousTextures = caps.MaxSimultaneousTextures; + this.m_cMaxRenderTargets = caps.AvailableRenderTargets; + } + + internal void EmitPixelFragment(string stData) + { + if (this.m_sbPixelShader == null) + this.m_sbPixelShader = new StringBuilder(128); + this.m_sbPixelShader.Append(stData); + } + + internal void EmitEffectFragment(string stData) + { + if (this.m_sbEffect == null) + this.m_sbEffect = new StringBuilder(512); + this.m_sbEffect.Append(stData); + } + + internal void EmitIncludesFragment(string stData) + { + if (this.m_alIncludes == null) + this.m_alIncludes = new Vector(); + if (this.m_alIncludes.Contains(stData)) + return; + this.m_alIncludes.Add(stData); + } + + internal string GenerateGlobalConstant(Dx9VariableType typeProperty, string stName) => this.GenerateVariableName(VariableScope.Const, typeProperty, stName); + + internal string GenerateLocalVariable(Dx9VariableType typeProperty, string stName) => this.GenerateVariableName(VariableScope.Local, typeProperty, stName); + + internal string GenerateGlobalVariable(Dx9VariableType typeProperty, string stName) => this.GenerateVariableName(VariableScope.Global, typeProperty, stName); + + internal void AddPropertyVariable(VariableInfo variableInfo) + { + if (this.m_alPropertyVariables == null) + this.m_alPropertyVariables = new Vector(); + this.m_alPropertyVariables.Add(variableInfo); + } + + internal void AddGlobalVariable(VariableInfo variableInfo) + { + if (this.m_alGlobalVariables == null) + this.m_alGlobalVariables = new Vector(); + this.m_alGlobalVariables.Add(variableInfo); + } + + private string GenerateVariableName( + VariableScope scope, + Dx9VariableType typeProperty, + string stName) + { + StringBuilder stringBuilder = new StringBuilder(32); + switch (scope) + { + case VariableScope.Global: + stringBuilder.Append("g_"); + break; + case VariableScope.Const: + stringBuilder.Append("k_"); + break; + } + switch (typeProperty) + { + case Dx9VariableType.Integer: + stringBuilder.Append("n"); + break; + case Dx9VariableType.Float: + stringBuilder.Append("fl"); + break; + case Dx9VariableType.Vector2: + case Dx9VariableType.Vector3: + case Dx9VariableType.Vector4: + stringBuilder.Append("v"); + break; + case Dx9VariableType.Texture: + stringBuilder.Append("tex"); + break; + } + if (stName != null) + { + if (stName.Length > 15) + stName = stName.Substring(0, 15); + stringBuilder.Append(stName); + } + else + stringBuilder.Append("Temp"); + return stringBuilder.ToString() + this.m_nUniqueVariableID++; + } + + internal void Clear() + { + this.m_stPixelOutput = null; + this.m_nUniqueVariableID = 0; + this.m_nRequirements = 0; + this.m_sbPixelShader = null; + this.m_sbVertexShader = null; + this.m_sbDeclarations = null; + this.m_sbEffect = null; + if (this.m_alPropertyVariables != null) + this.m_alPropertyVariables.Clear(); + if (this.m_alGlobalVariables != null) + this.m_alGlobalVariables.Clear(); + if (this.m_alTextureInfos != null) + this.m_alTextureInfos.Clear(); + if (this.m_alIncludes == null) + return; + this.m_alIncludes.Clear(); + } + + internal string ConvertToString(Dx9VariableType type) + { + switch (type) + { + case Dx9VariableType.Integer: + return "int"; + case Dx9VariableType.Float: + return "float"; + case Dx9VariableType.Vector2: + return "float2"; + case Dx9VariableType.Vector3: + return "float3"; + case Dx9VariableType.Vector4: + return "float4"; + case Dx9VariableType.Texture: + return "texture"; + default: + return ""; + } + } + + internal string ConvertToString(FilterMode mode) + { + switch (mode) + { + case FilterMode.Point: + return "Point"; + case FilterMode.Linear: + return "Linear"; + default: + return ""; + } + } + + internal bool Validate() => this.ImageCount <= this.m_cMaxSimultaneousTextures && this.GetRenderTargetCount() <= this.m_cMaxRenderTargets; + + internal Dx9TextureInfo AllocateTexture() + { + Dx9TextureInfo dx9TextureInfo = new Dx9TextureInfo() + { + ImageIndex = this.ImageCount + }; + dx9TextureInfo.TexCoordInput = InvariantString.Format("{0}{1}", "vTexCoord", dx9TextureInfo.ImageIndex); + dx9TextureInfo.Sampler = InvariantString.Format("{0}{1}", "Sampler", dx9TextureInfo.ImageIndex); + dx9TextureInfo.DownsamplePropertyID = -1; + if (this.m_alTextureInfos == null) + this.m_alTextureInfos = new Vector(); + this.m_alTextureInfos.Add(dx9TextureInfo); + return dx9TextureInfo; + } + + internal void AddRequirement( + Dx9TextureInfo textureInfo, + Dx9TextureRequirements type, + object oValue) + { + textureInfo.Requirements |= (int)type; + switch (type) + { + case Dx9TextureRequirements.TexelSize: + if (textureInfo.TexelSize != null) + break; + string stName1 = InvariantString.Format("{0}{1}", "TexelSize", textureInfo.ImageIndex); + VariableInfo variableInfo1 = new VariableInfo() + { + IsDynamic = true, + ID = -1, + Type = Dx9VariableType.Vector2 + }; + variableInfo1.Name = this.GenerateGlobalVariable(variableInfo1.Type, stName1); + variableInfo1.DefaultValue = new Vector2(0.0f, 0.0f); + this.AddGlobalVariable(variableInfo1); + textureInfo.TexelSize = variableInfo1.Name; + break; + case Dx9TextureRequirements.SampleBackbuffer: + textureInfo.DownsamplePropertyID = (int)oValue; + break; + case Dx9TextureRequirements.TexUVSize: + if (textureInfo.TexUVSize != null) + break; + string stName2 = InvariantString.Format("{0}{1}", "TexUVSize", textureInfo.ImageIndex); + VariableInfo variableInfo2 = new VariableInfo() + { + IsDynamic = true, + ID = -1, + Type = Dx9VariableType.Vector2 + }; + variableInfo2.Name = this.GenerateGlobalVariable(variableInfo2.Type, stName2); + variableInfo2.DefaultValue = new Vector2(0.0f, 0.0f); + this.AddGlobalVariable(variableInfo2); + textureInfo.TexUVSize = variableInfo2.Name; + break; + case Dx9TextureRequirements.TexUVRefPoint: + if (textureInfo.TexUVRefPoint != null) + break; + string stName3 = InvariantString.Format("{0}{1}", "TexUVRefPoint", textureInfo.ImageIndex); + VariableInfo variableInfo3 = new VariableInfo() + { + IsDynamic = true, + ID = -1, + Type = Dx9VariableType.Vector2 + }; + variableInfo3.Name = this.GenerateGlobalVariable(variableInfo3.Type, stName3); + variableInfo3.DefaultValue = new Vector2(0.0f, 0.0f); + this.AddGlobalVariable(variableInfo3); + textureInfo.TexUVRefPoint = variableInfo3.Name; + break; + } + } + + internal void AddRequirement(EffectRequirements requirement) => Bits.SetFlag(ref this.m_nRequirements, (int)requirement); + + internal Dx9TextureInfo GetTextureInfo(int idxTexture) => this.m_alTextureInfos[idxTexture]; + + internal string PixelShaderOutput + { + get => this.m_stPixelOutput; + set => this.m_stPixelOutput = value; + } + + internal string ShaderDeclarations => this.GenerateDeclarations(); + + internal string IncludesFragment + { + get + { + if (this.m_alIncludes == null) + return ""; + StringBuilder stringBuilder = new StringBuilder(); + for (int index = 0; index < this.m_alIncludes.Count; ++index) + stringBuilder.AppendFormat("#include {0}\r\n", this.m_alIncludes[index]); + return stringBuilder.ToString(); + } + } + + internal string PixelShader => this.GeneratePixelShader(); + + internal string VertexShader => this.GenerateVertexShader(); + + internal Vector PropertyVariables => this.m_alPropertyVariables; + + internal Vector GlobalVariables => this.m_alGlobalVariables; + + internal string EffectDefinition => this.m_sbEffect.ToString(); + + internal int ImageCount => this.m_alTextureInfos == null ? 0 : this.m_alTextureInfos.Count; + + internal Vector TextureInfoList => this.m_alTextureInfos; + + internal void SaveEffect(string stFilename) + { + StreamWriter streamWriter = new StreamWriter(stFilename); + streamWriter.WriteLine(this.m_sbEffect.ToString()); + streamWriter.Close(); + } + + private string GenerateDeclarations() + { + if (this.m_sbDeclarations == null) + this.m_sbDeclarations = new StringBuilder(128); + if (this.m_sbDeclarations.Length == 0) + { + this.m_sbDeclarations.Append("struct PS_OUTPUT\r\n{\r\n float4 Color : COLOR; // Object space position\r\n};\r\n\r\n"); + this.m_sbDeclarations.Append("struct VS_INPUT\r\n{\r\n float4 ObjPos : POSITION; // Object space position\r\n float4 Color : COLOR; // Vertex color\r\n"); + for (int index = 0; index < this.ImageCount; ++index) + this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", index); + this.m_sbDeclarations.Append("};\r\n\r\n"); + this.m_sbDeclarations.Append("struct VS_OUTPUT\r\n{\r\n float4 ProjPos : POSITION; // Projected space position\r\n float4 Color : COLOR; // Vertex color\r\n"); + if (Bits.TestFlag(this.m_nRequirements, 1)) + this.m_sbDeclarations.Append(" float3 ViewPos : TEXCOORD5; // View space position\r\n"); + for (int index = 0; index < this.ImageCount; ++index) + { + if (Bits.TestFlag(this.m_alTextureInfos[index].Requirements, 16)) + this.m_sbDeclarations.AppendFormat(" float3 TexCoord{0} : TEXCOORD{0}; // Texture {0} UVW coordinates\r\n", index); + else + this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", index); + } + this.m_sbDeclarations.Append("};\r\n\r\n"); + } + return this.m_sbDeclarations.ToString(); + } + + private string GenerateVertexShader() + { + if (this.m_sbVertexShader == null) + this.m_sbVertexShader = new StringBuilder(128); + if (this.m_sbVertexShader.Length == 0) + { + this.m_sbVertexShader.Append(" //\r\n // Compute the accumulated WVP matrix. If the separate matrices are not referenced\r\n // by effect elements, the D3DX preshader will combine these on the CPU and set the\r\n // result via VS constants.\r\n //\r\n\r\n float4x4 matAccumulated = mul(g_matWorldView, g_matProjection);\r\n\r\n\r\n //\r\n // Setup the resulting device vertex.\r\n //\r\n\r\n Output.ProjPos = mul(Input.ObjPos, matAccumulated);\r\n Output.Color = Input.Color;\r\n"); + if (Bits.TestFlag(this.m_nRequirements, 1)) + this.m_sbVertexShader.Append(" Output.ViewPos = mul(Input.ObjPos, g_matWorldView);\r\n"); + for (int index = 0; index < this.ImageCount; ++index) + { + if (Bits.TestFlag(this.m_alTextureInfos[index].Requirements, 16)) + this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = float3(Input.TexCoord{0}.x * Output.ProjPos.w, Input.TexCoord{0}.y * Output.ProjPos.w, Output.ProjPos.w);\r\n", index); + else + this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = Input.TexCoord{0};\r\n", index); + } + } + return this.m_sbVertexShader.ToString(); + } + + private string GeneratePixelShader() + { + StringBuilder stringBuilder = new StringBuilder(128); + for (int index = 0; index < this.ImageCount; ++index) + { + Dx9TextureInfo alTextureInfo = this.m_alTextureInfos[index]; + if (Bits.TestFlag(alTextureInfo.Requirements, 16)) + stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1}.xy / Input.TexCoord{1}.z;\r\n", alTextureInfo.TexCoordInput, index); + else + stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1};\r\n", alTextureInfo.TexCoordInput, index); + } + stringBuilder.Append("\r\n"); + stringBuilder.Append(this.m_sbPixelShader.ToString()); + return stringBuilder.ToString(); + } + + private int GetRenderTargetCount() + { + if (this.m_alTextureInfos == null) + return 0; + int num = 0; + foreach (Dx9TextureInfo alTextureInfo in this.m_alTextureInfos) + { + if ((alTextureInfo.Requirements & 2) > 0) + { + ++num; + break; + } + } + return num; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs new file mode 100644 index 0000000..e962ea9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs @@ -0,0 +1,129 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EffectManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EffectManager : RenderObject + { + private const int k_cMaxTargetItems = 50; + private RenderSession m_session; + private Dx9GraphicsDevice m_device; + private Dx9EffectBuilder m_effectBuilder; + private Map m_mapEffectCache; + private bool m_fPendingCacheUpdate; + private readonly DeferredHandler m_cbUpdateCache; + + internal Dx9EffectManager(RenderSession session, Dx9GraphicsDevice dx9Device) + { + this.m_session = session; + this.m_device = dx9Device; + this.m_cbUpdateCache = new DeferredHandler(this.UpdateCache); + this.m_effectBuilder = new Dx9EffectBuilder(this.m_device.GraphicsCaps); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose || this.m_mapEffectCache == null) + return; + Map.ValueCollection.Enumerator enumerator = this.m_mapEffectCache.Values.GetEnumerator(); + while (enumerator.MoveNext()) + enumerator.Current?.UnregisterUsage(this); + this.m_mapEffectCache = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal Dx9EffectBuilder EffectBuilder => this.m_effectBuilder; + + internal Dx9GraphicsDevice Device => this.m_device; + + private bool CacheLookup(ByteBuilder cacheKey, out Dx9EffectResource resource) + { + if (this.m_mapEffectCache == null) + { + resource = null; + return false; + } + bool flag = this.m_mapEffectCache.ContainsKey(cacheKey); + resource = !flag ? null : this.m_mapEffectCache[cacheKey]; + return flag; + } + + private void AddCachedEffect(ByteBuilder cacheWriter, Dx9EffectResource effect) + { + if (this.m_mapEffectCache == null) + this.m_mapEffectCache = new Map(50); + this.m_mapEffectCache.Add(cacheWriter, effect); + if (effect == null) + return; + this.ScheduleCacheUpdate(); + } + + internal bool CreateEffectResource( + string stName, + EffectInput element, + int nPropCacheSize, + out Dx9EffectResource dxEffectResource) + { + Dx9EffectResource resource = null; + ByteBuilder byteBuilder = new ByteBuilder(nPropCacheSize); + element.AddCacheKey(byteBuilder); + if (!this.CacheLookup(byteBuilder, out resource)) + { + resource = new Dx9EffectResource(this.m_session, stName, this); + resource.RegisterUsage(this); + if (!resource.Create(element)) + { + resource.UnregisterUsage(this); + dxEffectResource = null; + this.AddCachedEffect(byteBuilder, null); + return false; + } + this.AddCachedEffect(byteBuilder, resource); + } + dxEffectResource = resource; + return dxEffectResource != null; + } + + private void UpdateCache(object arg) + { + if (this.m_mapEffectCache != null) + { + Map map = new Map(Math.Max(50, this.m_mapEffectCache.Count)); + foreach (KeyValueEntry keyValueEntry in this.m_mapEffectCache) + { + if (keyValueEntry.Value != null) + { + if (keyValueEntry.Value.UsageCount == 1) + keyValueEntry.Value.UnregisterUsage(this); + else + map.Add(keyValueEntry.Key, keyValueEntry.Value); + } + } + if (map.Count != this.m_mapEffectCache.Count) + this.m_mapEffectCache = map; + } + this.m_fPendingCacheUpdate = false; + } + + private void ScheduleCacheUpdate() + { + if (this.m_fPendingCacheUpdate || this.m_mapEffectCache.Count < 50) + return; + this.m_session.DeferredInvoke(m_cbUpdateCache, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); + this.m_fPendingCacheUpdate = true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs new file mode 100644 index 0000000..c5a4c5c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs @@ -0,0 +1,396 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EffectResource +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EffectResource : SharedRenderObject, IRenderHandleOwner + { + private RenderSession m_session; + private RemoteDx9EffectResource m_remoteEffect; + private string m_stName; + private Dx9EffectManager m_effectManager; + private DataBufferTracker m_tracker; + private Size m_sizeGutter; + private static string k_stVertexShaderName = "ExecuteVertexShader"; + private static string k_stPixelShaderName = "ExecutePixelShader"; + + internal Dx9EffectResource( + RenderSession session, + string stName, + Dx9EffectManager effectManager) + { + this.m_session = session; + this.m_stName = stName; + this.m_effectManager = effectManager; + this.m_tracker = MessagingSession.Current.CreateDataBufferTracker(this); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + if (this.m_tracker != null) + MessagingSession.Current.ReturnDataBufferTracker(this.m_tracker); + if (this.m_remoteEffect != null) + this.m_remoteEffect.Dispose(); + } + this.m_tracker = null; + this.m_remoteEffect = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + public RemoteDx9EffectResource RemoteStub => this.m_remoteEffect; + + private string PixelShaderVersion => this.m_effectManager.Device.PixelShaderProfile; + + private string VertexShaderVersion => this.m_effectManager.Device.VertexShaderProfile; + + internal Size GutterSize => this.m_sizeGutter; + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteEffect.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = null; + + internal bool Create(EffectInput element) + { + Dx9EffectBuilder effectBuilder = this.m_effectManager.EffectBuilder; + effectBuilder.Clear(); + if (!this.ProcessEffectInput(element, ref effectBuilder)) + return false; + this.GenerateEffect(effectBuilder); + uint nBlobSize = 0; + IntPtr pEffectBlob = IntPtr.Zero; + IntPtr pBlobBuffer = IntPtr.Zero; + if (!this.CompileEffect(effectBuilder, out pEffectBlob, out pBlobBuffer, out nBlobSize)) + return false; + Vector propertyVariables = effectBuilder.PropertyVariables; + if (propertyVariables != null) + { + int index = 0; + while (index < propertyVariables.Count) + { + if (!propertyVariables[index].IsDynamic) + propertyVariables.RemoveAt(index); + else + ++index; + } + } + this.RemoteEffect(effectBuilder, pEffectBlob, pBlobBuffer, nBlobSize); + return true; + } + + private bool CompileEffect( + Dx9EffectBuilder effectBuilder, + out IntPtr pEffectBlob, + out IntPtr pBlobBuffer, + out uint nBlobSize) + { + bool flag = false; + IntPtr pErrorString = IntPtr.Zero; + IntPtr pErrorBuffer = IntPtr.Zero; + pEffectBlob = IntPtr.Zero; + pBlobBuffer = IntPtr.Zero; + nBlobSize = 0U; + try + { + EngineApi.IFC(EngineApi.SpDx9CompileEffect(effectBuilder.EffectDefinition, null, out pErrorString, out pErrorBuffer, out pEffectBlob, out nBlobSize, out pBlobBuffer)); + flag = true; + } + catch (Exception ex) + { + if (Marshal.PtrToStringAnsi(pErrorString) == null) + throw; + } + finally + { + if (pErrorBuffer != IntPtr.Zero) + Marshal.Release(pErrorBuffer); + } + return flag; + } + + private void RemoteEffect( + Dx9EffectBuilder effectBuilder, + IntPtr pEffectBlob, + IntPtr pBlobBuffer, + uint nBlobSize) + { + DataBuffer dataBuffer = this.m_session.BuildDataBuffer(pEffectBlob, nBlobSize); + this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(OnReleaseLocalData), pBlobBuffer); + dataBuffer.Commit(); + this.m_remoteEffect = this.m_session.BuildRemoteDx9EffectResource(this, this.m_effectManager.Device, dataBuffer); + Vector propertyVariables = effectBuilder.PropertyVariables; + if (propertyVariables != null) + { + foreach (VariableInfo variableInfo in propertyVariables) + { + switch (variableInfo.Type) + { + case Dx9VariableType.Integer: + this.m_remoteEffect.SendAddProperty(variableInfo.Name, (int)variableInfo.DefaultValue); + continue; + case Dx9VariableType.Float: + this.m_remoteEffect.SendAddProperty(variableInfo.Name, (float)variableInfo.DefaultValue); + continue; + case Dx9VariableType.Vector2: + this.m_remoteEffect.SendAddProperty(variableInfo.Name, (Vector2)variableInfo.DefaultValue); + continue; + case Dx9VariableType.Vector3: + this.m_remoteEffect.SendAddProperty(variableInfo.Name, (Vector3)variableInfo.DefaultValue); + continue; + case Dx9VariableType.Vector4: + this.m_remoteEffect.SendAddProperty(variableInfo.Name, (Vector4)variableInfo.DefaultValue); + continue; + case Dx9VariableType.Texture: + TextureVariableInfo textureVariableInfo = (TextureVariableInfo)variableInfo; + this.m_remoteEffect.SendAddProperty(variableInfo.Name, textureVariableInfo.CoordinateMapID, textureVariableInfo.ImageIndexID); + continue; + default: + continue; + } + } + } + this.m_remoteEffect.SendPostPropertiesAdded(); + this.m_remoteEffect.SendSetGutterSize(this.m_sizeGutter); + if (effectBuilder.TextureInfoList == null) + return; + foreach (Dx9TextureInfo textureInfo in effectBuilder.TextureInfoList) + { + if (textureInfo.Requirements != 0) + this.m_remoteEffect.SendAddTextureRequirements(textureInfo.ImageIndex, textureInfo.Requirements, textureInfo.TexelSize, textureInfo.TexUVSize, textureInfo.TexUVRefPoint, textureInfo.DownsamplePropertyID); + } + } + + private static void OnReleaseLocalData(object sender, DataBufferTracker.CleanupEventArgs args) + { + IntPtr contextData = (IntPtr)args.ContextData; + if (!(contextData != IntPtr.Zero)) + return; + Marshal.Release(contextData); + IntPtr zero = IntPtr.Zero; + } + + private string GenerateFileName() => this.m_stName + ".fx"; + + protected void EmitHeader(Dx9EffectBuilder effectBuilder) + { + effectBuilder.EmitEffectFragment("#include \"Common.fx\"\r\n"); + effectBuilder.EmitEffectFragment(effectBuilder.IncludesFragment + "\r\n\r\n"); + Vector[] vectorArray = new Vector[2] + { + effectBuilder.PropertyVariables, + effectBuilder.GlobalVariables + }; + for (int index = 0; index < vectorArray.Length; ++index) + { + if (vectorArray[index] != null) + { + foreach (VariableInfo variableInfo in vectorArray[index]) + { + if (variableInfo.Name != null) + { + switch (variableInfo.Type) + { + case Dx9VariableType.Integer: + if (variableInfo.IsDynamic) + { + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); + continue; + } + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, (int)variableInfo.DefaultValue)); + continue; + case Dx9VariableType.Float: + if (variableInfo.IsDynamic) + { + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); + continue; + } + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, (float)variableInfo.DefaultValue)); + continue; + case Dx9VariableType.Vector2: + if (variableInfo.IsDynamic) + { + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); + continue; + } + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector2)variableInfo.DefaultValue).ToDxShaderString())); + continue; + case Dx9VariableType.Vector3: + if (variableInfo.IsDynamic) + { + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); + continue; + } + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector3)variableInfo.DefaultValue).ToDxShaderString())); + continue; + case Dx9VariableType.Vector4: + if (variableInfo.IsDynamic) + { + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); + continue; + } + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector4)variableInfo.DefaultValue).ToDxShaderString())); + continue; + case Dx9VariableType.Texture: + TextureVariableInfo textureVariableInfo = (TextureVariableInfo)variableInfo; + effectBuilder.EmitEffectFragment(InvariantString.Format("\r\n{0} {1};\r\n", effectBuilder.ConvertToString(textureVariableInfo.Type), textureVariableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("sampler {0} = \r\n sampler_state\r\n {{\r\n Texture = <{1}>;\r\n MinFilter = {2};\r\n MagFilter = {3};\r\n AddressU = Clamp;\r\n AddressV = Clamp;\r\n }};\r\n\r\n", textureVariableInfo.SamplerName, textureVariableInfo.Name, textureVariableInfo.MinFilter, textureVariableInfo.MagFilter)); + continue; + default: + continue; + } + } + } + } + } + effectBuilder.EmitEffectFragment("\r\n"); + } + + protected void EmitShaders(Dx9EffectBuilder effectBuilder) + { + effectBuilder.EmitEffectFragment(effectBuilder.ShaderDeclarations); + effectBuilder.EmitEffectFragment(InvariantString.Format("VS_OUTPUT {0}(VS_INPUT Input)\r\n{{\r\n VS_OUTPUT Output;\r\n\r\n{1}\r\n return Output;\r\n}}\r\n\r\n", k_stVertexShaderName, effectBuilder.VertexShader)); + effectBuilder.EmitEffectFragment(InvariantString.Format("PS_OUTPUT {0}(VS_OUTPUT Input)\r\n{{\r\n PS_OUTPUT Output;\r\n\r\n{1} // Include Vertex color contribution\r\n Output.Color = {2} * Input.Color;\r\n\r\n // Return the final result\r\n return Output;\r\n}}\r\n\r\n", k_stPixelShaderName, effectBuilder.PixelShader, effectBuilder.PixelShaderOutput)); + } + + protected void EmitTechnique(Dx9EffectBuilder effectBuilder) => effectBuilder.EmitEffectFragment(InvariantString.Format("technique GeneratedTechnique\r\n{{\r\n pass P0\r\n {{\r\n // Shaders\r\n PixelShader = compile {0} {1}();\r\n VertexShader = compile {2} {3}();\r\n }}\r\n}}\r\n", PixelShaderVersion, k_stPixelShaderName, VertexShaderVersion, k_stVertexShaderName)); + + private void GenerateEffect(Dx9EffectBuilder effectBuilder) + { + this.EmitHeader(effectBuilder); + this.EmitShaders(effectBuilder); + this.EmitTechnique(effectBuilder); + } + + private bool ProcessEffectInput(EffectInput efiCurrent, ref Dx9EffectBuilder effectBuilder) + { + bool flag = true; + switch (efiCurrent.Type) + { + case EffectInputType.Color: + Dx9ColorElement.Generate((ColorElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.Image: + Dx9ImageElement.Generate((ImageElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.Blend: + BlendElement efiBlend = (BlendElement)efiCurrent; + this.ProcessEffectInput(efiBlend.Input1, ref effectBuilder); + string pixelShaderOutput1 = effectBuilder.PixelShaderOutput; + this.ProcessEffectInput(efiBlend.Input2, ref effectBuilder); + string pixelShaderOutput2 = effectBuilder.PixelShaderOutput; + Dx9BlendElement.Generate(efiBlend, pixelShaderOutput1, pixelShaderOutput2, ref effectBuilder); + break; + case EffectInputType.Interpolate: + InterpolateElement efiInterpolate = (InterpolateElement)efiCurrent; + this.ProcessEffectInput(efiInterpolate.Input1, ref effectBuilder); + string pixelShaderOutput3 = effectBuilder.PixelShaderOutput; + this.ProcessEffectInput(efiInterpolate.Input2, ref effectBuilder); + string pixelShaderOutput4 = effectBuilder.PixelShaderOutput; + Dx9InterpolateElement.Generate(efiInterpolate, pixelShaderOutput3, pixelShaderOutput4, ref effectBuilder); + break; + case EffectInputType.Layer: + flag = this.ProcessEffectLayer((EffectLayer)efiCurrent, ref effectBuilder); + break; + case EffectInputType.ComplexImage: + Dx9ComplexImageElement.Generate((ComplexImageElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.Video: + Dx9VideoElement.Generate((VideoElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.Spotlight2D: + Dx9SpotLight2DElement.Generate((SpotLight2DElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.PointLight2D: + Dx9PointLight2DElement.Generate((PointLight2DElement)efiCurrent, ref effectBuilder); + break; + case EffectInputType.Destination: + Dx9DestinationElement.Generate((DestinationElement)efiCurrent, ref effectBuilder); + this.m_sizeGutter.Width = Math.Max(this.m_sizeGutter.Width, 1); + this.m_sizeGutter.Height = Math.Max(this.m_sizeGutter.Height, 1); + break; + } + return flag && effectBuilder.Validate(); + } + + private bool ProcessEffectLayer(EffectLayer eflCurrent, ref Dx9EffectBuilder effectBuilder) + { + if (!this.ProcessEffectInput(eflCurrent.Input, ref effectBuilder)) + return false; + if (eflCurrent.Operations != null) + { + foreach (EffectOperation operation in eflCurrent.Operations) + { + switch (operation.Type) + { + case EffectOperationType.Brightness: + Dx9BrightnessElement.Generate((BrightnessElement)operation, ref effectBuilder); + continue; + case EffectOperationType.Contrast: + Dx9ContrastElement.Generate((ContrastElement)operation, ref effectBuilder); + continue; + case EffectOperationType.Desaturate: + Dx9DesaturateElement.Generate((DesaturateElement)operation, ref effectBuilder); + continue; + case EffectOperationType.EdgeDetection: + Dx9EdgeDetectionElement.Generate((EdgeDetectionElement)operation, ref effectBuilder); + continue; + case EffectOperationType.Emboss: + Dx9EmbossElement.Generate((EmbossElement)operation, ref effectBuilder); + continue; + case EffectOperationType.GaussianBlur: + Debug2.Validate(eflCurrent.Input.Type == EffectInputType.Image || eflCurrent.Input.Type == EffectInputType.Video || eflCurrent.Input.Type == EffectInputType.Destination, typeof(InvalidOperationException), "GaussianBlurElement only valid for inputs with ImageElement inputs"); + GaussianBlurElement efoBlur = (GaussianBlurElement)operation; + Dx9GaussianBlurElement.Generate(efoBlur, ref effectBuilder); + this.m_sizeGutter.Width = Math.Max(this.m_sizeGutter.Width, efoBlur.KernelRadius + 1); + this.m_sizeGutter.Height = Math.Max(this.m_sizeGutter.Height, efoBlur.KernelRadius + 1); + continue; + case EffectOperationType.HSL: + Dx9HSLElement.Generate((HSLElement)operation, ref effectBuilder); + continue; + case EffectOperationType.HSV: + Dx9HSVElement.Generate((HSVElement)operation, ref effectBuilder); + continue; + case EffectOperationType.InvAlpha: + Dx9InvAlphaElement.Generate(operation, ref effectBuilder); + continue; + case EffectOperationType.InvColor: + Dx9InvColorElement.Generate(operation, ref effectBuilder); + continue; + case EffectOperationType.Invert: + Dx9InvertElement.Generate((InvertElement)operation, ref effectBuilder); + continue; + case EffectOperationType.LightShaft: + Debug2.Validate(eflCurrent.Input.Type == EffectInputType.Image || eflCurrent.Input.Type == EffectInputType.Video || eflCurrent.Input.Type == EffectInputType.Destination, typeof(InvalidOperationException), "LightShaftElement only valid for inputs with ImageElement inputs"); + Dx9LightShaftElement.Generate((LightShaftElement)operation, ref effectBuilder); + continue; + case EffectOperationType.Sepia: + Dx9SepiaElement.Generate((SepiaElement)operation, ref effectBuilder); + continue; + default: + continue; + } + } + } + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs new file mode 100644 index 0000000..763d83b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs @@ -0,0 +1,92 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EffectTemplate +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EffectTemplate : EffectTemplate + { + private Dx9EffectResource m_effectResource; + + internal Dx9EffectTemplate(RenderSession session, GraphicsDevice device, string stName) + : base(session, device, stName) + { + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose || this.m_effectResource == null) + return; + this.m_effectResource.UnregisterUsage(this); + this.m_effectResource = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal Dx9EffectManager EffectManager => ((Dx9GraphicsDevice)this.m_graphicsDevice).EffectManager; + + internal Dx9EffectResource EffectResource => this.m_effectResource; + + protected override bool Build(EffectInput input) + { + int nPropCacheSize = 0; + if (!this.GenerateProperties(input, this.m_dynamicProperties, out nPropCacheSize) || !this.ProcessEffectElement(input, this.m_dynamicProperties, nPropCacheSize)) + return false; + Map.Enumerator enumerator = this.m_dynamicProperties.GetEnumerator(); + while (enumerator.MoveNext()) + { + EffectProperty effectProperty = enumerator.Current.Value; + if (effectProperty == null || !effectProperty.IsDynamic) + { + this.m_dynamicProperties.Remove(enumerator.Current.Key); + enumerator = this.m_dynamicProperties.GetEnumerator(); + } + } + return true; + } + + public override IEffect CreateInstance(object objUser) + { + Debug2.Validate(this.m_fBuilt, typeof(InvalidOperationException), "Cannot create instance if the template is not built"); + Dx9Effect dx9Effect = null; + if (this.m_cache != null) + dx9Effect = (Dx9Effect)this.m_cache.Remove(objUser); + if (dx9Effect == null) + { + dx9Effect = new Dx9Effect(this); + dx9Effect.Cache = this.m_cache; + dx9Effect.RegisterUsage(objUser); + dx9Effect.RemoteEffect(); + } + return dx9Effect; + } + + private bool ProcessEffectElement( + EffectInput element, + Map allProps, + int nPropCacheSize) + { + if (!(this.m_graphicsDevice as Dx9GraphicsDevice).EffectManager.CreateEffectResource(this.m_stName, element, nPropCacheSize, out this.m_effectResource)) + return false; + this.m_effectResource.RegisterUsage(this); + foreach (KeyValueEntry allProp in allProps) + { + EffectProperty effectProperty = allProp.Value; + if (effectProperty.Type == EffectPropertyType.Image && effectProperty.Value != null) + ((Image)effectProperty.Value).GutterSize = this.m_effectResource.GutterSize; + } + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs new file mode 100644 index 0000000..9f2e939 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9EmbossElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9EmbossElement + { + internal static void Generate(EmbossElement efoEmboss, ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efoEmboss.DirectionID, + Type = Dx9VariableType.Integer, + IsDynamic = efoEmboss.IsDynamicProperty("Direction") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoEmboss.Name + "Direction") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoEmboss.Name + "Direction"); + variableInfo1.DefaultValue = efoEmboss.Direction; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efoEmboss.GrayLevelID, + Type = Dx9VariableType.Float, + IsDynamic = efoEmboss.IsDynamicProperty("GrayLevel") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoEmboss.Name + "GrayLevel") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoEmboss.Name + "GrayLevel"); + variableInfo2.DefaultValue = efoEmboss.GrayLevel; + effectBuilder.AddPropertyVariable(variableInfo2); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vNeightbourPixel;\r\n if ({5} == 0)\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(-{3}.x, -{3}.y));\r\n }}\r\n else\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(+{3}.x, +{3}.y));\r\n }}\r\n float4 vDiff = {0} - vNeightbourPixel;\r\n float maxDiffColor = vDiff.r;\r\n if (abs(vDiff.g) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.g;\r\n }}\r\n if (abs(vDiff.b) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.b;\r\n }}\r\n maxDiffColor += {4};\r\n float minGray = min(maxDiffColor, 1.0f);\r\n float grayLevel = max(minGray, 0.0f);\r\n {0}.rgb = grayLevel;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo2.Name, variableInfo1.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs new file mode 100644 index 0000000..385b647 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9GaussianBlurElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9GaussianBlurElement + { + private static void GenerateWeights1D(int nKernelRadius, double flDeviation, double[] arKernel) + { + Debug2.Validate(flDeviation > 0.0, typeof(ArgumentOutOfRangeException), "Standard deviation must be > 0.0"); + Debug2.Validate(nKernelRadius >= 1, typeof(ArgumentOutOfRangeException), "Kernel radius must be >= 1"); + int num1 = 1 + 2 * nKernelRadius; + double num2 = 0.0; + Debug2.Validate(arKernel != null && num1 == arKernel.GetLength(0), typeof(ArgumentException), nameof(arKernel)); + double num3 = 2.0 * (flDeviation * flDeviation); + double num4 = Math.Sqrt(2.0 * Math.PI) * flDeviation; + for (int index = 0; index < num1; ++index) + { + double num5 = index - nKernelRadius; + double num6 = Math.Exp(-(num5 * num5) / num3); + arKernel[index] = num6 / num4; + num2 += arKernel[index]; + } + for (int index = 0; index < num1; ++index) + arKernel[index] /= num2; + } + + private static void GenerateWeights2D( + int nKernelRadius, + double flDeviation, + double[,] arKernel) + { + Debug2.Validate(flDeviation > 0.0, typeof(ArgumentOutOfRangeException), "Standard deviation must be > 0.0"); + Debug2.Validate(nKernelRadius >= 1, typeof(ArgumentOutOfRangeException), "Kernel radius must be >= 1"); + double num1 = 0.0; + int num2 = 1 + 2 * nKernelRadius; + Debug2.Validate(arKernel != null && num2 == arKernel.GetLength(0) && num2 == arKernel.GetLength(1), typeof(ArgumentException), nameof(arKernel)); + double num3 = flDeviation * flDeviation; + double num4 = 2.0 * num3; + double num5 = 2.0 * Math.PI * num3; + for (int index1 = 0; index1 < num2; ++index1) + { + for (int index2 = 0; index2 < num2; ++index2) + { + double num6 = index2 - nKernelRadius; + double num7 = index1 - nKernelRadius; + double num8 = Math.Exp(-(num6 * num6 + num7 * num7) / num4); + arKernel[index2, index1] = num8 / num5; + num1 += arKernel[index2, index1]; + } + } + for (int index1 = 0; index1 < num2; ++index1) + { + for (int index2 = 0; index2 < num2; ++index2) + arKernel[index2, index1] /= num1; + } + } + + internal static void Generate(GaussianBlurElement efoBlur, ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); + switch (efoBlur.Mode) + { + case GaussianBlurMode.Normal: + int length1 = 1 + efoBlur.KernelRadius * 2; + double[,] arKernel1 = new double[length1, length1]; + GenerateWeights2D(efoBlur.KernelRadius, efoBlur.Bluriness, arKernel1); + effectBuilder.EmitPixelFragment(" {\r\n // Gaussian filter\r\n float4 vBlur = 0;\r\n"); + for (int index1 = 0; index1 < length1; ++index1) + { + for (int index2 = 0; index2 < length1; ++index2) + { + int num1 = index2 - efoBlur.KernelRadius; + int num2 = index1 - efoBlur.KernelRadius; + if (num1 == 0 && num2 == 0) + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", effectBuilder.PixelShaderOutput, arKernel1[index2, index1])); + else + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, {2}.y * {4})) * {5};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num1, num2, arKernel1[index2, index1])); + } + } + effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput)); + break; + case GaussianBlurMode.Horizontal: + case GaussianBlurMode.Vertical: + bool flag = efoBlur.Mode == GaussianBlurMode.Horizontal; + int length2 = 1 + efoBlur.KernelRadius * 2; + double[] arKernel2 = new double[length2]; + GenerateWeights1D(efoBlur.KernelRadius, efoBlur.Bluriness, arKernel2); + effectBuilder.EmitPixelFragment(" {\r\n // Gaussian filter\r\n float4 vBlur = 0;\r\n"); + for (int index = 0; index < length2; ++index) + { + int num = index - efoBlur.KernelRadius; + if (num == 0) + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", effectBuilder.PixelShaderOutput, arKernel2[index])); + else if (flag) + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, 0)) * {4};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num, arKernel2[index])); + else + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2(0, {2}.y * {3})) * {4};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num, arKernel2[index])); + } + effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput)); + break; + default: + Debug2.Validate(false, typeof(InvalidOperationException), "Unknown blur mode"); + break; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs new file mode 100644 index 0000000..edc3f10 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs @@ -0,0 +1,128 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9GraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class Dx9GraphicsDevice : GraphicsDevice + { + private Dx9EffectManager m_effectManager; + + protected Dx9GraphicsDevice( + RenderSession session, + string stDisplayName, + GraphicsDeviceType type, + GraphicsRenderingQuality renderingQuality) + : base(session, stDisplayName) + { + this.m_deviceType = type; + this.m_graphicsCaps = session.GetGraphicsCaps(type); + this.m_renderingQuality = renderingQuality; + if (this.m_renderingQuality != GraphicsRenderingQuality.MinQuality) + { + Dx9GraphicsDevice.PixelShaderProfileType pixelShaderProfile = (Dx9GraphicsDevice.PixelShaderProfileType)this.m_graphicsCaps.PixelShaderProfile; + if ((byte)this.m_graphicsCaps.VertexShaderProfile < 1 || pixelShaderProfile < PixelShaderProfileType.PS_2_0) + this.m_renderingQuality = GraphicsRenderingQuality.MinQuality; + } + this.m_sizeGutterPxl = new Size(1, 1); + this.m_effectManager = new Dx9EffectManager(session, this); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose || this.m_effectManager == null) + return; + this.m_effectManager.Dispose(); + this.m_effectManager = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + public override bool IsVideoComposited => true; + + public override bool CanPlayAnimations => true; + + internal Dx9EffectManager EffectManager => this.m_effectManager; + + internal string PixelShaderProfile + { + get + { + switch ((byte)this.m_graphicsCaps.PixelShaderProfile) + { + case 0: + return "ps_1_1"; + case 1: + return "ps_1_2"; + case 2: + return "ps_1_3"; + case 3: + return "ps_1_4"; + case 4: + return "ps_2_0"; + case 5: + return "ps_2_a"; + case 6: + return "ps_2_b"; + case 7: + return "ps_3_0"; + default: + return "ps_1_1"; + } + } + } + + internal string VertexShaderProfile + { + get + { + switch ((byte)this.m_graphicsCaps.VertexShaderProfile) + { + case 0: + return "vs_1_1"; + case 1: + return "vs_2_0"; + case 2: + return "vs_2_a"; + case 3: + return "vs_3_0"; + default: + return "vs_1_1"; + } + } + } + + public override bool CanPlayAnimationType(AnimationInputType type) => true; + + internal override EffectTemplate CreateEffectTemplate(string stName) => new Dx9EffectTemplate(this.m_session, this, stName); + + private enum PixelShaderProfileType : byte + { + PS_1_1, + PS_1_2, + PS_1_3, + PS_1_4, + PS_2_0, + PS_2_A, + PS_2_B, + PS_3_0, + } + + private enum VertexShaderProfileType : byte + { + VS_1_1, + VS_2_0, + VS_2_A, + VS_3_0, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs new file mode 100644 index 0000000..e3953ee --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9HSLElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9HSLElement + { + internal static void Generate(HSLElement efoHSL, ref Dx9EffectBuilder effectBuilder) + { + effectBuilder.EmitIncludesFragment("\"HSL.fx\""); + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efoHSL.HueID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSL.IsDynamicProperty("Hue") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoHSL.Name + "Hue") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoHSL.Name + "Hue"); + variableInfo1.DefaultValue = efoHSL.Hue; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efoHSL.SaturationID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSL.IsDynamicProperty("Saturation") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoHSL.Name + "Saturation") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoHSL.Name + "Saturation"); + variableInfo2.DefaultValue = efoHSL.Saturation; + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efoHSL.LightnessID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSL.IsDynamicProperty("Lightness") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoHSL.Name + "Lightness") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoHSL.Name + "Lightness"); + variableInfo3.DefaultValue = efoHSL.Lightness; + effectBuilder.AddPropertyVariable(variableInfo3); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSL color space\r\n float3 fHSL = RGBToHSL({0});\r\n\r\n // adjust Hue, Sat and Luma\r\n fHSL *= float3({1}, {2}, {3});\r\n fHSL = saturate(fHSL);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSLToRGB(fHSL);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs new file mode 100644 index 0000000..c916143 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9HSVElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9HSVElement + { + internal static void Generate(HSVElement efoHSV, ref Dx9EffectBuilder effectBuilder) + { + effectBuilder.EmitIncludesFragment("\"HSV.fx\""); + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efoHSV.HueID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSV.IsDynamicProperty("Hue") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoHSV.Name + "Hue") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoHSV.Name + "Hue"); + variableInfo1.DefaultValue = efoHSV.Hue; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efoHSV.SaturationID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSV.IsDynamicProperty("Saturation") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoHSV.Name + "Saturation") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoHSV.Name + "Saturation"); + variableInfo2.DefaultValue = efoHSV.Saturation; + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efoHSV.ValueID, + Type = Dx9VariableType.Float, + IsDynamic = efoHSV.IsDynamicProperty("Value") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoHSV.Name + "Value") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoHSV.Name + "Value"); + variableInfo3.DefaultValue = efoHSV.Value; + effectBuilder.AddPropertyVariable(variableInfo3); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSV color space\r\n float3 fHSV = RGBToHSV({0});\r\n\r\n // adjust Hue, Sat and Value\r\n fHSV *= float3(1.0f, {2}, {3});\r\n fHSV[0] += {0};\r\n fHSV = saturate(fHSV);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSVToRGB(fHSV);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs new file mode 100644 index 0000000..6d9c65f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9ImageElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9ImageElement + { + internal static void Generate(ImageElement efiImage, ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.AllocateTexture(); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); + TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); + textureVariableInfo.ID = efiImage.ImageID; + textureVariableInfo.Type = Dx9VariableType.Texture; + textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiImage.Name); + textureVariableInfo.DefaultValue = efiImage.Image; + textureVariableInfo.SamplerName = textureInfo.Sampler; + textureVariableInfo.MinFilter = "Linear"; + textureVariableInfo.MagFilter = "Linear"; + textureVariableInfo.CoordinateMapID = -1; + textureVariableInfo.ImageIndexID = -1; + effectBuilder.AddPropertyVariable(textureVariableInfo); + VariableInfo variableInfo = new VariableInfo() + { + ID = efiImage.UVOffsetID, + Type = Dx9VariableType.Vector2, + IsDynamic = efiImage.IsDynamicProperty("UVOffset") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, "UVOffset") : effectBuilder.GenerateGlobalConstant(variableInfo.Type, "UVOffset"); + variableInfo.DefaultValue = efiImage.UVOffset; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiImage.Name); + if (variableInfo.IsDynamic || !efiImage.UVOffset.IsApproximate(Vector2.Zero)) + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); + else + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs new file mode 100644 index 0000000..f7415c7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9InterpolateElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9InterpolateElement + { + internal static void Generate( + InterpolateElement efiInterpolate, + string stSource1, + string stSource2, + ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo = new VariableInfo() + { + ID = efiInterpolate.ValueID, + Type = Dx9VariableType.Float, + IsDynamic = efiInterpolate.IsDynamicProperty("Value") + }; + variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efiInterpolate.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efiInterpolate.Name); + variableInfo.DefaultValue = efiInterpolate.Value; + effectBuilder.AddPropertyVariable(variableInfo); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiInterpolate.Name); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Interpolate the result\r\n float4 {0} = lerp({1}, {2}, {3});\r\n\r\n", effectBuilder.PixelShaderOutput, stSource1, stSource2, variableInfo.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs new file mode 100644 index 0000000..f2d78ea --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9InvAlphaElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9InvAlphaElement + { + internal static void Generate(EffectOperation efo, ref Dx9EffectBuilder effectBuilder) + { + string localVariable = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "InvAlpha"); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the alpha value\r\n float {1} = 1.0 - {0}.a;\r\n {0}.a = {1};\r\n\r\n", effectBuilder.PixelShaderOutput, localVariable)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs new file mode 100644 index 0000000..69dad67 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9InvColorElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9InvColorElement + { + internal static void Generate(EffectOperation efo, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the color value\r\n {0}.rgb = float3(1.0-{0}.r, 1.0-{0}.g, 1.0-{0}.b);\r\n\r\n", effectBuilder.PixelShaderOutput)); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs new file mode 100644 index 0000000..7a7c242 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9InvertElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9InvertElement + { + internal static void Generate(InvertElement efoInvert, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb = 1.0f - {0}.rgb;\r\n }}\r\n", effectBuilder.PixelShaderOutput)); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs new file mode 100644 index 0000000..8356676 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9LightShaftElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9LightShaftElement + { + internal static void Generate( + LightShaftElement efoLightShaft, + ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVSize, null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVRefPoint, null); + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efoLightShaft.PositionID, + Type = Dx9VariableType.Vector3, + IsDynamic = efoLightShaft.IsDynamicProperty("Position") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoLightShaft.Name + "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoLightShaft.Name + "Position"); + variableInfo1.DefaultValue = efoLightShaft.Position; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efoLightShaft.DecayID, + Type = Dx9VariableType.Float, + IsDynamic = efoLightShaft.IsDynamicProperty("Decay") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoLightShaft.Name + "Decay") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoLightShaft.Name + "Decay"); + variableInfo2.DefaultValue = efoLightShaft.Decay; + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efoLightShaft.DensityID, + Type = Dx9VariableType.Float, + IsDynamic = efoLightShaft.IsDynamicProperty("Density") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoLightShaft.Name + "Density") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoLightShaft.Name + "Density"); + variableInfo3.DefaultValue = efoLightShaft.Density; + effectBuilder.AddPropertyVariable(variableInfo3); + VariableInfo variableInfo4 = new VariableInfo() + { + ID = efoLightShaft.FallOffID, + Type = Dx9VariableType.Float, + IsDynamic = efoLightShaft.IsDynamicProperty("FallOff") + }; + variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, efoLightShaft.Name + "FallOff") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, efoLightShaft.Name + "FallOff"); + variableInfo4.DefaultValue = efoLightShaft.FallOff; + effectBuilder.AddPropertyVariable(variableInfo4); + VariableInfo variableInfo5 = new VariableInfo() + { + ID = efoLightShaft.IntensityID, + Type = Dx9VariableType.Float, + IsDynamic = efoLightShaft.IsDynamicProperty("Intensity") + }; + variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, efoLightShaft.Name + "Intensity") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, efoLightShaft.Name + "Intensity"); + variableInfo5.DefaultValue = efoLightShaft.Intensity; + effectBuilder.AddPropertyVariable(variableInfo5); + VariableInfo variableInfo6 = new VariableInfo() + { + ID = efoLightShaft.WeightID, + Type = Dx9VariableType.Float, + IsDynamic = efoLightShaft.IsDynamicProperty("Weight") + }; + variableInfo6.Name = variableInfo6.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo6.Type, efoLightShaft.Name + "Weight") : effectBuilder.GenerateGlobalConstant(variableInfo6.Type, efoLightShaft.Name + "Weight"); + variableInfo6.DefaultValue = efoLightShaft.Weight; + effectBuilder.AddPropertyVariable(variableInfo6); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n float2 diff = {2} - ({4} + {3}.xy * {5});\r\n float2 rayStep = diff / 15 * {6};\r\n float4 color = tex2D({1}, {2});\r\n float fadeFactor = 1.0f;\r\n for (int i=0; i<15; i++)\r\n {{\r\n {2} -= rayStep;\r\n float4 sample = tex2D({1}, {2});\r\n sample *= fadeFactor * {7};\r\n color += sample;\r\n fadeFactor *= {8};\r\n }}\r\n color.rgb *= {9};\r\n {0} = color * ({10} - length(diff));\r\n }}\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, variableInfo1.Name, textureInfo.TexUVRefPoint, textureInfo.TexUVSize, variableInfo3.Name, variableInfo6.Name, variableInfo2.Name, variableInfo5.Name, variableInfo4.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs new file mode 100644 index 0000000..62ce49a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs @@ -0,0 +1,71 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9PointLight2DElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9PointLight2DElement + { + internal static void Generate( + PointLight2DElement efiPointLight2D, + ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efiPointLight2D.PositionID, + Type = Dx9VariableType.Vector3, + IsDynamic = efiPointLight2D.IsDynamicProperty("Position") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, "Position"); + variableInfo1.DefaultValue = efiPointLight2D.Position; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efiPointLight2D.RadiusID, + Type = Dx9VariableType.Float, + IsDynamic = efiPointLight2D.IsDynamicProperty("Radius") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, "Radius") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, "Radius"); + variableInfo2.DefaultValue = efiPointLight2D.Radius; + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efiPointLight2D.LightColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efiPointLight2D.IsDynamicProperty("LightColor") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, "LightColor"); + variableInfo3.DefaultValue = efiPointLight2D.LightColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo3); + VariableInfo variableInfo4 = new VariableInfo() + { + ID = efiPointLight2D.AmbientColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efiPointLight2D.IsDynamicProperty("AmbientColor") + }; + variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, "AmbientColor") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, "AmbientColor"); + variableInfo4.DefaultValue = efiPointLight2D.AmbientColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo4); + VariableInfo variableInfo5 = new VariableInfo() + { + ID = efiPointLight2D.AttenuationID, + Type = Dx9VariableType.Vector3, + IsDynamic = efiPointLight2D.IsDynamicProperty("Attenuation") + }; + variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, "Attenuation") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, "Attenuation"); + variableInfo5.DefaultValue = efiPointLight2D.Attenuation; + effectBuilder.AddPropertyVariable(variableInfo5); + effectBuilder.AddRequirement(EffectRequirements.ViewPosition); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiPointLight2D.Name); + string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n float2 vPositionDelta = {1}.xy - Input.ViewPos.xy;\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = saturate({2} / ({4}.x + flDist*{4}.y + flDist*flDist*{4}.z));\r\n {0} *= flFalloff;\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo5.Name); + if (variableInfo4.IsDynamic || !efiPointLight2D.AmbientColor.ToVector4().IsApproximate(Vector4.Zero)) + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", str, effectBuilder.PixelShaderOutput, variableInfo4.Name)); + else + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", str)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs new file mode 100644 index 0000000..445ab5d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs @@ -0,0 +1,54 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9SepiaElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9SepiaElement + { + internal static void Generate(SepiaElement efoSepia, ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efoSepia.LightColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efoSepia.IsDynamicProperty("LightColor") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoSepia.Name + "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoSepia.Name + "LightColor"); + variableInfo1.DefaultValue = efoSepia.LightColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efoSepia.DarkColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efoSepia.IsDynamicProperty("DarkColor") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoSepia.Name + "DarkColor") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoSepia.Name + "DarkColor"); + variableInfo2.DefaultValue = efoSepia.DarkColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efoSepia.DesaturateID, + Type = Dx9VariableType.Float, + IsDynamic = efoSepia.IsDynamicProperty("Desaturate") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoSepia.Name + "Desaturate") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoSepia.Name + "Desaturate"); + variableInfo3.DefaultValue = efoSepia.Desaturate; + effectBuilder.AddPropertyVariable(variableInfo3); + VariableInfo variableInfo4 = new VariableInfo() + { + ID = efoSepia.ToneID, + Type = Dx9VariableType.Float, + IsDynamic = efoSepia.IsDynamicProperty("Tone") + }; + variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, efoSepia.Name + "Tone") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, efoSepia.Name + "Tone"); + variableInfo4.DefaultValue = efoSepia.Tone; + effectBuilder.AddPropertyVariable(variableInfo4); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb *= {1}.rgb;\r\n float3 grayer = float3(0.3f, 0.59f, 0.11f);\r\n float gray = dot({0}.rgb, grayer);\r\n float3 muted = lerp({0}.rgb, gray.xxx, {3});\r\n float3 sepia = lerp({2}.rgb, {1}.rgb, gray);\r\n {0}.rgb = lerp(muted, sepia, {4});\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo4.Name)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs new file mode 100644 index 0000000..1825406 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs @@ -0,0 +1,98 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9SpotLight2DElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9SpotLight2DElement + { + internal static void Generate( + SpotLight2DElement efiSpotlight2D, + ref Dx9EffectBuilder effectBuilder) + { + VariableInfo variableInfo1 = new VariableInfo() + { + ID = efiSpotlight2D.PositionID, + Type = Dx9VariableType.Vector3, + IsDynamic = efiSpotlight2D.IsDynamicProperty("Position") + }; + variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, "Position"); + variableInfo1.DefaultValue = efiSpotlight2D.Position; + effectBuilder.AddPropertyVariable(variableInfo1); + VariableInfo variableInfo2 = new VariableInfo() + { + ID = efiSpotlight2D.DirectionAngleID, + Type = Dx9VariableType.Float, + IsDynamic = efiSpotlight2D.IsDynamicProperty("DirectionAngle") + }; + variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, "DirectionAngle") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, "DirectionAngle"); + variableInfo2.DefaultValue = efiSpotlight2D.DirectionAngle; + effectBuilder.AddPropertyVariable(variableInfo2); + VariableInfo variableInfo3 = new VariableInfo() + { + ID = efiSpotlight2D.LightColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efiSpotlight2D.IsDynamicProperty("LightColor") + }; + variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, "LightColor"); + variableInfo3.DefaultValue = efiSpotlight2D.LightColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo3); + VariableInfo variableInfo4 = new VariableInfo() + { + ID = efiSpotlight2D.AmbientColorID, + Type = Dx9VariableType.Vector4, + IsDynamic = efiSpotlight2D.IsDynamicProperty("AmbientColor") + }; + variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, "AmbientColor") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, "AmbientColor"); + variableInfo4.DefaultValue = efiSpotlight2D.AmbientColor.ToVector4(); + effectBuilder.AddPropertyVariable(variableInfo4); + VariableInfo variableInfo5 = new VariableInfo() + { + ID = efiSpotlight2D.InnerConeAngleID, + Type = Dx9VariableType.Float, + IsDynamic = efiSpotlight2D.IsDynamicProperty("InnerConeAngle") + }; + variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, "InnerConeAngle") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, "InnerConeAngle"); + variableInfo5.DefaultValue = efiSpotlight2D.InnerConeAngle; + effectBuilder.AddPropertyVariable(variableInfo5); + VariableInfo variableInfo6 = new VariableInfo() + { + ID = efiSpotlight2D.OuterConeAngleID, + Type = Dx9VariableType.Float, + IsDynamic = efiSpotlight2D.IsDynamicProperty("OuterConeAngle") + }; + variableInfo6.Name = variableInfo6.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo6.Type, "OuterConeAngle") : effectBuilder.GenerateGlobalConstant(variableInfo6.Type, "OuterConeAngle"); + variableInfo6.DefaultValue = efiSpotlight2D.OuterConeAngle; + effectBuilder.AddPropertyVariable(variableInfo6); + VariableInfo variableInfo7 = new VariableInfo() + { + ID = efiSpotlight2D.IntensityID, + Type = Dx9VariableType.Float, + IsDynamic = efiSpotlight2D.IsDynamicProperty("Intensity") + }; + variableInfo7.Name = variableInfo7.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo7.Type, "Intensity") : effectBuilder.GenerateGlobalConstant(variableInfo7.Type, "Intensity"); + variableInfo7.DefaultValue = efiSpotlight2D.Intensity; + effectBuilder.AddPropertyVariable(variableInfo7); + VariableInfo variableInfo8 = new VariableInfo() + { + ID = efiSpotlight2D.AttenuationID, + Type = Dx9VariableType.Vector3, + IsDynamic = efiSpotlight2D.IsDynamicProperty("Attenuation") + }; + variableInfo8.Name = variableInfo8.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo8.Type, "Attenuation") : effectBuilder.GenerateGlobalConstant(variableInfo8.Type, "Attenuation"); + variableInfo8.DefaultValue = efiSpotlight2D.Attenuation; + effectBuilder.AddPropertyVariable(variableInfo8); + effectBuilder.AddRequirement(EffectRequirements.ViewPosition); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiSpotlight2D.Name); + string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n // Compute the direction of the spotlight and the distance from the current pixel\r\n // 0.0001 prevents div by zero while using smoothstep interpolation\r\n float flCosOuterCone = cos(radians(({4}+{5}+0.0001)/2.0f));\r\n float flCosInnerCone = cos(radians({4}/2.0f));\r\n float flDirectionAngle = radians({2});\r\n float2 vLightDir = {{cos(flDirectionAngle), -sin(flDirectionAngle)}};\r\n float2 vLightPosition = {1}.xy - vLightDir;\r\n float2 vPositionDelta = Input.ViewPos.xy - vLightPosition;\r\n\r\n // Compute the cone region, attenuation and falloff\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = {6} / ({7}.x + flDist*{7}.y + flDist*flDist*{7}.z);\r\n float flCone = dot(normalize(vPositionDelta), vLightDir);\r\n\r\n {0} *= smoothstep(flCosOuterCone, flCosInnerCone, flCone) * flFalloff;\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo5.Name, variableInfo6.Name, variableInfo7.Name, variableInfo8.Name); + if (variableInfo4.IsDynamic || !efiSpotlight2D.AmbientColor.ToVector4().IsApproximate(Vector4.Zero)) + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", str, effectBuilder.PixelShaderOutput, variableInfo4.Name)); + else + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", str)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureInfo.cs new file mode 100644 index 0000000..f2085a6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureInfo.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9TextureInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9TextureInfo + { + public int ImageIndex; + public string TexCoordInput; + public string Sampler; + public string TexelSize; + public string TexUVRefPoint; + public string TexUVSize; + public int DownsamplePropertyID; + public int Requirements; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureRequirements.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureRequirements.cs new file mode 100644 index 0000000..5f4ef5e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9TextureRequirements.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9TextureRequirements +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + [Flags] + internal enum Dx9TextureRequirements + { + TexelSize = 1, + SampleBackbuffer = 2, + TexUVSize = 4, + TexUVRefPoint = 8, + DisablePerspectiveCorrection = 16, // 0x00000010 + ValidMask = DisablePerspectiveCorrection | TexUVRefPoint | TexUVSize | SampleBackbuffer | TexelSize, // 0x0000001F + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VariableType.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VariableType.cs new file mode 100644 index 0000000..0991943 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VariableType.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9VariableType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum Dx9VariableType : byte + { + Integer, + Float, + Vector2, + Vector3, + Vector4, + Texture, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs new file mode 100644 index 0000000..8bc1f48 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Dx9VideoElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Dx9VideoElement + { + internal static void Generate(VideoElement efiVideo, ref Dx9EffectBuilder effectBuilder) + { + Dx9TextureInfo dx9TextureInfo = effectBuilder.AllocateTexture(); + TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); + textureVariableInfo.ID = efiVideo.VideoStreamID; + textureVariableInfo.Type = Dx9VariableType.Texture; + textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiVideo.Name); + textureVariableInfo.DefaultValue = efiVideo.VideoStream; + textureVariableInfo.SamplerName = dx9TextureInfo.Sampler; + textureVariableInfo.MinFilter = "Linear"; + textureVariableInfo.MagFilter = "Linear"; + textureVariableInfo.CoordinateMapID = -1; + textureVariableInfo.ImageIndexID = -1; + effectBuilder.AddPropertyVariable(textureVariableInfo); + effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiVideo.Name); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the surface\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, dx9TextureInfo.Sampler, dx9TextureInfo.TexCoordInput)); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBlock.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBlock.cs new file mode 100644 index 0000000..54bf784 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBlock.cs @@ -0,0 +1,129 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DynamicBlock +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class DynamicBlock : IDynamicBlock + { + private DynamicRow m_rowOwner; + private Rectangle m_rcLocationPxl; + private Size m_sizeContentPxl; + private Surface m_surface; + private bool m_fRotated; + private Size m_sizeGutter; + + internal DynamicBlock( + DynamicRow rowOwner, + Rectangle rcLocationPxl, + Size sizeContentPxl, + Size sizeGutter, + bool fRotated) + { + this.m_rowOwner = rowOwner; + this.m_fRotated = fRotated; + this.m_rcLocationPxl = rcLocationPxl; + this.m_sizeContentPxl = sizeContentPxl; + this.m_sizeGutter = sizeGutter; + } + + internal Surface Create(ISurfaceContentOwner surfaceOwner) + { + Surface surface = new Surface(this.m_rowOwner.DynamicPool.SurfacePool, surfaceOwner, this.m_sizeContentPxl, this.m_sizeGutter); + this.m_surface = surface; + RemoteSurface remoteStub = surface.RemoteStub; + remoteStub.SendRemapLocation(this.m_rcLocationPxl); + remoteStub.SendSetRotation(this.m_fRotated); + remoteStub.SendSetGutter(this.m_sizeGutter); + return surface; + } + + ~DynamicBlock() => this.Dispose(false); + + public void Dispose() + { + GC.SuppressFinalize(this); + this.Dispose(true); + } + + private void Dispose(bool fInDispose) + { + this.m_surface = null; + if (!fInDispose) + return; + this.m_rowOwner.NotifyBlockDestroyed(this); + } + + public int NearEdge => this.m_rcLocationPxl.Left; + + public int FarEdge => this.m_rcLocationPxl.Right; + + internal Point StoragePosition + { + get => this.m_rcLocationPxl.Location; + set + { + if (!(this.m_rcLocationPxl.Location != value)) + return; + this.m_rcLocationPxl.Location = value; + } + } + + internal Size StorageSize + { + get => this.m_rcLocationPxl.Size; + set + { + if (!(this.m_rcLocationPxl.Size != value)) + return; + this.m_rcLocationPxl.Size = value; + } + } + + public Surface Surface => this.m_surface; + + public DynamicRow Row => this.m_rowOwner; + + internal void NotifyPositionChanged(ArrayList alReloadContent, Point ptNewOffsetPxl) + { + if (!(ptNewOffsetPxl != this.m_rcLocationPxl.Location)) + return; + this.m_rcLocationPxl.Location = ptNewOffsetPxl; + Surface surface = this.Surface; + if (surface == null) + return; + RemoteSurface remoteStub = surface.RemoteStub; + switch (surface.SurfacePool.StorageState) + { + case SurfacePoolAllocationResult.NotAllocated: + case SurfacePoolAllocationResult.Requested: + case SurfacePoolAllocationResult.Immoveable: + remoteStub.SendRemapLocation(this.m_rcLocationPxl); + alReloadContent.Add(surface); + break; + } + } + + internal void NotifyRowChanged( + ArrayList alReloadContent, + DynamicRow rowNewOwner, + DynamicRow rowOldOwner, + Point ptNewOffsetPxl) + { + this.m_rowOwner = rowNewOwner; + this.NotifyPositionChanged(alReloadContent, ptNewOffsetPxl); + } + + [Conditional("DEBUG")] + private void OnPositionChanged() + { + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBucket.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBucket.cs new file mode 100644 index 0000000..abe4179 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicBucket.cs @@ -0,0 +1,215 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DynamicBucket +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class DynamicBucket + { + private DynamicPool m_poolOwner; + private int m_nHeightPxl; + private ArrayList m_alRows; + private bool m_fCompacting; + + public DynamicBucket(DynamicPool poolOwner, int nHeightPxl) + { + this.m_poolOwner = poolOwner; + this.m_nHeightPxl = nHeightPxl; + this.m_alRows = new ArrayList(); + } + + public int RowHeight => this.m_nHeightPxl; + + internal DynamicPool DynamicPool => this.m_poolOwner; + + public Surface CreateSurface( + ISurfaceContentOwner surfaceOwner, + Size sizeRequestPxl, + Size sizeContentPxl, + Size sizeGutter, + bool fRotated, + PoolAllocMethod allocMethod) + { + ArrayList alReloadContent = null; + DynamicRow dynamicRow = null; + switch (allocMethod) + { + case PoolAllocMethod.Available: + dynamicRow = this.FindTrivialFreeSpaceRow(sizeRequestPxl.Width); + break; + case PoolAllocMethod.New: + case PoolAllocMethod.CompactDead: + case PoolAllocMethod.CompactAll: + alReloadContent = new ArrayList(); + dynamicRow = this.m_poolOwner.CreateRow(alReloadContent, this, surfaceOwner, sizeRequestPxl, allocMethod); + if (dynamicRow != null) + { + this.m_alRows.Add(dynamicRow); + break; + } + break; + case PoolAllocMethod.ScavengeDead: + alReloadContent = new ArrayList(); + dynamicRow = this.ScavengeForAvailableSpace(alReloadContent, sizeRequestPxl); + break; + } + if (alReloadContent != null) + this.m_poolOwner.ProcessDeferredContent(alReloadContent); + return dynamicRow?.CreateSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated); + } + + public void NotifyEmpty(DynamicRow rowEmpty) + { + if (this.m_fCompacting) + return; + this.NotifyEmptyWorker(this.m_alRows.IndexOf(rowEmpty)); + } + + private void NotifyEmptyWorker(int idxRow) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[idxRow]; + this.m_alRows.RemoveAt(idxRow); + this.m_poolOwner.NotifyEmpty(alRow); + if (this.m_alRows.Count != 0) + return; + this.m_poolOwner.NotifyEmpty(this); + } + + private DynamicRow FindTrivialFreeSpaceRow(int nRequestedWidth) + { + for (int index = 0; index < this.m_alRows.Count; ++index) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[index]; + if (nRequestedWidth <= alRow.LargestFree) + return alRow; + } + return null; + } + + private DynamicRow ScavengeForAvailableSpace( + ArrayList alReloadContent, + Size sizeRequested) + { + uint uAvgTimestampsNoCompact; + uint uAvgTimestampsWithCompact; + object objResultOfSpeculation = this.m_poolOwner.SpeculateScavengeRows(this.RowHeight, this, out uAvgTimestampsNoCompact, out uAvgTimestampsWithCompact); + DynamicRow dynamicRow = null; + if (uAvgTimestampsNoCompact == uint.MaxValue) + dynamicRow = this.ScavengeLocalRows(alReloadContent, sizeRequested.Width); + if (uAvgTimestampsNoCompact != uint.MaxValue || uAvgTimestampsWithCompact != uint.MaxValue) + { + int nRequestedHeight = 0; + if (dynamicRow == null) + nRequestedHeight = this.RowHeight; + this.m_poolOwner.FinishScavengeRows(alReloadContent, nRequestedHeight, objResultOfSpeculation); + } + return dynamicRow; + } + + private DynamicRow ScavengeLocalRows(ArrayList alReloadContent, int nRequestedWidth) + { + DynamicRow dynamicRow1 = null; + object obj1 = null; + uint num1 = uint.MaxValue; + DynamicRow dynamicRow2 = null; + object obj2 = null; + uint num2 = uint.MaxValue; + for (int index = 0; index < this.m_alRows.Count; ++index) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[index]; + uint uAvgTimestampsNoCompact; + uint uAvgTimestampsWithCompact; + object obj3 = alRow.SpeculateScavengeBlocks(nRequestedWidth, out uAvgTimestampsNoCompact, out uAvgTimestampsWithCompact); + if (num1 > uAvgTimestampsNoCompact) + { + num1 = uAvgTimestampsNoCompact; + obj1 = obj3; + dynamicRow1 = alRow; + } + if (num2 > uAvgTimestampsWithCompact) + { + num2 = uAvgTimestampsWithCompact; + obj2 = obj3; + dynamicRow2 = alRow; + } + } + DynamicRow dynamicRow3 = dynamicRow1; + object objResultOfPotentialCalculation = obj1; + if (dynamicRow3 == null) + { + dynamicRow3 = dynamicRow2; + objResultOfPotentialCalculation = obj2; + } + if (dynamicRow3 != null && !dynamicRow3.FinishScavengeBlocks(alReloadContent, nRequestedWidth, objResultOfPotentialCalculation)) + dynamicRow3 = null; + if (dynamicRow3 != null && !this.m_alRows.Contains(dynamicRow3)) + dynamicRow3 = null; + return dynamicRow3; + } + + internal void CollectDeadBlocks() + { + if (this.m_alRows.Count <= 0) + return; + this.m_fCompacting = true; + try + { + for (int index = 0; index < this.m_alRows.Count; ++index) + ((DynamicRow)this.m_alRows[index]).CollectDeadBlocks(); + this.RemoveEmptyRows(); + } + finally + { + this.m_fCompacting = false; + } + } + + internal void CompactBlocks(ArrayList alReloadContent, bool fCompactToRight) + { + if (this.m_alRows.Count <= 0) + return; + this.m_fCompacting = true; + try + { + int index = 0; + for (; index < this.m_alRows.Count; ++index) + { + DynamicRow alRow1 = (DynamicRow)this.m_alRows[index]; + alRow1.CompactBlocks(alReloadContent, fCompactToRight); + int num = index + 1; + while (num < this.m_alRows.Count) + { + DynamicRow alRow2 = (DynamicRow)this.m_alRows[num++]; + if (!DynamicRow.MoveBlocksToEnd(alReloadContent, alRow1, alRow2, fCompactToRight)) + break; + } + } + this.RemoveEmptyRows(); + } + finally + { + this.m_fCompacting = false; + } + } + + internal void RemoveEmptyRows() + { + int num = 0; + while (num < this.m_alRows.Count) + { + if (((DynamicRow)this.m_alRows[num]).IsEmpty) + this.NotifyEmptyWorker(num); + else + ++num; + } + } + + public int ID => 0; + + internal void AssertOwningThread() => this.m_poolOwner.AssertOwningThread(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPool.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPool.cs new file mode 100644 index 0000000..7c84c32 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPool.cs @@ -0,0 +1,491 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DynamicPool +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class DynamicPool : IComparer + { + private RenderSession m_session; + private GraphicsDevice m_device; + private SurfacePool m_poolSurface; + private ArrayList m_alBuckets; + private ArrayList m_alRows; + private Size m_sizeTotalPxl; + private int m_nLargestFreePxl; + private int m_nTotalFreePxl; + private int m_nMinimumHeightPxl; + private int m_nMaximumHeightPxl; + private uint m_nCompact; + private bool m_fCollectDeadSurfacesDuringDebugCompact; + + internal DynamicPool(SurfacePool poolSurface, int nMinimumHeightPxl, int nMaximumHeightPxl) + { + this.m_device = poolSurface.Device; + this.m_session = this.m_device.Session; + this.m_poolSurface = poolSurface; + this.m_alBuckets = new ArrayList(); + this.m_alRows = new ArrayList(); + this.m_sizeTotalPxl = poolSurface.StorageSize; + this.m_nLargestFreePxl = this.m_sizeTotalPxl.Height; + this.m_nMinimumHeightPxl = nMinimumHeightPxl; + this.m_nMaximumHeightPxl = nMaximumHeightPxl; + } + + public void Dispose() + { + foreach (DynamicRow alRow in this.m_alRows) + alRow.Dispose(); + this.m_alBuckets = null; + this.m_alRows = null; + this.m_poolSurface.Dispose(); + this.m_poolSurface = null; + } + + internal SurfacePool SurfacePool => this.m_poolSurface; + + public Size TotalSize => this.m_sizeTotalPxl; + + public SurfaceFormat Format => this.m_poolSurface.Format; + + internal void AssertOwningThread() => this.m_session.AssertOwningThread(); + + public uint DebugCompactInterval + { + get => 0; + set + { + } + } + + public bool CollectDeadSurfacesDuringDebugCompact + { + get => this.m_fCollectDeadSurfacesDuringDebugCompact; + set => this.m_fCollectDeadSurfacesDuringDebugCompact = value; + } + + public Surface CreateSurface( + ISurfaceContentOwner surfaceOwner, + Size sizeRequestPxl, + Size sizeContentPxl, + Size sizeGutter, + bool fRotated, + PoolAllocMethod allocMethod) + { + int nHeightPxl = Math2.FindPowerOf2(sizeRequestPxl.Height, this.m_nMinimumHeightPxl); + if (nHeightPxl > this.m_nMaximumHeightPxl) + { + if (sizeRequestPxl.Height <= this.m_nMaximumHeightPxl) + nHeightPxl = this.m_nMaximumHeightPxl; + } + else if (sizeRequestPxl.Width <= this.m_sizeTotalPxl.Width) + { + int height = this.m_sizeTotalPxl.Height; + } + DynamicBucket dynamicBucket = null; + for (int index = 0; index < this.m_alBuckets.Count; ++index) + { + DynamicBucket alBucket = (DynamicBucket)this.m_alBuckets[index]; + if (alBucket.RowHeight == nHeightPxl) + { + dynamicBucket = alBucket; + break; + } + } + if (dynamicBucket == null) + { + dynamicBucket = new DynamicBucket(this, nHeightPxl); + this.m_alBuckets.Add(dynamicBucket); + } + return dynamicBucket.CreateSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated, allocMethod); + } + + public static void FindInsertionPoint( + ArrayList alItems, + int nTotalPxl, + int nNeededPxl, + out int idxInsert, + out int nOffsetNewPxl) + { + idxInsert = 0; + nOffsetNewPxl = 0; + int num1 = int.MaxValue; + if (alItems.Count <= 0) + return; + idxInsert = -1; + IDynamicBlock dynamicBlock1 = null; + int index = 0; + while (index <= alItems.Count) + { + IDynamicBlock dynamicBlock2 = null; + int num2; + if (index < alItems.Count) + { + dynamicBlock2 = (IDynamicBlock)alItems[index]; + num2 = dynamicBlock2.NearEdge; + } + else + num2 = nTotalPxl; + if (dynamicBlock1 != null) + num2 -= dynamicBlock1.FarEdge; + int num3 = num2 - nNeededPxl; + if (num3 >= 0 && num3 < num1) + { + nOffsetNewPxl = dynamicBlock1 != null ? dynamicBlock1.FarEdge : 0; + num1 = num3; + idxInsert = index; + } + ++index; + dynamicBlock1 = dynamicBlock2; + } + } + + public static void RecomputeAvailable( + ArrayList alItems, + int nTotalPxl, + out int nOutLargestFreePxl, + out int nOutTotalFreePxl) + { + int num1 = nTotalPxl; + int num2 = nTotalPxl; + if (alItems.Count >= 0) + { + num1 = 0; + num2 = 0; + IDynamicBlock dynamicBlock1 = null; + int index = 0; + while (index <= alItems.Count) + { + IDynamicBlock dynamicBlock2; + int num3; + if (index < alItems.Count) + { + dynamicBlock2 = (IDynamicBlock)alItems[index]; + num3 = dynamicBlock2.NearEdge; + } + else + { + dynamicBlock2 = null; + num3 = nTotalPxl; + } + if (dynamicBlock1 != null) + num3 -= dynamicBlock1.FarEdge; + if (num1 < num3) + num1 = num3; + num2 += num3; + ++index; + dynamicBlock1 = dynamicBlock2; + } + } + nOutLargestFreePxl = num1; + nOutTotalFreePxl = num2; + } + + [Conditional("DEBUG")] + public static void ValidateItems( + ArrayList alItems, + int nTotalPxl, + int nCachedLargestAvailable, + bool fTightPacking) + { + if (alItems.Count <= 0) + return; + int num1 = 0; + IDynamicBlock dynamicBlock1 = null; + int index = 0; + while (index <= alItems.Count) + { + IDynamicBlock dynamicBlock2; + int num2; + if (index < alItems.Count) + { + dynamicBlock2 = (IDynamicBlock)alItems[index]; + num2 = dynamicBlock2.NearEdge; + } + else + { + dynamicBlock2 = null; + num2 = nTotalPxl; + } + if (dynamicBlock1 != null) + num2 -= dynamicBlock1.FarEdge; + if (num1 < num2) + num1 = num2; + if (fTightPacking && index > 0) + { + int count = alItems.Count; + } + ++index; + dynamicBlock1 = dynamicBlock2; + } + } + + public DynamicRow CreateRow( + ArrayList alReloadContent, + DynamicBucket bktOwner, + ISurfaceContentOwner surfaceOwner, + Size sizeRequestPxl, + PoolAllocMethod allocMethod) + { + int rowHeight = bktOwner.RowHeight; + switch (allocMethod) + { + case PoolAllocMethod.CompactDead: + this.CollectDeadSurfaces(); + break; + case PoolAllocMethod.CompactAll: + this.FullCompact(alReloadContent); + break; + } + DynamicRow dynamicRow = null; + if (rowHeight <= this.m_nLargestFreePxl) + { + int idxInsert; + int nOffsetNewPxl; + FindInsertionPoint(this.m_alRows, this.m_sizeTotalPxl.Height, rowHeight, out idxInsert, out nOffsetNewPxl); + dynamicRow = new DynamicRow(bktOwner, rowHeight, nOffsetNewPxl); + this.m_alRows.Insert(idxInsert, dynamicRow); + RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); + } + return dynamicRow; + } + + internal object SpeculateScavengeRows( + int nRequestedHeight, + DynamicBucket bktIgnore, + out uint uAvgTimestampsNoCompact, + out uint uAvgTimestampsWithCompact) + { + uAvgTimestampsNoCompact = uint.MaxValue; + uAvgTimestampsWithCompact = uint.MaxValue; + if (nRequestedHeight <= this.m_nLargestFreePxl) + { + uAvgTimestampsNoCompact = 0U; + return null; + } + int count = this.m_alRows.Count; + int length = 0; + DynamicRow[] dynamicRowArray = new DynamicRow[count]; + int num1 = 0; + DynamicRow dynamicRow1 = null; + uint num2 = uint.MaxValue; + for (int index = 0; index < count; ++index) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[index]; + if (alRow.Bucket != bktIgnore) + { + alRow.UpdateLivenessAndAge(); + if (alRow.LastFullyEmpty) + { + dynamicRowArray[length++] = alRow; + num1 += alRow.StorageSize.Height; + if (alRow.LastAvgAge < num2) + { + int num3 = 0; + if (index > 0) + num3 = ((DynamicRow)this.m_alRows[index - 1]).FarEdge; + int num4 = this.m_sizeTotalPxl.Height; + if (index < count - 1) + num4 = ((DynamicRow)this.m_alRows[index + 1]).NearEdge; + if (num4 - num3 >= nRequestedHeight) + { + dynamicRow1 = alRow; + num2 = alRow.LastAvgAge; + } + } + } + } + } + if (dynamicRow1 != null) + { + uAvgTimestampsNoCompact = num2; + return dynamicRow1; + } + if (nRequestedHeight <= this.m_nTotalFreePxl) + { + uAvgTimestampsWithCompact = 0U; + return null; + } + if (nRequestedHeight > num1 + this.m_nTotalFreePxl) + return null; + Array.Sort(dynamicRowArray, 0, length, this); + int nTotalFreePxl = this.m_nTotalFreePxl; + int num5 = 0; + ulong num6 = 0; + while (num5 < length) + { + DynamicRow dynamicRow2 = dynamicRowArray[num5++]; + nTotalFreePxl += dynamicRow2.StorageSize.Height; + num6 += dynamicRow2.LastAvgAge; + if (nTotalFreePxl >= nRequestedHeight) + break; + } + uAvgTimestampsWithCompact = (uint)(num6 / (ulong)num5); + while (num5 < length) + dynamicRowArray[num5++] = null; + return dynamicRowArray; + } + + internal bool FinishScavengeRows( + ArrayList alReloadContent, + int nRequestedHeight, + object objResultOfSpeculation) + { + if (objResultOfSpeculation != null) + { + if (objResultOfSpeculation is DynamicRow dynamicRow1) + { + dynamicRow1.CollectDeadBlocks(); + this.RemoveEmptyRows(); + } + else + { + foreach (DynamicRow dynamicRow2 in objResultOfSpeculation as DynamicRow[]) + { + if (dynamicRow2 != null) + { + dynamicRow2.CollectDeadBlocks(); + this.RemoveEmptyRows(); + if (nRequestedHeight <= this.m_nLargestFreePxl) + break; + } + } + } + } + if (nRequestedHeight > this.m_nLargestFreePxl) + this.CompactRows(alReloadContent, false); + return nRequestedHeight <= this.m_nLargestFreePxl; + } + + int IComparer.Compare(object oL, object oR) + { + DynamicRow dynamicRow1 = oL as DynamicRow; + DynamicRow dynamicRow2 = oR as DynamicRow; + uint lastAvgAge1 = dynamicRow1.LastAvgAge; + uint lastAvgAge2 = dynamicRow2.LastAvgAge; + if (lastAvgAge1 < lastAvgAge2) + return -1; + return lastAvgAge1 > lastAvgAge2 ? 1 : 0; + } + + public void NotifyEmpty(DynamicRow rowEmpty) + { + this.m_alRows.Remove(rowEmpty); + RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); + } + + public void NotifyEmpty(DynamicBucket bktEmpty) + { + } + + public void CollectDeadSurfaces() + { + for (int index = 0; index < this.m_alBuckets.Count; ++index) + ((DynamicBucket)this.m_alBuckets[index]).CollectDeadBlocks(); + } + + internal IList ExtractAllSurfaces() + { + if (this.m_poolSurface == null) + return null; + IList allSurfaces = this.m_poolSurface.AllSurfaces; + if (allSurfaces == null) + return null; + foreach (Surface surCur in allSurfaces) + SurfacePool.RemapSurface(surCur, new SurfacePool(this.m_device, surCur.ContentSize, SurfaceFormat.ARGB32) + { + DestroyWhenEmpty = true + }); + this.m_poolSurface = null; + this.m_alBuckets = new ArrayList(); + this.m_alRows = new ArrayList(); + return allSurfaces; + } + + private void RemoveEmptyRows() + { + for (int index = 0; index < this.m_alBuckets.Count; ++index) + ((DynamicBucket)this.m_alBuckets[index]).RemoveEmptyRows(); + } + + private int TestCollect() + { + if (this.CollectDeadSurfacesDuringDebugCompact) + this.CollectDeadSurfaces(); + ArrayList alReloadContent = new ArrayList(); + this.FullCompact(alReloadContent); + this.ProcessDeferredContent(alReloadContent); + return alReloadContent.Count; + } + + private void DebugCompactTimeout(object sender, EventArgs args) => this.TestCollect(); + + internal void ProcessDeferredContent(ArrayList alReloadContent) + { + if (alReloadContent.Count <= 0) + return; + foreach (Surface surface in alReloadContent) + surface.RestoreContent(); + } + + private void FullCompact(ArrayList alReloadContent) + { + ++this.m_nCompact; + bool fCompactToRight = false; + bool fCompactDownward = false; + for (int index = 0; index < this.m_alBuckets.Count; ++index) + ((DynamicBucket)this.m_alBuckets[index]).CompactBlocks(alReloadContent, fCompactToRight); + this.CompactRows(alReloadContent, fCompactDownward); + this.m_nLargestFreePxl = this.m_sizeTotalPxl.Height; + int count = this.m_alRows.Count; + if (count <= 0) + return; + if (fCompactDownward) + this.m_nLargestFreePxl = ((DynamicRow)this.m_alRows[0]).NearEdge; + else + this.m_nLargestFreePxl = this.m_sizeTotalPxl.Height - ((DynamicRow)this.m_alRows[count - 1]).FarEdge; + } + + private void CompactRows(ArrayList alReloadContent, bool fCompactDownward) + { + if (fCompactDownward) + { + int height = this.m_sizeTotalPxl.Height; + for (int index = this.m_alRows.Count - 1; index >= 0; --index) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[index]; + height -= alRow.StorageSize.Height; + alRow.NotifyPositionChanged(alReloadContent, height); + } + } + else + { + int nNewOffsetYPxl = 0; + for (int index = 0; index < this.m_alRows.Count; ++index) + { + DynamicRow alRow = (DynamicRow)this.m_alRows[index]; + alRow.NotifyPositionChanged(alReloadContent, nNewOffsetYPxl); + nNewOffsetYPxl += alRow.StorageSize.Height; + } + } + } + + internal void Dump() + { + foreach (DynamicBucket alBucket in this.m_alBuckets) + ; + foreach (DynamicRow alRow in this.m_alRows) + { + foreach (DynamicBlock block in alRow.Blocks) + ; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs new file mode 100644 index 0000000..684aa86 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs @@ -0,0 +1,97 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DynamicPoolSet +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class DynamicPoolSet : RenderObject + { + private GraphicsDevice m_device; + private ArrayList m_alPools; + private SurfaceFormat m_nFormat; + private int m_idxLastAlloc; + + internal DynamicPoolSet(GraphicsDevice device, SurfaceFormat nFormat) + { + this.m_device = device; + this.m_alPools = new ArrayList(); + this.m_nFormat = nFormat; + this.m_idxLastAlloc = 0; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + foreach (DynamicPool alPool in this.m_alPools) + alPool.Dispose(); + } + this.m_alPools = null; + this.m_device = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal SurfaceFormat Format => this.m_nFormat; + + internal ArrayList Pools => this.m_alPools; + + internal DynamicPool AllocateDynamicPool( + Size sizeDynamicPoolPxl, + int nMinHeightPxl, + int nMaxHeightPxl) + { + SurfacePool poolSurface = new SurfacePool(this.m_device, sizeDynamicPoolPxl, this.m_nFormat); + poolSurface.DestroyWhenEmpty = false; + poolSurface.RemoteStub.SendSetPriority(-10); + DynamicPool dynamicPool = new DynamicPool(poolSurface, nMinHeightPxl, nMaxHeightPxl); + this.m_alPools.Add(dynamicPool); + return dynamicPool; + } + + internal Surface RequestSurface( + ISurfaceContentOwner surfaceOwner, + Size sizeRequestPxl, + Size sizeContentPxl, + Size sizeGutter, + bool fRotated, + PoolAllocMethod minAllocMethod, + PoolAllocMethod maxAllocMethod) + { + Debug2.Validate(surfaceOwner != null, typeof(ArgumentNullException), "Must provide valid surface owner"); + Debug2.Validate(sizeContentPxl.Width > 0 && sizeContentPxl.Height > 0, typeof(ArgumentOutOfRangeException), "Must provide positive area for surface"); + Surface surface = null; + for (int index1 = 0; index1 < this.m_alPools.Count; ++index1) + { + for (int index2 = (int)minAllocMethod; (PoolAllocMethod)index2 <= maxAllocMethod; ++index2) + { + int index3 = (this.m_idxLastAlloc + index1) % this.m_alPools.Count; + surface = ((DynamicPool)this.m_alPools[index3]).CreateSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated, (PoolAllocMethod)index2); + if (surface != null) + { + this.m_idxLastAlloc = index3; + break; + } + } + if (surface != null) + break; + } + return surface; + } + + protected override void Invariant() + { + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicRow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicRow.cs new file mode 100644 index 0000000..1336198 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/DynamicRow.cs @@ -0,0 +1,381 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.DynamicRow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class DynamicRow : IDynamicBlock, IComparer + { + private DynamicBucket m_bktOwner; + private Size m_sizeRowPxl; + private int m_nOffsetYPxl; + private int m_nLargestFreePxl; + private int m_nTotalFreePxl; + private ArrayList m_alBlocks; + private uint m_uLastAvgAge; + + internal DynamicRow(DynamicBucket bktOwner, int nHeightPxl, int nOffsetPxl) + { + this.m_bktOwner = bktOwner; + this.m_sizeRowPxl = new Size(bktOwner.DynamicPool.SurfacePool.StorageSize.Width, nHeightPxl); + this.m_nOffsetYPxl = nOffsetPxl; + this.m_alBlocks = new ArrayList(); + this.m_nLargestFreePxl = this.m_sizeRowPxl.Width; + } + + public void Dispose() + { + this.m_bktOwner.AssertOwningThread(); + this.m_bktOwner = null; + foreach (DynamicBlock alBlock in this.m_alBlocks) + alBlock.Dispose(); + this.m_alBlocks = null; + } + + public int NearEdge => this.m_nOffsetYPxl; + + public int FarEdge => this.m_nOffsetYPxl + this.m_sizeRowPxl.Height; + + public int LargestFree => this.m_nLargestFreePxl; + + public int TotalFree => this.m_nTotalFreePxl; + + public DynamicPool DynamicPool => this.m_bktOwner.DynamicPool; + + public DynamicBucket Bucket => this.m_bktOwner; + + public ICollection Blocks => m_alBlocks; + + internal bool IsEmpty => this.m_alBlocks.Count == 0; + + internal Size StorageSize => this.m_sizeRowPxl; + + internal bool LastFullyEmpty => this.m_uLastAvgAge != uint.MaxValue; + + internal uint LastAvgAge => this.m_uLastAvgAge; + + internal Surface CreateSurface( + ISurfaceContentOwner surfaceOwner, + Size sizeRequestPxl, + Size sizeContentPxl, + Size sizeGutter, + bool fRotated) + { + int idxInsert; + int nOffsetNewPxl; + DynamicPool.FindInsertionPoint(this.m_alBlocks, this.m_sizeRowPxl.Width, sizeRequestPxl.Width, out idxInsert, out nOffsetNewPxl); + DynamicBlock dynamicBlock = new DynamicBlock(this, new Rectangle(new Point(nOffsetNewPxl, this.m_nOffsetYPxl), sizeRequestPxl), sizeContentPxl, sizeGutter, fRotated); + Surface surface = dynamicBlock.Create(surfaceOwner); + surface.RegisterUsage(DynamicPool.SurfacePool); + this.m_alBlocks.Insert(idxInsert, dynamicBlock); + this.RecomputeAvailable(); + return surface; + } + + internal void UpdateLivenessAndAge() + { + ulong num = 0; + int count = this.m_alBlocks.Count; + for (int index = 0; index < count; ++index) + { + Surface surface = ((DynamicBlock)this.m_alBlocks[index]).Surface; + if (surface.InUse) + { + this.m_uLastAvgAge = uint.MaxValue; + return; + } + num += surface.LastUsage; + } + this.m_uLastAvgAge = (uint)(num / (ulong)count); + } + + internal object SpeculateScavengeBlocks( + int nRequestedWidth, + out uint uAvgTimestampsNoCompact, + out uint uAvgTimestampsWithCompact) + { + uAvgTimestampsNoCompact = uint.MaxValue; + uAvgTimestampsWithCompact = uint.MaxValue; + if (nRequestedWidth <= this.m_nLargestFreePxl) + { + uAvgTimestampsNoCompact = 0U; + return null; + } + int count = this.m_alBlocks.Count; + int length = 0; + DynamicBlock[] dynamicBlockArray = new DynamicBlock[count]; + int num1 = 0; + DynamicBlock dynamicBlock1 = null; + uint num2 = uint.MaxValue; + for (int index = 0; index < count; ++index) + { + DynamicBlock alBlock = (DynamicBlock)this.m_alBlocks[index]; + Surface surface = alBlock.Surface; + if (!surface.InUse) + { + dynamicBlockArray[length++] = alBlock; + num1 += alBlock.StorageSize.Width; + if (surface.LastUsage < num2) + { + int num3 = 0; + if (index > 0) + num3 = ((DynamicBlock)this.m_alBlocks[index - 1]).FarEdge; + int num4 = this.m_sizeRowPxl.Width; + if (index < count - 1) + num4 = ((DynamicBlock)this.m_alBlocks[index + 1]).NearEdge; + if (num4 - num3 >= nRequestedWidth) + { + dynamicBlock1 = alBlock; + num2 = surface.LastUsage; + } + } + } + } + if (dynamicBlock1 != null) + { + uAvgTimestampsNoCompact = num2; + return dynamicBlock1; + } + if (nRequestedWidth <= this.m_nTotalFreePxl) + { + uAvgTimestampsWithCompact = 0U; + return null; + } + if (nRequestedWidth > num1 + this.m_nTotalFreePxl) + return null; + Array.Sort(dynamicBlockArray, 0, length, this); + int nTotalFreePxl = this.m_nTotalFreePxl; + int num5 = 0; + ulong num6 = 0; + while (num5 < length) + { + DynamicBlock dynamicBlock2 = dynamicBlockArray[num5++]; + nTotalFreePxl += dynamicBlock2.StorageSize.Width; + num6 += dynamicBlock2.Surface.LastUsage; + if (nTotalFreePxl >= nRequestedWidth) + break; + } + uAvgTimestampsWithCompact = (uint)(num6 / (ulong)num5); + while (num5 < length) + dynamicBlockArray[num5++] = null; + return dynamicBlockArray; + } + + internal bool FinishScavengeBlocks( + ArrayList alReloadContent, + int nRequestedWidth, + object objResultOfPotentialCalculation) + { + if (objResultOfPotentialCalculation != null) + { + if (objResultOfPotentialCalculation is DynamicBlock blk1) + { + this.CollectDeadBlockSurface(blk1, blk1.Surface); + } + else + { + foreach (DynamicBlock blk2 in objResultOfPotentialCalculation as DynamicBlock[]) + { + if (blk2 != null) + this.CollectDeadBlockSurface(blk2, blk2.Surface); + if (nRequestedWidth <= this.m_nLargestFreePxl) + break; + } + } + } + if (nRequestedWidth > this.m_nLargestFreePxl) + this.CompactBlocks(alReloadContent, false); + return nRequestedWidth <= this.m_nLargestFreePxl; + } + + int IComparer.Compare(object oL, object oR) + { + DynamicBlock dynamicBlock1 = oL as DynamicBlock; + DynamicBlock dynamicBlock2 = oR as DynamicBlock; + Surface surface1 = dynamicBlock1.Surface; + Surface surface2 = dynamicBlock2.Surface; + uint lastUsage1 = surface1.LastUsage; + uint lastUsage2 = surface2.LastUsage; + if (lastUsage1 < lastUsage2) + return -1; + return lastUsage1 > lastUsage2 ? 1 : 0; + } + + internal void CollectDeadBlocks() + { + int index = 0; + while (index < this.m_alBlocks.Count) + { + DynamicBlock alBlock = (DynamicBlock)this.m_alBlocks[index]; + Surface surface = alBlock.Surface; + if (!surface.InUse) + this.CollectDeadBlockSurface(alBlock, surface); + else + ++index; + } + } + + private void CollectDeadBlockSurface(DynamicBlock blk, Surface sur) + { + sur.UnregisterUsage(DynamicPool.SurfacePool); + blk.Dispose(); + } + + internal void CompactBlocks(ArrayList alReloadContent, bool fCompactToRight) + { + if (this.m_alBlocks.Count <= 0) + return; + DynamicBlock dynamicBlock = null; + try + { + if (fCompactToRight) + { + Point ptNewOffsetPxl = new Point(this.m_sizeRowPxl.Width, this.m_nOffsetYPxl); + for (int index = this.m_alBlocks.Count - 1; index >= 0; --index) + { + DynamicBlock alBlock = (DynamicBlock)this.m_alBlocks[index]; + ptNewOffsetPxl.X -= alBlock.StorageSize.Width; + alBlock.NotifyPositionChanged(alReloadContent, ptNewOffsetPxl); + dynamicBlock = alBlock; + } + } + else + { + Point ptNewOffsetPxl = new Point(0, this.m_nOffsetYPxl); + for (int index = 0; index < this.m_alBlocks.Count; ++index) + { + DynamicBlock alBlock = (DynamicBlock)this.m_alBlocks[index]; + alBlock.NotifyPositionChanged(alReloadContent, ptNewOffsetPxl); + ptNewOffsetPxl.X = alBlock.FarEdge; + dynamicBlock = alBlock; + } + } + } + finally + { + if (fCompactToRight) + { + this.m_nLargestFreePxl = this.m_sizeRowPxl.Width; + if (dynamicBlock != null) + this.m_nLargestFreePxl = dynamicBlock.NearEdge; + } + else + { + this.m_nLargestFreePxl = this.m_sizeRowPxl.Width; + if (dynamicBlock != null) + this.m_nLargestFreePxl -= dynamicBlock.FarEdge; + } + } + } + + internal static bool MoveBlocksToEnd( + ArrayList alReloadContent, + DynamicRow rowDest, + DynamicRow rowSrc, + bool fCompactToRight) + { + bool flag = true; + while (rowSrc.m_alBlocks.Count > 0) + { + int index = fCompactToRight ? rowSrc.m_alBlocks.Count - 1 : 0; + DynamicBlock alBlock = (DynamicBlock)rowSrc.m_alBlocks[index]; + if (!MoveBlockToEnd(alReloadContent, alBlock, rowDest, rowSrc, fCompactToRight)) + { + flag = false; + break; + } + } + return flag; + } + + private static bool MoveBlockToEnd( + ArrayList alReloadContent, + DynamicBlock blkMove, + DynamicRow rowDest, + DynamicRow rowSrc, + bool fCompactToRight) + { + int num1 = blkMove.FarEdge - blkMove.NearEdge; + int count = rowDest.m_alBlocks.Count; + int x = 0; + int num2; + if (fCompactToRight) + { + if (count > 0) + x = ((DynamicBlock)rowDest.m_alBlocks[0]).NearEdge; + num2 = x; + } + else + { + if (count > 0) + x = ((DynamicBlock)rowDest.m_alBlocks[count - 1]).FarEdge; + num2 = rowDest.m_sizeRowPxl.Width - x; + } + if (num1 > num2) + return false; + try + { + if (fCompactToRight) + rowDest.m_alBlocks.Insert(0, blkMove); + else + rowDest.m_alBlocks.Add(blkMove); + int index = rowSrc.m_alBlocks.IndexOf(blkMove); + rowSrc.m_alBlocks.RemoveAt(index); + if (fCompactToRight) + x -= num1; + Point ptNewOffsetPxl = new Point(x, rowDest.m_nOffsetYPxl); + blkMove.NotifyRowChanged(alReloadContent, rowDest, rowSrc, ptNewOffsetPxl); + } + finally + { + rowDest.RecomputeAvailable(); + rowSrc.RecomputeAvailable(); + } + return true; + } + + private void RecomputeAvailable() + { + this.m_uLastAvgAge = this.IsEmpty ? 0U : uint.MaxValue; + DynamicPool.RecomputeAvailable(this.m_alBlocks, this.m_sizeRowPxl.Width, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); + } + + [Conditional("DEBUG")] + private void Validate(bool fTightPacking) + { + } + + internal int NotifyPositionChanged(ArrayList alReloadContent, int nNewOffsetYPxl) + { + if (this.m_nOffsetYPxl != nNewOffsetYPxl) + { + this.m_nOffsetYPxl = nNewOffsetYPxl; + for (int index = 0; index < this.m_alBlocks.Count; ++index) + { + DynamicBlock alBlock = (DynamicBlock)this.m_alBlocks[index]; + alBlock.NotifyPositionChanged(alReloadContent, new Point(alBlock.NearEdge, this.m_nOffsetYPxl)); + } + } + return this.m_sizeRowPxl.Height; + } + + internal void NotifyBlockDestroyed(DynamicBlock blkRemove) + { + if (this.m_bktOwner == null) + return; + this.m_alBlocks.RemoveAt(this.m_alBlocks.IndexOf(blkRemove)); + this.RecomputeAvailable(); + if (this.m_nLargestFreePxl != this.m_sizeRowPxl.Width) + return; + this.m_bktOwner.NotifyEmpty(this); + } + + public int ID => 0; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Effect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Effect.cs new file mode 100644 index 0000000..d186a8b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Effect.cs @@ -0,0 +1,548 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Effect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class Effect : + CachedRenderObject, + IEffect, + IAnimatableObject, + IAnimatable, + ISharedRenderObject, + IRenderHandleOwner + { + protected Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect m_remoteEffect; + protected EffectTemplate m_effectTemplate; + protected Vector m_propertyCache; + private static RemoteSurface[] s_EmptySurfaceArray = new RemoteSurface[0]; + + internal Effect(EffectTemplate effectTemplate) + { + this.m_effectTemplate = effectTemplate; + this.m_effectTemplate.RegisterUsage(this); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose) + return; + if (this.m_remoteEffect != null) + this.m_remoteEffect.Dispose(); + if (this.m_propertyCache != null) + { + foreach (EffectProperty effectProperty in this.m_propertyCache) + { + switch (effectProperty.Type) + { + case EffectPropertyType.Image: + this.FreeResource((Image)effectProperty.Value); + break; + case EffectPropertyType.ImageArray: + this.FreeResource((SharedResourceArray)effectProperty.Value); + break; + case EffectPropertyType.Video: + this.FreeResource((VideoStream)effectProperty.Value); + break; + } + effectProperty.Dispose(); + } + } + this.m_effectTemplate.UnregisterUsage(this); + this.m_effectTemplate = null; + this.m_propertyCache = null; + this.m_remoteEffect = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = null; + + internal Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect RemoteStub => this.m_remoteEffect; + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteEffect.RenderHandle; + + public string Name => this.m_effectTemplate.Name; + + public IEffectTemplate Template => m_effectTemplate; + + void IEffect.SetProperty(string stPropertyName, int nValue) => this.SetProperty(stPropertyName, nValue); + + void IEffect.SetProperty(string stPropertyName, float flValue) => this.SetProperty(stPropertyName, flValue); + + void IEffect.SetProperty(string stPropertyName, Vector2 vValue) => this.SetProperty(stPropertyName, vValue); + + void IEffect.SetProperty(string stPropertyName, Vector3 vValue) => this.SetProperty(stPropertyName, vValue); + + void IEffect.SetProperty(string stPropertyName, Vector4 vValue) => this.SetProperty(stPropertyName, vValue); + + void IEffect.SetProperty(string stPropertyName, IImage image) => this.SetProperty(stPropertyName, (Image)image); + + void IEffect.SetProperty(string stPropertyName, IImage[] images) => this.SetProperty(stPropertyName, images); + + void IEffect.SetProperty(string stPropertyName, ColorF color) => this.SetProperty(stPropertyName, color); + + void IEffect.SetProperty(string stPropertyName, IVideoStream videoStream) => this.SetProperty(stPropertyName, videoStream as VideoStream); + + RENDERHANDLE IAnimatableObject.GetObjectId() => this.RemoteStub.RenderHandle; + + uint IAnimatableObject.GetPropertyId(string propertyName) + { + Debug2.Validate(propertyName != null, typeof(ArgumentNullException), nameof(propertyName)); + Map dynamicProperties = this.m_effectTemplate.DynamicProperties; + if (dynamicProperties.ContainsKey(propertyName)) + return this.GenerateAnimationPropertyId(dynamicProperties[propertyName]); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: ", propertyName); + return 0; + } + + AnimationInputType IAnimatableObject.GetPropertyType( + string propertyName) + { + Debug2.Validate(propertyName != null, typeof(ArgumentNullException), nameof(propertyName)); + Map dynamicProperties = this.m_effectTemplate.DynamicProperties; + if (dynamicProperties.ContainsKey(propertyName)) + return this.MapEffectPropertyTypeToAnimationType(dynamicProperties[propertyName]); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: ", propertyName); + return AnimationInputType.Float; + } + + private uint GenerateAnimationPropertyId(EffectProperty effectProperty) + { + uint num1 = 7; + uint num2 = 16777215; + Debug2.Validate((effectProperty.Type & (EffectPropertyType)~(int)num1) == EffectPropertyType.Integer, typeof(ArgumentException), "Unsupported effect property type: {0}", effectProperty.Type); + Debug2.Validate((effectProperty.ID & ~(int)num2) == 0, typeof(ArgumentException), "Only 24-bits of effect property IDs are supported"); + return (uint)(effectProperty.Type & (EffectPropertyType)num1) << 28 | effectProperty.ID & num2; + } + + private AnimationInputType MapEffectPropertyTypeToAnimationType( + EffectProperty effectProperty) + { + AnimationInputType animationInputType; + switch (effectProperty.Type) + { + case EffectPropertyType.Integer: + case EffectPropertyType.Float: + animationInputType = AnimationInputType.Float; + break; + case EffectPropertyType.Vector2: + animationInputType = AnimationInputType.Vector2; + break; + case EffectPropertyType.Vector3: + animationInputType = AnimationInputType.Vector3; + break; + case EffectPropertyType.Vector4: + animationInputType = AnimationInputType.Vector4; + break; + case EffectPropertyType.Color: + animationInputType = AnimationInputType.Vector4; + break; + default: + Debug2.Throw(false, "{0} is not supported as animatable property", effectProperty.Type); + animationInputType = AnimationInputType.Float; + break; + } + return animationInputType; + } + + internal void SetProperty(string stPropertyName, int nValue) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Integer, out effectProperty)) + return; + this.RemoteProperty(effectProperty, nValue); + } + + internal void SetProperty(string stPropertyName, float flValue) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Float, out effectProperty)) + return; + this.RemoteProperty(effectProperty, flValue); + } + + internal void SetProperty(string stPropertyName, Vector2 vValue) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Vector2, out effectProperty)) + return; + this.RemoteProperty(effectProperty, vValue); + } + + internal void SetProperty(string stPropertyName, Vector3 vValue) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Vector3, out effectProperty)) + return; + this.RemoteProperty(effectProperty, vValue); + } + + internal void SetProperty(string stPropertyName, Vector4 vValue) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Vector4, out effectProperty)) + return; + this.RemoteProperty(effectProperty, vValue); + } + + internal void SetProperty(string stPropertyName, ColorF color) + { + EffectProperty effectProperty; + if (!this.IsValidProperty(stPropertyName, EffectPropertyType.Color, out effectProperty)) + return; + this.RemoteProperty(effectProperty, color); + } + + internal virtual void SetProperty(string stPropertyName, Image image) + { + EffectProperty propertyFromCache = this.GetPropertyFromCache(stPropertyName); + Debug2.Validate(propertyFromCache != null, typeof(InvalidOperationException), "Invalid property name"); + Debug2.Validate(propertyFromCache.Type == EffectPropertyType.Image || propertyFromCache.Type == EffectPropertyType.ImageArray, typeof(InvalidOperationException), "Invalid property type"); + if (propertyFromCache.Type == EffectPropertyType.Image) + { + if (propertyFromCache.HasIdenticalValue(image)) + return; + this.SetSharedResourceProperty(propertyFromCache, image); + } + else + { + if (propertyFromCache.Value != null && (Image)((SharedResourceArray)propertyFromCache.Value).Resources[0] == image) + return; + this.SetSharedResourceProperty(propertyFromCache, new SharedResourceArray(image)); + } + } + + internal virtual void SetProperty(string stPropertyName, IImage[] images) + { + Debug2.Validate(images != null, typeof(ArgumentNullException), nameof(images)); + Debug2.Validate(images.Length > 0, typeof(ArgumentException), "images.Length"); + EffectProperty propertyFromCache = this.GetPropertyFromCache(stPropertyName); + Debug2.Validate(propertyFromCache != null, typeof(InvalidOperationException), "Invalid property name"); + Debug2.Validate(propertyFromCache.Type == EffectPropertyType.ImageArray, typeof(InvalidOperationException), "Invalid property type"); + SharedResource[] rgResources = new SharedResource[images.Length]; + for (int index = 0; index < images.Length; ++index) + rgResources[index] = (SharedResource)images[index]; + SharedResourceArray oValue = new SharedResourceArray(rgResources); + oValue.RegisterUsage(this); + if (propertyFromCache.HasIdenticalValue(oValue)) + { + oValue.UnregisterUsage(this); + } + else + { + this.SetSharedResourceProperty(propertyFromCache, oValue); + oValue.UnregisterUsage(this); + } + } + + internal void SetProperty(string stPropertyName, VideoStream videoStream) + { + Debug2.Validate(videoStream != null, typeof(ArgumentNullException), "VideoStream"); + Debug2.Validate(videoStream.Surface != null, typeof(ArgumentException), "VideoStream.Surface"); + EffectProperty propertyFromCache = this.GetPropertyFromCache(stPropertyName); + Debug2.Validate(propertyFromCache != null, typeof(InvalidOperationException), "Invalid property name"); + Debug2.Validate(propertyFromCache.Type == EffectPropertyType.Video, typeof(InvalidOperationException), "Invalid property type"); + if (propertyFromCache.HasIdenticalValue(videoStream)) + return; + this.SetSharedResourceProperty(propertyFromCache, videoStream); + } + + private bool IsValidProperty( + string stPropertyName, + EffectPropertyType type, + out EffectProperty effectProperty) + { + EffectProperty dynamicProperty = this.m_effectTemplate.DynamicProperties[stPropertyName]; + Debug2.Validate(dynamicProperty != null, typeof(InvalidOperationException), "Invalid property name"); + Debug2.Validate(dynamicProperty.Type == type, typeof(InvalidOperationException), "Invalid property type"); + effectProperty = dynamicProperty; + return true; + } + + private void SetSharedResourceProperty(EffectProperty property, SharedResourceArray oValue) + { + Debug2.Validate(property.Type == EffectPropertyType.ImageArray || property.Type == EffectPropertyType.Image, typeof(InvalidOperationException), "Not an Image type"); + this.FreeResource(property.Value as SharedResourceArray); + property.Value = oValue; + this.AcquireNewResource(oValue); + this.RemoteProperty(property, oValue); + } + + private void SetSharedResourceProperty(EffectProperty property, Image oValue) + { + Debug2.Validate(property.Type == EffectPropertyType.Image, typeof(InvalidOperationException), "Not an Image type"); + this.FreeResource(property.Value as Image); + property.Value = oValue; + this.AcquireNewResource(oValue); + this.RemoteProperty(property, oValue); + } + + private void SetSharedResourceProperty(EffectProperty property, VideoStream oValue) + { + Debug2.Validate(property.Type == EffectPropertyType.Video, typeof(InvalidOperationException), "Not a Video type"); + this.FreeResource(property.Value as VideoStream); + property.Value = oValue; + this.AcquireNewResource(oValue); + this.RemoteProperty(property, oValue); + } + + private EffectProperty GetPropertyFromCache(string propertyName) + { + Map dynamicProperties = this.m_effectTemplate.DynamicProperties; + if (!dynamicProperties.ContainsKey(propertyName)) + Debug2.Validate(false, typeof(InvalidOperationException), "Invalid property name", propertyName); + EffectProperty effectProperty = dynamicProperties[propertyName]; + Debug2.Validate(effectProperty.IsSharedResource, typeof(InvalidOperationException), "Invalid property type"); + return this.GetPropertyFromCache(effectProperty.ID); + } + + private EffectProperty GetPropertyFromCache(int nPropertyId) + { + foreach (EffectProperty effectProperty in this.m_propertyCache) + { + if (effectProperty.ID == nPropertyId) + return effectProperty; + } + return null; + } + + private void RemoteProperty(EffectProperty property, object oValue) + { + switch (property.Type) + { + case EffectPropertyType.Integer: + this.m_remoteEffect.SendSetProperty(property.ID, (int)oValue); + break; + case EffectPropertyType.Float: + this.m_remoteEffect.SendSetProperty(property.ID, (float)oValue); + break; + case EffectPropertyType.Vector2: + this.m_remoteEffect.SendSetProperty(property.ID, (Vector2)oValue); + break; + case EffectPropertyType.Vector3: + this.m_remoteEffect.SendSetProperty(property.ID, (Vector3)oValue); + break; + case EffectPropertyType.Vector4: + this.m_remoteEffect.SendSetProperty(property.ID, (Vector4)oValue); + break; + case EffectPropertyType.Image: + Image image = (Image)oValue; + RemoteSurface surface1 = null; + if (image != null && image.Surface != null) + surface1 = image.Surface.RemoteStub; + this.m_remoteEffect.SendSetProperty(property.ID, surface1); + break; + case EffectPropertyType.Color: + this.m_remoteEffect.SendSetProperty(property.ID, ((ColorF)oValue).ToVector4()); + break; + case EffectPropertyType.ImageArray: + SharedResource[] resources = ((SharedResourceArray)oValue).Resources; + RemoteSurface[] surfaceArray = new RemoteSurface[resources.Length]; + bool flag = true; + for (int index = 0; index < resources.Length; ++index) + { + if (resources[index] == null || ((Image)resources[index]).Surface == null) + { + flag = false; + break; + } + surfaceArray[index] = ((Image)resources[index]).Surface.RemoteStub; + } + if (flag) + { + this.m_remoteEffect.SendSetProperty(property.ID, surfaceArray); + break; + } + this.m_remoteEffect.SendSetProperty(property.ID, s_EmptySurfaceArray); + break; + case EffectPropertyType.Video: + VideoStream videoStream = (VideoStream)oValue; + RemoteSurface surface2 = null; + if (videoStream != null && videoStream.Surface != null) + surface2 = videoStream.Surface.RemoteStub; + this.m_remoteEffect.SendSetProperty(property.ID, surface2); + break; + default: + Debug2.Throw(false, "Unknown property type"); + break; + } + } + + private void RemoteProperty(EffectProperty property, float flValue) => this.m_remoteEffect.SendSetProperty(property.ID, flValue); + + private void RemoteProperty(EffectProperty property, int nValue) => this.m_remoteEffect.SendSetProperty(property.ID, nValue); + + private void RemoteProperty(EffectProperty property, Vector2 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); + + private void RemoteProperty(EffectProperty property, Vector3 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); + + private void RemoteProperty(EffectProperty property, Vector4 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); + + private void RemoteProperty(EffectProperty property, ColorF color) => this.m_remoteEffect.SendSetProperty(property.ID, color.ToVector4()); + + private void AddSharedResourcesToCache() + { + foreach (EffectProperty property in this.m_effectTemplate.DynamicProperties.Values) + { + switch (property.Type) + { + case EffectPropertyType.Image: + this.AcquireNewResource(property.Value as Image); + this.AddPropertyToCache(property); + continue; + case EffectPropertyType.ImageArray: + this.AcquireNewResource(property.Value as SharedResourceArray); + this.AddPropertyToCache(property); + continue; + case EffectPropertyType.Video: + this.AcquireNewResource(property.Value as VideoStream); + this.AddPropertyToCache(property); + continue; + default: + continue; + } + } + } + + private void AddPropertyToCache(EffectProperty property) + { + if (this.m_propertyCache == null) + this.m_propertyCache = new Vector(3); + this.m_propertyCache.Add(property.Clone()); + } + + protected void Initialize() + { + Debug2.Validate(this.m_propertyCache == null, typeof(InvalidOperationException), "Initialize() should be called once"); + this.AddSharedResourcesToCache(); + if (this.m_propertyCache != null) + this.m_propertyCache.TrimExcess(); + this.CommitTemplateDefaults(false); + } + + private void CommitTemplateDefaults(bool fUpdateCache) + { + foreach (EffectProperty property in this.m_effectTemplate.DynamicProperties.Values) + { + if (fUpdateCache && property.IsSharedResource) + { + EffectProperty propertyFromCache = this.GetPropertyFromCache(property.ID); + switch (property.Type) + { + case EffectPropertyType.Image: + this.SetSharedResourceProperty(propertyFromCache, (Image)property.Value); + break; + case EffectPropertyType.ImageArray: + this.SetSharedResourceProperty(propertyFromCache, (SharedResourceArray)property.Value); + break; + case EffectPropertyType.Video: + this.SetSharedResourceProperty(propertyFromCache, (VideoStream)property.Value); + break; + } + } + this.RemoteProperty(property, property.Value); + } + } + + private void AcquireNewResource(Image image) + { + if (image == null) + return; + image.RegisterUsage(this); + image.ContentReloadedEvent += new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); + image.AddActiveUser(this); + } + + private void AcquireNewResource(SharedResourceArray imageArray) + { + if (imageArray == null) + return; + imageArray.RegisterUsage(this); + foreach (SharedResource resource in imageArray.Resources) + (resource as Image).ContentReloadedEvent += new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); + imageArray.AddActiveUser(this); + } + + private void AcquireNewResource(VideoStream videoStream) + { + if (videoStream == null) + return; + videoStream.RegisterUsage(this); + videoStream.AddActiveUser(this); + } + + internal void FreeResource(Image image) + { + if (image == null) + return; + image.ContentReloadedEvent -= new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); + image.RemoveActiveUser(this); + image.UnregisterUsage(this); + } + + internal void FreeResource(SharedResourceArray imageArray) + { + if (imageArray == null) + return; + foreach (SharedResource resource in imageArray.Resources) + (resource as Image).ContentReloadedEvent -= new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); + imageArray.RemoveActiveUser(this); + imageArray.UnregisterUsage(this); + } + + internal void FreeResource(VideoStream videoStream) + { + if (videoStream == null) + return; + videoStream.RemoveActiveUser(this); + videoStream.UnregisterUsage(this); + } + + internal void ImageContentReloadedHandler(Image image) + { + bool condition = false; + foreach (EffectProperty property in this.m_propertyCache) + { + if (property.Type == EffectPropertyType.Image) + { + if ((Image)property.Value == image) + { + condition = true; + this.RemoteProperty(property, property.Value); + } + } + else if (property.Type == EffectPropertyType.ImageArray) + { + SharedResource[] resources = ((SharedResourceArray)property.Value).Resources; + for (int index = 0; index < resources.Length; ++index) + { + if (resources[index] != null && (Image)resources[index] == image) + { + condition = true; + this.RemoteProperty(property, property.Value); + } + } + } + } + Debug2.Validate(condition, typeof(ArgumentException), "Could not find an Image property"); + } + + internal abstract void RemoteEffect(); + + internal override void Reset() => this.CommitTemplateDefaults(true); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectProperty.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectProperty.cs new file mode 100644 index 0000000..dad7df2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectProperty.cs @@ -0,0 +1,142 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.EffectProperty +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class EffectProperty : RenderObject + { + private const byte k_dynamicFlag = 128; + private byte m_nID; + private object m_oValue; + private byte m_propertyType; + + internal EffectProperty( + string stName, + EffectPropertyType eptType, + bool fIsDynamic, + object oValue, + byte nID) + { + this.m_propertyType = (byte)eptType; + this.IsDynamic = fIsDynamic; + this.m_nID = nID; + this.Value = oValue; + } + + private EffectProperty(EffectProperty copy) + { + this.m_propertyType = copy.m_propertyType; + this.IsDynamic = copy.IsDynamic; + this.m_nID = copy.m_nID; + this.Value = copy.Value; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose || this.m_oValue == null) + return; + this.ModifyUsage(false); + this.m_oValue = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal object Value + { + get => this.m_oValue; + set + { + this.ModifyUsage(false); + this.m_oValue = value; + this.ModifyUsage(true); + } + } + + internal bool IsDynamic + { + get => (m_propertyType & 128) == 128; + set + { + if (value) + this.m_propertyType |= 128; + else + this.m_propertyType &= 127; + } + } + + internal bool IsSharedResource => this.Type == EffectPropertyType.Image || this.Type == EffectPropertyType.ImageArray || this.Type == EffectPropertyType.Video; + + internal EffectPropertyType Type => (EffectPropertyType)(m_propertyType & 4294967167U); + + internal byte ID + { + get => this.m_nID; + set => this.m_nID = value; + } + + internal bool HasIdenticalValue(object oValue) + { + switch (this.Type) + { + case EffectPropertyType.Integer: + return (int)this.Value == (int)oValue; + case EffectPropertyType.Float: + return !Math2.WithinEpsilon((float)this.Value, (float)oValue); + case EffectPropertyType.Vector2: + return (Vector2)this.Value == (Vector2)oValue; + case EffectPropertyType.Vector3: + return (Vector3)this.Value == (Vector3)oValue; + case EffectPropertyType.Vector4: + return (Vector4)this.Value == (Vector4)oValue; + case EffectPropertyType.Image: + return (Image)this.Value == (Image)oValue; + case EffectPropertyType.Color: + return (ColorF)this.Value == (ColorF)oValue; + case EffectPropertyType.ImageArray: + SharedResource[] resources1 = ((SharedResourceArray)oValue).Resources; + SharedResource[] resources2 = ((SharedResourceArray)this.Value).Resources; + if (resources1.Length != resources1.Length) + return false; + for (int index = 0; index < resources2.Length; ++index) + { + if (resources2[index] != resources1[index]) + return false; + } + return true; + case EffectPropertyType.Video: + return (VideoStream)this.Value == (VideoStream)oValue; + default: + return false; + } + } + + internal EffectProperty Clone() => new EffectProperty(this); + + private void ModifyUsage(bool fLock) + { + if (this.m_oValue == null || !(this.m_oValue is SharedResource oValue)) + return; + if (fLock) + { + oValue.RegisterUsage(this); + oValue.AddActiveUser(this); + } + else + { + oValue.RemoveActiveUser(this); + oValue.UnregisterUsage(this); + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectPropertyType.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectPropertyType.cs new file mode 100644 index 0000000..8410354 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectPropertyType.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.EffectPropertyType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum EffectPropertyType : byte + { + Integer, + Float, + Vector2, + Vector3, + Vector4, + Image, + Color, + ImageArray, + Video, + Byte, + Max, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectRequirements.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectRequirements.cs new file mode 100644 index 0000000..0fe5041 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectRequirements.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.EffectRequirements +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + [Flags] + internal enum EffectRequirements + { + ViewPosition = 1, + ValidMask = ViewPosition, // 0x00000001 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectTemplate.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectTemplate.cs new file mode 100644 index 0000000..3b52170 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/EffectTemplate.cs @@ -0,0 +1,138 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.EffectTemplate +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class EffectTemplate : SharedRenderObject, IEffectTemplate, ISharedRenderObject + { + protected string m_stName; + protected GraphicsDevice m_graphicsDevice; + protected RenderSession m_session; + protected Map m_dynamicProperties; + protected bool m_fBuilt; + protected ObjectCache m_cache; + private bool m_fReleasingCache; + + internal EffectTemplate(RenderSession session, GraphicsDevice device, string stName) + { + this.m_dynamicProperties = new Map(10); + this.m_graphicsDevice = device; + this.m_session = session; + this.m_fBuilt = false; + this.m_stName = stName; + ObjectCacheManager cacheManager = session.CacheManager; + if (cacheManager == null) + return; + this.m_cache = new ObjectCache(100, 300, 100); + this.m_cache.DebugDescription = stName; + cacheManager.RegisterCache(this.m_cache); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose) + return; + if (this.m_dynamicProperties != null) + { + foreach (KeyValueEntry dynamicProperty in this.m_dynamicProperties) + { + EffectProperty effectProperty = dynamicProperty.Value; + if (effectProperty != null && effectProperty.Value != null && effectProperty.IsSharedResource) + ((SharedRenderObject)effectProperty.Value).UnregisterUsage(this); + effectProperty.Dispose(); + } + this.m_dynamicProperties = null; + } + if (this.m_cache == null) + return; + this.m_session.CacheManager.UnregisterCache(this.m_cache); + this.m_cache.Dispose(); + this.m_cache = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal override void UnregisterUsage(object objUser) + { + if (!this.m_fReleasingCache && this.m_cache != null && this.UsageCount == this.m_cache.Size + 1) + { + this.m_fReleasingCache = true; + this.m_cache.RemoveAll(); + this.m_fReleasingCache = false; + } + base.UnregisterUsage(objUser); + } + + internal GraphicsDevice Device => this.m_graphicsDevice; + + internal RenderSession Session => this.m_session; + + internal Map DynamicProperties => this.m_dynamicProperties; + + public bool IsBuilt => this.m_fBuilt; + + public string Name => this.m_stName; + + void IEffectTemplate.AddEffectProperty(string stProp) => this.m_dynamicProperties.Add(stProp, null); + + bool IEffectTemplate.Build(EffectInput input) + { + Debug2.Validate(input != null, typeof(ArgumentNullException), "IEffectTemplate.Build null argument"); + Debug2.Validate(!this.m_fBuilt, typeof(ArgumentNullException), "IEffectTemplate.Build called twice"); + if (!this.MeetQualityBar(input)) + { + this.ResetInternalState(); + return false; + } + if (!this.Build(input)) + { + this.ResetInternalState(); + return false; + } + foreach (KeyValueEntry dynamicProperty in this.m_dynamicProperties) + { + EffectProperty effectProperty = dynamicProperty.Value; + if (effectProperty != null && effectProperty.Value != null && effectProperty.IsSharedResource) + ((SharedRenderObject)effectProperty.Value).RegisterUsage(this); + } + this.m_fBuilt = true; + return true; + } + + protected virtual void ResetInternalState() + { + foreach (KeyValueEntry dynamicProperty in this.m_dynamicProperties) + dynamicProperty.Value?.Dispose(); + this.m_dynamicProperties.Clear(); + this.m_fBuilt = false; + } + + protected bool GenerateProperties( + EffectInput input, + Map dictionary, + out int nPropCacheSize) + { + byte nNextUniqueID = 0; + nPropCacheSize = input.PreProcessProperties(dictionary, ref nNextUniqueID); + return input.Process(dictionary); + } + + private bool MeetQualityBar(EffectInput input) => this.m_graphicsDevice.RenderingQuality != GraphicsRenderingQuality.MinQuality || input.Type == EffectInputType.Color || (input.Type == EffectInputType.Image || input.Type == EffectInputType.Video); + + protected abstract bool Build(EffectInput element); + + public abstract IEffect CreateInstance(object objUser); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffect.cs new file mode 100644 index 0000000..d968c25 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffect.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.GdiEffect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class GdiEffect : Effect + { + internal GdiEffect(GdiEffectTemplate effectTemplate) + : base(effectTemplate) + => this.m_remoteEffect = this.m_effectTemplate.Session.BuildRemoteGdiEffect(this); + + internal override void RemoteEffect() + { + ((RemoteGdiEffect)this.m_remoteEffect).SendSetType((int)((GdiEffectTemplate)this.m_effectTemplate).Type); + this.Initialize(); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs new file mode 100644 index 0000000..02be347 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs @@ -0,0 +1,80 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.GdiEffectTemplate +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class GdiEffectTemplate : EffectTemplate + { + private GdiEffectType m_type; + + internal GdiEffectTemplate(RenderSession session, GraphicsDevice device, string stName) + : base(session, device, stName) + => this.m_type = GdiEffectType.None; + + internal GdiEffectType Type => this.m_type; + + public override IEffect CreateInstance(object objUser) + { + Debug2.Validate(this.m_fBuilt, typeof(InvalidOperationException), "Cannot create instance if the template is not built"); + GdiEffect gdiEffect = null; + if (this.m_cache != null) + gdiEffect = (GdiEffect)this.m_cache.Remove(objUser); + if (gdiEffect == null) + { + gdiEffect = new GdiEffect(this); + gdiEffect.Cache = this.m_cache; + gdiEffect.RegisterUsage(objUser); + gdiEffect.RemoteEffect(); + } + return gdiEffect; + } + + protected override bool Build(EffectInput input) + { + if (!this.ProcessEffectElement(input)) + return false; + int nPropCacheSize = 0; + if (!this.GenerateProperties(input, this.m_dynamicProperties, out nPropCacheSize)) + return false; + Map.Enumerator enumerator = this.m_dynamicProperties.GetEnumerator(); + while (enumerator.MoveNext()) + { + EffectProperty effectProperty = enumerator.Current.Value; + if (effectProperty == null || !effectProperty.IsDynamic) + { + this.m_dynamicProperties.Remove(enumerator.Current.Key); + enumerator = this.m_dynamicProperties.GetEnumerator(); + } + } + return true; + } + + private bool ProcessEffectElement(EffectInput element) + { + switch (element.Type) + { + case EffectInputType.Color: + this.m_type = GdiEffectType.LoadColor; + return true; + case EffectInputType.Image: + this.m_type = GdiEffectType.LoadImage; + return true; + default: + return false; + } + } + + protected override void ResetInternalState() + { + base.ResetInternalState(); + this.m_type = GdiEffectType.None; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectType.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectType.cs new file mode 100644 index 0000000..e6ec4ff --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiEffectType.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.GdiEffectType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum GdiEffectType : byte + { + LoadColor, + LoadImage, + None, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs new file mode 100644 index 0000000..a3e512a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs @@ -0,0 +1,183 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.GdiGraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class GdiGraphicsDevice : GraphicsDevice, IRenderHandleOwner + { + private RemoteGdiDevice m_remoteDevice; + private bool m_fAllowAlpha; + private bool m_fAllowAnimations; + private bool m_fEnableBackBuffer; + private bool m_fSystemMemoryBitmaps; + private ColorF m_clrBackground; + private bool m_fEnableAlphaTracking; + private VideoZoomMode m_vzmZoomMode; + private bool m_fSecureDesktopMode; + + internal GdiGraphicsDevice(RenderSession session) + : base(session, "Gdi") + { + this.m_remoteDevice = session.BuildRemoteGdiDevice(this); + this.m_fAllowAlpha = true; + this.m_fAllowAnimations = true; + this.m_fEnableBackBuffer = true; + this.m_fSystemMemoryBitmaps = false; + this.m_clrBackground = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); + this.m_deviceType = GraphicsDeviceType.Gdi; + this.m_graphicsCaps = session.GetGraphicsCaps(this.m_deviceType); + this.m_renderingQuality = GraphicsRenderingQuality.MinQuality; + } + + protected override void Dispose(bool fInDispose) + { + if (fInDispose && this.m_remoteDevice != null) + this.m_remoteDevice.Dispose(); + this.m_remoteDevice = null; + base.Dispose(fInDispose); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; + + public override bool IsVideoComposited => false; + + internal override RemoteDevice RemoteDevice => m_remoteDevice; + + public override bool CanPlayAnimations => this.AllowAnimations; + + public bool AllowAlpha + { + get => this.m_fAllowAlpha; + set + { + if (this.m_fAllowAlpha == value) + return; + this.m_remoteDevice.SendSetAllowAlpha(value); + this.m_fAllowAlpha = value; + } + } + + public bool AllowAnimations + { + get => this.m_fAllowAnimations; + set + { + if (this.m_fAllowAnimations == value) + return; + this.m_remoteDevice.SendSetAllowAnimations(value); + this.m_fAllowAnimations = value; + } + } + + public bool EnableBackBuffer + { + get => this.m_fEnableBackBuffer; + set + { + if (value == this.m_fEnableBackBuffer) + return; + this.m_remoteDevice.SendSetEnableBackBuffer(value); + this.m_fEnableBackBuffer = value; + } + } + + public bool EnableAlphaTracking + { + get => this.m_fEnableAlphaTracking; + set + { + if (value == this.m_fEnableAlphaTracking) + return; + this.m_remoteDevice.SendSetEnableAlphaTracking(value); + this.m_fEnableAlphaTracking = value; + } + } + + public VideoZoomMode ZoomMode + { + get => this.m_vzmZoomMode; + set + { + if (value == this.m_vzmZoomMode) + return; + this.m_remoteDevice.SendSetZoomMode(value); + this.m_vzmZoomMode = value; + } + } + + public bool SystemMemoryBitmaps + { + get => this.m_fSystemMemoryBitmaps; + set + { + if (value == this.m_fSystemMemoryBitmaps) + return; + this.m_remoteDevice.SendSetUseSystemMemoryBitmaps(value); + this.m_fSystemMemoryBitmaps = value; + } + } + + public ColorF BackgroundColor + { + get => this.m_clrBackground; + set + { + if (!(value != this.m_clrBackground)) + return; + this.m_remoteDevice.SendSetBackgroundColor(value); + this.m_clrBackground = value; + } + } + + internal bool SecureDesktopMode + { + get => this.m_fSecureDesktopMode; + set + { + if (value == this.m_fSecureDesktopMode) + return; + this.m_remoteDevice.SendSecureDesktopMode(value); + this.m_fSecureDesktopMode = value; + } + } + + internal override bool IsSurfaceFormatSupported(SurfaceFormat nFormat) + { + switch (nFormat) + { + case SurfaceFormat.RGB24: + case SurfaceFormat.RGB32: + case SurfaceFormat.ARGB32: + return true; + case SurfaceFormat.External: + return false; + default: + return false; + } + } + + protected override void CreateSurfacePoolWorker( + object oSurfacePool, + object oHandle, + SurfaceFormat nFormat) + { + this.m_remoteDevice.SendCreateSurfacePool((RENDERHANDLE)oHandle, nFormat); + } + + protected override void RestartRendering(uint nRenderGeneration) => this.m_remoteDevice.SendRestart(nRenderGeneration); + + public override bool CanPlayAnimationType(AnimationInputType type) => false; + + internal override EffectTemplate CreateEffectTemplate(string stName) => new GdiEffectTemplate(this.m_session, this, stName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Gradient.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Gradient.cs new file mode 100644 index 0000000..c0800a0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Gradient.cs @@ -0,0 +1,115 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Gradient +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Gradient : SharedRenderObject, IGradient, ISharedRenderObject, IRenderHandleOwner + { + private RemoteGradient m_remoteGradient; + private Orientation m_orientation; + private ColorF m_colorMask; + private float m_flOffset; + + internal Gradient(RenderSession session, RemoteDevice remoteDevice) + { + Debug2.Validate(session != null, typeof(ArgumentNullException), "Must have valid RenderSession"); + session.AssertOwningThread(); + Debug2.Validate(remoteDevice != null, typeof(ArgumentNullException), "Must have a valid remoteDevice in-param"); + RenderPort renderingPort = session.RenderingPort; + RENDERHANDLE renderhandle = renderingPort.AllocHandle(this); + try + { + remoteDevice.SendCreateGradient(renderhandle); + this.m_remoteGradient = RemoteGradient.CreateFromHandle(renderingPort, renderhandle); + } + finally + { + if (this.m_remoteGradient != null && !this.m_remoteGradient.IsValid) + renderingPort.FreeHandle(renderhandle); + } + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_remoteGradient != null) + this.m_remoteGradient.Dispose(); + this.m_remoteGradient = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + Orientation IGradient.Orientation + { + get => this.m_orientation; + set + { + if (this.m_orientation == value) + return; + this.m_orientation = value; + this.m_remoteGradient.SendSetOrientation(this.m_orientation); + } + } + + ColorF IGradient.ColorMask + { + get => this.m_colorMask; + set + { + if (!(this.m_colorMask != value)) + return; + this.m_colorMask = value; + this.m_remoteGradient.SendSetColorMask(this.m_colorMask); + } + } + + float IGradient.Offset + { + get => this.m_flOffset; + set + { + if (m_flOffset == (double)value) + return; + this.m_flOffset = value; + this.m_remoteGradient.SendSetOffset(this.m_flOffset); + } + } + + void IGradient.AddValue(float flPosition, float flValue, RelativeSpace rsSpace) => this.m_remoteGradient.SendAddValue(flValue, flPosition, rsSpace); + + void IGradient.Clear() => this.m_remoteGradient.SendClear(); + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteGradient.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteGradient = null; + + internal RemoteGradient RemoteGradient => this.m_remoteGradient; + + internal struct GradientSample + { + public float position; + public float value; + public RelativeSpace relSpace; + + internal GradientSample(float pos, float val, RelativeSpace rs) + { + this.position = pos; + this.value = val; + this.relSpace = rs; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs new file mode 100644 index 0000000..912f629 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs @@ -0,0 +1,255 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.GraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class GraphicsDevice : RenderObject, IGraphicsDevice, IDeviceCallback + { + protected RenderSession m_session; + private string m_stDisplayName; + private SurfaceManager m_manSurfaces; + private ObjectTracker m_trackerSurfacePools; + private ObjectTracker m_trackerWindows; + private uint m_cRenderGeneration; + private readonly DeferredHandler m_cbRestartRenderer; + private bool m_fQueuedRestart; + private bool m_fCreated; + private bool m_fAllowDynamicPool; + private bool m_fInVsaBlock; + protected GraphicsCaps m_graphicsCaps; + protected GraphicsDeviceType m_deviceType; + protected GraphicsRenderingQuality m_renderingQuality; + private readonly DeferredHandler m_cbTrackerUpdate; + private bool m_fQueuedTrackerUpdate; + protected Size m_sizeGutterPxl; + private static readonly TrackerBase.ObjectTest s_testUnused = new TrackerBase.ObjectTest(TestIsUnused); + private bool m_fBeginCaptureBackBuffer; + private bool m_fEndCaptureBackBuffer; + + internal GraphicsDevice(RenderSession session, string stDisplayName) + { + this.m_session = session; + this.m_stDisplayName = stDisplayName; + this.m_trackerSurfacePools = new ObjectTracker(session, this); + this.m_trackerWindows = new ObjectTracker(session, this); + this.m_cRenderGeneration = 1U; + this.m_cbRestartRenderer = new DeferredHandler(this.OnRestartRenderer); + this.m_cbTrackerUpdate = new DeferredHandler(this.OnTrackerUpdate); + } + + public virtual void PostCreate() => this.m_manSurfaces = new SurfaceManager(this, this.m_session); + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + this.m_session.AssertOwningThread(); + if (this.m_manSurfaces != null) + this.m_manSurfaces.Dispose(); + if (this.m_trackerSurfacePools != null) + this.m_trackerSurfacePools.Dispose(); + if (this.m_trackerWindows != null) + this.m_trackerWindows.Dispose(); + } + this.m_trackerWindows = null; + this.m_trackerSurfacePools = null; + this.m_manSurfaces = null; + this.m_session = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + GraphicsDeviceType IGraphicsDevice.DeviceType => this.m_deviceType; + + Size IGraphicsDevice.MaximumImageSize => new Size(this.m_graphicsCaps.MaxTextureWidth, this.m_graphicsCaps.MaxTextureHeight); + + internal RenderSession Session => this.m_session; + + public string DisplayName => this.m_stDisplayName; + + internal SurfaceManager SurfaceManager => this.m_manSurfaces; + + public abstract bool IsVideoComposited { get; } + + public GraphicsRenderingQuality RenderingQuality => this.m_renderingQuality; + + public abstract bool CanPlayAnimations { get; } + + public bool InVsaBlock => this.m_fInVsaBlock; + + internal bool AllowDynamicPool => this.m_fAllowDynamicPool; + + internal abstract RemoteDevice RemoteDevice { get; } + + internal GraphicsCaps GraphicsCaps => this.m_graphicsCaps; + + internal abstract bool IsSurfaceFormatSupported(SurfaceFormat nFormat); + + internal void CreateSurfacePool(SurfacePool spNew, RENDERHANDLE handle, SurfaceFormat nFormat) + { + this.CreateSurfacePoolWorker(spNew, handle, nFormat); + this.m_trackerSurfacePools.AddObject(spNew); + } + + internal void OnSurfacePoolDispose() + { + if (this.m_fQueuedTrackerUpdate) + return; + this.m_session.DeferredInvoke(m_cbTrackerUpdate, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 10)); + this.m_fQueuedTrackerUpdate = true; + } + + private void OnTrackerUpdate(object args) + { + this.m_trackerSurfacePools.RemoveObjects(s_testUnused); + this.m_fQueuedTrackerUpdate = false; + } + + private static bool TestIsUnused(object objSubject, object objParam) => ((SurfacePool)objSubject).RemoteStub == null; + + public void AllocateSurfacePool(int nPoolID, SurfaceFormat nFormat, Size sizeStoragePxl) => this.m_manSurfaces.AllocateNamedSurface(nPoolID, nFormat, sizeStoragePxl); + + public void FreeSurfacePool(int nPoolID) => this.m_manSurfaces.FreeNamedSurface(nPoolID); + + protected abstract void CreateSurfacePoolWorker( + object oSurfacePool, + object oHandle, + SurfaceFormat nFormat); + + internal void CreateVideoPool(VideoPool spNew, RENDERHANDLE handle) + { + this.CreateVideoPoolWorker(spNew, handle); + this.m_trackerSurfacePools.AddObject(spNew); + } + + internal virtual void CreateVideoPoolWorker(object oSurfacePool, object oHandle) => Debug2.Validate(false, null, "GraphicsDevice type does not support Video Pool"); + + internal void RegisterWindow(RenderWindow win) => this.m_trackerWindows.AddObject(win); + + public virtual bool CanPlayAnimationType(AnimationInputType type) => false; + + internal SurfaceManager.VideoMemoryBreakdown ComputeBreakdown() => (SurfaceManager.VideoMemoryBreakdown)this.InternalComputeBreakdown(); + + internal abstract EffectTemplate CreateEffectTemplate(string stName); + + internal Image CreateImage(string identifier, ContentNotifyHandler handler) => new Image(this.m_session, this.m_manSurfaces, identifier, handler, this.m_sizeGutterPxl); + + protected virtual object InternalComputeBreakdown() => new SurfaceManager.VideoMemoryBreakdown(); + + private void RestoreAllSurfaces() + { + this.m_session.AssertOwningThread(); + foreach (SurfacePool liveObject in this.m_trackerSurfacePools.LiveObjects) + liveObject.Restore(); + } + + protected abstract void RestartRendering(uint nRenderGeneration); + + void IDeviceCallback.OnCreated(RENDERHANDLE target, bool fAllowDynamicPool) + { + this.m_fCreated = true; + this.m_fAllowDynamicPool = fAllowDynamicPool; + } + + void IDeviceCallback.OnLostDevice( + RENDERHANDLE target, + uint cRenderGeneration, + bool fLost) + { + if (fLost) + { + this.m_cRenderGeneration = cRenderGeneration; + } + else + { + this.ResetDeviceContent(); + if (this.m_fQueuedRestart) + return; + this.m_session.DeferredInvoke(m_cbRestartRenderer, null, DeferredInvokePriority.Low); + this.m_fQueuedRestart = true; + } + } + + internal virtual void ResetDeviceContent() + { + if (this.m_manSurfaces != null) + this.m_manSurfaces.CollectDeadSurfaces(); + this.RestoreAllSurfaces(); + } + + void IDeviceCallback.OnVsaBlock(RENDERHANDLE target, bool fInBlock) => this.m_fInVsaBlock = fInBlock; + + void IDeviceCallback.OnSurfacePoolAllocation( + RENDERHANDLE target, + RENDERHANDLE idSurfacePool, + SurfacePoolAllocationResult nResult) + { + IRenderHandleOwner handleOwner = this.Session.RenderingPort.TryGetHandleOwner(idSurfacePool); + if (handleOwner == null) + return; + if (handleOwner is SurfacePool surfacePool) + surfacePool.NotifyAllocation(nResult); + else + Debug2.Throw(false, "invalid surface pool owner"); + } + + private void OnRestartRenderer(object arg) + { + this.RestartRendering(this.m_cRenderGeneration); + this.m_fQueuedRestart = false; + } + + public virtual void RenderNowIfPossible() + { + } + + public void BeginCaptureBackBuffer(string stFileName) + { + Debug2.Validate(!this.m_fBeginCaptureBackBuffer, typeof(InvalidOperationException), "BeginCaptureBackBuffer() called but m_fBeginCaptureBackBuffer = true"); + Debug2.Validate(!this.m_fEndCaptureBackBuffer, typeof(InvalidOperationException), "EndCaptureBackBuffer() called but m_fEndCaptureBackBuffer = true"); + this.m_fBeginCaptureBackBuffer = true; + this.RemoteDevice.SendBeginCaptureBackBuffer(stFileName); + } + + public void EndCaptureBackBuffer() + { + Debug2.Validate(this.m_fBeginCaptureBackBuffer, typeof(InvalidOperationException), "BeginCaptureBackBuffer() called but m_fBeginCaptureBackBuffer = false"); + Debug2.Validate(!this.m_fEndCaptureBackBuffer, typeof(InvalidOperationException), "EndCaptureBackBuffer() called but m_fEndCaptureBackBuffer = true"); + this.m_session.DeferredInvoke(new DeferredHandler(this.DeferredEndCaptureBackBuffer), null, DeferredInvokePriority.VisualUpdate); + } + + private void DeferredEndCaptureBackBuffer(object args) + { + Debug2.Validate(this.m_fBeginCaptureBackBuffer, typeof(InvalidOperationException), "DeferredEndCaptureBackBuffer() called but m_fBeginCaptureBackBuffer = false"); + Debug2.Validate(!this.m_fEndCaptureBackBuffer, typeof(InvalidOperationException), "DeferredEndCaptureBackBuffer() called but m_fEndCaptureBackBuffer = true"); + this.m_fEndCaptureBackBuffer = true; + this.RemoteDevice.SendEndCaptureBackBuffer(); + } + + void IDeviceCallback.OnBackBufferCaptured(RENDERHANDLE target) + { + Debug2.Validate(this.BackBufferCapturedEvent != null, typeof(InvalidOperationException), "No event handler registered: BackBufferCapturedEvent = null"); + this.m_fBeginCaptureBackBuffer = false; + this.m_fEndCaptureBackBuffer = false; + this.BackBufferCapturedEvent(); + } + + public void TriggerDeviceReset() => this.RemoteDevice.SendTriggerDeviceReset(); + + public event BackBufferCapturedHandler BackBufferCapturedEvent; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IDynamicBlock.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IDynamicBlock.cs new file mode 100644 index 0000000..7ac5db8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IDynamicBlock.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.IDynamicBlock +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal interface IDynamicBlock + { + int NearEdge { get; } + + int FarEdge { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ISurfaceContentOwner.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ISurfaceContentOwner.cs new file mode 100644 index 0000000..8714cd1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ISurfaceContentOwner.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.ISurfaceContentOwner +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal interface ISurfaceContentOwner + { + void OnSurfaceDisposed(Surface surface); + + void OnRestoreContent(Surface surface); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ITreeOwner.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ITreeOwner.cs new file mode 100644 index 0000000..6a8238f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ITreeOwner.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.ITreeOwner +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal interface ITreeOwner + { + TreeNode Root { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IVideoPoolNotification.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IVideoPoolNotification.cs new file mode 100644 index 0000000..b5b976a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/IVideoPoolNotification.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.IVideoPoolNotification +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal interface IVideoPoolNotification + { + void InvalidateClients(); + + void NotifySourceChanged(Size sizeTargetPxl, Size sizeAspectRatio); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Image.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Image.cs new file mode 100644 index 0000000..315f303 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Image.cs @@ -0,0 +1,274 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Image +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Remote; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Image : SharedResource, IImage, ISharedRenderObject, ISurfaceContentOwner + { + private SurfaceManager m_surfaceManager; + private Surface m_surface; + private ImageFormat m_imageFormat; + private Size m_sizeImage; + private Size m_sizeGutterPxl; + private DataBufferTracker m_dataTracker; + private ContentNotifyHandler m_handlerContent; + private string m_stIdentifier; + private ImageLoadInfo m_loadInfo; + private bool m_insideReleaseCallback; + + internal Image( + RenderSession session, + SurfaceManager surfaceManager, + string identifier, + ContentNotifyHandler handler, + Size sizeGutter) + : base(session) + { + session.AssertOwningThread(); + this.m_session = session; + this.m_surfaceManager = surfaceManager; + this.m_stIdentifier = identifier; + this.m_handlerContent = handler; + this.m_sizeGutterPxl = sizeGutter; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_dataTracker != null) + MessagingSession.Current.ReturnDataBufferTracker(this.m_dataTracker); + this.m_surface = null; + this.m_surfaceManager = null; + this.m_dataTracker = null; + this.m_handlerContent = null; + this.m_session = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal Size Size => this.m_sizeImage; + + internal ImageFormat Format => this.m_imageFormat; + + internal Surface Surface => this.m_surface; + + internal string Identifier => this.m_stIdentifier; + + internal Size GutterSize + { + get => this.m_sizeGutterPxl; + set + { + if (value.Width <= this.m_sizeGutterPxl.Width && value.Height <= this.m_sizeGutterPxl.Height) + return; + this.m_sizeGutterPxl.Width = Math.Max(value.Width, this.m_sizeGutterPxl.Width); + this.m_sizeGutterPxl.Height = Math.Max(value.Height, this.m_sizeGutterPxl.Height); + if (!this.InUse) + return; + this.AcquireContent(); + } + } + + void ISurfaceContentOwner.OnSurfaceDisposed(Surface surface) + { + if (this.m_surface != surface) + return; + this.m_surface = null; + } + + void ISurfaceContentOwner.OnRestoreContent(Surface surface) + { + if (this.m_surface != surface) + return; + this.AcquireContent(); + } + + Size IImage.Size => this.m_sizeImage; + + ImageFormat IImage.Format => this.m_imageFormat; + + string IImage.Identifier => this.m_stIdentifier; + + bool IImage.LoadContent( + ImageFormat imageFormat, + Size sizeImage, + int nStride, + IntPtr rgData) + { + this.m_session.AssertOwningThread(); + bool flag1 = false; + bool flag2 = false; + DataBuffer buffer = null; + try + { + SurfaceFormat nFormat = SurfaceFormatInfo.FromImageFormat(imageFormat); + if (nFormat == SurfaceFormat.RGB32) + nFormat = SurfaceFormat.ARGB32; + if (this.m_surface != null && (this.m_imageFormat != imageFormat || this.m_sizeImage != sizeImage || this.m_sizeGutterPxl != this.m_surface.GutterSize)) + { + if (this.InUse) + this.m_surface.RemoveActiveUser(this); + this.m_surface = null; + } + if (this.m_surface == null) + { + this.m_surface = this.m_surfaceManager.RequestSurface(this, nFormat, sizeImage, this.m_sizeGutterPxl); + flag2 = true; + if (this.InUse) + this.m_surface.AddActiveUser(this); + } + IntPtr num1 = IntPtr.Zero; + if (this.m_session.IsForeignByteOrderOnWindowing) + { + int bitsPerPixel = SurfaceFormatInfo.GetBitsPerPixel(nFormat); + int num2 = sizeImage.Height * nStride; + num1 = Marshal.AllocHGlobal(num2); + Memory.ConvertEndian(num1, rgData, num2, bitsPerPixel); + } + this.m_imageFormat = imageFormat; + this.m_sizeImage = sizeImage; + uint cbSize = (uint)(nStride * this.m_sizeImage.Height); + buffer = this.m_session.BuildDataBuffer(num1 == IntPtr.Zero ? rgData : num1, cbSize); + this.Track(buffer, num1, rgData, nStride); + buffer.Commit(); + ++this.m_loadInfo.nLoadsInProgress; + ImageHeader header; + header.sizeActualPxl = this.m_sizeImage; + header.sizeOriginalPxl = this.m_sizeImage; + header.nStride = nStride; + header.nFormat = nFormat; + this.m_session.LoadSurface(buffer, this.m_surface, header); + if (flag2 && this.ContentReloadedEvent != null) + this.ContentReloadedEvent(this); + flag1 = true; + return flag1; + } + finally + { + if (!flag1) + { + if (buffer != null) + this.StopTracking(buffer); + this.m_surface = null; + } + } + } + + internal event Image.ContentReloadedHandler ContentReloadedEvent; + + private void AcquireContent() + { + Debug2.Validate(!this.m_insideReleaseCallback, typeof(InvalidOperationException), "AcquireContent must not be called while inside ContentNotify(Release) callback"); + ContentNotifyHandler handlerContent = this.m_handlerContent; + if (this.m_handlerContent != null) + { + if (this.m_loadInfo != null && this.m_loadInfo.nLoadsInProgress > 0) + { + ++this.m_loadInfo.nSystemLoadRequests; + ((IImage)this).LoadContent(this.m_imageFormat, this.m_sizeImage, this.m_loadInfo.nStride, this.m_loadInfo.rgAppData); + } + else + this.m_handlerContent(ContentNotification.Acquire, this, IntPtr.Zero); + } + Surface surface = this.m_surface; + } + + protected override void OnUsageChange(bool fUsed) + { + if (fUsed) + { + if (this.m_surface == null) + this.AcquireContent(); + else + this.m_surface.AddActiveUser(this); + } + else + { + if (this.m_surface == null) + return; + this.m_surface.RemoveActiveUser(this); + } + } + + private void Track(DataBuffer buffer, IntPtr rgConvertData, IntPtr rgAppData, int nStride) + { + ImageLoadInfo imageLoadInfo; + if (this.m_loadInfo != null && this.m_loadInfo.rgAppData == rgAppData && this.m_loadInfo.nStride == nStride) + { + imageLoadInfo = this.m_loadInfo; + } + else + { + imageLoadInfo = new ImageLoadInfo(); + imageLoadInfo.imageOwner = this; + imageLoadInfo.nLoadsInProgress = 0; + imageLoadInfo.nSystemLoadRequests = 0; + imageLoadInfo.handlerNotify = this.m_handlerContent; + imageLoadInfo.rgAppData = rgAppData; + imageLoadInfo.nStride = nStride; + if (this.m_dataTracker != null) + { + MessagingSession.Current.ReturnDataBufferTracker(this.m_dataTracker); + this.m_dataTracker = null; + } + this.m_dataTracker = MessagingSession.Current.CreateDataBufferTracker(this); + } + DataBufferCleanupInfo bufferCleanupInfo = new DataBufferCleanupInfo(); + bufferCleanupInfo.rgConvertData = rgConvertData; + bufferCleanupInfo.imageLoadInfo = imageLoadInfo; + DataBufferTracker.CleanupEventHandler handler = new DataBufferTracker.CleanupEventHandler(OnDataBufferConsumed); + this.m_dataTracker.Track(buffer, handler, bufferCleanupInfo); + this.m_loadInfo = imageLoadInfo; + } + + private void StopTracking(DataBuffer buffer) + { + if (this.m_dataTracker == null) + return; + this.m_dataTracker.Release(buffer, DataBufferTracker.Users.Valid); + } + + private static void OnDataBufferConsumed(object sender, DataBufferTracker.CleanupEventArgs args) + { + DataBufferCleanupInfo contextData = (DataBufferCleanupInfo)args.ContextData; + ImageLoadInfo imageLoadInfo = contextData.imageLoadInfo; + --imageLoadInfo.nLoadsInProgress; + if (imageLoadInfo.nSystemLoadRequests > 0) + { + --imageLoadInfo.nSystemLoadRequests; + } + else + { + if (imageLoadInfo.handlerNotify != null) + { + imageLoadInfo.imageOwner.m_insideReleaseCallback = true; + imageLoadInfo.handlerNotify(ContentNotification.Release, imageLoadInfo.imageOwner, imageLoadInfo.rgAppData); + imageLoadInfo.imageOwner.m_insideReleaseCallback = false; + } + imageLoadInfo.rgAppData = IntPtr.Zero; + imageLoadInfo.handlerNotify = null; + imageLoadInfo.imageOwner = null; + } + if (!(contextData.rgConvertData != IntPtr.Zero)) + return; + Marshal.FreeHGlobal(contextData.rgConvertData); + contextData.rgConvertData = IntPtr.Zero; + } + + internal delegate void ContentReloadedHandler(Image image); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ImageLoadInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ImageLoadInfo.cs new file mode 100644 index 0000000..ef115d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/ImageLoadInfo.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.ImageLoadInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class ImageLoadInfo + { + public Image imageOwner; + public IntPtr rgAppData; + public int nStride; + public int nLoadsInProgress; + public int nSystemLoadRequests; + public ContentNotifyHandler handlerNotify; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs new file mode 100644 index 0000000..fb34a36 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs @@ -0,0 +1,151 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.NtGraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class NtGraphicsDevice : Dx9GraphicsDevice, IRenderHandleOwner + { + private RemoteNtDevice m_remoteDevice; + private float m_flDisplayOverscan; + private float m_flMaxOverscan; + + internal NtGraphicsDevice(RenderSession session, GraphicsRenderingQuality renderingQuality) + : base(session, "Nt Dx9", GraphicsDeviceType.Direct3D9, renderingQuality) + => this.m_remoteDevice = session.BuildRemoteNtDevice(this); + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_remoteDevice != null) + this.m_remoteDevice.Dispose(); + this.m_remoteDevice = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; + + internal RemoteNtDevice RemoteStub => this.m_remoteDevice; + + internal override RemoteDevice RemoteDevice => m_remoteDevice; + + public Size EstimatedMaxPerformantResolution + { + get + { + Debug2.Validate(this.SurfaceManager != null, typeof(InvalidOperationException), "Dx9 driver must be fully initialized before querying resolution performance"); + return this.SurfaceManager.EstimatedMaxPerformantResolution; + } + } + + public float DisplayOverscan + { + get => this.m_flDisplayOverscan; + set + { + if (Math2.WithinEpsilon(this.m_flDisplayOverscan, value)) + return; + this.m_flDisplayOverscan = value; + this.m_remoteDevice.SendSetDisplayOverscan(value); + } + } + + public float MaxOverscan + { + get => this.m_flMaxOverscan; + set + { + if (Math2.WithinEpsilon(this.m_flMaxOverscan, value)) + return; + this.m_flMaxOverscan = value; + this.m_remoteDevice.SendSetMaxOverscan(value); + } + } + + public override void PostCreate() + { + base.PostCreate(); + SurfaceFormat nFormat = SurfaceFormat.ARGB32; + this.m_remoteDevice.SendCreateTransferBuffer(new Size(2048, 512), nFormat); + for (int index = 0; index < 2; ++index) + this.m_remoteDevice.SendCreateTransferBuffer(new Size(1024, 256), nFormat); + for (int index = 0; index < 4; ++index) + this.m_remoteDevice.SendCreateTransferBuffer(new Size(256, 256), nFormat); + for (int index = 0; index < 8; ++index) + this.m_remoteDevice.SendCreateTransferBuffer(new Size(128, 64), nFormat); + } + + internal override bool IsSurfaceFormatSupported(SurfaceFormat nFormat) + { + switch (nFormat) + { + case SurfaceFormat.A8: + case SurfaceFormat.RGB24: + case SurfaceFormat.RGB32: + case SurfaceFormat.ARGB32: + return true; + case SurfaceFormat.External: + return true; + default: + return false; + } + } + + protected override void CreateSurfacePoolWorker( + object oSurfacePool, + object oHandle, + SurfaceFormat nFormat) + { + this.m_remoteDevice.SendCreateSurfacePool((RENDERHANDLE)oHandle, nFormat); + } + + internal override void CreateVideoPoolWorker(object oSurfacePool, object oHandle) => this.m_remoteDevice.SendCreateVideoPool(this.m_session.RenderingProtocol.LocalVideoPoolCallbackHandle, (RENDERHANDLE)oHandle); + + protected override void RestartRendering(uint nRenderGeneration) => this.m_remoteDevice.SendRestart(nRenderGeneration); + + public override void RenderNowIfPossible() => this.m_remoteDevice.SendRenderNowIfPossible(); + + private static uint GetPixelCB(Size sizeSurfacePxl) => (uint)(Math2.FindPowerOf2(sizeSurfacePxl.Width) * Math2.FindPowerOf2(sizeSurfacePxl.Height) * 4); + + protected override object InternalComputeBreakdown() + { + SurfaceManager.VideoMemoryBreakdown videoMemoryBreakdown = new SurfaceManager.VideoMemoryBreakdown(); + ulong totalVideoMemory = this.m_graphicsCaps.TotalVideoMemory; + ulong dedicatedVideoMemory = this.m_graphicsCaps.DedicatedVideoMemory; + ulong num1 = totalVideoMemory; + videoMemoryBreakdown.sizeBuffersPxl = new Size(Win32Api.GetSystemMetrics(0), Win32Api.GetSystemMetrics(1)); + Size sizeSurfacePxl = new Size(1280, 1024); + if (totalVideoMemory > 67108864UL) + sizeSurfacePxl = totalVideoMemory <= 134217728UL ? new Size(1920, 1280) : new Size(2048, 1600); + videoMemoryBreakdown.sizeLargeBuffersPxl = sizeSurfacePxl; + uint num2 = GetPixelCB(sizeSurfacePxl) * 3U; + ulong num3 = num1 - num2; + videoMemoryBreakdown.cbVideo = 16777216U; + ulong num4 = num3 - videoMemoryBreakdown.cbVideo; + videoMemoryBreakdown.sizeBackgroundPxl = new Size(1024, 768); + uint pixelCb = GetPixelCB(videoMemoryBreakdown.sizeBackgroundPxl); + ulong num5 = num4 - pixelCb - totalVideoMemory / 20UL; + videoMemoryBreakdown.sizeDynamicPoolPxl = dedicatedVideoMemory >= 121634816UL ? new Size(2048, 2048) : new Size(1920, 548); + uint num6 = (uint)(videoMemoryBreakdown.sizeDynamicPoolPxl.Width * videoMemoryBreakdown.sizeDynamicPoolPxl.Height * 4); + for (uint index = 33554432; videoMemoryBreakdown.cbMinimumPool < index && num5 > num6; num5 -= num6) + videoMemoryBreakdown.cbMinimumPool += num6; + return videoMemoryBreakdown; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs new file mode 100644 index 0000000..21d5ee5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.NullGraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class NullGraphicsDevice : GraphicsDevice, IRenderHandleOwner + { + private RemoteNullDevice m_remoteDevice; + + internal NullGraphicsDevice(RenderSession session, bool fUseSplitWindowingPort) + : base(session, "Null") + { + session.AssertOwningThread(); + this.m_remoteDevice = session.BuildRemoteNullDevice(this, fUseSplitWindowingPort); + } + + protected override void Dispose(bool fInDispose) + { + if (fInDispose && this.m_remoteDevice != null) + this.m_remoteDevice.Dispose(); + this.m_remoteDevice = null; + base.Dispose(fInDispose); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; + + public override bool IsVideoComposited => false; + + internal override RemoteDevice RemoteDevice => m_remoteDevice; + + public override bool CanPlayAnimations => false; + + internal override bool IsSurfaceFormatSupported(SurfaceFormat nFormat) => nFormat != SurfaceFormat.None; + + protected override void CreateSurfacePoolWorker( + object oSurfacePool, + object oHandle, + SurfaceFormat nFormat) + { + this.m_remoteDevice.SendCreateSurfacePool((RENDERHANDLE)oHandle, nFormat); + } + + protected override void RestartRendering(uint nRenderGeneration) => this.m_remoteDevice.SendRestart(nRenderGeneration); + + public override bool CanPlayAnimationType(AnimationInputType type) => false; + + internal override EffectTemplate CreateEffectTemplate(string stName) + { + Debug2.Throw(false, "Not yet implemented"); + return null; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/PoolAllocMethod.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/PoolAllocMethod.cs new file mode 100644 index 0000000..8f8a752 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/PoolAllocMethod.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.PoolAllocMethod +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum PoolAllocMethod + { + Available, + New, + ScavengeDead, + CompactDead, + CompactAll, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Sprite.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Sprite.cs new file mode 100644 index 0000000..234378b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Sprite.cs @@ -0,0 +1,226 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Sprite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class Sprite : Visual, ISprite, IVisual, IRawInputSite, IAnimatable, ISharedRenderObject + { + private RemoteSprite m_remoteSprite; + private Effect m_effect; + + public Sprite(RenderSession session, RenderWindow window, object objOwnerData) + : base(session, window, objOwnerData) + { + this.m_remoteSprite = session.BuildRemoteSprite(this, window); + this.m_remoteSprite.SendSetVisible(true); + this.m_remoteVisual = m_remoteSprite; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_effect != null) + { + this.m_effect.UnregisterUsage(this); + this.m_effect = null; + } + this.PropertyManager.RemoveCoordmapProp(this); + this.m_remoteSprite = null; + this.m_effect = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + Vector3 ISprite.Position + { + get => this.Position; + set => this.Position = value; + } + + Vector2 ISprite.Size + { + get => this.Size; + set => this.Size = value; + } + + bool ISprite.Visible + { + get => this.Visible; + set => this.Visible = value; + } + + Vector3 ISprite.Scale + { + get => this.Scale; + set => this.Scale = value; + } + + AxisAngle ISprite.Rotation + { + get => this.Rotation; + set => this.Rotation = value; + } + + float ISprite.Alpha + { + get => this.Alpha; + set => this.Alpha = value; + } + + Vector3 ISprite.CenterPoint + { + get => this.CenterPointScale; + set => this.CenterPointScale = value; + } + + uint ISprite.Layer + { + get => this.Layer; + set => this.Layer = value; + } + + IEffect ISprite.Effect + { + get => Effect; + set => this.Effect = (Effect)value; + } + + internal Effect Effect + { + get => this.m_effect; + set + { + Effect effect = value; + if (this.m_effect == effect) + return; + if (this.m_effect != null) + this.m_effect.UnregisterUsage(this); + this.m_effect = effect; + if (this.m_effect != null) + this.m_effect.RegisterUsage(this); + this.m_remoteSprite.SendSetEffect(this.m_effect == null ? null : this.m_effect.RemoteStub); + } + } + + bool ISprite.RelativeSize + { + get => this.RelativeSize; + set => this.RelativeSize = value; + } + + void ISprite.AddGradient(IGradient gradient) => this.AddGradient((Gradient)gradient); + + void ISprite.RemoveAllGradients() => this.RemoveAllGradients(); + + void ISprite.SetNineGrid(int left, int top, int right, int bottom) + { + Debug2.Validate(left >= 0 && right >= 0 && top >= 0 && bottom >= 0, typeof(ArgumentNullException), "invalid nine grid params"); + this.PropertyManager.RemoveCoordmapProp(this); + this.m_remoteSprite.SendSetNineGrid(left, top, right, bottom); + this.SetPropFlag(PropId.MaxDynamicProp, true); + } + + void ISprite.SetCoordMap(int idxLayer, CoordMap coordMap) + { + Debug2.Validate(idxLayer >= 0, typeof(ArgumentOutOfRangeException), "idxLayer must be >= 0"); + Debug2.Validate(idxLayer < 4, typeof(ArgumentOutOfRangeException), "quick-check, currently we only support 4 layers/stages"); + if (this.IsPropFlagSet(PropId.MaxDynamicProp)) + { + this.m_remoteSprite.SendClearCoordMaps(); + this.SetPropFlag(PropId.MaxDynamicProp, false); + } + if (!this.UpdateCoordMap(idxLayer, coordMap)) + return; + this.m_remoteSprite.SendClearCoordMaps(); + if (!this.IsDynamicValueSet(PropId.CoordMap)) + return; + ArrayList result; + this.PropertyManager.GetCoordmapProp(this, out result); + foreach (Sprite.CoordMapEntry coordMapEntry in result) + { + foreach (CoordMap.CoordMapSample rampSample in coordMapEntry.coordMap.RampSamples) + this.m_remoteSprite.SendAddCoordMapEntry(coordMapEntry.idxLayer, rampSample.Orientation, rampSample.flPosition, rampSample.flValue); + } + } + + private bool UpdateCoordMap(int idxLayer, CoordMap coordMap) + { + ArrayList result; + if (this.IsDynamicValueSet(PropId.CoordMap)) + { + this.PropertyManager.GetCoordmapProp(this, out result); + } + else + { + if (coordMap == null) + return false; + result = new ArrayList(); + this.PropertyManager.SetCoordmapProp(this, result); + } + Sprite.CoordMapEntry coordMapEntry1 = null; + foreach (Sprite.CoordMapEntry coordMapEntry2 in result) + { + if (coordMapEntry2.idxLayer == idxLayer) + { + coordMapEntry1 = coordMapEntry2; + break; + } + } + if (coordMapEntry1 == null) + { + if (coordMap == null) + return false; + result.Add(new Sprite.CoordMapEntry(idxLayer, coordMap)); + return true; + } + if (coordMap == null) + result.Remove(coordMapEntry1); + else + coordMapEntry1.coordMap = coordMap; + return true; + } + + private void ResetCoordmaps() + { + if (this.IsPropFlagSet(PropId.MaxDynamicProp) || this.IsDynamicValueSet(PropId.CoordMap)) + { + this.m_remoteSprite.SendClearCoordMaps(); + this.SetPropFlag(PropId.MaxDynamicProp, false); + } + this.PropertyManager.RemoveCoordmapProp(this); + } + + internal override void Reset() + { + base.Reset(); + this.ResetCoordmaps(); + this.Effect = null; + } + + private class CoordMapEntry + { + internal int idxLayer; + internal CoordMap coordMap; + + internal CoordMapEntry(int idxLayerParam, CoordMap coordMapParam) + { + this.idxLayer = idxLayerParam; + this.coordMap = coordMapParam; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Surface.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Surface.cs new file mode 100644 index 0000000..7bcbd65 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Surface.cs @@ -0,0 +1,151 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Surface +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class Surface : SharedResource, IRenderHandleOwner + { + private ISurfaceContentOwner m_surfaceOwner; + private RemoteSurface m_remoteSurface; + private SurfacePool m_poolOwner; + private Size m_sizeContentPxl; + private Size m_sizeGutterPxl; + private int m_nInstanceID; + private bool m_fPrimaryOwner; + + internal Surface(SurfacePool poolOwner, ISurfaceContentOwner surfaceOwner, Size sizeContentPxl) + : this(poolOwner, surfaceOwner, sizeContentPxl, Size.Zero, RENDERHANDLE.NULL) + { + } + + internal Surface( + SurfacePool poolOwner, + ISurfaceContentOwner surfaceOwner, + Size sizeContentPxl, + Size sizeGutter) + : this(poolOwner, surfaceOwner, sizeContentPxl, sizeGutter, RENDERHANDLE.NULL) + { + } + + internal Surface( + SurfacePool poolOwner, + ISurfaceContentOwner surfaceOwner, + Size sizeContentPxl, + Size sizeGutterPxl, + RENDERHANDLE rhExternal) + : base(poolOwner.Device.Session) + { + this.m_surfaceOwner = surfaceOwner; + this.m_poolOwner = poolOwner; + this.m_remoteSurface = null; + this.m_sizeContentPxl = new Size(); + this.m_sizeGutterPxl = sizeGutterPxl; + RenderPort renderingPort = this.m_poolOwner.Device.Session.RenderingPort; + RENDERHANDLE handle = rhExternal; + if (handle == RENDERHANDLE.NULL) + { + handle = renderingPort.AllocHandle(this); + this.m_fPrimaryOwner = true; + } + try + { + if (this.m_fPrimaryOwner) + { + this.m_nInstanceID = this.m_poolOwner.CreateSurface(this, handle); + this.m_remoteSurface = RemoteSurface.CreateFromHandle(renderingPort, handle); + } + else + { + this.m_nInstanceID = this.m_poolOwner.AttachSurface(this); + this.m_remoteSurface = RemoteSurface.CreateFromExternalHandle(renderingPort, handle, this); + } + this.m_sizeContentPxl = sizeContentPxl; + Size sizeStoragePxl = new Size(sizeContentPxl.Width + this.m_sizeGutterPxl.Width * 2, sizeContentPxl.Height + this.m_sizeGutterPxl.Height * 2); + if (!this.m_fPrimaryOwner) + return; + this.m_remoteSurface.SendSetStorageSize(sizeStoragePxl); + } + finally + { + if (this.m_remoteSurface == null) + { + GC.SuppressFinalize(this); + if (this.m_fPrimaryOwner) + renderingPort.FreeHandle(handle); + } + } + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + if (this.m_remoteSurface != null) + this.m_remoteSurface.Dispose(); + try + { + this.m_surfaceOwner.OnSurfaceDisposed(this); + } + finally + { + this.m_poolOwner.NotifyDisposeSurface(this.m_nInstanceID); + this.m_nInstanceID = 0; + } + } + this.m_remoteSurface = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteSurface.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteSurface = null; + + internal RemoteSurface RemoteStub => this.m_remoteSurface; + + internal SurfacePool SurfacePool => this.m_poolOwner; + + internal int SurfacePoolInstanceID => this.m_nInstanceID; + + internal Size ContentSize => this.m_sizeContentPxl; + + internal ISurfaceContentOwner ContentOwner => this.m_surfaceOwner; + + internal Size GutterSize => this.m_sizeGutterPxl; + + internal void RestoreContent() + { + if (!this.m_remoteSurface.IsValid) + return; + this.m_surfaceOwner.OnRestoreContent(this); + } + + internal void NotifyNewPool(SurfacePool poolNew, int nNewInstanceID) + { + this.m_poolOwner = poolNew; + this.m_nInstanceID = nNewInstanceID; + Rectangle rcContentPxl = new Rectangle(0, 0, this.m_sizeContentPxl.Width, this.m_sizeContentPxl.Height); + this.m_remoteSurface.SendRemapContainer(this.m_poolOwner.RemoteStub); + this.m_remoteSurface.SendRemapLocation(rcContentPxl); + this.m_remoteSurface.SendSetRotation(false); + this.m_remoteSurface.SendSetGutter(this.m_sizeGutterPxl); + } + + protected override void OnUsageChange(bool fUsed) + { + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfaceManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfaceManager.cs new file mode 100644 index 0000000..b3462a7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfaceManager.cs @@ -0,0 +1,222 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.SurfaceManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class SurfaceManager : RenderObject + { + private GraphicsDevice m_device; + private ArrayList m_alDynamicSets; + private Map m_dictNamedPools; + private Size m_sizeThresholdPxl; + private LinkedList m_listLargeSurfaces; + private SurfaceManager.VideoMemoryBreakdown m_vmbStartup; + private bool m_fAllowDynamicPool; + + internal SurfaceManager(GraphicsDevice device, RenderSession session) + { + session.AssertOwningThread(); + Debug2.Validate(session != null, typeof(InvalidOperationException), "Creating a SurfaceManager requires a valid RenderSession"); + this.m_device = device; + this.m_alDynamicSets = new ArrayList(); + this.m_dictNamedPools = new Map(); + this.m_listLargeSurfaces = new LinkedList(); + this.m_vmbStartup = this.m_device.ComputeBreakdown(); + this.m_fAllowDynamicPool = this.m_device.AllowDynamicPool; + if (!this.m_fAllowDynamicPool || this.m_vmbStartup.sizeDynamicPoolPxl.Height <= 0) + return; + this.PreallocateDynamicPools(this.m_vmbStartup); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + foreach (RenderObject alDynamicSet in this.m_alDynamicSets) + alDynamicSet.Dispose(); + this.CollectLargeSurfaces(); + } + this.m_listLargeSurfaces = null; + this.m_alDynamicSets = null; + this.m_device = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + private void PreallocateDynamicPools(SurfaceManager.VideoMemoryBreakdown vmb) + { + this.m_alDynamicSets.Add(new DynamicPoolSet(this.m_device, SurfaceFormat.ARGB32)); + int num = 0; + int index = 0; + while (num < vmb.cbMinimumPool) + { + DynamicPool dynamicPool = ((DynamicPoolSet)this.m_alDynamicSets[index]).AllocateDynamicPool(vmb.sizeDynamicPoolPxl, 8, vmb.ThresholdHeightPxl); + num += dynamicPool.TotalSize.Width * dynamicPool.TotalSize.Height * SurfaceFormatInfo.GetBitsPerPixel(dynamicPool.Format) / 8; + index = (index + 1) % this.m_alDynamicSets.Count; + } + this.m_sizeThresholdPxl = new Size(vmb.sizeDynamicPoolPxl.Width, vmb.ThresholdHeightPxl); + } + + public Size EstimatedMaxPerformantResolution => this.m_vmbStartup.sizeLargeBuffersPxl; + + public Size MaximumSmallPoolBlockSize => this.m_sizeThresholdPxl; + + public Surface RequestSurface( + ISurfaceContentOwner surfaceOwner, + SurfaceFormat nFormat, + Size sizeContentPxl, + Size sizeGutter) + { + Debug2.Validate(surfaceOwner != null, typeof(ArgumentNullException), "Must provide valid surface owner"); + Debug2.Validate(this.m_device.IsSurfaceFormatSupported(nFormat), typeof(ArgumentException), "Surface format is not supported"); + Debug2.Validate(sizeContentPxl.Width > 0 && sizeContentPxl.Height > 0, typeof(ArgumentOutOfRangeException), "Must provide positive area for surface"); + bool flag1 = false; + bool flag2 = false; + Surface surface = null; + DynamicPoolSet dynamicPoolSet = null; + for (int index = 0; index < this.m_alDynamicSets.Count; ++index) + { + dynamicPoolSet = (DynamicPoolSet)this.m_alDynamicSets[index]; + if (dynamicPoolSet.Format == nFormat) + { + flag1 = true; + break; + } + } + if (flag1) + { + Size sizeRequestPxl; + bool fRotated; + if (sizeContentPxl.Width >= sizeContentPxl.Height) + { + sizeRequestPxl = sizeContentPxl; + fRotated = false; + } + else + { + sizeRequestPxl = new Size(sizeContentPxl.Height, sizeContentPxl.Width); + fRotated = true; + sizeGutter = new Size(sizeGutter.Height, sizeGutter.Width); + } + sizeRequestPxl.Width += sizeGutter.Width * 2; + sizeRequestPxl.Height += sizeGutter.Height * 2; + if (sizeRequestPxl.Width <= this.m_sizeThresholdPxl.Width && sizeRequestPxl.Height <= this.m_sizeThresholdPxl.Height) + { + surface = dynamicPoolSet.RequestSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated, PoolAllocMethod.Available, PoolAllocMethod.ScavengeDead) ?? dynamicPoolSet.RequestSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated, PoolAllocMethod.CompactDead, PoolAllocMethod.CompactAll); + if (surface != null) + ; + } + } + else + { + int num = this.m_fAllowDynamicPool ? 1 : 0; + } + if (surface == null) + { + this.CollectLargeSurfaces(); + flag2 = true; + surface = new Surface(new SurfacePool(this.m_device, sizeContentPxl, nFormat) + { + DestroyWhenEmpty = true + }, surfaceOwner, sizeContentPxl); + surface.RegisterUsage(this); + } + if (flag2) + this.m_listLargeSurfaces.AddLast(new LinkedListNode(surface)); + return surface; + } + + public Surface RequestNamedSurface( + ISurfaceContentOwner surfaceOwner, + Size sizeContentPxl, + int nPoolID) + { + Debug2.Validate(surfaceOwner != null, typeof(ArgumentNullException), "Must provide valid surface owner"); + Debug2.Validate(sizeContentPxl.Width > 0 && sizeContentPxl.Height > 0, typeof(ArgumentOutOfRangeException), "Must provide positive area for surface"); + Debug2.Validate(nPoolID >= 0, typeof(ArgumentException), "Must have valid ID or 0"); + SurfacePool dictNamedPool = this.m_dictNamedPools[nPoolID]; + Debug2.Validate(dictNamedPool != null, typeof(ArgumentException), "Must have previously allocated pool"); + dictNamedPool.DisposeAllSurfaces(); + return new Surface(dictNamedPool, surfaceOwner, sizeContentPxl); + } + + public void AllocateNamedSurface(int nPoolID, SurfaceFormat nFormat, Size sizeStoragePxl) + { + Debug2.Validate(nPoolID > 0, typeof(ArgumentException), "Must have valid ID"); + Debug2.Validate(this.m_device.IsSurfaceFormatSupported(nFormat), typeof(ArgumentException), "Surface format is not supported"); + Debug2.Validate(sizeStoragePxl.Width > 0 && sizeStoragePxl.Height > 0, typeof(ArgumentException), "Must have valid surface size"); + Debug2.Validate(this.m_dictNamedPools[nPoolID] == null, null, "SurfacePool must not already be allocated"); + SurfacePool surfacePool = new SurfacePool(this.m_device, sizeStoragePxl, nFormat); + try + { + surfacePool.DestroyWhenEmpty = false; + this.m_dictNamedPools[nPoolID] = surfacePool; + surfacePool = null; + } + finally + { + surfacePool?.Dispose(); + } + } + + public void FreeNamedSurface(int nPoolID) + { + Debug2.Validate(nPoolID > 0, null, "Must have valid ID"); + SurfacePool dictNamedPool = this.m_dictNamedPools[nPoolID]; + Debug2.Validate(dictNamedPool != null, null, "Must have previously allocated pool"); + this.m_dictNamedPools.Remove(nPoolID); + dictNamedPool.Dispose(); + } + + public void CollectDeadSurfaces() + { + foreach (DynamicPoolSet alDynamicSet in this.m_alDynamicSets) + { + foreach (DynamicPool pool in alDynamicSet.Pools) + pool.CollectDeadSurfaces(); + } + this.CollectLargeSurfaces(); + } + + private void CollectLargeSurfaces() + { + LinkedListNode next; + for (LinkedListNode node = this.m_listLargeSurfaces.First; node != null; node = next) + { + next = node.Next; + Surface surface = node.Value; + if (!surface.InUse) + { + surface.UnregisterUsage(this); + this.m_listLargeSurfaces.Remove(node); + } + } + } + + public struct VideoMemoryBreakdown + { + public Size sizeBuffersPxl; + public uint cbVideo; + public Size sizeBackgroundPxl; + public Size sizeDynamicPoolPxl; + public Size sizeLargeBuffersPxl; + public uint cbMinimumPool; + + public int ThresholdHeightPxl => Math.Max(Math.Min(this.sizeDynamicPoolPxl.Height, 350), this.sizeDynamicPoolPxl.Height * 350 / 2048); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePool.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePool.cs new file mode 100644 index 0000000..a1822b8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePool.cs @@ -0,0 +1,221 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.SurfacePool +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class SurfacePool : RenderObject, IRenderHandleOwner + { + private GraphicsDevice m_device; + private RenderSession m_session; + private ObjectTracker m_trackerSurfaces; + protected RemoteSurfacePool m_remotePool; + private Size m_sizeStoragePxl; + private bool m_fDestroyWhenEmpty; + private SurfaceFormat m_nFormat; + private SurfacePoolAllocationResult m_nStorage; + private bool m_fPrimaryOwner; + private Effect m_effect; + + internal SurfacePool(GraphicsDevice device, SurfaceFormat nFormat, RENDERHANDLE rhExternal) => this.CommonCreate(device, nFormat, rhExternal); + + internal SurfacePool(GraphicsDevice device, Size sizeStoragePxl, SurfaceFormat nFormat) + { + Debug2.Validate(sizeStoragePxl.Width > 0 && sizeStoragePxl.Height > 0, typeof(ArgumentException), "Must have positive area"); + this.CommonCreate(device, nFormat, RENDERHANDLE.NULL); + this.m_sizeStoragePxl = sizeStoragePxl; + this.m_nStorage = SurfacePoolAllocationResult.NotAllocated; + this.Allocate(); + } + + private void CommonCreate( + GraphicsDevice device, + SurfaceFormat nFormat, + RENDERHANDLE rhExternal) + { + Debug2.Validate(nFormat != SurfaceFormat.None, typeof(ArgumentException), nameof(nFormat)); + Debug2.Validate(device != null, typeof(ArgumentNullException), "Creating a SurfacePool requires a GraphicsDevice"); + this.m_device = device; + this.m_session = device.Session; + Debug2.Validate(this.m_session != null, typeof(InvalidOperationException), "Creating a SurfacePool requires a RenderSession"); + this.m_session.AssertOwningThread(); + this.m_remotePool = null; + this.m_sizeStoragePxl = new Size(); + this.m_nFormat = nFormat; + RENDERHANDLE handle = rhExternal; + if (handle == RENDERHANDLE.NULL) + { + handle = this.m_session.RenderingPort.AllocHandle(this); + this.m_fPrimaryOwner = true; + } + try + { + this.CreateRemoteSurfacePool(handle, this.m_fPrimaryOwner); + } + finally + { + if (this.m_remotePool == null) + { + GC.SuppressFinalize(this); + if (this.m_fPrimaryOwner) + this.m_session.RenderingPort.FreeHandle(handle); + } + } + this.m_trackerSurfaces = new ObjectTracker(this.m_session, this); + if (this.m_fPrimaryOwner) + return; + this.m_nStorage = SurfacePoolAllocationResult.Immoveable; + } + + protected virtual void CreateRemoteSurfacePool(RENDERHANDLE handle, bool fPrimaryOwner) + { + if (fPrimaryOwner) + { + this.m_device.CreateSurfacePool(this, handle, this.Format); + this.m_remotePool = RemoteSurfacePool.CreateFromHandle(this.m_session.RenderingPort, handle); + } + else + this.m_remotePool = RemoteSurfacePool.CreateFromExternalHandle(this.m_session.RenderingPort, handle, this); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + if (this.m_effect != null) + this.m_effect.UnregisterUsage(this); + this.DisposeAllSurfaces(); + this.m_trackerSurfaces.Dispose(); + this.m_remotePool.Dispose(); + this.m_device.OnSurfacePoolDispose(); + } + this.m_effect = null; + this.m_remotePool = null; + this.m_trackerSurfaces = null; + this.m_device = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remotePool.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remotePool = null; + + public Size StorageSize => this.m_sizeStoragePxl; + + public SurfaceFormat Format => this.m_nFormat; + + internal RemoteSurfacePool RemoteStub => this.m_remotePool; + + protected RenderSession Session => this.m_session; + + internal GraphicsDevice Device => this.m_device; + + internal bool DestroyWhenEmpty + { + get => this.m_fDestroyWhenEmpty; + set => this.m_fDestroyWhenEmpty = value; + } + + internal IList AllSurfaces + { + get + { + IList list = null; + if (this.m_trackerSurfaces != null) + list = m_trackerSurfaces.LiveObjects; + return list; + } + } + + internal SurfacePoolAllocationResult StorageState => this.m_nStorage; + + public Effect Effect + { + get => this.m_effect; + set + { + Effect effect = value; + if (this.m_effect == effect) + return; + if (this.m_effect != null) + this.m_effect.UnregisterUsage(this); + this.m_effect = effect; + if (this.m_effect != null) + this.m_effect.RegisterUsage(this); + this.m_remotePool.SendSetEffect(this.m_effect == null ? null : this.m_effect.RemoteStub); + } + } + + internal int CreateSurface(Surface spNew, RENDERHANDLE handle) + { + this.m_remotePool.SendCreateSurface(handle); + return this.AttachSurface(spNew); + } + + internal int AttachSurface(Surface spNew) => this.m_trackerSurfaces.AddObject(spNew); + + internal void DisposeAllSurfaces() + { + if (this.m_trackerSurfaces == null) + return; + ArrayList liveObjects = this.m_trackerSurfaces.LiveObjects; + for (int index = 0; index < liveObjects.Count; ++index) + ((SharedRenderObject)liveObjects[index]).UnregisterUsage(this); + } + + internal void NotifyDisposeSurface(int nID) + { + if (this.m_trackerSurfaces == null) + return; + this.m_trackerSurfaces.RemoveObject(nID); + if (!this.m_fDestroyWhenEmpty || !this.m_trackerSurfaces.IsEmpty) + return; + this.Dispose(); + } + + internal void Restore() + { + if (this.m_remotePool == null || !this.m_remotePool.IsValid) + return; + if (!this.m_sizeStoragePxl.IsZero) + this.Allocate(); + ArrayList liveObjects = this.m_trackerSurfaces.LiveObjects; + for (int index = 0; index < liveObjects.Count; ++index) + ((Surface)liveObjects[index]).RestoreContent(); + } + + internal static void RemapSurface(Surface surCur, SurfacePool poolNew) + { + SurfacePool surfacePool = surCur.SurfacePool; + if (poolNew == surfacePool) + return; + int surfacePoolInstanceId = surCur.SurfacePoolInstanceID; + surfacePool.NotifyDisposeSurface(surfacePoolInstanceId); + int nNewInstanceID = poolNew.m_trackerSurfaces.AddObject(surCur); + surCur.NotifyNewPool(poolNew, nNewInstanceID); + } + + internal void NotifyAllocation(SurfacePoolAllocationResult nResult) => this.m_nStorage = nResult; + + private void Allocate() + { + this.m_remotePool.SendAllocate(this.m_sizeStoragePxl); + this.m_nStorage = SurfacePoolAllocationResult.Requested; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePoolAllocationResult.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePoolAllocationResult.cs new file mode 100644 index 0000000..a4d5451 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/SurfacePoolAllocationResult.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.SurfacePoolAllocationResult +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum SurfacePoolAllocationResult + { + NotAllocated, + Requested, + Immoveable, + NotEnoughVideoMemory, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TextureVariableInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TextureVariableInfo.cs new file mode 100644 index 0000000..b3606c2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TextureVariableInfo.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.TextureVariableInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal class TextureVariableInfo : VariableInfo + { + internal string SamplerName; + internal string MinFilter; + internal string MagFilter; + internal int CoordinateMapID; + internal int ImageIndexID; + + public TextureVariableInfo() => this.IsDynamic = true; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNode.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNode.cs new file mode 100644 index 0000000..981c2e2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNode.cs @@ -0,0 +1,271 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.TreeNode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class TreeNode : CachedRenderObject + { + private static int s_idObject; + private ITreeOwner m_treeOwner; + private int m_idObject; + private TreeNode m_nodeParent; + private TreeNode m_nodeFirstChild; + private TreeNode m_nodeNext; + private TreeNode m_nodePrevious; + public static int s_DEBUG_nTotalNodes; + + internal TreeNode(ITreeOwner iTreeOwner) + { + Debug2.Validate(iTreeOwner != null, typeof(ArgumentNullException), "Must have a valid ITreeOwner when creating a TreeNode"); + this.m_treeOwner = iTreeOwner; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + this.ChangeParent(null); + this.RemoveAllChildren(); + } + this.m_treeOwner = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + private ITreeOwner Tree => this.m_treeOwner; + + internal bool HasChildren => this.m_nodeFirstChild != null; + + internal bool IsRoot => this.m_treeOwner.Root == this; + + internal TreeNode Parent => this.m_nodeParent; + + internal TreeNode NextSibling => this.m_nodeNext; + + internal TreeNode PreviousSibling => this.m_nodePrevious; + + internal TreeNode FirstSibling => this.m_nodeParent == null ? this : this.m_nodeParent.m_nodeFirstChild; + + internal TreeNode LastSibling + { + get + { + TreeNode treeNode = this; + while (treeNode.m_nodeNext != null) + treeNode = treeNode.m_nodeNext; + return treeNode; + } + } + + internal TreeNode FirstChild => this.m_nodeFirstChild; + + internal TreeNode LastChild => this.m_nodeFirstChild != null ? this.m_nodeFirstChild.LastSibling : null; + + internal TreeNodeCollection Children => new TreeNodeCollection(this); + + internal AncestorEnumerator Ancestors => new AncestorEnumerator(this); + + internal bool HasDescendant(TreeNode nodeOther) + { + for (; nodeOther != null; nodeOther = nodeOther.m_nodeParent) + { + if (nodeOther == this) + return true; + } + return false; + } + + public int ChildCount + { + get + { + int num = 0; + for (TreeNode treeNode = this.m_nodeFirstChild; treeNode != null; treeNode = treeNode.m_nodeNext) + ++num; + return num; + } + } + + internal virtual void RemoveAllChildren() + { + while (this.m_nodeFirstChild != null) + this.m_nodeFirstChild.ChangeParent(null); + } + + internal void ChangeParent(TreeNode nodeNewParent) => this.ChangeParent(nodeNewParent, null, LinkType.First); + + internal void ChangeParent(TreeNode nodeNewParent, TreeNode nodeSibling, TreeNode.LinkType lt) + { + if (this.m_nodeParent == nodeNewParent) + return; + TreeNode nodeParent = this.m_nodeParent; + if (this.m_nodeParent != null) + DoUnlink(this); + if (nodeNewParent != null) + DoLink(nodeNewParent, this, nodeSibling, lt); + if (nodeParent == null && nodeNewParent != null) + { + this.RegisterUsage(this); + } + else + { + if (nodeParent == null || nodeNewParent != null) + return; + this.UnregisterUsage(this); + } + } + + private static void DoLink( + TreeNode nodeParent, + TreeNode nodeChange, + TreeNode nodeSibling, + TreeNode.LinkType lt) + { + nodeChange.m_nodeParent = nodeParent; + TreeNode nodeFirstChild = nodeParent.m_nodeFirstChild; + if (nodeFirstChild == null) + { + nodeParent.m_nodeFirstChild = nodeChange; + } + else + { + switch (lt) + { + case LinkType.Before: + nodeChange.m_nodeNext = nodeSibling; + nodeChange.m_nodePrevious = nodeSibling.m_nodePrevious; + nodeSibling.m_nodePrevious = nodeChange; + if (nodeChange.m_nodePrevious != null) + { + nodeChange.m_nodePrevious.m_nodeNext = nodeChange; + break; + } + nodeParent.m_nodeFirstChild = nodeChange; + break; + case LinkType.Behind: + nodeChange.m_nodePrevious = nodeSibling; + nodeChange.m_nodeNext = nodeSibling.m_nodeNext; + nodeSibling.m_nodeNext = nodeChange; + if (nodeChange.m_nodeNext == null) + break; + nodeChange.m_nodeNext.m_nodePrevious = nodeChange; + break; + case LinkType.First: + nodeParent.m_nodeFirstChild = nodeChange; + nodeChange.m_nodeNext = nodeFirstChild; + if (nodeFirstChild == null) + break; + nodeFirstChild.m_nodePrevious = nodeChange; + break; + case LinkType.Last: + TreeNode lastSibling = nodeFirstChild.LastSibling; + lastSibling.m_nodeNext = nodeChange; + nodeChange.m_nodePrevious = lastSibling; + break; + } + } + } + + private static void DoUnlink(TreeNode nodeChange) + { + if (nodeChange.m_nodeParent.m_nodeFirstChild == nodeChange) + nodeChange.m_nodeParent.m_nodeFirstChild = nodeChange.m_nodeNext; + if (nodeChange.m_nodeNext != null) + nodeChange.m_nodeNext.m_nodePrevious = nodeChange.m_nodePrevious; + if (nodeChange.m_nodePrevious != null) + nodeChange.m_nodePrevious.m_nodeNext = nodeChange.m_nodeNext; + nodeChange.m_nodeParent = null; + nodeChange.m_nodeNext = null; + nodeChange.m_nodePrevious = null; + } + + internal int InstanceID + { + get + { + if (this.m_idObject == 0) + this.SetInstanceID(GenerateInstanceID()); + return this.m_idObject; + } + } + + private static int GenerateInstanceID() => ++s_idObject; + + private void SetInstanceID(int idObject) => this.m_idObject = idObject; + + public override int GetHashCode() => this.InstanceID; + + public override bool Equals(object oRHS) => ReferenceEquals(this, oRHS); + + public bool TestNodes( + TreeNode.NodeTest test, + TreeNode.NodeRelation nScope, + bool fParentChainsMustGoToRoot) + { + if ((nScope & NodeRelation.FullChain) == NodeRelation.None || (nScope & NodeRelation.Self) != NodeRelation.None && !test(this)) + return false; + if ((nScope & NodeRelation.Parents) != NodeRelation.None) + { + TreeNode node = this; + do + { + TreeNode parent = node.Parent; + if (parent != null) + node = parent; + else + goto label_7; + } + while (test(node)); + return false; + label_7: + if (fParentChainsMustGoToRoot && node != this.m_treeOwner.Root) + return false; + } + return true; + } + + internal int DEBUG_CurrentGeneration => 0; + + [Conditional("DEBUG")] + internal void DEBUG_CheckGeneration(int idxIntendedGeneration) + { + } + + [Conditional("DEBUG")] + internal void DEBUG_IncTotalNodes() => ++s_DEBUG_nTotalNodes; + + [Conditional("DEBUG")] + internal void DEBUG_DecTotalNodes() => --s_DEBUG_nTotalNodes; + + internal enum LinkType + { + Before = 1, + Behind = 2, + First = 3, + Last = 4, + } + + [Flags] + public enum NodeRelation + { + None = 0, + Self = 1, + Parents = 2, + FullChain = Parents | Self, // 0x00000003 + } + + public delegate bool NodeTest(TreeNode node); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs new file mode 100644 index 0000000..2f83c14 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs @@ -0,0 +1,148 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.TreeNodeCollection +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal struct TreeNodeCollection : IList, ICollection, IEnumerable + { + private TreeNode m_nodeSubject; + + internal TreeNodeCollection(TreeNode nodeSubject) => this.m_nodeSubject = nodeSubject; + + public int Count => this.m_nodeSubject.ChildCount; + + bool ICollection.IsSynchronized => false; + + object ICollection.SyncRoot => throw new InvalidOperationException("This collection may only be used on the correct thread"); + + bool IList.IsFixedSize => false; + + bool IList.IsReadOnly => false; + + object IList.this[int index] + { + get => this[index]; + set => Debug2.Validate(false, typeof(InvalidOperationException), "Use Add() and Remove() to modify collection"); + } + + public TreeNode this[int idxChild] + { + get + { + Debug2.Validate(idxChild >= 0, typeof(ArgumentOutOfRangeException), "Must have a valid index"); + int num = 0; + foreach (TreeNode treeNode in this) + { + if (idxChild == num) + return treeNode; + ++num; + } + Debug2.Validate(false, typeof(ArgumentOutOfRangeException), "Must have a valid index"); + return null; + } + set => Debug2.Validate(false, typeof(InvalidOperationException), "Use Add() and Remove() to modify collection"); + } + + IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); + + public TreeNodeEnumerator GetEnumerator() => new TreeNodeEnumerator(this.m_nodeSubject); + + void ICollection.CopyTo(Array arDest, int idxDest) + { + PromptCompatibleArray(arDest, idxDest, typeof(TreeNode), this.m_nodeSubject.ChildCount); + foreach (TreeNode treeNode in this) + arDest.SetValue(treeNode, idxDest++); + } + + public void CopyTo(TreeNode[] arDest, int idxDest) => ((ICollection)this).CopyTo(arDest, idxDest); + + int IList.Add(object value) + { + this.Add((TreeNode)value); + return this.m_nodeSubject.ChildCount - 1; + } + + public void Add(TreeNode nodeChild) + { + Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); + Debug2.Validate(nodeChild.Parent == null, typeof(ArgumentException), "Child must not already be parented"); + nodeChild.ChangeParent(this.m_nodeSubject, null, TreeNode.LinkType.Last); + } + + public void Clear() => this.m_nodeSubject.RemoveAllChildren(); + + bool IList.Contains(object nodeChild) => this.Contains((TreeNode)nodeChild); + + public bool Contains(TreeNode nodeChild) + { + Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); + return nodeChild.Parent == this.m_nodeSubject; + } + + int IList.IndexOf(object nodeChild) => this.IndexOf((TreeNode)nodeChild); + + public int IndexOf(TreeNode nodeChild) + { + Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); + if (nodeChild.Parent != this.m_nodeSubject) + return -1; + int num = 0; + foreach (TreeNode treeNode in this) + { + if (nodeChild == treeNode) + return num; + ++num; + } + return -1; + } + + void IList.Insert(int idxInsertAt, object nodeChild) => this.Insert(idxInsertAt, (TreeNode)nodeChild); + + public void Insert(int idxInsertAt, TreeNode nodeChild) + { + Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); + Debug2.Validate(nodeChild.Parent == null, typeof(ArgumentException), "Child must not already be parented"); + TreeNode nodeSibling = null; + TreeNode.LinkType lt = TreeNode.LinkType.Last; + if (idxInsertAt < this.Count) + { + nodeSibling = this[idxInsertAt]; + lt = TreeNode.LinkType.Before; + } + nodeChild.ChangeParent(this.m_nodeSubject, nodeSibling, lt); + } + + void IList.Remove(object nodeChild) => this.Remove((TreeNode)nodeChild); + + public void Remove(TreeNode nodeChild) + { + Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "must pass a valid TreeNode"); + nodeChild.ChangeParent(null); + } + + public void RemoveAt(int idxRemoveAt) => this[idxRemoveAt].ChangeParent(null); + + public static void PromptCompatibleArray( + Array array, + int indexStart, + Type typeObject, + int numItems) + { + Debug2.Validate(array != null, typeof(ArgumentNullException), "Must have valid array"); + Debug2.Validate(typeObject != null, typeof(ArgumentNullException), "Must have valid Type"); + Debug2.Validate(array.Rank == 1, typeof(RankException), "Array must have rank=1"); + Debug2.Validate(indexStart < array.Length || numItems == 0, typeof(ArgumentException), "Must have valid index"); + Debug2.Validate(indexStart >= 0, typeof(ArgumentOutOfRangeException), "Must have valid index"); + Debug2.Validate(indexStart + numItems <= array.Length, typeof(ArgumentOutOfRangeException), "Must have sufficient room in array"); + Type elementType = array.GetType().GetElementType(); + Debug2.Validate(typeObject == elementType || typeObject.IsSubclassOf(elementType), typeof(ArrayTypeMismatchException), "Must be a compatible array type"); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs new file mode 100644 index 0000000..c230d1d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.TreeNodeEnumerator +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal struct TreeNodeEnumerator : IEnumerator + { + private TreeNode m_nodeParent; + private TreeNode m_nodeCurrent; + private TreeNode m_nodeNext; + + internal TreeNodeEnumerator(TreeNode nodeParent) + { + this.m_nodeParent = nodeParent; + this.m_nodeCurrent = null; + this.m_nodeNext = nodeParent.FirstChild; + } + + object IEnumerator.Current => m_nodeCurrent; + + public TreeNode Current => this.m_nodeCurrent; + + public void Reset() + { + this.m_nodeCurrent = null; + this.m_nodeNext = this.m_nodeParent.FirstChild; + } + + public bool MoveNext() + { + this.m_nodeCurrent = this.m_nodeNext; + if (this.m_nodeNext == null) + return false; + this.m_nodeNext = this.m_nodeNext.NextSibling; + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableInfo.cs new file mode 100644 index 0000000..b72713d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableInfo.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VariableInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal class VariableInfo + { + internal int ID; + internal bool IsDynamic; + internal Dx9VariableType Type; + internal string Name; + internal object DefaultValue; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableScope.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableScope.cs new file mode 100644 index 0000000..a93b37f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VariableScope.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VariableScope +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum VariableScope : byte + { + Global = 1, + Local = 2, + Const = 3, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoPool.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoPool.cs new file mode 100644 index 0000000..325fadd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoPool.cs @@ -0,0 +1,71 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VideoPool +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; + +namespace Microsoft.Iris.Render.Graphics +{ + internal sealed class VideoPool : SurfacePool, IVideoPoolCallback + { + private RemoteVideoPool m_remoteVideoPool; + private IVideoPoolNotification m_imgOwner; + private float m_flContentOverscan; + private Size m_sizeTargetPxl; + + internal VideoPool(GraphicsDevice device, IVideoPoolNotification imgOwner) + : base(device, SurfaceFormat.External, RENDERHANDLE.NULL) + => this.m_imgOwner = imgOwner; + + protected override void CreateRemoteSurfacePool(RENDERHANDLE rhHandle, bool fPrimaryOwner) + { + if (fPrimaryOwner) + { + this.Device.CreateVideoPool(this, rhHandle); + this.m_remoteVideoPool = RemoteVideoPool.CreateFromHandle(this.Session.RenderingPort, rhHandle); + } + else + this.m_remoteVideoPool = RemoteVideoPool.CreateFromExternalHandle(this.Session.RenderingPort, rhHandle, this); + this.m_remotePool = m_remoteVideoPool; + } + + internal RemoteVideoPool RemoteVideoStub => this.m_remoteVideoPool; + + internal float ContentOverscan + { + get => this.m_flContentOverscan; + set + { + if (Math2.WithinEpsilon(this.m_flContentOverscan, value)) + return; + this.m_flContentOverscan = value; + this.m_remoteVideoPool.SendSetContentOverscan(value); + } + } + + internal void NotifyVideoModeChanged(Size sizeTargetPxl) + { + if (!(this.m_sizeTargetPxl != sizeTargetPxl)) + return; + this.m_sizeTargetPxl = sizeTargetPxl; + this.m_remoteVideoPool.SendNotifyVideoSizeChanged(sizeTargetPxl); + } + + void IVideoPoolCallback.OnInputChanged( + RENDERHANDLE target, + Size sizeTargetPxl, + Size sizeAspectRatio, + uint nFrameRateNumerator, + uint nFrameRateDenominator, + SurfaceFormat nFormat) + { + this.m_imgOwner.NotifySourceChanged(sizeTargetPxl, sizeAspectRatio); + } + + void IVideoPoolCallback.OnInvalidate(RENDERHANDLE target) => this.m_imgOwner.InvalidateClients(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoZoomMode.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoZoomMode.cs new file mode 100644 index 0000000..2302290 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VideoZoomMode.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VideoZoomMode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Graphics +{ + internal enum VideoZoomMode + { + Normal, + Zoomed, + Stretched, + NonLinear, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Visual.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Visual.cs new file mode 100644 index 0000000..61564f2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/Visual.cs @@ -0,0 +1,591 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.Visual +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections.Specialized; + +namespace Microsoft.Iris.Render.Graphics +{ + internal abstract class Visual : + TreeNode, + IVisual, + IAnimatableObject, + IAnimatable, + ISharedRenderObject, + IRenderHandleOwner, + IRawInputSite + { + private const uint k_DebugBitShift = 5; + private static ColorF s_colorTransparent = ColorF.FromArgb(0U); + private static ColorF s_colorWhite = new ColorF(1f, 1f, 1f, 1f); + public static readonly string PositionProperty = nameof(Position); + public static readonly string AlphaProperty = nameof(Alpha); + public static readonly string OrientationProperty = "Orientation"; + public static readonly string RotationProperty = nameof(Rotation); + public static readonly string ScaleProperty = nameof(Scale); + public static readonly string SizeProperty = nameof(Size); + protected RenderWindow m_window; + protected RemoteVisual m_remoteVisual; + private Vector3 m_vecPosition; + private Vector2 m_vecSize; + private BitVector32 m_bvDataBits; + private static BitVector32.Section s_bvsMouse = BitVector32.CreateSection(15); + private static BitVector32.Section s_bvsDebug = BitVector32.CreateSection(3, s_bvsMouse); + private static BitVector32.Section s_bvsValid = BitVector32.CreateSection(1, s_bvsDebug); + private static BitVector32.Section s_bvsVisible = BitVector32.CreateSection(1, s_bvsValid); + private static BitVector32.Section s_bvsAlpha; + private static BitVector32.Section s_bvsCenterPointScale; + private static BitVector32.Section s_bvsColor; + private static BitVector32.Section s_bvsCoordmap; + private static BitVector32.Section s_bvsGradient; + private static BitVector32.Section s_bvsLayer; + private static BitVector32.Section s_bvsRotation; + private static BitVector32.Section s_bvsScale; + private static BitVector32.Section s_bvsFlush = BitVector32.CreateSection(1, s_bvsVisible); + private static BitVector32.Section s_bvsRelativeSize; + private static BitVector32.Section s_bvsCamera; + private static BitVector32.Section s_bvsNineGrid; + private static BitVector32.Section[] s_sectionPropIDMap; + private object m_objOwnerData; + + static Visual() + { + s_bvsAlpha = BitVector32.CreateSection(1, s_bvsFlush); + s_bvsCenterPointScale = BitVector32.CreateSection(1, s_bvsAlpha); + s_bvsColor = BitVector32.CreateSection(1, s_bvsCenterPointScale); + s_bvsCoordmap = BitVector32.CreateSection(1, s_bvsColor); + s_bvsGradient = BitVector32.CreateSection(1, s_bvsCoordmap); + s_bvsLayer = BitVector32.CreateSection(1, s_bvsGradient); + s_bvsRotation = BitVector32.CreateSection(1, s_bvsLayer); + s_bvsScale = BitVector32.CreateSection(1, s_bvsRotation); + s_bvsRelativeSize = BitVector32.CreateSection(1, s_bvsScale); + s_bvsCamera = BitVector32.CreateSection(1, s_bvsRelativeSize); + s_bvsNineGrid = BitVector32.CreateSection(1, s_bvsCamera); + s_sectionPropIDMap = new BitVector32.Section[10]; + s_sectionPropIDMap[0] = s_bvsAlpha; + s_sectionPropIDMap[1] = s_bvsScale; + s_sectionPropIDMap[2] = s_bvsRotation; + s_sectionPropIDMap[3] = s_bvsCenterPointScale; + s_sectionPropIDMap[4] = s_bvsLayer; + s_sectionPropIDMap[5] = s_bvsColor; + s_sectionPropIDMap[6] = s_bvsCoordmap; + s_sectionPropIDMap[7] = s_bvsGradient; + s_sectionPropIDMap[8] = s_bvsCamera; + s_sectionPropIDMap[9] = s_bvsNineGrid; + } + + internal Visual(RenderSession session, RenderWindow window, object objOwnerData) + : base(window) + { + Debug2.Validate(session != null, typeof(ArgumentNullException), "Must have valid session"); + Debug2.Validate(window != null, typeof(ArgumentNullException), "Must have valid render window"); + session.AssertOwningThread(); + this.m_window = window; + this.m_objOwnerData = objOwnerData; + this.m_vecPosition = Vector3.Zero; + this.m_vecSize = Vector2.Zero; + this.FlushValues = true; + this.SetValid(true); + this.SetVisible(true); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + this.SetValid(false); + this.RemoveAllGradients(); + this.PropertyManager.RemoveAlphaProp(this); + this.PropertyManager.RemoveCenterPointScaleProp(this); + this.PropertyManager.RemoveLayerProp(this); + this.PropertyManager.RemoveRotationProp(this); + this.PropertyManager.RemoveScaleProp(this); + if (this.m_remoteVisual != null) + this.m_remoteVisual.Dispose(); + } + this.m_remoteVisual = null; + this.m_objOwnerData = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + MouseOptions IVisual.MouseOptions + { + get => this.MouseOptions; + set => this.MouseOptions = value; + } + + IVisualContainer IVisual.Parent => this.Parent as IVisualContainer; + + string IVisual.DebugID + { + get => this.DebugDescription; + set + { + } + } + + ColorF IVisual.DebugColor + { + get => this.DEBUG_OutlineColor; + set => this.DEBUG_OutlineColor = value; + } + + void IVisual.CopyFrom(IVisual visualSource) + { + Visual visual = (Visual)visualSource; + this.Position = visual.Position; + this.Size = visual.Size; + this.Scale = visual.Scale; + this.Rotation = visual.Rotation; + this.Alpha = visual.Alpha; + this.CenterPointScale = visual.CenterPointScale; + this.Layer = visual.Layer; + this.MouseOptions = visual.MouseOptions; + } + + void IVisual.Remove() => this.RemoveFromTree(); + + protected void AddGradient(Gradient gradient) + { + Vector result; + if (this.IsDynamicValueSet(PropId.Gradients)) + { + this.PropertyManager.GetGradientProp(this, out result); + } + else + { + result = new Vector(); + this.PropertyManager.SetGradientProp(this, result); + } + gradient.RegisterUsage(this); + result.Add(gradient); + this.m_remoteVisual.SendAddGradient(gradient.RemoteGradient); + } + + protected void RemoveAllGradients() + { + if (!this.IsDynamicValueSet(PropId.Gradients)) + return; + Vector result; + this.PropertyManager.GetGradientProp(this, out result); + this.PropertyManager.RemoveGradientProp(this); + foreach (SharedRenderObject sharedRenderObject in result) + sharedRenderObject.UnregisterUsage(this); + result.Clear(); + this.m_remoteVisual.SendClearGradients(); + } + + internal void ChangeParent(Visual visualParent, Visual visualSibling, VisualOrder nOrder) + { + RemoteVisual remoteVisual1 = visualParent?.m_remoteVisual; + RemoteVisual remoteVisual2 = this.m_remoteVisual; + RemoteVisual remoteVisual3 = visualSibling?.m_remoteVisual; + remoteVisual2.SendChangeParent(remoteVisual1, remoteVisual3, nOrder); + this.ChangeParent(visualParent); + } + + internal override void RemoveAllChildren() + { + for (Visual firstChild = (Visual)this.FirstChild; firstChild != null; firstChild = (Visual)this.FirstChild) + firstChild.ChangeParent(null, null, VisualOrder.First); + base.RemoveAllChildren(); + } + + protected void RemoveFromTree() + { + this.RemoveAllChildren(); + this.ChangeParent(null, null, VisualOrder.First); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteVisual.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteVisual = null; + + internal RemoteVisual RemoteStub => this.m_remoteVisual; + + public object OwnerData + { + get => this.m_objOwnerData; + set => this.m_objOwnerData = value; + } + + protected Vector3 Position + { + get => this.m_vecPosition; + set => this.SetPosition(value, false); + } + + protected void SetPosition(Vector3 value, bool force) + { + if (!(this.m_vecPosition != value) && !force) + return; + this.m_vecPosition = value; + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetPosition(this.m_vecPosition); + } + + internal Vector2 Size + { + get => this.m_vecSize; + set => this.SetSize(value, false); + } + + internal void SetSize(Vector2 value, bool force) + { + Debug2.Validate(value.X >= 0.0 && value.Y >= 0.0, typeof(ArgumentOutOfRangeException), "Negative size not allowed"); + if (!(this.m_vecSize != value) && !force) + return; + this.m_vecSize = value; + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetSize(this.m_vecSize); + } + + protected float Alpha + { + get + { + float result = 1f; + if (this.IsDynamicValueSet(PropId.Alpha)) + { + this.PropertyManager.GetAlphaProp(this, out result); + Debug2.Validate(!Math2.WithinEpsilon(result, 1f), typeof(InvalidOperationException), "expected non-opaque alpha if HasAlpha flag was set"); + } + return result; + } + set => this.SetAlpha(value, false); + } + + protected void SetAlpha(float value, bool force) + { + if (Alpha == (double)value && !force) + return; + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Alpha value must be within 0-1 range (incl)"); + this.PropertyManager.SetAlphaProp(this, value); + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetAlpha(value); + } + + protected Vector3 Scale + { + get + { + Vector3 result = Vector3.UnitVector; + if (this.IsDynamicValueSet(PropId.Scale)) + { + this.PropertyManager.GetScaleProp(this, out result); + Debug2.Validate(result != Vector3.UnitVector, typeof(InvalidOperationException), "expected non-unit scale if HasScale flag was set"); + } + return result; + } + set => this.SetScale(value, false); + } + + protected void SetScale(Vector3 value, bool force) + { + if (!(this.Scale != value) && !force) + return; + this.PropertyManager.SetScaleProp(this, value); + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetScale(value); + } + + protected AxisAngle Rotation + { + get + { + AxisAngle result = AxisAngle.Identity; + if (this.IsDynamicValueSet(PropId.Rotation)) + { + this.PropertyManager.GetRotationProp(this, out result); + Debug2.Validate(result != AxisAngle.Identity, typeof(InvalidOperationException), "expected non-null rotation data if HasRotation flag was set"); + } + return result; + } + set => this.SetRotation(value, false); + } + + protected void SetRotation(AxisAngle value, bool force) + { + if (!(this.Rotation != value) && !force) + return; + this.PropertyManager.SetRotationProp(this, value); + AxisAngle aaRotation = value; + if (this.m_window.IsRightToLeft && aaRotation.Axis.Y <= 0.0 && aaRotation.Axis.X <= 0.0) + aaRotation.Angle = -aaRotation.Angle; + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetRotation(aaRotation); + } + + protected Vector3 CenterPointScale + { + get + { + Vector3 result = Vector3.Zero; + if (this.IsDynamicValueSet(PropId.CenterPointScale)) + { + this.PropertyManager.GetCenterPointScaleProp(this, out result); + Debug2.Validate(result != Vector3.Zero, typeof(InvalidOperationException), "expected non-unit scale if HasCenterPointScale flag was set"); + } + return result; + } + set + { + if (this.m_window.IsRightToLeft) + value.X = 1f - value.X; + if (!(this.CenterPointScale != value)) + return; + this.PropertyManager.SetCenterPointScaleProp(this, value); + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetCenterPointScale(value); + } + } + + protected uint Layer + { + get + { + uint result = 0; + if (this.IsDynamicValueSet(PropId.Layer)) + { + this.PropertyManager.GetLayerProp(this, out result); + Debug2.Validate(result != 0U, typeof(InvalidOperationException), "expected non-zero layer if HasLayer flag was set"); + } + return result; + } + set + { + if ((int)this.Layer == (int)value) + return; + this.PropertyManager.SetLayerProp(this, value); + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetLayer(value); + } + } + + protected bool Visible + { + get => this.GetVisible(); + set + { + if (this.Visible == value) + return; + this.SetVisible(value); + if (!this.FlushValues) + return; + this.m_remoteVisual.SendSetVisible(value); + } + } + + protected bool RelativeSize + { + get => this.m_bvDataBits[s_bvsRelativeSize] != 0; + set + { + int num = value ? 1 : 0; + if (this.m_bvDataBits[s_bvsRelativeSize] == num) + return; + this.m_bvDataBits[s_bvsRelativeSize] = num; + this.m_remoteVisual.SendSetRelativeSize(value); + } + } + + internal bool IsValid => this.GetValid(); + + public MouseOptions MouseOptions + { + get => (MouseOptions)this.m_bvDataBits[s_bvsMouse]; + set + { + Debug2.Validate((value & ~MouseOptions.ValidMask) == MouseOptions.None, typeof(ArgumentException), "Expected valid mouse bits"); + uint nMask = (uint)this.m_bvDataBits[s_bvsMouse] ^ (uint)(short)value; + if (nMask != 0U && this.FlushValues) + this.m_remoteVisual.SendChangeDataBits((uint)value, nMask); + this.m_bvDataBits[s_bvsMouse] = (short)value; + } + } + + internal Visual.DebugBits DebugOptions + { + get => (Visual.DebugBits)this.m_bvDataBits[s_bvsDebug]; + set + { + Debug2.Validate((value & ~DebugBits.Dump) == DebugBits.None, typeof(ArgumentException), "Expected valid debug bits"); + Debug2.Validate((uint)value < byte.MaxValue, typeof(ArgumentException), "Expected valid debug bits"); + uint nMask = (uint)((Visual.DebugBits)this.m_bvDataBits[s_bvsDebug] ^ value); + if (nMask != 0U) + { + uint nValue = (uint)value << 5; + if (this.m_remoteVisual.IsValid) + this.m_remoteVisual.SendChangeDataBits(nValue, nMask); + } + this.m_bvDataBits[s_bvsDebug] = (int)value; + } + } + + protected VisualPropertyManager PropertyManager => this.m_window.Session.VisualPropertyManager; + + internal ColorF DEBUG_OutlineColor + { + get => s_colorTransparent; + set + { + } + } + + private bool GetValid() => this.m_bvDataBits[s_bvsValid] != 0; + + private void SetValid(bool fValid) => this.m_bvDataBits[s_bvsValid] = fValid ? 1 : 0; + + private bool GetVisible() => this.m_bvDataBits[s_bvsVisible] != 0; + + private void SetVisible(bool fVisible) => this.m_bvDataBits[s_bvsVisible] = fVisible ? 1 : 0; + + internal bool IsDynamicValueSet(Visual.PropId propid) + { + Debug2.Validate(propid < PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); + return this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] != 0; + } + + internal void SetDynamicValueSet(Visual.PropId propid, bool fValue) + { + Debug2.Validate(propid < PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); + this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; + } + + internal bool IsPropFlagSet(Visual.PropId propid) + { + Debug2.Validate(propid >= PropId.MaxDynamicProp && propid < PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call IsPropFlagSet on this propid"); + return this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] != 0; + } + + internal void SetPropFlag(Visual.PropId propid, bool fValue) + { + Debug2.Validate(propid >= PropId.MaxDynamicProp && propid < PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call SetPropFlag on this propid"); + this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; + } + + internal override void Reset() + { + this.RemoveFromTree(); + this.RemoveAllGradients(); + bool flushValues = this.FlushValues; + this.FlushValues = false; + this.Position = Vector3.Zero; + this.Scale = Vector3.UnitVector; + this.Size = Vector2.Zero; + this.Layer = 0U; + this.Alpha = 1f; + this.Rotation = AxisAngle.Identity; + this.Visible = true; + this.CenterPointScale = Vector3.Zero; + this.OwnerData = null; + this.MouseOptions = MouseOptions.None; + this.FlushValues = flushValues; + this.m_remoteVisual.SendReset(); + } + + private bool FlushValues + { + get => this.m_bvDataBits[s_bvsFlush] != 0; + set => this.m_bvDataBits[s_bvsFlush] = value ? 1 : 0; + } + + RENDERHANDLE IAnimatableObject.GetObjectId() => ((IRenderHandleOwner)this).RenderHandle; + + uint IAnimatableObject.GetPropertyId(string propertyName) + { + if (propertyName == PositionProperty) + return 1; + if (propertyName == AlphaProperty) + return 2; + if (propertyName == RotationProperty || propertyName == OrientationProperty) + return 3; + if (propertyName == ScaleProperty) + return 4; + if (propertyName == SizeProperty) + return 5; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); + return 0; + } + + AnimationInputType IAnimatableObject.GetPropertyType( + string propertyName) + { + if (propertyName == PositionProperty) + return AnimationInputType.Vector3; + if (propertyName == AlphaProperty) + return AnimationInputType.Float; + if (propertyName == RotationProperty) + return AnimationInputType.Vector4; + if (propertyName == OrientationProperty) + return AnimationInputType.Quaternion; + if (propertyName == ScaleProperty) + return AnimationInputType.Vector3; + if (propertyName == SizeProperty) + return AnimationInputType.Vector2; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); + return AnimationInputType.Float; + } + + public override int GetHashCode() => this.m_remoteVisual.GetHashCode(); + + public override bool Equals(object oRHS) => base.Equals(oRHS); + + [System.Flags] + internal enum DebugBits + { + MarkForOutline = 1, + IgnoreOutlineAll = 2, + Dump = IgnoreOutlineAll | MarkForOutline, // 0x00000003 + None = 0, + ValidMask = Dump, // 0x00000003 + } + + internal enum PropId + { + Alpha = 0, + Scale = 1, + Rotation = 2, + CenterPointScale = 3, + Layer = 4, + OutlineColor = 5, + CoordMap = 6, + Gradients = 7, + Camera = 8, + MaxDynamicProp = 9, + NineGrid = 9, + MaxFlagProp = 10, // 0x0000000A + } + + private enum AnimatableProperties : uint + { + Position = 1, + Alpha = 2, + Rotation = 3, + Scale = 4, + Size = 5, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualContainer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualContainer.cs new file mode 100644 index 0000000..4e5fb7d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualContainer.cs @@ -0,0 +1,163 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VisualContainer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class VisualContainer : + Visual, + IVisualContainer, + IVisual, + IRawInputSite, + IAnimatable, + ISharedRenderObject + { + private bool m_fIsRoot; + + internal VisualContainer( + bool isRoot, + RenderSession session, + RenderWindow window, + object objOwnerData, + out RemoteVisual remoteVisual) + : base(session, window, objOwnerData) + { + Debug2.Validate(session != null, typeof(ArgumentNullException), "Must have valid RenderSession"); + session.AssertOwningThread(); + Debug2.Validate(this.m_window != null, typeof(InvalidOperationException), "Parent visual should have saved our render window"); + this.m_fIsRoot = isRoot; + this.m_remoteVisual = session.BuildRemoteVisualContainer(this); + this.m_remoteVisual.SendSetVisible(true); + remoteVisual = this.m_remoteVisual; + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose) + return; + this.RemoveAllChildren(); + if (!this.IsDynamicValueSet(PropId.Camera)) + return; + this.PropertyManager.RemoveCameraProp(this); + } + finally + { + base.Dispose(fInDispose); + } + } + + private void SetCamera(ICamera camera) + { + this.PropertyManager.SetCameraProp(this, (Camera)camera); + RemoteVisualContainer remoteVisual = (RemoteVisualContainer)this.m_remoteVisual; + if (camera != null) + remoteVisual.SendSetCamera(((Camera)camera).RemoteStub); + else + remoteVisual.SendSetCamera(null); + } + + bool IVisualContainer.IsRoot => this.m_fIsRoot; + + Vector3 IVisualContainer.Position + { + get => this.Position; + set => this.Position = value; + } + + void IVisualContainer.SetPosition(Vector3 value, bool force) => this.SetPosition(value, force); + + Vector2 IVisualContainer.Size + { + get => this.Size; + set => this.Size = value; + } + + void IVisualContainer.SetSize(Vector2 value, bool force) => this.SetSize(value, force); + + bool IVisualContainer.Visible + { + get => this.Visible; + set => this.Visible = value; + } + + Vector3 IVisualContainer.Scale + { + get => this.Scale; + set => this.Scale = value; + } + + void IVisualContainer.SetScale(Vector3 value, bool force) => this.SetScale(value, force); + + AxisAngle IVisualContainer.Rotation + { + get => this.Rotation; + set => this.Rotation = value; + } + + void IVisualContainer.SetRotation(AxisAngle value, bool force) => this.SetRotation(value, force); + + float IVisualContainer.Alpha + { + get => this.Alpha; + set => this.Alpha = value; + } + + void IVisualContainer.SetAlpha(float value, bool force) => this.SetAlpha(value, force); + + Vector3 IVisualContainer.CenterPoint + { + get => this.CenterPointScale; + set => this.CenterPointScale = value; + } + + int IVisualContainer.ChildCount => this.ChildCount; + + uint IVisualContainer.Layer + { + get => this.Layer; + set => this.Layer = value; + } + + ICamera IVisualContainer.Camera + { + get + { + Camera result = null; + if (this.IsDynamicValueSet(PropId.Camera)) + this.PropertyManager.GetCameraProp(this, out result); + return result; + } + set => this.SetCamera(value); + } + + void IVisualContainer.AddGradient(IGradient gradient) => this.AddGradient((Gradient)gradient); + + void IVisualContainer.RemoveAllGradients() => this.RemoveAllGradients(); + + void IVisualContainer.AddChild( + IVisual vChild, + IVisual vSibling, + VisualOrder nOrder) + { + Visual visual = (Visual)vChild; + Visual visualSibling = null; + if (vSibling != null) + visualSibling = (Visual)vSibling; + visual.ChangeParent(this, visualSibling, nOrder); + } + + void IVisualContainer.RemoveChild(IVisual vChild) => ((Visual)vChild).ChangeParent(null, null, VisualOrder.First); + + void IVisualContainer.RemoveAllChildren() => this.RemoveAllChildren(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualPropertyManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualPropertyManager.cs new file mode 100644 index 0000000..ed8f8ab --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Graphics/VisualPropertyManager.cs @@ -0,0 +1,246 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Graphics.VisualPropertyManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Graphics +{ + internal class VisualPropertyManager : IDisposable + { + private SmartMap m_scaleProp; + private SmartMap m_centerPointScaleProp; + private SmartMap m_layerProp; + private SmartMap m_coordMapProp; + private SmartMap m_alphaProp; + private SmartMap m_rotationProp; + private SmartMap> m_gradientProp; + private SmartMap m_cameraProp; + + public VisualPropertyManager() + { + this.m_alphaProp = new SmartMap(); + this.m_coordMapProp = new SmartMap(); + this.m_gradientProp = new SmartMap>(); + this.m_layerProp = new SmartMap(); + this.m_rotationProp = new SmartMap(); + this.m_scaleProp = new SmartMap(); + this.m_centerPointScaleProp = new SmartMap(); + this.m_cameraProp = new SmartMap(); + } + + public void Dispose() + { + Debug2.Validate(this.m_alphaProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_coordMapProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_gradientProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_layerProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_rotationProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_scaleProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_centerPointScaleProp.IsEmpty, typeof(InvalidOperationException), "empty"); + Debug2.Validate(this.m_cameraProp.IsEmpty, typeof(InvalidOperationException), "empty"); + } + + public bool GetScaleProp(Visual key, out Vector3 result) + { + bool condition = this.m_scaleProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have scale"); + return condition; + } + + public void SetScaleProp(Visual key, Vector3 oValue) + { + if (oValue != Vector3.UnitVector) + { + this.m_scaleProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Scale, true); + } + else + { + if (!key.IsDynamicValueSet(Visual.PropId.Scale)) + return; + this.RemoveScaleProp(key); + } + } + + public void RemoveScaleProp(Visual key) + { + this.m_scaleProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Scale, false); + } + + public bool GetAlphaProp(Visual key, out float result) + { + bool condition = this.m_alphaProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have alpha"); + return condition; + } + + public void SetAlphaProp(Visual key, float oValue) + { + if (!Math2.WithinEpsilon(oValue, 1f)) + { + this.m_alphaProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Alpha, true); + } + else + { + if (!key.IsDynamicValueSet(Visual.PropId.Alpha)) + return; + this.RemoveAlphaProp(key); + } + } + + public void RemoveAlphaProp(Visual key) + { + this.m_alphaProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Alpha, false); + } + + public bool GetRotationProp(Visual key, out AxisAngle result) + { + bool condition = this.m_rotationProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have rotation"); + return condition; + } + + public void SetRotationProp(Visual key, AxisAngle oValue) + { + if (oValue != AxisAngle.Identity) + { + this.m_rotationProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Rotation, true); + } + else + { + if (!key.IsDynamicValueSet(Visual.PropId.Rotation)) + return; + this.RemoveRotationProp(key); + } + } + + public void RemoveRotationProp(Visual key) + { + this.m_rotationProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Rotation, false); + } + + public bool GetCenterPointScaleProp(Visual key, out Vector3 result) + { + bool condition = this.m_centerPointScaleProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have center point scale"); + return condition; + } + + public void SetCenterPointScaleProp(Visual key, Vector3 oValue) + { + if (oValue != Vector3.Zero) + { + this.m_centerPointScaleProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.CenterPointScale, true); + } + else + { + if (!key.IsDynamicValueSet(Visual.PropId.CenterPointScale)) + return; + this.RemoveCenterPointScaleProp(key); + } + } + + public void RemoveCenterPointScaleProp(Visual key) + { + this.m_centerPointScaleProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.CenterPointScale, false); + } + + public bool GetLayerProp(Visual key, out uint result) + { + bool condition = this.m_layerProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have layer"); + return condition; + } + + public void SetLayerProp(Visual key, uint oValue) + { + if (oValue != 0U) + { + this.m_layerProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Layer, true); + } + else + { + if (!key.IsDynamicValueSet(Visual.PropId.Layer)) + return; + this.RemoveLayerProp(key); + } + } + + public void RemoveLayerProp(Visual key) + { + this.m_layerProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Layer, false); + } + + public bool GetGradientProp(Visual key, out Vector result) + { + bool condition = this.m_gradientProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have gradient"); + return condition; + } + + public void SetGradientProp(Visual key, Vector oValue) + { + this.m_gradientProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Gradients, true); + } + + public void RemoveGradientProp(Visual key) + { + this.m_gradientProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Gradients, false); + } + + public bool GetCameraProp(Visual key, out Camera result) + { + bool condition = this.m_cameraProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have Camera"); + return condition; + } + + public void SetCameraProp(Visual key, Camera oValue) + { + this.m_cameraProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.Camera, true); + } + + public void RemoveCameraProp(Visual key) + { + this.m_cameraProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.Camera, false); + } + + public bool GetCoordmapProp(Visual key, out ArrayList result) + { + bool condition = this.m_coordMapProp.TryGetValue((uint)key.GetHashCode(), out result); + Debug2.Validate(condition, typeof(InvalidOperationException), "should have coordmap"); + return condition; + } + + public void SetCoordmapProp(Visual key, ArrayList oValue) + { + this.m_coordMapProp.SetValue((uint)key.GetHashCode(), oValue); + key.SetDynamicValueSet(Visual.PropId.CoordMap, true); + } + + public void RemoveCoordmapProp(Visual key) + { + this.m_coordMapProp.Remove((uint)key.GetHashCode()); + key.SetDynamicValueSet(Visual.PropId.CoordMap, false); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/GraphicsDeviceType.cs b/UIX.RenderApi/Microsoft/Iris/Render/GraphicsDeviceType.cs new file mode 100644 index 0000000..5178bfa --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/GraphicsDeviceType.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.GraphicsDeviceType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum GraphicsDeviceType + { + None, + Gdi, + Direct3D9, + XeDirectX9, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/GraphicsRenderingQuality.cs b/UIX.RenderApi/Microsoft/Iris/Render/GraphicsRenderingQuality.cs new file mode 100644 index 0000000..bd1fbde --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/GraphicsRenderingQuality.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.GraphicsRenderingQuality +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum GraphicsRenderingQuality + { + MinQuality, + MaxQuality, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/HSLElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/HSLElement.cs new file mode 100644 index 0000000..44f7dc7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/HSLElement.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.HSLElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + internal class HSLElement : EffectOperation + { + internal const string HuePropertyName = "Hue"; + internal const string SaturationPropertyName = "Saturation"; + internal const string LightnessPropertyName = "Lightness"; + private float m_flHue; + private byte m_nHueID; + private float m_flSaturation; + private byte m_nSaturationID; + private float m_flLightness; + private byte m_nLightnessID; + + public HSLElement(string stName, float flHue, float flSaturation, float flLightness) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); + Debug2.Validate(flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); + Debug2.Validate(flLightness >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Lightness is >= 0"); + this.m_flHue = flHue; + this.m_flSaturation = flSaturation; + this.m_flLightness = flLightness; + this.m_stName = stName; + } + + public HSLElement() => this.m_typeOperation = EffectOperationType.HSL; + + public float Hue + { + get => this.m_flHue; + set => this.m_flHue = value; + } + + internal byte HueID => this.m_nHueID; + + public float Saturation + { + get => this.m_flSaturation; + set => this.m_flSaturation = value; + } + + internal byte SaturationID => this.m_nSaturationID; + + public float Lightness + { + get => this.m_flLightness; + set => this.m_flLightness = value; + } + + internal byte LightnessID => this.m_nLightnessID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", 8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", 8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Lightness", 8, ref this.m_nLightnessID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Lightness", EffectPropertyType.Float, m_flLightness, this.m_nLightnessID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Hue", this.HueID, this.Hue, cacheKey); + this.GeneratePropertyCacheKey("Saturation", this.SaturationID, this.Saturation, cacheKey); + this.GeneratePropertyCacheKey("Lightness", this.LightnessID, this.Lightness, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/HSVElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/HSVElement.cs new file mode 100644 index 0000000..cabceea --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/HSVElement.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.HSVElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + internal class HSVElement : EffectOperation + { + internal const string HuePropertyName = "Hue"; + internal const string SaturationPropertyName = "Saturation"; + internal const string ValuePropertyName = "Value"; + private float m_flHue; + private byte m_nHueID; + private float m_flSaturation; + private byte m_nSaturationID; + private float m_flValue; + private byte m_nValueID; + + public HSVElement(string stName, float flHue, float flSaturation, float flValue) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); + Debug2.Validate(flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); + Debug2.Validate(flValue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Value is >= 0"); + this.m_flHue = flHue; + this.m_flSaturation = flSaturation; + this.m_flValue = flValue; + this.m_stName = stName; + } + + public HSVElement() => this.m_typeOperation = EffectOperationType.HSV; + + public float Hue + { + get => this.m_flHue; + set => this.m_flHue = value; + } + + internal byte HueID => this.m_nHueID; + + public float Saturation + { + get => this.m_flSaturation; + set => this.m_flSaturation = value; + } + + internal byte SaturationID => this.m_nSaturationID; + + public float Value + { + get => this.m_flValue; + set => this.m_flValue = value; + } + + internal byte ValueID => this.m_nValueID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", 8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", 8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", 8, ref this.m_nValueID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, m_flValue, this.m_nValueID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Hue", this.HueID, this.Hue, cacheKey); + this.GeneratePropertyCacheKey("Saturation", this.SaturationID, this.Saturation, cacheKey); + this.GeneratePropertyCacheKey("Value", this.ValueID, this.Value, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/HWND.cs b/UIX.RenderApi/Microsoft/Iris/Render/HWND.cs new file mode 100644 index 0000000..6d207f7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/HWND.cs @@ -0,0 +1,58 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.HWND +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct HWND + { + public IntPtr h; + + public HWND(IntPtr hwnd) => this.h = hwnd; + + public static HWND NULL => new HWND() + { + h = IntPtr.Zero + }; + + public static HWND HWND_TOP => new HWND() + { + h = new IntPtr(0) + }; + + public static HWND HWND_BOTTOM => new HWND() + { + h = new IntPtr(1) + }; + + public static HWND HWND_TOPMOST => new HWND() + { + h = new IntPtr(-1) + }; + + public static HWND HWND_NOTOPMOST => new HWND() + { + h = new IntPtr(-2) + }; + + public static HWND HWND_MESSAGE => new HWND() + { + h = new IntPtr(-3) + }; + + public static bool operator ==(HWND hl, HWND hr) => hl.h == hr.h; + + public static bool operator !=(HWND hl, HWND hr) => hl.h != hr.h; + + public override bool Equals(object oCompare) => this.h == (IntPtr)oCompare; + + public override int GetHashCode() => (int)this.h.ToInt64(); + + public override string ToString() => base.ToString(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IActivatable.cs b/UIX.RenderApi/Microsoft/Iris/Render/IActivatable.cs new file mode 100644 index 0000000..106cac9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IActivatable.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IActivatable +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IActivatable + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimatable.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimatable.cs new file mode 100644 index 0000000..44f9c7f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimatable.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimatable +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimatable : ISharedRenderObject + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimation.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimation.cs new file mode 100644 index 0000000..064dbe2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimation.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimation : ISharedRenderObject + { + int RepeatCount { get; set; } + + bool IsPlaying { get; } + + bool IsActive { get; } + + bool AutoReset { get; set; } + + AnimationResetBehavior ResetBehavior { get; set; } + + void Play(); + + void Pause(); + + void Reset(); + + void InstantAdvance(float advanceTime); + + void InstantFinish(); + + event AsyncNotifyHandler AsyncNotifyEvent; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimationGroup.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationGroup.cs new file mode 100644 index 0000000..802262b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationGroup.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimationGroup +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimationGroup : IAnimation, ISharedRenderObject + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimationInputProvider.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationInputProvider.cs new file mode 100644 index 0000000..0d69352 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationInputProvider.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimationInputProvider +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimationInputProvider : IAnimatable, ISharedRenderObject + { + void PublishFloat(string propertyName, float value); + + void PublishVector2(string propertyName, Vector2 value); + + void PublishVector3(string propertyName, Vector3 value); + + void PublishVector4(string propertyName, Vector4 value); + + void PublishQuaternion(string propertyName, Quaternion value); + + void RevokeFloat(string propertyName); + + void RevokeVector2(string propertyName); + + void RevokeVector3(string propertyName); + + void RevokeVector4(string propertyName); + + void RevokeQuaternion(string propertyName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimationPropertyMap.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationPropertyMap.cs new file mode 100644 index 0000000..673793f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationPropertyMap.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimationPropertyMap +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimationPropertyMap + { + uint GetPropertyId(string propertyName); + + AnimationInputType GetPropertyType(string propertyName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IAnimationSystem.cs b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationSystem.cs new file mode 100644 index 0000000..078219e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IAnimationSystem.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IAnimationSystem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IAnimationSystem + { + int UpdatesPerSecond { get; set; } + + float SpeedAdjustment { get; set; } + + bool BackCompat { set; } + + IKeyframeAnimation CreateKeyframeAnimation( + object objUser, + AnimationInput initialValue); + + IAnimationGroup CreateAnimationGroup(object objUser); + + IExternalAnimationInput CreateExternalAnimationInput( + object objUser, + IAnimationPropertyMap propertyMap); + + void PulseTimeAdvance(int nAdvanceMs); + + void PauseAnimations(); + + void StepAnimations(int nAdvanceMs); + + void ResumeAnimations(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ICamera.cs b/UIX.RenderApi/Microsoft/Iris/Render/ICamera.cs new file mode 100644 index 0000000..852f442 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ICamera.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ICamera +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface ICamera : IAnimatable, ISharedRenderObject + { + Vector3 Eye { get; set; } + + Vector3 At { get; set; } + + Vector3 Up { get; set; } + + float Zn { get; set; } + + bool Perspective { get; set; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IDebug.cs b/UIX.RenderApi/Microsoft/Iris/Render/IDebug.cs new file mode 100644 index 0000000..47e77ce --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IDebug.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IDebug +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IDebug : IDisposable + { + void Enter(string context); + + void Leave(string context); + + void Assert(bool condition, string message); + + void Throw(bool condition, string message); + + void Write(DebugCategory category, int verbosityLevel, string message); + + void WriteLine(DebugCategory category, int verbosityLevel, string message); + + void Indent(DebugCategory category, int verbosityLevel); + + void Unindent(DebugCategory category, int verbosityLevel); + + bool IsCategoryEnabled(DebugCategory category, int verbosityLevel); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IDeferredInvokeItem.cs b/UIX.RenderApi/Microsoft/Iris/Render/IDeferredInvokeItem.cs new file mode 100644 index 0000000..92ef022 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IDeferredInvokeItem.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IDeferredInvokeItem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IDeferredInvokeItem + { + void Dispatch(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IDisplay.cs b/UIX.RenderApi/Microsoft/Iris/Render/IDisplay.cs new file mode 100644 index 0000000..2be03d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IDisplay.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IDisplay +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IDisplay + { + string DeviceName { get; } + + Rectangle ScreenArea { get; } + + Rectangle WorkArea { get; } + + bool IsPrimary { get; } + + TvFormat TvFormat { get; } + + bool TvMode { get; } + + Size LogicalFullScreenResolution { get; } + + DisplayMode[] SupportedModes { get; } + + DisplayMode[] ExtraModes { get; } + + DisplayMode[] AllModes { get; } + + DisplayMode CurrentMode { get; } + + DisplayMode DesktopMode { get; } + + string MonitorPnP { get; } + + bool ValidateDisplayMode( + DisplayMode modeDesired, + DisplayModeFlags nCheck, + bool fAllowAllModes, + out DisplayMode modeComplete, + out DisplayModeFlags nCompleteCheck); + + bool ChangeFullScreenResolution(DisplayMode modeChanges, DisplayModeFlags nValid); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IDisplayManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/IDisplayManager.cs new file mode 100644 index 0000000..7bb62b9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IDisplayManager.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IDisplayManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IDisplayManager + { + IDisplay PrimaryDisplay { get; } + + DisplayMode[] ExtraModes { get; set; } + + IDisplay DisplayFromDeviceName(string stDeviceName); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IEffect.cs b/UIX.RenderApi/Microsoft/Iris/Render/IEffect.cs new file mode 100644 index 0000000..b0b0204 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IEffect.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IEffect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IEffect : IAnimatable, ISharedRenderObject + { + void SetProperty(string stPropertyName, int nValue); + + void SetProperty(string stPropertyName, float flValue); + + void SetProperty(string stPropertyName, Vector2 vValue); + + void SetProperty(string stPropertyName, Vector3 vValue); + + void SetProperty(string stPropertyName, Vector4 vValue); + + void SetProperty(string stPropertyName, ColorF colorValue); + + void SetProperty(string stPropertyName, IImage imgValue); + + void SetProperty(string stPropertyName, IImage[] imgValue); + + void SetProperty(string stPropertyName, IVideoStream streamValue); + + string Name { get; } + + IEffectTemplate Template { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IEffectTemplate.cs b/UIX.RenderApi/Microsoft/Iris/Render/IEffectTemplate.cs new file mode 100644 index 0000000..77ff52c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IEffectTemplate.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IEffectTemplate +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IEffectTemplate : ISharedRenderObject + { + void AddEffectProperty(string stPath); + + bool Build(EffectInput input); + + IEffect CreateInstance(object objUser); + + bool IsBuilt { get; } + + string Name { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IExternalAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/IExternalAnimationInput.cs new file mode 100644 index 0000000..3cf7b07 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IExternalAnimationInput.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IExternalAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IExternalAnimationInput : IAnimatable, ISharedRenderObject + { + uint UniqueId { get; } + + IAnimationInputProvider CreateProvider(object objUser); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IGradient.cs b/UIX.RenderApi/Microsoft/Iris/Render/IGradient.cs new file mode 100644 index 0000000..5c5a285 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IGradient.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IGradient +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IGradient : ISharedRenderObject + { + Orientation Orientation { get; set; } + + ColorF ColorMask { get; set; } + + float Offset { get; set; } + + void AddValue(float flPosition, float flValue, RelativeSpace rsSpace); + + void Clear(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IGraphicsDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/IGraphicsDevice.cs new file mode 100644 index 0000000..5729b58 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IGraphicsDevice.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IGraphicsDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IGraphicsDevice + { + GraphicsDeviceType DeviceType { get; } + + Size MaximumImageSize { get; } + + bool IsVideoComposited { get; } + + GraphicsRenderingQuality RenderingQuality { get; } + + void RenderNowIfPossible(); + + void BeginCaptureBackBuffer(string stFileName); + + void EndCaptureBackBuffer(); + + void TriggerDeviceReset(); + + event BackBufferCapturedHandler BackBufferCapturedEvent; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IHwndHostWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/IHwndHostWindow.cs new file mode 100644 index 0000000..2681124 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IHwndHostWindow.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IHwndHostWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IHwndHostWindow : IDisposable + { + ColorF BackgroundColor { get; set; } + + Point ClientPosition { get; set; } + + IntPtr Hwnd { get; } + + bool Visible { get; set; } + + Size WindowSize { get; set; } + + event EventHandler OnHandleChanged; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IImage.cs b/UIX.RenderApi/Microsoft/Iris/Render/IImage.cs new file mode 100644 index 0000000..920bfbc --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IImage.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IImage +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IImage : ISharedRenderObject + { + Size Size { get; } + + ImageFormat Format { get; } + + string Identifier { get; } + + bool LoadContent(ImageFormat format, Size size, int Stride, IntPtr Data); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IInputSystem.cs b/UIX.RenderApi/Microsoft/Iris/Render/IInputSystem.cs new file mode 100644 index 0000000..ef2ef9d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IInputSystem.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IInputSystem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IInputSystem + { + void RegisterRawInputCallbacks(IRawInputCallbacks handlers); + + void UnregisterRawInputCallbacks(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IKeyframeAnimation.cs b/UIX.RenderApi/Microsoft/Iris/Render/IKeyframeAnimation.cs new file mode 100644 index 0000000..ca99211 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IKeyframeAnimation.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IKeyframeAnimation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IKeyframeAnimation : IAnimation, ISharedRenderObject, IActivatable + { + int KeyframeCount { get; } + + AnimationInput InitialValue { get; } + + AnimationInput Reference { get; set; } + + AnimationInput Scale { get; set; } + + AnimationInputType Type { get; } + + void AddKeyframe(AnimationKeyframe keyframe); + + AnimationKeyframe GetKeyframe(int keyframeIndex); + + void SetKeyframe(int keyframeIndex, AnimationKeyframe keyframe); + + void AddTarget(IAnimatable targetObject, string targetProperty); + + void AddTarget(IAnimatable targetObject, string targetProperty, string targetPropertyMask); + + void RemoveTarget(IAnimatable targetObject, string targetProperty, string targetPropertyMask); + + void RemoveAllTargets(); + + void AddStageEvent(AnimationStage animationStage, AnimationEvent animationEvent); + + void AddTimeEvent(float absoluteTime, AnimationEvent animationEvent); + + void AddProgressEvent(float progress, AnimationEvent animationEvent); + + void AddValueEvent( + ValueEventCondition condition, + AnimationInput reference, + AnimationEvent animationEvent); + + void RemoveEvent(AnimationEvent animationEvent); + + void RemoveAllEvents(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRawInputCallbacks.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRawInputCallbacks.cs new file mode 100644 index 0000000..98ed1e7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRawInputCallbacks.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRawInputCallbacks +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; + +namespace Microsoft.Iris.Render +{ + public interface IRawInputCallbacks + { + InputHandlerFlags InputHandlerMask { get; } + + void HandleRawKeyboardInput(uint messageID, InputModifiers modifiers, ref RawKeyboardData args); + + void HandleRawMouseInput(uint messageID, InputModifiers modifiers, ref RawMouseData args); + + void HandleRawHidInput(ref RawHidData args); + + void HandleRawDragInput(uint messageID, InputModifiers modifiers, ref RawDragData args); + + void HandleAppCommand(ref RawHidData args); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRenderEngine.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRenderEngine.cs new file mode 100644 index 0000000..a852567 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRenderEngine.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRenderEngine +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IRenderEngine : IRenderObject, IDisposable + { + void Initialize( + GraphicsDeviceType typeGraphics, + GraphicsRenderingQuality renderingQuality, + SoundDeviceType typeSound); + + IRenderSession Session { get; } + + IRenderWindow Window { get; } + + IDisplayManager DisplayManager { get; } + + bool ProcessNativeEvents(); + + void WaitForWork(uint nTimeoutInMsecs); + + void InterThreadWake(); + + void FlushBatch(); + + bool IsGraphicsDeviceAvailable(GraphicsDeviceType type, bool fFilterRecommended); + + bool IsSoundDeviceAvailable(SoundDeviceType type); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRenderHost.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRenderHost.cs new file mode 100644 index 0000000..8f6844e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRenderHost.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRenderHost +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IRenderHost + { + void DeferredInvoke(DeferredInvokePriority priority, IDeferredInvokeItem item, TimeSpan delay); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRenderObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRenderObject.cs new file mode 100644 index 0000000..bb412f4 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRenderObject.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRenderObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IRenderObject : IDisposable + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRenderSession.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRenderSession.cs new file mode 100644 index 0000000..b1e8b58 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRenderSession.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRenderSession +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface IRenderSession : IRenderObject, IDisposable + { + IAnimationSystem AnimationSystem { get; } + + IInputSystem InputSystem { get; } + + IGraphicsDevice GraphicsDevice { get; } + + ISoundDevice SoundDevice { get; } + + IEffectTemplate CreateEffectTemplate(object objUser, string stName); + + IVideoStream CreateVideoStream(object objUser); + + IVisualContainer CreateVisualContainer(object objUser, object objOwnerData); + + ICamera CreateCamera(object objUser); + + IGradient CreateGradient(object objUser); + + ISprite CreateSprite(object objUser, object objOwnerData); + + IImage CreateImage(object objUser, string identifier, ContentNotifyHandler handler); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IRenderWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/IRenderWindow.cs new file mode 100644 index 0000000..7edef93 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IRenderWindow.cs @@ -0,0 +1,139 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IRenderWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; + +namespace Microsoft.Iris.Render +{ + public interface IRenderWindow + { + int Left { get; } + + int Top { get; } + + int Right { get; } + + int Bottom { get; } + + int Width { get; } + + int Height { get; } + + HWND WindowHandle { get; } + + Size ClientSize { get; set; } + + Size InitialClientSize { get; set; } + + FormPlacement InitialPlacement { set; } + + FormPlacement FinalPlacement { get; } + + int MinResizeWidth { get; set; } + + int MaxResizeWidth { get; set; } + + Point Position { get; set; } + + string Text { get; set; } + + Cursor Cursor { get; set; } + + Cursor IdleCursor { get; set; } + + bool Visible { get; set; } + + bool IsLoaded { get; } + + ColorF BackgroundColor { get; set; } + + bool EnableExternalDragDrop { get; set; } + + bool IsDragInProgress { get; set; } + + IDisplay CurrentDisplay { get; set; } + + bool FullScreenExclusive { get; set; } + + bool ActivationState { get; } + + WindowState WindowState { get; set; } + + FormStyleInfo Styles { get; set; } + + HWND AppNotifyWindow { set; } + + IVisualContainer VisualRoot { get; } + + void Initialize(); + + void SetIcon(string sModuleName, uint nResourceID, IconFlags nOptions); + + void SetEdgeImages(bool fActiveEdges, ShadowEdgePart[] edges); + + void SetWindowOptions(WindowOptions options, bool enable); + + void SetMouseIdleOptions(Size sizeMouseIdleTolerance, uint nMouseIdleDelay); + + void SetCapture(IRawInputSite captureSite, bool state); + + void SetDragDropResult(uint nDragOverResult, uint nDragDropResult); + + void ClientToScreen(ref Point point); + + void ScreenToClient(ref Point point); + + void ForceMouseIdle(bool fIdle); + + void LockMouseActive(bool fActive); + + void RefreshHitTarget(); + + void TakeFocus(); + + void TakeForeground(bool fForce); + + void BringToTop(); + + void Restore(); + + void TemporarilyExitExclusiveMode(); + + void Close(FormCloseReason fcrCloseReason); + + IHwndHostWindow CreateHwndHostWindow(); + + event LocationChangedHandler LocationChangedEvent; + + event SizeChangedHandler SizeChangedEvent; + + event MonitorChangedHandler MonitorChangedEvent; + + event WindowStateChangedHandler WindowStateChangedEvent; + + event SysCommandHandler SysCommandEvent; + + event MouseIdleHandler MouseIdleEvent; + + event ShowHandler ShowEvent; + + event ActivationChangeHandler ActivationChangeEvent; + + event SessionActivateHandler SessionActivateEvent; + + event SessionConnectHandler SessionConnectEvent; + + event SetFocusHandler SetFocusEvent; + + event LoadHandler LoadEvent; + + event CloseHandler CloseEvent; + + event CloseRequestHandler CloseRequestEvent; + + event ForwardMessageHandler ForwardMessageEvent; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISharedRenderObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISharedRenderObject.cs new file mode 100644 index 0000000..c89520d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISharedRenderObject.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISharedRenderObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface ISharedRenderObject + { + int UsageCount { get; } + + void RegisterUsage(object user); + + void UnregisterUsage(object user); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISound.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISound.cs new file mode 100644 index 0000000..a8ef9ec --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISound.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISound +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface ISound : ISharedRenderObject, IActivatable + { + void Play(); + + void Stop(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISoundBuffer.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISoundBuffer.cs new file mode 100644 index 0000000..66af289 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISoundBuffer.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISoundBuffer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface ISoundBuffer : ISharedRenderObject + { + ISound CreateSound(object objUser); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISoundData.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISoundData.cs new file mode 100644 index 0000000..aecf98f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISoundData.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISoundData +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public interface ISoundData + { + SoundDataFormat Format { get; } + + uint ChannelCount { get; } + + uint SampleRate { get; } + + uint SampleSize { get; } + + uint SampleCount { get; } + + IntPtr AcquireContent(); + + void ReleaseContent(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISoundDevice.cs new file mode 100644 index 0000000..ac59700 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISoundDevice.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface ISoundDevice + { + SoundDeviceType DeviceType { get; } + + bool Mute { get; set; } + + float Volume { get; set; } + + ISoundBuffer CreateSoundBuffer(object objUser, ISoundData soundData); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ISprite.cs b/UIX.RenderApi/Microsoft/Iris/Render/ISprite.cs new file mode 100644 index 0000000..4fa61ca --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ISprite.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ISprite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; + +namespace Microsoft.Iris.Render +{ + public interface ISprite : IVisual, IRawInputSite, IAnimatable, ISharedRenderObject + { + Vector3 Position { get; set; } + + Vector2 Size { get; set; } + + bool Visible { get; set; } + + Vector3 Scale { get; set; } + + AxisAngle Rotation { get; set; } + + float Alpha { get; set; } + + Vector3 CenterPoint { get; set; } + + uint Layer { get; set; } + + IEffect Effect { get; set; } + + bool RelativeSize { get; set; } + + void AddGradient(IGradient gradient); + + void RemoveAllGradients(); + + void SetCoordMap(int idxLayer, CoordMap coordMap); + + void SetNineGrid(int left, int top, int right, int bottom); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IVideoStream.cs b/UIX.RenderApi/Microsoft/Iris/Render/IVideoStream.cs new file mode 100644 index 0000000..0d278e1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IVideoStream.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IVideoStream +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public interface IVideoStream : ISharedRenderObject + { + int StreamID { get; } + + float ContentOverscan { get; set; } + + int ContentAspectWidth { get; } + + int ContentAspectHeight { get; } + + int ContentHeight { get; } + + int ContentWidth { get; } + + event InvalidateContentHandler InvalidateContentEvent; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IVisual.cs b/UIX.RenderApi/Microsoft/Iris/Render/IVisual.cs new file mode 100644 index 0000000..ba46d51 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IVisual.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IVisual +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; + +namespace Microsoft.Iris.Render +{ + public interface IVisual : IRawInputSite, IAnimatable, ISharedRenderObject + { + MouseOptions MouseOptions { get; set; } + + IVisualContainer Parent { get; } + + string DebugID { get; set; } + + ColorF DebugColor { get; set; } + + void Remove(); + + void CopyFrom(IVisual visualSource); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IVisualContainer.cs b/UIX.RenderApi/Microsoft/Iris/Render/IVisualContainer.cs new file mode 100644 index 0000000..f8bf749 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IVisualContainer.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IVisualContainer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; + +namespace Microsoft.Iris.Render +{ + public interface IVisualContainer : IVisual, IRawInputSite, IAnimatable, ISharedRenderObject + { + bool IsRoot { get; } + + Vector3 Position { get; set; } + + Vector2 Size { get; set; } + + bool Visible { get; set; } + + Vector3 Scale { get; set; } + + AxisAngle Rotation { get; set; } + + float Alpha { get; set; } + + Vector3 CenterPoint { get; set; } + + uint Layer { get; set; } + + int ChildCount { get; } + + ICamera Camera { get; set; } + + void SetPosition(Vector3 value, bool force); + + void SetSize(Vector2 value, bool force); + + void SetScale(Vector3 value, bool force); + + void SetRotation(AxisAngle value, bool force); + + void SetAlpha(float value, bool force); + + void AddGradient(IGradient gradient); + + void RemoveAllGradients(); + + void AddChild(IVisual vChild, IVisual vSibling, VisualOrder nOrder); + + void RemoveChild(IVisual vChild); + + void RemoveAllChildren(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IconFlags.cs b/UIX.RenderApi/Microsoft/Iris/Render/IconFlags.cs new file mode 100644 index 0000000..7ccac21 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IconFlags.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IconFlags +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Flags] + public enum IconFlags + { + Small = 1, + Large = 2, + All = Large | Small, // 0x00000003 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ImageElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/ImageElement.cs new file mode 100644 index 0000000..4f6ec97 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ImageElement.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ImageElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class ImageElement : EffectInput + { + internal const string ImagePropertyName = "Image"; + internal const string UVOffsetPropertyName = "UVOffset"; + private IImage m_image; + private byte m_nImageID; + private Vector2 m_UVOffset; + private byte m_nUVOffsetID; + + public ImageElement(string stName, IImage imgSource) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + this.m_stName = stName; + this.m_image = imgSource; + } + + public ImageElement() + { + this.m_stName = nameof(Image); + this.m_typeInput = EffectInputType.Image; + } + + public IImage Image + { + get => this.m_image; + set => this.m_image = value; + } + + internal byte ImageID => this.m_nImageID; + + public Vector2 UVOffset + { + get => this.m_UVOffset; + set => this.m_UVOffset = value; + } + + internal byte UVOffsetID => this.m_nUVOffsetID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID); + this.AddEffectProperty(dictionary, "Image"); + this.m_nImageID = nNextUniqueID++; + return num + this.PreProcessProperty(dictionary, "UVOffset", 12, ref this.m_nUVOffsetID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) + { + if (!this.GenerateProperty("Image", EffectPropertyType.Image, m_image, this.m_nImageID, dictProperties)) + return false; + dictProperties[this.GeneratePropertyPath("Image")].IsDynamic = true; + return this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, m_UVOffset, this.m_nUVOffsetID, dictProperties); + } + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("UVOffset", this.UVOffsetID, this.UVOffset, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ImageFormat.cs b/UIX.RenderApi/Microsoft/Iris/Render/ImageFormat.cs new file mode 100644 index 0000000..2d939bd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ImageFormat.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ImageFormat +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum ImageFormat + { + None, + A8R8G8B8, + X8R8G8B8, + A8, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Inset.cs b/UIX.RenderApi/Microsoft/Iris/Render/Inset.cs new file mode 100644 index 0000000..8f60440 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Inset.cs @@ -0,0 +1,101 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Inset +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public struct Inset + { + private int _left; + private int _top; + private int _right; + private int _bottom; + public static readonly Inset Zero = new Inset(0, 0, 0, 0); + + public Inset(int left, int top, int right, int bottom) + { + this._left = left; + this._top = top; + this._right = right; + this._bottom = bottom; + } + + internal Inset(Point topLeft, Point rightBottom) + { + this._left = topLeft.X; + this._top = topLeft.Y; + this._right = rightBottom.X; + this._bottom = rightBottom.Y; + } + + public int Left + { + get => this._left; + set => this._left = value; + } + + public int Top + { + get => this._top; + set => this._top = value; + } + + public int Right + { + get => this._right; + set => this._right = value; + } + + public int Bottom + { + get => this._bottom; + set => this._bottom = value; + } + + public static Inset operator +(Inset left, Inset right) => new Inset(left.Left + right.Left, left.Top + right.Top, left.Right + right.Right, left.Bottom + right.Bottom); + + public static Inset Add(Inset left, Inset right) => left + right; + + public static Inset operator -(Inset left, Inset right) => new Inset(left.Left - right.Left, left.Top - right.Top, left.Right - right.Right, left.Bottom - right.Bottom); + + public static Inset operator -(Inset left) => new Inset(-left.Left, -left.Top, -left.Right, -left.Bottom); + + public static Inset Subtract(Inset left, Inset right) => left - right; + + public override bool Equals(object obj) => obj is Inset inset && this == inset; + + public static bool operator ==(Inset left, Inset right) => left.Left == right.Left && left.Top == right.Top && left.Right == right.Right && left.Bottom == right.Bottom; + + public static bool operator !=(Inset left, Inset right) => !(left == right); + + public override int GetHashCode() => this.Left ^ (this.Top << 13 | (int)((uint)this.Top >> 19)) ^ (this.Right << 26 | (int)((uint)this.Right >> 6)) ^ (this.Bottom << 7 | (int)((uint)this.Bottom >> 25)); + + public override string ToString() => base.ToString(); + + internal Point TopLeft + { + get => new Point(this.Left, this.Top); + set + { + this.Left = value.X; + this.Top = value.Y; + } + } + + internal Point BottomRight + { + get => new Point(this.Right, this.Bottom); + set + { + this.Right = value.X; + this.Bottom = value.Y; + } + } + + public Size Size => new Size(this.Left + this.Right, this.Top + this.Bottom); + + public Rectangle ToRect => new Rectangle(this.Left, this.Right, this.Top, this.Bottom); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/Bits.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Bits.cs new file mode 100644 index 0000000..4ca329b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Bits.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.Bits +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.Render.Internal +{ + internal static class Bits + { + public static bool TestFlag(int nValue, int nMask) => (nValue & nMask) != 0; + + public static bool TestFlag(uint nValue, uint nMask) => ((int)nValue & (int)nMask) != 0; + + public static bool TestAnyFlags(int nValue, int nMask) => (nValue & nMask) != 0; + + public static bool TestAnyFlags(uint nValue, uint nMask) => ((int)nValue & (int)nMask) != 0; + + public static bool TestAllFlags(int nValue, int nMask) => (nValue & nMask) == nMask; + + public static bool TestAllFlags(uint nValue, uint nMask) => ((int)nValue & (int)nMask) == (int)nMask; + + public static void SetFlag(ref int nValue, int nMask) => nValue |= nMask; + + public static void SetFlag(ref uint nValue, uint nMask) => nValue |= nMask; + + public static void ClearFlag(ref int nValue, int nMask) => nValue &= ~nMask; + + public static void ClearFlag(ref uint nValue, uint nMask) => nValue &= ~nMask; + + public static void ChangeFlags(ref int nValue, int nNewValue, int nMask) => nValue = nNewValue & nMask | nValue & ~nMask; + + public static void ChangeFlags(ref uint nValue, uint nNewValue, uint nMask) => nValue = (uint)((int)nNewValue & (int)nMask | (int)nValue & ~(int)nMask); + + public static void ChangeFlag(ref int nValue, bool fFlag, int nMask) + { + int num = fFlag ? nMask : 0; + nValue = num & nMask | nValue & ~nMask; + } + + public static void ChangeFlag(ref uint nValue, bool fFlag, uint nMask) + { + uint num = fFlag ? nMask : 0U; + nValue = (uint)((int)num & (int)nMask | (int)nValue & ~(int)nMask); + } + + public static void FlipFlags(ref int nValue, int nMask) => nValue ^= nMask; + + public static void FlipFlags(ref uint nValue, uint nMask) => nValue ^= nMask; + + public static int ExtractFlags(int nValue, int nMask) => nValue & nMask; + + public static int ExtractFlags(int nValue, int nMask, int cShiftBits) => (nValue & nMask) >> cShiftBits; + + public static uint ExtractFlags(uint nValue, uint nMask) => nValue & nMask; + + public static uint ExtractFlags(uint nValue, uint nMask, int cShiftBits) => (nValue & nMask) >> cShiftBits; + + [Conditional("DEBUG")] + public static void AssertFlags(int nTestFlags, int nValidFlags) + { + } + + [Conditional("DEBUG")] + public static void AssertFlags(uint nTestFlags, uint nValidFlags) + { + } + + public static void PromptFlags(int nTestFlags, int nValidFlags) => Debug2.Validate((nTestFlags & nValidFlags) == nTestFlags, typeof(ArgumentException), "Ensure valid flags"); + + public static void PromptFlags(uint nTestFlags, uint nValidFlags) => Debug2.Validate(((int)nTestFlags & (int)nValidFlags) == (int)nTestFlags, typeof(ArgumentException), "Ensure valid flags"); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/DataCookie.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/DataCookie.cs new file mode 100644 index 0000000..b8fe0d5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/DataCookie.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.DataCookie +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Internal +{ + internal struct DataCookie + { + public static readonly DataCookie NULL = new DataCookie(); + private uint m_value; + + private DataCookie(uint value) => this.m_value = value; + + public static bool operator ==(DataCookie hl, DataCookie hr) => (int)hl.m_value == (int)hr.m_value; + + public static bool operator !=(DataCookie hl, DataCookie hr) => (int)hl.m_value != (int)hr.m_value; + + public override bool Equals(object oCompare) + { + uint num; + if (oCompare is DataCookie dataCookie) + num = dataCookie.m_value; + else if (oCompare is uint value) + num = value; + else + return false; + + return (int)m_value == (int)num; + + } + + public override int GetHashCode() => (int)this.m_value; + + internal static DataCookie FromUInt32(uint value) => new DataCookie(value); + + internal static uint ToUInt32(DataCookie handle) => handle.m_value; + + public static DataCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/Display.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Display.cs new file mode 100644 index 0000000..532f335 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Display.cs @@ -0,0 +1,290 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.Display +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections.Generic; + +namespace Microsoft.Iris.Render.Internal +{ + internal class Display : IDisplay + { + private string m_stDeviceName; + private Rectangle m_rcMonitor; + private Rectangle m_rcWork; + private bool m_fPrimaryMonitor; + private DisplayManager m_owner; + private RenderEngine m_engine; + private uint m_nDisplayId; + private TvFormat m_nTvFormat; + private string m_stMonitorPnP; + private DisplayMode m_modeDesktop; + private DisplayMode m_modeCurrent; + private DisplayModeFlags m_nCurrentValid; + private DisplayMode[] m_arSupportedModes; + private DisplayMode[] m_arExtraModes; + private DisplayMode[] m_arAllModes; + + internal Display( + DisplayManager owner, + RenderEngine engine, + string stDeviceName, + uint nDisplayID) + { + this.m_stDeviceName = stDeviceName; + this.m_owner = owner; + this.m_engine = engine; + this.m_nDisplayId = nDisplayID; + this.m_arSupportedModes = DisplayMode.EmptyModes; + this.m_arExtraModes = DisplayMode.EmptyModes; + this.m_arAllModes = DisplayMode.EmptyModes; + this.m_modeCurrent = new DisplayMode(); + this.m_nCurrentValid = 0; + } + + public string DeviceName => this.m_stDeviceName; + + public Rectangle ScreenArea => this.m_rcMonitor; + + public Rectangle WorkArea => this.m_rcWork; + + public bool IsPrimary => this.m_fPrimaryMonitor; + + public TvFormat TvFormat => this.m_nTvFormat; + + public bool TvMode => this.m_modeCurrent.fTvMode; + + public Size LogicalFullScreenResolution => this.m_modeCurrent.sizeLogicalPxl.IsZero ? (this.m_modeCurrent.sizePhysicalPxl.IsZero ? this.m_rcMonitor.Size : this.m_modeCurrent.sizePhysicalPxl) : this.m_modeCurrent.sizeLogicalPxl; + + internal uint UniqueId => this.m_nDisplayId; + + public DisplayMode[] SupportedModes => this.m_arSupportedModes; + + public DisplayMode[] ExtraModes => this.m_arExtraModes; + + public DisplayMode[] AllModes => this.m_arAllModes; + + public DisplayMode CurrentMode => this.m_modeCurrent; + + public DisplayMode DesktopMode => this.m_modeDesktop; + + public string MonitorPnP => this.m_stMonitorPnP; + + public bool ValidateDisplayMode( + DisplayMode modeDesired, + DisplayModeFlags nCheck, + bool fAllowAllModes, + out DisplayMode modeComplete, + out DisplayModeFlags nCompleteCheck) + { + if (fAllowAllModes) + { + if (this.m_arAllModes == null || this.m_arAllModes.Length == 0) + { + modeComplete = modeDesired; + nCompleteCheck = nCheck; + return false; + } + } + else if (this.m_arSupportedModes == null || this.m_arSupportedModes.Length == 0) + { + modeComplete = modeDesired; + nCompleteCheck = nCheck; + return false; + } + this.CompleteDisplayMode(ref modeDesired, ref nCheck); + modeComplete = this.m_modeCurrent; + nCompleteCheck = this.m_nCurrentValid; + DisplayMode[] array = fAllowAllModes ? this.m_arAllModes : this.m_arExtraModes; + DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer(); + if (Array.BinarySearch(array, modeDesired, renderModeComparer) >= 0) + { + modeComplete = modeDesired; + nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate; + } + else + { + modeComplete = this.m_modeDesktop; + int num = ComputeRank(this.m_modeDesktop, modeDesired, nCheck); + nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate; + foreach (DisplayMode arSupportedMode in this.m_arSupportedModes) + { + int rank = ComputeRank(arSupportedMode, modeDesired, nCheck); + if (rank >= num) + { + modeComplete = arSupportedMode; + num = rank; + nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate; + } + } + if (modeDesired.sizeLogicalPxl.Width > 0 && modeDesired.sizeLogicalPxl.Height > 0) + { + modeComplete.sizeLogicalPxl.Width = modeComplete.sizePhysicalPxl.Width; + modeComplete.sizeLogicalPxl.Height = modeComplete.sizePhysicalPxl.Width * modeDesired.sizeLogicalPxl.Height / modeDesired.sizeLogicalPxl.Width; + } + else + modeComplete.sizeLogicalPxl = modeComplete.sizePhysicalPxl; + } + if (Bits.TestFlag((int)nCheck, 8)) + { + modeComplete.fTvMode = modeDesired.fTvMode; + nCompleteCheck |= DisplayModeFlags.TvMode; + } + return true; + } + + 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), "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); + this.m_nCurrentValid |= nValid; + if (this.m_modeCurrent != modeCurrent) + { + this.m_owner.RemoteStub.SendChangeFullScreenMode(this.m_nDisplayId, new RenderDisplayMode() + { + sizePhysicalPxl = this.m_modeCurrent.sizePhysicalPxl, + sizeLogicalPxl = this.m_modeCurrent.sizeLogicalPxl, + nFormat = this.m_modeCurrent.nFormat, + nRefreshRate = this.m_modeCurrent.nRefreshRate, + Interlaced = this.m_modeCurrent.fInterlaced + }, this.m_modeCurrent.fTvMode); + flag = true; + this.m_engine.Window.NotifyDisplayReconfigured(); + } + return flag; + } + + private static int ComputeRank( + DisplayMode modeValid, + DisplayMode modeDesired, + DisplayModeFlags nCheck) + { + int num1 = 0; + if (Bits.TestFlag((int)nCheck, 2)) + { + if (modeValid.nFormat == modeDesired.nFormat) + { + num1 += 4000; + } + else + { + int num2 = SurfaceFormatInfo.GetBitsPerPixel(modeValid.nFormat); + int num3 = SurfaceFormatInfo.GetBitsPerPixel(modeDesired.nFormat); + if (num2 == 24) + num2 = 32; + if (num3 == 24) + num3 = 32; + if (num2 == num3) + num1 += 3500; + } + } + if (Bits.TestFlag((int)nCheck, 1) && !modeValid.sizePhysicalPxl.IsZero) + { + 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(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; + } + } + if (Bits.TestFlag((int)nCheck, 4) && modeValid.fInterlaced == modeDesired.fInterlaced) + { + int num2 = Math.Abs(modeDesired.nRefreshRate - modeValid.nRefreshRate); + if (num2 >= 15) + return -1; + int num3 = 1000 * (15 - num2) / 15; + num1 += num3; + } + return num1; + } + + private void CompleteDisplayMode(ref DisplayMode modeDesired, ref DisplayModeFlags nCheck) + { + if (!Bits.TestFlag((int)nCheck, 1)) + { + if (Bits.TestFlag((int)this.m_nCurrentValid, 1) && !this.m_modeCurrent.sizePhysicalPxl.IsZero) + { + modeDesired.sizePhysicalPxl = this.m_modeCurrent.sizePhysicalPxl; + modeDesired.sizeLogicalPxl = this.m_modeCurrent.sizeLogicalPxl; + nCheck |= DisplayModeFlags.Size; + } + else + { + modeDesired.sizePhysicalPxl.Width = this.m_rcMonitor.Width; + modeDesired.sizePhysicalPxl.Height = this.m_rcMonitor.Height; + modeDesired.sizeLogicalPxl.Width = this.m_rcMonitor.Width; + modeDesired.sizeLogicalPxl.Height = this.m_rcMonitor.Height; + nCheck |= DisplayModeFlags.Size; + } + } + if (!Bits.TestFlag((int)nCheck, 2) && Bits.TestFlag((int)this.m_nCurrentValid, 2)) + { + modeDesired.nFormat = this.m_modeCurrent.nFormat; + nCheck |= DisplayModeFlags.Format; + } + if (!Bits.TestFlag((int)nCheck, 4)) + { + if (Bits.TestFlag((int)this.m_nCurrentValid, 4) && this.m_modeCurrent.nRefreshRate > 0) + { + modeDesired.nRefreshRate = this.m_modeCurrent.nRefreshRate; + modeDesired.fInterlaced = this.m_modeCurrent.fInterlaced; + nCheck |= DisplayModeFlags.RefreshRate; + } + else + { + modeDesired.nRefreshRate = 60; + modeDesired.fInterlaced = false; + nCheck |= DisplayModeFlags.RefreshRate; + } + } + if (Bits.TestFlag((int)nCheck, 8) || !Bits.TestFlag((int)this.m_nCurrentValid, 8)) + return; + modeDesired.fTvMode = this.m_modeCurrent.fTvMode; + nCheck |= DisplayModeFlags.TvMode; + } + + internal void UpdateMonitorInfo( + Rectangle rcMonitor, + Rectangle rcWork, + bool fPrimary, + TvFormat nTvFormat, + string stMonitorPnP, + DisplayMode modeDesktop) + { + this.m_rcMonitor = rcMonitor; + this.m_rcWork = rcWork; + this.m_fPrimaryMonitor = fPrimary; + this.m_nTvFormat = nTvFormat; + this.m_modeDesktop = modeDesktop; + this.m_stMonitorPnP = stMonitorPnP; + } + + internal void UpdateDisplayModes( + DisplayMode[] arNewSupportedModes, + DisplayMode[] arNewExtraModes, + DisplayMode[] arNewAllModes) + { + this.m_arSupportedModes = arNewSupportedModes; + if (this.m_arSupportedModes == null) + this.m_arSupportedModes = DisplayMode.EmptyModes; + this.m_arExtraModes = arNewExtraModes; + if (this.m_arExtraModes == null) + this.m_arExtraModes = DisplayMode.EmptyModes; + this.m_arAllModes = arNewAllModes; + if (this.m_arAllModes != null) + return; + this.m_arAllModes = DisplayMode.EmptyModes; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/DisplayManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/DisplayManager.cs new file mode 100644 index 0000000..f631fe8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/DisplayManager.cs @@ -0,0 +1,339 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.DisplayManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + internal class DisplayManager : + RenderObject, + IDisplayManager, + IDesktopManagerCallback, + IRenderHandleOwner, + IEnumerable + { + private const uint MONITORINFOF_PRIMARY = 1; + private static ushort[] s_ByteOrder_MonitorInfoCallbackMsg; + private RenderSession m_session; + private RenderEngine m_engine; + private RemoteDesktopManager m_remoteManager; + private DisplayMode[] m_arExtraModes; + private DisplayManager.DisplayInfo m_info; + private DisplayManager.DisplayInfo m_infoRebuilding; + private Display m_dispRebuildLastAdded; + private ArrayList m_alRebuildSupportedModes; + private ArrayList m_alRebuildAllModes; + private bool m_fPendingChangeNotification; + + private DisplayManager(RenderSession session, RenderEngine engine, bool fEnumDisplayModes) + { + this.m_session = session; + this.m_engine = engine; + this.m_info = new DisplayManager.DisplayInfo(); + this.m_arExtraModes = DisplayMode.EmptyModes; + this.m_remoteManager = this.m_session.BuildRemoteDesktopManager(this, fEnumDisplayModes); + this.m_remoteManager.SendRebuildMonitorCache(); + } + + internal static DisplayManager CreateDisplayManager( + RenderSession session, + RenderEngine engine, + bool fEnumDisplayModes) + { + return new DisplayManager(session, engine, fEnumDisplayModes); + } + + protected override void Dispose(bool fInDispose) + { + if (fInDispose && this.m_remoteManager != null) + this.m_remoteManager.Dispose(); + this.m_remoteManager = null; + base.Dispose(fInDispose); + } + + public IDisplay PrimaryDisplay => m_info.primaryDisplay; + + public DisplayMode[] ExtraModes + { + get => this.m_arExtraModes; + set + { + if (value == null) + value = DisplayMode.EmptyModes; + this.m_arExtraModes = value; + } + } + + internal RemoteDesktopManager RemoteStub => this.m_remoteManager; + + public IDisplay DisplayFromDeviceName(string stDeviceName) => this.DisplayFromName(stDeviceName); + + private Display DisplayFromName(string stDeviceName) + { + Display display1 = null; + if (!string.IsNullOrEmpty(stDeviceName)) + { + foreach (Display display2 in this.m_info.displays) + { + if (string.Compare(display2.DeviceName, stDeviceName, StringComparison.OrdinalIgnoreCase) == 0) + { + display1 = display2; + break; + } + } + } + return display1; + } + + internal Display DisplayFromUniqueId(uint idDisplay) + { + foreach (Display display in this.m_info.displays) + { + if ((int)idDisplay == (int)display.UniqueId) + return display; + } + return null; + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteManager.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteManager = null; + + void IDesktopManagerCallback.OnBeginEnumMonitorInfo(RENDERHANDLE target) + { + this.m_infoRebuilding = new DisplayManager.DisplayInfo(); + this.m_dispRebuildLastAdded = null; + this.m_alRebuildSupportedModes = new ArrayList(); + this.m_alRebuildAllModes = new ArrayList(); + } + + void IDesktopManagerCallback.OnEndEnumMonitorInfo(RENDERHANDLE target) + { + foreach (Display display in this.m_infoRebuilding.displays) + { + if (display.IsPrimary) + this.m_infoRebuilding.primaryDisplay = display; + } + this.m_info = this.m_infoRebuilding; + 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(new DeferredHandler(this.DeliverDisplayChangeNotification), null, DeferredInvokePriority.Normal); + this.m_fPendingChangeNotification = true; + } + + unsafe void IDesktopManagerCallback.OnMonitorInfo( + RENDERHANDLE target, + Message* pmsgRaw) + { + if (this.m_session.IsForeignByteOrderOnWindowing) + 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(display); + } + + void IDesktopManagerCallback.OnBeginDisplayModes(RENDERHANDLE target) + { + } + + void IDesktopManagerCallback.OnDisplayMode( + RENDERHANDLE target, + RenderDisplayMode rmodeAdd, + bool fSupported) + { + DisplayMode displayMode = new DisplayMode(); + displayMode.sizePhysicalPxl = rmodeAdd.sizePhysicalPxl; + displayMode.sizeLogicalPxl = rmodeAdd.sizeLogicalPxl; + displayMode.nFormat = rmodeAdd.nFormat; + displayMode.nRefreshRate = rmodeAdd.nRefreshRate; + displayMode.fInterlaced = rmodeAdd.Interlaced; + displayMode.fTvMode = false; + if (fSupported) + this.m_alRebuildSupportedModes.Add(displayMode); + else + this.m_alRebuildAllModes.Add(displayMode); + } + + void IDesktopManagerCallback.OnEndDisplayModes(RENDERHANDLE target) + { + DisplayMode[] arSupportedModes; + DisplayMode[] arExtraModes; + DisplayMode[] arAllModes; + this.BuildModeLists(out arSupportedModes, out arExtraModes, out arAllModes); + if (arSupportedModes.Length <= 0) + return; + this.m_dispRebuildLastAdded.UpdateDisplayModes(arSupportedModes, arExtraModes, arAllModes); + } + + public IEnumerator GetEnumerator() => this.m_info != null ? this.m_info.displays.GetEnumerator() : new Display[0].GetEnumerator(); + + public event EventHandler DisplayChange; + + private void DeliverDisplayChangeNotification(object param) + { + if (!this.m_fPendingChangeNotification) + return; + this.m_fPendingChangeNotification = false; + if (this.DisplayChange == null) + return; + this.DisplayChange(this, EventArgs.Empty); + } + + private unsafe Display ConvertMonitorInfo(DisplayManager.MonitorInfoCallbackMsg* pmsg) + { + string stringUni1 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szDevice1)); + Display display = null; + if (this.m_info != null) + display = this.DisplayFromName(stringUni1); + if (display == null) + display = new Display(this, this.m_engine, stringUni1, pmsg->idDisplay); + Rectangle rcMonitor = new Rectangle(pmsg->rcMonLeft, pmsg->rcMonTop, pmsg->rcMonRight - pmsg->rcMonLeft, pmsg->rcMonBottom - pmsg->rcMonTop); + Rectangle rcWork = new Rectangle(pmsg->rcWrkLeft, pmsg->rcWrkTop, pmsg->rcWrkRight - pmsg->rcWrkLeft, pmsg->rcWrkBottom - pmsg->rcWrkTop); + bool fPrimary = ((int)pmsg->dwFlags & 1) != 0; + TvFormat nTvFormat = (TvFormat)pmsg->nTvFormat; + DisplayMode modeDesktop = new DisplayMode(); + modeDesktop.sizePhysicalPxl.Width = pmsg->sizeScreenWidth; + modeDesktop.sizePhysicalPxl.Height = pmsg->sizeScreenHeight; + modeDesktop.sizeLogicalPxl.Width = pmsg->sizeScreenWidth; + modeDesktop.sizeLogicalPxl.Height = pmsg->sizeScreenHeight; + modeDesktop.nFormat = (SurfaceFormat)pmsg->nFormat; + modeDesktop.nRefreshRate = pmsg->nRefreshRate; + modeDesktop.fInterlaced = pmsg->fInterlaced != 0U; + modeDesktop.fTvMode = false; + string stringUni2 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szMonitorPnP1)); + display.UpdateMonitorInfo(rcMonitor, rcWork, fPrimary, nTvFormat, stringUni2, modeDesktop); + return display; + } + + private void BuildModeLists( + out DisplayMode[] arSupportedModes, + out DisplayMode[] arExtraModes, + out DisplayMode[] arAllModes) + { + DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer(); + arSupportedModes = (DisplayMode[])this.m_alRebuildSupportedModes.ToArray(typeof(DisplayMode)); + Array.Sort(arSupportedModes, renderModeComparer); + arAllModes = (DisplayMode[])this.m_alRebuildAllModes.ToArray(typeof(DisplayMode)); + Array.Sort(arAllModes, renderModeComparer); + Vector vector = new Vector(); + int length = this.m_arExtraModes.Length; + List[] intListArray = new List[length]; + for (int index = 0; index < length; ++index) + intListArray[index] = new List(); + for (int index1 = 0; index1 < this.m_alRebuildAllModes.Count; ++index1) + { + DisplayMode alRebuildAllMode = (DisplayMode)this.m_alRebuildAllModes[index1]; + if (Array.BinarySearch(arSupportedModes, alRebuildAllMode, renderModeComparer) < 0) + { + for (int index2 = 0; index2 < this.m_arExtraModes.Length; ++index2) + { + DisplayMode arExtraMode = this.m_arExtraModes[index2]; + if (DisplayMode.CompareRenderModes(alRebuildAllMode, arExtraMode) == 0) + { + vector.Add(alRebuildAllMode); + intListArray[index2] = null; + } + else if (DisplayMode.CompareSimilarModes(alRebuildAllMode, arExtraMode) == 0) + intListArray[index2]?.Add(index1); + } + } + } + foreach (List intList in intListArray) + { + if (intList != null) + { + foreach (int index in intList) + vector.Add((DisplayMode)this.m_alRebuildAllModes[index]); + } + } + arExtraModes = vector.ToArray(); + Array.Sort(arExtraModes, renderModeComparer); + } + + private class DisplayInfo + { + public Display primaryDisplay; + public ArrayList displays = new ArrayList(); + } + + [ComVisible(false)] + private struct MonitorInfoCallbackMsg + { + public uint cbSize; + public int nMsg; + public RENDERHANDLE idObjectSubject; + public uint idDisplay; + public uint nTvFormat; + public int sizeScreenWidth; + public int sizeScreenHeight; + public uint nFormat; + public int nRefreshRate; + public uint fInterlaced; + public uint cbMiSize; + public int rcMonLeft; + public int rcMonTop; + public int rcMonRight; + public int rcMonBottom; + public int rcWrkLeft; + public int rcWrkTop; + public int rcWrkRight; + public int rcWrkBottom; + public uint dwFlags; + public long pad_szDevice1; + public long pad_szDevice2; + public long pad_szDevice3; + public long pad_szDevice4; + public long pad_szDevice5; + public long pad_szDevice6; + public long pad_szDevice7; + public long pad_szDevice8; + public long pad_szMonitorPnP1; + public long pad_szMonitorPnP2; + public long pad_szMonitorPnP3; + public long pad_szMonitorPnP4; + public long pad_szMonitorPnP5; + public long pad_szMonitorPnP6; + public long pad_szMonitorPnP7; + public long pad_szMonitorPnP8; + public long pad_szMonitorPnP9; + public long pad_szMonitorPnP10; + public long pad_szMonitorPnP11; + public long pad_szMonitorPnP12; + public long pad_szMonitorPnP13; + public long pad_szMonitorPnP14; + public long pad_szMonitorPnP15; + public long pad_szMonitorPnP16; + public long pad_szMonitorPnP17; + public long pad_szMonitorPnP18; + public long pad_szMonitorPnP19; + public long pad_szMonitorPnP20; + public long pad_szMonitorPnP21; + public long pad_szMonitorPnP22; + public long pad_szMonitorPnP23; + public long pad_szMonitorPnP24; + public long pad_szMonitorPnP25; + public long pad_szMonitorPnP26; + public long pad_szMonitorPnP27; + public long pad_szMonitorPnP28; + public long pad_szMonitorPnP29; + public long pad_szMonitorPnP30; + public long pad_szMonitorPnP31; + public long pad_szMonitorPnP32; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/EventCookie.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/EventCookie.cs new file mode 100644 index 0000000..998e2e9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/EventCookie.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.EventCookie +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Internal +{ + internal struct EventCookie + { + public static readonly EventCookie NULL = new EventCookie(); + private uint m_value; + + private EventCookie(uint value) => this.m_value = value; + + public static bool operator ==(EventCookie hl, EventCookie hr) => (int)hl.m_value == (int)hr.m_value; + + public static bool operator !=(EventCookie hl, EventCookie hr) => (int)hl.m_value != (int)hr.m_value; + + public override bool Equals(object oCompare) + { + uint num; + + if (oCompare is EventCookie eventCookie) + num = eventCookie.m_value; + else if (oCompare is uint value) + num = value; + else + return false; + + return (int)m_value == (int)num; + } + + public override int GetHashCode() => (int)this.m_value; + + internal static EventCookie FromUInt32(uint value) => new EventCookie(value); + + internal static uint ToUInt32(EventCookie handle) => handle.m_value; + + public static EventCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/FormApi.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/FormApi.cs new file mode 100644 index 0000000..72a3b54 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/FormApi.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.FormApi +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + internal static class FormApi + { + private const string s_stEhRenderDll = "UIXRender.dll"; + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpGdiplusInit(); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpGdiplusUninit(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/GraphicsCaps.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/GraphicsCaps.cs new file mode 100644 index 0000000..a5d61d5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/GraphicsCaps.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.GraphicsCaps +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + [ComVisible(false)] + [Serializable] + internal struct GraphicsCaps + { + internal uint DeviceType; + internal int MaxSimultaneousTextures; + internal int MaxTextureWidth; + internal int MaxTextureHeight; + internal ulong DedicatedVideoMemory; + internal ulong TotalVideoMemory; + internal uint PixelShaderProfile; + internal uint VertexShaderProfile; + internal int DriverWarning; + internal int AvailableRenderTargets; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/HRESULT.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/HRESULT.cs new file mode 100644 index 0000000..7c7077e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/HRESULT.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.HRESULT +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + internal struct HRESULT + { + public int hr; + + public HRESULT(int hr) => this.hr = hr; + + public static bool operator ==(HRESULT hrA, HRESULT hrB) => hrA.hr == hrB.hr; + + public static bool operator !=(HRESULT hrA, HRESULT hrB) => hrA.hr != hrB.hr; + + public override bool Equals(object oCompare) => oCompare is HRESULT hresult && this.hr == hresult.hr; + + public override int GetHashCode() => this.hr; + + public bool IsError() => this.hr < 0; + + public bool IsSuccess() => this.hr >= 0; + + public void HandleError() + { + if (!this.IsError()) + return; + Marshal.ThrowExceptionForHR(this.hr); + } + + public int Int => this.hr; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/HwndHostWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/HwndHostWindow.cs new file mode 100644 index 0000000..15d9d2f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/HwndHostWindow.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.HwndHostWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt; +using System; + +namespace Microsoft.Iris.Render.Internal +{ + internal sealed class HwndHostWindow : + RenderObject, + IHwndHostWindow, + IDisposable, + IHwndHostWindowCallback, + IRenderHandleOwner + { + private RemoteHwndHostWindow m_remoteWindow; + private ColorF m_clrBackground; + private HWND m_hwnd; + private Point m_ptClientPosition; + private Size m_sizeWindow; + private bool m_fVisible; + private EventHandler m_eventHandleChanged; + + public HwndHostWindow(RenderWindow winParent) + { + ProtocolSplashDesktopNt ntDesktopProtocol = winParent.Session.NtDesktopProtocol; + 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) + { + if (fInDispose && this.m_remoteWindow != null) + { + this.m_remoteWindow.Dispose(); + this.m_remoteWindow = null; + } + base.Dispose(fInDispose); + } + + ColorF IHwndHostWindow.BackgroundColor + { + get => this.m_clrBackground; + set + { + if (!(this.m_clrBackground != value)) + return; + this.m_clrBackground = value; + this.m_remoteWindow.SendSetBackgroundColor(value); + } + } + + Point IHwndHostWindow.ClientPosition + { + get => this.m_ptClientPosition; + set + { + if (!(this.m_ptClientPosition != value)) + return; + this.m_ptClientPosition = value; + this.m_remoteWindow.SendSetPosition(value); + } + } + + IntPtr IHwndHostWindow.Hwnd => this.m_hwnd.h; + + bool IHwndHostWindow.Visible + { + get => this.m_fVisible; + set + { + if (this.m_fVisible == value) + return; + this.m_fVisible = value; + this.m_remoteWindow.SendSetVisible(value); + } + } + + Size IHwndHostWindow.WindowSize + { + get => this.m_sizeWindow; + set + { + if (!(this.m_sizeWindow != value)) + return; + this.m_sizeWindow = value; + this.m_remoteWindow.SendSetSize(value); + } + } + + event EventHandler IHwndHostWindow.OnHandleChanged + { + add => this.m_eventHandleChanged += value; + remove => this.m_eventHandleChanged -= value; + } + + void IHwndHostWindowCallback.OnHandleChanged( + RENDERHANDLE target, + HWND hWnd) + { + this.m_hwnd = hWnd; + if (this.m_eventHandleChanged == null) + return; + this.m_eventHandleChanged(this, EventArgs.Empty); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/InputSystem.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/InputSystem.cs new file mode 100644 index 0000000..232891f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/InputSystem.cs @@ -0,0 +1,246 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.InputSystem +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Desktop; +using System; + +namespace Microsoft.Iris.Render.Internal +{ + internal sealed class InputSystem : RenderObject, IRenderHandleOwner, IInputSystem, IInputCallback + { + private const uint NG_KEYBOARD = 1; + private const uint NG_HIDCOMMAND = 2; + private const uint NG_APPCOMMAND = 3; + private const uint NG_WINDOWINPUT = 4; + private const uint NG_DRAGINPUT = 5; + private static ushort[] s_ByteOrder_KeyboardCommandMessage; + private static ushort[] s_ByteOrder_RemoteCallbackMessage; + private static ushort[] s_ByteOrder_HIDCommandMessage; + private static ushort[] s_ByteOrder_AppCommandMessage; + private static ushort[] s_ByteOrder_WindowInputCallbackMessage; + private static ushort[] s_ByteOrder_DragInputCallbackMessage; + private RenderSession m_session; + private RemoteInputRouter m_remoteInputRouter; + private IRawInputCallbacks m_inputHandlers; + private InputHandlerFlags m_maskInputHandlers; + + internal InputSystem(RenderSession session, RenderWindow window) + { + this.m_session = session; + this.Initialize(window); + } + + internal void Initialize(RenderWindow window) => this.m_remoteInputRouter = this.m_session.BuildRemoteInputRouter(this, window); + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_remoteInputRouter != null) + this.m_remoteInputRouter.Dispose(); + this.m_remoteInputRouter = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteInputRouter.RenderHandle; + + 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 s_ByteOrder_RemoteCallbackMessage, typeof(InputSystem.RemoteCallbackMessage), 0, 0); + switch (remoteCallbackMessagePtr->ownerMessage) + { + case 1: + if (this.m_session.IsForeignByteOrderOnWindowing) + 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 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 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 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 s_ByteOrder_DragInputCallbackMessage, typeof(InputSystem.DragInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + this.HandleDragInput((InputSystem.DragInputCallbackMessage*)remoteCallbackMessagePtr); + break; + default: + Debug2.Throw(false, "unexpected input type in IInputCallback.OnInput"); + break; + } + } + + public void RegisterRawInputCallbacks(IRawInputCallbacks handlers) + { + Debug2.Validate(handlers != null, typeof(ArgumentException), "must provide valid IRawInputCallbacks callback interface"); + Debug2.Validate(this.m_inputHandlers == null, typeof(InvalidOperationException), "Not allowed to register twice on one session"); + this.m_inputHandlers = handlers; + this.m_maskInputHandlers = this.m_inputHandlers.InputHandlerMask; + Debug2.Validate(this.m_maskInputHandlers != InputHandlerFlags.None, typeof(ArgumentException), "must register interest for at least one input type"); + } + + public void UnregisterRawInputCallbacks() + { + this.m_inputHandlers = null; + this.m_maskInputHandlers = InputHandlerFlags.None; + } + + private unsafe void HandleKeyboardInput(InputSystem.KeyboardCommandMessage* pmsg) + { + if (!this.IsRegisteredForInputType(InputHandlerFlags.Keyboard)) + return; + RawKeyboardData args = new RawKeyboardData((Keys)(ushort)pmsg->vk, pmsg->ScanCode, (uint)pmsg->repCount, pmsg->flags, pmsg->IsRemote != 0 ? InputDeviceType.Other : InputDeviceType.Keyboard); + this.m_inputHandlers.HandleRawKeyboardInput(pmsg->uiMsg, (InputModifiers)pmsg->stateValue, ref args); + } + + private unsafe void HandleHIDCommandInput(InputSystem.HIDCommandMessage* pmsg) + { + if (!this.IsRegisteredForInputType(InputHandlerFlags.Hid)) + return; + RawHidData args = new RawHidData(pmsg->usage, pmsg->usagePage, pmsg->wValue != 0U ? KeyAction.Down : KeyAction.Up, pmsg->IsRemote != 0 ? InputDeviceType.Other : InputDeviceType.Keyboard); + this.m_inputHandlers.HandleRawHidInput(ref args); + } + + private unsafe void HandleAppCommandInput(InputSystem.AppCommandMessage* pmsg) + { + if (!this.IsRegisteredForInputType(InputHandlerFlags.AppCommand)) + return; + RawHidData args1 = new RawHidData(pmsg->AppCommand, 0U, KeyAction.Down, InputDeviceType.Other); + this.m_inputHandlers.HandleAppCommand(ref args1); + RawHidData args2 = new RawHidData(pmsg->AppCommand, 0U, KeyAction.Up, InputDeviceType.Other); + this.m_inputHandlers.HandleAppCommand(ref args2); + } + + private unsafe void HandleWindowInput(InputSystem.WindowInputCallbackMessage* msg) + { + 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, msg->wheelDelta); + this.m_inputHandlers.HandleRawMouseInput(msg->messageValue, (InputModifiers)msg->modifiersValue, ref args); + } + + private unsafe void HandleDragInput(InputSystem.DragInputCallbackMessage* msg) + { + if (!this.IsRegisteredForInputType(InputHandlerFlags.Drag)) + return; + RawDragData args = new RawDragData(this.m_session.TryGetHandleOwner(msg->subjectValue), msg->positionXOffset, msg->positionYOffset, msg->pDataStream); + this.m_inputHandlers.HandleRawDragInput(msg->messageValue, (InputModifiers)msg->dragModifiers, ref args); + } + + private bool IsRegisteredForInputType(InputHandlerFlags flag) => this.m_inputHandlers != null && (this.m_maskInputHandlers & flag) == flag; + + protected override void Invariant() => Debug2.Validate(this.m_session != null, typeof(InvalidOperationException), this.GetType().ToString()); + + private struct RemoteCallbackMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerCookie; + public uint ownerMessage; + } + + private struct KeyboardCommandMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerHandle; + public uint codeValue; + public int IsRemote; + public int ScanCode; + public int vk; + public uint uiMsg; + public int repCount; + public uint stateValue; + public ushort flags; + } + + private struct HIDCommandMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerHandle; + public uint codeValue; + public int IsRemote; + public uint usagePage; + public uint usage; + public uint wValue; + } + + private struct AppCommandMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerHandle; + public uint codeValue; + public uint AppCommand; + public uint deviceValue; + public uint keysValue; + } + + private struct WindowInputCallbackMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerCookie; + public uint ownerMessage; + public uint messageValue; + public uint subjectValue; + public int positionXOffset; + public int positionYOffset; + public uint naturalValue; + public int naturalXOffset; + public int naturalYOffset; + public int physicalXOffset; + public int physicalYOffset; + public int screenXOffset; + public int screenYOffset; + public uint modifiersValue; + public uint buttonFlag; + public short wheelDelta; + } + + private struct DragInputCallbackMessage + { + public uint sizeCount; + public int msgValue; + public uint objectSubjectID; + public uint ownerCookie; + public uint ownerMessage; + public uint messageValue; + public uint subjectValue; + public uint dragModifiers; + public int positionXOffset; + public int positionYOffset; + public IntPtr pDataStream; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/KeyAllocator.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/KeyAllocator.cs new file mode 100644 index 0000000..5d187e5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/KeyAllocator.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.KeyAllocator +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Threading; + +namespace Microsoft.Iris.Render.Internal +{ + internal class KeyAllocator + { + private static int s_idxKeyGen; + + internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref s_idxKeyGen); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/Math2.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Math2.cs new file mode 100644 index 0000000..448ad6e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Math2.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.Math2 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Internal +{ + internal class Math2 + { + public static int FindPowerOf2(int nValue) => FindPowerOf2(nValue, 1); + + public static int FindPowerOf2(int nValue, int nStart) + { + int num = nStart; + while (num < nValue) + num *= 2; + return num; + } + + public static int RoundUp(float flValue) => (int)(flValue + 0.5); + + public static int Clamp(int nValue, int nMin, int nMax) + { + if (nValue < nMin) + return nMin; + return nValue > nMax ? nMax : nValue; + } + + public static float Clamp(float flValue, float flMin, float flMax) + { + if (flValue < (double)flMin) + return flMin; + return flValue > (double)flMax ? flMax : flValue; + } + + public static bool WithinEpsilon(float flValue1, float flValue2) + { + float num = flValue1 - flValue2; + return -9.99999974737875E-06 <= num && num <= 9.99999974737875E-06; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTracker.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTracker.cs new file mode 100644 index 0000000..cee5b1f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTracker.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.ObjectTracker +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + internal sealed class ObjectTracker : TrackerBase + { + private ObjectTracker.ThreadMode m_nMode; + private int m_idxNextIdentity; + private GCHandle m_hndOwner; + + public ObjectTracker(RenderSession session, object objOwner) + : this(session, ThreadMode.Private, objOwner) + { + } + + public ObjectTracker(RenderSession session, ObjectTracker.ThreadMode nMode, object objOwner) + { + 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; + this.m_hndOwner = GCHandle.Alloc(objOwner, GCHandleType.Weak); + } + + protected override void Dispose(bool fInDispose) + { + base.Dispose(fInDispose); + if (this.m_hndOwner.IsAllocated) + { + this.m_hndOwner.Free(); + this.m_hndOwner = new GCHandle(); + } + int num = fInDispose ? 1 : 0; + } + + public object Owner + { + get + { + object obj = null; + if (this.m_hndOwner.IsAllocated) + obj = this.m_hndOwner.Target; + return obj; + } + } + + public int AddObject(object o) + { + int num; + lock (this) + { + num = this.m_idxNextIdentity++; + this.AddObject(num, o); + } + return num; + } + + public void RemoveObject(int nIdentity) => this.RemoveKey(nIdentity); + + public object Find(int nIdentity) => this.Find((object)nIdentity); + + protected override void SetupObjectTable() + { + lock (this) + base.SetupObjectTable(); + } + + private void DoCleanup() + { + if (this.Owner == null) + this.Dispose(); + else + this.RemoveDeadObjects(); + } + + private void CleanupTimer(object sender, EventArgs args) + { + this.DoCleanup(); + foreach (ObjectTracker liveObject in this.LiveObjects) + liveObject.DoCleanup(); + } + + public enum ThreadMode + { + Private, + Shared, + Master, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs new file mode 100644 index 0000000..eee60cb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.ObjectTrackerGroup +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Internal +{ + internal static class ObjectTrackerGroup + { + private static ObjectTracker s_objectTrackerGroup = new ObjectTracker(null, ObjectTracker.ThreadMode.Master, null); + + internal static void RegisterChildTracker(ObjectTracker trackerToAdd) => s_objectTrackerGroup.AddObject(trackerToAdd); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderCaps.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderCaps.cs new file mode 100644 index 0000000..491d8b9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderCaps.cs @@ -0,0 +1,95 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.RenderCaps +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Internal +{ + internal class RenderCaps : RenderObject, IRenderHandleOwner, IRenderCapsCallback + { + private RemoteRenderCaps m_remoteObject; + private Vector m_graphicsCapsList; + private Vector m_soundCapsList; + private bool m_hasValidCaps; + private bool m_capsPending; + private uint m_currentRequestId; + + internal RenderCaps(RenderSession ownerSession) + { + this.m_hasValidCaps = false; + this.m_capsPending = false; + this.m_currentRequestId = 0U; + this.m_graphicsCapsList = new Vector(); + this.m_soundCapsList = new Vector(); + this.m_remoteObject = ownerSession.RenderingProtocol.BuildRemoteRenderCaps(this, ownerSession.RenderingProtocol.LocalRenderCapsCallbackHandle); + } + + internal bool HasValidCaps => this.m_hasValidCaps; + + internal Vector Graphics => this.m_graphicsCapsList; + + internal Vector Sound => this.m_soundCapsList; + + internal void RequestCaps() + { + if (this.m_capsPending) + return; + ++this.m_currentRequestId; + this.m_remoteObject.SendCheckCaps(this.m_currentRequestId); + this.m_capsPending = true; + } + + internal event EventHandler CapsAvailable; + + protected void NotifyCapsAvailable() + { + if (this.CapsAvailable == null) + return; + this.CapsAvailable(this, EventArgs.Empty); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; + + void IRenderCapsCallback.OnBeginCapsCheck(RENDERHANDLE target, uint cookie) + { + this.m_graphicsCapsList.Clear(); + this.m_soundCapsList.Clear(); + this.m_hasValidCaps = false; + } + + void IRenderCapsCallback.OnEndCapsCheck(RENDERHANDLE target, uint cookie) + { + this.m_hasValidCaps = true; + this.m_capsPending = false; + this.NotifyCapsAvailable(); + } + + void IRenderCapsCallback.OnGraphicsCaps( + RENDERHANDLE target, + uint cookie, + GraphicsCaps caps) + { + if ((int)this.m_currentRequestId != (int)cookie) + return; + this.m_graphicsCapsList.Add(caps); + } + + void IRenderCapsCallback.OnSoundCaps( + RENDERHANDLE target, + uint cookie, + SoundCaps caps) + { + if ((int)this.m_currentRequestId != (int)cookie) + return; + this.m_soundCapsList.Add(caps); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderDisplayMode.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderDisplayMode.cs new file mode 100644 index 0000000..badbafb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderDisplayMode.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.RenderDisplayMode +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + [ComVisible(false)] + internal struct RenderDisplayMode + { + public Size sizePhysicalPxl; + public Size sizeLogicalPxl; + public SurfaceFormat nFormat; + public int nRefreshRate; + private RenderDisplayMode.Flags m_nFlags; + + public bool Interlaced + { + get => Bits.TestFlag((uint)this.m_nFlags, 1U); + set + { + uint nFlags = (uint)this.m_nFlags; + Bits.ChangeFlag(ref nFlags, value, 1U); + this.m_nFlags = (RenderDisplayMode.Flags)nFlags; + } + } + + [System.Flags] + public enum Flags : uint + { + Interlaced = 1, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderEngine.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderEngine.cs new file mode 100644 index 0000000..9fa4864 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderEngine.cs @@ -0,0 +1,267 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.RenderEngine +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Sound; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Internal +{ + internal class RenderEngine : RenderObject, IRenderEngine, IRenderObject, IDisposable + { + private static BitArray s_contexts; + private static uint s_contextIdSeed = 1; + private static uint s_maxContextId = 254; + private IrisEngineInfo m_engineInfo; + private RenderToken m_primaryToken; + private MessagingSession m_messagingSession; + private RenderSession m_renderSession; + private RenderCaps m_renderCaps; + private GraphicsDeviceType m_typeGraphics; + private SoundDeviceType m_typeSound; + private RenderWindow m_renderWindow; + private DisplayManager m_displayManager; + private InputSystem m_inputSystem; + private SoundDevice m_soundDevice; + private ContextID m_localContextId; + private ContextID m_engineContextId; + + 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 = 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); + this.m_renderCaps = new RenderCaps(this.m_renderSession); + this.m_renderCaps.RequestCaps(); + this.m_messagingSession.FlushBatch(); + while (!this.m_renderCaps.HasValidCaps) + MessagingSession.DoEvents(50U); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + this.m_renderSession.ReleaseSharedResources(); + if (this.m_renderWindow != null) + this.m_renderWindow.WindowCreatedEvent -= new EventHandler(this.OnRenderWindowCreated); + if (this.m_soundDevice != null) + this.m_soundDevice.Dispose(); + if (this.m_renderWindow != null) + this.m_renderWindow.Dispose(); + if (this.m_inputSystem != null) + this.m_inputSystem.Dispose(); + if (this.m_displayManager != null) + this.m_displayManager.Dispose(); + if (this.m_renderSession != null) + this.m_renderSession.Dispose(); + if (this.m_messagingSession != null) + { + if (this.m_messagingSession.IsConnected) + this.m_messagingSession.Disconnect(); + this.m_messagingSession.Dispose(); + } + FreeContextId(this.m_localContextId); + FreeContextId(this.m_engineContextId); + } + this.m_soundDevice = null; + this.m_displayManager = null; + this.m_renderWindow = null; + this.m_renderSession = null; + this.m_messagingSession = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + void IRenderEngine.Initialize( + GraphicsDeviceType typeGraphics, + GraphicsRenderingQuality renderingQuality, + SoundDeviceType typeSound) + { + Debug2.Validate(this.m_messagingSession.IsConnected, typeof(InvalidOperationException), "Must be connected before attempting to initialize"); + Debug2.Validate(this.m_renderSession != null, typeof(ArgumentNullException), "Session must exist before calling Initialize"); + Debug2.Validate(this.IsGraphicsDeviceAvailable(typeGraphics, false), typeof(InvalidOperationException), "Graphics device type not available"); + Debug2.Validate(this.IsSoundDeviceAvailable(typeSound), typeof(InvalidOperationException), "Sound device type not available"); + this.m_renderSession.AssertOwningThread(); + this.m_typeGraphics = typeGraphics; + this.m_typeSound = typeSound; + this.m_displayManager = DisplayManager.CreateDisplayManager(this.m_renderSession, this, false); + this.m_renderWindow = new RenderWindow(this.m_renderSession, this.m_displayManager, typeGraphics, renderingQuality); + this.m_renderWindow.WindowCreatedEvent += new EventHandler(this.OnRenderWindowCreated); + this.m_renderSession.Initialize(); + this.m_inputSystem = new InputSystem(this.m_renderSession, this.m_renderWindow); + } + + private MessagingSession MessagingSession => this.m_messagingSession; + + IRenderSession IRenderEngine.Session => m_renderSession; + + internal RenderSession Session => this.m_renderSession; + + IRenderWindow IRenderEngine.Window => m_renderWindow; + + internal RenderWindow Window => this.m_renderWindow; + + IDisplayManager IRenderEngine.DisplayManager => m_displayManager; + + public DisplayManager DisplayManager => this.m_displayManager; + + public InputSystem InputSystem => this.m_inputSystem; + + internal SoundDevice SoundDevice => this.m_soundDevice; + + internal Vector GraphicsCaps => this.m_renderCaps.Graphics; + + internal Vector SoundCaps => this.m_renderCaps.Sound; + + private void DoEvents(uint nTimeoutInMsecs) + { + this.m_messagingSession.AssertOwningThread(); + MessagingSession.DoEvents(nTimeoutInMsecs); + } + + bool IRenderEngine.ProcessNativeEvents() + { + this.m_renderSession.AssertOwningThread(); + Win32Api.MSG msg; + EngineApi.WorkResult nResult; + EngineApi.SpPeekMessage(out msg, HWND.NULL, 0U, 0U, 1U, out nResult); + if (!Bits.TestFlag((uint)nResult, 2U)) + return Bits.TestFlag((uint)nResult, 1U); + if (this.m_renderWindow != null) + this.m_renderWindow.ForwardWindowMessage(ref msg); + Win32Api.TranslateMessage(ref msg); + Win32Api.DispatchMessage(ref msg); + return true; + } + + void IRenderEngine.WaitForWork(uint nTimeoutInMsecs) + { + this.m_renderSession.AssertOwningThread(); + EngineApi.SpWaitMessage(nTimeoutInMsecs, IntPtr.Zero); + } + + void IRenderEngine.InterThreadWake() => EngineApi.SpInvoke(this.m_localContextId, IntPtr.Zero, IntPtr.Zero, false); + + void IRenderEngine.FlushBatch() + { + this.m_renderSession.AssertOwningThread(); + this.m_messagingSession.FlushBatch(); + } + + bool IRenderEngine.IsGraphicsDeviceAvailable( + GraphicsDeviceType type, + bool fFilterRecommended) + { + Debug2.Validate(this.m_renderCaps != null, typeof(ArgumentNullException), "RenderCaps must be initialized prior to calling"); + this.m_renderSession.AssertOwningThread(); + return this.IsGraphicsDeviceAvailable(type, fFilterRecommended); + } + + private bool IsGraphicsDeviceAvailable(GraphicsDeviceType type, bool fFilterRecommended) + { + foreach (Microsoft.Iris.Render.Internal.GraphicsCaps graphic in this.m_renderCaps.Graphics) + { + if ((GraphicsDeviceType)graphic.DeviceType == type) + return !fFilterRecommended || graphic.DriverWarning == 0; + } + return false; + } + + bool IRenderEngine.IsSoundDeviceAvailable(SoundDeviceType type) + { + Debug2.Validate(this.m_renderCaps != null, typeof(ArgumentNullException), "RenderCaps must be initialized prior to calling"); + this.m_renderSession.AssertOwningThread(); + return this.IsSoundDeviceAvailable(type); + } + + private bool IsSoundDeviceAvailable(SoundDeviceType type) + { + if (type == SoundDeviceType.None) + return true; + foreach (Microsoft.Iris.Render.Internal.SoundCaps soundCaps in this.m_renderCaps.Sound) + { + if ((SoundDeviceType)soundCaps.DeviceType == type) + return true; + } + return false; + } + + private void OnRenderWindowCreated(object sender, EventArgs args) + { + SoundDevice soundDevice = null; + switch (this.m_typeSound) + { + case SoundDeviceType.None: + this.m_soundDevice = soundDevice; + break; + case SoundDeviceType.DirectSound8: + soundDevice = new Ds8SoundDevice(this.m_renderSession, m_renderWindow); + goto case SoundDeviceType.None; + case SoundDeviceType.WaveAudio: + case SoundDeviceType.XAudio: + Debug2.Validate(false, typeof(NotImplementedException), "{0} is not yet supported"); + goto case SoundDeviceType.None; + default: + Debug2.Validate(false, typeof(ArgumentException), "typeSound"); + goto case SoundDeviceType.None; + } + } + + internal static ContextID AllocateContextId() + { + uint num1 = 0; + lock (s_contexts) + { + for (int index = 0; index < s_maxContextId; ++index) + { + uint num2 = s_contextIdSeed++; + if (s_contextIdSeed > s_maxContextId) + s_contextIdSeed = 1U; + if (!s_contexts[(int)num2]) + { + num1 = num2; + s_contexts[(int)num1] = true; + break; + } + } + } + Debug2.Validate(num1 != 0U, typeof(InvalidOperationException), "Failed to allocate a context ID"); + return ContextID.FromUInt32(num1); + } + + private static void FreeContextId(ContextID contextId) + { + uint uint32 = ContextID.ToUInt32(contextId); + 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() + { + Debug2.Validate(this.m_localContextId != ContextID.NULL, typeof(InvalidOperationException), "local ContextId should not be NULL while running"); + Debug2.Validate(this.m_engineContextId != ContextID.NULL, typeof(InvalidOperationException), "engine ContextId should not be NULL while running"); + Debug2.Validate(this.MessagingSession != null, typeof(InvalidOperationException), "MessagingSession should not be null while running"); + Debug2.Validate(this.MessagingSession.IsConnected, typeof(InvalidOperationException), "MessagingSession should be connected while running"); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderSession.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderSession.cs new file mode 100644 index 0000000..a4aad87 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderSession.cs @@ -0,0 +1,371 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.RenderSession +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Desktop; +using Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt; +using Microsoft.Iris.Render.Remote; +using Microsoft.Iris.Render.Sound; +using System; + +namespace Microsoft.Iris.Render.Internal +{ + internal class RenderSession : RenderObject, IRenderSession, IRenderObject, IDisposable + { + private RenderEngine m_renderEngine; + private MessagingSession m_owningSession; + private VisualPropertyManager m_visPropManager; + private ProtocolSplashDesktop m_protocolDesktop; + private ProtocolSplashDesktopNt m_protocolDesktopNt; + private ProtocolSplashRendering m_protocolRendering; + private ProtocolSplashRenderingNt m_protocolRenderingNt; + private ProtocolSplashRendering m_protocolRenderingLocal; + private AnimationSystem m_animationSystem; + private ObjectCacheManager m_cacheManager; + private Microsoft.Iris.Render.Common.ObjectCache m_cacheSprite; + private Microsoft.Iris.Render.Common.ObjectCache m_cacheContainer; + + internal RenderSession(RenderEngine renderEngine) + { + Debug2.Validate(renderEngine != null, typeof(ArgumentNullException), nameof(renderEngine)); + this.RegisterOwningThread(); + this.m_protocolRendering = ProtocolSplashRendering.Bind(this.Messaging.RenderingPort); + this.m_protocolDesktop = ProtocolSplashDesktop.Bind(this.Messaging.WindowingPort); + this.m_protocolRenderingNt = ProtocolSplashRenderingNt.Bind(this.Messaging.RenderingPort); + this.m_protocolDesktopNt = ProtocolSplashDesktopNt.Bind(this.Messaging.WindowingPort); + if (this.Messaging.WindowingPort != this.Messaging.RenderingPort) + this.m_protocolRenderingLocal = ProtocolSplashRendering.Bind(this.Messaging.WindowingPort); + this.m_renderEngine = renderEngine; + this.m_visPropManager = new VisualPropertyManager(); + this.m_cacheManager = null; + } + + internal void Initialize() => this.m_animationSystem = new AnimationSystem(this); + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose && this.m_animationSystem != null) + this.m_animationSystem.UnregisterUsage(this); + this.UnregisterOwningThread(); + this.m_animationSystem = null; + this.m_visPropManager.Dispose(); + } + finally + { + base.Dispose(fInDispose); + } + } + + IGraphicsDevice IRenderSession.GraphicsDevice => m_renderEngine.Window.GraphicsDevice; + + ISoundDevice IRenderSession.SoundDevice => m_renderEngine.SoundDevice; + + internal SoundDevice SoundDevice => this.m_renderEngine.SoundDevice; + + IAnimationSystem IRenderSession.AnimationSystem => m_animationSystem; + + IInputSystem IRenderSession.InputSystem => m_renderEngine.InputSystem; + + internal MessagingSession Messaging => this.m_owningSession; + + internal RenderPort RenderingPort => this.m_owningSession.RenderingPort; + + internal RenderPort WindowingPort => this.m_owningSession.WindowingPort; + + internal ProtocolSplashDesktop DesktopProtocol => this.m_protocolDesktop; + + internal ProtocolSplashDesktopNt NtDesktopProtocol => this.m_protocolDesktopNt; + + internal ProtocolSplashRendering RenderingProtocol => this.m_protocolRendering; + + internal ProtocolSplashRenderingNt NtRenderingProtocol => this.m_protocolRenderingNt; + + internal ProtocolSplashRendering LocalRenderingProtocol => this.m_protocolRenderingLocal; + + internal bool IsValid => this.m_owningSession.IsConnected; + + internal bool IsForeignByteOrderOnWindowing => this.WindowingPort.ForeignByteOrder; + + internal VisualPropertyManager VisualPropertyManager => this.m_visPropManager; + + internal ObjectCacheManager CacheManager => this.m_cacheManager; + + public IEffectTemplate CreateEffectTemplate(object objUser, string stName) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + EffectTemplate effectTemplate = this.m_renderEngine.Window.GraphicsDevice.CreateEffectTemplate(stName); + effectTemplate.RegisterUsage(objUser); + return effectTemplate; + } + + public IVideoStream CreateVideoStream(object objUser) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + VideoStream videoStream = new VideoStream(this, this.m_renderEngine.Window.GraphicsDevice); + videoStream.RegisterUsage(objUser); + return videoStream; + } + + public IVisualContainer CreateVisualContainer( + object objUser, + object objOwnerData) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + VisualContainer visualContainer = null; + if (this.m_cacheContainer != null) + { + visualContainer = (VisualContainer)this.m_cacheContainer.Remove(objUser); + if (visualContainer != null) + visualContainer.OwnerData = objOwnerData; + } + if (visualContainer == null) + { + RemoteVisual remoteVisual; + visualContainer = new VisualContainer(false, this, this.m_renderEngine.Window, objOwnerData, out remoteVisual); + visualContainer.RegisterUsage(objUser); + visualContainer.Cache = this.m_cacheContainer; + } + return visualContainer; + } + + public ICamera CreateCamera(object objUser) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Camera camera = new Camera(this); + camera.RegisterUsage(objUser); + return camera; + } + + public IGradient CreateGradient(object objUser) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Gradient gradient = new Gradient(this, this.m_renderEngine.Window.GraphicsDevice.RemoteDevice); + gradient.RegisterUsage(objUser); + return gradient; + } + + public ISprite CreateSprite(object objUser, object objOwnerData) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Sprite sprite = null; + if (this.m_cacheSprite != null) + { + sprite = (Sprite)this.m_cacheSprite.Remove(objUser); + if (sprite != null) + sprite.OwnerData = objOwnerData; + } + if (sprite == null) + { + sprite = new Sprite(this, this.m_renderEngine.Window, objOwnerData); + sprite.RegisterUsage(objUser); + sprite.Cache = this.m_cacheSprite; + } + return sprite; + } + + public IImage CreateImage( + object objUser, + string identifier, + ContentNotifyHandler handler) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Debug2.Validate(handler != null, typeof(InvalidOperationException), "Invalid handler"); + Image image = this.m_renderEngine.Window.GraphicsDevice.CreateImage(identifier, handler); + image.RegisterUsage(objUser); + return image; + } + + internal GraphicsCaps GetGraphicsCaps(GraphicsDeviceType type) + { + foreach (GraphicsCaps graphicsCap in this.m_renderEngine.GraphicsCaps) + { + if ((GraphicsDeviceType)graphicsCap.DeviceType == type) + return graphicsCap; + } + return new GraphicsCaps(); + } + + private void RegisterOwningThread() => this.m_owningSession = MessagingSession.Current; + + private void UnregisterOwningThread() => this.m_owningSession = null; + + internal void AssertOwningThread() + { + } + + internal bool IsOwningThread() => this.m_owningSession == MessagingSession.Current; + + public void DeferredInvoke(Delegate method, object args, DeferredInvokePriority priority) + { + if (this.m_owningSession == null) + return; + this.m_owningSession.DeferredInvoke(method, args, priority, TimeSpan.FromMilliseconds(0.0)); + } + + public void DeferredInvoke( + SharedRenderObject owner, + Delegate method, + object args, + DeferredInvokePriority priority) + { + if (this.m_owningSession == null) + return; + this.m_owningSession.DeferredInvoke(owner, method, args, priority, TimeSpan.FromMilliseconds(0.0)); + } + + internal void DeferredInvoke( + Delegate method, + object args, + DeferredInvokePriority priority, + TimeSpan delay) + { + if (this.m_owningSession == null) + return; + this.m_owningSession.DeferredInvoke(method, args, priority, delay); + } + + internal void ReleaseSharedResources() + { + if (this.m_cacheSprite != null) + { + this.m_cacheManager.UnregisterCache(this.m_cacheSprite); + this.m_cacheSprite.Dispose(); + this.m_cacheSprite = null; + } + if (this.m_cacheContainer == null) + return; + this.m_cacheManager.UnregisterCache(this.m_cacheContainer); + this.m_cacheContainer.Dispose(); + this.m_cacheContainer = null; + } + + internal RENDERHANDLE AllocateRenderHandle(IRenderHandleOwner owner) => this.RenderingPort.AllocHandle(owner); + + internal void FreeRenderHandle(RENDERHANDLE handle) => this.RenderingPort.FreeHandle(handle); + + internal IVisual TryGetHandleOwner(uint dwHandleData) => this.WindowingPort.TryGetHandleOwner(RENDERHANDLE.FromUInt32(dwHandleData)) as IVisual; + + public RemoteDesktopManager BuildRemoteDesktopManager( + DisplayManager owner, + bool fEnumDisplayModes) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.NtDesktopProtocol.BuildRemoteDesktopManager(owner, this.NtDesktopProtocol.LocalDesktopManagerCallbackHandle, fEnumDisplayModes); + } + + internal RemoteFormWindow BuildRemoteFormWindow( + RenderWindow window, + DisplayManager displayManager) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.NtDesktopProtocol.BuildRemoteFormWindow(window, displayManager.RemoteStub, this.DesktopProtocol.LocalFormWindowCallbackHandle); + } + + internal RemoteInputRouter BuildRemoteInputRouter( + InputSystem inputSystem, + RenderWindow window) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + 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(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(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); + + internal void LoadSurface(DataBuffer buffer, Surface surface, ImageHeader header) => RemoteRasterizer.SendLoadRawImage(this.RenderingProtocol, surface.RemoteStub, buffer.RemoteStub, header); + + internal RemoteDx9EffectResource BuildRemoteDx9EffectResource( + Dx9EffectResource effectResource, + Dx9GraphicsDevice dx9Device, + DataBuffer dataBuffer) + { + return this.RenderingProtocol.BuildRemoteDx9EffectResource(effectResource, dx9Device.RemoteDevice, dataBuffer.RemoteStub); + } + + internal RemoteDx9Effect BuildRemoteDx9Effect(Dx9Effect effect) => RemoteDx9Effect.Create(this.RenderingProtocol, effect); + + internal RemoteGdiEffect BuildRemoteGdiEffect(GdiEffect effect) => RemoteGdiEffect.Create(this.NtRenderingProtocol, effect); + + internal RemoteCamera BuildRemoteCamera(Camera camera) => this.RenderingProtocol.BuildRemoteCamera(camera); + + internal RemoteVisualContainer BuildRemoteVisualContainer(Visual visual) => this.RenderingProtocol.BuildRemoteVisualContainer(visual); + + internal RemoteSprite BuildRemoteSprite(Sprite sprite, RenderWindow window) + { + switch (window.GraphicsDeviceType) + { + case GraphicsDeviceType.Gdi: + return this.NtRenderingProtocol.BuildRemoteGdiSprite(sprite); + case GraphicsDeviceType.Direct3D9: + case GraphicsDeviceType.XeDirectX9: + return this.RenderingProtocol.BuildRemoteDx9Sprite(sprite); + default: + Debug2.Throw(false, "Unrecognized device type: {0}", window.GraphicsDeviceType); + return null; + } + } + + internal RemoteSoundBuffer BuildSoundBufferFromHandle(RENDERHANDLE handle) => RemoteSoundBuffer.CreateFromHandle(this.RenderingPort, handle); + + internal RemoteSound BuildSoundFromHandle(RENDERHANDLE handle) => RemoteSound.CreateFromHandle(this.RenderingPort, handle); + + public RemoteAnimationManager BuildRemoteAnimationManager( + AnimationSystem owner) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.RenderingProtocol.BuildRemoteAnimationManager(owner); + } + + public RemoteAnimation BuildRemoteAnimation( + KeyframeAnimation owner, + AnimationInputType animationType) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.RenderingProtocol.BuildRemoteAnimation(owner, animationType, this.RenderingProtocol.LocalAnimationCallbackHandle); + } + + public RemoteExternalAnimationInput BuildRemoteExternalAnimationInput( + ExternalAnimationInput owner, + uint uniqueId) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.RenderingProtocol.BuildRemoteExternalAnimationInput(owner, uniqueId); + } + + public RemoteAnimationInputProvider BuildRemoteAnimationInputProvider( + AnimationInputProvider owner, + uint externalAnimationInputId) + { + Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); + return this.RenderingProtocol.BuildRemoteAnimationInputProvider(owner, externalAnimationInputId); + } + + protected override void Invariant() + { + this.AssertOwningThread(); + Debug2.Validate(this.m_owningSession != null, typeof(InvalidOperationException), this.GetType().ToString()); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderWindow.cs new file mode 100644 index 0000000..eb0d7e5 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/RenderWindow.cs @@ -0,0 +1,1190 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.RenderWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Desktop; +using Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Collections; +using System.Runtime.InteropServices; +using System.Security; + +namespace Microsoft.Iris.Render.Internal +{ + [SuppressUnmanagedCodeSecurity] + internal sealed class RenderWindow : + IRenderWindow, + ITreeOwner, + IFormWindowCallback, + IRenderHandleOwner + { + private const uint ACT_INACTIVE = 0; + private const uint ACT_ACTIVE = 1; + private const uint ACT_POPUP = 2; + private const uint ACT_SYSUI = 3; + private const uint STCH_MODE = 1; + private const uint STCH_ACTIVATION = 2; + private const uint STCH_VISIBILITY = 4; + private const uint STCH_LOCATION = 8; + private const uint STCH_SIZE = 16; + private const uint STCH_UNPLANNED = 256; + private const uint WM_KEYFIRST = 256; + private const uint WM_KEYLAST = 265; + private const uint WM_MOUSEFIRST = 512; + private const uint WM_MOUSELAST = 526; + private static ushort[] s_ByteOrder_FormStateCallbackMsg; + private RenderSession m_session; + private DisplayManager m_displayManager; + private GraphicsDevice m_device; + private GraphicsDeviceType m_graphicsDeviceType; + private VisualContainer m_rootVisual; + private int m_nX; + private int m_nY; + private int m_nWidth; + private int m_nHeight; + private int m_nMinResizeWidth; + private int m_nMaxResizeWidth; + private Size m_szDefault; + private string m_stText; + private Display m_currentDisplay; + private bool m_fSpanningMonitors; + private bool m_fOnSecondaryMonitor; + private bool m_fRightToLeft; + private bool m_fActivation; + private bool m_fFocused; + private bool m_fVisible; + private bool m_fExclusive; + private bool m_fShownBefore; + private bool m_fSessionHasDisplay; + private bool m_fSessionLocked; + private bool m_fExplicitlyLocked; + private bool m_fClosing; + private bool m_fLoadComplete; + private bool m_fLoadEventFired; + private WindowState m_nWindowState; + private FormStyleInfo m_windowStyles; + private ColorF m_clrBackground; + private ColorF m_clrOutlineAllColor; + private ColorF m_clrOutlineMarkedColor; + private Cursor m_cursor; + private Cursor m_cursorIdle; + private Stack m_stkWaitCursors; + private HWND m_hwnd; + private RemoteFormWindow m_remoteWindow; + private RenderWindow.RenderFlags m_renderFlags; + private bool m_fPreProcessedInput; + private int m_nMouseLockCount; + private ArrayList m_partialDropData; + private bool m_fEnableExternalDragDrop; + private uint m_nDragDropResult; + private uint m_nDragOverResult; + private bool m_fIsDragInProgress; + private FormPlacement m_finalPlacement; + private SmartMap m_mapShutdownHooks; + private ushort m_nextShutdownHookId; + + internal RenderWindow( + RenderSession session, + DisplayManager displayManager, + GraphicsDeviceType graphicsDeviceType, + GraphicsRenderingQuality renderingQuality) + { + Debug2.Validate(session != null, typeof(ArgumentNullException), "must pass a valid session"); + session.AssertOwningThread(); + Debug2.Validate(displayManager != null, typeof(ArgumentNullException), "must pass a valid DisplayManager"); + this.m_session = session; + this.m_displayManager = displayManager; + this.CreateGraphicsDevice(session, graphicsDeviceType, renderingQuality); + this.m_device.RegisterWindow(this); + this.m_clrBackground = new ColorF(0.0f, 0.0f, 0.0f); + this.m_remoteWindow = this.m_session.BuildRemoteFormWindow(this, this.m_displayManager); + this.m_fPreProcessedInput = false; + this.m_cursor = Cursor.Default; + this.m_cursorIdle = Cursor.Default; + this.m_nWindowState = WindowState.Normal; + this.m_fRightToLeft = false; + this.m_fSessionHasDisplay = true; + this.m_fSessionLocked = false; + this.m_szDefault = new Size(640, 480); + 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(); + this.m_nextShutdownHookId = 1; + this.m_nMouseLockCount = 0; + this.SetFullScreenExclusive(false); + } + + public void Initialize() => this.BuildRootContainer(); + + private GraphicsDevice CreateGraphicsDevice( + RenderSession session, + GraphicsDeviceType graphicsDeviceType, + GraphicsRenderingQuality renderingQuality) + { + GraphicsDevice graphicsDevice = null; + EngineApi.IFC(FormApi.SpGdiplusInit()); + this.m_graphicsDeviceType = graphicsDeviceType; + switch (this.m_graphicsDeviceType) + { + case GraphicsDeviceType.Gdi: + this.m_device = new GdiGraphicsDevice(session); + break; + case GraphicsDeviceType.Direct3D9: + this.m_device = new NtGraphicsDevice(session, renderingQuality); + break; + } + return graphicsDevice; + } + + internal void Dispose() + { + this.Visible = false; + this.m_remoteWindow.SendSetRoot(null); + this.m_rootVisual.UnregisterUsage(this); + this.StopRendering(); + } + + internal void StopRendering() + { + if (this.m_device != null) + { + this.m_device.Dispose(); + this.m_device = null; + } + if (this.m_remoteWindow != null) + { + this.m_remoteWindow.Dispose(); + this.m_remoteWindow = null; + } + EngineApi.IFC(FormApi.SpGdiplusUninit()); + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null; + + internal RemoteFormWindow RemoteStub => this.m_remoteWindow; + + public int Left => this.m_nX; + + public int Top => this.m_nY; + + public int Right => this.m_nX + this.m_nWidth; + + public int Bottom => this.m_nY + this.m_nHeight; + + public int Width => this.m_nWidth; + + public int Height => this.m_nHeight; + + public HWND WindowHandle => this.m_hwnd; + + public Size ClientSize + { + get => new Size(this.m_nWidth, this.m_nHeight); + set + { + if (this.m_nWidth == value.Width && this.m_nHeight == value.Height || !this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetSize(value); + } + } + + public Size InitialClientSize + { + get => this.m_szDefault; + set => this.m_szDefault = value; + } + + public FormPlacement InitialPlacement + { + set + { + if (!this.m_session.IsValid || this.m_remoteWindow == null || !(this.m_hwnd == HWND.NULL)) + return; + this.m_remoteWindow.SendSetInitialPlacement(value.ShowState, value.NormalPosition, value.MaximizedLocation); + } + } + + public FormPlacement FinalPlacement => this.m_finalPlacement; + + public int MinResizeWidth + { + get => this.m_nMinResizeWidth; + set + { + if (this.m_nMinResizeWidth == value) + return; + this.m_nMinResizeWidth = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetMinResizeWidth(this.m_nMinResizeWidth); + } + } + + public int MaxResizeWidth + { + get => this.m_nMaxResizeWidth; + set + { + if (this.m_nMaxResizeWidth == value) + return; + this.m_nMaxResizeWidth = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetMaxResizeWidth(this.m_nMaxResizeWidth); + } + } + + public Point Position + { + get => new Point(this.m_nX, this.m_nY); + set + { + if (this.m_nX == value.X && this.m_nY == value.Y || !this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetPosition(value); + } + } + + public string Text + { + get => this.m_stText == null ? "" : this.m_stText; + set + { + this.m_stText = value; + this.UpdateText(true); + } + } + + public Cursor Cursor + { + get => this.m_cursor; + set + { + if (this.m_cursor == value) + return; + this.m_cursor = value; + this.UpdateCursors(); + } + } + + public Cursor IdleCursor + { + get => this.m_cursorIdle; + set + { + if (this.m_cursorIdle == value) + return; + this.m_cursorIdle = value; + this.UpdateCursors(); + } + } + + public bool Visible + { + get => this.m_fVisible; + set + { + if (this.m_fVisible == value) + return; + this.m_fVisible = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetVisible(this.m_fVisible); + } + } + + public bool IsLoaded => this.m_fLoadEventFired; + + public ColorF BackgroundColor + { + get => this.m_clrBackground; + set => this.SetBackgroundColor(value); + } + + IDisplay IRenderWindow.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, null, "CurrentDisplay.set param MUST be a valid Display object"); + Display display = this.m_displayManager.DisplayFromUniqueId((inputIDisplay as Display).UniqueId); + if (display == null) + return; + this.m_currentDisplay = display; + } + + public bool FullScreenExclusive + { + get => this.m_fExclusive; + set => this.SetFullScreenExclusive(value); + } + + private void SetFullScreenExclusive(bool fNewValue) + { + switch (this.m_graphicsDeviceType) + { + case GraphicsDeviceType.Direct3D9: + this.m_fExclusive = fNewValue; + break; + case GraphicsDeviceType.XeDirectX9: + this.m_fExclusive = true; + break; + default: + this.m_fExclusive = false; + break; + } + } + + public bool ActivationState => this.m_fActivation; + + public WindowState WindowState + { + get => this.m_nWindowState; + set + { + if (this.m_nWindowState == value) + return; + this.m_nWindowState = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetMode((uint)this.m_nWindowState); + } + } + + public FormStyleInfo Styles + { + get => this.m_windowStyles; + set + { + this.m_windowStyles = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetStyles(value.uStyleRestored, value.uExStyleRestored, value.uStyleMinimized, value.uExStyleMinimized, value.uStyleMaximized, value.uExStyleMaximized, value.uStyleFullscreen, value.uExStyleFullscreen); + } + } + + HWND IRenderWindow.AppNotifyWindow + { + set => this.m_remoteWindow.INPROC_SendSetAppNotifyWindow(value); + } + + IVisualContainer IRenderWindow.VisualRoot => m_rootVisual; + + TreeNode ITreeOwner.Root => m_rootVisual; + + internal bool IsClosing => this.m_fClosing; + + internal bool IsSessionActive => this.m_fSessionHasDisplay && !this.m_fSessionLocked; + + internal bool IsSessionRemote => false; + + internal bool IsSpanningMonitors => this.m_fSpanningMonitors; + + internal bool IsOnSecondaryMonitor => this.m_fOnSecondaryMonitor; + + internal ColorF OutlineAllColor + { + get => this.m_clrOutlineAllColor; + set + { + if (!(this.m_clrOutlineAllColor != value)) + return; + this.m_clrOutlineAllColor = value; + this.m_remoteWindow.SendSetOutlineAllColor(value); + } + } + + internal ColorF OutlineMarkedColor + { + get => this.m_clrOutlineMarkedColor; + set + { + if (!(this.m_clrOutlineMarkedColor != value)) + return; + this.m_clrOutlineMarkedColor = value; + this.m_remoteWindow.SendSetOutlineMarkedColor(value); + } + } + + internal GraphicsDevice GraphicsDevice => this.m_device; + + internal RenderSession Session => this.m_session; + + internal GraphicsDeviceType GraphicsDeviceType => this.m_graphicsDeviceType; + + internal bool IsRightToLeft => this.m_fRightToLeft; + + public event LocationChangedHandler LocationChangedEvent; + + public event SizeChangedHandler SizeChangedEvent; + + public event MonitorChangedHandler MonitorChangedEvent; + + public event WindowStateChangedHandler WindowStateChangedEvent; + + public event CloseHandler CloseEvent; + + public event CloseRequestHandler CloseRequestEvent; + + public event SysCommandHandler SysCommandEvent; + + public event MouseIdleHandler MouseIdleEvent; + + public event ShowHandler ShowEvent; + + public event ActivationChangeHandler ActivationChangeEvent; + + public event SessionActivateHandler SessionActivateEvent; + + public event SessionConnectHandler SessionConnectEvent; + + public event SetFocusHandler SetFocusEvent; + + public event LoadHandler LoadEvent; + + public event ForwardMessageHandler ForwardMessageEvent; + + public event RenderWindow.RendererSuspendedHandler RendererSuspendedEvent; + + internal event EventHandler WindowCreatedEvent; + + private void OnCreated() + { + if (this.WindowCreatedEvent == null) + return; + this.WindowCreatedEvent(this, EventArgs.Empty); + } + + private void OnForwardWndMsg(uint msg, IntPtr wParam, IntPtr lParam) + { + if (this.ForwardMessageEvent == null) + return; + this.ForwardMessageEvent(msg, wParam, lParam); + } + + private void FireLoadEvent() + { + if (this.m_fLoadEventFired || !this.m_fLoadComplete || this.m_nWidth == 0 && this.m_nHeight == 0) + return; + if (this.LoadEvent != null) + this.LoadEvent(); + this.m_fLoadEventFired = true; + } + + private void OnLocationChanged() + { + if (this.LocationChangedEvent == null) + return; + this.LocationChangedEvent(this.Position); + } + + internal void NotifyDisplayReconfigured() => this.OnSizeChanged(); + + private void OnSizeChanged() + { + this.FireLoadEvent(); + if (this.SizeChangedEvent == null) + return; + this.SizeChangedEvent(); + } + + private void OnMonitorChanged() + { + if (this.MonitorChangedEvent == null) + return; + this.MonitorChangedEvent(); + } + + private void OnWindowStateChanged(bool fUnplanned) + { + if (this.WindowStateChangedEvent == null) + return; + this.WindowStateChangedEvent(fUnplanned); + } + + private void OnDestroyed() + { + } + + private void OnSysCommand(IntPtr uParam1, IntPtr uParam2) + { + if (this.SysCommandEvent == null) + return; + this.SysCommandEvent(uParam1, uParam2); + } + + private void OnMouseIdle(bool fIdle) + { + if (this.MouseIdleEvent == null) + return; + this.MouseIdleEvent(fIdle); + } + + private void OnShow(bool fShow, bool fFirstShow) + { + if (this.ShowEvent == null) + return; + this.ShowEvent(fShow, fFirstShow); + } + + private void OnActivationChange() + { + if (this.ActivationChangeEvent == null) + return; + this.ActivationChangeEvent(); + } + + private void OnTermSessionChange(uint uParam) + { + bool flag = false; + bool isSessionActive = this.IsSessionActive; + switch (uParam) + { + case 1: + case 3: + this.m_fSessionHasDisplay = true; + break; + case 2: + case 4: + this.m_fSessionHasDisplay = false; + break; + case 7: + this.m_fSessionLocked = true; + this.m_fExplicitlyLocked = true; + break; + case 8: + this.m_fSessionLocked = false; + flag = flag || !this.m_fExplicitlyLocked; + break; + } + if (this.IsSessionActive != isSessionActive || flag) + this.FireSessionActivate(this.IsSessionActive); + if (uParam != 2U && uParam != 1U && (uParam != 4U && uParam != 3U)) + return; + this.FireSessionConnect(uParam == 1U || uParam == 3U); + } + + public void FireSessionActivate(bool fIsActive) => this.OnSessionActivate(fIsActive); + + private void OnSessionActivate(bool fIsActive) + { + if (fIsActive && this.Visible && this.m_fExclusive) + { + this.Focus(); + this.m_remoteWindow.SendSetForeground(false); + } + if (this.SessionActivateEvent == null) + return; + this.SessionActivateEvent(fIsActive); + } + + private void FireSessionConnect(bool fIsConnected) + { + if (this.SessionConnectEvent == null) + return; + this.SessionConnectEvent(fIsConnected); + } + + private void OnNativeScreensave(bool fStart) + { + } + + private void OnDroppedFiles(IEnumerable files) + { + } + + public void EnableShellShutdownHook(string hookName, EventHandler handler) => this.GetShutdownHookInfo(hookName, true).Handler += handler; + + private RenderWindow.ShutdownHookInfo GetShutdownHookInfo( + string hookName, + bool fCanAdd) + { + RenderWindow.ShutdownHookInfo desired = new RenderWindow.ShutdownHookInfo(hookName); + if (this.m_mapShutdownHooks.Lookup(desired, out uint _)) + return desired; + if (fCanAdd) + { + ushort uIdMsg = this.m_nextShutdownHookId++; + this.m_mapShutdownHooks.SetValue(uIdMsg, desired); + this.m_remoteWindow.SendEnableShellShutdownHook(hookName, uIdMsg); + } + else + desired = null; + return desired; + } + + void IFormWindowCallback.OnTerminalSessionChange( + RENDERHANDLE target, + IntPtr wParam, + IntPtr lParam) + { + this.OnTermSessionChange((uint)wParam.ToInt32()); + } + + void IFormWindowCallback.OnPrivateSysCommand( + RENDERHANDLE target, + IntPtr wParam, + IntPtr lParam) + { + this.OnSysCommand(wParam, lParam); + } + + void IFormWindowCallback.OnMouseIdle(RENDERHANDLE target, bool fNewIdle) => this.OnMouseIdle(fNewIdle); + + void IFormWindowCallback.OnCloseRequested(RENDERHANDLE target) => this.EngineCloseRequest(); + + void IFormWindowCallback.OnLoad(RENDERHANDLE target) + { + this.m_fLoadComplete = true; + if (this.m_fClosing) + return; + this.FireLoadEvent(); + } + + void IFormWindowCallback.OnWindowDestroyed( + RENDERHANDLE target, + uint nFinalShowState, + Rectangle rcFinalPosition, + Point ptFinalMaximizedLocation) + { + this.m_finalPlacement.NormalPosition = rcFinalPosition; + this.m_finalPlacement.MaximizedLocation = ptFinalMaximizedLocation; + this.m_finalPlacement.ShowState = nFinalShowState; + this.m_hwnd = HWND.NULL; + this.m_fClosing = true; + if (this.CloseEvent == null) + return; + this.CloseEvent(); + } + + void IFormWindowCallback.OnWindowCreated(RENDERHANDLE target, HWND hWnd) + { + this.m_hwnd = hWnd; + this.m_device.PostCreate(); + this.UpdateText(false); + this.OnCreated(); + } + + unsafe void IFormWindowCallback.OnStateChange( + RENDERHANDLE target, + Message* pmsgRaw) + { + RenderWindow.FormStateCallbackMsg* stateCallbackMsgPtr = (RenderWindow.FormStateCallbackMsg*)pmsgRaw; + if (this.m_session.IsForeignByteOrderOnWindowing) + 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; + bool flag1 = stateCallbackMsgPtr->fOnSecondaryMonitor != 0; + bool flag2 = stateCallbackMsgPtr->cSpanningMonitors > 1U; + bool flag3 = false; + if (stateCallbackMsgPtr->idDisplay != uint.MaxValue) + flag3 = (int)num != (int)stateCallbackMsgPtr->idDisplay || this.m_fOnSecondaryMonitor != flag1 || this.m_fSpanningMonitors != flag2; + bool flag4 = this.m_nX != stateCallbackMsgPtr->rcWindowGlobal_left || this.m_nY != stateCallbackMsgPtr->rcWindowGlobal_top; + bool flag5 = this.m_nWidth != stateCallbackMsgPtr->szClientDims_cx || this.m_nHeight != stateCallbackMsgPtr->szClientDims_cy; + this.m_nX = stateCallbackMsgPtr->rcWindowGlobal_left; + this.m_nY = stateCallbackMsgPtr->rcWindowGlobal_top; + this.m_nWidth = stateCallbackMsgPtr->szClientDims_cx; + this.m_nHeight = stateCallbackMsgPtr->szClientDims_cy; + this.m_nWindowState = (WindowState)stateCallbackMsgPtr->uCurrentMode; + this.m_fVisible = stateCallbackMsgPtr->fVisible != 0; + this.m_fSpanningMonitors = flag2; + this.m_fOnSecondaryMonitor = flag1; + this.SetFullScreenExclusive(stateCallbackMsgPtr->fExclusive != 0); + bool fActivation = this.m_fActivation; + this.m_fActivation = stateCallbackMsgPtr->uActivation == 1U; + if (flag3) + this.m_currentDisplay = this.m_displayManager.DisplayFromUniqueId(stateCallbackMsgPtr->idDisplay); + if (flag3) + this.OnMonitorChanged(); + if (flag4) + this.OnLocationChanged(); + if (flag5) + { + this.m_rootVisual.Size = new Vector2(m_nWidth, m_nHeight); + this.OnSizeChanged(); + } + if (((int)stateCallbackMsgPtr->uRecentlyChanged & 1) != 0) + this.OnWindowStateChanged(((int)stateCallbackMsgPtr->uRecentlyChanged & 256) != 0); + if (((int)stateCallbackMsgPtr->uRecentlyChanged & 4) != 0) + { + bool fFirstShow = this.m_fVisible && !this.m_fShownBefore; + if (this.m_fVisible) + this.m_fShownBefore = true; + this.OnShow(this.m_fVisible, fFirstShow); + } + if (((int)stateCallbackMsgPtr->uRecentlyChanged & 2) == 0 || this.m_fActivation == fActivation) + return; + this.OnActivationChange(); + } + + void IFormWindowCallback.OnPartialDrop(RENDERHANDLE target, string file) + { + if (this.m_partialDropData == null) + this.m_partialDropData = new ArrayList(); + this.m_partialDropData.Add(file); + } + + void IFormWindowCallback.OnDropComplete(RENDERHANDLE target) + { + if (this.m_partialDropData == null || this.m_partialDropData.Count <= 0) + return; + IEnumerable partialDropData = m_partialDropData; + this.m_partialDropData = null; + this.OnDroppedFiles(partialDropData); + } + + void IFormWindowCallback.OnSetFocus( + RENDERHANDLE target, + bool focused, + HWND hwndFocusChange) + { + this.m_fFocused = focused; + int num = focused ? 1 : 0; + if (this.SetFocusEvent == null) + return; + this.SetFocusEvent(focused); + } + + void IFormWindowCallback.OnShellShutdownHook( + RENDERHANDLE target, + ushort hookId) + { + RenderWindow.ShutdownHookInfo shutdownHookInfo; + if (!this.m_mapShutdownHooks.TryGetValue(hookId, out shutdownHookInfo)) + return; + shutdownHookInfo.OnHook(this, EventArgs.Empty); + } + + void IFormWindowCallback.OnNativeScreensave( + RENDERHANDLE target, + bool fStartScreensave) + { + this.m_session.DeferredInvoke(new DeferredHandler(this.DoNativeScreensave), fStartScreensave, DeferredInvokePriority.Idle); + } + + private void DoNativeScreensave(object objParam) => this.OnNativeScreensave((bool)objParam); + + private void DoPopAnimations(object objParam) + { + } + + void IFormWindowCallback.OnRendererSuspended( + RENDERHANDLE target, + bool fSuspended) + { + this.FireRendererSuspended(fSuspended); + } + + private void FireRendererSuspended(bool fSuspended) + { + if (this.RendererSuspendedEvent == null) + return; + this.RendererSuspendedEvent(m_device, new RenderWindow.RendererSuspendedArgs(fSuspended)); + } + + internal RenderWindow.RenderFlags GlobalRenderFlags + { + get => this.m_renderFlags; + set => this.SetGlobalRenderFlags(value, RenderFlags.All); + } + + internal bool SetGlobalRenderFlags( + RenderWindow.RenderFlags flags, + RenderWindow.RenderFlags mask) + { + bool flag = false; + RenderWindow.RenderFlags renderFlags = this.m_renderFlags & ~mask | flags & mask; + if (this.m_renderFlags != renderFlags) + { + this.m_renderFlags = renderFlags; + flag = true; + this.m_remoteWindow.SendChangeDataBits((uint)flags, (uint)mask); + } + return flag; + } + + public void SetWindowOptions(WindowOptions optionMask, bool enable) + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetOptions((uint)optionMask, enable ? (uint)optionMask : 0U); + } + + public void SetMouseIdleOptions(Size mouseIdleTolerance, uint mouseIdleDelay) + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetMouseIdleOptions(mouseIdleTolerance, mouseIdleDelay); + } + + public void ForwardWindowMessage(ref Win32Api.MSG msg) + { + if (msg.message < 256U || msg.message > 265U) + return; + this.OnForwardWndMsg(msg.message, msg.wParam, msg.lParam); + } + + private void BuildRootContainer() + { + this.m_remoteWindow.SendSetSize(this.m_szDefault); + this.m_remoteWindow.SendCreateRootContainer(); + this.m_remoteWindow.SendSetHitMasks(1U, 2U, 4U, 8U); + RemoteVisual remoteVisual; + 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(m_nWidth, m_nHeight); + } + + void IRenderWindow.ClientToScreen(ref Point point) + { + Win32Api.POINT pt; + pt.x = !this.m_fRightToLeft ? point.X : this.ClientSize.Width - point.X; + pt.y = point.Y; + Win32Api.ClientToScreen(this.m_hwnd, ref pt); + point.X = pt.x; + point.Y = pt.y; + } + + void IRenderWindow.ScreenToClient(ref Point point) + { + Win32Api.POINT pt; + pt.x = point.X; + pt.y = point.Y; + Win32Api.ScreenToClient(this.m_hwnd, ref pt); + point.X = !this.m_fRightToLeft ? pt.x : this.ClientSize.Width - pt.x; + point.Y = pt.y; + } + + void IRenderWindow.TakeFocus() => this.Focus(); + + private void Focus() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendTakeFocus(); + } + + void IRenderWindow.TakeForeground(bool fForce) + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetForeground(fForce); + } + + void IRenderWindow.BringToTop() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendBringToTop(); + } + + void IRenderWindow.RefreshHitTarget() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendRefreshHitTarget(); + } + + private void EngineCloseRequest() + { + if (this.CloseRequestEvent != null) + this.CloseRequestEvent(); + else + this.Close(FormCloseReason.RendererRequest); + } + + public void Close(FormCloseReason nReason) + { + if (this.m_fClosing) + return; + this.ForceCloseWorker(nReason); + } + + private void ForceClose() => this.ForceCloseWorker(FormCloseReason.ForcedClose); + + private void ForceCloseWorker(FormCloseReason nReason) + { + if (this.m_fClosing) + return; + this.m_fClosing = true; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendDestroy(); + } + + public void PushWaitCursor(Cursor cursor) + { + if (this.m_stkWaitCursors == null) + this.m_stkWaitCursors = new Stack(); + this.m_stkWaitCursors.Push(cursor); + this.UpdateCursors(); + } + + public void PopWaitCursor() + { + this.m_stkWaitCursors.Pop(); + this.UpdateCursors(); + } + + public void ForceMouseIdle(bool fIdle) + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendForceMouseIdle(fIdle); + } + + public void SetCapture(IRawInputSite captureSite, bool state) + { + if (captureSite == null) + return; + this.m_remoteWindow.SendSetCapture((captureSite as Visual).RemoteStub, state); + } + + public void SetBackgroundColor(ColorF color) + { + if (!(this.m_clrBackground != color)) + return; + this.m_clrBackground = color; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetBackgroundColor(color); + } + + public void SetIcon(string sModuleName, uint nResourceID, IconFlags nOptions) + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetIcon(sModuleName, nResourceID, (uint)nOptions); + } + + public void SetEdgeImages(bool fActiveEdges, ShadowEdgePart[] edges) + { + if (!this.m_session.IsValid) + return; + 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, 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), 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); + } + + public bool EnableExternalDragDrop + { + get => this.m_fEnableExternalDragDrop; + set + { + if (this.m_fEnableExternalDragDrop == value) + return; + this.m_fEnableExternalDragDrop = value; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendEnableExternalDragDrop(value); + } + } + + public void SetDragDropResult(uint nDragOverResult, uint nDragDropResult) + { + if ((int)this.m_nDragOverResult == (int)nDragOverResult && (int)this.m_nDragDropResult == (int)nDragDropResult) + return; + this.m_nDragDropResult = nDragDropResult; + this.m_nDragOverResult = nDragOverResult; + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetDragDropResult(nDragOverResult, nDragDropResult); + } + + public bool IsDragInProgress + { + get => this.m_fIsDragInProgress; + set + { + if (this.m_fIsDragInProgress == value) + return; + this.m_fIsDragInProgress = value; + if (!this.m_session.IsValid) + return; + if (this.m_fIsDragInProgress) + this.m_remoteWindow.SendEnterInternalDrag(); + else + this.m_remoteWindow.SendExitInternalDrag(); + } + } + + public void Restore() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendRestore(); + } + + public void TemporarilyExitExclusiveMode() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendTemporarilyExitExclusiveMode(); + } + + public IHwndHostWindow CreateHwndHostWindow() => new HwndHostWindow(this); + + public void UnlockForegroundWindow() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendUpdateForegroundLockState(); + } + + public void BringToTop() + { + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendBringToTop(); + } + + public void LockMouseActive(bool fLock) + { + if (fLock) + { + ++this.m_nMouseLockCount; + if (this.m_nMouseLockCount != 1) + return; + this.SetWindowOptions(WindowOptions.LockMouseActive, true); + } + else + { + this.m_nMouseLockCount = Math.Max(this.m_nMouseLockCount - 1, 0); + if (this.m_nMouseLockCount != 0) + return; + this.SetWindowOptions(WindowOptions.LockMouseActive, false); + } + } + + private void UpdateText(bool fChanged) + { + if (!(this.m_hwnd != HWND.NULL) || this.m_stText == null && !fChanged || !this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetText(this.Text); + } + + private void UpdateCursors() + { + Cursor cursor1 = Cursor.NullCursor; + Cursor nullCursor = Cursor.NullCursor; + Cursor cursor2 = null; + if (this.m_stkWaitCursors != null && this.m_stkWaitCursors.Count > 0) + cursor2 = this.m_stkWaitCursors.Peek() as Cursor; + Cursor cursor3; + if (cursor2 != null) + { + cursor1 = cursor3 = cursor2; + } + else + { + if (this.m_cursor != null) + cursor1 = this.m_cursor; + cursor3 = this.m_cursorIdle == null ? cursor1 : this.m_cursorIdle; + } + if (!this.m_session.IsValid) + return; + this.m_remoteWindow.SendSetCursors(cursor1.ResourceId, cursor3.ResourceId); + } + + public bool IsPreProcessedInput => this.m_fPreProcessedInput; + + public delegate void RendererSuspendedHandler( + object sender, + RenderWindow.RendererSuspendedArgs args); + + internal class ShutdownHookInfo + { + private string m_stHookId; + + public ShutdownHookInfo(string stHookId) => this.m_stHookId = stHookId; + + public event EventHandler Handler; + + public void OnHook(object sender, EventArgs args) + { + if (this.Handler == null) + return; + this.Handler(sender, args); + } + + public override bool Equals(object obj) => obj is RenderWindow.ShutdownHookInfo shutdownHookInfo && this.m_stHookId == shutdownHookInfo.m_stHookId; + + public override int GetHashCode() => this.m_stHookId.GetHashCode(); + } + + internal class RendererSuspendedArgs : EventArgs + { + private bool m_fSuspended; + + public RendererSuspendedArgs(bool fSuspended) => this.m_fSuspended = fSuspended; + + public bool Suspended => this.m_fSuspended; + } + + [System.Flags] + internal enum RenderFlags + { + None = 0, + DebugPainting = 1, + OutlineMarked = 2, + OutlineAll = 4, + RenderDump = 8, + Wireframe = 16, // 0x00000010 + InvalidationDebug = 32, // 0x00000020 + NoLighting = 64, // 0x00000040 + NoVertexAlpha = 128, // 0x00000080 + NoTextures = 256, // 0x00000100 + NoAlpha = 512, // 0x00000200 + RemoteDebugMode = 1024, // 0x00000400 + DumpRopsOneTime = 2048, // 0x00000800 + All = DumpRopsOneTime | RemoteDebugMode | NoAlpha | NoTextures | NoVertexAlpha | NoLighting | InvalidationDebug | Wireframe | RenderDump | OutlineAll | OutlineMarked | DebugPainting, // 0x00000FFF + } + + [ComVisible(false)] + private struct FormStateCallbackMsg + { + public uint cbSize; + public int nMsg; + public RENDERHANDLE idObjectSubject; + public uint uRecentlyChanged; + public uint uCurrentMode; + public uint uActivation; + public int fVisible; + public int szClientDims_cx; + public int szClientDims_cy; + public int rcWindowGlobal_left; + public int rcWindowGlobal_top; + public int rcWindowGlobal_right; + public int rcWindowGlobal_bottom; + public uint idDisplay; + public uint cSpanningMonitors; + public int fExclusive; + public int fOnSecondaryMonitor; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/SoundCaps.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/SoundCaps.cs new file mode 100644 index 0000000..ae284ad --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/SoundCaps.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.SoundCaps +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Internal +{ + [ComVisible(false)] + [Serializable] + internal struct SoundCaps + { + internal uint DeviceType; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/StackIListEnumerator.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/StackIListEnumerator.cs new file mode 100644 index 0000000..6eb8b86 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/StackIListEnumerator.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.StackIListEnumerator +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Collections; + +namespace Microsoft.Iris.Render.Internal +{ + internal struct StackIListEnumerator : IEnumerator + { + private const int START_INVALID_INDEX = -1; + private IList m_list; + private int m_idxCurrent; + + internal StackIListEnumerator(IList list) + { + this.m_list = list; + this.m_idxCurrent = -1; + } + + public StackIListEnumerator GetEnumerator() => this; + + public bool MoveNext() => ++this.m_idxCurrent < this.m_list.Count; + + public object Current => this.m_list[this.m_idxCurrent]; + + public void Reset() => this.m_idxCurrent = -1; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Internal/Win32Api.cs b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Win32Api.cs new file mode 100644 index 0000000..aa80a31 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Internal/Win32Api.cs @@ -0,0 +1,393 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Internal.Win32Api +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; + +namespace Microsoft.Iris.Render.Internal +{ + [SuppressUnmanagedCodeSecurity] + internal static class Win32Api + { + public const int IDC_ARROW = 32512; + public const int IDC_IBEAM = 32513; + public const int IDC_WAIT = 32514; + public const int IDC_CROSS = 32515; + public const int IDC_UPARROW = 32516; + public const int IDC_SIZENWSE = 32642; + public const int IDC_SIZENESW = 32643; + public const int IDC_SIZEWE = 32644; + public const int IDC_SIZENS = 32645; + public const int IDC_SIZEALL = 32646; + public const int IDC_NO = 32648; + public const int IDC_HAND = 32649; + public const int IDC_APPSTARTING = 32550; + public const int IDC_HELP = 32651; + public const int SM_CXSCREEN = 0; + public const int SM_CYSCREEN = 1; + public const int RT_RCDATA = 10; + public const uint EVENT_MODIFY_STATE = 2; + public const uint LOAD_LIBRARY_AS_DATAFILE = 2; + public const int REG_NOTIFY_CHANGE_NAME = 1; + public const int REG_NOTIFY_CHANGE_ATTRIBUTES = 2; + public const int REG_NOTIFY_CHANGE_LAST_SET = 4; + public const int REG_NOTIFY_CHANGE_SECURITY = 8; + public const int KEY_NOTIFY = 16; + public const int KEY_READ = 131097; + public const int REG_SZ = 1; + public const int REG_DWORD = 4; + public const uint STATUS_ABANDONED_WAIT_0 = 128; + public const uint WAIT_ABANDONED = 128; + public const uint WAIT_TIMEOUT = 258; + public const uint WAIT_OBJECT_0 = 0; + public const uint INFINITE = 4294967295; + public const uint ERROR_SUCCESS = 0; + public const uint ERROR_FILE_NOT_FOUND = 2; + public const uint ERROR_PATH_NOT_FOUND = 3; + public const uint ERROR_ACCESS_DENIED = 5; + public const uint ERROR_INVALID_HANDLE = 6; + public const uint ERROR_NOT_ENOUGH_MEMORY = 8; + public const uint ERROR_OUTOFMEMORY = 14; + public const uint ERROR_NOT_SUPPORTED = 50; + public const uint ERROR_INVALID_PARAMETER = 87; + public const uint ERROR_CALL_NOT_IMPLEMENTED = 120; + public const uint ERROR_NOT_FOUND = 1168; + public const uint ERROR_NO_MATCH = 1169; + public const uint ERROR_SET_NOT_FOUND = 1170; + public const uint PM_REMOVE = 1; + public const uint WM_QUIT = 18; + public const uint WTS_CONSOLE_CONNECT = 1; + public const uint WTS_CONSOLE_DISCONNECT = 2; + public const uint WTS_REMOTE_CONNECT = 3; + public const uint WTS_REMOTE_DISCONNECT = 4; + public const uint WTS_SESSION_LOGON = 5; + public const uint WTS_SESSION_LOGOFF = 6; + public const uint WTS_SESSION_LOCK = 7; + public const uint WTS_SESSION_UNLOCK = 8; + public static readonly IntPtr HKEY_CURRENT_USER = new IntPtr(-2147483647); + 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)(a << 24 | b << 16 | g << 8) | 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) => RGB((byte)r, (byte)g, (byte)b); + + public static int GetRValue(Win32Api.COLORREF cr) => (int)cr.cr & byte.MaxValue; + + public static int GetGValue(Win32Api.COLORREF cr) => (int)((cr.cr & 65280U) >> 8); + + public static int GetBValue(Win32Api.COLORREF cr) => (int)((cr.cr & 16711680U) >> 16); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern bool TranslateMessage(ref Win32Api.MSG msg); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr DispatchMessage(ref Win32Api.MSG msg); + + [DllImport("user32.dll", EntryPoint = "GetWindowTextW", CharSet = CharSet.Unicode)] + public static extern int GetWindowText(HWND hWnd, StringBuilder text, int nMax); + + [DllImport("user32.dll", EntryPoint = "GetClassNameW", CharSet = CharSet.Unicode)] + public static extern int GetClassName(HWND hWnd, StringBuilder text, int nMax); + + [DllImport("user32.dll")] + public static extern bool ClientToScreen(HWND hwnd, [In, Out] ref Win32Api.POINT pt); + + [DllImport("user32.dll")] + public static extern bool ScreenToClient(HWND hwnd, [In, Out] ref Win32Api.POINT pt); + + [DllImport("user32.dll")] + public static extern int GetSystemMetrics(int metric); + + [DllImport("kernel32.dll")] + internal static extern Win32Api.HANDLE CreateEvent( + IntPtr lpSecurityAttributes, + bool bManualReset, + bool bInitialState, + string lpName); + + [DllImport("kernel32.dll")] + internal static extern bool CloseHandle(Win32Api.HANDLE hObject); + + [DllImport("kernel32.dll")] + public static extern void OutputDebugString(string lpOutputString); + + [DllImport("kernel32.dll")] + public static extern bool IsDebuggerPresent(); + + [DllImport("kernel32.dll")] + public static extern void DebugBreak(); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + internal static extern Win32Api.HINSTANCE LoadLibraryEx( + string stModuleName, + Win32Api.HANDLE hFile, + uint dwFlags); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + internal static extern bool FreeLibrary(Win32Api.HINSTANCE hinst); + + [DllImport("kernel32.dll", EntryPoint = "FindResourceW", CharSet = CharSet.Unicode)] + public static extern IntPtr FindResource(IntPtr hinst, string resource, IntPtr type); + + [DllImport("kernel32.dll")] + public static extern IntPtr LoadResource(IntPtr hinst, IntPtr i); + + [DllImport("kernel32.dll")] + public static extern IntPtr LockResource(IntPtr i); + + [DllImport("kernel32.dll")] + public static extern int SizeofResource(IntPtr hinst, IntPtr i); + + [DllImport("advapi32.dll")] + internal static extern int RegNotifyChangeKeyValue( + IntPtr hkey, + bool bWatchSubtree, + int dwNotifyFilter, + Win32Api.HANDLE hEvent, + bool fAsynchronous); + + [DllImport("advapi32.dll", CharSet = CharSet.Unicode)] + internal static extern int RegOpenKeyExW( + IntPtr hkey, + string szSubKey, + int dwOptions, + int samDesired, + out IntPtr phkResult); + + [DllImport("advapi32.dll", CharSet = CharSet.Unicode)] + public static extern int RegQueryValueExW( + IntPtr hKey, + string lpValueName, + IntPtr reserved, + out int lpType, + out int lpData, + ref int lpcbData); + + [DllImport("Advapi32.dll", CharSet = CharSet.Unicode)] + public static extern int RegQueryValueExW( + IntPtr hKey, + string lpValueName, + IntPtr reserved, + out int lpType, + char[] lpData, + ref int lpcbData); + + [DllImport("advapi32.dll")] + internal static extern int RegCloseKey(IntPtr hkey); + + [DllImport("kernel32.dll")] + public static extern void GetSystemInfo(out Win32Api.SYSTEM_INFO info); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + public static extern int RegisterWaitForSingleObject( + out IntPtr phNewWaitObject, + IntPtr hObject, + Win32Api.WaitOrTimerCallBack Callback, + IntPtr Context, + uint dwMilliseconds, + uint dwFlags); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + public static extern bool UnregisterWait(IntPtr hWaitHandle); + + internal static uint GetSystemPageSize() + { + Win32Api.SYSTEM_INFO info; + GetSystemInfo(out info); + return info.dwPageSize; + } + + internal static string DumpMessage(uint uMsg) => DumpMessageWorker(uMsg) ?? "UNKNOWN MESSAGE"; + + private static string DumpMessageWorker(uint uMsg) + { + InitMessageDump(); + if (uMsg >= s_rgsMessageNames.Length) + return null; + string rgsMessageName = s_rgsMessageNames[uMsg]; + if (rgsMessageName != null) + return rgsMessageName; + uint num = uMsg; + while (uMsg > 0U) + { + --num; + rgsMessageName = s_rgsMessageNames[num]; + if (rgsMessageName != null) + break; + } + if (rgsMessageName == null) + return null; + return string.Format(CultureInfo.InvariantCulture, "{0} + {1}", rgsMessageName, (uint)((int)uMsg - (int)num)); + } + + private static void InitMessageDump() + { + } + + [StructLayout(LayoutKind.Sequential)] + internal class CRITICAL_SECTION + { + public IntPtr DebugInfo; + public long LockCount; + public long RecursionCount; + public int OwningThread; + public int LockSemaphore; + public IntPtr SpinCount; + } + + [Serializable] + internal struct HANDLE + { + public IntPtr h; + + public bool IsValid => this.h != INVALID_HANDLE_VALUE; + + public static Win32Api.HANDLE NULL => new Win32Api.HANDLE() + { + h = IntPtr.Zero + }; + + public static Win32Api.HANDLE INVALID => new Win32Api.HANDLE() + { + h = INVALID_HANDLE_VALUE + }; + + public static bool operator ==(Win32Api.HANDLE hl, Win32Api.HANDLE hr) => hl.h == hr.h; + + public static bool operator !=(Win32Api.HANDLE hl, Win32Api.HANDLE hr) => hl.h != hr.h; + + public override bool Equals(object oCompare) => this.h == (IntPtr)oCompare; + + public override int GetHashCode() => (int)this.h.ToInt64(); + } + + internal struct HINSTANCE + { + public IntPtr h; + + public static Win32Api.HINSTANCE NULL => new Win32Api.HINSTANCE() + { + h = IntPtr.Zero + }; + + public static bool operator ==(Win32Api.HINSTANCE hl, Win32Api.HINSTANCE hr) => hl.h == hr.h; + + public static bool operator !=(Win32Api.HINSTANCE hl, Win32Api.HINSTANCE hr) => hl.h != hr.h; + + public override bool Equals(object oCompare) => this.h == (IntPtr)oCompare; + + public override int GetHashCode() => (int)this.h.ToInt64(); + } + + internal struct MSG + { + public HWND hwnd; + public uint message; + public IntPtr wParam; + public IntPtr lParam; + public uint time; + public int pt_x; + public int pt_y; + } + + [ComVisible(false)] + public struct SYSTEM_INFO + { + public ushort wProcessorArchitecture; + public ushort wReserved; + public uint dwPageSize; + public IntPtr lpMinimumApplicationAddress; + public IntPtr lpMaximumApplicationAddress; + public IntPtr dwActiveProcessorMask; + public uint dwNumberOfProcessors; + public uint dwProcessorType; + public uint dwAllocationGranularity; + public ushort wProcessorLevel; + public ushort wProcessorRevision; + } + + public struct SIZE + { + public int cx; + public int cy; + + public SIZE(int cx, int cy) + { + this.cx = cx; + this.cy = cy; + } + } + + [Serializable] + public struct POINT + { + public int x; + public int y; + + public POINT(int x, int y) + { + this.x = x; + this.y = y; + } + } + + [Serializable] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + + public RECT(int left, int top, int right, int bottom) + { + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + } + + public RECT(Win32Api.RECT rcSrc) + { + this.left = rcSrc.left; + this.top = rcSrc.top; + this.right = rcSrc.right; + this.bottom = rcSrc.bottom; + } + + public int Width + { + get => this.right - this.left; + set => this.right = this.left + value; + } + + public int Height + { + get => this.bottom - this.top; + set => this.bottom = this.top + value; + } + + public static Win32Api.RECT FromXYWH(int x, int y, int width, int height) => new Win32Api.RECT(x, y, x + width, y + height); + } + + public struct COLORREF + { + public uint cr; + + public COLORREF(uint cr) => this.cr = cr; + + public COLORREF(Win32Api.COLORREF cr) => this.cr = cr.cr; + } + + public delegate void WaitOrTimerCallBack(IntPtr lpParameter, byte f); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/InterpolateElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/InterpolateElement.cs new file mode 100644 index 0000000..788e98f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/InterpolateElement.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.InterpolateElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class InterpolateElement : EffectInput + { + internal const string ValuePropertyName = "Value"; + private EffectInput m_effectInput1; + private EffectInput m_effectInput2; + private float m_flValue; + private byte m_nValueID; + + public InterpolateElement( + string stName, + EffectInput effectInput1, + EffectInput effectInput2, + float flValue) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(effectInput1 != null, typeof(ArgumentNullException), nameof(effectInput1)); + Debug2.Validate(effectInput2 != null, typeof(ArgumentNullException), nameof(effectInput2)); + Debug2.Validate(flValue >= 0.0 && flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); + this.m_stName = stName; + this.m_effectInput1 = effectInput1; + this.m_effectInput2 = effectInput2; + this.m_flValue = flValue; + } + + public InterpolateElement() => this.m_typeInput = EffectInputType.Interpolate; + + public EffectInput Input1 + { + get => this.m_effectInput1; + set => this.m_effectInput1 = value; + } + + public EffectInput Input2 + { + get => this.m_effectInput2; + set => this.m_effectInput2 = value; + } + + public float Value + { + get => this.m_flValue; + set => this.m_flValue = value; + } + + internal byte ValueID => this.m_nValueID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput1.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput2.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", 8, ref this.m_nValueID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.m_effectInput1.Process(dictProperties) && this.m_effectInput2.Process(dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, m_flValue, this.m_nValueID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.m_effectInput1.AddCacheKey(cacheKey); + this.m_effectInput2.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Value", this.ValueID, this.Value, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/InvAlphaElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/InvAlphaElement.cs new file mode 100644 index 0000000..14be554 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/InvAlphaElement.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.InvAlphaElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public class InvAlphaElement : EffectOperation + { + public InvAlphaElement() => this.m_typeOperation = EffectOperationType.InvAlpha; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/InvColorElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/InvColorElement.cs new file mode 100644 index 0000000..e6f81ac --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/InvColorElement.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.InvColorElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public class InvColorElement : EffectOperation + { + public InvColorElement() => this.m_typeOperation = EffectOperationType.InvColor; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/InvalidateContentHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/InvalidateContentHandler.cs new file mode 100644 index 0000000..3423c07 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/InvalidateContentHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.InvalidateContentHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void InvalidateContentHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/InvertElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/InvertElement.cs new file mode 100644 index 0000000..cc551a0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/InvertElement.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.InvertElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public class InvertElement : EffectOperation + { + public InvertElement(string stName) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + this.m_stName = stName; + } + + public InvertElement() => this.m_typeOperation = EffectOperationType.Invert; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/IrisEngineInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/IrisEngineInfo.cs new file mode 100644 index 0000000..fdd0ddd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/IrisEngineInfo.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.IrisEngineInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class IrisEngineInfo : EngineInfo + { + private ConnectionInfo m_connectionInfo; + + public static EngineInfo CreateLocal() => new IrisEngineInfo(true); + + public static EngineInfo CreateRemote() => new IrisEngineInfo(true, TransportProtocol.TCP, "127.0.0.1", false); + + internal IrisEngineInfo(bool isPrimary) + : base(EngineType.Iris) + { + if (!isPrimary) + throw new NotImplementedException("Local connections to an existing engine are not supported yet"); + this.m_connectionInfo = new LocalConnectionInfo(); + } + + internal IrisEngineInfo( + bool isPrimary, + TransportProtocol protocol, + string sessionName, + bool swapByteOrder) + : base(EngineType.Iris) + { + if (!isPrimary) + throw new NotImplementedException("Local connections to an existing engine are not supported yet"); + this.m_connectionInfo = new RemoteConnectionInfo(protocol, sessionName, swapByteOrder); + } + + internal ConnectionInfo ConnectionInfo => this.m_connectionInfo; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Key.cs b/UIX.RenderApi/Microsoft/Iris/Render/Key.cs new file mode 100644 index 0000000..dcc3ad8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Key.cs @@ -0,0 +1,48 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Key +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; + +namespace Microsoft.Iris.Render +{ + internal static class Key + { + public const string PublicKey = "0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"; + public const string PublicKeyToken = "31bf3856ad364e35"; + public const string PublicKeyTokenAttrib = ",PublicKeyToken=31bf3856ad364e35"; + public const string PublicKeyAttrib = ",PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"; + private static readonly byte[] s_arPublicKeyBinary = ComputeBinaryKey(); + + public static byte[] PublicKeyBinary => (byte[])s_arPublicKeyBinary.Clone(); + + private static byte[] ComputeBinaryKey() + { + int length = "0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9".Length / 2 - 1; + byte[] numArray = new byte[length]; + int index1 = 2; + int index2 = 0; + while (index2 < length) + { + numArray[index2] = (byte)(ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1]) << 4 | ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1 + 1])); + ++index2; + index1 += 2; + } + return numArray; + } + + private static uint ParseNibble(char c) + { + if (c >= '0' && c <= '9') + return c - 48U; + if (c >= 'a' && c <= 'f') + return (uint)(10 + (c - 97)); + if (c >= 'A' && c <= 'F') + return (uint)(10 + (c - 65)); + Debug2.Throw(false, "invalid number format"); + return 0; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/LightShaftElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/LightShaftElement.cs new file mode 100644 index 0000000..3c2954d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/LightShaftElement.cs @@ -0,0 +1,149 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.LightShaftElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class LightShaftElement : EffectOperation + { + internal const string PositionPropertyName = "Position"; + internal const string DecayPropertyName = "Decay"; + internal const string DensityPropertyName = "Density"; + internal const string IntensityPropertyName = "Intensity"; + internal const string FallOffPropertyName = "FallOff"; + internal const string WeightPropertyName = "Weight"; + private Vector3 m_vPosition; + private byte m_nPositionID; + private float m_flDecay; + private byte m_nDecayID; + private float m_flDensity; + private byte m_nDensityID; + private float m_flIntensity; + private byte m_nIntensityID; + private float m_flFallOff; + private byte m_nFallOffID; + private float m_flWeight; + private byte m_nWeightID; + + public LightShaftElement( + string stName, + Vector3 vPosition, + float flDecay, + float flDensity, + float flFallOff, + float flIntensity, + float flWeight) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flDecay >= 0.0 && flDecay <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); + Debug2.Validate(flDensity > 0.0 && flDensity <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); + Debug2.Validate(flFallOff >= 0.0 && flFallOff <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); + Debug2.Validate(flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); + Debug2.Validate(flWeight >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); + this.m_stName = stName; + this.m_vPosition = vPosition; + this.m_flDecay = flDecay; + this.m_flDensity = flDensity; + this.m_flIntensity = flIntensity; + this.m_flFallOff = flFallOff; + this.m_flWeight = flWeight; + } + + public LightShaftElement() => this.m_typeOperation = EffectOperationType.LightShaft; + + public Vector3 Position + { + get => this.m_vPosition; + set => this.m_vPosition = value; + } + + internal byte PositionID => this.m_nPositionID; + + public float Decay + { + get => this.m_flDecay; + set + { + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); + this.m_flDecay = value; + } + } + + internal byte DecayID => this.m_nDecayID; + + public float Density + { + get => this.m_flDensity; + set + { + Debug2.Validate(value > 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); + this.m_flDensity = value; + } + } + + internal byte DensityID => this.m_nDensityID; + + public float Intensity + { + get => this.m_flIntensity; + set + { + Debug2.Validate(value >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); + this.m_flIntensity = value; + } + } + + internal byte IntensityID => this.m_nIntensityID; + + public float FallOff + { + get => this.m_flFallOff; + set + { + Debug2.Validate(value >= 0.0 && value <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); + this.m_flFallOff = value; + } + } + + internal byte FallOffID => this.m_nFallOffID; + + public float Weight + { + get => this.m_flWeight; + set + { + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); + this.m_flWeight = value; + } + } + + internal byte WeightID => this.m_nWeightID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Decay", 8, ref this.m_nDecayID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Density", 8, ref this.m_nDensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", 8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "FallOff", 8, ref this.m_nFallOffID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Weight", 8, ref this.m_nWeightID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Decay", EffectPropertyType.Float, m_flDecay, this.m_nDecayID, dictProperties) && (this.GenerateProperty("Density", EffectPropertyType.Float, m_flDensity, this.m_nDensityID, dictProperties) && this.GenerateProperty("Intensity", EffectPropertyType.Float, m_flIntensity, this.m_nIntensityID, dictProperties)) && this.GenerateProperty("FallOff", EffectPropertyType.Float, m_flFallOff, this.m_nFallOffID, dictProperties) && this.GenerateProperty("Weight", EffectPropertyType.Float, m_flWeight, this.m_nWeightID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Position", this.PositionID, this.Position, cacheKey); + this.GeneratePropertyCacheKey("Decay", this.DecayID, this.Decay, cacheKey); + this.GeneratePropertyCacheKey("Density", this.DensityID, this.Density, cacheKey); + this.GeneratePropertyCacheKey("Intensity", this.IntensityID, this.Intensity, cacheKey); + this.GeneratePropertyCacheKey("FallOff", this.FallOffID, this.FallOff, cacheKey); + this.GeneratePropertyCacheKey("Weight", this.WeightID, this.Weight, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/LinearInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/LinearInterpolation.cs new file mode 100644 index 0000000..6b1a6fd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/LinearInterpolation.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.LinearInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public sealed class LinearInterpolation : AnimationInterpolation + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/LoadHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/LoadHandler.cs new file mode 100644 index 0000000..0f16929 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/LoadHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.LoadHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void LoadHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/LocationChangedHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/LocationChangedHandler.cs new file mode 100644 index 0000000..dbe0e9f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/LocationChangedHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.LocationChangedHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void LocationChangedHandler(Point ptPosition); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/LogarithmicInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/LogarithmicInterpolation.cs new file mode 100644 index 0000000..bd8f8b8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/LogarithmicInterpolation.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.LogarithmicInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class LogarithmicInterpolation : AnimationInterpolation + { + private float m_weight; + + public LogarithmicInterpolation(float weight) + { + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); + this.m_weight = weight; + } + + internal float Weight => this.m_weight; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/MonitorChangedHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/MonitorChangedHandler.cs new file mode 100644 index 0000000..db98a3f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/MonitorChangedHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.MonitorChangedHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void MonitorChangedHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/MouseIdleHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/MouseIdleHandler.cs new file mode 100644 index 0000000..ec0940a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/MouseIdleHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.MouseIdleHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void MouseIdleHandler(bool fIdle); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/MouseOptions.cs b/UIX.RenderApi/Microsoft/Iris/Render/MouseOptions.cs new file mode 100644 index 0000000..1970108 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/MouseOptions.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.MouseOptions +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Flags] + public enum MouseOptions + { + Traversable = 1, + Hittable = 2, + Returnable = 4, + ClipChildren = 8, + None = 0, + ValidMask = ClipChildren | Returnable | Hittable | Traversable, // 0x0000000F + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Orientation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Orientation.cs new file mode 100644 index 0000000..3dd4134 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Orientation.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Orientation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum Orientation + { + Horizontal, + Vertical, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Point.cs b/UIX.RenderApi/Microsoft/Iris/Render/Point.cs new file mode 100644 index 0000000..d4c7248 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Point.cs @@ -0,0 +1,88 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Point +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct Point + { + private int m_x; + private int m_y; + public static readonly Point Zero = new Point(0, 0); + + public Point(int x, int y) + { + this.m_x = x; + this.m_y = y; + } + + public Point(Size size) + { + this.m_x = size.Width; + this.m_y = size.Height; + } + + public int X + { + get => this.m_x; + set => this.m_x = value; + } + + public int Y + { + get => this.m_y; + set => this.m_y = value; + } + + public int GetDimension(Orientation orientation) => orientation != Orientation.Horizontal ? this.Y : this.X; + + public void SetDimension(Orientation orientation, int value) + { + if (orientation == Orientation.Horizontal) + this.X = value; + else + this.Y = value; + } + + public static Point operator +(Point left, Point right) => new Point(left.X + right.X, left.Y + right.Y); + + public static Point Add(Point left, Point right) => left + right; + + public static Point operator -(Point left, Point right) => new Point(left.X - right.X, left.Y - right.Y); + + public static Point operator -(Point pt) => new Point(-pt.X, -pt.Y); + + public static Point Subtract(Point left, Point right) => left - right; + + public static Point Offset(Point point, int x, int y) => new Point(point.X + x, point.Y + y); + + public override bool Equals(object obj) => obj is Point point && point.X == this.X && point.Y == this.Y; + + public bool Equals(Point comp) => comp.X == this.X && comp.Y == this.Y; + + public static bool operator ==(Point left, Point right) => left.X == right.X && left.Y == right.Y; + + public static bool operator !=(Point left, Point right) => !(left == right); + + public override int GetHashCode() => this.X ^ this.Y; + + public override string ToString() => base.ToString(); + + public bool IsZero => this.Equals(Zero); + + public void Offset(int dx, int dy) + { + this.X += dx; + this.Y += dy; + } + + public Size ToSize() => new Size(this.X, this.Y); + + public static Point Negate(Point point) => new Point(-point.X, -point.Y); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/PointLight2DElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/PointLight2DElement.cs new file mode 100644 index 0000000..1a1f1d7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/PointLight2DElement.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.PointLight2DElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class PointLight2DElement : EffectInput + { + internal const string PositionPropertyName = "Position"; + internal const string RadiusPropertyName = "Radius"; + internal const string LightColorPropertyName = "LightColor"; + internal const string AmbientColorPropertyName = "AmbientColor"; + internal const string AttenuationPropertyName = "Attenuation"; + private Vector3 m_vPosition; + private byte m_nPositionID; + private float m_flRadius; + private byte m_nRadiusID; + private ColorF m_clrLight; + private byte m_nLightColorID; + private ColorF m_clrAmbient; + private byte m_nAmbientColorID; + private Vector3 m_vAttenuation; + private byte m_nAttenuationID; + + public PointLight2DElement( + string stName, + Vector3 vPosition, + float flRadius, + ColorF clrLight, + ColorF clrAmbient, + Vector3 vAttenuation) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flRadius >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flRadius is [0..)"); + this.m_stName = stName; + this.m_vPosition = vPosition; + this.m_flRadius = flRadius; + this.m_clrLight = clrLight; + this.m_clrAmbient = clrAmbient; + this.m_vAttenuation = vAttenuation; + } + + public PointLight2DElement() + { + this.m_typeInput = EffectInputType.PointLight2D; + this.m_vAttenuation = new Vector3(0.0f, 1f, 0.0f); + this.m_clrAmbient = new ColorF(0, 0, 0, 0); + } + + public Vector3 Position + { + get => this.m_vPosition; + set => this.m_vPosition = value; + } + + internal byte PositionID => this.m_nPositionID; + + public float Radius + { + get => this.m_flRadius; + set => this.m_flRadius = value; + } + + internal byte RadiusID => this.m_nRadiusID; + + public ColorF LightColor + { + get => this.m_clrLight; + set => this.m_clrLight = value; + } + + internal byte LightColorID => this.m_nLightColorID; + + public ColorF AmbientColor + { + get => this.m_clrAmbient; + set => this.m_clrAmbient = value; + } + + internal byte AmbientColorID => this.m_nAmbientColorID; + + public Vector3 Attenuation + { + get => this.m_vAttenuation; + set => this.m_vAttenuation = value; + } + + internal byte AttenuationID => this.m_nAttenuationID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Radius", 8, ref this.m_nRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", 20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", 16, ref this.m_nAttenuationID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Radius", EffectPropertyType.Float, m_flRadius, this.m_nRadiusID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, m_vAttenuation, this.m_nAttenuationID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Position", this.PositionID, this.Position, cacheKey); + this.GeneratePropertyCacheKey("Radius", this.RadiusID, this.Radius, cacheKey); + this.GeneratePropertyCacheKey("LightColor", this.LightColorID, this.LightColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("AmbientColor", this.AmbientColorID, this.AmbientColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("Attenuation", this.AttenuationID, this.Attenuation, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BLOBREF.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BLOBREF.cs new file mode 100644 index 0000000..2d2c5d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BLOBREF.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.BLOBREF +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + internal struct BLOBREF + { + public static readonly BLOBREF NULL = new BLOBREF(); + private uint value; + + private BLOBREF(uint value) => this.value = value; + + public static bool operator ==(BLOBREF hl, BLOBREF hr) => (int)hl.value == (int)hr.value; + + public static bool operator !=(BLOBREF hl, BLOBREF hr) => (int)hl.value != (int)hr.value; + + public override bool Equals(object oCompare) => (int)this.value == (int)(uint)oCompare; + + public override int GetHashCode() => (int)this.value; + + public static BLOBREF FromUInt32(uint value) => new BLOBREF(value); + + public static uint ToUInt32(BLOBREF handle) => handle.value; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BatchCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BatchCallback.cs new file mode 100644 index 0000000..5898cc1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BatchCallback.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.BatchCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal delegate void BatchCallback(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BlobInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BlobInfo.cs new file mode 100644 index 0000000..0760824 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/BlobInfo.cs @@ -0,0 +1,151 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.BlobInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal struct BlobInfo + { + private const int c_SizeOfChar = 2; + private const int c_SizeOfUInt = 4; + private Vector m_data; + private unsafe Message* m_pmsgBlob; + private uint m_totalSize; + private uint m_blobsOffset; + private bool m_foreignByteOrder; + private static object s_msgBlobSentinal = new object(); + private static Vector s_cache; + + public unsafe BlobInfo(RenderPort port, uint origTotal) + { + this.m_foreignByteOrder = port.ForeignByteOrder; + this.m_data = s_cache; + s_cache = null; + if (this.m_data == null) + this.m_data = new Vector(); + this.m_totalSize = origTotal; + this.m_blobsOffset = origTotal; + this.m_pmsgBlob = null; + } + + public uint AdjustedTotalSize => this.m_totalSize; + + public uint BlobDataSize => this.m_totalSize - this.m_blobsOffset; + + public BLOBREF Add(RENDERHANDLE[] param) + { + uint cbData = param == null ? 0U : (uint)(param.Length * 4); + return this.Add(param, cbData); + } + + public BLOBREF Add(string param) + { + if (param == null) + param = ""; + uint cbData = (uint)((param.Length + 1) * 2); + return this.Add(param, cbData); + } + + public unsafe BLOBREF Add(Message* pmsg) + { + uint cbData = 0; + if ((IntPtr)pmsg != IntPtr.Zero) + { + this.m_pmsgBlob = pmsg; + cbData = pmsg->cbSize; + } + return this.Add(s_msgBlobSentinal, cbData); + } + + private BLOBREF Add(object param, uint cbData) + { + Debug2.Validate(cbData < ushort.MaxValue, typeof(ArgumentException), "data blob too large", nameof(param)); + BLOBREF blobref = BLOBREF.FromUInt32(this.m_totalSize | cbData << 16); + if (cbData != 0U) + { + if (this.m_totalSize + cbData > ushort.MaxValue) + throw new InvalidOperationException("insufficient space in message for data blob"); + this.m_totalSize += cbData; + this.m_data.Add(param); + } + return blobref; + } + + public unsafe void Attach(Message* pMessage) + { + byte* numPtr1 = (byte*)((uint)pMessage + this.m_blobsOffset); + foreach (object obj in this.m_data) + { + if (obj is string) + { + string str = (string)obj; + fixed (char* chPtr1 = str) + { + if (!this.m_foreignByteOrder) + { + char* chPtr2 = (char*)numPtr1; + char* chPtr3 = chPtr1; + char* chPtr4 = chPtr1 + (str.Length + 1); + while (chPtr3 < chPtr4) + *chPtr2++ = *chPtr3++; + numPtr1 = (byte*)chPtr2; + } + else + { + byte* numPtr2 = (byte*)chPtr1; + for (byte* numPtr3 = numPtr2 + ((long)(str.Length + 1) * 2); numPtr2 < numPtr3; numPtr2 += 2) + { + *numPtr1++ = numPtr2[1]; + *numPtr1++ = *numPtr2; + } + } + } + } + else if (obj is RENDERHANDLE[]) + { + RENDERHANDLE[] renderhandleArray = (RENDERHANDLE[])obj; + fixed (RENDERHANDLE* renderhandlePtr = renderhandleArray) + { + if (!this.m_foreignByteOrder) + { + uint* numPtr2 = (uint*)numPtr1; + uint* numPtr3 = (uint*)renderhandlePtr; + uint* numPtr4 = numPtr3 + renderhandleArray.Length; + while (numPtr3 < numPtr4) + *numPtr2++ = *numPtr3++; + numPtr1 = (byte*)numPtr2; + } + else + { + byte* numPtr2 = (byte*)renderhandlePtr; + for (byte* numPtr3 = numPtr2 + ((long)renderhandleArray.Length * 4); numPtr2 < numPtr3; numPtr2 += 4) + { + *numPtr1++ = numPtr2[3]; + *numPtr1++ = numPtr2[2]; + *numPtr1++ = numPtr2[1]; + *numPtr1++ = *numPtr2; + } + } + } + } + else if (obj == s_msgBlobSentinal) + { + byte* pmsgBlob = (byte*)this.m_pmsgBlob; + byte* numPtr2 = pmsgBlob + (int)this.m_pmsgBlob->cbSize; + while (pmsgBlob < numPtr2) + *numPtr1++ = *pmsgBlob++; + } + else + Debug2.Throw(false, "Unexpected type."); + } + this.m_data.Clear(); + s_cache = this.m_data; + this.m_data = null; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/CallbackMessage.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/CallbackMessage.cs new file mode 100644 index 0000000..3283a2a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/CallbackMessage.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.CallbackMessage +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + internal struct CallbackMessage + { + public uint cbSize; + public uint nMsg; + public RENDERHANDLE idObjectSubject; + public RENDERHANDLE hTarget; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs new file mode 100644 index 0000000..7c3b2d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.ConnectionInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal abstract class ConnectionInfo + { + public static readonly ConnectionInfo Default = new LocalConnectionInfo(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ContextID.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ContextID.cs new file mode 100644 index 0000000..3f2dcc6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ContextID.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.ContextID +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + [Serializable] + internal struct ContextID + { + public static readonly ContextID NULL = new ContextID(); + public static readonly ContextID CURRENT = new ContextID(uint.MaxValue); + private uint value; + + private ContextID(uint value) => this.value = value; + + public static bool operator ==(ContextID hl, ContextID hr) => (int)hl.value == (int)hr.value; + + public static bool operator !=(ContextID hl, ContextID hr) => (int)hl.value != (int)hr.value; + + public override bool Equals(object oCompare) => oCompare is ContextID contextId && (int)this.value == (int)contextId.value; + + public override int GetHashCode() => (int)this.value; + + public static ContextID FromUInt32(uint value) => new ContextID(value); + + public static uint ToUInt32(ContextID handle) => handle.value; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBuffer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBuffer.cs new file mode 100644 index 0000000..87ad327 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBuffer.cs @@ -0,0 +1,105 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.DataBuffer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class DataBuffer : IDataBufferCallback, IRenderHandleOwner + { + private RenderPort m_port; + private RemoteDataBuffer m_remoteBuffer; + private unsafe void* m_pvData; + private uint m_cbSize; + + public unsafe DataBuffer(RenderPort port, void* pvData, uint cbSize) + { + this.m_port = port; + this.m_remoteBuffer = null; + this.m_pvData = pvData; + this.m_cbSize = cbSize; + } + + ~DataBuffer() => this.Dispose(false); + + public void Dispose() + { + this.m_port.Session.AssertOwningThread(); + GC.SuppressFinalize(this); + this.Dispose(true); + } + + private void Dispose(bool fInDispose) + { + if (fInDispose && this.m_remoteBuffer != null) + this.m_remoteBuffer.Dispose(); + this.m_remoteBuffer = null; + } + + public RenderPort Port => this.m_port; + + public uint DataSize => this.m_cbSize; + + public unsafe void* Data => this.m_pvData; + + public RemoteDataBuffer RemoteStub => this.m_remoteBuffer; + + public unsafe void Commit() + { + RENDERHANDLE renderhandle = this.m_port.AllocHandle(this); + try + { + this.m_port.SendDataBuffer(this.m_pvData, this.m_cbSize, renderhandle); + this.m_remoteBuffer = RemoteDataBuffer.CreateFromHandle(this.m_port, renderhandle); + this.m_remoteBuffer.SendRegisterOwner(this.m_port.MessagingProtocol.LocalDataBufferCallbackHandle); + renderhandle = RENDERHANDLE.NULL; + } + finally + { + if (renderhandle != RENDERHANDLE.NULL) + { + if (this.m_remoteBuffer != null) + { + this.m_remoteBuffer.Dispose(); + this.m_remoteBuffer = null; + } + else + this.m_port.FreeHandle(renderhandle); + } + } + } + + public event EventHandler DataConsumed; + + protected virtual void OnDataConsumed(object sender, EventArgs args) + { + this.OnReleaseLocalData(); + if (this.DataConsumed == null) + return; + this.DataConsumed(sender, args); + } + + protected void OnDataConsumed() => this.OnDataConsumed(this, EventArgs.Empty); + + public event EventHandler ReleaseLocalData; + + protected virtual void OnReleaseLocalData(object sender, EventArgs args) + { + if (this.ReleaseLocalData == null) + return; + this.ReleaseLocalData(sender, args); + } + + protected void OnReleaseLocalData() => this.OnReleaseLocalData(this, EventArgs.Empty); + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteBuffer.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = null; + + void IDataBufferCallback.OnComplete(RENDERHANDLE target) => this.OnDataConsumed(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs new file mode 100644 index 0000000..121a890 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs @@ -0,0 +1,151 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.DataBufferTracker +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class DataBufferTracker + { + private Vector m_alTracking; + + internal DataBufferTracker(object objUser) => this.m_alTracking = new Vector(); + + ~DataBufferTracker() => this.Dispose(false); + + internal void Dispose() + { + GC.SuppressFinalize(this); + this.Dispose(true); + } + + private void Dispose(bool fInDispose) + { + if (fInDispose && this.m_alTracking != null && this.m_alTracking.Count > 0) + { + foreach (DataBufferTracker.TrackingInfo trackingInfo in this.m_alTracking) + trackingInfo.DataBuffer.Dispose(); + this.m_alTracking.Clear(); + } + this.m_alTracking = null; + } + + internal int Count => this.m_alTracking.Count; + + internal string DEBUG_Description => (string)null; + + internal object DEBUG_User => (object)null; + + internal event EventHandler TrackerEmpty; + + protected virtual void OnTrackerEmpty(object sender, EventArgs args) + { + if (this.TrackerEmpty == null) + return; + this.TrackerEmpty(sender, args); + } + + internal void Track(DataBuffer dataBuffer) => this.Track(dataBuffer, null, null); + + internal void Track( + DataBuffer dataBuffer, + DataBufferTracker.CleanupEventHandler handler, + object contextData) + { + DataBufferTracker.TrackingInfo trackingInfo = new DataBufferTracker.TrackingInfo(dataBuffer, Users.Valid, handler, contextData); + dataBuffer.DataConsumed += new EventHandler(this.OnDataConsumed); + dataBuffer.ReleaseLocalData += new EventHandler(this.OnReleaseLocalData); + this.m_alTracking.Add(trackingInfo); + } + + internal void Release(DataBuffer dataBuffer, DataBufferTracker.Users userFlags) + { + DataBufferTracker.TrackingInfo trackingInfo1 = null; + foreach (DataBufferTracker.TrackingInfo trackingInfo2 in this.m_alTracking) + { + if (trackingInfo2.DataBuffer == dataBuffer) + { + trackingInfo1 = trackingInfo2; + break; + } + } + if (trackingInfo1 == null) + return; + uint userFlags1 = (uint)trackingInfo1.UserFlags; + Bits.ClearFlag(ref userFlags1, (uint)userFlags); + trackingInfo1.UserFlags = (DataBufferTracker.Users)userFlags1; + if (userFlags1 != 0U) + return; + if (trackingInfo1.CleanupHandler != null) + trackingInfo1.CleanupHandler(this, new DataBufferTracker.CleanupEventArgs(trackingInfo1.CleanupHandlerData)); + this.m_alTracking.Remove(trackingInfo1); + trackingInfo1.DataBuffer.DataConsumed -= new EventHandler(this.OnDataConsumed); + trackingInfo1.DataBuffer.ReleaseLocalData -= new EventHandler(this.OnReleaseLocalData); + trackingInfo1.DataBuffer.Dispose(); + trackingInfo1.DataBuffer = null; + trackingInfo1.CleanupHandler = null; + trackingInfo1.CleanupHandlerData = null; + if (this.m_alTracking.Count != 0) + return; + this.OnTrackerEmpty(this, EventArgs.Empty); + } + + private void OnDataConsumed(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, Users.Consumed); + + private void OnReleaseLocalData(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, Users.LocalData); + + internal void DEBUG_SetDescription(string stDescription) + { + } + + internal void DEBUG_DumpTrackingList() + { + } + + [System.Flags] + internal enum Users : uint + { + Consumed = 1, + LocalData = 2, + Valid = LocalData | Consumed, // 0x00000003 + } + + internal class CleanupEventArgs : EventArgs + { + public object ContextData; + + internal CleanupEventArgs(object contextData) => this.ContextData = contextData; + } + + internal delegate void CleanupEventHandler( + object sender, + DataBufferTracker.CleanupEventArgs args); + + private class TrackingInfo + { + private static uint s_idSeed; + internal DataBuffer DataBuffer; + internal DataBufferTracker.Users UserFlags; + internal uint Id; + internal DataBufferTracker.CleanupEventHandler CleanupHandler; + internal object CleanupHandlerData; + + internal TrackingInfo( + DataBuffer dataBuffer, + DataBufferTracker.Users userFlags, + DataBufferTracker.CleanupEventHandler handler, + object contextData) + { + this.DataBuffer = dataBuffer; + this.UserFlags = userFlags; + this.Id = s_idSeed++; + this.CleanupHandler = handler; + this.CleanupHandlerData = contextData; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/EngineApi.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/EngineApi.cs new file mode 100644 index 0000000..95c396c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/EngineApi.cs @@ -0,0 +1,263 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.EngineApi +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; + +namespace Microsoft.Iris.Render.Protocol +{ + [SuppressUnmanagedCodeSecurity] + internal static class EngineApi + { + private const string s_stEhRenderDll = "UIXRender.dll"; + + public static void IFC(HRESULT hr) + { + if (hr.Int >= 0) + return; + RenderException.ErrorCode code = (RenderException.ErrorCode)hr.Int; + switch (hr.Int) + { + case -2147221503: + case -2147221502: + throw new OutOfMemoryException(); + case -2147221494: + throw new RenderException(code, "Generic failure."); + case -2147221493: + throw new RenderException(code, "The object is in a \"busy\" state and is not available to process the request."); + case -2147221492: + throw new RenderException(code, "The object is not in a usable state to process the request."); + case -2147221484: + throw new RenderException(code, "The Context has not been initialized."); + case -2147221474: + throw new RenderException(code, "The object was used in the incorrect context."); + case -2147221473: + throw new RenderException(code, "The Context has been marked to only allow read-only operations. For example, this may be in the middle of a read-only callback."); + case -2147221472: + throw new RenderException(code, "The threading model has already be determined by a previous call to SpInit() and can no longer be changed."); + case -2147221471: + throw new RenderException(code, "Unable to use the IGMM_STANDARD messaging model because it is either unsupported or cannot be installed."); + case -2147221464: + throw new RenderException(code, "Can not mix an invalid coordinate mapping, for example having a non-relative child of a relative parent."); + case -2147221454: + throw new RenderException(code, "Could not find a MSGID for one of the requested messages. This will be represented by a '0' in the MSGID field for that message."); + case -2147221444: + throw new RenderException(code, "The operation is not legal because the specified Gadget does not have a GS_BUFFERED style."); + case -2147221434: + throw new RenderException(code, "The specific Gadget has started the destruction and can not be be modified in this manner."); + case -2147221433: + throw new RenderException(code, "The specific object is locked and may not be modified."); + case -2147221432: + throw new InvalidOperationException("The operation is not supported."); + case -2147221424: + throw new RenderException(code, "The specified optional component has not yet been initialized with InitGadgetComponent()."); + case -2147221414: + throw new RenderException(code, "The specified object was not found."); + case -2147221413: + throw new RenderException(code, "The ObjectID is already in use."); + case -2147221412: + throw new FileNotFoundException("The specified file could not be found"); + case -2147221411: + throw new ArgumentOutOfRangeException("", "The argument is out of range"); + case -2147221404: + throw new RenderException(code, "The specified parmeters are mismatched for the current object state."); + case -2147221394: + throw new RenderException(code, "GDI+ was unable to be loaded. It may not be installed on the system or may not be properly initialized."); + case -2147221393: + throw new RenderException(code, "Direct3D was unable to be loaded. It may not be installed on the system or may not be properly initialized."); + case -2147221384: + throw new RenderException(code, "The specified class was already registered."); + case -2147221383: + throw new RenderException(code, "The specified message was not found during class registration."); + case -2147221382: + throw new RenderException(code, "The specified message was not implemented during class registration."); + case -2147221381: + throw new RenderException(code, "The implementation of the specific class has not yet been registered."); + case -2147221380: + throw new RenderException(code, "Sending the message failed."); + case -2147221379: + throw new RenderException(code, "The message data is too large."); + case -2147221374: + throw new RenderException(code, "The specified object does not have any content."); + case -2147221373: + throw new RenderException(code, "The specified object is not properly setup to store the data."); + case -2147221364: + throw new RenderException(code, "Generic failure from Win32 that did not SetLastError()."); + case -2147221363: + throw new RenderException(code, "Generic failure from GDI+."); + case -2147221362: + throw new RenderException(code, "Generic failure from driver or rendering."); + case -2147221354: + throw new RenderException(code, "Unable to connect to remote renderer."); + default: + Marshal.ThrowExceptionForHR(hr.Int); + break; + } + } + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpInit(ref EngineApi.InitArgs args); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpUninit(); + + [DllImport("UIXRender.dll")] + public static extern unsafe HRESULT SpBufferOpen( + EngineApi.BufferInfo* phdrData, + void* pvData); + + [DllImport("UIXRender.dll")] + public static extern unsafe HRESULT SpWrapBufferProc( + EngineApi.MessageBufferEventHandler pfnProcessBufferProc, + IntPtr* ppNativeProc); + + [DllImport("UIXRender.dll", CharSet = CharSet.Auto)] + public static extern HRESULT SpPeekMessage( + out Win32Api.MSG msg, + HWND hwnd, + uint nMsgFilterMin, + uint nMsgFilterMax, + uint wRemoveMsg, + out EngineApi.WorkResult nResult); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpWaitMessage(uint nTimeOutMs, IntPtr _unused); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpInvoke( + ContextID idContext, + IntPtr pfnInvoke, + IntPtr pvArgs, + bool synchronous); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpRenderThreadInit( + ref EngineApi.InitArgs argsRender, + out IntPtr pThread); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpRenderThreadUninit(IntPtr pThread); + + [DllImport("UIXRender.dll", CharSet = CharSet.Unicode)] + public static extern HRESULT SpRemoteCreateServerStreams( + string stSession, + TransportProtocol nProtocol, + out IntPtr pSendStream, + out IntPtr pReceiveStream); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpRemoteWaitServerStreamsConnected( + TransportProtocol nProtocol, + IntPtr pSendStream, + IntPtr pReceiveStream); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpRemoteServerInit( + IntPtr pSendStream, + IntPtr pReceiveStream, + EngineApi.InitArgs argsSend, + out IntPtr pSession); + + [DllImport("UIXRender.dll")] + public static extern HRESULT SpRemoteServerUninit( + IntPtr pSession, + bool fForceShutdown, + out ShutdownReason nShutdownReason); + + [DllImport("UIXRender.dll", CharSet = CharSet.Ansi)] + public static extern HRESULT SpDx9CompileEffect( + string stEffect, + string stDefines, + out IntPtr pErrorString, + out IntPtr pErrorBuffer, + out IntPtr pEffectBlob, + out uint EffectBlobSize, + out IntPtr pEffectBlobBuffer); + + [DllImport("UIXRender.dll")] + public static extern void SpObjectRelease(IntPtr pUnknown); + + [System.Flags] + public enum BufferFlags + { + IsBatch = 1, + CopyData = 2, + Valid = CopyData | IsBatch, // 0x00000003 + } + + [ComVisible(false)] + public struct BufferInfo + { + public ContextID idContextSrc; + public ContextID idContextDest; + public RENDERHANDLE idBuffer; + public EngineApi.BufferFlags nFlags; + public uint cbSizeBuffer; + } + + internal delegate void TimeoutEventHandler(IntPtr pData); + + [ComVisible(false)] + internal struct InitArgs + { + public uint cbSize; + public ContextID idContext; + public int cItemsPerGroupBits; + public int cGroupBits; + public IntPtr pfnProcessBuffer; + public IntPtr pvProcessData; + public RENDERHANDLE idObjectBrokerClass; + public EngineApi.TimeoutEventHandler pfnTimeout; + public IntPtr pvTimeoutData; + public uint nTimeOutSec; + + public InitArgs(MessageCookieLayout layout, ContextID idContextNew) + { + Debug2.Validate(idContextNew != ContextID.NULL, typeof(ArgumentNullException), nameof(idContextNew)); + this.cbSize = (uint)Marshal.SizeOf(typeof(EngineApi.InitArgs)); + this.idContext = idContextNew; + this.cItemsPerGroupBits = layout.numberOfObjectBits; + this.cGroupBits = layout.numberOfGroupBits; + this.pfnProcessBuffer = IntPtr.Zero; + this.pvProcessData = IntPtr.Zero; + this.idObjectBrokerClass = RENDERHANDLE.FromUInt32(0U); + this.pfnTimeout = null; + this.pvTimeoutData = IntPtr.Zero; + this.nTimeOutSec = 0U; + } + + public unsafe InitArgs( + MessageCookieLayout layout, + ContextID idContextNew, + EngineApi.MessageBufferEventHandler pfnProcessBufferProc) + : this(layout, idContextNew) + { + if (pfnProcessBufferProc == null) + return; + IntPtr num; + IFC(SpWrapBufferProc(pfnProcessBufferProc, &num)); + this.pfnProcessBuffer = num; + } + } + + internal unsafe delegate int MessageBufferEventHandler( + IntPtr pData, + uint hContext, + EngineApi.BufferInfo* pBufferInfo, + void* pvBufferData); + + [System.Flags] + public enum WorkResult : uint + { + ProcessedMessage = 1, + NewUserMessage = 2, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleGroup.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleGroup.cs new file mode 100644 index 0000000..57fbfb1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleGroup.cs @@ -0,0 +1,367 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.HandleGroup +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class HandleGroup : RenderObject, IDisposable, IEnumerable, IRenderHandleOwner + { + private const int USAGE_INDEX_SHIFT = 5; + private const uint USAGE_INDEX_MASK = 31; + private const uint USAGE_SLOT_COUNT = 32; + private const uint USAGE_FULL_MASK = 4294967295; + private const uint LOWEST_BIT = 1; + private const uint INITIAL_BSEARCH_SPLIT = 16; + private const uint INITIAL_BSEARCH_TEST = 65535; + private static GCHandle s_gchEmpty = new GCHandle(); + private RenderPort m_portOwner; + private GCHandleType m_ht; + private GCHandle[] m_objects; + private uint[] m_usage; + private byte[] m_uniqueness; + private uint m_alloc; + private uint m_used; + private uint m_hint; + private uint m_maxObjects; + + public HandleGroup(GCHandleType ht, RenderPort portOwner) + : this(ht, portOwner, false, uint.MaxValue) + { + } + + public HandleGroup(GCHandleType ht, RenderPort portOwner, bool uniquify) + : this(ht, portOwner, uniquify, uint.MaxValue) + { + } + + public HandleGroup(GCHandleType ht, RenderPort portOwner, uint maxObjects) + : this(ht, portOwner, false, maxObjects) + { + } + + public HandleGroup(GCHandleType ht, RenderPort portOwner, bool uniquify, uint maxObjects) + { + Debug2.Validate(portOwner != null, typeof(ArgumentNullException), nameof(portOwner), "Must specify valid owner"); + this.m_ht = ht; + this.m_portOwner = portOwner; + this.m_maxObjects = maxObjects; + if (!uniquify) + return; + this.m_uniqueness = new byte[1]; + } + + protected override void Dispose(bool inDispose) + { + try + { + this.Clear(); + } + finally + { + base.Dispose(inDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => RENDERHANDLE.NULL; + + void IRenderHandleOwner.OnDisconnect() + { + } + + public IRenderHandleOwner this[uint index] + { + get + { + this.ValidateSlot(index); + GCHandle gcHandle = this.m_objects[index]; + return !gcHandle.IsAllocated ? null : (IRenderHandleOwner)gcHandle.Target; + } + set + { + this.ValidateSlot(index); + this.SetIndex(index, value); + } + } + + public uint Count => this.m_alloc; + + public IEnumerator GetEnumerator() => new HandleGroup.ObjectCopy(this).GetEnumerator(); + + public IRenderHandleOwner Get( + uint index, + uint expectedUniqueness, + bool fAllowInvalid) + { + if (!this.ValidateAccess(index, expectedUniqueness, fAllowInvalid)) + return null; + GCHandle gcHandle = this.m_objects[index]; + return !gcHandle.IsAllocated ? null : (IRenderHandleOwner)gcHandle.Target; + } + + public IRenderHandleOwner Get(uint index, uint expectedUniqueness) => this.Get(index, expectedUniqueness, false); + + public void Set(uint index, uint expectedUniqueness, IRenderHandleOwner owner) + { + this.ValidateAccess(index, expectedUniqueness); + this.SetIndex(index, owner); + } + + public void Clear() + { + if (this.m_objects == null) + return; + for (uint index = 0; index < m_objects.Length; ++index) + this.SetIndex(index, null); + this.m_objects = null; + this.m_usage = null; + if (this.m_uniqueness != null) + this.m_uniqueness = new byte[1]; + this.m_alloc = 0U; + this.m_used = 0U; + this.m_hint = 0U; + } + + public uint Add(IRenderHandleOwner owner) => this.Add(owner, out uint _); + + public uint Add(IRenderHandleOwner owner, out uint unique) + { + if (this.m_used >= this.m_alloc) + this.GrowStorage(); + uint index = this.AllocSlot(); + this.SetIndex(index, owner); + this.UpdateUniqueness(index, out unique); + return index; + } + + public void AddAtIndex(IRenderHandleOwner owner, uint index) => this.AddAtIndex(owner, index, out uint _); + + public void AddAtIndex(IRenderHandleOwner owner, uint index, out uint unique) + { + if (index >= this.m_alloc) + this.GrowStorageTo(index + 1U); + this.AllocSlotAt(index); + this.SetIndex(index, owner); + this.UpdateUniqueness(index, out unique); + } + + public void AddAtIndexWithKnownUniqueness( + IRenderHandleOwner owner, + uint index, + uint unique, + bool fUpdateExisting) + { + if (index >= this.m_alloc) + this.GrowStorageTo(index + 1U); + if (fUpdateExisting && !this.ValidateSlotFree(index, true)) + Debug2.Validate(this.Get(index, unique) == null, typeof(ArgumentException), "Should only be updating a null owner"); + else + this.AllocSlotAt(index); + this.SetIndex(index, owner); + this.SetUniqueness(index, unique); + } + + public void Remove(uint index) + { + this.ValidateSlot(index); + this.SetIndex(index, null); + this.FreeSlot(index); + } + + public void Remove(uint index, uint expectedUniqueness) + { + this.ValidateAccess(index, expectedUniqueness); + this.SetIndex(index, null); + this.FreeSlot(index); + } + + private static bool IsEmpty(GCHandle gch) => GCHandle.ToIntPtr(gch) == IntPtr.Zero; + + private void SetIndex(uint index, IRenderHandleOwner newOwner) + { + GCHandle gch = this.m_objects[index]; + if (!IsEmpty(gch)) + { + ((IRenderHandleOwner)gch.Target)?.OnDisconnect(); + gch.Free(); + } + if (newOwner != null) + this.m_objects[index] = GCHandle.Alloc(newOwner, this.m_ht); + else + this.m_objects[index] = s_gchEmpty; + } + + private void UpdateUniqueness(uint index, out uint unique) + { + byte num1 = 0; + if (this.m_uniqueness != null) + { + byte num2 = this.m_uniqueness[index]; + num1 = num2 >= byte.MaxValue ? (byte)1 : (byte)(num2 + 1U); + this.m_uniqueness[index] = num1; + } + unique = num1; + } + + private void SetUniqueness(uint index, uint unique) + { + Debug2.Validate(unique <= byte.MaxValue, typeof(ArgumentOutOfRangeException), "Uniqueness must be a byte"); + if (this.m_uniqueness == null) + return; + this.m_uniqueness[index] = (byte)(unique & byte.MaxValue); + } + + private void ValidateSlot(uint index) => this.ValidateSlot(index, false); + + private bool ValidateSlot(uint index, bool fAllowInvalid) + { + bool flag = false; + if (index < this.m_alloc && ((int)this.m_usage[index >> 5] & 1 << (int)index) != 0) + flag = true; + Debug2.Throw(flag || fAllowInvalid, "Slot is not allocated"); + return flag; + } + + private void ValidateSlotFree(uint index) => this.ValidateSlotFree(index, false); + + private bool ValidateSlotFree(uint index, bool fAllowInvalid) + { + bool flag = false; + if (index < this.m_alloc && ((int)this.m_usage[index >> 5] & 1 << (int)index) == 0) + flag = true; + Debug2.Throw(flag || fAllowInvalid, "Slot is not free"); + return flag; + } + + private void ValidateAccess(uint index, uint expectedUniqueness) => this.ValidateAccess(index, expectedUniqueness, false); + + private bool ValidateAccess(uint index, uint expectedUniqueness, bool fAllowInvalid) + { + if (!this.ValidateSlot(index, fAllowInvalid)) + return false; + uint num = 0; + if (this.m_uniqueness != null) + num = this.m_uniqueness[index]; + bool flag = (int)expectedUniqueness == (int)num; + Debug2.Throw(flag || fAllowInvalid, "Slot uniqueness is stale"); + return flag; + } + + private uint AllocSlot() + { + uint num1 = 0; + uint hint; + for (hint = this.m_hint; hint < m_usage.Length; ++hint) + { + num1 = this.m_usage[hint]; + if (num1 != uint.MaxValue) + break; + } + this.m_hint = hint; + uint num2 = 16; + uint maxValue = ushort.MaxValue; + uint num3 = 0; + do + { + if (((int)num1 & (int)maxValue) == (int)maxValue) + { + num1 >>= (int)num2; + num3 += num2; + } + num2 >>= 1; + maxValue >>= (int)num2; + } + while (num2 != 0U); + this.m_usage[hint] |= 1U << (int)num3; + ++this.m_used; + return hint << 5 | num3; + } + + private void AllocSlotAt(uint index) + { + this.ValidateSlotFree(index); + this.m_usage[index >> 5] |= 1U << (int)index; + ++this.m_used; + } + + private void FreeSlot(uint index) + { + uint num = index >> 5; + this.m_usage[num] &= (uint)~(1 << (int)index); + --this.m_used; + if (this.m_hint <= num) + return; + this.m_hint = num; + } + + private void GrowStorage() + { + Debug2.Validate(this.m_alloc < this.m_maxObjects, typeof(InvalidOperationException), "Too many video resources have been allocated"); + uint newSize = this.m_alloc * 2U; + if (newSize == 0U) + newSize = 32U; + if (newSize > this.m_maxObjects) + newSize = this.m_maxObjects; + this.GrowStorageTo(newSize); + } + + private void GrowStorageTo(uint newSize) + { + Debug2.Validate(newSize > this.m_alloc, typeof(ArgumentException), nameof(newSize)); + Debug2.Validate(newSize <= this.m_maxObjects, typeof(InvalidOperationException), "Too many video resources have been allocated"); + GCHandle[] gcHandleArray = new GCHandle[newSize]; + uint[] numArray1 = null; + byte[] numArray2 = null; + uint num = (uint)((int)newSize + 32 - 1) >> 5; + if (this.m_usage == null || m_usage.Length < num) + numArray1 = new uint[num]; + if (this.m_uniqueness != null) + { + numArray2 = new byte[newSize]; + Array.Copy(m_uniqueness, numArray2, this.m_uniqueness.Length); + } + if (this.m_objects != null) + { + Array.Copy(m_objects, gcHandleArray, this.m_objects.Length); + if (numArray1 != null) + Array.Copy(m_usage, numArray1, this.m_usage.Length); + this.m_hint = (uint)this.m_usage.Length; + } + this.m_objects = gcHandleArray; + if (numArray1 != null) + this.m_usage = numArray1; + this.m_uniqueness = numArray2; + this.m_alloc = newSize; + } + + private class ObjectCopy + { + private IRenderHandleOwner[] m_arObjects; + + public ObjectCopy(HandleGroup map) + { + uint used = map.m_used; + this.m_arObjects = new IRenderHandleOwner[used]; + uint num = 0; + for (uint index = 0; index < used; ++index) + { + GCHandle gch = map.m_objects[index]; + if (!IsEmpty(gch)) + { + IRenderHandleOwner target = (IRenderHandleOwner)gch.Target; + if (target != null) + this.m_arObjects[num++] = target; + } + } + } + + public IEnumerator GetEnumerator() => this.m_arObjects.GetEnumerator(); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleTable.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleTable.cs new file mode 100644 index 0000000..4639bfb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/HandleTable.cs @@ -0,0 +1,179 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.HandleTable +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class HandleTable : RenderObject, IComparer + { + private RenderPort m_portOwner; + private HandleGroup m_groups; + private uint m_MaxObjectsPerGroup; + private int m_GroupShift; + private int m_UniqueShift; + private uint m_GroupMask; + private uint m_ObjectMask; + private uint m_UniqueMask; + + public HandleTable(RenderPort portOwner, MessageCookieLayout layout) + { + Debug2.Validate(portOwner != null, typeof(ArgumentNullException), nameof(portOwner)); + this.m_portOwner = portOwner; + uint maxObjects = 1U << layout.numberOfGroupBits; + this.m_MaxObjectsPerGroup = 1U << layout.numberOfObjectBits; + this.m_GroupShift = layout.numberOfObjectBits; + this.m_UniqueShift = layout.numberOfObjectBits + layout.numberOfGroupBits; + this.m_GroupMask = (uint)((int)maxObjects - 1 << this.m_GroupShift); + this.m_ObjectMask = this.m_MaxObjectsPerGroup - 1U; + this.m_UniqueMask = (uint)~((int)this.m_GroupMask | (int)this.m_ObjectMask); + this.m_groups = new HandleGroup(GCHandleType.Normal, this.m_portOwner, maxObjects); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (!inDispose) + return; + foreach (HandleGroup group in this.m_groups) + group?.Dispose(); + this.m_groups.Clear(); + this.m_groups = null; + } + finally + { + base.Dispose(inDispose); + } + } + + public RENDERHANDLE Alloc(RENDERGROUP groupId, IRenderHandleOwner owner) + { + uint uint32 = RENDERGROUP.ToUInt32(groupId); + HandleGroup group = this.m_groups[uint32] as HandleGroup; + Debug2.Validate(group != null, typeof(ArgumentException), "Group does not exist", nameof(groupId)); + uint unique; + uint num = group.Add(owner, out unique); + return RENDERHANDLE.FromUInt32((uint)((int)unique << this.m_UniqueShift | (int)uint32 << this.m_GroupShift) | num); + } + + public void AllocWithId(IRenderHandleOwner owner, RENDERHANDLE handle, bool fUpdateExisting) + { + uint unique; + HandleGroup group; + uint index; + this.MapHandle(handle, true, out unique, out group, out index); + group.AddAtIndexWithKnownUniqueness(owner, index, unique, fUpdateExisting); + } + + public void Free(RENDERHANDLE handle) + { + uint unique; + HandleGroup group; + uint index; + this.MapHandle(handle, false, out unique, out group, out index); + group.Remove(index, unique); + } + + public IRenderHandleOwner GetOwner(RENDERHANDLE handle) => this.GetOwner(handle, false); + + public IRenderHandleOwner GetOwner(RENDERHANDLE handle, bool fAllowInvalid) + { + uint unique; + HandleGroup group; + uint index; + this.MapHandle(handle, false, out unique, out group, out index, fAllowInvalid); + return group.Get(index, unique, fAllowInvalid); + } + + public void SetOwner(RENDERHANDLE handle, IRenderHandleOwner owner) + { + uint unique; + HandleGroup group; + uint index; + this.MapHandle(handle, false, out unique, out group, out index); + group.Set(index, unique, owner); + } + + public RENDERGROUP GetGroup(RENDERHANDLE handle) => RENDERGROUP.FromUInt32((RENDERHANDLE.ToUInt32(handle) & this.m_GroupMask) >> this.m_GroupShift); + + public RENDERGROUP AllocGroup() => RENDERGROUP.FromUInt32(this.m_groups.Add(this.CreateNewGroup())); + + public void AllocGroupWithId(RENDERGROUP groupId) + { + uint uint32 = RENDERGROUP.ToUInt32(groupId); + this.m_groups.AddAtIndex(this.CreateNewGroup(), uint32); + } + + public void FreeGroup(RENDERGROUP groupId) => this.m_groups.Remove(RENDERGROUP.ToUInt32(groupId)); + + public void Validate(RENDERHANDLE handle) + { + uint unique; + HandleGroup group; + uint index; + this.MapHandle(handle, false, out unique, out group, out index); + Debug2.Validate(group.Get(index, unique) != null, typeof(ArgumentException), "Must point to valid object", nameof(handle)); + } + + private HandleGroup CreateNewGroup() => new HandleGroup(GCHandleType.Weak, this.m_portOwner, true, this.m_MaxObjectsPerGroup); + + private void MapHandle( + RENDERHANDLE handle, + bool fCreateGroup, + out uint unique, + out HandleGroup group, + out uint index) + { + this.MapHandle(handle, fCreateGroup, out unique, out group, out index, false); + } + + private void MapHandle( + RENDERHANDLE handle, + bool fCreateGroup, + out uint unique, + out HandleGroup group, + out uint index, + bool fAllowInvalid) + { + uint uint32 = RENDERHANDLE.ToUInt32(handle); + uint num1 = (uint32 & this.m_UniqueMask) >> this.m_UniqueShift; + uint index1 = (uint32 & this.m_GroupMask) >> this.m_GroupShift; + uint num2 = uint32 & this.m_ObjectMask; + group = null; + if (index1 <= this.m_groups.Count) + group = this.m_groups[index1] as HandleGroup; + if (group == null) + { + if (fCreateGroup) + { + group = this.CreateNewGroup(); + this.m_groups.AddAtIndex(group, index1); + } + else + Debug2.Throw(fAllowInvalid, "Group does not exist"); + } + unique = num1; + index = num2; + } + + int IComparer.Compare(object a, object b) + { + KeyValueEntry keyValueEntry1 = (KeyValueEntry)a; + KeyValueEntry keyValueEntry2 = (KeyValueEntry)b; + uint num1 = keyValueEntry1.Value; + uint num2 = keyValueEntry2.Value; + if (num1 > num2) + return -1; + return num1 < num2 ? 1 : string.Compare(keyValueEntry1.Key, keyValueEntry2.Key, StringComparison.Ordinal); + } + + protected override void Invariant() => Debug2.Validate(this.m_groups != null, typeof(InvalidOperationException), "HandleTable has no HandleGroups"); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IChannel.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IChannel.cs new file mode 100644 index 0000000..417203b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IChannel.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.IChannel +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal interface IChannel + { + void Connect(ContextID idRemoteContext, RENDERHANDLE hBrokerClass, MessageCookieLayout layout); + + void Dispose(); + + bool IsConnected { get; } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IRenderHandleOwner.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IRenderHandleOwner.cs new file mode 100644 index 0000000..d08432d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/IRenderHandleOwner.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.IRenderHandleOwner +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal interface IRenderHandleOwner + { + RENDERHANDLE RenderHandle { get; } + + void OnDisconnect(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalChannel.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalChannel.cs new file mode 100644 index 0000000..f73c96d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalChannel.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.LocalChannel +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class LocalChannel : RenderObject, IChannel + { + private IntPtr m_renderThread; + + public LocalChannel(LocalConnectionInfo connectionInfo) + { + } + + public bool IsConnected => this.m_renderThread != IntPtr.Zero; + + public void Connect( + ContextID remoteContextId, + RENDERHANDLE brokerClassHandle, + MessageCookieLayout layout) + { + Debug2.Validate(remoteContextId != ContextID.NULL, typeof(ArgumentNullException), nameof(remoteContextId)); + var args = new EngineApi.InitArgs(layout, remoteContextId) + { + idObjectBrokerClass = brokerClassHandle + }; + EngineApi.IFC(EngineApi.SpRenderThreadInit(ref args, out this.m_renderThread)); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (!(this.m_renderThread != IntPtr.Zero)) + return; + EngineApi.IFC(EngineApi.SpRenderThreadUninit(this.m_renderThread)); + this.m_renderThread = IntPtr.Zero; + } + finally + { + base.Dispose(inDispose); + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalConnectionInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalConnectionInfo.cs new file mode 100644 index 0000000..ff85c8b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/LocalConnectionInfo.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.LocalConnectionInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal sealed class LocalConnectionInfo : ConnectionInfo + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MarshalHelper.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MarshalHelper.cs new file mode 100644 index 0000000..96296d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MarshalHelper.cs @@ -0,0 +1,176 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MarshalHelper +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class MarshalHelper + { + private static RENDERHANDLE[] s_EmptyRenderHandleArray = new RENDERHANDLE[0]; + + public static unsafe void Decode( + RenderPort port, + Message* pmsg, + BLOBREF refParam, + out string param) + { + uint uint32 = BLOBREF.ToUInt32(refParam); + uint num1 = uint32 & ushort.MaxValue; + uint num2 = (uint32 & 4294901760U) >> 16; + byte* numPtr = (byte*)((int)pmsg + (int)num1); + int length = (int)num2 - 2; + byte[] numArray = new byte[length]; + Marshal.Copy(new IntPtr(numPtr), numArray, 0, length); + Encoding encoding = Encoding.Unicode; + if (port.AlwaysBigEndian) + encoding = Encoding.BigEndianUnicode; + param = encoding.GetString(numArray); + } + + public static unsafe void Decode( + RenderPort port, + Message* pmsgOuter, + BLOBREF refMsgInner, + out Message* pmsgInner) + { + byte* numPtr = (byte*)pmsgOuter; + uint num = ushort.MaxValue & BLOBREF.ToUInt32(refMsgInner); + pmsgInner = (Message*)(numPtr + (int)num); + } + + private static ushort[] ComputeByteOrderMap(Type targetType, bool fCompact) + { + ushort[] fieldMap = new ushort[10]; + ComputeByteOrderMapWorker(ref fieldMap, targetType, 0); + if (fCompact) + { + int length = fieldMap[0] + 1; + if (fieldMap.Length > length) + { + ushort[] numArray = new ushort[length]; + Array.Copy(fieldMap, numArray, length); + fieldMap = numArray; + } + } + return fieldMap; + } + + public static unsafe void SwapByteOrder( + byte* pMem, + ref ushort[] fieldMapByRef, + Type type, + int startOffset, + int stopOffset) + { + if (fieldMapByRef == null) + fieldMapByRef = ComputeByteOrderMap(type, true); + ushort[] numArray = fieldMapByRef; + if (stopOffset <= 0) + stopOffset = int.MaxValue; + int num1 = numArray[0] + 1; + for (int index1 = 1; index1 < num1; ++index1) + { + ushort num2 = numArray[index1]; + int num3 = num2 >> 2; + if (num3 >= startOffset) + { + if (num3 >= stopOffset) + break; + int num4 = 1 << (num2 & 3); + byte* numPtr = pMem + num3; + int num5 = num4 / 2; + for (int index2 = 0; index2 < num5; ++index2) + { + int index3 = num4 - (index2 + 1); + byte num6 = numPtr[index2]; + numPtr[index2] = numPtr[index3]; + numPtr[index3] = num6; + } + } + } + } + + public static object MakeDumpable(string value) => value; + + public static object MakeDumpable(object value) => value; + + public static unsafe object MakeDumpable(void* value) => new IntPtr(value); + + private static void ComputeByteOrderMapWorker( + ref ushort[] fieldMap, + Type targetType, + int parentOffset) + { + if (targetType.IsPrimitive) + return; + int packingForType = GetPackingForType(targetType); + int num1 = 0; + foreach (FieldInfo field in targetType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) + { + Type type = field.FieldType; + if (type.IsEnum) + type = Enum.GetUnderlyingType(type); + int size = Marshal.SizeOf(type); + int num2 = size; + if (type.IsPrimitive) + { + if (num2 > packingForType) + num2 = packingForType; + } + else if (num2 > 4) + num2 = 4; + int num3 = num2 - 1; + int num4 = num1 + num3 & ~num3; + int num5 = num4 + parentOffset; + if (type.IsPrimitive) + AddByteOrderEntry(ref fieldMap, num5, size); + else + ComputeByteOrderMapWorker(ref fieldMap, type, num5); + num1 = num4 + size; + } + } + + private static int GetPackingForType(Type t) => 8; + + private static void AddByteOrderEntry(ref ushort[] fieldMap, int offset, int size) + { + ushort num; + switch (size) + { + case 1: + return; + case 2: + num = 1; + break; + case 3: + return; + case 4: + num = 2; + break; + case 8: + num = 3; + break; + default: + return; + } + int index = fieldMap[0] + 1; + if (index >= fieldMap.Length) + { + ushort[] numArray = new ushort[2 * fieldMap.Length]; + Array.Copy(fieldMap, numArray, fieldMap.Length); + fieldMap = numArray; + } + fieldMap[0] = (ushort)index; + fieldMap[index] = (ushort)((uint)(offset << 2) | num); + } + + public static RENDERHANDLE[] CreateRenderHandleArray(int length) => length == 0 ? s_EmptyRenderHandleArray : new RENDERHANDLE[length]; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Memory.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Memory.cs new file mode 100644 index 0000000..31686ae --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Memory.cs @@ -0,0 +1,99 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.Memory +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal static class Memory + { + public static unsafe bool IsOverlap(IntPtr pvA, int cbA, IntPtr pvB, int cbB) + { + byte* pointer1 = (byte*)pvA.ToPointer(); + byte* pointer2 = (byte*)pvB.ToPointer(); + if (pointer1 >= pointer2 && pointer1 < pointer2 + cbB) + return true; + return pointer2 >= pointer1 && pointer2 < pointer1 + cbA; + } + + public static unsafe void Zero(IntPtr pvDest, int cbZero) + { + uint* pointer = (uint*)pvDest.ToPointer(); + int num1 = cbZero / 4; + int num2 = num1; + while (num2-- > 0) + *pointer++ = 0U; + byte* numPtr = (byte*)pointer; + int num3 = cbZero - num1 * 4; + while (num3-- > 0) + *numPtr++ = 0; + } + + public static unsafe void Copy(IntPtr pvDest, IntPtr pvSrc, int cbCopy) + { + uint* pointer1 = (uint*)pvDest.ToPointer(); + uint* pointer2 = (uint*)pvSrc.ToPointer(); + int num1 = cbCopy / 4; + int num2 = num1; + while (num2-- > 0) + *pointer1++ = *pointer2++; + byte* numPtr1 = (byte*)pointer1; + byte* numPtr2 = (byte*)pointer2; + int num3 = cbCopy - num1 * 4; + while (num3-- > 0) + *numPtr1++ = *numPtr2++; + } + + public static unsafe void ConvertEndian( + IntPtr pvDest, + IntPtr pvSrc, + int cbConvert, + int cUnitBits) + { + switch (cUnitBits) + { + case 8: + break; + case 16: + uint* pointer1 = (uint*)pvDest.ToPointer(); + uint* pointer2 = (uint*)pvSrc.ToPointer(); + int num1 = cbConvert / 4; + while (num1-- > 0) + { + uint num2 = *pointer2++; + *pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & byte.MaxValue) << 8); + } + if (cbConvert % 4 == 0) + break; + ushort* numPtr1 = (ushort*)pointer1; + ushort* numPtr2 = (ushort*)pointer1; + ushort* numPtr3 = (ushort*)(numPtr2 + 2); + ushort num3 = *numPtr2; + ushort* numPtr4 = numPtr1; + ushort* numPtr5 = (ushort*)(numPtr4 + 2); + int num4 = (ushort)((num3 & 65280) >> 8 | (num3 & byte.MaxValue) << 8); + *numPtr4 = (ushort)num4; + break; + case 32: + uint* pointer3 = (uint*)pvDest.ToPointer(); + uint* pointer4 = (uint*)pvSrc.ToPointer(); + int num5 = cbConvert / 4; + while (num5-- > 0) + { + uint num2 = *pointer4++; + *pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & byte.MaxValue) << 24); + } + break; + default: + Debug2.Throw(false, "Unsupported data format"); + break; + } + } + + public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & byte.MaxValue) << 24); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Message.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Message.cs new file mode 100644 index 0000000..0e64fe6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/Message.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.Message +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + internal struct Message + { + public uint cbSize; + public uint nMsg; + public RENDERHANDLE idObjectSubject; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchEntry.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchEntry.cs new file mode 100644 index 0000000..65c95c4 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchEntry.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MessageBatchEntry +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + internal struct MessageBatchEntry + { + public uint uOffsetNextEntry; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchHeader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchHeader.cs new file mode 100644 index 0000000..df79f18 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageBatchHeader.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MessageBatchHeader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + internal struct MessageBatchHeader + { + public RENDERHANDLE idPredicateBuffer; + public uint uOffsetFirstEntry; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageCookieLayout.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageCookieLayout.cs new file mode 100644 index 0000000..2024967 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageCookieLayout.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MessageCookieLayout +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal struct MessageCookieLayout + { + public short numberOfGroupBits; + public short numberOfObjectBits; + + public static MessageCookieLayout Default => new MessageCookieLayout() + { + numberOfGroupBits = 4, + numberOfObjectBits = 20 + }; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageHeap.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageHeap.cs new file mode 100644 index 0000000..aa06923 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessageHeap.cs @@ -0,0 +1,254 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MessageHeap +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class MessageHeap : RenderObject + { + private MessageHeap.BlockInfo headBlock; + private MessageHeap.BlockInfo tailBlock; + private uint nextBlockId; + private uint smallBlockSize; + private uint blockHeaderSize; + private uint allocExtraSize; + private uint key; + + public MessageHeap(uint blockSize, uint headerSize, uint allocationExtra) + { + Debug2.Validate(blockSize > headerSize, typeof(ArgumentException), "Blocks must be larger than their headers"); + this.smallBlockSize = blockSize; + this.blockHeaderSize = headerSize; + this.allocExtraSize = allocationExtra; + this.nextBlockId = 1U; + this.CreateBlock(BlockType.First, this.smallBlockSize); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (this.IsDisposed) + return; + this.ReleaseAll(true); + } + finally + { + base.Dispose(inDispose); + } + } + + internal bool IsDisposed => this.headBlock == null; + + public unsafe void* Alloc(uint size) + { + size += this.allocExtraSize; + uint num = (uint)(sizeof(void*) - 1); + size = (uint)((int)size + (int)num & ~(int)num); + MessageHeap.BlockInfo block = this.tailBlock; + if (size > block.size - block.used) + { + MessageHeap.BlockType type = BlockType.Normal; + uint actualSize = this.smallBlockSize; + if (size > this.smallBlockSize - this.blockHeaderSize) + { + type = BlockType.Large; + actualSize = this.blockHeaderSize + size; + } + block = this.CreateBlock(type, actualSize); + } + this.ZeroMemoryBlock(block, block.used, this.allocExtraSize); + void* voidPtr = (void*)((int)block.data + ((int)block.used + (int)this.allocExtraSize)); + block.used += size; + ++this.key; + return voidPtr; + } + + public unsafe MessageHeap.Block LookupBlock(void* p) + { + MessageHeap.BlockInfo blockInfo = this.LookupBlockWorker(p); + return new MessageHeap.Block(blockInfo.id, blockInfo.data, blockInfo.used); + } + + public void Reset() => this.ReleaseAll(false); + + public int BlockCount + { + get + { + int num = 0; + MessageHeap.BlockInfo blockInfo = this.headBlock; + while (blockInfo != null) + { + blockInfo = blockInfo.next; + ++num; + } + return num; + } + } + + public MessageHeap.Enumerator GetEnumerator() => new MessageHeap.Enumerator(this); + + private unsafe MessageHeap.BlockInfo CreateBlock( + MessageHeap.BlockType type, + uint actualSize) + { + ++this.key; + MessageHeap.BlockInfo block = new MessageHeap.BlockInfo(); + block.data = Marshal.AllocCoTaskMem((int)actualSize).ToPointer(); + block.id = this.nextBlockId++; + block.type = type; + block.size = actualSize; + switch (type) + { + case BlockType.First: + block.next = null; + this.headBlock = block; + this.tailBlock = block; + break; + case BlockType.Normal: + case BlockType.Large: + block.next = this.tailBlock.next; + this.tailBlock.next = block; + this.tailBlock = block; + break; + } + block.used = this.blockHeaderSize; + this.ZeroMemoryBlock(block, 0U, this.blockHeaderSize); + return block; + } + + private unsafe void DestroyBlock(MessageHeap.BlockInfo block) + { + Marshal.FreeCoTaskMem(new IntPtr(block.data)); + block.data = null; + } + + private void ReleaseAll(bool finalRelease) + { + ++this.key; + MessageHeap.BlockInfo block; + if (finalRelease) + { + block = this.headBlock; + this.headBlock = null; + this.tailBlock = null; + } + else + { + this.ZeroMemoryBlock(this.headBlock, 0U, this.blockHeaderSize); + block = this.headBlock.next; + this.headBlock.next = null; + this.headBlock.used = this.blockHeaderSize; + this.tailBlock = this.headBlock; + this.nextBlockId = 2U; + } + MessageHeap.BlockInfo next; + for (; block != null; block = next) + { + next = block.next; + switch (block.type) + { + case BlockType.First: + case BlockType.Normal: + case BlockType.Large: + this.DestroyBlock(block); + break; + } + } + } + + private unsafe MessageHeap.BlockInfo LookupBlockWorker(void* p) + { + for (MessageHeap.BlockInfo blockInfo = this.headBlock; blockInfo != null; blockInfo = blockInfo.next) + { + if (p >= blockInfo.data) + { + void* voidPtr = (void*)((int)blockInfo.data + (int)blockInfo.used); + if (p < voidPtr) + return blockInfo; + } + } + throw new ArgumentException("pointer is not on this heap"); + } + + private unsafe void ZeroMemoryBlock(MessageHeap.BlockInfo block, uint offset, uint size) + { + Debug2.Validate(offset + size <= block.size, typeof(ArgumentOutOfRangeException), "Invalid memory range for block"); + byte* numPtr1 = (byte*)((int)block.data + (int)offset); + for (byte* numPtr2 = numPtr1 + (int)size; numPtr1 < numPtr2; ++numPtr1) + *numPtr1 = 0; + } + + protected override void Invariant() => Debug2.Validate(!this.IsDisposed, typeof(InvalidOperationException), "MessageHeap has already been disposed"); + + internal struct Enumerator + { + private MessageHeap heap; + private MessageHeap.BlockInfo current; + private uint key; + + public Enumerator(MessageHeap heap) + { + this.heap = heap; + this.current = null; + this.key = heap.key; + } + + public bool MoveNext() + { + if ((int)this.key != (int)this.heap.key) + throw new InvalidOperationException("heap modified while enumerator is in use"); + this.current = this.current != null ? this.current.next : this.heap.headBlock; + return this.current != null; + } + + public unsafe MessageHeap.Block Current + { + get + { + if ((int)this.key != (int)this.heap.key) + throw new InvalidOperationException("heap modified while enumerator in use"); + return new MessageHeap.Block(this.current.id, this.current.data, this.current.used); + } + } + } + + internal struct Block + { + public uint id; + public unsafe void* data; + public uint size; + + public unsafe Block(uint id, void* data, uint size) + { + this.id = id; + this.data = data; + this.size = size; + } + } + + private enum BlockType + { + First, + Normal, + Large, + } + + private class BlockInfo + { + public MessageHeap.BlockInfo next; + public MessageHeap.BlockType type; + public uint id; + public unsafe void* data; + public uint size; + public uint used; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessagingSession.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessagingSession.cs new file mode 100644 index 0000000..222032c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/MessagingSession.cs @@ -0,0 +1,411 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.MessagingSession +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using System; +using System.Threading; + +namespace Microsoft.Iris.Render.Protocol +{ + internal sealed class MessagingSession : RenderObject + { + private static Map s_sessions = new Map(); + private readonly ContextID m_localContextId; + private bool m_isConnected; + private int m_pingRequestCount; + private IRenderHost m_renderHost; + private Thread m_owningThread; + private Vector m_ports; + private Vector m_activeTrackers; + private RenderPort m_portRendering; + private RenderPort m_portWindowing; + private bool m_isBatchingMessages; + private BatchCallback m_batchFillCallback; + private BatchCallback m_batchBeginCallbacks; + private BatchCallback m_batchEndCallbacks; + private BatchCallback m_batchDeliveryCallbacks; + private bool m_fBatchFlushRequested; + private DeferredInvokeItem m_batchFlushInvokeItem; + private EngineApi.MessageBufferEventHandler m_messageBufferHandler; + private TimeoutHandler m_externalTimeoutHandler; + private EngineApi.TimeoutEventHandler m_internalTimeoutHandler; + + internal MessagingSession(IRenderHost renderHost, RenderToken token) + : this(renderHost, token, null, 0U) + { + } + + internal unsafe MessagingSession( + IRenderHost renderHost, + RenderToken token, + TimeoutHandler handlerTimeout, + uint nTimeoutSec) + { + Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); + Debug2.Validate(token != null, typeof(ArgumentNullException), nameof(token)); + Debug2.Validate(token.LocalContextId != ContextID.NULL, typeof(ArgumentNullException), "token.LocalContextId"); + Debug2.Validate(token.EngineInfo is IrisEngineInfo, typeof(ArgumentException), "token.EngineInfo"); + this.m_pingRequestCount = 0; + this.m_renderHost = renderHost; + this.m_ports = new Vector(2); + this.m_localContextId = token.LocalContextId; + this.m_batchFlushInvokeItem = new DeferredInvokeItem(null, new DeferredHandler(this.ProcessDeferredFlushBatch), null); + this.m_batchFillCallback = new BatchCallback(this.OnBatchFirstMessage); + this.InitializeLocalMessaging(this.m_localContextId, new EngineApi.MessageBufferEventHandler(this.OnIncomingMessageBuffer), nTimeoutSec, handlerTimeout); + this.m_portRendering = this.CreatePort((token.EngineInfo as IrisEngineInfo).ConnectionInfo, token.DestinationContextId, token.RenderGroupId); + this.m_portWindowing = null; + this.m_activeTrackers = new Vector(); + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (fInDispose) + { + if (this.IsConnected) + this.Disconnect(); + this.DisposeRemainingDataBufferTrackers(); + foreach (RenderPort port in this.m_ports) + port.Dispose(); + this.m_ports.Clear(); + this.ShutdownLocalMessaging(); + } + this.m_activeTrackers = null; + this.m_portWindowing = null; + this.m_portRendering = null; + this.m_ports = null; + this.m_renderHost = null; + } + finally + { + base.Dispose(fInDispose); + } + } + + internal static MessagingSession Current + { + get + { + lock (s_sessions) + return s_sessions.ContainsKey(Thread.CurrentThread) ? s_sessions[Thread.CurrentThread] : null; + } + } + + internal Thread OwningThread => this.m_owningThread; + + internal bool IsConnected => this.m_isConnected; + + internal ContextID LocalContext => this.m_localContextId; + + internal RenderPort RenderingPort => this.m_portRendering; + + internal RenderPort WindowingPort => this.m_portWindowing == null ? this.m_portRendering : this.m_portWindowing; + + private void InitializeLocalMessaging( + ContextID localContextId, + EngineApi.MessageBufferEventHandler messageHandler, + uint timeoutInSeconds, + TimeoutHandler timeoutHandler) + { + this.m_messageBufferHandler = messageHandler; + this.m_externalTimeoutHandler = timeoutHandler; + this.m_internalTimeoutHandler = new EngineApi.TimeoutEventHandler(this.OnTimedOut); + EngineApi.InitArgs args = new EngineApi.InitArgs(MessageCookieLayout.Default, localContextId, messageHandler); + if (timeoutInSeconds > 0U && timeoutHandler != null) + { + args.pfnTimeout = this.m_internalTimeoutHandler; + args.nTimeOutSec = timeoutInSeconds; + } + EngineApi.IFC(EngineApi.SpInit(ref args)); + lock (s_sessions) + { + this.m_owningThread = Thread.CurrentThread; + s_sessions[this.m_owningThread] = this; + } + } + + private void ShutdownLocalMessaging() + { + lock (s_sessions) + { + s_sessions.Remove(this.m_owningThread); + this.m_owningThread = null; + } + EngineApi.IFC(EngineApi.SpUninit()); + this.m_messageBufferHandler = null; + this.m_externalTimeoutHandler = null; + this.m_internalTimeoutHandler = null; + } + + internal static void DoEvents(uint nTimeoutInMsecs) + { + EngineApi.SpWaitMessage(nTimeoutInMsecs, IntPtr.Zero); + EngineApi.SpPeekMessage(out Win32Api.MSG _, HWND.NULL, 0U, 0U, 1U, out EngineApi.WorkResult _); + } + + private RenderPort CreatePort( + ConnectionInfo connectionInfo, + ContextID destinationContextId, + RENDERGROUP grpObjects) + { + foreach (RenderPort port in this.m_ports) + Debug2.Validate(port.RemoteContext != destinationContextId, typeof(ArgumentException), "There already is a RenderPort allocated for this destination context"); + bool foreignByteOrder = false; + IChannel channel; + switch (connectionInfo) + { + case LocalConnectionInfo _: + channel = new LocalChannel((LocalConnectionInfo)connectionInfo); + break; + case RemoteConnectionInfo _: + RemoteConnectionInfo connectionInfo1 = (RemoteConnectionInfo)connectionInfo; + channel = new RemoteChannel(connectionInfo1); + foreignByteOrder = connectionInfo1.SwapByteOrder; + break; + default: + return null; + } + RenderPort renderPort = new RenderPort(this, channel, destinationContextId, grpObjects, MessageCookieLayout.Default, foreignByteOrder); + if (this.m_isConnected) + renderPort.Connect(); + this.m_ports.Add(renderPort); + return renderPort; + } + + internal DataBufferTracker CreateDataBufferTracker(object objUser) => new DataBufferTracker(objUser); + + internal void ReturnDataBufferTracker(DataBufferTracker tracker) + { + if (tracker.Count != 0) + { + tracker.TrackerEmpty += new EventHandler(this.OnDataBufferTrackerEmpty); + this.m_activeTrackers.Add(tracker); + } + else + tracker.Dispose(); + } + + private void OnDataBufferTrackerEmpty(object objSender, EventArgs args) + { + DataBufferTracker dataBufferTracker = (DataBufferTracker)objSender; + this.m_activeTrackers.Remove(dataBufferTracker); + dataBufferTracker.TrackerEmpty -= new EventHandler(this.OnDataBufferTrackerEmpty); + dataBufferTracker.Dispose(); + } + + private void DisposeRemainingDataBufferTrackers() + { + if (this.m_activeTrackers.Count <= 0) + return; + foreach (DataBufferTracker activeTracker in this.m_activeTrackers) + activeTracker.Dispose(); + this.m_activeTrackers.Clear(); + } + + internal void Connect() + { + Debug2.Throw(!this.m_isConnected, "MessagingSession is already connected"); + foreach (RenderPort port in this.m_ports) + port.Connect(); + this.Synchronize(); + this.StartNewBatch(); + this.m_isConnected = true; + } + + internal void Disconnect() + { + Debug2.Throw(this.m_isConnected, "MessagingSession is not connected"); + this.FlushCurrentBatch(true); + this.Synchronize(); + foreach (RenderPort port in this.m_ports) + port.DisposeObjectMaps(); + foreach (RenderPort port in this.m_ports) + port.Dispose(); + this.m_ports.Clear(); + this.m_isConnected = false; + } + + internal void Synchronize() + { + foreach (RenderPort port in this.m_ports) + { + port.PingReply += new EventHandler(this.OnPingReply); + ++this.m_pingRequestCount; + port.PingConnection(); + } + if (this.m_isBatchingMessages) + this.FlushBatch(); + while (this.m_pingRequestCount > 0) + DoEvents(uint.MaxValue); + } + + private void OnPingReply(object sender, EventArgs args) + { + (sender as RenderPort).PingReply -= new EventHandler(this.OnPingReply); + --this.m_pingRequestCount; + } + + private void StartNewBatch() + { + if (this.m_isBatchingMessages || this.m_ports.Count <= 0) + return; + foreach (RenderPort port in this.m_ports) + port.BeginMessageBatch(this.m_batchFillCallback); + this.m_isBatchingMessages = true; + if (this.m_batchBeginCallbacks == null) + return; + this.m_batchBeginCallbacks(); + this.m_batchBeginCallbacks = null; + } + + internal void FlushBatch() => this.FlushCurrentBatch(false); + + private void FlushCurrentBatch(bool stopBatching) + { + if (!this.m_isBatchingMessages) + return; + if (this.m_batchEndCallbacks != null) + { + this.m_batchEndCallbacks(); + this.m_batchEndCallbacks = null; + } + this.m_isBatchingMessages = false; + BatchCallback deliveryCallbacks = this.m_batchDeliveryCallbacks; + this.m_batchDeliveryCallbacks = null; + foreach (RenderPort port in this.m_ports) + port.EndMessageBatch(deliveryCallbacks); + if (stopBatching) + return; + this.StartNewBatch(); + } + + internal void ScheduleBatchFlush() + { + if (this.m_fBatchFlushRequested) + return; + this.AssertOwningThread(); + this.DeferredInvoke(this.m_batchFlushInvokeItem, DeferredInvokePriority.Low); + this.m_fBatchFlushRequested = true; + } + + internal void ProcessDeferredFlushBatch(object args) + { + this.AssertOwningThread(); + if (!this.m_fBatchFlushRequested) + return; + this.FlushBatch(); + this.m_fBatchFlushRequested = false; + } + + public void NotifyOnBeginBatch(BatchCallback newCallback) + { + if (!this.m_isBatchingMessages) + return; + this.m_batchBeginCallbacks += newCallback; + } + + public void NotifyOnEndBatch(BatchCallback newCallback, bool notifyEmptyBatches) + { + if (!this.m_isBatchingMessages) + return; + if (notifyEmptyBatches) + this.ScheduleBatchFlush(); + this.m_batchEndCallbacks += newCallback; + } + + public void NotifyOnCurrentBatchDelivered(BatchCallback newCallback) + { + if (!this.m_isBatchingMessages) + return; + this.m_batchDeliveryCallbacks += newCallback; + } + + private void OnBatchFirstMessage() => this.ScheduleBatchFlush(); + + private unsafe int OnIncomingMessageBuffer( + IntPtr pData, + uint hContext, + EngineApi.BufferInfo* pBufferInfo, + void* pvBufferData) + { + RenderPort renderPort = null; + for (int index = 0; index < this.m_ports.Count; ++index) + { + RenderPort port = (RenderPort)this.m_ports[index]; + if (port.RemoteContext == pBufferInfo->idContextSrc) + { + renderPort = port; + break; + } + } + Debug2.Throw(renderPort != null, "Expected a render port if we are receiving buffers"); + renderPort.ProcessMessageBuffer(pBufferInfo, pvBufferData); + return 0; + } + + private void OnTimedOut(IntPtr pData) + { + if (this.m_externalTimeoutHandler == null) + return; + this.m_externalTimeoutHandler(); + } + + internal void AssertOwningThread() + { + } + + internal bool IsOwningThread() => this.m_owningThread == Thread.CurrentThread; + + internal void DeferredInvoke(Delegate method, object args, DeferredInvokePriority priority) => this.DeferredInvoke(method, args, priority, TimeSpan.FromMilliseconds(0.0)); + + internal void DeferredInvoke( + SharedRenderObject owner, + Delegate method, + object args, + DeferredInvokePriority priority) + { + this.DeferredInvoke(owner, method, args, priority, TimeSpan.FromMilliseconds(0.0)); + } + + internal void DeferredInvoke( + Delegate method, + object args, + DeferredInvokePriority priority, + TimeSpan delay) + { + this.DeferredInvoke(null, method, args, priority, delay); + } + + internal void DeferredInvoke( + SharedRenderObject instanceOwner, + Delegate method, + object args, + DeferredInvokePriority priority, + TimeSpan delay) + { + if (this.m_owningThread == null) + return; + DeferredInvokeItem deferredInvokeItem = new DeferredInvokeItem(instanceOwner, method, args); + this.m_renderHost.DeferredInvoke(priority, deferredInvokeItem, delay); + } + + private void DeferredInvoke(DeferredInvokeItem item, DeferredInvokePriority priority) + { + if (this.m_owningThread == null) + return; + this.m_renderHost.DeferredInvoke(priority, item, TimeSpan.FromMilliseconds(0.0)); + } + + protected override void Invariant() + { + Debug2.Validate(this.m_owningThread != null, typeof(InvalidOperationException), this.GetType().ToString()); + Debug2.Validate(this.m_renderHost != null, typeof(InvalidOperationException), this.GetType().ToString()); + Debug2.Validate(this.m_isConnected, typeof(InvalidOperationException), this.GetType().ToString()); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ObjectCache.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ObjectCache.cs new file mode 100644 index 0000000..e2f20c9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ObjectCache.cs @@ -0,0 +1,80 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.ObjectCache +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class ObjectCache + { + private ObjectCache.Callback m_callback; + private object[] m_arFreeObjs; + private int m_idxFree; + + public ObjectCache(ObjectCache.Callback callback, int cFreeItems, bool fPrePopulate) + { + Debug2.Validate(callback != null, typeof(ArgumentNullException), "calback"); + Debug2.Validate(cFreeItems > 0, typeof(ArgumentException), "Free list must have at least one entry", nameof(cFreeItems)); + this.m_callback = callback; + this.m_arFreeObjs = new object[cFreeItems]; + this.m_idxFree = -1; + if (!fPrePopulate) + return; + for (int index = 0; index < cFreeItems; ++index) + this.Push(this.DoCallback(Operation.Alloc, null)); + } + + public void Dispose() + { + object[] arFreeObjs = this.m_arFreeObjs; + if (arFreeObjs == null) + return; + int idxFree = this.m_idxFree; + this.m_idxFree = -1; + this.m_arFreeObjs = null; + for (; idxFree >= 0; --idxFree) + this.DoCallback(Operation.Free, arFreeObjs[idxFree]); + } + + public object Pop() + { + ObjectCache.Operation operation = Operation.Alloc; + object data = null; + if (this.m_idxFree >= 0) + { + operation = Operation.Thaw; + data = this.m_arFreeObjs[this.m_idxFree--]; + } + return this.DoCallback(operation, data); + } + + public void Push(object data) + { + if (this.m_idxFree + 1 >= this.m_arFreeObjs.Length) + { + this.DoCallback(Operation.Free, data); + } + else + { + data = this.DoCallback(Operation.Freeze, data); + this.m_arFreeObjs[++this.m_idxFree] = data; + } + } + + private object DoCallback(ObjectCache.Operation operation, object data) => this.m_callback(operation, data); + + public enum Operation + { + Alloc, + Free, + Thaw, + Freeze, + } + + public delegate object Callback(ObjectCache.Operation operation, object data); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/PortCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/PortCallback.cs new file mode 100644 index 0000000..b0bea32 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/PortCallback.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.PortCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal unsafe delegate void PortCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ProtocolInstance.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ProtocolInstance.cs new file mode 100644 index 0000000..a61e0a0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ProtocolInstance.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.ProtocolInstance +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal abstract class ProtocolInstance + { + private RenderPort m_port; + private string m_name; + + protected ProtocolInstance(RenderPort port, string name) + { + this.m_port = port; + this.m_name = name; + } + + public RenderPort Port => this.m_port; + + public string Name => this.m_name; + + internal void OnConnect() => this.Init(); + + protected abstract void Init(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERGROUP.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERGROUP.cs new file mode 100644 index 0000000..a54268a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERGROUP.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RENDERGROUP +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + [Serializable] + internal struct RENDERGROUP + { + public static readonly RENDERGROUP NULL = new RENDERGROUP(); + private uint value; + + private RENDERGROUP(uint value) => this.value = value; + + public static bool operator ==(RENDERGROUP hl, RENDERGROUP hr) => (int)hl.value == (int)hr.value; + + public static bool operator !=(RENDERGROUP hl, RENDERGROUP hr) => (int)hl.value != (int)hr.value; + + public override bool Equals(object oCompare) => oCompare is RENDERGROUP rendergroup && (int)this.value == (int)rendergroup.value; + + public override int GetHashCode() => (int)this.value; + + public static RENDERGROUP FromUInt32(uint value) => new RENDERGROUP(value); + + public static uint ToUInt32(RENDERGROUP handle) => handle.value; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERHANDLE.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERHANDLE.cs new file mode 100644 index 0000000..c941c7b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RENDERHANDLE.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RENDERHANDLE +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocol +{ + [ComVisible(false)] + [Serializable] + internal struct RENDERHANDLE + { + public static readonly RENDERHANDLE NULL = new RENDERHANDLE(); + private uint value; + + private RENDERHANDLE(uint value) => this.value = value; + + public static bool operator ==(RENDERHANDLE hl, RENDERHANDLE hr) => (int)hl.value == (int)hr.value; + + public static bool operator !=(RENDERHANDLE hl, RENDERHANDLE hr) => (int)hl.value != (int)hr.value; + + public override bool Equals(object oCompare) => oCompare is RENDERHANDLE renderhandle && (int)this.value == (int)renderhandle.value; + + public override int GetHashCode() => (int)this.value; + + public static RENDERHANDLE FromUInt32(uint value) => new RENDERHANDLE(value); + + public static uint ToUInt32(RENDERHANDLE handle) => handle.value; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RelayConnectionInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RelayConnectionInfo.cs new file mode 100644 index 0000000..71b4538 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RelayConnectionInfo.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RelayConnectionInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal sealed class RelayConnectionInfo : RemoteConnectionInfoBase + { + private string m_serverName; + + public RelayConnectionInfo(RemoteConnectionInfo serverInfo, string serverName) + : base(serverInfo.TransportProtocol, serverInfo.SessionName, serverInfo.SwapByteOrder) + { + Debug2.Validate(serverName != null, typeof(ArgumentNullException), nameof(serverName)); + this.m_serverName = serverName; + } + + public string Server => this.m_serverName; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteChannel.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteChannel.cs new file mode 100644 index 0000000..9e4f15b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteChannel.cs @@ -0,0 +1,58 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RemoteChannel +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class RemoteChannel : RenderObject, IChannel + { + private string m_sessionName; + private TransportProtocol m_protocol; + private IntPtr m_pSendStream; + private IntPtr m_pReceiveStream; + private IntPtr m_pSession; + + public RemoteChannel(RemoteConnectionInfo connectionInfo) + { + this.m_sessionName = connectionInfo.SessionName; + this.m_protocol = connectionInfo.TransportProtocol; + EngineApi.IFC(EngineApi.SpRemoteCreateServerStreams(this.m_sessionName, this.m_protocol, out this.m_pSendStream, out this.m_pReceiveStream)); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (!(this.m_pSession != IntPtr.Zero)) + return; + EngineApi.IFC(EngineApi.SpRemoteServerUninit(this.m_pSession, true, out ShutdownReason _)); + this.m_pSession = IntPtr.Zero; + } + finally + { + base.Dispose(inDispose); + } + } + + public bool IsConnected => this.m_pSession != IntPtr.Zero; + + public void Connect( + ContextID idRemoteContext, + RENDERHANDLE hBrokerClass, + MessageCookieLayout layout) + { + EngineApi.IFC(EngineApi.SpRemoteWaitServerStreamsConnected(this.m_protocol, this.m_pSendStream, this.m_pReceiveStream)); + EngineApi.IFC(EngineApi.SpRemoteServerInit(this.m_pSendStream, this.m_pReceiveStream, new EngineApi.InitArgs(layout, idRemoteContext) + { + idObjectBrokerClass = hBrokerClass + }, out this.m_pSession)); + EngineApi.SpObjectRelease(this.m_pSendStream); + EngineApi.SpObjectRelease(this.m_pReceiveStream); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfo.cs new file mode 100644 index 0000000..0a21603 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfo.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RemoteConnectionInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal sealed class RemoteConnectionInfo : RemoteConnectionInfoBase + { + public RemoteConnectionInfo(TransportProtocol protocol, string sessionName, bool swapByteOrder) + : base(protocol, sessionName, swapByteOrder) + { + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfoBase.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfoBase.cs new file mode 100644 index 0000000..01895c8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteConnectionInfoBase.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RemoteConnectionInfoBase +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal abstract class RemoteConnectionInfoBase : ConnectionInfo + { + private string m_sessionName; + private TransportProtocol m_protocol; + private bool m_swapByteOrder; + + public RemoteConnectionInfoBase( + TransportProtocol protocol, + string sessionName, + bool swapByteOrder) + { + Debug2.Validate(protocol >= TransportProtocol.Min && protocol <= TransportProtocol.PIPE, typeof(ArgumentException), nameof(protocol)); + Debug2.Validate(sessionName != null, typeof(ArgumentNullException), nameof(sessionName)); + this.m_protocol = protocol; + this.m_sessionName = sessionName; + this.m_swapByteOrder = swapByteOrder; + } + + public string SessionName => this.m_sessionName; + + public TransportProtocol TransportProtocol => this.m_protocol; + + public bool SwapByteOrder => this.m_swapByteOrder; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteObject.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteObject.cs new file mode 100644 index 0000000..cfebfce --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RemoteObject.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RemoteObject +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + internal abstract class RemoteObject : RenderObject + { + private bool m_fFreeOnDispose; + protected RenderPort m_renderPort; + internal RENDERHANDLE m_renderHandle; + + public RemoteObject(RenderPort port, IRenderHandleOwner owner) + { + RENDERHANDLE handle = port.AllocHandle(owner); + this.Init(port, handle, true); + } + + public RemoteObject(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) => this.Init(port, handle, fFreeOnDispose); + + private void Init(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + { + this.m_renderPort = port; + this.m_renderHandle = handle; + this.m_fFreeOnDispose = fFreeOnDispose; + if (this.m_fFreeOnDispose) + return; + GC.SuppressFinalize(this); + } + + protected RemoteObject() + { + } + + protected override void Dispose(bool fInDispose) + { + try + { + if (!fInDispose) + return; + this.SafeDelete(); + } + finally + { + base.Dispose(fInDispose); + } + } + + public bool IsValid => this.m_renderHandle != RENDERHANDLE.NULL; + + public RenderPort Port => this.m_renderPort; + + public RENDERHANDLE RenderHandle => this.m_renderHandle; + + public override bool Equals(object other) => other is RemoteObject && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => this.m_renderHandle.GetHashCode(); + + private void SafeDelete() + { + if (this.IsValid && this.m_fFreeOnDispose && this.m_renderPort != null) + this.m_renderPort.FreeHandle(this.m_renderHandle); + this.m_renderHandle = RENDERHANDLE.NULL; + this.m_renderPort = null; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderException.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderException.cs new file mode 100644 index 0000000..b84aa6f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderException.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RenderException +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render.Protocol +{ + [Serializable] + internal class RenderException : InvalidOperationException + { + private const int ErrorPrefix = -2147221504; + private RenderException.ErrorCode m_code; + + public RenderException() + { + } + + public RenderException(string stReason) + : base(stReason) + { + } + + public RenderException(string stReason, Exception innerException) + : base(stReason, innerException) + { + } + + public RenderException(RenderException.ErrorCode code) => this.m_code = code; + + public RenderException(RenderException.ErrorCode code, string stReason) + : base(stReason) + => this.m_code = code; + + public RenderException.ErrorCode Error => this.m_code; + + public enum ErrorCode + { + OutOfKernelResources = -2147221503, // 0x80040001 + OutOfGdiResources = -2147221502, // 0x80040002 + Generic = -2147221494, // 0x8004000A + Busy = -2147221493, // 0x8004000B + Unusable = -2147221492, // 0x8004000C + NoContext = -2147221484, // 0x80040014 + InvalidContext = -2147221474, // 0x8004001E + ReadOnlyContext = -2147221473, // 0x8004001F + ThreadingAlreadySet = -2147221472, // 0x80040020 + CannotUseStandardMessaging = -2147221471, // 0x80040021 + BadCoordinateMap = -2147221464, // 0x80040028 + CannotFindMsgID = -2147221454, // 0x80040032 + NotBuffered = -2147221444, // 0x8004003C + StartDestroy = -2147221434, // 0x80040046 + ObjectLocked = -2147221433, // 0x80040047 + InvalidOperation = -2147221432, // 0x80040048 + NotInitialized = -2147221424, // 0x80040050 + NotFound = -2147221414, // 0x8004005A + IdAlreadyUsed = -2147221413, // 0x8004005B + FileNotFound = -2147221412, // 0x8004005C + OutOfRange = -2147221411, // 0x8004005D + MismatchedTypes = -2147221404, // 0x80040064 + CannotLoadGdiplus = -2147221394, // 0x8004006E + CannotLoadDirect3D = -2147221393, // 0x8004006F + ClassAlreadyRegistered = -2147221384, // 0x80040078 + MessageNotFound = -2147221383, // 0x80040079 + MessageNotImplemented = -2147221382, // 0x8004007A + ClassNotImplemented = -2147221381, // 0x8004007B + MessageFailed = -2147221380, // 0x8004007C + MessageData = -2147221379, // 0x8004007D + NoContent = -2147221374, // 0x80040082 + NoStorage = -2147221373, // 0x80040083 + GenericWin32 = -2147221364, // 0x8004008C + GenericGdiPlus = -2147221363, // 0x8004008D + GenericDriver = -2147221362, // 0x8004008E + UnableToConnect = -2147221354, // 0x80040096 + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderPort.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderPort.cs new file mode 100644 index 0000000..2dfd17f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/RenderPort.cs @@ -0,0 +1,801 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.RenderPort +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using System; +using System.Collections; + +namespace Microsoft.Iris.Render.Protocol +{ + internal class RenderPort : IRenderPortCallback, IRenderHandleOwner + { + private const uint c_maxCachedBatchSendInfos = 25; + private MessagingSession _session; + private IChannel _channel; + private ContextID _idRemoteContext; + private ProtocolSplashMessaging _protocolMessaging; + private ArrayList _protocols = new ArrayList(); + private HandleTable _handleTable; + private Map _groupProxies; + private MessageCookieLayout _layoutOfRenderHandles; + private RENDERGROUP _defaultGroupId; + private RENDERHANDLE _rootHandle; + private ArrayList _callbackHandlers = new ArrayList(); + private MessageHeap _currentMessageHeap; + private ObjectCache _spareHeapCache; + private Map _activeHeaps; + private uint _nextBatchId; + private RenderPort.BatchSendInfo _sentBatchesHead; + private RenderPort.BatchSendInfo _sentBatchesTail; + private RenderPort.BatchSendInfo _freeBatchSendInfos; + private uint _numFreeBatchSendInfos; + private unsafe MessageBatchEntry* _lastBatchEntry; + private uint _lastBatchBlockId; + private RENDERHANDLE[] _pendingBatchDeletes; + private uint _pendingBatchDeleteSlot; + private RENDERGROUP[] _pendingBatchGroupDeletes; + private uint _pendingBatchGroupDeleteSlot; + private BatchCallback _batchPopulateCallback; + private bool _individualMessageMode; + private uint _uBatchedMessages; + private DeferredHandler _deferredObjectReleaseWorker; + private DeferredHandler _deferredGroupReleaseWorker; + private DeferredHandler _deferredHeapReleaseWorker; + private DeferredHandler _deferredTrafficUpdate; + private bool _foreignByteOrder; + private static object s_SyncLock = new object(); + private static ushort[] s_ByteOrder_CallbackMessage; + private static ushort[] s_ByteOrder_MessageBatchHeader; + private static ushort[] s_ByteOrder_MessageBatchEntry; + private ulong _ulOverallControlTraffic; + private uint _uRecentControlTraffic; + private ulong _ulOverallDataTraffic; + private uint _uRecentDataTraffic; + private ulong _ulOverallTotalTraffic; + private DateTime _dtRecentTrafficTime; + private bool _fPendingTrafficSummary; + private static TimeSpan s_timeTrafficWindow = TimeSpan.FromMilliseconds(500.0); + + internal RenderPort( + MessagingSession session, + IChannel channel, + ContextID idRemoteContext, + RENDERGROUP idGroup, + MessageCookieLayout layout, + bool foreignByteOrder) + { + Debug2.Validate(session != null, typeof(ArgumentNullException), nameof(session)); + Debug2.Validate(channel != null, typeof(ArgumentNullException), nameof(channel)); + Debug2.Validate(idRemoteContext != ContextID.NULL, typeof(ArgumentNullException), nameof(idRemoteContext)); + this._deferredObjectReleaseWorker = new DeferredHandler(this.DeferredObjectReleaseWorker); + this._deferredGroupReleaseWorker = new DeferredHandler(this.DeferredGroupReleaseWorker); + this._deferredHeapReleaseWorker = new DeferredHandler(this.DeferredHeapReleaseWorker); + this._deferredTrafficUpdate = new DeferredHandler(this.DeferredTrafficUpdate); + this._activeHeaps = new Map(); + this._spareHeapCache = new ObjectCache(new ObjectCache.Callback(this.HeapCacheCallback), 10, false); + this._individualMessageMode = true; + this._layoutOfRenderHandles = layout; + this._handleTable = new HandleTable(this, this._layoutOfRenderHandles); + this._defaultGroupId = this.AllocHandleGroup(false); + this._rootHandle = this.AllocHandle(this); + if (idGroup != RENDERGROUP.NULL) + { + this.AllocHandleGroupWithId(idGroup); + this._defaultGroupId = idGroup; + } + this._channel = channel; + this._session = session; + this._foreignByteOrder = foreignByteOrder; + this._idRemoteContext = idRemoteContext; + this._protocolMessaging = ProtocolSplashMessaging.Bind(this); + } + + public void Connect() + { + Debug2.Throw(this._handleTable != null && this._channel != null, "must be valid to connect"); + Debug2.Throw(!this._channel.IsConnected, "already connected"); + this._channel.Connect(this._idRemoteContext, this._rootHandle, this._layoutOfRenderHandles); + foreach (ProtocolInstance protocol in this._protocols) + protocol.OnConnect(); + } + + internal void PingConnection() => LocalRenderPortCallback.AutoSendOnPingReply(this._protocolMessaging, RENDERHANDLE.NULL); + + internal event EventHandler PingReply; + + public void Dispose() + { + this.PingReply = null; + this.DisposeObjectMaps(); + if (this._channel != null) + { + this._channel.Dispose(); + this._channel = null; + } + if (this._spareHeapCache == null) + return; + if (this._currentMessageHeap != null) + this.ReleaseHeap(this._currentMessageHeap); + this._currentMessageHeap = null; + this._spareHeapCache.Dispose(); + this._spareHeapCache = null; + } + + public void DisposeObjectMaps() + { + if (this._handleTable == null) + return; + this._handleTable.Dispose(); + this._handleTable = null; + } + + public MessagingSession Session => this._session; + + public ContextID RemoteContext => this._idRemoteContext; + + public bool ForeignByteOrder => this._foreignByteOrder; + + public bool AlwaysBigEndian => this._foreignByteOrder; + + internal uint DefaultGroupID => RENDERGROUP.ToUInt32(this._defaultGroupId); + + RENDERHANDLE IRenderHandleOwner.RenderHandle => RENDERHANDLE.NULL; + + void IRenderHandleOwner.OnDisconnect() + { + } + + internal ProtocolSplashMessaging MessagingProtocol => this._protocolMessaging; + + public ProtocolInstance LookUpProtocol(string name) + { + ProtocolInstance protocolInstance = null; + foreach (ProtocolInstance protocol in this._protocols) + { + if (protocol.Name == name) + protocolInstance = protocol; + } + return protocolInstance; + } + + internal void BindProtocol(ProtocolInstance protocol) + { + Debug2.Validate(this.LookUpProtocol(protocol.Name) == null, typeof(InvalidOperationException), nameof(protocol), "protocol already bound"); + this._protocols.Add(protocol); + if (this._channel == null || !this._channel.IsConnected) + return; + protocol.OnConnect(); + } + + internal RENDERHANDLE InitRemoteClass(string className) + { + if (className.Equals("Splash::Messaging::Broker")) + return this._rootHandle; + RENDERHANDLE idObjectClass = this.AllocHandle(this); + RemoteBroker.SendCreateClass(this._protocolMessaging, className, idObjectClass); + return idObjectClass; + } + + internal unsafe void CreateRemoteObject( + RENDERHANDLE classCreate, + RENDERHANDLE hNewObject, + Message* pmsgConstructor) + { + RemoteBroker.SendCreateObject(this._protocolMessaging, classCreate, hNewObject, pmsgConstructor); + } + + internal unsafe void SendLocalCallbackMessage(Message* pmsgCallback) => Protocols.Splash.Messaging.RemoteContext.SendForwardMessage(this._protocolMessaging, this._session.LocalContext, pmsgCallback); + + internal void LinkContext(ContextID idContextExisting, ContextID idContextAlias) => RemoteContextRelay.SendLinkContext(this._protocolMessaging, idContextExisting, idContextAlias); + + internal void UnlinkContext(ContextID idContextExisting, ContextID idContextAlias) => RemoteContextRelay.SendUnlinkContext(this._protocolMessaging, idContextExisting, idContextAlias); + + public void BeginMessageBatch(BatchCallback populateCallback) + { + this.Session.AssertOwningThread(); + Debug2.Throw(this._individualMessageMode, "Already in batch mode"); + this._batchPopulateCallback = populateCallback; + this._individualMessageMode = false; + } + + public void EndMessageBatch(BatchCallback deliveryCallback) + { + this.Session.AssertOwningThread(); + Debug2.Throw(!this._individualMessageMode, "Must be collecting a batch to end"); + this.SendCurrentBatch(deliveryCallback); + this._individualMessageMode = true; + } + + public unsafe void SendDataBuffer(void* pvData, uint cbSize, RENDERHANDLE idRemoteBuffer) + { + Debug2.Validate(idRemoteBuffer != RENDERHANDLE.NULL, typeof(ArgumentNullException), nameof(idRemoteBuffer)); + this.UpdateTraffic(0U, cbSize); + var info = new EngineApi.BufferInfo + { + idContextSrc = this._session.LocalContext, + idContextDest = this._idRemoteContext, + idBuffer = idRemoteBuffer, + nFlags = 0, + cbSizeBuffer = cbSize + }; + EngineApi.IFC(EngineApi.SpBufferOpen(&info, pvData)); + } + + public unsafe void SendBatchBuffer(void* pvData, uint cbSize, RENDERHANDLE idRemoteBuffer) + { + int num = idRemoteBuffer != RENDERHANDLE.NULL ? 1 : 0; + this.UpdateTraffic(cbSize, 0U); + var info = new EngineApi.BufferInfo() + { + idContextSrc = this._session.LocalContext, + idContextDest = this._idRemoteContext, + idBuffer = idRemoteBuffer, + nFlags = EngineApi.BufferFlags.IsBatch, + cbSizeBuffer = cbSize + }; + EngineApi.IFC(EngineApi.SpBufferOpen(&info, pvData)); + } + + public unsafe void SendMessageBuffer(Message* pmsg) + { + this.UpdateTraffic(pmsg->cbSize, 0U); + uint src = pmsg->cbSize; + if (this.ForeignByteOrder) + src = Memory.ConvertEndian(src); + var info = new EngineApi.BufferInfo() + { + idContextSrc = this._session.LocalContext, + idContextDest = this._idRemoteContext, + idBuffer = RENDERHANDLE.NULL, + nFlags = EngineApi.BufferFlags.CopyData, + cbSizeBuffer = src + }; + EngineApi.IFC(EngineApi.SpBufferOpen(&info, pmsg)); + } + + private void UpdateTraffic(uint uControl, uint uData) + { + this._uRecentControlTraffic += uControl; + this._uRecentDataTraffic += uData; + this._dtRecentTrafficTime = DateTime.UtcNow; + if (Debug2.IsCategoryEnabled(DebugCategory.Protocol, 1)) + { + if (this._fPendingTrafficSummary || !this.Session.IsConnected) + return; + this.Session.DeferredInvoke(_deferredTrafficUpdate, null, DeferredInvokePriority.Idle, s_timeTrafficWindow); + this._fPendingTrafficSummary = true; + } + else + this.TrafficUpdateWorker(); + } + + private void DeferredTrafficUpdate(object obj) + { + if (!this._fPendingTrafficSummary) + return; + if (DateTime.UtcNow - this._dtRecentTrafficTime < s_timeTrafficWindow) + { + this.Session.DeferredInvoke(_deferredTrafficUpdate, null, DeferredInvokePriority.Idle, this._dtRecentTrafficTime + s_timeTrafficWindow - DateTime.UtcNow); + } + else + { + this._fPendingTrafficSummary = false; + this.TrafficUpdateWorker(); + } + } + + private void TrafficUpdateWorker() + { + this._ulOverallControlTraffic += _uRecentControlTraffic; + this._ulOverallDataTraffic += _uRecentDataTraffic; + this._ulOverallTotalTraffic += this._uRecentControlTraffic + this._uRecentDataTraffic; + Debug2.IsCategoryEnabled(DebugCategory.Protocol, 1); + this._uRecentControlTraffic = 0U; + this._uRecentDataTraffic = 0U; + } + + public unsafe void* AllocMessageBuffer(uint size) + { + this.Session.AssertOwningThread(); + if (this._currentMessageHeap == null) + this._currentMessageHeap = this.AllocHeap(); + return this._currentMessageHeap.Alloc(size); + } + + public unsafe void SendRemoteMessage(Message* pmsg) + { + this.Session.AssertOwningThread(); + Debug2.Throw(this._channel != null, "Not connected to renderer"); + if (this._individualMessageMode) + { + this.SendMessageBuffer(pmsg); + if (this._currentMessageHeap == null) + return; + this._currentMessageHeap.Reset(); + } + else + this.StoreMessageEntry(pmsg); + } + + public RENDERHANDLE AllocHandle(IRenderHandleOwner owner) + { + Debug2.Throw(this._handleTable != null, "Render port has already shut down"); + Debug2.Validate(owner != null, typeof(ArgumentNullException), nameof(owner)); + return this._handleTable.Alloc(this._defaultGroupId, owner); + } + + public void RegisterKnownHandle(IRenderHandleOwner owner, RENDERHANDLE handle) + { + Debug2.Throw(this._handleTable != null, "Render port has already shut down"); + Debug2.Validate(owner != null, typeof(ArgumentNullException), nameof(owner)); + this._handleTable.AllocWithId(owner, handle, true); + } + + public void FreeHandle(RENDERHANDLE handle) + { + if (this.Session.IsOwningThread()) + { + if (this._handleTable == null) + return; + if (this._channel != null && this._handleTable.GetGroup(handle) == this._defaultGroupId) + { + this._handleTable.SetOwner(handle, null); + this.AddPendingDelete(handle); + RemoteBroker.SendDestroyObject(this._protocolMessaging, handle); + } + else + this._handleTable.Free(handle); + } + else + this.Session.DeferredInvoke(_deferredObjectReleaseWorker, handle, DeferredInvokePriority.High); + } + + public void CancelAllocHandle(RENDERHANDLE handle) + { + if (this._handleTable == null) + return; + this._handleTable.Free(handle); + } + + public IRenderHandleOwner TryGetHandleOwner(RENDERHANDLE handle) => this._handleTable.GetOwner(handle, true); + + public IRenderHandleOwner TryGetProxyOwner(RENDERHANDLE handle) + { + IRenderHandleOwner renderHandleOwner = null; + if (this._groupProxies != null) + { + RENDERGROUP group = this._handleTable.GetGroup(handle); + if (group != RENDERGROUP.NULL) + renderHandleOwner = this.GetGroupProxy(group); + } + return renderHandleOwner; + } + + public IRenderHandleOwner GetHandleOwner(RENDERHANDLE handle) => this._handleTable.GetOwner(handle); + + public void ValidateHandle(RENDERHANDLE handle) => this._handleTable.Validate(handle); + + public void ValidateHandleOrNull(RENDERHANDLE handle) + { + if (!(handle != RENDERHANDLE.NULL)) + return; + this._handleTable.Validate(handle); + } + + public RENDERGROUP AllocHandleGroup() => this.AllocHandleGroup(true); + + public void AllocHandleGroupWithId(RENDERGROUP idGroup) => this._handleTable.AllocGroupWithId(idGroup); + + private RENDERGROUP AllocHandleGroup(bool failIfNotConnected) + { + RENDERGROUP handle = this._handleTable.AllocGroup(); + if (this._channel != null) + Protocols.Splash.Messaging.RemoteContext.SendCreateGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(handle), this._session.LocalContext); + else if (failIfNotConnected) + Debug2.Throw(false, "Not connected to renderer"); + return handle; + } + + public void FreeHandleGroup(RENDERGROUP group) + { + if (this.Session.IsOwningThread()) + { + if (this._handleTable == null) + return; + if (this._channel != null) + { + this.AddPendingGroupDelete(group); + Protocols.Splash.Messaging.RemoteContext.SendDestroyGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(group)); + } + else + this._handleTable.FreeGroup(group); + } + else + this.Session.DeferredInvoke(_deferredGroupReleaseWorker, group, DeferredInvokePriority.High); + } + + public void RegisterGroupProxy(RENDERGROUP group, IRenderHandleOwner proxy) + { + if (this._groupProxies == null) + this._groupProxies = new Map(); + this._groupProxies[group] = new WeakReference(proxy); + } + + public void RevokeGroupProxy(RENDERGROUP group) + { + if (this._groupProxies == null) + return; + this._groupProxies[group] = null; + } + + public IRenderHandleOwner GetGroupProxy(RENDERGROUP group) + { + IRenderHandleOwner renderHandleOwner = null; + if (this._groupProxies != null) + { + WeakReference groupProxy = this._groupProxies[group]; + if (groupProxy != null) + renderHandleOwner = groupProxy.Target as IRenderHandleOwner; + } + return renderHandleOwner; + } + + public MessageHeap AllocHeap() + { + this.Session.AssertOwningThread(); + return (MessageHeap)this._spareHeapCache.Pop(); + } + + public void ReleaseHeap(MessageHeap heap) + { + if (this.Session.IsOwningThread()) + this.DeferredHeapReleaseWorker(heap); + else if (this.Session.OwningThread != null) + this.Session.DeferredInvoke(_deferredHeapReleaseWorker, heap, DeferredInvokePriority.High); + else + heap.Dispose(); + } + + private unsafe void StoreMessageEntry(Message* pMethodMsg) + { + MessageHeap.Block block = this._currentMessageHeap.LookupBlock(pMethodMsg); + Debug2.Throw((IntPtr)block.data != IntPtr.Zero, "message should be in current message heap"); + uint num = (uint)((ulong)((sbyte*)pMethodMsg - (sbyte*)block.data) - (ulong)sizeof(MessageBatchEntry)); + if ((IntPtr)this._lastBatchEntry != IntPtr.Zero && (int)this._lastBatchBlockId == (int)block.id) + this._lastBatchEntry->uOffsetNextEntry = num; + else + ((MessageBatchHeader*)block.data)->uOffsetFirstEntry = num; + this._lastBatchEntry = (MessageBatchEntry*)((int)block.data + (int)num); + this._lastBatchBlockId = block.id; + ++this._uBatchedMessages; + BatchCallback populateCallback = this._batchPopulateCallback; + if (populateCallback == null) + return; + this._batchPopulateCallback = null; + populateCallback(); + } + + private unsafe void SendCurrentBatch(BatchCallback deliveryCallback) + { + try + { + if ((IntPtr)this._lastBatchEntry != IntPtr.Zero) + { + uint nextBatchId = this._nextBatchId; + ++this._nextBatchId; + try + { + LocalRenderPortCallback.AutoSendOnBatchProcessed(this._protocolMessaging, RENDERHANDLE.NULL, nextBatchId); + RenderPort.BatchSendInfo info = this.AllocBatchSendInfo(); + info.batchID = nextBatchId; + info.heap = this._currentMessageHeap; + info.pendingDeletes = this._pendingBatchDeletes; + info.pendingGroupDeletes = this._pendingBatchGroupDeletes; + info.deliveryCallback = deliveryCallback; + this.EnqueuePendingBatch(info); + RENDERHANDLE renderhandle = RENDERHANDLE.NULL; + int blockCount = this._currentMessageHeap.BlockCount; + uint num = 0; + MessageHeap.Enumerator enumerator = this._currentMessageHeap.GetEnumerator(); + while (enumerator.MoveNext()) + { + MessageHeap.Block current = enumerator.Current; + MessageBatchHeader* data = (MessageBatchHeader*)current.data; + RENDERHANDLE idRemoteBuffer = RENDERHANDLE.NULL; + --blockCount; + if (blockCount > 0) + idRemoteBuffer = this.AllocHandle(this); + data->idPredicateBuffer = renderhandle; + if (this.ForeignByteOrder) + SwapBatchListByteOrder(data); + num += current.size; + this.SendBatchBuffer(current.data, current.size, idRemoteBuffer); + renderhandle = idRemoteBuffer; + } + this._currentMessageHeap = null; + this._pendingBatchDeletes = null; + this._pendingBatchDeleteSlot = 0U; + this._pendingBatchGroupDeletes = null; + this._pendingBatchGroupDeleteSlot = 0U; + } + finally + { + if (this._currentMessageHeap != null) + { + this.DequeuePendingBatch(nextBatchId, true); + this.ReleaseHeap(this._currentMessageHeap); + this._currentMessageHeap = null; + } + } + } + else + { + if (this._currentMessageHeap != null) + { + this.ReleaseHeap(this._currentMessageHeap); + this._currentMessageHeap = null; + } + if (deliveryCallback == null) + return; + deliveryCallback(); + } + } + finally + { + this._currentMessageHeap = null; + this._batchPopulateCallback = null; + this._lastBatchEntry = null; + this._lastBatchBlockId = 0U; + this._uBatchedMessages = 0U; + } + } + + private static unsafe void SwapBatchListByteOrder(MessageBatchHeader* pHeader) + { + byte* pMem1 = (byte*)pHeader; + uint num = pHeader->uOffsetFirstEntry; + MarshalHelper.SwapByteOrder(pMem1, ref s_ByteOrder_MessageBatchHeader, typeof(MessageBatchHeader), 0, 0); + while (num != 0U) + { + byte* pMem2 = pMem1 + (int)num; + num = ((MessageBatchEntry*)pMem2)->uOffsetNextEntry; + MarshalHelper.SwapByteOrder(pMem2, ref s_ByteOrder_MessageBatchEntry, typeof(MessageBatchEntry), 0, 0); + } + } + + private void DeferredObjectReleaseWorker(object args) => this.FreeHandle((RENDERHANDLE)args); + + private void DeferredGroupReleaseWorker(object args) => this.FreeHandleGroup((RENDERGROUP)args); + + private void DeferredHeapReleaseWorker(object args) => this._spareHeapCache.Push((MessageHeap)args); + + private unsafe object HeapCacheCallback(ObjectCache.Operation operation, object data) + { + this.Session.AssertOwningThread(); + MessageHeap key = data as MessageHeap; + switch (operation) + { + case ObjectCache.Operation.Alloc: + key = new MessageHeap(8U * Win32Api.GetSystemPageSize(), (uint)sizeof(MessageBatchHeader), (uint)sizeof(MessageBatchEntry)); + this._activeHeaps[key] = key; + break; + case ObjectCache.Operation.Free: + this._activeHeaps.Remove(key); + key.Dispose(); + key = null; + break; + case ObjectCache.Operation.Freeze: + Debug2.Validate(key != null, typeof(ArgumentNullException), nameof(data)); + key.Reset(); + break; + } + return key; + } + + internal unsafe void ProcessMessageBuffer(EngineApi.BufferInfo* pBufferInfo, void* pvBufferData) + { + if (this.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)pvBufferData, ref s_ByteOrder_CallbackMessage, typeof(CallbackMessage), 0, 0); + CallbackMessage* message = (CallbackMessage*)pvBufferData; + this.DispatchCallbackMessage(RENDERHANDLE.ToUInt32(message->idObjectSubject), message); + } + + internal RENDERHANDLE RegisterCallback(PortCallback callback, out uint idCallback) + { + idCallback = (uint)this._callbackHandlers.Add(callback); + return RENDERHANDLE.FromUInt32(idCallback + 2U); + } + + private unsafe void DispatchCallbackMessage(uint idCallback, CallbackMessage* message) + { + idCallback -= 2U; + if (idCallback >= (uint)this._callbackHandlers.Count) + return; + PortCallback callbackHandler = (PortCallback)this._callbackHandlers[(int)idCallback]; + if (callbackHandler == null) + return; + IRenderHandleOwner owner = this; + if (message->hTarget != RENDERHANDLE.NULL) + { + if (this._handleTable == null) + return; + owner = this.TryGetHandleOwner(message->hTarget); + if (owner == null) + return; + } + callbackHandler(this, owner, message); + } + + void IRenderPortCallback.OnPingReply(RENDERHANDLE target) + { + if (this.PingReply == null) + return; + this.PingReply(this, EventArgs.Empty); + } + + void IRenderPortCallback.OnBatchProcessed( + RENDERHANDLE target, + uint uBatchCompleted) + { + RenderPort.BatchSendInfo info = this.DequeuePendingBatch(uBatchCompleted, false); + if (info == null) + return; + this.ProcessPendingDeletes(info.pendingDeletes); + this.ProcessPendingGroupDeletes(info.pendingGroupDeletes); + this.ReleaseHeap(info.heap); + if (info.deliveryCallback != null) + info.deliveryCallback(); + this.FreeBatchSendInfo(info); + } + + private void AddPendingDelete(RENDERHANDLE handle) + { + uint num1 = 0; + if (this._pendingBatchDeletes != null) + num1 = (uint)this._pendingBatchDeletes.Length; + if (this._pendingBatchDeleteSlot >= num1) + { + uint num2 = 2U * num1; + if (num2 == 0U) + num2 = 16U; + RENDERHANDLE[] renderhandleArray = new RENDERHANDLE[num2]; + if (num1 > 0U) + Array.Copy(_pendingBatchDeletes, renderhandleArray, this._pendingBatchDeletes.Length); + this._pendingBatchDeletes = renderhandleArray; + } + this._pendingBatchDeletes[this._pendingBatchDeleteSlot] = handle; + ++this._pendingBatchDeleteSlot; + } + + private void ProcessPendingDeletes(RENDERHANDLE[] deleteList) + { + if (deleteList == null || this._handleTable == null) + return; + foreach (RENDERHANDLE delete in deleteList) + { + if (delete != RENDERHANDLE.NULL) + this._handleTable.Free(delete); + } + } + + private void AddPendingGroupDelete(RENDERGROUP group) + { + uint num1 = 0; + if (this._pendingBatchGroupDeletes != null) + num1 = (uint)this._pendingBatchGroupDeletes.Length; + if (this._pendingBatchGroupDeleteSlot >= num1) + { + uint num2 = 2U * num1; + if (num2 == 0U) + num2 = 16U; + RENDERGROUP[] rendergroupArray = new RENDERGROUP[num2]; + if (num1 > 0U) + Array.Copy(_pendingBatchGroupDeletes, rendergroupArray, this._pendingBatchGroupDeletes.Length); + this._pendingBatchGroupDeletes = rendergroupArray; + } + this._pendingBatchGroupDeletes[this._pendingBatchGroupDeleteSlot] = group; + ++this._pendingBatchGroupDeleteSlot; + } + + private void ProcessPendingGroupDeletes(RENDERGROUP[] deleteList) + { + if (deleteList == null || this._handleTable == null) + return; + foreach (RENDERGROUP delete in deleteList) + { + if (delete != RENDERGROUP.NULL) + this._handleTable.FreeGroup(delete); + } + } + + private RenderPort.BatchSendInfo AllocBatchSendInfo() + { + RenderPort.BatchSendInfo batchSendInfo; + if (this._freeBatchSendInfos != null) + { + batchSendInfo = this._freeBatchSendInfos; + this._freeBatchSendInfos = batchSendInfo.next; + batchSendInfo.next = null; + --this._numFreeBatchSendInfos; + } + else + batchSendInfo = new RenderPort.BatchSendInfo(); + return batchSendInfo; + } + + private void FreeBatchSendInfo(RenderPort.BatchSendInfo info) + { + info.Reset(); + if (this._numFreeBatchSendInfos >= 25U) + return; + info.next = this._freeBatchSendInfos; + this._freeBatchSendInfos = info; + ++this._numFreeBatchSendInfos; + } + + private void EnqueuePendingBatch(RenderPort.BatchSendInfo info) + { + if (this._sentBatchesTail == null) + { + this._sentBatchesHead = info; + this._sentBatchesTail = info; + } + else + { + this._sentBatchesTail.next = info; + this._sentBatchesTail = info; + } + } + + private RenderPort.BatchSendInfo DequeuePendingBatch(uint batchID, bool fFreeInfo) + { + RenderPort.BatchSendInfo batchSendInfo = null; + RenderPort.BatchSendInfo info; + for (info = this._sentBatchesHead; info != null && (int)info.batchID != (int)batchID; info = info.next) + batchSendInfo = info; + if (info != null) + { + if (this._sentBatchesTail == info) + this._sentBatchesTail = batchSendInfo; + if (batchSendInfo == null) + this._sentBatchesHead = info.next; + else + batchSendInfo.next = info.next; + info.next = null; + if (fFreeInfo) + { + this.FreeBatchSendInfo(info); + info = null; + } + } + return info; + } + + public static object SyncLock => s_SyncLock; + + private class BatchSendInfo + { + public uint batchID; + public MessageHeap heap; + public RENDERHANDLE[] pendingDeletes; + public RENDERGROUP[] pendingGroupDeletes; + public BatchCallback deliveryCallback; + public RenderPort.BatchSendInfo next; + + public void Reset() + { + this.batchID = 0U; + this.heap = null; + this.pendingDeletes = null; + this.pendingGroupDeletes = null; + this.deliveryCallback = null; + this.next = null; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ShutdownReason.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ShutdownReason.cs new file mode 100644 index 0000000..801f816 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/ShutdownReason.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.ShutdownReason +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal enum ShutdownReason + { + NoReason, + SelfShutdown, + PeerShutdown, + TransportClosed, + TransportFailure, + GenericFailure, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TimeoutHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TimeoutHandler.cs new file mode 100644 index 0000000..f8954c3 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TimeoutHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.TimeoutHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal delegate void TimeoutHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TransportProtocol.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TransportProtocol.cs new file mode 100644 index 0000000..6da2ad6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocol/TransportProtocol.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocol.TransportProtocol +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render.Protocol +{ + internal enum TransportProtocol + { + None = 0, + Min = 1, + VC = 1, + TCP = 2, + UDP = 3, + Max = 4, + PIPE = 4, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IFormWindowCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IFormWindowCallback.cs new file mode 100644 index 0000000..3167940 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IFormWindowCallback.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.IFormWindowCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal interface IFormWindowCallback + { + void OnRendererSuspended(RENDERHANDLE target, bool fEnabled); + + void OnNativeScreensave(RENDERHANDLE target, bool fStartScreensave); + + void OnShellShutdownHook(RENDERHANDLE target, ushort uIdMsg); + + void OnSetFocus(RENDERHANDLE target, bool focused, HWND hwndFocusChange); + + void OnDropComplete(RENDERHANDLE target); + + void OnPartialDrop(RENDERHANDLE target, string file); + + unsafe void OnStateChange(RENDERHANDLE target, Message* stateInfo); + + void OnTerminalSessionChange(RENDERHANDLE target, IntPtr wParam, IntPtr lParam); + + void OnPrivateSysCommand(RENDERHANDLE target, IntPtr wParam, IntPtr lParam); + + void OnMouseIdle(RENDERHANDLE target, bool fNewIdle); + + void OnCloseRequested(RENDERHANDLE target); + + void OnLoad(RENDERHANDLE target); + + void OnWindowDestroyed( + RENDERHANDLE target, + uint nFinalShow, + Rectangle rcLastPosition, + Point ptFinalMaxPosition); + + void OnWindowCreated(RENDERHANDLE target, HWND m_hWnd); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IInputCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IInputCallback.cs new file mode 100644 index 0000000..3e469b0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/IInputCallback.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.IInputCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal interface IInputCallback + { + unsafe void OnInput(RENDERHANDLE target, Message* inputInfo); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs new file mode 100644 index 0000000..f26eb81 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs @@ -0,0 +1,420 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.LocalFormWindowCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal class LocalFormWindowCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnRendererSuspended; + private static ushort[] s_priv_ByteOrder_Msg1_OnNativeScreensave; + private static ushort[] s_priv_ByteOrder_Msg2_OnShellShutdownHook; + private static ushort[] s_priv_ByteOrder_Msg4_OnDropComplete; + private static ushort[] s_priv_ByteOrder_Msg5_OnPartialDrop; + private static ushort[] s_priv_ByteOrder_Msg6_OnStateChange; + private static ushort[] s_priv_ByteOrder_Msg7_OnTerminalSessionChange; + private static ushort[] s_priv_ByteOrder_Msg8_OnPrivateSysCommand; + private static ushort[] s_priv_ByteOrder_Msg9_OnMouseIdle; + private static ushort[] s_priv_ByteOrder_Msg10_OnCloseRequested; + private static ushort[] s_priv_ByteOrder_Msg11_OnLoad; + private static ushort[] s_priv_ByteOrder_Msg12_OnWindowDestroyed; + + protected LocalFormWindowCallback() + { + } + + internal static LocalFormWindowCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalFormWindowCallback(port, callbackInstance); + } + + protected LocalFormWindowCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalFormWindowCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IFormWindowCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnRendererSuspended(port, _priv_target, (LocalFormWindowCallback.Msg0_OnRendererSuspended*)message); + break; + case 1: + Dispatch_OnNativeScreensave(port, _priv_target, (LocalFormWindowCallback.Msg1_OnNativeScreensave*)message); + break; + case 2: + Dispatch_OnShellShutdownHook(port, _priv_target, (LocalFormWindowCallback.Msg2_OnShellShutdownHook*)message); + break; + case 3: + Dispatch_OnSetFocus(port, _priv_target, (LocalFormWindowCallback.Msg3_OnSetFocus*)message); + break; + case 4: + Dispatch_OnDropComplete(port, _priv_target, (LocalFormWindowCallback.Msg4_OnDropComplete*)message); + break; + case 5: + Dispatch_OnPartialDrop(port, _priv_target, (LocalFormWindowCallback.Msg5_OnPartialDrop*)message); + break; + case 6: + Dispatch_OnStateChange(port, _priv_target, (LocalFormWindowCallback.Msg6_OnStateChange*)message); + break; + case 7: + Dispatch_OnTerminalSessionChange(port, _priv_target, (LocalFormWindowCallback.Msg7_OnTerminalSessionChange*)message); + break; + case 8: + Dispatch_OnPrivateSysCommand(port, _priv_target, (LocalFormWindowCallback.Msg8_OnPrivateSysCommand*)message); + break; + case 9: + Dispatch_OnMouseIdle(port, _priv_target, (LocalFormWindowCallback.Msg9_OnMouseIdle*)message); + break; + case 10: + Dispatch_OnCloseRequested(port, _priv_target, (LocalFormWindowCallback.Msg10_OnCloseRequested*)message); + break; + case 11: + Dispatch_OnLoad(port, _priv_target, (LocalFormWindowCallback.Msg11_OnLoad*)message); + break; + case 12: + Dispatch_OnWindowDestroyed(port, _priv_target, (LocalFormWindowCallback.Msg12_OnWindowDestroyed*)message); + break; + case 13: + Dispatch_OnWindowCreated(port, _priv_target, (LocalFormWindowCallback.Msg13_OnWindowCreated*)message); + break; + } + } + + private static unsafe void Dispatch_OnRendererSuspended( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg0_OnRendererSuspended* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnRendererSuspended, typeof(LocalFormWindowCallback.Msg0_OnRendererSuspended), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + bool fEnabled = _priv_pmsg->fEnabled != 0U; + _priv_target.OnRendererSuspended(target, fEnabled); + } + + private static unsafe void Dispatch_OnNativeScreensave( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg1_OnNativeScreensave* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnNativeScreensave, typeof(LocalFormWindowCallback.Msg1_OnNativeScreensave), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + bool fStartScreensave = _priv_pmsg->fStartScreensave != 0U; + _priv_target.OnNativeScreensave(target, fStartScreensave); + } + + private static unsafe void Dispatch_OnShellShutdownHook( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg2_OnShellShutdownHook* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnShellShutdownHook, typeof(LocalFormWindowCallback.Msg2_OnShellShutdownHook), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + ushort uIdMsg = _priv_pmsg->uIdMsg; + _priv_target.OnShellShutdownHook(target, uIdMsg); + } + + private static unsafe void Dispatch_OnSetFocus( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg3_OnSetFocus* _priv_pmsg) + { + RENDERHANDLE target = _priv_pmsg->target; + bool focused = _priv_pmsg->focused != 0U; + HWND hwndFocusChange = _priv_pmsg->hwndFocusChange; + _priv_target.OnSetFocus(target, focused, hwndFocusChange); + } + + private static unsafe void Dispatch_OnDropComplete( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg4_OnDropComplete* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnDropComplete, typeof(LocalFormWindowCallback.Msg4_OnDropComplete), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnDropComplete(target); + } + + private static unsafe void Dispatch_OnPartialDrop( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg5_OnPartialDrop* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg5_OnPartialDrop, typeof(LocalFormWindowCallback.Msg5_OnPartialDrop), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + string file; + MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->file, out file); + _priv_target.OnPartialDrop(target, file); + } + + private static unsafe void Dispatch_OnStateChange( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg6_OnStateChange* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg6_OnStateChange, typeof(LocalFormWindowCallback.Msg6_OnStateChange), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + Message* pmsgInner; + MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->stateInfo, out pmsgInner); + _priv_target.OnStateChange(target, pmsgInner); + } + + private static unsafe void Dispatch_OnTerminalSessionChange( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg7_OnTerminalSessionChange* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg7_OnTerminalSessionChange, typeof(LocalFormWindowCallback.Msg7_OnTerminalSessionChange), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + IntPtr wParam = _priv_pmsg->wParam; + IntPtr lParam = _priv_pmsg->lParam; + _priv_target.OnTerminalSessionChange(target, wParam, lParam); + } + + private static unsafe void Dispatch_OnPrivateSysCommand( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg8_OnPrivateSysCommand* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg8_OnPrivateSysCommand, typeof(LocalFormWindowCallback.Msg8_OnPrivateSysCommand), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + IntPtr wParam = _priv_pmsg->wParam; + IntPtr lParam = _priv_pmsg->lParam; + _priv_target.OnPrivateSysCommand(target, wParam, lParam); + } + + private static unsafe void Dispatch_OnMouseIdle( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg9_OnMouseIdle* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg9_OnMouseIdle, typeof(LocalFormWindowCallback.Msg9_OnMouseIdle), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + bool fNewIdle = _priv_pmsg->fNewIdle != 0U; + _priv_target.OnMouseIdle(target, fNewIdle); + } + + private static unsafe void Dispatch_OnCloseRequested( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg10_OnCloseRequested* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg10_OnCloseRequested, typeof(LocalFormWindowCallback.Msg10_OnCloseRequested), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnCloseRequested(target); + } + + private static unsafe void Dispatch_OnLoad( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg11_OnLoad* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg11_OnLoad, typeof(LocalFormWindowCallback.Msg11_OnLoad), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnLoad(target); + } + + private static unsafe void Dispatch_OnWindowDestroyed( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg12_OnWindowDestroyed* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg12_OnWindowDestroyed, typeof(LocalFormWindowCallback.Msg12_OnWindowDestroyed), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint nFinalShow = _priv_pmsg->nFinalShow; + Rectangle rcLastPosition = _priv_pmsg->rcLastPosition; + Point finalMaxPosition = _priv_pmsg->ptFinalMaxPosition; + _priv_target.OnWindowDestroyed(target, nFinalShow, rcLastPosition, finalMaxPosition); + } + + private static unsafe void Dispatch_OnWindowCreated( + RenderPort _priv_port, + IFormWindowCallback _priv_target, + LocalFormWindowCallback.Msg13_OnWindowCreated* _priv_pmsg) + { + RENDERHANDLE target = _priv_pmsg->target; + HWND hWnd = _priv_pmsg->m_hWnd; + _priv_target.OnWindowCreated(target, hWnd); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnRendererSuspended + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint fEnabled; + } + + [ComVisible(false)] + private struct Msg1_OnNativeScreensave + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint fStartScreensave; + } + + [ComVisible(false)] + private struct Msg2_OnShellShutdownHook + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public ushort uIdMsg; + } + + [ComVisible(false)] + private struct Msg3_OnSetFocus + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint focused; + public HWND hwndFocusChange; + } + + [ComVisible(false)] + private struct Msg4_OnDropComplete + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg5_OnPartialDrop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public BLOBREF file; + } + + [ComVisible(false)] + private struct Msg6_OnStateChange + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public BLOBREF stateInfo; + } + + [ComVisible(false)] + private struct Msg7_OnTerminalSessionChange + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public IntPtr wParam; + public IntPtr lParam; + } + + [ComVisible(false)] + private struct Msg8_OnPrivateSysCommand + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public IntPtr wParam; + public IntPtr lParam; + } + + [ComVisible(false)] + private struct Msg9_OnMouseIdle + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint fNewIdle; + } + + [ComVisible(false)] + private struct Msg10_OnCloseRequested + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg11_OnLoad + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg12_OnWindowDestroyed + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint nFinalShow; + public Rectangle rcLastPosition; + public Point ptFinalMaxPosition; + } + + [ComVisible(false)] + private struct Msg13_OnWindowCreated + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public HWND m_hWnd; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs new file mode 100644 index 0000000..2d66af2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.LocalInputCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal class LocalInputCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnInput; + + protected LocalInputCallback() + { + } + + internal static LocalInputCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalInputCallback(port, callbackInstance); + } + + protected LocalInputCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalInputCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IInputCallback _priv_target) || message->nMsg != 0U) + return; + Dispatch_OnInput(port, _priv_target, (LocalInputCallback.Msg0_OnInput*)message); + } + + private static unsafe void Dispatch_OnInput( + RenderPort _priv_port, + IInputCallback _priv_target, + LocalInputCallback.Msg0_OnInput* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnInput, typeof(LocalInputCallback.Msg0_OnInput), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + Message* pmsgInner; + MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->inputInfo, out pmsgInner); + _priv_target.OnInput(target, pmsgInner); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnInput + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public BLOBREF inputInfo; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IDesktopManagerCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IDesktopManagerCallback.cs new file mode 100644 index 0000000..fc4643b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IDesktopManagerCallback.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.IDesktopManagerCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal interface IDesktopManagerCallback + { + void OnEndDisplayModes(RENDERHANDLE target); + + void OnDisplayMode(RENDERHANDLE target, RenderDisplayMode mode, bool fSupported); + + void OnBeginDisplayModes(RENDERHANDLE target); + + void OnEndEnumMonitorInfo(RENDERHANDLE target); + + unsafe void OnMonitorInfo(RENDERHANDLE target, Message* info); + + void OnBeginEnumMonitorInfo(RENDERHANDLE target); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IHwndHostWindowCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IHwndHostWindowCallback.cs new file mode 100644 index 0000000..85df788 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/IHwndHostWindowCallback.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.IHwndHostWindowCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal interface IHwndHostWindowCallback + { + void OnHandleChanged(RENDERHANDLE target, HWND m_hWnd); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs new file mode 100644 index 0000000..fbb2a2f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs @@ -0,0 +1,207 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.LocalDesktopManagerCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal class LocalDesktopManagerCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnEndDisplayModes; + private static ushort[] s_priv_ByteOrder_Msg1_OnDisplayMode; + private static ushort[] s_priv_ByteOrder_Msg2_OnBeginDisplayModes; + private static ushort[] s_priv_ByteOrder_Msg3_OnEndEnumMonitorInfo; + private static ushort[] s_priv_ByteOrder_Msg4_OnMonitorInfo; + private static ushort[] s_priv_ByteOrder_Msg5_OnBeginEnumMonitorInfo; + + protected LocalDesktopManagerCallback() + { + } + + internal static LocalDesktopManagerCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalDesktopManagerCallback(port, callbackInstance); + } + + protected LocalDesktopManagerCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalDesktopManagerCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IDesktopManagerCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnEndDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg0_OnEndDisplayModes*)message); + break; + case 1: + Dispatch_OnDisplayMode(port, _priv_target, (LocalDesktopManagerCallback.Msg1_OnDisplayMode*)message); + break; + case 2: + Dispatch_OnBeginDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes*)message); + break; + case 3: + Dispatch_OnEndEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo*)message); + break; + case 4: + Dispatch_OnMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg4_OnMonitorInfo*)message); + break; + case 5: + Dispatch_OnBeginEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo*)message); + break; + } + } + + private static unsafe void Dispatch_OnEndDisplayModes( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg0_OnEndDisplayModes* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnEndDisplayModes, typeof(LocalDesktopManagerCallback.Msg0_OnEndDisplayModes), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnEndDisplayModes(target); + } + + private static unsafe void Dispatch_OnDisplayMode( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg1_OnDisplayMode* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnDisplayMode, typeof(LocalDesktopManagerCallback.Msg1_OnDisplayMode), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + RenderDisplayMode mode = _priv_pmsg->mode; + bool fSupported = _priv_pmsg->fSupported != 0U; + _priv_target.OnDisplayMode(target, mode, fSupported); + } + + private static unsafe void Dispatch_OnBeginDisplayModes( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnBeginDisplayModes, typeof(LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnBeginDisplayModes(target); + } + + private static unsafe void Dispatch_OnEndEnumMonitorInfo( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnEndEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnEndEnumMonitorInfo(target); + } + + private static unsafe void Dispatch_OnMonitorInfo( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg4_OnMonitorInfo* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnMonitorInfo, typeof(LocalDesktopManagerCallback.Msg4_OnMonitorInfo), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + Message* pmsgInner; + MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->info, out pmsgInner); + _priv_target.OnMonitorInfo(target, pmsgInner); + } + + private static unsafe void Dispatch_OnBeginEnumMonitorInfo( + RenderPort _priv_port, + IDesktopManagerCallback _priv_target, + LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg5_OnBeginEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnBeginEnumMonitorInfo(target); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnEndDisplayModes + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg1_OnDisplayMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public RenderDisplayMode mode; + public uint fSupported; + } + + [ComVisible(false)] + private struct Msg2_OnBeginDisplayModes + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg3_OnEndEnumMonitorInfo + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg4_OnMonitorInfo + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public BLOBREF info; + } + + [ComVisible(false)] + private struct Msg5_OnBeginEnumMonitorInfo + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs new file mode 100644 index 0000000..1dfa046 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.LocalHwndHostWindowCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal class LocalHwndHostWindowCallback : RemoteObject + { + protected LocalHwndHostWindowCallback() + { + } + + internal static LocalHwndHostWindowCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalHwndHostWindowCallback(port, callbackInstance); + } + + protected LocalHwndHostWindowCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalHwndHostWindowCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IHwndHostWindowCallback _priv_target) || message->nMsg != 0U) + return; + Dispatch_OnHandleChanged(port, _priv_target, (LocalHwndHostWindowCallback.Msg0_OnHandleChanged*)message); + } + + private static unsafe void Dispatch_OnHandleChanged( + RenderPort _priv_port, + IHwndHostWindowCallback _priv_target, + LocalHwndHostWindowCallback.Msg0_OnHandleChanged* _priv_pmsg) + { + RENDERHANDLE target = _priv_pmsg->target; + HWND hWnd = _priv_pmsg->m_hWnd; + _priv_target.OnHandleChanged(target, hWnd); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnHandleChanged + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public HWND m_hWnd; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs new file mode 100644 index 0000000..277ccdf --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs @@ -0,0 +1,89 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.ProtocolSplashDesktopNt +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal sealed class ProtocolSplashDesktopNt : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_FormWindow; + private RENDERHANDLE _priv_remoteClass_HwndHostWindow; + private RENDERHANDLE _priv_remoteClass_DesktopManager; + private RENDERHANDLE _priv_callbackInstance_HwndHostWindowCallback; + private RENDERHANDLE _priv_callbackInstance_DesktopManagerCallback; + + public static ProtocolSplashDesktopNt Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Desktop::Nt"); + if (protocolInstance != null) + { + ProtocolSplashDesktopNt protocolSplashDesktopNt = protocolInstance as ProtocolSplashDesktopNt; + Debug2.Validate(protocolSplashDesktopNt != null, typeof(InvalidOperationException), "protocol name collision"); + return protocolSplashDesktopNt; + } + ProtocolSplashDesktopNt protocolSplashDesktopNt1 = new ProtocolSplashDesktopNt(port); + port.BindProtocol(protocolSplashDesktopNt1); + return protocolSplashDesktopNt1; + } + + public LocalHwndHostWindowCallback LocalHwndHostWindowCallbackHandle => LocalHwndHostWindowCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_HwndHostWindowCallback); + + public LocalDesktopManagerCallback LocalDesktopManagerCallbackHandle => LocalDesktopManagerCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_DesktopManagerCallback); + + private ProtocolSplashDesktopNt(RenderPort port) + : base(port, "Splash::Desktop::Nt") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_FormWindow = port.InitRemoteClass("Splash::Desktop::Nt::FormWindow"); + this._priv_remoteClass_HwndHostWindow = port.InitRemoteClass("Splash::Desktop::Nt::HwndHostWindow"); + this._priv_remoteClass_DesktopManager = port.InitRemoteClass("Splash::Desktop::Nt::DesktopManager"); + this._priv_callbackInstance_HwndHostWindowCallback = LocalHwndHostWindowCallback.BindCallback(port); + this._priv_callbackInstance_DesktopManagerCallback = LocalDesktopManagerCallback.BindCallback(port); + } + + internal RENDERHANDLE FormWindow_ClassHandle => this._priv_remoteClass_FormWindow; + + internal RENDERHANDLE HwndHostWindow_ClassHandle => this._priv_remoteClass_HwndHostWindow; + + internal RENDERHANDLE DesktopManager_ClassHandle => this._priv_remoteClass_DesktopManager; + + internal RENDERHANDLE HwndHostWindowCallback_CallbackInstance => this._priv_callbackInstance_HwndHostWindowCallback; + + internal RENDERHANDLE DesktopManagerCallback_CallbackInstance => this._priv_callbackInstance_DesktopManagerCallback; + + internal RemoteFormWindow BuildRemoteFormWindow( + IRenderHandleOwner _priv_owner, + RemoteDesktopManager manager, + LocalFormWindowCallback cb) + { + return RemoteFormWindow.Create(this, _priv_owner, manager, cb); + } + + internal RemoteHwndHostWindow BuildRemoteHwndHostWindow( + IRenderHandleOwner _priv_owner, + RemoteFormWindow winParent, + LocalHwndHostWindowCallback cb) + { + return RemoteHwndHostWindow.Create(this, _priv_owner, winParent, cb); + } + + internal RemoteDesktopManager BuildRemoteDesktopManager( + IRenderHandleOwner _priv_owner, + LocalDesktopManagerCallback cb, + bool fEnumDisplayModes) + { + return RemoteDesktopManager.Create(this, _priv_owner, cb, fEnumDisplayModes); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs new file mode 100644 index 0000000..0a884e8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs @@ -0,0 +1,168 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.RemoteDesktopManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal class RemoteDesktopManager : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg2_Create; + private static ushort[] s_priv_ByteOrder_Msg0_RebuildMonitorCache; + private static ushort[] s_priv_ByteOrder_Msg1_ChangeFullScreenMode; + + protected RemoteDesktopManager() + { + } + + public static unsafe RemoteDesktopManager Create( + ProtocolSplashDesktopNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalDesktopManagerCallback cb, + bool fEnumDisplayModes) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE managerClassHandle = _priv_protocolInstance.DesktopManager_ClassHandle; + RemoteDesktopManager remoteDesktopManager = new RemoteDesktopManager(port, _priv_owner); + uint num = (uint)sizeof(RemoteDesktopManager.Msg2_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteDesktopManager.Msg2_Create* msg2CreatePtr = (RemoteDesktopManager.Msg2_Create*)pMem; + msg2CreatePtr->_priv_size = num; + msg2CreatePtr->_priv_msgid = 2U; + msg2CreatePtr->_priv_objcb = cb.RenderHandle; + msg2CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg2CreatePtr->fEnumDisplayModes = fEnumDisplayModes ? uint.MaxValue : 0U; + msg2CreatePtr->_priv_idObjectSubject = remoteDesktopManager.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteDesktopManager.Msg2_Create), 0, 0); + port.CreateRemoteObject(managerClassHandle, remoteDesktopManager.m_renderHandle, (Message*)msg2CreatePtr); + return remoteDesktopManager; + } + + public unsafe void BuildRebuildMonitorCache( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDesktopManager.Msg0_RebuildMonitorCache); + RemoteDesktopManager.Msg0_RebuildMonitorCache* rebuildMonitorCachePtr = (RemoteDesktopManager.Msg0_RebuildMonitorCache*)_priv_portUse.AllocMessageBuffer(size); + rebuildMonitorCachePtr->_priv_size = size; + rebuildMonitorCachePtr->_priv_msgid = 0U; + rebuildMonitorCachePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)rebuildMonitorCachePtr, ref s_priv_ByteOrder_Msg0_RebuildMonitorCache, typeof(RemoteDesktopManager.Msg0_RebuildMonitorCache), 0, 0); + _priv_pmsgUse = (Message*)rebuildMonitorCachePtr; + } + + public unsafe void SendRebuildMonitorCache() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRebuildMonitorCache(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildChangeFullScreenMode( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idDisplay, + RenderDisplayMode mode, + bool fTvMode) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDesktopManager.Msg1_ChangeFullScreenMode); + RemoteDesktopManager.Msg1_ChangeFullScreenMode* changeFullScreenModePtr = (RemoteDesktopManager.Msg1_ChangeFullScreenMode*)_priv_portUse.AllocMessageBuffer(size); + changeFullScreenModePtr->_priv_size = size; + changeFullScreenModePtr->_priv_msgid = 1U; + changeFullScreenModePtr->idDisplay = idDisplay; + changeFullScreenModePtr->mode = mode; + changeFullScreenModePtr->fTvMode = fTvMode ? uint.MaxValue : 0U; + changeFullScreenModePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)changeFullScreenModePtr, ref s_priv_ByteOrder_Msg1_ChangeFullScreenMode, typeof(RemoteDesktopManager.Msg1_ChangeFullScreenMode), 0, 0); + _priv_pmsgUse = (Message*)changeFullScreenModePtr; + } + + public unsafe void SendChangeFullScreenMode( + uint idDisplay, + RenderDisplayMode mode, + bool fTvMode) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildChangeFullScreenMode(out _priv_portUse, out _priv_pmsgUse, idDisplay, mode, fTvMode); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDesktopManager CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDesktopManager(port, handle, true); + } + + public static RemoteDesktopManager CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDesktopManager(port, handle, false); + } + + protected RemoteDesktopManager(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDesktopManager(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDesktopManager && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg2_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + public uint fEnumDisplayModes; + } + + [ComVisible(false)] + private struct Msg0_RebuildMonitorCache + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_ChangeFullScreenMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idDisplay; + public RenderDisplayMode mode; + public uint fTvMode; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs new file mode 100644 index 0000000..6792548 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs @@ -0,0 +1,86 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.RemoteFormWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal class RemoteFormWindow : RemoteFormWindowBase + { + private static ushort[] s_priv_ByteOrder_Msg41_Create; + + protected RemoteFormWindow() + { + } + + public static unsafe RemoteFormWindow Create( + ProtocolSplashDesktopNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + RemoteDesktopManager manager, + LocalFormWindowCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE windowClassHandle = _priv_protocolInstance.FormWindow_ClassHandle; + RemoteFormWindow remoteFormWindow = new RemoteFormWindow(port, _priv_owner); + uint num = (uint)sizeof(RemoteFormWindow.Msg41_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteFormWindow.Msg41_Create* msg41CreatePtr = (RemoteFormWindow.Msg41_Create*)pMem; + msg41CreatePtr->_priv_size = num; + msg41CreatePtr->_priv_msgid = 41U; + msg41CreatePtr->manager = manager != null ? manager.RenderHandle : RENDERHANDLE.NULL; + msg41CreatePtr->_priv_objcb = cb.RenderHandle; + msg41CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg41CreatePtr->_priv_idObjectSubject = remoteFormWindow.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); + port.CreateRemoteObject(windowClassHandle, remoteFormWindow.m_renderHandle, (Message*)msg41CreatePtr); + return remoteFormWindow; + } + + public static RemoteFormWindow CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteFormWindow(port, handle, true); + } + + public static RemoteFormWindow CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteFormWindow(port, handle, false); + } + + protected RemoteFormWindow(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteFormWindow(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteFormWindow && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg41_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE manager; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs new file mode 100644 index 0000000..effd155 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs @@ -0,0 +1,235 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt.RemoteHwndHostWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt +{ + internal class RemoteHwndHostWindow : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg4_Create; + private static ushort[] s_priv_ByteOrder_Msg0_SetVisible; + private static ushort[] s_priv_ByteOrder_Msg1_SetSize; + private static ushort[] s_priv_ByteOrder_Msg2_SetPosition; + private static ushort[] s_priv_ByteOrder_Msg3_SetBackgroundColor; + + protected RemoteHwndHostWindow() + { + } + + public static unsafe RemoteHwndHostWindow Create( + ProtocolSplashDesktopNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + RemoteFormWindow winParent, + LocalHwndHostWindowCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE windowClassHandle = _priv_protocolInstance.HwndHostWindow_ClassHandle; + RemoteHwndHostWindow remoteHwndHostWindow = new RemoteHwndHostWindow(port, _priv_owner); + uint num = (uint)sizeof(RemoteHwndHostWindow.Msg4_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteHwndHostWindow.Msg4_Create* msg4CreatePtr = (RemoteHwndHostWindow.Msg4_Create*)pMem; + msg4CreatePtr->_priv_size = num; + msg4CreatePtr->_priv_msgid = 4U; + msg4CreatePtr->winParent = winParent != null ? winParent.RenderHandle : RENDERHANDLE.NULL; + msg4CreatePtr->_priv_objcb = cb.RenderHandle; + msg4CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg4CreatePtr->_priv_idObjectSubject = remoteHwndHostWindow.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg4_Create, typeof(RemoteHwndHostWindow.Msg4_Create), 0, 0); + port.CreateRemoteObject(windowClassHandle, remoteHwndHostWindow.m_renderHandle, (Message*)msg4CreatePtr); + return remoteHwndHostWindow; + } + + public unsafe void BuildSetVisible( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fVisible) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteHwndHostWindow.Msg0_SetVisible); + RemoteHwndHostWindow.Msg0_SetVisible* msg0SetVisiblePtr = (RemoteHwndHostWindow.Msg0_SetVisible*)_priv_portUse.AllocMessageBuffer(size); + msg0SetVisiblePtr->_priv_size = size; + msg0SetVisiblePtr->_priv_msgid = 0U; + msg0SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; + msg0SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0SetVisiblePtr, ref s_priv_ByteOrder_Msg0_SetVisible, typeof(RemoteHwndHostWindow.Msg0_SetVisible), 0, 0); + _priv_pmsgUse = (Message*)msg0SetVisiblePtr; + } + + public unsafe void SendSetVisible(bool fVisible) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVisible(out _priv_portUse, out _priv_pmsgUse, fVisible); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeWindowPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteHwndHostWindow.Msg1_SetSize); + RemoteHwndHostWindow.Msg1_SetSize* msg1SetSizePtr = (RemoteHwndHostWindow.Msg1_SetSize*)_priv_portUse.AllocMessageBuffer(size); + msg1SetSizePtr->_priv_size = size; + msg1SetSizePtr->_priv_msgid = 1U; + msg1SetSizePtr->sizeWindowPxl = sizeWindowPxl; + msg1SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1SetSizePtr, ref s_priv_ByteOrder_Msg1_SetSize, typeof(RemoteHwndHostWindow.Msg1_SetSize), 0, 0); + _priv_pmsgUse = (Message*)msg1SetSizePtr; + } + + public unsafe void SendSetSize(Size sizeWindowPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetSize(out _priv_portUse, out _priv_pmsgUse, sizeWindowPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetPosition( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Point ptClientPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteHwndHostWindow.Msg2_SetPosition); + RemoteHwndHostWindow.Msg2_SetPosition* msg2SetPositionPtr = (RemoteHwndHostWindow.Msg2_SetPosition*)_priv_portUse.AllocMessageBuffer(size); + msg2SetPositionPtr->_priv_size = size; + msg2SetPositionPtr->_priv_msgid = 2U; + msg2SetPositionPtr->ptClientPxl = ptClientPxl; + msg2SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetPositionPtr, ref s_priv_ByteOrder_Msg2_SetPosition, typeof(RemoteHwndHostWindow.Msg2_SetPosition), 0, 0); + _priv_pmsgUse = (Message*)msg2SetPositionPtr; + } + + public unsafe void SendSetPosition(Point ptClientPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetPosition(out _priv_portUse, out _priv_pmsgUse, ptClientPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetBackgroundColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clrBackground) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteHwndHostWindow.Msg3_SetBackgroundColor); + RemoteHwndHostWindow.Msg3_SetBackgroundColor* setBackgroundColorPtr = (RemoteHwndHostWindow.Msg3_SetBackgroundColor*)_priv_portUse.AllocMessageBuffer(size); + setBackgroundColorPtr->_priv_size = size; + setBackgroundColorPtr->_priv_msgid = 3U; + setBackgroundColorPtr->clrBackground = clrBackground; + setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg3_SetBackgroundColor, typeof(RemoteHwndHostWindow.Msg3_SetBackgroundColor), 0, 0); + _priv_pmsgUse = (Message*)setBackgroundColorPtr; + } + + public unsafe void SendSetBackgroundColor(ColorF clrBackground) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetBackgroundColor(out _priv_portUse, out _priv_pmsgUse, clrBackground); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteHwndHostWindow CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteHwndHostWindow(port, handle, true); + } + + public static RemoteHwndHostWindow CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteHwndHostWindow(port, handle, false); + } + + protected RemoteHwndHostWindow(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteHwndHostWindow(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteHwndHostWindow && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg4_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE winParent; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + + [ComVisible(false)] + private struct Msg0_SetVisible + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fVisible; + } + + [ComVisible(false)] + private struct Msg1_SetSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeWindowPxl; + } + + [ComVisible(false)] + private struct Msg2_SetPosition + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Point ptClientPxl; + } + + [ComVisible(false)] + private struct Msg3_SetBackgroundColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clrBackground; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs new file mode 100644 index 0000000..5819ee2 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs @@ -0,0 +1,68 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.ProtocolSplashDesktop +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal sealed class ProtocolSplashDesktop : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_InputRouter; + private RENDERHANDLE _priv_remoteClass_FormWindowBase; + private RENDERHANDLE _priv_callbackInstance_InputCallback; + private RENDERHANDLE _priv_callbackInstance_FormWindowCallback; + + public static ProtocolSplashDesktop Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Desktop"); + if (protocolInstance != null) + { + ProtocolSplashDesktop protocolSplashDesktop = protocolInstance as ProtocolSplashDesktop; + Debug2.Validate(protocolSplashDesktop != null, typeof(InvalidOperationException), "protocol name collision"); + return protocolSplashDesktop; + } + ProtocolSplashDesktop protocolSplashDesktop1 = new ProtocolSplashDesktop(port); + port.BindProtocol(protocolSplashDesktop1); + return protocolSplashDesktop1; + } + + public LocalInputCallback LocalInputCallbackHandle => LocalInputCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_InputCallback); + + public LocalFormWindowCallback LocalFormWindowCallbackHandle => LocalFormWindowCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_FormWindowCallback); + + private ProtocolSplashDesktop(RenderPort port) + : base(port, "Splash::Desktop") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_InputRouter = port.InitRemoteClass("Splash::Desktop::InputRouter"); + this._priv_remoteClass_FormWindowBase = port.InitRemoteClass("Splash::Desktop::FormWindowBase"); + this._priv_callbackInstance_InputCallback = LocalInputCallback.BindCallback(port); + this._priv_callbackInstance_FormWindowCallback = LocalFormWindowCallback.BindCallback(port); + } + + internal RENDERHANDLE InputRouter_ClassHandle => this._priv_remoteClass_InputRouter; + + internal RENDERHANDLE FormWindowBase_ClassHandle => this._priv_remoteClass_FormWindowBase; + + internal RENDERHANDLE InputCallback_CallbackInstance => this._priv_callbackInstance_InputCallback; + + internal RENDERHANDLE FormWindowCallback_CallbackInstance => this._priv_callbackInstance_FormWindowCallback; + + internal RemoteInputRouter BuildRemoteInputRouter( + IRenderHandleOwner _priv_owner, + LocalInputCallback ic) + { + return RemoteInputRouter.Create(this, _priv_owner, ic); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs new file mode 100644 index 0000000..ef12af0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs @@ -0,0 +1,1312 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.RemoteFormWindowBase +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal class RemoteFormWindowBase : RemoteWindow + { + private static ushort[] s_priv_ByteOrder_Msg7_SetEdgeImageParts; + private static ushort[] s_priv_ByteOrder_Msg8_SetInitialPlacement; + private static ushort[] s_priv_ByteOrder_Msg9_RefreshHitTarget; + private static ushort[] s_priv_ByteOrder_Msg10_ExitInternalDrag; + private static ushort[] s_priv_ByteOrder_Msg11_EnterInternalDrag; + private static ushort[] s_priv_ByteOrder_Msg12_SetDragDropResult; + private static ushort[] s_priv_ByteOrder_Msg13_EnableExternalDragDrop; + private static ushort[] s_priv_ByteOrder_Msg14_SetIcon; + private static ushort[] s_priv_ByteOrder_Msg15_SetMaxResizeWidth; + private static ushort[] s_priv_ByteOrder_Msg16_SetMinResizeWidth; + private static ushort[] s_priv_ByteOrder_Msg17_BringToTop; + private static ushort[] s_priv_ByteOrder_Msg18_EnableShellShutdownHook; + private static ushort[] s_priv_ByteOrder_Msg19_UpdateForegroundLockState; + private static ushort[] s_priv_ByteOrder_Msg21_SetHitMasks; + private static ushort[] s_priv_ByteOrder_Msg22_SetCapture; + private static ushort[] s_priv_ByteOrder_Msg23_SetText; + private static ushort[] s_priv_ByteOrder_Msg24_Destroy; + private static ushort[] s_priv_ByteOrder_Msg25_SetForeground; + private static ushort[] s_priv_ByteOrder_Msg26_TakeFocus; + private static ushort[] s_priv_ByteOrder_Msg27_ForceMouseIdle; + private static ushort[] s_priv_ByteOrder_Msg28_TemporarilyExitExclusiveMode; + private static ushort[] s_priv_ByteOrder_Msg29_Restore; + private static ushort[] s_priv_ByteOrder_Msg30_SetMode; + private static ushort[] s_priv_ByteOrder_Msg31_SetVisible; + private static ushort[] s_priv_ByteOrder_Msg32_SetPosition; + private static ushort[] s_priv_ByteOrder_Msg33_SetSize; + private static ushort[] s_priv_ByteOrder_Msg34_SetCursors; + private static ushort[] s_priv_ByteOrder_Msg35_SetStyles; + private static ushort[] s_priv_ByteOrder_Msg36_SetMouseIdleOptions; + private static ushort[] s_priv_ByteOrder_Msg37_SetOptions; + private static ushort[] s_priv_ByteOrder_Msg38_CreateRootContainer; + + protected RemoteFormWindowBase() + { + } + + public unsafe void BuildSetEdgeImageParts( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fActiveEdges, + string sModuleName, + string sResourceIdLeft, + string sResourceIdTop, + string sResourceIdRight, + string sResourceIdBottom, + Inset insetSplits) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteFormWindowBase.Msg7_SetEdgeImageParts)); + BLOBREF blobref1 = blobInfo.Add(sModuleName); + BLOBREF blobref2 = blobInfo.Add(sResourceIdLeft); + BLOBREF blobref3 = blobInfo.Add(sResourceIdTop); + BLOBREF blobref4 = blobInfo.Add(sResourceIdRight); + BLOBREF blobref5 = blobInfo.Add(sResourceIdBottom); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteFormWindowBase.Msg7_SetEdgeImageParts* setEdgeImagePartsPtr = (RemoteFormWindowBase.Msg7_SetEdgeImageParts*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + setEdgeImagePartsPtr->_priv_size = adjustedTotalSize; + setEdgeImagePartsPtr->_priv_msgid = 7U; + setEdgeImagePartsPtr->fActiveEdges = fActiveEdges ? uint.MaxValue : 0U; + setEdgeImagePartsPtr->sModuleName = blobref1; + setEdgeImagePartsPtr->sResourceIdLeft = blobref2; + setEdgeImagePartsPtr->sResourceIdTop = blobref3; + setEdgeImagePartsPtr->sResourceIdRight = blobref4; + setEdgeImagePartsPtr->sResourceIdBottom = blobref5; + setEdgeImagePartsPtr->insetSplits = insetSplits; + blobInfo.Attach((Message*)setEdgeImagePartsPtr); + setEdgeImagePartsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setEdgeImagePartsPtr, ref s_priv_ByteOrder_Msg7_SetEdgeImageParts, typeof(RemoteFormWindowBase.Msg7_SetEdgeImageParts), 0, 0); + _priv_pmsgUse = (Message*)setEdgeImagePartsPtr; + } + + public unsafe void SendSetEdgeImageParts( + bool fActiveEdges, + string sModuleName, + string sResourceIdLeft, + string sResourceIdTop, + string sResourceIdRight, + string sResourceIdBottom, + Inset insetSplits) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEdgeImageParts(out _priv_portUse, out _priv_pmsgUse, fActiveEdges, sModuleName, sResourceIdLeft, sResourceIdTop, sResourceIdRight, sResourceIdBottom, insetSplits); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetInitialPlacement( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nShowState, + Rectangle rcNormalPosition, + Point ptMaxPosition) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg8_SetInitialPlacement); + RemoteFormWindowBase.Msg8_SetInitialPlacement* initialPlacementPtr = (RemoteFormWindowBase.Msg8_SetInitialPlacement*)_priv_portUse.AllocMessageBuffer(size); + initialPlacementPtr->_priv_size = size; + initialPlacementPtr->_priv_msgid = 8U; + initialPlacementPtr->nShowState = nShowState; + initialPlacementPtr->rcNormalPosition = rcNormalPosition; + initialPlacementPtr->ptMaxPosition = ptMaxPosition; + initialPlacementPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)initialPlacementPtr, ref s_priv_ByteOrder_Msg8_SetInitialPlacement, typeof(RemoteFormWindowBase.Msg8_SetInitialPlacement), 0, 0); + _priv_pmsgUse = (Message*)initialPlacementPtr; + } + + public unsafe void SendSetInitialPlacement( + uint nShowState, + Rectangle rcNormalPosition, + Point ptMaxPosition) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetInitialPlacement(out _priv_portUse, out _priv_pmsgUse, nShowState, rcNormalPosition, ptMaxPosition); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRefreshHitTarget( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg9_RefreshHitTarget); + RemoteFormWindowBase.Msg9_RefreshHitTarget* refreshHitTargetPtr = (RemoteFormWindowBase.Msg9_RefreshHitTarget*)_priv_portUse.AllocMessageBuffer(size); + refreshHitTargetPtr->_priv_size = size; + refreshHitTargetPtr->_priv_msgid = 9U; + refreshHitTargetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)refreshHitTargetPtr, ref s_priv_ByteOrder_Msg9_RefreshHitTarget, typeof(RemoteFormWindowBase.Msg9_RefreshHitTarget), 0, 0); + _priv_pmsgUse = (Message*)refreshHitTargetPtr; + } + + public unsafe void SendRefreshHitTarget() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRefreshHitTarget(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildExitInternalDrag( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg10_ExitInternalDrag); + RemoteFormWindowBase.Msg10_ExitInternalDrag* exitInternalDragPtr = (RemoteFormWindowBase.Msg10_ExitInternalDrag*)_priv_portUse.AllocMessageBuffer(size); + exitInternalDragPtr->_priv_size = size; + exitInternalDragPtr->_priv_msgid = 10U; + exitInternalDragPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)exitInternalDragPtr, ref s_priv_ByteOrder_Msg10_ExitInternalDrag, typeof(RemoteFormWindowBase.Msg10_ExitInternalDrag), 0, 0); + _priv_pmsgUse = (Message*)exitInternalDragPtr; + } + + public unsafe void SendExitInternalDrag() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildExitInternalDrag(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEnterInternalDrag( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg11_EnterInternalDrag); + RemoteFormWindowBase.Msg11_EnterInternalDrag* enterInternalDragPtr = (RemoteFormWindowBase.Msg11_EnterInternalDrag*)_priv_portUse.AllocMessageBuffer(size); + enterInternalDragPtr->_priv_size = size; + enterInternalDragPtr->_priv_msgid = 11U; + enterInternalDragPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)enterInternalDragPtr, ref s_priv_ByteOrder_Msg11_EnterInternalDrag, typeof(RemoteFormWindowBase.Msg11_EnterInternalDrag), 0, 0); + _priv_pmsgUse = (Message*)enterInternalDragPtr; + } + + public unsafe void SendEnterInternalDrag() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEnterInternalDrag(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetDragDropResult( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nDragOverResult, + uint nDragDropResult) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg12_SetDragDropResult); + RemoteFormWindowBase.Msg12_SetDragDropResult* setDragDropResultPtr = (RemoteFormWindowBase.Msg12_SetDragDropResult*)_priv_portUse.AllocMessageBuffer(size); + setDragDropResultPtr->_priv_size = size; + setDragDropResultPtr->_priv_msgid = 12U; + setDragDropResultPtr->nDragOverResult = nDragOverResult; + setDragDropResultPtr->nDragDropResult = nDragDropResult; + setDragDropResultPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setDragDropResultPtr, ref s_priv_ByteOrder_Msg12_SetDragDropResult, typeof(RemoteFormWindowBase.Msg12_SetDragDropResult), 0, 0); + _priv_pmsgUse = (Message*)setDragDropResultPtr; + } + + public unsafe void SendSetDragDropResult(uint nDragOverResult, uint nDragDropResult) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDragDropResult(out _priv_portUse, out _priv_pmsgUse, nDragOverResult, nDragDropResult); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEnableExternalDragDrop( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fEnable) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg13_EnableExternalDragDrop); + RemoteFormWindowBase.Msg13_EnableExternalDragDrop* externalDragDropPtr = (RemoteFormWindowBase.Msg13_EnableExternalDragDrop*)_priv_portUse.AllocMessageBuffer(size); + externalDragDropPtr->_priv_size = size; + externalDragDropPtr->_priv_msgid = 13U; + externalDragDropPtr->fEnable = fEnable ? uint.MaxValue : 0U; + externalDragDropPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)externalDragDropPtr, ref s_priv_ByteOrder_Msg13_EnableExternalDragDrop, typeof(RemoteFormWindowBase.Msg13_EnableExternalDragDrop), 0, 0); + _priv_pmsgUse = (Message*)externalDragDropPtr; + } + + public unsafe void SendEnableExternalDragDrop(bool fEnable) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEnableExternalDragDrop(out _priv_portUse, out _priv_pmsgUse, fEnable); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetIcon( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string sModule, + uint nResourceID, + uint nOptions) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteFormWindowBase.Msg14_SetIcon)); + BLOBREF blobref = blobInfo.Add(sModule); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteFormWindowBase.Msg14_SetIcon* msg14SetIconPtr = (RemoteFormWindowBase.Msg14_SetIcon*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg14SetIconPtr->_priv_size = adjustedTotalSize; + msg14SetIconPtr->_priv_msgid = 14U; + msg14SetIconPtr->sModule = blobref; + msg14SetIconPtr->nResourceID = nResourceID; + msg14SetIconPtr->nOptions = nOptions; + blobInfo.Attach((Message*)msg14SetIconPtr); + msg14SetIconPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg14SetIconPtr, ref s_priv_ByteOrder_Msg14_SetIcon, typeof(RemoteFormWindowBase.Msg14_SetIcon), 0, 0); + _priv_pmsgUse = (Message*)msg14SetIconPtr; + } + + public unsafe void SendSetIcon(string sModule, uint nResourceID, uint nOptions) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetIcon(out _priv_portUse, out _priv_pmsgUse, sModule, nResourceID, nOptions); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetMaxResizeWidth( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nMaxResizeWidth) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg15_SetMaxResizeWidth); + RemoteFormWindowBase.Msg15_SetMaxResizeWidth* setMaxResizeWidthPtr = (RemoteFormWindowBase.Msg15_SetMaxResizeWidth*)_priv_portUse.AllocMessageBuffer(size); + setMaxResizeWidthPtr->_priv_size = size; + setMaxResizeWidthPtr->_priv_msgid = 15U; + setMaxResizeWidthPtr->nMaxResizeWidth = nMaxResizeWidth; + setMaxResizeWidthPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setMaxResizeWidthPtr, ref s_priv_ByteOrder_Msg15_SetMaxResizeWidth, typeof(RemoteFormWindowBase.Msg15_SetMaxResizeWidth), 0, 0); + _priv_pmsgUse = (Message*)setMaxResizeWidthPtr; + } + + public unsafe void SendSetMaxResizeWidth(int nMaxResizeWidth) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMaxResizeWidth(out _priv_portUse, out _priv_pmsgUse, nMaxResizeWidth); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetMinResizeWidth( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nMinResizeWidth) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg16_SetMinResizeWidth); + RemoteFormWindowBase.Msg16_SetMinResizeWidth* setMinResizeWidthPtr = (RemoteFormWindowBase.Msg16_SetMinResizeWidth*)_priv_portUse.AllocMessageBuffer(size); + setMinResizeWidthPtr->_priv_size = size; + setMinResizeWidthPtr->_priv_msgid = 16U; + setMinResizeWidthPtr->nMinResizeWidth = nMinResizeWidth; + setMinResizeWidthPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setMinResizeWidthPtr, ref s_priv_ByteOrder_Msg16_SetMinResizeWidth, typeof(RemoteFormWindowBase.Msg16_SetMinResizeWidth), 0, 0); + _priv_pmsgUse = (Message*)setMinResizeWidthPtr; + } + + public unsafe void SendSetMinResizeWidth(int nMinResizeWidth) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMinResizeWidth(out _priv_portUse, out _priv_pmsgUse, nMinResizeWidth); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildBringToTop(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg17_BringToTop); + RemoteFormWindowBase.Msg17_BringToTop* msg17BringToTopPtr = (RemoteFormWindowBase.Msg17_BringToTop*)_priv_portUse.AllocMessageBuffer(size); + msg17BringToTopPtr->_priv_size = size; + msg17BringToTopPtr->_priv_msgid = 17U; + msg17BringToTopPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg17BringToTopPtr, ref s_priv_ByteOrder_Msg17_BringToTop, typeof(RemoteFormWindowBase.Msg17_BringToTop), 0, 0); + _priv_pmsgUse = (Message*)msg17BringToTopPtr; + } + + public unsafe void SendBringToTop() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildBringToTop(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEnableShellShutdownHook( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string messageToHook, + ushort uIdMsg) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteFormWindowBase.Msg18_EnableShellShutdownHook)); + BLOBREF blobref = blobInfo.Add(messageToHook); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteFormWindowBase.Msg18_EnableShellShutdownHook* shellShutdownHookPtr = (RemoteFormWindowBase.Msg18_EnableShellShutdownHook*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + shellShutdownHookPtr->_priv_size = adjustedTotalSize; + shellShutdownHookPtr->_priv_msgid = 18U; + shellShutdownHookPtr->messageToHook = blobref; + shellShutdownHookPtr->uIdMsg = uIdMsg; + blobInfo.Attach((Message*)shellShutdownHookPtr); + shellShutdownHookPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)shellShutdownHookPtr, ref s_priv_ByteOrder_Msg18_EnableShellShutdownHook, typeof(RemoteFormWindowBase.Msg18_EnableShellShutdownHook), 0, 0); + _priv_pmsgUse = (Message*)shellShutdownHookPtr; + } + + public unsafe void SendEnableShellShutdownHook(string messageToHook, ushort uIdMsg) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEnableShellShutdownHook(out _priv_portUse, out _priv_pmsgUse, messageToHook, uIdMsg); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildUpdateForegroundLockState( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg19_UpdateForegroundLockState); + RemoteFormWindowBase.Msg19_UpdateForegroundLockState* foregroundLockStatePtr = (RemoteFormWindowBase.Msg19_UpdateForegroundLockState*)_priv_portUse.AllocMessageBuffer(size); + foregroundLockStatePtr->_priv_size = size; + foregroundLockStatePtr->_priv_msgid = 19U; + foregroundLockStatePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)foregroundLockStatePtr, ref s_priv_ByteOrder_Msg19_UpdateForegroundLockState, typeof(RemoteFormWindowBase.Msg19_UpdateForegroundLockState), 0, 0); + _priv_pmsgUse = (Message*)foregroundLockStatePtr; + } + + public unsafe void SendUpdateForegroundLockState() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildUpdateForegroundLockState(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void INPROC_BuildSetAppNotifyWindow( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + HWND hwndAppNotify) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg20_SetAppNotifyWindow); + RemoteFormWindowBase.Msg20_SetAppNotifyWindow* setAppNotifyWindowPtr = (RemoteFormWindowBase.Msg20_SetAppNotifyWindow*)_priv_portUse.AllocMessageBuffer(size); + setAppNotifyWindowPtr->_priv_size = size; + setAppNotifyWindowPtr->_priv_msgid = 20U; + setAppNotifyWindowPtr->hwndAppNotify = hwndAppNotify; + setAppNotifyWindowPtr->_priv_idObjectSubject = this.m_renderHandle; + _priv_pmsgUse = (Message*)setAppNotifyWindowPtr; + } + + public unsafe void INPROC_SendSetAppNotifyWindow(HWND hwndAppNotify) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.INPROC_BuildSetAppNotifyWindow(out _priv_portUse, out _priv_pmsgUse, hwndAppNotify); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetHitMasks( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint uMaskTraverse, + uint uMaskHit, + uint uMaskResult, + uint uMaskClip) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg21_SetHitMasks); + RemoteFormWindowBase.Msg21_SetHitMasks* msg21SetHitMasksPtr = (RemoteFormWindowBase.Msg21_SetHitMasks*)_priv_portUse.AllocMessageBuffer(size); + msg21SetHitMasksPtr->_priv_size = size; + msg21SetHitMasksPtr->_priv_msgid = 21U; + msg21SetHitMasksPtr->uMaskTraverse = uMaskTraverse; + msg21SetHitMasksPtr->uMaskHit = uMaskHit; + msg21SetHitMasksPtr->uMaskResult = uMaskResult; + msg21SetHitMasksPtr->uMaskClip = uMaskClip; + msg21SetHitMasksPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg21SetHitMasksPtr, ref s_priv_ByteOrder_Msg21_SetHitMasks, typeof(RemoteFormWindowBase.Msg21_SetHitMasks), 0, 0); + _priv_pmsgUse = (Message*)msg21SetHitMasksPtr; + } + + public unsafe void SendSetHitMasks( + uint uMaskTraverse, + uint uMaskHit, + uint uMaskResult, + uint uMaskClip) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetHitMasks(out _priv_portUse, out _priv_pmsgUse, uMaskTraverse, uMaskHit, uMaskResult, uMaskClip); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetCapture( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteVisual hVisual, + bool fState) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (hVisual != null) + _priv_portUse.ValidateHandleOrNull(hVisual.RenderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg22_SetCapture); + RemoteFormWindowBase.Msg22_SetCapture* msg22SetCapturePtr = (RemoteFormWindowBase.Msg22_SetCapture*)_priv_portUse.AllocMessageBuffer(size); + msg22SetCapturePtr->_priv_size = size; + msg22SetCapturePtr->_priv_msgid = 22U; + msg22SetCapturePtr->hVisual = hVisual != null ? hVisual.RenderHandle : RENDERHANDLE.NULL; + msg22SetCapturePtr->fState = fState ? uint.MaxValue : 0U; + msg22SetCapturePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg22SetCapturePtr, ref s_priv_ByteOrder_Msg22_SetCapture, typeof(RemoteFormWindowBase.Msg22_SetCapture), 0, 0); + _priv_pmsgUse = (Message*)msg22SetCapturePtr; + } + + public unsafe void SendSetCapture(RemoteVisual hVisual, bool fState) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCapture(out _priv_portUse, out _priv_pmsgUse, hVisual, fState); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetText( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string text) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteFormWindowBase.Msg23_SetText)); + BLOBREF blobref = blobInfo.Add(text); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteFormWindowBase.Msg23_SetText* msg23SetTextPtr = (RemoteFormWindowBase.Msg23_SetText*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg23SetTextPtr->_priv_size = adjustedTotalSize; + msg23SetTextPtr->_priv_msgid = 23U; + msg23SetTextPtr->text = blobref; + blobInfo.Attach((Message*)msg23SetTextPtr); + msg23SetTextPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg23SetTextPtr, ref s_priv_ByteOrder_Msg23_SetText, typeof(RemoteFormWindowBase.Msg23_SetText), 0, 0); + _priv_pmsgUse = (Message*)msg23SetTextPtr; + } + + public unsafe void SendSetText(string text) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetText(out _priv_portUse, out _priv_pmsgUse, text); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildDestroy(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg24_Destroy); + RemoteFormWindowBase.Msg24_Destroy* msg24DestroyPtr = (RemoteFormWindowBase.Msg24_Destroy*)_priv_portUse.AllocMessageBuffer(size); + msg24DestroyPtr->_priv_size = size; + msg24DestroyPtr->_priv_msgid = 24U; + msg24DestroyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg24DestroyPtr, ref s_priv_ByteOrder_Msg24_Destroy, typeof(RemoteFormWindowBase.Msg24_Destroy), 0, 0); + _priv_pmsgUse = (Message*)msg24DestroyPtr; + } + + public unsafe void SendDestroy() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildDestroy(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetForeground( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fForce) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg25_SetForeground); + RemoteFormWindowBase.Msg25_SetForeground* msg25SetForegroundPtr = (RemoteFormWindowBase.Msg25_SetForeground*)_priv_portUse.AllocMessageBuffer(size); + msg25SetForegroundPtr->_priv_size = size; + msg25SetForegroundPtr->_priv_msgid = 25U; + msg25SetForegroundPtr->fForce = fForce ? uint.MaxValue : 0U; + msg25SetForegroundPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg25SetForegroundPtr, ref s_priv_ByteOrder_Msg25_SetForeground, typeof(RemoteFormWindowBase.Msg25_SetForeground), 0, 0); + _priv_pmsgUse = (Message*)msg25SetForegroundPtr; + } + + public unsafe void SendSetForeground(bool fForce) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetForeground(out _priv_portUse, out _priv_pmsgUse, fForce); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildTakeFocus(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg26_TakeFocus); + RemoteFormWindowBase.Msg26_TakeFocus* msg26TakeFocusPtr = (RemoteFormWindowBase.Msg26_TakeFocus*)_priv_portUse.AllocMessageBuffer(size); + msg26TakeFocusPtr->_priv_size = size; + msg26TakeFocusPtr->_priv_msgid = 26U; + msg26TakeFocusPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg26TakeFocusPtr, ref s_priv_ByteOrder_Msg26_TakeFocus, typeof(RemoteFormWindowBase.Msg26_TakeFocus), 0, 0); + _priv_pmsgUse = (Message*)msg26TakeFocusPtr; + } + + public unsafe void SendTakeFocus() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildTakeFocus(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildForceMouseIdle( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fIdle) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg27_ForceMouseIdle); + RemoteFormWindowBase.Msg27_ForceMouseIdle* msg27ForceMouseIdlePtr = (RemoteFormWindowBase.Msg27_ForceMouseIdle*)_priv_portUse.AllocMessageBuffer(size); + msg27ForceMouseIdlePtr->_priv_size = size; + msg27ForceMouseIdlePtr->_priv_msgid = 27U; + msg27ForceMouseIdlePtr->fIdle = fIdle ? uint.MaxValue : 0U; + msg27ForceMouseIdlePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg27ForceMouseIdlePtr, ref s_priv_ByteOrder_Msg27_ForceMouseIdle, typeof(RemoteFormWindowBase.Msg27_ForceMouseIdle), 0, 0); + _priv_pmsgUse = (Message*)msg27ForceMouseIdlePtr; + } + + public unsafe void SendForceMouseIdle(bool fIdle) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildForceMouseIdle(out _priv_portUse, out _priv_pmsgUse, fIdle); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildTemporarilyExitExclusiveMode( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode); + RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode* exitExclusiveModePtr = (RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode*)_priv_portUse.AllocMessageBuffer(size); + exitExclusiveModePtr->_priv_size = size; + exitExclusiveModePtr->_priv_msgid = 28U; + exitExclusiveModePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)exitExclusiveModePtr, ref s_priv_ByteOrder_Msg28_TemporarilyExitExclusiveMode, typeof(RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode), 0, 0); + _priv_pmsgUse = (Message*)exitExclusiveModePtr; + } + + public unsafe void SendTemporarilyExitExclusiveMode() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildTemporarilyExitExclusiveMode(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRestore(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg29_Restore); + RemoteFormWindowBase.Msg29_Restore* msg29RestorePtr = (RemoteFormWindowBase.Msg29_Restore*)_priv_portUse.AllocMessageBuffer(size); + msg29RestorePtr->_priv_size = size; + msg29RestorePtr->_priv_msgid = 29U; + msg29RestorePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg29RestorePtr, ref s_priv_ByteOrder_Msg29_Restore, typeof(RemoteFormWindowBase.Msg29_Restore), 0, 0); + _priv_pmsgUse = (Message*)msg29RestorePtr; + } + + public unsafe void SendRestore() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRestore(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetMode( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint uMode) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg30_SetMode); + RemoteFormWindowBase.Msg30_SetMode* msg30SetModePtr = (RemoteFormWindowBase.Msg30_SetMode*)_priv_portUse.AllocMessageBuffer(size); + msg30SetModePtr->_priv_size = size; + msg30SetModePtr->_priv_msgid = 30U; + msg30SetModePtr->uMode = uMode; + msg30SetModePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg30SetModePtr, ref s_priv_ByteOrder_Msg30_SetMode, typeof(RemoteFormWindowBase.Msg30_SetMode), 0, 0); + _priv_pmsgUse = (Message*)msg30SetModePtr; + } + + public unsafe void SendSetMode(uint uMode) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMode(out _priv_portUse, out _priv_pmsgUse, uMode); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVisible( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fVisible) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg31_SetVisible); + RemoteFormWindowBase.Msg31_SetVisible* msg31SetVisiblePtr = (RemoteFormWindowBase.Msg31_SetVisible*)_priv_portUse.AllocMessageBuffer(size); + msg31SetVisiblePtr->_priv_size = size; + msg31SetVisiblePtr->_priv_msgid = 31U; + msg31SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; + msg31SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg31SetVisiblePtr, ref s_priv_ByteOrder_Msg31_SetVisible, typeof(RemoteFormWindowBase.Msg31_SetVisible), 0, 0); + _priv_pmsgUse = (Message*)msg31SetVisiblePtr; + } + + public unsafe void SendSetVisible(bool fVisible) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVisible(out _priv_portUse, out _priv_pmsgUse, fVisible); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetPosition( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Point ptScreenPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg32_SetPosition); + RemoteFormWindowBase.Msg32_SetPosition* msg32SetPositionPtr = (RemoteFormWindowBase.Msg32_SetPosition*)_priv_portUse.AllocMessageBuffer(size); + msg32SetPositionPtr->_priv_size = size; + msg32SetPositionPtr->_priv_msgid = 32U; + msg32SetPositionPtr->ptScreenPxl = ptScreenPxl; + msg32SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg32SetPositionPtr, ref s_priv_ByteOrder_Msg32_SetPosition, typeof(RemoteFormWindowBase.Msg32_SetPosition), 0, 0); + _priv_pmsgUse = (Message*)msg32SetPositionPtr; + } + + public unsafe void SendSetPosition(Point ptScreenPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetPosition(out _priv_portUse, out _priv_pmsgUse, ptScreenPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeClientPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg33_SetSize); + RemoteFormWindowBase.Msg33_SetSize* msg33SetSizePtr = (RemoteFormWindowBase.Msg33_SetSize*)_priv_portUse.AllocMessageBuffer(size); + msg33SetSizePtr->_priv_size = size; + msg33SetSizePtr->_priv_msgid = 33U; + msg33SetSizePtr->sizeClientPxl = sizeClientPxl; + msg33SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg33SetSizePtr, ref s_priv_ByteOrder_Msg33_SetSize, typeof(RemoteFormWindowBase.Msg33_SetSize), 0, 0); + _priv_pmsgUse = (Message*)msg33SetSizePtr; + } + + public unsafe void SendSetSize(Size sizeClientPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetSize(out _priv_portUse, out _priv_pmsgUse, sizeClientPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetCursors( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idCursorNormal, + int idCursorIdle) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg34_SetCursors); + RemoteFormWindowBase.Msg34_SetCursors* msg34SetCursorsPtr = (RemoteFormWindowBase.Msg34_SetCursors*)_priv_portUse.AllocMessageBuffer(size); + msg34SetCursorsPtr->_priv_size = size; + msg34SetCursorsPtr->_priv_msgid = 34U; + msg34SetCursorsPtr->idCursorNormal = idCursorNormal; + msg34SetCursorsPtr->idCursorIdle = idCursorIdle; + msg34SetCursorsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg34SetCursorsPtr, ref s_priv_ByteOrder_Msg34_SetCursors, typeof(RemoteFormWindowBase.Msg34_SetCursors), 0, 0); + _priv_pmsgUse = (Message*)msg34SetCursorsPtr; + } + + public unsafe void SendSetCursors(int idCursorNormal, int idCursorIdle) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCursors(out _priv_portUse, out _priv_pmsgUse, idCursorNormal, idCursorIdle); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetStyles( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint uRst, + uint uRstEx, + uint uMin, + uint uMinEx, + uint uMax, + uint uMaxEx, + uint uFul, + uint uFulEx) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg35_SetStyles); + RemoteFormWindowBase.Msg35_SetStyles* msg35SetStylesPtr = (RemoteFormWindowBase.Msg35_SetStyles*)_priv_portUse.AllocMessageBuffer(size); + msg35SetStylesPtr->_priv_size = size; + msg35SetStylesPtr->_priv_msgid = 35U; + msg35SetStylesPtr->uRst = uRst; + msg35SetStylesPtr->uRstEx = uRstEx; + msg35SetStylesPtr->uMin = uMin; + msg35SetStylesPtr->uMinEx = uMinEx; + msg35SetStylesPtr->uMax = uMax; + msg35SetStylesPtr->uMaxEx = uMaxEx; + msg35SetStylesPtr->uFul = uFul; + msg35SetStylesPtr->uFulEx = uFulEx; + msg35SetStylesPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg35SetStylesPtr, ref s_priv_ByteOrder_Msg35_SetStyles, typeof(RemoteFormWindowBase.Msg35_SetStyles), 0, 0); + _priv_pmsgUse = (Message*)msg35SetStylesPtr; + } + + public unsafe void SendSetStyles( + uint uRst, + uint uRstEx, + uint uMin, + uint uMinEx, + uint uMax, + uint uMaxEx, + uint uFul, + uint uFulEx) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetStyles(out _priv_portUse, out _priv_pmsgUse, uRst, uRstEx, uMin, uMinEx, uMax, uMaxEx, uFul, uFulEx); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetMouseIdleOptions( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size szMouseIdleTolerance, + uint dwMouseIdleTimeout) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg36_SetMouseIdleOptions); + RemoteFormWindowBase.Msg36_SetMouseIdleOptions* mouseIdleOptionsPtr = (RemoteFormWindowBase.Msg36_SetMouseIdleOptions*)_priv_portUse.AllocMessageBuffer(size); + mouseIdleOptionsPtr->_priv_size = size; + mouseIdleOptionsPtr->_priv_msgid = 36U; + mouseIdleOptionsPtr->szMouseIdleTolerance = szMouseIdleTolerance; + mouseIdleOptionsPtr->dwMouseIdleTimeout = dwMouseIdleTimeout; + mouseIdleOptionsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)mouseIdleOptionsPtr, ref s_priv_ByteOrder_Msg36_SetMouseIdleOptions, typeof(RemoteFormWindowBase.Msg36_SetMouseIdleOptions), 0, 0); + _priv_pmsgUse = (Message*)mouseIdleOptionsPtr; + } + + public unsafe void SendSetMouseIdleOptions(Size szMouseIdleTolerance, uint dwMouseIdleTimeout) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMouseIdleOptions(out _priv_portUse, out _priv_pmsgUse, szMouseIdleTolerance, dwMouseIdleTimeout); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetOptions( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint uOptionsMask, + uint uOptionsValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg37_SetOptions); + RemoteFormWindowBase.Msg37_SetOptions* msg37SetOptionsPtr = (RemoteFormWindowBase.Msg37_SetOptions*)_priv_portUse.AllocMessageBuffer(size); + msg37SetOptionsPtr->_priv_size = size; + msg37SetOptionsPtr->_priv_msgid = 37U; + msg37SetOptionsPtr->uOptionsMask = uOptionsMask; + msg37SetOptionsPtr->uOptionsValue = uOptionsValue; + msg37SetOptionsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg37SetOptionsPtr, ref s_priv_ByteOrder_Msg37_SetOptions, typeof(RemoteFormWindowBase.Msg37_SetOptions), 0, 0); + _priv_pmsgUse = (Message*)msg37SetOptionsPtr; + } + + public unsafe void SendSetOptions(uint uOptionsMask, uint uOptionsValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetOptions(out _priv_portUse, out _priv_pmsgUse, uOptionsMask, uOptionsValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateRootContainer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteFormWindowBase.Msg38_CreateRootContainer); + RemoteFormWindowBase.Msg38_CreateRootContainer* createRootContainerPtr = (RemoteFormWindowBase.Msg38_CreateRootContainer*)_priv_portUse.AllocMessageBuffer(size); + createRootContainerPtr->_priv_size = size; + createRootContainerPtr->_priv_msgid = 38U; + createRootContainerPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createRootContainerPtr, ref s_priv_ByteOrder_Msg38_CreateRootContainer, typeof(RemoteFormWindowBase.Msg38_CreateRootContainer), 0, 0); + _priv_pmsgUse = (Message*)createRootContainerPtr; + } + + public unsafe void SendCreateRootContainer() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateRootContainer(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteFormWindowBase CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteFormWindowBase(port, handle, true); + } + + public static RemoteFormWindowBase CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteFormWindowBase(port, handle, false); + } + + protected RemoteFormWindowBase(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteFormWindowBase(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteFormWindowBase && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg7_SetEdgeImageParts + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fActiveEdges; + public BLOBREF sModuleName; + public BLOBREF sResourceIdLeft; + public BLOBREF sResourceIdTop; + public BLOBREF sResourceIdRight; + public BLOBREF sResourceIdBottom; + public Inset insetSplits; + } + + [ComVisible(false)] + private struct Msg8_SetInitialPlacement + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nShowState; + public Rectangle rcNormalPosition; + public Point ptMaxPosition; + } + + [ComVisible(false)] + private struct Msg9_RefreshHitTarget + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg10_ExitInternalDrag + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg11_EnterInternalDrag + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg12_SetDragDropResult + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nDragOverResult; + public uint nDragDropResult; + } + + [ComVisible(false)] + private struct Msg13_EnableExternalDragDrop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fEnable; + } + + [ComVisible(false)] + private struct Msg14_SetIcon + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF sModule; + public uint nResourceID; + public uint nOptions; + } + + [ComVisible(false)] + private struct Msg15_SetMaxResizeWidth + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nMaxResizeWidth; + } + + [ComVisible(false)] + private struct Msg16_SetMinResizeWidth + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nMinResizeWidth; + } + + [ComVisible(false)] + private struct Msg17_BringToTop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg18_EnableShellShutdownHook + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF messageToHook; + public ushort uIdMsg; + } + + [ComVisible(false)] + private struct Msg19_UpdateForegroundLockState + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg20_SetAppNotifyWindow + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public HWND hwndAppNotify; + } + + [ComVisible(false)] + private struct Msg21_SetHitMasks + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint uMaskTraverse; + public uint uMaskHit; + public uint uMaskResult; + public uint uMaskClip; + } + + [ComVisible(false)] + private struct Msg22_SetCapture + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE hVisual; + public uint fState; + } + + [ComVisible(false)] + private struct Msg23_SetText + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF text; + } + + [ComVisible(false)] + private struct Msg24_Destroy + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg25_SetForeground + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fForce; + } + + [ComVisible(false)] + private struct Msg26_TakeFocus + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg27_ForceMouseIdle + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fIdle; + } + + [ComVisible(false)] + private struct Msg28_TemporarilyExitExclusiveMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg29_Restore + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg30_SetMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint uMode; + } + + [ComVisible(false)] + private struct Msg31_SetVisible + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fVisible; + } + + [ComVisible(false)] + private struct Msg32_SetPosition + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Point ptScreenPxl; + } + + [ComVisible(false)] + private struct Msg33_SetSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeClientPxl; + } + + [ComVisible(false)] + private struct Msg34_SetCursors + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idCursorNormal; + public int idCursorIdle; + } + + [ComVisible(false)] + private struct Msg35_SetStyles + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint uRst; + public uint uRstEx; + public uint uMin; + public uint uMinEx; + public uint uMax; + public uint uMaxEx; + public uint uFul; + public uint uFulEx; + } + + [ComVisible(false)] + private struct Msg36_SetMouseIdleOptions + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size szMouseIdleTolerance; + public uint dwMouseIdleTimeout; + } + + [ComVisible(false)] + private struct Msg37_SetOptions + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint uOptionsMask; + public uint uOptionsValue; + } + + [ComVisible(false)] + private struct Msg38_CreateRootContainer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs new file mode 100644 index 0000000..7d79cf6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs @@ -0,0 +1,158 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.RemoteInputRouter +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop +{ + internal class RemoteInputRouter : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg2_Create; + private static ushort[] s_priv_ByteOrder_Msg0_UnRegisterWithInputSource; + private static ushort[] s_priv_ByteOrder_Msg1_RegisterWithInputSource; + + protected RemoteInputRouter() + { + } + + public static unsafe RemoteInputRouter Create( + ProtocolSplashDesktop _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalInputCallback ic) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE routerClassHandle = _priv_protocolInstance.InputRouter_ClassHandle; + RemoteInputRouter remoteInputRouter = new RemoteInputRouter(port, _priv_owner); + uint num = (uint)sizeof(RemoteInputRouter.Msg2_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteInputRouter.Msg2_Create* msg2CreatePtr = (RemoteInputRouter.Msg2_Create*)pMem; + msg2CreatePtr->_priv_size = num; + msg2CreatePtr->_priv_msgid = 2U; + msg2CreatePtr->_priv_objic = ic.RenderHandle; + msg2CreatePtr->_priv_ctxic = port.Session.LocalContext; + msg2CreatePtr->_priv_idObjectSubject = remoteInputRouter.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteInputRouter.Msg2_Create), 0, 0); + port.CreateRemoteObject(routerClassHandle, remoteInputRouter.m_renderHandle, (Message*)msg2CreatePtr); + return remoteInputRouter; + } + + public unsafe void BuildUnRegisterWithInputSource( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteInputRouter.Msg0_UnRegisterWithInputSource); + RemoteInputRouter.Msg0_UnRegisterWithInputSource* registerWithInputSourcePtr = (RemoteInputRouter.Msg0_UnRegisterWithInputSource*)_priv_portUse.AllocMessageBuffer(size); + registerWithInputSourcePtr->_priv_size = size; + registerWithInputSourcePtr->_priv_msgid = 0U; + registerWithInputSourcePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref s_priv_ByteOrder_Msg0_UnRegisterWithInputSource, typeof(RemoteInputRouter.Msg0_UnRegisterWithInputSource), 0, 0); + _priv_pmsgUse = (Message*)registerWithInputSourcePtr; + } + + public unsafe void SendUnRegisterWithInputSource() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildUnRegisterWithInputSource(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRegisterWithInputSource( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idGroup, + RENDERHANDLE idSource) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteInputRouter.Msg1_RegisterWithInputSource); + RemoteInputRouter.Msg1_RegisterWithInputSource* registerWithInputSourcePtr = (RemoteInputRouter.Msg1_RegisterWithInputSource*)_priv_portUse.AllocMessageBuffer(size); + registerWithInputSourcePtr->_priv_size = size; + registerWithInputSourcePtr->_priv_msgid = 1U; + registerWithInputSourcePtr->idGroup = idGroup; + registerWithInputSourcePtr->idSource = idSource; + registerWithInputSourcePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref s_priv_ByteOrder_Msg1_RegisterWithInputSource, typeof(RemoteInputRouter.Msg1_RegisterWithInputSource), 0, 0); + _priv_pmsgUse = (Message*)registerWithInputSourcePtr; + } + + public unsafe void SendRegisterWithInputSource(uint idGroup, RENDERHANDLE idSource) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRegisterWithInputSource(out _priv_portUse, out _priv_pmsgUse, idGroup, idSource); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteInputRouter CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteInputRouter(port, handle, true); + } + + public static RemoteInputRouter CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteInputRouter(port, handle, false); + } + + protected RemoteInputRouter(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteInputRouter(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteInputRouter && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg2_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objic; + public ContextID _priv_ctxic; + } + + [ComVisible(false)] + private struct Msg0_UnRegisterWithInputSource + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_RegisterWithInputSource + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idGroup; + public RENDERHANDLE idSource; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs new file mode 100644 index 0000000..fe675b1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs @@ -0,0 +1,48 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon.ProtocolSplashDesktopXenon +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon +{ + internal sealed class ProtocolSplashDesktopXenon : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_FormWindow; + + public static ProtocolSplashDesktopXenon Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Desktop::Xenon"); + if (protocolInstance != null) + { + ProtocolSplashDesktopXenon splashDesktopXenon = protocolInstance as ProtocolSplashDesktopXenon; + Debug2.Validate(splashDesktopXenon != null, typeof(InvalidOperationException), "protocol name collision"); + return splashDesktopXenon; + } + ProtocolSplashDesktopXenon splashDesktopXenon1 = new ProtocolSplashDesktopXenon(port); + port.BindProtocol(splashDesktopXenon1); + return splashDesktopXenon1; + } + + private ProtocolSplashDesktopXenon(RenderPort port) + : base(port, "Splash::Desktop::Xenon") + { + } + + protected override void Init() => this._priv_remoteClass_FormWindow = this.Port.InitRemoteClass("Splash::Desktop::Xenon::FormWindow"); + + internal RENDERHANDLE FormWindow_ClassHandle => this._priv_remoteClass_FormWindow; + + internal RemoteFormWindow BuildRemoteFormWindow( + IRenderHandleOwner _priv_owner, + LocalFormWindowCallback cb) + { + return RemoteFormWindow.Create(this, _priv_owner, cb); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs new file mode 100644 index 0000000..57d57fa --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs @@ -0,0 +1,83 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon.RemoteFormWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon +{ + internal class RemoteFormWindow : RemoteFormWindowBase + { + private static ushort[] s_priv_ByteOrder_Msg41_Create; + + protected RemoteFormWindow() + { + } + + public static unsafe RemoteFormWindow Create( + ProtocolSplashDesktopXenon _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalFormWindowCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE windowClassHandle = _priv_protocolInstance.FormWindow_ClassHandle; + RemoteFormWindow remoteFormWindow = new RemoteFormWindow(port, _priv_owner); + uint num = (uint)sizeof(RemoteFormWindow.Msg41_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteFormWindow.Msg41_Create* msg41CreatePtr = (RemoteFormWindow.Msg41_Create*)pMem; + msg41CreatePtr->_priv_size = num; + msg41CreatePtr->_priv_msgid = 41U; + msg41CreatePtr->_priv_objcb = cb.RenderHandle; + msg41CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg41CreatePtr->_priv_idObjectSubject = remoteFormWindow.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); + port.CreateRemoteObject(windowClassHandle, remoteFormWindow.m_renderHandle, (Message*)msg41CreatePtr); + return remoteFormWindow; + } + + public static RemoteFormWindow CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteFormWindow(port, handle, true); + } + + public static RemoteFormWindow CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteFormWindow(port, handle, false); + } + + protected RemoteFormWindow(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteFormWindow(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteFormWindow && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg41_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IDataBufferCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IDataBufferCallback.cs new file mode 100644 index 0000000..aba243f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IDataBufferCallback.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.IDataBufferCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal interface IDataBufferCallback + { + void OnComplete(RENDERHANDLE target); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IRenderPortCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IRenderPortCallback.cs new file mode 100644 index 0000000..277a536 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/IRenderPortCallback.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.IRenderPortCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal interface IRenderPortCallback + { + void OnBatchProcessed(RENDERHANDLE target, uint uBatchCompleted); + + void OnPingReply(RENDERHANDLE target); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs new file mode 100644 index 0000000..fbcdd9e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs @@ -0,0 +1,74 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.LocalDataBufferCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class LocalDataBufferCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnComplete; + + protected LocalDataBufferCallback() + { + } + + internal static LocalDataBufferCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalDataBufferCallback(port, callbackInstance); + } + + protected LocalDataBufferCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalDataBufferCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IDataBufferCallback _priv_target) || message->nMsg != 0U) + return; + Dispatch_OnComplete(port, _priv_target, (LocalDataBufferCallback.Msg0_OnComplete*)message); + } + + private static unsafe void Dispatch_OnComplete( + RenderPort _priv_port, + IDataBufferCallback _priv_target, + LocalDataBufferCallback.Msg0_OnComplete* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnComplete, typeof(LocalDataBufferCallback.Msg0_OnComplete), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnComplete(target); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnComplete + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs new file mode 100644 index 0000000..3e5bf1a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs @@ -0,0 +1,145 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.LocalRenderPortCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class LocalRenderPortCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnBatchProcessed; + private static ushort[] s_priv_ByteOrder_Msg1_OnPingReply; + + protected LocalRenderPortCallback() + { + } + + public static unsafe void AutoSendOnBatchProcessed( + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE target, + uint uBatchCompleted) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance; + uint num = (uint)sizeof(LocalRenderPortCallback.Msg0_OnBatchProcessed); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + LocalRenderPortCallback.Msg0_OnBatchProcessed* onBatchProcessedPtr = (LocalRenderPortCallback.Msg0_OnBatchProcessed*)pMem; + onBatchProcessedPtr->_priv_size = num; + onBatchProcessedPtr->_priv_msgid = 0U; + onBatchProcessedPtr->target = target; + onBatchProcessedPtr->uBatchCompleted = uBatchCompleted; + onBatchProcessedPtr->_priv_idObjectSubject = callbackInstance; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), 0, 0); + port.SendLocalCallbackMessage((Message*)onBatchProcessedPtr); + } + + public static unsafe void AutoSendOnPingReply( + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE target) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance; + uint num = (uint)sizeof(LocalRenderPortCallback.Msg1_OnPingReply); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + LocalRenderPortCallback.Msg1_OnPingReply* msg1OnPingReplyPtr = (LocalRenderPortCallback.Msg1_OnPingReply*)pMem; + msg1OnPingReplyPtr->_priv_size = num; + msg1OnPingReplyPtr->_priv_msgid = 1U; + msg1OnPingReplyPtr->target = target; + msg1OnPingReplyPtr->_priv_idObjectSubject = callbackInstance; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), 0, 0); + port.SendLocalCallbackMessage((Message*)msg1OnPingReplyPtr); + } + + internal static LocalRenderPortCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalRenderPortCallback(port, callbackInstance); + } + + protected LocalRenderPortCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalRenderPortCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IRenderPortCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnBatchProcessed(port, _priv_target, (LocalRenderPortCallback.Msg0_OnBatchProcessed*)message); + break; + case 1: + Dispatch_OnPingReply(port, _priv_target, (LocalRenderPortCallback.Msg1_OnPingReply*)message); + break; + } + } + + private static unsafe void Dispatch_OnBatchProcessed( + RenderPort _priv_port, + IRenderPortCallback _priv_target, + LocalRenderPortCallback.Msg0_OnBatchProcessed* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint uBatchCompleted = _priv_pmsg->uBatchCompleted; + _priv_target.OnBatchProcessed(target, uBatchCompleted); + } + + private static unsafe void Dispatch_OnPingReply( + RenderPort _priv_port, + IRenderPortCallback _priv_target, + LocalRenderPortCallback.Msg1_OnPingReply* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnPingReply(target); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnBatchProcessed + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint uBatchCompleted; + } + + [ComVisible(false)] + private struct Msg1_OnPingReply + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs new file mode 100644 index 0000000..86541ba --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.ProtocolSplashMessaging +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal sealed class ProtocolSplashMessaging : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_Broker; + private RENDERHANDLE _priv_remoteClass_Context; + private RENDERHANDLE _priv_remoteClass_DataBuffer; + private RENDERHANDLE _priv_remoteClass_ContextRelay; + private RENDERHANDLE _priv_callbackInstance_RenderPortCallback; + private RENDERHANDLE _priv_callbackInstance_DataBufferCallback; + + public static ProtocolSplashMessaging Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Messaging"); + if (protocolInstance != null) + { + ProtocolSplashMessaging protocolSplashMessaging = protocolInstance as ProtocolSplashMessaging; + Debug2.Validate(protocolSplashMessaging != null, typeof(InvalidOperationException), "protocol name collision"); + return protocolSplashMessaging; + } + ProtocolSplashMessaging protocolSplashMessaging1 = new ProtocolSplashMessaging(port); + port.BindProtocol(protocolSplashMessaging1); + return protocolSplashMessaging1; + } + + public LocalRenderPortCallback LocalRenderPortCallbackHandle => LocalRenderPortCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_RenderPortCallback); + + public LocalDataBufferCallback LocalDataBufferCallbackHandle => LocalDataBufferCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_DataBufferCallback); + + private ProtocolSplashMessaging(RenderPort port) + : base(port, "Splash::Messaging") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_Broker = port.InitRemoteClass("Splash::Messaging::Broker"); + this._priv_remoteClass_Context = port.InitRemoteClass("Splash::Messaging::Context"); + this._priv_remoteClass_DataBuffer = port.InitRemoteClass("Splash::Messaging::DataBuffer"); + this._priv_remoteClass_ContextRelay = port.InitRemoteClass("Splash::Messaging::ContextRelay"); + this._priv_callbackInstance_RenderPortCallback = LocalRenderPortCallback.BindCallback(port); + this._priv_callbackInstance_DataBufferCallback = LocalDataBufferCallback.BindCallback(port); + } + + internal RENDERHANDLE Broker_ClassHandle => this._priv_remoteClass_Broker; + + internal RENDERHANDLE Context_ClassHandle => this._priv_remoteClass_Context; + + internal RENDERHANDLE DataBuffer_ClassHandle => this._priv_remoteClass_DataBuffer; + + internal RENDERHANDLE ContextRelay_ClassHandle => this._priv_remoteClass_ContextRelay; + + internal RENDERHANDLE RenderPortCallback_CallbackInstance => this._priv_callbackInstance_RenderPortCallback; + + internal RENDERHANDLE DataBufferCallback_CallbackInstance => this._priv_callbackInstance_DataBufferCallback; + + internal RemoteContextRelay BuildRemoteContextRelay( + IRenderHandleOwner _priv_owner, + TransportProtocol protocol, + string stServer, + string stSession) + { + return RemoteContextRelay.Create(this, _priv_owner, protocol, stServer, stSession); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs new file mode 100644 index 0000000..217bb95 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs @@ -0,0 +1,185 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteBroker +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class RemoteBroker : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_DestroyObject; + private static ushort[] s_priv_ByteOrder_Msg1_CreateObject; + private static ushort[] s_priv_ByteOrder_Msg2_CreateClass; + + protected RemoteBroker() + { + } + + public static unsafe void BuildDestroyObject( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE idObject) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle; + _priv_portUse.ValidateHandle(brokerClassHandle); + uint size = (uint)sizeof(RemoteBroker.Msg0_DestroyObject); + RemoteBroker.Msg0_DestroyObject* msg0DestroyObjectPtr = (RemoteBroker.Msg0_DestroyObject*)_priv_portUse.AllocMessageBuffer(size); + msg0DestroyObjectPtr->_priv_size = size; + msg0DestroyObjectPtr->_priv_msgid = 0U; + msg0DestroyObjectPtr->idObject = idObject; + msg0DestroyObjectPtr->_priv_idObjectSubject = brokerClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0DestroyObjectPtr, ref s_priv_ByteOrder_Msg0_DestroyObject, typeof(RemoteBroker.Msg0_DestroyObject), 0, 0); + _priv_pmsgUse = (Message*)msg0DestroyObjectPtr; + } + + public static unsafe void SendDestroyObject( + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE idObject) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildDestroyObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObject); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildCreateObject( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE idObjectClass, + RENDERHANDLE idObjectNew, + Message* msgConstruction) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle; + _priv_portUse.ValidateHandle(brokerClassHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteBroker.Msg1_CreateObject)); + BLOBREF blobref = blobInfo.Add(msgConstruction); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteBroker.Msg1_CreateObject* msg1CreateObjectPtr = (RemoteBroker.Msg1_CreateObject*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg1CreateObjectPtr->_priv_size = adjustedTotalSize; + msg1CreateObjectPtr->_priv_msgid = 1U; + msg1CreateObjectPtr->idObjectClass = idObjectClass; + msg1CreateObjectPtr->idObjectNew = idObjectNew; + msg1CreateObjectPtr->msgConstruction = blobref; + blobInfo.Attach((Message*)msg1CreateObjectPtr); + msg1CreateObjectPtr->_priv_idObjectSubject = brokerClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1CreateObjectPtr, ref s_priv_ByteOrder_Msg1_CreateObject, typeof(RemoteBroker.Msg1_CreateObject), 0, 0); + _priv_pmsgUse = (Message*)msg1CreateObjectPtr; + } + + public static unsafe void SendCreateObject( + ProtocolSplashMessaging _priv_protocolInstance, + RENDERHANDLE idObjectClass, + RENDERHANDLE idObjectNew, + Message* msgConstruction) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCreateObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObjectClass, idObjectNew, msgConstruction); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildCreateClass( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + string stClassName, + RENDERHANDLE idObjectClass) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle; + _priv_portUse.ValidateHandle(brokerClassHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteBroker.Msg2_CreateClass)); + BLOBREF blobref = blobInfo.Add(stClassName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteBroker.Msg2_CreateClass* msg2CreateClassPtr = (RemoteBroker.Msg2_CreateClass*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg2CreateClassPtr->_priv_size = adjustedTotalSize; + msg2CreateClassPtr->_priv_msgid = 2U; + msg2CreateClassPtr->stClassName = blobref; + msg2CreateClassPtr->idObjectClass = idObjectClass; + blobInfo.Attach((Message*)msg2CreateClassPtr); + msg2CreateClassPtr->_priv_idObjectSubject = brokerClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2CreateClassPtr, ref s_priv_ByteOrder_Msg2_CreateClass, typeof(RemoteBroker.Msg2_CreateClass), 0, 0); + _priv_pmsgUse = (Message*)msg2CreateClassPtr; + } + + public static unsafe void SendCreateClass( + ProtocolSplashMessaging _priv_protocolInstance, + string stClassName, + RENDERHANDLE idObjectClass) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCreateClass(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, stClassName, idObjectClass); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteBroker CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteBroker(port, handle, true); + + public static RemoteBroker CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteBroker(port, handle, false); + } + + protected RemoteBroker(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteBroker(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteBroker && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_DestroyObject + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idObject; + } + + [ComVisible(false)] + private struct Msg1_CreateObject + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idObjectClass; + public RENDERHANDLE idObjectNew; + public BLOBREF msgConstruction; + } + + [ComVisible(false)] + private struct Msg2_CreateClass + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stClassName; + public RENDERHANDLE idObjectClass; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs new file mode 100644 index 0000000..3684d02 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs @@ -0,0 +1,220 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteContext +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class RemoteContext : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_ReleaseObject; + private static ushort[] s_priv_ByteOrder_Msg2_ForwardMessage; + private static ushort[] s_priv_ByteOrder_Msg3_DestroyGroup; + private static ushort[] s_priv_ByteOrder_Msg4_CreateGroup; + + protected RemoteContext() + { + } + + public static unsafe void BuildReleaseObject( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + IntPtr punkObj) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle; + _priv_portUse.ValidateHandle(contextClassHandle); + uint size = (uint)sizeof(RemoteContext.Msg0_ReleaseObject); + RemoteContext.Msg0_ReleaseObject* msg0ReleaseObjectPtr = (RemoteContext.Msg0_ReleaseObject*)_priv_portUse.AllocMessageBuffer(size); + msg0ReleaseObjectPtr->_priv_size = size; + msg0ReleaseObjectPtr->_priv_msgid = 0U; + msg0ReleaseObjectPtr->punkObj = punkObj; + msg0ReleaseObjectPtr->_priv_idObjectSubject = contextClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0ReleaseObjectPtr, ref s_priv_ByteOrder_Msg0_ReleaseObject, typeof(RemoteContext.Msg0_ReleaseObject), 0, 0); + _priv_pmsgUse = (Message*)msg0ReleaseObjectPtr; + } + + public static unsafe void SendReleaseObject( + ProtocolSplashMessaging _priv_protocolInstance, + IntPtr punkObj) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildReleaseObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, punkObj); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildForwardMessage( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextDest, + Message* msgReturn) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle; + _priv_portUse.ValidateHandle(contextClassHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteContext.Msg2_ForwardMessage)); + BLOBREF blobref = blobInfo.Add(msgReturn); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteContext.Msg2_ForwardMessage* msg2ForwardMessagePtr = (RemoteContext.Msg2_ForwardMessage*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg2ForwardMessagePtr->_priv_size = adjustedTotalSize; + msg2ForwardMessagePtr->_priv_msgid = 2U; + msg2ForwardMessagePtr->idContextDest = idContextDest; + msg2ForwardMessagePtr->msgReturn = blobref; + blobInfo.Attach((Message*)msg2ForwardMessagePtr); + msg2ForwardMessagePtr->_priv_idObjectSubject = contextClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2ForwardMessagePtr, ref s_priv_ByteOrder_Msg2_ForwardMessage, typeof(RemoteContext.Msg2_ForwardMessage), 0, 0); + _priv_pmsgUse = (Message*)msg2ForwardMessagePtr; + } + + public static unsafe void SendForwardMessage( + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextDest, + Message* msgReturn) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildForwardMessage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextDest, msgReturn); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildDestroyGroup( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + int idxGroup) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle; + _priv_portUse.ValidateHandle(contextClassHandle); + uint size = (uint)sizeof(RemoteContext.Msg3_DestroyGroup); + RemoteContext.Msg3_DestroyGroup* msg3DestroyGroupPtr = (RemoteContext.Msg3_DestroyGroup*)_priv_portUse.AllocMessageBuffer(size); + msg3DestroyGroupPtr->_priv_size = size; + msg3DestroyGroupPtr->_priv_msgid = 3U; + msg3DestroyGroupPtr->idxGroup = idxGroup; + msg3DestroyGroupPtr->_priv_idObjectSubject = contextClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3DestroyGroupPtr, ref s_priv_ByteOrder_Msg3_DestroyGroup, typeof(RemoteContext.Msg3_DestroyGroup), 0, 0); + _priv_pmsgUse = (Message*)msg3DestroyGroupPtr; + } + + public static unsafe void SendDestroyGroup( + ProtocolSplashMessaging _priv_protocolInstance, + int idxGroup) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildDestroyGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildCreateGroup( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + int idxGroup, + ContextID idContextOwner) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle; + _priv_portUse.ValidateHandle(contextClassHandle); + uint size = (uint)sizeof(RemoteContext.Msg4_CreateGroup); + RemoteContext.Msg4_CreateGroup* msg4CreateGroupPtr = (RemoteContext.Msg4_CreateGroup*)_priv_portUse.AllocMessageBuffer(size); + msg4CreateGroupPtr->_priv_size = size; + msg4CreateGroupPtr->_priv_msgid = 4U; + msg4CreateGroupPtr->idxGroup = idxGroup; + msg4CreateGroupPtr->idContextOwner = idContextOwner; + msg4CreateGroupPtr->_priv_idObjectSubject = contextClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4CreateGroupPtr, ref s_priv_ByteOrder_Msg4_CreateGroup, typeof(RemoteContext.Msg4_CreateGroup), 0, 0); + _priv_pmsgUse = (Message*)msg4CreateGroupPtr; + } + + public static unsafe void SendCreateGroup( + ProtocolSplashMessaging _priv_protocolInstance, + int idxGroup, + ContextID idContextOwner) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCreateGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup, idContextOwner); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteContext CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteContext(port, handle, true); + + public static RemoteContext CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteContext(port, handle, false); + } + + protected RemoteContext(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteContext(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteContext && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_ReleaseObject + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public IntPtr punkObj; + } + + [ComVisible(false)] + private struct Msg2_ForwardMessage + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ContextID idContextDest; + public BLOBREF msgReturn; + } + + [ComVisible(false)] + private struct Msg3_DestroyGroup + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxGroup; + } + + [ComVisible(false)] + private struct Msg4_CreateGroup + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxGroup; + public ContextID idContextOwner; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs new file mode 100644 index 0000000..84ec013 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs @@ -0,0 +1,181 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteContextRelay +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class RemoteContextRelay : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg2_Create; + private static ushort[] s_priv_ByteOrder_Msg0_UnlinkContext; + private static ushort[] s_priv_ByteOrder_Msg1_LinkContext; + + protected RemoteContextRelay() + { + } + + public static unsafe RemoteContextRelay Create( + ProtocolSplashMessaging _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + TransportProtocol protocol, + string stServer, + string stSession) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle; + RemoteContextRelay remoteContextRelay = new RemoteContextRelay(port, _priv_owner); + BlobInfo blobInfo = new BlobInfo(port, (uint)sizeof(RemoteContextRelay.Msg2_Create)); + BLOBREF blobref1 = blobInfo.Add(stServer); + BLOBREF blobref2 = blobInfo.Add(stSession); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)adjustedTotalSize]; + RemoteContextRelay.Msg2_Create* msg2CreatePtr = (RemoteContextRelay.Msg2_Create*)pMem; + msg2CreatePtr->_priv_size = adjustedTotalSize; + msg2CreatePtr->_priv_msgid = 2U; + msg2CreatePtr->protocol = protocol; + msg2CreatePtr->stServer = blobref1; + msg2CreatePtr->stSession = blobref2; + blobInfo.Attach((Message*)msg2CreatePtr); + msg2CreatePtr->_priv_idObjectSubject = remoteContextRelay.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteContextRelay.Msg2_Create), 0, 0); + port.CreateRemoteObject(relayClassHandle, remoteContextRelay.m_renderHandle, (Message*)msg2CreatePtr); + return remoteContextRelay; + } + + public static unsafe void BuildUnlinkContext( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextExisting, + ContextID idContextAlias) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle; + _priv_portUse.ValidateHandle(relayClassHandle); + uint size = (uint)sizeof(RemoteContextRelay.Msg0_UnlinkContext); + RemoteContextRelay.Msg0_UnlinkContext* msg0UnlinkContextPtr = (RemoteContextRelay.Msg0_UnlinkContext*)_priv_portUse.AllocMessageBuffer(size); + msg0UnlinkContextPtr->_priv_size = size; + msg0UnlinkContextPtr->_priv_msgid = 0U; + msg0UnlinkContextPtr->idContextExisting = idContextExisting; + msg0UnlinkContextPtr->idContextAlias = idContextAlias; + msg0UnlinkContextPtr->_priv_idObjectSubject = relayClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0UnlinkContextPtr, ref s_priv_ByteOrder_Msg0_UnlinkContext, typeof(RemoteContextRelay.Msg0_UnlinkContext), 0, 0); + _priv_pmsgUse = (Message*)msg0UnlinkContextPtr; + } + + public static unsafe void SendUnlinkContext( + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextExisting, + ContextID idContextAlias) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildUnlinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildLinkContext( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextExisting, + ContextID idContextAlias) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle; + _priv_portUse.ValidateHandle(relayClassHandle); + uint size = (uint)sizeof(RemoteContextRelay.Msg1_LinkContext); + RemoteContextRelay.Msg1_LinkContext* msg1LinkContextPtr = (RemoteContextRelay.Msg1_LinkContext*)_priv_portUse.AllocMessageBuffer(size); + msg1LinkContextPtr->_priv_size = size; + msg1LinkContextPtr->_priv_msgid = 1U; + msg1LinkContextPtr->idContextExisting = idContextExisting; + msg1LinkContextPtr->idContextAlias = idContextAlias; + msg1LinkContextPtr->_priv_idObjectSubject = relayClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1LinkContextPtr, ref s_priv_ByteOrder_Msg1_LinkContext, typeof(RemoteContextRelay.Msg1_LinkContext), 0, 0); + _priv_pmsgUse = (Message*)msg1LinkContextPtr; + } + + public static unsafe void SendLinkContext( + ProtocolSplashMessaging _priv_protocolInstance, + ContextID idContextExisting, + ContextID idContextAlias) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildLinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteContextRelay CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteContextRelay(port, handle, true); + } + + public static RemoteContextRelay CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteContextRelay(port, handle, false); + } + + protected RemoteContextRelay(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteContextRelay(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteContextRelay && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg2_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public TransportProtocol protocol; + public BLOBREF stServer; + public BLOBREF stSession; + } + + [ComVisible(false)] + private struct Msg0_UnlinkContext + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ContextID idContextExisting; + public ContextID idContextAlias; + } + + [ComVisible(false)] + private struct Msg1_LinkContext + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ContextID idContextExisting; + public ContextID idContextAlias; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs new file mode 100644 index 0000000..c3dc6db --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs @@ -0,0 +1,89 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteDataBuffer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Messaging +{ + internal class RemoteDataBuffer : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_RegisterOwner; + + protected RemoteDataBuffer() + { + } + + public unsafe void BuildRegisterOwner( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + LocalDataBufferCallback cb) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDataBuffer.Msg0_RegisterOwner); + RemoteDataBuffer.Msg0_RegisterOwner* msg0RegisterOwnerPtr = (RemoteDataBuffer.Msg0_RegisterOwner*)_priv_portUse.AllocMessageBuffer(size); + msg0RegisterOwnerPtr->_priv_size = size; + msg0RegisterOwnerPtr->_priv_msgid = 0U; + msg0RegisterOwnerPtr->_priv_objcb = cb.RenderHandle; + msg0RegisterOwnerPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext; + msg0RegisterOwnerPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0RegisterOwnerPtr, ref s_priv_ByteOrder_Msg0_RegisterOwner, typeof(RemoteDataBuffer.Msg0_RegisterOwner), 0, 0); + _priv_pmsgUse = (Message*)msg0RegisterOwnerPtr; + } + + public unsafe void SendRegisterOwner(LocalDataBufferCallback cb) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRegisterOwner(out _priv_portUse, out _priv_pmsgUse, cb); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDataBuffer CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDataBuffer(port, handle, true); + } + + public static RemoteDataBuffer CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDataBuffer(port, handle, false); + } + + protected RemoteDataBuffer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDataBuffer(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDataBuffer && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_RegisterOwner + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IAnimationCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IAnimationCallback.cs new file mode 100644 index 0000000..fc4b4eb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IAnimationCallback.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.IAnimationCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal interface IAnimationCallback + { + void AsyncNotify(RENDERHANDLE target, int nCookie); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IDeviceCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IDeviceCallback.cs new file mode 100644 index 0000000..3afa41f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IDeviceCallback.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.IDeviceCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal interface IDeviceCallback + { + void OnBackBufferCaptured(RENDERHANDLE target); + + void OnSurfacePoolAllocation( + RENDERHANDLE target, + RENDERHANDLE idSurfacePool, + SurfacePoolAllocationResult nResult); + + void OnVsaBlock(RENDERHANDLE target, bool fInBlock); + + void OnLostDevice(RENDERHANDLE target, uint cRenderGeneration, bool fLost); + + void OnCreated(RENDERHANDLE target, bool fAllowDynamicPool); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IRenderCapsCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IRenderCapsCallback.cs new file mode 100644 index 0000000..ef0f7f7 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IRenderCapsCallback.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.IRenderCapsCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal interface IRenderCapsCallback + { + void OnSoundCaps(RENDERHANDLE target, uint nCookie, Microsoft.Iris.Render.Internal.SoundCaps capsInfo); + + void OnGraphicsCaps(RENDERHANDLE target, uint nCookie, GraphicsCaps capsInfo); + + void OnEndCapsCheck(RENDERHANDLE target, uint nCookie); + + void OnBeginCapsCheck(RENDERHANDLE target, uint nCookie); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ISoundBufferCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ISoundBufferCallback.cs new file mode 100644 index 0000000..c3213ac --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ISoundBufferCallback.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.ISoundBufferCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal interface ISoundBufferCallback + { + void OnSoundBufferReady(RENDERHANDLE idTarget); + + void OnSoundBufferLost(RENDERHANDLE idTarget); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IVideoPoolCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IVideoPoolCallback.cs new file mode 100644 index 0000000..1738896 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/IVideoPoolCallback.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.IVideoPoolCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal interface IVideoPoolCallback + { + void OnInvalidate(RENDERHANDLE target); + + void OnInputChanged( + RENDERHANDLE target, + Size sizeTargetPxl, + Size sizeAspectRatioPxl, + uint nFrameRateNumerator, + uint nFrameRateDenominator, + SurfaceFormat nFormat); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs new file mode 100644 index 0000000..40bec9d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.LocalAnimationCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class LocalAnimationCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_AsyncNotify; + + protected LocalAnimationCallback() + { + } + + internal static LocalAnimationCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalAnimationCallback(port, callbackInstance); + } + + protected LocalAnimationCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalAnimationCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IAnimationCallback _priv_target) || message->nMsg != 0U) + return; + Dispatch_AsyncNotify(port, _priv_target, (LocalAnimationCallback.Msg0_AsyncNotify*)message); + } + + private static unsafe void Dispatch_AsyncNotify( + RenderPort _priv_port, + IAnimationCallback _priv_target, + LocalAnimationCallback.Msg0_AsyncNotify* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_AsyncNotify, typeof(LocalAnimationCallback.Msg0_AsyncNotify), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + int nCookie = _priv_pmsg->nCookie; + _priv_target.AsyncNotify(target, nCookie); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_AsyncNotify + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public int nCookie; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs new file mode 100644 index 0000000..9f35dc6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs @@ -0,0 +1,188 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.LocalDeviceCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class LocalDeviceCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnBackBufferCaptured; + private static ushort[] s_priv_ByteOrder_Msg1_OnSurfacePoolAllocation; + private static ushort[] s_priv_ByteOrder_Msg2_OnVsaBlock; + private static ushort[] s_priv_ByteOrder_Msg3_OnLostDevice; + private static ushort[] s_priv_ByteOrder_Msg4_OnCreated; + + protected LocalDeviceCallback() + { + } + + internal static LocalDeviceCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalDeviceCallback(port, callbackInstance); + } + + protected LocalDeviceCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalDeviceCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IDeviceCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnBackBufferCaptured(port, _priv_target, (LocalDeviceCallback.Msg0_OnBackBufferCaptured*)message); + break; + case 1: + Dispatch_OnSurfacePoolAllocation(port, _priv_target, (LocalDeviceCallback.Msg1_OnSurfacePoolAllocation*)message); + break; + case 2: + Dispatch_OnVsaBlock(port, _priv_target, (LocalDeviceCallback.Msg2_OnVsaBlock*)message); + break; + case 3: + Dispatch_OnLostDevice(port, _priv_target, (LocalDeviceCallback.Msg3_OnLostDevice*)message); + break; + case 4: + Dispatch_OnCreated(port, _priv_target, (LocalDeviceCallback.Msg4_OnCreated*)message); + break; + } + } + + private static unsafe void Dispatch_OnBackBufferCaptured( + RenderPort _priv_port, + IDeviceCallback _priv_target, + LocalDeviceCallback.Msg0_OnBackBufferCaptured* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnBackBufferCaptured, typeof(LocalDeviceCallback.Msg0_OnBackBufferCaptured), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnBackBufferCaptured(target); + } + + private static unsafe void Dispatch_OnSurfacePoolAllocation( + RenderPort _priv_port, + IDeviceCallback _priv_target, + LocalDeviceCallback.Msg1_OnSurfacePoolAllocation* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnSurfacePoolAllocation, typeof(LocalDeviceCallback.Msg1_OnSurfacePoolAllocation), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + RENDERHANDLE idSurfacePool = _priv_pmsg->idSurfacePool; + SurfacePoolAllocationResult nResult = _priv_pmsg->nResult; + _priv_target.OnSurfacePoolAllocation(target, idSurfacePool, nResult); + } + + private static unsafe void Dispatch_OnVsaBlock( + RenderPort _priv_port, + IDeviceCallback _priv_target, + LocalDeviceCallback.Msg2_OnVsaBlock* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnVsaBlock, typeof(LocalDeviceCallback.Msg2_OnVsaBlock), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + bool fInBlock = _priv_pmsg->fInBlock != 0U; + _priv_target.OnVsaBlock(target, fInBlock); + } + + private static unsafe void Dispatch_OnLostDevice( + RenderPort _priv_port, + IDeviceCallback _priv_target, + LocalDeviceCallback.Msg3_OnLostDevice* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnLostDevice, typeof(LocalDeviceCallback.Msg3_OnLostDevice), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint renderGeneration = _priv_pmsg->cRenderGeneration; + bool fLost = _priv_pmsg->fLost != 0U; + _priv_target.OnLostDevice(target, renderGeneration, fLost); + } + + private static unsafe void Dispatch_OnCreated( + RenderPort _priv_port, + IDeviceCallback _priv_target, + LocalDeviceCallback.Msg4_OnCreated* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnCreated, typeof(LocalDeviceCallback.Msg4_OnCreated), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + bool fAllowDynamicPool = _priv_pmsg->fAllowDynamicPool != 0U; + _priv_target.OnCreated(target, fAllowDynamicPool); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnBackBufferCaptured + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg1_OnSurfacePoolAllocation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public RENDERHANDLE idSurfacePool; + public SurfacePoolAllocationResult nResult; + } + + [ComVisible(false)] + private struct Msg2_OnVsaBlock + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint fInBlock; + } + + [ComVisible(false)] + private struct Msg3_OnLostDevice + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint cRenderGeneration; + public uint fLost; + } + + [ComVisible(false)] + private struct Msg4_OnCreated + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint fAllowDynamicPool; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs new file mode 100644 index 0000000..27cd8c4 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs @@ -0,0 +1,164 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.LocalRenderCapsCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class LocalRenderCapsCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnSoundCaps; + private static ushort[] s_priv_ByteOrder_Msg1_OnGraphicsCaps; + private static ushort[] s_priv_ByteOrder_Msg2_OnEndCapsCheck; + private static ushort[] s_priv_ByteOrder_Msg3_OnBeginCapsCheck; + + protected LocalRenderCapsCallback() + { + } + + internal static LocalRenderCapsCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalRenderCapsCallback(port, callbackInstance); + } + + protected LocalRenderCapsCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalRenderCapsCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is IRenderCapsCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnSoundCaps(port, _priv_target, (LocalRenderCapsCallback.Msg0_OnSoundCaps*)message); + break; + case 1: + Dispatch_OnGraphicsCaps(port, _priv_target, (LocalRenderCapsCallback.Msg1_OnGraphicsCaps*)message); + break; + case 2: + Dispatch_OnEndCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg2_OnEndCapsCheck*)message); + break; + case 3: + Dispatch_OnBeginCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg3_OnBeginCapsCheck*)message); + break; + } + } + + private static unsafe void Dispatch_OnSoundCaps( + RenderPort _priv_port, + IRenderCapsCallback _priv_target, + LocalRenderCapsCallback.Msg0_OnSoundCaps* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnSoundCaps, typeof(LocalRenderCapsCallback.Msg0_OnSoundCaps), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint nCookie = _priv_pmsg->nCookie; + Microsoft.Iris.Render.Internal.SoundCaps capsInfo = _priv_pmsg->capsInfo; + _priv_target.OnSoundCaps(target, nCookie, capsInfo); + } + + private static unsafe void Dispatch_OnGraphicsCaps( + RenderPort _priv_port, + IRenderCapsCallback _priv_target, + LocalRenderCapsCallback.Msg1_OnGraphicsCaps* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnGraphicsCaps, typeof(LocalRenderCapsCallback.Msg1_OnGraphicsCaps), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint nCookie = _priv_pmsg->nCookie; + GraphicsCaps capsInfo = _priv_pmsg->capsInfo; + _priv_target.OnGraphicsCaps(target, nCookie, capsInfo); + } + + private static unsafe void Dispatch_OnEndCapsCheck( + RenderPort _priv_port, + IRenderCapsCallback _priv_target, + LocalRenderCapsCallback.Msg2_OnEndCapsCheck* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnEndCapsCheck, typeof(LocalRenderCapsCallback.Msg2_OnEndCapsCheck), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint nCookie = _priv_pmsg->nCookie; + _priv_target.OnEndCapsCheck(target, nCookie); + } + + private static unsafe void Dispatch_OnBeginCapsCheck( + RenderPort _priv_port, + IRenderCapsCallback _priv_target, + LocalRenderCapsCallback.Msg3_OnBeginCapsCheck* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnBeginCapsCheck, typeof(LocalRenderCapsCallback.Msg3_OnBeginCapsCheck), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + uint nCookie = _priv_pmsg->nCookie; + _priv_target.OnBeginCapsCheck(target, nCookie); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnSoundCaps + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint nCookie; + public Microsoft.Iris.Render.Internal.SoundCaps capsInfo; + } + + [ComVisible(false)] + private struct Msg1_OnGraphicsCaps + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint nCookie; + public GraphicsCaps capsInfo; + } + + [ComVisible(false)] + private struct Msg2_OnEndCapsCheck + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint nCookie; + } + + [ComVisible(false)] + private struct Msg3_OnBeginCapsCheck + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public uint nCookie; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs new file mode 100644 index 0000000..bbf018c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs @@ -0,0 +1,103 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.LocalSoundBufferCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class LocalSoundBufferCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnSoundBufferReady; + private static ushort[] s_priv_ByteOrder_Msg1_OnSoundBufferLost; + + protected LocalSoundBufferCallback() + { + } + + internal static LocalSoundBufferCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalSoundBufferCallback(port, callbackInstance); + } + + protected LocalSoundBufferCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalSoundBufferCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (!(owner is ISoundBufferCallback _priv_target)) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnSoundBufferReady(port, _priv_target, (LocalSoundBufferCallback.Msg0_OnSoundBufferReady*)message); + break; + case 1: + Dispatch_OnSoundBufferLost(port, _priv_target, (LocalSoundBufferCallback.Msg1_OnSoundBufferLost*)message); + break; + } + } + + private static unsafe void Dispatch_OnSoundBufferReady( + RenderPort _priv_port, + ISoundBufferCallback _priv_target, + LocalSoundBufferCallback.Msg0_OnSoundBufferReady* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnSoundBufferReady, typeof(LocalSoundBufferCallback.Msg0_OnSoundBufferReady), sizeof(CallbackMessage), 0); + RENDERHANDLE idTarget = _priv_pmsg->idTarget; + _priv_target.OnSoundBufferReady(idTarget); + } + + private static unsafe void Dispatch_OnSoundBufferLost( + RenderPort _priv_port, + ISoundBufferCallback _priv_target, + LocalSoundBufferCallback.Msg1_OnSoundBufferLost* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnSoundBufferLost, typeof(LocalSoundBufferCallback.Msg1_OnSoundBufferLost), sizeof(CallbackMessage), 0); + RENDERHANDLE idTarget = _priv_pmsg->idTarget; + _priv_target.OnSoundBufferLost(idTarget); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnSoundBufferReady + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idTarget; + } + + [ComVisible(false)] + private struct Msg1_OnSoundBufferLost + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idTarget; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs new file mode 100644 index 0000000..cdf4dac --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs @@ -0,0 +1,113 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.LocalVideoPoolCallback +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class LocalVideoPoolCallback : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_OnInvalidate; + private static ushort[] s_priv_ByteOrder_Msg1_OnInputChanged; + + protected LocalVideoPoolCallback() + { + } + + internal static LocalVideoPoolCallback CreateCallbackImpl( + RenderPort port, + RENDERHANDLE callbackInstance) + { + return new LocalVideoPoolCallback(port, callbackInstance); + } + + protected LocalVideoPoolCallback(RenderPort port, RENDERHANDLE handle) + : base(port, handle, false) + { + } + + public override bool Equals(object other) => other is LocalVideoPoolCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + internal static unsafe RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); + + private static unsafe void DispatchCallback( + RenderPort port, + IRenderHandleOwner owner, + CallbackMessage* message) + { + if (owner is not IVideoPoolCallback _priv_target) + return; + switch (message->nMsg) + { + case 0: + Dispatch_OnInvalidate(port, _priv_target, (LocalVideoPoolCallback.Msg0_OnInvalidate*)message); + break; + case 1: + Dispatch_OnInputChanged(port, _priv_target, (LocalVideoPoolCallback.Msg1_OnInputChanged*)message); + break; + } + } + + private static unsafe void Dispatch_OnInvalidate( + RenderPort _priv_port, + IVideoPoolCallback _priv_target, + LocalVideoPoolCallback.Msg0_OnInvalidate* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnInvalidate, typeof(LocalVideoPoolCallback.Msg0_OnInvalidate), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + _priv_target.OnInvalidate(target); + } + + private static unsafe void Dispatch_OnInputChanged( + RenderPort _priv_port, + IVideoPoolCallback _priv_target, + LocalVideoPoolCallback.Msg1_OnInputChanged* _priv_pmsg) + { + if (_priv_port.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnInputChanged, typeof(LocalVideoPoolCallback.Msg1_OnInputChanged), sizeof(CallbackMessage), 0); + RENDERHANDLE target = _priv_pmsg->target; + Size sizeTargetPxl = _priv_pmsg->sizeTargetPxl; + Size sizeAspectRatioPxl = _priv_pmsg->sizeAspectRatioPxl; + uint frameRateNumerator = _priv_pmsg->nFrameRateNumerator; + uint frameRateDenominator = _priv_pmsg->nFrameRateDenominator; + SurfaceFormat nFormat = _priv_pmsg->nFormat; + _priv_target.OnInputChanged(target, sizeTargetPxl, sizeAspectRatioPxl, frameRateNumerator, frameRateDenominator, nFormat); + } + + [Conditional("DEBUG")] + private static unsafe void OnInvalidCallback(CallbackMessage* message, string category) + { + } + + [ComVisible(false)] + private struct Msg0_OnInvalidate + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + } + + [ComVisible(false)] + private struct Msg1_OnInputChanged + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE target; + public Size sizeTargetPxl; + public Size sizeAspectRatioPxl; + public uint nFrameRateNumerator; + public uint nFrameRateDenominator; + public SurfaceFormat nFormat; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs new file mode 100644 index 0000000..23a8214 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs @@ -0,0 +1,94 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.ProtocolSplashRenderingNt +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal sealed class ProtocolSplashRenderingNt : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_GdiDevice; + private RENDERHANDLE _priv_remoteClass_NtDevice; + private RENDERHANDLE _priv_remoteClass_GdiEffect; + private RENDERHANDLE _priv_remoteClass_GdiSprite; + private RENDERHANDLE _priv_remoteClass_WinSoundDevice; + private RENDERHANDLE _priv_remoteClass_Ds8SoundDevice; + + public static ProtocolSplashRenderingNt Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Rendering::Nt"); + if (protocolInstance != null) + { + ProtocolSplashRenderingNt splashRenderingNt = protocolInstance as ProtocolSplashRenderingNt; + Debug2.Validate(splashRenderingNt != null, typeof(InvalidOperationException), "protocol name collision"); + return splashRenderingNt; + } + ProtocolSplashRenderingNt splashRenderingNt1 = new ProtocolSplashRenderingNt(port); + port.BindProtocol(splashRenderingNt1); + return splashRenderingNt1; + } + + private ProtocolSplashRenderingNt(RenderPort port) + : base(port, "Splash::Rendering::Nt") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_GdiDevice = port.InitRemoteClass("Splash::Rendering::Nt::GdiDevice"); + this._priv_remoteClass_NtDevice = port.InitRemoteClass("Splash::Rendering::Nt::NtDevice"); + this._priv_remoteClass_GdiEffect = port.InitRemoteClass("Splash::Rendering::Nt::GdiEffect"); + this._priv_remoteClass_GdiSprite = port.InitRemoteClass("Splash::Rendering::Nt::GdiSprite"); + this._priv_remoteClass_WinSoundDevice = port.InitRemoteClass("Splash::Rendering::Nt::WinSoundDevice"); + this._priv_remoteClass_Ds8SoundDevice = port.InitRemoteClass("Splash::Rendering::Nt::Ds8SoundDevice"); + } + + internal RENDERHANDLE GdiDevice_ClassHandle => this._priv_remoteClass_GdiDevice; + + internal RENDERHANDLE NtDevice_ClassHandle => this._priv_remoteClass_NtDevice; + + internal RENDERHANDLE GdiEffect_ClassHandle => this._priv_remoteClass_GdiEffect; + + internal RENDERHANDLE GdiSprite_ClassHandle => this._priv_remoteClass_GdiSprite; + + internal RENDERHANDLE WinSoundDevice_ClassHandle => this._priv_remoteClass_WinSoundDevice; + + internal RENDERHANDLE Ds8SoundDevice_ClassHandle => this._priv_remoteClass_Ds8SoundDevice; + + internal RemoteGdiDevice BuildRemoteGdiDevice( + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + return RemoteGdiDevice.Create(this, _priv_owner, cb); + } + + internal RemoteNtDevice BuildRemoteNtDevice( + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + return RemoteNtDevice.Create(this, _priv_owner, cb); + } + + internal RemoteGdiSprite BuildRemoteGdiSprite(IRenderHandleOwner _priv_owner) => RemoteGdiSprite.Create(this, _priv_owner); + + internal RemoteWinSoundDevice BuildRemoteWinSoundDevice( + IRenderHandleOwner _priv_owner) + { + return RemoteWinSoundDevice.Create(this, _priv_owner); + } + + internal RemoteDs8SoundDevice INPROC_BuildRemoteDs8SoundDevice( + IRenderHandleOwner _priv_owner, + HWND hwnd) + { + return RemoteDs8SoundDevice.INPROC_Create(this, _priv_owner, hwnd); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteDs8SoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteDs8SoundDevice.cs new file mode 100644 index 0000000..e460ad4 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteDs8SoundDevice.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteDs8SoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteDs8SoundDevice : RemoteSoundDevice + { + protected RemoteDs8SoundDevice() + { + } + + public static unsafe RemoteDs8SoundDevice INPROC_Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + HWND hwnd) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.Ds8SoundDevice_ClassHandle; + RemoteDs8SoundDevice remoteDs8SoundDevice = new RemoteDs8SoundDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteDs8SoundDevice.Msg4_Create); + // ISSUE: untyped stack allocation + byte* bytes = stackalloc byte[(int)num]; + RemoteDs8SoundDevice.Msg4_Create* msg4CreatePtr = (Msg4_Create*)bytes; + msg4CreatePtr->_priv_size = num; + msg4CreatePtr->_priv_msgid = 4U; + msg4CreatePtr->hwnd = hwnd; + msg4CreatePtr->_priv_idObjectSubject = remoteDs8SoundDevice.m_renderHandle; + port.CreateRemoteObject(deviceClassHandle, remoteDs8SoundDevice.m_renderHandle, (Message*)msg4CreatePtr); + return remoteDs8SoundDevice; + } + + public static RemoteDs8SoundDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDs8SoundDevice(port, handle, true); + } + + public static RemoteDs8SoundDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDs8SoundDevice(port, handle, false); + } + + protected RemoteDs8SoundDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDs8SoundDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDs8SoundDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg4_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public HWND hwnd; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs new file mode 100644 index 0000000..00377da --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs @@ -0,0 +1,381 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteGdiDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteGdiDevice : RemoteDevice + { + private static ushort[] s_priv_ByteOrder_Msg23_Create; + private static ushort[] s_priv_ByteOrder_Msg8_SecureDesktopMode; + private static ushort[] s_priv_ByteOrder_Msg9_SetZoomMode; + private static ushort[] s_priv_ByteOrder_Msg11_SetEnableAlphaTracking; + private static ushort[] s_priv_ByteOrder_Msg13_SetBackgroundColor; + private static ushort[] s_priv_ByteOrder_Msg15_SetUseSystemMemoryBitmaps; + private static ushort[] s_priv_ByteOrder_Msg17_SetEnableBackBuffer; + private static ushort[] s_priv_ByteOrder_Msg19_SetAllowAnimations; + private static ushort[] s_priv_ByteOrder_Msg21_SetAllowAlpha; + + protected RemoteGdiDevice() + { + } + + public static unsafe RemoteGdiDevice Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.GdiDevice_ClassHandle; + RemoteGdiDevice remoteGdiDevice = new RemoteGdiDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteGdiDevice.Msg23_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteGdiDevice.Msg23_Create* msg23CreatePtr = (RemoteGdiDevice.Msg23_Create*)pMem; + msg23CreatePtr->_priv_size = num; + msg23CreatePtr->_priv_msgid = 23U; + msg23CreatePtr->_priv_objcb = cb.RenderHandle; + msg23CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg23CreatePtr->_priv_idObjectSubject = remoteGdiDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg23_Create, typeof(RemoteGdiDevice.Msg23_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteGdiDevice.m_renderHandle, (Message*)msg23CreatePtr); + return remoteGdiDevice; + } + + public unsafe void BuildSecureDesktopMode( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fEnabled) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg8_SecureDesktopMode); + RemoteGdiDevice.Msg8_SecureDesktopMode* secureDesktopModePtr = (RemoteGdiDevice.Msg8_SecureDesktopMode*)_priv_portUse.AllocMessageBuffer(size); + secureDesktopModePtr->_priv_size = size; + secureDesktopModePtr->_priv_msgid = 8U; + secureDesktopModePtr->fEnabled = fEnabled ? uint.MaxValue : 0U; + secureDesktopModePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)secureDesktopModePtr, ref s_priv_ByteOrder_Msg8_SecureDesktopMode, typeof(RemoteGdiDevice.Msg8_SecureDesktopMode), 0, 0); + _priv_pmsgUse = (Message*)secureDesktopModePtr; + } + + public unsafe void SendSecureDesktopMode(bool fEnabled) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSecureDesktopMode(out _priv_portUse, out _priv_pmsgUse, fEnabled); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetZoomMode( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + VideoZoomMode vzmZoomMode) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg9_SetZoomMode); + RemoteGdiDevice.Msg9_SetZoomMode* msg9SetZoomModePtr = (RemoteGdiDevice.Msg9_SetZoomMode*)_priv_portUse.AllocMessageBuffer(size); + msg9SetZoomModePtr->_priv_size = size; + msg9SetZoomModePtr->_priv_msgid = 9U; + msg9SetZoomModePtr->vzmZoomMode = vzmZoomMode; + msg9SetZoomModePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg9SetZoomModePtr, ref s_priv_ByteOrder_Msg9_SetZoomMode, typeof(RemoteGdiDevice.Msg9_SetZoomMode), 0, 0); + _priv_pmsgUse = (Message*)msg9SetZoomModePtr; + } + + public unsafe void SendSetZoomMode(VideoZoomMode vzmZoomMode) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetZoomMode(out _priv_portUse, out _priv_pmsgUse, vzmZoomMode); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEnableAlphaTracking( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fEnableAlphaTracking) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg11_SetEnableAlphaTracking); + RemoteGdiDevice.Msg11_SetEnableAlphaTracking* enableAlphaTrackingPtr = (RemoteGdiDevice.Msg11_SetEnableAlphaTracking*)_priv_portUse.AllocMessageBuffer(size); + enableAlphaTrackingPtr->_priv_size = size; + enableAlphaTrackingPtr->_priv_msgid = 11U; + enableAlphaTrackingPtr->fEnableAlphaTracking = fEnableAlphaTracking ? uint.MaxValue : 0U; + enableAlphaTrackingPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)enableAlphaTrackingPtr, ref s_priv_ByteOrder_Msg11_SetEnableAlphaTracking, typeof(RemoteGdiDevice.Msg11_SetEnableAlphaTracking), 0, 0); + _priv_pmsgUse = (Message*)enableAlphaTrackingPtr; + } + + public unsafe void SendSetEnableAlphaTracking(bool fEnableAlphaTracking) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEnableAlphaTracking(out _priv_portUse, out _priv_pmsgUse, fEnableAlphaTracking); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetBackgroundColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clrBackground) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg13_SetBackgroundColor); + RemoteGdiDevice.Msg13_SetBackgroundColor* setBackgroundColorPtr = (RemoteGdiDevice.Msg13_SetBackgroundColor*)_priv_portUse.AllocMessageBuffer(size); + setBackgroundColorPtr->_priv_size = size; + setBackgroundColorPtr->_priv_msgid = 13U; + setBackgroundColorPtr->clrBackground = clrBackground; + setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg13_SetBackgroundColor, typeof(RemoteGdiDevice.Msg13_SetBackgroundColor), 0, 0); + _priv_pmsgUse = (Message*)setBackgroundColorPtr; + } + + public unsafe void SendSetBackgroundColor(ColorF clrBackground) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetBackgroundColor(out _priv_portUse, out _priv_pmsgUse, clrBackground); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetUseSystemMemoryBitmaps( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fSystemMemoryBitmaps) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps); + RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps* systemMemoryBitmapsPtr = (RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps*)_priv_portUse.AllocMessageBuffer(size); + systemMemoryBitmapsPtr->_priv_size = size; + systemMemoryBitmapsPtr->_priv_msgid = 15U; + systemMemoryBitmapsPtr->fSystemMemoryBitmaps = fSystemMemoryBitmaps ? uint.MaxValue : 0U; + systemMemoryBitmapsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)systemMemoryBitmapsPtr, ref s_priv_ByteOrder_Msg15_SetUseSystemMemoryBitmaps, typeof(RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps), 0, 0); + _priv_pmsgUse = (Message*)systemMemoryBitmapsPtr; + } + + public unsafe void SendSetUseSystemMemoryBitmaps(bool fSystemMemoryBitmaps) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetUseSystemMemoryBitmaps(out _priv_portUse, out _priv_pmsgUse, fSystemMemoryBitmaps); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEnableBackBuffer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fEnableBackBuffer) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg17_SetEnableBackBuffer); + RemoteGdiDevice.Msg17_SetEnableBackBuffer* enableBackBufferPtr = (RemoteGdiDevice.Msg17_SetEnableBackBuffer*)_priv_portUse.AllocMessageBuffer(size); + enableBackBufferPtr->_priv_size = size; + enableBackBufferPtr->_priv_msgid = 17U; + enableBackBufferPtr->fEnableBackBuffer = fEnableBackBuffer ? uint.MaxValue : 0U; + enableBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)enableBackBufferPtr, ref s_priv_ByteOrder_Msg17_SetEnableBackBuffer, typeof(RemoteGdiDevice.Msg17_SetEnableBackBuffer), 0, 0); + _priv_pmsgUse = (Message*)enableBackBufferPtr; + } + + public unsafe void SendSetEnableBackBuffer(bool fEnableBackBuffer) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEnableBackBuffer(out _priv_portUse, out _priv_pmsgUse, fEnableBackBuffer); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetAllowAnimations( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fAllowAnimations) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg19_SetAllowAnimations); + RemoteGdiDevice.Msg19_SetAllowAnimations* setAllowAnimationsPtr = (RemoteGdiDevice.Msg19_SetAllowAnimations*)_priv_portUse.AllocMessageBuffer(size); + setAllowAnimationsPtr->_priv_size = size; + setAllowAnimationsPtr->_priv_msgid = 19U; + setAllowAnimationsPtr->fAllowAnimations = fAllowAnimations ? uint.MaxValue : 0U; + setAllowAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setAllowAnimationsPtr, ref s_priv_ByteOrder_Msg19_SetAllowAnimations, typeof(RemoteGdiDevice.Msg19_SetAllowAnimations), 0, 0); + _priv_pmsgUse = (Message*)setAllowAnimationsPtr; + } + + public unsafe void SendSetAllowAnimations(bool fAllowAnimations) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAllowAnimations(out _priv_portUse, out _priv_pmsgUse, fAllowAnimations); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetAllowAlpha( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fAllowAlpha) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiDevice.Msg21_SetAllowAlpha); + RemoteGdiDevice.Msg21_SetAllowAlpha* msg21SetAllowAlphaPtr = (RemoteGdiDevice.Msg21_SetAllowAlpha*)_priv_portUse.AllocMessageBuffer(size); + msg21SetAllowAlphaPtr->_priv_size = size; + msg21SetAllowAlphaPtr->_priv_msgid = 21U; + msg21SetAllowAlphaPtr->fAllowAlpha = fAllowAlpha ? uint.MaxValue : 0U; + msg21SetAllowAlphaPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg21SetAllowAlphaPtr, ref s_priv_ByteOrder_Msg21_SetAllowAlpha, typeof(RemoteGdiDevice.Msg21_SetAllowAlpha), 0, 0); + _priv_pmsgUse = (Message*)msg21SetAllowAlphaPtr; + } + + public unsafe void SendSetAllowAlpha(bool fAllowAlpha) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAllowAlpha(out _priv_portUse, out _priv_pmsgUse, fAllowAlpha); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteGdiDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteGdiDevice(port, handle, true); + } + + public static RemoteGdiDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteGdiDevice(port, handle, false); + } + + protected RemoteGdiDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteGdiDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteGdiDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg23_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + + [ComVisible(false)] + private struct Msg8_SecureDesktopMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fEnabled; + } + + [ComVisible(false)] + private struct Msg9_SetZoomMode + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public VideoZoomMode vzmZoomMode; + } + + [ComVisible(false)] + private struct Msg11_SetEnableAlphaTracking + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fEnableAlphaTracking; + } + + [ComVisible(false)] + private struct Msg13_SetBackgroundColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clrBackground; + } + + [ComVisible(false)] + private struct Msg15_SetUseSystemMemoryBitmaps + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fSystemMemoryBitmaps; + } + + [ComVisible(false)] + private struct Msg17_SetEnableBackBuffer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fEnableBackBuffer; + } + + [ComVisible(false)] + private struct Msg19_SetAllowAnimations + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fAllowAnimations; + } + + [ComVisible(false)] + private struct Msg21_SetAllowAlpha + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fAllowAlpha; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs new file mode 100644 index 0000000..31befb3 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs @@ -0,0 +1,98 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteGdiEffect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteGdiEffect : RemoteEffect + { + private static ushort[] s_priv_ByteOrder_Msg8_SetType; + + protected RemoteGdiEffect() + { + } + + public static unsafe RemoteGdiEffect Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE effectClassHandle = _priv_protocolInstance.GdiEffect_ClassHandle; + RemoteGdiEffect remoteGdiEffect = new RemoteGdiEffect(port, _priv_owner); + port.CreateRemoteObject(effectClassHandle, remoteGdiEffect.m_renderHandle, null); + return remoteGdiEffect; + } + + public unsafe void BuildSetType( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nType) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGdiEffect.Msg8_SetType); + RemoteGdiEffect.Msg8_SetType* msg8SetTypePtr = (RemoteGdiEffect.Msg8_SetType*)_priv_portUse.AllocMessageBuffer(size); + msg8SetTypePtr->_priv_size = size; + msg8SetTypePtr->_priv_msgid = 8U; + msg8SetTypePtr->nType = nType; + msg8SetTypePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8SetTypePtr, ref s_priv_ByteOrder_Msg8_SetType, typeof(RemoteGdiEffect.Msg8_SetType), 0, 0); + _priv_pmsgUse = (Message*)msg8SetTypePtr; + } + + public unsafe void SendSetType(int nType) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetType(out _priv_portUse, out _priv_pmsgUse, nType); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteGdiEffect CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteGdiEffect(port, handle, true); + } + + public static RemoteGdiEffect CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteGdiEffect(port, handle, false); + } + + protected RemoteGdiEffect(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteGdiEffect(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteGdiEffect && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg8_SetType + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nType; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs new file mode 100644 index 0000000..dcc9085 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteGdiSprite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteGdiSprite : RemoteSprite + { + private static ushort[] s_priv_ByteOrder_Msg22_Create; + + protected RemoteGdiSprite() + { + } + + public static unsafe RemoteGdiSprite Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE spriteClassHandle = _priv_protocolInstance.GdiSprite_ClassHandle; + RemoteGdiSprite remoteGdiSprite = new RemoteGdiSprite(port, _priv_owner); + uint num = (uint)sizeof(RemoteGdiSprite.Msg22_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteGdiSprite.Msg22_Create* msg22CreatePtr = (RemoteGdiSprite.Msg22_Create*)pMem; + msg22CreatePtr->_priv_size = num; + msg22CreatePtr->_priv_msgid = 22U; + msg22CreatePtr->_priv_idObjectSubject = remoteGdiSprite.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg22_Create, typeof(RemoteGdiSprite.Msg22_Create), 0, 0); + port.CreateRemoteObject(spriteClassHandle, remoteGdiSprite.m_renderHandle, (Message*)msg22CreatePtr); + return remoteGdiSprite; + } + + public static RemoteGdiSprite CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteGdiSprite(port, handle, true); + } + + public static RemoteGdiSprite CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteGdiSprite(port, handle, false); + } + + protected RemoteGdiSprite(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteGdiSprite(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteGdiSprite && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg22_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs new file mode 100644 index 0000000..e079909 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs @@ -0,0 +1,269 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteNtDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteNtDevice : RemoteDx9Device + { + private static ushort[] s_priv_ByteOrder_Msg19_Create; + private static ushort[] s_priv_ByteOrder_Msg11_RenderNowIfPossible; + private static ushort[] s_priv_ByteOrder_Msg12_CreateTransferBuffer; + private static ushort[] s_priv_ByteOrder_Msg13_SetMaxOverscan; + private static ushort[] s_priv_ByteOrder_Msg15_SetDisplayOverscan; + private static ushort[] s_priv_ByteOrder_Msg17_SetEnablePageFlip; + + protected RemoteNtDevice() + { + } + + public static unsafe RemoteNtDevice Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.NtDevice_ClassHandle; + RemoteNtDevice remoteNtDevice = new RemoteNtDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteNtDevice.Msg19_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteNtDevice.Msg19_Create* msg19CreatePtr = (RemoteNtDevice.Msg19_Create*)pMem; + msg19CreatePtr->_priv_size = num; + msg19CreatePtr->_priv_msgid = 19U; + msg19CreatePtr->_priv_objcb = cb.RenderHandle; + msg19CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg19CreatePtr->_priv_idObjectSubject = remoteNtDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg19_Create, typeof(RemoteNtDevice.Msg19_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteNtDevice.m_renderHandle, (Message*)msg19CreatePtr); + return remoteNtDevice; + } + + public unsafe void BuildRenderNowIfPossible( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteNtDevice.Msg11_RenderNowIfPossible); + RemoteNtDevice.Msg11_RenderNowIfPossible* renderNowIfPossiblePtr = (RemoteNtDevice.Msg11_RenderNowIfPossible*)_priv_portUse.AllocMessageBuffer(size); + renderNowIfPossiblePtr->_priv_size = size; + renderNowIfPossiblePtr->_priv_msgid = 11U; + renderNowIfPossiblePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)renderNowIfPossiblePtr, ref s_priv_ByteOrder_Msg11_RenderNowIfPossible, typeof(RemoteNtDevice.Msg11_RenderNowIfPossible), 0, 0); + _priv_pmsgUse = (Message*)renderNowIfPossiblePtr; + } + + public unsafe void SendRenderNowIfPossible() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRenderNowIfPossible(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateTransferBuffer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeTransferPxl, + SurfaceFormat nFormat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteNtDevice.Msg12_CreateTransferBuffer); + RemoteNtDevice.Msg12_CreateTransferBuffer* createTransferBufferPtr = (RemoteNtDevice.Msg12_CreateTransferBuffer*)_priv_portUse.AllocMessageBuffer(size); + createTransferBufferPtr->_priv_size = size; + createTransferBufferPtr->_priv_msgid = 12U; + createTransferBufferPtr->sizeTransferPxl = sizeTransferPxl; + createTransferBufferPtr->nFormat = nFormat; + createTransferBufferPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createTransferBufferPtr, ref s_priv_ByteOrder_Msg12_CreateTransferBuffer, typeof(RemoteNtDevice.Msg12_CreateTransferBuffer), 0, 0); + _priv_pmsgUse = (Message*)createTransferBufferPtr; + } + + public unsafe void SendCreateTransferBuffer(Size sizeTransferPxl, SurfaceFormat nFormat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateTransferBuffer(out _priv_portUse, out _priv_pmsgUse, sizeTransferPxl, nFormat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetMaxOverscan( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flMaxOverscan) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteNtDevice.Msg13_SetMaxOverscan); + RemoteNtDevice.Msg13_SetMaxOverscan* msg13SetMaxOverscanPtr = (RemoteNtDevice.Msg13_SetMaxOverscan*)_priv_portUse.AllocMessageBuffer(size); + msg13SetMaxOverscanPtr->_priv_size = size; + msg13SetMaxOverscanPtr->_priv_msgid = 13U; + msg13SetMaxOverscanPtr->flMaxOverscan = flMaxOverscan; + msg13SetMaxOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg13SetMaxOverscanPtr, ref s_priv_ByteOrder_Msg13_SetMaxOverscan, typeof(RemoteNtDevice.Msg13_SetMaxOverscan), 0, 0); + _priv_pmsgUse = (Message*)msg13SetMaxOverscanPtr; + } + + public unsafe void SendSetMaxOverscan(float flMaxOverscan) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMaxOverscan(out _priv_portUse, out _priv_pmsgUse, flMaxOverscan); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetDisplayOverscan( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flDisplayOverscan) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteNtDevice.Msg15_SetDisplayOverscan); + RemoteNtDevice.Msg15_SetDisplayOverscan* setDisplayOverscanPtr = (RemoteNtDevice.Msg15_SetDisplayOverscan*)_priv_portUse.AllocMessageBuffer(size); + setDisplayOverscanPtr->_priv_size = size; + setDisplayOverscanPtr->_priv_msgid = 15U; + setDisplayOverscanPtr->flDisplayOverscan = flDisplayOverscan; + setDisplayOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setDisplayOverscanPtr, ref s_priv_ByteOrder_Msg15_SetDisplayOverscan, typeof(RemoteNtDevice.Msg15_SetDisplayOverscan), 0, 0); + _priv_pmsgUse = (Message*)setDisplayOverscanPtr; + } + + public unsafe void SendSetDisplayOverscan(float flDisplayOverscan) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDisplayOverscan(out _priv_portUse, out _priv_pmsgUse, flDisplayOverscan); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEnablePageFlip( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fPageFlip) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteNtDevice.Msg17_SetEnablePageFlip); + RemoteNtDevice.Msg17_SetEnablePageFlip* setEnablePageFlipPtr = (RemoteNtDevice.Msg17_SetEnablePageFlip*)_priv_portUse.AllocMessageBuffer(size); + setEnablePageFlipPtr->_priv_size = size; + setEnablePageFlipPtr->_priv_msgid = 17U; + setEnablePageFlipPtr->fPageFlip = fPageFlip ? uint.MaxValue : 0U; + setEnablePageFlipPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setEnablePageFlipPtr, ref s_priv_ByteOrder_Msg17_SetEnablePageFlip, typeof(RemoteNtDevice.Msg17_SetEnablePageFlip), 0, 0); + _priv_pmsgUse = (Message*)setEnablePageFlipPtr; + } + + public unsafe void SendSetEnablePageFlip(bool fPageFlip) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEnablePageFlip(out _priv_portUse, out _priv_pmsgUse, fPageFlip); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteNtDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteNtDevice(port, handle, true); + } + + public static RemoteNtDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteNtDevice(port, handle, false); + } + + protected RemoteNtDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteNtDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteNtDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg19_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + + [ComVisible(false)] + private struct Msg11_RenderNowIfPossible + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg12_CreateTransferBuffer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeTransferPxl; + public SurfaceFormat nFormat; + } + + [ComVisible(false)] + private struct Msg13_SetMaxOverscan + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flMaxOverscan; + } + + [ComVisible(false)] + private struct Msg15_SetDisplayOverscan + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flDisplayOverscan; + } + + [ComVisible(false)] + private struct Msg17_SetEnablePageFlip + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fPageFlip; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs new file mode 100644 index 0000000..7dfdac0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt.RemoteWinSoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt +{ + internal class RemoteWinSoundDevice : RemoteSoundDevice + { + private static ushort[] s_priv_ByteOrder_Msg4_Create; + + protected RemoteWinSoundDevice() + { + } + + public static unsafe RemoteWinSoundDevice Create( + ProtocolSplashRenderingNt _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.WinSoundDevice_ClassHandle; + RemoteWinSoundDevice remoteWinSoundDevice = new RemoteWinSoundDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteWinSoundDevice.Msg4_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteWinSoundDevice.Msg4_Create* msg4CreatePtr = (RemoteWinSoundDevice.Msg4_Create*)pMem; + msg4CreatePtr->_priv_size = num; + msg4CreatePtr->_priv_msgid = 4U; + msg4CreatePtr->_priv_idObjectSubject = remoteWinSoundDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg4_Create, typeof(RemoteWinSoundDevice.Msg4_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteWinSoundDevice.m_renderHandle, (Message*)msg4CreatePtr); + return remoteWinSoundDevice; + } + + public static RemoteWinSoundDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteWinSoundDevice(port, handle, true); + } + + public static RemoteWinSoundDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteWinSoundDevice(port, handle, false); + } + + protected RemoteWinSoundDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteWinSoundDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteWinSoundDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg4_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs new file mode 100644 index 0000000..a0e0b21 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs @@ -0,0 +1,242 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.ProtocolSplashRendering +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal sealed class ProtocolSplashRendering : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_Window; + private RENDERHANDLE _priv_remoteClass_RenderCaps; + private RENDERHANDLE _priv_remoteClass_Visual; + private RENDERHANDLE _priv_remoteClass_Camera; + private RENDERHANDLE _priv_remoteClass_VisualContainer; + private RENDERHANDLE _priv_remoteClass_Device; + private RENDERHANDLE _priv_remoteClass_Surface; + private RENDERHANDLE _priv_remoteClass_SurfacePool; + private RENDERHANDLE _priv_remoteClass_VideoPool; + private RENDERHANDLE _priv_remoteClass_Rasterizer; + private RENDERHANDLE _priv_remoteClass_Gradient; + private RENDERHANDLE _priv_remoteClass_AnimationManager; + private RENDERHANDLE _priv_remoteClass_Animation; + private RENDERHANDLE _priv_remoteClass_ExternalAnimationInput; + private RENDERHANDLE _priv_remoteClass_AnimationInputProvider; + private RENDERHANDLE _priv_remoteClass_WaitCursor; + private RENDERHANDLE _priv_remoteClass_NullDevice; + private RENDERHANDLE _priv_remoteClass_Dx9Device; + private RENDERHANDLE _priv_remoteClass_Dx9EffectResource; + private RENDERHANDLE _priv_remoteClass_Effect; + private RENDERHANDLE _priv_remoteClass_Dx9Effect; + private RENDERHANDLE _priv_remoteClass_Sprite; + private RENDERHANDLE _priv_remoteClass_Dx9Sprite; + private RENDERHANDLE _priv_remoteClass_DynamicSurfaceFactory; + private RENDERHANDLE _priv_remoteClass_SoundBuffer; + private RENDERHANDLE _priv_remoteClass_Sound; + private RENDERHANDLE _priv_remoteClass_SoundDevice; + private RENDERHANDLE _priv_callbackInstance_RenderCapsCallback; + private RENDERHANDLE _priv_callbackInstance_DeviceCallback; + private RENDERHANDLE _priv_callbackInstance_VideoPoolCallback; + private RENDERHANDLE _priv_callbackInstance_AnimationCallback; + private RENDERHANDLE _priv_callbackInstance_SoundBufferCallback; + + public static ProtocolSplashRendering Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Rendering"); + if (protocolInstance != null) + { + ProtocolSplashRendering protocolSplashRendering = protocolInstance as ProtocolSplashRendering; + Debug2.Validate(protocolSplashRendering != null, typeof(InvalidOperationException), "protocol name collision"); + return protocolSplashRendering; + } + ProtocolSplashRendering protocolSplashRendering1 = new ProtocolSplashRendering(port); + port.BindProtocol(protocolSplashRendering1); + return protocolSplashRendering1; + } + + public LocalRenderCapsCallback LocalRenderCapsCallbackHandle => LocalRenderCapsCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_RenderCapsCallback); + + public LocalDeviceCallback LocalDeviceCallbackHandle => LocalDeviceCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_DeviceCallback); + + public LocalVideoPoolCallback LocalVideoPoolCallbackHandle => LocalVideoPoolCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_VideoPoolCallback); + + public LocalAnimationCallback LocalAnimationCallbackHandle => LocalAnimationCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_AnimationCallback); + + public LocalSoundBufferCallback LocalSoundBufferCallbackHandle => LocalSoundBufferCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_SoundBufferCallback); + + private ProtocolSplashRendering(RenderPort port) + : base(port, "Splash::Rendering") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_Window = port.InitRemoteClass("Splash::Rendering::Window"); + this._priv_remoteClass_RenderCaps = port.InitRemoteClass("Splash::Rendering::RenderCaps"); + this._priv_remoteClass_Visual = port.InitRemoteClass("Splash::Rendering::Visual"); + this._priv_remoteClass_Camera = port.InitRemoteClass("Splash::Rendering::Camera"); + this._priv_remoteClass_VisualContainer = port.InitRemoteClass("Splash::Rendering::VisualContainer"); + this._priv_remoteClass_Device = port.InitRemoteClass("Splash::Rendering::Device"); + this._priv_remoteClass_Surface = port.InitRemoteClass("Splash::Rendering::Surface"); + this._priv_remoteClass_SurfacePool = port.InitRemoteClass("Splash::Rendering::SurfacePool"); + this._priv_remoteClass_VideoPool = port.InitRemoteClass("Splash::Rendering::VideoPool"); + this._priv_remoteClass_Rasterizer = port.InitRemoteClass("Splash::Rendering::Rasterizer"); + this._priv_remoteClass_Gradient = port.InitRemoteClass("Splash::Rendering::Gradient"); + this._priv_remoteClass_AnimationManager = port.InitRemoteClass("Splash::Rendering::AnimationManager"); + this._priv_remoteClass_Animation = port.InitRemoteClass("Splash::Rendering::Animation"); + this._priv_remoteClass_ExternalAnimationInput = port.InitRemoteClass("Splash::Rendering::ExternalAnimationInput"); + this._priv_remoteClass_AnimationInputProvider = port.InitRemoteClass("Splash::Rendering::AnimationInputProvider"); + this._priv_remoteClass_WaitCursor = port.InitRemoteClass("Splash::Rendering::WaitCursor"); + this._priv_remoteClass_NullDevice = port.InitRemoteClass("Splash::Rendering::NullDevice"); + this._priv_remoteClass_Dx9Device = port.InitRemoteClass("Splash::Rendering::Dx9Device"); + this._priv_remoteClass_Dx9EffectResource = port.InitRemoteClass("Splash::Rendering::Dx9EffectResource"); + this._priv_remoteClass_Effect = port.InitRemoteClass("Splash::Rendering::Effect"); + this._priv_remoteClass_Dx9Effect = port.InitRemoteClass("Splash::Rendering::Dx9Effect"); + this._priv_remoteClass_Sprite = port.InitRemoteClass("Splash::Rendering::Sprite"); + this._priv_remoteClass_Dx9Sprite = port.InitRemoteClass("Splash::Rendering::Dx9Sprite"); + this._priv_remoteClass_DynamicSurfaceFactory = port.InitRemoteClass("Splash::Rendering::DynamicSurfaceFactory"); + this._priv_remoteClass_SoundBuffer = port.InitRemoteClass("Splash::Rendering::SoundBuffer"); + this._priv_remoteClass_Sound = port.InitRemoteClass("Splash::Rendering::Sound"); + this._priv_remoteClass_SoundDevice = port.InitRemoteClass("Splash::Rendering::SoundDevice"); + this._priv_callbackInstance_RenderCapsCallback = LocalRenderCapsCallback.BindCallback(port); + this._priv_callbackInstance_DeviceCallback = LocalDeviceCallback.BindCallback(port); + this._priv_callbackInstance_VideoPoolCallback = LocalVideoPoolCallback.BindCallback(port); + this._priv_callbackInstance_AnimationCallback = LocalAnimationCallback.BindCallback(port); + this._priv_callbackInstance_SoundBufferCallback = LocalSoundBufferCallback.BindCallback(port); + } + + internal RENDERHANDLE Window_ClassHandle => this._priv_remoteClass_Window; + + internal RENDERHANDLE RenderCaps_ClassHandle => this._priv_remoteClass_RenderCaps; + + internal RENDERHANDLE Visual_ClassHandle => this._priv_remoteClass_Visual; + + internal RENDERHANDLE Camera_ClassHandle => this._priv_remoteClass_Camera; + + internal RENDERHANDLE VisualContainer_ClassHandle => this._priv_remoteClass_VisualContainer; + + internal RENDERHANDLE Device_ClassHandle => this._priv_remoteClass_Device; + + internal RENDERHANDLE Surface_ClassHandle => this._priv_remoteClass_Surface; + + internal RENDERHANDLE SurfacePool_ClassHandle => this._priv_remoteClass_SurfacePool; + + internal RENDERHANDLE VideoPool_ClassHandle => this._priv_remoteClass_VideoPool; + + internal RENDERHANDLE Rasterizer_ClassHandle => this._priv_remoteClass_Rasterizer; + + internal RENDERHANDLE Gradient_ClassHandle => this._priv_remoteClass_Gradient; + + internal RENDERHANDLE AnimationManager_ClassHandle => this._priv_remoteClass_AnimationManager; + + internal RENDERHANDLE Animation_ClassHandle => this._priv_remoteClass_Animation; + + internal RENDERHANDLE ExternalAnimationInput_ClassHandle => this._priv_remoteClass_ExternalAnimationInput; + + internal RENDERHANDLE AnimationInputProvider_ClassHandle => this._priv_remoteClass_AnimationInputProvider; + + internal RENDERHANDLE WaitCursor_ClassHandle => this._priv_remoteClass_WaitCursor; + + internal RENDERHANDLE NullDevice_ClassHandle => this._priv_remoteClass_NullDevice; + + internal RENDERHANDLE Dx9Device_ClassHandle => this._priv_remoteClass_Dx9Device; + + internal RENDERHANDLE Dx9EffectResource_ClassHandle => this._priv_remoteClass_Dx9EffectResource; + + internal RENDERHANDLE Effect_ClassHandle => this._priv_remoteClass_Effect; + + internal RENDERHANDLE Dx9Effect_ClassHandle => this._priv_remoteClass_Dx9Effect; + + internal RENDERHANDLE Sprite_ClassHandle => this._priv_remoteClass_Sprite; + + internal RENDERHANDLE Dx9Sprite_ClassHandle => this._priv_remoteClass_Dx9Sprite; + + internal RENDERHANDLE DynamicSurfaceFactory_ClassHandle => this._priv_remoteClass_DynamicSurfaceFactory; + + internal RENDERHANDLE SoundBuffer_ClassHandle => this._priv_remoteClass_SoundBuffer; + + internal RENDERHANDLE Sound_ClassHandle => this._priv_remoteClass_Sound; + + internal RENDERHANDLE SoundDevice_ClassHandle => this._priv_remoteClass_SoundDevice; + + internal RENDERHANDLE RenderCapsCallback_CallbackInstance => this._priv_callbackInstance_RenderCapsCallback; + + internal RENDERHANDLE DeviceCallback_CallbackInstance => this._priv_callbackInstance_DeviceCallback; + + internal RENDERHANDLE VideoPoolCallback_CallbackInstance => this._priv_callbackInstance_VideoPoolCallback; + + internal RENDERHANDLE AnimationCallback_CallbackInstance => this._priv_callbackInstance_AnimationCallback; + + internal RENDERHANDLE SoundBufferCallback_CallbackInstance => this._priv_callbackInstance_SoundBufferCallback; + + internal RemoteRenderCaps BuildRemoteRenderCaps( + IRenderHandleOwner _priv_owner, + LocalRenderCapsCallback callback) + { + return RemoteRenderCaps.Create(this, _priv_owner, callback); + } + + internal RemoteCamera BuildRemoteCamera(IRenderHandleOwner _priv_owner) => RemoteCamera.Create(this, _priv_owner); + + internal RemoteVisualContainer BuildRemoteVisualContainer( + IRenderHandleOwner _priv_owner) + { + return RemoteVisualContainer.Create(this, _priv_owner); + } + + internal RemoteAnimationManager BuildRemoteAnimationManager( + IRenderHandleOwner _priv_owner) + { + return RemoteAnimationManager.Create(this, _priv_owner); + } + + internal RemoteAnimation BuildRemoteAnimation( + IRenderHandleOwner _priv_owner, + AnimationInputType animationType, + LocalAnimationCallback cb) + { + return RemoteAnimation.Create(this, _priv_owner, animationType, cb); + } + + internal RemoteExternalAnimationInput BuildRemoteExternalAnimationInput( + IRenderHandleOwner _priv_owner, + uint nUniqueId) + { + return RemoteExternalAnimationInput.Create(this, _priv_owner, nUniqueId); + } + + internal RemoteAnimationInputProvider BuildRemoteAnimationInputProvider( + IRenderHandleOwner _priv_owner, + uint nExternalAnimationInputId) + { + return RemoteAnimationInputProvider.Create(this, _priv_owner, nExternalAnimationInputId); + } + + internal RemoteWaitCursor BuildRemoteWaitCursor(IRenderHandleOwner _priv_owner) => RemoteWaitCursor.Create(this, _priv_owner); + + internal RemoteNullDevice BuildRemoteNullDevice( + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + return RemoteNullDevice.Create(this, _priv_owner, cb); + } + + internal RemoteDx9EffectResource BuildRemoteDx9EffectResource( + IRenderHandleOwner _priv_owner, + RemoteDevice devOwner, + RemoteDataBuffer dataBuffer) + { + return RemoteDx9EffectResource.Create(this, _priv_owner, devOwner, dataBuffer); + } + + internal RemoteDx9Sprite BuildRemoteDx9Sprite(IRenderHandleOwner _priv_owner) => RemoteDx9Sprite.Create(this, _priv_owner); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs new file mode 100644 index 0000000..cb44409 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs @@ -0,0 +1,1703 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteAnimation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteAnimation : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg43_Create; + private static ushort[] s_priv_ByteOrder_Msg0_RemoveAllEvents; + private static ushort[] s_priv_ByteOrder_Msg1_RemoveEvent; + private static ushort[] s_priv_ByteOrder_Msg2_AddValueEvent; + private static ushort[] s_priv_ByteOrder_Msg3_AddProgressEvent; + private static ushort[] s_priv_ByteOrder_Msg4_AddTimeEvent; + private static ushort[] s_priv_ByteOrder_Msg5_AddStageEvent; + private static ushort[] s_priv_ByteOrder_Msg6_RemoveTarget; + private static ushort[] s_priv_ByteOrder_Msg7_AddTarget; + private static ushort[] s_priv_ByteOrder_Msg8_SetEaseOut; + private static ushort[] s_priv_ByteOrder_Msg9_SetEaseIn; + private static ushort[] s_priv_ByteOrder_Msg10_SetBezier; + private static ushort[] s_priv_ByteOrder_Msg11_SetCosine; + private static ushort[] s_priv_ByteOrder_Msg12_SetSine; + private static ushort[] s_priv_ByteOrder_Msg13_SetSCurve; + private static ushort[] s_priv_ByteOrder_Msg14_SetLogarithmic; + private static ushort[] s_priv_ByteOrder_Msg15_SetExponential; + private static ushort[] s_priv_ByteOrder_Msg16_SetLinear; + private static ushort[] s_priv_ByteOrder_Msg17_SetBinaryOperation; + private static ushort[] s_priv_ByteOrder_Msg18_SetContinuous; + private static ushort[] s_priv_ByteOrder_Msg19_SetCaptured; + private static ushort[] s_priv_ByteOrder_Msg20_SetQuaternion; + private static ushort[] s_priv_ByteOrder_Msg21_SetVector4; + private static ushort[] s_priv_ByteOrder_Msg22_SetVector3; + private static ushort[] s_priv_ByteOrder_Msg23_SetVector2; + private static ushort[] s_priv_ByteOrder_Msg24_SetFloat; + private static ushort[] s_priv_ByteOrder_Msg25_EndAnimationInput; + private static ushort[] s_priv_ByteOrder_Msg26_BeginAnimationInput; + private static ushort[] s_priv_ByteOrder_Msg27_SetKeyframeTime; + private static ushort[] s_priv_ByteOrder_Msg29_SetKeyframeCount; + private static ushort[] s_priv_ByteOrder_Msg31_AddKeyframe; + private static ushort[] s_priv_ByteOrder_Msg32_InstantFinish; + private static ushort[] s_priv_ByteOrder_Msg33_InstantAdvance; + private static ushort[] s_priv_ByteOrder_Msg34_Reset; + private static ushort[] s_priv_ByteOrder_Msg35_Pause; + private static ushort[] s_priv_ByteOrder_Msg36_Play; + private static ushort[] s_priv_ByteOrder_Msg37_SetResetBehavior; + private static ushort[] s_priv_ByteOrder_Msg39_SetAutoReset; + private static ushort[] s_priv_ByteOrder_Msg41_SetRepeatCount; + + protected RemoteAnimation() + { + } + + public static unsafe RemoteAnimation Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + AnimationInputType animationType, + LocalAnimationCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE animationClassHandle = _priv_protocolInstance.Animation_ClassHandle; + RemoteAnimation remoteAnimation = new RemoteAnimation(port, _priv_owner); + uint num = (uint)sizeof(RemoteAnimation.Msg43_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteAnimation.Msg43_Create* msg43CreatePtr = (RemoteAnimation.Msg43_Create*)pMem; + msg43CreatePtr->_priv_size = num; + msg43CreatePtr->_priv_msgid = 43U; + msg43CreatePtr->animationType = animationType; + msg43CreatePtr->_priv_objcb = cb.RenderHandle; + msg43CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg43CreatePtr->_priv_idObjectSubject = remoteAnimation.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg43_Create, typeof(RemoteAnimation.Msg43_Create), 0, 0); + port.CreateRemoteObject(animationClassHandle, remoteAnimation.m_renderHandle, (Message*)msg43CreatePtr); + return remoteAnimation; + } + + public unsafe void BuildRemoveAllEvents( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg0_RemoveAllEvents); + RemoteAnimation.Msg0_RemoveAllEvents* msg0RemoveAllEventsPtr = (RemoteAnimation.Msg0_RemoveAllEvents*)_priv_portUse.AllocMessageBuffer(size); + msg0RemoveAllEventsPtr->_priv_size = size; + msg0RemoveAllEventsPtr->_priv_msgid = 0U; + msg0RemoveAllEventsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0RemoveAllEventsPtr, ref s_priv_ByteOrder_Msg0_RemoveAllEvents, typeof(RemoteAnimation.Msg0_RemoveAllEvents), 0, 0); + _priv_pmsgUse = (Message*)msg0RemoveAllEventsPtr; + } + + public unsafe void SendRemoveAllEvents() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRemoveAllEvents(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRemoveEvent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idEvent) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg1_RemoveEvent); + RemoteAnimation.Msg1_RemoveEvent* msg1RemoveEventPtr = (RemoteAnimation.Msg1_RemoveEvent*)_priv_portUse.AllocMessageBuffer(size); + msg1RemoveEventPtr->_priv_size = size; + msg1RemoveEventPtr->_priv_msgid = 1U; + msg1RemoveEventPtr->idEvent = idEvent; + msg1RemoveEventPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1RemoveEventPtr, ref s_priv_ByteOrder_Msg1_RemoveEvent, typeof(RemoteAnimation.Msg1_RemoveEvent), 0, 0); + _priv_pmsgUse = (Message*)msg1RemoveEventPtr; + } + + public unsafe void SendRemoveEvent(uint idEvent) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRemoveEvent(out _priv_portUse, out _priv_pmsgUse, idEvent); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddValueEvent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idEvent, + ValueEventCondition nCondition, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg2_AddValueEvent); + RemoteAnimation.Msg2_AddValueEvent* msg2AddValueEventPtr = (RemoteAnimation.Msg2_AddValueEvent*)_priv_portUse.AllocMessageBuffer(size); + msg2AddValueEventPtr->_priv_size = size; + msg2AddValueEventPtr->_priv_msgid = 2U; + msg2AddValueEventPtr->idEvent = idEvent; + msg2AddValueEventPtr->nCondition = nCondition; + msg2AddValueEventPtr->idTargetObject = idTargetObject; + msg2AddValueEventPtr->nTargetMethodId = nTargetMethodId; + msg2AddValueEventPtr->nTargetMethodArg = nTargetMethodArg; + msg2AddValueEventPtr->fInitialActivation = fInitialActivation ? uint.MaxValue : 0U; + msg2AddValueEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; + msg2AddValueEventPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2AddValueEventPtr, ref s_priv_ByteOrder_Msg2_AddValueEvent, typeof(RemoteAnimation.Msg2_AddValueEvent), 0, 0); + _priv_pmsgUse = (Message*)msg2AddValueEventPtr; + } + + public unsafe void SendAddValueEvent( + uint idEvent, + ValueEventCondition nCondition, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddValueEvent(out _priv_portUse, out _priv_pmsgUse, idEvent, nCondition, idTargetObject, nTargetMethodId, nTargetMethodArg, fInitialActivation, fAllowRepeat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProgressEvent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idEvent, + float flProgress, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg3_AddProgressEvent); + RemoteAnimation.Msg3_AddProgressEvent* addProgressEventPtr = (RemoteAnimation.Msg3_AddProgressEvent*)_priv_portUse.AllocMessageBuffer(size); + addProgressEventPtr->_priv_size = size; + addProgressEventPtr->_priv_msgid = 3U; + addProgressEventPtr->idEvent = idEvent; + addProgressEventPtr->flProgress = flProgress; + addProgressEventPtr->idTargetObject = idTargetObject; + addProgressEventPtr->nTargetMethodId = nTargetMethodId; + addProgressEventPtr->nTargetMethodArg = nTargetMethodArg; + addProgressEventPtr->fInitialActivation = fInitialActivation ? uint.MaxValue : 0U; + addProgressEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; + addProgressEventPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)addProgressEventPtr, ref s_priv_ByteOrder_Msg3_AddProgressEvent, typeof(RemoteAnimation.Msg3_AddProgressEvent), 0, 0); + _priv_pmsgUse = (Message*)addProgressEventPtr; + } + + public unsafe void SendAddProgressEvent( + uint idEvent, + float flProgress, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProgressEvent(out _priv_portUse, out _priv_pmsgUse, idEvent, flProgress, idTargetObject, nTargetMethodId, nTargetMethodArg, fInitialActivation, fAllowRepeat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddTimeEvent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idEvent, + float flEventTime, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg4_AddTimeEvent); + RemoteAnimation.Msg4_AddTimeEvent* msg4AddTimeEventPtr = (RemoteAnimation.Msg4_AddTimeEvent*)_priv_portUse.AllocMessageBuffer(size); + msg4AddTimeEventPtr->_priv_size = size; + msg4AddTimeEventPtr->_priv_msgid = 4U; + msg4AddTimeEventPtr->idEvent = idEvent; + msg4AddTimeEventPtr->flEventTime = flEventTime; + msg4AddTimeEventPtr->idTargetObject = idTargetObject; + msg4AddTimeEventPtr->nTargetMethodId = nTargetMethodId; + msg4AddTimeEventPtr->nTargetMethodArg = nTargetMethodArg; + msg4AddTimeEventPtr->fInitialActivation = fInitialActivation ? uint.MaxValue : 0U; + msg4AddTimeEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; + msg4AddTimeEventPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4AddTimeEventPtr, ref s_priv_ByteOrder_Msg4_AddTimeEvent, typeof(RemoteAnimation.Msg4_AddTimeEvent), 0, 0); + _priv_pmsgUse = (Message*)msg4AddTimeEventPtr; + } + + public unsafe void SendAddTimeEvent( + uint idEvent, + float flEventTime, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddTimeEvent(out _priv_portUse, out _priv_pmsgUse, idEvent, flEventTime, idTargetObject, nTargetMethodId, nTargetMethodArg, fInitialActivation, fAllowRepeat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddStageEvent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint idEvent, + AnimationStage nStage, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg5_AddStageEvent); + RemoteAnimation.Msg5_AddStageEvent* msg5AddStageEventPtr = (RemoteAnimation.Msg5_AddStageEvent*)_priv_portUse.AllocMessageBuffer(size); + msg5AddStageEventPtr->_priv_size = size; + msg5AddStageEventPtr->_priv_msgid = 5U; + msg5AddStageEventPtr->idEvent = idEvent; + msg5AddStageEventPtr->nStage = nStage; + msg5AddStageEventPtr->idTargetObject = idTargetObject; + msg5AddStageEventPtr->nTargetMethodId = nTargetMethodId; + msg5AddStageEventPtr->nTargetMethodArg = nTargetMethodArg; + msg5AddStageEventPtr->fInitialActivation = fInitialActivation ? uint.MaxValue : 0U; + msg5AddStageEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; + msg5AddStageEventPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5AddStageEventPtr, ref s_priv_ByteOrder_Msg5_AddStageEvent, typeof(RemoteAnimation.Msg5_AddStageEvent), 0, 0); + _priv_pmsgUse = (Message*)msg5AddStageEventPtr; + } + + public unsafe void SendAddStageEvent( + uint idEvent, + AnimationStage nStage, + RENDERHANDLE idTargetObject, + uint nTargetMethodId, + uint nTargetMethodArg, + bool fInitialActivation, + bool fAllowRepeat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddStageEvent(out _priv_portUse, out _priv_pmsgUse, idEvent, nStage, idTargetObject, nTargetMethodId, nTargetMethodArg, fInitialActivation, fAllowRepeat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRemoveTarget( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int targetId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg6_RemoveTarget); + RemoteAnimation.Msg6_RemoveTarget* msg6RemoveTargetPtr = (RemoteAnimation.Msg6_RemoveTarget*)_priv_portUse.AllocMessageBuffer(size); + msg6RemoveTargetPtr->_priv_size = size; + msg6RemoveTargetPtr->_priv_msgid = 6U; + msg6RemoveTargetPtr->targetId = targetId; + msg6RemoveTargetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg6RemoveTargetPtr, ref s_priv_ByteOrder_Msg6_RemoveTarget, typeof(RemoteAnimation.Msg6_RemoveTarget), 0, 0); + _priv_pmsgUse = (Message*)msg6RemoveTargetPtr; + } + + public unsafe void SendRemoveTarget(int targetId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRemoveTarget(out _priv_portUse, out _priv_pmsgUse, targetId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddTarget( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int targetId, + RENDERHANDLE objectId, + uint propertyId, + uint propertyInfo) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg7_AddTarget); + RemoteAnimation.Msg7_AddTarget* msg7AddTargetPtr = (RemoteAnimation.Msg7_AddTarget*)_priv_portUse.AllocMessageBuffer(size); + msg7AddTargetPtr->_priv_size = size; + msg7AddTargetPtr->_priv_msgid = 7U; + msg7AddTargetPtr->targetId = targetId; + msg7AddTargetPtr->objectId = objectId; + msg7AddTargetPtr->propertyId = propertyId; + msg7AddTargetPtr->propertyInfo = propertyInfo; + msg7AddTargetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7AddTargetPtr, ref s_priv_ByteOrder_Msg7_AddTarget, typeof(RemoteAnimation.Msg7_AddTarget), 0, 0); + _priv_pmsgUse = (Message*)msg7AddTargetPtr; + } + + public unsafe void SendAddTarget( + int targetId, + RENDERHANDLE objectId, + uint propertyId, + uint propertyInfo) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddTarget(out _priv_portUse, out _priv_pmsgUse, targetId, objectId, propertyId, propertyInfo); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEaseOut( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flWeight, + float flHandle) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg8_SetEaseOut); + RemoteAnimation.Msg8_SetEaseOut* msg8SetEaseOutPtr = (RemoteAnimation.Msg8_SetEaseOut*)_priv_portUse.AllocMessageBuffer(size); + msg8SetEaseOutPtr->_priv_size = size; + msg8SetEaseOutPtr->_priv_msgid = 8U; + msg8SetEaseOutPtr->idxKeyframe = idxKeyframe; + msg8SetEaseOutPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg8SetEaseOutPtr->flWeight = flWeight; + msg8SetEaseOutPtr->flHandle = flHandle; + msg8SetEaseOutPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8SetEaseOutPtr, ref s_priv_ByteOrder_Msg8_SetEaseOut, typeof(RemoteAnimation.Msg8_SetEaseOut), 0, 0); + _priv_pmsgUse = (Message*)msg8SetEaseOutPtr; + } + + public unsafe void SendSetEaseOut( + int idxKeyframe, + bool fSpherical, + float flWeight, + float flHandle) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEaseOut(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flWeight, flHandle); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEaseIn( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flWeight, + float flHandle) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg9_SetEaseIn); + RemoteAnimation.Msg9_SetEaseIn* msg9SetEaseInPtr = (RemoteAnimation.Msg9_SetEaseIn*)_priv_portUse.AllocMessageBuffer(size); + msg9SetEaseInPtr->_priv_size = size; + msg9SetEaseInPtr->_priv_msgid = 9U; + msg9SetEaseInPtr->idxKeyframe = idxKeyframe; + msg9SetEaseInPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg9SetEaseInPtr->flWeight = flWeight; + msg9SetEaseInPtr->flHandle = flHandle; + msg9SetEaseInPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg9SetEaseInPtr, ref s_priv_ByteOrder_Msg9_SetEaseIn, typeof(RemoteAnimation.Msg9_SetEaseIn), 0, 0); + _priv_pmsgUse = (Message*)msg9SetEaseInPtr; + } + + public unsafe void SendSetEaseIn( + int idxKeyframe, + bool fSpherical, + float flWeight, + float flHandle) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEaseIn(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flWeight, flHandle); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetBezier( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flHandle1, + float flHandle2) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg10_SetBezier); + RemoteAnimation.Msg10_SetBezier* msg10SetBezierPtr = (RemoteAnimation.Msg10_SetBezier*)_priv_portUse.AllocMessageBuffer(size); + msg10SetBezierPtr->_priv_size = size; + msg10SetBezierPtr->_priv_msgid = 10U; + msg10SetBezierPtr->idxKeyframe = idxKeyframe; + msg10SetBezierPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg10SetBezierPtr->flHandle1 = flHandle1; + msg10SetBezierPtr->flHandle2 = flHandle2; + msg10SetBezierPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg10SetBezierPtr, ref s_priv_ByteOrder_Msg10_SetBezier, typeof(RemoteAnimation.Msg10_SetBezier), 0, 0); + _priv_pmsgUse = (Message*)msg10SetBezierPtr; + } + + public unsafe void SendSetBezier( + int idxKeyframe, + bool fSpherical, + float flHandle1, + float flHandle2) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetBezier(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flHandle1, flHandle2); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetCosine( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg11_SetCosine); + RemoteAnimation.Msg11_SetCosine* msg11SetCosinePtr = (RemoteAnimation.Msg11_SetCosine*)_priv_portUse.AllocMessageBuffer(size); + msg11SetCosinePtr->_priv_size = size; + msg11SetCosinePtr->_priv_msgid = 11U; + msg11SetCosinePtr->idxKeyframe = idxKeyframe; + msg11SetCosinePtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg11SetCosinePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg11SetCosinePtr, ref s_priv_ByteOrder_Msg11_SetCosine, typeof(RemoteAnimation.Msg11_SetCosine), 0, 0); + _priv_pmsgUse = (Message*)msg11SetCosinePtr; + } + + public unsafe void SendSetCosine(int idxKeyframe, bool fSpherical) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCosine(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetSine( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg12_SetSine); + RemoteAnimation.Msg12_SetSine* msg12SetSinePtr = (RemoteAnimation.Msg12_SetSine*)_priv_portUse.AllocMessageBuffer(size); + msg12SetSinePtr->_priv_size = size; + msg12SetSinePtr->_priv_msgid = 12U; + msg12SetSinePtr->idxKeyframe = idxKeyframe; + msg12SetSinePtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg12SetSinePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg12SetSinePtr, ref s_priv_ByteOrder_Msg12_SetSine, typeof(RemoteAnimation.Msg12_SetSine), 0, 0); + _priv_pmsgUse = (Message*)msg12SetSinePtr; + } + + public unsafe void SendSetSine(int idxKeyframe, bool fSpherical) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetSine(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetSCurve( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flWeight) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg13_SetSCurve); + RemoteAnimation.Msg13_SetSCurve* msg13SetScurvePtr = (RemoteAnimation.Msg13_SetSCurve*)_priv_portUse.AllocMessageBuffer(size); + msg13SetScurvePtr->_priv_size = size; + msg13SetScurvePtr->_priv_msgid = 13U; + msg13SetScurvePtr->idxKeyframe = idxKeyframe; + msg13SetScurvePtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg13SetScurvePtr->flWeight = flWeight; + msg13SetScurvePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg13SetScurvePtr, ref s_priv_ByteOrder_Msg13_SetSCurve, typeof(RemoteAnimation.Msg13_SetSCurve), 0, 0); + _priv_pmsgUse = (Message*)msg13SetScurvePtr; + } + + public unsafe void SendSetSCurve(int idxKeyframe, bool fSpherical, float flWeight) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetSCurve(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flWeight); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetLogarithmic( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flWeight) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg14_SetLogarithmic); + RemoteAnimation.Msg14_SetLogarithmic* msg14SetLogarithmicPtr = (RemoteAnimation.Msg14_SetLogarithmic*)_priv_portUse.AllocMessageBuffer(size); + msg14SetLogarithmicPtr->_priv_size = size; + msg14SetLogarithmicPtr->_priv_msgid = 14U; + msg14SetLogarithmicPtr->idxKeyframe = idxKeyframe; + msg14SetLogarithmicPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg14SetLogarithmicPtr->flWeight = flWeight; + msg14SetLogarithmicPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg14SetLogarithmicPtr, ref s_priv_ByteOrder_Msg14_SetLogarithmic, typeof(RemoteAnimation.Msg14_SetLogarithmic), 0, 0); + _priv_pmsgUse = (Message*)msg14SetLogarithmicPtr; + } + + public unsafe void SendSetLogarithmic(int idxKeyframe, bool fSpherical, float flWeight) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetLogarithmic(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flWeight); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetExponential( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical, + float flWeight) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg15_SetExponential); + RemoteAnimation.Msg15_SetExponential* msg15SetExponentialPtr = (RemoteAnimation.Msg15_SetExponential*)_priv_portUse.AllocMessageBuffer(size); + msg15SetExponentialPtr->_priv_size = size; + msg15SetExponentialPtr->_priv_msgid = 15U; + msg15SetExponentialPtr->idxKeyframe = idxKeyframe; + msg15SetExponentialPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg15SetExponentialPtr->flWeight = flWeight; + msg15SetExponentialPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg15SetExponentialPtr, ref s_priv_ByteOrder_Msg15_SetExponential, typeof(RemoteAnimation.Msg15_SetExponential), 0, 0); + _priv_pmsgUse = (Message*)msg15SetExponentialPtr; + } + + public unsafe void SendSetExponential(int idxKeyframe, bool fSpherical, float flWeight) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetExponential(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical, flWeight); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetLinear( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + bool fSpherical) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg16_SetLinear); + RemoteAnimation.Msg16_SetLinear* msg16SetLinearPtr = (RemoteAnimation.Msg16_SetLinear*)_priv_portUse.AllocMessageBuffer(size); + msg16SetLinearPtr->_priv_size = size; + msg16SetLinearPtr->_priv_msgid = 16U; + msg16SetLinearPtr->idxKeyframe = idxKeyframe; + msg16SetLinearPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; + msg16SetLinearPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg16SetLinearPtr, ref s_priv_ByteOrder_Msg16_SetLinear, typeof(RemoteAnimation.Msg16_SetLinear), 0, 0); + _priv_pmsgUse = (Message*)msg16SetLinearPtr; + } + + public unsafe void SendSetLinear(int idxKeyframe, bool fSpherical) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetLinear(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, fSpherical); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetBinaryOperation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + BinaryOpCode opCode) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg17_SetBinaryOperation); + RemoteAnimation.Msg17_SetBinaryOperation* setBinaryOperationPtr = (RemoteAnimation.Msg17_SetBinaryOperation*)_priv_portUse.AllocMessageBuffer(size); + setBinaryOperationPtr->_priv_size = size; + setBinaryOperationPtr->_priv_msgid = 17U; + setBinaryOperationPtr->idxKeyframe = idxKeyframe; + setBinaryOperationPtr->opCode = opCode; + setBinaryOperationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setBinaryOperationPtr, ref s_priv_ByteOrder_Msg17_SetBinaryOperation, typeof(RemoteAnimation.Msg17_SetBinaryOperation), 0, 0); + _priv_pmsgUse = (Message*)setBinaryOperationPtr; + } + + public unsafe void SendSetBinaryOperation(int idxKeyframe, BinaryOpCode opCode) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetBinaryOperation(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, opCode); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetContinuous( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + RENDERHANDLE idObject, + uint idProperty, + uint propertyInfo) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg18_SetContinuous); + RemoteAnimation.Msg18_SetContinuous* msg18SetContinuousPtr = (RemoteAnimation.Msg18_SetContinuous*)_priv_portUse.AllocMessageBuffer(size); + msg18SetContinuousPtr->_priv_size = size; + msg18SetContinuousPtr->_priv_msgid = 18U; + msg18SetContinuousPtr->idxKeyframe = idxKeyframe; + msg18SetContinuousPtr->idObject = idObject; + msg18SetContinuousPtr->idProperty = idProperty; + msg18SetContinuousPtr->propertyInfo = propertyInfo; + msg18SetContinuousPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg18SetContinuousPtr, ref s_priv_ByteOrder_Msg18_SetContinuous, typeof(RemoteAnimation.Msg18_SetContinuous), 0, 0); + _priv_pmsgUse = (Message*)msg18SetContinuousPtr; + } + + public unsafe void SendSetContinuous( + int idxKeyframe, + RENDERHANDLE idObject, + uint idProperty, + uint propertyInfo) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetContinuous(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, idObject, idProperty, propertyInfo); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetCaptured( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + RENDERHANDLE idObject, + uint idProperty, + uint propertyInfo, + bool fRefreshOnRepeat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg19_SetCaptured); + RemoteAnimation.Msg19_SetCaptured* msg19SetCapturedPtr = (RemoteAnimation.Msg19_SetCaptured*)_priv_portUse.AllocMessageBuffer(size); + msg19SetCapturedPtr->_priv_size = size; + msg19SetCapturedPtr->_priv_msgid = 19U; + msg19SetCapturedPtr->idxKeyframe = idxKeyframe; + msg19SetCapturedPtr->idObject = idObject; + msg19SetCapturedPtr->idProperty = idProperty; + msg19SetCapturedPtr->propertyInfo = propertyInfo; + msg19SetCapturedPtr->fRefreshOnRepeat = fRefreshOnRepeat ? uint.MaxValue : 0U; + msg19SetCapturedPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg19SetCapturedPtr, ref s_priv_ByteOrder_Msg19_SetCaptured, typeof(RemoteAnimation.Msg19_SetCaptured), 0, 0); + _priv_pmsgUse = (Message*)msg19SetCapturedPtr; + } + + public unsafe void SendSetCaptured( + int idxKeyframe, + RENDERHANDLE idObject, + uint idProperty, + uint propertyInfo, + bool fRefreshOnRepeat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCaptured(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, idObject, idProperty, propertyInfo, fRefreshOnRepeat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetQuaternion( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + Quaternion qValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg20_SetQuaternion); + RemoteAnimation.Msg20_SetQuaternion* msg20SetQuaternionPtr = (RemoteAnimation.Msg20_SetQuaternion*)_priv_portUse.AllocMessageBuffer(size); + msg20SetQuaternionPtr->_priv_size = size; + msg20SetQuaternionPtr->_priv_msgid = 20U; + msg20SetQuaternionPtr->idxKeyframe = idxKeyframe; + msg20SetQuaternionPtr->qValue = qValue; + msg20SetQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg20SetQuaternionPtr, ref s_priv_ByteOrder_Msg20_SetQuaternion, typeof(RemoteAnimation.Msg20_SetQuaternion), 0, 0); + _priv_pmsgUse = (Message*)msg20SetQuaternionPtr; + } + + public unsafe void SendSetQuaternion(int idxKeyframe, Quaternion qValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetQuaternion(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, qValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVector4( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + Vector4 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg21_SetVector4); + RemoteAnimation.Msg21_SetVector4* msg21SetVector4Ptr = (RemoteAnimation.Msg21_SetVector4*)_priv_portUse.AllocMessageBuffer(size); + msg21SetVector4Ptr->_priv_size = size; + msg21SetVector4Ptr->_priv_msgid = 21U; + msg21SetVector4Ptr->idxKeyframe = idxKeyframe; + msg21SetVector4Ptr->vValue = vValue; + msg21SetVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg21SetVector4Ptr, ref s_priv_ByteOrder_Msg21_SetVector4, typeof(RemoteAnimation.Msg21_SetVector4), 0, 0); + _priv_pmsgUse = (Message*)msg21SetVector4Ptr; + } + + public unsafe void SendSetVector4(int idxKeyframe, Vector4 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVector4(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVector3( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + Vector3 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg22_SetVector3); + RemoteAnimation.Msg22_SetVector3* msg22SetVector3Ptr = (RemoteAnimation.Msg22_SetVector3*)_priv_portUse.AllocMessageBuffer(size); + msg22SetVector3Ptr->_priv_size = size; + msg22SetVector3Ptr->_priv_msgid = 22U; + msg22SetVector3Ptr->idxKeyframe = idxKeyframe; + msg22SetVector3Ptr->vValue = vValue; + msg22SetVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg22SetVector3Ptr, ref s_priv_ByteOrder_Msg22_SetVector3, typeof(RemoteAnimation.Msg22_SetVector3), 0, 0); + _priv_pmsgUse = (Message*)msg22SetVector3Ptr; + } + + public unsafe void SendSetVector3(int idxKeyframe, Vector3 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVector3(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVector2( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + Vector2 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg23_SetVector2); + RemoteAnimation.Msg23_SetVector2* msg23SetVector2Ptr = (RemoteAnimation.Msg23_SetVector2*)_priv_portUse.AllocMessageBuffer(size); + msg23SetVector2Ptr->_priv_size = size; + msg23SetVector2Ptr->_priv_msgid = 23U; + msg23SetVector2Ptr->idxKeyframe = idxKeyframe; + msg23SetVector2Ptr->vValue = vValue; + msg23SetVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg23SetVector2Ptr, ref s_priv_ByteOrder_Msg23_SetVector2, typeof(RemoteAnimation.Msg23_SetVector2), 0, 0); + _priv_pmsgUse = (Message*)msg23SetVector2Ptr; + } + + public unsafe void SendSetVector2(int idxKeyframe, Vector2 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVector2(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetFloat( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + float flValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg24_SetFloat); + RemoteAnimation.Msg24_SetFloat* msg24SetFloatPtr = (RemoteAnimation.Msg24_SetFloat*)_priv_portUse.AllocMessageBuffer(size); + msg24SetFloatPtr->_priv_size = size; + msg24SetFloatPtr->_priv_msgid = 24U; + msg24SetFloatPtr->idxKeyframe = idxKeyframe; + msg24SetFloatPtr->flValue = flValue; + msg24SetFloatPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg24SetFloatPtr, ref s_priv_ByteOrder_Msg24_SetFloat, typeof(RemoteAnimation.Msg24_SetFloat), 0, 0); + _priv_pmsgUse = (Message*)msg24SetFloatPtr; + } + + public unsafe void SendSetFloat(int idxKeyframe, float flValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetFloat(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, flValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEndAnimationInput( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg25_EndAnimationInput); + RemoteAnimation.Msg25_EndAnimationInput* endAnimationInputPtr = (RemoteAnimation.Msg25_EndAnimationInput*)_priv_portUse.AllocMessageBuffer(size); + endAnimationInputPtr->_priv_size = size; + endAnimationInputPtr->_priv_msgid = 25U; + endAnimationInputPtr->idxKeyframe = idxKeyframe; + endAnimationInputPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)endAnimationInputPtr, ref s_priv_ByteOrder_Msg25_EndAnimationInput, typeof(RemoteAnimation.Msg25_EndAnimationInput), 0, 0); + _priv_pmsgUse = (Message*)endAnimationInputPtr; + } + + public unsafe void SendEndAnimationInput(int idxKeyframe) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEndAnimationInput(out _priv_portUse, out _priv_pmsgUse, idxKeyframe); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildBeginAnimationInput( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg26_BeginAnimationInput); + RemoteAnimation.Msg26_BeginAnimationInput* beginAnimationInputPtr = (RemoteAnimation.Msg26_BeginAnimationInput*)_priv_portUse.AllocMessageBuffer(size); + beginAnimationInputPtr->_priv_size = size; + beginAnimationInputPtr->_priv_msgid = 26U; + beginAnimationInputPtr->idxKeyframe = idxKeyframe; + beginAnimationInputPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)beginAnimationInputPtr, ref s_priv_ByteOrder_Msg26_BeginAnimationInput, typeof(RemoteAnimation.Msg26_BeginAnimationInput), 0, 0); + _priv_pmsgUse = (Message*)beginAnimationInputPtr; + } + + public unsafe void SendBeginAnimationInput(int idxKeyframe) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildBeginAnimationInput(out _priv_portUse, out _priv_pmsgUse, idxKeyframe); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetKeyframeTime( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + float flTimeSec) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg27_SetKeyframeTime); + RemoteAnimation.Msg27_SetKeyframeTime* msg27SetKeyframeTimePtr = (RemoteAnimation.Msg27_SetKeyframeTime*)_priv_portUse.AllocMessageBuffer(size); + msg27SetKeyframeTimePtr->_priv_size = size; + msg27SetKeyframeTimePtr->_priv_msgid = 27U; + msg27SetKeyframeTimePtr->idxKeyframe = idxKeyframe; + msg27SetKeyframeTimePtr->flTimeSec = flTimeSec; + msg27SetKeyframeTimePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg27SetKeyframeTimePtr, ref s_priv_ByteOrder_Msg27_SetKeyframeTime, typeof(RemoteAnimation.Msg27_SetKeyframeTime), 0, 0); + _priv_pmsgUse = (Message*)msg27SetKeyframeTimePtr; + } + + public unsafe void SendSetKeyframeTime(int idxKeyframe, float flTimeSec) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetKeyframeTime(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, flTimeSec); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetKeyframeCount( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int cKeyframes) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg29_SetKeyframeCount); + RemoteAnimation.Msg29_SetKeyframeCount* setKeyframeCountPtr = (RemoteAnimation.Msg29_SetKeyframeCount*)_priv_portUse.AllocMessageBuffer(size); + setKeyframeCountPtr->_priv_size = size; + setKeyframeCountPtr->_priv_msgid = 29U; + setKeyframeCountPtr->cKeyframes = cKeyframes; + setKeyframeCountPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setKeyframeCountPtr, ref s_priv_ByteOrder_Msg29_SetKeyframeCount, typeof(RemoteAnimation.Msg29_SetKeyframeCount), 0, 0); + _priv_pmsgUse = (Message*)setKeyframeCountPtr; + } + + public unsafe void SendSetKeyframeCount(int cKeyframes) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetKeyframeCount(out _priv_portUse, out _priv_pmsgUse, cKeyframes); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddKeyframe( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxKeyframe, + float flTimeSec) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg31_AddKeyframe); + RemoteAnimation.Msg31_AddKeyframe* msg31AddKeyframePtr = (RemoteAnimation.Msg31_AddKeyframe*)_priv_portUse.AllocMessageBuffer(size); + msg31AddKeyframePtr->_priv_size = size; + msg31AddKeyframePtr->_priv_msgid = 31U; + msg31AddKeyframePtr->idxKeyframe = idxKeyframe; + msg31AddKeyframePtr->flTimeSec = flTimeSec; + msg31AddKeyframePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg31AddKeyframePtr, ref s_priv_ByteOrder_Msg31_AddKeyframe, typeof(RemoteAnimation.Msg31_AddKeyframe), 0, 0); + _priv_pmsgUse = (Message*)msg31AddKeyframePtr; + } + + public unsafe void SendAddKeyframe(int idxKeyframe, float flTimeSec) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddKeyframe(out _priv_portUse, out _priv_pmsgUse, idxKeyframe, flTimeSec); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildInstantFinish(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg32_InstantFinish); + RemoteAnimation.Msg32_InstantFinish* msg32InstantFinishPtr = (RemoteAnimation.Msg32_InstantFinish*)_priv_portUse.AllocMessageBuffer(size); + msg32InstantFinishPtr->_priv_size = size; + msg32InstantFinishPtr->_priv_msgid = 32U; + msg32InstantFinishPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg32InstantFinishPtr, ref s_priv_ByteOrder_Msg32_InstantFinish, typeof(RemoteAnimation.Msg32_InstantFinish), 0, 0); + _priv_pmsgUse = (Message*)msg32InstantFinishPtr; + } + + public unsafe void SendInstantFinish() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildInstantFinish(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildInstantAdvance( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float advanceTime) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg33_InstantAdvance); + RemoteAnimation.Msg33_InstantAdvance* msg33InstantAdvancePtr = (RemoteAnimation.Msg33_InstantAdvance*)_priv_portUse.AllocMessageBuffer(size); + msg33InstantAdvancePtr->_priv_size = size; + msg33InstantAdvancePtr->_priv_msgid = 33U; + msg33InstantAdvancePtr->advanceTime = advanceTime; + msg33InstantAdvancePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg33InstantAdvancePtr, ref s_priv_ByteOrder_Msg33_InstantAdvance, typeof(RemoteAnimation.Msg33_InstantAdvance), 0, 0); + _priv_pmsgUse = (Message*)msg33InstantAdvancePtr; + } + + public unsafe void SendInstantAdvance(float advanceTime) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildInstantAdvance(out _priv_portUse, out _priv_pmsgUse, advanceTime); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildReset(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg34_Reset); + RemoteAnimation.Msg34_Reset* msg34ResetPtr = (RemoteAnimation.Msg34_Reset*)_priv_portUse.AllocMessageBuffer(size); + msg34ResetPtr->_priv_size = size; + msg34ResetPtr->_priv_msgid = 34U; + msg34ResetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg34ResetPtr, ref s_priv_ByteOrder_Msg34_Reset, typeof(RemoteAnimation.Msg34_Reset), 0, 0); + _priv_pmsgUse = (Message*)msg34ResetPtr; + } + + public unsafe void SendReset() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildReset(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPause(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg35_Pause); + RemoteAnimation.Msg35_Pause* msg35PausePtr = (RemoteAnimation.Msg35_Pause*)_priv_portUse.AllocMessageBuffer(size); + msg35PausePtr->_priv_size = size; + msg35PausePtr->_priv_msgid = 35U; + msg35PausePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg35PausePtr, ref s_priv_ByteOrder_Msg35_Pause, typeof(RemoteAnimation.Msg35_Pause), 0, 0); + _priv_pmsgUse = (Message*)msg35PausePtr; + } + + public unsafe void SendPause() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPause(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPlay(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg36_Play); + RemoteAnimation.Msg36_Play* msg36PlayPtr = (RemoteAnimation.Msg36_Play*)_priv_portUse.AllocMessageBuffer(size); + msg36PlayPtr->_priv_size = size; + msg36PlayPtr->_priv_msgid = 36U; + msg36PlayPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg36PlayPtr, ref s_priv_ByteOrder_Msg36_Play, typeof(RemoteAnimation.Msg36_Play), 0, 0); + _priv_pmsgUse = (Message*)msg36PlayPtr; + } + + public unsafe void SendPlay() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPlay(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetResetBehavior( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + AnimationResetBehavior behavior) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg37_SetResetBehavior); + RemoteAnimation.Msg37_SetResetBehavior* setResetBehaviorPtr = (RemoteAnimation.Msg37_SetResetBehavior*)_priv_portUse.AllocMessageBuffer(size); + setResetBehaviorPtr->_priv_size = size; + setResetBehaviorPtr->_priv_msgid = 37U; + setResetBehaviorPtr->behavior = behavior; + setResetBehaviorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setResetBehaviorPtr, ref s_priv_ByteOrder_Msg37_SetResetBehavior, typeof(RemoteAnimation.Msg37_SetResetBehavior), 0, 0); + _priv_pmsgUse = (Message*)setResetBehaviorPtr; + } + + public unsafe void SendSetResetBehavior(AnimationResetBehavior behavior) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetResetBehavior(out _priv_portUse, out _priv_pmsgUse, behavior); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetAutoReset( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fAutoReset) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg39_SetAutoReset); + RemoteAnimation.Msg39_SetAutoReset* msg39SetAutoResetPtr = (RemoteAnimation.Msg39_SetAutoReset*)_priv_portUse.AllocMessageBuffer(size); + msg39SetAutoResetPtr->_priv_size = size; + msg39SetAutoResetPtr->_priv_msgid = 39U; + msg39SetAutoResetPtr->fAutoReset = fAutoReset ? uint.MaxValue : 0U; + msg39SetAutoResetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg39SetAutoResetPtr, ref s_priv_ByteOrder_Msg39_SetAutoReset, typeof(RemoteAnimation.Msg39_SetAutoReset), 0, 0); + _priv_pmsgUse = (Message*)msg39SetAutoResetPtr; + } + + public unsafe void SendSetAutoReset(bool fAutoReset) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAutoReset(out _priv_portUse, out _priv_pmsgUse, fAutoReset); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetRepeatCount( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int cRepeats) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimation.Msg41_SetRepeatCount); + RemoteAnimation.Msg41_SetRepeatCount* msg41SetRepeatCountPtr = (RemoteAnimation.Msg41_SetRepeatCount*)_priv_portUse.AllocMessageBuffer(size); + msg41SetRepeatCountPtr->_priv_size = size; + msg41SetRepeatCountPtr->_priv_msgid = 41U; + msg41SetRepeatCountPtr->cRepeats = cRepeats; + msg41SetRepeatCountPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg41SetRepeatCountPtr, ref s_priv_ByteOrder_Msg41_SetRepeatCount, typeof(RemoteAnimation.Msg41_SetRepeatCount), 0, 0); + _priv_pmsgUse = (Message*)msg41SetRepeatCountPtr; + } + + public unsafe void SendSetRepeatCount(int cRepeats) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetRepeatCount(out _priv_portUse, out _priv_pmsgUse, cRepeats); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteAnimation CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteAnimation(port, handle, true); + } + + public static RemoteAnimation CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteAnimation(port, handle, false); + } + + protected RemoteAnimation(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteAnimation(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteAnimation && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg43_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public AnimationInputType animationType; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + + [ComVisible(false)] + private struct Msg0_RemoveAllEvents + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_RemoveEvent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idEvent; + } + + [ComVisible(false)] + private struct Msg2_AddValueEvent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idEvent; + public ValueEventCondition nCondition; + public RENDERHANDLE idTargetObject; + public uint nTargetMethodId; + public uint nTargetMethodArg; + public uint fInitialActivation; + public uint fAllowRepeat; + } + + [ComVisible(false)] + private struct Msg3_AddProgressEvent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idEvent; + public float flProgress; + public RENDERHANDLE idTargetObject; + public uint nTargetMethodId; + public uint nTargetMethodArg; + public uint fInitialActivation; + public uint fAllowRepeat; + } + + [ComVisible(false)] + private struct Msg4_AddTimeEvent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idEvent; + public float flEventTime; + public RENDERHANDLE idTargetObject; + public uint nTargetMethodId; + public uint nTargetMethodArg; + public uint fInitialActivation; + public uint fAllowRepeat; + } + + [ComVisible(false)] + private struct Msg5_AddStageEvent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint idEvent; + public AnimationStage nStage; + public RENDERHANDLE idTargetObject; + public uint nTargetMethodId; + public uint nTargetMethodArg; + public uint fInitialActivation; + public uint fAllowRepeat; + } + + [ComVisible(false)] + private struct Msg6_RemoveTarget + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int targetId; + } + + [ComVisible(false)] + private struct Msg7_AddTarget + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int targetId; + public RENDERHANDLE objectId; + public uint propertyId; + public uint propertyInfo; + } + + [ComVisible(false)] + private struct Msg8_SetEaseOut + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flWeight; + public float flHandle; + } + + [ComVisible(false)] + private struct Msg9_SetEaseIn + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flWeight; + public float flHandle; + } + + [ComVisible(false)] + private struct Msg10_SetBezier + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flHandle1; + public float flHandle2; + } + + [ComVisible(false)] + private struct Msg11_SetCosine + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + } + + [ComVisible(false)] + private struct Msg12_SetSine + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + } + + [ComVisible(false)] + private struct Msg13_SetSCurve + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flWeight; + } + + [ComVisible(false)] + private struct Msg14_SetLogarithmic + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flWeight; + } + + [ComVisible(false)] + private struct Msg15_SetExponential + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + public float flWeight; + } + + [ComVisible(false)] + private struct Msg16_SetLinear + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public uint fSpherical; + } + + [ComVisible(false)] + private struct Msg17_SetBinaryOperation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public BinaryOpCode opCode; + } + + [ComVisible(false)] + private struct Msg18_SetContinuous + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public RENDERHANDLE idObject; + public uint idProperty; + public uint propertyInfo; + } + + [ComVisible(false)] + private struct Msg19_SetCaptured + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public RENDERHANDLE idObject; + public uint idProperty; + public uint propertyInfo; + public uint fRefreshOnRepeat; + } + + [ComVisible(false)] + private struct Msg20_SetQuaternion + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public Quaternion qValue; + } + + [ComVisible(false)] + private struct Msg21_SetVector4 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public Vector4 vValue; + } + + [ComVisible(false)] + private struct Msg22_SetVector3 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public Vector3 vValue; + } + + [ComVisible(false)] + private struct Msg23_SetVector2 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public Vector2 vValue; + } + + [ComVisible(false)] + private struct Msg24_SetFloat + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public float flValue; + } + + [ComVisible(false)] + private struct Msg25_EndAnimationInput + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + } + + [ComVisible(false)] + private struct Msg26_BeginAnimationInput + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + } + + [ComVisible(false)] + private struct Msg27_SetKeyframeTime + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public float flTimeSec; + } + + [ComVisible(false)] + private struct Msg29_SetKeyframeCount + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int cKeyframes; + } + + [ComVisible(false)] + private struct Msg31_AddKeyframe + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxKeyframe; + public float flTimeSec; + } + + [ComVisible(false)] + private struct Msg32_InstantFinish + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg33_InstantAdvance + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float advanceTime; + } + + [ComVisible(false)] + private struct Msg34_Reset + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg35_Pause + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg36_Play + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg37_SetResetBehavior + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public AnimationResetBehavior behavior; + } + + [ComVisible(false)] + private struct Msg39_SetAutoReset + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fAutoReset; + } + + [ComVisible(false)] + private struct Msg41_SetRepeatCount + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int cRepeats; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs new file mode 100644 index 0000000..84e3d23 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs @@ -0,0 +1,470 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteAnimationInputProvider +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteAnimationInputProvider : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg10_Create; + private static ushort[] s_priv_ByteOrder_Msg0_RevokeQuaternion; + private static ushort[] s_priv_ByteOrder_Msg1_RevokeVector4; + private static ushort[] s_priv_ByteOrder_Msg2_RevokeVector3; + private static ushort[] s_priv_ByteOrder_Msg3_RevokeVector2; + private static ushort[] s_priv_ByteOrder_Msg4_RevokeFloat; + private static ushort[] s_priv_ByteOrder_Msg5_PublishQuaternion; + private static ushort[] s_priv_ByteOrder_Msg6_PublishVector4; + private static ushort[] s_priv_ByteOrder_Msg7_PublishVector3; + private static ushort[] s_priv_ByteOrder_Msg8_PublishVector2; + private static ushort[] s_priv_ByteOrder_Msg9_PublishFloat; + + protected RemoteAnimationInputProvider() + { + } + + public static unsafe RemoteAnimationInputProvider Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + uint nExternalAnimationInputId) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE providerClassHandle = _priv_protocolInstance.AnimationInputProvider_ClassHandle; + RemoteAnimationInputProvider animationInputProvider = new RemoteAnimationInputProvider(port, _priv_owner); + uint num = (uint)sizeof(RemoteAnimationInputProvider.Msg10_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteAnimationInputProvider.Msg10_Create* msg10CreatePtr = (RemoteAnimationInputProvider.Msg10_Create*)pMem; + msg10CreatePtr->_priv_size = num; + msg10CreatePtr->_priv_msgid = 10U; + msg10CreatePtr->nExternalAnimationInputId = nExternalAnimationInputId; + msg10CreatePtr->_priv_idObjectSubject = animationInputProvider.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg10_Create, typeof(RemoteAnimationInputProvider.Msg10_Create), 0, 0); + port.CreateRemoteObject(providerClassHandle, animationInputProvider.m_renderHandle, (Message*)msg10CreatePtr); + return animationInputProvider; + } + + public unsafe void BuildRevokeQuaternion( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg0_RevokeQuaternion); + RemoteAnimationInputProvider.Msg0_RevokeQuaternion* revokeQuaternionPtr = (RemoteAnimationInputProvider.Msg0_RevokeQuaternion*)_priv_portUse.AllocMessageBuffer(size); + revokeQuaternionPtr->_priv_size = size; + revokeQuaternionPtr->_priv_msgid = 0U; + revokeQuaternionPtr->propertyId = propertyId; + revokeQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)revokeQuaternionPtr, ref s_priv_ByteOrder_Msg0_RevokeQuaternion, typeof(RemoteAnimationInputProvider.Msg0_RevokeQuaternion), 0, 0); + _priv_pmsgUse = (Message*)revokeQuaternionPtr; + } + + public unsafe void SendRevokeQuaternion(uint propertyId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRevokeQuaternion(out _priv_portUse, out _priv_pmsgUse, propertyId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRevokeVector4( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg1_RevokeVector4); + RemoteAnimationInputProvider.Msg1_RevokeVector4* msg1RevokeVector4Ptr = (RemoteAnimationInputProvider.Msg1_RevokeVector4*)_priv_portUse.AllocMessageBuffer(size); + msg1RevokeVector4Ptr->_priv_size = size; + msg1RevokeVector4Ptr->_priv_msgid = 1U; + msg1RevokeVector4Ptr->propertyId = propertyId; + msg1RevokeVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1RevokeVector4Ptr, ref s_priv_ByteOrder_Msg1_RevokeVector4, typeof(RemoteAnimationInputProvider.Msg1_RevokeVector4), 0, 0); + _priv_pmsgUse = (Message*)msg1RevokeVector4Ptr; + } + + public unsafe void SendRevokeVector4(uint propertyId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRevokeVector4(out _priv_portUse, out _priv_pmsgUse, propertyId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRevokeVector3( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg2_RevokeVector3); + RemoteAnimationInputProvider.Msg2_RevokeVector3* msg2RevokeVector3Ptr = (RemoteAnimationInputProvider.Msg2_RevokeVector3*)_priv_portUse.AllocMessageBuffer(size); + msg2RevokeVector3Ptr->_priv_size = size; + msg2RevokeVector3Ptr->_priv_msgid = 2U; + msg2RevokeVector3Ptr->propertyId = propertyId; + msg2RevokeVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2RevokeVector3Ptr, ref s_priv_ByteOrder_Msg2_RevokeVector3, typeof(RemoteAnimationInputProvider.Msg2_RevokeVector3), 0, 0); + _priv_pmsgUse = (Message*)msg2RevokeVector3Ptr; + } + + public unsafe void SendRevokeVector3(uint propertyId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRevokeVector3(out _priv_portUse, out _priv_pmsgUse, propertyId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRevokeVector2( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg3_RevokeVector2); + RemoteAnimationInputProvider.Msg3_RevokeVector2* msg3RevokeVector2Ptr = (RemoteAnimationInputProvider.Msg3_RevokeVector2*)_priv_portUse.AllocMessageBuffer(size); + msg3RevokeVector2Ptr->_priv_size = size; + msg3RevokeVector2Ptr->_priv_msgid = 3U; + msg3RevokeVector2Ptr->propertyId = propertyId; + msg3RevokeVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3RevokeVector2Ptr, ref s_priv_ByteOrder_Msg3_RevokeVector2, typeof(RemoteAnimationInputProvider.Msg3_RevokeVector2), 0, 0); + _priv_pmsgUse = (Message*)msg3RevokeVector2Ptr; + } + + public unsafe void SendRevokeVector2(uint propertyId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRevokeVector2(out _priv_portUse, out _priv_pmsgUse, propertyId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRevokeFloat( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg4_RevokeFloat); + RemoteAnimationInputProvider.Msg4_RevokeFloat* msg4RevokeFloatPtr = (RemoteAnimationInputProvider.Msg4_RevokeFloat*)_priv_portUse.AllocMessageBuffer(size); + msg4RevokeFloatPtr->_priv_size = size; + msg4RevokeFloatPtr->_priv_msgid = 4U; + msg4RevokeFloatPtr->propertyId = propertyId; + msg4RevokeFloatPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4RevokeFloatPtr, ref s_priv_ByteOrder_Msg4_RevokeFloat, typeof(RemoteAnimationInputProvider.Msg4_RevokeFloat), 0, 0); + _priv_pmsgUse = (Message*)msg4RevokeFloatPtr; + } + + public unsafe void SendRevokeFloat(uint propertyId) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRevokeFloat(out _priv_portUse, out _priv_pmsgUse, propertyId); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPublishQuaternion( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId, + Quaternion value) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg5_PublishQuaternion); + RemoteAnimationInputProvider.Msg5_PublishQuaternion* publishQuaternionPtr = (RemoteAnimationInputProvider.Msg5_PublishQuaternion*)_priv_portUse.AllocMessageBuffer(size); + publishQuaternionPtr->_priv_size = size; + publishQuaternionPtr->_priv_msgid = 5U; + publishQuaternionPtr->propertyId = propertyId; + publishQuaternionPtr->value = value; + publishQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)publishQuaternionPtr, ref s_priv_ByteOrder_Msg5_PublishQuaternion, typeof(RemoteAnimationInputProvider.Msg5_PublishQuaternion), 0, 0); + _priv_pmsgUse = (Message*)publishQuaternionPtr; + } + + public unsafe void SendPublishQuaternion(uint propertyId, Quaternion value) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPublishQuaternion(out _priv_portUse, out _priv_pmsgUse, propertyId, value); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPublishVector4( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId, + Vector4 value) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg6_PublishVector4); + RemoteAnimationInputProvider.Msg6_PublishVector4* msg6PublishVector4Ptr = (RemoteAnimationInputProvider.Msg6_PublishVector4*)_priv_portUse.AllocMessageBuffer(size); + msg6PublishVector4Ptr->_priv_size = size; + msg6PublishVector4Ptr->_priv_msgid = 6U; + msg6PublishVector4Ptr->propertyId = propertyId; + msg6PublishVector4Ptr->value = value; + msg6PublishVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg6PublishVector4Ptr, ref s_priv_ByteOrder_Msg6_PublishVector4, typeof(RemoteAnimationInputProvider.Msg6_PublishVector4), 0, 0); + _priv_pmsgUse = (Message*)msg6PublishVector4Ptr; + } + + public unsafe void SendPublishVector4(uint propertyId, Vector4 value) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPublishVector4(out _priv_portUse, out _priv_pmsgUse, propertyId, value); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPublishVector3( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId, + Vector3 value) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg7_PublishVector3); + RemoteAnimationInputProvider.Msg7_PublishVector3* msg7PublishVector3Ptr = (RemoteAnimationInputProvider.Msg7_PublishVector3*)_priv_portUse.AllocMessageBuffer(size); + msg7PublishVector3Ptr->_priv_size = size; + msg7PublishVector3Ptr->_priv_msgid = 7U; + msg7PublishVector3Ptr->propertyId = propertyId; + msg7PublishVector3Ptr->value = value; + msg7PublishVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7PublishVector3Ptr, ref s_priv_ByteOrder_Msg7_PublishVector3, typeof(RemoteAnimationInputProvider.Msg7_PublishVector3), 0, 0); + _priv_pmsgUse = (Message*)msg7PublishVector3Ptr; + } + + public unsafe void SendPublishVector3(uint propertyId, Vector3 value) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPublishVector3(out _priv_portUse, out _priv_pmsgUse, propertyId, value); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPublishVector2( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId, + Vector2 value) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg8_PublishVector2); + RemoteAnimationInputProvider.Msg8_PublishVector2* msg8PublishVector2Ptr = (RemoteAnimationInputProvider.Msg8_PublishVector2*)_priv_portUse.AllocMessageBuffer(size); + msg8PublishVector2Ptr->_priv_size = size; + msg8PublishVector2Ptr->_priv_msgid = 8U; + msg8PublishVector2Ptr->propertyId = propertyId; + msg8PublishVector2Ptr->value = value; + msg8PublishVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8PublishVector2Ptr, ref s_priv_ByteOrder_Msg8_PublishVector2, typeof(RemoteAnimationInputProvider.Msg8_PublishVector2), 0, 0); + _priv_pmsgUse = (Message*)msg8PublishVector2Ptr; + } + + public unsafe void SendPublishVector2(uint propertyId, Vector2 value) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPublishVector2(out _priv_portUse, out _priv_pmsgUse, propertyId, value); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPublishFloat( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint propertyId, + float value) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationInputProvider.Msg9_PublishFloat); + RemoteAnimationInputProvider.Msg9_PublishFloat* msg9PublishFloatPtr = (RemoteAnimationInputProvider.Msg9_PublishFloat*)_priv_portUse.AllocMessageBuffer(size); + msg9PublishFloatPtr->_priv_size = size; + msg9PublishFloatPtr->_priv_msgid = 9U; + msg9PublishFloatPtr->propertyId = propertyId; + msg9PublishFloatPtr->value = value; + msg9PublishFloatPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg9PublishFloatPtr, ref s_priv_ByteOrder_Msg9_PublishFloat, typeof(RemoteAnimationInputProvider.Msg9_PublishFloat), 0, 0); + _priv_pmsgUse = (Message*)msg9PublishFloatPtr; + } + + public unsafe void SendPublishFloat(uint propertyId, float value) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPublishFloat(out _priv_portUse, out _priv_pmsgUse, propertyId, value); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteAnimationInputProvider CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteAnimationInputProvider(port, handle, true); + } + + public static RemoteAnimationInputProvider CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteAnimationInputProvider(port, handle, false); + } + + protected RemoteAnimationInputProvider( + RenderPort port, + RENDERHANDLE handle, + bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteAnimationInputProvider(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteAnimationInputProvider && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg10_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nExternalAnimationInputId; + } + + [ComVisible(false)] + private struct Msg0_RevokeQuaternion + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + } + + [ComVisible(false)] + private struct Msg1_RevokeVector4 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + } + + [ComVisible(false)] + private struct Msg2_RevokeVector3 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + } + + [ComVisible(false)] + private struct Msg3_RevokeVector2 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + } + + [ComVisible(false)] + private struct Msg4_RevokeFloat + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + } + + [ComVisible(false)] + private struct Msg5_PublishQuaternion + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + public Quaternion value; + } + + [ComVisible(false)] + private struct Msg6_PublishVector4 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + public Vector4 value; + } + + [ComVisible(false)] + private struct Msg7_PublishVector3 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + public Vector3 value; + } + + [ComVisible(false)] + private struct Msg8_PublishVector2 + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + public Vector2 value; + } + + [ComVisible(false)] + private struct Msg9_PublishFloat + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint propertyId; + public float value; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs new file mode 100644 index 0000000..cc3a916 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs @@ -0,0 +1,190 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteAnimationManager +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteAnimationManager : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg3_Create; + private static ushort[] s_priv_ByteOrder_Msg0_SetAnimationRate; + private static ushort[] s_priv_ByteOrder_Msg1_PulseTimeAdvance; + private static ushort[] s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment; + + protected RemoteAnimationManager() + { + } + + public static unsafe RemoteAnimationManager Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE managerClassHandle = _priv_protocolInstance.AnimationManager_ClassHandle; + RemoteAnimationManager animationManager = new RemoteAnimationManager(port, _priv_owner); + uint num = (uint)sizeof(RemoteAnimationManager.Msg3_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteAnimationManager.Msg3_Create* msg3CreatePtr = (RemoteAnimationManager.Msg3_Create*)pMem; + msg3CreatePtr->_priv_size = num; + msg3CreatePtr->_priv_msgid = 3U; + msg3CreatePtr->_priv_idObjectSubject = animationManager.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg3_Create, typeof(RemoteAnimationManager.Msg3_Create), 0, 0); + port.CreateRemoteObject(managerClassHandle, animationManager.m_renderHandle, (Message*)msg3CreatePtr); + return animationManager; + } + + public unsafe void BuildSetAnimationRate( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nFramesPerSecond) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationManager.Msg0_SetAnimationRate); + RemoteAnimationManager.Msg0_SetAnimationRate* setAnimationRatePtr = (RemoteAnimationManager.Msg0_SetAnimationRate*)_priv_portUse.AllocMessageBuffer(size); + setAnimationRatePtr->_priv_size = size; + setAnimationRatePtr->_priv_msgid = 0U; + setAnimationRatePtr->nFramesPerSecond = nFramesPerSecond; + setAnimationRatePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setAnimationRatePtr, ref s_priv_ByteOrder_Msg0_SetAnimationRate, typeof(RemoteAnimationManager.Msg0_SetAnimationRate), 0, 0); + _priv_pmsgUse = (Message*)setAnimationRatePtr; + } + + public unsafe void SendSetAnimationRate(int nFramesPerSecond) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAnimationRate(out _priv_portUse, out _priv_pmsgUse, nFramesPerSecond); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPulseTimeAdvance( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPulseMs) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationManager.Msg1_PulseTimeAdvance); + RemoteAnimationManager.Msg1_PulseTimeAdvance* pulseTimeAdvancePtr = (RemoteAnimationManager.Msg1_PulseTimeAdvance*)_priv_portUse.AllocMessageBuffer(size); + pulseTimeAdvancePtr->_priv_size = size; + pulseTimeAdvancePtr->_priv_msgid = 1U; + pulseTimeAdvancePtr->nPulseMs = nPulseMs; + pulseTimeAdvancePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)pulseTimeAdvancePtr, ref s_priv_ByteOrder_Msg1_PulseTimeAdvance, typeof(RemoteAnimationManager.Msg1_PulseTimeAdvance), 0, 0); + _priv_pmsgUse = (Message*)pulseTimeAdvancePtr; + } + + public unsafe void SendPulseTimeAdvance(int nPulseMs) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPulseTimeAdvance(out _priv_portUse, out _priv_pmsgUse, nPulseMs); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetGlobalSpeedAdjustment( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flFactor) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment); + RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment* globalSpeedAdjustmentPtr = (RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment*)_priv_portUse.AllocMessageBuffer(size); + globalSpeedAdjustmentPtr->_priv_size = size; + globalSpeedAdjustmentPtr->_priv_msgid = 2U; + globalSpeedAdjustmentPtr->flFactor = flFactor; + globalSpeedAdjustmentPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)globalSpeedAdjustmentPtr, ref s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment, typeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment), 0, 0); + _priv_pmsgUse = (Message*)globalSpeedAdjustmentPtr; + } + + public unsafe void SendSetGlobalSpeedAdjustment(float flFactor) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetGlobalSpeedAdjustment(out _priv_portUse, out _priv_pmsgUse, flFactor); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteAnimationManager CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteAnimationManager(port, handle, true); + } + + public static RemoteAnimationManager CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteAnimationManager(port, handle, false); + } + + protected RemoteAnimationManager(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteAnimationManager(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteAnimationManager && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg3_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg0_SetAnimationRate + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nFramesPerSecond; + } + + [ComVisible(false)] + private struct Msg1_PulseTimeAdvance + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPulseMs; + } + + [ComVisible(false)] + private struct Msg2_SetGlobalSpeedAdjustment + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flFactor; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs new file mode 100644 index 0000000..716229b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs @@ -0,0 +1,259 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteCamera +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteCamera : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg5_Create; + private static ushort[] s_priv_ByteOrder_Msg0_SetPerspective; + private static ushort[] s_priv_ByteOrder_Msg1_SetZn; + private static ushort[] s_priv_ByteOrder_Msg2_SetUp; + private static ushort[] s_priv_ByteOrder_Msg3_SetAt; + private static ushort[] s_priv_ByteOrder_Msg4_SetEye; + + protected RemoteCamera() + { + } + + public static unsafe RemoteCamera Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE cameraClassHandle = _priv_protocolInstance.Camera_ClassHandle; + RemoteCamera remoteCamera = new RemoteCamera(port, _priv_owner); + uint num = (uint)sizeof(RemoteCamera.Msg5_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteCamera.Msg5_Create* msg5CreatePtr = (RemoteCamera.Msg5_Create*)pMem; + msg5CreatePtr->_priv_size = num; + msg5CreatePtr->_priv_msgid = 5U; + msg5CreatePtr->_priv_idObjectSubject = remoteCamera.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg5_Create, typeof(RemoteCamera.Msg5_Create), 0, 0); + port.CreateRemoteObject(cameraClassHandle, remoteCamera.m_renderHandle, (Message*)msg5CreatePtr); + return remoteCamera; + } + + public unsafe void BuildSetPerspective( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fPerspective) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteCamera.Msg0_SetPerspective); + RemoteCamera.Msg0_SetPerspective* msg0SetPerspectivePtr = (RemoteCamera.Msg0_SetPerspective*)_priv_portUse.AllocMessageBuffer(size); + msg0SetPerspectivePtr->_priv_size = size; + msg0SetPerspectivePtr->_priv_msgid = 0U; + msg0SetPerspectivePtr->fPerspective = fPerspective ? uint.MaxValue : 0U; + msg0SetPerspectivePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0SetPerspectivePtr, ref s_priv_ByteOrder_Msg0_SetPerspective, typeof(RemoteCamera.Msg0_SetPerspective), 0, 0); + _priv_pmsgUse = (Message*)msg0SetPerspectivePtr; + } + + public unsafe void SendSetPerspective(bool fPerspective) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetPerspective(out _priv_portUse, out _priv_pmsgUse, fPerspective); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetZn( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flZn) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteCamera.Msg1_SetZn); + RemoteCamera.Msg1_SetZn* msg1SetZnPtr = (RemoteCamera.Msg1_SetZn*)_priv_portUse.AllocMessageBuffer(size); + msg1SetZnPtr->_priv_size = size; + msg1SetZnPtr->_priv_msgid = 1U; + msg1SetZnPtr->flZn = flZn; + msg1SetZnPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1SetZnPtr, ref s_priv_ByteOrder_Msg1_SetZn, typeof(RemoteCamera.Msg1_SetZn), 0, 0); + _priv_pmsgUse = (Message*)msg1SetZnPtr; + } + + public unsafe void SendSetZn(float flZn) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetZn(out _priv_portUse, out _priv_pmsgUse, flZn); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetUp( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vUp) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteCamera.Msg2_SetUp); + RemoteCamera.Msg2_SetUp* msg2SetUpPtr = (RemoteCamera.Msg2_SetUp*)_priv_portUse.AllocMessageBuffer(size); + msg2SetUpPtr->_priv_size = size; + msg2SetUpPtr->_priv_msgid = 2U; + msg2SetUpPtr->vUp = vUp; + msg2SetUpPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetUpPtr, ref s_priv_ByteOrder_Msg2_SetUp, typeof(RemoteCamera.Msg2_SetUp), 0, 0); + _priv_pmsgUse = (Message*)msg2SetUpPtr; + } + + public unsafe void SendSetUp(Vector3 vUp) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetUp(out _priv_portUse, out _priv_pmsgUse, vUp); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetAt( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vAt) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteCamera.Msg3_SetAt); + RemoteCamera.Msg3_SetAt* msg3SetAtPtr = (RemoteCamera.Msg3_SetAt*)_priv_portUse.AllocMessageBuffer(size); + msg3SetAtPtr->_priv_size = size; + msg3SetAtPtr->_priv_msgid = 3U; + msg3SetAtPtr->vAt = vAt; + msg3SetAtPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3SetAtPtr, ref s_priv_ByteOrder_Msg3_SetAt, typeof(RemoteCamera.Msg3_SetAt), 0, 0); + _priv_pmsgUse = (Message*)msg3SetAtPtr; + } + + public unsafe void SendSetAt(Vector3 vAt) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAt(out _priv_portUse, out _priv_pmsgUse, vAt); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEye( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vEye) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteCamera.Msg4_SetEye); + RemoteCamera.Msg4_SetEye* msg4SetEyePtr = (RemoteCamera.Msg4_SetEye*)_priv_portUse.AllocMessageBuffer(size); + msg4SetEyePtr->_priv_size = size; + msg4SetEyePtr->_priv_msgid = 4U; + msg4SetEyePtr->vEye = vEye; + msg4SetEyePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4SetEyePtr, ref s_priv_ByteOrder_Msg4_SetEye, typeof(RemoteCamera.Msg4_SetEye), 0, 0); + _priv_pmsgUse = (Message*)msg4SetEyePtr; + } + + public unsafe void SendSetEye(Vector3 vEye) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEye(out _priv_portUse, out _priv_pmsgUse, vEye); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteCamera CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteCamera(port, handle, true); + + public static RemoteCamera CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteCamera(port, handle, false); + } + + protected RemoteCamera(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteCamera(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteCamera && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg5_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg0_SetPerspective + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fPerspective; + } + + [ComVisible(false)] + private struct Msg1_SetZn + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flZn; + } + + [ComVisible(false)] + private struct Msg2_SetUp + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vUp; + } + + [ComVisible(false)] + private struct Msg3_SetAt + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vAt; + } + + [ComVisible(false)] + private struct Msg4_SetEye + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vEye; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs new file mode 100644 index 0000000..85bfa8a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs @@ -0,0 +1,299 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDevice : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_TriggerDeviceReset; + private static ushort[] s_priv_ByteOrder_Msg1_EndCaptureBackBuffer; + private static ushort[] s_priv_ByteOrder_Msg2_BeginCaptureBackBuffer; + private static ushort[] s_priv_ByteOrder_Msg3_CreateGradient; + private static ushort[] s_priv_ByteOrder_Msg4_Stop; + private static ushort[] s_priv_ByteOrder_Msg5_Restart; + private static ushort[] s_priv_ByteOrder_Msg6_CreateSurfacePool; + + protected RemoteDevice() + { + } + + public unsafe void BuildTriggerDeviceReset( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg0_TriggerDeviceReset); + RemoteDevice.Msg0_TriggerDeviceReset* triggerDeviceResetPtr = (RemoteDevice.Msg0_TriggerDeviceReset*)_priv_portUse.AllocMessageBuffer(size); + triggerDeviceResetPtr->_priv_size = size; + triggerDeviceResetPtr->_priv_msgid = 0U; + triggerDeviceResetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)triggerDeviceResetPtr, ref s_priv_ByteOrder_Msg0_TriggerDeviceReset, typeof(RemoteDevice.Msg0_TriggerDeviceReset), 0, 0); + _priv_pmsgUse = (Message*)triggerDeviceResetPtr; + } + + public unsafe void SendTriggerDeviceReset() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildTriggerDeviceReset(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEndCaptureBackBuffer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg1_EndCaptureBackBuffer); + RemoteDevice.Msg1_EndCaptureBackBuffer* captureBackBufferPtr = (RemoteDevice.Msg1_EndCaptureBackBuffer*)_priv_portUse.AllocMessageBuffer(size); + captureBackBufferPtr->_priv_size = size; + captureBackBufferPtr->_priv_msgid = 1U; + captureBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref s_priv_ByteOrder_Msg1_EndCaptureBackBuffer, typeof(RemoteDevice.Msg1_EndCaptureBackBuffer), 0, 0); + _priv_pmsgUse = (Message*)captureBackBufferPtr; + } + + public unsafe void SendEndCaptureBackBuffer() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEndCaptureBackBuffer(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildBeginCaptureBackBuffer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stFileName) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDevice.Msg2_BeginCaptureBackBuffer)); + BLOBREF blobref = blobInfo.Add(stFileName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDevice.Msg2_BeginCaptureBackBuffer* captureBackBufferPtr = (RemoteDevice.Msg2_BeginCaptureBackBuffer*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + captureBackBufferPtr->_priv_size = adjustedTotalSize; + captureBackBufferPtr->_priv_msgid = 2U; + captureBackBufferPtr->stFileName = blobref; + blobInfo.Attach((Message*)captureBackBufferPtr); + captureBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref s_priv_ByteOrder_Msg2_BeginCaptureBackBuffer, typeof(RemoteDevice.Msg2_BeginCaptureBackBuffer), 0, 0); + _priv_pmsgUse = (Message*)captureBackBufferPtr; + } + + public unsafe void SendBeginCaptureBackBuffer(string stFileName) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildBeginCaptureBackBuffer(out _priv_portUse, out _priv_pmsgUse, stFileName); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateGradient( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RENDERHANDLE idNewGradient) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg3_CreateGradient); + RemoteDevice.Msg3_CreateGradient* msg3CreateGradientPtr = (RemoteDevice.Msg3_CreateGradient*)_priv_portUse.AllocMessageBuffer(size); + msg3CreateGradientPtr->_priv_size = size; + msg3CreateGradientPtr->_priv_msgid = 3U; + msg3CreateGradientPtr->idNewGradient = idNewGradient; + msg3CreateGradientPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3CreateGradientPtr, ref s_priv_ByteOrder_Msg3_CreateGradient, typeof(RemoteDevice.Msg3_CreateGradient), 0, 0); + _priv_pmsgUse = (Message*)msg3CreateGradientPtr; + } + + public unsafe void SendCreateGradient(RENDERHANDLE idNewGradient) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateGradient(out _priv_portUse, out _priv_pmsgUse, idNewGradient); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildStop(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg4_Stop); + RemoteDevice.Msg4_Stop* msg4StopPtr = (RemoteDevice.Msg4_Stop*)_priv_portUse.AllocMessageBuffer(size); + msg4StopPtr->_priv_size = size; + msg4StopPtr->_priv_msgid = 4U; + msg4StopPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4StopPtr, ref s_priv_ByteOrder_Msg4_Stop, typeof(RemoteDevice.Msg4_Stop), 0, 0); + _priv_pmsgUse = (Message*)msg4StopPtr; + } + + public unsafe void SendStop() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildStop(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRestart( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nRenderGeneration) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg5_Restart); + RemoteDevice.Msg5_Restart* msg5RestartPtr = (RemoteDevice.Msg5_Restart*)_priv_portUse.AllocMessageBuffer(size); + msg5RestartPtr->_priv_size = size; + msg5RestartPtr->_priv_msgid = 5U; + msg5RestartPtr->nRenderGeneration = nRenderGeneration; + msg5RestartPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5RestartPtr, ref s_priv_ByteOrder_Msg5_Restart, typeof(RemoteDevice.Msg5_Restart), 0, 0); + _priv_pmsgUse = (Message*)msg5RestartPtr; + } + + public unsafe void SendRestart(uint nRenderGeneration) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRestart(out _priv_portUse, out _priv_pmsgUse, nRenderGeneration); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateSurfacePool( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RENDERHANDLE idNewSurface, + SurfaceFormat nFormat) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDevice.Msg6_CreateSurfacePool); + RemoteDevice.Msg6_CreateSurfacePool* createSurfacePoolPtr = (RemoteDevice.Msg6_CreateSurfacePool*)_priv_portUse.AllocMessageBuffer(size); + createSurfacePoolPtr->_priv_size = size; + createSurfacePoolPtr->_priv_msgid = 6U; + createSurfacePoolPtr->idNewSurface = idNewSurface; + createSurfacePoolPtr->nFormat = nFormat; + createSurfacePoolPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createSurfacePoolPtr, ref s_priv_ByteOrder_Msg6_CreateSurfacePool, typeof(RemoteDevice.Msg6_CreateSurfacePool), 0, 0); + _priv_pmsgUse = (Message*)createSurfacePoolPtr; + } + + public unsafe void SendCreateSurfacePool(RENDERHANDLE idNewSurface, SurfaceFormat nFormat) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateSurfacePool(out _priv_portUse, out _priv_pmsgUse, idNewSurface, nFormat); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDevice CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteDevice(port, handle, true); + + public static RemoteDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDevice(port, handle, false); + } + + protected RemoteDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_TriggerDeviceReset + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_EndCaptureBackBuffer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg2_BeginCaptureBackBuffer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stFileName; + } + + [ComVisible(false)] + private struct Msg3_CreateGradient + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idNewGradient; + } + + [ComVisible(false)] + private struct Msg4_Stop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg5_Restart + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nRenderGeneration; + } + + [ComVisible(false)] + private struct Msg6_CreateSurfacePool + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idNewSurface; + public SurfaceFormat nFormat; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs new file mode 100644 index 0000000..3d9d412 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs @@ -0,0 +1,162 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDx9Device +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDx9Device : RemoteDevice + { + private static ushort[] s_priv_ByteOrder_Msg8_CreateVideoPool; + private static ushort[] s_priv_ByteOrder_Msg9_EndVideoSurfaceAllocation; + private static ushort[] s_priv_ByteOrder_Msg10_BeginVideoSurfaceAllocation; + + protected RemoteDx9Device() + { + } + + public unsafe void BuildCreateVideoPool( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + LocalVideoPoolCallback cbOwner, + RENDERHANDLE idNewSurface) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDx9Device.Msg8_CreateVideoPool); + RemoteDx9Device.Msg8_CreateVideoPool* msg8CreateVideoPoolPtr = (RemoteDx9Device.Msg8_CreateVideoPool*)_priv_portUse.AllocMessageBuffer(size); + msg8CreateVideoPoolPtr->_priv_size = size; + msg8CreateVideoPoolPtr->_priv_msgid = 8U; + msg8CreateVideoPoolPtr->_priv_objcbOwner = cbOwner.RenderHandle; + msg8CreateVideoPoolPtr->_priv_ctxcbOwner = _priv_portUse.Session.LocalContext; + msg8CreateVideoPoolPtr->idNewSurface = idNewSurface; + msg8CreateVideoPoolPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8CreateVideoPoolPtr, ref s_priv_ByteOrder_Msg8_CreateVideoPool, typeof(RemoteDx9Device.Msg8_CreateVideoPool), 0, 0); + _priv_pmsgUse = (Message*)msg8CreateVideoPoolPtr; + } + + public unsafe void SendCreateVideoPool( + LocalVideoPoolCallback cbOwner, + RENDERHANDLE idNewSurface) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateVideoPool(out _priv_portUse, out _priv_pmsgUse, cbOwner, idNewSurface); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEndVideoSurfaceAllocation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDx9Device.Msg9_EndVideoSurfaceAllocation); + RemoteDx9Device.Msg9_EndVideoSurfaceAllocation* surfaceAllocationPtr = (RemoteDx9Device.Msg9_EndVideoSurfaceAllocation*)_priv_portUse.AllocMessageBuffer(size); + surfaceAllocationPtr->_priv_size = size; + surfaceAllocationPtr->_priv_msgid = 9U; + surfaceAllocationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref s_priv_ByteOrder_Msg9_EndVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg9_EndVideoSurfaceAllocation), 0, 0); + _priv_pmsgUse = (Message*)surfaceAllocationPtr; + } + + public unsafe void SendEndVideoSurfaceAllocation() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEndVideoSurfaceAllocation(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildBeginVideoSurfaceAllocation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation); + RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation* surfaceAllocationPtr = (RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation*)_priv_portUse.AllocMessageBuffer(size); + surfaceAllocationPtr->_priv_size = size; + surfaceAllocationPtr->_priv_msgid = 10U; + surfaceAllocationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref s_priv_ByteOrder_Msg10_BeginVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation), 0, 0); + _priv_pmsgUse = (Message*)surfaceAllocationPtr; + } + + public unsafe void SendBeginVideoSurfaceAllocation() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildBeginVideoSurfaceAllocation(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDx9Device CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDx9Device(port, handle, true); + } + + public static RemoteDx9Device CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDx9Device(port, handle, false); + } + + protected RemoteDx9Device(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDx9Device(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDx9Device && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg8_CreateVideoPool + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcbOwner; + public ContextID _priv_ctxcbOwner; + public RENDERHANDLE idNewSurface; + } + + [ComVisible(false)] + private struct Msg9_EndVideoSurfaceAllocation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg10_BeginVideoSurfaceAllocation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs new file mode 100644 index 0000000..5a29fea --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDx9Effect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDx9Effect : RemoteEffect + { + private static ushort[] s_priv_ByteOrder_Msg8_LoadEffectResource; + + protected RemoteDx9Effect() + { + } + + public static unsafe RemoteDx9Effect Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE effectClassHandle = _priv_protocolInstance.Dx9Effect_ClassHandle; + RemoteDx9Effect remoteDx9Effect = new RemoteDx9Effect(port, _priv_owner); + port.CreateRemoteObject(effectClassHandle, remoteDx9Effect.m_renderHandle, null); + return remoteDx9Effect; + } + + public unsafe void BuildLoadEffectResource( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteDx9EffectResource effectResource) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (effectResource != null) + _priv_portUse.ValidateHandleOrNull(effectResource.RenderHandle); + uint size = (uint)sizeof(RemoteDx9Effect.Msg8_LoadEffectResource); + RemoteDx9Effect.Msg8_LoadEffectResource* loadEffectResourcePtr = (RemoteDx9Effect.Msg8_LoadEffectResource*)_priv_portUse.AllocMessageBuffer(size); + loadEffectResourcePtr->_priv_size = size; + loadEffectResourcePtr->_priv_msgid = 8U; + loadEffectResourcePtr->effectResource = effectResource != null ? effectResource.RenderHandle : RENDERHANDLE.NULL; + loadEffectResourcePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)loadEffectResourcePtr, ref s_priv_ByteOrder_Msg8_LoadEffectResource, typeof(RemoteDx9Effect.Msg8_LoadEffectResource), 0, 0); + _priv_pmsgUse = (Message*)loadEffectResourcePtr; + } + + public unsafe void SendLoadEffectResource(RemoteDx9EffectResource effectResource) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildLoadEffectResource(out _priv_portUse, out _priv_pmsgUse, effectResource); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDx9Effect CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDx9Effect(port, handle, true); + } + + public static RemoteDx9Effect CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDx9Effect(port, handle, false); + } + + protected RemoteDx9Effect(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDx9Effect(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDx9Effect && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg8_LoadEffectResource + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE effectResource; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs new file mode 100644 index 0000000..251f752 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs @@ -0,0 +1,521 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDx9EffectResource +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDx9EffectResource : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg10_Create; + private static ushort[] s_priv_ByteOrder_Msg0_SetDebugID; + private static ushort[] s_priv_ByteOrder_Msg1_SetGutterSize; + private static ushort[] s_priv_ByteOrder_Msg2_PostPropertiesAdded; + private static ushort[] s_priv_ByteOrder_Msg3_AddTextureRequirements; + private static ushort[] s_priv_ByteOrder_Msg4_AddProperty; + private static ushort[] s_priv_ByteOrder_Msg5_AddProperty; + private static ushort[] s_priv_ByteOrder_Msg6_AddProperty; + private static ushort[] s_priv_ByteOrder_Msg7_AddProperty; + private static ushort[] s_priv_ByteOrder_Msg8_AddProperty; + private static ushort[] s_priv_ByteOrder_Msg9_AddProperty; + + protected RemoteDx9EffectResource() + { + } + + public static unsafe RemoteDx9EffectResource Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + RemoteDevice devOwner, + RemoteDataBuffer dataBuffer) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE resourceClassHandle = _priv_protocolInstance.Dx9EffectResource_ClassHandle; + RemoteDx9EffectResource dx9EffectResource = new RemoteDx9EffectResource(port, _priv_owner); + uint num = (uint)sizeof(RemoteDx9EffectResource.Msg10_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteDx9EffectResource.Msg10_Create* msg10CreatePtr = (RemoteDx9EffectResource.Msg10_Create*)pMem; + msg10CreatePtr->_priv_size = num; + msg10CreatePtr->_priv_msgid = 10U; + msg10CreatePtr->devOwner = devOwner != null ? devOwner.RenderHandle : RENDERHANDLE.NULL; + msg10CreatePtr->dataBuffer = dataBuffer != null ? dataBuffer.RenderHandle : RENDERHANDLE.NULL; + msg10CreatePtr->_priv_idObjectSubject = dx9EffectResource.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg10_Create, typeof(RemoteDx9EffectResource.Msg10_Create), 0, 0); + port.CreateRemoteObject(resourceClassHandle, dx9EffectResource.m_renderHandle, (Message*)msg10CreatePtr); + return dx9EffectResource; + } + + public unsafe void BuildSetDebugID( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stDebugID) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg0_SetDebugID)); + BLOBREF blobref = blobInfo.Add(stDebugID); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg0_SetDebugID* msg0SetDebugIdPtr = (RemoteDx9EffectResource.Msg0_SetDebugID*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg0SetDebugIdPtr->_priv_size = adjustedTotalSize; + msg0SetDebugIdPtr->_priv_msgid = 0U; + msg0SetDebugIdPtr->stDebugID = blobref; + blobInfo.Attach((Message*)msg0SetDebugIdPtr); + msg0SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteDx9EffectResource.Msg0_SetDebugID), 0, 0); + _priv_pmsgUse = (Message*)msg0SetDebugIdPtr; + } + + public unsafe void SendSetDebugID(string stDebugID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDebugID(out _priv_portUse, out _priv_pmsgUse, stDebugID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetGutterSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeGutterPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDx9EffectResource.Msg1_SetGutterSize); + RemoteDx9EffectResource.Msg1_SetGutterSize* msg1SetGutterSizePtr = (RemoteDx9EffectResource.Msg1_SetGutterSize*)_priv_portUse.AllocMessageBuffer(size); + msg1SetGutterSizePtr->_priv_size = size; + msg1SetGutterSizePtr->_priv_msgid = 1U; + msg1SetGutterSizePtr->sizeGutterPxl = sizeGutterPxl; + msg1SetGutterSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1SetGutterSizePtr, ref s_priv_ByteOrder_Msg1_SetGutterSize, typeof(RemoteDx9EffectResource.Msg1_SetGutterSize), 0, 0); + _priv_pmsgUse = (Message*)msg1SetGutterSizePtr; + } + + public unsafe void SendSetGutterSize(Size sizeGutterPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetGutterSize(out _priv_portUse, out _priv_pmsgUse, sizeGutterPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPostPropertiesAdded( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteDx9EffectResource.Msg2_PostPropertiesAdded); + RemoteDx9EffectResource.Msg2_PostPropertiesAdded* postPropertiesAddedPtr = (RemoteDx9EffectResource.Msg2_PostPropertiesAdded*)_priv_portUse.AllocMessageBuffer(size); + postPropertiesAddedPtr->_priv_size = size; + postPropertiesAddedPtr->_priv_msgid = 2U; + postPropertiesAddedPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)postPropertiesAddedPtr, ref s_priv_ByteOrder_Msg2_PostPropertiesAdded, typeof(RemoteDx9EffectResource.Msg2_PostPropertiesAdded), 0, 0); + _priv_pmsgUse = (Message*)postPropertiesAddedPtr; + } + + public unsafe void SendPostPropertiesAdded() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPostPropertiesAdded(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddTextureRequirements( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxImage, + int nRequirements, + string stTexelSize, + string stTexUVSize, + string stTexUVRefPoint, + int nDownsamplePropertyID) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg3_AddTextureRequirements)); + BLOBREF blobref1 = blobInfo.Add(stTexelSize); + BLOBREF blobref2 = blobInfo.Add(stTexUVSize); + BLOBREF blobref3 = blobInfo.Add(stTexUVRefPoint); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg3_AddTextureRequirements* textureRequirementsPtr = (RemoteDx9EffectResource.Msg3_AddTextureRequirements*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + textureRequirementsPtr->_priv_size = adjustedTotalSize; + textureRequirementsPtr->_priv_msgid = 3U; + textureRequirementsPtr->idxImage = idxImage; + textureRequirementsPtr->nRequirements = nRequirements; + textureRequirementsPtr->stTexelSize = blobref1; + textureRequirementsPtr->stTexUVSize = blobref2; + textureRequirementsPtr->stTexUVRefPoint = blobref3; + textureRequirementsPtr->nDownsamplePropertyID = nDownsamplePropertyID; + blobInfo.Attach((Message*)textureRequirementsPtr); + textureRequirementsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)textureRequirementsPtr, ref s_priv_ByteOrder_Msg3_AddTextureRequirements, typeof(RemoteDx9EffectResource.Msg3_AddTextureRequirements), 0, 0); + _priv_pmsgUse = (Message*)textureRequirementsPtr; + } + + public unsafe void SendAddTextureRequirements( + int idxImage, + int nRequirements, + string stTexelSize, + string stTexUVSize, + string stTexUVRefPoint, + int nDownsamplePropertyID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddTextureRequirements(out _priv_portUse, out _priv_pmsgUse, idxImage, nRequirements, stTexelSize, stTexUVSize, stTexUVRefPoint, nDownsamplePropertyID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + int nCoordinateMapID, + int nImageIndexID) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg4_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg4_AddProperty* msg4AddPropertyPtr = (RemoteDx9EffectResource.Msg4_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg4AddPropertyPtr->_priv_size = adjustedTotalSize; + msg4AddPropertyPtr->_priv_msgid = 4U; + msg4AddPropertyPtr->stName = blobref; + msg4AddPropertyPtr->nCoordinateMapID = nCoordinateMapID; + msg4AddPropertyPtr->nImageIndexID = nImageIndexID; + blobInfo.Attach((Message*)msg4AddPropertyPtr); + msg4AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4AddPropertyPtr, ref s_priv_ByteOrder_Msg4_AddProperty, typeof(RemoteDx9EffectResource.Msg4_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg4AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, int nCoordinateMapID, int nImageIndexID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, nCoordinateMapID, nImageIndexID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + Vector4 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg5_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg5_AddProperty* msg5AddPropertyPtr = (RemoteDx9EffectResource.Msg5_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg5AddPropertyPtr->_priv_size = adjustedTotalSize; + msg5AddPropertyPtr->_priv_msgid = 5U; + msg5AddPropertyPtr->stName = blobref; + msg5AddPropertyPtr->vValue = vValue; + blobInfo.Attach((Message*)msg5AddPropertyPtr); + msg5AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5AddPropertyPtr, ref s_priv_ByteOrder_Msg5_AddProperty, typeof(RemoteDx9EffectResource.Msg5_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg5AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, Vector4 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + Vector3 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg6_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg6_AddProperty* msg6AddPropertyPtr = (RemoteDx9EffectResource.Msg6_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg6AddPropertyPtr->_priv_size = adjustedTotalSize; + msg6AddPropertyPtr->_priv_msgid = 6U; + msg6AddPropertyPtr->stName = blobref; + msg6AddPropertyPtr->vValue = vValue; + blobInfo.Attach((Message*)msg6AddPropertyPtr); + msg6AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg6AddPropertyPtr, ref s_priv_ByteOrder_Msg6_AddProperty, typeof(RemoteDx9EffectResource.Msg6_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg6AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, Vector3 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + Vector2 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg7_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg7_AddProperty* msg7AddPropertyPtr = (RemoteDx9EffectResource.Msg7_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg7AddPropertyPtr->_priv_size = adjustedTotalSize; + msg7AddPropertyPtr->_priv_msgid = 7U; + msg7AddPropertyPtr->stName = blobref; + msg7AddPropertyPtr->vValue = vValue; + blobInfo.Attach((Message*)msg7AddPropertyPtr); + msg7AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7AddPropertyPtr, ref s_priv_ByteOrder_Msg7_AddProperty, typeof(RemoteDx9EffectResource.Msg7_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg7AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, Vector2 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + float flValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg8_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg8_AddProperty* msg8AddPropertyPtr = (RemoteDx9EffectResource.Msg8_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg8AddPropertyPtr->_priv_size = adjustedTotalSize; + msg8AddPropertyPtr->_priv_msgid = 8U; + msg8AddPropertyPtr->stName = blobref; + msg8AddPropertyPtr->flValue = flValue; + blobInfo.Attach((Message*)msg8AddPropertyPtr); + msg8AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8AddPropertyPtr, ref s_priv_ByteOrder_Msg8_AddProperty, typeof(RemoteDx9EffectResource.Msg8_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg8AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, float flValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, flValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stName, + int nValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteDx9EffectResource.Msg9_AddProperty)); + BLOBREF blobref = blobInfo.Add(stName); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteDx9EffectResource.Msg9_AddProperty* msg9AddPropertyPtr = (RemoteDx9EffectResource.Msg9_AddProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg9AddPropertyPtr->_priv_size = adjustedTotalSize; + msg9AddPropertyPtr->_priv_msgid = 9U; + msg9AddPropertyPtr->stName = blobref; + msg9AddPropertyPtr->nValue = nValue; + blobInfo.Attach((Message*)msg9AddPropertyPtr); + msg9AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg9AddPropertyPtr, ref s_priv_ByteOrder_Msg9_AddProperty, typeof(RemoteDx9EffectResource.Msg9_AddProperty), 0, 0); + _priv_pmsgUse = (Message*)msg9AddPropertyPtr; + } + + public unsafe void SendAddProperty(string stName, int nValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddProperty(out _priv_portUse, out _priv_pmsgUse, stName, nValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDx9EffectResource CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDx9EffectResource(port, handle, true); + } + + public static RemoteDx9EffectResource CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDx9EffectResource(port, handle, false); + } + + protected RemoteDx9EffectResource(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDx9EffectResource(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDx9EffectResource && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg10_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE devOwner; + public RENDERHANDLE dataBuffer; + } + + [ComVisible(false)] + private struct Msg0_SetDebugID + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stDebugID; + } + + [ComVisible(false)] + private struct Msg1_SetGutterSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeGutterPxl; + } + + [ComVisible(false)] + private struct Msg2_PostPropertiesAdded + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg3_AddTextureRequirements + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxImage; + public int nRequirements; + public BLOBREF stTexelSize; + public BLOBREF stTexUVSize; + public BLOBREF stTexUVRefPoint; + public int nDownsamplePropertyID; + } + + [ComVisible(false)] + private struct Msg4_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public int nCoordinateMapID; + public int nImageIndexID; + } + + [ComVisible(false)] + private struct Msg5_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public Vector4 vValue; + } + + [ComVisible(false)] + private struct Msg6_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public Vector3 vValue; + } + + [ComVisible(false)] + private struct Msg7_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public Vector2 vValue; + } + + [ComVisible(false)] + private struct Msg8_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public float flValue; + } + + [ComVisible(false)] + private struct Msg9_AddProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stName; + public int nValue; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs new file mode 100644 index 0000000..8b3424e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDx9Sprite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDx9Sprite : RemoteSprite + { + private static ushort[] s_priv_ByteOrder_Msg22_Create; + + protected RemoteDx9Sprite() + { + } + + public static unsafe RemoteDx9Sprite Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE spriteClassHandle = _priv_protocolInstance.Dx9Sprite_ClassHandle; + RemoteDx9Sprite remoteDx9Sprite = new RemoteDx9Sprite(port, _priv_owner); + uint num = (uint)sizeof(RemoteDx9Sprite.Msg22_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteDx9Sprite.Msg22_Create* msg22CreatePtr = (RemoteDx9Sprite.Msg22_Create*)pMem; + msg22CreatePtr->_priv_size = num; + msg22CreatePtr->_priv_msgid = 22U; + msg22CreatePtr->_priv_idObjectSubject = remoteDx9Sprite.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg22_Create, typeof(RemoteDx9Sprite.Msg22_Create), 0, 0); + port.CreateRemoteObject(spriteClassHandle, remoteDx9Sprite.m_renderHandle, (Message*)msg22CreatePtr); + return remoteDx9Sprite; + } + + public static RemoteDx9Sprite CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDx9Sprite(port, handle, true); + } + + public static RemoteDx9Sprite CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDx9Sprite(port, handle, false); + } + + protected RemoteDx9Sprite(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDx9Sprite(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDx9Sprite && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg22_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs new file mode 100644 index 0000000..43af8f8 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs @@ -0,0 +1,219 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteDynamicSurfaceFactory +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteDynamicSurfaceFactory : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_CloseInstance; + private static ushort[] s_priv_ByteOrder_Msg1_CreateVideoInstance; + private static ushort[] s_priv_ByteOrder_Msg2_CreateSurfaceInstance; + + protected RemoteDynamicSurfaceFactory() + { + } + + public static unsafe void BuildCloseInstance( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE factoryClassHandle = _priv_protocolInstance.DynamicSurfaceFactory_ClassHandle; + _priv_portUse.ValidateHandle(factoryClassHandle); + uint size = (uint)sizeof(RemoteDynamicSurfaceFactory.Msg0_CloseInstance); + RemoteDynamicSurfaceFactory.Msg0_CloseInstance* msg0CloseInstancePtr = (RemoteDynamicSurfaceFactory.Msg0_CloseInstance*)_priv_portUse.AllocMessageBuffer(size); + msg0CloseInstancePtr->_priv_size = size; + msg0CloseInstancePtr->_priv_msgid = 0U; + msg0CloseInstancePtr->nUniqueID = nUniqueID; + msg0CloseInstancePtr->_priv_idObjectSubject = factoryClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0CloseInstancePtr, ref s_priv_ByteOrder_Msg0_CloseInstance, typeof(RemoteDynamicSurfaceFactory.Msg0_CloseInstance), 0, 0); + _priv_pmsgUse = (Message*)msg0CloseInstancePtr; + } + + public static unsafe void SendCloseInstance( + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCloseInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildCreateVideoInstance( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID, + RENDERHANDLE idClassContext, + RemoteDevice devOwner, + RemoteSurface surScene, + RemoteVideoPool poolScene) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE factoryClassHandle = _priv_protocolInstance.DynamicSurfaceFactory_ClassHandle; + _priv_portUse.ValidateHandle(factoryClassHandle); + if (devOwner != null) + _priv_portUse.ValidateHandleOrNull(devOwner.RenderHandle); + if (surScene != null) + _priv_portUse.ValidateHandleOrNull(surScene.RenderHandle); + if (poolScene != null) + _priv_portUse.ValidateHandleOrNull(poolScene.RenderHandle); + uint size = (uint)sizeof(RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance); + RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance* createVideoInstancePtr = (RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance*)_priv_portUse.AllocMessageBuffer(size); + createVideoInstancePtr->_priv_size = size; + createVideoInstancePtr->_priv_msgid = 1U; + createVideoInstancePtr->nUniqueID = nUniqueID; + createVideoInstancePtr->idClassContext = idClassContext; + createVideoInstancePtr->devOwner = devOwner != null ? devOwner.RenderHandle : RENDERHANDLE.NULL; + createVideoInstancePtr->surScene = surScene != null ? surScene.RenderHandle : RENDERHANDLE.NULL; + createVideoInstancePtr->poolScene = poolScene != null ? poolScene.RenderHandle : RENDERHANDLE.NULL; + createVideoInstancePtr->_priv_idObjectSubject = factoryClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createVideoInstancePtr, ref s_priv_ByteOrder_Msg1_CreateVideoInstance, typeof(RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance), 0, 0); + _priv_pmsgUse = (Message*)createVideoInstancePtr; + } + + public static unsafe void SendCreateVideoInstance( + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID, + RENDERHANDLE idClassContext, + RemoteDevice devOwner, + RemoteSurface surScene, + RemoteVideoPool poolScene) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCreateVideoInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static unsafe void BuildCreateSurfaceInstance( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID, + RENDERHANDLE idClassContext, + RemoteDevice devOwner, + RemoteSurface surScene, + RemoteVideoPool poolScene) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE factoryClassHandle = _priv_protocolInstance.DynamicSurfaceFactory_ClassHandle; + _priv_portUse.ValidateHandle(factoryClassHandle); + if (devOwner != null) + _priv_portUse.ValidateHandleOrNull(devOwner.RenderHandle); + if (surScene != null) + _priv_portUse.ValidateHandleOrNull(surScene.RenderHandle); + if (poolScene != null) + _priv_portUse.ValidateHandleOrNull(poolScene.RenderHandle); + uint size = (uint)sizeof(RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance); + RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance* createSurfaceInstancePtr = (RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance*)_priv_portUse.AllocMessageBuffer(size); + createSurfaceInstancePtr->_priv_size = size; + createSurfaceInstancePtr->_priv_msgid = 2U; + createSurfaceInstancePtr->nUniqueID = nUniqueID; + createSurfaceInstancePtr->idClassContext = idClassContext; + createSurfaceInstancePtr->devOwner = devOwner != null ? devOwner.RenderHandle : RENDERHANDLE.NULL; + createSurfaceInstancePtr->surScene = surScene != null ? surScene.RenderHandle : RENDERHANDLE.NULL; + createSurfaceInstancePtr->poolScene = poolScene != null ? poolScene.RenderHandle : RENDERHANDLE.NULL; + createSurfaceInstancePtr->_priv_idObjectSubject = factoryClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createSurfaceInstancePtr, ref s_priv_ByteOrder_Msg2_CreateSurfaceInstance, typeof(RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance), 0, 0); + _priv_pmsgUse = (Message*)createSurfaceInstancePtr; + } + + public static unsafe void SendCreateSurfaceInstance( + ProtocolSplashRendering _priv_protocolInstance, + int nUniqueID, + RENDERHANDLE idClassContext, + RemoteDevice devOwner, + RemoteSurface surScene, + RemoteVideoPool poolScene) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildCreateSurfaceInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteDynamicSurfaceFactory CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteDynamicSurfaceFactory(port, handle, true); + } + + public static RemoteDynamicSurfaceFactory CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteDynamicSurfaceFactory(port, handle, false); + } + + protected RemoteDynamicSurfaceFactory( + RenderPort port, + RENDERHANDLE handle, + bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteDynamicSurfaceFactory(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteDynamicSurfaceFactory && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_CloseInstance + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nUniqueID; + } + + [ComVisible(false)] + private struct Msg1_CreateVideoInstance + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nUniqueID; + public RENDERHANDLE idClassContext; + public RENDERHANDLE devOwner; + public RENDERHANDLE surScene; + public RENDERHANDLE poolScene; + } + + [ComVisible(false)] + private struct Msg2_CreateSurfaceInstance + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nUniqueID; + public RENDERHANDLE idClassContext; + public RENDERHANDLE devOwner; + public RENDERHANDLE surScene; + public RENDERHANDLE poolScene; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs new file mode 100644 index 0000000..a832ff1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs @@ -0,0 +1,373 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteEffect : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_SetDebugID; + private static ushort[] s_priv_ByteOrder_Msg1_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg2_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg3_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg4_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg5_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg6_SetProperty; + private static ushort[] s_priv_ByteOrder_Msg7_SetProperty; + + protected RemoteEffect() + { + } + + public unsafe void BuildSetDebugID( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stDebugID) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteEffect.Msg0_SetDebugID)); + BLOBREF blobref = blobInfo.Add(stDebugID); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteEffect.Msg0_SetDebugID* msg0SetDebugIdPtr = (RemoteEffect.Msg0_SetDebugID*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg0SetDebugIdPtr->_priv_size = adjustedTotalSize; + msg0SetDebugIdPtr->_priv_msgid = 0U; + msg0SetDebugIdPtr->stDebugID = blobref; + blobInfo.Attach((Message*)msg0SetDebugIdPtr); + msg0SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteEffect.Msg0_SetDebugID), 0, 0); + _priv_pmsgUse = (Message*)msg0SetDebugIdPtr; + } + + public unsafe void SendSetDebugID(string stDebugID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDebugID(out _priv_portUse, out _priv_pmsgUse, stDebugID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + RemoteSurface[] surfaceArray) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteEffect.Msg1_SetProperty)); + RENDERHANDLE[] renderHandleArray = MarshalHelper.CreateRenderHandleArray(surfaceArray.Length); + for (int index = 0; index < surfaceArray.Length; ++index) + renderHandleArray[index] = surfaceArray[index].RenderHandle; + BLOBREF blobref = blobInfo.Add(renderHandleArray); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteEffect.Msg1_SetProperty* msg1SetPropertyPtr = (RemoteEffect.Msg1_SetProperty*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg1SetPropertyPtr->_priv_size = adjustedTotalSize; + msg1SetPropertyPtr->_priv_msgid = 1U; + msg1SetPropertyPtr->nPropertyID = nPropertyID; + msg1SetPropertyPtr->surfaceArray = blobref; + blobInfo.Attach((Message*)msg1SetPropertyPtr); + msg1SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1SetPropertyPtr, ref s_priv_ByteOrder_Msg1_SetProperty, typeof(RemoteEffect.Msg1_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg1SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, RemoteSurface[] surfaceArray) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, surfaceArray); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + RemoteSurface surface) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (surface != null) + _priv_portUse.ValidateHandleOrNull(surface.RenderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg2_SetProperty); + RemoteEffect.Msg2_SetProperty* msg2SetPropertyPtr = (RemoteEffect.Msg2_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg2SetPropertyPtr->_priv_size = size; + msg2SetPropertyPtr->_priv_msgid = 2U; + msg2SetPropertyPtr->nPropertyID = nPropertyID; + msg2SetPropertyPtr->surface = surface != null ? surface.RenderHandle : RENDERHANDLE.NULL; + msg2SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetPropertyPtr, ref s_priv_ByteOrder_Msg2_SetProperty, typeof(RemoteEffect.Msg2_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg2SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, RemoteSurface surface) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, surface); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + Vector4 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg3_SetProperty); + RemoteEffect.Msg3_SetProperty* msg3SetPropertyPtr = (RemoteEffect.Msg3_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg3SetPropertyPtr->_priv_size = size; + msg3SetPropertyPtr->_priv_msgid = 3U; + msg3SetPropertyPtr->nPropertyID = nPropertyID; + msg3SetPropertyPtr->vValue = vValue; + msg3SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3SetPropertyPtr, ref s_priv_ByteOrder_Msg3_SetProperty, typeof(RemoteEffect.Msg3_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg3SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, Vector4 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + Vector3 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg4_SetProperty); + RemoteEffect.Msg4_SetProperty* msg4SetPropertyPtr = (RemoteEffect.Msg4_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg4SetPropertyPtr->_priv_size = size; + msg4SetPropertyPtr->_priv_msgid = 4U; + msg4SetPropertyPtr->nPropertyID = nPropertyID; + msg4SetPropertyPtr->vValue = vValue; + msg4SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4SetPropertyPtr, ref s_priv_ByteOrder_Msg4_SetProperty, typeof(RemoteEffect.Msg4_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg4SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, Vector3 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + Vector2 vValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg5_SetProperty); + RemoteEffect.Msg5_SetProperty* msg5SetPropertyPtr = (RemoteEffect.Msg5_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg5SetPropertyPtr->_priv_size = size; + msg5SetPropertyPtr->_priv_msgid = 5U; + msg5SetPropertyPtr->nPropertyID = nPropertyID; + msg5SetPropertyPtr->vValue = vValue; + msg5SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5SetPropertyPtr, ref s_priv_ByteOrder_Msg5_SetProperty, typeof(RemoteEffect.Msg5_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg5SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, Vector2 vValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, vValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + float flValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg6_SetProperty); + RemoteEffect.Msg6_SetProperty* msg6SetPropertyPtr = (RemoteEffect.Msg6_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg6SetPropertyPtr->_priv_size = size; + msg6SetPropertyPtr->_priv_msgid = 6U; + msg6SetPropertyPtr->nPropertyID = nPropertyID; + msg6SetPropertyPtr->flValue = flValue; + msg6SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg6SetPropertyPtr, ref s_priv_ByteOrder_Msg6_SetProperty, typeof(RemoteEffect.Msg6_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg6SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, float flValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, flValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetProperty( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPropertyID, + int nValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteEffect.Msg7_SetProperty); + RemoteEffect.Msg7_SetProperty* msg7SetPropertyPtr = (RemoteEffect.Msg7_SetProperty*)_priv_portUse.AllocMessageBuffer(size); + msg7SetPropertyPtr->_priv_size = size; + msg7SetPropertyPtr->_priv_msgid = 7U; + msg7SetPropertyPtr->nPropertyID = nPropertyID; + msg7SetPropertyPtr->nValue = nValue; + msg7SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7SetPropertyPtr, ref s_priv_ByteOrder_Msg7_SetProperty, typeof(RemoteEffect.Msg7_SetProperty), 0, 0); + _priv_pmsgUse = (Message*)msg7SetPropertyPtr; + } + + public unsafe void SendSetProperty(int nPropertyID, int nValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetProperty(out _priv_portUse, out _priv_pmsgUse, nPropertyID, nValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteEffect CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteEffect(port, handle, true); + + public static RemoteEffect CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteEffect(port, handle, false); + } + + protected RemoteEffect(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteEffect(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteEffect && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_SetDebugID + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stDebugID; + } + + [ComVisible(false)] + private struct Msg1_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public BLOBREF surfaceArray; + } + + [ComVisible(false)] + private struct Msg2_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public RENDERHANDLE surface; + } + + [ComVisible(false)] + private struct Msg3_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public Vector4 vValue; + } + + [ComVisible(false)] + private struct Msg4_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public Vector3 vValue; + } + + [ComVisible(false)] + private struct Msg5_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public Vector2 vValue; + } + + [ComVisible(false)] + private struct Msg6_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public float flValue; + } + + [ComVisible(false)] + private struct Msg7_SetProperty + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPropertyID; + public int nValue; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs new file mode 100644 index 0000000..7ca2963 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs @@ -0,0 +1,84 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteExternalAnimationInput +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteExternalAnimationInput : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_Create; + + protected RemoteExternalAnimationInput() + { + } + + public static unsafe RemoteExternalAnimationInput Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + uint nUniqueId) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE inputClassHandle = _priv_protocolInstance.ExternalAnimationInput_ClassHandle; + RemoteExternalAnimationInput externalAnimationInput = new RemoteExternalAnimationInput(port, _priv_owner); + uint num = (uint)sizeof(RemoteExternalAnimationInput.Msg0_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteExternalAnimationInput.Msg0_Create* msg0CreatePtr = (RemoteExternalAnimationInput.Msg0_Create*)pMem; + msg0CreatePtr->_priv_size = num; + msg0CreatePtr->_priv_msgid = 0U; + msg0CreatePtr->nUniqueId = nUniqueId; + msg0CreatePtr->_priv_idObjectSubject = externalAnimationInput.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg0_Create, typeof(RemoteExternalAnimationInput.Msg0_Create), 0, 0); + port.CreateRemoteObject(inputClassHandle, externalAnimationInput.m_renderHandle, (Message*)msg0CreatePtr); + return externalAnimationInput; + } + + public static RemoteExternalAnimationInput CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteExternalAnimationInput(port, handle, true); + } + + public static RemoteExternalAnimationInput CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteExternalAnimationInput(port, handle, false); + } + + protected RemoteExternalAnimationInput( + RenderPort port, + RENDERHANDLE handle, + bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteExternalAnimationInput(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteExternalAnimationInput && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nUniqueId; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs new file mode 100644 index 0000000..403f523 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs @@ -0,0 +1,236 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteGradient +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteGradient : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_Clear; + private static ushort[] s_priv_ByteOrder_Msg1_AddValue; + private static ushort[] s_priv_ByteOrder_Msg2_SetOffset; + private static ushort[] s_priv_ByteOrder_Msg3_SetColorMask; + private static ushort[] s_priv_ByteOrder_Msg4_SetOrientation; + + protected RemoteGradient() + { + } + + public unsafe void BuildClear(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGradient.Msg0_Clear); + RemoteGradient.Msg0_Clear* msg0ClearPtr = (RemoteGradient.Msg0_Clear*)_priv_portUse.AllocMessageBuffer(size); + msg0ClearPtr->_priv_size = size; + msg0ClearPtr->_priv_msgid = 0U; + msg0ClearPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0ClearPtr, ref s_priv_ByteOrder_Msg0_Clear, typeof(RemoteGradient.Msg0_Clear), 0, 0); + _priv_pmsgUse = (Message*)msg0ClearPtr; + } + + public unsafe void SendClear() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildClear(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddValue( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flValue, + float flPosition, + RelativeSpace relative) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGradient.Msg1_AddValue); + RemoteGradient.Msg1_AddValue* msg1AddValuePtr = (RemoteGradient.Msg1_AddValue*)_priv_portUse.AllocMessageBuffer(size); + msg1AddValuePtr->_priv_size = size; + msg1AddValuePtr->_priv_msgid = 1U; + msg1AddValuePtr->flValue = flValue; + msg1AddValuePtr->flPosition = flPosition; + msg1AddValuePtr->relative = relative; + msg1AddValuePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1AddValuePtr, ref s_priv_ByteOrder_Msg1_AddValue, typeof(RemoteGradient.Msg1_AddValue), 0, 0); + _priv_pmsgUse = (Message*)msg1AddValuePtr; + } + + public unsafe void SendAddValue(float flValue, float flPosition, RelativeSpace relative) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddValue(out _priv_portUse, out _priv_pmsgUse, flValue, flPosition, relative); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetOffset( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flOffset) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGradient.Msg2_SetOffset); + RemoteGradient.Msg2_SetOffset* msg2SetOffsetPtr = (RemoteGradient.Msg2_SetOffset*)_priv_portUse.AllocMessageBuffer(size); + msg2SetOffsetPtr->_priv_size = size; + msg2SetOffsetPtr->_priv_msgid = 2U; + msg2SetOffsetPtr->flOffset = flOffset; + msg2SetOffsetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetOffsetPtr, ref s_priv_ByteOrder_Msg2_SetOffset, typeof(RemoteGradient.Msg2_SetOffset), 0, 0); + _priv_pmsgUse = (Message*)msg2SetOffsetPtr; + } + + public unsafe void SendSetOffset(float flOffset) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetOffset(out _priv_portUse, out _priv_pmsgUse, flOffset); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetColorMask( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clrMask) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGradient.Msg3_SetColorMask); + RemoteGradient.Msg3_SetColorMask* msg3SetColorMaskPtr = (RemoteGradient.Msg3_SetColorMask*)_priv_portUse.AllocMessageBuffer(size); + msg3SetColorMaskPtr->_priv_size = size; + msg3SetColorMaskPtr->_priv_msgid = 3U; + msg3SetColorMaskPtr->clrMask = clrMask; + msg3SetColorMaskPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3SetColorMaskPtr, ref s_priv_ByteOrder_Msg3_SetColorMask, typeof(RemoteGradient.Msg3_SetColorMask), 0, 0); + _priv_pmsgUse = (Message*)msg3SetColorMaskPtr; + } + + public unsafe void SendSetColorMask(ColorF clrMask) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetColorMask(out _priv_portUse, out _priv_pmsgUse, clrMask); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetOrientation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Orientation dir) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteGradient.Msg4_SetOrientation); + RemoteGradient.Msg4_SetOrientation* msg4SetOrientationPtr = (RemoteGradient.Msg4_SetOrientation*)_priv_portUse.AllocMessageBuffer(size); + msg4SetOrientationPtr->_priv_size = size; + msg4SetOrientationPtr->_priv_msgid = 4U; + msg4SetOrientationPtr->dir = dir; + msg4SetOrientationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4SetOrientationPtr, ref s_priv_ByteOrder_Msg4_SetOrientation, typeof(RemoteGradient.Msg4_SetOrientation), 0, 0); + _priv_pmsgUse = (Message*)msg4SetOrientationPtr; + } + + public unsafe void SendSetOrientation(Orientation dir) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetOrientation(out _priv_portUse, out _priv_pmsgUse, dir); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteGradient CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteGradient(port, handle, true); + } + + public static RemoteGradient CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteGradient(port, handle, false); + } + + protected RemoteGradient(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteGradient(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteGradient && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_Clear + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_AddValue + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flValue; + public float flPosition; + public RelativeSpace relative; + } + + [ComVisible(false)] + private struct Msg2_SetOffset + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flOffset; + } + + [ComVisible(false)] + private struct Msg3_SetColorMask + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clrMask; + } + + [ComVisible(false)] + private struct Msg4_SetOrientation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Orientation dir; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs new file mode 100644 index 0000000..ef26d67 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs @@ -0,0 +1,83 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteNullDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteNullDevice : RemoteDevice + { + private static ushort[] s_priv_ByteOrder_Msg8_Create; + + protected RemoteNullDevice() + { + } + + public static unsafe RemoteNullDevice Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.NullDevice_ClassHandle; + RemoteNullDevice remoteNullDevice = new RemoteNullDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteNullDevice.Msg8_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteNullDevice.Msg8_Create* msg8CreatePtr = (RemoteNullDevice.Msg8_Create*)pMem; + msg8CreatePtr->_priv_size = num; + msg8CreatePtr->_priv_msgid = 8U; + msg8CreatePtr->_priv_objcb = cb.RenderHandle; + msg8CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg8CreatePtr->_priv_idObjectSubject = remoteNullDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg8_Create, typeof(RemoteNullDevice.Msg8_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteNullDevice.m_renderHandle, (Message*)msg8CreatePtr); + return remoteNullDevice; + } + + public static RemoteNullDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteNullDevice(port, handle, true); + } + + public static RemoteNullDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteNullDevice(port, handle, false); + } + + protected RemoteNullDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteNullDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteNullDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg8_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs new file mode 100644 index 0000000..acaddcc --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs @@ -0,0 +1,104 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteRasterizer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using Microsoft.Iris.Render.Remote; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteRasterizer : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_LoadRawImage; + + protected RemoteRasterizer() + { + } + + public static unsafe void BuildLoadRawImage( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ProtocolSplashRendering _priv_protocolInstance, + RemoteSurface surContent, + RemoteDataBuffer buffer, + ImageHeader info) + { + RenderPort port = _priv_protocolInstance.Port; + _priv_portUse = port; + RENDERHANDLE rasterizerClassHandle = _priv_protocolInstance.Rasterizer_ClassHandle; + _priv_portUse.ValidateHandle(rasterizerClassHandle); + if (surContent != null) + _priv_portUse.ValidateHandleOrNull(surContent.RenderHandle); + if (buffer != null) + _priv_portUse.ValidateHandleOrNull(buffer.RenderHandle); + uint size = (uint)sizeof(RemoteRasterizer.Msg0_LoadRawImage); + RemoteRasterizer.Msg0_LoadRawImage* msg0LoadRawImagePtr = (RemoteRasterizer.Msg0_LoadRawImage*)_priv_portUse.AllocMessageBuffer(size); + msg0LoadRawImagePtr->_priv_size = size; + msg0LoadRawImagePtr->_priv_msgid = 0U; + msg0LoadRawImagePtr->surContent = surContent != null ? surContent.RenderHandle : RENDERHANDLE.NULL; + msg0LoadRawImagePtr->buffer = buffer != null ? buffer.RenderHandle : RENDERHANDLE.NULL; + msg0LoadRawImagePtr->info = info; + msg0LoadRawImagePtr->_priv_idObjectSubject = rasterizerClassHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0LoadRawImagePtr, ref s_priv_ByteOrder_Msg0_LoadRawImage, typeof(RemoteRasterizer.Msg0_LoadRawImage), 0, 0); + _priv_pmsgUse = (Message*)msg0LoadRawImagePtr; + } + + public static unsafe void SendLoadRawImage( + ProtocolSplashRendering _priv_protocolInstance, + RemoteSurface surContent, + RemoteDataBuffer buffer, + ImageHeader info) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + BuildLoadRawImage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, surContent, buffer, info); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteRasterizer CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteRasterizer(port, handle, true); + } + + public static RemoteRasterizer CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteRasterizer(port, handle, false); + } + + protected RemoteRasterizer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteRasterizer(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteRasterizer && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_LoadRawImage + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE surContent; + public RENDERHANDLE buffer; + public ImageHeader info; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs new file mode 100644 index 0000000..6f49cf1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs @@ -0,0 +1,121 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteRenderCaps +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteRenderCaps : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg1_Create; + private static ushort[] s_priv_ByteOrder_Msg0_CheckCaps; + + protected RemoteRenderCaps() + { + } + + public static unsafe RemoteRenderCaps Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalRenderCapsCallback callback) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE renderCapsClassHandle = _priv_protocolInstance.RenderCaps_ClassHandle; + RemoteRenderCaps remoteRenderCaps = new RemoteRenderCaps(port, _priv_owner); + uint num = (uint)sizeof(RemoteRenderCaps.Msg1_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteRenderCaps.Msg1_Create* msg1CreatePtr = (RemoteRenderCaps.Msg1_Create*)pMem; + msg1CreatePtr->_priv_size = num; + msg1CreatePtr->_priv_msgid = 1U; + msg1CreatePtr->_priv_objcallback = callback.RenderHandle; + msg1CreatePtr->_priv_ctxcallback = port.Session.LocalContext; + msg1CreatePtr->_priv_idObjectSubject = remoteRenderCaps.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg1_Create, typeof(RemoteRenderCaps.Msg1_Create), 0, 0); + port.CreateRemoteObject(renderCapsClassHandle, remoteRenderCaps.m_renderHandle, (Message*)msg1CreatePtr); + return remoteRenderCaps; + } + + public unsafe void BuildCheckCaps( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nCookie) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteRenderCaps.Msg0_CheckCaps); + RemoteRenderCaps.Msg0_CheckCaps* msg0CheckCapsPtr = (RemoteRenderCaps.Msg0_CheckCaps*)_priv_portUse.AllocMessageBuffer(size); + msg0CheckCapsPtr->_priv_size = size; + msg0CheckCapsPtr->_priv_msgid = 0U; + msg0CheckCapsPtr->nCookie = nCookie; + msg0CheckCapsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0CheckCapsPtr, ref s_priv_ByteOrder_Msg0_CheckCaps, typeof(RemoteRenderCaps.Msg0_CheckCaps), 0, 0); + _priv_pmsgUse = (Message*)msg0CheckCapsPtr; + } + + public unsafe void SendCheckCaps(uint nCookie) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCheckCaps(out _priv_portUse, out _priv_pmsgUse, nCookie); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteRenderCaps CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteRenderCaps(port, handle, true); + } + + public static RemoteRenderCaps CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteRenderCaps(port, handle, false); + } + + protected RemoteRenderCaps(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteRenderCaps(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteRenderCaps && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg1_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcallback; + public ContextID _priv_ctxcallback; + } + + [ComVisible(false)] + private struct Msg0_CheckCaps + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nCookie; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs new file mode 100644 index 0000000..149c54c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs @@ -0,0 +1,109 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSound +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSound : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_Stop; + private static ushort[] s_priv_ByteOrder_Msg1_Play; + + protected RemoteSound() + { + } + + public unsafe void BuildStop(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSound.Msg0_Stop); + RemoteSound.Msg0_Stop* msg0StopPtr = (RemoteSound.Msg0_Stop*)_priv_portUse.AllocMessageBuffer(size); + msg0StopPtr->_priv_size = size; + msg0StopPtr->_priv_msgid = 0U; + msg0StopPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0StopPtr, ref s_priv_ByteOrder_Msg0_Stop, typeof(RemoteSound.Msg0_Stop), 0, 0); + _priv_pmsgUse = (Message*)msg0StopPtr; + } + + public unsafe void SendStop() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildStop(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildPlay(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSound.Msg1_Play); + RemoteSound.Msg1_Play* msg1PlayPtr = (RemoteSound.Msg1_Play*)_priv_portUse.AllocMessageBuffer(size); + msg1PlayPtr->_priv_size = size; + msg1PlayPtr->_priv_msgid = 1U; + msg1PlayPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1PlayPtr, ref s_priv_ByteOrder_Msg1_Play, typeof(RemoteSound.Msg1_Play), 0, 0); + _priv_pmsgUse = (Message*)msg1PlayPtr; + } + + public unsafe void SendPlay() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildPlay(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSound CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteSound(port, handle, true); + + public static RemoteSound CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSound(port, handle, false); + } + + protected RemoteSound(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSound(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSound && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_Stop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_Play + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs new file mode 100644 index 0000000..81fc569 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs @@ -0,0 +1,90 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSoundBuffer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Messaging; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSoundBuffer : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_LoadSoundData; + + protected RemoteSoundBuffer() + { + } + + public unsafe void BuildLoadSoundData( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteDataBuffer dataBuffer) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (dataBuffer != null) + _priv_portUse.ValidateHandleOrNull(dataBuffer.RenderHandle); + uint size = (uint)sizeof(RemoteSoundBuffer.Msg0_LoadSoundData); + RemoteSoundBuffer.Msg0_LoadSoundData* msg0LoadSoundDataPtr = (RemoteSoundBuffer.Msg0_LoadSoundData*)_priv_portUse.AllocMessageBuffer(size); + msg0LoadSoundDataPtr->_priv_size = size; + msg0LoadSoundDataPtr->_priv_msgid = 0U; + msg0LoadSoundDataPtr->dataBuffer = dataBuffer != null ? dataBuffer.RenderHandle : RENDERHANDLE.NULL; + msg0LoadSoundDataPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0LoadSoundDataPtr, ref s_priv_ByteOrder_Msg0_LoadSoundData, typeof(RemoteSoundBuffer.Msg0_LoadSoundData), 0, 0); + _priv_pmsgUse = (Message*)msg0LoadSoundDataPtr; + } + + public unsafe void SendLoadSoundData(RemoteDataBuffer dataBuffer) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildLoadSoundData(out _priv_portUse, out _priv_pmsgUse, dataBuffer); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSoundBuffer CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteSoundBuffer(port, handle, true); + } + + public static RemoteSoundBuffer CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSoundBuffer(port, handle, false); + } + + protected RemoteSoundBuffer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSoundBuffer(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSoundBuffer && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_LoadSoundData + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE dataBuffer; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs new file mode 100644 index 0000000..aee8289 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs @@ -0,0 +1,209 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Sound; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSoundDevice : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_CreateSound; + private static ushort[] s_priv_ByteOrder_Msg1_CreateSoundBuffer; + private static ushort[] s_priv_ByteOrder_Msg2_EvictExternalResources; + private static ushort[] s_priv_ByteOrder_Msg3_CreateExternalResources; + + protected RemoteSoundDevice() + { + } + + public unsafe void BuildCreateSound( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RENDERHANDLE idNewSound, + RemoteSoundBuffer soundBuffer) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (soundBuffer != null) + _priv_portUse.ValidateHandleOrNull(soundBuffer.RenderHandle); + uint size = (uint)sizeof(RemoteSoundDevice.Msg0_CreateSound); + RemoteSoundDevice.Msg0_CreateSound* msg0CreateSoundPtr = (RemoteSoundDevice.Msg0_CreateSound*)_priv_portUse.AllocMessageBuffer(size); + msg0CreateSoundPtr->_priv_size = size; + msg0CreateSoundPtr->_priv_msgid = 0U; + msg0CreateSoundPtr->idNewSound = idNewSound; + msg0CreateSoundPtr->soundBuffer = soundBuffer != null ? soundBuffer.RenderHandle : RENDERHANDLE.NULL; + msg0CreateSoundPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0CreateSoundPtr, ref s_priv_ByteOrder_Msg0_CreateSound, typeof(RemoteSoundDevice.Msg0_CreateSound), 0, 0); + _priv_pmsgUse = (Message*)msg0CreateSoundPtr; + } + + public unsafe void SendCreateSound(RENDERHANDLE idNewSound, RemoteSoundBuffer soundBuffer) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateSound(out _priv_portUse, out _priv_pmsgUse, idNewSound, soundBuffer); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateSoundBuffer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RENDERHANDLE idNewBuffer, + SoundHeader info, + LocalSoundBufferCallback cb) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSoundDevice.Msg1_CreateSoundBuffer); + RemoteSoundDevice.Msg1_CreateSoundBuffer* createSoundBufferPtr = (RemoteSoundDevice.Msg1_CreateSoundBuffer*)_priv_portUse.AllocMessageBuffer(size); + createSoundBufferPtr->_priv_size = size; + createSoundBufferPtr->_priv_msgid = 1U; + createSoundBufferPtr->idNewBuffer = idNewBuffer; + createSoundBufferPtr->info = info; + createSoundBufferPtr->_priv_objcb = cb.RenderHandle; + createSoundBufferPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext; + createSoundBufferPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)createSoundBufferPtr, ref s_priv_ByteOrder_Msg1_CreateSoundBuffer, typeof(RemoteSoundDevice.Msg1_CreateSoundBuffer), 0, 0); + _priv_pmsgUse = (Message*)createSoundBufferPtr; + } + + public unsafe void SendCreateSoundBuffer( + RENDERHANDLE idNewBuffer, + SoundHeader info, + LocalSoundBufferCallback cb) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateSoundBuffer(out _priv_portUse, out _priv_pmsgUse, idNewBuffer, info, cb); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildEvictExternalResources( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSoundDevice.Msg2_EvictExternalResources); + RemoteSoundDevice.Msg2_EvictExternalResources* externalResourcesPtr = (RemoteSoundDevice.Msg2_EvictExternalResources*)_priv_portUse.AllocMessageBuffer(size); + externalResourcesPtr->_priv_size = size; + externalResourcesPtr->_priv_msgid = 2U; + externalResourcesPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref s_priv_ByteOrder_Msg2_EvictExternalResources, typeof(RemoteSoundDevice.Msg2_EvictExternalResources), 0, 0); + _priv_pmsgUse = (Message*)externalResourcesPtr; + } + + public unsafe void SendEvictExternalResources() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildEvictExternalResources(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateExternalResources( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSoundDevice.Msg3_CreateExternalResources); + RemoteSoundDevice.Msg3_CreateExternalResources* externalResourcesPtr = (RemoteSoundDevice.Msg3_CreateExternalResources*)_priv_portUse.AllocMessageBuffer(size); + externalResourcesPtr->_priv_size = size; + externalResourcesPtr->_priv_msgid = 3U; + externalResourcesPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref s_priv_ByteOrder_Msg3_CreateExternalResources, typeof(RemoteSoundDevice.Msg3_CreateExternalResources), 0, 0); + _priv_pmsgUse = (Message*)externalResourcesPtr; + } + + public unsafe void SendCreateExternalResources() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateExternalResources(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSoundDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteSoundDevice(port, handle, true); + } + + public static RemoteSoundDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSoundDevice(port, handle, false); + } + + protected RemoteSoundDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSoundDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSoundDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_CreateSound + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idNewSound; + public RENDERHANDLE soundBuffer; + } + + [ComVisible(false)] + private struct Msg1_CreateSoundBuffer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idNewBuffer; + public SoundHeader info; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + } + + [ComVisible(false)] + private struct Msg2_EvictExternalResources + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg3_CreateExternalResources + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs new file mode 100644 index 0000000..ca3865d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs @@ -0,0 +1,212 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSprite +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSprite : RemoteVisual + { + private static ushort[] s_priv_ByteOrder_Msg18_SetNineGrid; + private static ushort[] s_priv_ByteOrder_Msg19_AddCoordMapEntry; + private static ushort[] s_priv_ByteOrder_Msg20_ClearCoordMaps; + private static ushort[] s_priv_ByteOrder_Msg21_SetEffect; + + protected RemoteSprite() + { + } + + public unsafe void BuildSetNineGrid( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nLeft, + int nTop, + int nRight, + int nBottom) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSprite.Msg18_SetNineGrid); + RemoteSprite.Msg18_SetNineGrid* msg18SetNineGridPtr = (RemoteSprite.Msg18_SetNineGrid*)_priv_portUse.AllocMessageBuffer(size); + msg18SetNineGridPtr->_priv_size = size; + msg18SetNineGridPtr->_priv_msgid = 18U; + msg18SetNineGridPtr->nLeft = nLeft; + msg18SetNineGridPtr->nTop = nTop; + msg18SetNineGridPtr->nRight = nRight; + msg18SetNineGridPtr->nBottom = nBottom; + msg18SetNineGridPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg18SetNineGridPtr, ref s_priv_ByteOrder_Msg18_SetNineGrid, typeof(RemoteSprite.Msg18_SetNineGrid), 0, 0); + _priv_pmsgUse = (Message*)msg18SetNineGridPtr; + } + + public unsafe void SendSetNineGrid(int nLeft, int nTop, int nRight, int nBottom) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetNineGrid(out _priv_portUse, out _priv_pmsgUse, nLeft, nTop, nRight, nBottom); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddCoordMapEntry( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxLayer, + Orientation orientation, + float flPosition, + float flValue) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSprite.Msg19_AddCoordMapEntry); + RemoteSprite.Msg19_AddCoordMapEntry* addCoordMapEntryPtr = (RemoteSprite.Msg19_AddCoordMapEntry*)_priv_portUse.AllocMessageBuffer(size); + addCoordMapEntryPtr->_priv_size = size; + addCoordMapEntryPtr->_priv_msgid = 19U; + addCoordMapEntryPtr->idxLayer = idxLayer; + addCoordMapEntryPtr->orientation = orientation; + addCoordMapEntryPtr->flPosition = flPosition; + addCoordMapEntryPtr->flValue = flValue; + addCoordMapEntryPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)addCoordMapEntryPtr, ref s_priv_ByteOrder_Msg19_AddCoordMapEntry, typeof(RemoteSprite.Msg19_AddCoordMapEntry), 0, 0); + _priv_pmsgUse = (Message*)addCoordMapEntryPtr; + } + + public unsafe void SendAddCoordMapEntry( + int idxLayer, + Orientation orientation, + float flPosition, + float flValue) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddCoordMapEntry(out _priv_portUse, out _priv_pmsgUse, idxLayer, orientation, flPosition, flValue); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildClearCoordMaps(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSprite.Msg20_ClearCoordMaps); + RemoteSprite.Msg20_ClearCoordMaps* msg20ClearCoordMapsPtr = (RemoteSprite.Msg20_ClearCoordMaps*)_priv_portUse.AllocMessageBuffer(size); + msg20ClearCoordMapsPtr->_priv_size = size; + msg20ClearCoordMapsPtr->_priv_msgid = 20U; + msg20ClearCoordMapsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg20ClearCoordMapsPtr, ref s_priv_ByteOrder_Msg20_ClearCoordMaps, typeof(RemoteSprite.Msg20_ClearCoordMaps), 0, 0); + _priv_pmsgUse = (Message*)msg20ClearCoordMapsPtr; + } + + public unsafe void SendClearCoordMaps() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildClearCoordMaps(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetEffect( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteEffect effect) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (effect != null) + _priv_portUse.ValidateHandleOrNull(effect.RenderHandle); + uint size = (uint)sizeof(RemoteSprite.Msg21_SetEffect); + RemoteSprite.Msg21_SetEffect* msg21SetEffectPtr = (RemoteSprite.Msg21_SetEffect*)_priv_portUse.AllocMessageBuffer(size); + msg21SetEffectPtr->_priv_size = size; + msg21SetEffectPtr->_priv_msgid = 21U; + msg21SetEffectPtr->effect = effect != null ? effect.RenderHandle : RENDERHANDLE.NULL; + msg21SetEffectPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg21SetEffectPtr, ref s_priv_ByteOrder_Msg21_SetEffect, typeof(RemoteSprite.Msg21_SetEffect), 0, 0); + _priv_pmsgUse = (Message*)msg21SetEffectPtr; + } + + public unsafe void SendSetEffect(RemoteEffect effect) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEffect(out _priv_portUse, out _priv_pmsgUse, effect); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSprite CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteSprite(port, handle, true); + + public static RemoteSprite CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSprite(port, handle, false); + } + + protected RemoteSprite(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSprite(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSprite && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg18_SetNineGrid + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nLeft; + public int nTop; + public int nRight; + public int nBottom; + } + + [ComVisible(false)] + private struct Msg19_AddCoordMapEntry + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxLayer; + public Orientation orientation; + public float flPosition; + public float flValue; + } + + [ComVisible(false)] + private struct Msg20_ClearCoordMaps + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg21_SetEffect + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE effect; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs new file mode 100644 index 0000000..94f9d3e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs @@ -0,0 +1,338 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSurface +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSurface : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_RemapContainer; + private static ushort[] s_priv_ByteOrder_Msg1_RemapLocation; + private static ushort[] s_priv_ByteOrder_Msg2_MarkContentValid; + private static ushort[] s_priv_ByteOrder_Msg3_Clear; + private static ushort[] s_priv_ByteOrder_Msg5_SetGutter; + private static ushort[] s_priv_ByteOrder_Msg6_SetDescription; + private static ushort[] s_priv_ByteOrder_Msg7_SetRotation; + private static ushort[] s_priv_ByteOrder_Msg8_SetStorageSize; + + protected RemoteSurface() + { + } + + public unsafe void BuildRemapContainer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteSurfacePool poolNewContainer) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (poolNewContainer != null) + _priv_portUse.ValidateHandleOrNull(poolNewContainer.RenderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg0_RemapContainer); + RemoteSurface.Msg0_RemapContainer* msg0RemapContainerPtr = (RemoteSurface.Msg0_RemapContainer*)_priv_portUse.AllocMessageBuffer(size); + msg0RemapContainerPtr->_priv_size = size; + msg0RemapContainerPtr->_priv_msgid = 0U; + msg0RemapContainerPtr->poolNewContainer = poolNewContainer != null ? poolNewContainer.RenderHandle : RENDERHANDLE.NULL; + msg0RemapContainerPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0RemapContainerPtr, ref s_priv_ByteOrder_Msg0_RemapContainer, typeof(RemoteSurface.Msg0_RemapContainer), 0, 0); + _priv_pmsgUse = (Message*)msg0RemapContainerPtr; + } + + public unsafe void SendRemapContainer(RemoteSurfacePool poolNewContainer) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRemapContainer(out _priv_portUse, out _priv_pmsgUse, poolNewContainer); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildRemapLocation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Rectangle rcContentPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg1_RemapLocation); + RemoteSurface.Msg1_RemapLocation* msg1RemapLocationPtr = (RemoteSurface.Msg1_RemapLocation*)_priv_portUse.AllocMessageBuffer(size); + msg1RemapLocationPtr->_priv_size = size; + msg1RemapLocationPtr->_priv_msgid = 1U; + msg1RemapLocationPtr->rcContentPxl = rcContentPxl; + msg1RemapLocationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1RemapLocationPtr, ref s_priv_ByteOrder_Msg1_RemapLocation, typeof(RemoteSurface.Msg1_RemapLocation), 0, 0); + _priv_pmsgUse = (Message*)msg1RemapLocationPtr; + } + + public unsafe void SendRemapLocation(Rectangle rcContentPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildRemapLocation(out _priv_portUse, out _priv_pmsgUse, rcContentPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildMarkContentValid( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg2_MarkContentValid); + RemoteSurface.Msg2_MarkContentValid* markContentValidPtr = (RemoteSurface.Msg2_MarkContentValid*)_priv_portUse.AllocMessageBuffer(size); + markContentValidPtr->_priv_size = size; + markContentValidPtr->_priv_msgid = 2U; + markContentValidPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)markContentValidPtr, ref s_priv_ByteOrder_Msg2_MarkContentValid, typeof(RemoteSurface.Msg2_MarkContentValid), 0, 0); + _priv_pmsgUse = (Message*)markContentValidPtr; + } + + public unsafe void SendMarkContentValid() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildMarkContentValid(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildClear(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg3_Clear); + RemoteSurface.Msg3_Clear* msg3ClearPtr = (RemoteSurface.Msg3_Clear*)_priv_portUse.AllocMessageBuffer(size); + msg3ClearPtr->_priv_size = size; + msg3ClearPtr->_priv_msgid = 3U; + msg3ClearPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3ClearPtr, ref s_priv_ByteOrder_Msg3_Clear, typeof(RemoteSurface.Msg3_Clear), 0, 0); + _priv_pmsgUse = (Message*)msg3ClearPtr; + } + + public unsafe void SendClear() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildClear(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetGutter( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeGutter) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg5_SetGutter); + RemoteSurface.Msg5_SetGutter* msg5SetGutterPtr = (RemoteSurface.Msg5_SetGutter*)_priv_portUse.AllocMessageBuffer(size); + msg5SetGutterPtr->_priv_size = size; + msg5SetGutterPtr->_priv_msgid = 5U; + msg5SetGutterPtr->sizeGutter = sizeGutter; + msg5SetGutterPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5SetGutterPtr, ref s_priv_ByteOrder_Msg5_SetGutter, typeof(RemoteSurface.Msg5_SetGutter), 0, 0); + _priv_pmsgUse = (Message*)msg5SetGutterPtr; + } + + public unsafe void SendSetGutter(Size sizeGutter) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetGutter(out _priv_portUse, out _priv_pmsgUse, sizeGutter); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetDescription( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stDescription) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteSurface.Msg6_SetDescription)); + BLOBREF blobref = blobInfo.Add(stDescription); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteSurface.Msg6_SetDescription* msg6SetDescriptionPtr = (RemoteSurface.Msg6_SetDescription*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg6SetDescriptionPtr->_priv_size = adjustedTotalSize; + msg6SetDescriptionPtr->_priv_msgid = 6U; + msg6SetDescriptionPtr->stDescription = blobref; + blobInfo.Attach((Message*)msg6SetDescriptionPtr); + msg6SetDescriptionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg6SetDescriptionPtr, ref s_priv_ByteOrder_Msg6_SetDescription, typeof(RemoteSurface.Msg6_SetDescription), 0, 0); + _priv_pmsgUse = (Message*)msg6SetDescriptionPtr; + } + + public unsafe void SendSetDescription(string stDescription) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDescription(out _priv_portUse, out _priv_pmsgUse, stDescription); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetRotation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fRotated) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg7_SetRotation); + RemoteSurface.Msg7_SetRotation* msg7SetRotationPtr = (RemoteSurface.Msg7_SetRotation*)_priv_portUse.AllocMessageBuffer(size); + msg7SetRotationPtr->_priv_size = size; + msg7SetRotationPtr->_priv_msgid = 7U; + msg7SetRotationPtr->fRotated = fRotated ? uint.MaxValue : 0U; + msg7SetRotationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7SetRotationPtr, ref s_priv_ByteOrder_Msg7_SetRotation, typeof(RemoteSurface.Msg7_SetRotation), 0, 0); + _priv_pmsgUse = (Message*)msg7SetRotationPtr; + } + + public unsafe void SendSetRotation(bool fRotated) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetRotation(out _priv_portUse, out _priv_pmsgUse, fRotated); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetStorageSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeStoragePxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurface.Msg8_SetStorageSize); + RemoteSurface.Msg8_SetStorageSize* msg8SetStorageSizePtr = (RemoteSurface.Msg8_SetStorageSize*)_priv_portUse.AllocMessageBuffer(size); + msg8SetStorageSizePtr->_priv_size = size; + msg8SetStorageSizePtr->_priv_msgid = 8U; + msg8SetStorageSizePtr->sizeStoragePxl = sizeStoragePxl; + msg8SetStorageSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8SetStorageSizePtr, ref s_priv_ByteOrder_Msg8_SetStorageSize, typeof(RemoteSurface.Msg8_SetStorageSize), 0, 0); + _priv_pmsgUse = (Message*)msg8SetStorageSizePtr; + } + + public unsafe void SendSetStorageSize(Size sizeStoragePxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetStorageSize(out _priv_portUse, out _priv_pmsgUse, sizeStoragePxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSurface CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteSurface(port, handle, true); + + public static RemoteSurface CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSurface(port, handle, false); + } + + protected RemoteSurface(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSurface(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSurface && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_RemapContainer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE poolNewContainer; + } + + [ComVisible(false)] + private struct Msg1_RemapLocation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Rectangle rcContentPxl; + } + + [ComVisible(false)] + private struct Msg2_MarkContentValid + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg3_Clear + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg5_SetGutter + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeGutter; + } + + [ComVisible(false)] + private struct Msg6_SetDescription + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stDescription; + } + + [ComVisible(false)] + private struct Msg7_SetRotation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fRotated; + } + + [ComVisible(false)] + private struct Msg8_SetStorageSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeStoragePxl; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs new file mode 100644 index 0000000..f9808fd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs @@ -0,0 +1,232 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteSurfacePool +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteSurfacePool : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_SetEffect; + private static ushort[] s_priv_ByteOrder_Msg1_CreateSurface; + private static ushort[] s_priv_ByteOrder_Msg2_Free; + private static ushort[] s_priv_ByteOrder_Msg3_Allocate; + private static ushort[] s_priv_ByteOrder_Msg4_SetPriority; + + protected RemoteSurfacePool() + { + } + + public unsafe void BuildSetEffect( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteEffect effect) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (effect != null) + _priv_portUse.ValidateHandleOrNull(effect.RenderHandle); + uint size = (uint)sizeof(RemoteSurfacePool.Msg0_SetEffect); + RemoteSurfacePool.Msg0_SetEffect* msg0SetEffectPtr = (RemoteSurfacePool.Msg0_SetEffect*)_priv_portUse.AllocMessageBuffer(size); + msg0SetEffectPtr->_priv_size = size; + msg0SetEffectPtr->_priv_msgid = 0U; + msg0SetEffectPtr->effect = effect != null ? effect.RenderHandle : RENDERHANDLE.NULL; + msg0SetEffectPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0SetEffectPtr, ref s_priv_ByteOrder_Msg0_SetEffect, typeof(RemoteSurfacePool.Msg0_SetEffect), 0, 0); + _priv_pmsgUse = (Message*)msg0SetEffectPtr; + } + + public unsafe void SendSetEffect(RemoteEffect effect) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetEffect(out _priv_portUse, out _priv_pmsgUse, effect); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildCreateSurface( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RENDERHANDLE idNewSurface) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurfacePool.Msg1_CreateSurface); + RemoteSurfacePool.Msg1_CreateSurface* msg1CreateSurfacePtr = (RemoteSurfacePool.Msg1_CreateSurface*)_priv_portUse.AllocMessageBuffer(size); + msg1CreateSurfacePtr->_priv_size = size; + msg1CreateSurfacePtr->_priv_msgid = 1U; + msg1CreateSurfacePtr->idNewSurface = idNewSurface; + msg1CreateSurfacePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1CreateSurfacePtr, ref s_priv_ByteOrder_Msg1_CreateSurface, typeof(RemoteSurfacePool.Msg1_CreateSurface), 0, 0); + _priv_pmsgUse = (Message*)msg1CreateSurfacePtr; + } + + public unsafe void SendCreateSurface(RENDERHANDLE idNewSurface) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildCreateSurface(out _priv_portUse, out _priv_pmsgUse, idNewSurface); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildFree(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurfacePool.Msg2_Free); + RemoteSurfacePool.Msg2_Free* msg2FreePtr = (RemoteSurfacePool.Msg2_Free*)_priv_portUse.AllocMessageBuffer(size); + msg2FreePtr->_priv_size = size; + msg2FreePtr->_priv_msgid = 2U; + msg2FreePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2FreePtr, ref s_priv_ByteOrder_Msg2_Free, typeof(RemoteSurfacePool.Msg2_Free), 0, 0); + _priv_pmsgUse = (Message*)msg2FreePtr; + } + + public unsafe void SendFree() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildFree(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAllocate( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizePxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurfacePool.Msg3_Allocate); + RemoteSurfacePool.Msg3_Allocate* msg3AllocatePtr = (RemoteSurfacePool.Msg3_Allocate*)_priv_portUse.AllocMessageBuffer(size); + msg3AllocatePtr->_priv_size = size; + msg3AllocatePtr->_priv_msgid = 3U; + msg3AllocatePtr->sizePxl = sizePxl; + msg3AllocatePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3AllocatePtr, ref s_priv_ByteOrder_Msg3_Allocate, typeof(RemoteSurfacePool.Msg3_Allocate), 0, 0); + _priv_pmsgUse = (Message*)msg3AllocatePtr; + } + + public unsafe void SendAllocate(Size sizePxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAllocate(out _priv_portUse, out _priv_pmsgUse, sizePxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetPriority( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int nPriority) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteSurfacePool.Msg4_SetPriority); + RemoteSurfacePool.Msg4_SetPriority* msg4SetPriorityPtr = (RemoteSurfacePool.Msg4_SetPriority*)_priv_portUse.AllocMessageBuffer(size); + msg4SetPriorityPtr->_priv_size = size; + msg4SetPriorityPtr->_priv_msgid = 4U; + msg4SetPriorityPtr->nPriority = nPriority; + msg4SetPriorityPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4SetPriorityPtr, ref s_priv_ByteOrder_Msg4_SetPriority, typeof(RemoteSurfacePool.Msg4_SetPriority), 0, 0); + _priv_pmsgUse = (Message*)msg4SetPriorityPtr; + } + + public unsafe void SendSetPriority(int nPriority) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetPriority(out _priv_portUse, out _priv_pmsgUse, nPriority); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteSurfacePool CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteSurfacePool(port, handle, true); + } + + public static RemoteSurfacePool CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteSurfacePool(port, handle, false); + } + + protected RemoteSurfacePool(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteSurfacePool(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteSurfacePool && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_SetEffect + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE effect; + } + + [ComVisible(false)] + private struct Msg1_CreateSurface + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE idNewSurface; + } + + [ComVisible(false)] + private struct Msg2_Free + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg3_Allocate + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizePxl; + } + + [ComVisible(false)] + private struct Msg4_SetPriority + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int nPriority; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs new file mode 100644 index 0000000..45f296b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs @@ -0,0 +1,368 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteVideoPool +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteVideoPool : RemoteSurfacePool + { + private static ushort[] s_priv_ByteOrder_Msg6_NotifyVideoInputChanged; + private static ushort[] s_priv_ByteOrder_Msg7_SetContentOverscan; + private static ushort[] s_priv_ByteOrder_Msg8_NotifyVideoSizeChanged; + private static ushort[] s_priv_ByteOrder_Msg10_OnFrameReady; + private static ushort[] s_priv_ByteOrder_Msg11_OnClockStop; + private static ushort[] s_priv_ByteOrder_Msg12_OnClockStart; + private static ushort[] s_priv_ByteOrder_Msg13_OnDisconnect; + private static ushort[] s_priv_ByteOrder_Msg14_OnConnect; + + protected RemoteVideoPool() + { + } + + public unsafe void BuildNotifyVideoInputChanged( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeContentPxl, + Size sizeAspectRatio) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg6_NotifyVideoInputChanged); + RemoteVideoPool.Msg6_NotifyVideoInputChanged* videoInputChangedPtr = (RemoteVideoPool.Msg6_NotifyVideoInputChanged*)_priv_portUse.AllocMessageBuffer(size); + videoInputChangedPtr->_priv_size = size; + videoInputChangedPtr->_priv_msgid = 6U; + videoInputChangedPtr->sizeContentPxl = sizeContentPxl; + videoInputChangedPtr->sizeAspectRatio = sizeAspectRatio; + videoInputChangedPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)videoInputChangedPtr, ref s_priv_ByteOrder_Msg6_NotifyVideoInputChanged, typeof(RemoteVideoPool.Msg6_NotifyVideoInputChanged), 0, 0); + _priv_pmsgUse = (Message*)videoInputChangedPtr; + } + + public unsafe void SendNotifyVideoInputChanged(Size sizeContentPxl, Size sizeAspectRatio) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildNotifyVideoInputChanged(out _priv_portUse, out _priv_pmsgUse, sizeContentPxl, sizeAspectRatio); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetContentOverscan( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flContentOverscan) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg7_SetContentOverscan); + RemoteVideoPool.Msg7_SetContentOverscan* setContentOverscanPtr = (RemoteVideoPool.Msg7_SetContentOverscan*)_priv_portUse.AllocMessageBuffer(size); + setContentOverscanPtr->_priv_size = size; + setContentOverscanPtr->_priv_msgid = 7U; + setContentOverscanPtr->flContentOverscan = flContentOverscan; + setContentOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setContentOverscanPtr, ref s_priv_ByteOrder_Msg7_SetContentOverscan, typeof(RemoteVideoPool.Msg7_SetContentOverscan), 0, 0); + _priv_pmsgUse = (Message*)setContentOverscanPtr; + } + + public unsafe void SendSetContentOverscan(float flContentOverscan) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetContentOverscan(out _priv_portUse, out _priv_pmsgUse, flContentOverscan); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildNotifyVideoSizeChanged( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Size sizeTargetPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg8_NotifyVideoSizeChanged); + RemoteVideoPool.Msg8_NotifyVideoSizeChanged* videoSizeChangedPtr = (RemoteVideoPool.Msg8_NotifyVideoSizeChanged*)_priv_portUse.AllocMessageBuffer(size); + videoSizeChangedPtr->_priv_size = size; + videoSizeChangedPtr->_priv_msgid = 8U; + videoSizeChangedPtr->sizeTargetPxl = sizeTargetPxl; + videoSizeChangedPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)videoSizeChangedPtr, ref s_priv_ByteOrder_Msg8_NotifyVideoSizeChanged, typeof(RemoteVideoPool.Msg8_NotifyVideoSizeChanged), 0, 0); + _priv_pmsgUse = (Message*)videoSizeChangedPtr; + } + + public unsafe void SendNotifyVideoSizeChanged(Size sizeTargetPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildNotifyVideoSizeChanged(out _priv_portUse, out _priv_pmsgUse, sizeTargetPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildOnFrameReady( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + int idxFrame, + long nTimeStampQPC, + long nFrameCount, + Rectangle rcContent, + uint nOptions) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg10_OnFrameReady); + RemoteVideoPool.Msg10_OnFrameReady* msg10OnFrameReadyPtr = (RemoteVideoPool.Msg10_OnFrameReady*)_priv_portUse.AllocMessageBuffer(size); + msg10OnFrameReadyPtr->_priv_size = size; + msg10OnFrameReadyPtr->_priv_msgid = 10U; + msg10OnFrameReadyPtr->idxFrame = idxFrame; + msg10OnFrameReadyPtr->nTimeStampQPC = nTimeStampQPC; + msg10OnFrameReadyPtr->nFrameCount = nFrameCount; + msg10OnFrameReadyPtr->rcContent = rcContent; + msg10OnFrameReadyPtr->nOptions = nOptions; + msg10OnFrameReadyPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg10OnFrameReadyPtr, ref s_priv_ByteOrder_Msg10_OnFrameReady, typeof(RemoteVideoPool.Msg10_OnFrameReady), 0, 0); + _priv_pmsgUse = (Message*)msg10OnFrameReadyPtr; + } + + public unsafe void SendOnFrameReady( + int idxFrame, + long nTimeStampQPC, + long nFrameCount, + Rectangle rcContent, + uint nOptions) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildOnFrameReady(out _priv_portUse, out _priv_pmsgUse, idxFrame, nTimeStampQPC, nFrameCount, rcContent, nOptions); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildOnClockStop(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg11_OnClockStop); + RemoteVideoPool.Msg11_OnClockStop* msg11OnClockStopPtr = (RemoteVideoPool.Msg11_OnClockStop*)_priv_portUse.AllocMessageBuffer(size); + msg11OnClockStopPtr->_priv_size = size; + msg11OnClockStopPtr->_priv_msgid = 11U; + msg11OnClockStopPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg11OnClockStopPtr, ref s_priv_ByteOrder_Msg11_OnClockStop, typeof(RemoteVideoPool.Msg11_OnClockStop), 0, 0); + _priv_pmsgUse = (Message*)msg11OnClockStopPtr; + } + + public unsafe void SendOnClockStop() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildOnClockStop(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildOnClockStart( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nClockGeneration, + uint nFrameRateNumerator, + uint nFrameRateDenominator, + Rectangle rcBasisPxl, + Size sizeAspectRatio) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg12_OnClockStart); + RemoteVideoPool.Msg12_OnClockStart* msg12OnClockStartPtr = (RemoteVideoPool.Msg12_OnClockStart*)_priv_portUse.AllocMessageBuffer(size); + msg12OnClockStartPtr->_priv_size = size; + msg12OnClockStartPtr->_priv_msgid = 12U; + msg12OnClockStartPtr->nClockGeneration = nClockGeneration; + msg12OnClockStartPtr->nFrameRateNumerator = nFrameRateNumerator; + msg12OnClockStartPtr->nFrameRateDenominator = nFrameRateDenominator; + msg12OnClockStartPtr->rcBasisPxl = rcBasisPxl; + msg12OnClockStartPtr->sizeAspectRatio = sizeAspectRatio; + msg12OnClockStartPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg12OnClockStartPtr, ref s_priv_ByteOrder_Msg12_OnClockStart, typeof(RemoteVideoPool.Msg12_OnClockStart), 0, 0); + _priv_pmsgUse = (Message*)msg12OnClockStartPtr; + } + + public unsafe void SendOnClockStart( + uint nClockGeneration, + uint nFrameRateNumerator, + uint nFrameRateDenominator, + Rectangle rcBasisPxl, + Size sizeAspectRatio) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildOnClockStart(out _priv_portUse, out _priv_pmsgUse, nClockGeneration, nFrameRateNumerator, nFrameRateDenominator, rcBasisPxl, sizeAspectRatio); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildOnDisconnect(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg13_OnDisconnect); + RemoteVideoPool.Msg13_OnDisconnect* msg13OnDisconnectPtr = (RemoteVideoPool.Msg13_OnDisconnect*)_priv_portUse.AllocMessageBuffer(size); + msg13OnDisconnectPtr->_priv_size = size; + msg13OnDisconnectPtr->_priv_msgid = 13U; + msg13OnDisconnectPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg13OnDisconnectPtr, ref s_priv_ByteOrder_Msg13_OnDisconnect, typeof(RemoteVideoPool.Msg13_OnDisconnect), 0, 0); + _priv_pmsgUse = (Message*)msg13OnDisconnectPtr; + } + + public unsafe void SendOnDisconnect() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildOnDisconnect(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildOnConnect(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVideoPool.Msg14_OnConnect); + RemoteVideoPool.Msg14_OnConnect* msg14OnConnectPtr = (RemoteVideoPool.Msg14_OnConnect*)_priv_portUse.AllocMessageBuffer(size); + msg14OnConnectPtr->_priv_size = size; + msg14OnConnectPtr->_priv_msgid = 14U; + msg14OnConnectPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg14OnConnectPtr, ref s_priv_ByteOrder_Msg14_OnConnect, typeof(RemoteVideoPool.Msg14_OnConnect), 0, 0); + _priv_pmsgUse = (Message*)msg14OnConnectPtr; + } + + public unsafe void SendOnConnect() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildOnConnect(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteVideoPool CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteVideoPool(port, handle, true); + } + + public static RemoteVideoPool CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteVideoPool(port, handle, false); + } + + protected RemoteVideoPool(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteVideoPool(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteVideoPool && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg6_NotifyVideoInputChanged + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeContentPxl; + public Size sizeAspectRatio; + } + + [ComVisible(false)] + private struct Msg7_SetContentOverscan + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flContentOverscan; + } + + [ComVisible(false)] + private struct Msg8_NotifyVideoSizeChanged + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Size sizeTargetPxl; + } + + [ComVisible(false)] + private struct Msg10_OnFrameReady + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public int idxFrame; + public long nTimeStampQPC; + public long nFrameCount; + public Rectangle rcContent; + public uint nOptions; + } + + [ComVisible(false)] + private struct Msg11_OnClockStop + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg12_OnClockStart + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nClockGeneration; + public uint nFrameRateNumerator; + public uint nFrameRateDenominator; + public Rectangle rcBasisPxl; + public Size sizeAspectRatio; + } + + [ComVisible(false)] + private struct Msg13_OnDisconnect + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg14_OnConnect + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs new file mode 100644 index 0000000..7995a40 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs @@ -0,0 +1,648 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteVisual +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteVisual : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_ClearGradients; + private static ushort[] s_priv_ByteOrder_Msg1_AddGradient; + private static ushort[] s_priv_ByteOrder_Msg2_SetRelativeSize; + private static ushort[] s_priv_ByteOrder_Msg3_Reset; + private static ushort[] s_priv_ByteOrder_Msg4_ChangeDataBits; + private static ushort[] s_priv_ByteOrder_Msg5_ChangeParent; + private static ushort[] s_priv_ByteOrder_Msg6_SetDebugOutlineColor; + private static ushort[] s_priv_ByteOrder_Msg7_SetDebugID; + private static ushort[] s_priv_ByteOrder_Msg8_SetAlpha; + private static ushort[] s_priv_ByteOrder_Msg9_SetLayer; + private static ushort[] s_priv_ByteOrder_Msg10_SetRotation; + private static ushort[] s_priv_ByteOrder_Msg11_SetCenterPointScale; + private static ushort[] s_priv_ByteOrder_Msg12_SetScale; + private static ushort[] s_priv_ByteOrder_Msg13_SetSize; + private static ushort[] s_priv_ByteOrder_Msg14_SetPosition; + private static ushort[] s_priv_ByteOrder_Msg16_SetVisible; + + protected RemoteVisual() + { + } + + public unsafe void BuildClearGradients(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg0_ClearGradients); + RemoteVisual.Msg0_ClearGradients* msg0ClearGradientsPtr = (RemoteVisual.Msg0_ClearGradients*)_priv_portUse.AllocMessageBuffer(size); + msg0ClearGradientsPtr->_priv_size = size; + msg0ClearGradientsPtr->_priv_msgid = 0U; + msg0ClearGradientsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0ClearGradientsPtr, ref s_priv_ByteOrder_Msg0_ClearGradients, typeof(RemoteVisual.Msg0_ClearGradients), 0, 0); + _priv_pmsgUse = (Message*)msg0ClearGradientsPtr; + } + + public unsafe void SendClearGradients() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildClearGradients(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildAddGradient( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteGradient grad) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (grad != null) + _priv_portUse.ValidateHandleOrNull(grad.RenderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg1_AddGradient); + RemoteVisual.Msg1_AddGradient* msg1AddGradientPtr = (RemoteVisual.Msg1_AddGradient*)_priv_portUse.AllocMessageBuffer(size); + msg1AddGradientPtr->_priv_size = size; + msg1AddGradientPtr->_priv_msgid = 1U; + msg1AddGradientPtr->grad = grad != null ? grad.RenderHandle : RENDERHANDLE.NULL; + msg1AddGradientPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1AddGradientPtr, ref s_priv_ByteOrder_Msg1_AddGradient, typeof(RemoteVisual.Msg1_AddGradient), 0, 0); + _priv_pmsgUse = (Message*)msg1AddGradientPtr; + } + + public unsafe void SendAddGradient(RemoteGradient grad) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildAddGradient(out _priv_portUse, out _priv_pmsgUse, grad); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetRelativeSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fRelative) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg2_SetRelativeSize); + RemoteVisual.Msg2_SetRelativeSize* msg2SetRelativeSizePtr = (RemoteVisual.Msg2_SetRelativeSize*)_priv_portUse.AllocMessageBuffer(size); + msg2SetRelativeSizePtr->_priv_size = size; + msg2SetRelativeSizePtr->_priv_msgid = 2U; + msg2SetRelativeSizePtr->fRelative = fRelative ? uint.MaxValue : 0U; + msg2SetRelativeSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetRelativeSizePtr, ref s_priv_ByteOrder_Msg2_SetRelativeSize, typeof(RemoteVisual.Msg2_SetRelativeSize), 0, 0); + _priv_pmsgUse = (Message*)msg2SetRelativeSizePtr; + } + + public unsafe void SendSetRelativeSize(bool fRelative) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetRelativeSize(out _priv_portUse, out _priv_pmsgUse, fRelative); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildReset(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg3_Reset); + RemoteVisual.Msg3_Reset* msg3ResetPtr = (RemoteVisual.Msg3_Reset*)_priv_portUse.AllocMessageBuffer(size); + msg3ResetPtr->_priv_size = size; + msg3ResetPtr->_priv_msgid = 3U; + msg3ResetPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3ResetPtr, ref s_priv_ByteOrder_Msg3_Reset, typeof(RemoteVisual.Msg3_Reset), 0, 0); + _priv_pmsgUse = (Message*)msg3ResetPtr; + } + + public unsafe void SendReset() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildReset(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildChangeDataBits( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nValue, + uint nMask) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg4_ChangeDataBits); + RemoteVisual.Msg4_ChangeDataBits* msg4ChangeDataBitsPtr = (RemoteVisual.Msg4_ChangeDataBits*)_priv_portUse.AllocMessageBuffer(size); + msg4ChangeDataBitsPtr->_priv_size = size; + msg4ChangeDataBitsPtr->_priv_msgid = 4U; + msg4ChangeDataBitsPtr->nValue = nValue; + msg4ChangeDataBitsPtr->nMask = nMask; + msg4ChangeDataBitsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4ChangeDataBitsPtr, ref s_priv_ByteOrder_Msg4_ChangeDataBits, typeof(RemoteVisual.Msg4_ChangeDataBits), 0, 0); + _priv_pmsgUse = (Message*)msg4ChangeDataBitsPtr; + } + + public unsafe void SendChangeDataBits(uint nValue, uint nMask) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildChangeDataBits(out _priv_portUse, out _priv_pmsgUse, nValue, nMask); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildChangeParent( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteVisual visNewParent, + RemoteVisual visSibling, + VisualOrder nOrder) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (visNewParent != null) + _priv_portUse.ValidateHandleOrNull(visNewParent.RenderHandle); + if (visSibling != null) + _priv_portUse.ValidateHandleOrNull(visSibling.RenderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg5_ChangeParent); + RemoteVisual.Msg5_ChangeParent* msg5ChangeParentPtr = (RemoteVisual.Msg5_ChangeParent*)_priv_portUse.AllocMessageBuffer(size); + msg5ChangeParentPtr->_priv_size = size; + msg5ChangeParentPtr->_priv_msgid = 5U; + msg5ChangeParentPtr->visNewParent = visNewParent != null ? visNewParent.RenderHandle : RENDERHANDLE.NULL; + msg5ChangeParentPtr->visSibling = visSibling != null ? visSibling.RenderHandle : RENDERHANDLE.NULL; + msg5ChangeParentPtr->nOrder = nOrder; + msg5ChangeParentPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5ChangeParentPtr, ref s_priv_ByteOrder_Msg5_ChangeParent, typeof(RemoteVisual.Msg5_ChangeParent), 0, 0); + _priv_pmsgUse = (Message*)msg5ChangeParentPtr; + } + + public unsafe void SendChangeParent( + RemoteVisual visNewParent, + RemoteVisual visSibling, + VisualOrder nOrder) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildChangeParent(out _priv_portUse, out _priv_pmsgUse, visNewParent, visSibling, nOrder); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetDebugOutlineColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clr) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg6_SetDebugOutlineColor); + RemoteVisual.Msg6_SetDebugOutlineColor* debugOutlineColorPtr = (RemoteVisual.Msg6_SetDebugOutlineColor*)_priv_portUse.AllocMessageBuffer(size); + debugOutlineColorPtr->_priv_size = size; + debugOutlineColorPtr->_priv_msgid = 6U; + debugOutlineColorPtr->clr = clr; + debugOutlineColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)debugOutlineColorPtr, ref s_priv_ByteOrder_Msg6_SetDebugOutlineColor, typeof(RemoteVisual.Msg6_SetDebugOutlineColor), 0, 0); + _priv_pmsgUse = (Message*)debugOutlineColorPtr; + } + + public unsafe void SendSetDebugOutlineColor(ColorF clr) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDebugOutlineColor(out _priv_portUse, out _priv_pmsgUse, clr); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetDebugID( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + string stDebugID) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteVisual.Msg7_SetDebugID)); + BLOBREF blobref = blobInfo.Add(stDebugID); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteVisual.Msg7_SetDebugID* msg7SetDebugIdPtr = (RemoteVisual.Msg7_SetDebugID*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg7SetDebugIdPtr->_priv_size = adjustedTotalSize; + msg7SetDebugIdPtr->_priv_msgid = 7U; + msg7SetDebugIdPtr->stDebugID = blobref; + blobInfo.Attach((Message*)msg7SetDebugIdPtr); + msg7SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg7SetDebugIdPtr, ref s_priv_ByteOrder_Msg7_SetDebugID, typeof(RemoteVisual.Msg7_SetDebugID), 0, 0); + _priv_pmsgUse = (Message*)msg7SetDebugIdPtr; + } + + public unsafe void SendSetDebugID(string stDebugID) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetDebugID(out _priv_portUse, out _priv_pmsgUse, stDebugID); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetAlpha( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float fAlpha) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg8_SetAlpha); + RemoteVisual.Msg8_SetAlpha* msg8SetAlphaPtr = (RemoteVisual.Msg8_SetAlpha*)_priv_portUse.AllocMessageBuffer(size); + msg8SetAlphaPtr->_priv_size = size; + msg8SetAlphaPtr->_priv_msgid = 8U; + msg8SetAlphaPtr->fAlpha = fAlpha; + msg8SetAlphaPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg8SetAlphaPtr, ref s_priv_ByteOrder_Msg8_SetAlpha, typeof(RemoteVisual.Msg8_SetAlpha), 0, 0); + _priv_pmsgUse = (Message*)msg8SetAlphaPtr; + } + + public unsafe void SendSetAlpha(float fAlpha) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetAlpha(out _priv_portUse, out _priv_pmsgUse, fAlpha); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetLayer( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint layer) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg9_SetLayer); + RemoteVisual.Msg9_SetLayer* msg9SetLayerPtr = (RemoteVisual.Msg9_SetLayer*)_priv_portUse.AllocMessageBuffer(size); + msg9SetLayerPtr->_priv_size = size; + msg9SetLayerPtr->_priv_msgid = 9U; + msg9SetLayerPtr->layer = layer; + msg9SetLayerPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg9SetLayerPtr, ref s_priv_ByteOrder_Msg9_SetLayer, typeof(RemoteVisual.Msg9_SetLayer), 0, 0); + _priv_pmsgUse = (Message*)msg9SetLayerPtr; + } + + public unsafe void SendSetLayer(uint layer) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetLayer(out _priv_portUse, out _priv_pmsgUse, layer); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetRotation( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + AxisAngle aaRotation) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg10_SetRotation); + RemoteVisual.Msg10_SetRotation* msg10SetRotationPtr = (RemoteVisual.Msg10_SetRotation*)_priv_portUse.AllocMessageBuffer(size); + msg10SetRotationPtr->_priv_size = size; + msg10SetRotationPtr->_priv_msgid = 10U; + msg10SetRotationPtr->aaRotation = aaRotation; + msg10SetRotationPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg10SetRotationPtr, ref s_priv_ByteOrder_Msg10_SetRotation, typeof(RemoteVisual.Msg10_SetRotation), 0, 0); + _priv_pmsgUse = (Message*)msg10SetRotationPtr; + } + + public unsafe void SendSetRotation(AxisAngle aaRotation) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetRotation(out _priv_portUse, out _priv_pmsgUse, aaRotation); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetCenterPointScale( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vCenterPointScale) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg11_SetCenterPointScale); + RemoteVisual.Msg11_SetCenterPointScale* centerPointScalePtr = (RemoteVisual.Msg11_SetCenterPointScale*)_priv_portUse.AllocMessageBuffer(size); + centerPointScalePtr->_priv_size = size; + centerPointScalePtr->_priv_msgid = 11U; + centerPointScalePtr->vCenterPointScale = vCenterPointScale; + centerPointScalePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)centerPointScalePtr, ref s_priv_ByteOrder_Msg11_SetCenterPointScale, typeof(RemoteVisual.Msg11_SetCenterPointScale), 0, 0); + _priv_pmsgUse = (Message*)centerPointScalePtr; + } + + public unsafe void SendSetCenterPointScale(Vector3 vCenterPointScale) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCenterPointScale(out _priv_portUse, out _priv_pmsgUse, vCenterPointScale); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetScale( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vScale) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg12_SetScale); + RemoteVisual.Msg12_SetScale* msg12SetScalePtr = (RemoteVisual.Msg12_SetScale*)_priv_portUse.AllocMessageBuffer(size); + msg12SetScalePtr->_priv_size = size; + msg12SetScalePtr->_priv_msgid = 12U; + msg12SetScalePtr->vScale = vScale; + msg12SetScalePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg12SetScalePtr, ref s_priv_ByteOrder_Msg12_SetScale, typeof(RemoteVisual.Msg12_SetScale), 0, 0); + _priv_pmsgUse = (Message*)msg12SetScalePtr; + } + + public unsafe void SendSetScale(Vector3 vScale) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetScale(out _priv_portUse, out _priv_pmsgUse, vScale); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetSize( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector2 vSizePxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg13_SetSize); + RemoteVisual.Msg13_SetSize* msg13SetSizePtr = (RemoteVisual.Msg13_SetSize*)_priv_portUse.AllocMessageBuffer(size); + msg13SetSizePtr->_priv_size = size; + msg13SetSizePtr->_priv_msgid = 13U; + msg13SetSizePtr->vSizePxl = vSizePxl; + msg13SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg13SetSizePtr, ref s_priv_ByteOrder_Msg13_SetSize, typeof(RemoteVisual.Msg13_SetSize), 0, 0); + _priv_pmsgUse = (Message*)msg13SetSizePtr; + } + + public unsafe void SendSetSize(Vector2 vSizePxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetSize(out _priv_portUse, out _priv_pmsgUse, vSizePxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetPosition( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + Vector3 vPositionPxl) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg14_SetPosition); + RemoteVisual.Msg14_SetPosition* msg14SetPositionPtr = (RemoteVisual.Msg14_SetPosition*)_priv_portUse.AllocMessageBuffer(size); + msg14SetPositionPtr->_priv_size = size; + msg14SetPositionPtr->_priv_msgid = 14U; + msg14SetPositionPtr->vPositionPxl = vPositionPxl; + msg14SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg14SetPositionPtr, ref s_priv_ByteOrder_Msg14_SetPosition, typeof(RemoteVisual.Msg14_SetPosition), 0, 0); + _priv_pmsgUse = (Message*)msg14SetPositionPtr; + } + + public unsafe void SendSetPosition(Vector3 vPositionPxl) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetPosition(out _priv_portUse, out _priv_pmsgUse, vPositionPxl); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVisible( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fVisible) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteVisual.Msg16_SetVisible); + RemoteVisual.Msg16_SetVisible* msg16SetVisiblePtr = (RemoteVisual.Msg16_SetVisible*)_priv_portUse.AllocMessageBuffer(size); + msg16SetVisiblePtr->_priv_size = size; + msg16SetVisiblePtr->_priv_msgid = 16U; + msg16SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; + msg16SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg16SetVisiblePtr, ref s_priv_ByteOrder_Msg16_SetVisible, typeof(RemoteVisual.Msg16_SetVisible), 0, 0); + _priv_pmsgUse = (Message*)msg16SetVisiblePtr; + } + + public unsafe void SendSetVisible(bool fVisible) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVisible(out _priv_portUse, out _priv_pmsgUse, fVisible); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteVisual CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteVisual(port, handle, true); + + public static RemoteVisual CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteVisual(port, handle, false); + } + + protected RemoteVisual(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteVisual(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteVisual && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_ClearGradients + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_AddGradient + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE grad; + } + + [ComVisible(false)] + private struct Msg2_SetRelativeSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fRelative; + } + + [ComVisible(false)] + private struct Msg3_Reset + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg4_ChangeDataBits + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nValue; + public uint nMask; + } + + [ComVisible(false)] + private struct Msg5_ChangeParent + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE visNewParent; + public RENDERHANDLE visSibling; + public VisualOrder nOrder; + } + + [ComVisible(false)] + private struct Msg6_SetDebugOutlineColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clr; + } + + [ComVisible(false)] + private struct Msg7_SetDebugID + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF stDebugID; + } + + [ComVisible(false)] + private struct Msg8_SetAlpha + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float fAlpha; + } + + [ComVisible(false)] + private struct Msg9_SetLayer + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint layer; + } + + [ComVisible(false)] + private struct Msg10_SetRotation + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public AxisAngle aaRotation; + } + + [ComVisible(false)] + private struct Msg11_SetCenterPointScale + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vCenterPointScale; + } + + [ComVisible(false)] + private struct Msg12_SetScale + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vScale; + } + + [ComVisible(false)] + private struct Msg13_SetSize + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector2 vSizePxl; + } + + [ComVisible(false)] + private struct Msg14_SetPosition + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public Vector3 vPositionPxl; + } + + [ComVisible(false)] + private struct Msg16_SetVisible + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fVisible; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs new file mode 100644 index 0000000..8a4a638 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs @@ -0,0 +1,118 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteVisualContainer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteVisualContainer : RemoteVisual + { + private static ushort[] s_priv_ByteOrder_Msg19_Create; + private static ushort[] s_priv_ByteOrder_Msg18_SetCamera; + + protected RemoteVisualContainer() + { + } + + public static unsafe RemoteVisualContainer Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE containerClassHandle = _priv_protocolInstance.VisualContainer_ClassHandle; + RemoteVisualContainer remoteVisualContainer = new RemoteVisualContainer(port, _priv_owner); + uint num = (uint)sizeof(RemoteVisualContainer.Msg19_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteVisualContainer.Msg19_Create* msg19CreatePtr = (RemoteVisualContainer.Msg19_Create*)pMem; + msg19CreatePtr->_priv_size = num; + msg19CreatePtr->_priv_msgid = 19U; + msg19CreatePtr->_priv_idObjectSubject = remoteVisualContainer.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg19_Create, typeof(RemoteVisualContainer.Msg19_Create), 0, 0); + port.CreateRemoteObject(containerClassHandle, remoteVisualContainer.m_renderHandle, (Message*)msg19CreatePtr); + return remoteVisualContainer; + } + + public unsafe void BuildSetCamera( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteCamera camera) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (camera != null) + _priv_portUse.ValidateHandleOrNull(camera.RenderHandle); + uint size = (uint)sizeof(RemoteVisualContainer.Msg18_SetCamera); + RemoteVisualContainer.Msg18_SetCamera* msg18SetCameraPtr = (RemoteVisualContainer.Msg18_SetCamera*)_priv_portUse.AllocMessageBuffer(size); + msg18SetCameraPtr->_priv_size = size; + msg18SetCameraPtr->_priv_msgid = 18U; + msg18SetCameraPtr->camera = camera != null ? camera.RenderHandle : RENDERHANDLE.NULL; + msg18SetCameraPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg18SetCameraPtr, ref s_priv_ByteOrder_Msg18_SetCamera, typeof(RemoteVisualContainer.Msg18_SetCamera), 0, 0); + _priv_pmsgUse = (Message*)msg18SetCameraPtr; + } + + public unsafe void SendSetCamera(RemoteCamera camera) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetCamera(out _priv_portUse, out _priv_pmsgUse, camera); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteVisualContainer CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteVisualContainer(port, handle, true); + } + + public static RemoteVisualContainer CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteVisualContainer(port, handle, false); + } + + protected RemoteVisualContainer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteVisualContainer(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteVisualContainer && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg19_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg18_SetCamera + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE camera; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs new file mode 100644 index 0000000..c73ab0a --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs @@ -0,0 +1,272 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteWaitCursor +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteWaitCursor : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg5_Create; + private static ushort[] s_priv_ByteOrder_Msg0_Show; + private static ushort[] s_priv_ByteOrder_Msg1_Hide; + private static ushort[] s_priv_ByteOrder_Msg2_SetVisuals; + private static ushort[] s_priv_ByteOrder_Msg3_SetShowAnimations; + private static ushort[] s_priv_ByteOrder_Msg4_SetHideAnimations; + + protected RemoteWaitCursor() + { + } + + public static unsafe RemoteWaitCursor Create( + ProtocolSplashRendering _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE cursorClassHandle = _priv_protocolInstance.WaitCursor_ClassHandle; + RemoteWaitCursor remoteWaitCursor = new RemoteWaitCursor(port, _priv_owner); + uint num = (uint)sizeof(RemoteWaitCursor.Msg5_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteWaitCursor.Msg5_Create* msg5CreatePtr = (RemoteWaitCursor.Msg5_Create*)pMem; + msg5CreatePtr->_priv_size = num; + msg5CreatePtr->_priv_msgid = 5U; + msg5CreatePtr->_priv_idObjectSubject = remoteWaitCursor.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg5_Create, typeof(RemoteWaitCursor.Msg5_Create), 0, 0); + port.CreateRemoteObject(cursorClassHandle, remoteWaitCursor.m_renderHandle, (Message*)msg5CreatePtr); + return remoteWaitCursor; + } + + public unsafe void BuildShow(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWaitCursor.Msg0_Show); + RemoteWaitCursor.Msg0_Show* msg0ShowPtr = (RemoteWaitCursor.Msg0_Show*)_priv_portUse.AllocMessageBuffer(size); + msg0ShowPtr->_priv_size = size; + msg0ShowPtr->_priv_msgid = 0U; + msg0ShowPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg0ShowPtr, ref s_priv_ByteOrder_Msg0_Show, typeof(RemoteWaitCursor.Msg0_Show), 0, 0); + _priv_pmsgUse = (Message*)msg0ShowPtr; + } + + public unsafe void SendShow() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildShow(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildHide(out RenderPort _priv_portUse, out Message* _priv_pmsgUse) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWaitCursor.Msg1_Hide); + RemoteWaitCursor.Msg1_Hide* msg1HidePtr = (RemoteWaitCursor.Msg1_Hide*)_priv_portUse.AllocMessageBuffer(size); + msg1HidePtr->_priv_size = size; + msg1HidePtr->_priv_msgid = 1U; + msg1HidePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg1HidePtr, ref s_priv_ByteOrder_Msg1_Hide, typeof(RemoteWaitCursor.Msg1_Hide), 0, 0); + _priv_pmsgUse = (Message*)msg1HidePtr; + } + + public unsafe void SendHide() + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildHide(out _priv_portUse, out _priv_pmsgUse); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVisuals( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteVisual[] arVisuals) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteWaitCursor.Msg2_SetVisuals)); + RENDERHANDLE[] renderHandleArray = MarshalHelper.CreateRenderHandleArray(arVisuals.Length); + for (int index = 0; index < arVisuals.Length; ++index) + renderHandleArray[index] = arVisuals[index].RenderHandle; + BLOBREF blobref = blobInfo.Add(renderHandleArray); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteWaitCursor.Msg2_SetVisuals* msg2SetVisualsPtr = (RemoteWaitCursor.Msg2_SetVisuals*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + msg2SetVisualsPtr->_priv_size = adjustedTotalSize; + msg2SetVisualsPtr->_priv_msgid = 2U; + msg2SetVisualsPtr->arVisuals = blobref; + blobInfo.Attach((Message*)msg2SetVisualsPtr); + msg2SetVisualsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg2SetVisualsPtr, ref s_priv_ByteOrder_Msg2_SetVisuals, typeof(RemoteWaitCursor.Msg2_SetVisuals), 0, 0); + _priv_pmsgUse = (Message*)msg2SetVisualsPtr; + } + + public unsafe void SendSetVisuals(RemoteVisual[] arVisuals) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVisuals(out _priv_portUse, out _priv_pmsgUse, arVisuals); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetShowAnimations( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteAnimation[] arAnimations) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteWaitCursor.Msg3_SetShowAnimations)); + RENDERHANDLE[] renderHandleArray = MarshalHelper.CreateRenderHandleArray(arAnimations.Length); + for (int index = 0; index < arAnimations.Length; ++index) + renderHandleArray[index] = arAnimations[index].RenderHandle; + BLOBREF blobref = blobInfo.Add(renderHandleArray); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteWaitCursor.Msg3_SetShowAnimations* setShowAnimationsPtr = (RemoteWaitCursor.Msg3_SetShowAnimations*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + setShowAnimationsPtr->_priv_size = adjustedTotalSize; + setShowAnimationsPtr->_priv_msgid = 3U; + setShowAnimationsPtr->arAnimations = blobref; + blobInfo.Attach((Message*)setShowAnimationsPtr); + setShowAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setShowAnimationsPtr, ref s_priv_ByteOrder_Msg3_SetShowAnimations, typeof(RemoteWaitCursor.Msg3_SetShowAnimations), 0, 0); + _priv_pmsgUse = (Message*)setShowAnimationsPtr; + } + + public unsafe void SendSetShowAnimations(RemoteAnimation[] arAnimations) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetShowAnimations(out _priv_portUse, out _priv_pmsgUse, arAnimations); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetHideAnimations( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteAnimation[] arAnimations) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteWaitCursor.Msg4_SetHideAnimations)); + RENDERHANDLE[] renderHandleArray = MarshalHelper.CreateRenderHandleArray(arAnimations.Length); + for (int index = 0; index < arAnimations.Length; ++index) + renderHandleArray[index] = arAnimations[index].RenderHandle; + BLOBREF blobref = blobInfo.Add(renderHandleArray); + uint adjustedTotalSize = blobInfo.AdjustedTotalSize; + RemoteWaitCursor.Msg4_SetHideAnimations* setHideAnimationsPtr = (RemoteWaitCursor.Msg4_SetHideAnimations*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize); + setHideAnimationsPtr->_priv_size = adjustedTotalSize; + setHideAnimationsPtr->_priv_msgid = 4U; + setHideAnimationsPtr->arAnimations = blobref; + blobInfo.Attach((Message*)setHideAnimationsPtr); + setHideAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setHideAnimationsPtr, ref s_priv_ByteOrder_Msg4_SetHideAnimations, typeof(RemoteWaitCursor.Msg4_SetHideAnimations), 0, 0); + _priv_pmsgUse = (Message*)setHideAnimationsPtr; + } + + public unsafe void SendSetHideAnimations(RemoteAnimation[] arAnimations) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetHideAnimations(out _priv_portUse, out _priv_pmsgUse, arAnimations); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteWaitCursor CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteWaitCursor(port, handle, true); + } + + public static RemoteWaitCursor CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteWaitCursor(port, handle, false); + } + + protected RemoteWaitCursor(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteWaitCursor(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteWaitCursor && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg5_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg0_Show + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg1_Hide + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg2_SetVisuals + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF arVisuals; + } + + [ComVisible(false)] + private struct Msg3_SetShowAnimations + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF arAnimations; + } + + [ComVisible(false)] + private struct Msg4_SetHideAnimations + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public BLOBREF arAnimations; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs new file mode 100644 index 0000000..6ab3f41 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs @@ -0,0 +1,235 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteWindow +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering +{ + internal class RemoteWindow : RemoteObject + { + private static ushort[] s_priv_ByteOrder_Msg0_SetBackgroundColor; + private static ushort[] s_priv_ByteOrder_Msg1_SetOutlineMarkedColor; + private static ushort[] s_priv_ByteOrder_Msg2_SetOutlineAllColor; + private static ushort[] s_priv_ByteOrder_Msg3_ChangeDataBits; + private static ushort[] s_priv_ByteOrder_Msg5_SetRoot; + + protected RemoteWindow() + { + } + + public unsafe void BuildSetBackgroundColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clrBack) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWindow.Msg0_SetBackgroundColor); + RemoteWindow.Msg0_SetBackgroundColor* setBackgroundColorPtr = (RemoteWindow.Msg0_SetBackgroundColor*)_priv_portUse.AllocMessageBuffer(size); + setBackgroundColorPtr->_priv_size = size; + setBackgroundColorPtr->_priv_msgid = 0U; + setBackgroundColorPtr->clrBack = clrBack; + setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg0_SetBackgroundColor, typeof(RemoteWindow.Msg0_SetBackgroundColor), 0, 0); + _priv_pmsgUse = (Message*)setBackgroundColorPtr; + } + + public unsafe void SendSetBackgroundColor(ColorF clrBack) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetBackgroundColor(out _priv_portUse, out _priv_pmsgUse, clrBack); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetOutlineMarkedColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clr) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWindow.Msg1_SetOutlineMarkedColor); + RemoteWindow.Msg1_SetOutlineMarkedColor* outlineMarkedColorPtr = (RemoteWindow.Msg1_SetOutlineMarkedColor*)_priv_portUse.AllocMessageBuffer(size); + outlineMarkedColorPtr->_priv_size = size; + outlineMarkedColorPtr->_priv_msgid = 1U; + outlineMarkedColorPtr->clr = clr; + outlineMarkedColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)outlineMarkedColorPtr, ref s_priv_ByteOrder_Msg1_SetOutlineMarkedColor, typeof(RemoteWindow.Msg1_SetOutlineMarkedColor), 0, 0); + _priv_pmsgUse = (Message*)outlineMarkedColorPtr; + } + + public unsafe void SendSetOutlineMarkedColor(ColorF clr) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetOutlineMarkedColor(out _priv_portUse, out _priv_pmsgUse, clr); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetOutlineAllColor( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + ColorF clr) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWindow.Msg2_SetOutlineAllColor); + RemoteWindow.Msg2_SetOutlineAllColor* setOutlineAllColorPtr = (RemoteWindow.Msg2_SetOutlineAllColor*)_priv_portUse.AllocMessageBuffer(size); + setOutlineAllColorPtr->_priv_size = size; + setOutlineAllColorPtr->_priv_msgid = 2U; + setOutlineAllColorPtr->clr = clr; + setOutlineAllColorPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)setOutlineAllColorPtr, ref s_priv_ByteOrder_Msg2_SetOutlineAllColor, typeof(RemoteWindow.Msg2_SetOutlineAllColor), 0, 0); + _priv_pmsgUse = (Message*)setOutlineAllColorPtr; + } + + public unsafe void SendSetOutlineAllColor(ColorF clr) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetOutlineAllColor(out _priv_portUse, out _priv_pmsgUse, clr); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildChangeDataBits( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + uint nValue, + uint nMask) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteWindow.Msg3_ChangeDataBits); + RemoteWindow.Msg3_ChangeDataBits* msg3ChangeDataBitsPtr = (RemoteWindow.Msg3_ChangeDataBits*)_priv_portUse.AllocMessageBuffer(size); + msg3ChangeDataBitsPtr->_priv_size = size; + msg3ChangeDataBitsPtr->_priv_msgid = 3U; + msg3ChangeDataBitsPtr->nValue = nValue; + msg3ChangeDataBitsPtr->nMask = nMask; + msg3ChangeDataBitsPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg3ChangeDataBitsPtr, ref s_priv_ByteOrder_Msg3_ChangeDataBits, typeof(RemoteWindow.Msg3_ChangeDataBits), 0, 0); + _priv_pmsgUse = (Message*)msg3ChangeDataBitsPtr; + } + + public unsafe void SendChangeDataBits(uint nValue, uint nMask) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildChangeDataBits(out _priv_portUse, out _priv_pmsgUse, nValue, nMask); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetRoot( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + RemoteVisual visRoot) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + if (visRoot != null) + _priv_portUse.ValidateHandleOrNull(visRoot.RenderHandle); + uint size = (uint)sizeof(RemoteWindow.Msg5_SetRoot); + RemoteWindow.Msg5_SetRoot* msg5SetRootPtr = (RemoteWindow.Msg5_SetRoot*)_priv_portUse.AllocMessageBuffer(size); + msg5SetRootPtr->_priv_size = size; + msg5SetRootPtr->_priv_msgid = 5U; + msg5SetRootPtr->visRoot = visRoot != null ? visRoot.RenderHandle : RENDERHANDLE.NULL; + msg5SetRootPtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5SetRootPtr, ref s_priv_ByteOrder_Msg5_SetRoot, typeof(RemoteWindow.Msg5_SetRoot), 0, 0); + _priv_pmsgUse = (Message*)msg5SetRootPtr; + } + + public unsafe void SendSetRoot(RemoteVisual visRoot) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetRoot(out _priv_portUse, out _priv_pmsgUse, visRoot); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteWindow CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteWindow(port, handle, true); + + public static RemoteWindow CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteWindow(port, handle, false); + } + + protected RemoteWindow(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteWindow(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteWindow && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg0_SetBackgroundColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clrBack; + } + + [ComVisible(false)] + private struct Msg1_SetOutlineMarkedColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clr; + } + + [ComVisible(false)] + private struct Msg2_SetOutlineAllColor + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public ColorF clr; + } + + [ComVisible(false)] + private struct Msg3_ChangeDataBits + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint nValue; + public uint nMask; + } + + [ComVisible(false)] + private struct Msg5_SetRoot + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE visRoot; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs new file mode 100644 index 0000000..7178273 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon.ProtocolSplashRenderingXenon +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon +{ + internal sealed class ProtocolSplashRenderingXenon : ProtocolInstance + { + private RENDERHANDLE _priv_remoteClass_XeDevice; + private RENDERHANDLE _priv_remoteClass_XAudSoundDevice; + + public static ProtocolSplashRenderingXenon Bind(RenderPort port) + { + Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port)); + ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Rendering::Xenon"); + if (protocolInstance != null) + { + ProtocolSplashRenderingXenon splashRenderingXenon = protocolInstance as ProtocolSplashRenderingXenon; + Debug2.Validate(splashRenderingXenon != null, typeof(InvalidOperationException), "protocol name collision"); + return splashRenderingXenon; + } + ProtocolSplashRenderingXenon splashRenderingXenon1 = new ProtocolSplashRenderingXenon(port); + port.BindProtocol(splashRenderingXenon1); + return splashRenderingXenon1; + } + + private ProtocolSplashRenderingXenon(RenderPort port) + : base(port, "Splash::Rendering::Xenon") + { + } + + protected override void Init() + { + RenderPort port = this.Port; + this._priv_remoteClass_XeDevice = port.InitRemoteClass("Splash::Rendering::Xenon::XeDevice"); + this._priv_remoteClass_XAudSoundDevice = port.InitRemoteClass("Splash::Rendering::Xenon::XAudSoundDevice"); + } + + internal RENDERHANDLE XeDevice_ClassHandle => this._priv_remoteClass_XeDevice; + + internal RENDERHANDLE XAudSoundDevice_ClassHandle => this._priv_remoteClass_XAudSoundDevice; + + internal RemoteXeDevice BuildRemoteXeDevice( + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb, + Size sizeScreenPxl) + { + return RemoteXeDevice.Create(this, _priv_owner, cb, sizeScreenPxl); + } + + internal RemoteXAudSoundDevice BuildRemoteXAudSoundDevice( + IRenderHandleOwner _priv_owner) + { + return RemoteXAudSoundDevice.Create(this, _priv_owner); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs new file mode 100644 index 0000000..fc6e19e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs @@ -0,0 +1,153 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon.RemoteXAudSoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon +{ + internal class RemoteXAudSoundDevice : RemoteSoundDevice + { + private static ushort[] s_priv_ByteOrder_Msg6_Create; + private static ushort[] s_priv_ByteOrder_Msg4_SetMute; + private static ushort[] s_priv_ByteOrder_Msg5_SetVolume; + + protected RemoteXAudSoundDevice() + { + } + + public static unsafe RemoteXAudSoundDevice Create( + ProtocolSplashRenderingXenon _priv_protocolInstance, + IRenderHandleOwner _priv_owner) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.XAudSoundDevice_ClassHandle; + RemoteXAudSoundDevice remoteXaudSoundDevice = new RemoteXAudSoundDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteXAudSoundDevice.Msg6_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteXAudSoundDevice.Msg6_Create* msg6CreatePtr = (RemoteXAudSoundDevice.Msg6_Create*)pMem; + msg6CreatePtr->_priv_size = num; + msg6CreatePtr->_priv_msgid = 6U; + msg6CreatePtr->_priv_idObjectSubject = remoteXaudSoundDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg6_Create, typeof(RemoteXAudSoundDevice.Msg6_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteXaudSoundDevice.m_renderHandle, (Message*)msg6CreatePtr); + return remoteXaudSoundDevice; + } + + public unsafe void BuildSetMute( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + bool fMuted) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteXAudSoundDevice.Msg4_SetMute); + RemoteXAudSoundDevice.Msg4_SetMute* msg4SetMutePtr = (RemoteXAudSoundDevice.Msg4_SetMute*)_priv_portUse.AllocMessageBuffer(size); + msg4SetMutePtr->_priv_size = size; + msg4SetMutePtr->_priv_msgid = 4U; + msg4SetMutePtr->fMuted = fMuted ? uint.MaxValue : 0U; + msg4SetMutePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg4SetMutePtr, ref s_priv_ByteOrder_Msg4_SetMute, typeof(RemoteXAudSoundDevice.Msg4_SetMute), 0, 0); + _priv_pmsgUse = (Message*)msg4SetMutePtr; + } + + public unsafe void SendSetMute(bool fMuted) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetMute(out _priv_portUse, out _priv_pmsgUse, fMuted); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public unsafe void BuildSetVolume( + out RenderPort _priv_portUse, + out Message* _priv_pmsgUse, + float flVolume) + { + Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); + _priv_portUse = this.m_renderPort; + _priv_portUse.ValidateHandle(this.m_renderHandle); + uint size = (uint)sizeof(RemoteXAudSoundDevice.Msg5_SetVolume); + RemoteXAudSoundDevice.Msg5_SetVolume* msg5SetVolumePtr = (RemoteXAudSoundDevice.Msg5_SetVolume*)_priv_portUse.AllocMessageBuffer(size); + msg5SetVolumePtr->_priv_size = size; + msg5SetVolumePtr->_priv_msgid = 5U; + msg5SetVolumePtr->flVolume = flVolume; + msg5SetVolumePtr->_priv_idObjectSubject = this.m_renderHandle; + if (_priv_portUse.ForeignByteOrder) + MarshalHelper.SwapByteOrder((byte*)msg5SetVolumePtr, ref s_priv_ByteOrder_Msg5_SetVolume, typeof(RemoteXAudSoundDevice.Msg5_SetVolume), 0, 0); + _priv_pmsgUse = (Message*)msg5SetVolumePtr; + } + + public unsafe void SendSetVolume(float flVolume) + { + RenderPort _priv_portUse; + Message* _priv_pmsgUse; + this.BuildSetVolume(out _priv_portUse, out _priv_pmsgUse, flVolume); + _priv_portUse.SendRemoteMessage(_priv_pmsgUse); + } + + public static RemoteXAudSoundDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteXAudSoundDevice(port, handle, true); + } + + public static RemoteXAudSoundDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteXAudSoundDevice(port, handle, false); + } + + protected RemoteXAudSoundDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteXAudSoundDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteXAudSoundDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg6_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + } + + [ComVisible(false)] + private struct Msg4_SetMute + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public uint fMuted; + } + + [ComVisible(false)] + private struct Msg5_SetVolume + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public float flVolume; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs new file mode 100644 index 0000000..9a8667b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs @@ -0,0 +1,86 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon.RemoteXeDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Protocol; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon +{ + internal class RemoteXeDevice : RemoteDx9Device + { + private static ushort[] s_priv_ByteOrder_Msg11_Create; + + protected RemoteXeDevice() + { + } + + public static unsafe RemoteXeDevice Create( + ProtocolSplashRenderingXenon _priv_protocolInstance, + IRenderHandleOwner _priv_owner, + LocalDeviceCallback cb, + Size sizeScreenPxl) + { + RenderPort port = _priv_protocolInstance.Port; + RENDERHANDLE deviceClassHandle = _priv_protocolInstance.XeDevice_ClassHandle; + RemoteXeDevice remoteXeDevice = new RemoteXeDevice(port, _priv_owner); + uint num = (uint)sizeof(RemoteXeDevice.Msg11_Create); + // ISSUE: untyped stack allocation + byte* pMem = stackalloc byte[(int)num]; + RemoteXeDevice.Msg11_Create* msg11CreatePtr = (RemoteXeDevice.Msg11_Create*)pMem; + msg11CreatePtr->_priv_size = num; + msg11CreatePtr->_priv_msgid = 11U; + msg11CreatePtr->_priv_objcb = cb.RenderHandle; + msg11CreatePtr->_priv_ctxcb = port.Session.LocalContext; + msg11CreatePtr->sizeScreenPxl = sizeScreenPxl; + msg11CreatePtr->_priv_idObjectSubject = remoteXeDevice.m_renderHandle; + if (port.ForeignByteOrder) + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg11_Create, typeof(RemoteXeDevice.Msg11_Create), 0, 0); + port.CreateRemoteObject(deviceClassHandle, remoteXeDevice.m_renderHandle, (Message*)msg11CreatePtr); + return remoteXeDevice; + } + + public static RemoteXeDevice CreateFromHandle( + RenderPort port, + RENDERHANDLE handle) + { + return new RemoteXeDevice(port, handle, true); + } + + public static RemoteXeDevice CreateFromExternalHandle( + RenderPort port, + RENDERHANDLE handle, + IRenderHandleOwner owner) + { + port.RegisterKnownHandle(owner, handle); + return new RemoteXeDevice(port, handle, false); + } + + protected RemoteXeDevice(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose) + : base(port, handle, fFreeOnDispose) + { + } + + protected RemoteXeDevice(RenderPort port, IRenderHandleOwner owner) + : base(port, owner) + { + } + + public override bool Equals(object other) => other is RemoteXeDevice && this.m_renderHandle == ((RemoteObject)other).m_renderHandle; + + public override int GetHashCode() => base.GetHashCode(); + + [ComVisible(false)] + private struct Msg11_Create + { + public uint _priv_size; + public uint _priv_msgid; + public RENDERHANDLE _priv_idObjectSubject; + public RENDERHANDLE _priv_objcb; + public ContextID _priv_ctxcb; + public Size sizeScreenPxl; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Quaternion.cs b/UIX.RenderApi/Microsoft/Iris/Render/Quaternion.cs new file mode 100644 index 0000000..c045b91 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Quaternion.cs @@ -0,0 +1,131 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Quaternion +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render +{ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct Quaternion + { + private float m_x; + private float m_y; + private float m_z; + private float m_w; + public static readonly Quaternion Identity = new Quaternion(0.0f, 0.0f, 0.0f, 1f); + + public Quaternion(float x, float y, float z, float w) + { + this.m_x = x; + this.m_y = y; + this.m_z = z; + this.m_w = w; + } + + public Quaternion(Vector3 vAxis, float flAngle) + { + vAxis.Normalize(); + float num1 = (float)Math.Sin(0.5 * flAngle); + float num2 = (float)Math.Cos(0.5 * flAngle); + this.m_x = vAxis.X * num1; + this.m_y = vAxis.Y * num1; + this.m_z = vAxis.Z * num1; + this.m_w = num2; + } + + public Quaternion(AxisAngle axisAngle) + : this(axisAngle.Axis, axisAngle.Angle) + { + } + + public float X + { + get => this.m_x; + set => this.m_x = value; + } + + public float Y + { + get => this.m_y; + set => this.m_y = value; + } + + public float Z + { + get => this.m_z; + set => this.m_z = value; + } + + public float W + { + get => this.m_w; + set => this.m_w = value; + } + + public bool IsIdentity => Equals(this, Identity); + + public static Quaternion operator *(Quaternion q1, Quaternion q2) => new Quaternion() + { + m_x = (float)(q2.m_w * (double)q1.m_x + q2.m_x * (double)q1.m_w + q2.m_y * (double)q1.m_z - q2.m_z * (double)q1.m_y), + m_y = (float)(q2.m_w * (double)q1.m_y - q2.m_x * (double)q1.m_z + q2.m_y * (double)q1.m_w + q2.m_z * (double)q1.m_x), + m_z = (float)(q2.m_w * (double)q1.m_z + q2.m_x * (double)q1.m_y - q2.m_y * (double)q1.m_x + q2.m_z * (double)q1.m_w), + m_w = (float)(q2.m_w * (double)q1.m_w - q2.m_x * (double)q1.m_x - q2.m_y * (double)q1.m_y - q2.m_z * (double)q1.m_z) + }; + + public static Quaternion Multiply(Quaternion qLeft, Quaternion qRight) => qLeft * qRight; + + public override bool Equals(object obj) => obj is Quaternion quaternion && this == quaternion; + + public static bool operator ==(Quaternion left, Quaternion right) => Math2.WithinEpsilon(left.X, right.X) && Math2.WithinEpsilon(left.Y, right.Y) && Math2.WithinEpsilon(left.Z, right.Z) && Math2.WithinEpsilon(left.W, right.W); + + public static bool operator !=(Quaternion left, Quaternion right) => !(left == right); + + public AxisAngle ToAxisAngle() + { + this.Normalize(); + Vector3 vAxis; + float flAngle; + this.ToAxisAngle(out vAxis, out flAngle); + return vAxis.IsApproximate(Vector3.Zero) ? AxisAngle.Identity : new AxisAngle(vAxis, flAngle); + } + + internal void Normalize() + { + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z + m_w * (double)this.m_w); + if (Math2.WithinEpsilon(flValue1, 1f)) + return; + if (flValue1 > 1.40129846432482E-45) + { + float num = (float)Math.Sqrt(flValue1); + this.m_x /= num; + this.m_y /= num; + this.m_z /= num; + this.m_w /= num; + } + else + { + this.m_x = 0.0f; + this.m_y = 0.0f; + this.m_z = 0.0f; + this.m_w = 0.0f; + } + } + + public override int GetHashCode() => this.X.GetHashCode() ^ this.Y.GetHashCode() ^ this.Z.GetHashCode() ^ this.W.GetHashCode(); + + public override string ToString() => base.ToString(); + + public void ToAxisAngle(out Vector3 vAxis, out float flAngle) + { + vAxis = new Vector3(this.m_x, this.m_y, this.m_z); + flAngle = (float)(2.0 * Math.Acos(m_w)); + } + + public bool IsApproximate(Quaternion q) => Math2.WithinEpsilon(this.m_x, q.m_x) && Math2.WithinEpsilon(this.m_y, q.m_y) && Math2.WithinEpsilon(this.m_z, q.m_z) && Math2.WithinEpsilon(this.m_w, q.m_w); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Rectangle.cs b/UIX.RenderApi/Microsoft/Iris/Render/Rectangle.cs new file mode 100644 index 0000000..178114b --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Rectangle.cs @@ -0,0 +1,204 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Rectangle +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct Rectangle + { + private int m_x; + private int m_y; + private int m_width; + private int m_height; + public static readonly Rectangle Zero = new Rectangle(0, 0, 0, 0); + + public Rectangle(int x, int y, int width, int height) + { + this.m_x = x; + this.m_y = y; + this.m_width = width; + this.m_height = height; + } + + public Rectangle(float x, float y, float width, float height) + { + this.m_x = (int)Math.Round(x); + this.m_y = (int)Math.Round(y); + this.m_width = (int)Math.Round(width); + this.m_height = (int)Math.Round(height); + } + + public Rectangle(Size extent) + : this(Point.Zero, extent) + { + } + + public Rectangle(Point offset, Size extent) + { + this.m_x = offset.X; + this.m_y = offset.Y; + this.m_width = extent.Width; + this.m_height = extent.Height; + } + + public int X + { + get => this.m_x; + set => this.m_x = value; + } + + public int Y + { + get => this.m_y; + set => this.m_y = value; + } + + public int Width + { + get => this.m_width; + set => this.m_width = value; + } + + public int Height + { + get => this.m_height; + set => this.m_height = value; + } + + public bool Contains(Point point) => this.Contains(point.X, point.Y); + + public static Rectangle Inflate(Rectangle rectangle, int x, int y) + { + Rectangle rectangle1 = rectangle; + rectangle1.Inflate(x, y); + return rectangle1; + } + + public static Rectangle Intersect(Rectangle left, Rectangle right) + { + int x = Math.Max(left.X, right.X); + int num1 = Math.Min(left.X + left.Width, right.X + right.Width); + int y = Math.Max(left.Y, right.Y); + int num2 = Math.Min(left.Y + left.Height, right.Y + right.Height); + return num1 >= x && num2 >= y ? new Rectangle(x, y, num1 - x, num2 - y) : Zero; + } + + public static Rectangle Union(Rectangle left, Rectangle right) + { + int x = Math.Min(left.X, right.X); + int num1 = Math.Max(left.X + left.Width, right.X + right.Width); + int y = Math.Min(left.Y, right.Y); + int num2 = Math.Max(left.Y + left.Height, right.Y + right.Height); + return new Rectangle(x, y, num1 - x, num2 - y); + } + + public override bool Equals(object obj) => obj is Rectangle rectangle && rectangle.X == this.X && (rectangle.Y == this.Y && rectangle.Width == this.Width) && rectangle.Height == this.Height; + + public static bool operator ==(Rectangle left, Rectangle right) => left.X == right.X && left.Y == right.Y && left.Width == right.Width && left.Height == right.Height; + + public static bool operator !=(Rectangle left, Rectangle right) => !(left == right); + + public override int GetHashCode() => this.X ^ (this.Y << 13 | (int)((uint)this.Y >> 19)) ^ (this.Width << 26 | (int)((uint)this.Width >> 6)) ^ (this.Height << 7 | (int)((uint)this.Height >> 25)); + + public override string ToString() => base.ToString(); + + public static Rectangle FromLTRB(int left, int top, int right, int bottom) => new Rectangle(left, top, right - left, bottom - top); + + public Point Location + { + get => new Point(this.X, this.Y); + set + { + this.X = value.X; + this.Y = value.Y; + } + } + + public Size Size + { + get => new Size(this.Width, this.Height); + set + { + this.Width = value.Width; + this.Height = value.Height; + } + } + + public int Left => this.X; + + public int Top => this.Y; + + public int Right => this.X + this.Width; + + public int Bottom => this.Y + this.Height; + + public bool IsEmpty => this.Height == 0 && this.Width == 0 && this.X == 0 && this.Y == 0; + + public int Area => this.Width * this.Height; + + public bool Contains(int x, int y) => this.X <= x && x < this.X + this.Width && this.Y <= y && y < this.Y + this.Height; + + public bool Contains(Rectangle rect) => this.X <= rect.X && rect.X + rect.Width <= this.X + this.Width && this.Y <= rect.Y && rect.Y + rect.Height <= this.Y + this.Height; + + public void Inflate(int width, int height) + { + this.X -= width; + this.Y -= height; + this.Width += 2 * width; + this.Height += 2 * height; + } + + public void Inflate(Size size) => this.Inflate(size.Width, size.Height); + + public static Rectangle Inflate(Rectangle source, Rectangle offset) => FromLTRB(source.Left - offset.Left, source.Top - offset.Top, source.Right + offset.Right, source.Bottom + offset.Bottom); + + public void Intersect(Rectangle rect) + { + Rectangle rectangle = Intersect(rect, this); + this.X = rectangle.X; + this.Y = rectangle.Y; + this.Width = rectangle.Width; + this.Height = rectangle.Height; + } + + public bool IntersectsWith(Rectangle rect) => this.Left < rect.Right && this.Top < rect.Bottom && this.Right > rect.Left && this.Bottom > rect.Top; + + public void Union(Rectangle rect) + { + Rectangle rectangle = Union(rect, this); + this.X = rectangle.X; + this.Y = rectangle.Y; + this.Width = rectangle.Width; + this.Height = rectangle.Height; + } + + public static Rectangle Offset(Rectangle rect, Point pos) + { + rect.Offset(pos); + return rect; + } + + public void Offset(Point pos) => this.Offset(pos.X, pos.Y); + + public static Rectangle Offset(Rectangle rect, int x, int y) + { + rect.Offset(x, y); + return rect; + } + + public void Offset(int x, int y) + { + this.X += x; + this.Y += y; + } + + public Point Center => new Point(this.X + this.Width / 2, this.Y + this.Height / 2); + + public bool IsZero => this.Height == 0 && this.Width == 0 && this.X == 0 && this.Y == 0; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/RelativeSpace.cs b/UIX.RenderApi/Microsoft/Iris/Render/RelativeSpace.cs new file mode 100644 index 0000000..7b14798 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/RelativeSpace.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.RelativeSpace +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum RelativeSpace + { + Min = 0, + Max = 1, + Global = 4, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Remote/ImageHeader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Remote/ImageHeader.cs new file mode 100644 index 0000000..666ae98 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Remote/ImageHeader.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Remote.ImageHeader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Remote +{ + [ComVisible(false)] + public struct ImageHeader + { + public Size sizeActualPxl; + public Size sizeOriginalPxl; + public int nStride; + public SurfaceFormat nFormat; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Remote/SoundHeader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Remote/SoundHeader.cs new file mode 100644 index 0000000..aa64017 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Remote/SoundHeader.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Remote.SoundHeader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Remote +{ + [ComVisible(false)] + public struct SoundHeader + { + public ushort wFormatTag; + public ushort nChannels; + public uint nSamplesPerSec; + public uint nAvgBytesPerSec; + public ushort nBlockAlign; + public ushort wBitsPerSample; + public ushort cbExtraData; + public uint cbDataSize; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/RenderApi.cs b/UIX.RenderApi/Microsoft/Iris/Render/RenderApi.cs new file mode 100644 index 0000000..1435f26 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/RenderApi.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.RenderApi +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render +{ + public static class RenderApi + { + public static IDebug DebugModule + { + get => Debug2.Module; + set => Debug2.Module = value; + } + + public static IRenderEngine CreateEngine( + EngineInfo engineInfo, + IRenderHost renderHost) + { + Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo)); + Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); + IRenderEngine renderEngine = null; + if (engineInfo.Type == EngineType.Iris) + renderEngine = new RenderEngine(engineInfo as IrisEngineInfo, renderHost); + return renderEngine; + } + + public static IRenderSession CreateSession( + RenderToken sessionToken, + IRenderHost renderHost) + { + Debug2.Validate(sessionToken != null, typeof(ArgumentNullException), nameof(sessionToken)); + Debug2.Validate(sessionToken.EngineInfo != null, typeof(ArgumentNullException), "sessionToken.EngineInfo"); + Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); + IRenderSession renderSession = null; + if (sessionToken.EngineInfo.Type == EngineType.Iris) + renderSession = new RenderSession(null); + return renderSession; + } + + public static void InitializeForToolOnly() + { + EngineApi.InitArgs args = new EngineApi.InitArgs(MessageCookieLayout.Default, RenderEngine.AllocateContextId()); + EngineApi.IFC(EngineApi.SpInit(ref args)); + } + + public static void ShutdownForToolOnly() => EngineApi.IFC(EngineApi.SpUninit()); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/RenderToken.cs b/UIX.RenderApi/Microsoft/Iris/Render/RenderToken.cs new file mode 100644 index 0000000..bd67e2f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/RenderToken.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.RenderToken +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using System; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public class RenderToken + { + private EngineInfo m_engineInfo; + private ContextID m_localContextId; + private ContextID m_destinationContextId; + private RENDERGROUP m_renderGroupId; + + internal RenderToken( + EngineInfo engineInfo, + ContextID localContextId, + ContextID destinationContextId, + RENDERGROUP renderGroupId) + { + Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo)); + Debug2.Validate(localContextId != ContextID.NULL, typeof(ArgumentNullException), nameof(localContextId)); + Debug2.Validate(destinationContextId != ContextID.NULL, typeof(ArgumentNullException), nameof(destinationContextId)); + this.m_engineInfo = engineInfo; + this.m_localContextId = localContextId; + this.m_destinationContextId = destinationContextId; + this.m_renderGroupId = renderGroupId; + } + + internal EngineInfo EngineInfo => this.m_engineInfo; + + internal ContextID LocalContextId => this.m_localContextId; + + internal ContextID DestinationContextId => this.m_destinationContextId; + + internal RENDERGROUP RenderGroupId => this.m_renderGroupId; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SCurveInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/SCurveInterpolation.cs new file mode 100644 index 0000000..b4c9b5f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SCurveInterpolation.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SCurveInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; + +namespace Microsoft.Iris.Render +{ + public sealed class SCurveInterpolation : AnimationInterpolation + { + private float m_weight; + + public SCurveInterpolation(float weight) + { + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "weight must be > 0"); + this.m_weight = weight; + } + + internal float Weight => this.m_weight; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SepiaElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/SepiaElement.cs new file mode 100644 index 0000000..7811d7f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SepiaElement.cs @@ -0,0 +1,111 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SepiaElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class SepiaElement : EffectOperation + { + internal const string LightColorPropertyName = "LightColor"; + internal const string DarkColorPropertyName = "DarkColor"; + internal const string DesaturatePropertyName = "Desaturate"; + internal const string TonePropertyName = "Tone"; + private ColorF m_lightColor; + private byte m_nLightColorID; + private ColorF m_darkColor; + private byte m_nDarkColorID; + private float m_flDesaturate; + private byte m_nDesaturateID; + private float m_flTone; + private byte m_nToneID; + + public SepiaElement( + string stName, + ColorF darkColor, + ColorF lightColor, + float flDesat, + float flTone) + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flDesat >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Desat is >= 0"); + Debug2.Validate(flTone >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Tone is >= 0"); + this.m_typeOperation = EffectOperationType.Sepia; + this.m_lightColor = lightColor; + this.m_darkColor = darkColor; + this.m_flDesaturate = flDesat; + this.m_flTone = flTone; + this.m_stName = stName; + } + + public SepiaElement(string stName) + { + this.m_typeOperation = EffectOperationType.Sepia; + this.m_lightColor = new ColorF(1f, 0.9f, 0.5f); + this.m_darkColor = new ColorF(0.2f, 0.05f, 0.0f); + this.m_flDesaturate = 0.5f; + this.m_flTone = 1f; + this.m_stName = stName; + } + + public SepiaElement() + : this(null) + { + } + + public ColorF LightColor + { + get => this.m_lightColor; + set => this.m_lightColor = value; + } + + internal byte LightColorID => this.m_nLightColorID; + + public ColorF DarkColor + { + get => this.m_darkColor; + set => this.m_darkColor = value; + } + + internal byte DarkColorID => this.m_nDarkColorID; + + public float Desaturate + { + get => this.m_flDesaturate; + set => this.m_flDesaturate = value; + } + + internal byte DesaturateID => this.m_nDesaturateID; + + public float Tone + { + get => this.m_flTone; + set => this.m_flTone = value; + } + + internal byte ToneID => this.m_nToneID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DarkColor", 20, ref this.m_nDarkColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", 8, ref this.m_nDesaturateID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Tone", 8, ref this.m_nToneID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("LightColor", EffectPropertyType.Color, m_lightColor, this.m_nLightColorID, dictProperties) && this.GenerateProperty("DarkColor", EffectPropertyType.Color, m_darkColor, this.m_nDarkColorID, dictProperties) && this.GenerateProperty("Desaturate", EffectPropertyType.Float, m_flDesaturate, this.m_nDesaturateID, dictProperties) && this.GenerateProperty("Tone", EffectPropertyType.Float, m_flTone, this.m_nToneID, dictProperties); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("LightColor", this.LightColorID, this.LightColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("DarkColor", this.DarkColorID, this.DarkColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("Desaturate", this.DesaturateID, this.Desaturate, cacheKey); + this.GeneratePropertyCacheKey("Tone", this.ToneID, this.Tone, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SessionActivateHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/SessionActivateHandler.cs new file mode 100644 index 0000000..ac290cb --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SessionActivateHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SessionActivateHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void SessionActivateHandler(bool fActive); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SessionConnectHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/SessionConnectHandler.cs new file mode 100644 index 0000000..9e0c6fc --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SessionConnectHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SessionConnectHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void SessionConnectHandler(bool fIsConnected); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SetFocusHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/SetFocusHandler.cs new file mode 100644 index 0000000..81fc12e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SetFocusHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SetFocusHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void SetFocusHandler(bool focused); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ShadowEdgePart.cs b/UIX.RenderApi/Microsoft/Iris/Render/ShadowEdgePart.cs new file mode 100644 index 0000000..85e92dd --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ShadowEdgePart.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ShadowEdgePart +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public struct ShadowEdgePart + { + public string ModuleName; + public string ResourceName; + public Inset SplitPoints; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ShowHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/ShowHandler.cs new file mode 100644 index 0000000..9962a78 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ShowHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ShowHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void ShowHandler(bool fShow, bool fFirstShow); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SineInterpolation.cs b/UIX.RenderApi/Microsoft/Iris/Render/SineInterpolation.cs new file mode 100644 index 0000000..31230a6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SineInterpolation.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SineInterpolation +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public sealed class SineInterpolation : AnimationInterpolation + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Size.cs b/UIX.RenderApi/Microsoft/Iris/Render/Size.cs new file mode 100644 index 0000000..9b9d184 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Size.cs @@ -0,0 +1,110 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Size +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public struct Size + { + private int m_width; + private int m_height; + public static readonly Size Zero = new Size(0, 0); + public static readonly object ZeroBox = Zero; + + public Size(int width, int height) + { + this.m_width = width; + this.m_height = height; + } + + public Size(Point point) + { + this.m_width = point.X; + this.m_height = point.Y; + } + + public int Width + { + get => this.m_width; + set => this.m_width = value; + } + + public int Height + { + get => this.m_height; + set => this.m_height = value; + } + + public int GetDimension(Orientation orientation) => orientation != Orientation.Horizontal ? this.Height : this.Width; + + public void SetDimension(Orientation orientation, int value) + { + if (orientation == Orientation.Horizontal) + this.Width = value; + else + this.Height = value; + } + + public static Size operator +(Size left, Size right) => new Size(left.Width + right.Width, left.Height + right.Height); + + public static Size Add(Size left, Size right) => left + right; + + public static Size operator -(Size left, Size right) => new Size(left.Width - right.Width, left.Height - right.Height); + + public static Size Subtract(Size left, Size right) => left - right; + + public void Deflate(Size amount) + { + this.Width = Math.Max(0, this.Width - amount.Width); + this.Height = Math.Max(0, this.Height - amount.Height); + } + + public static bool operator ==(Size left, Size right) => left.Width == right.Width && left.Height == right.Height; + + public static bool operator !=(Size left, Size right) => !(left == right); + + public override bool Equals(object obj) => obj is Size size && size.Width == this.Width && size.Height == this.Height; + + public bool Equals(Size comp) => comp.Width == this.Width && comp.Height == this.Height; + + public override int GetHashCode() => this.Width ^ this.Height; + + public override string ToString() => base.ToString(); + + public Point ToPoint() => new Point(this.Width, this.Height); + + public static Size Min(Size sz1, Size sz2) => new Size(Math.Min(sz1.Width, sz2.Width), Math.Min(sz1.Height, sz2.Height)); + + public static Size Max(Size sz1, Size sz2) => new Size(Math.Max(sz1.Width, sz2.Width), Math.Max(sz1.Height, sz2.Height)); + + public bool IsZero => this.Equals(Zero); + + public bool IsEmpty => this.Width == 0 || this.Height == 0; + + public static Size LargestFit(Size source, Size bounds) + { + float num = source.Width / (float)source.Height; + Size size = new Size(bounds.Width, (int)Math.Ceiling(bounds.Width / (double)num)); + if (size.Height > bounds.Height) + size = new Size((int)Math.Ceiling(bounds.Height * (double)num), bounds.Height); + return size; + } + + public void Scale(float flScale) + { + this.Width = (int)(Width * (double)flScale); + this.Height = (int)(Height * (double)flScale); + } + + public static Size Scale(Size size, float flScale) + { + Size size1 = size; + size1.Scale(flScale); + return size1; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SizeChangedHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/SizeChangedHandler.cs new file mode 100644 index 0000000..6eac4ed --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SizeChangedHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SizeChangedHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void SizeChangedHandler(); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs new file mode 100644 index 0000000..4be7c2e --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Sound.Ds8SoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt; +using System; + +namespace Microsoft.Iris.Render.Sound +{ + internal class Ds8SoundDevice : SoundDevice, IRenderHandleOwner + { + private IRenderWindow m_ownerWindow; + private RemoteDs8SoundDevice m_remoteDevice; + + internal Ds8SoundDevice(RenderSession ownerSession, IRenderWindow ownerWindow) + : base(ownerSession) + { + Debug2.Validate(ownerWindow != null, typeof(ArgumentNullException), nameof(ownerWindow)); + this.m_ownerWindow = ownerWindow; + this.PostCreate(); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (this.m_remoteDevice == null) + return; + this.m_remoteDevice.Dispose(); + this.m_remoteDevice = null; + } + finally + { + base.Dispose(inDispose); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; + + protected override SoundDeviceType DeviceType => SoundDeviceType.DirectSound8; + + protected override void CreateRemoteSoundDeviceImpl() => this.m_remoteDevice = this.Session.NtRenderingProtocol.INPROC_BuildRemoteDs8SoundDevice(this, this.m_ownerWindow.WindowHandle); + + protected override void CreateExternalResourcesImpl() => this.m_remoteDevice.SendCreateExternalResources(); + + protected override void EvictExternalResourcesImpl() => this.m_remoteDevice.SendEvictExternalResources(); + + protected override void CreateRemoteSoundBufferImpl( + RENDERHANDLE handle, + SoundHeader info, + LocalSoundBufferCallback callback) + { + this.m_remoteDevice.SendCreateSoundBuffer(handle, info, callback); + } + + protected override void CreateRemoteSoundImpl(RENDERHANDLE handle, SoundBuffer soundBuffer) => this.m_remoteDevice.SendCreateSound(handle, soundBuffer.RemoteStub); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Sound/Sound.cs b/UIX.RenderApi/Microsoft/Iris/Render/Sound/Sound.cs new file mode 100644 index 0000000..97a3a72 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Sound/Sound.cs @@ -0,0 +1,106 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Sound.Sound +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Animation; +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Sound +{ + internal class Sound : + SharedRenderObject, + ISound, + ISharedRenderObject, + IRenderHandleOwner, + IActivatableObject, + IActivatable + { + public static readonly string PlayMethod = "Play"; + public static readonly string StopMethod = "Stop"; + private RemoteSound m_remoteSound; + private SoundBuffer m_bufferOwner; + + internal Sound(SoundBuffer buffer) + { + this.m_remoteSound = this.CreateRemoteObject(buffer); + this.m_bufferOwner = buffer; + } + + protected override void Dispose(bool inDispose) + { + try + { + if (this.m_remoteSound != null) + { + this.m_remoteSound.Dispose(); + this.m_remoteSound = null; + } + this.m_bufferOwner = null; + } + finally + { + base.Dispose(inDispose); + } + } + + void ISound.Play() + { + if (!this.m_bufferOwner.IsContentLoaded) + this.m_bufferOwner.LoadContent(); + if (!this.m_bufferOwner.IsContentLoaded || !this.m_remoteSound.IsValid) + return; + this.m_remoteSound.SendPlay(); + } + + void ISound.Stop() + { + if (!this.m_bufferOwner.IsContentLoaded || !this.m_remoteSound.IsValid) + return; + this.m_remoteSound.SendStop(); + } + + private RemoteSound CreateRemoteObject(SoundBuffer buffer) + { + RemoteSound remoteSound = null; + RENDERHANDLE handle = buffer.Device.Session.AllocateRenderHandle(this); + try + { + buffer.Device.CreateRemoteSound(handle, buffer); + remoteSound = buffer.Device.Session.BuildSoundFromHandle(handle); + return remoteSound; + } + finally + { + if (!remoteSound.IsValid) + buffer.Device.Session.FreeRenderHandle(handle); + } + } + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteSound.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteSound = null; + + RENDERHANDLE IActivatableObject.GetObjectId() => this.m_remoteSound.RenderHandle; + + uint IActivatableObject.GetMethodId(string methodName) + { + if (methodName == PlayMethod) + return 1; + if (methodName == StopMethod) + return 2; + Debug2.Validate(false, typeof(ArgumentException), "Unsupported method: {0}", methodName); + return 0; + } + + protected enum ActivatableMethods : uint + { + Play = 1, + Stop = 2, + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundBuffer.cs b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundBuffer.cs new file mode 100644 index 0000000..9213378 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundBuffer.cs @@ -0,0 +1,164 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Sound.SoundBuffer +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Sound +{ + internal class SoundBuffer : + SharedRenderObject, + ISoundBuffer, + ISharedRenderObject, + ISoundBufferCallback, + IRenderHandleOwner + { + private RemoteSoundBuffer m_remoteBuffer; + private SoundDevice m_device; + private ISoundData m_soundData; + private bool m_contentLoaded; + private DataBufferTracker m_tracker; + private SoundBuffer.SoundBufferLoadInfo m_loadInfo; + + internal SoundBuffer(SoundDevice device, ISoundData soundData) + { + Debug2.Validate(soundData != null, typeof(ArgumentNullException), nameof(soundData)); + Debug2.Validate(soundData.Format == SoundDataFormat.PCM, typeof(ArgumentException), "Only PCM sound data is currently supported"); + Debug2.Validate(soundData.ChannelCount == 1U || soundData.ChannelCount == 2U, typeof(ArgumentException), "Only mono/stereo sound data is currently supported"); + Debug2.Validate(soundData.SampleSize == 8U || soundData.SampleSize == 16U, typeof(ArgumentException), "Only 8bps/16bps sound data is currently supported"); + Debug2.Validate(soundData.SampleCount > 0U, typeof(ArgumentException), "Insufficient sample data"); + Debug2.Validate(soundData.SampleCount % soundData.ChannelCount == 0U, typeof(ArgumentException), "Insufficient sample data"); + this.m_device = device; + this.m_soundData = soundData; + this.m_tracker = MessagingSession.Current.CreateDataBufferTracker(this); + this.m_remoteBuffer = this.CreateRemoteObject(); + this.LoadContent(); + } + + protected override void Dispose(bool inDispose) + { + try + { + if (inDispose) + { + if (this.m_tracker != null) + MessagingSession.Current.ReturnDataBufferTracker(this.m_tracker); + if (this.m_remoteBuffer != null) + this.m_remoteBuffer.Dispose(); + } + this.m_tracker = null; + this.m_soundData = null; + this.m_device = null; + this.m_remoteBuffer = null; + } + finally + { + base.Dispose(inDispose); + } + } + + internal SoundDevice Device => this.m_device; + + internal RemoteSoundBuffer RemoteStub => this.m_remoteBuffer; + + internal bool IsContentLoaded => this.m_contentLoaded; + + RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteBuffer.RenderHandle; + + void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = null; + + ISound ISoundBuffer.CreateSound(object objUser) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Microsoft.Iris.Render.Sound.Sound sound = new Microsoft.Iris.Render.Sound.Sound(this); + sound.RegisterUsage(objUser); + return sound; + } + + private RemoteSoundBuffer CreateRemoteObject() + { + RemoteSoundBuffer remoteSoundBuffer = null; + SoundHeader info; + info.wFormatTag = 1; + info.nChannels = (ushort)this.m_soundData.ChannelCount; + info.nSamplesPerSec = this.m_soundData.SampleRate; + info.nAvgBytesPerSec = this.m_soundData.SampleRate * (this.m_soundData.SampleSize / 8U) * this.m_soundData.ChannelCount; + info.nBlockAlign = (ushort)(this.m_soundData.ChannelCount * (this.m_soundData.SampleSize / 8U)); + info.wBitsPerSample = (ushort)this.m_soundData.SampleSize; + info.cbExtraData = 0; + info.cbDataSize = this.m_soundData.SampleCount * (this.m_soundData.SampleSize / 8U); + RENDERHANDLE handle = this.m_device.Session.AllocateRenderHandle(this); + try + { + this.m_device.CreateRemoteSoundBuffer(handle, info, this.m_device.Session.RenderingProtocol.LocalSoundBufferCallbackHandle); + remoteSoundBuffer = this.m_device.Session.BuildSoundBufferFromHandle(handle); + return remoteSoundBuffer; + } + finally + { + if (!remoteSoundBuffer.IsValid) + this.m_device.Session.FreeRenderHandle(handle); + } + } + + internal void LoadContent() + { + if (this.m_contentLoaded) + return; + IntPtr pData = this.m_soundData.AcquireContent(); + DataBuffer dataBuffer = null; + try + { + uint cbSize = this.m_soundData.SampleCount * (this.m_soundData.SampleSize / 8U); + dataBuffer = this.m_device.Session.BuildDataBuffer(pData, cbSize); + if (this.m_loadInfo == null) + { + this.m_loadInfo = new SoundBuffer.SoundBufferLoadInfo(); + this.m_loadInfo.loadCount = 0; + this.m_loadInfo.soundData = this.m_soundData; + } + ++this.m_loadInfo.loadCount; + this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(OnDataBufferConsumed), m_loadInfo); + dataBuffer.Commit(); + if (this.m_remoteBuffer.IsValid) + this.m_remoteBuffer.SendLoadSoundData(dataBuffer.RemoteStub); + this.m_contentLoaded = true; + } + finally + { + if (!this.m_contentLoaded) + this.m_tracker.Release(dataBuffer, DataBufferTracker.Users.Valid); + } + } + + private static void OnDataBufferConsumed(object sender, DataBufferTracker.CleanupEventArgs args) + { + SoundBuffer.SoundBufferLoadInfo contextData = (SoundBuffer.SoundBufferLoadInfo)args.ContextData; + --contextData.loadCount; + if (contextData.loadCount != 0) + return; + contextData.soundData.ReleaseContent(); + contextData.soundData = null; + } + + void ISoundBufferCallback.OnSoundBufferLost(RENDERHANDLE target) => this.m_contentLoaded = false; + + void ISoundBufferCallback.OnSoundBufferReady(RENDERHANDLE target) + { + if (this.m_contentLoaded) + return; + this.LoadContent(); + } + + private class SoundBufferLoadInfo + { + public int loadCount; + public ISoundData soundData; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundDevice.cs b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundDevice.cs new file mode 100644 index 0000000..fe50e46 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundDevice.cs @@ -0,0 +1,129 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Sound.SoundDevice +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocol; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; + +namespace Microsoft.Iris.Render.Sound +{ + internal abstract class SoundDevice : RenderObject, ISoundDevice + { + private RenderSession m_ownerSession; + private bool m_isValid; + + internal SoundDevice(RenderSession ownerSession) + { + this.m_ownerSession = ownerSession; + this.m_isValid = false; + } + + protected void PostCreate() + { + this.CreateRemoteSoundDevice(); + this.m_isValid = true; + } + + protected override void Dispose(bool inDispose) + { + try + { + this.m_ownerSession = null; + } + finally + { + base.Dispose(inDispose); + } + } + + SoundDeviceType ISoundDevice.DeviceType => this.DeviceType; + + bool ISoundDevice.Mute + { + get + { + Debug2.Validate(this.DeviceType == SoundDeviceType.XAudio, typeof(InvalidOperationException), "Only supported on XAudio"); + return false; + } + set => Debug2.Validate(this.DeviceType == SoundDeviceType.XAudio, typeof(InvalidOperationException), "Only supported on XAudio"); + } + + float ISoundDevice.Volume + { + get + { + Debug2.Validate(this.DeviceType == SoundDeviceType.XAudio, typeof(InvalidOperationException), "Only supported on XAudio"); + return 0.0f; + } + set => Debug2.Validate(this.DeviceType == SoundDeviceType.XAudio, typeof(InvalidOperationException), "Only supported on XAudio"); + } + + internal RenderSession Session => this.m_ownerSession; + + internal bool IsValid => this.m_isValid; + + ISoundBuffer ISoundDevice.CreateSoundBuffer( + object objUser, + ISoundData soundData) + { + Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); + Debug2.Validate(soundData != null, typeof(ArgumentNullException), nameof(soundData)); + SoundBuffer soundBuffer = new SoundBuffer(this, soundData); + soundBuffer.RegisterUsage(objUser); + return soundBuffer; + } + + internal void Rebuild() + { + if (this.m_isValid) + this.EvictExternalResources(); + if (this.m_isValid) + return; + this.CreateExternalResources(); + } + + private void EvictExternalResources() + { + this.m_isValid = false; + this.EvictExternalResourcesImpl(); + } + + private void CreateExternalResources() + { + this.CreateExternalResourcesImpl(); + this.m_isValid = true; + } + + private void CreateRemoteSoundDevice() => this.CreateRemoteSoundDeviceImpl(); + + internal void CreateRemoteSoundBuffer( + RENDERHANDLE handle, + SoundHeader info, + LocalSoundBufferCallback callback) + { + this.CreateRemoteSoundBufferImpl(handle, info, callback); + } + + internal void CreateRemoteSound(RENDERHANDLE handle, SoundBuffer soundBuffer) => this.CreateRemoteSoundImpl(handle, soundBuffer); + + protected abstract SoundDeviceType DeviceType { get; } + + protected abstract void CreateRemoteSoundDeviceImpl(); + + protected abstract void CreateExternalResourcesImpl(); + + protected abstract void EvictExternalResourcesImpl(); + + protected abstract void CreateRemoteSoundBufferImpl( + RENDERHANDLE handle, + SoundHeader info, + LocalSoundBufferCallback callback); + + protected abstract void CreateRemoteSoundImpl(RENDERHANDLE handle, SoundBuffer soundBuffer); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundHeader.cs b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundHeader.cs new file mode 100644 index 0000000..131f30d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Sound/SoundHeader.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Sound.SoundHeader +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render.Sound +{ + [ComVisible(false)] + internal struct SoundHeader + { + public ushort wFormatTag; + public ushort nChannels; + public uint nSamplesPerSec; + public uint nAvgBytesPerSec; + public ushort nBlockAlign; + public ushort wBitsPerSample; + public ushort cbExtraData; + public uint cbDataSize; + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SoundCaps.cs b/UIX.RenderApi/Microsoft/Iris/Render/SoundCaps.cs new file mode 100644 index 0000000..840f189 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SoundCaps.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SoundCaps +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render +{ + [StructLayout(LayoutKind.Sequential, Size = 1)] + public struct SoundCaps + { + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SoundDataFormat.cs b/UIX.RenderApi/Microsoft/Iris/Render/SoundDataFormat.cs new file mode 100644 index 0000000..46543d3 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SoundDataFormat.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SoundDataFormat +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum SoundDataFormat + { + PCM = 1, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SoundDeviceType.cs b/UIX.RenderApi/Microsoft/Iris/Render/SoundDeviceType.cs new file mode 100644 index 0000000..be66a6d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SoundDeviceType.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SoundDeviceType +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum SoundDeviceType + { + None, + DirectSound8, + WaveAudio, + XAudio, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SpotLight2DElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/SpotLight2DElement.cs new file mode 100644 index 0000000..5f4ba2d --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SpotLight2DElement.cs @@ -0,0 +1,160 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SpotLight2DElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class SpotLight2DElement : EffectInput + { + internal const string PositionPropertyName = "Position"; + internal const string DirectionAnglePropertyName = "DirectionAngle"; + internal const string LightColorPropertyName = "LightColor"; + internal const string AmbientColorPropertyName = "AmbientColor"; + internal const string InnerConeAnglePropertyName = "InnerConeAngle"; + internal const string OuterConeAnglePropertyName = "OuterConeAngle"; + internal const string IntensityPropertyName = "Intensity"; + internal const string AttenuationPropertyName = "Attenuation"; + private Vector3 m_vPosition; + private byte m_nPositionID; + private float m_flDirectionAngle; + private byte m_nDirectionAngleID; + private ColorF m_clrLight; + private byte m_nLightColorID; + private ColorF m_clrAmbient; + private byte m_nAmbientColorID; + private float m_flInnerConeAngle; + private byte m_nInnerConeAngleID; + private float m_flOuterConeAngle; + private byte m_nOuterConeAngleID; + private float m_flIntensity; + private byte m_nIntensityID; + private Vector3 m_vAttenuation; + private byte m_nAttenuationID; + + public SpotLight2DElement( + string stName, + Vector3 vPosition, + float flDirectionAngle, + ColorF clrLight, + ColorF clrAmbient, + float flInnerConeAngle, + float flOuterConeAngle, + float flIntensity, + Vector3 vAttenuation) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + Debug2.Validate(flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flIntensity is [0..)"); + Debug2.Validate(flInnerConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flInnerConeAngle is [0..)"); + Debug2.Validate(flOuterConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flOuterConeAngle is [0..)"); + this.m_stName = stName; + this.m_vPosition = vPosition; + this.m_flDirectionAngle = flDirectionAngle; + this.m_clrLight = clrLight; + this.m_clrAmbient = clrAmbient; + this.m_flInnerConeAngle = flInnerConeAngle; + this.m_flOuterConeAngle = flOuterConeAngle; + this.m_flIntensity = flIntensity; + this.m_vAttenuation = vAttenuation; + } + + public SpotLight2DElement() + { + this.m_typeInput = EffectInputType.Spotlight2D; + this.m_vAttenuation = new Vector3(0.0f, 1f, 0.0f); + this.m_clrAmbient = new ColorF(0, 0, 0, 0); + } + + public Vector3 Position + { + get => this.m_vPosition; + set => this.m_vPosition = value; + } + + internal byte PositionID => this.m_nPositionID; + + public float DirectionAngle + { + get => this.m_flDirectionAngle; + set => this.m_flDirectionAngle = value; + } + + internal byte DirectionAngleID => this.m_nDirectionAngleID; + + public ColorF LightColor + { + get => this.m_clrLight; + set => this.m_clrLight = value; + } + + internal byte LightColorID => this.m_nLightColorID; + + public ColorF AmbientColor + { + get => this.m_clrAmbient; + set => this.m_clrAmbient = value; + } + + internal byte AmbientColorID => this.m_nAmbientColorID; + + public float InnerConeAngle + { + get => this.m_flInnerConeAngle; + set => this.m_flInnerConeAngle = value; + } + + internal byte InnerConeAngleID => this.m_nInnerConeAngleID; + + public float OuterConeAngle + { + get => this.m_flOuterConeAngle; + set => this.m_flOuterConeAngle = value; + } + + internal byte OuterConeAngleID => this.m_nOuterConeAngleID; + + public float Intensity + { + get => this.m_flIntensity; + set => this.m_flIntensity = value; + } + + internal byte IntensityID => this.m_nIntensityID; + + public Vector3 Attenuation + { + get => this.m_vAttenuation; + set => this.m_vAttenuation = value; + } + + internal byte AttenuationID => this.m_nAttenuationID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DirectionAngle", 8, ref this.m_nDirectionAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", 20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "InnerConeAngle", 8, ref this.m_nInnerConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "OuterConeAngle", 8, ref this.m_nOuterConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", 8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", 16, ref this.m_nAttenuationID, ref nNextUniqueID); + } + + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("DirectionAngle", EffectPropertyType.Float, m_flDirectionAngle, this.m_nDirectionAngleID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && (this.GenerateProperty("InnerConeAngle", EffectPropertyType.Float, m_flInnerConeAngle, this.m_nInnerConeAngleID, dictProperties) && this.GenerateProperty("OuterConeAngle", EffectPropertyType.Float, m_flOuterConeAngle, this.m_nOuterConeAngleID, dictProperties) && (this.GenerateProperty("Intensity", EffectPropertyType.Float, m_flIntensity, this.m_nIntensityID, dictProperties) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, m_vAttenuation, this.m_nAttenuationID, dictProperties))); + + internal override void AddCacheKey(ByteBuilder cacheKey) + { + base.AddCacheKey(cacheKey); + this.GeneratePropertyCacheKey("Position", this.PositionID, this.Position, cacheKey); + this.GeneratePropertyCacheKey("DirectionAngle", this.DirectionAngleID, this.DirectionAngle, cacheKey); + this.GeneratePropertyCacheKey("LightColor", this.LightColorID, this.LightColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("AmbientColor", this.AmbientColorID, this.AmbientColor.ToVector4(), cacheKey); + this.GeneratePropertyCacheKey("InnerConeAngle", this.InnerConeAngleID, this.InnerConeAngle, cacheKey); + this.GeneratePropertyCacheKey("OuterConeAngle", this.OuterConeAngleID, this.OuterConeAngle, cacheKey); + this.GeneratePropertyCacheKey("Intensity", this.IntensityID, this.Intensity, cacheKey); + this.GeneratePropertyCacheKey("Attenuation", this.AttenuationID, this.Attenuation, cacheKey); + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormat.cs b/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormat.cs new file mode 100644 index 0000000..be9ed01 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormat.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SurfaceFormat +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum SurfaceFormat : uint + { + None = 0, + Bpp8 = 524288, // 0x00080000 + A8 = 557056, // 0x00088000 + Bpp16 = 1048576, // 0x00100000 + RGB16_555 = 1049941, // 0x00100555 + RGB16_565 = 1049957, // 0x00100565 + ARGB16_1555 = 1054037, // 0x00101555 + Bpp24 = 1572864, // 0x00180000 + RGB24 = 1575048, // 0x00180888 + Bpp32 = 2097152, // 0x00200000 + RGB32 = 2099336, // 0x00200888 + ARGB32 = 2132104, // 0x00208888 + YUY2 = 554696704, // 0x21100000 + External = 2147483648, // 0x80000000 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormatInfo.cs b/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormatInfo.cs new file mode 100644 index 0000000..cfb4a10 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SurfaceFormatInfo.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SurfaceFormatInfo +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + internal static class SurfaceFormatInfo + { + public static int GetBitsPerPixel(SurfaceFormat nFormat) => (int)((uint)(nFormat & (SurfaceFormat)16711680) >> 16); + + public static SurfaceFormat FromImageFormat(ImageFormat fmt) + { + switch (fmt) + { + case ImageFormat.A8R8G8B8: + return SurfaceFormat.ARGB32; + case ImageFormat.X8R8G8B8: + return SurfaceFormat.RGB32; + case ImageFormat.A8: + return SurfaceFormat.A8; + default: + return SurfaceFormat.None; + } + } + + public static ImageFormat ToImageFormat(SurfaceFormat fmt) + { + switch (fmt) + { + case SurfaceFormat.A8: + return ImageFormat.A8; + case SurfaceFormat.RGB32: + return ImageFormat.X8R8G8B8; + case SurfaceFormat.ARGB32: + return ImageFormat.A8R8G8B8; + default: + return ImageFormat.None; + } + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/SysCommandHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/SysCommandHandler.cs new file mode 100644 index 0000000..86c3faa --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/SysCommandHandler.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.SysCommandHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + public delegate void SysCommandHandler(IntPtr uParam1, IntPtr uParam2); +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/TrackerBase.cs b/UIX.RenderApi/Microsoft/Iris/Render/TrackerBase.cs new file mode 100644 index 0000000..51fd57f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/TrackerBase.cs @@ -0,0 +1,192 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.TrackerBase +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using System; +using System.Collections; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Render +{ + public abstract class TrackerBase + { + private static readonly TrackerBase.ObjectTest s_testAll = new TrackerBase.ObjectTest(AllObjectTest); + private static readonly TrackerBase.ObjectTest s_testDead = new TrackerBase.ObjectTest(DeadObjectTest); + private static readonly TrackerBase.ObjectTest s_testObject = new TrackerBase.ObjectTest(SpecificObjectTest); + private Map m_tblObjects; + + ~TrackerBase() => this.Dispose(false); + + public void Dispose() + { + GC.SuppressFinalize(this); + this.Dispose(true); + } + + protected virtual void Dispose(bool fInDispose) => this.RemoveObjects(s_testAll); + + public bool IsEmpty => this.m_tblObjects.Count == 0; + + public ArrayList LiveObjects + { + get + { + ArrayList arrayList = new ArrayList(); + lock (this) + { + if (this.m_tblObjects != null) + { + foreach (KeyValueEntry tblObject in this.m_tblObjects) + { + object target = tblObject.Value.Target; + if (target != null) + arrayList.Add(target); + } + } + } + return arrayList; + } + } + + public void AddObject(object key, object value) + { + lock (this) + { + if (this.m_tblObjects == null) + this.SetupObjectTable(); + this.m_tblObjects[key] = GCHandle.Alloc(value, GCHandleType.Weak); + } + } + + public void RemoveKey(object key) + { + lock (this) + { + GCHandle gcHandle; + if (!this.m_tblObjects.TryGetValue(key, out gcHandle)) + { + Debug2.Validate(false, typeof(InvalidOperationException), "Unable to find object with key " + key); + } + else + { + gcHandle.Free(); + this.m_tblObjects.Remove(key); + } + } + } + + public void RemoveKeys(TrackerBase.KeyTest keyTest) + { + lock (this) + { + if (this.m_tblObjects == null) + return; + ArrayList arrayList = null; + foreach (string key in this.m_tblObjects.Keys) + { + if (keyTest == null || keyTest(key)) + { + if (arrayList == null) + arrayList = new ArrayList(); + arrayList.Add(key); + } + } + if (arrayList == null) + return; + foreach (object key in arrayList) + this.RemoveKey(key); + } + } + + public void RemoveObject(object objRemove) => this.RemoveObjects(s_testObject, objRemove); + + public void RemoveDeadObjects() => this.RemoveObjects(s_testDead); + + public void RemoveAllObjects() => this.RemoveObjects(s_testAll); + + public void RemoveObjects(TrackerBase.ObjectTest test) => this.RemoveObjects(test, null); + + public void RemoveObjects(TrackerBase.ObjectTest test, object objParam) + { + lock (this) + { + if (this.m_tblObjects == null) + return; + ArrayList arrayList = null; + foreach (KeyValueEntry tblObject in this.m_tblObjects) + { + GCHandle gcHandle = tblObject.Value; + object target = gcHandle.Target; + if (target == null || test(target, objParam)) + { + if (arrayList == null) + arrayList = new ArrayList(); + object key = tblObject.Key; + arrayList.Add(key); + gcHandle.Free(); + } + } + if (arrayList == null) + return; + foreach (object key in arrayList) + this.m_tblObjects.Remove(key); + } + } + + public object Find(object key) + { + object obj = null; + lock (this) + { + if (this.m_tblObjects != null) + { + GCHandle gcHandle; + if (this.m_tblObjects.TryGetValue(key, out gcHandle)) + { + obj = gcHandle.Target; + if (obj == null) + { + this.m_tblObjects.Remove(key); + gcHandle.Free(); + } + } + } + } + return obj; + } + + public bool ContainsKey(object key) + { + bool flag = false; + lock (this) + { + if (this.m_tblObjects != null) + flag = this.m_tblObjects.ContainsKey(key); + } + return flag; + } + + protected virtual void SetupObjectTable() + { + lock (this) + { + if (this.m_tblObjects != null) + return; + this.m_tblObjects = new Map(); + } + } + + private static bool AllObjectTest(object objSubject, object objParam) => true; + + private static bool DeadObjectTest(object objSubject, object objParam) => false; + + private static bool SpecificObjectTest(object objSubject, object objParam) => objSubject == objParam; + + public delegate bool ObjectTest(object objSubject, object objParam); + + public delegate bool KeyTest(string key); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/TvFormat.cs b/UIX.RenderApi/Microsoft/Iris/Render/TvFormat.cs new file mode 100644 index 0000000..bb9d1f9 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/TvFormat.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.TvFormat +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum TvFormat + { + None, + Ntsc, + Pal, + Pal60, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/ValueEventCondition.cs b/UIX.RenderApi/Microsoft/Iris/Render/ValueEventCondition.cs new file mode 100644 index 0000000..bd2a017 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/ValueEventCondition.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.ValueEventCondition +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum ValueEventCondition : uint + { + RiseAbove, + RiseTo, + FallBelow, + FallTo, + Count, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs b/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs new file mode 100644 index 0000000..1078900 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs @@ -0,0 +1,111 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Vector2 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Text; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct Vector2 + { + private float m_x; + private float m_y; + public static readonly Vector2 Zero = new Vector2(0.0f, 0.0f); + public static readonly Vector2 UnitVector = new Vector2(1f, 1f); + + public Vector2(float x, float y) + { + this.m_x = x; + this.m_y = y; + } + + internal Vector2(double x, double y) + : this((float)x, (float)y) + { + } + + public float X + { + get => this.m_x; + set => this.m_x = value; + } + + public float Y + { + get => this.m_y; + set => this.m_y = value; + } + + public static Vector2 operator +(Vector2 left, Vector2 right) => new Vector2(left.X + right.X, left.Y + right.Y); + + public static Vector2 Add(Vector2 left, Vector2 right) => left + right; + + public static Vector2 operator -(Vector2 left, Vector2 right) => new Vector2(left.X - right.X, left.Y - right.Y); + + public static Vector2 operator -(Vector2 left) => new Vector2(-left.X, -left.Y); + + public static Vector2 Subtract(Vector2 left, Vector2 right) => left - right; + + public static Vector2 operator *(Vector2 left, Vector2 right) => new Vector2(left.X * right.X, left.Y * right.Y); + + public static Vector2 Multiply(Vector2 left, Vector2 right) => left * right; + + public static Vector2 operator *(Vector2 vector, float scalar) => new Vector2(vector.X * scalar, vector.Y * scalar); + + public static Vector2 Multiply(Vector2 vector, float scalar) => vector * scalar; + + public static Vector2 operator /(Vector2 left, Vector2 right) => new Vector2(left.X / right.X, left.Y / right.Y); + + public static Vector2 Divide(Vector2 left, Vector2 right) => left / right; + + public static Vector2 operator /(Vector2 vector, float scalar) => new Vector2(vector.X / scalar, vector.Y / scalar); + + public static Vector2 Divide(Vector2 vector, float scalar) => vector / scalar; + + internal void Normalize() + { + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y); + if (Math2.WithinEpsilon(flValue1, 1f)) + return; + if (flValue1 > 1.40129846432482E-45) + { + float num = (float)Math.Sqrt(flValue1); + this.m_x /= num; + this.m_y /= num; + } + else + { + this.m_x = 0.0f; + this.m_y = 0.0f; + } + } + + public override bool Equals(object obj) => obj is Vector2 vector2 && this == vector2; + + public static bool operator ==(Vector2 left, Vector2 right) => left.X == (double)right.X && left.Y == (double)right.Y; + + public static bool operator !=(Vector2 left, Vector2 right) => !(left == right); + + public override int GetHashCode() => this.X.GetHashCode() ^ this.Y.GetHashCode(); + + public override string ToString() => base.ToString(); + + internal string ToDxShaderString() + { + StringBuilder stringBuilder = new StringBuilder(128); + stringBuilder.Append("{"); + stringBuilder.Append(this.X); + stringBuilder.Append(", "); + stringBuilder.Append(this.Y); + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + + public bool IsApproximate(Vector2 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs b/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs new file mode 100644 index 0000000..eb0662f --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs @@ -0,0 +1,134 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Vector3 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Text; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct Vector3 + { + private float m_x; + private float m_y; + private float m_z; + public static readonly Vector3 Zero = new Vector3(0.0f, 0.0f, 0.0f); + public static readonly Vector3 UnitVector = new Vector3(1f, 1f, 1f); + + public Vector3(float x, float y, float z) + { + this.m_x = x; + this.m_y = y; + this.m_z = z; + } + + public Vector3(Vector3 value) + { + this.m_x = value.m_x; + this.m_y = value.m_y; + this.m_z = value.m_z; + } + + internal Vector3(double x, double y, double z) + : this((float)x, (float)y, (float)z) + { + } + + public float X + { + get => this.m_x; + set => this.m_x = value; + } + + public float Y + { + get => this.m_y; + set => this.m_y = value; + } + + public float Z + { + get => this.m_z; + set => this.m_z = value; + } + + public static Vector3 operator +(Vector3 left, Vector3 right) => new Vector3(left.X + right.X, left.Y + right.Y, left.Z + right.Z); + + public static Vector3 operator +(Vector3 vector, float scalar) => new Vector3(vector.X + scalar, vector.Y + scalar, vector.Z + scalar); + + public static Vector3 Add(Vector3 left, Vector3 right) => left + right; + + public static Vector3 operator -(Vector3 left, Vector3 right) => new Vector3(left.X - right.X, left.Y - right.Y, left.Z - right.Z); + + public static Vector3 operator -(Vector3 vector, float scalar) => new Vector3(vector.X - scalar, vector.Y - scalar, vector.Z - scalar); + + public static Vector3 operator -(Vector3 left) => new Vector3(-left.X, -left.Y, -left.Z); + + public static Vector3 Subtract(Vector3 left, Vector3 right) => left - right; + + public static Vector3 operator *(Vector3 left, Vector3 right) => new Vector3(left.X * right.X, left.Y * right.Y, left.Z * right.Z); + + public static Vector3 Multiply(Vector3 left, Vector3 right) => left * right; + + public static Vector3 operator *(Vector3 vector, float scalar) => new Vector3(vector.X * scalar, vector.Y * scalar, vector.Z * scalar); + + public static Vector3 Multiply(Vector3 vector, float scalar) => vector * scalar; + + public static Vector3 operator /(Vector3 left, Vector3 right) => new Vector3(left.X / right.X, left.Y / right.Y, left.Z / right.Z); + + public static Vector3 Divide(Vector3 left, Vector3 right) => left / right; + + public static Vector3 operator /(Vector3 vector, float scalar) => new Vector3(vector.X / scalar, vector.Y / scalar, vector.Z / scalar); + + public static Vector3 Divide(Vector3 vector, float scalar) => vector / scalar; + + internal void Normalize() + { + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z); + if (Math2.WithinEpsilon(flValue1, 1f)) + return; + if (flValue1 > 1.40129846432482E-45) + { + float num = (float)Math.Sqrt(flValue1); + this.m_x /= num; + this.m_y /= num; + this.m_z /= num; + } + else + { + this.m_x = 0.0f; + this.m_y = 0.0f; + this.m_z = 0.0f; + } + } + + public override bool Equals(object obj) => obj is Vector3 vector3 && this == vector3; + + public static bool operator ==(Vector3 left, Vector3 right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Z == (double)right.Z; + + public static bool operator !=(Vector3 left, Vector3 right) => !(left == right); + + public override int GetHashCode() => this.X.GetHashCode() ^ this.Y.GetHashCode() ^ this.Z.GetHashCode(); + + public override string ToString() => base.ToString(); + + internal string ToDxShaderString() + { + StringBuilder stringBuilder = new StringBuilder(128); + stringBuilder.Append("{"); + stringBuilder.Append(this.X); + stringBuilder.Append(", "); + stringBuilder.Append(this.Y); + stringBuilder.Append(", "); + stringBuilder.Append(this.Z); + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + + public bool IsApproximate(Vector3 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y) && Math2.WithinEpsilon(this.m_z, vector.m_z); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Vector4.cs b/UIX.RenderApi/Microsoft/Iris/Render/Vector4.cs new file mode 100644 index 0000000..d957800 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/Vector4.cs @@ -0,0 +1,135 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.Vector4 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Internal; +using System; +using System.Text; + +namespace Microsoft.Iris.Render +{ + [Serializable] + public struct Vector4 + { + private float m_x; + private float m_y; + private float m_z; + private float m_w; + public static readonly Vector4 Zero = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + public static readonly Vector4 UnitVector = new Vector4(1f, 1f, 1f, 1f); + + public Vector4(float x, float y, float z, float w) + { + this.m_x = x; + this.m_y = y; + this.m_z = z; + this.m_w = w; + } + + internal Vector4(double x, double y, double z, double w) + : this((float)x, (float)y, (float)z, (float)w) + { + } + + public float X + { + get => this.m_x; + set => this.m_x = value; + } + + public float Y + { + get => this.m_y; + set => this.m_y = value; + } + + public float Z + { + get => this.m_z; + set => this.m_z = value; + } + + public float W + { + get => this.m_w; + set => this.m_w = value; + } + + public static Vector4 operator +(Vector4 left, Vector4 right) => new Vector4(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W); + + public static Vector4 Add(Vector4 left, Vector4 right) => left + right; + + public static Vector4 operator -(Vector4 left, Vector4 right) => new Vector4(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W); + + public static Vector4 operator -(Vector4 left) => new Vector4(-left.X, -left.Y, -left.Z, -left.W); + + public static Vector4 Subtract(Vector4 left, Vector4 right) => left - right; + + public static Vector4 operator *(Vector4 left, Vector4 right) => new Vector4(left.X * right.X, left.Y * right.Y, left.Z * right.Z, left.W * right.W); + + public static Vector4 Multiply(Vector4 left, Vector4 right) => left * right; + + public static Vector4 operator *(Vector4 vector, float scalar) => new Vector4(vector.X * scalar, vector.Y * scalar, vector.Z * scalar, vector.W * scalar); + + public static Vector4 Multiply(Vector4 vector, float scalar) => vector * scalar; + + public static Vector4 operator /(Vector4 left, Vector4 right) => new Vector4(left.X / right.X, left.Y / right.Y, left.Z / right.Z, left.W / right.W); + + public static Vector4 Divide(Vector4 left, Vector4 right) => left / right; + + public static Vector4 operator /(Vector4 vector, float scalar) => new Vector4(vector.X / scalar, vector.Y / scalar, vector.Z / scalar, vector.W / scalar); + + public static Vector4 Divide(Vector4 vector, float scalar) => vector / scalar; + + internal void Normalize() + { + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z + m_w * (double)this.m_w); + if (Math2.WithinEpsilon(flValue1, 1f)) + return; + if (flValue1 > 1.40129846432482E-45) + { + float num = (float)Math.Sqrt(flValue1); + this.m_x /= num; + this.m_y /= num; + this.m_z /= num; + this.m_w /= num; + } + else + { + this.m_x = 0.0f; + this.m_y = 0.0f; + this.m_z = 0.0f; + this.m_w = 0.0f; + } + } + + public override bool Equals(object obj) => obj is Vector4 vector4 && this == vector4; + + public static bool operator ==(Vector4 left, Vector4 right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Z == (double)right.Z && left.W == (double)right.W; + + public static bool operator !=(Vector4 left, Vector4 right) => !(left == right); + + public override int GetHashCode() => this.X.GetHashCode() ^ this.Y.GetHashCode() ^ this.Z.GetHashCode() ^ this.W.GetHashCode(); + + public override string ToString() => base.ToString(); + + internal string ToDxShaderString() + { + StringBuilder stringBuilder = new StringBuilder(128); + stringBuilder.Append("{"); + stringBuilder.Append(this.X); + stringBuilder.Append(", "); + stringBuilder.Append(this.Y); + stringBuilder.Append(", "); + stringBuilder.Append(this.Z); + stringBuilder.Append(", "); + stringBuilder.Append(this.W); + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + + public bool IsApproximate(Vector4 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y) && Math2.WithinEpsilon(this.m_z, vector.m_z) && Math2.WithinEpsilon(this.m_w, vector.m_w); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/VideoElement.cs b/UIX.RenderApi/Microsoft/Iris/Render/VideoElement.cs new file mode 100644 index 0000000..f95d0d6 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/VideoElement.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.VideoElement +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using System; + +namespace Microsoft.Iris.Render +{ + public class VideoElement : EffectInput + { + internal const string VideoPropertyName = "Video"; + private Microsoft.Iris.Render.VideoStream m_videoStream; + private byte m_nVideoStreamID; + + public VideoElement(string stName, IVideoStream videoStream) + : this() + { + Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); + this.m_stName = stName; + this.m_videoStream = videoStream as Microsoft.Iris.Render.VideoStream; + } + + public VideoElement() => this.m_typeInput = EffectInputType.Video; + + public IVideoStream VideoStream + { + get => m_videoStream; + set => this.m_videoStream = value as Microsoft.Iris.Render.VideoStream; + } + + internal byte VideoStreamID => this.m_nVideoStreamID; + + internal override int PreProcessProperties( + Map dictionary, + ref byte nNextUniqueID) + { + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID); + this.AddEffectProperty(dictionary, "Video"); + this.m_nVideoStreamID = nNextUniqueID++; + return num; + } + + internal override bool Process(Map dictProperties) + { + if (!this.GenerateProperty("Video", EffectPropertyType.Video, VideoStream, this.m_nVideoStreamID, dictProperties)) + return false; + dictProperties[this.GeneratePropertyPath("Video")].IsDynamic = true; + return true; + } + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/VideoStream.cs b/UIX.RenderApi/Microsoft/Iris/Render/VideoStream.cs new file mode 100644 index 0000000..1563920 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/VideoStream.cs @@ -0,0 +1,137 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.VideoStream +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using Microsoft.Iris.Render.Common; +using Microsoft.Iris.Render.Graphics; +using Microsoft.Iris.Render.Internal; +using Microsoft.Iris.Render.Protocols.Splash.Rendering; +using System; +using System.Threading; + +namespace Microsoft.Iris.Render +{ + internal sealed class VideoStream : + SharedResource, + IVideoPoolNotification, + IVideoStream, + ISharedRenderObject, + ISurfaceContentOwner + { + private static int s_idxNextUnique = 100; + private GraphicsDevice m_device; + private Surface m_surfaceScene; + private VideoPool m_poolScene; + private int m_nUniqueID; + private Size m_sizeTargetPxl; + private Size m_sizeAspectRatio; + + public VideoStream(RenderSession session, GraphicsDevice device) + : base(session) + { + Debug2.Validate(device != null, typeof(ArgumentNullException), "must pass a valid device"); + this.m_device = device; + this.Initialize(); + } + + private void Initialize() + { + this.m_nUniqueID = Interlocked.Increment(ref s_idxNextUnique); + this.m_poolScene = new VideoPool(this.m_device, this); + this.m_surfaceScene = new Surface(m_poolScene, this, Size.Zero); + this.m_surfaceScene.RegisterUsage(this); + IEffectTemplate effectTemplate = this.m_session.CreateEffectTemplate(this, "EmptyVideo"); + ColorElement colorElement = new ColorElement("ColorFill", ColorF.FromArgb(byte.MaxValue, 0, 0, 0)); + effectTemplate.Build(colorElement); + IEffect instance = effectTemplate.CreateInstance(this); + this.m_poolScene.Effect = (Effect)instance; + instance.UnregisterUsage(this); + effectTemplate.UnregisterUsage(this); + RemoteDynamicSurfaceFactory.SendCreateVideoInstance(this.m_session.RenderingProtocol, this.m_nUniqueID, this.m_session.RenderingPort.MessagingProtocol.Context_ClassHandle, RemoteDevice.CreateFromHandle(this.m_device.RemoteDevice.Port, this.m_device.RemoteDevice.RenderHandle), this.m_surfaceScene.RemoteStub, this.m_poolScene.RemoteVideoStub); + } + + protected override void Dispose(bool fInDispose) + { + if (fInDispose) + { + if (this.m_poolScene != null) + { + this.m_surfaceScene.UnregisterUsage(this); + this.m_surfaceScene = null; + this.m_poolScene.Dispose(); + this.m_poolScene = null; + } + RemoteDynamicSurfaceFactory.SendCloseInstance(this.m_session.RenderingProtocol, this.m_nUniqueID); + } + this.m_device = null; + base.Dispose(fInDispose); + } + + public void InvalidateClients() + { + if (this.InvalidateContentEvent == null) + return; + this.InvalidateContentEvent(); + } + + public void NotifySourceChanged(Size sizeTargetPxl, Size sizeAspectRatio) + { + bool flag = false; + if (this.m_sizeTargetPxl != sizeTargetPxl) + { + this.m_sizeTargetPxl = sizeTargetPxl; + flag = true; + } + if (this.m_sizeAspectRatio != sizeAspectRatio) + { + this.m_sizeAspectRatio = sizeAspectRatio; + flag = true; + } + if (!flag) + return; + this.InvalidateClients(); + } + + public void OnSurfaceDisposed(Surface surface) + { + if (this.m_surfaceScene != surface) + return; + this.m_surfaceScene = null; + } + + public void OnRestoreContent(Surface surface) + { + } + + public int StreamID => this.m_nUniqueID; + + public float ContentOverscan + { + get => this.m_poolScene.ContentOverscan; + set + { + Debug2.Validate(value >= 0.0 && value <= 0.5, typeof(ArgumentException), "Valid range for content overscan is [0, .5]"); + if (Math2.WithinEpsilon(this.m_poolScene.ContentOverscan, value)) + return; + this.m_poolScene.ContentOverscan = value; + this.InvalidateClients(); + } + } + + public int ContentAspectWidth => this.m_sizeAspectRatio.Width; + + public int ContentAspectHeight => this.m_sizeAspectRatio.Height; + + public int ContentHeight => this.m_sizeTargetPxl.Height; + + public int ContentWidth => this.m_sizeTargetPxl.Width; + + public event InvalidateContentHandler InvalidateContentEvent; + + internal Surface Surface => this.m_surfaceScene; + + protected override void OnUsageChange(bool fUsed) => this.InvalidateClients(); + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/VisualOrder.cs b/UIX.RenderApi/Microsoft/Iris/Render/VisualOrder.cs new file mode 100644 index 0000000..7db5b5c --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/VisualOrder.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.VisualOrder +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum VisualOrder + { + Any, + Before, + After, + First, + Last, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/WindowOptions.cs b/UIX.RenderApi/Microsoft/Iris/Render/WindowOptions.cs new file mode 100644 index 0000000..c104393 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/WindowOptions.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.WindowOptions +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; + +namespace Microsoft.Iris.Render +{ + [Flags] + public enum WindowOptions + { + EnableCursor = 1, + TrackMouseIdle = 2, + NativeScreensaver = 4, + PreventInterruption = 8, + MaximizeExclusive = 16, // 0x00000010 + LockMouseActive = 32, // 0x00000020 + FreeformResize = 64, // 0x00000040 + ShowFormShadow = 128, // 0x00000080 + StartCentered = 256, // 0x00000100 + StartInWorkArea = 512, // 0x00000200 + MouseleaveOnIdle = 1024, // 0x00000400 + RespectStartupSettings = 2048, // 0x00000800 + MaximizeFullScreen = 4096, // 0x00001000 + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/WindowState.cs b/UIX.RenderApi/Microsoft/Iris/Render/WindowState.cs new file mode 100644 index 0000000..c7506d0 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/WindowState.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.WindowState +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public enum WindowState + { + Normal, + Minimized, + Maximized, + } +} diff --git a/UIX.RenderApi/Microsoft/Iris/Render/WindowStateChangedHandler.cs b/UIX.RenderApi/Microsoft/Iris/Render/WindowStateChangedHandler.cs new file mode 100644 index 0000000..0f2a4c1 --- /dev/null +++ b/UIX.RenderApi/Microsoft/Iris/Render/WindowStateChangedHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Render.WindowStateChangedHandler +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace Microsoft.Iris.Render +{ + public delegate void WindowStateChangedHandler(bool fUnplanned); +} diff --git a/UIX.RenderApi/System/Collections/Generic/HashHelpers.cs b/UIX.RenderApi/System/Collections/Generic/HashHelpers.cs new file mode 100644 index 0000000..3e6a665 --- /dev/null +++ b/UIX.RenderApi/System/Collections/Generic/HashHelpers.cs @@ -0,0 +1,118 @@ +// Decompiled with JetBrains decompiler +// Type: System.Collections.Generic.HashHelpers +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +namespace System.Collections.Generic +{ + internal class HashHelpers + { + internal static readonly int[] s_primes = new int[72] + { + 3, + 7, + 11, + 17, + 23, + 29, + 37, + 47, + 59, + 71, + 89, + 107, + 131, + 163, + 197, + 239, + 293, + 353, + 431, + 521, + 631, + 761, + 919, + 1103, + 1327, + 1597, + 1931, + 2333, + 2801, + 3371, + 4049, + 4861, + 5839, + 7013, + 8419, + 10103, + 12143, + 14591, + 17519, + 21023, + 25229, + 30293, + 36353, + 43627, + 52361, + 62851, + 75431, + 90523, + 108631, + 130363, + 156437, + 187751, + 225307, + 270371, + 324449, + 389357, + 467237, + 560689, + 672827, + 807403, + 968897, + 1162687, + 1395263, + 1674319, + 2009191, + 2411033, + 2893249, + 3471899, + 4166287, + 4999559, + 5999471, + 7199369 + }; + + internal static bool IsPrime(int candidate) + { + if ((candidate & 1) == 0) + return candidate == 2; + int num = (int)Math.Sqrt(candidate); + for (int index = 3; index <= num; index += 2) + { + if (candidate % index == 0) + return false; + } + return true; + } + + internal static int GetPrime(int min) + { + if (min < 0) + throw new ArgumentException(nameof(min)); + for (int index = 0; index < s_primes.Length; ++index) + { + int prime = s_primes[index]; + if (prime >= min) + return prime; + } + for (int candidate = min | 1; candidate < int.MaxValue; candidate += 2) + { + if (IsPrime(candidate)) + return candidate; + } + return min; + } + } +} diff --git a/UIX.RenderApi/UIX.RenderApi.csproj b/UIX.RenderApi/UIX.RenderApi.csproj new file mode 100644 index 0000000..dfa9ee6 --- /dev/null +++ b/UIX.RenderApi/UIX.RenderApi.csproj @@ -0,0 +1,518 @@ + + + + net35 + {CB2B7609-C7B8-4E2A-82D8-DD631B70B621} + Library + UIX.RenderApi + false + 9 + + + true + + + + + + + + \ No newline at end of file diff --git a/UIX.RenderApi/Vector.cs b/UIX.RenderApi/Vector.cs new file mode 100644 index 0000000..eac0a1c --- /dev/null +++ b/UIX.RenderApi/Vector.cs @@ -0,0 +1,200 @@ +// Decompiled with JetBrains decompiler +// Type: Vector +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections; + +public class Vector : IVector +{ + private const int k_defaultCapacity = 4; + private static object[] s_emptyArray = new object[0]; + private object[] _items; + private int _size; + + public Vector() => this._items = s_emptyArray; + + public Vector(int capacity) => this._items = new object[capacity]; + + public Vector(IEnumerable collection) + { + if (collection is ICollection collection1) + { + int count = collection1.Count; + this._items = new object[count]; + collection1.CopyTo(_items, 0); + this._size = count; + } + else + { + this._size = 0; + this._items = new object[4]; + foreach (object obj in collection) + this.Add(obj); + } + } + + public Vector(IVector list) + { + int count = list.Count; + this._size = count; + this._items = new object[count]; + for (int index = 0; index < count; ++index) + this._items[index] = list[index]; + } + + public int Capacity + { + get => this._items.Length; + set + { + if (value == this._items.Length) + return; + if (value > 0) + { + object[] objArray = new object[value]; + if (this._size > 0) + Array.Copy(_items, 0, objArray, 0, this._size); + this._items = objArray; + } + else + this._items = s_emptyArray; + } + } + + public int Count => this._size; + + public object this[int index] + { + get => this._items[index]; + set => this._items[index] = value; + } + + object IVector.this[int index] => this[index]; + + public void Add(object item) + { + if (this._size == this._items.Length) + this.EnsureCapacity(this._size + 1); + this._items[this._size++] = item; + } + + public void Clear() + { + Array.Clear(_items, 0, this._size); + this._size = 0; + } + + public bool Contains(object item) => Array.IndexOf(this._items, item, 0, this._size) >= 0; + + public void CopyTo(Array array, int index) + { + if (this._items == null) + return; + try + { + Array.Copy(_items, 0, array, index, this._size); + } + catch (ArrayTypeMismatchException ex) + { + throw new ArgumentException(null); + } + } + + public void ExpandTo(int count) + { + if (this.Count >= count) + return; + this.EnsureCapacity(count); + this._size = count; + } + + public Vector.Enumerator GetEnumerator() => new Vector.Enumerator(this); + + public int IndexOf(object item) => Array.IndexOf(this._items, item, 0, this._size); + + public void Insert(int index, object item) + { + if (this._size == this._items.Length) + this.EnsureCapacity(this._size + 1); + if (index < this._size) + Array.Copy(_items, index, _items, index + 1, this._size - index); + this._items[index] = item; + ++this._size; + } + + public bool Remove(object item) + { + int index = this.IndexOf(item); + if (index < 0) + return false; + this.RemoveAt(index); + return true; + } + + public void RemoveAt(int index) + { + --this._size; + if (index < this._size) + Array.Copy(_items, index + 1, _items, index, this._size - index); + this._items[this._size] = null; + } + + public void RemoveRange(int index, int count) + { + if (count <= 0) + return; + this._size -= count; + if (index < this._size) + Array.Copy(_items, index + count, _items, index, this._size - index); + Array.Clear(_items, this._size, count); + } + + public void Sort() => this.Sort(0, this.Count, null); + + public void Sort(IComparer comparer) => this.Sort(0, this.Count, comparer); + + public void Sort(int index, int count, IComparer comparer) => Array.Sort(_items, index, count, comparer); + + public object[] ToArray() + { + object[] objArray = new object[this._size]; + Array.Copy(_items, 0, objArray, 0, this._size); + return objArray; + } + + public void TrimExcess() + { + if (this._size >= (int)(_items.Length * 0.9)) + return; + this.Capacity = this._size; + } + + private void EnsureCapacity(int minItemCount) + { + if (this._items.Length >= minItemCount) + return; + int num = this._items.Length == 0 ? 4 : this._items.Length * 2; + if (num < minItemCount) + num = minItemCount; + this.Capacity = num; + } + + public struct Enumerator + { + private Vector _list; + private int _index; + + internal Enumerator(Vector list) + { + this._list = list; + this._index = -1; + } + + public bool MoveNext() => ++this._index < this._list._size; + + public object Current => this._list[this._index]; + } +} diff --git a/UIX.RenderApi/Vector`1.cs b/UIX.RenderApi/Vector`1.cs new file mode 100644 index 0000000..03b8f61 --- /dev/null +++ b/UIX.RenderApi/Vector`1.cs @@ -0,0 +1,200 @@ +// Decompiled with JetBrains decompiler +// Type: Vector`1 +// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1 +// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll + +using System; +using System.Collections; + +public class Vector : IVector +{ + private const int k_defaultCapacity = 4; + private static A[] s_emptyArray = new A[0]; + private A[] _items; + private int _size; + + public Vector() => this._items = s_emptyArray; + + public Vector(int capacity) => this._items = new A[capacity]; + + public Vector(IEnumerable collection) + { + if (collection is ICollection collection1) + { + int count = collection1.Count; + this._items = new A[count]; + collection1.CopyTo(_items, 0); + this._size = count; + } + else + { + this._size = 0; + this._items = new A[4]; + foreach (A a in collection) + this.Add(a); + } + } + + public Vector(IVector list) + { + int count = list.Count; + this._size = count; + this._items = new A[count]; + for (int index = 0; index < count; ++index) + this._items[index] = (A)list[index]; + } + + public int Capacity + { + get => this._items.Length; + set + { + if (value == this._items.Length) + return; + if (value > 0) + { + A[] aArray = new A[value]; + if (this._size > 0) + Array.Copy(_items, 0, aArray, 0, this._size); + this._items = aArray; + } + else + this._items = s_emptyArray; + } + } + + public int Count => this._size; + + public A this[int index] + { + get => this._items[index]; + set => this._items[index] = value; + } + + object IVector.this[int index] => this[index]; + + public void Add(A item) + { + if (this._size == this._items.Length) + this.EnsureCapacity(this._size + 1); + this._items[this._size++] = item; + } + + public void Clear() + { + Array.Clear(_items, 0, this._size); + this._size = 0; + } + + public bool Contains(A item) => Array.IndexOf(this._items, item, 0, this._size) >= 0; + + public void CopyTo(Array array, int index) + { + if (this._items == null) + return; + try + { + Array.Copy(_items, 0, array, index, this._size); + } + catch (ArrayTypeMismatchException ex) + { + throw new ArgumentException(null); + } + } + + public void ExpandTo(int count) + { + if (this.Count >= count) + return; + this.EnsureCapacity(count); + this._size = count; + } + + public Vector.Enumerator GetEnumerator() => new Vector.Enumerator(this); + + public int IndexOf(A item) => Array.IndexOf(this._items, item, 0, this._size); + + public void Insert(int index, A item) + { + if (this._size == this._items.Length) + this.EnsureCapacity(this._size + 1); + if (index < this._size) + Array.Copy(_items, index, _items, index + 1, this._size - index); + this._items[index] = item; + ++this._size; + } + + public bool Remove(A item) + { + int index = this.IndexOf(item); + if (index < 0) + return false; + this.RemoveAt(index); + return true; + } + + public void RemoveAt(int index) + { + --this._size; + if (index < this._size) + Array.Copy(_items, index + 1, _items, index, this._size - index); + this._items[this._size] = default(A); + } + + public void RemoveRange(int index, int count) + { + if (count <= 0) + return; + this._size -= count; + if (index < this._size) + Array.Copy(_items, index + count, _items, index, this._size - index); + Array.Clear(_items, this._size, count); + } + + public void Sort() => this.Sort(0, this.Count, null); + + public void Sort(IComparer comparer) => this.Sort(0, this.Count, comparer); + + public void Sort(int index, int count, IComparer comparer) => Array.Sort(_items, index, count, comparer); + + public A[] ToArray() + { + A[] aArray = new A[this._size]; + Array.Copy(_items, 0, aArray, 0, this._size); + return aArray; + } + + public void TrimExcess() + { + if (this._size >= (int)(_items.Length * 0.9)) + return; + this.Capacity = this._size; + } + + private void EnsureCapacity(int minItemCount) + { + if (this._items.Length >= minItemCount) + return; + int num = this._items.Length == 0 ? 4 : this._items.Length * 2; + if (num < minItemCount) + num = minItemCount; + this.Capacity = num; + } + + public struct Enumerator + { + private Vector _list; + private int _index; + + internal Enumerator(Vector list) + { + this._list = list; + this._index = -1; + } + + public bool MoveNext() => ++this._index < this._list._size; + + public A Current => this._list[this._index]; + } +} diff --git a/UIX/UIX.csproj b/UIX/UIX.csproj index a02f9f6..89396c7 100644 --- a/UIX/UIX.csproj +++ b/UIX/UIX.csproj @@ -77,9 +77,6 @@ packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll - - ..\lib\UIX.renderapi.dll - @@ -1053,6 +1050,12 @@ + + + {cb2b7609-c7b8-4e2a-82d8-dd631b70b621} + UIX.RenderApi + +