示例#1
0
        public WindowImpl()
        {
            _touchDevice = new TouchDevice();
            _mouseDevice = new WindowsMouseDevice();

#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                    UnmanagedMethods.SetCapture(Handle.Handle);
                else
                    UnmanagedMethods.ReleaseCapture();
            });
#endif

            _windowProperties = new WindowProperties
            {
                ShowInTaskbar = false,
                IsResizable = true,
                Decorations = SystemDecorations.Full
            };
            _rendererLock = new ManagedDeferredRendererLock();


            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);

            if (Win32GlManager.EglFeature != null)
                _gl = new EglGlPlatformSurface(Win32GlManager.EglFeature.DeferredContext, this);

            Screen = new ScreenImpl();

            _nativeControlHost = new Win32NativeControlHost(this);
            s_instances.Add(this);
        }
示例#2
0
        public WindowImpl()
        {
#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                {
                    UnmanagedMethods.SetCapture(Handle.Handle);
                }
                else
                {
                    UnmanagedMethods.ReleaseCapture();
                }
            });
#endif
            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);
            if (Win32GlManager.EglFeature != null)
            {
                _gl = new EglGlPlatformSurface((EglDisplay)Win32GlManager.EglFeature.Display,
                                               Win32GlManager.EglFeature.DeferredContext, this);
            }

            s_instances.Add(this);
        }
示例#3
0
        public TopLevelImpl(Context context, bool placeOnTop = false)
        {
            _view           = new ViewImpl(context, this, placeOnTop);
            _keyboardHelper = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _touchHelper    = new AndroidTouchEventsHelper <TopLevelImpl>(this, () => InputRoot,
                                                                          p => GetAvaloniaPointFromEvent(p));

            _gl          = GlPlatformSurface.TryCreate(this);
            _framebuffer = new FramebufferManager(this);

            MaxClientSize = new Size(_view.Resources.DisplayMetrics.WidthPixels,
                                     _view.Resources.DisplayMetrics.HeightPixels);
        }
示例#4
0
        public TopLevelImpl(Context context, bool placeOnTop = false)
        {
            _view            = new ViewImpl(context, this, placeOnTop);
            _textInputMethod = new AndroidInputMethod <ViewImpl>(_view);
            _keyboardHelper  = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _touchHelper     = new AndroidTouchEventsHelper <TopLevelImpl>(this, () => InputRoot,
                                                                           GetAvaloniaPointFromEvent);
            _gl          = GlPlatformSurface.TryCreate(this);
            _framebuffer = new FramebufferManager(this);

            RenderScaling = (int)_view.Scaling;

            MaxClientSize = new PixelSize(_view.Resources.DisplayMetrics.WidthPixels,
                                          _view.Resources.DisplayMetrics.HeightPixels).ToSize(RenderScaling);
        }
示例#5
0
        public WindowImpl()
        {
            _touchDevice = new TouchDevice();
            _mouseDevice = new WindowsMouseDevice();

#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                {
                    UnmanagedMethods.SetCapture(Handle.Handle);
                }
                else
                {
                    UnmanagedMethods.ReleaseCapture();
                }
            });
#endif

            _windowProperties = new WindowProperties
            {
                ShowInTaskbar = false,
                IsResizable   = true,
                Decorations   = SystemDecorations.Full
            };
            _rendererLock = new ManagedDeferredRendererLock();


            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);

            var glPlatform = AvaloniaLocator.Current.GetService <IPlatformOpenGlInterface>();

            if (glPlatform is EglPlatformOpenGlInterface egl)
            {
                _gl = new EglGlPlatformSurface(egl, this);
            }
            else if (glPlatform is WglPlatformOpenGlInterface wgl)
            {
                _gl = new WglGlPlatformSurface(wgl.PrimaryContext, this);
            }

            Screen = new ScreenImpl();

            _nativeControlHost = new Win32NativeControlHost(this);
            s_instances.Add(this);
        }
示例#6
0
        public TopLevelImpl(AvaloniaView avaloniaView, bool placeOnTop = false)
        {
            _view            = new ViewImpl(avaloniaView.Context, this, placeOnTop);
            _textInputMethod = new AndroidInputMethod <ViewImpl>(_view);
            _keyboardHelper  = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _pointerHelper   = new AndroidMotionEventsHelper(this);
            _gl          = GlPlatformSurface.TryCreate(this);
            _framebuffer = new FramebufferManager(this);

            RenderScaling = _view.Scaling;

            MaxClientSize = new PixelSize(_view.Resources.DisplayMetrics.WidthPixels,
                                          _view.Resources.DisplayMetrics.HeightPixels).ToSize(RenderScaling);

            NativeControlHost = new AndroidNativeControlHostImpl(avaloniaView);
            StorageProvider   = new AndroidStorageProvider((AvaloniaActivity)avaloniaView.Context);
        }
示例#7
0
 public GlRenderTarget(GRContext grContext, IGlPlatformSurface glSurface)
 {
     _grContext = grContext;
     _surface   = glSurface.CreateGlRenderTarget();
 }