-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpanelconfig.h
More file actions
150 lines (129 loc) · 5.12 KB
/
Copy pathpanelconfig.h
File metadata and controls
150 lines (129 loc) · 5.12 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* File: panelconfig.h
* Author: Sir Gee of Five
*
* Created on October 3, 2010, 1:31 PM
*/
#ifndef PANELCONFIG_H
#define PANELCONFIG_H
#include <stdlib.h>
#include <stdio.h>
#include <pspkerneltypes.h>
#include <pspiofilemgr.h>
#include "colorconfig.h"
#include "cursorpos.h"
#include "dimension.h"
/** Indicates success. */
#define PANELCONFIG_SUCCESS (0)
/** Indicates failure. */
#define PANELCONFIG_FAILURE (-1)
/** Indicates a memory error. */
#define PANELCONFIG_MEMORY (-2)
/** Indicates a NULL pointer. */
#define PANELCONFIG_NULLPTR (-3)
/** Indicates an I/O Error. */
#define PANELCONFIG_IOERROR (-4)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _PanelConfig {
/** Normal color configuration. */
ColorConfig rColor;
/** Cursor color configuration. */
ColorConfig rCursor;
/** Edit color configuration. */
ColorConfig rEdit;
/** Cursor position of the top-left corner of the Panel. */
CursorPos rTop;
/** Dimension of the Panel expressed in rows and columns. */
Dimension rSize;
}
/** The Panel Configuration structure holds Panel configuration settings.
* The settings specify color and position of the Panel.
*/
PanelConfig;
/** Copy a PanelConfig struct.
*
* @param prDest Pointer to a PanelConfig struct to act as the destination.
* @param prSrc Pointer to a PanelConfig struct to act as the source.
* @return PANELCONFIG_NULLPTR is returned if either parameter is NULL.
* PANELCONFIG_SUCCESS is returned if the PanelConfig is copied.
*/
int panelconfig_copy(PanelConfig* prDest, PanelConfig* prSrc);
/** Return a pointer to a ColorConfig struct representing the cursor
* color configuration.
*
* @param prCfg Pointer to a PanelConfig struct representing the Panel
* Configuration.
* @return A Pointer to the cursor ColorConfig struct is returned or NULL
* is returned.
*/
ColorConfig* panelconfig_get_cursorcolor(PanelConfig* prCfg);
/** Return a pointer to a ColorConfig struct representing the editor
* color configuration.
*
* @param prCfg Pointer to a PanelConfig struct representing the Panel
* Configuration.
* @return A Pointer to the cursor ColorConfig struct is returned or NULL
* is returned.
*/
ColorConfig* panelconfig_get_editcolor(PanelConfig* prCfg);
/** Return a pointer to a ColorConfig struct representing the Panel
* color configuration.
*
* @param prCfg Pointer to a PanelConfig struct representing the Panel
* Configuration.
* @return A Pointer to the cursor ColorConfig struct is returned or NULL
* is returned.
*/
ColorConfig* panelconfig_get_panelcolor(PanelConfig* prCfg);
/** Return a pointer to a CursorPos struct representing the position of
* the Panel on the screen.
*
* @param prCfg Pointer to a PanelConfig struct representing the Panel
* Configuration.
* @return A pointer to the CursorPos struct representing the Panel
* position or NULL is returned.
*/
CursorPos* panelconfig_get_position(PanelConfig* prCfg);
/** Return a pointer to a Dimension struct representing the Panel
* Size in rows and columns.
*
* @param prCfg Pointer to a PanelConfig struct representing the Panel
* Configuration.
* @return A pointer to the Dimension struct representing the Panel
* size or NULL is returned.
*/
Dimension* panelconfig_get_size(PanelConfig* prCfg);
/** Initialize a PanelConfig struct.
*
* @param prCfg Pointer to the PanelConfig struct to initialize.
* @return PANELCONFIG_NULLPTR is returned if the parameter prCfg is NULL.
* PANELCONFIG_FAILURE is returned if the PanelConfig could not be
* initialized, otherwise PANELCONFIG_SUCCESS is returned.
*/
int panelconfig_init(PanelConfig* prCfg);
/** Read a PanelConfig struct from the specified file descriptor.
*
* @param prCfg Pointer to a PanelConfig struct to read into.
* @param fd SceUID containing a valid file descriptor.
* @return PANELCONFIG_NULLPTR is returned if the parameter prCfg is NULL.
* PANELCONFIG_FAILURE is returned if the PanelConfig could not be read.
* PANELCONFIG_IOERROR is returned if an I/O error occured during reading.
* PANELCONFIG_SUCCESS is returned if the PanelConfig was read.
*/
int panelconfig_read(PanelConfig* prCfg, SceUID fd);
/** Write a PanelConfig struct to the specified file descriptor.
*
* @param prCfg Pointer to the PanelConfig struct to write.
* @param fd SceUID containing a valid file descriptor.
* @return PANELCONFIG_NULLPTR is returned if the parameter prCfg is NULL.
* PANELCONFIG_FAILURE is returned if the PanelConfig could not be written.
* PANELCONFIG_IOERROR is returned if an I/O error occured during writing.
* PANELCONFIG_SUCCESS is returned if the PanelConfig was written.
*/
int panelconfig_write(PanelConfig* prCfg, SceUID fd);
#ifdef __cplusplus
}
#endif
#endif /* PANELCONFIG_H */