mirror of
https://github.com/NohamR/RMHook.git
synced 2026-04-08 07:59:58 +00:00
Add native HTTP server, CLI scripts and docs
Implement a native macOS HTTP server for RMHook and wire it into the app. Adds HttpServer.h/.mm (CFSocket-based) with start/stop/isRunning APIs, broadcasts incoming POST /exportFile and /documentAccepted requests to the QML MessageBroker, and starts the server on port 8080 from reMarkable.m. Update CMakeLists to include HttpServer.mm and link Qt Qml when building qmlrebuild mode. Add documentation (docs/HTTP_SERVER.md) and QML snippets for MessageBroker integration, plus Python helper scripts (scripts/http_server.py and scripts/test_http_server.py) for invoking the endpoints. Also add small MessageBroker examples (src/utils/mb.m, src/utils/mb.qml) and update ResourceUtils to include additional QML resources.
This commit is contained in:
@@ -114,13 +114,24 @@ endif()
|
||||
if(BUILD_MODE_QMLREBUILD)
|
||||
target_compile_definitions(reMarkable PRIVATE BUILD_MODE_QMLREBUILD=1)
|
||||
|
||||
# Enable Qt MOC for MessageBroker
|
||||
# Enable Qt MOC for MessageBroker (HttpServer is pure Obj-C/Foundation, no MOC needed)
|
||||
set_target_properties(reMarkable PROPERTIES AUTOMOC ON)
|
||||
|
||||
# Add MessageBroker source (needs MOC processing)
|
||||
# Add MessageBroker (needs MOC) and HttpServer (native macOS)
|
||||
target_sources(reMarkable PRIVATE
|
||||
${PROJECT_ROOT_DIR}/src/utils/MessageBroker.mm
|
||||
${PROJECT_ROOT_DIR}/src/utils/HttpServer.mm
|
||||
)
|
||||
|
||||
find_package(Qt6 COMPONENTS Qml QUIET)
|
||||
if(Qt6Qml_FOUND)
|
||||
target_link_libraries(reMarkable PRIVATE Qt6::Qml)
|
||||
else()
|
||||
find_package(Qt5 COMPONENTS Qml QUIET)
|
||||
if(Qt5Qml_FOUND)
|
||||
target_link_libraries(reMarkable PRIVATE Qt5::Qml)
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "Build mode: qmlrebuild (resource hooking)")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user