// Case 1) User created structure: // allocate native on creation, free native on dispose. internal CfxStructure(CfxApi.cfx_ctor_delegate cfx_ctor, CfxApi.cfx_dtor_delegate cfx_dtor) { this.m_cfx_dtor = cfx_dtor; //this might happen if the application tries to instanciate a platform specific struct //on the wrong platform. if(cfx_ctor == null) return; CreateNative(cfx_ctor); }
// Case 1) User created structure: // allocate native on creation, free native on dispose. internal CfxStructure(CfxApi.cfx_ctor_delegate cfx_ctor, CfxApi.cfx_dtor_delegate cfx_dtor) { this.m_cfx_dtor = cfx_dtor; //this might happen if the application tries to instanciate a platform specific struct //on the wrong platform. if (cfx_ctor == null) { return; } CreateNative(cfx_ctor); }
// Case 1) User created structure: // allocate native on creation, free native on dispose. internal CfxStructure(CfxApi.cfx_ctor_delegate cfx_ctor, CfxApi.cfx_dtor_delegate cfx_dtor) { this.m_cfx_dtor = cfx_dtor; //this might happen if the application tries to instanciate a platform specific struct //on the wrong platform. if (cfx_ctor == null) { return; } var nativePtr = cfx_ctor(); if (nativePtr == IntPtr.Zero) { throw new OutOfMemoryException(); } SetNative(nativePtr); }
internal CfxWindowInfoLinux(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxBrowserSettings(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxCursorInfo(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxCookie(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxKeyEvent(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxDraggableRegion(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
// Case 3) struct passed in from framework as a return value // native layer makes a copy -> free native pointer on dispose internal CfxStructure(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) { this.m_cfx_dtor = cfx_dtor; SetNative(nativePtr); }
internal CfxPopupFeatures(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxInsets(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxGeoposition(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }
internal CfxPageRange(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor) : base(nativePtr, cfx_dtor) { }