View Source ReflectOS.Kernel.Layout.Registry (reflect_os_kernel v0.10.0)
Used to register one or more ReflectOS.Kernel.Layout
with the system.
If you are building an extension library with a new layout type, the layout module must be registered with the ReflectOS system. This will ensure that it's available for users to create and configure layouts via the Console UI application.
The recommended way to accomplish this is to do so by starting a task in the root supervisor of your application.
For example:
defmodule MyReflectOSExtensions.Application do
@moduledoc false
use Application
alias ReflectOS.Kernel.Layout.Registry, as: LayoutRegistry
@impl true
def start(_type, _args) do
children = [
# Start a task to register ReflectOS extensions
{Task, fn -> reflect_os_register() end}
]
opts = [strategy: :one_for_one, name: MyReflectOSExtensions.Supervisor]
Supervisor.start_link(children, opts)
end
defp reflect_os_register() do
LayoutRegistry.register([
MyReflectOSExtensions.Layouts.MyNewLayout,
])
end
end
Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieves a list of definitions for all registered layouts.
Retrieves the list of registered layout modules.
Registers a module with the Layout registry.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec definitions() :: [ReflectOS.Kernel.Layout.Definition.t()]
Retrieves a list of definitions for all registered layouts.
@spec list() :: [module()]
Retrieves the list of registered layout modules.
Registers a module with the Layout registry.
Accepts either a single module or a list of modules.