Skip to content

App Rendering Protocol (ARP) #215

Open

Description

@mitsukaki

So after closing the original thread where the idea was designed, we know are that much closer to our graphic systems. With remote renderers complete and local one's in the works, one question still remains.

"So how do I make a window?"

Whether we treat the content of a window as a page, a canvas, or whatnot, the actual process to create this, and interface to work with it needs to be standard for apps to work across NodeOS platforms. Ideally, a well designed platform can also have a shell to allow it to run on platforms other than NodeOS.

The simplest way to go about this is to create a module. This modules sole job would be to tell whatever window manager happens to be on the device, to create a window (via some interface). And allow the app to render to the window. That is all, as any additional manager specific features could be included separately in different modules by that window manager's maintenance team.

Seeing that apps need to work in the browser, this 'module' could be a dual that work both as an import or a nodejs module. I will create a repository for us (the nodeos community) to begin hacking away at a system that works.

Activity

  1. mitsukaki commented on Mar 1, 2016

    @mitsukaki
    ContributorAuthor

    needs to be standard for apps to work across NodeOS platforms.

    I meant to say, it needs to be standardized for it to work across NodeOS window managers. As not all managers may chose to run apps fullscreen, they need to be asked first and interacted with when an app works with a window.

  2. self-assigned this
    on Mar 1, 2016
  3. Coretool commented on Mar 1, 2016

    @Coretool
    Member

    And don't forget that apps which do not run on a Desktop will always be rendered as full screen apps, since the framebuffer size will be set to full screen... They do not have anything like a windowing system, this is oart of the desktop. I think we should make a standard format for apps that do run on Desktops, since they won't be able to just be a standard webpage ...

  4. piranna commented on Mar 1, 2016

    @piranna
    Member

    Isn't this fixed with the URLs design I proposed to launch GUI apps backend
    servers? Or are you talking about a common protocol for the desktop
    environments to interact with the window manager (maximize, minimize,
    close...)? If so, the important part is to have a common API that all apps
    could agree, and for this se could write a library that overwrite the
    current methods for the browser Window object (or implement them for
    non-browser environments). Is it really needed to store some state on the
    Desktop Environment backend server? I think the Window Manager could (and
    should) be implemented purely client side as Os.js does...
    El 1/3/2016 4:53 AM, "Lite McFish" notifications@github.com escribió:

    So after closing the original thread where the idea was designed, we know
    are that much closer to our graphic systems. With remote renderers complete
    and local one's in the works, one question still remains.

    "So how do I make a window?"

    Whether we treat the content of a window as a page, a canvas, or whatnot,
    the actual process to create this, and interface to work with it needs to
    be standard for apps to work across NodeOS platforms. Ideally, a well
    designed platform can also have a shell to allow it to run on platforms
    other than NodeOS.

    The simplest way to go about this is to create a module. This modules sole
    job would be to tell whatever window manager happens to be on the device,
    to create a window (via some interface). And allow the app to render to the
    window. That is all, as any additional manager specific features could be
    included separately in different modules by that window manager's
    maintenance team.

    Seeing that apps need to work in the browser, this 'module' could be a
    dual that work both as an import or a nodejs module. I will create a
    repository for us (the nodeos community) to begin hacking away at a system
    that works.

    —
    Reply to this email directly or view it on GitHub
    #215.

  5. piranna commented on Mar 1, 2016

    @piranna
    Member

    In other words: KISS (Keep It Simple, Stupid) and DRY (Don't Repeat
    Yourself) rules ;-)
    El 1/3/2016 8:08 AM, "piranna@gmail.com" piranna@gmail.com escribió:

    Isn't this fixed with the URLs design I proposed to launch GUI apps
    backend servers? Or are you talking about a common protocol for the desktop
    environments to interact with the window manager (maximize, minimize,
    close...)? If so, the important part is to have a common API that all apps
    could agree, and for this se could write a library that overwrite the
    current methods for the browser Window object (or implement them for
    non-browser environments). Is it really needed to store some state on the
    Desktop Environment backend server? I think the Window Manager could (and
    should) be implemented purely client side as Os.js does...
    El 1/3/2016 4:53 AM, "Lite McFish" notifications@github.com escribió:

    So after closing the original thread where the idea was designed, we know
    are that much closer to our graphic systems. With remote renderers complete
    and local one's in the works, one question still remains.

    "So how do I make a window?"

    Whether we treat the content of a window as a page, a canvas, or whatnot,
    the actual process to create this, and interface to work with it needs to
    be standard for apps to work across NodeOS platforms. Ideally, a well
    designed platform can also have a shell to allow it to run on platforms
    other than NodeOS.

    The simplest way to go about this is to create a module. This modules
    sole job would be to tell whatever window manager happens to be on the
    device, to create a window (via some interface). And allow the app to
    render to the window. That is all, as any additional manager specific
    features could be included separately in different modules by that window
    manager's maintenance team.

    Seeing that apps need to work in the browser, this 'module' could be a
    dual that work both as an import or a nodejs module. I will create a
    repository for us (the nodeos community) to begin hacking away at a system
    that works.

    —
    Reply to this email directly or view it on GitHub
    #215.

  6. mitsukaki commented on Mar 1, 2016

    @mitsukaki
    ContributorAuthor

    And don't forget that apps which do not run on a Desktop will always be rendered as full screen apps,

    Yes because of this the "window size" params would only be preferences.

    Or are you talking about a common protocol for the desktop
    environments to interact with the window manager (maximize, minimize,
    close...)?

    I would assume the window manager would be a part of the desktop environment and that the developer of the desktop environment should ensure the two are compatible. By a rendering protocol I mean, say I'm an app. How do I make a window to show my content to? Apps ought not to be limited to one frame. The ARP would specify how apps ough to simply create window. From there on, the interactions with it and such are all specific to the window manager.

  7. piranna commented on Mar 1, 2016

    @piranna
    Member

    Yes because of this the "window size" params would only be preferences.

    I'm not sure if there's already support for this on HTML/Javascript or only as a parameter when calling window.open()... If so we should use it instead of invent our own mechanism.

    I would assume the window manager would be a part of the desktop environment and that the developer of the desktop environment should ensure the two are compatible.

    I agree.

    By a rendering protocol I mean, say I'm an app. How do I make a window to show my content to?

    Simple: use window.open() :-)

    • Running full-screen without a desktop manager? The browser native method will be used.
    • Running inside a HTML5 Desktop Environment? The Desktop Environment would have overwrite the window.open() method of the app window iframe so it will call the Desktop Environment internal mechanism to create a new window (mostly create a new iframe, but it would be whatever).
    • Running on an "alien" environment (for example a framebuffer-based renderer)? That environment should emulate the window.open() method someway.

    Apps ought not to be limited to one frame. The ARP would specify how apps ough to simply create window. From there on, the interactions with it and such are all specific to the window manager.

    I agree, but as I've said, I think it's just enough that all Desktop Environments and Window Managers use a common API, and the most obvious one is to use the methods from the browser Window object.

  8. zodern commented on Mar 1, 2016

    @zodern
    Contributor

    I am working on a new app framework fork Silk which is compatible with electron. Stretto already runs in Silk.

    It requires nodeIntegration to be disabled in all windows and will not support preloading files. I have only found a couple electron apps that meets those requirements. But all apps made for Silk will run on Windows, OSX and Linux with no modifications.

  9. piranna commented on Mar 1, 2016

    @piranna
    Member

    nodeIntegration is what makes possible to access Node.js APIs directly from the HTML/client side code, isn't it? +1 to require it to be disabled, makes it more difficult to program but the architecture is more elegant and flexible.

  10. mitsukaki commented on Mar 2, 2016

    @mitsukaki
    ContributorAuthor

    Simple: use window.open() :-)

    By using window.open we actually break compatibility with existing browsers. Since window.open() exists already, when called in a browser it would create an additional window even though the code is already being run in one where as on node it doesn't have one. We also can't immediately create a window when imported into the module (required) if it's a module that is, because the app may not want to use the window right away (and hence the developers might have preferred to create it later)

  11. mitsukaki commented on Mar 2, 2016

    @mitsukaki
    ContributorAuthor

    The proposal solution is to implement both functions. One function would be used only at start to create the initial window browsers would already have. If called in a browser this would throw an error. However, developers can use a simple pollyfill to solve. If the function name was buildFrame then
    if(window.buildFrame) { window.buildFrame("window", 720, 480); }

    quick and easy fix!

  12. mitsukaki commented on Mar 2, 2016

    @mitsukaki
    ContributorAuthor

    I am working on a new app framework fork Silk which is compatible with electron. Stretto already runs in Silk.

    If you chose to support nodeOS, you could easily just import said 'window' module and expand it to your users. I'm reserving the npm name 'frame' for it.

  13. piranna commented on Mar 2, 2016

    @piranna
    Member

    By using window.open we actually break compatibility with existing browsers. Since window.open() exists already, when called in a browser it would create an additional window even though the code is already being run in one where as on node it doesn't have one.

    I understand your concerns, but you are taking a bad point of view: we are writting a Windows Manager using HTML iframes as containers to host the GUI apps "windows" content. The point is, you are missing that fact that each one of these iframes has its own window object, and independent from the browser "main frame" one (the Desktop Environment / WIndow Manager). Taking this in account, nothing forbids us to inject code that overwrite the window.open() method inside that iframe to do a postMessage() call to the parent frame (the Window manager) to create a new iframe for the new GUI app "window" instead of having the browser default behaviour of create a new browser window, and in fact this is something similar to what Firefox does to show modal windows inside the browser rendering region instead of OS level independent windows. The main problem would be how to know when to inject that code on the iframe, since it must be on each iframe navigation change after the current page clean-up (if any) and just before the new page start downloading and executing new content.

  14. piranna commented on Mar 2, 2016

    @piranna
    Member

    Taking this in account, nothing forbids us to inject code that overwrite the window.open() method inside that iframe to do a postMessage() call to the parent frame (the Window manager) to create a new iframe for the new GUI app "window" instead of having the browser default behaviour of create a new browser window

    Well... here we have something that could be discussed, what protocol to follow in this postMessage() based communication, this way the injected code to overwrite the behaviour of the window object on the iframes would be common and the diferent Windows Manager only would need to listen for this messages and process them :-) The most simple and minimal solution here is to use a 1:1 mapping from the window object method names and their calls positional arguments to JSON-RPC requests. Only problem I would find here is that I believe most of these methods are sincronous... :-/

  15. mitsukaki commented on Mar 2, 2016

    @mitsukaki
    ContributorAuthor

    Well... here we have something that could be discussed, what protocol to follow in this postMessage() based communication, this way the injected code to overwrite the behaviour of the window object on the iframes would be common and the diferent Windows Manager only would need to listen for this messages and process them :-) The most simple and minimal solution here is to use a 1:1 mapping from the window object method names and their calls positional arguments to JSON-RPC requests. Only problem I would find here is that I believe most of these methods are sincronous... :-/

    Ah. I haven't worked much with JSON-RPC so I wouldn't be to useful here.

    I understand your concerns, but you are taking a bad point of view: we are writting a Windows Manager using HTML iframes as containers to host the GUI apps "windows" content. The point is, you are missing that fact that each one of these iframes has its own window object, and independent from the browser "main frame" one (the Desktop Environment / WIndow Manager).

    Ah okay, that makes a lot more sense

  16. 13 remaining items

  17. Coretool commented on Mar 4, 2016

    @Coretool
    Member

    @piranna I've looked into building electron and I don't think that it would be easy to make it render to the linuxfb...

  18. piranna commented on Mar 4, 2016

    @piranna
    Member

    @piranna I've looked into building electron and I don't think that it would be easy to make it render to the linuxfb...

    Sh*t... :-(

  19. mitsukaki commented on Mar 5, 2016

    @mitsukaki
    ContributorAuthor

    @Coretool Yeah... no. XD have fun with that. It's modified CEF impements x11 on linux (maybe support wayland) but the struggle it would take to implement it for the fb is real.

    Sh*t... :-(

    What other options do we have?

  20. Coretool commented on Mar 5, 2016

    @Coretool
    Member

    Just stick with noGui (or start with it ^^) and iframes ^^

  21. piranna commented on Mar 5, 2016

    @piranna
    Member

    Good idea, let's get something working and later we'll move on.
    El 5/3/2016 9:33, "John Green" notifications@github.com escribió:

    Just stick with noGui (or start with it ^^) and iframes ^^

    —
    Reply to this email directly or view it on GitHub
    #215 (comment).

  22. mitsukaki commented on Mar 6, 2016

    @mitsukaki
    ContributorAuthor

    @piranna @Coretool sounds good. Awaiting a working noGui build. Let me know if you guys get anywhere!

  23. piranna commented on Mar 6, 2016

    @piranna
    Member

    @piranna @Coretool sounds good. Awaiting a working noGui build. Let me
    know if you guys get anywhere!

    Could someone take a look on the docs how to give an URL to QtWebkit, at
    least a hardcoded one? I only get a blank page (the same as @formula1 with
    its experiment with webkit.js...).

  24. Coretool commented on Mar 6, 2016

    @Coretool
    Member

    @piranna Take a look at noGui. (main.cc) It does that ^^ Change the code in QUrl() to your url. Are there any network errors or what ?

  25. piranna commented on Mar 6, 2016

    @piranna
    Member

    Take a look at noGui. (main.cc) It does that ^^

    Lol :-P Yes, you're right. We need more error checking there, since at this moment it hides the console output and gets control of the keyboard and only way is to swith off the machine, that's tedious to test...

  26. Coretool commented on Mar 6, 2016

    @Coretool
    Member

    Yeah... I've to add the keyboard shortcuts and so on.

  27. formula1 commented on Mar 6, 2016

    @formula1
    Contributor

    http://doc.qt.io/qt-5/qwebview.html#load

    Is this the method you're looking for?

    I'm going to checkout breifly how embeddable servo is. They recently (I think last week) showed an intense proof of concept that rendered Rediculous things at > 60 fps. They acheived this through offloading most of the work to the GPU (so GPU-less machines may still be in trouble) but they are really doing great stuff over there. I really wouldn't be too suprised if a rust javascript engine becomes standard over time.

    EDIT: Cancel that thought. Its still way too early and pretty laggy. Long term it would be great but unrealistic for the time being

  28. Coretool commented on Mar 6, 2016

    @Coretool
    Member

    @formula1 Yes, it's this method.

  29. piranna commented on Mar 6, 2016

    @piranna
    Member

    I'm going to checkout breifly how embeddable servo is. They recently (I
    think last week) showed an intense proof of concept that rendered
    Rediculous things at > 60 fps. They acheived this through offloading most
    of the work to the GPU (so GPU-less machines may still be in trouble) but
    they are really doing great stuff over there. I really wouldn't be too
    suprised if a rust javascript engine becomes standard over time.

    It would be good to have several rendering engines to compare. I'm going to
    try to find some time to fix the ICU static compilation, but if someone
    wants to take a look on it or avout getting noGUI to render something, any
    help will be welcome. In that way, I was thinking we could be able to
    enable X11 support to make it easier to test and when we get something
    usable disable it again, what do you think?

  30. mitsukaki commented on Mar 7, 2016

    @mitsukaki
    ContributorAuthor

    It would be good to have several rendering engines to compare.

    I'm now contending with the struggle of designing and constructing my own mostly taking inspiration from Blink. Hopefully I'll be able to give more insight on possible solutions with my greater understanding of web engines when I'm done this project (Velocity)

  31. Coretool commented on Mar 7, 2016

    @Coretool
    Member

    @piranna I think I have to add some logging to noGui, it doesn't throw errors at all :/ ... I know that the 'normal' desktop version works but I've really no plan, why the static one doesn't... Enabling X11 would be great for testing and maybe a first release since it would make the qt stuff far easier (querying the display size, setting the view size etc ... even if I'm not sure if this would still be needed )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions