ARB
Classes | Macros | Typedefs | Functions
awt_config_manager.hxx File Reference
#include <ConfigMapping.h>
#include <aw_base.hxx>
#include <cb.h>
Include dependency graph for awt_config_manager.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AWT_config_mapping_def
 
struct  AWT_predefined_config
 
class  AWT_config
 
class  AWT_config_definition
 

Macros

#define awt_assert(cond)   arb_assert(cond)
 

Typedefs

typedef char *(* ConfigModifyCallback )(const char *key, const char *value, AW_CL cl_user)
 

Functions

 DECLARE_CBTYPE_FVV_AND_BUILDERS (ConfigSetupCallback, void, AWT_config_definition &)
 
 DECLARE_CBTYPE_VV_AND_BUILDERS (StoreConfigCallback, char *)
 
 DECLARE_CBTYPE_FVV_AND_BUILDERS (RestoreConfigCallback, void, const char *)
 
void AWT_insert_config_manager (AW_window *aww, AW_default default_file_, const char *id, const StoreConfigCallback &store, const RestoreConfigCallback &load_or_reset, const char *macro_id=NULp, const AWT_predefined_config *predef=NULp)
 
void AWT_insert_config_manager (AW_window *aww, AW_default default_file_, const char *id, ConfigSetupCallback setup_cb, const char *macro_id=NULp, const AWT_predefined_config *predef=NULp)
 
void AWT_insert_config_manager (AW_window *aww, AW_default default_file_, const char *id, const AWT_config_mapping_def *mapping, const char *macro_id=NULp, const AWT_predefined_config *predef=NULp)
 
void AWT_modify_managed_configs (AW_default default_file_, const char *id, ConfigModifyCallback mod_cb, AW_CL cl_user)
 

Macro Definition Documentation

#define awt_assert (   cond)    arb_assert(cond)

Typedef Documentation

typedef char*(* ConfigModifyCallback)(const char *key, const char *value, AW_CL cl_user)

Definition at line 142 of file awt_config_manager.hxx.

Function Documentation

DECLARE_CBTYPE_FVV_AND_BUILDERS ( ConfigSetupCallback  ,
void  ,
AWT_config_definition  
)
DECLARE_CBTYPE_VV_AND_BUILDERS ( StoreConfigCallback  ,
char  
)
DECLARE_CBTYPE_FVV_AND_BUILDERS ( RestoreConfigCallback  ,
void  ,
const char  
)
void AWT_insert_config_manager ( AW_window aww,
AW_default  default_file_,
const char id,
const StoreConfigCallback &  store,
const RestoreConfigCallback &  load_or_reset,
const char macro_id = NULp,
const AWT_predefined_config predef = NULp 
)

inserts a config-button into aww

Parameters
default_file_db where configs will be stored (use AW_ROOT_DEFAULT to store in properties)
idunique id (has to be a key)
store_cbcreates a string from current state
load_or_reset_cbrestores state from string or resets factory defaults if string is NULp
macro_idcustom macro id (normally default (=NULp) will do)
predefpredefined configs (default: none)

Definition at line 856 of file AWT_config_manager.cxx.

References AW_window::button_length(), AW_window::callback(), AW_window::create_button(), create_config_manager_window(), destroy_AWT_configuration(), and AW_window::get_button_length().

Referenced by AP_create_con_expert_window(), AWT_create_www_window(), AWT_insert_config_manager(), create_colorTranslationTable_window(), create_common_next_neighbour_fields(), create_configuration_marker_window(), create_helix_props_window(), create_insertDeleteBySAI_window(), create_key_map_window(), create_matrix_settings_window(), create_modify_fields_window(), create_primer_design_window(), create_probe_design_window(), create_probe_match_window(), QUERY::create_query_box(), RefEntries::create_refentries_window(), create_tree_export_window(), createOptimizeWindow(), ED4_configure_species_flags(), ED4_create_consensus_definition_window(), ED4_create_editor_options_window(), ED4_pfold_create_props_window(), ED4_popup_dot_missing_bases_window(), ED4_popup_search_window(), FastAligner_create_window(), GDE_menuitem_cb(), MG_gene_species_create_field_transfer_def_window(), NDS_create_window(), new_sina_simple(), NT_create_moveGroupInfo_window(), PH_create_filter_window(), popup_group_search_window(), SAI_popup_calculator_window(), SEC_create_display_window(), SQ_create_seq_quality_window(), STAT_create_chimera_check_window(), and TREE_create_settings_window().

void AWT_insert_config_manager ( AW_window aww,
AW_default  default_file_,
const char id,
ConfigSetupCallback  setup_cb,
const char macro_id = NULp,
const AWT_predefined_config predef = NULp 
)

inserts a config-button into aww

Parameters
default_file_db where configs will be stored (use AW_ROOT_DEFAULT to store in properties)
idunique id (has to be a key)
setup_cbpopulates an AWT_config_definition (cl is passed to setup_cb)
macro_idcustom macro id (normally default (=NULp) will do)
predefpredefined configs (default: none)

Definition at line 891 of file AWT_config_manager.cxx.

References AWT_insert_config_manager(), load_or_reset_generated_config_cb(), and store_generated_config_cb().

void AWT_insert_config_manager ( AW_window aww,
AW_default  default_file_,
const char id,
const AWT_config_mapping_def mapping,
const char macro_id = NULp,
const AWT_predefined_config predef = NULp 
)

inserts a config-button into aww

Parameters
default_file_db where configs will be stored (use AW_ROOT_DEFAULT to store in properties)
idunique id (has to be a key)
mappinghardcoded mapping between AWARS and config strings
macro_idcustom macro id (normally default (=NULp) will do)
predefpredefined configs (default: none)

Definition at line 911 of file AWT_config_manager.cxx.

References AWT_insert_config_manager(), and generate_config_from_mapping_cb().

void AWT_modify_managed_configs ( AW_default  default_file_,
const char id,
ConfigModifyCallback  mod_cb,
AW_CL  cl_user 
)

allows to modify (parts of) all stored configs

Parameters
default_filehas to be same as used in AWT_insert_config_manager()
idditto
mod_cbcalled with each key/value pair of each stored config. result == NULp -> delete pair; result != NULp -> change or leave unchanged (result has to be a heapcopy!)
cl_userforwarded to mod_cb

Definition at line 1108 of file AWT_config_manager.cxx.

References aw_message(), AWT_config::config_string(), AWT_config::delete_entry(), GB_FIND, GB_read_char_pntr(), GB_search(), GB_write_string(), GBS_global_string(), ConfigDefinition::get_config_dbpath(), ConfigDefinition::get_db(), AWT_config::get_entries(), AWT_config::get_entry(), get_existing_configs(), NULp, AWT_config::parseError(), AWT_config::set_entry(), CharPtrArray::size(), and ta.

Referenced by modify_configurations().