Merge pull request #22 from shinyquagsire23/multitask

Add multitasking  support for wut
This commit is contained in:
James 2016-07-27 12:21:41 +01:00 committed by GitHub
commit 7cfd28df68
7 changed files with 118 additions and 1 deletions

View File

@ -0,0 +1,27 @@
#pragma once
#include <wut.h>
/**
* \defgroup coreinit_foreground Foreground Management
* \ingroup coreinit
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
void
OSEnableForegroundExit();
void
OSReleaseForeground();
void
OSSavesDone_ReadyToRelease();
#ifdef __cplusplus
}
#endif
/** @} */

68
include/proc_ui/procui.h Normal file
View File

@ -0,0 +1,68 @@
#pragma once
#include <wut.h>
/**
* \defgroup proc_ui_procui ProcUI
* \ingroup proc_ui
* @{
*/
#ifdef __cplusplus
"C" {
#endif
typedef void (*ProcUISaveCallback)(void);
typedef uint32_t (*ProcUISaveCallbackEx)(void*);
typedef uint32_t (*ProcUICallback)(void*);
typedef enum ProcUIStatus
{
PROCUI_STATUS_IN_FOREGROUND,
PROCUI_STATUS_IN_BACKGROUND,
PROCUI_STATUS_RELEASE_FOREGROUND,
PROCUI_STATUS_EXITING,
} ProcUIStatus;
uint32_t
ProcUICalcMemorySize(uint32_t unk);
void
ProcUIClearCallbacks();
void
ProcUIDrawDoneRelease();
BOOL
ProcUIInForeground();
BOOL
ProcUIInShutdown();
void
ProcUIInit(ProcUISaveCallback saveCallback);
void
ProcUIInitEx(ProcUISaveCallbackEx saveCallback,
void *arg);
BOOL
ProcUIIsRunning();
ProcUIStatus
ProcUIProcessMessages(BOOL block);
void
ProcUISetSaveCallback(ProcUISaveCallbackEx saveCallback,
void *arg);
void
ProcUIShutdown();
ProcUIStatus
ProcUISubProcessMessages();
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -1,5 +1,5 @@
WUT_ROOT := $(CURDIR)/..
TARGETS := libcoreinit libgx2 libnsysnet libvpad libsysapp
TARGETS := libcoreinit libgx2 libnsysnet libvpad libsysapp libproc_ui
all:
@for dir in $(TARGETS); do \

View File

@ -152,6 +152,11 @@ EXPORT(FSSetPosFileAsync);
EXPORT(FSGetVolumeState);
EXPORT(FSGetLastErrorCodeForViewer);
// coreinit/foreground.h
EXPORT(OSEnableForegroundExit);
EXPORT(OSReleaseForeground);
EXPORT(OSSavesDone_ReadyToRelease);
// coreinit/frameheap.h
EXPORT(MEMCreateFrmHeapEx);
EXPORT(MEMDestroyFrmHeap);

2
rpl/libproc_ui/Makefile Normal file
View File

@ -0,0 +1,2 @@
-include ../common/rules.mk
-include ../../common/rules.mk

1
rpl/libproc_ui/config.h Normal file
View File

@ -0,0 +1 @@
#define LIBRARY_NAME "proc_ui"

14
rpl/libproc_ui/exports.h Normal file
View File

@ -0,0 +1,14 @@
// procui/procui.h
EXPORT(ProcUICalcMemorySize);
EXPORT(ProcUIClearCallbacks);
EXPORT(ProcUIDrawDoneRelease);
EXPORT(ProcUIInForeground);
EXPORT(ProcUIInShutdown);
EXPORT(ProcUIInit);
EXPORT(ProcUIInitEx);
EXPORT(ProcUIIsRunning);
EXPORT(ProcUIProcessMessages);
EXPORT(ProcUISetSaveCallback);
EXPORT(ProcUIShutdown);
EXPORT(ProcUISubProcessMessages);