directmanipulation.idl 14.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*
 * Copyright 2019 Alistair Leslie-Hughes
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

import "oaidl.idl";
import "ocidl.idl";

cpp_quote("#if 0")
typedef void* HWND;
cpp_quote("#endif")

interface IDirectManipulationViewportEventHandler;

typedef enum DIRECTMANIPULATION_HITTEST_TYPE
{
    DIRECTMANIPULATION_HITTEST_TYPE_ASYNCHRONOUS     = 0x00000000,
    DIRECTMANIPULATION_HITTEST_TYPE_SYNCHRONOUS      = 0x00000001,
    DIRECTMANIPULATION_HITTEST_TYPE_AUTO_SYNCHRONOUS = 0x00000002
} DIRECTMANIPULATION_HITTEST_TYPE;
34
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_HITTEST_TYPE)")
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

typedef enum DIRECTMANIPULATION_STATUS
{
    DIRECTMANIPULATION_BUILDING,
    DIRECTMANIPULATION_ENABLED,
    DIRECTMANIPULATION_DISABLED,
    DIRECTMANIPULATION_RUNNING,
    DIRECTMANIPULATION_INERTIA,
    DIRECTMANIPULATION_READY,
    DIRECTMANIPULATION_SUSPENDED
} DIRECTMANIPULATION_STATUS;

typedef enum DIRECTMANIPULATION_VIEWPORT_OPTIONS
{
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_DEFAULT              = 0x00000000,
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_AUTODISABLE          = 0x00000001,
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE         = 0x00000002,
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_INPUT                = 0x00000004,
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_EXPLICITHITTEST      = 0x00000008,
    DIRECTMANIPULATION_VIEWPORT_OPTIONS_DISABLEPIXELSNAPPING = 0x00000010,
} DIRECTMANIPULATION_VIEWPORT_OPTIONS;
56
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_VIEWPORT_OPTIONS)")
57 58 59 60 61 62 63 64 65 66 67 68 69

typedef enum DIRECTMANIPULATION_CONFIGURATION
{
    DIRECTMANIPULATION_CONFIGURATION_NONE                = 0x00000000,
    DIRECTMANIPULATION_CONFIGURATION_INTERACTION         = 0x00000001,
    DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X       = 0x00000002,
    DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y       = 0x00000004,
    DIRECTMANIPULATION_CONFIGURATION_SCALING             = 0x00000010,
    DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_INERTIA = 0x00000020,
    DIRECTMANIPULATION_CONFIGURATION_SCALING_INERTIA     = 0x00000080,
    DIRECTMANIPULATION_CONFIGURATION_RAILS_X             = 0x00000100,
    DIRECTMANIPULATION_CONFIGURATION_RAILS_Y             = 0x00000200,
} DIRECTMANIPULATION_CONFIGURATION;
70
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_CONFIGURATION)")
71 72 73 74 75 76 77 78 79

typedef enum DIRECTMANIPULATION_GESTURE_CONFIGURATION
{
    DIRECTMANIPULATION_GESTURE_NONE                   = 0x00000000,
    DIRECTMANIPULATION_GESTURE_DEFAULT                = 0x00000000,
    DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_VERTICAL   = 0x00000008,
    DIRECTMANIPULATION_GESTURE_CROSS_SLIDE_HORIZONTAL = 0x00000010,
    DIRECTMANIPULATION_GESTURE_PINCH_ZOOM             = 0x00000020,
} DIRECTMANIPULATION_GESTURE_CONFIGURATION;
80
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_GESTURE_CONFIGURATION)")
81 82 83 84 85 86 87 88 89 90 91 92 93

typedef enum DIRECTMANIPULATION_MOTION_TYPES
{
    DIRECTMANIPULATION_MOTION_NONE       = 0x00000000,
    DIRECTMANIPULATION_MOTION_TRANSLATEX = 0x00000001,
    DIRECTMANIPULATION_MOTION_TRANSLATEY = 0x00000002,
    DIRECTMANIPULATION_MOTION_ZOOM       = 0x00000004,
    DIRECTMANIPULATION_MOTION_CENTERX    = 0x00000010,
    DIRECTMANIPULATION_MOTION_CENTERY    = 0x00000020,
    DIRECTMANIPULATION_MOTION_ALL        = DIRECTMANIPULATION_MOTION_TRANSLATEX | DIRECTMANIPULATION_MOTION_TRANSLATEY |
                                           DIRECTMANIPULATION_MOTION_ZOOM | DIRECTMANIPULATION_MOTION_CENTERX |
                                           DIRECTMANIPULATION_MOTION_CENTERY
} DIRECTMANIPULATION_MOTION_TYPES;
94
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_MOTION_TYPES)")
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

