Пример #1
0
 public MouseActiveTrigger(OverlayPlugin plugin, XmlNode node)
     : base(node)
 {
     mManager      = GetManager(plugin, node, "trigger");
     mCore         = plugin.Core;
     mMoveListener = new Action <FrameOverlayManager, EventArgs>(mManager_CursorMoved);
 }
Пример #2
0
 void coordinator_InitialisationFinished()
 {
     if (mFrame.Core.HasPlugin <OverlayPlugin>())
     {
         mManager = mFrame.Core.GetPlugin <OverlayPlugin>()[mFrame.Name];
     }
 }
Пример #3
0
 public override IFrameState CreateWindowState(FrameOverlayManager manager)
 {
     IFrameState w = new FrameState(manager);
     if (mUseDefaultBG)
         w.AddFeature(new ColourFeature(mDefaultBG));
     return w;
 }
Пример #4
0
        public override IFrameState CreateFrameState(FrameOverlayManager manager)
        {
            SeeThroughMenuWindow stateWindow = new SeeThroughMenuWindow(manager);

            mWindows.Add(stateWindow);
            return(stateWindow);
        }
Пример #5
0
        /// <summary>
        /// CreateWindowState a window state for drawing this state to the specified window.
        /// </summary>
        /// <param name="window">The window the new window state is to draw on.</param>
        public override IFrameState CreateFrameState(FrameOverlayManager manager)
        {
            ImageBGWindow win = new ImageBGWindow(manager, mWindowBGs.ContainsKey(manager.Name) ?  mWindowBGs[manager.Name] : mDefaultBG);

            mWindows.Add(manager.Name, win);
            return(win);
        }
Пример #6
0
        public CursorRenderer(OverlayPlugin manager, XmlNode node)
        {
            ISelectionRenderer renderer = manager.GetRenderer(node, "cursor renderer", null, "InnerRenderer");
            mOverlayManager = GetManager(manager, node, "cursor renderer");

            Size size = new Size(GetInt(node, 80, "W"), GetInt(node, 80, "H"));
            Init(size, renderer.DrawHover);
        }
Пример #7
0
 public TouchscreenWindow(FrameOverlayManager manager, TouchscreenPlugin plugin)
     : base(manager)
 {
     mPlugin = plugin;
     mPlugin.Left.SizeChanged   += () => Manager.ForceRedrawStatic();
     mPlugin.Right.SizeChanged  += () => Manager.ForceRedrawStatic();
     mPlugin.Single.SizeChanged += () => Manager.ForceRedrawStatic();
 }
Пример #8
0
 private void coordinator_WindowAdded(Frame frame, EventArgs args)
 {
     if (frame.Name == mWindow)
     {
         mManager = mOverlayPlugin[frame.Name];
         frame.Core.FrameAdded -= mWindowAddedListener;
     }
 }
Пример #9
0
 public CursorTrigger(ISelectionRenderer renderer, FrameOverlayManager manager)
     : base(manager.Frame.Core, "CursorTrigger", mSelectMS)
 {
     mManager = manager;
     mRenderer = renderer;
     //mSelectCursor = new Cursor(new IntPtr(65571));
     mSelectCursor = new Cursor(new IntPtr(65567));
 }
Пример #10
0
 public CursorTrigger(ISelectionRenderer renderer, FrameOverlayManager manager)
     : base(manager.Frame.Core, "CursorTrigger", mSelectMS)
 {
     mManager  = manager;
     mRenderer = renderer;
     //mSelectCursor = new Cursor(new IntPtr(65571));
     mSelectCursor = new Cursor(new IntPtr(65567));
 }
Пример #11
0
 public override IFrameState CreateFrameState(FrameOverlayManager manager)
 {
     if (manager.Name.Equals(mPlugin.Frame.Name))
     {
         return(new TouchscreenWindow(manager, mPlugin));
     }
     return(new FrameState(manager));
 }
