private CefPrintDialogCallback(cef_print_dialog_callback_t *ptr)
 {
     if (ptr == null)
     {
         throw new ArgumentNullException("ptr");
     }
     _self = ptr;
 }
 internal static CefPrintDialogCallback FromNativeOrNull(cef_print_dialog_callback_t *ptr)
 {
     if (ptr == null)
     {
         return(null);
     }
     return(new CefPrintDialogCallback(ptr));
 }
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
Beispiel #5
0
        private int on_print_dialog(cef_print_handler_t *self, int has_selection, cef_print_dialog_callback_t *callback)
        {
            CheckSelf(self);

            var m_callback = CefPrintDialogCallback.FromNative(callback);
            var m_result   = OnPrintDialog(has_selection != 0, m_callback);

            return(m_result ? 1 : 0);
        }
        public static int release(cef_print_dialog_callback_t *self)
        {
            release_delegate d;
            var p = self->_base._release;

            if (p == _p1)
            {
                d = _d1;
            }
            else
            {
                d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
                if (_p1 == IntPtr.Zero)
                {
                    _d1 = d; _p1 = p;
                }
            }
            return(d(self));
        }
        public static int add_ref(cef_print_dialog_callback_t *self)
        {
            add_ref_delegate d;
            var p = self->_base._add_ref;

            if (p == _p0)
            {
                d = _d0;
            }
            else
            {
                d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
                if (_p0 == IntPtr.Zero)
                {
                    _d0 = d; _p0 = p;
                }
            }
            return(d(self));
        }
        public static void cancel(cef_print_dialog_callback_t *self)
        {
            cancel_delegate d;
            var             p = self->_cancel;

            if (p == _p4)
            {
                d = _d4;
            }
            else
            {
                d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
                if (_p4 == IntPtr.Zero)
                {
                    _d4 = d; _p4 = p;
                }
            }
            d(self);
        }
        public static void cont(cef_print_dialog_callback_t *self, cef_print_settings_t *settings)
        {
            cont_delegate d;
            var           p = self->_cont;

            if (p == _p3)
            {
                d = _d3;
            }
            else
            {
                d = (cont_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cont_delegate));
                if (_p3 == IntPtr.Zero)
                {
                    _d3 = d; _p3 = p;
                }
            }
            d(self, settings);
        }
        public static int get_refct(cef_print_dialog_callback_t *self)
        {
            get_refct_delegate d;
            var p = self->_base._get_refct;

            if (p == _p2)
            {
                d = _d2;
            }
            else
            {
                d = (get_refct_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_refct_delegate));
                if (_p2 == IntPtr.Zero)
                {
                    _d2 = d; _p2 = p;
                }
            }
            return(d(self));
        }
        public static int has_at_least_one_ref(cef_print_dialog_callback_t *self)
        {
            has_at_least_one_ref_delegate d;
            var p = self->_base._has_at_least_one_ref;

            if (p == _p3)
            {
                d = _d3;
            }
            else
            {
                d = (has_at_least_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_at_least_one_ref_delegate));
                if (_p3 == IntPtr.Zero)
                {
                    _d3 = d; _p3 = p;
                }
            }
            return(d(self));
        }
 internal static CefPrintDialogCallback FromNative(cef_print_dialog_callback_t *ptr)
 {
     return(new CefPrintDialogCallback(ptr));
 }
 private CefPrintDialogCallback(cef_print_dialog_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
Beispiel #14
0
 public CefPrintDialogCallback(cef_print_dialog_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Beispiel #15
0
 public unsafe extern int OnPrintDialog(cef_browser_t *browser, int has_selection, cef_print_dialog_callback_t *callback);
        /// <summary>
        /// Synchronize |settings| with client state. If |get_defaults| is true then
        /// populate |settings| with the default print settings. Do not keep a
        /// reference to |settings| outside of this callback.
        /// </summary>
        // protected abstract void OnPrintSettings(cef_print_settings_t* settings, int get_defaults);

        private int on_print_dialog(cef_print_handler_t *self, int has_selection, cef_print_dialog_callback_t *callback)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefPrintHandler.OnPrintDialog
        }