// Copyright (c) Microsoft Corporation. All rights reserved. cpp_quote("#pragma region Application Family") cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)") #include import "oaidl.idl"; import "ocidl.idl"; import "inspectable.idl"; cpp_quote("// Win32 API definitions") cpp_quote("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)") cpp_quote("_Check_return_ HRESULT InitializeXamlDiagnostic(_In_ LPCWSTR endPointName, _In_ DWORD pid, _In_ LPCWSTR wszDllXamlDiagnostics, _In_ LPCWSTR wszTAPDllName, _In_ CLSID tapClsid);") cpp_quote("_Check_return_ HRESULT InitializeXamlDiagnosticsEx(_In_ LPCWSTR endPointName, _In_ DWORD pid, _In_ LPCWSTR wszDllXamlDiagnostics, _In_ LPCWSTR wszTAPDllName, _In_ CLSID tapClsid, _In_ LPCWSTR wszInitializationData);") // Typedefs. typedef unsigned hyper InstanceHandle; typedef enum VisualMutationType { Add = 0, Remove } VisualMutationType; typedef enum BaseValueSource { BaseValueSourceUnknown = 0, BaseValueSourceDefault, BaseValueSourceBuiltInStyle, BaseValueSourceStyle, BaseValueSourceLocal, Inherited, DefaultStyleTrigger, TemplateTrigger, StyleTrigger, ImplicitStyleReference, ParentTemplate, ParentTemplateTrigger, Animation, Coercion } BaseValueSource; // Structs. typedef struct SourceInfo { BSTR FileName; unsigned int LineNumber; unsigned int ColumnNumber; unsigned int CharPosition; BSTR Hash; } SourceInfo; typedef struct ParentChildRelation { InstanceHandle Parent; InstanceHandle Child; unsigned int ChildIndex; } ParentChildRelation; typedef struct VisualElement { InstanceHandle Handle; SourceInfo SrcInfo; BSTR Type; BSTR Name; unsigned int NumChildren; } VisualElement; typedef struct PropertyChainSource { InstanceHandle Handle; BSTR TargetType; BSTR Name; BaseValueSource Source; SourceInfo SrcInfo; } PropertyChainSource; typedef enum MetadataBit { IsValueHandle = 0x1, IsPropertyReadOnly = 0x2, IsValueCollection = 0x4, IsValueCollectionReadOnly = 0x8 } MetadataBit; typedef struct PropertyChainValue { unsigned int Index; BSTR Type; BSTR DeclaringType; BSTR ValueType; // Type of the current value. BSTR ItemType; // Collection item type or null for non-collections. BSTR Value; BOOL Overridden; hyper MetadataBits; // Bit field of booleans indexed by MetadataBit. BSTR PropertyName; unsigned int PropertyChainIndex; } PropertyChainValue; typedef struct EnumType { BSTR Name; SAFEARRAY(int) ValueInts; SAFEARRAY(BSTR) ValueStrings; } EnumType; typedef struct CollectionElementValue { unsigned int Index; // Collection index where the element was found. BSTR ValueType; // Type of the element object. BSTR Value; // Value of the element. hyper MetadataBits; // Bit field of booleans indexed by MetadataBit. } CollectionElementValue; // Interfaces. [ object, uuid(AA7A8931-80E4-4FEC-8F3B-553F87B4966E), pointer_default(unique) ] interface IVisualTreeServiceCallback : IUnknown { HRESULT OnVisualTreeChange( [in] ParentChildRelation relation, [in] VisualElement element, [in] VisualMutationType mutationType); }; [ object, uuid(A593B11A-D17F-48BB-8F66-83910731C8A5), pointer_default(unique) ] interface IVisualTreeService : IUnknown { // Mutation events. HRESULT AdviseVisualTreeChange( [in] IVisualTreeServiceCallback *pCallback); HRESULT UnadviseVisualTreeChange( [in] IVisualTreeServiceCallback *pCallback); // Get all available enums. HRESULT GetEnums( [out] unsigned int* pCount, [out, size_is(, *pCount)] EnumType** ppEnums); // Instance creation. HRESULT CreateInstance( [in] BSTR typeName, [in] BSTR value, [out, retval] InstanceHandle* pInstanceHandle); // Property get/set. HRESULT GetPropertyValuesChain( [in] InstanceHandle instanceHandle, [out] unsigned int* pSourceCount, [out, size_is(, *pSourceCount)] PropertyChainSource** ppPropertySources, [out] unsigned int* pPropertyCount, [out, size_is(, *pPropertyCount)] PropertyChainValue** ppPropertyValues); HRESULT SetProperty( [in] InstanceHandle instanceHandle, [in] InstanceHandle value, [in] unsigned int propertyIndex); HRESULT ClearProperty( [in] InstanceHandle instanceHandle, [in] unsigned int propertyIndex); // Collections. HRESULT GetCollectionCount( [in] InstanceHandle instanceHandle, [out] unsigned int* pCollectionSize); HRESULT GetCollectionElements( [in] InstanceHandle instanceHandle, [in] unsigned int startIndex, [in, out] unsigned int* pElementCount, [out, size_is(, *pElementCount)] CollectionElementValue** ppElementValues); HRESULT AddChild( [in] InstanceHandle parent, [in] InstanceHandle child, [in] unsigned int index); HRESULT RemoveChild( [in] InstanceHandle parent, [in] unsigned int index); HRESULT ClearChildren( [in] InstanceHandle parent); }; [ object, uuid(18C9E2B6-3F43-4116-9F2B-FF935D7770D2), pointer_default(unique) ] interface IXamlDiagnostics : IUnknown { HRESULT GetDispatcher( [out, retval] IInspectable** ppDispatcher); HRESULT GetUiLayer( [out, retval] IInspectable** ppLayer); HRESULT GetApplication( [out, retval] IInspectable** ppApplication); HRESULT GetIInspectableFromHandle( [in] InstanceHandle instanceHandle, [out, retval] IInspectable** ppInstance); HRESULT GetHandleFromIInspectable( [in] IInspectable* pInstance, [out, retval] InstanceHandle* pHandle); HRESULT HitTest( [in] RECT rect, [out] unsigned int* pCount, [out, size_is(, *pCount)] InstanceHandle** ppInstanceHandles); HRESULT RegisterInstance( [in] IInspectable* pInstance, [out, retval] InstanceHandle *pInstanceHandle); HRESULT GetInitializationData( [out, retval] BSTR* pInitializationData); }; cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ ") cpp_quote("#pragma endregion")