Commit Graph
303 Commits
Author SHA1 Message Date
Martín Lucas Golini c530e4bd6e feat: add cross-platform file association management
Add an EE::System::FileAssociation abstraction with XDG, Windows,
and macOS implementations.

Expose extensions from syntax predefinitions and add custom widget
support to UISettingsPanel. Add an ecode settings page for selecting
file associations and installing an XDG desktop entry.

Apply changes asynchronously with lifecycle-safe UI handling, disable
controls while applying, and avoid redundant XDG database updates.

Add translations and coverage for the new functionality.

Implements SpartanJ/ecode#192
2026-09-17 11:04:25 -03:00
Martín Lucas Golini 071bc5d697 Add optional smooth scrolling across UI scrollable widgets
Introduce UIScrollController to provide frame-rate-independent wheel
interpolation, touch dragging, and momentum for code editors, terminals,
scroll views, and scrollable widgets while preserving the legacy instant
scrolling path.

Add a UISceneNode-level smooth-scrolling policy. Embedded scenes inherit
the root scene setting, new widgets snapshot it during construction, and
setSmoothScrollEnabled() can optionally apply changes to existing widgets
across the complete embedded-scene hierarchy.

Move native macOS scrolling and title-bar helpers into PlatformHelper,
enable native momentum from UIApplication, and explicitly enable it in
ecode. Preserve precise SDL2 and SDL3 wheel deltas for fractional momentum
events without changing normal integer wheel steps.

Replace the separate editor and terminal preferences in ecode and eterm
with one global smooth-scrolling setting, including legacy configuration
migration, live updates, and localized settings text.

Improve UITouchDraggableWidget momentum handling and add regression tests
for scrolling interpolation, pixel-aligned editor positions, scene
inheritance, widget overrides, and immediate policy application.
2026-09-13 20:27:37 -03:00
Martín Lucas Golini 42de99cf3b Fix GL resource sharing across native application windows
Decouple GL object sharing between native windows from auxiliary worker-thread context support. Platforms without threaded GL contexts, such as Haiku, must still share textures and other GL resources between their window contexts.

Always configure SDL_GL_SHARE_WITH_CURRENT_CONTEXT according to the requested context settings, while continuing to create the auxiliary thread context only on supported platforms. Explicitly reset the SDL attribute for non-shared contexts to avoid leaking state into subsequent window creation.

Apply the fix to both SDL2 and SDL3 backends. Also link the Haiku unit test executable against libbsd and libnetwork to resolve its PTY and socket dependencies.
2026-09-12 01:51:17 -03:00
Martín Lucas Golini 095fe7919e feat(ui): add native multi-window application support
- let UIApplication create, manage, render, and destroy multiple native windows
  - add scoped scene and GL window-context switching
  - route input events to the scene belonging to each native window
  - share application fonts, themes, icons, styles, and graphics resources safely
  - add NewInApplicationWindow factories for UIWindow, UIFileDialog, and UIMessageBox
  - support native parent relationships, modality, minimum sizes, and optional positioning
  - close child windows when the primary application window closes
  - defer native context destruction until the end of the application tick
  - fall back to in-scene windows for Emscripten and terminal rendering
  - reapply renderer state caches when switching OpenGL contexts
  - fix SDL2/SDL3 display bounds and multi-window lifecycle handling
  - add a native file-dialog and message-box multi-window example
  - add integration coverage for context switching, input, resources, modality, and closing
2026-09-10 19:27:29 -03:00
Martín Lucas Golini a294d78733 eterm: extract settings actions and fix macOS efsw linkage
Build:
  - Link eterm with CoreFoundation and CoreServices on macOS
  - Satisfy the framework dependencies required by efsw's FSEvents backend

  Applications:
  - Move eterm settings operations into a dedicated SettingsActions class
  - Centralize settings window lifecycle and font configuration actions
  - Route settings panel font-size updates through SettingsActions
2026-09-09 17:06:38 -03:00
Martín Lucas Golini fe91253276 eterm:
- persist keybindings in keybindings.cfg with configurable primary and secondary modifiers
  - hot-reload bindings and merge newly introduced defaults
  - open keybindings.cfg in a terminal-font-sized code editor tab
  - indicate unsaved keybinding changes using the modified-tab marker
  - share tab and split commands between terminals and the keybindings editor
  - add bindings for terminal actions, tab navigation, numbered tabs, splits, renaming, and tab movement
  - expose keybindings through terminal and tab context menus
  - add tab split and move-left/right context menu actions