typedef enum DIRECTMANIPULATION_SNAPPOINT_TYPE
{
    DIRECTMANIPULATION_SNAPPOINT_MANDATORY,
    DIRECTMANIPULATION_SNAPPOINT_OPTIONAL,
    DIRECTMANIPULATION_SNAPPOINT_MANDATORY_SINGLE,
    DIRECTMANIPULATION_SNAPPOINT_OPTIONAL_SINGLE
} DIRECTMANIPULATION_SNAPPOINT_TYPE;

typedef enum DIRECTMANIPULATION_SNAPPOINT_COORDINATE
{
    DIRECTMANIPULATION_COORDINATE_BOUNDARY  = 0x00000000,
    DIRECTMANIPULATION_COORDINATE_ORIGIN    = 0x00000001,
    DIRECTMANIPULATION_COORDINATE_MIRRORED  = 0x00000010
} DIRECTMANIPULATION_SNAPPOINT_COORDINATE;
110
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_SNAPPOINT_COORDINATE)")
111 112 113 114 115 116 117 118 119

typedef enum DIRECTMANIPULATION_HORIZONTALALIGNMENT
{
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_NONE         = 0x00000000,
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_LEFT         = 0x00000001,
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_CENTER       = 0x00000002,
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_RIGHT        = 0x00000004,
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER = 0x00000008
} DIRECTMANIPULATION_HORIZONTALALIGNMENT;
120
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_HORIZONTALALIGNMENT)")
121 122 123 124 125 126 127 128 129

typedef enum DIRECTMANIPULATION_VERTICALALIGNMENT
{
    DIRECTMANIPULATION_VERTICALALIGNMENT_NONE         = 0x00000000,
    DIRECTMANIPULATION_VERTICALALIGNMENT_TOP          = 0x00000001,
    DIRECTMANIPULATION_VERTICALALIGNMENT_CENTER       = 0x00000002,
    DIRECTMANIPULATION_VERTICALALIGNMENT_BOTTOM       = 0x00000004,
    DIRECTMANIPULATION_VERTICALALIGNMENT_UNLOCKCENTER = 0x00000008
} DIRECTMANIPULATION_VERTICALALIGNMENT;
130
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DIRECTMANIPULATION_VERTICALALIGNMENT)")
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380

typedef enum DIRECTMANIPULATION_INPUT_MODE
{
    DIRECTMANIPULATION_INPUT_MODE_AUTOMATIC,
    DIRECTMANIPULATION_INPUT_MODE_MANUAL
} DIRECTMANIPULATION_INPUT_MODE;

[
    local,
    object,
    uuid(fb759dba-6f4c-4c01-874e-19c8a05907f9),
    pointer_default(unique)
]
interface IDirectManipulationFrameInfoProvider : IUnknown
{
    HRESULT GetNextFrameInfo([out] ULONGLONG *time, [out] ULONGLONG *process, [out] ULONGLONG *composition);
}

[
    local,
    object,
    uuid(fbf5d3b4-70c7-4163-9322-5a6f660d6fbc),
    pointer_default(unique)
]
interface IDirectManipulationManager : IUnknown
{
    HRESULT Activate([in] HWND window);

    HRESULT Deactivate([in] HWND window);

    HRESULT RegisterHitTestTarget([in] HWND window, [in] HWND hittest, [in] DIRECTMANIPULATION_HITTEST_TYPE type);

    HRESULT ProcessInput([in] const MSG *msg, [out, retval] BOOL *handled);

    HRESULT GetUpdateManager([in] REFIID riid, [out, iid_is(riid), retval,] void **obj);

    HRESULT CreateViewport([in] IDirectManipulationFrameInfoProvider *frame, [in] HWND window,
                           [in] REFIID riid, [out, iid_is(riid), retval] void **obj);

    HRESULT CreateContent([in] IDirectManipulationFrameInfoProvider *frame, [in] REFCLSID clsid,
                          [in] REFIID riid, [out, iid_is(riid), retval] void **obj);
}

[
    local,
    object,
    uuid(b89962cb-3d89-442b-bb58-5098fa0f9f16),
    pointer_default(unique)
]
interface IDirectManipulationContent : IUnknown
{
    HRESULT GetContentRect([out] RECT *size);

