Repository navigation
OpenECS 0.8.0
Pre-releaseOpenECS 0.8.0 runs Lua plugins on LuaJIT, whose compiler makes their code run at nearly C's speed, and lets Lua call C through LuaJIT's FFI. The core now draws every menu and tooltip of a tool, so they look and work the same everywhere. A tool gets menus and buttons in its title bar, eleven themes, and a denser look with JetBrains Mono. Panels get badges and redraw on events, plugins hear the log, sessions follow their preset, and tests can drive menus, settings and file dialogs. OpenECS is now under the 0BSD license.
It comes out with the releases of the two repositories that OpenECS ships, each described in its own release:
- OpenECS-std 0.8.0: the new plugin history, with undo and redo for any tool; ui's boards, icons, labels, callbacks by meaning, drawing on the GPU and long lists and trees built in view; fs's full set of file operations, the trash and watching inside folders; the files panel's tree and grid; and the console's sources, filter, sorting and counts.
- OpenECS-examples 0.8.0:
c15_board, a board of blocks and wires, ands26_history, undo and redo; every example on LuaJIT 2.1, its Lua panels objects of a class, showing the release's features.
This is still an early release.
What you can do
Run Lua plugins on LuaJIT. Lua plugins run on LuaJIT 2.1 in place of Lua 5.5. They have Lua 5.1's language and libraries, the extensions from Lua 5.2 and 5.3, the syntax that LuaJIT 2.1 takes from LuaJIT 3.0, such as +=, continue and ?., LuaJIT's bit, ffi, jit, string.buffer, table.new and table.clear, and utf8 from lua-compat-5.3 0.15.1. DESIGN 9.6 lists them all.
Call C at C's speed. Lua calls plugins' C functions, and the core's surface and panel methods, through LuaJIT's FFI, so the compiler compiles the call with its caller. Handles and structs are cdata, with their methods and operators. A buffer argument takes a string, a string.buffer, or a cdata array or struct, without a copy. Workers' values go between threads as string.buffer's bytes, and 64-bit integers cross. While ecs.profile is on, ecs.profile.get also gives the Lua functions that took the most time, from LuaJIT's sampling profiler.
Open menus and show tooltips through the core. ECSPanel_OpenMenu, in Lua panel:openMenu, opens a menu of entries that run a function by name or a click, with tooltips, dimmed and checked entries, lines, headings and submenus. ECSPanel_ShowTooltip and ECSPopup_ShowTooltip, in Lua panel:showTooltip and popup:showTooltip, show the tool's one tooltip. Menus show what cannot be done now dimmed, with why in its tooltip, and long menus scroll. ECSPopup_StartDrag, in Lua popup:startDrag, drags data from a popup onto a panel. ECSPopup_OpenFrom, in Lua popup:openPopup, opens a popup beside another, for submenus.
Give a tool its title bar. The setting ecs.titleMenus gives the title bar's menus: File and Window by default, then Tools, where ECSApp_AddMenuEntry and ecs.app.addMenuEntry add a plugin's functions. The setting ecs.titleButtons adds the tool's own buttons, at the left or the right, and a button can look like a search field. ECSPanel_FindTitleButton, in Lua panel:findTitleButton, gives a button's place, so a popup opens below it. With two or more workspaces, a menu at the right switches between them. The window buttons are part of the title bar, and its parts show tooltips.
Choose a theme. The interface follows classic editors: neutral greys, the focused panel framed in the accent, rounded corners, a font of 13 and lower tab rows. The core's font is JetBrains Mono, and Roboto still ships for ecs.font. The shown tab of every group is filled with the theme's selected colour. Seven colours join the theme: ecs.colorPanel, ecs.colorField, ecs.colorButton, ecs.colorButtonHover, ecs.colorHover, ecs.colorError and ecs.colorWarning. Besides dark and light, the core ships deepDark, highContrastDark, highContrastLight, midnight, ember, forest, paper, sakura and peony, and ecs.theme offers every theme of the settings files, including the user's own.
Make panels tell more. ECSPanel_SetBadge, in Lua panel:setBadge, shows a short text after a panel's title, such as a count of new messages. A panel type's redrawOn names events that draw its panels again, so a plugin keeps no list of panels to redraw. Panels hear PointerLeave, and DragOver and DragLeave while data is dragged over them, so a panel shows where the data will land. Pointer events carry the system's count of clicks. ECSLayout_FindByType, in Lua ecs.layout.findByType, finds an open panel of a type. ECSPanel_GetPlace, in Lua panel.place, gives a panel's place in its OS window.
Arrange panels more easily. A press where two splits meet drags both dividers at once. Dividers under the pointer show a line of the accent, and a press beside a divider's gap grabs it. A dragged divider lines up with other dividers, with equal shares of its split, and with the middle of its neighbours. A right click on a tab, on the rest of a tab row or on a grip opens the panel's one menu. The wheel over a tab row shows the next or previous tab. ecs.layout.moveToNewWorkspace, the prefix then Shift+N, moves the focused panel to a new workspace.
Bind keys for a whole plugin. ECSKey_Bind and ecs.key.bind take a scope: a panel type, the plugin's own name for all of its panel types, or prefix for a key after the prefix to one of its functions. The core emits ecs.prefix while it waits for the key after the prefix, and the standard plugin keys lists them. Every tool loads history, with Ctrl+Z for undo, and Ctrl+Y and Ctrl+Shift+Z for redo.
Hear the log. The core emits each line of the log as the event ecs.logged, from any thread, with its time, level, plugin and message, so a console shows the log to the tool's user.
Set a setting for one run. ECSSetting_SetForRun, in Lua ecs.setting.setForRun, sets a value that no file keeps, such as a frame colour while a game plays. Nil takes it away.
Keep sessions up to date. A session names its preset. When it opens, the preset gives the tool's menus, keys and settings again, and the session keeps the user's workspaces, panels and state.
Test more of a tool. test.menu and test.choose read and choose the entries of the open menu, test.tooltip reads the tooltip, and test.titleBar reads the title bar. test.setSetting changes a setting, test.call calls a function with values, and test.fileDialog answers a file dialog. test.errors and test.misuses give what plugins reported. Every build runs tests, and shuild's -j runs the tests of several examples at once. A test has XDG folders of its own, so it writes nothing of the user's.
More for plugins. ECSValue_Copy copies a value. ecs.path.full gives a path's full form. A handle parameter written handle<name>? takes nil. A popup sets the entries it shows with ECSPopup_SetItems, and takes typed text with ECSPopup_SetTextInput.
Build into another folder. shuild.c's -o, --output, names the folder the build goes into, in place of build/. Its flags print their help from one list.
Small fixes
- A native plugin whose library does not exist says so, with its path.
- A Lua plugin's choice setting starts at its default, not at its first choice.
--installwrites a desktop entry that launchers accept.- Double clicks come from the system's count of clicks.
- Stopping a timer that already ended does nothing.
- Functions that other threads send to the main thread never run inside a message dialog.
- A handle in dragged data, or in a drop that waits, gives no object once its object is freed.
- A tab behind another shows its new title and unsaved mark at once.
- A setting's value of the wrong type is reported once, and a saved session leaves it out.
- Setting a key works when the settings file cannot be written.
- A misuse inside a Lua function that C called names the function.
- A tooltip popup takes no pointer events, so a click beside it reaches its panel. A popup stays inside its OS window, and a popup window is never stretched.
- A menu is as wide as its widest entry, and the workspaces' menu opens with the current workspace chosen.
- On Linux, quitting no longer aborts where a tray host runs.
- Key presses, theme colours and the interface's texts are kept parsed or laid out, so frames draw faster.
What will break
Native plugins. OPENECS_API_VERSION is 4, so a plugin's manifest says api = 4. ECSPanelTypeDesc loses minWidth and minHeight and gains redrawOn and redrawOnCount, and ECSPopupDesc loses anchorWidth. A panel's or popup's draw that opens, moves or closes a panel is a misuse. A C function that Lua calls through the FFI, and that calls Lua, is a misuse.
Lua plugins. LuaJIT has no integers: numbers are doubles, whole up to 2^53, and //, math.type and string.pack are missing. Use math.floor, % 1 and FFI arrays instead. Handles and structs are cdata: a handle's fields are read-only, and == on structs compares identity. A worker's message, input or result that holds a function, a handle or a struct is an error, not skipped. A number outside an int's range given to a surface's method is an error, not clamped.
Manifests. A plugin's name may not hold a dot, or be prefix.
Settings. ecs.toolMenu is gone: the title bar's menus are ecs.titleMenus, and a plugin adds its functions to Tools with ecs.app.addMenuEntry. ecs.tabScrollStep is gone. The core's settings file no longer binds the standard plugins' keys after the prefix: each plugin binds its own.
Sessions. Presets and sessions are format 4, which adds a session's preset. OpenECS reads formats 1 to 4, so older presets and sessions still open; an older OpenECS cannot read the sessions it writes. Settings files keep their format.
Standard plugins. OpenECS-std's release says how ui's menus, callbacks and tooltips changed.
Downloads
openecs-0.8.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 runOpenECS. It needs glibc 2.38 or later, such as Ubuntu 24.04 or Fedora 39.openecs-0.8.0-windows-x86_64.zip: the same for Windows on x86_64, with SDL's DLLs besideOpenECS.exe.openecs-0.8.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.
OpenECS is under the 0BSD license.