示例#1
0
 private static extern ScDomResult SciterTraverseUIEvent(EVENT_GROUPS evt, IntPtr eventCtlStruct, out bool bOutProcessed);
示例#2
0
 private static extern ScDomResult SciterWindowAttachEventHandler(IntPtr IntPtrLayout, /*[MarshalAs(UnmanagedType.FunctionPtr)] ElementEventProc*/ IntPtr pep, IntPtr tag, EVENT_GROUPS subscription);
示例#3
0
 private static extern ScDomResult SciterWindowAttachEventHandler(IntPtr hwnd, /*[MarshalAs(UnmanagedType.FunctionPtr)] ElementEventProc*/ IntPtr pep, IntPtr tag, EVENT_GROUPS subscription);
示例#4
0
 private static extern ScDomResult SciterTraverseUIEvent(EVENT_GROUPS evt, IntPtr eventCtlStruct, out bool bOutProcessed);
示例#5
0
 /// <summary>
 /// Compact framework have a problems with "bool" results
 /// </summary>
 private static int Behavior_NativeCallbackI4(IntPtr tag, IntPtr he, EVENT_GROUPS evtg, IntPtr prms)
 {
     return(Behavior_NativeCallback(tag, he, evtg, prms) ? 1 : 0);
 }
示例#6
0
        /// <summary>
        /// Bridge to sciter element callbacks
        /// </summary>
        private static unsafe bool Behavior_NativeCallback(IntPtr tag, IntPtr he, EVENT_GROUPS evtg, IntPtr prms)
        {
            using (var prot = ElementScope.Create())
            {
                bool handled  = false;
                var  behavior = InstanceProtector.GetInstance(tag) as ISciterBehavior;
                if (behavior != null)
                {
                    // TODO: Timer
                    switch (evtg)
                    {
                    case EVENT_GROUPS.HANDLE_INITIALIZATION:
                        Behavior_HandleInitialization(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_MOUSE:
                        Behavior_HandleMouseEvent(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_KEY:
                        Behavior_HandleKey(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_FOCUS:
                        Behavior_HandleFocusEvent(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_SCROLL:
                        Behavior_HandleScroll(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_TIMER:
                        Behavior_HandleTimer(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_SIZE:
                        Behavior_HandleSize(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_DRAW:
                        Behavior_HandleDraw(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_DATA_ARRIVED:
                        Behavior_HandleDataArrived(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_BEHAVIOR_EVENT:
                        Behavior_HandleBehaviorEvent(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_METHOD_CALL:
                        Behavior_HandleMethodCall(behavior, he, prms, ref handled);
                        break;

                    case EVENT_GROUPS.HANDLE_SCRIPTING_METHOD_CALL:
                        Behavior_HandleScriptingMethodCall(behavior, he, prms, ref handled);
                        break;

                    default:
                        break;
                    }
                }

                Debug.Assert(behavior != null, "Behavior object has been garbage collected");
                return(handled);
            }
        }
示例#7
0
 /// <summary>
 /// Attach/Detach ElementEventProc to the Sciter window.
 /// All events will start first here (in SINKING phase) and if not consumed will end up here.
 /// You can install Window EventHandler only once - it will survive all document reloads.
 /// </summary>
 public void WindowAttachEventHandler(IntPtr hWnd, ISciterBehavior bhv, EVENT_GROUPS evt)
 {
     CheckResult(SciterWindowAttachEventHandler(hWnd, SciterHostApi.ElementEventProcEntryPoint, InstanceProtector.Protect(bhv), evt));
 }
示例#8
0
 /// <summary>
 /// Attached event handler to the Window
 /// </summary>
 internal void AttachEventHandler(ISciterBehavior handler, EVENT_GROUPS events)
 {
     SciterDomApi.WindowAttachEventHandler(Handle, handler, events);
 }
示例#9
0
        /// <summary>
        /// Bridge to sciter element callbacks
        /// </summary>
        private static unsafe bool Behavior_NativeCallback(IntPtr tag, IntPtr he, EVENT_GROUPS evtg, IntPtr prms)
        {
            using (var prot = ElementScope.Create())
            {
                var handled = false;
                var behavior = InstanceProtector.GetInstance(tag) as ISciterBehavior;
                if (behavior != null)
                {
                    switch (evtg)
                    {
                        case EVENT_GROUPS.HANDLE_INITIALIZATION:
                            Behavior_HandleInitialization(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_MOUSE:
                            Behavior_HandleMouseEvent(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_KEY:
                            Behavior_HandleKey(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_FOCUS:
                            Behavior_HandleFocusEvent(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_SCROLL:
                            Behavior_HandleScroll(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_TIMER:
                            Behavior_HandleTimer(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_SIZE:
                            Behavior_HandleSize(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_DRAW:
                            Behavior_HandleDraw(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_DATA_ARRIVED:
                            Behavior_HandleDataArrived(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_BEHAVIOR_EVENT:
                            Behavior_HandleBehaviorEvent(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_METHOD_CALL:
                            Behavior_HandleMethodCall(behavior, he, prms, ref handled);
                            break;
                        case EVENT_GROUPS.HANDLE_SCRIPTING_METHOD_CALL:
                            Behavior_HandleScriptingMethodCall(behavior, he, prms, ref handled);
                            break;
                        default:
                            break;
                    }
                }

                Debug.Assert(behavior != null, "Behavior object has been garbage collected");
                return handled;
            }
        }       
示例#10
0
 /// <summary>
 /// Compact framework have a problems with "bool" results
 /// </summary>
 private static int Behavior_NativeCallbackI4(IntPtr tag, IntPtr he, EVENT_GROUPS evtg, IntPtr prms)
 {
     return Behavior_NativeCallback(tag, he, evtg, prms) ? 1 : 0;
 }
示例#11
0
 /// <summary>
 /// Attach/Detach ElementEventProc to the Sciter window. 
 /// All events will start first here (in SINKING phase) and if not consumed will end up here.
 /// You can install Window EventHandler only once - it will survive all document reloads.
 /// </summary>
 public void WindowAttachEventHandler(IntPtr hWnd, ISciterBehavior bhv, EVENT_GROUPS evt)
 {
     CheckResult(SciterWindowAttachEventHandler(hWnd, SciterHostApi.ElementEventProcEntryPoint, InstanceProtector.Protect(bhv), evt));
 }