-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdialog.c
75 lines (60 loc) · 1.63 KB
/
dialog.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright (C) 2010 drizzt
*
* Authors:
* drizzt <[email protected]>
* The original OpenBM author
*
* 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 3 of the License.
*/
/* Functions to manage dialogs */
#include <sysutil/sysutil_msgdialog.h>
#include "dialog.h"
#include "graphics.h"
uint32_t type_dialog_yes_no =
CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BG_VISIBLE | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO |
CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON | CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO;
uint32_t type_dialog_ok =
CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BG_VISIBLE | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK |
CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF | CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK;
int dialog_ret = 0;
void dialog_fun1(int button_type, void *userData __attribute__ ((unused)))
{
switch (button_type) {
case CELL_MSGDIALOG_BUTTON_YES:
dialog_ret = 1;
break;
case CELL_MSGDIALOG_BUTTON_NO:
case CELL_MSGDIALOG_BUTTON_ESCAPE:
case CELL_MSGDIALOG_BUTTON_NONE:
dialog_ret = 2;
break;
default:
break;
}
}
void dialog_fun2(int button_type, void *userData __attribute__ ((unused)))
{
switch (button_type) {
case CELL_MSGDIALOG_BUTTON_OK:
case CELL_MSGDIALOG_BUTTON_ESCAPE:
case CELL_MSGDIALOG_BUTTON_NONE:
dialog_ret = 1;
break;
default:
break;
}
}
void wait_dialog(void)
{
while (!dialog_ret) {
cellSysutilCheckCallback();
flip();
}
cellMsgDialogAbort();
setRenderColor();
sys_timer_usleep(100000);
}
/* vim: set ts=4 sw=4 sts=4 tw=120 */