Posted 31 December 2013 - 07:28 PM
This is a simple draft RFC (Request for Comments) for allowing apps that are running under an "OS" (shell) to open new, independent windows
outside the primary program's screen. This draft does not include any fallback for if your shell hasn't implemented the protocol, as that would be unique
to the toolkit your program is using for showing the UI.
The primary goals of this protocol are:
Flags are a simple list of string values, which should be one of the following.
Additional Notes:
The returned id can take any form, however it should be assumed to be unique on an at-least per-program basis. For the purposes of term.activeWindow() – the normal terminal window that all apps have is defined as 'main-window'.
Changes
I'm looking for feedback on any part of this draft, as that is the reason I'm publishing it.
outside the primary program's screen. This draft does not include any fallback for if your shell hasn't implemented the protocol, as that would be unique
to the toolkit your program is using for showing the UI.
The primary goals of this protocol are:
- Self-Contained
- Toolkit/Shell agnostic
- Ease of use
- term.newWindow(title, width, height) – Returns: id, term
- term.activeWindow() – Returns the active window ID, if it's the app is inactive, this should return nil (Though, ideally your app would not be getting events if this is the case.)
- setTitle(title) – Changes the window's title.
- setSize(size) – Changes the window's size
- show() – Shows the window from a hidden state.
- hide() – Hides a window from a shown state.
- getFlags() – Returns a table of string flags.
- setFlags(table) – Sets the flags currently applied, as a table of string values.
- window_flag_added id, flag – Fired when a flag is added to the given window.
- window_flag_removed id, flag – Fired when a flag is removed from the given window.
- window_resize id – Fired when a window is resized, given the window ID that was resized.
Flags are a simple list of string values, which should be one of the following.
- Capabilities
- minimisable
- resizable
- closable
- modal – Means the main window may not get focused unless this window is dismissed.
- State (Read-Only)
- minimised
- maximised
- focused
Additional Notes:
The returned id can take any form, however it should be assumed to be unique on an at-least per-program basis. For the purposes of term.activeWindow() – the normal terminal window that all apps have is defined as 'main-window'.
Changes
- 2014-02-05
- Add modal flag, makes the window jump to the top when it's parent window is selected.
- 2014-01-19
- Removal of window_char, window_key, etc.
- Addition of term.activeWindow()
- Additional details on standard flags.
- 2014-01-15
- Initial addition of this section.
- Rename window_resized to window_resize in the spirit of LyqydOS
I'm looking for feedback on any part of this draft, as that is the reason I'm publishing it.
Edited on 05 February 2014 - 04:02 PM