ARB
Classes | Macros | Enumerations | Functions
AWT_config_manager.cxx File Reference
#include "awt_config_manager.hxx"
#include "awt_sel_boxes.hxx"
#include "awt.hxx"
#include <aw_root.hxx>
#include <aw_question.hxx>
#include <aw_awar.hxx>
#include <aw_msg.hxx>
#include <aw_select.hxx>
#include <arb_defs.h>
#include <arb_str.h>
Include dependency graph for AWT_config_manager.cxx:

Go to the source code of this file.

Classes

class  ConfigDefinition
 
class  AWT_configuration
 

Macros

#define HEADER   "ARB_CONFIGURATION"
 
#define HEADERLEN   17
 
#define NO_CONFIG_SELECTED   "<no config selected>"
 

Enumerations

enum  ConfigAwar {
  VISIBLE_COMMENT, STORED_COMMENTS, EXISTING_CFGS, CURRENT_CFG,
  SELECTED_FIELD, FIELD_CONTENT, CONFIG_AWARS
}
 

Functions

bool is_prefined (const string &cfgname)
 
void remove_from_configs (const string &config, string &existing_configs)
 
static void current_changed_cb (AW_root *, AWT_configuration *config)
 
void save_comments (const AWT_config &comments, AWT_configuration *config)
 
static void comment_changed_cb (AW_root *, AWT_configuration *config)
 
static void erase_comment_cb (AW_window *, AW_awar *awar_comment)
 
static void restore_cb (AW_window *, AWT_configuration *config)
 
static void store_cb (AW_window *, AWT_configuration *config)
 
static void delete_cb (AW_window *, AWT_configuration *config)
 
static void load_cb (AW_window *, AWT_configuration *config)
 
static void save_cb (AW_window *, AWT_configuration *config)
 
static void keep_changed_fields_cb (AW_window *, AWT_configuration *config)
 
static void delete_field_cb (AW_window *, AWT_configuration *config)
 
static void selected_field_changed_cb (AW_root *, AWT_configuration *config)
 
static void field_content_changed_cb (AW_root *, AWT_configuration *config)
 
static void edit_cb (AW_window *aww, AWT_configuration *config)
 
static void reset_cb (AW_window *, AWT_configuration *config)
 
static void get_existing_configs (ConfigDefinition &configDef, ConstStrArray &cfgs)
 
static void refresh_config_sellist_cb (AW_root *, AWT_configuration *config, AW_selection_list *sel)
 
static AW_windowcreate_config_manager_window (AW_root *, AWT_configuration *config, AW_window *aww)
 
static void destroy_AWT_configuration (AWT_configuration *c, AW_window *)
 
void AWT_insert_config_manager (AW_window *aww, AW_default default_file_, const char *id, const StoreConfigCallback &store_cb, const RestoreConfigCallback &load_or_reset_cb, const char *macro_id, const AWT_predefined_config *predef)
 
static charstore_generated_config_cb (const ConfigSetupCallback *setup_cb)
 
static void load_or_reset_generated_config_cb (const char *stored_string, const ConfigSetupCallback *setup_cb)
 
void AWT_insert_config_manager (AW_window *aww, AW_default default_file_, const char *id, ConfigSetupCallback setup_cb, const char *macro_id, const AWT_predefined_config *predef)
 
static void generate_config_from_mapping_cb (AWT_config_definition &cdef, const AWT_config_mapping_def *mapping)
 
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, const AWT_predefined_config *predef)
 
void warn_unknown_awar (const string &awar_name)
 
void AWT_modify_managed_configs (AW_default default_file, const char *id, ConfigModifyCallback mod_cb, AW_CL cl_user)
 

Macro Definition Documentation

#define HEADER   "ARB_CONFIGURATION"

Definition at line 191 of file AWT_config_manager.cxx.

Referenced by AWT_configuration::Load(), and AWT_configuration::Save().

#define HEADERLEN   17

Definition at line 192 of file AWT_config_manager.cxx.

Referenced by AWT_configuration::Load(), and AWT_configuration::Save().

#define NO_CONFIG_SELECTED   "<no config selected>"

Enumeration Type Documentation

enum ConfigAwar
Enumerator
VISIBLE_COMMENT 
STORED_COMMENTS 
EXISTING_CFGS 
CURRENT_CFG 
SELECTED_FIELD 
FIELD_CONTENT 
CONFIG_AWARS 

Definition at line 31 of file AWT_config_manager.cxx.

Function Documentation

bool is_prefined ( const string cfgname)
void remove_from_configs ( const string config,
string existing_configs 
)

Definition at line 294 of file AWT_config_manager.cxx.

References GBT_join_strings(), GBT_split_string(), and ConstStrArray::put().

Referenced by delete_cb(), and store_cb().

static void current_changed_cb ( AW_root ,
AWT_configuration config 
)
static
void save_comments ( const AWT_config comments,
AWT_configuration config 
)
inline
static void comment_changed_cb ( AW_root ,
AWT_configuration config 
)
static
static void erase_comment_cb ( AW_window ,
AW_awar awar_comment 
)
static

Definition at line 403 of file AWT_config_manager.cxx.

References AW_awar::write_string().

Referenced by create_config_manager_window().

static void restore_cb ( AW_window ,
AWT_configuration config 
)
static
static void store_cb ( AW_window ,
AWT_configuration config 
)
static
static void delete_cb ( AW_window ,
AWT_configuration config 
)
static
static void load_cb ( AW_window ,
AWT_configuration config 
)
static
static void save_cb ( AW_window ,
AWT_configuration config 
)
static
static void keep_changed_fields_cb ( AW_window ,
AWT_configuration config 
)
static
static void delete_field_cb ( AW_window ,
AWT_configuration config 
)
static
static void selected_field_changed_cb ( AW_root ,
AWT_configuration config 
)
static
static void field_content_changed_cb ( AW_root ,
AWT_configuration config 
)
static
static void edit_cb ( AW_window aww,
AWT_configuration config 
)
static
static void reset_cb ( AW_window ,
AWT_configuration config 
)
static

Definition at line 755 of file AWT_config_manager.cxx.

References AWT_configuration::Reset().

Referenced by create_config_manager_window().

static void get_existing_configs ( ConfigDefinition configDef,
ConstStrArray cfgs 
)
static
static void refresh_config_sellist_cb ( AW_root ,
AWT_configuration config,
AW_selection_list sel 
)
static
static AW_window* create_config_manager_window ( AW_root ,
AWT_configuration config,
AW_window aww 
)
static
static void destroy_AWT_configuration ( AWT_configuration c,
AW_window  
)
static

Definition at line 854 of file AWT_config_manager.cxx.

Referenced by AWT_insert_config_manager().

void AWT_insert_config_manager ( AW_window aww,
AW_default  default_file_,
const char id,
const StoreConfigCallback &  store_cb,
const RestoreConfigCallback &  load_or_reset_cb,
const char macro_id,
const AWT_predefined_config predef 
)

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().

static char* store_generated_config_cb ( const ConfigSetupCallback *  setup_cb)
static

Definition at line 878 of file AWT_config_manager.cxx.

References AWT_config_definition::read().

Referenced by AWT_insert_config_manager().

static void load_or_reset_generated_config_cb ( const char stored_string,
const ConfigSetupCallback *  setup_cb 
)
static
void AWT_insert_config_manager ( AW_window aww,
AW_default  default_file_,
const char id,
ConfigSetupCallback  setup_cb,
const char macro_id,
const AWT_predefined_config predef 
)

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().

static void generate_config_from_mapping_cb ( AWT_config_definition cdef,
const AWT_config_mapping_def mapping 
)
static

Definition at line 907 of file AWT_config_manager.cxx.

References AWT_config_definition::add().

Referenced by AWT_insert_config_manager().

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,
const AWT_predefined_config predef 
)

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 warn_unknown_awar ( const string awar_name)
inline

Definition at line 932 of file AWT_config_manager.cxx.

References aw_message(), and GBS_global_string().

Referenced by AWT_config_definition::reset().

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().