Window.js is an open-source Javascript runtime for desktop graphics programming.

Overview

Window.js

Window.js is an open-source Javascript runtime for desktop graphics programming.

It is documented at windowjs.org.

Windows Linux macOS

Introduction

Window.js provides APIs for window creation and manipulation via GLFW and the HTML5 Canvas API via the Skia graphics library, backed by the v8 Javascript engine.

Window.js comes with familiar APIs for web developers for input event handling and animated rendering, and has additional, convenient APIs for file access.

Additional APIs for sound, networking and WebGL are planned for a future release.

See the FAQ for more details.

Note: Window.js is a very recent project and hasn't been widely tested yet. Please report any issues and get in contact for help.

Quick start

Window.js is distributed as a single binary that can be downloaded for Windows and macOS.

It can also be built from the sources for Windows, macOS and Linux.

Window.js runs a Javascript source file directly:

$ windowjs examples/breakout.js

The source files can be edited and reloaded with F5 in the main window.

A Javascript console is available by pressing F1, that can be used to diagnose errors and explore the APIs. For example, submitting this:

window.title = "Hello!"

changes the title of the main window. Errors are highlighted in the main window:

window.title = noSuchVariable;

Uncaught exceptions and console log errors are also shown in the main window. That overlay can be toggled with F4. See help() in the console for more development tools.

See the example applications and the API documentation for more.

Contact

Contact the Window.js developers and other users via the Window.js mailing list at Google Groups, or via its email address [email protected].

Github users can also use the Github Discussions page for the project.

Report issues the Github issues tracker.

Contributing

See the documentation for contributions and a list of planned features for ideas.

License

Window.js is licensed under the MIT License.

