Files
tp/include/f_pc/f_pc_manager.h
T

103 lines
3.3 KiB
C
Raw Normal View History

2021-04-01 12:06:29 +02:00
#ifndef F_PC_MANAGER_H_
#define F_PC_MANAGER_H_
2021-03-28 22:49:05 +02:00
2021-04-01 12:06:29 +02:00
#include "f_pc/f_pc_create_iter.h"
#include "f_pc/f_pc_executor.h"
2022-12-27 22:43:29 -07:00
#include "f_pc/f_pc_leaf.h"
2023-05-12 12:10:14 -07:00
#include "f_pc/f_pc_node.h"
#include "f_pc/f_pc_stdcreate_req.h"
2024-03-19 04:31:53 -07:00
#include "f_pc/f_pc_searcher.h"
2021-03-28 22:49:05 +02:00
2023-02-10 09:07:47 -08:00
enum {
2024-07-07 11:31:29 -07:00
fpcM_ERROR_PROCESS_ID_e = 0xFFFFFFFF
2023-02-10 09:07:47 -08:00
};
2021-04-01 12:06:29 +02:00
typedef int (*FastCreateReqFunc)(void*);
typedef void (*fpcM_ManagementFunc)(void);
typedef int (*fpcM_DrawIteraterFunc)(void*, void*);
2024-11-29 08:24:26 -08:00
inline fpc_ProcID fpcM_GetID(const void* i_process) {
return i_process != NULL ? ((base_process_class*)i_process)->id : fpcM_ERROR_PROCESS_ID_e;
2021-06-12 15:22:36 -07:00
}
2024-11-29 08:24:26 -08:00
inline s16 fpcM_GetName(const void* i_process) {
return ((base_process_class*)i_process)->name;
2021-12-04 05:10:59 -08:00
}
2024-11-29 08:24:26 -08:00
inline u32 fpcM_GetParam(const void* i_process) {
return ((base_process_class*)i_process)->parameters;
2022-05-03 12:55:30 +02:00
}
2024-11-29 08:24:26 -08:00
inline void fpcM_SetParam(void* i_process, u32 param) {
((base_process_class*)i_process)->parameters = param;
2022-03-26 10:17:17 -07:00
}
2024-11-29 08:24:26 -08:00
inline s16 fpcM_GetProfName(const void* i_process) {
return ((base_process_class*)i_process)->profname;
2022-12-27 22:43:29 -07:00
}
2024-11-29 08:24:26 -08:00
inline fpc_ProcID fpcM_Create(s16 i_procName, FastCreateReqFunc i_createFunc, void* i_append) {
return fpcSCtRq_Request(fpcLy_CurrentLayer(), i_procName, (stdCreateFunc)i_createFunc, NULL,
i_append);
2022-03-26 10:17:17 -07:00
}
2024-11-29 08:24:26 -08:00
inline s16 fpcM_DrawPriority(const void* i_process) {
return (s16)fpcLf_GetPriority((const leafdraw_class*)i_process);
}
2024-11-29 08:24:26 -08:00
inline s32 fpcM_ChangeLayerID(void* i_process, int i_layerID) {
return fpcPi_Change(&((base_process_class*)i_process)->priority, i_layerID, 0xFFFD, 0xFFFD);
}
2024-11-29 08:24:26 -08:00
inline BOOL fpcM_IsJustType(int i_typeA, int i_typeB) {
return fpcBs_Is_JustOfType(i_typeA, i_typeB);
}
2024-11-29 08:24:26 -08:00
inline bool fpcM_IsFirstCreating(void* i_process) {
2025-07-26 03:44:23 +03:00
return ((base_process_class*)i_process)->state.init_state == 0;
2024-11-29 08:24:26 -08:00
}
inline process_profile_definition* fpcM_GetProfile(void* i_process) {
return ((base_process_class*)i_process)->profile;
}
inline void* fpcM_GetAppend(const void* i_process) {
return ((base_process_class*)i_process)->append;
}
2024-10-12 15:11:17 -07:00
inline BOOL fpcM_IsExecuting(fpc_ProcID id) {
return fpcEx_IsExist(id);
}
2023-01-03 17:43:38 -08:00
inline void* fpcM_LyJudge(process_node_class* i_node, fpcLyIt_JudgeFunc i_func, void* i_data) {
2024-11-29 08:24:26 -08:00
return fpcLyIt_Judge(&i_node->layer, i_func, i_data);
2023-01-03 17:43:38 -08:00
}
2024-11-29 08:24:26 -08:00
inline base_process_class* fpcM_Search(fpcLyIt_JudgeFunc i_func, void* i_data) {
return fpcEx_Search(i_func, i_data);
2024-03-19 04:31:53 -07:00
}
inline base_process_class* fpcM_SearchByName(s16 name) {
return (base_process_class*)fpcLyIt_AllJudge(fpcSch_JudgeForPName, &name);
}
2024-11-29 08:24:26 -08:00
inline base_process_class* fpcM_SearchByID(fpc_ProcID i_id) {
return fpcEx_SearchByID(i_id);
}
void fpcM_Draw(void* i_process);
s32 fpcM_DrawIterater(fpcM_DrawIteraterFunc i_drawIterFunc);
s32 fpcM_Execute(void* i_process);
s32 fpcM_Delete(void* i_process);
BOOL fpcM_IsCreating(fpc_ProcID i_id);
void fpcM_Management(fpcM_ManagementFunc i_preExecuteFn, fpcM_ManagementFunc i_postExecuteFn);
2024-03-19 04:31:53 -07:00
void fpcM_Init();
2024-11-29 08:24:26 -08:00
base_process_class* fpcM_FastCreate(s16 i_procname, FastCreateReqFunc i_createReqFunc,
void* i_createData, void* i_append);
s32 fpcM_IsPause(void* i_process, u8 i_flag);
void fpcM_PauseEnable(void* i_process, u8 i_flag);
void fpcM_PauseDisable(void* i_process, u8 i_flag);
void* fpcM_JudgeInLayer(fpc_ProcID i_layerID, fpcCtIt_JudgeFunc i_judgeFunc, void* i_data);
2021-04-01 12:06:29 +02:00
2022-05-03 12:55:30 +02:00
#endif