コード例 #1
0
ファイル: LoplaControl.cs プロジェクト: Lopla/Language
        private void SetupLopla()
        {
            var drawCtx = new LoplaRequests(skControl1);

            Engine = new SkiaDrawLoplaEngine(drawCtx);

            _uiEventsProvider = new LoplaGuiEventProcessor(Engine);

            var windowsDesktopEvents =
                new WindowsDesktopEvents(skControl1, _uiEventsProvider);
        }
コード例 #2
0
        /// <summary>
        ///     Draw library for lopla
        /// </summary>
        /// <param name="drawEngine">target draw engine</param>
        /// <param name="uiEventsProvider">
        ///     used by one function .: WaitForEvent
        ///     if something is send to that queue it will be passed to user
        ///     otherwise it's not used by any purpose
        ///     ui events for the system incl: click, SetCanvas, keypress
        /// </param>
        public Draw(
            ISkiaDrawLoplaEngine drawEngine,
            ISender uiEventsProvider = null
            )
        {
            _renderingEngine  = drawEngine;
            _uiEventsProvider = uiEventsProvider;

            Add("Clear", Clear, "r", "g", "b");

            Add("SetColor", SetColor, "r", "g", "b");

            Add("Box", Box, "a", "b", "c", "d");
            Add("Line", Line, "a", "b", "c", "d");

            Add("Image", Image, "x", "y", "arrayOfBinaryData");
            Add("GetImageSize", GetImageSize, "arrayOfBinaryData");
            Add("GetImagePart", GetImagePart, "arrayOfBinaryData", "left", "top", "right", "bottom");

            Add("Animation", Animation, "x", "y", "animatedGif");

            Add("Flush", Flush);

            Add("Write", Write, "text", "align", "offset");
            Add("Log", Log, "s");
            Add("Text", Text, "posx", "posy", "text");

            Add("GetTextSize", GetTextSize, "text");
            Add("GetTextInfo", GetTextInfo);
            Add("GetCanvasSize", GetCanvasSize);

            Add("SetCanvas", SetCanvas, "a", "b");

            Add("WaitForEvent", WaitForEvent);

            Add("AddTimer", AddTimer, "interval");
        }
コード例 #3
0
 public LoplaGuiEventProcessor(ISkiaDrawLoplaEngine engine)
 {
     UiEvents = new LockingBus();
     _engine  = engine;
 }
コード例 #4
0
ファイル: WinFormsDraw.cs プロジェクト: Lopla/Language
 public WinFormsDraw(Form form, ISkiaDrawLoplaEngine drawEngine, ISender uiEventsProvider = null) : base(
         drawEngine,
         uiEventsProvider)
 {
     _form = form;
 }