source: trunk/MERGE/merge.hxx

Last change on this file was 19731, checked in by westram, 8 weeks ago
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1//  ==================================================================== //
2//                                                                       //
3//    File      : merge.hxx                                              //
4//    Purpose   : Local header for usage inside directory MERGE          //
5//                                                                       //
6//  Copyright Department of Microbiology (Technical University Munich)   //
7//  Visit our web site at: http://www.arb-home.de/                       //
8//                                                                       //
9//  ==================================================================== //
10
11#ifndef MERGE_HXX
12#define MERGE_HXX
13
14#ifndef AW_BASE_HXX
15#include <aw_base.hxx>
16#endif
17#ifndef ARB_ASSERT_H
18#include <arb_assert.h>
19#endif
20#ifndef ARBDB_BASE_H
21#include <arbdb_base.h>
22#endif
23
24#define mg_assert(bed) arb_assert(bed)
25
26#define AWAR_MERGE_SAV "merge/"
27#define AWAR_MERGE_TMP "tmp/" AWAR_MERGE_SAV
28
29#define AWAR_MERGE_TMP_SRC AWAR_MERGE_TMP "src/"
30#define AWAR_MERGE_TMP_DST AWAR_MERGE_TMP "dst/"
31
32#define AWAR_DB_SRC AWAR_MERGE_TMP_SRC "db"
33#define AWAR_DB_DST AWAR_MERGE_TMP_DST "db"
34
35enum DbSel { SRC_DB = 1, DST_DB = 2 };
36
37inline bool validDb(DbSel db) { return db == SRC_DB || db == DST_DB; }
38inline DbSel otherDb(DbSel db) { mg_assert(validDb(db)); return db == SRC_DB ? DST_DB : SRC_DB; }
39inline const char *dbSide(DbSel db) { mg_assert(validDb(db)); return db == SRC_DB ? "left" : "right"; }
40
41inline const char *awar_name_tmp(DbSel db, const char *name) {
42    mg_assert(validDb(db));
43    static char buffer[256];
44    sprintf(buffer, "%s%s", db == SRC_DB ? AWAR_MERGE_TMP_SRC : AWAR_MERGE_TMP_DST, name);
45    return buffer;
46}
47
48AW_window *MG_create_merge_alignment_window(AW_root *awr);
49AW_window *MG_create_merge_names_window(AW_root *awr);
50AW_window *MG_create_merge_species_window(AW_root *awr, bool dst_is_new);
51AW_window *MG_create_preserves_selection_window(AW_root *awr);
52AW_window *MG_create_merge_SAIs_window(AW_root *awr);
53AW_window *MG_create_merge_trees_window(AW_root *awr);
54AW_window *MG_create_merge_selections_window(AW_root *awr);
55
56AW_window *create_mg_check_fields_window(AW_root *aw_root);
57
58void MG_create_config_awar(AW_root *aw_root, AW_default aw_def);
59void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def);
60void MG_create_extendeds_awars(AW_root *aw_root, AW_default aw_def);
61void MG_create_species_awars(AW_root *aw_root, AW_default aw_def);
62void MG_create_rename_awars(AW_root *aw_root, AW_default aw_def);
63
64void MG_popup_selection_admin(AW_window *aw_parent, DbSel db);
65
66void MG_create_db_dependent_rename_awars(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst);
67
68void     MG_set_renamed(bool renamed, AW_root *aw_root, const char *reason);
69GB_ERROR MG_expect_renamed();
70
71int MG_copy_and_check_alignments();
72
73// export of gene-species:
74
75void       MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def);
76AW_window *MG_gene_species_create_field_transfer_def_window(AW_root *aw_root);
77GB_ERROR   MG_export_fields(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst, GB_HASH *error_suppressor, GB_HASH *source_organism_hash); // export defined fields
78
79#define AWAR_REMAP_SPECIES_LIST AWAR_MERGE_SAV "remap_species_list"
80#define AWAR_REMAP_ENABLE       AWAR_MERGE_SAV "remap_enable"
81
82#define IS_QUERIED_SPECIES(gb_species) GB_user_flag(gb_species, GB_USERFLAG_QUERY)
83long mg_count_queried(GBDATA *gb_main);
84
85const char *MG_left_AWAR_SPECIES_NAME();
86
87#ifndef MG_MERGE_HXX
88#include "mg_merge.hxx"
89#endif
90
91inline GBDATA *get_gb_main(DbSel db) {
92    mg_assert(validDb(db));
93    return db == SRC_DB ? GLOBAL_gb_src : GLOBAL_gb_dst;
94}
95
96
97#else
98#error merge.hxx included twice
99#endif // MERGE_HXX
Note: See TracBrowser for help on using the repository browser.