ARB
Classes | Macros | Enumerations | Functions | Variables
NT_group_search.cxx File Reference
#include "NT_group_search.h"
#include "NT_local.h"
#include "ad_trees.h"
#include <group_search.h>
#include <TreeDisplay.hxx>
#include <awt_config_manager.hxx>
#include <awt_sel_boxes.hxx>
#include <aw_select.hxx>
#include <aw_root.hxx>
#include <aw_awar.hxx>
#include <aw_msg.hxx>
#include <aw_awar_defs.hxx>
#include <ad_cb_prot.h>
Include dependency graph for NT_group_search.cxx:

Go to the source code of this file.

Classes

class  GroupUIdata
 

Macros

#define TRACE(msg)
 
#define GS_AWARS   "group_search/"
 
#define GS_AWARS_DUPS   GS_AWARS "dup/"
 
#define GS_AWARS_TMP   "tmp/" GS_AWARS
 
#define AWAR_MAYBE_INVALID_GROUP   GS_AWARS_TMP "sellist"
 
#define AWAR_SELECTED_RESULT_GROUP   GS_AWARS_TMP "selected"
 
#define AWAR_GROUP_HIT_COUNT   GS_AWARS_TMP "hits"
 
#define AWAR_SELECTED_GROUP_NAME   GS_AWARS_TMP "selname"
 
#define AWAR_RESULTING_GROUP_NAME   GS_AWARS_TMP "resname"
 
#define AWAR_TREE_SELECTED   GS_AWARS_TMP "treesel"
 
#define AWAR_RESULT_ORDER   GS_AWARS_TMP "order"
 
#define AWAR_SEARCH_WHICH_TREES   GS_AWARS "trees"
 
#define AWAR_SEARCH_MODE   GS_AWARS "mode"
 
#define AWAR_MATCH_MODE   GS_AWARS "match"
 
#define AWAR_MARK_TARGET   GS_AWARS "markwhat"
 
#define AWAR_RENAME_EXPRESSION   GS_AWARS "aci"
 
#define AWAR_DUPLICATE_MODE   GS_AWARS_DUPS "mode"
 
#define AWAR_DUP_TREE_MODE   GS_AWARS_DUPS "locmode"
 
#define AWAR_DUP_NAME_MATCH   GS_AWARS_DUPS "namematch"
 
#define AWAR_DUP_MIN_CLUSTER_SIZE   GS_AWARS_DUPS "clustsize"
 
#define AWAR_DUP_MIN_WORDS   GS_AWARS_DUPS "minwords"
 
#define AWAR_DUP_IGNORE_CASE   GS_AWARS_DUPS "ignore_case"
 
#define AWAR_DUP_EXCLUDED_WORDS   GS_AWARS_DUPS "excluded"
 
#define AWAR_DUP_WORD_SEPARATORS   GS_AWARS_DUPS "separators"
 
#define AWARFORMAT_CRIT_OPERATOR   GS_AWARS "op%i"
 
#define AWARFORMAT_CRIT_KEY   GS_AWARS "key%i"
 
#define AWARFORMAT_CRIT_EQUALS   GS_AWARS "equals%i"
 
#define AWARFORMAT_CRIT_MATCHES   GS_AWARS "match%i"
 
#define MAX_CRITERIA   3
 

Enumerations

enum  TreeSearchRange { SEARCH_CURRENT_TREE, SEARCH_SELECTED_TREES, SEARCH_ALL_TREES }
 
enum  DuplicateMode { DONT_MIND_DUPLICATES, ONLY_DUPLICATES, ONLY_UNIQUE }
 
enum  GroupMarkTarget { GMT_ALL_SPECIES, GMT_SELECTED_GROUP, GMT_ANY_GROUP, GMT_ALL_GROUPS }
 

Functions

const charcriterion_awar_name (const char *format, int crit)
 
