Skip to content

SamuelMarks/c-multiplatform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C multiplatform (libcmp)

License

Purpose: The main entry point and overview of the LibCMPC project.

Current State: LibCMPC is a strict C89 (ANSI C) cross-platform application framework. Following a strategic rewrite, it provides a highly cohesive, monolithic core for building modality-agnostic GUI applications in native C. It integrates best-in-class sibling libraries for networking, file systems, and databases, while maintaining zero external dependencies for its core rendering and layout engines.

Upcoming Features: The rendering and UI systems are currently being expanded to natively support Google Material 3, Apple Cupertino / HIG, and Microsoft Fluent 2 design systems out-of-the-box.

This project is architected specifically for Context-Window Scalability, utilizing an amalgamated header design (cmp.h) that makes the codebase distinctively friendly for LLM-assisted coding and maintenance.

🚀 Key Features

  • Strict C89 ABI: Compiles on virtually any C compiler (MSVC, GCC, Clang, TCC).
  • Unified Modality Engine: Run your application in single-threaded, multi-threaded worker-pool, or fully asynchronous (epoll/IOCP) modes without changing your business logic.
  • Coroutines & Async/Await: Native C coroutine support (cmp_coroutine_t) for complex asynchronous task orchestration.
  • Flexbox Layout Engine: A fully featured C implementation of Flexbox (cmp_layout_node_t) for responsive, dynamic user interfaces.
  • Native UI Primitives: Core unstyled widgets (cmp_ui_box_create, cmp_ui_text_input_create, etc.) ready to be themed via cmp_theme_t.
  • Deep Ecosystem Integration:
    • VFS (c-fs): Transparent virtual file system mounting and asynchronous reads.
    • HTTP/WebSockets (c-abstract-http): Native networking integration directly into the modality event loop.
    • ORM (c-orm): Local SQLite persistence with data-binding observables (cmp_orm_observable_t) tied directly to UI nodes.

📂 Architecture Strategy

The framework is organized into a cohesive, amalgamated structure:

  • include/cmp.h: The single source of truth for all API contracts, structs, and interfaces.
  • src/: Modular implementations of the core systems (cmp_memory, cmp_layout, cmp_ui, cmp_window, cmp_modality).
  • tests/: Comprehensive test suites using the greatest framework, ensuring memory safety and behavioral correctness.
  • examples/: Standalone GUI applications demonstrating real-world usage (e.g., OAuth2 Login flows).

🛠️ Build Instructions

LibCMPC uses CMake and manages its internal ecosystem dependencies automatically via FetchContent.

Compile

$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug
$ cmake --build build

Running Tests

$ cd build
$ ctest --output-on-failure

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Cross platform GUI framework in ANSI C (C89), native for: Windows (GDI+); Linux (GTK+4); macOS (Cocoa); iOS; Android; web (WASM). Material 3.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors