* Pure C++ UI Data Export Function * Exports UI changes as JSON for JavaScript processing */
| 231 | * Exports UI changes as JSON for JavaScript processing |
| 232 | */ |
| 233 | EMSCRIPTEN_KEEPALIVE void* getUiUpdateData(int* dataSize) { |
| 234 | // Export basic UI update structure |
| 235 | fl::json doc = fl::json::object(); |
| 236 | doc.set("event", "ui_update"); |
| 237 | doc.set("timestamp", static_cast<int>(fl::millis())); |
| 238 | |
| 239 | fl::string jsonBuffer = doc.to_string(); |
| 240 | |
| 241 | // Allocate and return data pointer |
| 242 | char* buffer = (char*)fl::malloc(jsonBuffer.length() + 1); |
| 243 | fl::strcpy(buffer, jsonBuffer.c_str()); |
| 244 | *dataSize = jsonBuffer.length(); |
| 245 | |
| 246 | return buffer; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Canvas Size Setting Function - Push-based notification to JavaScript |