Skip to content

Commit

Permalink
Simpler non-COM interface code gen (#2103)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Oct 18, 2022
1 parent 3b9f912 commit 962d0a9
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 415 deletions.
12 changes: 0 additions & 12 deletions crates/libs/bindgen/src/interfaces.rs
Expand Up @@ -51,18 +51,6 @@ fn gen_win_interface(gen: &Gen, def: TypeDef) -> TokenStream {
#features
#[repr(transparent)]
pub struct #ident(::std::ptr::NonNull<::std::ffi::c_void>);
#features
unsafe impl ::windows::core::Abi for Option<#ident> {
type Abi = *mut ::std::ffi::c_void;
}
#features
unsafe impl ::windows::core::Abi for #ident {
type Abi = *mut ::std::ffi::c_void;

fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
});
}

Expand Down
Expand Up @@ -92,15 +92,6 @@ pub struct ID3DDestructionNotifier_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D\"`*"]
#[repr(transparent)]
pub struct ID3DInclude(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3DInclude> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3DInclude {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3DInclude {
pub unsafe fn Open<'a, P0>(&self, includetype: D3D_INCLUDE_TYPE, pfilename: P0, pparentdata: *const ::core::ffi::c_void, ppdata: *mut *mut ::core::ffi::c_void, pbytes: *mut u32) -> ::windows::core::Result<()>
where
Expand Down
180 changes: 0 additions & 180 deletions crates/libs/windows/src/Windows/Win32/Graphics/Direct3D10/mod.rs
Expand Up @@ -2149,15 +2149,6 @@ pub struct ID3D10Effect_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectBlendVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectBlendVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectBlendVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectBlendVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -2291,15 +2282,6 @@ pub struct ID3D10EffectBlendVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectConstantBuffer(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectConstantBuffer> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectConstantBuffer {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectConstantBuffer {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -2443,15 +2425,6 @@ pub struct ID3D10EffectConstantBuffer_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectDepthStencilVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectDepthStencilVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectDepthStencilVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectDepthStencilVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -2586,15 +2559,6 @@ pub struct ID3D10EffectDepthStencilVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectDepthStencilViewVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectDepthStencilViewVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectDepthStencilViewVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectDepthStencilViewVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -2734,15 +2698,6 @@ pub struct ID3D10EffectDepthStencilViewVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectMatrixVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectMatrixVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectMatrixVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectMatrixVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -2894,15 +2849,6 @@ pub struct ID3D10EffectMatrixVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectPass(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectPass> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectPass {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectPass {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3017,15 +2963,6 @@ pub struct ID3D10EffectPool_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectRasterizerVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectRasterizerVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectRasterizerVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectRasterizerVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3160,15 +3097,6 @@ pub struct ID3D10EffectRasterizerVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectRenderTargetViewVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectRenderTargetViewVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectRenderTargetViewVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectRenderTargetViewVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3308,15 +3236,6 @@ pub struct ID3D10EffectRenderTargetViewVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectSamplerVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectSamplerVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectSamplerVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectSamplerVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3446,15 +3365,6 @@ pub struct ID3D10EffectSamplerVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectScalarVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectScalarVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectScalarVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectScalarVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3648,15 +3558,6 @@ pub struct ID3D10EffectScalarVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectShaderResourceVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectShaderResourceVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectShaderResourceVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectShaderResourceVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3796,15 +3697,6 @@ pub struct ID3D10EffectShaderResourceVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectShaderVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectShaderVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectShaderVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectShaderVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -3969,15 +3861,6 @@ pub struct ID3D10EffectShaderVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectStringVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectStringVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectStringVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectStringVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -4106,15 +3989,6 @@ pub struct ID3D10EffectStringVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectTechnique(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectTechnique> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectTechnique {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectTechnique {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -4185,15 +4059,6 @@ pub struct ID3D10EffectTechnique_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectType(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectType> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectType {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectType {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -4268,15 +4133,6 @@ pub struct ID3D10EffectType_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -4422,15 +4278,6 @@ pub struct ID3D10EffectVariable_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10EffectVectorVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10EffectVectorVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10EffectVectorVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10EffectVectorVariable {
#[doc = "*Required features: `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
Expand Down Expand Up @@ -5675,15 +5522,6 @@ pub struct ID3D10ShaderReflection1_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10ShaderReflectionConstantBuffer(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10ShaderReflectionConstantBuffer> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10ShaderReflectionConstantBuffer {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10ShaderReflectionConstantBuffer {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D\"`*"]
#[cfg(feature = "Win32_Graphics_Direct3D")]
Expand Down Expand Up @@ -5735,15 +5573,6 @@ pub struct ID3D10ShaderReflectionConstantBuffer_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10ShaderReflectionType(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10ShaderReflectionType> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10ShaderReflectionType {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10ShaderReflectionType {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D\"`*"]
#[cfg(feature = "Win32_Graphics_Direct3D")]
Expand Down Expand Up @@ -5798,15 +5627,6 @@ pub struct ID3D10ShaderReflectionType_Vtbl {
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
#[repr(transparent)]
pub struct ID3D10ShaderReflectionVariable(::std::ptr::NonNull<::std::ffi::c_void>);
unsafe impl ::windows::core::Abi for Option<ID3D10ShaderReflectionVariable> {
type Abi = *mut ::std::ffi::c_void;
}
unsafe impl ::windows::core::Abi for ID3D10ShaderReflectionVariable {
type Abi = *mut ::std::ffi::c_void;
fn abi_is_possibly_valid(abi: &Self::Abi) -> bool {
!abi.is_null()
}
}
impl ID3D10ShaderReflectionVariable {
pub unsafe fn GetDesc(&self) -> ::windows::core::Result<D3D10_SHADER_VARIABLE_DESC> {
let mut result__ = ::core::mem::MaybeUninit::zeroed();
Expand Down

0 comments on commit 962d0a9

Please sign in to comment.