Comments
  • Initial TypeScript declarations

    Initial TypeScript declarations

    I've copied out all the APIs from the docs into Typescript. Took me a little while, naturally :)

    I've tried to match things up with the DOM library from the Typescript repo, where possible.

    Right now they're in a barebones npm thing so we can experiment with docs generation. TypeDoc seems to work fairly well; just run npx typedoc *.d.ts to generate the HTML.

    We could also use TSDoc to parse the comments, then emit jekyll markdown with a custom script, but if we like TypeDoc I'd propose going with that to save the effort!

    opened by hamish-milne 9
  • Improve view on mobile devices

    Improve view on mobile devices

    Issue #33

    This PR started from scratch and was more careful to preserve the style of the original website.

    On a desktop, this PR should look the same as the existing website except for two items: (1) The top navbar text and GitHub symbol does not extend edge-to-edge (this is an easy fix if preferred), (2) the highlighted text when an API item is selected from the right window only highlights the text, the highlight does not extend across the entire anchor element (this one was a challenge for me since padding the top was the only solution I could come up with so that the item was not hidden under the top nav bar):

    Screenshot from 2022-01-24 16-44-56

    The mobile views should look the same as the last PR, except I changed the bottom nav bar to look more like the existing website:

    Screenshot from 2022-01-24 16-45-50

    Screenshot from 2022-01-24 16-46-14

    opened by sfdeloach 4
  • Mobile style patch

    Mobile style patch

    This may be a bit more than requested. I had to make substantial changes to the layouts (about.html, documentation.html, and development.html) to leverage some of the benefits of bootstrap. The documentation pages should display better on mobile devices. The top navigation bar also adjusts to a dropdown menu on mobile devices. Screencaps below are from iPhone 5, which is the smallest screen available in the Chrome dev tools for testing. The website will display "normally" on tablets and larger screens. The breakpoint occurs at 752 pixels screen width (anything less than 752 gets the mobile version, anything greater gets the normal full page layout. Please let me know if it needs any more tweaking!

    Main Page:

    main

    Canvas Page:

    canvas

    Canvas Page w/ Top Navigation Menu Extended (toggles):

    canvas_topNavExtended

    Canvas Page - Mid-Page (Top Nav Bar disappears to create more space for content)

    canvas_midPage

    opened by sfdeloach 4
  • Add feature import export

    Add feature import export

    Add the possibility of import export js file

    export function hello(){
        console.log("hello world")
    }
    
    import {hello} from "./imported.js"
    
    hello()
    
    good first issue 
    opened by hanako-eo 3
  • The test runner sometimes times out

    The test runner sometimes times out

    This doesn't happen very often but is very annoying in the GitHub workflows.

    It's also very hard to reproduce locally, but happens after hundreds of runs like this:

    $ while xvfb-run out-debug/windowjs tests/run_tests.js; do sleep 1; done
    

    Super unclear why this happens though. It's likely a race or some indeterminism in the subprocess spawning code, or in child/parent event dispatching.

    bug tools 
    opened by joaodasilva 3
  • Improving the website

    Improving the website

    Hello, @joaodasilva , I am improving the website of windowjs, If any feature you want, inform me, I will try to Implement that. This will be my first contribution.

    documentation 
    opened by ashusharmasigdev 3
  • Test coverage

    Test coverage

    The project doesn't have any test coverage so far, other than checking out the examples.

    Issues like #34 require changing a large number of places, and this only scales when test coverage to confirm that everything is still working as expected.

    The idea is to build a test runner that runs on Window.js itself:

    • it spawns subprocesses to run individual test suites
    • all documented APIs should have test coverage, in all their variants, including invalid invocations and thrown errors
    • also have some pixel-diff tests to verify that rendering is working as expected.
    opened by joaodasilva 3
  • Update console.md

    Update console.md

    This is my first ever contribution to open source! I apologize in advance if I am breaking protocol! I wanted to see if this file meets the open issue to make these pages look more like the website. Please let me know if this is what you are looking for and I take a shot at the rest of the files in the doc folder.

    Relative links were used in the update. Extra header row added since GitHub tables require it.

    opened by sfdeloach 3
  • Add new logo

    Add new logo

    With this pull request I would like to add the new logo to the website as discussed in #24, alongside with other small changes, such as adding favicons, applying an enhanced color palette, and adjusting the navbar on mobile.

    Added

    • Favicon and app icons
    • Logo
    • Logo to navbar
    • Icon tags to <head>

    Changed

    • Updated color palette
    • Improved responsive styling of navbar
    opened by svenfinger 2
  • Sign the binaries to avoid malware warnings on Windows

    Sign the binaries to avoid malware warnings on Windows

    The prebuilt binaries are blocked by Windows and macOS by default, and the security checks must be bypassed manually by the user.

    Figure how to sign the binaries for distribution to avoid these warnings.

    Likewise, avoid the malware warning in Chrome when the binaries are downloaded.

    windows 
    opened by joaodasilva 2
  • [feature request] Add option to disable keyboard shortcuts

    [feature request] Add option to disable keyboard shortcuts

    I would like to be able to disable keyboard shortcuts, (console, console overlay, performance info), so the user would not be able to access them. Also each individually, the console overlay is nice. :)

    opened by ghost 1
  • [feature request] Add tooltip (API)

    [feature request] Add tooltip (API)

    Would be great if I can use tooltips like in the browser, with a window.js API, obviously. For example, I hover an element made on the canvas and, checking hover with mouse API, I can decide to show a tooltip if user stop the mouse in this position.

    The API could be simply implemented so:

    // default don't show any tooltip
    window.tooltip = "";
    
    // shows a description while hovering "interesting" content
    window.tooltip = "This is a description of what are you hovering!";
    
    // if element is not anymore hovered
    window.tooltip = "";
    

    Please, if you like my idea, add a :+1: below!

    opened by Bellisario 2
  • Support loading files from a ZIP bundle, and merging the bundle with the executable

    Support loading files from a ZIP bundle, and merging the bundle with the executable

    This is similar to #88.

    1. Support running a ZIP bundle instead of running a main JS file. Any file operations start by looking for the file in the ZIP, and then fallback on the filesystem when that fails.

    2. Support merging that ZIP with the executable, to distribute as a single binary. This might work by just concatenating the binary and the ZIP, because the ZIP header is at the end of the file:

    https://en.wikipedia.org/wiki/ZIP_(file_format)

    The downside is that the original executable can't be signed (or its signature becomes invalid).

    opened by joaodasilva 0
  • Ability to export the program as a separate executable

    Ability to export the program as a separate executable

    Let's say I create a cool app and I want to send it to my friend I want them to just open the executable and have the page shown to be my application. I can think of two ways this can be implemented:

    • flag for --export or option.
    • during the compilation of windowjs give it path for default application.
    opened by CmdEngineer 2
  • Fix crash at shutdown on Windows debug builds with MSVC

    Fix crash at shutdown on Windows debug builds with MSVC

    The program in attachment crashes after 10 to 100 runs on debug builds with MSVC on Windows.

    This seems to come from a destructor running at shutdown, possibly reaching for memory from an object that has already been destroyed. The issue only reproes on early exits via std::exit, which is often used in child processes (and in tests).

    Window.js doesn't have any destructors at shutdown, and this is likely coming from one of the libraries used. It's quite tricky to pin this down.

    The temporary fix at in commit f56ae2fe uses std::quick_exit instead, to bypass the atexit callbacks. This isn't great; this bug is to change that back to std::exit and fix the shutdown issue.

    https://gist.github.com/joaodasilva/f5fe471c7b27a2606689c6aeeb7398ed

    bug 
    opened by joaodasilva 0
  • The Windows build broke on windows-2022

    The Windows build broke on windows-2022

    GitHub has updated "windows-latest" from "windows-2019" to "windows-2022":

    https://github.com/actions/virtual-environments/issues/4856

    The v8 build fails to start with that change:

    Building v8 in libraries/v8/out/Release"
    
            1 file(s) copied.
    Traceback (most recent call last):
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 573, in <module>
        sys.exit(main())
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 569, in main
        return commands[sys.argv[1]](*sys.argv[2:])
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 546, in GetToolchainDir
        runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 106, in SetEnvironmentAndGetRuntimeDllDirs
        os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath()
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 197, in DetectVisualStudioPath
        version_as_year = GetVisualStudioVersion()
      File "D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py", line 186, in GetVisualStudioVersion
        raise Exception('No supported Visual Studio can be found.'
    Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017).
    ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
          exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
          ^----------
    Current dir: D:/a/windowjs/windowjs/libraries/v8/out/Release/
    Command: D:/a/windowjs/windowjs/libraries/depot_tools/bootstrap-2@3_8_10_chromium_23_bin/python3/bin/python3.exe D:/a/windowjs/windowjs/libraries/v8/build/vs_toolchain.py get_toolchain_dir
    Returned 1.
    See //build/toolchain/win/BUILD.gn:9:1: whence it was imported.
    import("//build/config/win/visual_studio_version.gni")
    ^----------------------------------------------------
    See //BUILD.gn:1516:1: which caused the file to be included.
    action("postmortem-metadata") {
    ^------------------------------
    
    GN failed!
    
    opened by joaodasilva 1
Releases(v0.2.1)
StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that of JavaScript's and TypeScript's

StarkScript StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that

EnderCommunity 5 May 10, 2022
F Graphics Library (FGL) is a small graphics C++ portable library for LCD displays on embedded systems

F Graphics Library (FGL) Full documentation: fgl.docsforge.com (By Filipe Chagas) F Graphics Library is a C++ library that I created for use in embedd

Filipe Chagas 9 Oct 31, 2022
GraphicsFuzz provides tools for automatically finding and simplifying bugs in graphics drivers, specifically graphics shader compilers.

GraphicsFuzz GraphicsFuzz is a set of tools for testing shader compilers GraphicsFuzz provides tools for automatically finding and simplifying bugs in

Google 516 Dec 15, 2022
CSC404: Computer Graphics [CG] & CSL402: Computer Graphics Lab [CG Lab]

COMPUTER-GRAPHICS-AND-COMPUTER-GRAPHICS-LAB CSC404: CG & CSL402: CG LAB [SEMESTER IV] Syllabus CG - Reference Books THE WALL MEGA SATISH - AUTHOR CG C

AMEY THAKUR 7 Apr 28, 2022
PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.

PLPv2b PLP Project Programming Language Programming Language for projects and computer science and research on computer and programming. What is PLP L

PLP Language 5 Aug 20, 2022
An open-source general-purpose programming language

An open source general purpose high-level programming language! [OO-N-YUH] This language is gonna onya other languages Vs Code Extention Language Supp

Tech Penguin 4 Aug 9, 2021
Crashser - open source dump/crash server for different programming languages

Crashser - open source dump/crash server for different programming languages (used for crash analysis in various applications). This library is crossplatfrom (now only Windows, Linux, OSX) implementation C++ client for Crasher dump/crash server.

Balun Vladimir 16 Oct 15, 2022
The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

The Synthesis ToolKit in C++ (STK) By Perry R. Cook and Gary P. Scavone, 1995--2021. This distribution of the Synthesis ToolKit in C++ (STK) contains

null 832 Jan 2, 2023
Open-source and open-hardware scientific RPN calculator

OpenRPNCalc Open-source and open-hardware scientific RPN calculator Introduction OpenRPNCalc is a scientific calculator based on STM32 microcontroller

Anton Poluektov 152 Dec 23, 2022
A fully-functional open source and open hardware mechanical USB computer keyboard with only three keys!

threeboard threeboard is a fully-functional open source and open hardware mechanical USB computer keyboard with only three keys. It supports multiple

Conor Taylor 98 Dec 9, 2022
dwm is an extremely fast, small, and dynamic window manager for X.

dwm - dynamic window manager dwm is an extremely fast, small, and dynamic window manager for X. My Patches This is in the order that I patched everyth

Christian Chiarulli 32 Dec 23, 2022
JWM is a cross-platform Java window management and OS integration library.

JWM aims to expose an interface that abstracts over window creation, input handling and OS integration

JetBrains 403 Jan 9, 2023
A simple utility that cold patches dwm (uDWM.dll) in order to disable window rounded corners in Windows 11

Win11DisableRoundedCorners A simple utility that cold patches the Desktop Window Manager (uDWM.dll) in order to disable window rounded corners in Wind

Valentin-Gabriel Radu 516 Dec 27, 2022
Play video by fonts in a console window by composing characters

FontVideo Play video by fonts in a console window by composing characters. Using FFmpeg API to decode the input file, then the video stream is rendere

0xaa55 9 Jul 16, 2022
Small Header-Only Window and OpenGL Manager.

LxDemOWin Linux Demo OpenGL and Window manager A small header-Only Window and OpenGL manager made in C, written in about 2 hours. With some basic code

PipeWarp 6 Oct 23, 2022
A window manager for GNOME, with rounded corners patch

Tested in gnome-shell 40.5, should works in gnome 40 and 41. integrate the blur effects with rounded corners.The source code can be found here. Issues

Yi 502 Jan 4, 2023
Hypr is a tiling window manager written in modern C++.

Hypr is a Linux tiling window manager for Xorg. It's written in XCB with modern C++ and aims to provide easily readable and expandable code. !WARNING:

vaxerski 709 Jan 4, 2023
A simple X11 window manager

Devoid WM A simple x11 tiling window manager Devoid tries to abide by the principle - "Do one thing, do it well". All it is is a window manager which

Murtaza Udaipurwala 29 Dec 6, 2022
Draw a triangle inside Electron's window using DirectX 11, mixing web and native content.

Draw a triangle inside Electron's window using DirectX 11, mixing web and native content. Limitations The native content is rendered over a child wind

UKABUER 10 Dec 3, 2022