Skip to content

OpenECS 0.2.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Oct 04:37
· 961 commits to dev since this release
4247ff6

OpenECS 0.2.0 adds standard plugins that your plugins can build on: drawing, user interfaces, character grids, images, sound, networking, 3D models and files. It also adds a settings window, a launcher, a list of panel types, pop-out windows and popups, dark and light themes, window frames drawn by OpenECS, and simpler settings and keys.

It comes out with the first releases of two repositories that OpenECS ships, each described in its own release:

  • OpenECS-std 0.2.0: the standard plugins, the settings window and the launcher.
  • OpenECS-examples 0.2.0: eighteen examples, from a first Lua plugin to a drawing tool, one for each standard plugin, and one with the first-party plugins. They are OpenECS's tests too.

This is still an early release. Plugins made for 0.1.0 need the changes under "What will break".

What you can do

Start from the launcher.

  • Run OpenECS with no preset, and the launcher lists your presets and saved sessions. Click one, or choose it with the arrows and Return.
  • Run OpenECS --help to see the options. Each has a short form: -p for --preset, -s for --session, -f for --fresh, and so on.

Change settings in a window.

  • Press Alt+W, then , to open the settings window. It lists every setting of the core and the plugins, with a control for each type.
  • A value that does not fit its setting's type shows as wrong, and is not saved.
  • The window writes your settings file, ~/.config/openecs/settings.lua.

Open any panel. Press Alt+W, then N to list the panel types of the tool, by plugin, and open one where the focused panel is.

Arrange panels across windows.

  • Press Alt+W, then P to move a panel into a window of its own. Sessions keep these windows.
  • Press Alt+W, then W to choose a workspace from a menu.
  • Press Alt+W, then Shift+R to reset the layout to the preset's, and Alt+W, then Q to quit. Every right-click menu ends with both.
  • Closing the last panel quits the tool, and the next start opens its preset.
  • Locked and maximized groups show a mark at the end of their tab row.

Choose dark or light. OpenECS follows your system's dark or light mode, and changes with it. Set ecs.theme to "dark" or "light" to choose one. Your settings file can change a theme's colours, and plugins name the theme's colours, such as "accent", so they follow it too.

Move and resize every window. OpenECS draws its windows' title bars, with buttons that minimize, maximize and close, and edges that resize, so they work the same on every desktop, also on the ones that draw no frames. Set ecs.titleBar to false to leave the frames to the system.

Keep your work, when you want to.

  • A tool now starts from its preset each time. To get your last session back at the next start, set ["ecs.keepSession"] = true in your settings file.
  • Alt+W, then S saves the session to a file whenever you want.

Build plugins on the standard plugins. They ship in the archive's plugins/ folder: draw, mixer, ui, textgrid, image, audio, net, gltf and fs. OpenECS-std 0.2.0 says what each does. A standard plugin needs nothing but OpenECS, so copying its folder installs it.

Use other plugins' functions easily.

  • In Lua, local draw = require("draw") gives the functions of the plugin draw, when your manifest depends on it.
  • OpenECS --definitions FOLDER writes a file for each plugin it finds: NAME.lua for your editor's completion and checks, and NAME.h for C plugins, with typed functions.
  • The archive's include/ holds these files for the standard plugins, so with include/ in your editor's workspace.library, require("ui") completes with no more setup. Building from source writes them too, with a .luarc.json that names them.
  • Function signatures can name their parameters, such as void(string path, float volume), and those names show in your editor.

Write richer panels.

  • Panels can take typed text, with the input method's help, such as for accented letters.
  • Panels can open popups: menus and tooltips next to a part of the panel.
  • surface:fill(x, y, width, height, color) in Lua, and ECSSurface_Fill in C, fill a rectangle in one call.
  • ECS_LogInfo(plugin, ...) and its siblings log at one level in C.
  • ecs.plugin.folder gives the folder a plugin was loaded from, so it can read its own files.
  • Lua plugins have all of Lua's standard libraries: io reads and writes files, and os renames and removes them. The fs plugin lists and makes folders.
  • Add ---@type ecs.Preset or ---@type ecs.Manifest above the return of a preset or a manifest, and your editor completes and checks it.

Learn from the examples. The archive's examples/ folder holds them, each a preset with its plugins and a test; OpenECS-examples 0.2.0 lists them. Run one with OpenECS --fresh --preset examples/1_hello/preset.lua; --fresh starts it from its preset, even when ecs.keepSession is on.

