public WindowImpl(IAvaloniaNativeFactory factory) { using (var e = new WindowEvents(this)) { Init(_native = factory.CreateWindow(e), factory.CreateScreens()); } }
public WindowImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts) : base(opts) { using (var e = new WindowEvents(this)) { Init(_native = factory.CreateWindow(e), factory.CreateScreens()); } }
public AvaloniaNativeMenuExporter(IAvaloniaNativeFactory factory) { _factory = factory; _applicationCommands = _factory.CreateApplicationCommands(); DoLayoutReset(); }
public AvaloniaNativeMenuExporter(IAvnTrayIcon trayIcon, IAvaloniaNativeFactory factory) { _factory = factory; _trayIcon = trayIcon; DoLayoutReset(); }
internal void Update(AvaloniaNativeMenuExporter exporter, IAvaloniaNativeFactory factory, NativeMenuItem item) { if (item != ManagedMenuItem) { throw new ArgumentException("The item does not match the menuitem being updated.", nameof(item)); } if (item.Menu != null) { if (_subMenu == null) { _subMenu = __MicroComIAvnMenuProxy.Create(factory); _subMenu.Initialise(exporter, item.Menu, item.Header); SetSubMenu(_subMenu); } _subMenu.Update(factory, item.Menu); } if (item.Menu == null && _subMenu != null) { _subMenu.Deinitialise(); _subMenu.Dispose(); SetSubMenu(null); } }
public PopupImpl(IAvaloniaNativeFactory factory) { using (var e = new PopupEvents(this)) { Init(factory.CreatePopup(e), factory.CreateScreens()); } }
public AvaloniaNativeMenuExporter(IAvnWindow nativeWindow, IAvaloniaNativeFactory factory) { _factory = factory; _nativeWindow = nativeWindow; DoLayoutReset(); }
public AvaloniaNativeMenuExporter(IAvaloniaNativeFactory factory) { _factory = factory; _menu = NativeMenu.GetMenu(Application.Current); DoLayoutReset(); }
public PopupImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts) : base(opts) { using (var e = new PopupEvents(this)) { Init(factory.CreatePopup(e), factory.CreateScreens()); } }
private IAvnMenuItem CreateNew(IAvaloniaNativeFactory factory, NativeMenuItemBase item) { var nativeItem = item is NativeMenuItemSeperator?factory.CreateMenuItemSeperator() : factory.CreateMenuItem(); nativeItem.ManagedMenuItem = item; return(nativeItem); }
private __MicroComIAvnMenuItemProxy CreateNew(IAvaloniaNativeFactory factory, NativeMenuItemBase item) { var nativeItem = (__MicroComIAvnMenuItemProxy)(item is NativeMenuItemSeparator ? factory.CreateMenuItemSeparator() : factory.CreateMenuItem()); nativeItem.ManagedMenuItem = item; return nativeItem; }
public WindowImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts) : base(opts) { _factory = factory; _opts = opts; using (var e = new WindowEvents(this)) { Init(_native = factory.CreateWindow(e), factory.CreateScreens()); } //NativeMenuExporter = new AvaloniaNativeMenuExporter(_native, factory); }
internal WindowBaseImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, AvaloniaNativePlatformOpenGlInterface glFeature) { _factory = factory; _gpu = opts.UseGpu && glFeature != null; _deferredRendering = opts.UseDeferredRendering; _keyboard = AvaloniaLocator.Current.GetService <IKeyboardDevice>(); _mouse = new MouseDevice(); _cursorFactory = AvaloniaLocator.Current.GetService <ICursorFactory>(); }
public static __MicroComIAvnMenuProxy Create(IAvaloniaNativeFactory factory) { var events = new MenuEvents(); var menu = (__MicroComIAvnMenuProxy)factory.CreateMenu(events); events.Initialise(menu); menu._events = events; return menu; }
public static IAvnMenu Create(IAvaloniaNativeFactory factory) { var events = new MenuEvents(); var menu = factory.CreateMenu(events); events.Initialise(menu); menu._events = events; return(menu); }
public PopupImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, IWindowBaseImpl parent) : base(opts) { _factory = factory; _opts = opts; using (var e = new PopupEvents(this)) { Init(factory.CreatePopup(e), factory.CreateScreens()); } PopupPositioner = new ManagedPopupPositioner(new ManagedPopupPositionerPopupImplHelper(parent, MoveResize)); }
private __MicroComIAvnMenuItemProxy CreateNewAt(IAvaloniaNativeFactory factory, int index, NativeMenuItemBase item) { var result = CreateNew(factory, item); result.Initialize(item); _menuItemLookup.Add(result.ManagedMenuItem, result); _menuItems.Insert(index, result); InsertItem(index, result); return result; }
public PopupImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, GlPlatformFeature glFeature, IWindowBaseImpl parent) : base(opts, glFeature) { _factory = factory; _opts = opts; _glFeature = glFeature; using (var e = new PopupEvents(this)) { Init(factory.CreatePopup(e, _opts.UseGpu ? glFeature?.DeferredContext.Context : null), factory.CreateScreens()); } PopupPositioner = new ManagedPopupPositioner(new OsxManagedPopupPositionerPopupImplHelper(parent, MoveResize)); }
internal WindowImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, GlPlatformFeature glFeature) : base(opts, glFeature) { _factory = factory; _opts = opts; _glFeature = glFeature; using (var e = new WindowEvents(this)) { Init(_native = factory.CreateWindow(e, _opts.UseGpu ? glFeature?.DeferredContext.Context : null), factory.CreateScreens()); } NativeMenuExporter = new AvaloniaNativeMenuExporter(_native, factory); }
internal WindowImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, AvaloniaNativePlatformOpenGlInterface glFeature) : base(opts, glFeature) { _factory = factory; _opts = opts; _glFeature = glFeature; using (var e = new WindowEvents(this)) { var context = _opts.UseGpu ? glFeature?.MainContext : null; Init(_native = factory.CreateWindow(e, context?.Context), factory.CreateScreens(), context); } NativeMenuExporter = new AvaloniaNativeMenuExporter(_native, factory); }
public PopupImpl(IAvaloniaNativeFactory factory, AvaloniaNativePlatformOptions opts, AvaloniaNativePlatformOpenGlInterface glFeature, IWindowBaseImpl parent) : base(factory, opts, glFeature) { _opts = opts; _glFeature = glFeature; _parent = parent; using (var e = new PopupEvents(this)) { var context = _opts.UseGpu ? glFeature?.MainContext : null; Init(factory.CreatePopup(e, context?.Context), factory.CreateScreens(), context); } PopupPositioner = new ManagedPopupPositioner(new ManagedPopupPositionerPopupImplHelper(parent, MoveResize)); }
internal void Update(IAvaloniaNativeFactory factory, NativeMenu menu) { if (menu != ManagedMenu) { throw new ArgumentException("The menu being updated does not match.", nameof(menu)); } for (int i = 0; i < menu.Items.Count; i++) { __MicroComIAvnMenuItemProxy nativeItem; if (i >= _menuItems.Count) { nativeItem = CreateNewAt(factory, i, menu.Items[i]); } else if (menu.Items[i] == _menuItems[i].ManagedMenuItem) { nativeItem = _menuItems[i]; } else if (_menuItemLookup.TryGetValue(menu.Items[i], out nativeItem)) { MoveExistingTo(i, nativeItem); } else { nativeItem = CreateNewAt(factory, i, menu.Items[i]); } if (menu.Items[i] is NativeMenuItem nmi) { nativeItem.Update(_exporter, factory, nmi); } } while (_menuItems.Count > menu.Items.Count) { RemoveAndDispose(_menuItems[_menuItems.Count - 1]); } }
private AvaloniaNativePlatform(IAvaloniaNativeFactory factory) { _factory = factory; }
public AvaloniaNativeMenuExporter(IAvaloniaNativeFactory factory) { _factory = factory; DoLayoutReset(); }
public TrayIconImpl(IAvaloniaNativeFactory factory) { _native = factory.CreateTrayIcon(); MenuExporter = new AvaloniaNativeMenuExporter(_native, factory); }
public AvaloniaNativeDragSource(IAvaloniaNativeFactory factory) { _factory = factory; }