ARB
Classes | Macros | Typedefs | Enumerations | Functions | Variables
NT_edconf.cxx File Reference
#include "NT_local.h"
#include "ad_trees.h"
#include <TreeNode.h>
#include <TreeDisplay.hxx>
#include <RegExpr.hxx>
#include <awt_sel_boxes.hxx>
#include <awt_misc.hxx>
#include <awt_config_manager.hxx>
#include <awt_modules.hxx>
#include <aw_awars.hxx>
#include <aw_root.hxx>
#include <aw_msg.hxx>
#include <aw_select.hxx>
#include <ad_config.h>
#include <ad_cb_prot.h>
#include <arb_global_defs.h>
#include <map>
#include <set>
#include <string>
Include dependency graph for NT_edconf.cxx:

Go to the source code of this file.

Classes

class  FINAL_TYPE< SEQTYPE >
 xml element More...
 
struct  ConfigModifier
 
class  ConfigRenamer
 
class  ConfigDeleter
 
class  Store_species
 
struct  SAI_string_builder
 

Macros

#define AWAR_CL_SELECTED_CONFIGS   "configuration_data/win%i/selected"
 
#define AWAR_CL_DISPLAY_CONFIG_MARKERS   "configuration_data/win%i/display"
 
#define AWAR_CONFIG_COMMENT   "tmp/configuration/comment"
 
#define CONFIG_SEPARATOR   "\1"
 
#define CONFIG_BASE_PATH   "/configuration_data/configuration"
 
#define MANAGED_CONFIGSET_SECTION   "configmarkers"
 
#define MANAGED_CONFIGSET_ENTRY   "selected_configs"
 

Typedefs

typedef map< string, stringConfigHits
 

Enumerations

enum  extractType {
  CONF_EXTRACT, CONF_MARK, CONF_UNMARK, CONF_INVERT,
  CONF_COMBINE
}
 
enum  ConfigCreation { BY_CALLING_THE_EDITOR, FROM_IMPORTER, FROM_MANAGER }
 

Functions

static void nt_extract_configuration (UNFIXED, extractType ext_type)
 
bool displays_config_markers (MarkerDisplay *md)
 
AW_awarget_canvas_awar (const char *awar_name_format, int canvas_id)
 
AW_awarget_config_awar (int canvas_id)
 
AW_awarget_display_toggle_awar (int canvas_id)
 
static SmartPtr< ConstStrArrayget_selected_configs_from_awar (int canvas_id)
 
static void write_configs_to_awar (int canvas_id, const CharPtrArray &configs)
 
static void init_config_awars (AW_root *root)
 
static void selected_configs_awar_changed_cb (AW_root *aw_root, TREE_canvas *ntw)
 
static void selected_configs_display_awar_changed_cb (AW_root *root, TREE_canvas *ntw)
 
static void configs_selectionlist_changed_cb (AW_selection *selected_configs, bool interactive_change, AW_CL ntw_id)
 
static void config_modified_cb (GBDATA *gb_cfg_area)
 
static void install_config_change_callbacks (GBDATA *gb_main)
 
void NT_activate_configMarkers_display (TREE_canvas *ntw)
 
static void setup_configmarker_config_cb (AWT_config_definition &config, int ntw_id)
 
static charcorrect_managed_configsets_cb (const char *key, const char *value, AW_CL cl_ConfigModifier)
 
static void modify_configurations (const ConfigModifier &mod)
 
static void configuration_renamed_cb (const char *old_name, const char *new_name)
 
static void configuration_deleted_cb (const char *name)
 
static AW_windowcreate_configuration_marker_window (AW_root *root, TREE_canvas *ntw)
 
static void unmark_species (TreeNode *node)
 
static void mark_species (TreeNode *node, Store_species **extra_marked_species)
 
static TreeNoderightmost_leaf (TreeNode *node)
 
static TreeNodeleft_neighbour_leaf (TreeNode *node)
 
static int nt_build_conf_string_rek (GB_HASH *used, TreeNode *tree, GBS_strstruct &memfile, Store_species **extra_marked_species, int use_species_aside, int *auto_mark, int marked_at_left, int *marked_at_right)
 
static void nt_build_sai_string_by_hash (const char *key, long, void *cd_sai_builder)
 
static void nt_build_sai_string (GBDATA *gb_main, const char *topAreaSaiList, GBS_strstruct &topfile, GBS_strstruct &middlefile)
 
static void nt_build_conf_marked (GBDATA *gb_main, GB_HASH *used, GBS_strstruct &file)
 
static void nt_delete_configuration (AW_window *aww, AW_DB_selection *dbsel)
 
static GB_ERROR nt_create_configuration (TreeNode *tree, const char *conf_name, int use_species_aside, ConfigCreation creation)
 
static void nt_store_configuration (AW_window *, TREE_canvas *ntw)
 
static void nt_rename_configuration (AW_window *aww)
 
static void selected_config_changed_cb (AW_root *root)
 
static void config_comment_changed_cb (AW_root *root)
 
static void init_config_admin_awars (AW_root *root)
 
static GB_ERROR swap_configs (GBDATA *gb_main, StrArray &config, int i1, int i2)
 
static void reorder_configs_cb (AW_window *aww, awt_reorder_mode mode, AW_DB_selection *sel)
 
static void clear_comment_cb (AW_window *aww)
 
static AW_windowcreate_configuration_admin_window (AW_root *root, TREE_canvas *ntw)
 
void NT_popup_configuration_admin (AW_window *aw_main, TREE_canvas *ntw)
 
static void nt_start_editor_on_configuration (AW_window *aww)
 
AW_windowNT_create_startEditorOnOldConfiguration_window (AW_root *awr)
 
void NT_start_editor_on_tree (AW_window *aww, int use_species_aside, TREE_canvas *ntw)
 
void nt_create_config_after_import (TREE_canvas *ntw)
 
void NT_create_config_after_import (TREE_canvas *ntw, bool imported_from_scratch)
 

Variables

static AW_selectionselected_configs_list [MAX_NT_WINDOWS] = { MAX_NT_WINDOWS_NULLINIT }
 
static bool allow_selection2awar_update = true
 
static bool allow_to_activate_display = false
 
const char CFG_SEP = 1
 

Macro Definition Documentation

#define AWAR_CL_SELECTED_CONFIGS   "configuration_data/win%i/selected"
#define AWAR_CL_DISPLAY_CONFIG_MARKERS   "configuration_data/win%i/display"

Definition at line 41 of file NT_edconf.cxx.

Referenced by get_display_toggle_awar(), and NT_activate_configMarkers_display().

#define AWAR_CONFIG_COMMENT   "tmp/configuration/comment"
#define CONFIG_SEPARATOR   "\1"
#define CONFIG_BASE_PATH   "/configuration_data/configuration"

Definition at line 241 of file NT_edconf.cxx.

Referenced by install_config_change_callbacks().

#define MANAGED_CONFIGSET_SECTION   "configmarkers"

Definition at line 269 of file NT_edconf.cxx.

Referenced by create_configuration_marker_window(), and modify_configurations().

#define MANAGED_CONFIGSET_ENTRY   "selected_configs"

Definition at line 270 of file NT_edconf.cxx.

Referenced by correct_managed_configsets_cb(), and setup_configmarker_config_cb().

Typedef Documentation

typedef map<string, string> ConfigHits

Definition at line 54 of file NT_edconf.cxx.

Enumeration Type Documentation

Enumerator
CONF_EXTRACT 
CONF_MARK 
CONF_UNMARK 
CONF_INVERT 
CONF_COMBINE 

Definition at line 45 of file NT_edconf.cxx.

Enumerator
BY_CALLING_THE_EDITOR 
FROM_IMPORTER 
FROM_MANAGER 

Definition at line 839 of file NT_edconf.cxx.

Function Documentation

static void nt_extract_configuration ( UNFIXED  ,
extractType  ext_type 
)
static
bool displays_config_markers ( MarkerDisplay md)
inline

Definition at line 131 of file NT_edconf.cxx.

References md.

Referenced by selected_configs_awar_changed_cb().

AW_awar* get_canvas_awar ( const char awar_name_format,
int  canvas_id 
)
inline
AW_awar* get_config_awar ( int  canvas_id)
inline
AW_awar* get_display_toggle_awar ( int  canvas_id)
inline
static SmartPtr<ConstStrArray> get_selected_configs_from_awar ( int  canvas_id)
static
static void write_configs_to_awar ( int  canvas_id,
const CharPtrArray configs 
)
static
static void init_config_awars ( AW_root root)
static
static void selected_configs_awar_changed_cb ( AW_root aw_root,
TREE_canvas ntw 
)
static
static void selected_configs_display_awar_changed_cb ( AW_root root,
TREE_canvas ntw 
)
static
static void configs_selectionlist_changed_cb ( AW_selection selected_configs,
bool  interactive_change,
AW_CL  ntw_id 
)
static
static void config_modified_cb ( GBDATA gb_cfg_area)
static
static void install_config_change_callbacks ( GBDATA gb_main)
static
void NT_activate_configMarkers_display ( TREE_canvas ntw)
static void setup_configmarker_config_cb ( AWT_config_definition config,
int  ntw_id 
)
static
static char* correct_managed_configsets_cb ( const char key,
const char value,
AW_CL  cl_ConfigModifier 
)
static
static void modify_configurations ( const ConfigModifier mod)
static
static void configuration_renamed_cb ( const char old_name,
const char new_name 
)
static

Definition at line 347 of file NT_edconf.cxx.

References modify_configurations().

Referenced by nt_rename_configuration().

static void configuration_deleted_cb ( const char name)
static

Definition at line 348 of file NT_edconf.cxx.

References modify_configurations().

Referenced by nt_delete_configuration().

static AW_window* create_configuration_marker_window ( AW_root root,
TREE_canvas ntw 
)
static
static void unmark_species ( TreeNode node)
static

Definition at line 434 of file NT_edconf.cxx.

References TreeNode::gb_node, GB_read_flag(), GB_write_flag(), and nt_assert.

Referenced by nt_create_configuration().

static void mark_species ( TreeNode node,
Store_species **  extra_marked_species 
)
static

Definition at line 441 of file NT_edconf.cxx.

References add(), TreeNode::gb_node, GB_read_flag(), GB_write_flag(), and nt_assert.

Referenced by nt_build_conf_string_rek().

static TreeNode* rightmost_leaf ( TreeNode node)
static

Definition at line 452 of file NT_edconf.cxx.

References TreeNode::is_leaf(), and nt_assert.

Referenced by left_neighbour_leaf().

static TreeNode* left_neighbour_leaf ( TreeNode node)
static
static int nt_build_conf_string_rek ( GB_HASH used,
TreeNode tree,
GBS_strstruct memfile,
Store_species **  extra_marked_species,
int  use_species_aside,
int auto_mark,
int  marked_at_left,
int marked_at_right 
)
static

Builds a configuration string from a tree.

Parameters
usedall species inserted by this function are stored here
treeused for group information
memfilegenerated configuration string is stored here
extra_marked_speciesall extra marked species are inserted here
use_species_asidenumber of species to mark left and right of marked species
auto_marknumber species to extra-mark (if not already marked)
marked_at_leftnumber of species which were marked (looking to left)
marked_at_rightnumber of species which are marked (when returning from recursion)
Returns
the number of marked species
Format of configuration string : [Part]+ \0

Part : '' ( Group | Species | Sai )

Group : ( OpenedGroup | ClosedGroup ) OpenedGroup : 'G' GroupDef ClosedGroup : 'F' GroupDef GroupDef : 'groupname' [PART]* EndGroup EndGroup : ''

SPECIES : 'L' 'speciesname' SAI : 'S' 'sainame'

\0 : ASCII 0 (eos) : ASCII 1

Definition at line 482 of file NT_edconf.cxx.

References add(), GBS_strstruct::cat(), GBS_strstruct::cut_tail(), GB_entry(), TreeNode::gb_node, GB_read_byte(), GB_read_flag(), GBS_write_hash(), GBS_strstruct::get_position(), Store_species::getNode(), TreeNode::is_leaf(), left_neighbour_leaf(), mark_species(), TreeNode::name, nt_assert, NULp, GBS_strstruct::put(), Store_species::remove(), tree, and UNCOVERED.

Referenced by nt_create_configuration().

static void nt_build_sai_string_by_hash ( const char key,
long  ,
void *  cd_sai_builder 
)
static
static void nt_build_sai_string ( GBDATA gb_main,
const char topAreaSaiList,
GBS_strstruct topfile,
GBS_strstruct middlefile 
)
static
static void nt_build_conf_marked ( GBDATA gb_main,
GB_HASH used,
GBS_strstruct file 
)
static
static void nt_delete_configuration ( AW_window aww,
AW_DB_selection dbsel 
)
static
static GB_ERROR nt_create_configuration ( TreeNode tree,
const char conf_name,
int  use_species_aside,
ConfigCreation  creation 
)
static
static void nt_store_configuration ( AW_window ,
TREE_canvas ntw 
)
static
static void nt_rename_configuration ( AW_window aww)
static
static void selected_config_changed_cb ( AW_root root)
static
static void config_comment_changed_cb ( AW_root root)
static
static void init_config_admin_awars ( AW_root root)
static
static GB_ERROR swap_configs ( GBDATA gb_main,
StrArray &  config,
int  i1,
int  i2 
)
static

Definition at line 1086 of file NT_edconf.cxx.

References error(), nt_assert, NULp, GBT_config::saveAsOver(), and swap().

Referenced by reorder_configs_cb().

static void reorder_configs_cb ( AW_window aww,
awt_reorder_mode  mode,
AW_DB_selection sel 
)
static
static void clear_comment_cb ( AW_window aww)
static
static AW_window* create_configuration_admin_window ( AW_root root,
TREE_canvas ntw 
)
static
void NT_popup_configuration_admin ( AW_window aw_main,
TREE_canvas ntw 
)

Definition at line 1253 of file NT_edconf.cxx.

References create_configuration_admin_window(), and AW_window::get_root().

Referenced by popup_new_main_window().

static void nt_start_editor_on_configuration ( AW_window aww)
static
AW_window* NT_create_startEditorOnOldConfiguration_window ( AW_root awr)
void NT_start_editor_on_tree ( AW_window aww,
int  use_species_aside,
TREE_canvas ntw 
)
void nt_create_config_after_import ( TREE_canvas ntw)
inline
void NT_create_config_after_import ( TREE_canvas ntw,
bool  imported_from_scratch 
)

create a new config after import

Parameters
imported_from_scratchif true -> DB was created from scratch, all species in DB are marked. if false -> data was imported into existing DB. Other species may be marked as well, imported species are "queried".

Definition at line 1322 of file NT_edconf.cxx.

References GB_clear_user_flag(), AWT_canvas::gb_main, GB_read_flag(), GB_user_flag(), GB_USERFLAG_QUERY, GB_USERFLAG_WASMARKED, GB_write_flag(), GB_write_user_flag(), GBT_first_species(), GBT_next_species(), nt_create_config_after_import(), and ta.

Referenced by nt_seq_load_cb(), and start_main_window_after_import().

Variable Documentation

AW_selection* selected_configs_list[MAX_NT_WINDOWS] = { MAX_NT_WINDOWS_NULLINIT }
static

Definition at line 161 of file NT_edconf.cxx.

bool allow_selection2awar_update = true
static
bool allow_to_activate_display = false
static
const char CFG_SEP = 1

Definition at line 480 of file NT_edconf.cxx.