Giter VIP home page Giter VIP logo

skiabuild's Introduction

“When you design a new user interface, you have to start off humbly”

— Steve Jobs presenting Aqua

Humble UI is a desktop UI framework for Clojure. No Electron. No JavaScript. Only JVM and native code.

Goal

  • A way to build high-quality desktop UIs
  • Build better apps that’s possible with web now, while staying cross-platform
  • Build them faster in Clojure

Motivation

  • Create desktop apps in Clojure
  • Electron is a great landmark
    • People prefer native apps to web apps
      • Normal shortcuts, icon, its own window, file system access, notifications, OS integrations
    • Developing real native apps is expensive
    • JavaScript + Chrome have huge overhead, can be slow
  • Java has “UI curse”
    • Previous attempts were cumbersome for user
    • Mimicking native look and feel didn’t work
    • Looked bad
  • Time of declarative UIs is now
    • React
    • Flutter
    • SwiftUI
    • Jetpack Compose
  • Web + Electron cleared the way for non-native look and feel
    • Write once, run everywhere is no longer rejected by users
    • Even native apps have many custom UI elements
  • Flutter proved new UI stack is a feasible task
  • Clojure is the best language for UI development
    • Performant enough to not noticeably lag
    • Access to full power of your computer (multithreaded)
    • REPL + interactive development == instant feedback loop
    • Proven itself great in CLJS world, can do the same on desktop

How is it going to be different

  • No goal to look native, aim for web look (write once, run everywhere)
  • Embrace platform differences in OS integration
  • Declarative UI API is much more pleasant to work with (+plays well with FP)
  • Expose low-level APIs along with high-level API
    • People can solve non-trivial problems in their own way, without hacks
  • Superpowers of Clojure

Architecture

  • Leverage Skia via Skija for high-performance GPU-accelerated graphics
  • JWM (Java Window Manager) for OS integration (simple, common ground, embrace the differences)

Status

Work in progress. No docs, and everything changes every day.

Resources

Slack:

Posts:

Videos:

Sample apps:

Development

Run REPL server:

./script/repl.py

To reload demo app using tools.namespace, evaluate:

(user/reload)

Examples