    HRESULT SetContentRect([in] const RECT *size);

    HRESULT GetViewport([in] REFIID riid, [out, iid_is(riid)] void **object);

    HRESULT GetTag([in] REFIID riid, [out, iid_is(riid)] void **object, [out] UINT32 *id);

    HRESULT SetTag([in, unique] IUnknown *object, [in] UINT32 id);

    HRESULT GetOutputTransform([out] float *matrix, [in] DWORD count);

    HRESULT GetContentTransform([out] float *matrix, [in] DWORD count);

    HRESULT SyncContentTransform([in] const float *matrix, [in] DWORD count);
}

[
    local,
    object,
    uuid(790b6337-64f8-4ff5-a269-b32bc2af27a7),
    pointer_default(unique)
]
interface IDirectManipulationUpdateHandler : IUnknown
{
    HRESULT Update();
}

[
    local,
    object,
    uuid(b0ae62fd-be34-46e7-9caa-d361facbb9cc),
    pointer_default(unique)
]
interface IDirectManipulationUpdateManager : IUnknown
{
    HRESULT RegisterWaitHandleCallback([in] HANDLE handle, [in] IDirectManipulationUpdateHandler *handler,
                                       [out] DWORD *cookie);

    HRESULT UnregisterWaitHandleCallback([in] DWORD cookie);

    HRESULT Update([in] IDirectManipulationFrameInfoProvider *provider);
}

[
    local,
    object,
    uuid(537a0825-0387-4efa-b62f-71eb1f085a7e),
    pointer_default(unique)
]
interface IDirectManipulationCompositor : IUnknown
{
    HRESULT AddContent([in] IDirectManipulationContent *content, [in] IUnknown *device,
                       [in] IUnknown *parent, [in] IUnknown *child);

    HRESULT RemoveContent([in] IDirectManipulationContent *content);

    HRESULT SetUpdateManager([in] IDirectManipulationUpdateManager *manager);

    HRESULT Flush();
}

[
    local,
    object,
    uuid(28b85a3d-60a0-48bd-9ba1-5ce8d9ea3a6d),
    pointer_default(unique)
]
interface IDirectManipulationViewport : IUnknown
{
    HRESULT Enable();

    HRESULT Disable();

    HRESULT SetContact([in] UINT32 id);

    HRESULT ReleaseContact([in] UINT32 id);

    HRESULT ReleaseAllContacts();

    HRESULT GetStatus([out] DIRECTMANIPULATION_STATUS *status);

    HRESULT GetTag([in] REFIID riid, [out, iid_is(riid)] void **object, [out] UINT32 *id);

    HRESULT SetTag([in, unique] IUnknown *object, [in] UINT32 id);

    HRESULT GetViewportRect([out, retval] RECT *viewport);

    HRESULT SetViewportRect([in] const RECT *viewport);

    HRESULT ZoomToRect([in] const float left, [in] const float top, [in] const float right,
                        [in] const float bottom, [in] BOOL animate);

    HRESULT SetViewportTransform([in] const float *matrix, [in] DWORD count);

    HRESULT SyncDisplayTransform([in] const float *matrix, [in] DWORD count);

    HRESULT GetPrimaryContent([in] REFIID riid, [out, iid_is(riid)] void **object);

    HRESULT AddContent([in, unique] IDirectManipulationContent *content);

    HRESULT RemoveContent([in, unique] IDirectManipulationContent *content);

    HRESULT SetViewportOptions([in] DIRECTMANIPULATION_VIEWPORT_OPTIONS options);

    HRESULT AddConfiguration([in] DIRECTMANIPULATION_CONFIGURATION configuration);

    HRESULT RemoveConfiguration([in] DIRECTMANIPULATION_CONFIGURATION configuration);

    HRESULT ActivateConfiguration([in] DIRECTMANIPULATION_CONFIGURATION configuration);

    HRESULT SetManualGesture([in] DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration);

    HRESULT SetChaining([in] DIRECTMANIPULATION_MOTION_TYPES enabledTypes);

    HRESULT AddEventHandler([in] HWND window, [in] IDirectManipulationViewportEventHandler *eventHandler,
                        [out, retval] DWORD *cookie);

    HRESULT RemoveEventHandler([in] DWORD cookie);

    HRESULT SetInputMode([in] DIRECTMANIPULATION_INPUT_MODE mode);