static void popdown_search_window_cb (AW_window *, GroupUIdata *data)
 
static void runGroupSearch_cb (AW_window *, GroupUIdata *data)
 
static void remove_hit_cb (AW_window *, GroupUIdata *data)
 
static void clear_results_cb (AW_window *, GroupUIdata *data)
 
static void delete_selected_group_cb (AW_window *, GroupUIdata *data)
 
static void delete_listed_groups_cb (AW_window *, GroupUIdata *data)
 
static void rename_selected_group_cb (AW_window *, GroupUIdata *data)
 
static void rename_listed_groups_cb (AW_window *, GroupUIdata *data)
 
static void double_click_group_cb (AW_window *, GroupUIdata *data)
 
static void listed_groups_folding_cb (AW_window *, GroupUIdata *data, GroupFoldingMode mode)
 
static void group_mark_cb (AW_window *, GroupUIdata *data, GroupMarkMode mode)
 
TREE_canvasNT_get_canvas_showing_tree (const char *tree_name, bool forceDisplay)
 
static TREE_canvasget_canvas_able_to_show (GBDATA *gb_group)
 
static void selected_group_changed_by_canvas_cb (AW_root *awr)
 
void create_group_search_awars (AW_root *aw_root, AW_default props)
 
static AW_windowcreate_tree_select_window_cb (AW_root *aw_root, GroupUIdata *data)
 
static AW_windowcreate_group_rename_window_cb (AW_root *awr, GroupUIdata *data)
 
static AW_windowcreate_dup_config_window_cb (AW_root *awr)
 
static void create_search_config_setup_cb (AWT_config_definition &def)
 
void popup_group_search_window (AW_window *aw_parent, GBDATA *gb_main)
 

Variables

static bool inside_group_selection = false
 
static bool nameChangedByGroupChange = false
 
static AWT_config_mapping_def group_search_config_mapping []
 
static AWT_predefined_config predefined_group_search []
 

Macro Definition Documentation

#define TRACE (   msg)
#define GS_AWARS   "group_search/"

Definition at line 40 of file NT_group_search.cxx.

#define GS_AWARS_DUPS   GS_AWARS "dup/"

Definition at line 41 of file NT_group_search.cxx.

#define GS_AWARS_TMP   "tmp/" GS_AWARS

Definition at line 42 of file NT_group_search.cxx.

#define AWAR_MAYBE_INVALID_GROUP   GS_AWARS_TMP "sellist"
#define AWAR_SELECTED_RESULT_GROUP   GS_AWARS_TMP "selected"
#define AWAR_GROUP_HIT_COUNT   GS_AWARS_TMP "hits"

Definition at line 46 of file NT_group_search.cxx.

Referenced by create_group_search_awars(), and popup_group_search_window().

#define AWAR_SELECTED_GROUP_NAME   GS_AWARS_TMP "selname"

Definition at line 47 of file NT_group_search.cxx.

Referenced by create_group_rename_window_cb(), and create_group_search_awars().

#define AWAR_RESULTING_GROUP_NAME   GS_AWARS_TMP "resname"

Definition at line 48 of file NT_group_search.cxx.

Referenced by create_group_rename_window_cb(), and create_group_search_awars().

#define AWAR_TREE_SELECTED   GS_AWARS_TMP "treesel"

Definition at line 49 of file NT_group_search.cxx.

Referenced by create_group_search_awars(), and create_tree_select_window_cb().

#define AWAR_RESULT_ORDER   GS_AWARS_TMP "order"

Definition at line 50 of file NT_group_search.cxx.

Referenced by create_group_search_awars(), and popup_group_search_window().

#define AWAR_SEARCH_WHICH_TREES   GS_AWARS "trees"
#define AWAR_SEARCH_MODE   GS_AWARS "mode"
#define AWAR_MATCH_MODE   GS_AWARS "match"
#define AWAR_MARK_TARGET   GS_AWARS "markwhat"
#define AWAR_RENAME_EXPRESSION   GS_AWARS "aci"
#define AWAR_DUPLICATE_MODE   GS_AWARS_DUPS "mode"

