Compartilhar via


Gesture Architecture (Compact 2013)

3/26/2014

The following diagram shows the gesture architecture.

Compact 7 software architecture for gestures

The gesture architecture is described here.

  • Applications
    Applications call the EnableGestures function of the gesture core to enable gestures. One of the arguments is a bit mask that specifies which gestures to enable. Another argument specifies the scope of the messages. An application can enable gestures for all windows of the process, or for one or more specified windows.
  • Gesture Core (in GWES)
    The gesture core within GWES controls gesture processing. It calls TouchPanelEnableEx to enable the touch driver, and passes a pointer to a callback function as an argument in the call. The driver uses the callback function to provide touch data to the gesture core.

    The gesture core loads, initializes, and configures the gesture recognizers, including the built-in recognizer and all OEM recognizers. Registry entries specify which OEM recognizers to load. When the touch driver provides touch data to the core, the core forwards it to the recognizers. For more information about OEM recognizer registry settings, see Gesture Recognizer Examples.

    The gesture core code is linked into the GWES DLL from TouchGesture.lib.

  • Default Gesture Handler (in GWES)
    A gesture handler is a code component that monitors the gesture events from the gesture recognizers and causes applications to respond to them. An application can be programmed to handle its own gestures.

    Compact 2013 provides a default gesture handler (AutoGesture) and physics engine that can make applications respond to flick gestures with minimal program changes. When there is flick gesture message, AutoGesture generates WM_VSCROLL and WM_HSCROLL messages. If your application has scrollable windows, the WM_VSCROLL and WM_HSCROLL messages cause scrolling in the application.

    For more information, see Default Gesture Handler.

  • Physics Engine
    When a user manipulates a visual element by using a gesture, the program that handles the gesture must move the visual element appropriately. The physics engine provides functions that calculate future point positions of a visual element, given an initial point location, velocity and direction of the element. AutoGesture uses the physics engine to calculate scrolling for flick gestures. Other applications can call the physics engine also.

    The physics engine code is in PhysicsEngine.dll. For more information, see Physics Engine.

  • Built-in Gesture Recognizer
    Compact 2013 provides a gesture recognizer component that recognizes gestures and reports gesture events to GWES. GWES sends WM_GESTURE messages to all the windows that are registered for the message type.

    The recognizer recognizes these gestures: pan, scroll, hold, select, double select, and direct manipulation. For more information, see Types of Gestures.

    GWES echoes mouse events (mouse up, mouse down, and mouse move) to each of the active gesture recognizers.

    The built-in recognizer is always present and active when gestures are enabled with EnableGestures; it cannot be disabled.

    The code for the built-in recognizer is in Touchrecognizer.dll.

  • OEM Gesture Recognizers
    An OEM that requires gestures that the built-in recognizer does not handle can write one or more custom recognizers. OEM recognizers work in parallel with the built-in recognizer. When gesture core receives touch data from the driver, it dispatches the data to all of the gesture recognizers for conversion.
  • Touch Driver
    The touch driver controls the touch panel and provides touch data to GWES. For information about the touch driver, see Touch Driver Architecture.

    Note

    The touch driver can provide more than two touch points; however, the gesture implementation only uses the first two and ignores any beyond that.

In This Section

  • Gesture Core API
    Describes the API of the gesture core, which is the part of GWES that controls gesture processing.
  • Sysgen Variables for Gesture
    Discusses the system variables that control what gesture catalog items the build includes in the OS run-time image.

See Also

Concepts

Touch and Gesture