private void CheckSelf(cef_resource_bundle_handler_t *self) { if (_self != self) { throw ExceptionBuilder.InvalidSelfReference(); } }
protected virtual void Dispose(bool disposing) { if (_self != null) { cef_resource_bundle_handler_t.Free(_self); _self = null; } }
public CefResourceBundleHandler() { cef_resource_bundle_handler_t *self = this.NativeInstance; self->get_localized_string = (void *)Marshal.GetFunctionPointerForDelegate(fnGetLocalizedString); self->get_data_resource = (void *)Marshal.GetFunctionPointerForDelegate(fnGetDataResource); self->get_data_resource_for_scale = (void *)Marshal.GetFunctionPointerForDelegate(fnGetDataResourceForScale); }
private int get_data_resource(cef_resource_bundle_handler_t *self, int resource_id, void **data, UIntPtr *data_size) { CheckSelf(self); var result = GetDataResource(resource_id, data, data_size); return(result ? 1 : 0); }
private int get_data_resource_for_scale(cef_resource_bundle_handler_t *self, int resource_id, CefScaleFactor scale_factor, void **data, UIntPtr *data_size) { CheckSelf(self); var result = GetDataResourceForScale(resource_id, scale_factor, data, data_size); return(result ? 1 : 0); }
protected virtual void Dispose(bool disposing) { if (_self != null) { cef_resource_bundle_handler_t.Free(_self); _self = null; } }
private void add_ref(cef_resource_bundle_handler_t *self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
private int release(cef_resource_bundle_handler_t *self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } } return(result); } }
public CefResourceBundleHandler() { cef_resource_bundle_handler_t *self = this.NativeInstance; #if NET_LESS_5_0 self->get_localized_string = (void *)Marshal.GetFunctionPointerForDelegate(fnGetLocalizedString); self->get_data_resource = (void *)Marshal.GetFunctionPointerForDelegate(fnGetDataResource); self->get_data_resource_for_scale = (void *)Marshal.GetFunctionPointerForDelegate(fnGetDataResourceForScale); #else self->get_localized_string = (delegate * unmanaged[Stdcall] < cef_resource_bundle_handler_t *, int, cef_string_t *, int >) & GetLocalizedStringImpl; self->get_data_resource = (delegate * unmanaged[Stdcall] < cef_resource_bundle_handler_t *, int, void **, UIntPtr *, int >) & GetDataResourceImpl; self->get_data_resource_for_scale = (delegate * unmanaged[Stdcall] < cef_resource_bundle_handler_t *, int, CefScaleFactor, void **, UIntPtr *, int >) & GetDataResourceForScaleImpl; #endif }
protected CefResourceBundleHandler() { _self = cef_resource_bundle_handler_t.Alloc(); _ds0 = new cef_resource_bundle_handler_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_resource_bundle_handler_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_resource_bundle_handler_t.get_refct_delegate(get_refct); _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_resource_bundle_handler_t.get_localized_string_delegate(get_localized_string); _self->_get_localized_string = Marshal.GetFunctionPointerForDelegate(_ds3); _ds4 = new cef_resource_bundle_handler_t.get_data_resource_delegate(get_data_resource); _self->_get_data_resource = Marshal.GetFunctionPointerForDelegate(_ds4); }
protected CefResourceBundleHandler() { _self = cef_resource_bundle_handler_t.Alloc(); _ds0 = new cef_resource_bundle_handler_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_resource_bundle_handler_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_resource_bundle_handler_t.get_refct_delegate(get_refct); _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_resource_bundle_handler_t.get_localized_string_delegate(get_localized_string); _self->_get_localized_string = Marshal.GetFunctionPointerForDelegate(_ds3); _ds4 = new cef_resource_bundle_handler_t.get_data_resource_delegate(get_data_resource); _self->_get_data_resource = Marshal.GetFunctionPointerForDelegate(_ds4); }
/// <summary> /// Called to retrieve a localized translation for the string specified /// by |message_id|. To provide the translation set |string| to the /// translation string and return true (1). To use the default /// translation return false (0). /// /// WARNING: Be cautious when implementing this function. ID values are /// auto- generated when CEF is built and may change between versions. /// Existing ID values can be discovered by searching for *_strings.h in /// the "obj/global_intermediate" build output directory. /// </summary> private int get_localized_string(cef_resource_bundle_handler_t *self, int message_id, cef_string_t * @string) { ThrowIfObjectDisposed(); var m_string = cef_string_t.ToString(@string); var localizedString = this.GetLocalizedString(message_id, m_string); if (localizedString != null) { cef_string_t.Set(localizedString, @string, true); return(1); } return(0); }
private int get_localized_string(cef_resource_bundle_handler_t *self, int message_id, cef_string_t * @string) { CheckSelf(self); var value = GetLocalizedString(message_id); if (value != null) { cef_string_t.Copy(value, @string); return(1); } else { return(0); } }
private int get_localized_string(cef_resource_bundle_handler_t *self, int string_id, cef_string_t * @string) { CheckSelf(self); string mValue; var result = GetLocalizedString(string_id, out mValue); if (result) { cef_string_t.Copy(mValue, @string); return(1); } else { return(0); } }
private int get_data_resource_for_scale(cef_resource_bundle_handler_t *self, int resource_id, CefScaleFactor scale_factor, void **data, UIntPtr *data_size) { CheckSelf(self); void * mData; UIntPtr mDataSize; var result = GetDataResourceForScale(resource_id, scale_factor, out mData, out mDataSize); if (result) { *data = mData; *data_size = mDataSize; return(1); } else { return(0); } }
private int get_data_resource(cef_resource_bundle_handler_t *self, int resource_id, void **data, UIntPtr *data_size) { CheckSelf(self); return(0); // TODO: CefResourceBundleHandler.GetDataResource }
/// <summary> /// Called to retrieve data for the resource specified by |resource_id|. /// To provide the resource data set |data| and |data_size| to the data /// pointer and size respectively and return true (1). To use the default /// resource data return false (0). The resource data will not be copied /// and must remain resident in memory. /// /// WARNING: Be cautious when implementing this function. ID values are /// auto- generated when CEF is built and may change between versions. /// Existing ID values can be discovered by searching for *_resources.h /// in the "obj/global_intermediate" build output directory. /// </summary> private int get_data_resource(cef_resource_bundle_handler_t *self, int resource_id, void **data, int *data_size) { ThrowIfObjectDisposed(); // TODO: Implement GetDataResource() throw new NotImplementedException(); }
private int get_refct(cef_resource_bundle_handler_t *self) { return(_refct); }
public CefResourceBundleHandler() { cef_resource_bundle_handler_t *self = FixedPtr; }
public CefResourceBundleHandler(cef_resource_bundle_handler_t *instance) : base((cef_base_ref_counted_t *)instance) { }
/// <summary> /// Called to retrieve a localized translation for the string specified by /// |message_id|. To provide the translation set |string| to the translation /// string and return true. To use the default translation return false. /// Supported message IDs are listed in cef_pack_strings.h. /// </summary> // protected abstract int GetLocalizedString(int message_id, cef_string_t* @string); private int get_data_resource(cef_resource_bundle_handler_t *self, int resource_id, void **data, UIntPtr *data_size) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefResourceBundleHandler.GetDataResource }
private int has_at_least_one_ref(cef_resource_bundle_handler_t *self) { lock (SyncRoot) { return(_refct != 0 ? 1 : 0); } }
internal static void Free(cef_resource_bundle_handler_t *ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private int get_localized_string(cef_resource_bundle_handler_t *self, int message_id, cef_string_t * @string) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefResourceBundleHandler.GetLocalizedString }