1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     Util.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46365 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_COMMON_SCENE_UTIL_H_
17 #define NN_COMMON_SCENE_UTIL_H_
18 
19 #include <nn.h>
20 #include "TextWriter.h"
21 #include "Gui.h"
22 
23 #define  AOC_PANIC_IF_FAILED(result) NN_UTIL_PANIC_IF_FAILED(result)
24 
25 namespace scene
26 {
27     /* Please see man pages for details
28 
29     */
30     u32 wstrlen(const wchar_t* pText);
31 
32     /* Please see man pages for details
33 
34     */
35     u32 wtoi(const wchar_t* pText);
36 
37     /* Please see man pages for details
38 
39     */
40     void SetupMemory(u32 deviceMemorySize);
41 
42     /* Please see man pages for details
43 
44     */
45     void ReleaseMemory();
46 
47     /* Please see man pages for details
48 
49     */
50     nn::fnd::ExpHeap* GetHeap();
51 
52     /* Please see man pages for details
53 
54     */
55     void* Allocate(size_t size, s32 alignment = 4);
56 
57     /* Please see man pages for details
58 
59     */
60     void Free(void* pBuffer);
61 
62     /* Please see man pages for details
63 
64     */
65     void SetTitle(const wchar_t* pTitle, size_t length);
66     void DrawTitle(TextWriter* pTextWriter);
67     void DrawTitleForApplet(TextWriter* pTextWriter);
68     void DrawTitleForApplication(TextWriter* pTextWriter);
69 
70     /* Please see man pages for details
71 
72     */
73     void DrawSceneId(TextWriter* pTextWriter, const wchar_t* pSceneId);
74 
75     /* Please see man pages for details
76 
77     */
78     void DrawResult(TextWriter* pTextWriter, const nn::Result& result);
79 
80     /* Please see man pages for details
81 
82     */
83     void DrawBusyIcon(TextWriter* pTextWriter, u16 x, u16 y, u32 counter);
84 
85     /* Please see man pages for details
86 
87     */
88     void DrawConfirmMessage(TextWriter* pTextWriter, const wchar_t* pMessage1, const wchar_t* pMessage2);
89 
90     /* Please see man pages for details
91 
92     */
93     nn::fnd::DateTime GetDateTimeFromUnixTime(s64 unixTime);
94 
95     /* Please see man pages for details
96 
97     */
98     void AddLButton(scene::ControlManager* pManager, u32 id, const wchar_t* pCaption);
99 
100     /* Please see man pages for details
101 
102     */
103     void AddRButton(scene::ControlManager* pManager, u32 id, const wchar_t* pCaption);
104 
105     /* Please see man pages for details
106 
107     */
108     void AddYesNoButtons(scene::ControlManager* pManager, u32 idYes, u32 idNo, const wchar_t* pCaptionYes = L"はい", const wchar_t* pCaptionNo = L"いいえ");
109 
110 }
111 
112 #endif // NN_COMMON_SCENE_UTIL_H_
113