Debian Codegraph @

Descent3/ConfigItem.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/ConfigItem.h $
21 * $Revision: 8 $
22 * $Date: 10/19/98 6:30p $
23 * $Author: Jeff $
24 *
25 * Contains the class info for ConfigItem [config dialog UI objects]
26 *
27 * $Log: /DescentIII/main/ConfigItem.h $
28 *
29 * 8 10/19/98 6:30p Jeff
30 * changes made for detail variables. Put in preset values. Preset
31 * options. Removed terrain_cast from detail. Put new callbacks in
32 * UIListBox and UISlider
33 *
34 * 7 10/16/98 1:42p Jeff
35 * added CIF_USEGROUP and general dialog look
36 *
37 * 6 9/02/98 2:54p Jeff
38 * added defines for text colors to be used throughout the game...fixed up
39 * buddy menu too
40 *
41 * 5 6/05/98 5:59p Jeff
42 * Added a CIT_CHECKBOX style
43 *
44 * 4 5/23/98 6:33p Jeff
45 * Added some flags for the slider, and fixed it up a bit
46 *
47 * 3 5/22/98 5:02p Jeff
48 * Increased functionality
49 *
50 * 2 5/21/98 10:35p Jeff
51 * Initial creation
52 *
53 * $NoKeywords: $
54 */
55
56 #ifndef __CONFIGITEM_H_
57 #define __CONFIGITEM_H_cxx . . $ `Descent3/ConfigItem.h:57:9`!
58
59 #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/
60
61 #if defined(POSIXcxx . . $ `<built-in>:480:9`!)
62 void CIListBoxCallbackcxx . . $ CIListBoxCallback(6ca3d68f5c5f0975).(int ID, void *);
63 void CISliderCallbackcxx . . $ CISliderCallback(6ca3d68f5c5f0975).(int ID, void *);
64 #endif
65
66 // config item types
67 #define CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`! 0x01
68 #define CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`! 0x02
69 #define CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`! 0x03
70 #define CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`! 0x04
71 #define CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`! 0x05
72 #define CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`! 0x06
73 #define CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`! 0x07
74
75 // config item value types
76 #define CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`! 0x01
77 #define CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`! 0x02
78 #define CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`! 0x03
79
80 // config item flags
81 #define CIF_PERCENTcxx . . $ `Descent3/ConfigItem.h:81:9`! 0x01 // tells a slider to display a percent sign
82 #define CIF_NODECIMALcxx . . $ `Descent3/ConfigItem.h:82:9`! 0x02 // tells a slider not to display a decimal point (float sliders only)
83 #define CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`! 0x04 // places a group box around the configitem (CIT_RADIOBUTTON only)
84
85 #define HOTSPOTLIST_GAPcxx . . $ `Descent3/ConfigItem.h:85:9`! 8 // the horizontal gap between hotspot lists
86 #define LISTBOX_LABELGAPcxx . . $ `Descent3/ConfigItem.h:86:9`! 3 // the vertical gap between label and listbox
87 #define RADIOBUTTON_LABELGAPcxx . . $ `Descent3/ConfigItem.h:87:9`! 3 // the vertical gap between label and radiobutton list
88 #define RADIOBUTTON_GAPcxx . . $ `Descent3/ConfigItem.h:88:9`! 3 // the vertical gap between radiobuttons
89
90 int GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).(void);
91
92 class ConfigItemcxx . . $ ConfigItem# {
93 public:
94 ConfigItemcxx . . $ ConfigItem#ConfigItem(49f6e7a06ebc5aa8).();
95 ~cxx . . $ ConfigItem#`~ConfigItem`(49f6e7a06ebc5aa8).ConfigItemcxx . . $ ConfigItem#();
96
97 // create functions
98 bool Createcxx . . $ ConfigItem#Create(427e420ce4e940e6).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h, int initialvalue,
99 int flags, int item_x);
100 bool Createcxx . . $ ConfigItem#Create(9ca3d41f557e3874).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h, bool initialvalue,
101 int flags, int item_x);
102 bool Createcxx . . $ ConfigItem#Create(a2e6a2b58c19220).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h, float initialvalue,
103 int flags, int item_x);
104
105 // destroy function
106 void Destroycxx . . $ ConfigItem#Destroy(49f6e7a06ebc5aa8).(void);
107
108 // gets the current value (returns true on success)
109 bool GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(18a3c31ed0aa5760).(int *currvalue);
110 bool GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(78ac5d2f3d401626).(bool *currvalue);
111 bool GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(7f1546a85f5329ec).(float *currvalue);
112
113 // sets the current value for the item
114 bool SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(9609253e83e89946).(int currvalue, bool call_callback = true);
115 bool SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(f2cb034b043a1ce9).(bool currvalue, bool call_callback = true);
116 bool SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(d45380cd2068a9c8).(float currvalue, bool call_callback = true);
117
118 // gets the initial value (returns true on success)
119 bool GetInitialValuecxx . . $ ConfigItem#GetInitialValue(18a3c31ed0aa5760).(int *initvalue);
120 bool GetInitialValuecxx . . $ ConfigItem#GetInitialValue(78ac5d2f3d401626).(bool *initvalue);
121 bool GetInitialValuecxx . . $ ConfigItem#GetInitialValue(7f1546a85f5329ec).(float *initvalue);
122
123 // set range
124 void SetRangecxx . . $ ConfigItem#SetRange(b1146eedae1e1d0b).(int min, int max, int range);
125 void SetRangecxx . . $ ConfigItem#SetRange(b9f8a67be5c7b53e).(float min, float max, int range);
126
127 // sets a callback for when an item changes
128 void SetCallbackcxx . . $ ConfigItem#SetCallback(3bb669cff3be67f9).(void (*callback)(float));
129 void SetCallbackcxx . . $ ConfigItem#SetCallback(94eb4457dc8d4d10).(void (*callback)(int));
130 void SetCallbackcxx . . $ ConfigItem#SetCallback(ea22beb3ee77eebe).(void (*callback)(bool));
131
132 // updates the config item (pass in result from DoUI)
133 void Updatecxx . . $ ConfigItem#Update(d4f767463ce0a6b3).(int result);
134
135 // adds items to the config item (count is number of items, followed by a list of UITextItems)
136 void Addcxx . . $ ConfigItem#Add(c2886f81a411d68e).(int count, ...);
137
138 friend void CIListBoxCallbackcxx . . $ CIListBoxCallback(6ca3d68f5c5f0975).(int ID, void *);
139 friend void CISliderCallbackcxx . . $ CISliderCallback(6ca3d68f5c5f0975).(int ID, void *);
140
141 private:
142 bool Createcxx . . $ ConfigItem#Create(7794d1f573484a60).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, int flags, int x, int y, int w, int h, char *label, int item_x);
143 void UpdateHotSpotListcxx . . $ ConfigItem#UpdateHotSpotList(d4f767463ce0a6b3).(int index);
144 void UpdateSlidercxx . . $ ConfigItem#UpdateSlider(918ebd27a9ddbad3).(int index, bool call_callback = true);
145 void UpdateOnOffButtoncxx . . $ ConfigItem#UpdateOnOffButton(d4f767463ce0a6b3).(int index);
146 void UpdateListBoxcxx . . $ ConfigItem#UpdateListBox(d4f767463ce0a6b3).(int index);
147 void UpdateYesNoButtoncxx . . $ ConfigItem#UpdateYesNoButton(d4f767463ce0a6b3).(int index);
148 void UpdateRadioButtoncxx . . $ ConfigItem#UpdateRadioButton(d4f767463ce0a6b3).(int index);
149 void UpdateCheckBoxcxx . . $ ConfigItem#UpdateCheckBox(d4f767463ce0a6b3).(int index);
150
151 bool m_bAlivecxx . . $ ConfigItem#m_bAlive.; // true is the config item has been created not destroyed yet
152 // Initial value of the config item
153 unioncxx . . $ ConfigItem#$anonymous_type_0# {
154 bool m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial.;
155 int m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.;
156 float m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial.;
157 };
158 // current value of the config item
159 unioncxx . . $ ConfigItem#$anonymous_type_1# {
160 bool m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.;
161 int m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.;
162 float m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue.;
163 };
164 int m_Xcxx . . $ ConfigItem#m_X., m_Ycxx . . $ ConfigItem#m_Y., m_Wcxx . . $ ConfigItem#m_W., m_Hcxx . . $ ConfigItem#m_H.; // x,y, width and height for the config item
165 int curr_xcxx . . $ ConfigItem#curr_x., curr_ycxx . . $ ConfigItem#curr_y.; // current x and y (relative to m_X and m_Y)
166 int m_iFlagscxx . . $ ConfigItem#m_iFlags.; // flags for config item
167 int m_iTypecxx . . $ ConfigItem#m_iType.; // how is this config item represented
168 int *m_iIDcxx . . $ ConfigItem#m_iID.; // unique ID[s] of the config item
169 int m_iNumIDscxx . . $ ConfigItem#m_iNumIDs.; // number of IDs
170 int m_iItemscxx . . $ ConfigItem#m_iItems.; // number of items associated with this config item
171 int m_iValueTypecxx . . $ ConfigItem#m_iValueType.; // what kind of value is this config item holding
172 UITextcxx . . $ UIText# m_tLabelcxx . . $ ConfigItem#m_tLabel.; // Text item for the label
173 UIGroupcxx . . $ UIGroup# m_gGroupcxx . . $ ConfigItem#m_gGroup.; // Group box if needed
174 int m_auxXcxx . . $ ConfigItem#m_auxX.; // contains the original x passed in
175 int m_auxYcxx . . $ ConfigItem#m_auxY.; // contains the original y passed in
176 UITextcxx . . $ UIText# m_tLabel2cxx . . $ ConfigItem#m_tLabel2.; // Used for Sliders
177 NewUIGameWindowcxx . . $ NewUIGameWindow# *m_hWndcxx . . $ ConfigItem#m_hWnd.; // parent window
178 UITextItemcxx . . $ UITextItem# **m_tiListcxx . . $ ConfigItem#m_tiList.; // list of text items for config item
179 int m_tiCountcxx . . $ ConfigItem#m_tiCount.; // number of text items
180 UIHotspotcxx . . $ UIHotspot# **m_hsListcxx . . $ ConfigItem#m_hsList.; // list of hotspot items
181 int m_hsCountcxx . . $ ConfigItem#m_hsCount.; // number of hotspot items
182 NewUISlidercxx . . $ NewUISlider# **m_sListcxx . . $ ConfigItem#m_sList.; // list of slider items
183 int m_sCountcxx . . $ ConfigItem#m_sCount.; // number of sliders
184 UIRadioButtoncxx . . $ UIRadioButton# **m_rbListcxx . . $ ConfigItem#m_rbList.; // list of radio buttons
185 int m_rbCountcxx . . $ ConfigItem#m_rbCount.; // number of radio buttons
186 NewUIButtoncxx . . $ NewUIButton# **m_bListcxx . . $ ConfigItem#m_bList.; // list of button items
187 int m_bCountcxx . . $ ConfigItem#m_bCount.; // number of buttons
188 NewUIListBoxcxx . . $ NewUIListBox# **m_lbListcxx . . $ ConfigItem#m_lbList.; // list of list boxes
189 int m_lbCountcxx . . $ ConfigItem#m_lbCount.; // number of list boxes
190 float m_fMincxx . . $ ConfigItem#m_fMin., m_fMaxcxx . . $ ConfigItem#m_fMax.; // range min/max
191 int m_iRangecxx . . $ ConfigItem#m_iRange.; // range
192 float m_fUnitcxx . . $ ConfigItem#m_fUnit.; // scale between min->max to fit in range
193 char *m_labeltextcxx . . $ ConfigItem#m_labeltext.; // we need to save the label for group boxes
194 void (*m_fCallbackcxx . . $ ConfigItem#m_fCallback.)(float);
195 void (*m_iCallbackcxx . . $ ConfigItem#m_iCallback.)(int);
196 void (*m_bCallbackcxx . . $ ConfigItem#m_bCallback.)(bool);
197 };
198
199 #endif