Giter Club home page Giter Club logo

ultralight-java-reborn's Introduction

Ultralight Discord | Ultralight Upstream

Ultralight Java Reborn

Complete rewrite of the original Java wrapper for the Ultralight web engine

About

This project is a Java wrapper for the Ultralight web engine which focuses on providing a simple, easy-to-use, and lightweight API for embedding web content in Java applications.

What is Ultralight?

Ultralight is a lightweight, cross-platform, standards-compliant HTML UI engine. It's not a full browser, it's designed specifically for creating native applications with HTML, CSS, and JavaScript. Ultralight is written in C++ and meant to be embedded into native applications (on desktop or console platforms). It's a great solution for projects that want a UI that runs off of HTML but doesn't want to deal with the complexity of embedding a full browser like Chromium or WebKit.

What makes Ultralight Java Reborn different from other solutions?

Other than solutions like JCEF and the JavaFX WebView, Ultralight is meant to be embedded into applications and games. As such, it focuses on speed and integration with custom code. Ultralight Java Reborn is a wrapper around the Ultralight C++ API.

Contact

If you have any questions, feel free to join the Ultralight Discord and ask in the #java channel.

Using the library

Snapshot builds are published to https://s01.oss.sonatype.org/content/repositories/snapshots.

Gradle

Add the repository:

repositories {
    maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
}

Add the dependencies:

dependencies {
    // Java libraries, these are needed for compilation and runtime
    implementation("net.janrupf.ultralight:ultralight-java-reborn-core:0.0.2-SNAPSHOT")
    implementation("net.janrupf.ultralight:ultralight-java-reborn-platform-jni:0.0.2-SNAPSHOT")

    // The native libraries, these are needed for runtime only (they contain no Java code)
    runtimeOnly("net.janrupf.ultralight:ultralight-java-reborn-platform-jni:0.0.2-SNAPSHOT:linux-x64")
    // or win-x64, mac-x64, or just add all 3 as dependencies
}

Maven

Add the repository:

<repositories>
    <repository>
        <id>sonatype-snapshots</id>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

Add the dependencies:

<dependencies>
    <dependency>
        <!-- Core library -->
        <groupId>net.janrupf.ultralight</groupId>
        <artifactId>ultralight-java-reborn-core</artifactId>
        <version>0.0.2-SNAPSHOT</version>
    </dependency>
    <dependency>
        <!-- Platform JNI library -->
        <groupId>net.janrupf.ultralight</groupId>
        <artifactId>ultralight-java-reborn-platform-jni</artifactId>
        <version>0.0.2-SNAPSHOT</version>
    </dependency>
    <dependency>
        <!-- Platform JNI natives -->
        <groupId>net.janrupf.ultralight</groupId>
        <artifactId>ultralight-java-reborn-platform-jni</artifactId>
        <version>0.0.2-SNAPSHOT</version>
        <classifier>linux-x64</classifier>
        <scope>runtime</scope> <!-- Only required at runtime, contains no Java code -->
        <!-- or win-x64, mac-x64, or just add all 3 as dependencies -->
    </dependency>
</dependencies>

Licensing

This wrapper is licensed under the LGPLv3 license. See the LICENSE file for more information.

However, Ultralight itself requires a commercial license for use in commercial products. See the official Ultralight website for more information.

Moreover, some of the Jar files produced by this project contain the non-free proprietary binaries of Ultralight.

ultralight-java-reborn's People

Contributors

1zun4 avatar janrupf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

1zun4 trautmannp

ultralight-java-reborn's Issues

JNIUlBitmap.nativeUnlockPixels throws JNI Exception

Hi,

I am trying to get a bitmap of the surface and copy that to some texture. Here's the code

        UltralightBitmapSurface surface = (UltralightBitmapSurface) view.surface();
        UltralightBitmap bitmap = surface.bitmap();
        UltralightBuffer lock = bitmap.lockPixels();
        texture.setPixels(bitmap.rawPixels()); // some other engine code
        lock.close();

However, the above code throws this JNI exception:
Caused by: java.lang.UnsatisfiedLinkError: 'void net.janrupf.ujr.platform.jni.impl.JNIUlBitmap.nativeUnlockPixels(byte[])'

UltralightView#loadURL(String) causes an std::runtime_error

I'm trying to display a web page from a local html file. When i pass to method UltralightView#loadURL(String) URL with scheme file://, this message prints to the standard error stream and program execution interrupts:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Thread not attached to JVM

URLs with the http:// and https:// schemes works fine.

Thanks!

`UltralightView#getJavaScriptContext()` not found

First of all, thank you for your dedication to this great project.

My question is that in this example below, it says method UltralightView#getJavaScriptContext() can be used to obtain the JavaScript context, however, I cannot find the method in class net.janrupf.ujr.api.UltralightView.

// In this example we will only use JavaScript core directly, so no Ultralight view is ever created.
// Usually you would obtain the JavaScript context using UltralightView#getJavaScriptContext(), but
// here we manually create the context.

Is there something that I missed? Or is it still unimplemented (If so could you pls offer some information about it so that maybe I can submit a PR to implement it.) ? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.