Пример #12
0
        public override IFrameState CreateFrameState(FrameOverlayManager manager)
        {
            IFrameState w = new FrameState(manager);

            if (mUseDefaultBG)
            {
                w.AddFeature(new ColourFeature(mDefaultBG));
            }
            return(w);
        }
Пример #13
0
        public CursorRenderer(OverlayPlugin manager, XmlNode node)
        {
            ISelectionRenderer renderer = manager.GetRenderer(node, "cursor renderer", null, "InnerRenderer");

            mOverlayManager = GetManager(manager, node, "cursor renderer");

            Size size = new Size(GetInt(node, 80, "W"), GetInt(node, 80, "H"));

            Init(size, renderer.DrawHover);
        }
Пример #14
0
        /// <summary>
        /// Initialise the fade transition, specifying how long the fade should last, in ms.
        /// </summary>
        /// <param name="transition">The transition this fade is part of.</param>
        /// <param name="manager">The window this fade is to be drawn on.</param>
        /// <param name="lengthMS">The length of time, in ms, the fade should last.</param>
        public FeatureFrameTransition(StateTransition transition, FrameOverlayManager manager, IFeatureTransition transitionEffect)
            : base(transition, manager)
        {
            mTransition           = transitionEffect;
            mTransition.Start     = From;
            mTransition.Finish    = To;
            mTransition.Finished += new Action(transitionEffect_Finished);

            AddFeature(mTransition);
        }
Пример #15
0
        public UnityState(OverlayPlugin manager, XmlNode node)
            : base(GetName(node, "creating unity state"), manager, node, false)
        {
            mUnity      = Path.GetFullPath(GetString(node, null, "File"));
            mManager    = manager;
            mMainWindow = GetManager(manager, node, "unity state");
            mBounds     = manager.GetBounds(node, "unity state");

            ResizedHandler = new System.EventHandler(this.Resized);
        }
Пример #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="transition"></param>
        /// <param name="window"></param>
        /// <exception cref="InvalidArgumentException">Thrown if there is no window state for the To or From state.</exception>
        public FrameTransition(StateTransition transition, FrameOverlayManager manager)
            : base(manager.Name)
        {
            mManager    = manager;
            mTransition = transition;

            mFrom = transition.From[manager.Name];
            mTo   = transition.To[manager.Name];

            Finished += trans => mSelected = false;
        }
        /// <summary>
        /// Initialise the fade transition, specifying how long the fade should last, in ms.
        /// </summary>
        /// <param name="transition">The transition this fade is part of.</param>
        /// <param name="manager">The window this fade is to be drawn on.</param>
        /// <param name="lengthMS">The length of time, in ms, the fade should last.</param>
        public OpacityFadeWindowTransition(StateTransition transition, FrameOverlayManager manager, double lengthMS, bool fadeIn)
            : base(transition, manager)
        {
            mLengthMS     = lengthMS;
            mFadeIn       = fadeIn;
            mTickListener = new Action(Coordinator_Tick);

            Finished += new Action <IWindowTransition>(OpacityFadeWindowTransition_Finished);

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, transition.Name + " " + manager.Name);
#endif
        }
Пример #18
0
 public OverlayTouchSource(FrameOverlayManager manager)
 {
     mManager          = manager;
     mManager.OnPress += () => { if (OnPress != null)
                                 {
                                     OnPress(0);
                                 }
     };
     mManager.OnRelease += () => { if (OnRelease != null)
                                   {
                                       OnRelease(0);
                                   }
     };
 }
        public OpacityFadeFeature(OverlayPlugin manager, XmlNode node)
        {
            mManager = GetManager(manager, node, "Opacity Fade");

            if (node.Attributes["FadeIn"] != null) {
                mStart = GetBool(node, true, "FadeIn") ? 0.0 : 1.0;
                mFinish = GetBool(node, true, "FadeIn") ? 1.0 : 0.0;
            }

            mStart = GetDouble(node, mStart, "Start");
            mFinish = GetDouble(node, mFinish, "Finish");
            mWait = GetDouble(node, 0.0, "Wait");
            mLength = GetDouble(node, mLength, "Length");
        }
