mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Abstract class for MsgDialog interface
This commit is contained in:
parent
cfb41c4dab
commit
00205bfa58
8 changed files with 227 additions and 237 deletions
|
|
@ -6,7 +6,7 @@ enum
|
|||
CELL_MSGDIALOG_ERROR_DIALOG_NOT_OPENED = 0x8002b302,
|
||||
};
|
||||
|
||||
enum CellMsgDialogType
|
||||
enum CellMsgDialogType : u32
|
||||
{
|
||||
CELL_MSGDIALOG_DIALOG_TYPE_ERROR = 0x00000000,
|
||||
CELL_MSGDIALOG_DIALOG_TYPE_NORMAL = 0x00000001,
|
||||
|
|
@ -16,28 +16,28 @@ enum CellMsgDialogType
|
|||
CELL_MSGDIALOG_DEFAULT_CURSOR_NO = 0x00000100,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_SE_TYPE = 0x1,
|
||||
CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR = 0 << 0,
|
||||
CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL = 1 << 0,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_SE_MUTE = 0x2,
|
||||
CELL_MSGDIALOG_TYPE_SE_MUTE_OFF = 0 << 1,
|
||||
CELL_MSGDIALOG_TYPE_SE_MUTE_ON = 1 << 1,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_BG = 0x4,
|
||||
CELL_MSGDIALOG_TYPE_BG_VISIBLE = 0 << 2,
|
||||
CELL_MSGDIALOG_TYPE_BG_INVISIBLE = 1 << 2,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_BUTTON_TYPE = 0x70,
|
||||
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE = 0 << 4,
|
||||
|
|
@ -45,14 +45,14 @@ enum
|
|||
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK = 2 << 4,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_DISABLE_CANCEL = 0x80,
|
||||
CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF = 0 << 7,
|
||||
CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON = 1 << 7,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR = 0x300,
|
||||
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NONE = 0 << 8,
|
||||
|
|
@ -61,7 +61,7 @@ enum
|
|||
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK = 0 << 8,
|
||||
};
|
||||
|
||||
enum
|
||||
enum : u32
|
||||
{
|
||||
CELL_MSGDIALOG_TYPE_PROGRESSBAR = 0x3000,
|
||||
CELL_MSGDIALOG_TYPE_PROGRESSBAR_NONE = 0 << 12,
|
||||
|
|
@ -69,7 +69,8 @@ enum
|
|||
CELL_MSGDIALOG_TYPE_PROGRESSBAR_DOUBLE = 2 << 12,
|
||||
};
|
||||
|
||||
enum
|
||||
// MsgDialog Button Type
|
||||
enum : s32
|
||||
{
|
||||
CELL_MSGDIALOG_BUTTON_NONE = -1,
|
||||
CELL_MSGDIALOG_BUTTON_INVALID = 0,
|
||||
|
|
@ -79,22 +80,32 @@ enum
|
|||
CELL_MSGDIALOG_BUTTON_ESCAPE = 3,
|
||||
};
|
||||
|
||||
typedef void(CellMsgDialogCallback)(s32 buttonType, u32 userData);
|
||||
typedef void(CellMsgDialogCallback)(s32 buttonType, vm::ptr<void> userData);
|
||||
|
||||
s32 cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, vm::ptr<CellMsgDialogCallback> callback, u32 userData, u32 extParam);
|
||||
s32 cellMsgDialogOpenErrorCode(u32 errorCode, vm::ptr<CellMsgDialogCallback> callback, u32 userData, u32 extParam);
|
||||
enum MsgDialogState
|
||||
{
|
||||
msgDialogNone,
|
||||
msgDialogOpen,
|
||||
msgDialogClose,
|
||||
msgDialogAbort,
|
||||
};
|
||||
|
||||
s32 cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::ptr<const char> msgString);
|
||||
s32 cellMsgDialogProgressBarReset(u32 progressBarIndex);
|
||||
s32 cellMsgDialogProgressBarInc(u32 progressBarIndex, u32 delta);
|
||||
s32 cellMsgDialogClose(float delay);
|
||||
s32 cellMsgDialogAbort();
|
||||
struct MsgDialogInstance
|
||||
{
|
||||
std::atomic<MsgDialogState> state;
|
||||
|
||||
typedef void(*MsgDialogCreateCb)(u32 type, const char* msg, u64& status);
|
||||
typedef void(*MsgDialogDestroyCb)();
|
||||
typedef void(*MsgDialogProgressBarSetMsgCb)(u32 progressBarIndex, const char* msg);
|
||||
typedef void(*MsgDialogProgressBarResetCb)(u32 progressBarIndex);
|
||||
typedef void(*MsgDialogProgressBarIncCb)(u32 progressBarIndex, u32 delta);
|
||||
s32 status = 0;
|
||||
u64 wait_until = 0;
|
||||
u32 progress_bar_count = 0;
|
||||
|
||||
void SetMsgDialogCallbacks(MsgDialogCreateCb ccb, MsgDialogDestroyCb dcb, MsgDialogProgressBarSetMsgCb pbscb, MsgDialogProgressBarResetCb pbrcb, MsgDialogProgressBarIncCb pbicb);
|
||||
void MsgDialogClose();
|
||||
MsgDialogInstance();
|
||||
virtual ~MsgDialogInstance();
|
||||
|
||||
virtual void Close();
|
||||
|
||||
virtual void Create(u32 type, const char* msg) = 0;
|
||||
virtual void Destroy() = 0;
|
||||
virtual void ProgressBarSetMsg(u32 progressBarIndex, const char* msg) = 0;
|
||||
virtual void ProgressBarReset(u32 progressBarIndex) = 0;
|
||||
virtual void ProgressBarInc(u32 progressBarIndex, u32 delta) = 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue