public void Register(WindowEventType eventType, UnityAction callback)
            {
                switch (eventType)
                {
                case WindowEventType.OnShowBegin:
                    this.onShowBegin.AddListener(callback);
                    break;

                case WindowEventType.OnShowEnd:
                    this.onShowEnd.AddListener(callback);
                    break;

                case WindowEventType.OnHideBegin:
                    this.onHideBegin.AddListener(callback);
                    break;

                case WindowEventType.OnHideEnd:
                    this.onHideEnd.AddListener(callback);
                    break;

                case WindowEventType.OnWindowOpen:
                    this.onWindowOpen.AddListener(callback);
                    break;
                }
            }
示例#2
0
            public void Unregister(WindowEventType eventType, UnityAction callback)
            {
                switch (eventType)
                {
                case WindowEventType.OnShowBegin:
                    this.onShowBegin.RemoveListener(callback);
                    break;

                case WindowEventType.OnShowEnd:
                    this.onShowEnd.RemoveListener(callback);
                    break;

                case WindowEventType.OnHideBegin:
                    this.onHideBegin.RemoveListener(callback);
                    break;

                case WindowEventType.OnHideEnd:
                    this.onHideEnd.RemoveListener(callback);
                    break;

                case WindowEventType.OnWindowOpen:
                    this.onWindowOpen.RemoveListener(callback);
                    break;

                case WindowEventType.OnWindowActive:
                    this.onWindowActive.RemoveListener(callback);
                    break;

                case WindowEventType.OnWindowInactive:
                    this.onWindowInactive.RemoveListener(callback);
                    break;
                }
            }
示例#3
0
            public void ReleaseEvents(WindowEventType eventType)
            {
                switch (eventType)
                {
                case WindowEventType.OnShowBegin:
                    this.onShowBegin.Invoke();
                    break;

                case WindowEventType.OnShowEnd:
                    this.onShowEnd.Invoke();
                    break;

                case WindowEventType.OnHideBegin:
                    this.onHideBegin.Invoke();
                    break;

                case WindowEventType.OnHideEnd:
                    this.onHideEnd.Invoke();
                    break;

                case WindowEventType.OnWindowOpen:
                    this.onWindowOpen.Invoke();
                    break;

                case WindowEventType.OnWindowActive:
                    this.onWindowActive.Invoke();
                    break;

                case WindowEventType.OnWindowInactive:
                    this.onWindowInactive.Invoke();
                    break;
                }
            }
示例#4
0
            public void ReleaseEvents(WindowEventType eventType)
            {
                switch (eventType)
                {
                case WindowEventType.OnInit:
                    this.onInit.Invoke();
                    break;

                case WindowEventType.OnDeinit:
                    this.onDeinit.Invoke();
                    break;
                }
            }
示例#5
0
            public void Unregister(WindowEventType eventType, UnityAction callback)
            {
                switch (eventType)
                {
                case WindowEventType.OnInit:
                    this.onInit.RemoveListener(callback);
                    break;

                case WindowEventType.OnDeinit:
                    this.onDeinit.RemoveListener(callback);
                    break;
                }
            }
 void disposing(unoidl.com.sun.star.lang.EventObject Source) { LastKnownWindowState = WindowEventType.CLOSED; fireWindowEvent(WindowEventType.CLOSED, Source); }
示例#7
0
 public MouseWheelWindowEvent(WindowEventType type, IMainWindow window, Point windowPos, PointF uiPos,
                              float delta) : base(type, window, windowPos, uiPos)
 {
     Delta = delta;
 }
示例#8
0
 public WindowEvent(WindowEventType type, IMainWindow window)
 {
     Type   = type;
     Window = window;
 }
示例#9
0
 public MouseFocusEvent(WindowEventType type, IMainWindow window) : base(type, window)
 {
 }
示例#10
0
 public void RemoveEventListener(WindowEventType type, EventListener <WindowEvent <Window> > listener, bool useCapture = false)
 {
 }
示例#11
0
 private void ReleaseEvents(WindowEventType eventType)
 {
     this.events.Call(eventType);
     this.eventsInstance.Call(eventType);
 }
示例#12
0
 public WindowEvent(WindowEventType type) : this()
 {
     Type = type;
 }
示例#13
0
 private void ReleaseEvents(WindowEventType eventType)
 {
     this.once.ReleaseEvents(eventType);
     this.onEveryInstance.ReleaseEvents(eventType);
 }
 void windowShown(unoidl.com.sun.star.lang.EventObject e) { LastKnownWindowState = WindowEventType.OPENED; fireWindowEvent(WindowEventType.OPENED, e); }
 void windowHidden(unoidl.com.sun.star.lang.EventObject e) { LastKnownWindowState = WindowEventType.MINIMIZED; fireWindowEvent(WindowEventType.MINIMIZED, e); }
 void windowEnabled(unoidl.com.sun.star.lang.EventObject e) { LastKnownWindowState = WindowEventType.ACTIVATED; fireWindowEvent(WindowEventType.ACTIVATED, e); }
 /// <summary>
 /// Initializes a new instance of the <see cref="OoAccessibleDocWindowEventArgs"/> class.
 /// </summary>
 /// <param name="type">The original event type.</param>
 /// <param name="e">The native event object.</param>
 public OoAccessibleDocWindowEventArgs(WindowEventType type, EventObject e)
 {
     Type = type;
     E = e;
 }