Definition at line 58 of file NT_group_search.cxx.

Referenced by create_group_search_awars(), and popup_group_search_window().

#define AWAR_DUP_TREE_MODE   GS_AWARS_DUPS "locmode"

Definition at line 59 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_NAME_MATCH   GS_AWARS_DUPS "namematch"

Definition at line 60 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_MIN_CLUSTER_SIZE   GS_AWARS_DUPS "clustsize"

Definition at line 61 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_MIN_WORDS   GS_AWARS_DUPS "minwords"

Definition at line 62 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_IGNORE_CASE   GS_AWARS_DUPS "ignore_case"

Definition at line 63 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_EXCLUDED_WORDS   GS_AWARS_DUPS "excluded"

Definition at line 64 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWAR_DUP_WORD_SEPARATORS   GS_AWARS_DUPS "separators"

Definition at line 65 of file NT_group_search.cxx.

Referenced by create_dup_config_window_cb(), and create_group_search_awars().

#define AWARFORMAT_CRIT_OPERATOR   GS_AWARS "op%i"
#define AWARFORMAT_CRIT_KEY   GS_AWARS "key%i"
#define AWARFORMAT_CRIT_EQUALS   GS_AWARS "equals%i"
#define AWARFORMAT_CRIT_MATCHES   GS_AWARS "match%i"
#define MAX_CRITERIA   3

Enumeration Type Documentation

Enumerator
SEARCH_CURRENT_TREE 
SEARCH_SELECTED_TREES 
SEARCH_ALL_TREES 

Definition at line 79 of file NT_group_search.cxx.

Enumerator
DONT_MIND_DUPLICATES 
ONLY_DUPLICATES 
ONLY_UNIQUE 

Definition at line 85 of file NT_group_search.cxx.

Enumerator
GMT_ALL_SPECIES 
GMT_SELECTED_GROUP 
GMT_ANY_GROUP 
GMT_ALL_GROUPS 

Definition at line 569 of file NT_group_search.cxx.

Function Documentation

const char* criterion_awar_name ( const char format,
int  crit 
)
inline
static void popdown_search_window_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 356 of file NT_group_search.cxx.

References GroupUIdata::cleanup().

Referenced by popup_group_search_window().

static void runGroupSearch_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 357 of file NT_group_search.cxx.

References GroupUIdata::run_search().

Referenced by popup_group_search_window().

static void remove_hit_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 358 of file NT_group_search.cxx.

References GroupUIdata::remove_selected_result().

Referenced by popup_group_search_window().

static void clear_results_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 359 of file NT_group_search.cxx.

References GroupUIdata::remove_all_results().

Referenced by popup_group_search_window().

static void delete_selected_group_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 360 of file NT_group_search.cxx.

References GroupUIdata::delete_selected_group().

Referenced by popup_group_search_window().

static void delete_listed_groups_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 361 of file NT_group_search.cxx.

References GroupUIdata::delete_listed_groups().

Referenced by popup_group_search_window().

static void rename_selected_group_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 362 of file NT_group_search.cxx.

References GroupUIdata::rename_selected_group().

Referenced by create_group_rename_window_cb().

static void rename_listed_groups_cb ( AW_window ,
GroupUIdata data 
)
static

Definition at line 363 of file NT_group_search.cxx.

References GroupUIdata::rename_listed_groups().

Referenced by create_group_rename_window_cb().

static void double_click_group_cb ( AW_window ,
GroupUIdata data 
)
static
static void listed_groups_folding_cb ( AW_window ,
GroupUIdata data,
GroupFoldingMode  mode 
)
static
static void group_mark_cb ( AW_window ,
GroupUIdata data,
GroupMarkMode  mode 
)
static

