-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwimputils
178 lines (140 loc) · 5.59 KB
/
wimputils
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/* Header: wimputils.h V2.06 - By Tim Moore (17th Sept 1994)
*
* Purpose: General wimp utilities
*
* Other Info: Most of these functions provide a simpler call strcuture
* to RISC_OSLib by removing common code from the main programs
* and making the calls easier to understand.
*
*/
#ifndef __wimputils_h
#define __wimputils_h
#ifndef BOOL
#define BOOL int
#define TRUE 1
#define FALSE 0
#endif
/**************************** DATA / STRUCTURES ***************************/
typedef struct {
int Version_Ic;
char Version[80];
} Version_Info;
/******************************* THE FUNCTIONS ****************************/
/* ----------------------- wimp_utils_create_window ------------------------
* Description: Create the window, yielding its handle.
*
* Parameters: char *Name -- the name of the window template
* wimp_w Handle -- the window's handler
* Returns: TRUE if all ok.
* Other Info: none.
*
*/
BOOL Wimp_Utils_Create_Window( char *Name /*in*/ , wimp_w *Handle /*out*/);
/* ----------------------- wimp_utils_redraw_window ------------------------
* Description: Event handling to deal with redrawing the window
*
* Parameters: wimp_w Handle -- the window's handler
* Returns: void.
* Other Info: (future change to call a user routine?)
*
*/
void Wimp_Utils_Redraw_Window( wimp_w Handle /*in*/);
/* ----------------------- wimp_utils_open_window --------------------------
* Description: Open a window (simpler call)
*
* Parameters: wimp_w Handle -- the window's handler
* BOOL Window_Limit -- if TRUE limits the number of this
* window allowed to be opened to 1
* BOOL Window_Open -- used to pass/change details of window
* being open or not
* Returns: TRUE if all ok.
* Other Info: This is just to abstract the call and make it simpler.
* It will always open window in front. A seperate function
* will be necessary to deal with more complex features.
*
*/
BOOL Wimp_Utils_Open_Window( wimp_w Handle /*in*/ ,BOOL Window_Limit /*in*/
,BOOL Window_Open /*in*/);
/* ----------------------- wimp_utils_get_icon_text ------------------------
* Description: Get text from a indirected icon
*
* Parameters: wimp_w Window -- the window's handler
* wimp_i Icon -- the icon number
* char *Text -- the returned text
* Returns: the returned text
* Other Info: none.
*
*/
char *Wimp_Utils_Get_Icon_Text( wimp_w Window /*in*/, wimp_i Icon /*in*/,
char *Text /*out*/);
/* ----------------------- wimp_utils_put_icon_text ------------------------
* Description: Put text into an indirected icon
*
* Parameters: wimp_w Window -- the window's handler
* wimp_i Icon -- the icon number
* char *Text -- the text to insert
* Returns: void.
* Other Info: none.
*
*/
void Wimp_Utils_Put_Icon_Text( wimp_w Window /*in*/, wimp_i Icon /*in*/,
char *Text /*in*/);
/* ERROR IN NEXT ONE - REMOVED FOR MOMENT!!!
* BOOL wimp_utils_icon_empty( wimp_w window, wimp_i icon);
*/
/* ----------------------- wimp_utils_disable_icon -------------------------
* Description: Disable an icon by 'greying' it out
*
* Parameters: wimp_w Window -- the window's handler
* wimp_i Icon -- the icon number
* Returns: void.
* Other Info: none.
*
*/
void Wimp_Utils_Disable_Icon( wimp_w Window /*in*/, wimp_i Icon /*in*/);
/* ----------------------- wimp_utils_enable_icon --------------------------
* Description: Enable an icon by 'ungreying' it
*
* Parameters: wimp_w Window -- the window's handler
* wimp_i Icon -- the icon number
* Returns: void.
* Other Info: none.
*
*/
void Wimp_Utils_Enable_Icon( wimp_w Window /*in*/, wimp_i Icon /*in*/);
/* ----------------------- wimp_utils_isselected ---------------------------
* Description: Detects if an icon is 'selected' by user
*
* Parameters: wimp_w Window -- the window's handler
* wimp_i Icon -- the icon number
* Returns: TRUE or FALSE.
* Other Info: none.
*
*/
BOOL Wimp_Utils_Isselected(wimp_w Window /*in*/, wimp_i Icon /*in*/);
/* --------------------- wimp_utils_program_info ---------------------------
* Description: Display the program info box - called from the menu processor. *
* Parameters: char *Temp_Name -- name of dialogue box template
* Version_Info The_Version_Info
-- The version field to fill in.
* Returns: void.
* Other Info: This function has just been moved away from main routines
* to remove commonly repeated areas and things you don't need
* to think about. It used the object 'info_details_type'.
*
*/
void Wimp_Utils_Program_Info( char *Temp_Name /*in*/,
Version_Info The_Version_Info /*in*/ );
/* ---------------------------- wimp_utils_help ----------------------------
* Description: Sends messages after requests made for interactive help,
* given the message string from the event and the text to
* display. *
* Parameters: char *Text -- help text to send
* wimp_msgstr *Msg -- event details of the message string.
* Returns: void.
* Other Info: none.
*
*/
void Wimp_Utils_Help(char *Text /*in*/, wimp_msgstr *Msg /*inout*/);
#endif
/* end of wimputils.h */