diff --git a/PInvoke/DirectManipulation/DirectManipulation.Interfaces.cs b/PInvoke/DirectManipulation/DirectManipulation.Interfaces.cs deleted file mode 100644 index f354ac5e..00000000 --- a/PInvoke/DirectManipulation/DirectManipulation.Interfaces.cs +++ /dev/null @@ -1,2425 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Vanara.PInvoke; - -/// Items from the DirectManipulation.dll. -public static partial class DirectManipulation -{ - /// Represents the auto-scroll animation behavior of content as it approaches the boundary of a given axis or axes. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationautoscrollbehavior - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationAutoScrollBehavior")] - [ComImport, Guid("6D5954D4-2003-4356-9B31-D051C9FF0AF7"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationAutoScrollBehavior - { - /// Performs the auto-scroll animation for the viewport this behavior is attached to. - /// - /// A combination of DIRECTMANIPULATION_MOTION_TRANSLATEX and DIRECTMANIPULATION_MOTION_TRANSLATEY from - /// DIRECTMANIPULATION_MOTION_TYPES. DIRECTMANIPULATION_MOTION_NONE cannot be specified. - /// - /// One of the values from DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION. - /// - /// - /// SetConfiguration takes effect immediately. If the content is not in inertia, and - /// DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_STOP is specified for scrollMotion, then this method returns S_FALSE. - /// - /// Examples - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationautoscrollbehavior-setconfiguration - // HRESULT SetConfiguration( [in] DIRECTMANIPULATION_MOTION_TYPES motionTypes, [in] DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION - // scrollMotion ); - void SetConfiguration(DIRECTMANIPULATION_MOTION_TYPES motionTypes, DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION scrollMotion); - } - - /// - /// Represents a compositor object that associates manipulated content with a drawing surface, such as canvas (Windows app using - /// JavaScript) or Canvas (Windows Store app using C++, C#, or Visual Basic). - /// - /// - /// - /// The content of a Direct Manipulation viewport must be manually updated during an input event for custom implementations of - /// IDirectManipulationCompositor. Call Update to redraw the content within the viewport. - /// - /// You specify manual mode on a viewport by calling either of these functions: - /// - /// - /// SetViewportOptions, with DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE specified. - /// - /// - /// SetUpdateMode, with DIRECTMANIPULATION_INPUT_MODE_MANUAL specified. - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationcompositor - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationCompositor")] - [ComImport, Guid("537A0825-0387-4EFA-B62F-71EB1F085A7E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DCompManipulationCompositor))] - public interface IDirectManipulationCompositor - { - /// - /// Associates content (owned by the caller) with the compositor, assigns a composition device to the content, and specifies the - /// position of the content in the composition tree relative to other composition visuals. - /// - /// - /// The content to add to the composition tree. - /// content is placed between parentVisual and childVisual in the composition tree. - /// - /// - /// The device used to compose the content. - /// Notedevice is created by the application. - /// - /// - /// The parent visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// The child visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// - /// This method inserts a small visual tree (owned by the Direct Manipulation device) between the parentVisual and the - /// childVisual. Transforms can then be applied to the inserted content. - /// - /// - /// All content, regardless of type, must be added to the compositor. This can be primary content, obtained from the viewport by - /// calling GetPrimaryContent, or secondary content, such as a panning indicator, created by calling CreateContent. - /// - /// If the application uses a system-provided IDirectManipulationCompositor: - /// - /// - /// device must be an IDCompositionDevice object, and parent and child visuals must be IDCompositionVisual objects. - /// - /// - /// device, parentVisual, and childVisual cannot be NULL. - /// - /// - /// device, parentVisual, and childVisual objects are created and owned by the application. - /// - /// - /// - /// When content is added to the composition tree using this method, the new composition visuals are inserted between - /// parentVisual and childVisual. The new visuals should not be destroyed until they are disassociated from the - /// compositor with RemoveContent. - /// - /// - /// - /// If the application uses a custom implementation of IDirectManipulationCompositor: - /// - /// - /// - /// device, parentVisual, and childVisual must be a valid type for the compositor. They do not have to be - /// IDCompositionDevice or IDCompositionVisual objects. - /// - /// - /// - /// device, parentVisual, and childVisual can be NULL, depending on the compositor. - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-addcontent - // HRESULT AddContent( [in] IDirectManipulationContent *content, [in, optional] IUnknown *device, [in] IUnknown *parentVisual, [in] - // IUnknown *childVisual ); - void AddContent([In] IDirectManipulationContent content, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object device, - [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object parentVisual, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object childVisual); - - /// Removes content from the compositor. - /// The content to remove from the composition tree. - /// - /// This method removes content added with AddContent and restores the original relationships between parent visuals and child - /// visuals in the composition tree. In other words, RemoveContent undoes AddContent. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-removecontent - // HRESULT RemoveContent( [in] IDirectManipulationContent *content ); - void RemoveContent([In] IDirectManipulationContent content); - - /// Sets the update manager used to send compositor updates to Direct Manipulation. - /// The update manager. - /// - /// Retrieve updateManager by calling GetUpdateManager. - /// Call this method during Direct Manipulation initialization to connect the compositor to the update manager. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-setupdatemanager - // HRESULT SetUpdateManager( [in] IDirectManipulationUpdateManager *updateManager ); - void SetUpdateManager([In] IDirectManipulationUpdateManager updateManager); - - /// Commits all pending updates in the compositor to the system for rendering. - /// - /// This method enables Direct Manipulation to flush any pending changes to its visuals before a system event, such as a process suspension. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-flush - // HRESULT Flush(); - void Flush(); - } - - /// Represents a compositor object that associates manipulated content with drawing surfaces across multiple processes. - /// - /// - /// The content of a Direct Manipulation viewport must be manually updated during an input event for custom implementations of - /// IDirectManipulationCompositor2. Call Update to redraw the content within the viewport. - /// - /// You specify manual mode on a viewport by calling either of these functions: - /// - /// - /// SetViewportOptions, with DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE specified. - /// - /// - /// SetUpdateMode, with DIRECTMANIPULATION_INPUT_MODE_MANUAL specified. - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationcompositor2 - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationCompositor2")] - [ComImport, Guid("D38C7822-F1CB-43CB-B4B9-AC0C767A412E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DCompManipulationCompositor))] - public interface IDirectManipulationCompositor2 : IDirectManipulationCompositor - { - /// - /// Associates content (owned by the caller) with the compositor, assigns a composition device to the content, and specifies the - /// position of the content in the composition tree relative to other composition visuals. - /// - /// - /// The content to add to the composition tree. - /// content is placed between parentVisual and childVisual in the composition tree. - /// - /// - /// The device used to compose the content. - /// Notedevice is created by the application. - /// - /// - /// The parent visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// The child visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// - /// This method inserts a small visual tree (owned by the Direct Manipulation device) between the parentVisual and the - /// childVisual. Transforms can then be applied to the inserted content. - /// - /// - /// All content, regardless of type, must be added to the compositor. This can be primary content, obtained from the viewport by - /// calling GetPrimaryContent, or secondary content, such as a panning indicator, created by calling CreateContent. - /// - /// If the application uses a system-provided IDirectManipulationCompositor: - /// - /// - /// device must be an IDCompositionDevice object, and parent and child visuals must be IDCompositionVisual objects. - /// - /// - /// device, parentVisual, and childVisual cannot be NULL. - /// - /// - /// device, parentVisual, and childVisual objects are created and owned by the application. - /// - /// - /// - /// When content is added to the composition tree using this method, the new composition visuals are inserted between - /// parentVisual and childVisual. The new visuals should not be destroyed until they are disassociated from the - /// compositor with RemoveContent. - /// - /// - /// - /// If the application uses a custom implementation of IDirectManipulationCompositor: - /// - /// - /// - /// device, parentVisual, and childVisual must be a valid type for the compositor. They do not have to be - /// IDCompositionDevice or IDCompositionVisual objects. - /// - /// - /// - /// device, parentVisual, and childVisual can be NULL, depending on the compositor. - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-addcontent - // HRESULT AddContent( [in] IDirectManipulationContent *content, [in, optional] IUnknown *device, [in] IUnknown *parentVisual, [in] - // IUnknown *childVisual ); - new void AddContent([In] IDirectManipulationContent content, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object device, - [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object parentVisual, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object childVisual); - - /// Removes content from the compositor. - /// The content to remove from the composition tree. - /// - /// This method removes content added with AddContent and restores the original relationships between parent visuals and child - /// visuals in the composition tree. In other words, RemoveContent undoes AddContent. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-removecontent - // HRESULT RemoveContent( [in] IDirectManipulationContent *content ); - new void RemoveContent([In] IDirectManipulationContent content); - - /// Sets the update manager used to send compositor updates to Direct Manipulation. - /// The update manager. - /// - /// Retrieve updateManager by calling GetUpdateManager. - /// Call this method during Direct Manipulation initialization to connect the compositor to the update manager. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-setupdatemanager - // HRESULT SetUpdateManager( [in] IDirectManipulationUpdateManager *updateManager ); - new void SetUpdateManager([In] IDirectManipulationUpdateManager updateManager); - - /// Commits all pending updates in the compositor to the system for rendering. - /// - /// This method enables Direct Manipulation to flush any pending changes to its visuals before a system event, such as a process suspension. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor-flush - // HRESULT Flush(); - new void Flush(); - - /// - /// Associates content (owned by the component host) with the compositor, assigns a composition device to the content, and specifies - /// the position of the content in the composition tree relative to other composition visuals. Represents a compositor object that - /// associates manipulated content with drawing surfaces across multiple processes. - /// - /// - /// The content to add to the composition tree. - /// content is placed between parentVisual and childVisual in the composition tree. - /// Only primary content, created at the same time as the viewport, is valid. - /// - /// - /// The device used to compose the content. - /// Notedevice is created by the application. - /// - /// - /// The parent visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// The child visuals in the composition tree of the content being added. - /// parentVisual must also be a parent of childVisual in the composition tree. - /// - /// - /// - /// This method inserts a small visual tree (owned by the Direct Manipulation device) between the parentVisual and the - /// childVisual. Transforms can then be applied to the inserted content. - /// - /// All content, regardless of type, must be added to the compositor. - /// If the application uses a system-provided IDirectManipulationCompositor: - /// - /// - /// device must be an IDCompositionDevice object, and parent and child visuals must be IDCompositionVisual objects. - /// - /// - /// device, parentVisual, and childVisual cannot be NULL. - /// - /// - /// device, parentVisual, and childVisual objects are created and owned by the application. - /// - /// - /// - /// When content is added to the composition tree using this method, the new composition visuals are inserted between - /// parentVisual and childVisual. The new visuals should not be destroyed until they are disassociated from the - /// compositor with RemoveContent. - /// - /// - /// - /// If the application uses a custom implementation of IDirectManipulationCompositor: - /// - /// - /// - /// device, parentVisual, and childVisual must be a valid type for the compositor. They do not have to be - /// IDCompositionDevice or IDCompositionVisual objects. - /// - /// - /// - /// device, parentVisual, and childVisual can be NULL, depending on the compositor. - /// - /// - /// - /// The cross-process pointer events (WM_POINTERROUTEDAWAY, WM_POINTERROUTEDRELEASED, and WM_POINTERROUTEDTO) should be handled appropriately. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcompositor2-addcontentwithcrossprocesschaining - // HRESULT AddContentWithCrossProcessChaining( [in] IDirectManipulationPrimaryContent *content, [in] IUnknown *device, [in] IUnknown - // *parentVisual, [in] IUnknown *childVisual ); - void AddContentWithCrossProcessChaining([In] IDirectManipulationPrimaryContent content, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object device, - [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object parentVisual, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object childVisual); - } - - /// - /// Encapsulates content inside a viewport, where content represents a visual surface clipped inside the viewport. - /// The content has a set of transforms that controls the visual movement of the surface during manipulation and inertia. - /// - /// Note When implementing a Direct Manipulation object, ensure that the IUnknown implementation supports multithreading through - /// thread-safe reference counting. For more information, see InterlockedIncrement and InterlockedDecrement. - /// - /// - /// The system provides an implementation of IDirectManipulationContent. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationcontent - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationContent")] - [ComImport, Guid("B89962CB-3D89-442B-BB58-5098FA0F9F16"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationContent - { - /// Retrieves the bounding rectangle of the content, relative to the bounding rectangle of the viewport (if defined). - /// The bounding rectangle of the content. - /// - /// If the bounding rectangle has not been set using SetContentRect, then UI_E_VALUE_NOT_SET is returned. However, the actual content - /// rectangle is (-FLT_MAX, -FLT_MAX, FLT_MAX, FLT_MAX). - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-getcontentrect - // HRESULT GetContentRect( [out] RECT *contentSize ); - RECT GetContentRect(); - - /// Specifies the bounding rectangle of the content, relative to its viewport. - /// The bounding rectangle of the content. - /// The default bounding rectangle is (-FLT_MAX, -FLT_MAX, FLT_MAX, FLT_MAX). - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-setcontentrect - // HRESULT SetContentRect( [in] const RECT *contentSize ); - void SetContentRect(in RECT contentSize); - - /// Retrieves the viewport that contains the content. - /// A reference to the identifier of the interface to use. - /// The viewport object. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-getviewport - // HRESULT GetViewport( [in] REFIID riid, [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - object GetViewport(in Guid riid); - - /// Retrieves the tag object set on this content. - /// A reference to the identifier of the interface to use. The tag object typically implements this interface. - /// The tag object. - /// The ID portion of the tag. - /// - /// - /// GetTag and SetTag are useful for associating an external COM object with the content without an external mapping between - /// the two. They can also be used to pass information to callbacks generated for the content. - /// - /// GetTag queries the tag value for the specified interface and returns a pointer to that interface. - /// - /// A tag is a pairing of an integer ID ( id) with a Component Object Model (COM) object ( object). It can be used by - /// an app to identify a motion. The parameters are optional, so that the method can return both parts of the tag, the identifier - /// portion, or the tag object. - /// - /// Examples - /// The following example shows the syntax for this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-gettag - // HRESULT GetTag( [in] REFIID riid, [out, optional] void **object, [out, optional] UINT32 *id ); - void GetTag(in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object @object, out uint id); - - /// Specifies the tag object for the content. - /// The object portion of the tag. - /// The ID portion of the tag. - /// - /// - /// GetTag and SetTag are useful for associating an external COM object with the content without an external mapping between - /// the two. They can also be used to pass information to callbacks generated for the content. - /// - /// - /// A tag is a pairing of an integer ID ( id) with a Component Object Model (COM) object ( object). It can be used by - /// an app to store and retrieve an arbitrary object associated with the content. - /// - /// The object parameter is optional, so that the method can set just the identifier portion. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-settag - // HRESULT SetTag( [in] IUnknown *object, [in] UINT32 id ); - void SetTag([In, Optional, MarshalAs(UnmanagedType.IUnknown)] object @object, uint id); - - /// Gets the final transform applied to the content. - /// The transform matrix. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// This transform might contain the other custom curves applied during manipulation and inertia. - /// This transform contains both the content transform and the sync transform set with SyncContentTransform. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-getoutputtransform - // HRESULT GetOutputTransform( [out] float *matrix, [in] DWORD pointCount ); - void GetOutputTransform([Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount = 6); - - /// Retrieves the transform applied to the content. - /// The transform matrix. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// This transform contains the default overpan and bounce curves during manipulation and inertia. - /// This transform does not contain the sync transform set with SyncContentTransform. - /// When this method returns, the format of matrix is: - /// matrixmatrixmatrixmatrixmatrixmatrix - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-getcontenttransform - // HRESULT GetContentTransform( [out] float *matrix, [in] DWORD pointCount ); - void GetContentTransform([Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount = 6); - - /// Modifies the content transform while maintaining the output transform. - /// The transform matrix. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// This method will fail if the viewport state is DIRECTMANIPULATION_RUNNING, DIRECTMANIPULATION_INERTIA or DIRECTMANIPULATION_SUSPENDED. - /// - /// This method is useful when the application wants to apply transforms on top of the content transforms at the end of a - /// manipulation, while preserving the visual output transform of the content. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationcontent-synccontenttransform - // HRESULT SyncContentTransform( [in] const float *matrix, [in] DWORD pointCount ); - void SyncContentTransform([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount = 6); - } - - /// - /// Represents a service for managing associations between a contact and a viewport. - /// - /// SetContact is called when a WM_POINTERDOWN message is received. Upon receiving a WM_POINTERDOWN, the application can use the - /// coordinates of the input to hit-test and determine the viewports to which the contact is associated. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationdefercontactservice - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationDeferContactService")] - [ComImport, Guid("652D5C71-FE60-4A98-BE70-E5F21291E7F1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationDeferContactService - { - /// - /// Specifies the amount of time to defer the execution of a call to SetContact for this pointerId. - /// DeferContact must be called before SetContact. - /// - /// The ID of the pointer. - /// The duration of the deferral, in milliseconds. The maximum value is 500. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdefercontactservice-defercontact - // HRESULT DeferContact( [in] UINT32 pointerId, [in] UINT32 timeout ); - void DeferContact(uint pointerId, uint timeout); - - /// Cancel all scheduled calls to SetContact for this pointerId. - /// The ID of the pointer. - /// This function fails if the timeout specified in DeferContact has already been reached. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdefercontactservice-cancelcontact - // HRESULT CancelContact( [in] UINT32 pointerId ); - void CancelContact(uint pointerId); - - /// Cancel the deferral set in DeferContact and process the scheduled SetContact call for this pointerId. - /// The ID of the pointer. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdefercontactservice-canceldeferral - // HRESULT CancelDeferral( [in] UINT32 pointerId ); - void CancelDeferral(uint pointerId); - } - - /// - /// Represents behaviors for drag and drop interactions, which are triggered by cross-slide or press-and-hold gestures. - /// Call AddBehavior to apply the behavior on a viewport and RemoveBehavior to remove it. - /// - /// - /// - /// If AddConfiguration, RemoveConfiguration, ActivateConfiguration, or SetManualGesture has been called successfully on a viewport, - /// AddBehavior fails for the remaining lifetime of the viewport. - /// - /// - /// Once the behavior is added to the viewport, calls to AddConfiguration, RemoveConfiguration, ActivateConfiguration, or - /// SetManualGesture will fail until RemoveBehavior is called. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationdragdropbehavior - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationDragDropBehavior")] - [ComImport, Guid("814B5AF5-C2C8-4270-A9B7-A198CE8D02FA"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationDragDropBehavior - { - /// Sets the configuration of the drag-drop interaction for the viewport this behavior is attached to. - /// - /// Combination of values from DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION. - /// For the configuration to be valid, configuration must contain exactly one of the following three values: - /// - /// - /// DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_ONLY - /// - /// - /// DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_DRAG - /// - /// - /// DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HOLD_DRAG - /// - /// - /// - /// If DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_ONLY or DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_DRAG - /// is specified, one of DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_VERTICAL or - /// DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HORIZONTAL is required. - /// - /// - /// If DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HOLD_DRAG is specified, both - /// DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_VERTICAL and DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HORIZONTAL are required. - /// - /// - /// - /// - /// The configuration of the behavior can be set before or after it has been added to a viewport. If a configuration change is made - /// while an interaction is occurring, the new configuration takes effect on the next interaction. - /// - /// - /// IDirectManipulationViewport::ActivateConfiguration should not be called prior to calling - /// IDirectManipulationDragDropBehavior::SetConfiguration. This will result in unexpected behavior. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdragdropbehavior-setconfiguration - // HRESULT SetConfiguration( [in] DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION configuration ); - void SetConfiguration([In] DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION configuration); - - /// Gets the status of the drag-drop interaction for the viewport this behavior is attached to. - /// One of the values from DIRECTMANIPULATION_DRAG_DROP_STATUS. - /// This method returns the drag-drop status at the time of the call and not at the time when the return value is read. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdragdropbehavior-getstatus - // HRESULT GetStatus( [out, retval] DIRECTMANIPULATION_DRAG_DROP_STATUS *status ); - DIRECTMANIPULATION_DRAG_DROP_STATUS GetStatus(); - } - - /// - /// Defines methods to handle drag-drop behavior events. - /// - /// Note When implementing this interface, ensure that the IUnknown implementation supports multithreading through thread-safe - /// reference counting. For more information, see InterlockedIncrement and InterlockedDecrement. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationdragdropeventhandler - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationDragDropEventHandler")] - [ComImport, Guid("1FA11B10-701B-41AE-B5F2-49E36BD595AA"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationDragDropEventHandler - { - /// Called when a status change happens in the viewport that the drag-and-drop behavior is attached to. - /// The updated viewport. - /// The current state of the drag-drop interaction from DIRECTMANIPULATION_DRAG_DROP_STATUS. - /// The previous state of the drag-drop interaction from DIRECTMANIPULATION_DRAG_DROP_STATUS. - /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - /// - /// If a class is implementing IDirectManipulationViewportEventHandler it should also implement - /// IDirectManipulationDragDropEventHandler if that viewport will use drag and drop. Direct Manipulation will query the - /// IDirectManipulationViewportEventHandler instances to verify that they also implement IDirectManipulationDragDropEventHandler. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationdragdropeventhandler-ondragdropstatuschange - // HRESULT OnDragDropStatusChange( [in] IDirectManipulationViewport2 *viewport, [in] DIRECTMANIPULATION_DRAG_DROP_STATUS current, - // [in] DIRECTMANIPULATION_DRAG_DROP_STATUS previous ); - [PreserveSig] - HRESULT OnDragDropStatusChange([In] IDirectManipulationViewport2 viewport, - [In] DIRECTMANIPULATION_DRAG_DROP_STATUS current, [In] DIRECTMANIPULATION_DRAG_DROP_STATUS previous); - } - - /// - /// Represents a time-keeping object that measures the latency of the composition infrastructure used by the application and provides - /// this data to Direct Manipulation. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationframeinfoprovider - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationFrameInfoProvider")] - [ComImport, Guid("fb759dba-6f4c-4c01-874e-19c8a05907f9"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationFrameInfoProvider - { - /// Retrieves the composition timing information from the compositor. - /// The current time, in milliseconds. - /// The time, in milliseconds, when the compositor begins constructing the next frame. - /// - /// The time, in milliseconds, when the compositor finishes composing and drawing the next frame on the screen. - /// - /// - /// The system implementation of IDirectManipulationFrameInfoProvider uses DirectComposition. GetFrameStatistics is used to calculate - /// the parameter values for GetNextFrameInfo. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationframeinfoprovider-getnextframeinfo - // HRESULT GetNextFrameInfo( [out] ULONGLONG *time, [out] ULONGLONG *processTime, [out] ULONGLONG *compositionTime ); - void GetNextFrameInfo(out ulong time, out ulong processTime, out ulong compositionTime); - } - - /// - /// Defines methods to handle interactions when they are detected. - /// - /// Note When implementing this interface, ensure that the IUnknown implementation supports multithreading through thread-safe - /// reference counting. For more information, see InterlockedIncrement and InterlockedDecrement. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationinteractioneventhandler - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationInteractionEventHandler")] - [ComImport, Guid("E43F45B8-42B4-403E-B1F2-273B8F510830"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationInteractionEventHandler - { - /// Called when an interaction is detected. - /// The viewport on which the interaction was detected. - /// One of the values from DIRECTMANIPULATION_INTERACTION_TYPE. - /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationinteractioneventhandler-oninteraction - // HRESULT OnInteraction( [in] IDirectManipulationViewport2 *viewport, [in] DIRECTMANIPULATION_INTERACTION_TYPE interaction ); - [PreserveSig] - HRESULT OnInteraction([In] IDirectManipulationViewport2 viewport, [In] DIRECTMANIPULATION_INTERACTION_TYPE interaction); - } - - /// - /// Provides access to all the Direct Manipulation features and APIs available to the client application. - /// - /// This is the first COM object (the object factory) created by the application to retrieve other COM objects in the Direct Manipulation - /// API surface. It also serves to activate and deactivate Direct Manipulation functionality on a per-HWND basis. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationmanager - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationManager")] - [ComImport, Guid("FBF5D3B4-70C7-4163-9322-5A6F660D6FBC"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationManager))] - public interface IDirectManipulationManager - { - /// Activates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to activate Direct Manipulation. - /// - /// - /// The manipulation manager is deactivated, by default. The manager does not receive or respond to input and callbacks until - /// Activate is called for the window. - /// - /// Calls to Activate and Deactivate are reference counted. - /// Examples - /// The following example shows how to activate and deactivate input processing. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-activate - // HRESULT Activate( [in] HWND window ); - void Activate([In] HWND window); - - /// Deactivates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to deactivate input. - /// - /// - /// The manipulation manager is deactivated by default. The manager does not receive or respond to input until Activate is called. - /// The manipulation manager should be deactivated when the app does not receive or respond to input. For example, when the app is minimized. - /// - /// Calls to Activate and Deactivate are reference counted. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-deactivate - // HRESULT Deactivate( [in] HWND window ); - void Deactivate([In] HWND window); - - /// Registers a dedicated thread for hit testing. - /// The handle of the main app window (typically created from the UI thread). - /// - /// The handle of the window in which hit testing is registered (should be created from the hit testing thread). Pass in nullptr to - /// unregister a previously registered hit-test target. - /// - /// - /// One of the values from DIRECTMANIPULATION_HITTEST_TYPE. Specifies whether the UI window or the hit testing window (or both) - /// receives the hit testing WM_POINTERDOWN message , and in what order. - /// - /// - /// - /// Hit testing is typically performed on the application UI thread. The application receives a WM_POINTERDOWN message on which - /// hit-testing is performed. If a manipulation is required, SetContact is called on one or more viewports. An application can use - /// the RegisterHitTestTarget method to delegate this hit-testing responsibility to a separate hit-testing thread. - /// - /// - /// Once a dedicated hit-test target is successfully registered, WM_POINTERDOWN messages are processed on the hit-testing thread. If - /// a manipulation, such as pan or zoom, is required, SetContact is called from this thread. - /// - /// - /// If SetContact is not called from the hit-testing thread, WM_POINTERDOWN messages may be processed on the UI thread, depending on - /// the DIRECTMANIPULATION_HITTEST_TYPE specified during registration. - /// - /// - /// If SetContact is not called by either the hit-test thread or the UI thread, Direct Manipulation ignores the input which is then - /// handled on the UI thread. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-registerhittesttarget - // HRESULT RegisterHitTestTarget( [in] HWND window, [in, optional] HWND hitTestWindow, [in] DIRECTMANIPULATION_HITTEST_TYPE type ); - void RegisterHitTestTarget([In] HWND window, [In, Optional] HWND hitTestWindow, [In] DIRECTMANIPULATION_HITTEST_TYPE type); - - /// Passes keyboard and mouse messages to the manipulation manager on the app's UI thread. - /// The input message to process. - /// TRUE if no further processing should be done with this message; otherwise, FALSE. - /// - /// Call this method for mouse and keyboard input. - /// Examples - /// The following example shows how to pass messages to the manipulation manager. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-processinput - // HRESULT ProcessInput( [in] const MSG *message, [out, retval] BOOL *handled ); - bool ProcessInput(in MSG message); - - /// Gets a pointer to an IDirectManipulationUpdateManager object that receives compositor updates. - /// IID to the interface. - /// Pointer to the new IDirectManipulationUpdateManager object. - /// - /// For the compositor to respond to update events from Direct Manipulation, you must associate IDirectManipulationUpdateManager to - /// an IDirectManipulationCompositor object during initialization. Use GetUpdateManager to obtain a pointer to a - /// IDirectManipulationUpdateManager object. Pass this pointer to the compositor using the SetUpdateManager method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-getupdatemanager - // HRESULT GetUpdateManager( [in] REFIID riid, [out, retval] void **object ); - IDirectManipulationUpdateManager GetUpdateManager(in Guid riid); - - /// - /// The factory method that is used to create a new IDirectManipulationViewport object. - /// The viewport manages the interaction state and mapping of input to output actions. - /// - /// The frame info provider for the viewport. - /// The handle of the main app window to associate with the viewport. - /// IID to the interface. - /// The new IDirectManipulationViewport object. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createviewport - // HRESULT CreateViewport( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] HWND window, [in] REFIID riid, [out, - // retval] void **object ); - IDirectManipulationViewport CreateViewport([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, [In] HWND window, in Guid riid); - - /// - /// The factory method that is used to create an instance of secondary content (such as a panning indicator) inside a viewport. - /// - /// - /// The frame info provider for the secondary content. This should match the frame info provider used to create the viewport. - /// - /// Class identifier (CLSID) of the secondary content. This ID specifies the content type. - /// IID of the interface. - /// The secondary content object that implements the specified interface. - /// - /// - /// Primary content is automatically created at the same time as the viewport and has a one-to-one relationship to a viewport. - /// Therefore, it is not possible to create, add, or remove primary content. - /// - /// - /// Secondary content is created independently from the viewport. There is no limit to how much secondary content can be added or - /// removed from a viewport. All secondary content transforms are derived from those supported by the primary content with specific - /// rules applied based on the intended purpose of the element (identified by its Class identifier (CLSID)). - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createcontent - // HRESULT CreateContent( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] REFCLSID clsid, [in] REFIID riid, - // [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - object CreateContent([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, in Guid clsid, in Guid riid); - } - - /// - /// - /// Extends the IDirectManipulationManager interface that provides access to all the Direct Manipulation features and APIs available to - /// the client application. - /// - /// The IDirectManipulationManager2 interface adds support for configuration behaviors that can be attached to a viewport. - /// - /// Note To obtain an IDirectManipulationManager2 interface pointer, QueryInterface on an existing - /// IDirectManipulationManager interface pointer. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationmanager2 - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationManager2")] - [ComImport, Guid("FA1005E9-3D16-484C-BFC9-62B61E56EC4E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationManager))] - public interface IDirectManipulationManager2 : IDirectManipulationManager - { - /// Activates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to activate Direct Manipulation. - /// - /// - /// The manipulation manager is deactivated, by default. The manager does not receive or respond to input and callbacks until - /// Activate is called for the window. - /// - /// Calls to Activate and Deactivate are reference counted. - /// Examples - /// The following example shows how to activate and deactivate input processing. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-activate - // HRESULT Activate( [in] HWND window ); - new void Activate([In] HWND window); - - /// Deactivates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to deactivate input. - /// - /// - /// The manipulation manager is deactivated by default. The manager does not receive or respond to input until Activate is called. - /// The manipulation manager should be deactivated when the app does not receive or respond to input. For example, when the app is minimized. - /// - /// Calls to Activate and Deactivate are reference counted. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-deactivate - // HRESULT Deactivate( [in] HWND window ); - new void Deactivate([In] HWND window); - - /// Registers a dedicated thread for hit testing. - /// The handle of the main app window (typically created from the UI thread). - /// - /// The handle of the window in which hit testing is registered (should be created from the hit testing thread). Pass in nullptr to - /// unregister a previously registered hit-test target. - /// - /// - /// One of the values from DIRECTMANIPULATION_HITTEST_TYPE. Specifies whether the UI window or the hit testing window (or both) - /// receives the hit testing WM_POINTERDOWN message , and in what order. - /// - /// - /// - /// Hit testing is typically performed on the application UI thread. The application receives a WM_POINTERDOWN message on which - /// hit-testing is performed. If a manipulation is required, SetContact is called on one or more viewports. An application can use - /// the RegisterHitTestTarget method to delegate this hit-testing responsibility to a separate hit-testing thread. - /// - /// - /// Once a dedicated hit-test target is successfully registered, WM_POINTERDOWN messages are processed on the hit-testing thread. If - /// a manipulation, such as pan or zoom, is required, SetContact is called from this thread. - /// - /// - /// If SetContact is not called from the hit-testing thread, WM_POINTERDOWN messages may be processed on the UI thread, depending on - /// the DIRECTMANIPULATION_HITTEST_TYPE specified during registration. - /// - /// - /// If SetContact is not called by either the hit-test thread or the UI thread, Direct Manipulation ignores the input which is then - /// handled on the UI thread. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-registerhittesttarget - // HRESULT RegisterHitTestTarget( [in] HWND window, [in, optional] HWND hitTestWindow, [in] DIRECTMANIPULATION_HITTEST_TYPE type ); - new void RegisterHitTestTarget([In] HWND window, [In, Optional] HWND hitTestWindow, [In] DIRECTMANIPULATION_HITTEST_TYPE type); - - /// Passes keyboard and mouse messages to the manipulation manager on the app's UI thread. - /// The input message to process. - /// TRUE if no further processing should be done with this message; otherwise, FALSE. - /// - /// Call this method for mouse and keyboard input. - /// Examples - /// The following example shows how to pass messages to the manipulation manager. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-processinput - // HRESULT ProcessInput( [in] const MSG *message, [out, retval] BOOL *handled ); - new bool ProcessInput(in MSG message); - - /// Gets a pointer to an IDirectManipulationUpdateManager object that receives compositor updates. - /// IID to the interface. - /// Pointer to the new IDirectManipulationUpdateManager object. - /// - /// For the compositor to respond to update events from Direct Manipulation, you must associate IDirectManipulationUpdateManager to - /// an IDirectManipulationCompositor object during initialization. Use GetUpdateManager to obtain a pointer to a - /// IDirectManipulationUpdateManager object. Pass this pointer to the compositor using the SetUpdateManager method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-getupdatemanager - // HRESULT GetUpdateManager( [in] REFIID riid, [out, retval] void **object ); - new IDirectManipulationUpdateManager GetUpdateManager(in Guid riid); - - /// - /// The factory method that is used to create a new IDirectManipulationViewport object. - /// The viewport manages the interaction state and mapping of input to output actions. - /// - /// The frame info provider for the viewport. - /// The handle of the main app window to associate with the viewport. - /// IID to the interface. - /// The new IDirectManipulationViewport object. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createviewport - // HRESULT CreateViewport( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] HWND window, [in] REFIID riid, [out, - // retval] void **object ); - new IDirectManipulationViewport CreateViewport([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, [In] HWND window, in Guid riid); - - /// - /// The factory method that is used to create an instance of secondary content (such as a panning indicator) inside a viewport. - /// - /// - /// The frame info provider for the secondary content. This should match the frame info provider used to create the viewport. - /// - /// Class identifier (CLSID) of the secondary content. This ID specifies the content type. - /// IID of the interface. - /// The secondary content object that implements the specified interface. - /// - /// - /// Primary content is automatically created at the same time as the viewport and has a one-to-one relationship to a viewport. - /// Therefore, it is not possible to create, add, or remove primary content. - /// - /// - /// Secondary content is created independently from the viewport. There is no limit to how much secondary content can be added or - /// removed from a viewport. All secondary content transforms are derived from those supported by the primary content with specific - /// rules applied based on the intended purpose of the element (identified by its Class identifier (CLSID)). - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createcontent - // HRESULT CreateContent( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] REFCLSID clsid, [in] REFIID riid, - // [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - new object CreateContent([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, in Guid clsid, in Guid riid); - - /// Factory method to create a behavior. - /// CLSID of the behavior. The CLSID specifies the type of behavior. - /// The IID of the behavior interface to create. - /// The new behavior object that implements the specified interface. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager2-createbehavior - // HRESULT CreateBehavior( [in] REFCLSID clsid, [in] REFIID riid, [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - object CreateBehavior(in Guid clsid, in Guid riid); - } - - /// - /// - /// Extends the IDirectManipulationManager2 interface that provides access to all the Direct Manipulation features and APIs available to - /// the client application. - /// - /// The IDirectManipulationManager3 interface adds support for retrieving an IDirectManipulationDeferContactService object. - /// - /// Note To obtain an IDirectManipulationManager3 interface pointer, QueryInterface on an existing - /// IDirectManipulationManager interface pointer. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationmanager3 - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationManager3")] - [ComImport, Guid("2CB6B33D-FFE8-488C-B750-FBDFE88DCA8C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationManager))] - public interface IDirectManipulationManager3 : IDirectManipulationManager2 - { - /// Activates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to activate Direct Manipulation. - /// - /// - /// The manipulation manager is deactivated, by default. The manager does not receive or respond to input and callbacks until - /// Activate is called for the window. - /// - /// Calls to Activate and Deactivate are reference counted. - /// Examples - /// The following example shows how to activate and deactivate input processing. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-activate - // HRESULT Activate( [in] HWND window ); - new void Activate([In] HWND window); - - /// Deactivates Direct Manipulation for processing input and handling callbacks on the specified window. - /// The window in which to deactivate input. - /// - /// - /// The manipulation manager is deactivated by default. The manager does not receive or respond to input until Activate is called. - /// The manipulation manager should be deactivated when the app does not receive or respond to input. For example, when the app is minimized. - /// - /// Calls to Activate and Deactivate are reference counted. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-deactivate - // HRESULT Deactivate( [in] HWND window ); - new void Deactivate([In] HWND window); - - /// Registers a dedicated thread for hit testing. - /// The handle of the main app window (typically created from the UI thread). - /// - /// The handle of the window in which hit testing is registered (should be created from the hit testing thread). Pass in nullptr to - /// unregister a previously registered hit-test target. - /// - /// - /// One of the values from DIRECTMANIPULATION_HITTEST_TYPE. Specifies whether the UI window or the hit testing window (or both) - /// receives the hit testing WM_POINTERDOWN message , and in what order. - /// - /// - /// - /// Hit testing is typically performed on the application UI thread. The application receives a WM_POINTERDOWN message on which - /// hit-testing is performed. If a manipulation is required, SetContact is called on one or more viewports. An application can use - /// the RegisterHitTestTarget method to delegate this hit-testing responsibility to a separate hit-testing thread. - /// - /// - /// Once a dedicated hit-test target is successfully registered, WM_POINTERDOWN messages are processed on the hit-testing thread. If - /// a manipulation, such as pan or zoom, is required, SetContact is called from this thread. - /// - /// - /// If SetContact is not called from the hit-testing thread, WM_POINTERDOWN messages may be processed on the UI thread, depending on - /// the DIRECTMANIPULATION_HITTEST_TYPE specified during registration. - /// - /// - /// If SetContact is not called by either the hit-test thread or the UI thread, Direct Manipulation ignores the input which is then - /// handled on the UI thread. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-registerhittesttarget - // HRESULT RegisterHitTestTarget( [in] HWND window, [in, optional] HWND hitTestWindow, [in] DIRECTMANIPULATION_HITTEST_TYPE type ); - new void RegisterHitTestTarget([In] HWND window, [In, Optional] HWND hitTestWindow, [In] DIRECTMANIPULATION_HITTEST_TYPE type); - - /// Passes keyboard and mouse messages to the manipulation manager on the app's UI thread. - /// The input message to process. - /// TRUE if no further processing should be done with this message; otherwise, FALSE. - /// - /// Call this method for mouse and keyboard input. - /// Examples - /// The following example shows how to pass messages to the manipulation manager. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-processinput - // HRESULT ProcessInput( [in] const MSG *message, [out, retval] BOOL *handled ); - new bool ProcessInput(in MSG message); - - /// Gets a pointer to an IDirectManipulationUpdateManager object that receives compositor updates. - /// IID to the interface. - /// Pointer to the new IDirectManipulationUpdateManager object. - /// - /// For the compositor to respond to update events from Direct Manipulation, you must associate IDirectManipulationUpdateManager to - /// an IDirectManipulationCompositor object during initialization. Use GetUpdateManager to obtain a pointer to a - /// IDirectManipulationUpdateManager object. Pass this pointer to the compositor using the SetUpdateManager method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-getupdatemanager - // HRESULT GetUpdateManager( [in] REFIID riid, [out, retval] void **object ); - new IDirectManipulationUpdateManager GetUpdateManager(in Guid riid); - - /// - /// The factory method that is used to create a new IDirectManipulationViewport object. - /// The viewport manages the interaction state and mapping of input to output actions. - /// - /// The frame info provider for the viewport. - /// The handle of the main app window to associate with the viewport. - /// IID to the interface. - /// The new IDirectManipulationViewport object. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createviewport - // HRESULT CreateViewport( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] HWND window, [in] REFIID riid, [out, - // retval] void **object ); - new IDirectManipulationViewport CreateViewport([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, [In] HWND window, in Guid riid); - - /// - /// The factory method that is used to create an instance of secondary content (such as a panning indicator) inside a viewport. - /// - /// - /// The frame info provider for the secondary content. This should match the frame info provider used to create the viewport. - /// - /// Class identifier (CLSID) of the secondary content. This ID specifies the content type. - /// IID of the interface. - /// The secondary content object that implements the specified interface. - /// - /// - /// Primary content is automatically created at the same time as the viewport and has a one-to-one relationship to a viewport. - /// Therefore, it is not possible to create, add, or remove primary content. - /// - /// - /// Secondary content is created independently from the viewport. There is no limit to how much secondary content can be added or - /// removed from a viewport. All secondary content transforms are derived from those supported by the primary content with specific - /// rules applied based on the intended purpose of the element (identified by its Class identifier (CLSID)). - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-createcontent - // HRESULT CreateContent( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo, [in] REFCLSID clsid, [in] REFIID riid, - // [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - new object CreateContent([In, Optional] IDirectManipulationFrameInfoProvider frameInfo, in Guid clsid, in Guid riid); - - /// Factory method to create a behavior. - /// CLSID of the behavior. The CLSID specifies the type of behavior. - /// The IID of the behavior interface to create. - /// The new behavior object that implements the specified interface. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager2-createbehavior - // HRESULT CreateBehavior( [in] REFCLSID clsid, [in] REFIID riid, [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - new object CreateBehavior(in Guid clsid, in Guid riid); - - /// Retrieves an IDirectManipulationDeferContactService object. - /// The IDirectManipulationDeferContactService CLSID. - /// The IID of the IDirectManipulationDeferContactService to retrieve. - /// The IDirectManipulationDeferContactService object. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager3-getservice - // HRESULT GetService( [in] REFCLSID clsid, [in] REFIID riid, [out, retval] void **object ); - [return: MarshalAs(UnmanagedType.IUnknown)] - object GetService(in Guid clsid, in Guid riid); - } - - /// - /// Encapsulates the primary content inside a viewport. Primary content is the content specified during the creation of a viewport. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationprimarycontent - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationPrimaryContent")] - [ComImport, Guid("C12851E4-1698-4625-B9B1-7CA3EC18630B"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationPrimaryContent))] - public interface IDirectManipulationPrimaryContent - { - /// Specifies snap points for the inertia end position at uniform intervals. - /// One of the DIRECTMANIPULATION_MOTION_TYPES enumeration values. - /// The interval between each snap point. - /// The offset from the coordinate specified in SetSnapCoordinate. - /// - /// Snap point locations are in content coordinate units. - /// Specify snap points through SetSnapPoints or SetSnapInterval. - /// - /// If snap points are invalid (for example, outside of the content boundaries), they are ignored and the content is always within - /// the content boundaries. - /// - /// - /// Snap points are not at boundaries by default. If you wish for content to stop at a boundary, a snap point must be set at the boundary. - /// - /// Snap points set by SetSnapInterval can be cleared by calling SetSnapInterval with an interval of 0.0f. - /// Examples - /// - /// The following example shows how to set the coordinate system for X translation snap points to the origin. Snap points are set - /// every 45 pixels, beginning at the origin along the X-axis. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setsnapinterval - // HRESULT SetSnapInterval( [in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] float interval, [in] float offset ); - void SetSnapInterval([In] DIRECTMANIPULATION_MOTION_TYPES motion, [In] float interval, [In] float offset); - - /// Specifies the snap points for the inertia rest position. - /// - /// One or more of the DIRECTMANIPULATION_MOTION_TYPES enumeration values. Only DIRECTMANIPULATION_MOTION_TRANSLATE_X, - /// DIRECTMANIPULATION_MOTION_TRANSLATE_Y, or DIRECTMANIPULATION_MOTION_ZOOM are allowed. - /// - /// - /// An array of snap points within the boundaries of the content to snap to. Should be specified in increasing order relative to the - /// origin set in SetSnapCoordinate. - /// - /// The size of the array of snap points. Should be greater than 0. - /// - /// If snap points are invalid (for example, outside of the content boundaries), they are ignored and the content is always within - /// the content boundaries. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setsnappoints - // HRESULT SetSnapPoints( [in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] const float *points, [in] DWORD pointCount ); - void SetSnapPoints([In] DIRECTMANIPULATION_MOTION_TYPES motion, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] float[] points, - uint pointCount); - - /// Specifies the type of snap point. - /// One or more of the DIRECTMANIPULATION_MOTION_TYPES enumeration values. - /// - /// One of the DIRECTMANIPULATION_SNAPPOINT_TYPE enumeration values. - /// - /// If set to DIRECTMANIPULATION_SNAPPOINT_TYPE_NONE, snap points specified through SetSnapPoints or SetSnapInterval are cleared. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setsnaptype - // HRESULT SetSnapType( [in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] DIRECTMANIPULATION_SNAPPOINT_TYPE type ); - void SetSnapType([In] DIRECTMANIPULATION_MOTION_TYPES motion, [In] DIRECTMANIPULATION_SNAPPOINT_TYPE type); - - /// Specifies the coordinate system for snap points or snap intervals. - /// One of the values from DIRECTMANIPULATION_MOTION_TYPES. - /// - /// One of the values from DIRECTMANIPULATION_SNAPPOINT_COORDINATE. - /// - /// If motion is set to translation ( DIRECTMANIPULATION_MOTION_TRANSLATEX or - /// DIRECTMANIPULATION_MOTION_TRANSLATEY), all values of DIRECTMANIPULATION_SNAPPOINT_COORDINATE are valid. - /// - /// - /// If motion is set to DIRECTMANIPULATION_MOTION_ZOOM, only DIRECTMANIPULATION_COORDINATE_ORIGIN of - /// DIRECTMANIPULATION_SNAPPOINT_COORDINATE is valid ( origin must be set to 0.0f). - /// - /// - /// - /// - /// The initial, or starting, snap point. All snap points are relative to this one. Only used when - /// DIRECTMANIPULATION_COORDINATE_ORIGIN is set. - /// - /// If motion is set to DIRECTMANIPULATION_MOTION_ZOOM, then origin must be set to 0.0f. - /// - /// - /// The origin is relative to the content boundaries. If no boundary has been set (SetContentRect is never called) the default - /// boundaries are (-FLT_MAX, FLT_MAX). - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setsnapcoordinate - // HRESULT SetSnapCoordinate( [in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate, - // [in] float origin ); - void SetSnapCoordinate([In] DIRECTMANIPULATION_MOTION_TYPES motion, [In] DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate, [In] float origin); - - /// Specifies the minimum and maximum boundaries for zoom. - /// The minimum zoom level allowed. Must be greater than or equal to 0.1f, which corresponds to 100% zoom. - /// The maximum zoom allowed. Must be greater than zoomMinimum and less than FLT_MAX. - /// - /// If the content is outside the new boundaries, and the viewport is ENABLED or READY, then the content is reset to be within the - /// new boundaries. If inertia configuration is enabled, the reset operation uses an inertia animation. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setzoomboundaries - // HRESULT SetZoomBoundaries( [in] float zoomMinimum, [in] float zoomMaximum ); - void SetZoomBoundaries([In] float zoomMinimum, [In] float zoomMaximum); - - /// Sets the horizontal alignment of the primary content relative to the viewport. - /// - /// One or more values from DIRECTMANIPULATION_HORIZONTALALIGNMENT. The default is DIRECTMANIPULATION_HORIZONTALALIGNMENT_NONE. - /// You cannot combine the following options: DIRECTMANIPULATION_HORIZONTALALIGNMENT_LEFT, - /// DIRECTMANIPULATION-HORIZONTALALIGNMENT_CENTER, DIRECTMANIPULATION_HORIZONTALALIGNMENT_RIGHT. - /// DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER can be combined with any option but cannot be configured by itself. - /// - /// - /// - /// If you have activated a configuration consisting only of zoom or zoom inertia, specify - /// DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER to respect the zoom center point. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-sethorizontalalignment - // HRESULT SetHorizontalAlignment( [in] DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment ); - void SetHorizontalAlignment([In] DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment); - - /// Specifies the vertical alignment of the primary content in the viewport. - /// - /// One or more values from DIRECTMANIPULATION_VERTICALALIGNMENT. - /// You cannot combine DIRECTMANIPULATION_VERTICALALIGNMENT_TOP, DIRECTMANIPULATION_VERTICALALIGNMENT_CENTER, or - /// DIRECTMANIPULATION_VERTICALALIGNMENT_BOTTOM. DIRECTMANIPULATION_VERTICALALIGNMENT_UNLOCKCENTER can be combined with - /// any option but cannot be configured by itself. - /// - /// - /// - /// If you have activated a configuration consisting only of zoom or zoom inertia, specify - /// DIRECTMANIPULATION_VERTICALALIGNMENT_UNLOCKCENTER to respect the zoom center point. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-setverticalalignment - // HRESULT SetVerticalAlignment( [in] DIRECTMANIPULATION_VERTICALALIGNMENT alignment ); - void SetVerticalAlignment([In] DIRECTMANIPULATION_VERTICALALIGNMENT alignment); - - /// Gets the final transform, including inertia, of the primary content. - /// The transformed matrix that represents the inertia ending position. - /// - /// The size of the matrix. - /// This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// Warning Calling this method can cause a race condition if inertia has ended or been interrupted. This can also occur - /// during the OnViewportStatusChanged callback. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-getinertiaendtransform - // HRESULT GetInertiaEndTransform( [out] float *matrix, [in] DWORD pointCount ); - void GetInertiaEndTransform([Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount = 6); - - /// - /// Retrieves the center point of the manipulation in content coordinates. If there is no manipulation in progress, retrieves the - /// center point of the viewport. - /// - /// The center on the horizontal axis. - /// The center on the vertical axis. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationprimarycontent-getcenterpoint - // HRESULT GetCenterPoint( [out] float *centerX, [out] float *centerY ); - void GetCenterPoint(out float centerX, out float centerY); - } - - /// - /// Defines methods for handling manipulation update events. - /// - /// Note When implementing a Direct Manipulation object, ensure that the IUnknown implementation supports multithreading through - /// thread-safe reference counting. For more information, see InterlockedIncrement and InterlockedDecrement. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationupdatehandler - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationUpdateHandler")] - [ComImport, Guid("790B6337-64F8-4FF5-A269-B32BC2AF27A7"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationUpdateHandler - { - /// Notifies the compositor when to update inertia animation. - /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationupdatehandler-update - // HRESULT Update(); - [PreserveSig] - HRESULT Update(); - } - - /// - /// Manages how compositor updates are sent to Direct Manipulation. - /// - /// This interface enables the compositor to trigger an update on Direct Manipulation whenever there is a compositor update. The - /// application should not call the methods of this interface directly. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationupdatemanager - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationUpdateManager")] - [ComImport, Guid("B0AE62FD-BE34-46E7-9CAA-D361FACBB9CC"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationUpdateManager))] - public interface IDirectManipulationUpdateManager - { - /// Registers a callback that is triggered by a handle. - /// The event handle that triggers the callback. - /// The event handler to call when the event is fired. - /// The unique ID of the event callback instance. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationupdatemanager-registerwaithandlecallback - // HRESULT RegisterWaitHandleCallback( [in] HANDLE handle, [in] IDirectManipulationUpdateHandler *eventHandler, [out] DWORD *cookie ); - void RegisterWaitHandleCallback([In] HANDLE handle, [In] IDirectManipulationUpdateHandler eventHandler, out uint cookie); - - /// Deregisters a callback. - /// The unique ID of the event callback instance. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationupdatemanager-unregisterwaithandlecallback - // HRESULT UnregisterWaitHandleCallback( [in] DWORD cookie ); - void UnregisterWaitHandleCallback(uint cookie); - - /// Updates Direct Manipulation at the current time. - /// - /// The frame info provider used to predict the position of the content and compensate for latency during composition. - /// - /// - /// If the application provides its own implementation of IDirectManipulationCompositor, this implementation should call - /// Update whenever there is a compositor update. Frame timing information can be provided to Direct Manipulation through the - /// IDirectManipulationFrameInfoProvider interface. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationupdatemanager-update - // HRESULT Update( [in, optional] IDirectManipulationFrameInfoProvider *frameInfo ); - void Update([In, Optional] IDirectManipulationFrameInfoProvider frameInfo); - } - - /// - /// Defines a region within a window (referred to as a viewport) that is able to receive and process input from user interactions. The - /// viewport contains content that moves in response to a user interaction. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationviewport - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationViewport")] - [ComImport, Guid("28b85a3d-60a0-48bd-9ba1-5ce8d9ea3a6d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(DirectManipulationViewport))] - public interface IDirectManipulationViewport - { - /// Starts or resumes input processing by the viewport. - /// - /// If the method succeeds, it returns S_OK, or S_FALSE if there is no work to do (for example, the viewport is already - /// enabled). Otherwise, it returns an HRESULT error code. - /// - /// - /// This method directs a viewport to attempt to respond to input. - /// Call this method if the AUTODISABLE option is set. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-enable - // HRESULT Enable(); - [PreserveSig] - HRESULT Enable(); - - /// Stops input processing by the viewport. - /// - /// When a viewport is disabled, it immediately stops all transforms and moves the content to the final location. - /// Call this method when you want to modify multiple attributes atomically. This method can be called at any time. - /// The viewport will not resume processing input until Enable is called. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-disable - // HRESULT Disable(); - void Disable(); - - /// Specifies an association between a contact and the viewport. - /// The ID of the pointer. - /// - /// - /// Call this method when a WM_POINTERDOWN message is received. Upon receiving a WM_POINTERDOWN, the application can use the - /// coordinates of the input to hit-test and determine the viewports to which the contact is associated. - /// - /// DeferContact must be called before SetContact. - /// - /// After initialization, Direct Manipulation is not aware of viewport z-order or parent-child relations between viewports. The order - /// of SetContact calls defines the viewport tree. To establish the correct viewport hierarchy, SetContact should be - /// called first on the child-most viewport, followed by the parent, grand-parent, and so on. - /// - /// - /// Use GET_POINTERID_WPARAM to get the pointer identifier from a pointer message. The contact is removed automatically when - /// WM_POINTERUP is received. - /// - /// - /// If a contact is associated with one or more viewports using the SetContact method, Direct Manipulation will examine - /// further input from that contact and attempt to identify an appropriate manipulation based on the configuration of the associated - /// viewports. If a manipulation is recognized, the application will then receive a WM_POINTERCAPTURECHANGED message for this - /// contact. In this context, the WM_POINTERCAPTURECHANGED message indicates that Direct Manipulation has captured the contact - /// and the application will not receive input from this contact that is consumed for this manipulation. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setcontact - // HRESULT SetContact( [in] UINT32 pointerId ); - void SetContact(uint pointerId); - - /// Removes a contact that is associated with a viewport. - /// The ID of the pointer. - /// - /// This method releases a contact from a specific Direct Manipulation viewport (equivalent to the user removing a touch point). - /// - /// The viewport state is not affected unless the last remaining contact on the viewport is removed, in which case the viewport will - /// transition to inertia, if supported. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-releasecontact - // HRESULT ReleaseContact( [in] UINT32 pointerId ); - void ReleaseContact(uint pointerId); - - /// Removes all contacts that are associated with the viewport. Inertia is started if the viewport supports inertia. - /// - /// - /// This is equivalent to calling ReleaseContact on every contact associated with the viewport. The outcome is equivalent to the user - /// removing all touch points from the viewport. - /// - /// If supported, inertia will be started after calling this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-releaseallcontacts - // HRESULT ReleaseAllContacts(); - void ReleaseAllContacts(); - - /// Gets the state of the viewport. - /// One of the values from DIRECTMANIPULATION_STATUS. - /// - /// This method returns the viewport state at the time of the call and not at the time when the return value is read. - /// This method will fail if called after Abandon. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getstatus - // HRESULT GetStatus( [out, retval] DIRECTMANIPULATION_STATUS *status ); - DIRECTMANIPULATION_STATUS GetStatus(); - - /// Gets the tag value of a viewport. - /// IID to the interface. - /// The object portion of the tag. - /// The identifier portion of the tag. - /// - /// - /// A tag is a pairing of an integer ID with a Component Object Model (COM) object. It can be used by an app to identify the viewport. - /// - /// The out parameters are optional, so the method can return an ID, the viewport object, or both. - /// Examples - /// The following example show how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-gettag - // HRESULT GetTag( [in] REFIID riid, [out, optional] void **object, [out, optional] UINT32 *id ); - void GetTag(in Guid riid, [Optional, MarshalAs(UnmanagedType.IUnknown)] out object @object, out uint id); - - /// Sets a viewport tag. - /// The object portion of the tag. - /// The ID portion of the tag. - /// - /// - /// A tag is a pairing of an integer ID with a Component Object Model (COM) object. It can be used by an app to identify the viewport. - /// - /// The object parameter is optional, so that the method can set just an ID. - /// Examples - /// The following example shows the syntax for this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-settag - // HRESULT SetTag( [in, optional] IUnknown *object, [in] UINT32 id ); - void SetTag([In, Optional, MarshalAs(UnmanagedType.IUnknown)] object @object, uint id); - - /// Retrieves the rectangle for the viewport relative to the origin of the viewport coordinate system specified by SetViewportRect. - /// The bounding rectangle relative to the viewport coordinate system. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getviewportrect - // HRESULT GetViewportRect( [out, retval] RECT *viewport ); - RECT GetViewportRect(); - - /// Sets the bounding rectangle for the viewport, relative to the origin of the viewport coordinate system. - /// The bounding rectangle. - /// - /// The viewport rectangle specifies the region of content that is visible to the user. In conjunction with the primary content - /// rectangle, the viewport rectangle is used to determine chaining behaviors. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewportrect - // HRESULT SetViewportRect( [in] const RECT *viewport ); - void SetViewportRect(in RECT viewport); - - /// Moves the viewport to a specific area of the primary content and specifies whether to animate the transition. - /// The leftmost coordinate of the rectangle in the primary content coordinate space. - /// The topmost coordinate of the rectangle in the primary content coordinate space. - /// The rightmost coordinate of the rectangle in the primary content coordinate space. - /// The bottommost coordinate of the rectangle in the primary content coordinate space. - /// Specifies whether to animate the zoom behavior. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-zoomtorect - // HRESULT ZoomToRect( [in] const float left, [in] const float top, [in] const float right, [in] const float bottom, [in] BOOL - // animate ); - void ZoomToRect([In] float left, [In] float top, [In] float right, [In] float bottom, bool animate); - - /// Specifies the transform from the viewport coordinate system to the window client coordinate system. - /// The transform matrix, in row-wise order: _11, _12, _21, _22, _31, _32. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// - /// Call this function to specify the viewport position, scaling and orientation on the screen. Viewport position, scaling, - /// orientation and size are uniquely determined by the viewport transform and the viewport rectangle. The application can specify - /// the viewport transform using this method, and the viewport rectangle using SetViewportRect. - /// - /// - /// The viewport rectangle (the rectangular area inside the content that is visible to the user) is specified in viewport - /// coordinates. If the viewport rectangle top-left point is (0,0), the viewport rectangle is positioned exactly at the viewport - /// coordinate system origin. Viewports offset from the viewport coordinate system origin can be specified in two ways: - /// - /// - /// - /// Through the viewport rectangle top-left point - /// - /// - /// Through the viewport transform translation component (_31, _32) - /// - /// - /// - /// The viewport transform converts from the viewport coordinate system to the window client coordinate system. Direct Manipulation - /// ignores the window RTL property, so the client area origin is always the top-left point. The transforms are applied in the - /// following order: - /// - /// - /// - /// Viewport rectangle offset - /// - /// - /// Viewport transform (from viewport to client coordinate system) - /// - /// - /// Client to screen mapping (from client to screen coordinate system) - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewporttransform - // HRESULT SetViewportTransform( [in] const float *matrix, [in] DWORD pointCount ); - void SetViewportTransform([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount); - - /// - /// Specifies a display transform for the viewport, and synchronizes the output transform with the new value of the display transform. - /// - /// The transform matrix, in row-wise order: _11, _12, _21, _22, _31, _32. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// - /// If the application performs special output processing of the content outside of the compositor (content not fully captured in the - /// viewport transform), it should call this method to specify the display transform for the special processing. - /// - /// - /// The display transform affects how manipulation updates are applied to the output transform. For example, if the display transform - /// is set to scale 3x, panning will move the content 3x the original distance. - /// - /// - /// When a display transform is changed using this method, the output transform will be synchronized to the new value of the display transform. - /// - /// This method cannot be called if the viewport status is DIRECTMANIPULATION_RUNNING or DIRECTMANIPULATION_INERTIA. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-syncdisplaytransform - // HRESULT SyncDisplayTransform( [in] const float *matrix, [in] DWORD pointCount ); - void SyncDisplayTransform([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount); - - /// - /// ***BAD FORMATTING - Params*** - /// Gets the primary content of a viewport that implements IDirectManipulationContent and IDirectManipulationPrimaryContent. - /// - /// Primary content is an element that gets transformed (e.g. moved, scaled, rotated) in response to a user interaction. Primary - /// content is created at the same time as the viewport and cannot be added or removed. - /// - /// - /// IID to the interface. - /// The primary content object. - /// - /// This method gets the content of the viewport that implements IDirectManipulationContent and IDirectManipulationPrimaryContent. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getprimarycontent - // HRESULT GetPrimaryContent( [in] REFIID riid, [out, retval] void **object ); - void GetPrimaryContent(in Guid riid, out IDirectManipulationPrimaryContent @object); - - /// Adds secondary content, such as a panning indicator, to a viewport. - /// The content to add to the viewport. - /// - /// Secondary content is created by calling CreateContent. Once added, the secondary content will move relative to the primary - /// content in response to a manipulation. Its motion is determined by rules associated with each type of secondary content. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addcontent - // HRESULT AddContent( [in] IDirectManipulationContent *content ); - void AddContent([In] IDirectManipulationContent content); - - /// Removes secondary content from a viewport. - /// The content object to remove. - /// Secondary content can be removed from the viewport at any time. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removecontent - // HRESULT RemoveContent( [in] IDirectManipulationContent *content ); - void RemoveContent([In] IDirectManipulationContent content); - - /// - /// Sets how the viewport handles input and output. - /// Calling this method overrides all settings previously specified with SetUpdateMode or SetInputMode. - /// - /// One or more of the values from DIRECTMANIPULATION_VIEWPORT_OPTIONS. - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewportoptions - // HRESULT SetViewportOptions( [in] DIRECTMANIPULATION_VIEWPORT_OPTIONS options ); - void SetViewportOptions([In] DIRECTMANIPULATION_VIEWPORT_OPTIONS options); - - /// Adds an interaction configuration for the viewport. - /// - /// One of the values from DIRECTMANIPULATION_CONFIGURATION that specifies the interaction configuration for the viewport. - /// - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which manipulations are supported. Any - /// number of possible configurations can be added to the viewport using AddConfiguration before processing input. - /// - /// Configurations can be switched by the application at runtime using ActivateConfiguration. - /// When a configuration is no longer required (and is not currently active), it can be removed using RemoveConfiguration. - /// - /// If a configuration has not been added using AddConfiguration, it can be automatically added and then activated by calling ActivateConfiguration. - /// - /// Note If input processing is occurring, this call will fail. - /// This method fails if a drag and drop behavior has been specified. - /// A drag and drop behavior object cannot be attached after successfully calling this method. - /// You cannot add another drag and drop behavior after an existing one has already been added. - /// - /// This method is designed to allow an application to switch pre-added configurations, as a configuration cannot be changed while a - /// manipulation is occurring. Under most circumstances it is better to update the configuration using ActivateConfiguration. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addconfiguration - // HRESULT AddConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - void AddConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Removes an interaction configuration for the viewport. - /// - /// One of the values from DIRECTMANIPULATION_CONFIGURATION that specifies the interaction configuration for the viewport. - /// - /// - /// - /// This method removes a possible configuration that was added by using AddConfiguration. This method can be called only if the - /// configuration is not active. - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which gestures are supported. Any number - /// of configurations can be added to the viewport using AddConfiguration. Configurations can be switched by the application at - /// runtime using ActivateConfiguration. When a configuration is no longer required (and is not currently active), it can be removed - /// using RemoveConfiguration. - /// - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removeconfiguration - // HRESULT RemoveConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - void RemoveConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Sets the configuration for input interaction. - /// - /// One or more values from DIRECTMANIPULATION_CONFIGURATION that specify the interaction configuration for the viewport. - /// - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which manipulations are supported. Any - /// number of possible configurations can be added to the viewport using AddConfiguration before processing input. - /// - /// Configurations can be switched by the application at runtime using ActivateConfiguration. - /// When a configuration is no longer required (and is not currently active), it can be removed using RemoveConfiguration. - /// - /// If a configuration has not been added using AddConfiguration, it can be automatically added and then activated by calling ActivateConfiguration. - /// - /// Note If input processing is occurring, this call will fail. - /// This method fails if a drag and drop behavior has been specified. - /// A drag and drop behavior object cannot be attached after successfully calling this method. - /// Examples - /// The following example shows how to configure a viewport for horizontal panning. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-activateconfiguration - // HRESULT ActivateConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - void ActivateConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Sets which gestures are ignored by Direct Manipulation. - /// One of the values from DIRECTMANIPULATION_GESTURE_CONFIGURATION. - /// - /// - /// Use this method to specify which gestures the application processes on the UI thread. If a gesture is recognized, it will be - /// passed to the application for processing and ignored by Direct Manipulation. - /// - /// Examples - /// - /// The following example shows how zoom gestures can be ignored by Direct Manipulation and handled by the application, which may - /// have custom zoom behavior implementation. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setmanualgesture - // HRESULT SetManualGesture( [in] DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration ); - void SetManualGesture([In] DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration); - - /// Specifies the motion types supported in a viewport that can be chained to a parent viewport. - /// - /// One of the values from DIRECTMANIPULATION_MOTION_TYPES that specifies the motion types that are enabled for this viewport. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setchaining - // HRESULT SetChaining( [in] DIRECTMANIPULATION_MOTION_TYPES enabledTypes ); - void SetChaining([In] DIRECTMANIPULATION_MOTION_TYPES enabledTypes); - - /// Adds a new event handler to listen for viewport events. - /// The handle of a window owned by the thread for the event callback. - /// - /// The handler that is called when viewport status and update events occur. The specified object must implement the - /// IDirectManipulationViewportEventHandler interface. - /// - /// The handle that represents this event handler callback. - /// - /// - /// The event callback is fired from the thread that owns the specified window. Consecutive events of the same callback method may be coalesced. - /// - /// Note If the viewport has a drag-drop behavior attached, the event handler should implement IDirectManipulationDragDropEventHandler. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addeventhandler - // HRESULT AddEventHandler( [in] HWND window, [in] IDirectManipulationViewportEventHandler *eventHandler, [out, retval] DWORD *cookie ); - void AddEventHandler([In, Optional] HWND window, [In] IDirectManipulationViewportEventHandler eventHandler, out uint cookie); - - /// Removes an existing event handler from the viewport. - /// A value that was returned by a previous call to AddEventHandler. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removeeventhandler - // HRESULT RemoveEventHandler( [in] DWORD cookie ); - void RemoveEventHandler(uint cookie); - - /// Specifies if input is visible to the UI thread. - /// One of the values from DIRECTMANIPULATION_INPUT_MODE. - /// - /// DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC is the default mode for Direct Manipulation. - /// - /// Direct Manipulation consumes all the input that drives the manipulation and the application receives WM_POINTERCAPTURECHANGED messages. - /// - /// - /// In some situations an application may want to receive input that is driving a manipulation. Set - /// DIRECTMANIPULATION_INPUT_MODE_MANUAL in this case. The application will receive all input messages, even input used by Direct - /// Manipulation to drive a manipulation. - /// - /// Note The application will not receive WM_POINTERCAPTURECHANGED messages. - /// - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling - /// SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). However, calling SetViewportOptions also overrides all - /// other settings. - /// - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setinputmode - // HRESULT SetInputMode( [in] DIRECTMANIPULATION_INPUT_MODE mode ); - void SetInputMode([In] DIRECTMANIPULATION_INPUT_MODE mode); - - /// Specifies whether a viewport updates content manually instead of during an input event. - /// One of the values from DIRECTMANIPULATION_INPUT_MODE. - /// - /// - /// DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC is the default mode for Direct Manipulation. In this mode, visual updates are pushed to - /// compositor driven by input. This is the expected mode of operation if the application is using system-provided implementation of IDirectManipulationCompositor. - /// - /// - /// If the application provides its own implementation of IDirectManipulationCompositor, it should switch viewport update mode to - /// manual by setting DIRECTMANIPULATION_INPUT_MODE_MANUAL. When in manual mode, the compositor pulls visual updates whenever it - /// calls Update on Direct Manipulation. - /// - /// - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling - /// SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). However, calling SetViewportOptions also overrides all - /// other settings. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setupdatemode - // HRESULT SetUpdateMode( [in] DIRECTMANIPULATION_INPUT_MODE mode ); - void SetUpdateMode([In] DIRECTMANIPULATION_INPUT_MODE mode); - - /// Stops the manipulation and returns the viewport to a ready state. - /// If a mandatory snap point has been configured, the content may animate to the nearest snap point. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-stop - // HRESULT Stop(); - void Stop(); - - /// Releases all resources that are used by the viewport and prepares it for destruction from memory. - /// - /// Once Abandon has been called, do not make subsequent function calls on the viewport. If a function is called after - /// Abandon, E_INVALID_STATE will be returned. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-abandon - // HRESULT Abandon(); - void Abandon(); - } - - /// - /// Provides management of behaviors on a viewport. A behavior affects the functionality of a particular part of the Direct Manipulation workflow. - /// - /// - /// IDirectManipulationViewport2 can be used in place of IDirectManipulationViewport. - /// Behaviors are created using IDirectManipulationManager2 and an appropriate class ID. - /// - /// A behavior can be attached or removed at any time and takes effect immediately (even during an active manipulation or inertia animation). - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationviewport2 - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationViewport2")] - [ComImport, Guid("923CCAAC-61E1-4385-B726-017AF189882A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationViewport2 : IDirectManipulationViewport - { - /// Starts or resumes input processing by the viewport. - /// - /// If the method succeeds, it returns S_OK, or S_FALSE if there is no work to do (for example, the viewport is already - /// enabled). Otherwise, it returns an HRESULT error code. - /// - /// - /// This method directs a viewport to attempt to respond to input. - /// Call this method if the AUTODISABLE option is set. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-enable - // HRESULT Enable(); - [PreserveSig] - new HRESULT Enable(); - - /// Stops input processing by the viewport. - /// - /// When a viewport is disabled, it immediately stops all transforms and moves the content to the final location. - /// Call this method when you want to modify multiple attributes atomically. This method can be called at any time. - /// The viewport will not resume processing input until Enable is called. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-disable - // HRESULT Disable(); - new void Disable(); - - /// Specifies an association between a contact and the viewport. - /// The ID of the pointer. - /// - /// - /// Call this method when a WM_POINTERDOWN message is received. Upon receiving a WM_POINTERDOWN, the application can use the - /// coordinates of the input to hit-test and determine the viewports to which the contact is associated. - /// - /// DeferContact must be called before SetContact. - /// - /// After initialization, Direct Manipulation is not aware of viewport z-order or parent-child relations between viewports. The order - /// of SetContact calls defines the viewport tree. To establish the correct viewport hierarchy, SetContact should be - /// called first on the child-most viewport, followed by the parent, grand-parent, and so on. - /// - /// - /// Use GET_POINTERID_WPARAM to get the pointer identifier from a pointer message. The contact is removed automatically when - /// WM_POINTERUP is received. - /// - /// - /// If a contact is associated with one or more viewports using the SetContact method, Direct Manipulation will examine - /// further input from that contact and attempt to identify an appropriate manipulation based on the configuration of the associated - /// viewports. If a manipulation is recognized, the application will then receive a WM_POINTERCAPTURECHANGED message for this - /// contact. In this context, the WM_POINTERCAPTURECHANGED message indicates that Direct Manipulation has captured the contact - /// and the application will not receive input from this contact that is consumed for this manipulation. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setcontact - // HRESULT SetContact( [in] UINT32 pointerId ); - new void SetContact(uint pointerId); - - /// Removes a contact that is associated with a viewport. - /// The ID of the pointer. - /// - /// This method releases a contact from a specific Direct Manipulation viewport (equivalent to the user removing a touch point). - /// - /// The viewport state is not affected unless the last remaining contact on the viewport is removed, in which case the viewport will - /// transition to inertia, if supported. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-releasecontact - // HRESULT ReleaseContact( [in] UINT32 pointerId ); - new void ReleaseContact(uint pointerId); - - /// Removes all contacts that are associated with the viewport. Inertia is started if the viewport supports inertia. - /// - /// - /// This is equivalent to calling ReleaseContact on every contact associated with the viewport. The outcome is equivalent to the user - /// removing all touch points from the viewport. - /// - /// If supported, inertia will be started after calling this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-releaseallcontacts - // HRESULT ReleaseAllContacts(); - new void ReleaseAllContacts(); - - /// Gets the state of the viewport. - /// One of the values from DIRECTMANIPULATION_STATUS. - /// - /// This method returns the viewport state at the time of the call and not at the time when the return value is read. - /// This method will fail if called after Abandon. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getstatus - // HRESULT GetStatus( [out, retval] DIRECTMANIPULATION_STATUS *status ); - new DIRECTMANIPULATION_STATUS GetStatus(); - - /// Gets the tag value of a viewport. - /// IID to the interface. - /// The object portion of the tag. - /// The identifier portion of the tag. - /// - /// - /// A tag is a pairing of an integer ID with a Component Object Model (COM) object. It can be used by an app to identify the viewport. - /// - /// The out parameters are optional, so the method can return an ID, the viewport object, or both. - /// Examples - /// The following example show how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-gettag - // HRESULT GetTag( [in] REFIID riid, [out, optional] void **object, [out, optional] UINT32 *id ); - new void GetTag(in Guid riid, [Optional, MarshalAs(UnmanagedType.IUnknown)] out object @object, out uint id); - - /// Sets a viewport tag. - /// The object portion of the tag. - /// The ID portion of the tag. - /// - /// - /// A tag is a pairing of an integer ID with a Component Object Model (COM) object. It can be used by an app to identify the viewport. - /// - /// The object parameter is optional, so that the method can set just an ID. - /// Examples - /// The following example shows the syntax for this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-settag - // HRESULT SetTag( [in, optional] IUnknown *object, [in] UINT32 id ); - new void SetTag([In, Optional, MarshalAs(UnmanagedType.IUnknown)] object @object, uint id); - - /// Retrieves the rectangle for the viewport relative to the origin of the viewport coordinate system specified by SetViewportRect. - /// The bounding rectangle relative to the viewport coordinate system. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getviewportrect - // HRESULT GetViewportRect( [out, retval] RECT *viewport ); - new RECT GetViewportRect(); - - /// Sets the bounding rectangle for the viewport, relative to the origin of the viewport coordinate system. - /// The bounding rectangle. - /// - /// The viewport rectangle specifies the region of content that is visible to the user. In conjunction with the primary content - /// rectangle, the viewport rectangle is used to determine chaining behaviors. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewportrect - // HRESULT SetViewportRect( [in] const RECT *viewport ); - new void SetViewportRect(in RECT viewport); - - /// Moves the viewport to a specific area of the primary content and specifies whether to animate the transition. - /// The leftmost coordinate of the rectangle in the primary content coordinate space. - /// The topmost coordinate of the rectangle in the primary content coordinate space. - /// The rightmost coordinate of the rectangle in the primary content coordinate space. - /// The bottommost coordinate of the rectangle in the primary content coordinate space. - /// Specifies whether to animate the zoom behavior. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-zoomtorect - // HRESULT ZoomToRect( [in] const float left, [in] const float top, [in] const float right, [in] const float bottom, [in] BOOL - // animate ); - new void ZoomToRect([In] float left, [In] float top, [In] float right, [In] float bottom, bool animate); - - /// Specifies the transform from the viewport coordinate system to the window client coordinate system. - /// The transform matrix, in row-wise order: _11, _12, _21, _22, _31, _32. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// - /// Call this function to specify the viewport position, scaling and orientation on the screen. Viewport position, scaling, - /// orientation and size are uniquely determined by the viewport transform and the viewport rectangle. The application can specify - /// the viewport transform using this method, and the viewport rectangle using SetViewportRect. - /// - /// - /// The viewport rectangle (the rectangular area inside the content that is visible to the user) is specified in viewport - /// coordinates. If the viewport rectangle top-left point is (0,0), the viewport rectangle is positioned exactly at the viewport - /// coordinate system origin. Viewports offset from the viewport coordinate system origin can be specified in two ways: - /// - /// - /// - /// Through the viewport rectangle top-left point - /// - /// - /// Through the viewport transform translation component (_31, _32) - /// - /// - /// - /// The viewport transform converts from the viewport coordinate system to the window client coordinate system. Direct Manipulation - /// ignores the window RTL property, so the client area origin is always the top-left point. The transforms are applied in the - /// following order: - /// - /// - /// - /// Viewport rectangle offset - /// - /// - /// Viewport transform (from viewport to client coordinate system) - /// - /// - /// Client to screen mapping (from client to screen coordinate system) - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewporttransform - // HRESULT SetViewportTransform( [in] const float *matrix, [in] DWORD pointCount ); - new void SetViewportTransform([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount); - - /// - /// Specifies a display transform for the viewport, and synchronizes the output transform with the new value of the display transform. - /// - /// The transform matrix, in row-wise order: _11, _12, _21, _22, _31, _32. - /// - /// The size of the transform matrix. This value is always 6, because a 3x2 matrix is used for all direct manipulation transforms. - /// - /// - /// - /// If the application performs special output processing of the content outside of the compositor (content not fully captured in the - /// viewport transform), it should call this method to specify the display transform for the special processing. - /// - /// - /// The display transform affects how manipulation updates are applied to the output transform. For example, if the display transform - /// is set to scale 3x, panning will move the content 3x the original distance. - /// - /// - /// When a display transform is changed using this method, the output transform will be synchronized to the new value of the display transform. - /// - /// This method cannot be called if the viewport status is DIRECTMANIPULATION_RUNNING or DIRECTMANIPULATION_INERTIA. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-syncdisplaytransform - // HRESULT SyncDisplayTransform( [in] const float *matrix, [in] DWORD pointCount ); - new void SyncDisplayTransform([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] matrix, uint pointCount); - - /// - /// ***BAD FORMATTING - Params*** - /// Gets the primary content of a viewport that implements IDirectManipulationContent and IDirectManipulationPrimaryContent. - /// - /// Primary content is an element that gets transformed (e.g. moved, scaled, rotated) in response to a user interaction. Primary - /// content is created at the same time as the viewport and cannot be added or removed. - /// - /// - /// IID to the interface. - /// The primary content object. - /// - /// This method gets the content of the viewport that implements IDirectManipulationContent and IDirectManipulationPrimaryContent. - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-getprimarycontent - // HRESULT GetPrimaryContent( [in] REFIID riid, [out, retval] void **object ); - new void GetPrimaryContent(in Guid riid, out IDirectManipulationPrimaryContent @object); - - /// Adds secondary content, such as a panning indicator, to a viewport. - /// The content to add to the viewport. - /// - /// Secondary content is created by calling CreateContent. Once added, the secondary content will move relative to the primary - /// content in response to a manipulation. Its motion is determined by rules associated with each type of secondary content. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addcontent - // HRESULT AddContent( [in] IDirectManipulationContent *content ); - new void AddContent([In] IDirectManipulationContent content); - - /// Removes secondary content from a viewport. - /// The content object to remove. - /// Secondary content can be removed from the viewport at any time. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removecontent - // HRESULT RemoveContent( [in] IDirectManipulationContent *content ); - new void RemoveContent([In] IDirectManipulationContent content); - - /// - /// Sets how the viewport handles input and output. - /// Calling this method overrides all settings previously specified with SetUpdateMode or SetInputMode. - /// - /// One or more of the values from DIRECTMANIPULATION_VIEWPORT_OPTIONS. - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setviewportoptions - // HRESULT SetViewportOptions( [in] DIRECTMANIPULATION_VIEWPORT_OPTIONS options ); - new void SetViewportOptions([In] DIRECTMANIPULATION_VIEWPORT_OPTIONS options); - - /// Adds an interaction configuration for the viewport. - /// - /// One of the values from DIRECTMANIPULATION_CONFIGURATION that specifies the interaction configuration for the viewport. - /// - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which manipulations are supported. Any - /// number of possible configurations can be added to the viewport using AddConfiguration before processing input. - /// - /// Configurations can be switched by the application at runtime using ActivateConfiguration. - /// When a configuration is no longer required (and is not currently active), it can be removed using RemoveConfiguration. - /// - /// If a configuration has not been added using AddConfiguration, it can be automatically added and then activated by calling ActivateConfiguration. - /// - /// Note If input processing is occurring, this call will fail. - /// This method fails if a drag and drop behavior has been specified. - /// A drag and drop behavior object cannot be attached after successfully calling this method. - /// You cannot add another drag and drop behavior after an existing one has already been added. - /// - /// This method is designed to allow an application to switch pre-added configurations, as a configuration cannot be changed while a - /// manipulation is occurring. Under most circumstances it is better to update the configuration using ActivateConfiguration. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addconfiguration - // HRESULT AddConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - new void AddConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Removes an interaction configuration for the viewport. - /// - /// One of the values from DIRECTMANIPULATION_CONFIGURATION that specifies the interaction configuration for the viewport. - /// - /// - /// - /// This method removes a possible configuration that was added by using AddConfiguration. This method can be called only if the - /// configuration is not active. - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which gestures are supported. Any number - /// of configurations can be added to the viewport using AddConfiguration. Configurations can be switched by the application at - /// runtime using ActivateConfiguration. When a configuration is no longer required (and is not currently active), it can be removed - /// using RemoveConfiguration. - /// - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removeconfiguration - // HRESULT RemoveConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - new void RemoveConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Sets the configuration for input interaction. - /// - /// One or more values from DIRECTMANIPULATION_CONFIGURATION that specify the interaction configuration for the viewport. - /// - /// - /// - /// An interaction configuration specifies how the manipulation engine responds to input and which manipulations are supported. Any - /// number of possible configurations can be added to the viewport using AddConfiguration before processing input. - /// - /// Configurations can be switched by the application at runtime using ActivateConfiguration. - /// When a configuration is no longer required (and is not currently active), it can be removed using RemoveConfiguration. - /// - /// If a configuration has not been added using AddConfiguration, it can be automatically added and then activated by calling ActivateConfiguration. - /// - /// Note If input processing is occurring, this call will fail. - /// This method fails if a drag and drop behavior has been specified. - /// A drag and drop behavior object cannot be attached after successfully calling this method. - /// Examples - /// The following example shows how to configure a viewport for horizontal panning. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-activateconfiguration - // HRESULT ActivateConfiguration( [in] DIRECTMANIPULATION_CONFIGURATION configuration ); - new void ActivateConfiguration([In] DIRECTMANIPULATION_CONFIGURATION configuration); - - /// Sets which gestures are ignored by Direct Manipulation. - /// One of the values from DIRECTMANIPULATION_GESTURE_CONFIGURATION. - /// - /// - /// Use this method to specify which gestures the application processes on the UI thread. If a gesture is recognized, it will be - /// passed to the application for processing and ignored by Direct Manipulation. - /// - /// Examples - /// - /// The following example shows how zoom gestures can be ignored by Direct Manipulation and handled by the application, which may - /// have custom zoom behavior implementation. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setmanualgesture - // HRESULT SetManualGesture( [in] DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration ); - new void SetManualGesture([In] DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration); - - /// Specifies the motion types supported in a viewport that can be chained to a parent viewport. - /// - /// One of the values from DIRECTMANIPULATION_MOTION_TYPES that specifies the motion types that are enabled for this viewport. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setchaining - // HRESULT SetChaining( [in] DIRECTMANIPULATION_MOTION_TYPES enabledTypes ); - new void SetChaining([In] DIRECTMANIPULATION_MOTION_TYPES enabledTypes); - - /// Adds a new event handler to listen for viewport events. - /// The handle of a window owned by the thread for the event callback. - /// - /// The handler that is called when viewport status and update events occur. The specified object must implement the - /// IDirectManipulationViewportEventHandler interface. - /// - /// The handle that represents this event handler callback. - /// - /// - /// The event callback is fired from the thread that owns the specified window. Consecutive events of the same callback method may be coalesced. - /// - /// Note If the viewport has a drag-drop behavior attached, the event handler should implement IDirectManipulationDragDropEventHandler. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-addeventhandler - // HRESULT AddEventHandler( [in] HWND window, [in] IDirectManipulationViewportEventHandler *eventHandler, [out, retval] DWORD *cookie ); - new void AddEventHandler([In, Optional] HWND window, [In] IDirectManipulationViewportEventHandler eventHandler, out uint cookie); - - /// Removes an existing event handler from the viewport. - /// A value that was returned by a previous call to AddEventHandler. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-removeeventhandler - // HRESULT RemoveEventHandler( [in] DWORD cookie ); - new void RemoveEventHandler(uint cookie); - - /// Specifies if input is visible to the UI thread. - /// One of the values from DIRECTMANIPULATION_INPUT_MODE. - /// - /// DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC is the default mode for Direct Manipulation. - /// - /// Direct Manipulation consumes all the input that drives the manipulation and the application receives WM_POINTERCAPTURECHANGED messages. - /// - /// - /// In some situations an application may want to receive input that is driving a manipulation. Set - /// DIRECTMANIPULATION_INPUT_MODE_MANUAL in this case. The application will receive all input messages, even input used by Direct - /// Manipulation to drive a manipulation. - /// - /// Note The application will not receive WM_POINTERCAPTURECHANGED messages. - /// - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling - /// SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). However, calling SetViewportOptions also overrides all - /// other settings. - /// - /// Examples - /// The following example shows how to use this method. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setinputmode - // HRESULT SetInputMode( [in] DIRECTMANIPULATION_INPUT_MODE mode ); - new void SetInputMode([In] DIRECTMANIPULATION_INPUT_MODE mode); - - /// Specifies whether a viewport updates content manually instead of during an input event. - /// One of the values from DIRECTMANIPULATION_INPUT_MODE. - /// - /// - /// DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC is the default mode for Direct Manipulation. In this mode, visual updates are pushed to - /// compositor driven by input. This is the expected mode of operation if the application is using system-provided implementation of IDirectManipulationCompositor. - /// - /// - /// If the application provides its own implementation of IDirectManipulationCompositor, it should switch viewport update mode to - /// manual by setting DIRECTMANIPULATION_INPUT_MODE_MANUAL. When in manual mode, the compositor pulls visual updates whenever it - /// calls Update on Direct Manipulation. - /// - /// - /// Calling this method with DIRECTMANIPULATION_INPUT_MODE_MANUAL set is similar to calling - /// SetViewportOptions(DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT). However, calling SetViewportOptions also overrides all - /// other settings. - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-setupdatemode - // HRESULT SetUpdateMode( [in] DIRECTMANIPULATION_INPUT_MODE mode ); - new void SetUpdateMode([In] DIRECTMANIPULATION_INPUT_MODE mode); - - /// Stops the manipulation and returns the viewport to a ready state. - /// If a mandatory snap point has been configured, the content may animate to the nearest snap point. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-stop - // HRESULT Stop(); - new void Stop(); - - /// Releases all resources that are used by the viewport and prepares it for destruction from memory. - /// - /// Once Abandon has been called, do not make subsequent function calls on the viewport. If a function is called after - /// Abandon, E_INVALID_STATE will be returned. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport-abandon - // HRESULT Abandon(); - new void Abandon(); - - /// Adds a behavior to the viewport and returns a cookie to the caller. - /// A behavior created using the CreateBehavior method. - /// - /// A cookie is returned so the caller can remove this behavior later. This allows the caller to release any reference on the - /// behavior and let Direct Manipulation maintain an appropriate lifetime, similar to event handlers. - /// - /// - /// A behavior takes effect immediately after AddBehavior is called. This must be considered when adding a behavior during an - /// active manipulation or inertia phase. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport2-addbehavior - // HRESULT AddBehavior( [in] IUnknown *behavior, [out, retval] DWORD *cookie ); - void AddBehavior([In, MarshalAs(UnmanagedType.IUnknown)] object behavior, out uint cookie); - - /// Removes a behavior from the viewport that matches the given cookie. - /// A valid cookie returned from the AddBehavior call on the same viewport. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport2-removebehavior - // HRESULT RemoveBehavior( [in] DWORD cookie ); - void RemoveBehavior(uint cookie); - - /// Removes all behaviors added to the viewport. - /// - /// RemoveAllBehaviors only returns an error if the removal of a behavior from the viewport was unsuccessful. In the event - /// that a specific behavior is not removed successfully, RemoveAllBehaviors removes all remaining behaviors. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewport2-removeallbehaviors - // HRESULT RemoveAllBehaviors(); - void RemoveAllBehaviors(); - } - - /// - /// Defines methods for handling status and update events for the viewport. - /// - /// Note When implementing a Direct Manipulation object, ensure that the IUnknown implementation supports multithreading through - /// thread-safe reference counting. For more information, see InterlockedIncrement and InterlockedDecrement. - /// - /// - /// - /// Client apps implement this handler to receive status and update events for viewports. Use AddEventHandler to set the handler for a - /// viewport. Each viewport can have more than one handler. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nn-directmanipulation-idirectmanipulationviewporteventhandler - [PInvokeData("directmanipulation.h", MSDNShortId = "NN:directmanipulation.IDirectManipulationViewportEventHandler")] - [ComImport, Guid("952121DA-D69F-45F9-B0F9-F23944321A6D"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IDirectManipulationViewportEventHandler - { - /// Called when the status of a viewport changes. - /// The viewport for which status has changed. - /// The new status of the viewport. - /// The previous status of the viewport. - /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - /// - /// If you call GetStatus from within this handler, the status returned is not guaranteed to be the same as at the time of the call. - /// This is because of the asynchronous nature of the notification. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewporteventhandler-onviewportstatuschanged - // HRESULT OnViewportStatusChanged( [in] IDirectManipulationViewport *viewport, [in] DIRECTMANIPULATION_STATUS current, [in] - // DIRECTMANIPULATION_STATUS previous ); - [PreserveSig] - HRESULT OnViewportStatusChanged([In] IDirectManipulationViewport viewport, [In] DIRECTMANIPULATION_STATUS current, [In] DIRECTMANIPULATION_STATUS previous); - - /// Called after all content in the viewport has been updated. - /// The viewport that has been updated. - /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - /// - /// If you have actions that need to be executed once for a viewport update, implement OnViewportUpdated. OnContentUpdated is - /// called once for each content change in the viewport. This can result in multiple OnContentUpdated calls. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewporteventhandler-onviewportupdated - // HRESULT OnViewportUpdated( [in] IDirectManipulationViewport *viewport ); - [PreserveSig] - HRESULT OnViewportUpdated([In] IDirectManipulationViewport viewport); - - /// Called when content inside a viewport is updated. - /// The viewport that is updated. - /// The content in the viewport that has changed. - /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. - /// - /// - /// This method is called once for each content change in the viewport. This can result in multiple OnContentUpdated calls. - /// For instance, when the position of the content is changed, you can use IDirectManipualtionContent::GetContentTransform to - /// retrieve the new value. - /// - /// If you have actions that need to be executed once for a viewport update, implement OnViewportUpdated. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationviewporteventhandler-oncontentupdated - // HRESULT OnContentUpdated( [in] IDirectManipulationViewport *viewport, [in] IDirectManipulationContent *content ); - [PreserveSig] - HRESULT OnContentUpdated([In] IDirectManipulationViewport viewport, [In] IDirectManipulationContent content); - } - - /// Retrieves the transform applied to the content. - /// A IDirectManipulationContent instance. - /// The transform matrix. - /// - /// This transform contains the default overpan and bounce curves during manipulation and inertia. - /// This transform does not contain the sync transform set with SyncContentTransform. - /// - public static float[] GetContentTransform(this IDirectManipulationContent obj) - { - float[] f = new float[6]; - obj.GetContentTransform(f); - return f; - } - - /// Gets the final transform, including inertia, of the primary content. - /// The IDirectManipulationPrimaryContent object. - /// The transformed matrix that represents the inertia ending position. - /// - /// Warning Calling this method can cause a race condition if inertia has ended or been interrupted. This can also occur during - /// the OnViewportStatusChanged callback. - /// - public static float[] GetInertiaEndTransform(this IDirectManipulationPrimaryContent obj) - { - float[] f = new float[6]; - obj.GetInertiaEndTransform(f); - return f; - } - - /// Gets the final transform applied to the content. - /// A IDirectManipulationContent instance. - /// The transform matrix. - /// - /// This transform might contain the other custom curves applied during manipulation and inertia. - /// This transform contains both the content transform and the sync transform set with SyncContentTransform. - /// - public static float[] GetOutputTransform(this IDirectManipulationContent obj) - { - float[] f = new float[6]; - obj.GetOutputTransform(f); - return f; - } - - /// Retrieves the tag object set on this content. - /// A reference to the identifier of the interface to use. The tag object typically implements this interface. - /// A IDirectManipulationContent instance. - /// The tag object. - /// The ID portion of the tag. - /// - /// - /// GetTag and SetTag are useful for associating an external COM object with the content without an external mapping between the - /// two. They can also be used to pass information to callbacks generated for the content. - /// - /// GetTag queries the tag value for the specified interface and returns a pointer to that interface. - /// - /// A tag is a pairing of an integer ID ( id) with a Component Object Model (COM) object ( object). It can be used by an - /// app to identify a motion. The parameters are optional, so that the method can return both parts of the tag, the identifier portion, - /// or the tag object. - /// - /// Examples - /// The following example shows the syntax for this method. - /// - public static void GetTag(this IDirectManipulationContent obj, out T @object, out uint id) where T : class - { - obj.GetTag(typeof(T).GUID, out object o, out id); - @object = (T)o; - } - - /// Retrieves the viewport that contains the content. - /// A reference to the identifier of the interface to use. - /// A IDirectManipulationContent instance. - /// The viewport object. - public static T GetViewport(this IDirectManipulationContent obj) where T : class => (T)obj.GetViewport(typeof(T).GUID); - - /// CLSID_DCompManipulationCompositor - [ComImport, Guid("79DEA627-A08A-43AC-8EF5-6900B9299126"), ClassInterface(ClassInterfaceType.None)] - public class DCompManipulationCompositor { } - - /// CLSID_DirectManipulationManager - [ComImport, Guid("54E211B6-3650-4F75-8334-FA359598E1C5"), ClassInterface(ClassInterfaceType.None)] - public class DirectManipulationManager { } - - /// CLSID_DirectManipulationPrimaryContent - [ComImport, Guid("CAA02661-D59E-41C7-8393-3BA3BACB6B57"), ClassInterface(ClassInterfaceType.None)] - public class DirectManipulationPrimaryContent { } - - /// CLSID_DirectManipulationSharedManager - [ComImport, Guid("99793286-77CC-4B57-96DB-3B354F6F9FB5"), ClassInterface(ClassInterfaceType.None)] - public class DirectManipulationSharedManager { } - - /// CLSID_DirectManipulationUpdateManager - [ComImport, Guid("9FC1BFD5-1835-441A-B3B1-B6CC74B727D0"), ClassInterface(ClassInterfaceType.None)] - public class DirectManipulationUpdateManager { } - - /// CLSID_DirectManipulationViewport - [ComImport, Guid("34E211B6-3650-4F75-8334-FA359598E1C5"), ClassInterface(ClassInterfaceType.None)] - public class DirectManipulationViewport { } -} \ No newline at end of file diff --git a/PInvoke/DirectManipulation/DirectManipulation.cs b/PInvoke/DirectManipulation/DirectManipulation.cs deleted file mode 100644 index ffc458c0..00000000 --- a/PInvoke/DirectManipulation/DirectManipulation.cs +++ /dev/null @@ -1,817 +0,0 @@ -using System; - -namespace Vanara.PInvoke; - -/// Items from the DirectManipulation.dll. -public static partial class DirectManipulation -{ - /// Specifies a psuedo-pointer ID for emulating a touch contact through keyboard input. - public const uint DIRECTMANIPULATION_KEYBOARDFOCUS = 0xFFFFFFFE; - - /// Specifies the minimum permitted zoom boundary of 10%. - public const float DIRECTMANIPULATION_MINIMUM_ZOOM = 0.1f; - - /// Specifies a psuedo-pointer ID for emulating a touch contact through mouse input. - public const uint DIRECTMANIPULATION_MOUSEFOCUS = 0xfffffffd; - - /// Autoscroll Behavior. Enables content to automatically scroll as it approaches the boundary of a given axis. - public static readonly Guid CLSID_AutoScrollBehavior = new(0x26126a51, 0x3c70, 0x4c9a, 0xae, 0xc2, 0x94, 0x88, 0x49, 0xee, 0xb0, 0x93); - - /// Contact deferral behavior. The amount of time (in millliseconds) to wait before calling SetContact. - public static readonly Guid CLSID_DeferContactService = new(0xd7b67cf4, 0x84bb, 0x434e, 0x86, 0xae, 0x65, 0x92, 0xbb, 0xc9, 0xab, 0xd9); - - /// Drag & Drop Behavior. Enables items to be selected and dragged. - public static readonly Guid CLSID_DragDropConfigurationBehavior = new(0x09b01b3e, 0xba6c, 0x454d, 0x82, 0xe8, 0x95, 0xe3, 0x52, 0x32, 0x9f, 0x23); - - /// Horizontal Panning Indicator. A visual element that shows your current position in content that extends off-screen horizontally. - public static readonly Guid CLSID_HorizontalIndicatorContent = new(0xe7d18cf5, 0x3ec7, 0x44d5, 0xa7, 0x6b, 0x37, 0x70, 0xf3, 0xcf, 0x90, 0x3d); - - /// Vertical Panning Indicator. A visual element that shows your current position in content that extends off-screen vertically. - public static readonly Guid CLSID_VerticalIndicatorContent = new(0xa10b5f17, 0xafe0, 0x4aa2, 0x91, 0xe9, 0x3e, 0x70, 0x1, 0xd2, 0xe6, 0xb4); - - /// Virtual Viewport. A virtual viewport can be used to respect fixed position elements for viewports with zoom configured. - public static readonly Guid CLSID_VirtualViewportContent = new(0x3206a19a, 0x86f0, 0x4cb4, 0xa7, 0xf3, 0x16, 0xe3, 0xb7, 0xe2, 0xd8, 0x52); - - private const string Lib_DirectManipulation = "DirectManipulation.dll"; - - /// Determines the type and direction of automatic scrolling animation to apply. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_autoscroll_configuration - // typedef enum DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION { DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_STOP = 0, - // DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_FORWARD = 1, DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_REVERSE = 2 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION")] - public enum DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION - { - /// - /// Value: - /// 0 - /// If content is scrolling, slowly stop along the direction of the motion. - /// - DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_STOP, - - /// - /// Value: - /// 1 - /// Scroll towards the positive boundary of the content. - /// - DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_FORWARD, - - /// - /// Value: - /// 2 - /// Scroll towards the origin of the content. - /// - DIRECTMANIPULATION_AUTOSCROLL_CONFIGURATION_REVERSE, - } - - /// Defines the interaction configuration states available in Direct Manipulation. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_configuration typedef - // enum DIRECTMANIPULATION_CONFIGURATION { DIRECTMANIPULATION_CONFIGURATION_NONE = 0, DIRECTMANIPULATION_CONFIGURATION_INTERACTION = 0x1, - // DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X = 0x2, DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y = 0x4, - // DIRECTMANIPULATION_CONFIGURATION_SCALING = 0x10, DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_INERTIA = 0x20, - // DIRECTMANIPULATION_CONFIGURATION_SCALING_INERTIA = 0x80, DIRECTMANIPULATION_CONFIGURATION_RAILS_X = 0x100, - // DIRECTMANIPULATION_CONFIGURATION_RAILS_Y = 0x200 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_CONFIGURATION")] - [Flags] - public enum DIRECTMANIPULATION_CONFIGURATION - { - /// - /// Value: - /// 0 - /// No interaction is defined. - /// - DIRECTMANIPULATION_CONFIGURATION_NONE = 0x0, - - /// - /// Value: - /// 0x1 - /// An interaction is defined. To enable interactions, this value must be included. - /// Required when setting a configuration other than - /// DIRECTMANIPULATION_CONFIGURATION_NONE - /// . - /// - DIRECTMANIPULATION_CONFIGURATION_INTERACTION = 0x1, - - /// - /// Value: - /// 0x2 - /// Translation in the horizontal axis. - /// - DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X = 0x2, - - /// - /// Value: - /// 0x4 - /// Translation in the vertical axis. - /// - DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y = 0x4, - - /// - /// Value: - /// 0x10 - /// Zoom. - /// - DIRECTMANIPULATION_CONFIGURATION_SCALING = 0x10, - - /// - /// Value: - /// 0x20 - /// Inertia for translation as defined by - /// DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X - /// and - /// DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y - /// . - /// - DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_INERTIA = 0x20, - - /// - /// Value: - /// 0x80 - /// Inertia for zoom as defined by - /// DIRECTMANIPULATION_CONFIGURATION _SCALING - /// . - /// - DIRECTMANIPULATION_CONFIGURATION_SCALING_INERTIA = 0x80, - - /// - /// Value: - /// 0x100 - /// Rails on the horizontal axis. - /// - DIRECTMANIPULATION_CONFIGURATION_RAILS_X = 0x100, - - /// - /// Value: - /// 0x200 - /// Rails on the vertical axis. - /// - DIRECTMANIPULATION_CONFIGURATION_RAILS_Y = 0x200, - } - - /// Defines behaviors for the drag-drop interaction. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_drag_drop_configuration - // typedef enum DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION { DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_VERTICAL = 0x1, - // DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HORIZONTAL = 0x2, DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_ONLY = 0x10, - // DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_DRAG = 0x20, DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HOLD_DRAG = 0x40 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION")] - [Flags] - public enum DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION - { - /// - /// Value: - /// 0x1 - /// Specifies that vertical movement is applicable to the chosen gesture. - /// - DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_VERTICAL = 0x1, - - /// - /// Value: - /// 0x2 - /// Specifies that horizontal movement is applicable to the chosen gesture. - /// - DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HORIZONTAL = 0x2, - - /// - /// Value: - /// 0x10 - /// Specifies that the gesture is to be cross-slide only. - /// - DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_ONLY = 0x10, - - /// - /// Value: - /// 0x20 - /// Specifies that the gesture is a drag initiated by cross-slide. - /// - DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_SELECT_DRAG = 0x20, - - /// - /// Value: - /// 0x40 - /// Specifies that the gesture a drag initiated by press-and-hold. - /// - DIRECTMANIPULATION_DRAG_DROP_CONFIGURATION_HOLD_DRAG = 0x40, - } - - /// Defines the drag-and-drop interaction states for the viewport. - /// - /// - /// For each interaction, the status always starts at DIRECTMANIPULATION_DRAG_DROP_READY and ends at either - /// DIRECTMANIPULATION_DRAG_DROP_CANCELLED or DIRECTMANIPULATION_DRAG_DROP_COMMITTED. There are no explicit callbacks for - /// the transition from CANCELLED/COMMITTED to READY. - /// - /// The meaning of the CANCELLED and COMMITTED values depend on the previous status. - /// - /// - /// - /// For DIRECTMANIPULATION_DRAG_DROP_PRESELECT, they mean the same thing: the content goes back to the original location and no - /// other actions should be taken. - /// - /// - /// - /// - /// FOR DIRECTMANIPULATION_DRAG_DROP_SELECTING, COMMITTED means apply the selection change; CANCELLED means avoid the selection change. - /// - /// - /// - /// - /// For DIRECTMANIPULATION_DRAG_DROP_DRAGGING, COMMITTED means perform the drop action; CANCELLED means cancel the drop action. - /// - /// - /// - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_drag_drop_status - // typedef enum DIRECTMANIPULATION_DRAG_DROP_STATUS { DIRECTMANIPULATION_DRAG_DROP_READY = 0, DIRECTMANIPULATION_DRAG_DROP_PRESELECT = 1, - // DIRECTMANIPULATION_DRAG_DROP_SELECTING = 2, DIRECTMANIPULATION_DRAG_DROP_DRAGGING = 3, DIRECTMANIPULATION_DRAG_DROP_CANCELLED = 4, - // DIRECTMANIPULATION_DRAG_DROP_COMMITTED = 5 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_DRAG_DROP_STATUS")] - public enum DIRECTMANIPULATION_DRAG_DROP_STATUS - { - /// - /// Value: - /// 0 - /// The viewport is at rest and ready for input. - /// - DIRECTMANIPULATION_DRAG_DROP_READY, - - /// - /// Value: - /// 1 - /// The viewport is updating its content and the content is not selected. - /// - DIRECTMANIPULATION_DRAG_DROP_PRESELECT, - - /// - /// Value: - /// 2 - /// The viewport is updating its content and the content is selected. - /// - DIRECTMANIPULATION_DRAG_DROP_SELECTING, - - /// - /// Value: - /// 3 - /// The viewport is updating its content and the content is being dragged. - /// - DIRECTMANIPULATION_DRAG_DROP_DRAGGING, - - /// - /// Value: - /// 4 - /// The viewport has concluded the interaction and requests a revert. - /// - DIRECTMANIPULATION_DRAG_DROP_CANCELLED, - - /// - /// Value: - /// 5 - /// The viewport has concluded the interaction and requests a commit. - /// - DIRECTMANIPULATION_DRAG_DROP_COMMITTED, - } - - /// Defines the gestures that can be passed to SetManualGesture. - /// - /// By default, Direct Manipulation always reassigns tap and press-and-hold gestures to the application. - /// Use DIRECTMANIPULATION_GESTURE_PINCH_ZOOM to zoom instead of scale. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_gesture_configuration - // typedef enum DIRECTMANIPULATION_GESTURE_CONFIGURATION { DIRECTMANIPULATION_GESTURE_NONE = 0, DIRECTMANIPULATION_GESTURE_DEFAULT = 0, DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_VERTICAL = 0x8, DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_HORIZONTAL = 0x10, DIRECTMANIPULATION_GESTURE_PINCH_ZOOM = 0x20 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_GESTURE_CONFIGURATION")] - public enum DIRECTMANIPULATION_GESTURE_CONFIGURATION - { - /// - /// Value: - /// 0 - /// No gestures are defined. - /// - DIRECTMANIPULATION_GESTURE_NONE = 0x0, - /// - /// Value: - /// 0 - /// Only default gestures are supported. This is the default value. - /// - DIRECTMANIPULATION_GESTURE_DEFAULT = 0x0, - /// - /// Value: - /// 0x8 - /// Vertical slide and swipe gestures are supported through the cross-slide interaction. For more information, see - /// Guidelines for cross-slide - /// . - /// - DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_VERTICAL = 0x8, - /// - /// Value: - /// 0x10 - /// Horizontal slide and swipe gestures are supported through the cross-slide interaction. For more information, see - /// Guidelines for cross-slide - /// . - /// - DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_HORIZONTAL = 0x10, - /// - /// Value: - /// 0x20 - /// Pinch and stretch gestures for zooming. - /// - DIRECTMANIPULATION_GESTURE_PINCH_ZOOM = 0x20, - } - - /// Defines how hit testing is handled by Direct Manipulation when using a dedicated hit-test thread registered through RegisterHitTestTarget. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_hittest_type typedef - // enum DIRECTMANIPULATION_HITTEST_TYPE { DIRECTMANIPULATION_HITTEST_TYPE_ASYNCHRONOUS = 0, DIRECTMANIPULATION_HITTEST_TYPE_SYNCHRONOUS = - // 0x1, DIRECTMANIPULATION_HITTEST_TYPE_AUTO_SYNCHRONOUS = 0x2 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_HITTEST_TYPE")] - public enum DIRECTMANIPULATION_HITTEST_TYPE - { - /// - /// Value: - /// 0 - /// The hit-test thread receives - /// WM_POINTERDOWN - /// messages and specifies whether to call - /// SetContact - /// . If - /// SetContact - /// is not called, the contact will not be associated with a viewport. - /// - DIRECTMANIPULATION_HITTEST_TYPE_ASYNCHRONOUS, - - /// - /// Value: - /// 0x1 - /// The UI thread always receives - /// WM_POINTERDOWN - /// messages after the hit-test thread. A call to - /// SetContact - /// is not required. - /// - DIRECTMANIPULATION_HITTEST_TYPE_SYNCHRONOUS, - - /// - /// Value: - /// 0x2 - /// The UI thread receives - /// WM_POINTERDOWN - /// messages only when - /// SetContact - /// isn't called by the hit-test thread. - /// - DIRECTMANIPULATION_HITTEST_TYPE_AUTO_SYNCHRONOUS, - } - - /// Defines the horizontal alignment options for content within a viewport. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_horizontalalignment - // typedef enum DIRECTMANIPULATION_HORIZONTALALIGNMENT { DIRECTMANIPULATION_HORIZONTALALIGNMENT_NONE = 0, - // DIRECTMANIPULATION_HORIZONTALALIGNMENT_LEFT = 0x1, DIRECTMANIPULATION_HORIZONTALALIGNMENT_CENTER = 0x2, - // DIRECTMANIPULATION_HORIZONTALALIGNMENT_RIGHT = 0x4, DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER = 0x8 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_HORIZONTALALIGNMENT")] - [Flags] - public enum DIRECTMANIPULATION_HORIZONTALALIGNMENT - { - /// - /// Value: - /// 0 - /// No alignment. The object can be positioned anywhere within the viewport. - /// - DIRECTMANIPULATION_HORIZONTALALIGNMENT_NONE = 0x0, - - /// - /// Value: - /// 0x1 - /// Align object along the left side of the viewport. - /// - DIRECTMANIPULATION_HORIZONTALALIGNMENT_LEFT = 0x1, - - /// - /// Value: - /// 0x2 - /// Align object to the center of the viewport. - /// - DIRECTMANIPULATION_HORIZONTALALIGNMENT_CENTER = 0x2, - - /// - /// Value: - /// 0x4 - /// Align object along the right side of the viewport. - /// - DIRECTMANIPULATION_HORIZONTALALIGNMENT_RIGHT = 0x4, - - /// - /// Value: - /// 0x8 - /// Content zooms around the center point of the contacts, instead of being locked with the horizontal alignment. - /// - DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER = 0x8, - } - - /// - /// Defines the threading behavior for SetInputMode or SetUpdateMode. The exact meaning of each constant depends on the method called. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_input_mode typedef - // enum DIRECTMANIPULATION_INPUT_MODE { DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC = 0, DIRECTMANIPULATION_INPUT_MODE_MANUAL = 1 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_INPUT_MODE")] - public enum DIRECTMANIPULATION_INPUT_MODE - { - /// - /// Value: - /// 0 - /// Input is automatically passed to the viewport in an independent thread. - /// - DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC, - - /// - /// Value: - /// 1 - /// Input is manually passed by the app on its thread via the - /// ProcessInput - /// method. - /// - DIRECTMANIPULATION_INPUT_MODE_MANUAL, - } - - /// Defines gestures recognized by Direct Manipulation. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_interaction_type - // typedef enum DIRECTMANIPULATION_INTERACTION_TYPE { DIRECTMANIPULATION_INTERACTION_BEGIN = 0, - // DIRECTMANIPULATION_INTERACTION_TYPE_MANIPULATION = 1, DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_TAP = 2, - // DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_HOLD = 3, DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_CROSS_SLIDE = 4, - // DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_PINCH_ZOOM = 5, DIRECTMANIPULATION_INTERACTION_END = 100 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_INTERACTION_TYPE")] - public enum DIRECTMANIPULATION_INTERACTION_TYPE - { - /// - /// Value: - /// 0 - /// Marks the beginning of an interaction. - /// - DIRECTMANIPULATION_INTERACTION_BEGIN, - - /// - /// Value: - /// 1 - /// A compound gesture that supports translation, rotation and scaling. - /// - DIRECTMANIPULATION_INTERACTION_TYPE_MANIPULATION, - - /// - /// Value: - /// 2 - /// A tap gesture. - /// - DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_TAP, - - /// - /// Value: - /// 3 - /// A hold gesture. - /// - DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_HOLD, - - /// - /// Value: - /// 4 - /// Select or move through slide or swipe gestures. - /// - DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_CROSS_SLIDE, - - /// - /// Value: - /// 5 - /// A zoom gesture. - /// - DIRECTMANIPULATION_INTERACTION_TYPE_GESTURE_PINCH_ZOOM, - - /// - /// Value: - /// 100 - /// Marks the end of an interaction. - /// - DIRECTMANIPULATION_INTERACTION_END, - } - - /// Defines the Direct Manipulation motion type. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_motion_types typedef - // enum DIRECTMANIPULATION_MOTION_TYPES { DIRECTMANIPULATION_MOTION_NONE = 0, DIRECTMANIPULATION_MOTION_TRANSLATEX = 0x1, - // DIRECTMANIPULATION_MOTION_TRANSLATEY = 0x2, DIRECTMANIPULATION_MOTION_ZOOM = 0x4, DIRECTMANIPULATION_MOTION_CENTERX = 0x10, - // DIRECTMANIPULATION_MOTION_CENTERY = 0x20, DIRECTMANIPULATION_MOTION_ALL } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_MOTION_TYPES")] - [Flags] - public enum DIRECTMANIPULATION_MOTION_TYPES - { - /// - /// Value: - /// 0 - /// None. - /// - DIRECTMANIPULATION_MOTION_NONE = 0x0, - - /// - /// Value: - /// 0x1 - /// Translation in the horizontal axis. - /// - DIRECTMANIPULATION_MOTION_TRANSLATEX = 0x1, - - /// - /// Value: - /// 0x2 - /// Translation in the vertical axis. - /// - DIRECTMANIPULATION_MOTION_TRANSLATEY = 0x2, - - /// - /// Value: - /// 0x4 - /// Zoom. - /// - DIRECTMANIPULATION_MOTION_ZOOM = 0x4, - - /// - /// Value: - /// 0x10 - /// The horizontal center of the manipulation. - /// - DIRECTMANIPULATION_MOTION_CENTERX = 0x10, - - /// - /// Value: - /// 0x20 - /// The vertical center of the manipulation. - /// - DIRECTMANIPULATION_MOTION_CENTERY = 0x20, - - /// All manipulation motion. - DIRECTMANIPULATION_MOTION_ALL = DIRECTMANIPULATION_MOTION_TRANSLATEX | DIRECTMANIPULATION_MOTION_TRANSLATEY | DIRECTMANIPULATION_MOTION_ZOOM | DIRECTMANIPULATION_MOTION_CENTERX | DIRECTMANIPULATION_MOTION_CENTERY, - } - - /// Defines the coordinate system for a collection of snap points. - /// - /// If DIRECTMANIPULATION_COORDINATE_ORIGIN and DIRECTMANIPULATION_COORDINATE_MIRRORED are both specified, the snap points - /// are interpreted as specified from the bottom and right boundaries of the content (the size of the content - the size of the - /// viewport). This is intended for RTL reading scenarios where content is normally specified and rendered from right-to-left or bottom-to-top. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_snappoint_coordinate - // typedef enum DIRECTMANIPULATION_SNAPPOINT_COORDINATE { DIRECTMANIPULATION_COORDINATE_BOUNDARY = 0, - // DIRECTMANIPULATION_COORDINATE_ORIGIN = 0x1, DIRECTMANIPULATION_COORDINATE_MIRRORED = 0x10 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_SNAPPOINT_COORDINATE")] - [Flags] - public enum DIRECTMANIPULATION_SNAPPOINT_COORDINATE - { - /// - /// Value: - /// 0 - /// Default. - /// Snap points are specified relative to the top and left boundaries of the content unless - /// DIRECTMANIPULATION_COORDINATE_MIRRORED - /// - /// is also specified, in which case they are relative to the bottom and right boundaries of the content. For zoom, the boundary is 1.0f. - /// - /// - DIRECTMANIPULATION_COORDINATE_BOUNDARY = 0, - - /// - /// Value: - /// 0x1 - /// Snap points are specified relative to the origin of the viewport. - /// - DIRECTMANIPULATION_COORDINATE_ORIGIN = 1, - - /// - /// Value: - /// 0x10 - /// - /// Snap points are interpreted as specified in the negative direction of the origin. The origin is shifted to the bottom and right - /// of the viewport or content. Cannot be set for zoom. - /// - /// - DIRECTMANIPULATION_COORDINATE_MIRRORED = 0x10, - } - - /// Modifies how the final inertia end position is calculated. - /// - /// For DIRECTMANIPULATION_SNAPPOINT_MANDATORY or DIRECTMANIPULATION_SNAPPOINT_OPTIONAL snap points, the snap points are - /// chosen based on the natural ending position of inertia as calculated by the touch interaction engine. For - /// DIRECTMANIPULATION_SNAPPOINT_MANDATORY_SINGLE or DIRECTMANIPULATION_SNAPPOINT_OPTIONAL_SINGLE snap points, the selected - /// snap point depends on where inertia started. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_snappoint_type typedef - // enum DIRECTMANIPULATION_SNAPPOINT_TYPE { DIRECTMANIPULATION_SNAPPOINT_MANDATORY = 0, DIRECTMANIPULATION_SNAPPOINT_OPTIONAL = 1, - // DIRECTMANIPULATION_SNAPPOINT_MANDATORY_SINGLE = 2, DIRECTMANIPULATION_SNAPPOINT_OPTIONAL_SINGLE = 3 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_SNAPPOINT_TYPE")] - public enum DIRECTMANIPULATION_SNAPPOINT_TYPE - { - /// - /// Value: - /// 0 - /// Content always stops at the snap point closest to where inertia would naturally stop along the direction of inertia. - /// - DIRECTMANIPULATION_SNAPPOINT_MANDATORY, - - /// - /// Value: - /// 1 - /// - /// Content stops at a snap point closest to where inertia would naturally stop along the direction of inertia, depending on how - /// close the snap point is. - /// - /// - DIRECTMANIPULATION_SNAPPOINT_OPTIONAL, - - /// - /// Value: - /// 2 - /// Content always stops at the snap point closest to the release point along the direction of inertia. - /// - DIRECTMANIPULATION_SNAPPOINT_MANDATORY_SINGLE, - - /// - /// Value: - /// 3 - /// Content stops at the next snap point, if the motion starts far from it. - /// - DIRECTMANIPULATION_SNAPPOINT_OPTIONAL_SINGLE, - } - - /// Defines the possible states of Direct Manipulation. The viewport can process input in any state unless otherwise noted. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_status typedef enum - // DIRECTMANIPULATION_STATUS { DIRECTMANIPULATION_BUILDING = 0, DIRECTMANIPULATION_ENABLED = 1, DIRECTMANIPULATION_DISABLED = 2, - // DIRECTMANIPULATION_RUNNING = 3, DIRECTMANIPULATION_INERTIA = 4, DIRECTMANIPULATION_READY = 5, DIRECTMANIPULATION_SUSPENDED = 6 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_STATUS")] - public enum DIRECTMANIPULATION_STATUS - { - /// - /// Value: - /// 0 - /// The viewport is being initialized and is not yet able to process input. - /// - DIRECTMANIPULATION_BUILDING, - - /// - /// Value: - /// 1 - /// The viewport was successfully enabled. - /// - DIRECTMANIPULATION_ENABLED, - - /// - /// Value: - /// 2 - /// The viewport is disabled and cannot process input or callbacks. The viewport can be enabled by calling - /// Enable - /// . - /// - DIRECTMANIPULATION_DISABLED, - - /// - /// Value: - /// 3 - /// The viewport is currently processing input and updating content. - /// - DIRECTMANIPULATION_RUNNING, - - /// - /// Value: - /// 4 - /// The viewport is moving content due to inertia. - /// - DIRECTMANIPULATION_INERTIA, - - /// - /// Value: - /// 5 - /// The viewport has completed the previous interaction. - /// - DIRECTMANIPULATION_READY, - - /// - /// Value: - /// 6 - /// The transient state of the viewport when input has been promoted to an ancestor in the - /// SetContact - /// chain. - /// - DIRECTMANIPULATION_SUSPENDED, - } - - /// Defines the vertical alignment settings for content within the viewport. - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_verticalalignment - // typedef enum DIRECTMANIPULATION_VERTICALALIGNMENT { DIRECTMANIPULATION_VERTICALALIGNMENT_NONE = 0, - // DIRECTMANIPULATION_VERTICALALIGNMENT_TOP = 0x1, DIRECTMANIPULATION_VERTICALALIGNMENT_CENTER = 0x2, - // DIRECTMANIPULATION_VERTICALALIGNMENT_BOTTOM = 0x4, DIRECTMANIPULATION_VERTICALALIGNMENT_UNLOCKCENTER = 0x8 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_VERTICALALIGNMENT")] - [Flags] - public enum DIRECTMANIPULATION_VERTICALALIGNMENT - { - /// - /// Value: - /// 0 - /// No alignment. The object can be positioned anywhere within the viewport. - /// - DIRECTMANIPULATION_VERTICALALIGNMENT_NONE = 0x0, - - /// - /// Value: - /// 0x1 - /// Align object along the top of the viewport. - /// - DIRECTMANIPULATION_VERTICALALIGNMENT_TOP = 0x1, - - /// - /// Value: - /// 0x2 - /// Align object to the center of the viewport. - /// - DIRECTMANIPULATION_VERTICALALIGNMENT_CENTER = 0x2, - - /// - /// Value: - /// 0x4 - /// Align object along the bottom of the viewport. - /// - DIRECTMANIPULATION_VERTICALALIGNMENT_BOTTOM = 0x4, - - /// - /// Value: - /// 0x8 - /// Content zooms around the center point of the contacts, instead of being locked with the vertical alignment. - /// - DIRECTMANIPULATION_VERTICALALIGNMENT_UNLOCKCENTER = 0x8, - } - - /// Defines the input behavior options for the viewport. - /// - /// DIRECTMANIPULATION_VIEWPORT_OPTIONS is used in the SetViewportOptions method. These flags can be combined to set the input - /// behavior for a viewport. - /// - // https://learn.microsoft.com/en-us/windows/win32/api/directmanipulation/ne-directmanipulation-directmanipulation_viewport_options - // typedef enum DIRECTMANIPULATION_VIEWPORT_OPTIONS { DIRECTMANIPULATION_VIEWPORT_OPTIONS_DEFAULT = 0, - // DIRECTMANIPULATION_VIEWPORT_OPTIONS_AUTODISABLE = 0x1, DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE = 0x2, - // DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT = 0x4, DIRECTMANIPULATION_VIEWPORT_OPTIONS_EXPLICITHITTEST = 0x8, - // DIRECTMANIPULATION_VIEWPORT_OPTIONS_DISABLEPIXELSNAPPING = 0x10 } ; - [PInvokeData("directmanipulation.h", MSDNShortId = "NE:directmanipulation.DIRECTMANIPULATION_VIEWPORT_OPTIONS")] - [Flags] - public enum DIRECTMANIPULATION_VIEWPORT_OPTIONS - { - /// - /// Value: - /// 0 - /// No special behaviors. This is the default value used to set or revert to default behavior. - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_DEFAULT = 0x0, - - /// - /// Value: - /// 0x1 - /// At the end of an interaction, the viewport transitions to - /// DIRECTMANIPULATION_READY - /// and then immediately to - /// DIRECTMANIPULATION_DISABLED - /// . The viewport must be explicitly enabled through the - /// Enable - /// method before the next interaction can be processed. - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_AUTODISABLE = 0x1, - - /// - /// Value: - /// 0x2 - /// Update - /// must be called to redraw the content within the viewport. The content is not updated automatically during an input event. - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE = 0x2, - - /// - /// Value: - /// 0x4 - /// All input from a contact associated with the viewport is passed to the UI thread for processing. - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT = 0x4, - - /// - /// Value: - /// 0x8 - /// If set, all - /// WM_POINTERDOWN - /// messages are passed to the application for hit testing. Otherwise, - /// Direct Manipulation - /// - /// will process the messages for hit testing against the existing list of running viewports, and the application will not see the input. - /// - /// Applies only when viewport state is - /// DIRECTMANIPULATION_RUNNING - /// or - /// DIRECTMANIPULATION_INERTIA - /// . - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_EXPLICITHITTEST = 0x8, - - /// - /// Value: - /// 0x10 - /// Specifies that pixel snapping during a manipulation is disabled. - /// - /// Anti-aliasing can create irregular edge rendering. Artifacts, commonly seen as blurry, or semi-transparent, edges can occur when - /// the location of an edge falls in the middle of a device pixel rather than between device pixels. - /// - /// - DIRECTMANIPULATION_VIEWPORT_OPTIONS_DISABLEPIXELSNAPPING = 0x10, - } -} \ No newline at end of file diff --git a/PInvoke/DirectManipulation/Vanara.PInvoke.DirectManipulation.csproj b/PInvoke/DirectManipulation/Vanara.PInvoke.DirectManipulation.csproj deleted file mode 100644 index aeef44b6..00000000 --- a/PInvoke/DirectManipulation/Vanara.PInvoke.DirectManipulation.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - directmanipulation.dll - - - PInvoke API (methods, structures and constants) imported from Windows Direct Manipulation. - Vanara.PInvoke.DirectManipulation - $(AssemblyName) - $(AssemblyName) - pinvoke;vanara;net-extensions;interop;DirectManipulation - - - - - - - \ No newline at end of file diff --git a/Vanara.sln b/Vanara.sln index d4d557a2..ec8835e7 100644 --- a/Vanara.sln +++ b/Vanara.sln @@ -416,8 +416,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.WscApi", "PI EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.WebSocket", "PInvoke\WebSocket\Vanara.PInvoke.WebSocket.csproj", "{2CF460E8-47EF-4C53-9748-A305EE59D06E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.DirectManipulation", "PInvoke\DirectManipulation\Vanara.PInvoke.DirectManipulation.csproj", "{85D43F4C-5040-4A10-9B55-3C408068DADE}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2771,24 +2769,6 @@ Global {2CF460E8-47EF-4C53-9748-A305EE59D06E}.Release|x64.Build.0 = Release|Any CPU {2CF460E8-47EF-4C53-9748-A305EE59D06E}.Release|x86.ActiveCfg = Release|Any CPU {2CF460E8-47EF-4C53-9748-A305EE59D06E}.Release|x86.Build.0 = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|x64.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|x64.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|x86.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Debug|x86.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|Any CPU.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|Any CPU.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|x64.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|x64.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|x86.ActiveCfg = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.DebugNoTests|x86.Build.0 = Debug|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|Any CPU.Build.0 = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|x64.ActiveCfg = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|x64.Build.0 = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|x86.ActiveCfg = Release|Any CPU - {85D43F4C-5040-4A10-9B55-3C408068DADE}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2970,7 +2950,6 @@ Global {D8B0FBB6-8BBF-42BD-8844-8A2915CC95E5} = {385CAD2D-0A5E-4F80-927B-D5499D126B90} {48F95024-8539-4958-A804-ED1C18A28F3C} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} {2CF460E8-47EF-4C53-9748-A305EE59D06E} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} - {85D43F4C-5040-4A10-9B55-3C408068DADE} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {543FAC75-2AF1-4EF1-9609-B242B63FEED4}