FCT
载入中...
搜索中...
未找到
Android_UICommon.h
浏览该文件的文档.
1//
2// Created by Administrator on 2025/2/27.
3//
4#pragma once
5#include "../ThirdParty.h"
6
7#ifndef ANDROID_UICOMMON_H
8#define ANDROID_UICOMMON_H
9namespace FCT {
10 using UITaskFunction = std::function<void(void *)>;
11
12 struct UiTaskData {
14 void *param;
15 std::shared_ptr<bool> waiting;
16 };
17
19 public:
20
21 void preinit();
22 void cleanup();
23 void postUiTask(UITaskFunction task,void* param = nullptr,bool waited = true);
24 private:
25 void processUiTask(int fd);
26 ALooper* m_uiLooper;
28 static int looperWork(int fd, int events, void *data);
29 };
30}
31#endif //ANDROID_UICOMMON_H
static int looperWork(int fd, int events, void *data)
void postUiTask(UITaskFunction task, void *param=nullptr, bool waited=true)
std::function< void(void *)> UITaskFunction
std::shared_ptr< bool > waiting