Definition at line 366 of file NT_group_search.cxx.

References GroupUIdata::mark_species().

Referenced by popup_group_search_window().

TREE_canvas* NT_get_canvas_showing_tree ( const char tree_name,
bool  forceDisplay 
)
static TREE_canvas* get_canvas_able_to_show ( GBDATA gb_group)
static

Definition at line 401 of file NT_group_search.cxx.

References GB_get_father(), GB_read_key(), NT_get_canvas_showing_tree(), NULp, and ta.

static void selected_group_changed_by_canvas_cb ( AW_root awr)
static
void create_group_search_awars ( AW_root aw_root,
AW_default  props 
)
static AW_window* create_tree_select_window_cb ( AW_root aw_root,
GroupUIdata data 
)
static
static AW_window* create_group_rename_window_cb ( AW_root awr,
GroupUIdata data 
)
static
static AW_window* create_dup_config_window_cb ( AW_root awr)
static
static void create_search_config_setup_cb ( AWT_config_definition def)
static
void popup_group_search_window ( AW_window aw_parent,
GBDATA gb_main 
)

Definition at line 870 of file NT_group_search.cxx.

References AW_window::activate(), GroupUIdata::announce_result_list(), AW_POPDOWN(), AW_ROOT_DEFAULT, AWAR_DUPLICATE_MODE, AWAR_GROUP_HIT_COUNT, AWAR_MARK_TARGET, AWAR_MATCH_MODE, AWAR_MAYBE_INVALID_GROUP, AWAR_RESULT_ORDER, AWAR_SEARCH_MODE, AWAR_SEARCH_WHICH_TREES, AWARFORMAT_CRIT_EQUALS, AWARFORMAT_CRIT_KEY, AWARFORMAT_CRIT_MATCHES, AWARFORMAT_CRIT_OPERATOR, AWT_insert_config_manager(), GroupUIdata::clear_result_list(), clear_results_cb(), CO_AND, CO_IGNORE, CO_OR, create_dup_config_window_cb(), create_group_rename_window_cb(), create_search_config_setup_cb(), create_tree_select_window_cb(), criterion_awar_name(), CT_AID, CT_FOLDED, CT_KEELED, CT_MARKED, CT_MARKED_PC, CT_NAME, CT_NESTING_LEVEL, CT_PARENT_ALL, CT_PARENT_ANY, CT_PARENT_DIRECT, CT_SIZE, CT_ZOMBIES, delete_listed_groups_cb(), delete_selected_group_cb(), DONT_MIND_DUPLICATES, double_click_group_cb(), GBS_global_string(), AW_window::get_root(), GFM_COLLAPSE, GFM_EXPANDPARENTS, GFM_EXPANDREC, GFM_EXPANDREC_COLLREST, GMM_INVERT, GMM_MARK, GMM_UNMARK, GMT_ALL_GROUPS, GMT_ALL_SPECIES, GMT_ANY_GROUP, GMT_SELECTED_GROUP, group_mark_cb(), GSC_AID, GSC_CLUSTER, GSC_HIT_REASON, GSC_KEELED, GSC_MARKED, GSC_MARKED_PC, GSC_NAME, GSC_NESTING, GSC_NONE, GSC_REVERSE, GSC_SIZE, GSC_TREENAME, GSC_TREEORDER, GSM_ADD, GSM_FIND, GSM_KEEP, GSM_MATCH, GSM_MISMATCH, GSM_REMOVE, GroupUIdata::initialize(), listed_groups_folding_cb(), makeHelpCallback(), MAX_CRITERIA, NULp, ONLY_DUPLICATES, ONLY_UNIQUE, popdown_search_window_cb(), remove_hit_cb(), runGroupSearch_cb(), SEARCH_ALL_TREES, SEARCH_CURRENT_TREE, and SEARCH_SELECTED_TREES.

Referenced by popup_new_main_window().

Variable Documentation

