Skip to content

OpenECS-std 0.8.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Dec 06:58
· 3 commits to dev since this release
40fff48

OpenECS-std 0.8.0 adds history, which gives any tool undo and redo, and a Spacer panel. ui gains boards of blocks and wires, popups of its own elements, icons and labels, panel types in a line, and long lists that build only what shows; it draws on the GPU by default, and its callbacks are named by what they mean. fs reads, writes, moves, copies, removes and trashes files. The files panel shows a tree of folders beside a grid, and the console takes in the log, with sources, a Show level and a Sort. The Lua plugins run on LuaJIT 2.1, and the license is 0BSD. The release has the plugins built for Linux and Windows.

It comes out with OpenECS 0.8.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.8.0 use them.

What you can do

Undo and redo in any tool. history keeps histories by name. A plugin pushes a record for each change with history.push, with the functions that undo and redo it, or history.change for one value; records with the same merge key, close in time, join, so a drag is undone at once. history.use(panel, h) names a panel's history, and history.useDefault(h) the tool's. Ctrl+Z and Ctrl+Y act on the focused panel's history, from Lua and C alike. The History panel, the prefix then H, lists the records with their tags, and a click goes to one.

Build node editors. ui.board shows blocks at their places, ui.block, with pins, ui.pin, and wires between them. The wheel zooms around the pointer, and the middle button moves the view. Presses, Shift, Ctrl and a rectangle choose blocks through onSelect; a drag gives onMove at the release; a pin's drag draws its wire to the pointer and rings the pins that take it. ui.fit frames the blocks, and ui.boardPoint turns a panel's point into the board's. From C: UI_BOARD, UI_BLOCK, UI_PIN and UI_OPENED_BLOCK.

Show ui's elements in a popup. ui.popup(panel, desc) opens a popup whose elements a view gives, as a panel's are, with its own background and border; a field in it takes typed text. In C, Ui_OpenPopup. The dropdown's choices and the colour picker are such popups.

Register a panel type in a line. ui.panelType(desc) completes a panel type with ui's part: its view(state, surface) gives the elements, and its own event gets only the events ui did not take. In C, Ui_PanelType with a View that describes with the macros.

Draw on the GPU. ui draws its panels with gpu, where gpu can draw, and with draw elsewhere. The setting ui.gpu, on by default, chooses. gpu gains outline, circle, rounded, roundedOutline, clip and styled text, as draw has them, and gpu.available. gpu.text keeps its texts' layouts.

Show icons and labels. ui.icon(name) draws a small picture from shapes: an eye and a padlock, open and shut, the tools move, turn, scale, rect and shape, and a player's play, pause, step and stop, among others. A button, a section's heading, a tree's node and mark, and a selector's and tabs' choices take a label: a text, or spans that hold icons and images. A selector's choices may each have their own tooltip and keys. In C, UI_ICON and UI_LABEL.

Show an image made in memory. ui.image takes an image of draw in place of a file's path. When draw.setImagePixels changes it, the panel's next show shows the new pixels; draw.imageVersion tells a plugin that keeps a copy when to copy again.

Build long lists and trees. A list builds only the items in view: ui.range(panel, id, count) gives the first and last to build, and the list takes count and first. Every tree does it by itself. A list's anchor, "start" or "end", keeps its place as items come, so a log's newest show and the item being read stays still.

Agree on one way for lists. In every list, table and tree, a press chooses an item (onSelect), and a double click or Return goes to it (onOpen). A tree's arrow, or Right and Left, opens and closes a node. A tree's marks are labels at the end of a node's row that a click turns on and off through onMark.

More in ui.

  • Data dragged over a panel shows where it would land: a line before or after an item, or a box around it. onDragOver takes or refuses it. Any element with onDrag drags, and C has onDrag, onDragOver, onDrop and onMenu as functions in UiProps.
  • A number field's drag and a slider's drag give onChange its value with dragging true, so a tool shows a dragged value at once and waits for a typed one's Return.
  • A text's maxLines shows at most that many lines, the last with an ellipsis. Its wrapMark, such as "↪ ", starts each line after a break, and its gutter, such as a line's number, stands before its first line.
  • A dropdown's folders shows its texts in folders, and a menu entry's submenu opens beside the menu.
  • Tooltips show in popups of their own, over other panels, through the core's tooltip.
  • ui is denser and in the theme's colours, with rounded controls by the setting ui.radius, and an element's keys names its key combination in its tooltip.
  • A double click is the system's: its time, and its count of clicks.
  • In C, UI_CHANGED(id) and UI_SUBMITTED(id) say what changed for any element described before in the show.

Work with files. fs reads and writes files, fs.read, fs.readPart and fs.write, which writes whole or not at all; moves and copies files and folders, fs.move and fs.copy, across drives too; removes them, fs.remove; and moves them to the system's trash, fs.trash, on Linux and Windows. Where a drive has no trash, they go to the folder of the setting fs.trashFolder. fs.watch(folder, changed, true) watches the folders inside too.

