These are chat archives for AvaloniaUI/Avalonia

17th
Jun 2016
Darnell Williams
@Seeker1437
Jun 17 2016 00:17
@kekekeks hey, dpesnt the designer use an elementhost? Could that be the issue?
Nikita Tsukanov
@kekekeks
Jun 17 2016 00:17
No idea
These elements are rendered in designer process through
so that might be the issue
Darnell Williams
@Seeker1437
Jun 17 2016 00:18
the splitter is fragile hah
Nikita Tsukanov
@kekekeks
Jun 17 2016 00:19
Well, it's better than what we had before
Darnell Williams
@Seeker1437
Jun 17 2016 00:20
Oh right yes I remember this, the original designer view has an issue with the way the splitter works yeah
causes the design view to remain in the corner and not resize
its because the bounds is set to 0,0
errm id have to look at it again it should actually already be an issue on the PerspexVS repo
...well AvaloniaVS.
lol grr
Yeah PerspexVS#6 i think
Darnell Williams
@Seeker1437
Jun 17 2016 00:25
s/PerspexVS#6/PerspexVS/#6
Omg
nvm
i think the problem stems from a similar sotuation
Andrey Kunchev
@donandren
Jun 17 2016 10:17
@grokys I'll need embedding a native control in Avalonia window do you have any thoughts, guidelines how to implement that?
Steven Kirk
@grokys
Jun 17 2016 11:11
we've not got a solution for that yes as far as i know
tbh i'm not sure what would be involved, but i don't think it should be too difficult
Andrey Kunchev
@donandren
Jun 17 2016 12:47
yes don't think ti should be t, I was thinking of a IControlImpl or INativeControlImpl with AddChild(IControlImpl) RemoveChild(IControlImpl) and be similar like IWindowImpl may be some possitioning methods and IWindowImpl inherits IControlImpl
Nikita Tsukanov
@kekekeks
Jun 17 2016 12:52
For proper embedding we need to support something like gtksocket/gtkplug on platform backend side first
In case of GTK it will directly map to said gtksocket
in case of win32 it will be a separate child window, initially hidden
Those will have window handles even if not attached to actual on-screen windows
So one can safely add child external windows to them
again, in case of GTK it will be handled automagically
using some SetWindowParent magic on windows, XEmbed on linux and whatever method they use on OS X
That will allow us to embed anything and we only need the window handle
this way you can embed MPlayer to your window for example
which works in a separate process
There is no need for inter-process embedding on mobile platforms
Nikita Tsukanov
@kekekeks
Jun 17 2016 12:57
So there we can do it in a simplier way
I already have some plans for embedding architecture and hopefully find time for that this month
Since we definetely need embedding for mobile platforms, because, well, people will need native textboxes
Our looks like abomination there
Andrey Kunchev
@donandren
Jun 17 2016 13:02
yea that would be nice
Steven Kirk
@grokys
Jun 17 2016 13:22
is embedding even worth doing x-plat? i mean, it's intrinsically platform specific
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:22
It's not
On desktop you can embed anything as long as you have window handle
There are some quirks, but they are handled by GTK
Steven Kirk
@grokys
Jun 17 2016 13:24
but the thing you're embedding is going to be specific to the OS you're running on right?
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:24
it's "window handle" for desktop
that's it
just IntPtr
In case of mobile platforms it's going to be tricky since we'll need to embed native views which are represented by objects
But that can be handled
The "EmbeddedWidgetHost" can still be xplat
Steven Kirk
@grokys
Jun 17 2016 13:26
but the thing you're embedding is going to be platform specific so you're going to have platform specific code in there anyway
so why not just tie the embedding to the windowing subsystem
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:26
Well, what exaclty is platform-specific in spawning mplayer process via System.Diagnostics.Process.Start?
Steven Kirk
@grokys
Jun 17 2016 13:27
ok embedding a subwindow of another process you might be able to do x-plat
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:27
Same thing with native wigdets
You have some platform-specific dll
Steven Kirk
@grokys
Jun 17 2016 13:28
how do i create a windows widget on lunix?
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:28
which provides you with something
that returns you a window handle
Said platform-specific lib doesn't need to know about avalonia
It might even be some native lib
Steven Kirk
@grokys
Jun 17 2016 13:29
i guess yeah
@donandren what's your use-case?
Andrey Kunchev
@donandren
Jun 17 2016 13:30
I'll need to embed a native video player
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:30
Which, I guess, is mplayer of vlc
Andrey Kunchev
@donandren
Jun 17 2016 13:30
nope
it's a custom native player
but that shouldn't matter also a webbrowser probably
for windows
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:33
For xplat webbrowser we need CEF
Andrey Kunchev
@donandren
Jun 17 2016 13:33
it'll be most probably a platform browser control from the system
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:34
you can do this with windows
Andrey Kunchev
@donandren
Jun 17 2016 13:34
yes
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:34
but for linux/osx we'll need cef
since ther is no proper browser control for gtk that actually works
Andrey Kunchev
@donandren
Jun 17 2016 13:34
don't have experience with linux, but probably CEF will be the option there
but ios, android, windows has browser window controls
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:36
Well, for windows we either stick with the control from winforms (which is kinda crap, because, well, IE) or also use CEF
Probably need switchable browser backends or something
Andrey Kunchev
@donandren
Jun 17 2016 13:37
so i was thinking more a generic way in avalonia to allow embedding a native control and it shouldn't be too hard
and also option for embedding avalonia window in native control probably a good option also
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:37
yep, embedding infrastructure is a prerequisite for webview

