Represents the animation behavior of content as it approaches the boundary of a given axis or axes.
Performs the auto-scroll animation for the viewport this behavior is attached to.
A combination of
One of the values from
If this method succeeds, it returns
SetConfiguration takes effect immediately. If the content is not in inertia, and
Represents a compositor object that associates manipulated content with a drawing surface, such as canvas (Windows Store 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
You specify manual mode on a viewport by calling either of these functions:
Associates content 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.
SyntaxParametersAddContent( [in]???????????? *content, [in, optional]?? device, [in]???????????? *parentVisual, [in]???????????? *childVisual );
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.
Note??device is created by the application.
The parent in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
The child in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
If the method succeeds, it returns
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
If the application uses a custom implementation of
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.
Note??device is created by the application.
The parent in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
The child in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
Removes content from the compositor.
SyntaxParametersRemoveContent( [in]?? *content );
The content to remove from the composition tree.
If the method succeeds, it returns
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.
RequirementsThe content to remove from the composition tree.
Sets the update manager used to send compositor updates to Direct Manipulation.
SyntaxParametersSetUpdateManager( [in]?? *updateManager );
The update manager.
If the method succeeds, it returns
Retrieve updateManager by calling GetUpdateManager.
Call this method during Direct Manipulation initialization to connect the compositor to the update manager.
RequirementsCommits all pending updates in the compositor to the system for rendering.
SyntaxParametersFlush();
This method has no parameters.
Return valueIf the method succeeds, it returns
This method enables Direct Manipulation to flush any pending changes to its visuals before a system event, such as a process suspension.
Requirements
Represents a compositor object that associates manipulated content with a drawing surface, such as canvas (Windows Store 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
You specify manual mode on a viewport by calling either of these functions:
Associates content 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.
SyntaxParametersAddContent( [in]???????????? *content, [in, optional]?? device, [in]???????????? *parentVisual, [in]???????????? *childVisual );
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.
Note??device is created by the application.
The parent in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
The child in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
If the method succeeds, it returns
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
If the application uses a custom implementation of
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.
Note??device is created by the application.
The parent in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
The child in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
Removes content from the compositor.
SyntaxParametersRemoveContent( [in]?? *content );
The content to remove from the composition tree.
If the method succeeds, it returns
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.
RequirementsThe content to remove from the composition tree.
Sets the update manager used to send compositor updates to Direct Manipulation.
SyntaxParametersSetUpdateManager( [in]?? *updateManager );
The update manager.
If the method succeeds, it returns
Retrieve updateManager by calling GetUpdateManager.
Call this method during Direct Manipulation initialization to connect the compositor to the update manager.
RequirementsCommits all pending updates in the compositor to the system for rendering.
SyntaxParametersFlush();
This method has no parameters.
Return valueIf the method succeeds, it returns
This method enables Direct Manipulation to flush any pending changes to its visuals before a system event, such as a process suspension.
RequirementsAssociates content 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.
Note??device is created by the application.
The parent in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
The child in the composition tree for the content being added.
parentVisual must also be a parent of childVisual in the composition tree.
If the method succeeds, it returns
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
If the application uses a custom implementation of
Removes content from the compositor.
The content to remove from the composition tree.
If the method succeeds, it returns
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.
Sets the update manager used to send compositor updates to Direct Manipulation.
If the method succeeds, it returns
Retrieve updateManager by calling GetUpdateManager.
Call this method during Direct Manipulation initialization to connect the compositor to the update manager.
Commits all pending updates in the compositor to the system for rendering.
If the method succeeds, it returns
This method enables Direct Manipulation to flush any pending changes to its visuals before a system event, such as a process suspension.
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
The system provides an implementation of
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 method succeeds, it returns
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).
Specifies the bounding rectangle of the content, relative to its viewport.
The bounding rectangle of the content.
If the method succeeds, it returns
The default bounding rectangle is (-FLT_MAX, -FLT_MAX, FLT_MAX, FLT_MAX).
Retrieves the viewport that contains the content.
A reference to the identifier of the interface to use.
The viewport object.
If the method succeeds, it returns
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.
If the method succeeds, it returns
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 reference 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.
Specifies the tag object for the content.
The object portion of the tag.
The ID portion of the tag.
If the method succeeds, it returns
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.
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.
If the method succeeds, it returns
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.
Output transform = Pixel rounding (Sync transform * Content transform)
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.
If the method succeeds, it returns
This transform contains the default overpan and bounce curves during manipulation and inertia.
This transform does not contain the sync transform set with SyncContentTransform.
Output transform = Pixel rounding (Sync transform * Content transform)
When this method returns, the format of matrix is:
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.
If the method succeeds, it returns
This method will fail if the viewport state is
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.
Output transform = Pixel rounding (Sync transform * Content transform)
Retrieves or sets the bounding rectangle of the content, relative to the bounding rectangle of the viewport (if defined).
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).
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.
Sets the configuration of the drag-drop interaction for the viewport this behavior is attached to.
Combination of values from
For the configuration to be valid, configuration must contain exactly one of the following three values:
If
If
If this method succeeds, it returns
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. ?
Gets the status of the drag-drop interaction for the viewport this behavior is attached to.
One of the values from
If this method succeeds, it returns
This method returns the drag-drop status at the time of the call and not at the time when the return value is read.
Sets the configuration of the drag-drop interaction for the viewport this behavior is attached to.
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. ?
Gets the status of the drag-drop interaction for the viewport this behavior is attached to.
This method returns the drag-drop status at the time of the call and not at the time when the return value is read.
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-
Activates Direct Manipulation for processing input and handling callbacks on the specified window.
If the method succeeds, it returns
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.
Deactivates Direct Manipulation for processing input and handling callbacks on the specified window.
If the method succeeds, it returns
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.
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
If the method succeeds, it returns
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
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.
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,
If the method succeeds, it returns
Call this method for mouse and keyboard input.
Gets a reference to an
If the method succeeds, it returns
For the compositor to respond to update events from Direct Manipulation, you must associate
The factory method that is used to create a new
The viewport manages the interaction state and mapping of input to output actions.
If the method succeeds, it returns
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.
If the method succeeds, it returns
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)).
Provides a method to create configuration behaviors that can be attached to a viewport.
Note??To obtain an
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.
If this method succeeds, it returns
Determines the type and direction of automatic scrolling animation to apply.
If content is scrolling, slowly stop along the direction of the motion.
Scroll towards the positive boundary of the content.
Scroll towards the origin of the content.
Defines the interaction configuration states available in Direct Manipulation.
Defines behaviors for the drag-drop interaction.
Specifies that vertical movement is applicable to the chosen gesture.
Specifies that horizontal movement is applicable to the chosen gesture.
Specifies that the gesture is to be cross-slide only.
Specifies that the gesture is a drag initiated by cross-slide.
Specifies that the gesture a drag initiated by press-and-hold.
Defines the drag-and-drop interaction states for the viewport.
For each interaction, the status always starts at
The meaning of the CANCELLED and COMMITED values depend on the previous status.
The viewport is at rest and ready for input.
The viewport is updating its content and the content is not selected.
The viewport is updating its content and the content is selected.
The viewport is updating its content and the content is being dragged.
The viewport has concluded the interaction and requests a revert.
The viewport has concluded the interaction and requests a commit.
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
Defines how hit testing is handled by Direct Manipulation when using a dedicated hit-test thread registered through RegisterHitTestTarget.
Defines the horizontal alignment options for content within a viewport.
No alignment. The object can be positioned anywhere within the viewport.
Align object along the left side of the viewport.
Align object to the center of the viewport.
Align object along the right side of the viewport.
Content zooms around the center point of the contacts, instead of being locked with the horizontal alignment.
Defines the threading behavior for SetInputMode or SetUpdateMode. The exact meaning of each constant depends on the method called.
Defines gestures recognized by Direct Manipulation.
Defines the Direct Manipulation motion type.
Defines the coordinate system for a collection of snap points.
If
Default.
Snap points are specified relative to the top and left boundaries of the content unless
Snap points are specified relative to the origin of the viewport.
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.
Modifies how the final inertia end position is calculated.
For
Content always stops at the snap point closest to where inertia would naturally stop along the direction of inertia.
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.
Content always stops at the snap point closest to the release point along the direction of inertia.
Content stops at the next snap point, if the motion starts far from it.
Defines the possible states of Direct Manipulation. The viewport can process input in any state unless otherwise noted.
Defines the vertical alignment settings for content within the viewport.
No alignment. The object can be positioned anywhere within the viewport.
Align object along the top of the viewport.
Align object to the center of the viewport.
Align object along the bottom of the viewport.
Content zooms around the center point of the contacts, instead of being locked with the vertical alignment.
Defines the input behavior options for the viewport.
No special behaviors. This is the default value used to set or revert to default behavior.
At the end of an interaction, the viewport transitions to
Update must be called to redraw the content within the viewport. The content is not updated automatically during an input event.
All input from a contact associated with the viewport is passed to the UI thread for processing.
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
Defines methods to handle drag-drop behavior events.
Note??When implementing this interface, ensure that the
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
The previous state of the drag-drop interaction from
If this method succeeds, it returns
If a class is implementing
Represents a time-keeping object that measures the latency of the composition infrastructure used by the application and provides this data to Direct Manipulation.
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.
If the method succeeds, it returns
The system implementation of
Defines methods to handle interactions when they are detected.
Note??When implementing this interface, ensure that the
Called when an interaction is detected.
The viewport on which the interaction was detected.
One of the values from
If this method succeeds, it returns
Encapsulates the primary content inside a viewport. Primary content is the content specified during the creation of a viewport.
Specifies snap points for the inertia end position at uniform intervals.
One of the
The interval between each snap point.
The offset from the coordinate specified in SetSnapCoordinate.
If the method succeeds, it returns
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.
Specifies the snap points for the inertia rest position.
One or more of the
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 the method succeeds, it returns
If snap points are invalid (for example, outside of the content boundaries), they are ignored and the content is always within the content boundaries.
Specifies the type of snap point.
One or more of the
One of the
If set to DIRECTMANIPULATION_SNAPPOINT_TYPE_NONE, snap points specified through SetSnapPoints or SetSnapInterval are cleared.
If the method succeeds, it returns
Specifies the coordinate system for snap points or snap intervals.
One of the values from
One of the values from
If motion is set to translation (
If motion is set to
The initial, or starting, snap point. All snap points are relative to this one. Only used when
If motion is set to
If the method succeeds, it returns
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).
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 method succeeds, it returns
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.
Sets the horizontal alignment of the primary content relative to the viewport.
One or more values from
Note??You cannot combine the following options:
If the method succeeds, it returns
If you have activated a configuration consisting only of zoom or zoom inertia, specify
Specifies the vertical alignment of the primary content in the viewport.
One or more values from
Note??You cannot combine
If the method succeeds, it returns
If you have activated a configuration consisting only of zoom or zoom inertia, specify
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.
If the method succeeds, it returns
Warning??Calling this method can cause a race condition if inertia has ended or been interrupted. This can also occur during the OnViewportStatusChanged callback.
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.
If the method succeeds, it returns
Sets the horizontal alignment of the primary content relative to the viewport.
If you have activated a configuration consisting only of zoom or zoom inertia, specify
Specifies the vertical alignment of the primary content in the viewport.
If you have activated a configuration consisting only of zoom or zoom inertia, specify
Defines methods for handling manipulation update events.
Note??When implementing a Direct Manipulation object, ensure that the
Notifies the compositor when to update inertia animation.
If this method succeeds, it returns
Updates Direct Manipulation at the current time.
If the application provides its own implementation of
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.
If the method succeeds, it returns
Deregisters a callback.
The unique ID of the event callback instance.
If the method succeeds, it returns
Updates Direct Manipulation at the current time.
If this method succeeds, it returns
If the application provides its own implementation of
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.
Starts or resumes input processing by the viewport.
If the method succeeds, it returns
This method directs a viewport to attempt to respond to input.
Call this method if the AUTODISABLE option is set.
Stops input processing by the viewport.
If this method succeeds, it returns
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.
Specifies an association between a contact and the viewport.
The ID of the reference.
If the method succeeds, it returns
Call this method when it 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.
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 reference identifier from a reference 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.
Removes a contact that is associated with a viewport.
The ID of the reference.
If the method succeeds, it returns
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.
Removes all contacts that are associated with the viewport. Inertia is started if the viewport supports inertia.
If the method succeeds, it returns
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.
Gets the state of the viewport.
One of the values from
If the method succeeds, it returns
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.
Gets the tag value of a viewport.
IID to the interface.
The object portion of the tag.
The identifier portion of the tag.
If the method succeeds, it returns
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.
Sets a viewport tag.
The object portion of the tag.
The ID portion of the tag.
If the method succeeds, it returns
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.
Retrieves the rectangle for the viewport relative to the origin of the viewport coordinate system specified by SetViewportRect.
If the method succeeds, it returns
Sets the bounding rectangle for the viewport, relative to the origin of the viewport coordinate system.
The bounding rectangle.
If the method succeeds, it returns
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.
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.
If the method succeeds, it returns
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.
If the method succeeds, it returns
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:
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:
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 method succeeds, it returns
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
Gets the primary content of a viewport that implements
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.
If the method succeeds, it returns
This method gets the content of the viewport that implements
Adds secondary content, such as a panning indicator, to a viewport.
The content to add to the viewport.
If this method succeeds, it returns
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.
Removes secondary content from a viewport.
The content object to remove.
If this method succeeds, it returns
Secondary content can be removed from the viewport at any time.
Sets how the viewport should handle input and output (non-default).
One or more of the values from
If the method succeeds, it returns
Calling this method with
Adds an interaction configuration for the viewport.
One of the values from
If the method succeeds, it returns
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.
Removes an interaction configuration for the viewport.
One of the values from
If the method succeeds, it returns
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.
Sets the configuration for input interaction.
One or more values from
If the method succeeds, it returns
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.
Sets which gestures are ignored by Direct Manipulation.
If the method succeeds, it returns
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.
Specifies the motion types supported in a viewport that can be chained to a parent viewport.
One of the values from
If the method succeeds, it returns
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
The handle that represents this event handler callback.
If this method succeeds, it returns
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
Removes an existing event handler from the viewport.
A value that was returned by a previous call to AddEventHandler.
If the method succeeds, it returns
Specifies if input is visible to the UI thread.
One of the values from
If the method succeeds, it returns
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
Note??The application will not receive WM_POINTERCAPTURECHANGED messages.
Calling this method with
Specifies whether a viewport updates content manually instead of during an input event.
One of the values from
If the method succeeds, it returns
If the application provides its own implementation of
Calling this method with
Stops the manipulation and returns the viewport to a ready state.
If the method succeeds, it returns
If a mandatory snap point has been configured, the content may animate to the nearest snap point.
Releases all resources that are used by the viewport and prepares it for destruction from memory.
If the method succeeds, it returns
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.
Specifies an association between a contact and the viewport.
Call this method when it 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.
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 reference identifier from a reference 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.
Gets the state of the viewport.
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.
Retrieves or sets the rectangle for the viewport relative to the origin of the viewport coordinate system specified by SetViewportRect.
Sets how the viewport should handle input and output (non-default).
Calling this method with
Sets which gestures are ignored by Direct Manipulation.
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.
Specifies the motion types supported in a viewport that can be chained to a parent viewport.
Specifies if input is visible to the UI thread.
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
Note??The application will not receive WM_POINTERCAPTURECHANGED messages.
Calling this method with
Specifies whether a viewport updates content manually instead of during an input event.
If the application provides its own implementation of
Calling this method with
Provides management of behaviors on a viewport. A behavior affects the functionality of a particular part of the Direct Manipulation workflow.
Behaviors are created using
A behavior can be attached or removed at any time and takes effect immediately (even during an active manipulation or inertia animation).
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.
If the method succeeds, it returns
A behavior takes effect immediately after AddBehavior is called. This must be considered when adding a behavior during an active manipulation or inertia phase.
Removes a behavior from the viewport that matches the given cookie.
A valid cookie returned from the AddBehavior call on the same viewport.
If the method succeeds, it returns
Removes all behaviors added to the viewport.
If this method succeeds, it returns
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.
Called when content inside a viewport is updated.
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.
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
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.
Called after all content in the viewport has been updated.
The viewport that has been updated.
If the method succeeds, it returns
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.
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
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.