2012-12-10 12:08:54 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-07-29 03:28:32 +00:00
|
|
|
#include "Globals.h"
|
|
|
|
#include "Common/Common.h"
|
|
|
|
#include "Core/Config.h"
|
2013-02-04 04:31:46 +00:00
|
|
|
|
|
|
|
class PointerWrap;
|
2012-12-10 12:08:54 +00:00
|
|
|
|
|
|
|
#define SCE_UTILITY_DIALOG_RESULT_SUCCESS 0
|
|
|
|
#define SCE_UTILITY_DIALOG_RESULT_CANCEL 1
|
|
|
|
#define SCE_UTILITY_DIALOG_RESULT_ABORT 2
|
|
|
|
|
2013-04-20 20:14:11 +00:00
|
|
|
const int SCE_ERROR_UTILITY_INVALID_STATUS = 0x80110001;
|
|
|
|
const int SCE_ERROR_UTILITY_INVALID_PARAM_SIZE = 0x80110004;
|
|
|
|
const int SCE_ERROR_UTILITY_WRONG_TYPE = 0x80110005;
|
2013-03-18 02:01:58 +00:00
|
|
|
|
2013-07-27 22:30:18 +00:00
|
|
|
struct pspUtilityDialogCommon
|
2012-12-15 16:42:38 +00:00
|
|
|
{
|
2013-07-27 22:30:18 +00:00
|
|
|
u32_le size; /** Size of the structure */
|
|
|
|
s32_le language; /** Language */
|
|
|
|
s32_le buttonSwap; /** Set to 1 for X/O button swap */
|
|
|
|
s32_le graphicsThread; /** Graphics thread priority */
|
|
|
|
s32_le accessThread; /** Access/fileio thread priority (SceJobThread) */
|
|
|
|
s32_le fontThread; /** Font thread priority (ScePafThread) */
|
|
|
|
s32_le soundThread; /** Sound thread priority */
|
|
|
|
s32_le result; /** Result */
|
|
|
|
s32_le reserved[4]; /** Set to 0 */
|
|
|
|
};
|
2012-12-15 16:42:38 +00:00
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
|
|
|
|
class PSPDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PSPDialog();
|
|
|
|
virtual ~PSPDialog();
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
virtual int Update();
|
2013-05-31 08:07:37 +00:00
|
|
|
virtual int Shutdown(bool force = false);
|
2012-12-28 21:36:37 +00:00
|
|
|
virtual void DoState(PointerWrap &p);
|
2013-06-10 08:52:26 +00:00
|
|
|
virtual pspUtilityDialogCommon *GetCommonParam();
|
2012-12-10 12:08:54 +00:00
|
|
|
|
|
|
|
enum DialogStatus
|
|
|
|
{
|
|
|
|
SCE_UTILITY_STATUS_NONE = 0,
|
|
|
|
SCE_UTILITY_STATUS_INITIALIZE = 1,
|
|
|
|
SCE_UTILITY_STATUS_RUNNING = 2,
|
|
|
|
SCE_UTILITY_STATUS_FINISHED = 3,
|
|
|
|
SCE_UTILITY_STATUS_SHUTDOWN = 4
|
|
|
|
};
|
|
|
|
|
2013-06-10 08:52:26 +00:00
|
|
|
enum DialogStockButton
|
|
|
|
{
|
|
|
|
DS_BUTTON_NONE = 0x00,
|
|
|
|
DS_BUTTON_OK = 0x01,
|
|
|
|
DS_BUTTON_CANCEL = 0x02,
|
|
|
|
DS_BUTTON_BOTH = 0x03,
|
|
|
|
};
|
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
DialogStatus GetStatus();
|
|
|
|
|
|
|
|
void StartDraw();
|
|
|
|
void EndDraw();
|
|
|
|
protected:
|
|
|
|
bool IsButtonPressed(int checkButton);
|
2013-06-10 08:52:26 +00:00
|
|
|
void DisplayButtons(int flags);
|
2013-01-18 23:45:00 +00:00
|
|
|
|
|
|
|
void StartFade(bool fadeIn_);
|
|
|
|
void UpdateFade();
|
|
|
|
u32 CalcFadedColor(u32 inColor);
|
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
DialogStatus status;
|
|
|
|
|
|
|
|
unsigned int lastButtons;
|
|
|
|
unsigned int buttons;
|
2013-01-18 23:45:00 +00:00
|
|
|
|
|
|
|
float fadeTimer;
|
|
|
|
bool isFading;
|
|
|
|
bool fadeIn;
|
|
|
|
u32 fadeValue;
|
2013-06-10 08:52:26 +00:00
|
|
|
|
|
|
|
int okButtonImg;
|
|
|
|
int cancelButtonImg;
|
|
|
|
int okButtonFlag;
|
|
|
|
int cancelButtonFlag;
|
2012-12-10 12:08:54 +00:00
|
|
|
};
|