コード例 #1
0
ファイル: CfxStructure.cs プロジェクト: xmcy0011/NanUI
 // 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);
 }
コード例 #2
0
ファイル: CfxTime.cs プロジェクト: xmcy0011/NanUI
 internal CfxTime(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor)
     : base(nativePtr, cfx_dtor)
 {
 }
コード例 #3
0
ファイル: CfxObject.cs プロジェクト: xmcy0011/NanUI
 internal void CreateNative(CfxApi.cfx_ctor_delegate cfx_ctor)
 {
     m_nativePtr = cfx_ctor();
     if(m_nativePtr == IntPtr.Zero)
         throw new OutOfMemoryException();
 }
コード例 #4
0
ファイル: CfxObject.cs プロジェクト: xmcy0011/NanUI
 internal void CreateNative(CfxApi.cfx_ctor_with_gc_handle_delegate cfx_ctor)
 {
     // must be a weak handle
     // otherwise transient callback structs never go out of scope if
     // they are not explicitly disposed
     System.Runtime.InteropServices.GCHandle handle =
         System.Runtime.InteropServices.GCHandle.Alloc(this, System.Runtime.InteropServices.GCHandleType.Weak);
     m_nativePtr = cfx_ctor(System.Runtime.InteropServices.GCHandle.ToIntPtr(handle));
     if(m_nativePtr == IntPtr.Zero)
         throw new OutOfMemoryException();
 }
コード例 #5
0
ファイル: CfxBrowserSettings.cs プロジェクト: xmcy0011/NanUI
 internal CfxBrowserSettings(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor)
     : base(nativePtr, cfx_dtor)
 {
 }
コード例 #6
0
 /// <summary>
 /// Sets the value at the specified index as type int. Returns true (1) if the
 /// value was set successfully.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetInt(int index, int value)
 {
     return(0 != CfxApi.cfx_list_value_set_int(NativePtr, index, value));
 }
コード例 #7
0
 /// <summary>
 /// Sets the value at the specified index as type bool. Returns true (1) if the
 /// value was set successfully.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetBool(int index, bool value)
 {
     return(0 != CfxApi.cfx_list_value_set_bool(NativePtr, index, value ? 1 : 0));
 }
コード例 #8
0
 /// <summary>
 /// Sets the value at the specified index as type null. Returns true (1) if the
 /// value was set successfully.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetNull(int index)
 {
     return(0 != CfxApi.cfx_list_value_set_null(NativePtr, index));
 }
コード例 #9
0
 /// <summary>
 /// Returns the value at the specified index as type list. The returned value
 /// will reference existing data and modifications to the value will modify
 /// this object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public CfxListValue GetList(int index)
 {
     return(CfxListValue.Wrap(CfxApi.cfx_list_value_get_list(NativePtr, index)));
 }
コード例 #10
0
ファイル: CfxScreenInfo.cs プロジェクト: xmcy0011/NanUI
 internal CfxScreenInfo(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor)
     : base(nativePtr, cfx_dtor)
 {
 }
コード例 #11
0
 internal CfxWindowInfoWindows(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor)
     : base(nativePtr, cfx_dtor)
 {
 }
コード例 #12
0
ファイル: CfxBase.cs プロジェクト: xmcy0011/NanUI
 internal CfxBase(CfxApi.cfx_ctor_with_gc_handle_delegate cfx_ctor)
 {
     CreateNative(cfx_ctor);
 }
コード例 #13
0
ファイル: CfxStructure.cs プロジェクト: xmcy0011/NanUI
 // 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);
 }
コード例 #14
0
ファイル: CfxDraggableRegion.cs プロジェクト: xmcy0011/NanUI
 internal CfxDraggableRegion(IntPtr nativePtr, CfxApi.cfx_dtor_delegate cfx_dtor)
     : base(nativePtr, cfx_dtor)
 {
 }