    HRESULT SetUpdateMode([in] DIRECTMANIPULATION_INPUT_MODE mode);

    HRESULT Stop();

    HRESULT Abandon();
}

[
    local,
    object,
    uuid(923ccaac-61e1-4385-b726-017af189882a),
    pointer_default(unique)
]
interface IDirectManipulationViewport2 : IDirectManipulationViewport
{
    HRESULT AddBehavior([in] IUnknown *behavior, [out, retval] DWORD *cookie);

    HRESULT RemoveBehavior([in] DWORD cookie);

    HRESULT RemoveAllBehaviors();
}

[
    local,
    object,
    uuid(952121DA-D69F-45F9-B0F9-F23944321A6D),
    pointer_default(unique)
]
interface IDirectManipulationViewportEventHandler : IUnknown
{
    HRESULT OnViewportStatusChanged([in] IDirectManipulationViewport *viewport, [in] DIRECTMANIPULATION_STATUS current,
                                    [in] DIRECTMANIPULATION_STATUS previous);

    HRESULT OnViewportUpdated([in] IDirectManipulationViewport *viewport);

    HRESULT OnContentUpdated([in] IDirectManipulationViewport *viewport, [in] IDirectManipulationContent *content);
}

[
    local,
    object,
    uuid(fa1005e9-3d16-484c-bfc9-62b61e56ec4e),
    pointer_default(unique)
]
interface IDirectManipulationManager2 : IDirectManipulationManager
{
    HRESULT CreateBehavior([in] REFCLSID clsid, [in] REFIID riid, [out, iid_is(riid), retval] void **obj);
}

[
    local,
    object,
    uuid(c12851e4-1698-4625-b9b1-7ca3ec18630b),
    pointer_default(unique)
]
interface IDirectManipulationPrimaryContent : IUnknown
{
    HRESULT SetSnapInterval([in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] float interval, [in] float offset);

    HRESULT SetSnapPoints([in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] const float *points, [in] DWORD count);

    HRESULT SetSnapType([in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] DIRECTMANIPULATION_SNAPPOINT_TYPE type);

    HRESULT SetSnapCoordinate([in] DIRECTMANIPULATION_MOTION_TYPES motion, [in] DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate,
                              [in] float origin);

    HRESULT SetZoomBoundaries([in] float minimum, [in] float maximum);

    HRESULT SetHorizontalAlignment([in] DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment);

    HRESULT SetVerticalAlignment([in] DIRECTMANIPULATION_VERTICALALIGNMENT alignment);

    HRESULT GetInertiaEndTransform([out] float *matrix, [in] DWORD count);

    HRESULT GetCenterPoint([out] float *x, [out] float *y);
}

381 382 383 384 385 386 387 388 389 390 391 392
[
    local,
    object,
    uuid(d38c7822-f1cb-43cb-b4b9-ac0c767a412e),
    pointer_default(unique)
]
interface IDirectManipulationCompositor2 : IDirectManipulationCompositor
{
    HRESULT AddContentWithCrossProcessChaining([in] IDirectManipulationPrimaryContent *content, [in] IUnknown *device,
                                               [in] IUnknown *parentVisual, [in] IUnknown *childVisual);
}

393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
[
    uuid(9fbedf98-f6d8-4e3b-b488-fa66dbf5e9f3),
    version(1.0)
]
library DirectManipulation
{
    [
        uuid(54e211b6-3650-4f75-8334-fa359598e1c5)
    ]
    coclass DirectManipulationManager
    {
        interface IDirectManipulationManager2;
        [default] interface IDirectManipulationManager;
    }

    [
        uuid(99793286-77cc-4b57-96db-3b354f6f9fb5)
    ]
    coclass DirectManipulationSharedManager
    {
        interface IDirectManipulationManager2;
        [default] interface IDirectManipulationManager;
    }

    [
        uuid(79dea627-a08a-43ac-8ef5-6900b9299126)
    ]
    coclass DCompManipulationCompositor
    {
        [default] interface IDirectManipulationCompositor;
423
        interface IDirectManipulationCompositor2;
424 425 426 427 428 429 430 431 432 433 434 435 436 437
        interface IDirectManipulationFrameInfoProvider;
    }

    [
        noncreatable,
        hidden,
        uuid(34e211b6-3650-4f75-8334-fa359598e1c5)
    ]
    coclass DirectManipulationViewport
    {
        interface IDirectManipulationViewport2;
        [default] interface IDirectManipulationViewport;
    }
}