Пример #20
0
        protected ControlFeature(OverlayPlugin manager, XmlNode node, bool singletonControl)
        {
            mPlugin           = manager;
            mManager          = GetManager(manager, node, "control feature");
            mFrame            = mManager.Frame.Name;
            mSingletonControl = singletonControl;

            float x = GetFloat(node, 0f, "X");
            float y = GetFloat(node, 0f, "Y");
            float w = GetFloat(node, 1f, "W", "Width");
            float h = GetFloat(node, 1f, "H", "Height");

            mBounds = new RectangleF(x, y, w, h);
        }
Пример #21
0
        public OpacityFadeFeature(OverlayPlugin manager, XmlNode node)
        {
            mManager = GetManager(manager, node, "Opacity Fade");

            if (node.Attributes["FadeIn"] != null)
            {
                mStart  = GetBool(node, true, "FadeIn") ? 0.0 : 1.0;
                mFinish = GetBool(node, true, "FadeIn") ? 1.0 : 0.0;
            }

            mStart  = GetDouble(node, mStart, "Start");
            mFinish = GetDouble(node, mFinish, "Finish");
            mWait   = GetDouble(node, 0.0, "Wait");
            mLength = GetDouble(node, mLength, "Length");
        }
Пример #22
0
        void Core_InitialisationComplete()
        {
            if (mFrame.Core.HasPlugin <OverlayPlugin>())
            {
                mManager = mFrame.Core.GetPlugin <OverlayPlugin>()[mFrame.Name];
            }

            if (mConfig.AutoStartViewer)
            {
                Launch();
            }
            else if (mConfig.AutoStartProxy)
            {
                StartProxy();
            }
        }
Пример #23
0
 void mManager_CursorMoved(FrameOverlayManager manager, EventArgs args)
 {
     if (Inside)
     {
         if (!mInside)
         {
             mInside = true;
             Entered();
         }
     }
     else if (mInside)
     {
         mInside = false;
         Exited();
     }
 }
Пример #24
0
        public void Init(FrameOverlayManager manager)
        {
            mManager = manager;

            drawPanel.BackColor   = manager.TransparencyKey;
            TransparencyKey       = manager.TransparencyKey;
            BackColor             = manager.TransparencyKey;
            Opacity               = manager.Opacity;
            refreshTimer.Interval = manager.FrameLength;
            //refreshTimer.Enabled = true;

            Thread tickthread = new Thread(TickThread);

            tickthread.Name = mManager.Name + " graphics thread.";
            tickthread.Start();
        }
Пример #25
0
        public VideoState(OverlayPlugin manager, XmlNode node, IMediaPlayer player)
            : base(GetName(node, "creating video state"), manager, node, false)
        {
            //: base(manager, node, false) {

            mPlayer = player;
            mVideo  = GetString(node, null, "File");
            if (mVideo == null)
            {
                throw new ArgumentException("Unable to load VideoState. No File attribute specified.");
            }
            mVideo = Path.GetFullPath(mVideo);
            if (!File.Exists(mVideo))
            {
                throw new ArgumentException("Unable to load VideoState. The file '" + mVideo + "' does not exist.");
            }

            mPlayer.PlaybackFinished += new Action(mPlayer_VideoFinished);
            mPlayer.PlaybackStarted  += new Action(mPlayer_VideoStarted);
            mMainWindow = GetManager(manager, node, "video state");
            mBounds     = manager.GetBounds(node, "video state");

            XmlAttribute toAttr = node.Attributes["FinishState"];

            if (toAttr != null && manager.GetState(toAttr.Value) != null)
            {
                mTrigger = new SimpleTrigger();
                ITransitionStyle transition = manager.GetTransition(node, "video state finish transition", new FeatureFrameTransitionFactory(new FeatureFadeFactory(), 2000), "Transition");
                if (transition == null)
                {
                    Logger.Debug("No transition specified for VideoState. using default 2s bitmap fade transition.");
                    transition = new FeatureFrameTransitionFactory(new FeatureFadeFactory(), 2000);
                }
                AddTransition(new StateTransition(Manager, this, manager.GetState(toAttr.Value), mTrigger, transition));
            }

            LoadTriggers(node, manager, "StartTriggers", mStartTriggers, new Action <ITrigger>(StartTriggered));
            LoadTriggers(node, manager, "StopTriggers", mStopTriggers, new Action <ITrigger>(StopTriggered));

            mRestartMode = GetBool(node, false, "RestartMode");
            if (mRestartMode)
            {
                LoadTriggers(node, manager, "ResetTriggers", mResetTriggers, new Action <ITrigger>(RestartTriggered));
            }
        }
