3 const USHORT pix_per_in = 72;
4 const USHORT max_ushort = 65535;
5 const LONG max_long = 0x7FFFFFFF;
6 const DOUBLE my_pi = 3.14159265358979323846;
7 const DOUBLE nat_log_of_2 = .69314718056;
11 const CHAR my_endline =
'\n';
13 const USHORT max_file_path_len = 1024;
16 const DOUBLE amps_floor = 1e-11;
17 const DOUBLE probs_floor = 1e-11;
18 enum COORD_SYSTEM {polar_cs, rect_cs};
21 #pragma mark ---------used only with macgui-------- 22 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\. 25 #pragma mark --general constants:-- 27 const Rect the_zero_rect = {0x0000, 0x0000, 0x0000, 0x0000};
29 const OSType my_creator_id =
'QFog';
30 const OSType my_file_type_id =
'QNet';
34 enum NET_STREAM_TYPE {open_reco, paste_reco, undel_reco};
36 #pragma mark --version constants:-- 51 const SInt32 k_vers_100 = 0x01008001;
52 const SInt32 k_vers_150 = 0x01508001;
53 const SInt32 k_vers_160 = 0x01608000;
54 const SInt32 k_vers_200 = 0x02008000;
55 const SInt32 k_vers_app = k_vers_200;
57 #pragma mark --uaction related-- 58 const USHORT max_num_of_act_types = 2;
60 const USHORT mview_num_of_act_types = 1;
61 const USHORT mview_del = 0;
63 const USHORT etable_num_of_act_types = 2;
64 const USHORT etable_del = 0;
65 const USHORT etable_paste = 1;
72 #pragma mark --toolbox resources-- 73 #pragma mark 'ALRT' rids 74 const ResIDT gen_alert_rid = 129;
75 const ResIDT cannot_undo_alert_rid = 131;
76 #pragma mark 'cicn' rids 77 const ResIDT fog_horn_icon_rid = 128;
79 #pragma mark 'CURS' rids 80 const ResIDT pointing_hand_rid = 200;
81 const ResIDT open_hand_rid = 205;
82 const ResIDT closed_hand_rid = 206;
83 const ResIDT explosion_rid = 207;
84 const ResIDT clockwise_rot_rid = 211;
85 const ResIDT paint_brush_rid = 212;
86 const ResIDT eye_dropper_rid = 213;
87 const ResIDT bow_and_arrow_rid = 215;
88 const ResIDT arrow_source_rid = 216;
90 const ResIDT bi_node_and_pointing_hand_rid = 400;
92 #pragma mark 'ICN#' rids 93 const ResIDT qbit_rot_icon_rid = 200;
94 const ResIDT sg_magnet_icon_rid = 201;
96 #pragma mark 'inc#' rids 98 const ResIDT selection_tool_rid = 1110;
99 const ResIDT drag_tool_rid = 1120;
100 const ResIDT open_tool_rid = 1130;
101 const ResIDT rotation_tool_rid = 1140;
102 const ResIDT paint_tool_rid = 1150;
103 const ResIDT copy_color_tool_rid = 1160;
104 const ResIDT arrow_tool_rid = 1170;
105 const ResIDT arrow_source_tool_rid = 1180;
107 const ResIDT beam_spl_tool_rid = 1190;
108 const ResIDT custom_node_tool_rid = 1200;
109 const ResIDT determ_node_tool_rid = 1210;
110 const ResIDT pol_rot_tool_rid = 1220;
111 const ResIDT pol_tool_rid = 1230;
112 const ResIDT qbit_rot_tool_rid = 1240;
113 const ResIDT sg_magnet_tool_rid = 1250;
115 const ResIDT bi_nd_selector_tool_rid = 1300;
117 #pragma mark 'MENU' rids 118 const ResIDT project_menu_rid = 255;
120 #pragma mark 'ppat' rids 121 const ResIDT pol_rot_pat_rid = 200;
122 const ResIDT pol_pat_rid = 250;
124 #pragma mark 'PICT' rids 125 const ResIDT ggate_pict_rid = 128;
127 #pragma mark 'snd ' rids 128 const ResIDT fog_horn_snd_rid = 3001;
130 #pragma mark 'STR#' rids 131 const ResIDT my_redo_rid = 250;
132 const ResIDT my_undo_rid = 251;
133 const ResIDT undel_ind = 1;
134 const ResIDT uncut_ind = 2;
135 const ResIDT unpaste_ind = 3;
137 #pragma mark --PP specific resources-- 138 #pragma mark 'Txtr' rids 147 const ResIDT sysFont12_rid = 201;
148 const ResIDT sysFont12_c_rid = 202;
149 const ResIDT node_txt_rid = sysFont12_c_rid;
150 const ResIDT sysFont12_ul_rid = 203;
152 const ResIDT Verdana9_rid = 300;
153 const ResIDT Verdana12_rid = 311;
155 #pragma mark 'PPob' rids 157 const ResIDT ata_window_rid = 1000;
158 const ResIDT ata_fog_horn_but_rid = 1002;
160 const ResIDT main_window_rid = 1050;
161 const ResIDT main_scroller_rid = 1051;
162 const ResIDT mview_rid = 1052;
163 const ResIDT main_wind_cap_rid = 1053;
165 const ResIDT pal_rid = 1100;
166 const ResIDT pal_icon_table_rid = 1101;
167 const ResIDT pal_swatch_rid = 1151;
168 const ResIDT pal_nd_tool_popup_rid = 1190;
171 const ResIDT printout_rid = 1400;
172 const ResIDT placeholder_rid = 1401;
174 const ResIDT other_fsize_window_rid = 1500;
175 const ResIDT other_fsize_efield_rid = 1504;
177 const ResIDT ds_window_rid = 1600;
178 const ResIDT ds_horiz_efield_rid = 1606;
179 const ResIDT ds_vert_efield_rid = 1607;
180 const ResIDT ds_page_setup_but_rid= 1608;
182 const ResIDT tf_folder_but_rid= 1703;
183 const ResIDT tf_folder_cap_rid= 1704;
184 const ResIDT tf_prefix_efield_rid= 1705;
186 const ResIDT tf_window_rid= 1700;
187 const ResIDT tf_ecases_cbox_rid= 1711;
188 const ResIDT tf_nd_probs_cbox_rid= 1712;
189 const ResIDT tf_bi_nd_probs_cbox_rid= 1713;
190 const ResIDT tf_stories_cbox_rid= 1714;
193 const ResIDT af_wind_rid= 1780;
194 const ResIDT af_des_finesse_efield_rid= 1783;
195 const ResIDT af_cur_finesse_cap_rid= 1784;
197 const ResIDT pi_wind_rid= 1800;
200 const ResIDT pi_owner_cap_rid= 1805;
201 const ResIDT pi_nd_efield_rid= 1811;
202 const ResIDT pi_nd_popup_rid= 1812;
203 const ResIDT pi_first_nd_but_rid= 1813;
204 const ResIDT pi_next_nd_but_rid= 1814;
205 const ResIDT pi_reorder_nds_but_rid= 1815;
206 const ResIDT pi_first_in_st_but_rid= 1830;
207 const ResIDT pi_prev_in_st_but_rid= 1831;
208 const ResIDT pi_next_in_st_but_rid= 1832;
209 const ResIDT pi_parents_table_rid= 1836;
210 const ResIDT pi_reorder_in_nds_but_rid= 1837;
211 const ResIDT pi_all_act_but_rid= 1842;
212 const ResIDT pi_none_act_but_rid= 1843;
213 const ResIDT pi_polar_radio_rid= 1844;
214 const ResIDT pi_rect_radio_rid= 1845;
215 const ResIDT pi_rad_re_cap_rid= 1848;
216 const ResIDT pi_ang_im_cap_rid= 1849;
217 const ResIDT pi_amps_table_rid= 1851;
218 const ResIDT pi_reorder_nd_sts_but_rid= 1852;
219 const ResIDT pi_num_of_rows_cap_rid= 1860;
220 const ResIDT pi_num_of_rows_but_rid= 1861;
221 const ResIDT pi_total_prob_but_rid= 1870;
222 const ResIDT pi_total_prob_cap_rid= 1871;
223 const ResIDT pi_gen_st_names_but_rid= 1881;
224 const ResIDT pi_gen_amps_but_rid= 1882;
226 const ResIDT bi_nd_wind_rid = 1900;
227 const ResIDT bi_nd_list_box_rid = 1910;
228 const ResIDT bi_nd_check_box_rid = 1920;
229 const ResIDT bi_nd_owner_cap_rid = 1940;
231 const ResIDT nd_probs_wind_rid= 2000;
232 const ResIDT nd_probs_owner_cap_rid= 2001;
233 const ResIDT nd_probs_popup_rid= 2010;
234 const ResIDT nd_probs_first_but_rid= 2011;
235 const ResIDT nd_probs_next_but_rid= 2012;
236 const ResIDT nd_probs_info_cap_rid= 2016;
237 const ResIDT nd_probs_table_rid= 2021;
239 const ResIDT bi_nd_probs_wind_rid= 2100;
240 const ResIDT bi_nd_probs_owner_cap_rid= 2101;
241 const ResIDT bi_nd_probs_popup_rid= 2110;
242 const ResIDT bi_nd_probs_first_but_rid= 2111;
243 const ResIDT bi_nd_probs_next_but_rid= 2112;
244 const ResIDT bi_nd_probs_state_cap_rid= 2115;
245 const ResIDT bi_nd_probs_info_cap_rid= 2117;
246 const ResIDT bi_nd_probs_scroller_rid= 2120;
247 const ResIDT bi_nd_probs_table_rid= 2121;
248 const ResIDT bi_nd_probs_lmargin_rid= 2122;
249 const ResIDT bi_nd_probs_tmargin_rid= 2123;
251 const ResIDT sto_wind_rid= 2200;
252 const ResIDT sto_wind_owner_cap_rid= 2201;
253 const ResIDT sto_wind_cs_cap_rid= 2203;
254 const ResIDT sto_wind_popup_rid= 2204;
255 const ResIDT sto_wind_polar_radio_rid= 2211;
256 const ResIDT sto_wind_rect_radio_rid= 2212;
257 const ResIDT sto_wind_first_but_rid= 2213;
258 const ResIDT sto_wind_next_but_rid= 2214;
260 const ResIDT det_wind_rid= 2300;
261 const ResIDT det_nd_type_popup_rid= 2311;
262 const ResIDT det_host_view_rid= 2312;
263 const ResIDT cnot_pane_rid= 2320;
264 const ResIDT cnot_pa1_radio_rid= 2322;
265 const ResIDT cnot_pa2_radio_rid= 2323;
266 const ResIDT cnot_0fires_radio_rid= 2325;
267 const ResIDT cnot_1fires_radio_rid= 2326;
268 const ResIDT marg_pane_rid= 2340;
269 const ResIDT marg_pos_efield_rid= 2342;
270 const ResIDT marg_len_efield_rid= 2344;
271 const ResIDT pshifter_pane_rid= 2360;
272 const ResIDT pshifter_theta_efield_rid= 2362;
273 const ResIDT pshifter_check_box_rid= 2364;
275 const ResIDT sg_magnet_window_rid= 2400;
276 const ResIDT sg_magnet_theta_efield_rid= 2413;
277 const ResIDT sg_magnet_phi_efield_rid= 2415;
278 const ResIDT sg_magnet_table_rid= 2426;
280 const ResIDT bs_window_rid= 2500;
281 const ResIDT bs_tau_mag_sq_efield_rid= 2512;
282 const ResIDT bs_tau_ang_efield_rid= 2514;
283 const ResIDT bs_rho_ang_efield_rid= 2516;
284 const ResIDT bs_max_n_sum_efield_rid= 2518;
286 const ResIDT pol_window_rid= 2600;
287 const ResIDT pol_efield_rid= 2612;
289 const ResIDT pol_rot_window_rid= 2700;
290 const ResIDT pol_rot_efield_rid= 2712;
292 const ResIDT qbit_rot_window_rid= 2800;
293 const ResIDT qbit_rot_theta0_efield_rid= 2820;
294 const ResIDT qbit_rot_theta1_efield_rid= 2821;
295 const ResIDT qbit_rot_theta2_efield_rid= 2822;
296 const ResIDT qbit_rot_theta3_efield_rid= 2823;
298 const ResIDT rows_wind_rid= 4000;
299 const ResIDT rows_wind_ok_but_rid= 4001;
300 const ResIDT rows_wind_cancel_but_rid= 4002;
301 const ResIDT rows_wind_efield_rid= 4003;
303 const ResIDT q_wind_rid= 4100;
304 const ResIDT q_abc_but_rid= 4103;
305 const ResIDT qtable_rid= 4112;
307 const ResIDT gn_wind_rid= 4200;
308 const ResIDT gn_num_of_comps_efield_rid= 4212;
309 const ResIDT gn_min_char_efield_rid= 4222;
310 const ResIDT gn_max_char_efield_rid= 4224;
311 const ResIDT gn_commas_check_box_rid = 4231;
313 const ResIDT pv_window_rid = 4300;
314 const ResIDT pv_total_prob_rid = 4310;
315 const ResIDT pv_num_of_stories_rid = 4311;
317 const PaneIDT first_nd_efield_rid = 10001;
318 const PaneIDT first_pi_pa_st_popup_PPob_rid = 20001;
320 const ResIDT per_dial_rid = 4400;
321 const ResIDT per_dial_cap_rid = 4410;
324 #pragma mark 'RidL' rids 325 const ResIDT pal_ridl = pal_rid;
326 const ResIDT pi_wind_ridl = pi_wind_rid;
327 const ResIDT bi_nd_wind_ridl = bi_nd_wind_rid;
328 const ResIDT nd_probs_wind_ridl = nd_probs_wind_rid;
329 const ResIDT bi_nd_probs_wind_ridl = bi_nd_probs_wind_rid;
330 const ResIDT sto_wind_ridl = sto_wind_rid;
332 #pragma mark commands 334 const CommandT cmd_import = 2001;
335 const CommandT cmd_import_nd_sts = 20011;
336 const CommandT cmd_import_amps = 20012;
338 const CommandT cmd_export = 2002;
339 const CommandT cmd_export_topology = 20021;
340 const CommandT cmd_export_nd_sts = 20022;
341 const CommandT cmd_export_amps = 20023;
343 const CommandT cmd_drawing_size= 3001;
344 const CommandT cmd_grid_lines= 3002;
345 const CommandT cmd_choose_color= 3003;
346 const CommandT cmd_filter_out_small_amps= 3005;
348 const CommandT cmd_preview= 4002;
349 const CommandT cmd_text_files= 4003;
350 const CommandT cmd_do_one_ecase_at_a_time= 4004;
351 const CommandT cmd_illustrate_stories= 4005;
353 const CommandT cmd_initial_run_state= 5001;
354 const CommandT cmd_go_forward= 5002;
356 const CommandT cmd_active_project= 6001;
357 const CommandT cmd_show_main_wind= 6002;
358 const CommandT cmd_show_palette= 6003;
359 const CommandT cmd_show_pi_wind= 6004;
360 const CommandT cmd_show_bi_nd_wind= 6005;
361 const CommandT cmd_show_nd_probs_wind= 6006;
362 const CommandT cmd_show_bi_nd_probs_wind= 6007;
363 const CommandT cmd_show_stories_wind= 6008;
365 const CommandT cmd_close_all_non_main_winds = 6100;
366 const CommandT cmd_doc_SetModified = 6101;
368 #pragma mark messages 370 const MessageT msg_ata_fog_horn_but= ata_fog_horn_but_rid;
372 const MessageT msg_pal_nd_tool_popup = pal_nd_tool_popup_rid;
374 const MessageT msg_tf_folder_but= tf_folder_but_rid;
376 const MessageT msg_mv_nd_efield= mview_rid;
378 const MessageT msg_pi_refresh_num_of_rows_cap= pi_amps_table_rid;
379 const MessageT msg_pi_nd_efield= pi_nd_efield_rid;
380 const MessageT msg_pi_nd_popup= pi_nd_popup_rid;
381 const MessageT msg_pi_first_nd_but= pi_first_nd_but_rid;
382 const MessageT msg_pi_next_nd_but= pi_next_nd_but_rid;
383 const MessageT msg_pi_reorder_nds_but= pi_reorder_nds_but_rid;
384 const MessageT msg_pi_reorder_in_nds_but= pi_reorder_in_nds_but_rid;
385 const MessageT msg_pi_reorder_nd_sts_but= pi_reorder_nd_sts_but_rid;
386 const MessageT msg_pi_first_in_st_but= pi_first_in_st_but_rid;
387 const MessageT msg_pi_prev_in_st_but= pi_prev_in_st_but_rid;
388 const MessageT msg_pi_next_in_st_but= pi_next_in_st_but_rid;
389 const MessageT msg_pi_all_act_but= pi_all_act_but_rid;
390 const MessageT msg_pi_none_act_but= pi_none_act_but_rid;
391 const MessageT msg_pi_polar_radio= pi_polar_radio_rid;
392 const MessageT msg_pi_clear_total_prob_cap= pi_total_prob_cap_rid;
393 const MessageT msg_pi_total_prob_but = pi_total_prob_but_rid;
394 const MessageT msg_pi_num_of_rows_but= pi_num_of_rows_but_rid;
395 const MessageT msg_pi_gen_st_names_but= pi_gen_st_names_but_rid;
396 const MessageT msg_pi_gen_amps_but= pi_gen_amps_but_rid;
398 const MessageT msg_bi_nd_check_box = bi_nd_check_box_rid;
400 const MessageT msg_nd_probs_popup= nd_probs_popup_rid;
401 const MessageT msg_nd_probs_first_but= nd_probs_first_but_rid;
402 const MessageT msg_nd_probs_next_but= nd_probs_next_but_rid;
404 const MessageT msg_bi_nd_probs_popup= bi_nd_probs_popup_rid;
405 const MessageT msg_bi_nd_probs_first_but= bi_nd_probs_first_but_rid;
406 const MessageT msg_bi_nd_probs_next_but= bi_nd_probs_next_but_rid;
408 const MessageT msg_sto_wind_popup= sto_wind_popup_rid;
409 const MessageT msg_sto_wind_polar_radio= sto_wind_polar_radio_rid;
410 const MessageT msg_sto_wind_first_but= sto_wind_first_but_rid;
411 const MessageT msg_sto_wind_next_but= sto_wind_next_but_rid;
413 const MessageT msg_det_nd_type_popup = det_nd_type_popup_rid;
415 const MessageT msg_q_abc_but = q_abc_but_rid;
418 #endif //_mac_gui_app \\............................................//