From b4f02cd86f900d80b59d3aa973465fdd268d46e6 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 9 May 2024 13:01:04 +0200 Subject: [PATCH] Simplify --- src/NetVips/Internal/GObject.cs | 10 ++-------- src/NetVips/Internal/Vips.cs | 10 ++-------- src/NetVips/VipsProgress.cs | 7 ++++++- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/NetVips/Internal/GObject.cs b/src/NetVips/Internal/GObject.cs index 1c764726..f919d7a7 100644 --- a/src/NetVips/Internal/GObject.cs +++ b/src/NetVips/Internal/GObject.cs @@ -15,7 +15,7 @@ internal static class GObject [StructLayout(LayoutKind.Sequential)] internal struct Struct { - internal GType.Instance GTypeInstance; + internal IntPtr GTypeInstance; internal uint RefCount; @@ -76,12 +76,6 @@ internal struct GEnumClass internal static class GType { - [StructLayout(LayoutKind.Sequential)] - internal struct Instance - { - internal IntPtr GClass; - } - [SuppressUnmanagedCodeSecurity] [DllImport(Libraries.GObject, CallingConvention = CallingConvention.Cdecl, EntryPoint = "g_type_name")] @@ -218,7 +212,7 @@ internal static class GParamSpec [StructLayout(LayoutKind.Sequential)] internal struct Struct { - internal GType.Instance GTypeInstance; + internal IntPtr GTypeInstance; internal IntPtr Name; diff --git a/src/NetVips/Internal/Vips.cs b/src/NetVips/Internal/Vips.cs index fe1572fe..ecd355ad 100644 --- a/src/NetVips/Internal/Vips.cs +++ b/src/NetVips/Internal/Vips.cs @@ -260,16 +260,10 @@ internal static extern int SetFromString(VipsObjectManaged @object, internal static extern IntPtr GetDescription(VipsObjectManaged @object); } - [StructLayout(LayoutKind.Sequential)] - internal struct VipsArgument - { - internal IntPtr Pspec; - } - [StructLayout(LayoutKind.Sequential)] internal struct VipsArgumentClass { - internal VipsArgument Parent; + internal IntPtr Parent; internal IntPtr ObjectClass; internal ArgumentFlags Flags; @@ -280,7 +274,7 @@ internal struct VipsArgumentClass [StructLayout(LayoutKind.Sequential)] internal struct VipsArgumentInstance { - internal VipsArgument Parent; + internal IntPtr Parent; internal IntPtr ArgumentClass; internal IntPtr Object; diff --git a/src/NetVips/VipsProgress.cs b/src/NetVips/VipsProgress.cs index b0b4a53d..a086d224 100644 --- a/src/NetVips/VipsProgress.cs +++ b/src/NetVips/VipsProgress.cs @@ -66,6 +66,11 @@ public struct VipsProgress /// /// Start time. /// - public GTimer Start; + private IntPtr StartPtr; + + /// + /// Start time. + /// + public GTimer Start => Marshal.PtrToStructure(StartPtr); } } \ No newline at end of file