Пример #26
0
 public void Init(Core core)
 {
     if (!core.HasPlugin <OverlayPlugin>())
     {
         //throw new ArgumentException("Unable to load kinect cursor. Overlay plugin is not loaded.");
         Logger.Warn("Unable to load axis cursor. Overlay plugin is not loaded.");
         Init();
         return;
     }
     mOverlayPlugin = core.GetPlugin <OverlayPlugin>();
     if (core.HasFrame(mWindow))
     {
         mManager = mOverlayPlugin[mWindow];
     }
     else
     {
         mWindowAddedListener = new Action <Chimera.Frame, EventArgs>(coordinator_WindowAdded);
         core.FrameAdded     += mWindowAddedListener;
     }
     Init();
 }
Пример #27
0
 public HoverTrigger(FrameOverlayManager manager, ISelectionRenderer renderer, RectangleF bounds)
     : base(manager, bounds)
 {
     mRenderer = renderer;
 }
Пример #28
0
 public HoverTrigger(FrameOverlayManager manager, ISelectionRenderer renderer, int x, int y, int w, int h, Rectangle clip)
     : this(manager, renderer, (float) x / (float) clip.Width, (float) y / (float) clip.Height, (float) w / (float) clip.Width, (float) h / (float) clip.Height)
 {
 }
Пример #29
0
 public override IFrameState CreateWindowState(FrameOverlayManager manager)
 {
     return new FrameState(manager);
 }
 public SeeThroughMenuWindow(FrameOverlayManager manager)
     : base(manager)
 {
 }
Пример #31
0
        public CursorRenderer(ISelectionRenderer renderer, Size size, FrameOverlayManager manager)
        {
            mOverlayManager = manager;

            Init(size, renderer.DrawHover);
        }
Пример #32
0
 public StaticText(string text, FrameOverlayManager manager, Font font, Color colour, PointF location)
     : base(text, manager.Frame.Name, font, colour, location)
 {
     mManager = manager;
 }
 public IWindowTransition Create(StateTransition transition, FrameOverlayManager manager)
 {
     return(new OpacityFadeWindowTransition(transition, manager, mLengthMS, !mFadeOut));
 }
Пример #34
0
        public CursorRenderer(Action<Graphics, Rectangle, double> drawStep, Size size, FrameOverlayManager manager)
        {
            mOverlayManager = manager;

            Init(size, drawStep);
        }
Пример #35
0
 public AreaTrigger(FrameOverlayManager manager, int x, int y, int w, int h, Rectangle clip)
     : this(manager, (float)x / (float)clip.Width, (float)y / (float)clip.Height, (float)w / (float)clip.Width, (float)h / (float)clip.Height)
 {
 }
Пример #36
0
 public ClickTrigger(FrameOverlayManager manager, RectangleF bounds)
     : base(manager, bounds)
 {
     Manager.OnRelease += new Action(mManager_OnRelease);
 }
