| 1 |
/* |
| 2 |
* Copyright (C) 2023 Mohamad Al-Jaf |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
import "windows.foundation.numerics.idl"; |
| 29 |
/* import "windows.perception.idl"; */ |
| 30 |
import "windows.storage.streams.idl"; |
| 31 |
/* import "windows.system.remotesystems.idl"; */ |
| 32 |
|
| 33 |
namespace Windows.Perception.Spatial { |
| 34 |
typedef enum SpatialPerceptionAccessStatus SpatialPerceptionAccessStatus; |
| 35 |
typedef struct SpatialBoundingBox SpatialBoundingBox; |
| 36 |
typedef struct SpatialBoundingFrustum SpatialBoundingFrustum; |
| 37 |
typedef struct SpatialBoundingOrientedBox SpatialBoundingOrientedBox; |
| 38 |
typedef struct SpatialBoundingSphere SpatialBoundingSphere; |
| 39 |
typedef enum SpatialAnchorExportPurpose SpatialAnchorExportPurpose; |
| 40 |
|
| 41 |
interface ISpatialBoundingVolume; |
| 42 |
interface ISpatialBoundingVolumeStatics; |
| 43 |
interface ISpatialCoordinateSystem; |
| 44 |
interface ISpatialAnchorRawCoordinateSystemAdjustedEventArgs; |
| 45 |
interface ISpatialAnchor; |
| 46 |
interface ISpatialAnchorStatics; |
| 47 |
interface ISpatialAnchorExportSufficiency; |
| 48 |
interface ISpatialAnchorExporter; |
| 49 |
interface ISpatialAnchorExporterStatics; |
| 50 |
|
| 51 |
runtimeclass SpatialBoundingVolume; |
| 52 |
runtimeclass SpatialCoordinateSystem; |
| 53 |
runtimeclass SpatialAnchorRawCoordinateSystemAdjustedEventArgs; |
| 54 |
runtimeclass SpatialAnchor; |
| 55 |
runtimeclass SpatialAnchorExportSufficiency; |
| 56 |
runtimeclass SpatialAnchorExporter; |
| 57 |
|
| 58 |
declare { |
| 59 |
interface Windows.Foundation.Collections.IIterable<Windows.Perception.Spatial.SpatialBoundingVolume *>; |
| 60 |
interface Windows.Foundation.Collections.IIterator<Windows.Perception.Spatial.SpatialBoundingVolume *>; |
| 61 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Perception.Spatial.SpatialPerceptionAccessStatus>; |
| 62 |
interface Windows.Foundation.IAsyncOperation<Windows.Perception.Spatial.SpatialPerceptionAccessStatus>; |
| 63 |
interface Windows.Foundation.IReference<Windows.Perception.Spatial.SpatialBoundingBox>; |
| 64 |
interface Windows.Foundation.IReference<Windows.Perception.Spatial.SpatialBoundingFrustum>; |
| 65 |
interface Windows.Foundation.IReference<Windows.Perception.Spatial.SpatialBoundingOrientedBox>; |
| 66 |
interface Windows.Foundation.TypedEventHandler<Windows.Perception.Spatial.SpatialAnchor *, Windows.Perception.Spatial.SpatialAnchorRawCoordinateSystemAdjustedEventArgs *>; |
| 67 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Perception.Spatial.SpatialAnchorExportSufficiency *>; |
| 68 |
interface Windows.Foundation.IAsyncOperation<Windows.Perception.Spatial.SpatialAnchorExportSufficiency *>; |
| 69 |
} |
| 70 |
|
| 71 |
[ |
| 72 |
contract(Windows.Foundation.UniversalApiContract, 2.0) |
| 73 |
] |
| 74 |
enum SpatialPerceptionAccessStatus |
| 75 |
{ |
| 76 |
Unspecified = 0, |
| 77 |
Allowed = 1, |
| 78 |
DeniedByUser = 2, |
| 79 |
DeniedBySystem = 3, |
| 80 |
}; |
| 81 |
|
| 82 |
[ |
| 83 |
contract(Windows.Foundation.UniversalApiContract, 7.0) |
| 84 |
] |
| 85 |
enum SpatialAnchorExportPurpose |
| 86 |
{ |
| 87 |
Relocalization = 0, |
| 88 |
Sharing = 1 |
| 89 |
}; |
| 90 |
|
| 91 |
[ |
| 92 |
contract(Windows.Foundation.UniversalApiContract, 2.0) |
| 93 |
] |
| 94 |
struct SpatialBoundingBox |
| 95 |
{ |
| 96 |
Windows.Foundation.Numerics.Vector3 Center; |
| 97 |
Windows.Foundation.Numerics.Vector3 Extents; |
| 98 |
}; |
| 99 |
|
| 100 |
[ |
| 101 |
contract(Windows.Foundation.UniversalApiContract, 2.0) |
| 102 |
] |
| 103 |
struct SpatialBoundingFrustum |
| 104 |
{ |
| 105 |
Windows.Foundation.Numerics.Plane Near; |
| 106 |
Windows.Foundation.Numerics.Plane Far; |
| 107 |
Windows.Foundation.Numerics.Plane Right; |
| 108 |
Windows.Foundation.Numerics.Plane Left; |
| 109 |
Windows.Foundation.Numerics.Plane Top; |
| 110 |
Windows.Foundation.Numerics.Plane Bottom; |
| 111 |
}; |
| 112 |
|
| 113 |
[ |
| 114 |
contract(Windows.Foundation.UniversalApiContract, 2.0) |
| 115 |
] |
| 116 |
struct SpatialBoundingOrientedBox |
| 117 |
{ |
| 118 |
Windows.Foundation.Numerics.Vector3 Center; |
| 119 |
Windows.Foundation.Numerics.Vector3 Extents; |
| 120 |
Windows.Foundation.Numerics.Quaternion Orientation; |
| 121 |
}; |
| 122 |
|
| 123 |
[ |
| 124 |
contract(Windows.Foundation.UniversalApiContract, 2.0) |
| 125 |
] |
| 126 |
struct SpatialBoundingSphere |
| 127 |
{ |
| 128 |
Windows.Foundation.Numerics.Vector3 Center; |
| 129 |
FLOAT Radius; |
| 130 |
}; |
| 131 |
|
| 132 |
[ |
| 133 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 134 |
exclusiveto(Windows.Perception.Spatial.SpatialBoundingVolume), |
| 135 |
uuid(fb2065da-68c3-33df-b7af-4c787207999c) |
| 136 |
] |
| 137 |
interface ISpatialBoundingVolume : IInspectable |
| 138 |
{ |
| 139 |
} |
| 140 |
|
| 141 |
[ |
| 142 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 143 |
exclusiveto(Windows.Perception.Spatial.SpatialBoundingVolume), |
| 144 |
uuid(05889117-b3e1-36d8-b017-566181a5b196) |
| 145 |
] |
| 146 |
interface ISpatialBoundingVolumeStatics : IInspectable |
| 147 |
{ |
| 148 |
HRESULT FromBox( |
| 149 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *system, |
| 150 |
[in] Windows.Perception.Spatial.SpatialBoundingBox box, |
| 151 |
[out, retval] Windows.Perception.Spatial.SpatialBoundingVolume **value |
| 152 |
); |
| 153 |
HRESULT FromOrientedBox( |
| 154 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *system, |
| 155 |
[in] Windows.Perception.Spatial.SpatialBoundingOrientedBox box, |
| 156 |
[out, retval] Windows.Perception.Spatial.SpatialBoundingVolume **value |
| 157 |
); |
| 158 |
HRESULT FromSphere( |
| 159 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *system, |
| 160 |
[in] Windows.Perception.Spatial.SpatialBoundingSphere sphere, |
| 161 |
[out, retval] Windows.Perception.Spatial.SpatialBoundingVolume **value |
| 162 |
); |
| 163 |
HRESULT FromFrustum( |
| 164 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *system, |
| 165 |
[in] Windows.Perception.Spatial.SpatialBoundingFrustum frustum, |
| 166 |
[out, retval] Windows.Perception.Spatial.SpatialBoundingVolume **value |
| 167 |
); |
| 168 |
} |
| 169 |
|
| 170 |
[ |
| 171 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 172 |
exclusiveto(Windows.Perception.Spatial.SpatialCoordinateSystem), |
| 173 |
uuid(69ebca4b-60a3-3586-a653-59a7bd676d07) |
| 174 |
] |
| 175 |
interface ISpatialCoordinateSystem : IInspectable |
| 176 |
{ |
| 177 |
HRESULT TryGetTransformTo( |
| 178 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *target, |
| 179 |
[out, retval] Windows.Foundation.IReference<Windows.Foundation.Numerics.Matrix4x4> **value |
| 180 |
); |
| 181 |
} |
| 182 |
|
| 183 |
[ |
| 184 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 185 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchor), |
| 186 |
uuid(a9928642-0174-311c-ae79-0e5107669f16), |
| 187 |
] |
| 188 |
interface ISpatialAnchorStatics : IInspectable |
| 189 |
{ |
| 190 |
[overload("TryCreateRelativeTo")] HRESULT TryCreateRelativeTo( |
| 191 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *coord_system, |
| 192 |
[out] [retval] Windows.Perception.Spatial.SpatialAnchor **value |
| 193 |
); |
| 194 |
[overload("TryCreateRelativeTo")] HRESULT TryCreateWithPositionRelativeTo( |
| 195 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *coord_system, |
| 196 |
[in] Windows.Foundation.Numerics.Vector3 position, |
| 197 |
[out] [retval] Windows.Perception.Spatial.SpatialAnchor **value |
| 198 |
); |
| 199 |
[overload("TryCreateRelativeTo")] HRESULT TryCreateWithPositionAndOrientationRelativeTo( |
| 200 |
[in] Windows.Perception.Spatial.SpatialCoordinateSystem *coord_system, |
| 201 |
[in] Windows.Foundation.Numerics.Vector3 position, |
| 202 |
[in] Windows.Foundation.Numerics.Quaternion orientation, |
| 203 |
[out] [retval] Windows.Perception.Spatial.SpatialAnchor **value |
| 204 |
); |
| 205 |
} |
| 206 |
|
| 207 |
[ |
| 208 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 209 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchor), |
| 210 |
uuid(0529e5ce-1d34-3702-bcec-eabff578a869), |
| 211 |
] |
| 212 |
interface ISpatialAnchor : IInspectable |
| 213 |
{ |
| 214 |
[propget] HRESULT CoordinateSystem([out] [retval] Windows.Perception.Spatial.SpatialCoordinateSystem **value); |
| 215 |
[propget] HRESULT RawCoordinateSystem([out] [retval] Windows.Perception.Spatial.SpatialCoordinateSystem **value); |
| 216 |
[eventadd] HRESULT RawCoordinateSystemAdjusted( |
| 217 |
[in] Windows.Foundation.TypedEventHandler<Windows.Perception.Spatial.SpatialAnchor *, |
| 218 |
Windows.Perception.Spatial.SpatialAnchorRawCoordinateSystemAdjustedEventArgs*> *handler, |
| 219 |
[out] [retval] EventRegistrationToken *cookie |
| 220 |
); |
| 221 |
[eventremove] HRESULT RawCoordinateSystemAdjusted([in] EventRegistrationToken cookie); |
| 222 |
} |
| 223 |
|
| 224 |
[ |
| 225 |
contract(Windows.Foundation.UniversalApiContract, 7.0), |
| 226 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchorExportSufficiency), |
| 227 |
uuid(77c25b2b-3409-4088-b91b-fdfd05d1648f), |
| 228 |
] |
| 229 |
interface ISpatialAnchorExportSufficiency : IInspectable |
| 230 |
{ |
| 231 |
[propget] HRESULT IsMinimallySufficient([out] [retval] boolean *value); |
| 232 |
[propget] HRESULT SufficiencyLevel([out] [retval] DOUBLE *value); |
| 233 |
[propget] HRESULT RecommendedSufficiencyLevel([out] [retval] DOUBLE *value); |
| 234 |
} |
| 235 |
|
| 236 |
[ |
| 237 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 238 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchorRawCoordinateSystemAdjustedEventArgs), |
| 239 |
uuid(a1e81eb8-56c7-3117-a2e4-81e0fcf28e00), |
| 240 |
] |
| 241 |
interface ISpatialAnchorRawCoordinateSystemAdjustedEventArgs : IInspectable |
| 242 |
{ |
| 243 |
[propget] HRESULT OldRawCoordinateSystemToNewRawCoordinateSystemTransform([out] [retval] Windows.Foundation.Numerics.Matrix4x4 *value); |
| 244 |
} |
| 245 |
|
| 246 |
[ |
| 247 |
contract(Windows.Foundation.UniversalApiContract, 7.0), |
| 248 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchorExporter), |
| 249 |
uuid(9a2a4338-24fb-4269-89c5-88304aeef20f), |
| 250 |
] |
| 251 |
interface ISpatialAnchorExporter : IInspectable |
| 252 |
{ |
| 253 |
HRESULT GetAnchorExportSufficiencyAsync( |
| 254 |
[in] Windows.Perception.Spatial.SpatialAnchor *anchor, |
| 255 |
[in] Windows.Perception.Spatial.SpatialAnchorExportPurpose purpose, |
| 256 |
[out] [retval] Windows.Foundation.IAsyncOperation<Windows.Perception.Spatial.SpatialAnchorExportSufficiency*> **operation |
| 257 |
); |
| 258 |
HRESULT TryExportAnchorAsync( |
| 259 |
[in] Windows.Perception.Spatial.SpatialAnchor* anchor, |
| 260 |
[in] Windows.Perception.Spatial.SpatialAnchorExportPurpose purpose, |
| 261 |
[in] Windows.Storage.Streams.IOutputStream* stream, |
| 262 |
[out] [retval] Windows.Foundation.IAsyncOperation<boolean>** operation |
| 263 |
); |
| 264 |
} |
| 265 |
|
| 266 |
[ |
| 267 |
contract(Windows.Foundation.UniversalApiContract, 7.0), |
| 268 |
exclusiveto(Windows.Perception.Spatial.SpatialAnchorExporter), |
| 269 |
uuid(ed2507b8-2475-439c-85ff-7fed341fdc88), |
| 270 |
] |
| 271 |
interface ISpatialAnchorExporterStatics : IInspectable |
| 272 |
{ |
| 273 |
HRESULT GetDefault([out] [retval] Windows.Perception.Spatial.SpatialAnchorExporter **value); |
| 274 |
HRESULT RequestAccessAsync([out] [retval] Windows.Foundation.IAsyncOperation<Windows.Perception.Spatial.SpatialPerceptionAccessStatus> **result); |
| 275 |
} |
| 276 |
|
| 277 |
[ |
| 278 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 279 |
marshaling_behavior(agile), |
| 280 |
static(Windows.Perception.Spatial.ISpatialBoundingVolumeStatics, Windows.Foundation.UniversalApiContract, 2.0), |
| 281 |
threading(both) |
| 282 |
] |
| 283 |
runtimeclass SpatialBoundingVolume |
| 284 |
{ |
| 285 |
[default] interface Windows.Perception.Spatial.ISpatialBoundingVolume; |
| 286 |
} |
| 287 |
|
| 288 |
[ |
| 289 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 290 |
marshaling_behavior(agile), |
| 291 |
threading(both) |
| 292 |
] |
| 293 |
runtimeclass SpatialCoordinateSystem |
| 294 |
{ |
| 295 |
[default] interface Windows.Perception.Spatial.ISpatialCoordinateSystem; |
| 296 |
} |
| 297 |
|
| 298 |
[ |
| 299 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 300 |
marshaling_behavior(agile), |
| 301 |
static(Windows.Perception.Spatial.ISpatialAnchorStatics, Windows.Foundation.UniversalApiContract, 2.0), |
| 302 |
threading(both), |
| 303 |
] |
| 304 |
runtimeclass SpatialAnchor |
| 305 |
{ |
| 306 |
[default] interface Windows.Perception.Spatial.ISpatialAnchor; |
| 307 |
} |
| 308 |
|
| 309 |
[ |
| 310 |
contract(Windows.Foundation.UniversalApiContract, 7.0), |
| 311 |
marshaling_behavior(agile), |
| 312 |
threading(both), |
| 313 |
] |
| 314 |
runtimeclass SpatialAnchorExportSufficiency |
| 315 |
{ |
| 316 |
[default] interface Windows.Perception.Spatial.ISpatialAnchorExportSufficiency; |
| 317 |
} |
| 318 |
|
| 319 |
[ |
| 320 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 321 |
marshaling_behavior(agile), |
| 322 |
threading(both), |
| 323 |
] |
| 324 |
runtimeclass SpatialAnchorRawCoordinateSystemAdjustedEventArgs |
| 325 |
{ |
| 326 |
[default] interface Windows.Perception.Spatial.ISpatialAnchorRawCoordinateSystemAdjustedEventArgs; |
| 327 |
} |
| 328 |
|
| 329 |
[ |
| 330 |
contract(Windows.Foundation.UniversalApiContract, 7.0), |
| 331 |
marshaling_behavior(agile), |
| 332 |
static(Windows.Perception.Spatial.ISpatialAnchorExporterStatics, Windows.Foundation.UniversalApiContract, 7.0), |
| 333 |
threading(both), |
| 334 |
] |
| 335 |
runtimeclass SpatialAnchorExporter |
| 336 |
{ |
| 337 |
[default] interface Windows.Perception.Spatial.ISpatialAnchorExporter; |
| 338 |
} |
| 339 |
} |