and also option for embedding avalonia window in native control probably a good option also

We already have some support for that

It's used by designer
There is IWindowingPlatform::CreateEmbeddableWindow
It will give you a IWindowImpl that can be passed to Window constructor
for now it only works for windows, but it will be easy to implement with gtk
not sure about mobile platforms through, probably there will be a lot of refactoring to be done
Andrey Kunchev
@donandren
Jun 17 2016 13:41
yea basically it should be possible to attach WindowImpl to existing native control and it should be ok
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:45

attach WindowImpl to existing native control and it should be ok

You can't "attach" it to something

window implementation needs to create it's own window/view/whatever
it won't be able to work otherwise
The only thing that avalonia can provide you with
Andrey Kunchev
@donandren
Jun 17 2016 13:46
not to anything, but to special host control that supports that
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:46
is a native widget that can be embbedded somewhere else
On windows it will be a window handle that you'll be able to pass to WPF's WindowHost, for example
For other desktop platforms it will be a GtkPlug (which also provides said window handle)
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:53
There also will be backend-specific wrappers
that do actual work for you
but core embedding system will only provide a raw widget/window handle
Andrey Kunchev
@donandren
Jun 17 2016 13:56
yea I was thinking the same way, and to provide some generic support for easily embed native (prepared for that purpose) controls/widgets
with support for positioning in the parent window, enable/disable visibility and remove them when needed
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:57
ehm
Darnell Williams
@Seeker1437
Jun 17 2016 13:57
@kekekeks nice work with the pcl stuff
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:57
You can't do that in a uniform way, unfortunately
Andrey Kunchev
@donandren
Jun 17 2016 13:58
all this will be implemented in a platform code
Darnell Williams
@Seeker1437
Jun 17 2016 13:58
I see now why spawning a stub isnt a great idea
Nikita Tsukanov
@kekekeks
Jun 17 2016 13:58
for example WPF's WindowHost forces it's child to have specific dimensions
We can add some shim code to pass size request to the parent widget
but that's it
Andrey Kunchev
@donandren
Jun 17 2016 13:59
yea that should be enough
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:36
@grokys @jkoritzinsky
AvaloniaUI/Avalonia#553
Are you sure that we should add opacity mask support in drawing api
if we know that it won't ever work on some platforms?
kinda removes "cross-platform" part from avalonia
Steven Kirk
@grokys
Jun 17 2016 14:37
well it was requested by @danwalmsley, and it's supported on WPF etc
i have no strong opinion
but also i don't think we should leave stuff out because it can't be supported on every platform
we can have warnings "X is not supported on Y"
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:39
Well, rendering is a core part
We should aim for pixel-perfect match on every platform
Steven Kirk
@grokys
Jun 17 2016 14:40
ha! i don't know how possible that is. it's certainly not something I was aiming for
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:40
Then it won't be "write once - run everywhere"
Steven Kirk
@grokys
Jun 17 2016 14:40
it'd be nice sure
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:41
It will be "look, we have another platform hell for you"
Steven Kirk
@grokys
Jun 17 2016 14:41
well we can try for it, but like i say, i'm not sure how possible it is
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:41
"Sure you can write your xaml that looks nice in designer, but it will turn into a mess on your iPhone"
Steven Kirk
@grokys
Jun 17 2016 14:42
you're not going to be porting a desktop app as-is to a phone. there's going to have to be some consideration paid by the writer of the application to where it's running
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:42
People expect to rearrange stuff to work well with touch UI
not to rewrite drawing code
Steven Kirk
@grokys
Jun 17 2016 14:44
our backends are pluggable - we don't know what platforms we're going to be supporting
if a backend can't support something, that's fine IMO
Nikita Tsukanov
@kekekeks
Jun 17 2016 14:45
Yeah, but there are core platforms and we know that opacity mask doesn't work with android
Steven Kirk
@grokys
Jun 17 2016 14:46
ok, so there are 2 options: remove the feature for everyone even though it can work on all but 1 backend, or don't support it on 1 backend
i prefer the second option personally
i'm open to persuasion - what do others think?
José Manuel Nieto
@SuperJMN
Jun 17 2016 14:49
Yay! I'm making a lot of progress with immutability! Immutable lists are already supported, and immutable objects are starting to be created, too!
Steven Kirk
@grokys
Jun 17 2016 14:50
cool, immutable objects will be useful
immutable lists, not so much right now for us
btw do events now work? i saw you merged @jkoritzinsky 's PR
Jeremy Koritzinsky
@jkoritzinsky
Jun 17 2016 15:07
@kekekeks There isn't a good place to put opacity masks anywhere else. And I've been trying to figure out how to do the stuff in Skia.
Nikita Tsukanov
@kekekeks
Jun 17 2016 15:08
And this
Jeremy Koritzinsky
@jkoritzinsky
Jun 17 2016 15:10
@kekekeks Thanks! For some reason I just couldn't seem to find the right stuff. I'll try that out tonight.
José Manuel Nieto
@SuperJMN
Jun 17 2016 15:10
@grokys yes! it's on another branch
Jeremy Koritzinsky
@jkoritzinsky
Jun 17 2016 15:10
@grokys Non-attached events work as expected. Attached events will require more API work.
Nikita Tsukanov
@kekekeks
Jun 17 2016 15:10
If you are stuck with skia try to look for android examples
because android's canvas is basically a wrapper around SkCanvas
Jeremy Koritzinsky
@jkoritzinsky
Jun 17 2016 15:10
Thanks for the suggestion! I'll remember that for the future.
Steven Kirk
@grokys
Jun 17 2016 15:10
@jkoritzinsky yeah just normal events are fine for now
btw did you try opacity masks in the ControlCatalog? don't know if i was doing something wrong but didn't seem to work
Jeremy Koritzinsky
@jkoritzinsky
Jun 17 2016 15:12
I'll try it out again when I start messing with stuff tonight. I've just been extremely busy recently. My best friend came into town last weekend so I spent all of the weekend hanging out with her.
Steven Kirk
@grokys
Jun 17 2016 15:14
no problem :) there's no hurry!
Reed Copsey, Jr.
@ReedCopsey
Jun 17 2016 17:29
@grokys Saw you're going to present a lightning talk at .net fringe - that's awesome
Steven Kirk
@grokys
Jun 17 2016 17:30
yep! looking forward to it!
Steven Kirk
@grokys
Jun 17 2016 17:39
i assume are you going to be there? will be nice to meet you!
Wiesław Šoltés
@wieslawsoltes
Jun 17 2016 19:17
@grokys Issue #563 is still happening, here is screen-capture:
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:08
https://github.com/tijoytom/capstan-example Meanwhile .NET on unikernels
i. e. without OS
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:09
that's linux based?
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:09
nope
There is no linux there
it will run on bare metal
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:09
so they implement all drivers etc, in a linux compatible way?
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:10
nope
There are no processes
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:10
so what does the drivers and kernel? ie, you'll need some kind of kernel
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:10
everything runs in ring-0
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:10
ok
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:10
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:10
reading a bit..
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:10
The idea is to run that in KVM/Hyper-V
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:10
ok, makes sense
similar to hyperv containers
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:11
and use stuff provided by hypervisor
So there is no context switch overhead, etc
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:11
well, less..
;)
you'll still have interrupts
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:12
Yeah, but there is no stupid stuff like switching to kernel mode to write to a file or allocate a page of memory
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:12
ok
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:13
https://github.com/tijoytom/capstan-example - this guy used dotnet-cli tool to compile his code to C++ (it allows you to bundle coreclr and corefx)
And then linked that cpp code with OSv
OSv (stylized OSv) is a cloud computing focused computer operating system released on September 16, 2013. It is a special-purpose operating system built to run as a guest on top of a virtual machine, thus it does not include drivers for bare-metal hardware. It is a slim, bare bones unikernel including just the functionality necessary to run Java or POSIX applications. For this reason, it does not support a notion of users (it's not a multiuser system) or processes - everything runs in the kernel address space. Using a single address space removes some of the time-consuming operations associated with context switching. It uses large amounts of code from the FreeBSD operating system, in particular the network stack and the ZFS file system. OSv can be managed using a REST Management API and an optional command line interface written in Lua.
So they are running coreclr apps on top of that
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:19
cool
but they'll still emulate the syscalls, meaning a lot of memory copying i think?
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:20
why
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:20
hmm, no, because they also have the clibs etc
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:20
OSv has its own libc
which is aware of the fact that it's running in unikernel
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:23
yeah, hmm
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:25
New .NET Core APIs
System.Drawing
Wow
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:25
Awesome!!
where did you read about that?
already in rc2
May be we should dump cairo or something :)
They only included primitive structs like Rectangle, Point and Size
that's something
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:27
you mean its too primitive ?
well, give them another 6 release candidates.. ;)
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:28
so no actual drawing stuff?
Nikita Tsukanov
@kekekeks
Jun 17 2016 20:28
yep
Well they have the same problem that we've encountered: no proper xplat native drawing library except skia
Matthijs ter Woord
@mterwoord
Jun 17 2016 20:30
:)