Пример #37
0
 /// <summary>
 /// Create the trigger. Specifies the position and size of the area the cursor must hover in to trigger this trigger as values between 0 and 1.
 /// 0,0 is top left, 1,1 is bottom right.
 /// </summary>
 /// <param name="manager">The manager which manages the window this trigger is to draw to.</param>
 /// <param name="render">The renderer used to draw this trigger being selected.</param>
 /// <param name="x">The x coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the left, 1 flush to the right.</param>
 /// <param name="y">The y coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the top, 1 flush to the bottom.</param>
 /// <param name="x">The width of the image, specified between 0 and 1. 1 will fill the entire width, 0 will be invisible.</param>
 /// <param name="y">The width of the image, specified between 0 and 1. 1 will fill the entire height, 0 will be invisible.</param>
 public ClickTrigger(FrameOverlayManager manager, float x, float y, float w, float h)
     : this(manager, new RectangleF(x, y, w, h))
 {
 }
Пример #38
0
 /// <summary>
 /// Create the trigger. Specifies the position and size of the area the cursor must hover in to trigger this trigger as values between 0 and 1.
 /// 0,0 is top left, 1,1 is bottom right.
 /// </summary>
 /// <param name="manager">The manager which manages the window this trigger is to draw to.</param>
 /// <param name="render">The renderer used to draw this trigger being selected.</param>
 /// <param name="x">The x coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the left, 1 flush to the right.</param>
 /// <param name="y">The y coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the top, 1 flush to the bottom.</param>
 /// <param name="x">The width of the image, specified between 0 and 1. 1 will fill the entire width, 0 will be invisible.</param>
 /// <param name="y">The width of the image, specified between 0 and 1. 1 will fill the entire height, 0 will be invisible.</param>
 public HoverTrigger(FrameOverlayManager manager, ISelectionRenderer renderer, float x, float y, float w, float h)
     : this(manager, renderer, new RectangleF(x, y, w, h))
 {
 }
Пример #39
0
 public ImageBGWindow(FrameOverlayManager manager, Bitmap BG)
     : base(manager)
 {
     mBG = BG;
 }
 public ImageClickTrigger(FrameOverlayManager manager, OverlayImage image)
     : base(manager, image.Bounds)
 {
     mImage = image;
 }
 public ImageHoverTrigger(FrameOverlayManager manager, ISelectionRenderer render, OverlayImage image)
     : base(manager, render, image.Bounds)
 {
     mImage = image;
 }
Пример #42
0
 public TextClickTrigger(FrameOverlayManager manager, Text text, Rectangle clip)
     : base(manager, Text.GetBounds(text, clip))
 {
     mText = text;
         Clip = clip;
 }
Пример #43
0
 public TextHoverTrigger(FrameOverlayManager manager, ISelectionRenderer renderer, Text text, Rectangle clip)
     : base(manager, renderer, Text.GetBounds(text, clip))
 {
     mText = text;
         Clip = clip;
 }
Пример #44
0
 public ImageHoverTrigger(FrameOverlayManager manager, ISelectionRenderer render, OverlayImage image)
     : base(manager, render, image.Bounds)
 {
     mImage = image;
 }
Пример #45
0
 /// <summary>
 /// Create the trigger. Specifies the position and size of the area the cursor must hover in to trigger this trigger as values between 0 and 1.
 /// 0,0 is top left, 1,1 is bottom right.
 /// </summary>
 /// <param name="manager">The manager which manages the window this trigger is to draw to.</param>
 /// <param name="render">The renderer used to draw this trigger being selected.</param>
 /// <param name="x">The x coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the left, 1 flush to the right.</param>
 /// <param name="y">The y coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the top, 1 flush to the bottom.</param>
 /// <param name="x">The width of the image, specified between 0 and 1. 1 will fill the entire width, 0 will be invisible.</param>
 /// <param name="y">The width of the image, specified between 0 and 1. 1 will fill the entire height, 0 will be invisible.</param>
 public HoverTrigger(FrameOverlayManager manager, ISelectionRenderer renderer, float x, float y, float w, float h)
     : this(manager, renderer, new RectangleF(x, y, w, h))
 {
 }