(require '[io.github.humbleui.ui :as ui])

(def ui
  (ui/default-theme {}
    (ui/center
      (ui/label "Hello from Humble UI! 👋"))))

(ui/start-app!
  (ui/window
    {:title "Humble 🐝 UI"}
    #'ui))

skiabuild's People

Contributors

danielku15 avatar glavo avatar jkwill87 avatar olonho avatar rsedaikin avatar tonsky 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

Watchers

 avatar  avatar  avatar  avatar

skiabuild's Issues

[fork] on windows (Release) "release.py" urllib.error.HTTPError: HTTP Error 401: Unauthorized

I have created a fork in order to build a windows (Release) with direct3d disabled. Local build was unsuccessful, several errors, so I have forked SkiaBuild in order to run the same actions as original, with 'skia_use_direct3d=false' and go on to build a new skija dll from there.
Trying to run current github actions, I get an authorization - permission error.

"release.py"
urllib.error.HTTPError: HTTP Error 401: Unauthorized
Error: Process completed with exit code 1.
##[debug]Finishing: Run python3 script/release.py --version m109-664500fa93 --build-type Release

Do we have any idea why?

value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug'

windows 10 x64,debug model error :
`1>skia_x64_debug.lib(skia.SkColor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'‘

1>skia_x64_debug.lib(skia.SkColor.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' `

required source headers does not exist in zip

unfortunately there are still more header files not present in the zip

/Users/smallville7123/StudioProjects/Astrid/app/src/main/cpp/SkiaApp/ViewSystem/SkiaBuild/Skia-m100-d5a507cafd-macos-Release-x64/src/gpu/GrShaderCaps.h:12:10: fatal error: 'src/gpu/glsl/GrGLSL.h' file not found
#include "src/gpu/glsl/GrGLSL.h"

Matthews-MacBook-Pro:SkiaApp smallville7123$ find . -name GrGLSL.h
./ViewSystem/SkiaBuild/skia/src/gpu/glsl/GrGLSL.h
Matthews-MacBook-Pro:SkiaApp smallville7123$

this is my CMake

cmake_minimum_required(VERSION 3.10.2)
project(SkiaBuild)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_library(SkiaBuild SHARED empty.cpp)
add_library(SkiaBuild_Debug SHARED empty.cpp)

target_compile_definitions(SkiaBuild PUBLIC SK_GL=1 SK_RELEASE=1)
target_compile_definitions(SkiaBuild_Debug PUBLIC SK_GL=1 SK_DEBUG=1)

set(SKIA_OUT Shared)
set(SKIA_OUT_DEBUG Shared_Debug)

set(SKIA_DIR        skia) #Skia-m100-d5a507cafd-macos-${SKIA_OUT})
set(SKIA_DIR_DEBUG  skia) #Skia-m100-d5a507cafd-macos-${SKIA_OUT_DEBUG})

target_include_directories(SkiaBuild PUBLIC
    ${SKIA_DIR}
    ${SKIA_DIR}/include/android
    ${SKIA_DIR}/include/c
    ${SKIA_DIR}/include/codec
    ${SKIA_DIR}/include/config
    ${SKIA_DIR}/include/core
    ${SKIA_DIR}/include/docs
    ${SKIA_DIR}/include/effects
    ${SKIA_DIR}/include/encode
    ${SKIA_DIR}/include/gpu
    ${SKIA_DIR}/include/pathops
    ${SKIA_DIR}/include/ports
    ${SKIA_DIR}/include/private
    ${SKIA_DIR}/include/sksl
    ${SKIA_DIR}/include/svg
    ${SKIA_DIR}/include/third_party/skcms
    ${SKIA_DIR}/include/third_party/vulkan
    ${SKIA_DIR}/include/utils
    ${SKIA_DIR}/src/core
    ${SKIA_DIR}/src/c
    ${SKIA_DIR}/src/codec
    ${SKIA_DIR}/src/core
    ${SKIA_DIR}/src/effects
    ${SKIA_DIR}/src/gpu
    ${SKIA_DIR}/src/image
    ${SKIA_DIR}/src/images
    ${SKIA_DIR}/src/lazy
    ${SKIA_DIR}/src/opts
    ${SKIA_DIR}/src/pathops
    ${SKIA_DIR}/src/pdf
    ${SKIA_DIR}/src/ports
    ${SKIA_DIR}/src/sfnt
    ${SKIA_DIR}/src/shaders
    ${SKIA_DIR}/src/sksl
    ${SKIA_DIR}/src/svg
    ${SKIA_DIR}/src/utils
    ${SKIA_DIR}/src/xml
    ${SKIA_DIR}/src/xps
)

target_include_directories(SkiaBuild_Debug PUBLIC
    ${SKIA_DIR_DEBUG}
    ${SKIA_DIR_DEBUG}/include/android
    ${SKIA_DIR_DEBUG}/include/c
    ${SKIA_DIR_DEBUG}/include/codec
    ${SKIA_DIR_DEBUG}/include/config
    ${SKIA_DIR_DEBUG}/include/core
    ${SKIA_DIR_DEBUG}/include/docs
    ${SKIA_DIR_DEBUG}/include/effects
    ${SKIA_DIR_DEBUG}/include/encode
    ${SKIA_DIR_DEBUG}/include/gpu
    ${SKIA_DIR_DEBUG}/include/pathops
    ${SKIA_DIR_DEBUG}/include/ports
    ${SKIA_DIR_DEBUG}/include/private
    ${SKIA_DIR_DEBUG}/include/sksl
    ${SKIA_DIR_DEBUG}/include/svg
    ${SKIA_DIR_DEBUG}/include/third_party/skcms
    ${SKIA_DIR_DEBUG}/include/third_party/vulkan
    ${SKIA_DIR_DEBUG}/include/utils
    ${SKIA_DIR_DEBUG}/src/core
    ${SKIA_DIR_DEBUG}/src/c
    ${SKIA_DIR_DEBUG}/src/codec
    ${SKIA_DIR_DEBUG}/src/core
    ${SKIA_DIR_DEBUG}/src/effects
    ${SKIA_DIR_DEBUG}/src/gpu
    ${SKIA_DIR_DEBUG}/src/image
    ${SKIA_DIR_DEBUG}/src/images
    ${SKIA_DIR_DEBUG}/src/lazy
    ${SKIA_DIR_DEBUG}/src/opts
    ${SKIA_DIR_DEBUG}/src/pathops
    ${SKIA_DIR_DEBUG}/src/pdf
    ${SKIA_DIR_DEBUG}/src/ports
    ${SKIA_DIR_DEBUG}/src/sfnt
    ${SKIA_DIR_DEBUG}/src/shaders
    ${SKIA_DIR_DEBUG}/src/sksl
    ${SKIA_DIR_DEBUG}/src/svg
    ${SKIA_DIR_DEBUG}/src/utils
    ${SKIA_DIR_DEBUG}/src/xml
    ${SKIA_DIR_DEBUG}/src/xps
)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
        CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    if(APPLE)
        set(WHOLE_ARCHIVE_FLAG "-Wl,-all_load" CACHE INTERNAL "all_load flag")
        set(NO_WHOLE_ARCHIVE_FLAG "-Wl,-noall_load" CACHE INTERNAL "noall_load flag")
    else()
        set(WHOLE_ARCHIVE_FLAG "-Wl,--whole-archive" CACHE INTERNAL "whole-archive flag")
        set(NO_WHOLE_ARCHIVE_FLAG "-Wl,--no-whole-archive" CACHE INTERNAL "no-whole-archive flag")
    endif()
else()
    set(WHOLE_ARCHIVE_FLAG "")
    set(NO_WHOLE_ARCHIVE_FLAG "")
endif()

# we cannot link to static libs such as icu, skresources, dng_sdk, pathkit, ect
# attempting to do so brings undefined references

#file(GLOB SKIA_LIBS_STATIC ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/*.a)
file(GLOB SKIA_WEBP_LIBS_STATIC ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/libwebp*.a)
file(GLOB SKIA_LIBS_SHARED ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/*.so)

target_link_libraries(
        SkiaBuild
        OpenGL_Library
        ${SKIA_LIBS_SHARED}

        ${WHOLE_ARCHIVE_FLAG}
        ${SKIA_LIBS_STATIC}

        # link to what we can
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/libexpat.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/libharfbuzz.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/libjpeg.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR}/out/${SKIA_OUT}/libpiex.a
        ${SKIA_WEBP_LIBS_STATIC}

        ${NO_WHOLE_ARCHIVE_FLAG}
)

#file(GLOB SKIA_LIBS_STATIC_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/*.a)
file(GLOB SKIA_WEBP_LIBS_STATIC_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/libwebp*.a)
file(GLOB SKIA_LIBS_SHARED_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/*.so)

target_link_libraries(
        SkiaBuild_Debug
        OpenGL_Library
        ${SKIA_LIBS_SHARED_DEBUG}

        ${WHOLE_ARCHIVE_FLAG}
        ${SKIA_LIBS_STATIC_DEBUG}

        # link to what we can
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/libexpat.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/libharfbuzz.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/libjpeg.a
        ${CMAKE_CURRENT_SOURCE_DIR}/${SKIA_DIR_DEBUG}/out/${SKIA_OUT_DEBUG}/libpiex.a
        ${SKIA_WEBP_LIBS_STATIC_DEBUG}

        ${NO_WHOLE_ARCHIVE_FLAG}
)

linux aarch64 port is broken

[258/1822] compile ../../src/core/SkContourMeasure.cpp
FAILED: obj/src/core/libskia.SkContourMeasure.o 
aarch64-linux-gnu-g++-9 -MD -MF obj/src/core/libskia.SkContourMeasure.o.d -DNDEBUG -DSK_R32_SHIFT=16 -DSK_ENABLE_SKSL -DSK_ENABLE_SKSL_IN_RASTER_PIPELINE -DSK_ENABLE_PRECOMPILE -DSK_GANESH -DSK_USE_PERFETTO -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -DSK_TYPEFACE_FACTORY_FREETYPE -DSK_GL -DSK_SUPPORT_PDF -DSK_CODEC_DECODES_JPEG -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_RAW -DSK_CODEC_DECODES_WEBP -DSK_HAS_WUFFS_LIBRARY -DSK_XML -I../.. -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -O3 -fdata-sections -ffunction-sections -I/usr/aarch64-linux-gnu/include -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -frtti -c ../../src/core/SkContourMeasure.cpp -o obj/src/core/libskia.SkContourMeasure.o
In file included from ../../src/core/SkGeometry.h:14,
                 from ../../src/core/SkContourMeasure.cpp:11:
../../src/base/SkVx.h:950:41: internal compiler error: in instantiate_decl, at cp/pt.c:24765
  950 |     a = sk_bit_cast<Vec<N,T>>(mat.val[0]); \
      |                                         ^
../../src/base/SkVx.h:968:1: note: in expansion of macro ‘IMPL_LOAD4_TRANSPOSED’
  968 | IMPL_LOAD4_TRANSPOSED(4, float, vld4q_f32)
      | ^~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.

@Glavo can you look into that?

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.