Find files in a tree and a grid. The files panel shows a tree of folders on its left, and a grid of the chosen folder's folders and files on its right, with a divider between them and a Folders toggle. Files and folders show their pictures, and a tool gives them its own with icon. Delete moves into the trash. The panel takes dropped files: a file of its folder moves, and one from elsewhere is copied under a free name, such as apple 2.png. files.reveal(path) shows a file in every shown files panel that is not locked; the Lock toggle and files.lock keep a panel where it is. files.selected and files.toggleTree serve keys.

Read the log in the console. The console takes in every line of the log, by its plugin. An entry has a source, which console.add takes, and checkboxes show some sources only, with their counts. Show shows the entries from a level up, Error, Warning, Info or Debug, and Sort orders them, Newest first, Oldest first, Level or Source; the settings console.show and console.sort start a new console. A console that is not shown counts its new entries in a badge after its title, in the colour of the worst. An entry's count of repeats stands out in its level's colour.

More in the others.

  • The panel type panels.spacer, titled Spacer, fills a place in the layout, such as a split's other side.
  • settings.show(name) opens the settings window at a setting.
  • The key list shows a plugin's keys for all its panels in a section of their own. The keys after the prefix show in a popup while OpenECS waits for one.
  • The plugins' own windows bind their keys after the prefix and add Open entries to the title bar's menu Tools.
  • The profiler's Functions tab shows the Lua functions that took the most time.
  • The viewer numbers a text's lines, and marks the rows a long line wraps into.
  • draw's move moves a rectangle's pixels, and fontStyle gives a font's style. draw's mono font is OpenECS's JetBrains Mono by default.
  • net.listen and net.listenTLS take a host, such as 127.0.0.1 for this computer's programs only, and port 0 picks a free port, which net.port tells.
  • process.start and process.run take an environment, a list of NAME=VALUE texts.

Small fixes

  • ui is faster: it draws again only the rectangles that changed, moves the pixels of a scroll that alone scrolled, keeps wrapped and measured texts, and reuses its elements' tables. draw fills rounded shapes and circles many times faster.
  • process.run sends a large input while it reads the output, and a Windows pipe takes large writes.
  • textgrid shows the cursor of a full row on its last column.
  • Italic text measures as wide as it draws, so italic spans leave no gap.
  • parse fails with why on data nested deeper than 512, and compress and web fail when memory runs out, in place of stopping the program.
  • regex's replace writes its count as an int.
  • fs.remove removes folders on Windows.
  • Each plugin compiles its own stb_ds.

What will break

Plugin API 4 and LuaJIT. Every plugin's manifest says api = 4, so the plugins need OpenECS 0.8.0. Change api = 3 to 4 in your own plugins. Lua plugins run on LuaJIT 2.1, as OpenECS 0.8.0 says: Lua 5.4's //, math.type, math.tointeger and string.pack are gone.

ui's callbacks. Each callback means one thing on every element:

  • A selector's, tabs' and dropdown's onSelect(selected) is onChange(selected).
  • A section's onToggle(open) is onChange(open).
  • A list's, table's and tree's onActivate is onClick. Return gives the item to onOpen, or to onClick without one.
  • onChange runs only for another value: a dropdown's same choice, or a number, key, colour or path's chosen file that is the same, gives nothing.

ui's menus. ui.menu is gone: open the core's menu with panel:openMenu(entries), as files and console do.

ui's elements. An element lives until its panel's next show, so showing one element table twice is a misuse: make it again. A dropdown's choices must be texts.

ui in C.

  • Ui_Menu, UiMenuEntry and their entries are gone: use ECSPanel_OpenMenu.
  • UI_ACTIVATED and UI_ACTIVATED_NODE are UI_CLICKED_ITEM and UI_CLICKED_NODE.
  • UiProps' clickable and onActivate are one bool, onClick: a clicked column or row, or a list, table or tree whose items are clicked.
  • UI_FIELD and UI_PATH give whether the text changed, not whether Return was pressed: use UI_SUBMITTED(id) for Return. Every macro that writes a value gives whether it wrote another one, UI_TABLE too.

fs. fs.copy refuses a path that is taken, where it replaced it: remove first.

files. The handler delete is gone: Delete moves into the trash with fs. A panel's saved state from 0.7.0 starts afresh, with the new tree and grid.

console. The level toggles, console.run and the setting console.clearOnRun are gone. A tool that wants an empty console for each run calls console.clear(). A preset sets the level a new console shows with console.show, Warning by default: a tool whose users' prints are info sets Info.

net and process. net.listen(host, port) and net.listenTLS(host, port, certificate, key) take the host first: pass "" for every address, as before. process.run(command, folder, environment, input) takes the environment before the input: pass {}.

cglm. The bytes functions and methods, such as mat4Bytes and model:bytes(), are gone. A struct is a buffer itself: put uniforms in a string.buffer, buffer.new():putcdata(model, 64).

draw. draw ships no font: Roboto Mono and its fonts/ folder are gone. The default of the setting draw.monoFont is OpenECS's JetBrains Mono.

Downloads

  • openecs-std-0.8.0-linux-x86_64.tar.gz and openecs-std-0.8.0-windows-x86_64.zip: the plugins built, as above, with the licenses of the libraries in them.
  • openecs-std-0.8.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as OpenECS's README.md says.
  • SHA256SUMS: checksums of the archives.

The standard plugins are under the 0BSD license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.