2026-09-09 14:32:43 -03:00
Martín Lucas Golini cff165fa37 Build fix for macOS + premake4 + brew sdl2 2026-09-01 03:20:08 -03:00
Martín Lucas Golini 47f9336c0a Add optional LTO and harden Windows clipboard handling
- add --with-lto support to Premake 4 and 5 release builds
  - use ThinLTO with Clang, automatic LTO with GCC, and LTCG with MSVC
  - exclude Emscripten builds from LTO configuration
  - retry SDL2 clipboard writes on Windows when the clipboard is temporarily unavailable
  - make the UIMergeView copy regression test independent of the system clipboard
2026-09-01 00:46:13 -03:00
Martín Lucas Golini 66d22ea5bb Add integrated Git conflict resolution workflow
Introduce a three-pane UIMergeView with an editable shared result
document, conflict navigation and acceptance actions, live diff
highlighting, synchronized scrolling, and contextual pane labels.

Read conflict stages directly from Git's index, detect paused merge
operations, restore conflict sessions, and support resolving, staging,
recreating, continuing, committing, and aborting operations.

Add repository-aware conflict state handling, safe asynchronous
lifetimes, merge operation UI, configurable key modifiers, i18n
strings, and focused merge-view and Git conflict tests.
2026-08-27 22:18:58 -03:00
Martín Lucas Golini 6ff677ff2b Rename macosmenubar.m to .mm to avoid getting compiled as Objective-C and not Objective-C++. 2026-08-24 10:15:28 -03:00
Martín Lucas Golini 9752be89ad Add native macOS global menu bar integration
Mirror UIMenuBar hierarchies into AppKit while keeping eepp menus as the
source of truth.

Add semantic item activation and menu lifecycle hooks so native actions,
lazy menus, checkboxes, radio buttons, visibility, enabled state, and
submenus preserve existing eepp behavior. Support shortcuts and standard
About, Preferences, Quit, Window, Help, and Services menu integration.

Keep the platform adapter private to the UI implementation and support
safe installation, synchronization, and removal of the native menu.

Migrate ecode away from its hand-written Cocoa menu, assign semantic menu
roles, and populate the UI Language submenu synchronously so it is ready
on its first opening.

Add unit tests covering activation, menu lifecycle, roles, and submenu
preparation.

Refs: SpartanJ/ecode#823
2026-08-24 02:38:36 -03:00
Martín Lucas Golini 681841e11d Create unit-test windows hidden from the start while preserving hardware OpenGL rendering. Force double buffering for hidden X11 windows so framebuffer capture reads the rendered back buffer reliably, and keep SDL2/SDL3 behavior consistent. Update unit-test documentation to use direct desktop execution by default, with Xvfb retained for headless environments.
This change might break unit-tests in other platforms, next CI run will let us know.
2026-08-22 14:11:11 -03:00
Martín Lucas Golini 36e54fe2a3 Add reactive UI data binding and observable collections
Introduce observable and computed values, typed widget bindings, validation groups, UI properties, commands, and UI-thread delivery.

Add observable vector and list model support for incrementally updated collections, with filtering and source-row mapping.

Modernize the Flight Booker and CRUD examples and add focused data handling and collection examples demonstrating the new APIs.

Organize the UI binding headers under ui/databinding, expand test coverage for notification and lifetime semantics, and document API selection, validation, ownership, threading, and performance behavior.
2026-08-22 01:00:04 -03:00
Martín Lucas Golini d31e880cc3 Fix bidirectional clipboard support in Emscripten builds:
SDL2 prevents the default action for Ctrl/Cmd key events on Emscripten,
which stops browsers from emitting the native paste event.

Intercept Ctrl/Cmd+V before SDL2 consumes it, allow the browser paste
event to update the internal clipboard, and replay the keydown so the
application executes its normal paste command.

Also refresh the clipboard through the asynchronous Clipboard API when
opening a context menu, enabling paste actions triggered without a
keyboard shortcut.