bool inside_group_selection = false
static

Definition at line 420 of file NT_group_search.cxx.

bool nameChangedByGroupChange = false
static

Definition at line 461 of file NT_group_search.cxx.

AWT_config_mapping_def group_search_config_mapping[]
static
Initial value:
= {
{ AWAR_SEARCH_WHICH_TREES, "searched_trees" },
{ AWAR_SEARCH_MODE, "search_mode" },
{ AWAR_MATCH_MODE, "match_mode" },
{ AWAR_DUPLICATE_MODE, "dup_mode" },
{ AWAR_DUP_TREE_MODE, "dup_tree_mode" },
{ AWAR_DUP_MIN_CLUSTER_SIZE, "dup_min_size" },
{ AWAR_DUP_NAME_MATCH, "dup_match_mode" },
{ AWAR_DUP_IGNORE_CASE, "dup_ignore_case" },
{ AWAR_DUP_MIN_WORDS, "dup_min_words" },
{ AWAR_DUP_EXCLUDED_WORDS, "dup_excluded_words" },
{ AWAR_DUP_WORD_SEPARATORS, "dup_word_separators" },
{ AWAR_MARK_TARGET, "mark_target" },
{ AWAR_RENAME_EXPRESSION, "rename_script" },
{ NULp, NULp },
}
#define AWAR_DUP_MIN_WORDS
#define AWAR_MARK_TARGET
#define AWAR_DUP_EXCLUDED_WORDS
#define AWAR_DUP_NAME_MATCH
#define AWAR_DUPLICATE_MODE
#define AWAR_DUP_MIN_CLUSTER_SIZE
#define AWAR_SEARCH_MODE
#define AWAR_DUP_IGNORE_CASE
#define AWAR_MATCH_MODE
#define AWAR_DUP_WORD_SEPARATORS
#define AWAR_DUP_TREE_MODE
#define NULp
Definition: cxxforward.h:116
#define AWAR_RENAME_EXPRESSION
#define AWAR_SEARCH_WHICH_TREES

Definition at line 824 of file NT_group_search.cxx.

AWT_predefined_config predefined_group_search[]
static
Initial value:
= {
{ "*tagged_find", "Search expression for \"tagged\" groupnames", "dup_mode='0';eq1='0';expr1='*[*]*';match_mode='0';op2='2';op3='2';sel1='0'" },
{ "*tags_remove_all", "Expression for batch-rename:\n- removes any prefix(es) in \"[..]\" from groupnames", "rename_script='/\\\\[.*\\\\]//'" },
{ "*tag_prefix", "Expression for batch-rename:\n- adds prefix \"[TAG] \" to groupnames", "rename_script='\"[TAG] \";dd'" },
{ "*swap_AND_names", "Batch-rename:\n \"X and Y\" -> \"Y and X\"\n \"X, Y and Z\" -> \"Z, X and Y\" ...", "rename_script=':* and *=*2 and *1:* and *, *=*1, *2 and *3:*, * and *, *=*1, *2, *3 and *4'" },
{ "*rename_enumerated", "Batch-rename:\n- appends running number to group-name\n (using hitlist order)", "rename_script='dd;\"_\";command(\"\\\\\"00\\\\\";hitidx|merge|tail(3)\")'" },
{ "*remove_numeric_suffix", "Batch-rename:\n- removes numeric suffixes \n like \"_1\", \"_003\"", "rename_script='/_[0-9]+$//'" },
{ "*undo_groupXfer_report", "undo group rename applied by \"Move groups\":\n * remove prefix \"XFRD_\"\n * remove penalty suffix", "rename_script='command(\"/^XFRD_//\")|command(\"/\\\\\\\\{penalty.*\\\\\\\\}$//\")'" },
{ NULp, NULp, NULp }
}
#define NULp
Definition: cxxforward.h:116

Definition at line 857 of file NT_group_search.cxx.