These are chat archives for AvaloniaUI/Avalonia

7th
Jun 2017
danwalmsley
@danwalmsley
Jun 07 2017 10:20
@grokys did you install vs2017.3 in the end?
Steven Kirk
@grokys
Jun 07 2017 10:24
didn't have time yet
my girlfriend has become obsessed with twin peaks and insists i watch it with her every spare moment
she's promised me an evening off tonight though so might get time
Matthijs ter Woord
@mterwoord
Jun 07 2017 10:28
@galvesribeiro See private message..
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:35
@grokys according to the current layout code
Measure will call IVisual.Measure only on the layout root
If I understand correctly what's happening there
Which in turn will call measure on it's subtree
Steven Kirk
@grokys
Jun 07 2017 10:37
it will first iterate upwards towards the root, call measure on that, which will measure its subtree
if anything didn't get meaured by that, it will call measure on that control when unwinding the iteration
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:37
Yep, but then subtrees will be remeasured again
one by one
Steven Kirk
@grokys
Jun 07 2017 10:38
if (!control.IsMeasureValid)
which means they won't be remeasured
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:39
So invalidating measure of any control actually triggers measurement of the whole tree
Steven Kirk
@grokys
Jun 07 2017 10:39
no, because controls are only measured if their measure is invalid
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:40
There is no such check for layout root
You are always calling root.Measure(root.MaxClientSize);
Which will in turn recursively run measure
it's messy i know
you should see WPF's layout code
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:41
I'm trying to figure out how to intregrate it with host layout systems
like WPF and Cocoa
Steven Kirk
@grokys
Jun 07 2017 10:43
for that don't you just need to set a new size on the root?
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:43
Not exactly
Our current system works fine with fixed clientsize or application-controlled clientsize (i. e. autosize)
But in case of embedding we need to implement external Measure/Arrange calls and call InvalidateMeasure when needed
Steven Kirk
@grokys
Jun 07 2017 10:49
yeah, but theoretically that sounds just the same as any control measuring its child?
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:50
I've implemented Measure/Arrange and they seem to work
The problem is that I don't know when I should call WPF's InvalidateMeasure
but there's not a good way to hook into that from above the root
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:52
So I can override that in TopLevel, right?
Steven Kirk
@grokys
Jun 07 2017 10:52
yeah, that'd tell you when toplevel's child's desired size changes
Nikita Tsukanov
@kekekeks
Jun 07 2017 10:55
Hm
I guess I could just make InvalidateMeasure virtual
Steven Kirk
@grokys
Jun 07 2017 10:58
@kekekeks https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Layout/Layoutable.cs#L72 - DesiredSize is an avalonia property - can't you just listen for changes to that?
Nikita Tsukanov
@kekekeks
Jun 07 2017 11:38
The problem is that it's limited by ClientSize
I might need to get rid of TopLevel entirely
And just implement a custom one
Hm...
I will need to implement IInputRoot, IRenderRoot, ILayoutRoot and IStyleRoot
Meh, ILayoutRoot still have the concept of ClientSize
and MaxClientSize
Nikita Tsukanov
@kekekeks
Jun 07 2017 11:44
Which is only used by item virtualizer
Matthijs ter Woord
@mterwoord
Jun 07 2017 12:06
blegh, still fighting building for raspberry
Meanwhile on WPF integration front
Matthijs ter Woord
@mterwoord
Jun 07 2017 14:23
cool!
Nikita Tsukanov
@kekekeks
Jun 07 2017 14:39
You can even reference avalonia controls from WPF's xaml
        <GroupBox Header="AvBtn" DockPanel.Dock="Right">
            <wpf:WpfAvaloniaHost x:Name="RightBtn">
                <av:Button Content="Avalonia button 2"/>
            </wpf:WpfAvaloniaHost>
        </GroupBox>
It won't detect our bindings, content properties, etc
But you can still reference your views directly
Matthijs ter Woord
@mterwoord
Jun 07 2017 15:00
if i have issues getting to the Skia font manager, what might be wrong?
Joel Day
@joelday
Jun 07 2017 15:03
Thanks again to @kekekeks for the help yesterday.
Matthijs ter Woord
@mterwoord
Jun 07 2017 15:06
Shoot. I forgot to save the avaloniasvs file (current latest)
@kekekeks I think you gave it to me last time?
if you would be so kind....
Joel Day
@joelday
Jun 07 2017 15:13
For a platform implementation, what do I really need to implement as far as DrawingContext, Rendering and Framebuffers/surfaces?
I’d like to limit the actual per-pixel blitting/bitmap management that the framework is responsible for.
In my specific, weird case, anything manipulating a raw image buffer isn’t really applicable.
I think I need clarity on what the architecture is for how visuals ultimately make it to the screen.
something like that?
Matthijs ter Woord
@mterwoord
Jun 07 2017 15:34
hmm, my linking is wrong.
Nikita Tsukanov
@kekekeks
Jun 07 2017 15:37
@joelday It's better to create a stub implementation
And handle rendering in your own code
Joel Day
@joelday
Jun 07 2017 15:43
Does the stub surface have to exist?
on the Embeddable impl
Nikita Tsukanov
@kekekeks
Jun 07 2017 15:44
I don't think that you need it
You can create your own renderer instance
That won't actually call render
Joel Day
@joelday
Jun 07 2017 15:45
Cool
What’s a good example of which services I need to register on the locator in my app builder?
Nikita Tsukanov
@kekekeks
Jun 07 2017 15:46
See files with names ending with Platform.cs
Joel Day
@joelday
Jun 07 2017 15:51
When should I expect a IRuntimePlatform to exist? Do I have to add that?
I was trying to use AvaloniaLocator.Current.GetService<IRuntimePlatform>().PostThreadPoolItem in my Keyboard class created in my IEmbeddableWindowImpl just like the LinuxFramebuffer one, but it was null.
Joel Day
@joelday
Jun 07 2017 16:00
Probably not using AppBuilder properly?
This is what I have right now:
class Program
{
    static void Main(string[] args)
    {
        AppBuilder.Configure<App>().InitializeWithTerminal(t =>
        {
            System.Diagnostics.Debugger.Break();
        });
    }
}

public class App : Application
{
    public override void Initialize()
    {
        // AvaloniaXamlLoader.Load(this);
    }
}
Ugh, Gitter’s code MD is being weird.
There we go.
Thanks again for answering all this. :D
Matthijs ter Woord
@mterwoord
Jun 07 2017 16:14
So, I have a libskia.a file, which, when built to an executable which calls the fontmgr to find out hte number of fonts, works just fine.
something is going wrong with linking that to a shared object..
anybody has an idea?
Matthijs ter Woord
@mterwoord
Jun 07 2017 16:26
got it!
Matthijs ter Woord
@mterwoord
Jun 07 2017 16:35
what windowing system is being used on linux?
Matthijs ter Woord
@mterwoord
Jun 07 2017 17:05
hmm, some atoc thing is going wrong..
atoc -> atomic
refcounting based.
If you guys want me to stop rambling about this, please do tell!
Nikita Tsukanov
@kekekeks
Jun 07 2017 17:13
@joelday you are supposed to pass initialization delegate for your platform to appbuilder
Then it will call it during SetupWithoutStarting
Not before
Matthijs ter Woord
@mterwoord
Jun 07 2017 18:52
FYI i made a script for building the .so file for raspberry. if anyone is interested, ic an make it..
public
Nikita Tsukanov
@kekekeks
Jun 07 2017 19:48
Docker image would be preferable
what was the main issue with the build?