ARB
Classes | Functions | Variables
selection_admin.cxx File Reference
#include "selection_admin.h"
#include <sel_boxes.hxx>
#include <aw_select.hxx>
#include <aw_root.hxx>
#include <aw_awar.hxx>
#include <aw_awar_defs.hxx>
#include <aw_msg.hxx>
#include <arb_global_defs.h>
#include <arb_strarray.h>
#include <ad_config.h>
#include <ad_cb.h>
#include <arbdbt.h>
#include <RegExpr.hxx>
#include <TreeNode.h>
#include <modules.hxx>
#include <map>
Include dependency graph for selection_admin.cxx:

Go to the source code of this file.

Classes

class  Store_species
 
struct  SAI_string_builder
 

Functions

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)
 
void extract_species_selection (GBDATA *gb_main, const char *selectionName, SelectionExtractType ext_type)
 
static void nt_extract_configuration (UNFIXED, const SelectionAdmin *selection, SelectionExtractType ext_type)
 
static void nt_delete_configuration (AW_window *aww, AW_DB_selection *dbsel, const SelectionAdmin *selection)
 
static void selected_config_changed_cb (AW_root *root, const SelectionAdmin *selection)
 
static void config_comment_changed_cb (AW_root *root, const SelectionAdmin *selection)
 
static void init_awars_and_callbacks (AW_root *awr, const SelectionAdmin *selection, bool install_callbacks)
 
GB_ERROR create_species_selection (const SelectionAdmin &selection, const char *conf_name, int use_species_aside, SelectionCreation creation)
 
static void nt_store_configuration (AW_window *, const SelectionAdmin *selection)
 
static void nt_rename_configuration (AW_window *aww, const SelectionAdmin *selection)
 
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, const SelectionAdmin *selection)
 
static void update_marked_counter_label (GBDATA *gb_species_data, AW_awar *awar_counter_label)
 
void create_species_selection_button (AW_window *awm, WindowCallback wcb, const char *macro_id, const char *awarname_buttontext, GBDATA *gb_main)
 
AW_windowcreate_species_selection_window (AW_root *root, const SelectionAdmin *selection)
 

Variables

const char CFG_SEP = 1
 

Function Documentation

static void unmark_species ( TreeNode node)
static

Definition at line 77 of file selection_admin.cxx.

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

Referenced by create_species_selection().

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

Definition at line 84 of file selection_admin.cxx.

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

Referenced by nt_build_conf_string_rek().

static TreeNode* rightmost_leaf ( TreeNode node)
static

Definition at line 93 of file selection_admin.cxx.

References arb_assert, and TreeNode::is_leaf().

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 123 of file selection_admin.cxx.

References add(), arb_assert, 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, NULp, GBS_strstruct::put(), Store_species::remove(), tree, and UNCOVERED.

Referenced by create_species_selection().

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
void extract_species_selection ( GBDATA gb_main,
const char selectionName,
SelectionExtractType  ext_type 
)
static void nt_extract_configuration ( UNFIXED  ,
const SelectionAdmin selection,
SelectionExtractType  ext_type 
)
static
static void nt_delete_configuration ( AW_window aww,
AW_DB_selection dbsel,
const SelectionAdmin selection 
)
static
static void selected_config_changed_cb ( AW_root root,
const SelectionAdmin selection 
)
static
static void config_comment_changed_cb ( AW_root root,
const SelectionAdmin selection 
)
static
static void init_awars_and_callbacks ( AW_root awr,
const SelectionAdmin selection,
bool  install_callbacks 
)
static
GB_ERROR create_species_selection ( const SelectionAdmin selection,
const char conf_name,
int  use_species_aside,
SelectionCreation  creation 
)
static void nt_store_configuration ( AW_window ,
const SelectionAdmin selection 
)
static
static void nt_rename_configuration ( AW_window aww,
const SelectionAdmin selection 
)
static
static GB_ERROR swap_configs ( GBDATA gb_main,
StrArray &  config,
int  i1,
int  i2 
)
static

Definition at line 761 of file selection_admin.cxx.

References arb_assert, error(), 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,
const SelectionAdmin selection 
)
static
static void update_marked_counter_label ( GBDATA gb_species_data,
AW_awar awar_counter_label 
)
static

Updates marked counter and issues redraw on tree if number of marked species changes. Called on any change of species_information container.

Definition at line 848 of file selection_admin.cxx.

References AW_root::awar(), AWAR_TREE_REFRESH, buffer, GB_get_root(), gb_main, GBS_global_string(), GBT_count_marked_species(), AW_awar::read_char_pntr(), AW_root::SINGLETON, AW_awar::touch(), and AW_awar::write_string().

Referenced by create_species_selection_button().

void create_species_selection_button ( AW_window awm,
WindowCallback  wcb,
const char macro_id,
const char awarname_buttontext,
GBDATA gb_main 
)
AW_window* create_species_selection_window ( AW_root root,
const SelectionAdmin selection 
)

Variable Documentation

const char CFG_SEP = 1

Definition at line 121 of file selection_admin.cxx.