widl: Properly align name table entries.
[wine.git] / dlls / windows.devices.enumeration / private.h
blob06234e984e03829b012002e061e3b1fbc3765919
1 /* WinRT Windows.Devices.Enumeration implementation
3 * Copyright 2021 Gijs Vermeulen
4 * Copyright 2022 Julian Klemann for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINDOWS_DEVICES_ENUMERATION_PRIVATE_H
22 #define __WINE_WINDOWS_DEVICES_ENUMERATION_PRIVATE_H
24 #include <stdarg.h>
26 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winstring.h"
30 #include "objbase.h"
32 #include "activation.h"
34 #define WIDL_using_Windows_Foundation
35 #define WIDL_using_Windows_Foundation_Collections
36 #include "windows.foundation.h"
37 #define WIDL_using_Windows_Devices_Enumeration
38 #include "windows.devices.enumeration.h"
40 #include "wine/list.h"
42 extern IActivationFactory *device_access_factory;
44 HRESULT typed_event_handlers_append( struct list *list, ITypedEventHandler_IInspectable_IInspectable *handler, EventRegistrationToken *token );
45 HRESULT typed_event_handlers_remove( struct list *list, EventRegistrationToken *token );
46 HRESULT typed_event_handlers_notify( struct list *list, IInspectable *sender, IInspectable *args );
47 HRESULT typed_event_handlers_clear( struct list *list );
49 #define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
50 static inline impl_type *impl_from( iface_type *iface ) \
51 { \
52 return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
53 } \
54 static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
55 { \
56 impl_type *impl = impl_from( iface ); \
57 return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
58 } \
59 static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
60 { \
61 impl_type *impl = impl_from( iface ); \
62 return IInspectable_AddRef( (IInspectable *)(expr) ); \
63 } \
64 static ULONG WINAPI pfx##_Release( iface_type *iface ) \
65 { \
66 impl_type *impl = impl_from( iface ); \
67 return IInspectable_Release( (IInspectable *)(expr) ); \
68 } \
69 static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
70 { \
71 impl_type *impl = impl_from( iface ); \
72 return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
73 } \
74 static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
75 { \
76 impl_type *impl = impl_from( iface ); \
77 return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
78 } \
79 static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
80 { \
81 impl_type *impl = impl_from( iface ); \
82 return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
84 #define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
85 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
86 #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \
87 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface )
89 #endif