Beispiel #1
0
 private void CheckSelf(cef_accessibility_handler_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
        public CefAccessibilityHandler()
        {
            cef_accessibility_handler_t *self = this.NativeInstance;

            self->on_accessibility_tree_change     = (void *)Marshal.GetFunctionPointerForDelegate(fnOnAccessibilityTreeChange);
            self->on_accessibility_location_change = (void *)Marshal.GetFunctionPointerForDelegate(fnOnAccessibilityLocationChange);
        }
Beispiel #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_accessibility_handler_t.Free(_self);
         _self = null;
     }
 }
        private void on_accessibility_location_change(cef_accessibility_handler_t *self, cef_value_t *value)
        {
            CheckSelf(self);

            var mValue = CefValue.FromNativeOrNull(value);

            OnAccessibilityLocationChange(mValue);
        }
        // void (*)(_cef_accessibility_handler_t* self, _cef_value_t* value)*
        private static unsafe void OnAccessibilityLocationChangeImpl(cef_accessibility_handler_t *self, cef_value_t *value)
        {
            var instance = GetInstance((IntPtr)self) as CefAccessibilityHandler;

            if (instance == null || ((ICefAccessibilityHandlerPrivate)instance).AvoidOnAccessibilityLocationChange())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)value);
                return;
            }
            instance.OnAccessibilityLocationChange(CefValue.Wrap(CefValue.Create, value));
        }
Beispiel #6
0
 private void add_ref(cef_accessibility_handler_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Beispiel #7
0
        public CefAccessibilityHandler()
        {
            cef_accessibility_handler_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->on_accessibility_tree_change     = (void *)Marshal.GetFunctionPointerForDelegate(fnOnAccessibilityTreeChange);
            self->on_accessibility_location_change = (void *)Marshal.GetFunctionPointerForDelegate(fnOnAccessibilityLocationChange);
                        #else
            self->on_accessibility_tree_change     = (delegate * unmanaged[Stdcall] < cef_accessibility_handler_t *, cef_value_t *, void >) & OnAccessibilityTreeChangeImpl;
            self->on_accessibility_location_change = (delegate * unmanaged[Stdcall] < cef_accessibility_handler_t *, cef_value_t *, void >) & OnAccessibilityLocationChangeImpl;
                        #endif
        }
Beispiel #8
0
 private int release(cef_accessibility_handler_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return(1);
         }
         return(0);
     }
 }
Beispiel #9
0
        protected CefAccessibilityHandler()
        {
            _self = cef_accessibility_handler_t.Alloc();

            _ds0 = new cef_accessibility_handler_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_accessibility_handler_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_accessibility_handler_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_accessibility_handler_t.on_accessibility_tree_change_delegate(on_accessibility_tree_change);
            _self->_on_accessibility_tree_change = Marshal.GetFunctionPointerForDelegate(_ds3);
            _ds4 = new cef_accessibility_handler_t.on_accessibility_location_change_delegate(on_accessibility_location_change);
            _self->_on_accessibility_location_change = Marshal.GetFunctionPointerForDelegate(_ds4);
        }
 internal static void Free(cef_accessibility_handler_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 public CefAccessibilityHandler(cef_accessibility_handler_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Beispiel #12
0
 private int has_one_ref(cef_accessibility_handler_t *self)
 {
     lock (SyncRoot) { return(_refct == 1 ? 1 : 0); }
 }