OpenHarmony: file selection

This commit is contained in:
Coder2 2025-11-01 20:48:38 +08:00
parent a48cde983f
commit 9f5452fe86
No known key found for this signature in database
GPG key ID: 98C112D1F699AA4C
4 changed files with 79 additions and 12 deletions

View file

@ -11,6 +11,8 @@
#include "napi/native_api.h"
#include "SDL3/SDL_log.h"
#include "SDL3/SDL_hints.h"
#include "SDL3/SDL_power.h"
#include "SDL3/SDL_dialog.h"
#include <GLES2/gl2.h>
#include <stdlib.h>
#include <thread>
@ -18,6 +20,7 @@
#include <vulkan/vulkan_core.h>
#include <ohaudio/native_audiorenderer.h>
#include <ohaudio/native_audiostreambuilder.h>
#include <fstream>
static napi_value Add(napi_env env, napi_callback_info info)
{
@ -119,8 +122,6 @@ int main()
SDL_Log("sdl error: %s", SDL_GetError());
SDL_Window* win = SDL_CreateWindow("test", 1024, 1024, SDL_WINDOW_OPENGL);
SDL_OpenURL("https://bilibili.com");
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "SDL Application", "test!", win);
SDL_StartTextInput(win);
// SDL_StopTextInput();

View file

@ -2,4 +2,7 @@ export const sdlCallbackInit: (d) => void;
export const sdlLaunchMain: (lib: string, func: string) => number;
export const sdlKeyEvent: (scancode: number, type: number) => number;
export const sdlTextAppend: (str: string) => number;
export const sdlTextEditing: (str: string, loc: number, length: number) => number;
export const sdlTextEditing: (str: string, loc: number, length: number) => number;
export const sdlDialogExecCallback: () => void;
export const sdlDialogClearSelection: () => void;
export const sdlDialogFileSelected: (path: string) => void;