Exemplo n.º 1
0
        /// <summary>
        /// Handles load data notification
        /// </summary>
        unsafe static partial void Host_HandleLoadData(ISciterNotifications host, IntPtr pns)
        {
            var datantf = (SCN_LOAD_DATA *)pns;
            var e       = new LoadDataEventArgs(datantf->GetUri(), () => datantf->GetData())
            {
                IsCached = datantf->outData != IntPtr.Zero,
                //TODO: Htmlayout do not have such property
                //RequestId = datantf->request_id,
                ResourceType = (ResourceType)datantf->dataType
            };

            host.ProcessLoadData(e);

            byte[] bytes = null;
            if (e.IsDataAvailable)
            {
                bytes = e.GetData();
            }
            else
            {
                bytes = SciterFactory.ResolveBinResource(e.Uri, e.ResourceType);
            }

            SciterDataReady(datantf->hwnd, e.Uri, bytes);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles data loaded notification
        /// </summary>
        unsafe static partial void Host_HandleDataLoaded(ISciterNotifications host, IntPtr pns)
        {
            var datantf = (SCN_DATA_LOADED *)pns;
            var e       = new DataLoadedEventArgs(datantf->GetUri(), () => datantf->GetData());

            host.ProcessDataLoaded(e);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles host callback notification
        /// </summary>
        private unsafe static void Host_HandleCallbackHost(ISciterNotifications host, IntPtr pns)
        {
            var datantf = (SCN_CALLBACK_HOST *)pns;
            var e       = new CallbackHostEventArgs((CallbackHostEventArgs.HostChannelType)datantf->channel, datantf->p1.GetValue(), datantf->p2.GetValue());

            host.ProcessCallbackHost(e);

            if (e.ReturnValue != null)
            {
                datantf->r.SetValue(e.ReturnValue);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles behavior attach
        /// </summary>
        unsafe static partial void Host_HandleAttachBehavior(ISciterNotifications host, IntPtr pns)
        {
            var datantf = (SCN_ATTACH_BEHAVIOR *)pns;
            var e       = new AttachBehaviorEventArgs(Element.Create(datantf->element), datantf->GetBehaviorName());

            host.ProcessAttachBehavior(e);

            e.Behavior = e.Behavior ?? SciterFactory.ResolveBehavior(e.BehaviorName);
            if (e.Behavior != null)
            {
                datantf->elementProc   = ElementEventProcEntryPoint;
                datantf->elementTag    = InstanceProtector.Protect(e.Behavior);
                datantf->elementEvents = (EVENT_GROUPS)e.EventGroups;
            }
        }
Exemplo n.º 5
0
 unsafe static partial void Host_HandleDocumentComplete(ISciterNotifications host, IntPtr pns);
Exemplo n.º 6
0
 unsafe static partial void Host_HandleLoadData(ISciterNotifications host, IntPtr pns);
Exemplo n.º 7
0
 unsafe static partial void Host_HandleAttachBehavior(ISciterNotifications host, IntPtr pns);
Exemplo n.º 8
0
        /// <summary>
        /// Assings host callback to the sciter window
        /// </summary>
        /// <param name="hWndSciter"></param>
        /// <param name="ntf"></param>
        public static void SciterSetCallback(IntPtr hWndSciter, ISciterNotifications ntf)
        {
            Debug.Assert(ntf != null, "Notification callback cannot be null");

            HTMLayoutSetCallback(hWndSciter, _nativeCallback, InstanceProtector.Protect(ntf));
        }
Exemplo n.º 9
0
 /// <summary>
 /// Handles document complete event
 /// </summary>
 static unsafe partial void Host_HandleDocumentComplete(ISciterNotifications host, IntPtr pns)
 {
     host.ProcessDocumentComplete(DocumentCompleteEventArgs.Empty);
 }
Exemplo n.º 10
0
        /// <summary>
        /// Handles host callback notification
        /// </summary>
        private unsafe static void Host_HandleCallbackHost(ISciterNotifications host, IntPtr pns)
        {
            var datantf = (SCN_CALLBACK_HOST*)pns;
            var e = new CallbackHostEventArgs((CallbackHostEventArgs.HostChannelType)datantf->channel, datantf->p1.GetValue(), datantf->p2.GetValue());
            host.ProcessCallbackHost(e);

            if (e.ReturnValue != null)
                datantf->r.SetValue(e.ReturnValue);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Assings host callback to the sciter window
 /// </summary>
 /// <param name="hWndSciter"></param>
 /// <param name="ntf"></param>
 public static void SciterSetCallback(IntPtr hWndSciter, ISciterNotifications ntf)
 {
     SciterSetCallback(hWndSciter, _nativeCallback, InstanceProtector.Protect(ntf));
 }
Exemplo n.º 12
0
 unsafe static partial void Host_HandleDocumentComplete(ISciterNotifications host, IntPtr pns);
Exemplo n.º 13
0
 unsafe static partial void Host_HandleLoadData(ISciterNotifications host, IntPtr pns);
Exemplo n.º 14
0
 unsafe static partial void Host_HandleAttachBehavior(ISciterNotifications host, IntPtr pns);
Exemplo n.º 15
0
 /// <summary>
 /// Assings host callback to the sciter window
 /// </summary>
 /// <param name="hWndSciter"></param>
 /// <param name="ntf"></param>
 public static void SciterSetCallback(IntPtr hWndSciter, ISciterNotifications ntf)
 {
     SciterSetCallback(hWndSciter, _nativeCallback, InstanceProtector.Protect(ntf));
 }
Exemplo n.º 16
0
        /// <summary>
        /// Assings host callback to the sciter window
        /// </summary>
        /// <param name="hWndSciter"></param>
        /// <param name="ntf"></param>
        public static void SciterSetCallback(IntPtr hWndSciter, ISciterNotifications ntf)
        {
            Debug.Assert(ntf != null, "Notification callback cannot be null");

            HTMLayoutSetCallback(hWndSciter, _nativeCallback, InstanceProtector.Protect(ntf));
        }