Small fixes

  • A failed start shows the step that failed, the file, the error, and where the log file is.
  • A missing plugin, or one that fails to load, is logged as an error, and the program goes on; its panels show placeholders.
  • A manifest or preset with a wrong structure, such as a missing field or dependencies in a cycle, stops the start with an error that names the file and the field.
  • On Wayland, a panel dragged onto another of the tool's windows lands there, and frames are paced by OpenECS, which ends pauses of a few seconds.
  • Right-click menus are narrower: their entries are short.
  • While you type in a panel, letter keys never run key bindings.
  • The session's save dialog suggests a file named after the preset.
  • Closing a pop-out window frees the textures of its panels first, so a panel that moved out of it never draws with a freed texture.

What will break

Names. A plugin declares what it registers by its local name, and OpenECS adds the plugin's name: the plugin notes registers the panel type "editor", which presets and other plugins name "notes.editor". This holds for panel types, settings, functions, handle types and events. In Lua, ecs.service.register(functions) no longer takes the plugin's name. Looking up, emitting, subscribing and binding keys still take full names.

Manifests.

  • type = "native" or type = "lua" replaces the fields native and lua. A native plugin's library is lib<name>.so in its folder, and a Lua plugin starts in init.lua.
  • name, version, api and type are required, and name must be the folder's name. A preset's depends is required.

A plugin's own life. ECSPlugin_Register(plugin, &desc) with an ECSPluginDesc, and ecs.plugin.register(desc) in Lua, describe what a plugin saves in sessions and what it does before the program exits. They replace ECSPlugin_Shutdown, ECSPlugin_RegisterState, ecs.plugin.registerState and ecs.plugin.onShutdown.

Panels in Lua. A panel's data are fields: panel.title, which you can set, panel.unsaved, which you can set, panel.id and panel.type. getTitle, setTitle, getId, getType and setUnsaved are gone, and so are the copies of panel methods in ecs.panel and the table ecs.popup.

Colours. In Lua, colours are texts: "#RRGGBB", "#RRGGBBAA" or a colour of the theme, such as "text". In C they are ECSColor, and ECSColor_Parse reads texts. A function signature can take the type color.

Keys. Every keys table has one shape now. A field is a key combination, and its value is the name of a function to run, or false to remove the key. The field prefix holds the keys after Alt+W, and a field named after a panel type holds that panel type's keys:

keys = {
  ["Ctrl+N"] = "notes.new",
  prefix = { ["N"] = "notes.new" },
  ["notes.editor"] = { ["Ctrl+B"] = "notes.bold" },
}
  • In settings files and presets, move the keys of ecs.prefixKeys into keys.prefix.
  • ECSKey_Bind(plugin, panelType, key, function) and ecs.input.bind(panelType, key, function) now take a key combination, such as "Ctrl+N", instead of the name of a key setting.

Settings.

  • There are three settings layers: the defaults, the preset, and your settings file.
  • A key or color value that cannot be read is reported, and the default is used. Colours are written "#RRGGBB" or "#RRGGBBAA".

Sessions. A tool no longer restores its last session unless ecs.keepSession is on.

Command line. An unknown option, or an option without its value, is an error: OpenECS prints the help and exits with status 2.

Plugins and presets moved.

  • The sketch plugins and their preset are now the example examples/12_sketch/.
  • The standard plugins, the settings window and the launcher are in OpenECS-std, and the examples are in OpenECS-examples. Both are submodules of OpenECS, in std/ and examples/. Clone OpenECS with --recursive.

Building from source.

  • shuild -b TYPE chooses the build type: debug, release, relwithdebinfo or minsizerel. The --static and --dynamic options are gone.
  • The build goes to build/TYPE/, such as build/Release/.
  • The build builds the standard plugins of std/ too, with their own shuild.c; -n leaves them out. -e builds the examples of examples/ the same way.
  • The examples are the tests: .github/scripts/test.sh build/Debug/bin/OpenECS runs every example's test. A test loads only the plugins its preset names.

Downloads

  • openecs-0.2.0-linux-x86_64.tar.gz: the program with SDL's libraries, its plugins, presets and examples, the plugin interface, and the licenses. Unpack it and run OpenECS.
  • openecs-0.2.0-source.tar.gz: the source with every library it uses. GitHub's own "Source code" archives leave the libraries out, so use this one to build.
  • SHA256SUMS: checksums of the archives.

Only Linux on x86_64 has a build. It needs glibc 2.38 or later, such as Ubuntu 24.04 or Fedora 39.

OpenECS is under the zlib license.