Changeset 6666 for trunk/WINDOW/aw_root.hxx
- Timestamp:
- 21/05/10 19:44:17 (2 years ago)
- Files:
-
- 1 modified
-
trunk/WINDOW/aw_root.hxx (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WINDOW/aw_root.hxx
r6508 r6666 16 16 #endif 17 17 18 19 #define AW_ROOT_DEFAULT (aw_main_root_default) 18 #define AW_ROOT_DEFAULT AW_root::SINGLETON->check_properties(NULL) 19 20 20 class AW_root; 21 21 class AW_window; 22 typedef long AW_CL; // generic client data type (void *)22 typedef long AW_CL; // generic client data type (void *) 23 23 24 24 typedef void (*AW_RCB)(AW_root*, AW_CL, AW_CL); … … 36 36 typedef int AW_font; 37 37 38 extern AW_default aw_main_root_default;39 40 38 typedef struct _WidgetRec *Widget; 41 39 42 // #define AWUSE(variable) variable = variable43 40 #if defined(DEBUG) && defined(DEVEL_RALF) && 0 44 41 #define AWUSE(variable) (void)variable; int DONT_USE_AWUSE_FOR_##variable … … 180 177 181 178 class AW_root { 179 AW_default application_database; 180 181 void init_variables(AW_default database); 182 void exit_variables(); 183 184 void init_root(const char *programname, bool no_exit); 185 AW_default load_properties(const char *default_name); 186 182 187 public: 183 static AW_root *THIS; 184 AW_root_Motif *prvt; // Do not use !!! 185 bool value_changed; 186 long changer_of_variable; 187 int y_correction_for_input_labels; 188 AW_active global_mask; 189 GB_HASH *hash_table_for_variables; 190 bool variable_set_by_toggle_field; 191 int number_of_toggle_fields; 192 int number_of_option_menus; 193 char *program_name; 188 static AW_root *SINGLETON; 189 190 AW_root_Motif *prvt; // Do not use !!! 191 bool value_changed; 192 long changer_of_variable; 193 int y_correction_for_input_labels; 194 AW_active global_mask; 195 GB_HASH *hash_table_for_variables; 196 bool variable_set_by_toggle_field; 197 int number_of_toggle_fields; 198 int number_of_option_menus; 199 char *program_name; 194 200 195 201 void *get_aw_var_struct(char *awar); … … 204 210 205 211 // the read only public section: 206 AW_default application_database;207 212 short font_width; 208 213 short font_height; … … 211 216 212 217 // the real public section: 213 AW_root( );218 AW_root(const char *properties, const char *program, bool no_exit); 214 219 ~AW_root(); 220 215 221 enum { AW_MONO_COLOR, AW_RGB_COLOR } color_mode; 216 222 217 void init_variables(AW_default database);218 void init_root(const char *programname, bool no_exit);219 223 void main_loop(); 220 void process_events(); // might block 221 void process_pending_events(); // non-blocking 224 225 void process_events(); // might block 226 void process_pending_events(); // non-blocking 222 227 AW_ProcessEventType peek_key_event(AW_window *); 223 228 … … 245 250 void unlink_awars_from_DB(GBDATA *gb_main); // use before calling GB_close for 'gb_main', if you have AWARs in DB 246 251 247 AW_default open_default(const char *default_name, bool create_if_missing = true); 248 AW_error *save_default(const char *awar_name); 249 AW_error *save_default(const char *awar_name, const char *file_name); 250 AW_error *save_default(AW_default aw_default, const char *file_name); 251 AW_default get_default(const char *varname); 252 AW_default get_gbdata(const char *varname); 252 static const char *property_DB_fullname(const char *default_name); 253 static bool property_DB_exists(const char *default_name); 254 255 AW_default check_properties(AW_default aw_props) { 256 return aw_props ? aw_props : application_database; 257 } 258 259 GB_ERROR save_properties(const char *filename = NULL) __ATTR__USERESULT; 260 261 AW_default get_gbdata(const char *varname) __ATTR__DEPRECATED; // replace by awar + gb_var 262 253 263 254 264 // Control sensitivity of buttons etc.: … … 330 340 331 341 AW_awar(AW_VARIABLE_TYPE var_type, const char *var_name, const char *var_value, double var_double_value, AW_default default_file, AW_root *root); 342 ~AW_awar(); 332 343 333 344 AW_awar *add_callback(Awar_CB2 f, AW_CL cd1, AW_CL cd2);