Export Emscripten's ccall runtime method so the browser clipboard helper
can reliably invoke its C++ callbacks in optimized builds, and disable
clang-format for the header containing embedded JavaScript.
2026-08-10 00:32:01 -03:00
Martín Lucas Golini 5c957121d9 Link unit-tests against pthread 2026-08-07 01:59:01 -03:00
Martín Lucas Golini 120471343c Fixed both CI issues.
- MSVC:
      - Removed lambda-based eeNew expansion in favor of typed MemoryManager::trackNew().
      - Added macro expansion indirection.
      - Enabled MSVC’s conforming preprocessor with /Zc:preprocessor across Premake 4/5 static libraries, shared libraries, and executables.
      - Verified generated VS2022 projects contain the flag, including eterm-static and eepp-maps-static.
      - Added explicit standard-library includes to memorymanagerglobal.cpp.

  - Linux/macOS release tests:
      - MemoryManager.tracesPlainNew is now compiled only with EE_MEMORY_MANAGER, since global tracing is intentionally debug-only.

Added new plan to improve PropertyIdSet.
2026-08-05 11:53:36 -03:00
Martín Lucas Golini afb2d44bda core: extend debug allocation tracing and reduce render-time allocations
- intercept global new/delete operations in debug memory-manager builds
  - distinguish anonymous global allocations from source-tracked leaks
  - modernize eeNew to support constructor-expression syntax
  - improve memory reports with tabulated leaks and separate largest allocations
  - cache autocomplete shortcuts instead of hashing string keys on key events
  - reuse UIStyle property sets across state changes
  - reuse Text shadow colors and avoid temporary outline-color copies
  - use inline storage for temporary linear-gradient rendering data
  - make unit tests resolve assets from the executable directory
  - add memory-manager and PropertyIdSet regression coverage
2026-08-05 11:02:35 -03:00
Martín Lucas Golini 51ceff9b08 Move eeiv to the main repo, I'll start modernizing the tool. 2026-07-31 00:04:21 -03:00
Martín Lucas Golini 683b35b249 feat(ecode): add VS Code-compatible user snippets
Add user-defined snippet support to the autocomplete plugin, including
language-specific, global, .vscode, and .ecode project snippets.

Support JSONC parsing, scopes, hot reload, source-aware ranking, exact
prefix replacement, multi-cursor insertion, contextual indentation,
variables, transforms, choices, linked placeholders, and tab navigation.

Recognize .code-snippets files as JSON and preserve existing LSP snippet
completion behavior.

Refs SpartanJ/ecode#111
2026-07-29 01:11:01 -03:00
Martín Lucas Golini b940407102 ecode: The custom fallback font reused the "fallback-font" resource key, replacing the built-in CJK fallback in FontService.
Fix:

  - User fallback now uses "user-fallback-font".
  - Built-in CJK and custom fallback fonts remain registered together.
  - Added and passed a regression test verifying both fallback resources remain in the chain.

Fixes in premake5.lua:

  - Removed obsolete PRECISE_F32=1; Wasm already provides precise float behavior.
  - Moved ENVIRONMENT=worker,web to final application link options.

