diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..5f8e80cb
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,84 @@
+---
+name: Bug Report
+description: File a bug report to help us improve OpenBangla Keyboard
+labels: ["Bug"]
+title: "[Bug]: "
+type: bug
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for reporting a bug in OpenBangla Keyboard (OBK). Please provide as much detail as possible to help us diagnose and fix the issue.
+ - type: input
+ id: obk-version
+ attributes:
+ label: OpenBangla Keyboard Version
+ description: What version of OpenBangla Keyboard are you using?
+ placeholder: e.g., 2.0.0
+ validations:
+ required: true
+ - type: input
+ id: os-details
+ attributes:
+ label: Operating System and Version
+ description: Which OS or Distro and which version are you using?
+ placeholder: e.g., Windows 11 25H2, macOS 26.4, Linux Mint 22.3
+ validations:
+ required: true
+ - type: input
+ id: environment-details
+ attributes:
+ label: Environment Details (for GNU/Linux Users)
+ description: Which desktop environment and display type are you using?
+ placeholder: e.g., KDE Plasma Wayland, Cinnamon X11
+ validations:
+ required: false
+ - type: dropdown
+ id: input-method
+ attributes:
+ label: Input Method Framework
+ description: Which input method framework are you using?
+ multiple: true
+ options:
+ - IBus
+ - Fcitx
+ - Other (Specify in Additional Context)
+ validations:
+ required: false
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: Describe the Bug
+ description: A clear and concise description of what the bug is.
+ placeholder: Let us know what issues you are experiencing.
+ validations:
+ required: true
+ - type: textarea
+ id: steps-to-reproduce
+ attributes:
+ label: Steps to Reproduce
+ description: Provide detailed steps to reproduce the bug.
+ placeholder: |
+ 1. Open OBK
+ 2. Select a specific layout
+ 3. Type specific characters
+ 4. Observe the issue
+ validations:
+ required: true
+ - type: textarea
+ id: logs
+ attributes:
+ label: Logs or Screenshots
+ description: If applicable, please include relevant logs, screenshots, or other files to help explain the problem.
+ placeholder: Paste logs here or describe how to access screenshots.
+ validations:
+ required: false
+ - type: textarea
+ id: additional-context
+ attributes:
+ label: Additional Context
+ description: Any other context about the problem, such as specific keyboard layouts or system configurations.
+ placeholder: Add any relevant details here.
+ validations:
+ required: false
+---
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..e6ca76f8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: true
+contact_links:
+ - name: Got any questions?
+ url: https://github.com/OpenBangla/OpenBangla-Keyboard/discussions/categories/q-a
+ about: General inquiries or help with OpenBangla Keyboard.
+ - name: Share your ideas!
+ url: https://github.com/OpenBangla/OpenBangla-Keyboard/discussions/categories/ideas
+ about: Suggest new features or improvements for the project.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 00000000..2a95fc9e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,44 @@
+---
+name: Feature Request
+description: Suggest an idea for improving OpenBangla Keyboard
+labels: ["Enhancement"]
+title: "[Feature]: "
+type: feature
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for suggesting an improvement for OpenBangla Keyboard (OBK). Please provide as much detail as possible to help us understand your idea.
+ - type: textarea
+ id: feature-description
+ attributes:
+ label: Describe the Feature
+ description: A clear and concise description of the feature you'd like to see.
+ placeholder: What feature would you like to add to OBK?
+ validations:
+ required: true
+ - type: textarea
+ id: problem-solved
+ attributes:
+ label: Problem or Use Case
+ description: What problem does this feature solve, or what use case does it address?
+ placeholder: Describe the problem or scenario this feature would improve.
+ validations:
+ required: true
+ - type: textarea
+ id: proposed-solution
+ attributes:
+ label: Proposed Solution
+ description: How do you envision this feature working? Provide details on the implementation or behavior.
+ placeholder: Describe how you think this should work in OBK.
+ validations:
+ required: false
+ - type: textarea
+ id: additional-context
+ attributes:
+ label: Additional Context
+ description: Any other details, such as specific keyboard layouts, user workflows, or examples from other software.
+ placeholder: Add any relevant details or examples here.
+ validations:
+ required: false
+---
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 4561628c..98158b8a 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -6,16 +6,15 @@ on:
tags-ignore: [ '**' ]
jobs:
-
build:
if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
strategy:
matrix:
- container: [ "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian:11", "debian:12", "fedora:37", "fedora:39", "fedora:40", "fedora:41", "archlinux:latest" ]
+ container: [ "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "ubuntu:25.04", "debian:12", "debian:13", "fedora:40", "fedora:41", "fedora:42", "archlinux:latest" ]
# this list should be updated from time to time by consulting these pages:
# https://releases.ubuntu.com/
# https://wiki.debian.org/DebianReleases#Production_Releases
- # https://fedoraproject.org/wiki/Releases
+ # https://en.wikipedia.org/wiki/Fedora_Linux_release_history#Release_history
runs-on: "ubuntu-latest"
container:
image: ${{ matrix.container }}
@@ -23,64 +22,63 @@ jobs:
DIST: ${{ matrix.container }}
DEBIAN_FRONTEND: noninteractive
steps:
+ - name: install-git
+ run: |
+ # Install Git based on distro
+ if command -v apt-get >/dev/null; then
+ apt-get update -y
+ apt-get install -y git
+ elif command -v dnf >/dev/null; then
+ dnf install -y git
+ elif command -v zypper >/dev/null; then
+ zypper install -y git
+ elif command -v pacman >/dev/null; then
+ pacman -Sy git --noconfirm
+ fi
+
- name: checkout-source
uses: actions/checkout@v4
with:
submodules: recursive
+
- name: run-builder
shell: bash
run: ./tools/build.sh
+
+ - name: Sanitize container name
+ id: sanitizer
+ shell: bash
+ run: |
+ # Replace colons and slashes with dashes
+ SANITIZED_CONTAINER=$(echo "${{ matrix.container }}" | sed 's/[:\\/]/-/g')
+ echo "sanitized_container=$SANITIZED_CONTAINER" >> $GITHUB_OUTPUT
+
- name: upload-artifacts
uses: actions/upload-artifact@v4
with:
- name: package-archives
+ name: pkg-${{ steps.sanitizer.outputs.sanitized_container }}
path: artifact
- deploy:
+ release:
if: contains(github.event.head_commit.message, 'deploy+')
needs: build
runs-on: "ubuntu-latest"
- container:
- image: "archlinux:latest"
- env:
- BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
- BINTRAY_APIKEY: ${{ secrets.BINTRAY_APIKEY }}
- BINTRAY_GPG_DATA: ${{ secrets.GPG_DATA }}
- BINTRAY_GPG_ID: ${{ secrets.GPG_ID }}
- JFROG_CLI_OFFER_CONFIG: false
steps:
- name: checkout-source
uses: actions/checkout@v4
- with:
- submodules: recursive
- - name: install-jfrog-cli
- uses: jfrog/setup-jfrog-cli@v1
- - name: download-artifacts
- uses: actions/download-artifact@v4
- with:
- name: package-archives
- path: artifact
- - name: bintray-publish
- shell: bash
- run: ./tools/publish.sh
- release:
- needs: deploy
- runs-on: "ubuntu-latest"
- steps:
- - name: checkout-source
- uses: actions/checkout@v4
- name: get-version
id: get_version
shell: bash
run: |
RELEASE_VERSION=$(cat version.txt | head -n1)
- echo ::set-output name=RELEASE_VERSION::$RELEASE_VERSION
+ echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
+
- name: download-artifacts
uses: actions/download-artifact@v4
with:
- name: package-archives
- path: artifact
+ path: artifacts
+
- name: create-release
id: create_release
uses: ncipollo/release-action@v1
@@ -88,7 +86,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.get_version.outputs.RELEASE_VERSION }}
name: ${{ steps.get_version.outputs.RELEASE_VERSION }}
- artifacts: "artifact/*"
+ artifacts: "artifacts/*/*"
allowUpdates: true
draft: true
body: |
diff --git a/.gitignore b/.gitignore
index a2a3177c..bddb6aa3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,3 +143,16 @@ fabric.properties
*.exe
*.out
*.app
+.cache
+
+target
+
+*~
+*.DS_Store
+.*.swp
+*mode1v3
+*pbxuser
+*perspectivev3
+*xcuserdata*
+*xcworkspace*
+/build
diff --git a/.gitmodules b/.gitmodules
index 389ee113..451ca414 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,3 +2,6 @@
path = src/engine/riti
url = https://github.com/OpenBangla/riti.git
branch = master
+[submodule "cmake/corrosion-rs"]
+ path = cmake/corrosion-rs
+ url = https://github.com/corrosion-rs/corrosion.git
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index beac2882..2cea3c9f 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -8,6 +8,7 @@
"${workspaceRoot}"
],
"defines": [],
+ "compileCommands": "build/compile_commands.json",
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61193e1c..22000817 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,46 @@
# Change Log
+## Unreleased
+
+## 3.0.0
+* Fcitx5 engine for KDE based distributions ([#202])
+* Use [okkhor] as the Avro Phonetic implementation. It is substantially faster than the previous implementation ([#15])
+* Add the [Khipro](https://khiprokeyboard.github.io/) layout, a modern shift-free phonetic method for Bangla ([#426](https://github.com/OpenBangla/OpenBangla-Keyboard/issues/426))
+* Emoji input support ([#23])
+* ANSI encoding support ([#33])
+* Smart Quoting feature ([#35])
+* Whole word deletion by Ctrl + Backspace keypress combination feature ([#36])
+* Preserve user's candidate selection if the keypress was a punctuation mark in Phonetic Method ([#363])
+* Old style typing in Fixed method ([#20])
+* Inclusion of typed English word in Fixed method suggestions.
+* Introduce System tray entry for TopBar ([#209])
+* Installation support for new Fixed method layouts ([#355])
+* Edit National keyboard to conform with Ekushey's National layout ([#281])
+* Missing ZWJ character is added in the Borno layout
+* Fix focus out behavior of preedit text in iBus engine ([#298], [#300])
+* Prevent the preedit from reappearing at the new position after a mouse click in iBus engine ([#313])
+* Detect Dark Mode to enable the Dark mode theme of the TopBar
+* Performance optimizations ([#16], [#26])
+* Add new autocorrect entries ([#48])
+
+[okkhor]: https://github.com/gulshan/okkhor/
+[#15]: https://github.com/OpenBangla/riti/pull/15
+[#16]: https://github.com/OpenBangla/riti/pull/16
+[#20]: https://github.com/OpenBangla/riti/pull/20
+[#23]: https://github.com/OpenBangla/riti/pull/23
+[#26]: https://github.com/OpenBangla/riti/pull/26
+[#33]: https://github.com/OpenBangla/riti/pull/33
+[#35]: https://github.com/OpenBangla/riti/pull/35
+[#36]: https://github.com/OpenBangla/riti/pull/36
+[#48]: https://github.com/OpenBangla/riti/pull/48
+[#209]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/209
+[#202]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/202
+[#281]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/281
+[#298]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/298
+[#300]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/300
+[#313]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/313
+[#355]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/355
+[#363]: https://github.com/OpenBangla/OpenBangla-Keyboard/pull/363
+
## 2.0.0
* Complete re-implementation of input method functionalities in Rust. ([#107][107]) It is [~1.2x faster in searching][3] dictionary suggestions.
* Dictionary suggestion is now available in Fixed Method Layouts(Provat, National etc.) ([#61][61], [#6][6])
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4057ce0a..2c130d32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 3.10)
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+cmake_minimum_required(VERSION 3.18...3.29)
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" VERSION_STRING LIMIT_COUNT 1 REGEX "^.+")
project("OpenBangla-Keyboard" VERSION ${VERSION_STRING})
@@ -9,62 +9,149 @@ set(APP_NAME "OpenBangla-Keyboard")
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
## Set Compiler Standard
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-enable_language(Rust)
-include(CMakeCargo)
+add_subdirectory(cmake/corrosion-rs)
-find_package(Qt5 COMPONENTS Widgets Network REQUIRED)
+if(APPLE)
+ enable_language(Swift)
+
+ if("${CMAKE_Swift_COMPILER_VERSION}" VERSION_LESS 5.9)
+ message(FATAL_ERROR "Bidirectional C++ Interop requires Swift 5.9 or greater. Have ${CMAKE_Swift_COMPILER_VERSION}")
+ endif()
+
+ # Set up swiftrt.o and runtime library search paths
+ include(InitializeSwift)
+ # cmake/modules/AddSwift.cmake provides the function for creating the Swift to
+ # C++ bridging header
+ include(AddSwift)
+endif()
+
+find_package(Qt5 COMPONENTS Widgets Network Svg REQUIRED)
+
+message(STATUS "Qt5 framework version: ${Qt5Core_VERSION}")
# Get system information. WIN32 and APPLE are defined by CMake
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(OS_LINUX 1)
-endif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+endif()
# Set build type to "Release" if user did not specify any build type yet
# Other possible values: Debug, Release, RelWithDebInfo and MinSizeRel
-if (NOT CMAKE_BUILD_TYPE)
+if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
-endif (NOT CMAKE_BUILD_TYPE)
+endif()
-if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
-endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
+endif()
# Sanity check our source directory to make sure that we are not trying to
# generate an in-tree build (it pollutes the source tree with a lot of CMake
# related files).
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed.\nPlease create a build directory and initiate cmake from there.")
-endif ()
+endif()
# For Linux.
-if (OS_LINUX)
+if(OS_LINUX)
## Additions for Linux ##
- # Generate compile_commands.json to satisfy vscode linux configuration
- set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-
- ## Set Directories for installing and storing files
- set(CMAKE_INSTALL_PREFIX "/usr")
- set(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
+ if(NOT DEFINED BIN_DIR)
+ set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+ endif()
+ if(NOT DEFINED DATADIR)
+ set(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
+ endif()
+ if(NOT DEFINED LIBEXECDIR)
+ set(LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/libexec")
+ endif()
set(PROJECT_DATADIR "${DATADIR}/openbangla-keyboard")
add_definitions(-DPROJECT_DATADIR="${PROJECT_DATADIR}")
+ add_definitions(-DBIN_DIR="${BIN_DIR}")
+ add_definitions(-DLIBEXECDIR="${LIBEXECDIR}")
include(FindPkgConfig)
find_package(PkgConfig)
- ## Find iBus ##
- pkg_check_modules(IBUS REQUIRED ibus-1.0)
+
+ option(ENABLE_IBUS "Enable IBus support" OFF)
+ option(ENABLE_FCITX "Enable Fcitx support" OFF)
+ option(ENABLE_BOTH "Enable both IBus and Fcitx support" OFF)
+
+ if((NOT ENABLE_IBUS) AND (NOT ENABLE_FCITX) AND (NOT ENABLE_BOTH))
+ message(FATAL_ERROR "Please set atleast ENABLE_IBUS or ENABLE_FCITX or ENABLE_BOTH to be ON to build a backend")
+ endif()
+
## Find zstd ##
pkg_check_modules(ZSTD REQUIRED libzstd)
-endif (OS_LINUX)
+
+ ## Find iBus ##
+ if(ENABLE_IBUS)
+ pkg_check_modules(IBUS REQUIRED ibus-1.0)
+ endif()
+
+ ## Find Fcitx ##
+ if(ENABLE_FCITX)
+ find_package(Fcitx5Core 5.0.5 REQUIRED)
+ endif()
+
+ if(ENABLE_BOTH)
+ pkg_check_modules(IBUS REQUIRED ibus-1.0)
+ find_package(Fcitx5Core 5.0.5 REQUIRED)
+ endif()
+endif()
+
+# For Windows
+if(WIN32)
+ find_package(zstd CONFIG REQUIRED)
+
+ # Install the MSVC runtime next to the GUI executable (flat layout, no bin/).
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
+ include(InstallRequiredSystemLibraries)
+
+ # Install data files
+ install(FILES
+ "${CMAKE_SOURCE_DIR}/data/dictionary.json"
+ "${CMAKE_SOURCE_DIR}/data/regex.json"
+ "${CMAKE_SOURCE_DIR}/data/suffix.json"
+ "${CMAKE_SOURCE_DIR}/src/engine/riti/data/autocorrect.json"
+ "${CMAKE_SOURCE_DIR}/data/kalpurush.ttf"
+ DESTINATION data)
+ install(FILES
+ "${CMAKE_SOURCE_DIR}/data/avrophonetic.json"
+ "${CMAKE_SOURCE_DIR}/data/khipro.json"
+ "${CMAKE_SOURCE_DIR}/data/Avro_Easy.json"
+ "${CMAKE_SOURCE_DIR}/data/Borno.json"
+ "${CMAKE_SOURCE_DIR}/data/Munir_Optima.json"
+ "${CMAKE_SOURCE_DIR}/data/National_Jatiya.json"
+ "${CMAKE_SOURCE_DIR}/data/Probhat.json"
+ DESTINATION layouts)
+endif()
+
+# For Apple
+if(APPLE)
+ find_package(zstd CONFIG REQUIRED)
+
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
+ set(CMAKE_INSTALL_PREFIX "/")
+
+ # Determine host architectures for the .pkg installer distribution.
+ # Without hostArchitectures, macOS assumes x86_64 and prompts for Rosetta.
+ if(CMAKE_OSX_ARCHITECTURES)
+ string(REPLACE ";" "," CPACK_HOST_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
+ else()
+ set(CPACK_HOST_ARCHITECTURES "${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
+endif()
add_subdirectory(src/engine)
+add_subdirectory(src/platform)
add_subdirectory(src/frontend)
add_subdirectory(src/shared)
# uninstall target
-if (NOT TARGET uninstall)
+if(NOT TARGET uninstall)
configure_file(
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@@ -72,45 +159,195 @@ if (NOT TARGET uninstall)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
-endif ()
+endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenSource Bengali input method")
set(CPACK_PACKAGE_VENDOR "OpenBangla Team")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "OpenBangla Team ")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/data/Readme.txt")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
+set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/data/Readme.txt")
+if(APPLE)
+ set(CPACK_PACKAGE_NAME "OpenBangla Keyboard")
+ # macOS productbuild requires license files with .txt, .rtf, .rtfd, or .html extension
+ configure_file("${CMAKE_SOURCE_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/LICENSE.txt" COPYONLY)
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.txt")
+else()
+ set(CPACK_PACKAGE_NAME "openbangla-keyboard")
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
+
+ # Stripping on macOS invalidates ad-hoc code signatures, causing
+ # installed apps to be killed by the system.
+ set(CPACK_STRIP_FILES TRUE)
+endif()
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
-set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${PROJECT_VERSION}-$ENV{DIST}")
-set(CPACK_STRIP_FILES TRUE)
-set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://openbangla.github.io/")
+set(CPACK_PRODUCTBUILD_IDENTITY_NAME "" CACHE STRING "Code signing identity for productbuild")
+set(CPACK_PRODUCTBUILD_KEYCHAIN_PATH "" CACHE STRING "Keychain path for code signing")
+set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://openbangla.org/")
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "ibus (>= 1.5.1)")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
-set(CPACK_RPM_PACKAGE_URL "https://openbangla.github.io/")
-set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, ibus >= 1.5.1, ibus-libs >= 1.5.1, libzstd >= 1.3.3")
+set(CPACK_RPM_PACKAGE_URL "https://openbangla.org/")
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
+configure_file("${CMAKE_SOURCE_DIR}/data/linux/postinst.in" "${CMAKE_BINARY_DIR}/postinst" @ONLY)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst")
+set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/postinst")
# Prevents CPack from generating file conflicts
-set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/applications")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus/component")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/metainfo")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/pixmaps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/1024x1024")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/1024x1024/apps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/128x128")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/128x128/apps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/16x16")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/16x16/apps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/32x32")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/32x32/apps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/48x48")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/48x48/apps")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/512x512")
-list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons/hicolor/512x512/apps")
+set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/applications" "/usr/share/metainfo" "/usr/share/pixmaps"
+ "/usr/share/icons" "/usr/share/icons/hicolor"
+ "/usr/share/icons/hicolor/1024x1024" "/usr/share/icons/hicolor/1024x1024/apps"
+ "/usr/share/icons/hicolor/128x128" "/usr/share/icons/hicolor/128x128/apps"
+ "/usr/share/icons/hicolor/16x16" "/usr/share/icons/hicolor/16x16/apps"
+ "/usr/share/icons/hicolor/32x32" "/usr/share/icons/hicolor/32x32/apps"
+ "/usr/share/icons/hicolor/48x48" "/usr/share/icons/hicolor/48x48/apps"
+ "/usr/share/icons/hicolor/512x512" "/usr/share/icons/hicolor/512x512/apps")
+# Configure CPack on the basis of which backend we are building for.
+if(ENABLE_IBUS)
+ ## IBUS
+ # set(CPACK_PACKAGE_NAME "ibus-openbangla")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "ibus (>= 1.5.1)")
+ set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, ibus >= 1.5.1, ibus-libs >= 1.5.1, libzstd >= 1.3.3")
+ list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus" "/usr/share/ibus/component")
+elseif(ENABLE_FCITX)
+ ## FCITX
+ # set(CPACK_PACKAGE_NAME "fcitx-openbangla")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "fcitx5 (>= 5.0.5)")
+ set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, libzstd >= 1.3.3, fcitx5 >= 5.0.5")
+ list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/lib64/fcitx5" "/usr/share/fcitx5" "/usr/share/fcitx5/inputmethod" "/usr/share/fcitx5/addon")
+elseif(ENABLE_BOTH)
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "fcitx5 (>= 5.0.5) | ibus (>= 1.5.1)")
+ set(CPACK_RPM_PACKAGE_REQUIRES
+ "(ibus >= 1.5.1 if gnome-shell else fcitx5 >= 5.0.5), (gnome-shell-extension-appindicator if gnome-shell), qt5-qtbase >= 5.15.0, libzstd >= 1.3.3"
+ )
+ list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus" "/usr/share/ibus/component" "/usr/lib64/fcitx5"
+ "/usr/share/fcitx5" "/usr/share/fcitx5/inputmethod" "/usr/share/fcitx5/addon")
+elseif(APPLE)
+ set(CPACK_PACKAGE_VENDOR "OpenBangla")
+ set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+ set(CPACK_PACKAGE_FILE_NAME "OpenBangla-Keyboard-${PROJECT_VERSION}")
+ set(CPACK_PACKAGING_INSTALL_PREFIX "/")
+ set(CPACK_MONOLITHIC_INSTALL OFF)
+ set(CPACK_COMPONENTS_ALL IME GUI)
+ set(CPACK_COMPONENT_IME_REQUIRED TRUE)
+ set(CPACK_COMPONENT_GUI_REQUIRED TRUE)
+ set(CPACK_COMPONENT_GUI_DEPENDS IME)
+ set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "FALSE")
+ set(CPACK_POSTFLIGHT_GUI_SCRIPT "${CMAKE_SOURCE_DIR}/data/productbuild/postinstall")
+ set(CPACK_PRODUCTBUILD_RESOURCES_DIR "${CMAKE_SOURCE_DIR}/data/productbuild")
+ set(CPACK_PRODUCTBUILD_BACKGROUND "installer.png")
+ set(CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT "left")
+ set(CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA "installer.png")
+ set(CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT "left")
+elseif(WIN32)
+ set(CPACK_GENERATOR "NSIS")
+ set(CPACK_PACKAGE_NAME "OpenBangla-Keyboard")
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|x86_64")
+ set(_arch_suffix "x86_64")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64")
+ set(_arch_suffix "aarch64")
+ else()
+ set(_arch_suffix "${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
+ set(CPACK_PACKAGE_FILE_NAME "OpenBangla-Keyboard-${PROJECT_VERSION}-${_arch_suffix}")
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenBangla-Keyboard")
+ # Create the Start Menu shortcut explicitly (below) instead of via
+ # CPACK_PACKAGE_EXECUTABLES, whose target path depends on the CPack/NSIS
+ # generator version (older generators hardcode a nonexistent $INSTDIR\bin).
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA
+ "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\OpenBangla Keyboard.lnk\\\" \\\"$INSTDIR\\\\openbangla-gui.exe\\\"")
+ set(CPACK_NSIS_DELETE_ICONS_EXTRA
+ "Delete \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\OpenBangla Keyboard.lnk\\\"")
+ set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+ set(CPACK_NSIS_DISPLAY_NAME "OpenBangla Keyboard ${PROJECT_VERSION}")
+ set(CPACK_NSIS_PACKAGE_NAME "OpenBangla Keyboard")
+ set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/frontend/openbangla.ico")
+ set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/src/frontend/openbangla.ico")
+ set(CPACK_NSIS_INSTALLED_ICON_NAME "openbangla-gui.exe")
+ set(CPACK_NSIS_URL_INFO_ABOUT "https://openbangla.github.io/")
+ set(CPACK_NSIS_HELP_LINK "https://github.com/OpenBangla/OpenBangla-Keyboard")
+ set(CPACK_NSIS_MODIFY_PATH OFF)
+ set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+
+ # Include x64.nsh for 64-bit/ARM64 detection and file system redirection macros.
+ set(CPACK_NSIS_DEFINES "!include \\\"x64.nsh\\\"")
+
+ # Disable file system redirection before file extraction so that files are
+ # installed into the true 64-bit/ARM64 paths instead of WoW64 redirected ones.
+ # Also validate that the installer matches the target architecture.
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64")
+ set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "\
+ \\\${If} \\\${IsNativeARM64}\n\
+ \\\${Else}\n\
+ MessageBox MB_ICONSTOP \\\"This installer requires Windows on ARM64.\\\"\n\
+ Quit\n\
+ \\\${EndIf}\n\
+ \\\${DisableX64FSRedirection}")
+ else()
+ set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "\\\${DisableX64FSRedirection}")
+ endif()
+
+ # NSIS install commands: register IME DLLs and create user data directory.
+ # Note: NSIS installer is 32-bit, so $SYSDIR points to SysWOW64 (32-bit)
+ # and $WINDIR\Sysnative points to the real System32 (64-bit/ARM64 native).
+ # Backslashes need quadruple-escaping (\\\\) to survive two rounds of CMake
+ # parsing: CMakeLists.txt → CPackConfig.cmake → NSIS template.
+ set(_nsis_install_commands
+ # Create user data directory for user-created layouts
+ "CreateDirectory \\\"$LOCALAPPDATA\\\\OpenBangla\\\\layouts\\\""
+ # Install the Kalpurush font (required by the candidate window) as a system font:
+ # copy into the Fonts dir, register it for the running session, persist it in the
+ # registry, then broadcast WM_FONTCHANGE (0x001D) so running apps pick it up.
+ "CopyFiles /SILENT \\\"$INSTDIR\\\\data\\\\kalpurush.ttf\\\" \\\"$FONTS\\\\kalpurush.ttf\\\""
+ "System::Call 'GDI32::AddFontResource(t)i(\\\"$FONTS\\\\kalpurush.ttf\\\")'"
+ "WriteRegStr HKLM \\\"Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Fonts\\\" \\\"Kalpurush (TrueType)\\\" \\\"kalpurush.ttf\\\""
+ # Use /TIMEOUT so NSIS uses SendMessageTimeout (abort-if-hung) instead of a
+ # blocking SendMessage; a HWND_BROADCAST of WM_FONTCHANGE otherwise waits on
+ # every top-level window and hangs the installer if any window is unresponsive.
+ "SendMessage 0xFFFF 0x001D 0 0 /TIMEOUT=1000"
+ # Register native IME DLL (use Sysnative to reach native regsvr32)
+ "ExecWait '\\\"$WINDIR\\\\Sysnative\\\\regsvr32.exe\\\" /s \\\"$INSTDIR\\\\openbangla.dll\\\"' $0"
+ "\\\${If} $0 <> 0"
+ " MessageBox MB_OK|MB_ICONEXCLAMATION \\\"Failed to register the IME module (error code: $0). The keyboard may not work correctly.\\\""
+ "\\\${EndIf}"
+ )
+ set(_nsis_uninstall_commands
+ # Disable FS redirection for uninstall operations
+ "\\\${DisableX64FSRedirection}"
+ # Unregister native IME DLL
+ "ExecWait '\\\"$WINDIR\\\\Sysnative\\\\regsvr32.exe\\\" /s /u \\\"$INSTDIR\\\\openbangla.dll\\\"'"
+ # Remove the Kalpurush system font installed above.
+ "System::Call 'GDI32::RemoveFontResource(t)i(\\\"$FONTS\\\\kalpurush.ttf\\\")'"
+ "DeleteRegValue HKLM \\\"Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Fonts\\\" \\\"Kalpurush (TrueType)\\\""
+ "Delete \\\"$FONTS\\\\kalpurush.ttf\\\""
+ # See install block: /TIMEOUT avoids the blocking-broadcast hang.
+ "SendMessage 0xFFFF 0x001D 0 0 /TIMEOUT=1000"
+ )
+
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|x86_64")
+ list(APPEND _nsis_install_commands
+ # Register 32-bit IME DLL (use $SYSDIR which is SysWOW64 in 32-bit NSIS)
+ "ExecWait '\\\"$SYSDIR\\\\regsvr32.exe\\\" /s \\\"$INSTDIR\\\\openbangla_x86.dll\\\"' $0"
+ "\\\${If} $0 <> 0"
+ " MessageBox MB_OK|MB_ICONEXCLAMATION \\\"Failed to register the 32-bit IME module (error code: $0). The keyboard may not work in 32-bit applications.\\\""
+ "\\\${EndIf}"
+ )
+ list(INSERT _nsis_uninstall_commands 0
+ # Unregister 32-bit IME DLL
+ "ExecWait '\\\"$SYSDIR\\\\regsvr32.exe\\\" /s /u \\\"$INSTDIR\\\\openbangla_x86.dll\\\"'"
+ )
+ endif()
+
+ string(REPLACE ";" "\n " _nsis_install_str "${_nsis_install_commands}")
+ string(REPLACE ";" "\n " _nsis_uninstall_str "${_nsis_uninstall_commands}")
+ set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " ${_nsis_install_str}")
+ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS " ${_nsis_uninstall_str}")
+endif()
+
+# Set package filename after CPACK_PACKAGE_NAME is defined (Linux only)
+if(OS_LINUX)
+ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}-$ENV{DIST}$ENV{ARCH_SUFFIX}")
+endif()
+
include(CPack)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..99502ec9
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,53 @@
+# Contributing to OpenBangla Keyboard (OBK)
+
+Thank you for your interest in contributing to OpenBangla Keyboard! We welcome contributions of all kinds, whether it's code, documentation, bug reports, feature requests, or helping fellow contributors.
+
+Please take a moment to review this guide before submitting your contribution.
+
+## Code of Conduct
+
+We expect all contributors to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it carefully and ensure you understand and agree to its terms.
+
+## How Can I Contribute?
+
+There are many ways you can contribute to this project:
+
+### Reporting Bugs
+
+If you encounter a bug, please help us by submitting a detailed issue. When reporting a bug, please include:
+
+- **A clear and descriptive title** for the issue.
+- **Steps to reproduce the bug** as precisely as possible.
+- **What you expected to happen** instead of the actual outcome.
+- **Any relevant environment information**, such as your operating system, software versions, and any specific configurations.
+- **If possible, include any error messages or screenshots** that might be helpful.
+
+### Suggesting Enhancements
+
+We are always open to suggestions for new features and improvements. When suggesting an enhancement, please consider:
+
+- **Clearly describe the proposed enhancement** and its benefits.
+- **Explain the use case** and why you believe this enhancement would be valuable.
+- **If possible, suggest how the enhancement might be implemented.**
+- **Check if a similar feature request already exists** before creating a new one.
+
+### Contributing Code or Documentation
+
+If you'd like to contribute code or documentation, please follow these steps:
+
+1. **Fork the repository** on your GitHub account
+2. **Clone your fork** to your local machine
+3. **Create a new branch** for your changes and choose a descriptive name (e.g., feature/smth, fix/smth)
+4. **Make your changes** and ensure your code follows the project's coding style (if applicable)
+5. **Add your changes** to Git
+6. **Commit your changes** with a clear and concise commit message. It's highly encouraged follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages which will help us to auto-generate `CHANGELOG.md`
+7. **Push your branch** to your fork on GitHub
+8. **Create a Pull Request (PR)** targeting OBK's `develop` branch and while creating your PR, it's highly appreciated if you follow [Semantic PR](https://pulsar.apache.org/contribute/develop-semantic-title/) conventions
+
+> NOTE: All documentation for OBK will be managed in the [OpenBangla/manual](https://github.com/OpenBangla/manual) repository. Its contribution guidelines are the preferred and prioritized source for documentation contributions.
+
+## Questions?
+
+If you have any questions about contributing, feel free to ask in [GitHub Discussions](https://github.com/OpenBangla/OpenBangla-Keyboard/discussions)!
+
+Thank you again for your contribution! We appreciate your time and effort in making OBK better.
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..39af4eda
--- /dev/null
+++ b/README.md
@@ -0,0 +1,178 @@
+# OpenBangla Keyboard — PR #475 (New UI/UX) + EN/বাং Toggle Button
+
+> This fork's `master` contains upstream PR #475 (`new-design`) **plus** a
+> TopBar/tray **EN ⇄ বাং language toggle button**, built and tested on
+> **Linux Mint 22.3** (Ubuntu 24.04 Noble base, Cinnamon, X11).
+> Upstream docs were moved intact to `UPSTREAM-README.adoc`
+> (Bengali: `UPSTREAM-README-BN.adoc`).
+
+## What's in this fork
+
+- **Base:** upstream PR #475 `new-design` branch (new Settings dialog, dynamic
+ Layout Viewer, layout JSON v3) — built as version 3.0.0 with the IBus backend.
+- **Added:** TopBar + system-tray **EN ⇄ বাং toggle button**
+ (`src/frontend/TopBar.{h,cpp,ui}`) — click to switch Bangla/English.
+- **Below:** full step-by-step notes of everything done on the Mint machine
+ (build fixes, crash fix, hotkey investigation).
+
+## What was fixed
+
+1. **Build failure (Rust too old):** Ubuntu Noble's Rust 1.75 can't parse this
+ branch's lockfile-v4 `Cargo.lock` → installed Rust 1.98 via rustup.
+2. **Engine crash on startup:** stale 2.0.0 setting pointed `layout/path` at the
+ on-disk `avrophonetic.json`, which the new engine misreads as a *fixed*
+ layout → `unwrap()` panic in `riti/src/fixed/method.rs:109`. Fixed by using
+ the built-in id `avro_phonetic` (details in §3 below).
+3. **No way to switch language by key:** IBus's own hotkeys never fire on this
+ system, and Cinnamon was grabbing `Super+Space` for an input list that
+ didn't include OpenBangla. Fixed with Cinnamon-native switching
+ (`('ibus', 'OpenBangla')` source + `Super+Space`/`F12` binding, details in §4).
+4. **NumLock breaks combo hotkeys:** with NumLock ON, Cinnamon ignores
+ `Super+Space`/`Ctrl+Space` — covered by adding single-key `F12`.
+5. **Toggle button one-way bug:** `QAbstractButton::setChecked()` is a no-op on
+ non-checkable buttons, so Bangla→English never worked. Fixed with
+ `checkable=true` + reading the clicked state as the desired state.
+6. **This README was invisible:** GitHub renders `README.adoc` over
+ `README.md`, so upstream docs were moved intact to `UPSTREAM-README*.adoc`.
+
+## Setup notes (Linux Mint 22.3)
+
+Environment: **Linux Mint 22.3 Zena** (Ubuntu 24.04 Noble base), **Cinnamon**, X11, x86_64.
+
+### 1. Removed `ibus-avro`, installed OpenBangla Keyboard 2.0.0
+
+```bash
+sudo apt remove -y ibus-avro
+wget https://github.com/OpenBangla/OpenBangla-Keyboard/releases/download/2.0.0/OpenBangla-Keyboard_2.0.0-ubuntu24.04.deb -O /tmp/OpenBangla.deb
+sudo apt install -y /tmp/OpenBangla.deb
+```
+
+IBus settings were reset/adjusted along the way:
+
+```bash
+gsettings set org.freedesktop.ibus.general preload-engines "['xkb:us::eng', 'OpenBangla']"
+gsettings set org.freedesktop.ibus.panel show 2 # always show floating panel
+gsettings set org.freedesktop.ibus.panel show-im-name true
+```
+
+TopBar autostart entry created at `~/.config/autostart/openbangla-keyboard.desktop`
+so the floating TopBar survives reboots.
+
+### 2. Built and installed PR #475 — “New UI/UX Design”
+
+PR: `OpenBangla/OpenBangla-Keyboard#475` (open, branch `new-design` @ `1eca2da`,
+6 commits: Settings dialog redesign, Layout Viewer redesign, layout JSON v3, …).
+
+```bash
+git clone --recursive https://github.com/OpenBangla/OpenBangla-Keyboard.git /tmp/openbangla-pr475
+cd /tmp/openbangla-pr475
+git fetch origin pull/475/head:pr475 && git checkout pr475
+git submodule update --init --recursive
+```
+
+Build dependencies (same as CI, IBus-only):
+
+```bash
+sudo apt-get install -y build-essential clang cmake libibus-1.0-dev \
+ libzstd-dev qtbase5-dev qtbase5-dev-tools libqt5svg5-dev pkg-config
+```
+
+**Gotcha — Rust too old:** Ubuntu Noble ships Rust **1.75**, but this branch's
+`src/platform/Cargo.lock` uses lockfile **v4** (needs Cargo ≥ 1.78), so CMake
+failed with `failed to parse lock file`. Fixed by installing stable Rust via rustup
+(1.98) and putting `$HOME/.cargo/bin` first on `PATH`.
+
+Configure / build / install (same flags as upstream CI, IBus backend):
+
+```bash
+export PATH="$HOME/.cargo/bin:$PATH"
+cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_IBUS=ON -DCMAKE_INSTALL_PREFIX=/usr
+cmake --build build -j$(nproc)
+sudo cmake --install build
+```
+
+Result: version **3.0.0**, GUI at `/usr/bin/openbangla-gui`,
+engine at `/usr/libexec/ibus-engine-openbangla`.
+
+### 3. Fixed engine crash on startup (stale 2.0.0 setting)
+
+Symptom: `ibus engine OpenBangla` timed out (`Set global engine failed`);
+running the engine manually showed a Rust panic:
+
+```
+panicked at src/fixed/method.rs:109:66: called `Option::unwrap()` on a `None` value
+```
+
+Root cause: the old 2.0.0 user setting `~/.config/OpenBangla/Keyboard.conf`
+still pointed `layout/path` at the on-disk `avrophonetic.json`. The new engine
+treats **any file path as a fixed layout**, so the phonetic JSON failed
+`FixedMethod`'s flat-map parse → `None` → `unwrap()` panic.
+
+Fix: point the setting at the built-in id instead:
+
+```ini
+[layout]
+name=Avro Phonetic
+path=avro_phonetic
+```
+
+### 4. Language-switching investigation (the deep part)
+
+Goal: switch Bangla ⇄ English with a keypress.
+
+Findings, each verified with `xdotool`-synthesized keys and `ibus engine` reads:
+
+1. **IBus's own hotkeys are dead on this system.** Neither `triggers`
+ (`Ctrl+Space`) nor `next-engine` (`Super+Space`, then `F12`) ever fired —
+ even with a fresh daemon and NumLock off. A `python-xlib` grab test proved
+ XTEST events *do* trigger X grabs here, so the test method was valid; the
+ IBus hotkey path itself never reacts.
+2. **Cinnamon-native switching works.** Added the engine to Cinnamon's own
+ sources so Cinnamon drives the switch (this is the correct integration
+ for Cinnamon anyway):
+
+ ```bash
+ gsettings set org.cinnamon.desktop.input-sources sources "[('xkb', 'us'), ('ibus', 'OpenBangla')]"
+ ```
+
+3. **NumLock quirk:** with NumLock ON, Cinnamon ignores `Super+Space` (and
+ `Ctrl+Space`) combos; a single key (`F12`) works in every NumLock state.
+ Final binding covers both:
+
+ ```bash
+ gsettings set org.cinnamon.desktop.keybindings.wm switch-input-source "['space', 'F12']"
+ ```
+
+ (`Super+Space` was also freed from Cinnamon earlier and later restored as
+ part of this binding; IBus `next-engine` was left at its default
+ `Alt+Shift_L` to avoid conflicts.)
+4. Note: `ibus engine OpenBangla` prints success state correctly but **exits 1**
+ even when the switch completes (slow `EngineChanged` signal?), so scripts
+ must check `ibus engine` output, not the exit code.
+
+Working result: `F12` toggles EN ⇄ বাং reliably; `Win+Space` works when
+NumLock is off.
+
+### 5. EN/বাং toggle button (feature commit on top of PR #475)
+
+Files changed: `src/frontend/TopBar.{h,cpp,ui}` (+112 lines).
+
+- TopBar widened 260 → 314 px with a 6th button showing **বাং** (highlighted)
+ when the `OpenBangla` engine is active, **EN** otherwise.
+- The button polls `ibus engine` once a second (pausing 1.5 s right after a
+ manual toggle so the in-flight switch isn't misread) and hides itself when
+ no `ibus` helper exists (e.g. Fcitx-only builds).
+- The tray menu gained a checkable **“Bangla (বাংলা)”** item wired to the
+ same switch.
+- Lesson learned: `QAbstractButton::setChecked()` is a **no-op on
+ non-checkable buttons** — the button must be `checkable=true`, and then
+ `clicked()` already carries the desired state.
+- Verified end-to-end by clicking the real TopBar with `xdotool` at its
+ on-screen coordinates and reading `ibus engine` both ways
+ (plus `strace` confirming click → `ibus engine …` execution).
+
+### 6. Current working config recap (Mint/Cinnamon)
+
+- IBus preload: `['xkb:us::eng', 'OpenBangla']`, panel always shown.
+- Cinnamon sources include `('ibus', 'OpenBangla')`; switch keys `Super+Space` + `F12`.
+- TopBar autostarted from `/usr/bin/openbangla-gui`.
diff --git a/README.bn.adoc b/UPSTREAM-README-BN.adoc
similarity index 97%
rename from README.bn.adoc
rename to UPSTREAM-README-BN.adoc
index 887aa00d..d9ea320d 100644
--- a/README.bn.adoc
+++ b/UPSTREAM-README-BN.adoc
@@ -78,17 +78,15 @@ bash -c "$(wget -q https://raw.githubusercontent.com/OpenBangla/OpenBangla-Keybo
=== আর্চলিনাক্স ভিত্তিক ডিস্ট্রো
TIP: আর্চ লিনাক্সে ওপেনবাংলা কীবোর্ড ইনস্টল করার বিষয়ে একটি ভিডিও টিউটোরিয়াল রয়েছে। আপনি এটি https://youtu.be/C8vnR1AY6sA[এখান] থেকে দেখতে পারেন।
-Arch User Repository(AUR) তে ওপেনবাংলা কিবোর্ডের দুটো প্যাকেজ রয়েছে। `openbangla-keyboard` ব্যবহার করুন যদি আপনি সোর্স থেকে প্যাকেজটি তৈরি এবং ইন্সটল করতে চান। অথবা `openbangla-keyboard-bin` ব্যবহার করুন যদি আপনি বাইনারি প্যাকেজটি ব্যবহার করতে চান যেটি আর্চলিনাক্স ভিত্তিক ডিস্ট্রো গুলোর জন্য প্যাকেজটির মেইন্টেইনার তৈরি করেছেন। আপনি আপনার পছন্দের AUR হেল্পার ব্যবহার করে একটি কম্যান্ডের মাধ্যমেই ইন্সটল করতে পারবেন। কিছু জনপ্রিয় টুলের উদাহরণ:
+Arch User Repository(AUR) তে ওপেনবাংলা কিবোর্ডের দুটো প্যাকেজ রয়েছে। `openbangla-keyboard` ব্যবহার করুন যদি আপনি সোর্স থেকে প্যাকেজটি তৈরি এবং ইন্সটল করতে চান। অথবা `openbangla-keyboard-bin` ব্যবহার করুন যদি আপনি বাইনারি প্যাকেজটি ব্যবহার করতে চান যেটি আর্চলিনাক্স ভিত্তিক ডিস্ট্রো গুলোর জন্য প্যাকেজটির মেইন্টেইনার তৈরি করেছেন। আপনি আপনার পছন্দের AUR হেল্পার ব্যবহার করে একটি কম্যান্ডের মাধ্যমেই ইন্সটল করতে পারবেন। দুইটি জনপ্রিয় AUR হেল্পারের জন্য উদাহরণ:
==== `openbangla-keyboard`
-* `$ pacaur -S openbangla-keyboard`
+* `$ paru -S openbangla-keyboard`
* `$ yay -S openbangla-keyboard`
-* `$ yaourt -S openbangla-keyboard`
==== `openbangla-keyboard-bin`
-* `$ pacaur -S openbangla-keyboard-bin`
+* `$ paru -S openbangla-keyboard-bin`
* `$ yay -S openbangla-keyboard-bin`
-* `$ yaourt -S openbangla-keyboard-bin`
অথবা ম্যানুয়ালি ইন্সটল করুন:
```bash
@@ -118,11 +116,11 @@ https://github.com/OpenBangla/OpenBangla-Keyboard/discussions[গিটহাব
ওপেনবাংলা কিবোর্ড কম্পাইল তথা সোর্সকোড থেকে বিল্ড করার জন্য বর্তমানে নিম্নোলিখিত ডিপেন্ডেসিগুলো প্রয়োজন:
-* GNU GCC, G++ compiler or Clang
+* GNU GCC 8 (or later) or Clang 7 (or later) compiler
* Rust 1.34.0 or later
* GNU Make or Ninja
* CMake
-* Qt 5.5 or later
+* Qt 5.15 or later
* iBus development library
* Zstandard compression library (zstd)
@@ -176,6 +174,7 @@ sudo make install
* মেহেদী হাসান খান, অভ্র কিবোর্ডের ডেভলপের জন্য।
* রীফাত নবী, অভ্র ফোনেটিক জাভাস্ক্রিপ্টে স্থানান্তর করার জন্য।
* https://github.com/sarim[সারিম খান], আইবাস-অভ্র ডেভলপের জন্য।
+ * https://github.com/dec32[Dec_32], https://github.com/dec32/Ajemi[Ajemi] প্রোজেক্ট ডেভলপের জন্য।
* https://github.com/saaiful[সাইফুল ইসলাম], আইকনের জন্য।
* https://material.io/resources/icons[Material Design Icons].
* https://github.com/alex-spataru/QSimpleUpdater[QSimpleUpdater], হালনাগাদকরণ লাইব্রেরির জন্য।
diff --git a/README.adoc b/UPSTREAM-README.adoc
similarity index 96%
rename from README.adoc
rename to UPSTREAM-README.adoc
index f3171f4c..306c1ea4 100644
--- a/README.adoc
+++ b/UPSTREAM-README.adoc
@@ -79,17 +79,15 @@ If this does not workout for you please create an https://github.com/OpenBangla/
=== Archlinux and it's derivatives
TIP: There is a video tutorial about installing OpenBangla Keyboard in Arch Linux. You may check that out from https://youtu.be/C8vnR1AY6sA[here].
-There are two packages for OpenBangla Keyboard in the Arch User Repository(AUR). Use `openbangla-keyboard` if you want to make and install the package from source. Otherwise, use `openbangla-keyboard-bin` to use the binary package released for Arch and its derivatives by the maintainer. You can install it in one command with your favorite aur helper. Example commands for some popular tools:
+There are two packages for OpenBangla Keyboard in the Arch User Repository(AUR). Use `openbangla-keyboard` if you want to make and install the package from source. Otherwise, use `openbangla-keyboard-bin` to use the binary package released for Arch and its derivatives by the maintainer. You can install it in one command with your favorite aur helper. Example commands for two popular AUR helpers:
==== `openbangla-keyboard`
-* `$ pacaur -S openbangla-keyboard`
+* `$ paru -S openbangla-keyboard`
* `$ yay -S openbangla-keyboard`
-* `$ yaourt -S openbangla-keyboard`
==== `openbangla-keyboard-bin`
-* `$ pacaur -S openbangla-keyboard-bin`
+* `$ paru -S openbangla-keyboard-bin`
* `$ yay -S openbangla-keyboard-bin`
-* `$ yaourt -S openbangla-keyboard-bin`
Or install manually:
```bash
@@ -118,11 +116,11 @@ We are on https://github.com/OpenBangla/OpenBangla-Keyboard/discussions[Github D
OpenBangla Keyboard currently has the following build dependencies:
-* GNU GCC, G++ compiler or Clang
+* GNU GCC 8 (or later) or Clang 7 (or later) compiler
* Rust 1.34.0 or later
* GNU Make or Ninja
* CMake
-* Qt 5.5 or later
+* Qt 5.15 or later
* iBus development library
* Zstandard compression library (zstd)
@@ -176,6 +174,7 @@ sudo make install
* Mehdi Hasan Khan, for originally developing and maintaining Avro Keyboard.
* Rifat Nabi, for porting Avro Phonetic to Javascript.
* https://github.com/sarim[Sarim Khan], for writing ibus-avro.
+ * https://github.com/dec32[Dec_32], for https://github.com/dec32/Ajemi[Ajemi] project.
* https://github.com/saaiful[Saiful Islam], for the icon.
* https://material.io/resources/icons[Material Design Icons].
* https://github.com/alex-spataru/QSimpleUpdater[QSimpleUpdater], for providing update mechanism.
diff --git a/ci-workflows-from-PR475/ci.yml b/ci-workflows-from-PR475/ci.yml
new file mode 100644
index 00000000..a4c9b0b5
--- /dev/null
+++ b/ci-workflows-from-PR475/ci.yml
@@ -0,0 +1,114 @@
+name: CI
+on:
+ push:
+ branches: [ '**' ]
+ tags-ignore: [ '**' ]
+ paths-ignore: [ '**.md', '**.adoc' ]
+ pull_request:
+ branches: [ '**' ]
+ paths-ignore: [ '**.md', '**.adoc' ]
+
+jobs:
+ build-linux:
+ if: contains(github.event.head_commit.message, 'deploy+') == false
+ runs-on: "ubuntu-latest"
+ strategy:
+ matrix:
+ env:
+ - { CXX: g++, CC: gcc, CXX_FOR_BUILD: g++, CC_FOR_BUILD: gcc }
+ - { CXX: clang++, CC: clang, CXX_FOR_BUILD: clang++, CC_FOR_BUILD: clang }
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+ - name: update-system
+ run: sudo apt-get update -qq
+ - name: install-deps
+ run: sudo apt-get -y install build-essential clang cmake rustc cargo libibus-1.0-dev libfcitx5core-dev libzstd-dev qtbase5-dev qtbase5-dev-tools libqt5svg5-dev
+ - name: make
+ env: ${{ matrix.env }}
+ run: |
+ mkdir build
+ cd build
+ cmake .. -DENABLE_BOTH=ON
+ make
+
+ build-windows-x86_64:
+ if: contains(github.event.head_commit.message, 'deploy+') == false
+ runs-on: windows-latest
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: install-qt
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: '5.15.2'
+ arch: win64_msvc2019_64
+
+ - name: install-rust-i686-target
+ run: rustup target add i686-pc-windows-msvc
+
+ - name: build
+ run: |
+ mkdir build
+ cd build
+ cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
+ cmake --build . --config Release
+
+ build-windows-arm:
+ if: contains(github.event.head_commit.message, 'deploy+') == false
+ runs-on: windows-11-arm
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: setup-msys2
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: CLANGARM64
+ install: >-
+ mingw-w64-clang-aarch64-cmake
+ mingw-w64-clang-aarch64-clang
+ mingw-w64-clang-aarch64-ninja
+ mingw-w64-clang-aarch64-qt5-base
+ mingw-w64-clang-aarch64-qt5-svg
+ mingw-w64-clang-aarch64-qt5-tools
+ mingw-w64-clang-aarch64-zstd
+ mingw-w64-clang-aarch64-rust
+
+ - name: build
+ shell: msys2 {0}
+ run: |
+ mkdir build
+ cd build
+ cmake .. -G Ninja
+ cmake --build .
+
+ build-macos:
+ if: contains(github.event.head_commit.message, 'deploy+') == false
+ runs-on: macos-latest
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: install-deps
+ run: brew install cmake qt@5 zstd ninja
+
+ - name: setup-qt
+ run: echo "$(brew --prefix qt@5)/bin" >> $GITHUB_PATH
+
+ - name: build
+ run: |
+ mkdir build
+ cd build
+ cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix qt@5);$(brew --prefix zstd)" -GNinja
+ ninja
+
diff --git a/ci-workflows-from-PR475/deploy.yml b/ci-workflows-from-PR475/deploy.yml
new file mode 100644
index 00000000..88c7070f
--- /dev/null
+++ b/ci-workflows-from-PR475/deploy.yml
@@ -0,0 +1,186 @@
+name: DEPLOY
+
+on:
+ push:
+ branches: [ '**' ]
+ tags-ignore: [ '**' ]
+
+jobs:
+ build:
+ if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
+ strategy:
+ matrix:
+ platform: [ "ubuntu-latest", "ubuntu-24.04-arm" ]
+ # this list should be updated from time to time by consulting these pages:
+ # https://releases.ubuntu.com/
+ # https://wiki.debian.org/DebianReleases#Production_Releases
+ # https://fedoraproject.org/wiki/Releases
+ # https://en.wikipedia.org/wiki/OpenSUSE#Version_history
+ container: [ "ubuntu:22.04", "ubuntu:24.04", "debian:12", "fedora:40", "fedora:41", "opensuse/tumbleweed" ]
+ runs-on: ${{ matrix.platform }}
+ container:
+ image: ${{ matrix.container }}
+ env:
+ DIST: ${{ matrix.container }}
+ DEBIAN_FRONTEND: noninteractive
+ steps:
+ - name: install-git
+ run: |
+ # Install Git based on distro
+ if command -v apt-get >/dev/null; then
+ apt-get update -y
+ apt-get install -y git
+ elif command -v dnf >/dev/null; then
+ dnf install -y git
+ elif command -v zypper >/dev/null; then
+ zypper install -y git
+ elif command -v pacman >/dev/null; then
+ pacman -Sy git --noconfirm
+ fi
+
+ - name: checkout-source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: run-builder
+ shell: bash
+ run: ./tools/build.sh
+
+ - name: Sanitize container name
+ id: sanitizer
+ shell: bash
+ run: |
+ # Replace colons and slashes with dashes
+ SANITIZED_CONTAINER=$(echo "${{ matrix.container }}" | sed 's/[:\\/]/-/g')
+ echo "sanitized_container=$SANITIZED_CONTAINER" >> $GITHUB_OUTPUT
+
+ - name: upload-artifacts
+ uses: actions/upload-artifact@v7
+ with:
+ name: pkg-${{ matrix.platform == 'ubuntu-24.04-arm' && 'arm64' || 'x64' }}-${{ steps.sanitizer.outputs.sanitized_container }}
+ path: artifact
+
+ build-windows:
+ if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
+ runs-on: windows-latest
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: install-qt
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: '5.15.2'
+ arch: win64_msvc2019_64
+
+ - name: install-rust-i686-target
+ run: rustup target add i686-pc-windows-msvc
+
+ - name: install-nsis
+ run: choco install nsis -y
+
+ - name: build-and-package
+ run: |
+ mkdir build
+ cd build
+ cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
+ cmake --build . --config Release
+ cpack -G NSIS -C Release
+
+ - name: upload-artifacts
+ uses: actions/upload-artifact@v7
+ with:
+ name: pkg-windows-x64
+ path: build/OpenBangla-Keyboard-*.exe
+
+ build-windows-arm:
+ if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
+ runs-on: windows-11-arm
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: setup-msys2
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: CLANGARM64
+ install: >-
+ mingw-w64-clang-aarch64-cmake
+ mingw-w64-clang-aarch64-clang
+ mingw-w64-clang-aarch64-ninja
+ mingw-w64-clang-aarch64-qt5-base
+ mingw-w64-clang-aarch64-qt5-svg
+ mingw-w64-clang-aarch64-qt5-tools
+ mingw-w64-clang-aarch64-zstd
+ mingw-w64-clang-aarch64-rust
+
+ - name: install-nsis
+ run: choco install nsis -y
+
+ - name: build-and-package
+ shell: msys2 {0}
+ run: |
+ export PATH="/c/Program Files (x86)/NSIS:$PATH"
+ mkdir build
+ cd build
+ cmake .. -G Ninja
+ cmake --build .
+ cpack -G NSIS
+
+ - name: upload-artifacts
+ uses: actions/upload-artifact@v7
+ with:
+ name: pkg-windows-arm64
+ path: build/OpenBangla-Keyboard-*.exe
+
+ merge:
+ needs: [build, build-windows, build-windows-arm]
+ runs-on: ubuntu-latest
+ steps:
+ - name: merge-artifacts
+ uses: actions/upload-artifact/merge@v7
+ with:
+ name: packages
+ pattern: pkg-*
+ delete-merged: true
+
+ release:
+ if: contains(github.event.head_commit.message, 'deploy+')
+ needs: merge
+ runs-on: "ubuntu-latest"
+ steps:
+ - name: checkout-source
+ uses: actions/checkout@v5
+
+ - name: get-version
+ id: get_version
+ shell: bash
+ run: |
+ RELEASE_VERSION=$(cat version.txt | head -n1)
+ echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
+
+ - name: download-artifacts
+ uses: actions/download-artifact@v7
+ with:
+ name: packages
+ path: artifacts
+
+ - name: create-release
+ id: create_release
+ uses: ncipollo/release-action@v1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ tag: ${{ steps.get_version.outputs.RELEASE_VERSION }}
+ name: ${{ steps.get_version.outputs.RELEASE_VERSION }}
+ artifacts: "artifacts/*"
+ allowUpdates: true
+ draft: true
+ body: |
+ []()
+ ### Changes in this release:
+ - ...
diff --git a/cmake/AddSwift.cmake b/cmake/AddSwift.cmake
new file mode 100644
index 00000000..099273fd
--- /dev/null
+++ b/cmake/AddSwift.cmake
@@ -0,0 +1,78 @@
+# This source file is part of the Swift open source project
+#
+# Copyright (c) 2023 Apple Inc. and the Swift project authors.
+# Licensed under Apache License v2.0 with Runtime Library Exception
+#
+# See https://swift.org/LICENSE.txt for license information
+
+
+# Generate the bridging header from Swift to C++
+#
+# target: the name of the target to generate headers for.
+# This target must build swift source files.
+# header: the name of the header file to generate.
+#
+# NOTE: This logic will eventually be unstreamed into CMake.
+function(_swift_generate_cxx_header target header)
+ if(NOT TARGET ${target})
+ message(FATAL_ERROR "Target ${target} not defined.")
+ endif()
+
+ if(NOT DEFINED CMAKE_Swift_COMPILER)
+ message(WARNING "Swift not enabled in project. Cannot generate headers for Swift files.")
+ return()
+ endif()
+
+ cmake_parse_arguments(ARG "" "" "SEARCH_PATHS;MODULE_NAME" ${ARGN})
+
+ if(NOT ARG_MODULE_NAME)
+ set(target_module_name $)
+ set(ARG_MODULE_NAME $,${target_module_name},${target}>)
+ endif()
+
+ if(ARG_SEARCH_PATHS)
+ list(TRANSFORM ARG_SEARCH_PATHS PREPEND "-I")
+ endif()
+
+ if(APPLE AND CMAKE_OSX_SYSROOT)
+ set(SDK_FLAGS "-sdk" "${CMAKE_OSX_SYSROOT}")
+ elseif(WIN32)
+ set(SDK_FLAGS "-sdk" "$ENV{SDKROOT}")
+ elseif(CMAKE_SYSROOT)
+ set(SDK_FLAGS "-sdk" "${CMAKE_SYSROOT}")
+ endif()
+
+ cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR include
+ OUTPUT_VARIABLE base_path)
+
+ cmake_path(APPEND base_path ${header}
+ OUTPUT_VARIABLE header_path)
+
+ cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR "${ARG_MODULE_NAME}.emit-module.d" OUTPUT_VARIABLE depfile_path)
+
+ set(_AllSources $,${CMAKE_CURRENT_SOURCE_DIR}>)
+ set(_SwiftSources $)
+ add_custom_command(OUTPUT ${header_path}
+ DEPENDS ${_SwiftSources}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${CMAKE_Swift_COMPILER} -typecheck
+ ${ARG_SEARCH_PATHS}
+ ${_SwiftSources}
+ ${SDK_FLAGS}
+ -module-name "${ARG_MODULE_NAME}"
+ -cxx-interoperability-mode=default
+ -emit-clang-header-path ${header_path}
+ -emit-dependencies
+ DEPFILE "${depfile_path}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT
+ "Generating '${header_path}'"
+ COMMAND_EXPAND_LISTS)
+
+ # Added to public interface for dependees to find.
+ target_include_directories(${target} PUBLIC ${base_path})
+ # Added to the target to ensure target rebuilds if header changes and is used
+ # by sources in the target.
+ target_sources(${target} PRIVATE ${header_path})
+endfunction()
diff --git a/cmake/BundleMingwDeps.cmake b/cmake/BundleMingwDeps.cmake
new file mode 100644
index 00000000..f7115ada
--- /dev/null
+++ b/cmake/BundleMingwDeps.cmake
@@ -0,0 +1,50 @@
+# Bundle the MSYS2 / Clang runtime and Qt third-party dependency DLLs that
+# windeployqt does not copy (libc++, libunwind, libwinpthread, and Qt's own
+# deps such as libpng, pcre2, harfbuzz, freetype, zlib, ...). Without these the
+# installed executable fails to start outside an MSYS2 shell.
+#
+# Invoked via install(SCRIPT), so CMAKE_INSTALL_PREFIX is available here.
+# Runs inside the MSYS2 shell, where ldd, awk and cygpath are present.
+
+find_program(_obk_ldd ldd)
+find_program(_obk_cygpath cygpath)
+if(NOT _obk_ldd OR NOT _obk_cygpath)
+ message(WARNING "ldd/cygpath not found; skipping MSYS2 runtime DLL bundling")
+ return()
+endif()
+
+set(_obk_exe "${CMAKE_INSTALL_PREFIX}/openbangla-gui.exe")
+
+execute_process(
+ COMMAND "${_obk_ldd}" "${_obk_exe}"
+ OUTPUT_VARIABLE _obk_ldd_out
+ RESULT_VARIABLE _obk_ldd_res)
+if(NOT _obk_ldd_res EQUAL 0)
+ message(WARNING "ldd failed on ${_obk_exe}; skipping runtime DLL bundling")
+ return()
+endif()
+
+string(REPLACE "\n" ";" _obk_lines "${_obk_ldd_out}")
+foreach(_obk_line IN LISTS _obk_lines)
+ # ldd lines look like: " => (0x...)"
+ if(NOT _obk_line MATCHES "=> (/[^ ]+) \\(")
+ continue()
+ endif()
+ set(_obk_dep "${CMAKE_MATCH_1}")
+
+ # Skip Windows system DLLs; bundle everything else (the MSYS2 prefix libs).
+ string(TOLOWER "${_obk_dep}" _obk_dep_lower)
+ if(_obk_dep_lower MATCHES "/windows/|/system32/|/syswow64/")
+ continue()
+ endif()
+
+ # Translate the MSYS2 path (e.g. /clangarm64/bin/libc++.dll) into a Windows
+ # path so the native CMake file(INSTALL) can read it.
+ execute_process(
+ COMMAND "${_obk_cygpath}" -w "${_obk_dep}"
+ OUTPUT_VARIABLE _obk_win
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(EXISTS "${_obk_win}")
+ file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}" TYPE SHARED_LIBRARY FILES "${_obk_win}")
+ endif()
+endforeach()
diff --git a/cmake/CMakeCargo.cmake b/cmake/CMakeCargo.cmake
deleted file mode 100644
index cf952171..00000000
--- a/cmake/CMakeCargo.cmake
+++ /dev/null
@@ -1,65 +0,0 @@
-function(cargo_build)
- cmake_parse_arguments(CARGO "" "NAME" "" ${ARGN})
- string(REPLACE "-" "_" LIB_NAME ${CARGO_NAME})
-
- set(CARGO_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
-
- execute_process(COMMAND ${RUSTC_EXECUTABLE} --version --verbose OUTPUT_VARIABLE LIB_TARGET OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX MATCH "[a-z][a-z0-9_]+-[a-z0-9]+(-[a-z0-9]+)+" LIB_TARGET "${LIB_TARGET}")
- message(STATUS "Rust Compiler Target: ${LIB_TARGET}")
-
- if(ANDROID)
- if(ANDROID_SYSROOT_ABI STREQUAL "x86")
- set(LIB_TARGET "i686-linux-android")
- elseif(ANDROID_SYSROOT_ABI STREQUAL "x86_64")
- set(LIB_TARGET "x86_64-linux-android")
- elseif(ANDROID_SYSROOT_ABI STREQUAL "arm")
- set(LIB_TARGET "arm-linux-androideabi")
- elseif(ANDROID_SYSROOT_ABI STREQUAL "arm64")
- set(LIB_TARGET "aarch64-linux-android")
- endif()
- endif()
-
- if(CMAKE_CROSSCOMPILING)
- # Get target triple from environment
- if(DEFINED ENV{RUST_TARGET}) # For Void Linux
- set(LIB_TARGET $ENV{RUST_TARGET})
- endif()
- endif()
-
- if(NOT CMAKE_BUILD_TYPE)
- set(LIB_BUILD_TYPE "debug")
- elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
- set(LIB_BUILD_TYPE "release")
- else()
- set(LIB_BUILD_TYPE "debug")
- endif()
-
- set(LIB_FILE "${CARGO_TARGET_DIR}/${LIB_TARGET}/${LIB_BUILD_TYPE}/${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-
- if(IOS)
- set(CARGO_ARGS "lipo")
- else()
- set(CARGO_ARGS "build")
- list(APPEND CARGO_ARGS "--target" ${LIB_TARGET})
- endif()
-
- if(${LIB_BUILD_TYPE} STREQUAL "release")
- list(APPEND CARGO_ARGS "--release")
- endif()
-
- file(GLOB_RECURSE LIB_SOURCES "*.rs")
-
- set(CARGO_ENV_COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${CARGO_TARGET_DIR}")
-
- add_custom_command(
- OUTPUT ${LIB_FILE}
- COMMAND ${CARGO_ENV_COMMAND} ${CARGO_EXECUTABLE} ARGS ${CARGO_ARGS}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS ${LIB_SOURCES}
- COMMENT "running cargo")
- add_custom_target(${CARGO_NAME}_target ALL DEPENDS ${LIB_FILE})
- add_library(${CARGO_NAME} STATIC IMPORTED GLOBAL)
- add_dependencies(${CARGO_NAME} ${CARGO_NAME}_target)
- set_target_properties(${CARGO_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_FILE})
-endfunction()
\ No newline at end of file
diff --git a/cmake/CMakeDetermineRustCompiler.cmake b/cmake/CMakeDetermineRustCompiler.cmake
deleted file mode 100644
index 6d481529..00000000
--- a/cmake/CMakeDetermineRustCompiler.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-
-if(NOT CMAKE_Rust_COMPILER)
- find_package(Rust)
- if(RUST_FOUND)
- set(CMAKE_Rust_COMPILER "${RUSTC_EXECUTABLE}")
- set(CMAKE_Rust_COMPILER_ID "Rust")
- set(CMAKE_Rust_COMPILER_VERSION "${RUST_VERSION}")
- set(CMAKE_Rust_PLATFORM_ID "Rust")
- endif()
-endif()
-
-message(STATUS "Cargo Home: ${CARGO_HOME}")
-message(STATUS "Rust Compiler Version: ${RUSTC_VERSION}")
-
-mark_as_advanced(CMAKE_Rust_COMPILER)
-
-if(CMAKE_Rust_COMPILER)
- set(CMAKE_Rust_COMPILER_LOADED 1)
-endif(CMAKE_Rust_COMPILER)
-
-configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeRustCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${CMAKE_VERSION}/CMakeRustCompiler.cmake IMMEDIATE @ONLY)
-
-set(CMAKE_Rust_COMPILER_ENV_VAR "RUSTC")
-
diff --git a/cmake/CMakeRustCompiler.cmake.in b/cmake/CMakeRustCompiler.cmake.in
deleted file mode 100644
index 5916c1c3..00000000
--- a/cmake/CMakeRustCompiler.cmake.in
+++ /dev/null
@@ -1,15 +0,0 @@
-
-set(CMAKE_Rust_COMPILER "@CMAKE_Rust_COMPILER@")
-set(CMAKE_Rust_COMPILER_ID "@CMAKE_Rust_COMPILER_ID@")
-set(CMAKE_Rust_COMPILER_VERSION "@CMAKE_Rust_COMPILER_VERSION@")
-set(CMAKE_Rust_COMPILER_LOADED @CMAKE_Rust_COMPILER_LOADED@)
-set(CMAKE_Rust_PLATFORM_ID "@CMAKE_Rust_PLATFORM_ID@")
-
-SET(CMAKE_Rust_SOURCE_FILE_EXTENSIONS rs)
-SET(CMAKE_Rust_LINKER_PREFERENCE 40)
-#SET(CMAKE_Rust_OUTPUT_EXTENSION_REPLACE 1)
-SET(CMAKE_STATIC_LIBRARY_PREFIX_Rust "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX_Rust .a)
-
-set(CMAKE_Rust_COMPILER_ENV_VAR "RUSTC")
-
diff --git a/cmake/CMakeRustInformation.cmake b/cmake/CMakeRustInformation.cmake
deleted file mode 100644
index 05d96c94..00000000
--- a/cmake/CMakeRustInformation.cmake
+++ /dev/null
@@ -1,106 +0,0 @@
-
-#
-# Usage: rustc [OPTIONS] INPUT
-#
-# Options:
-# -h --help Display this message
-# --cfg SPEC Configure the compilation environment
-# -L [KIND=]PATH Add a directory to the library search path. The
-# optional KIND can be one of dependency, crate, native,
-# framework or all (the default).
-# -l [KIND=]NAME Link the generated crate(s) to the specified native
-# library NAME. The optional KIND can be one of static,
-# dylib, or framework. If omitted, dylib is assumed.
-# --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|metadata]
-# Comma separated list of types of crates for the
-# compiler to emit
-# --crate-name NAME Specify the name of the crate being built
-# --emit [asm|llvm-bc|llvm-ir|obj|link|dep-info]
-# Comma separated list of types of output for the
-# compiler to emit
-# --print [crate-name|file-names|sysroot|cfg|target-list|target-cpus|target-features|relocation-models|code-models]
-# Comma separated list of compiler information to print
-# on stdout
-# -g Equivalent to -C debuginfo=2
-# -O Equivalent to -C opt-level=2
-# -o FILENAME Write output to
-# --out-dir DIR Write output to compiler-chosen filename in
-# --explain OPT Provide a detailed explanation of an error message
-# --test Build a test harness
-# --target TARGET Target triple for which the code is compiled
-# -W --warn OPT Set lint warnings
-# -A --allow OPT Set lint allowed
-# -D --deny OPT Set lint denied
-# -F --forbid OPT Set lint forbidden
-# --cap-lints LEVEL Set the most restrictive lint level. More restrictive
-# lints are capped at this level
-# -C --codegen OPT[=VALUE]
-# Set a codegen option
-# -V --version Print version info and exit
-# -v --verbose Use verbose output
-#
-# Additional help:
-# -C help Print codegen options
-# -W help Print 'lint' options and default settings
-# -Z help Print internal options for debugging rustc
-# --help -v Print the full set of options rustc accepts
-#
-
-#