示例#18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OoWindowEventArgs" /> class.
 /// </summary>
 /// <param name="window">The corresponding and event throwing window.</param>
 /// <param name="_type">The type of event.</param>
 public OoWindowEventArgs(OoAccessibleDocWnd window, WindowEventType _type = WindowEventType.UNKNOWN)
 {
     Window = window;
     Type   = _type;
 }
 void fireWindowEvent(WindowEventType type, EventObject e)
 {
     if (WindowEvent != null)
     {
         try
         {
             WindowEvent.Invoke(this, new OoAccessibleDocWindowEventArgs(type, e));
         }
         catch (Exception ex) { Logger.Instance.Log(LogPriority.DEBUG, this, "cant fire window event", ex); }
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OoWindowEventArgs" /> class.
 /// </summary>
 /// <param name="window">The corresponding and event throwing window.</param>
 /// <param name="_type">The type of event.</param>
 public OoWindowEventArgs(OoAccessibleDocWnd window, WindowEventType _type = WindowEventType.UNKNOWN)
 {
     Window = window;
     Type = _type;
 }
示例#21
0
        private IntPtr hookCallback(int nCode, IntPtr wParam, IntPtr lParam)
        {
            bool result = true;

            if (nCode >= 0 && base.childProcedure != null)
            {
                if (this.manejadorEventos != null)
                {
                    WINDOWINPUT     hookStruct = new WINDOWINPUT();
                    int             param      = wParam.ToInt32();
                    WindowEventType tipoEvento = Enum.IsDefined(typeof(WindowEventType), param) ? (WindowEventType)Enum.ToObject(typeof(WindowEventType), param) : WindowEventType.WM_NULL;
                    if (!tipoEvento.Equals(WindowEventType.WM_NULL))
                    {
                        hookStruct = (WINDOWINPUT)Marshal.PtrToStructure(lParam, typeof(WINDOWINPUT));
                        Debug.WriteLine("Se ha interceptado un evento de tipo " + tipoEvento.ToString() + " con data { lParam = " + hookStruct.lParam + " , wParam = " + hookStruct.wParam + ", message = " + hookStruct.message + " , hwnd = " + hookStruct.hwnd + "} ");
                        CREATESTRUCT data;
                        RECT         rectangulo;
                        MACRO        x;
                        POINT        punto;
                        switch (tipoEvento)
                        {
                        case WindowEventType.WM_DESTROY:
                            result = this.manejadorEventos.onBeforeWindowDestroy(this);
                            break;

                        case WindowEventType.WM_NCDESTROY:
                            result = this.manejadorEventos.onWindowDestroy(this);
                            break;

                        case WindowEventType.WM_NCCREATE:
                            data   = (CREATESTRUCT)Marshal.PtrToStructure(hookStruct.lParam, typeof(CREATESTRUCT));
                            result = this.manejadorEventos.onBeforeWindowCreation(this, data);
                            break;

                        case WindowEventType.WM_CREATE:
                            data   = (CREATESTRUCT)Marshal.PtrToStructure(hookStruct.lParam, typeof(CREATESTRUCT));
                            result = this.manejadorEventos.onWindowCreation(this, data);
                            break;

                        case WindowEventType.WM_DPICHANGED:
                            x = new MACRO {
                                Number = hookStruct.wParam.ToUInt32()
                            };
                            punto      = new POINT(x.Low, x.High);
                            rectangulo = (RECT)Marshal.PtrToStructure(hookStruct.lParam, typeof(RECT));
                            result     = this.manejadorEventos.onWindowDPIChange(this, punto, rectangulo);
                            break;

                        case WindowEventType.WM_MOVING:
                            rectangulo = (RECT)Marshal.PtrToStructure(hookStruct.lParam, typeof(RECT));
                            result     = this.manejadorEventos.onWindowMoving(this, rectangulo);
                            break;

                        case WindowEventType.WM_MOVE:
                            x = new MACRO {
                                Number = unchecked ((uint)hookStruct.lParam.ToInt32())
                            };
                            punto  = new POINT(x.Low, x.High);
                            result = this.manejadorEventos.onWindowMoved(this, punto);
                            break;

                        case WindowEventType.WM_SIZING:
                            rectangulo = (RECT)Marshal.PtrToStructure(hookStruct.lParam, typeof(RECT));
                            result     = this.manejadorEventos.onWindowResizing(this, rectangulo);
                            break;

                        case WindowEventType.WM_SIZE:
                            x = new MACRO {
                                Number = unchecked ((uint)hookStruct.lParam.ToInt32())
                            };
                            punto  = new POINT(x.Low, x.High);
                            result = this.manejadorEventos.onWindowResized(this, punto);
                            break;
                        }
                    }
                }
            }
            if (result)
            {
                return(CallNextHookEx(base.getHookID(), nCode, wParam, lParam));
            }
            else
            {
                return((IntPtr)1);
            }
        }
示例#22
0
 public static extern int imaqGetLastEvent(ref WindowEventType type, ref int windowNumber, ref Tool tool, ref Rect rect);