Fixed MarkdownView not getting the correct CSS style from the base theme.
2026-07-25 01:36:00 -03:00
Martín Lucas Golini b0129880d8 Add LSP snippet navigation and expansion support
Implement LSP snippet parsing and editing sessions with tab stops, linked placeholders, choices, variables, transforms, visual feedback, and multi-cursor insertion.
This adds snippet support for LSP completion items. User-defined snippets will be implemented separately.
Refs SpartanJ/ecode#111
2026-07-18 16:51:45 -03:00
Martín Lucas Golini 513ef0f12b Move backward implementation to its own module but still have an special version for ecode. Integrate backward into unit-tests. 2026-07-13 11:00:35 -03:00
Martín Lucas Golini a3d78a1217 Implemented Built-in Scientific Calculator in the universal bar for ecode (SpartanJ/ecode#701). 2026-07-02 18:51:12 -03:00
Martín Lucas Golini 57cdab7b7f Implemented UIFontPickerDialog.
Fixed alignment in UILinearLayout when padding is used.
2026-06-29 20:32:08 -03:00
Martín Lucas Golini d939766355 Disable glew by default (entering deprecation). 2026-06-23 22:54:44 -03:00
Martín Lucas Golini e5f3983c44 Upgrade SOIL2.
Allow to disable GLEW dependency, it will now be disabled by default so we can test. The idea is to remove the dependency completely once this is confirmed to work.
2026-06-22 10:12:02 -03:00
Martín Lucas Golini 19f2f16b8e Damn! Fix CI. 2026-06-06 17:20:22 -03:00
Martín Lucas Golini 3af9e76ae7 Fix CI. 2026-06-06 17:19:50 -03:00
Martín Lucas Golini ed333b3839 Optimization in RichText and added benchmark. 2026-05-21 19:19:47 -03:00
Martín Lucas Golini dd2134b0d0 Fix unit-tests build. 2026-05-21 01:02:06 -03:00
Martín Lucas Golini 1af86f9110 Merge branch 'feature/system-font-resolver' into develop 2026-05-15 01:52:29 -03:00
Martín Lucas Golini b00547655d Some mingw build fixes for my local build. 2026-05-14 19:27:16 -03:00
Martín Lucas Golini f815d99489 Some extra fixes.
fontconfig is now loaded at runtime.
2026-05-14 02:28:48 -03:00
Martín Lucas Golini 828adf581d Initial work on the system font resolver. 2026-05-13 23:59:36 -03:00
Martín Lucas Golini 7452cbf492 Fix mingw build on openSUSE. 2026-05-08 18:01:41 -03:00
Martín Lucas Golini a870a278bb Forgot to update versioning. A couple of minor nits. 2026-05-08 16:50:46 -03:00
Martín Lucas Golini 02a9c3708b Pump internal remote SDL2 version. 2026-05-07 20:11:07 -03:00
Martín Lucas Golini 02b6076cee mojoAL SDL3 2026-05-04 11:47:54 -03:00
Martín Lucas Golini 6e65ef31f2 Merge branch 'develop' into feature/sdl3 2026-04-23 17:57:31 -03:00
Martín Lucas Golini 7d09138bb0 Add woff2 font format support.
Try again luck with the test that it's failing in macOS...
2026-04-09 00:54:22 -03:00
Martín Lucas Golini 1be1137ebd Forgot to include dir for args library. 2026-04-06 02:48:33 -03:00
Martín Lucas Golini aa9138a12e Fix gumbo parser linking in mingw. 2026-03-29 21:21:40 -03:00
Martín Lucas Golini 0f8bacf6dd Fix br element tag.
Fix gumbo dependency in ecode.
Fix crash in StyleSheet::getStyleSheetStyleByAtRule.
Plus some minor nits.
2026-03-29 20:18:19 -03:00
Martín Lucas Golini b7726b8767 Should fix MSVC build.
As for the MingW build I'll check if `--cc=gcc` works in the CI environments, since premake5-beta8 deprecated `--cc=mingw` which was an alias of `gcc`.
2026-03-29 15:11:41 -03:00
Martín Lucas Golini 26a97be74d Added HTML native linting.
Added HTML folding-ranges.
Fixed HTMLFormatter::HTMLtoXML.
Added `TextDocument::toString` and `TextDocument::toUtf8String`.
Fixed incorrect check for emojis in Text.
Fixed potential crash due to CSS parsing issues in StyleSheetSpecification.
2026-03-29 14:31:26 -03:00
Martín Lucas Golini a14b8f4de0 Minor fix in UIHTMLTable layouting.
Add *very* basic HTML test. And *very* basic HTML demo. This is more than basic, it's just that I need something to quickly test stuff.
2026-03-28 02:45:24 -03:00
Martín Lucas Golini 47dca8a803 Some clean up. 2026-03-27 12:11:34 -03:00
Martín Lucas Golini affd3737b5 Merge branch 'develop' into feature/sdl3 2026-03-22 17:50:28 -03:00
Martín Lucas Golini dd039fc233 Improve stack-trace for ecode symbols.
Fix demangling in stack-trace for mingw builds.
Fix all stat calls in windows mingw builds that fail to detect files / dirs when the path ends with a path separator (this is an old bug, as old as I can remember, I thought it was fixed on mingw side but it seems only works for the cross compiled build, windows mingw build was failing catastrophically and never saw it).
There was also a very old minor bug in Sys::getProcessPath.
2026-03-22 18:41:47 -03:00
Martín Lucas Golini 70cec917da SDL3 port WIP. 2026-03-21 19:06:19 -03:00