Пример #46
0
 /// <summary>
 /// Create the trigger. Specifies the position and size of the area the cursor must hover in to trigger this trigger as values between 0 and 1.
 /// 0,0 is top left, 1,1 is bottom right.
 /// </summary>
 /// <param name="manager">The manager which manages the window this trigger is to draw to.</param>
 /// <param name="render">The renderer used to draw this trigger being selected.</param>
 /// <param name="x">The x coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the left, 1 flush to the right.</param>
 /// <param name="y">The y coordinate for where the image is to be positioned, specified between 0 and 1. 0 is flush to the top, 1 flush to the bottom.</param>
 /// <param name="x">The width of the image, specified between 0 and 1. 1 will fill the entire width, 0 will be invisible.</param>
 /// <param name="y">The width of the image, specified between 0 and 1. 1 will fill the entire height, 0 will be invisible.</param>
 public AreaTrigger(FrameOverlayManager manager, float x, float y, float w, float h)
     : this(manager, new RectangleF(x, y, w, h))
 {
 }
Пример #47
0
        protected FeatureBase(OverlayPlugin plugin, XmlNode node)
        {
            mManager = GetManager(plugin, node, "FeatureBase");

            mControlPanel = new FeatureControl(this);
        }
Пример #48
0
 public AreaTrigger(FrameOverlayManager manager, RectangleF bounds)
 {
     mManager      = manager;
     mBounds       = bounds;
     mMoveListener = new Action <FrameOverlayManager, EventArgs>(mManager_CursorMoved);
 }
Пример #49
0
 public StaticText(OverlayPlugin manager, XmlNode node)
     : base(manager, node)
 {
     mManager = GetManager(manager, node, "text");
 }
Пример #50
0
 public OverlayWindow(FrameOverlayManager manager)
     : this()
 {
     Init(manager);
 }
 public ScreenshotFeature(OverlayPlugin plugin, XmlNode node)
 {
     mManager = GetManager(plugin, node, "Screenshot Feature");
     mIncludeOverlay = GetBool(node, false, "IncludeOverlay");
 }
 public override IFrameState CreateFrameState(FrameOverlayManager manager)
 {
     SeeThroughMenuWindow stateWindow = new SeeThroughMenuWindow(manager);
     mWindows.Add(stateWindow);
     return stateWindow;
 }
Пример #53
0
 public StaticText(OverlayPlugin manager, XmlNode node, Rectangle clip)
     : base(manager, node, clip)
 {
     mManager = GetManager(manager, node, "text");
 }
Пример #54
0
 public ClickTrigger(FrameOverlayManager manager, int x, int y, int w, int h, Rectangle clip)
     : this(manager, (float) x / (float) clip.Width, (float) y / (float) clip.Height, (float) w / (float) clip.Width, (float) h / (float) clip.Height)
 {
 }
Пример #55
0
 void mManager_CursorMoved(FrameOverlayManager manager, EventArgs args)
 {
     if (Inside) {
         if (!mInside) {
             mInside = true;
             Entered();
         }
     } else if (mInside) {
         mInside = false;
         Exited();
     }
 }
Пример #56
0
 public ImageBGWindow(FrameOverlayManager manager, Bitmap BG)
     : base(manager) {
     mBG = BG;
 }
Пример #57
0
 public AreaTrigger(FrameOverlayManager manager, RectangleF bounds)
 {
     mManager = manager;
     mBounds = bounds;
     mMoveListener = new Action<FrameOverlayManager,EventArgs>(mManager_CursorMoved);
 }