35 using namespace SEQIO;
57 char *real_outname =
NULp;
60 filter, cut_stop_codon, compress,
61 db_name, formname, ftsname,
62 outname, multiple, &real_outname);
76 static char *last_used_name =
ARB_strdup(
"noname");
77 if (nameOnly) freedup(last_used_name, nameOnly);
90 char *path, *nameOnly, *suffix;
96 if (new_exportname) awar_export->
write_string(new_exportname);
140 const char *current_suffix = eft_info.
suffix.content();
141 static char *previous_suffix =
NULp;
154 char *path, *nameOnly, *suffix;
160 if (previous_suffix &&
ARB_stricmp(suffix, previous_suffix) == 0) freedup(suffix, current_suffix);
166 if (new_exportname) awar_export->
write_string(new_exportname);
178 freedup(previous_suffix, current_suffix);
187 typedef std::set<std::string>
StrSet;
194 tracked.insert(fieldname);
198 for (StrSet::const_iterator elem = tracked.begin(); elem != tracked.end(); ++elem) {
208 static const char* fake_exported_sequence(
GBDATA*,
unsigned long *len,
const char**) {
222 fields.put(
ARB_strdup(
"<no known source database>"));
243 if (gb_someSpecies) {
251 GBL_env env(gb_main,
"tree_faked");
271 scan_error =
"unknown form access failure";
280 scan_error =
"no species";
284 scan_error =
"no database";
292 fields.put(
ARB_strdup(
"<no export filter selected>"));
304 static AW_window_simple *aws =
NULp;
309 aws =
new AW_window_simple;
311 aws->init(awr,
"ARB_EXPORT",
"ARB EXPORT");
312 aws->load_xfig(
"awt/export_db.fig");
316 aws->create_button(
"CLOSE",
"CLOSE",
"C");
320 aws->create_button(
"HELP",
"HELP",
"H");
325 aws->at(
"allmarked");
327 aws->insert_option(
"all",
"a",
EBF_ALL);
328 aws->insert_option(
"marked",
"m",
EBF_MARKED);
329 aws->update_option_menu();
333 aws->insert_option(
"no",
"n", 0);
334 aws->insert_option(
"vertical gaps",
"v", 1);
335 aws->insert_option(
"all gaps",
"a", 2);
336 aws->update_option_menu();
338 aws->at(
"seqfilter");
354 aws->callback(makeWindowCallback(
export_go_cb, gb_main, filtercd));
355 aws->create_button(
"GO",
"GO",
"G",
"+");
359 aws->create_button(
"TEST",
"Test",
"T");
void awt_create_filter_awars(AW_root *aw_root, AW_default aw_def, const char *awar_filtername, const char *awar_mapto_alignment)
static void create_export_awars(AW_root *awr)
set< string, lt_field > StrSet
void useFieldTracker(FieldTracker *tracker_)
GB_CSTR GB_path_in_arbprop(const char *relative_path)
void XFER_select_RuleSet(AW_window *aww, const char *awar_selected_fts, const AvailableFieldScanner *fieldScanner)
void scanFields(StrArray &fields, FieldsToScan whatToScan) const OVERRIDE
char * GBS_string_eval_in_env(const char *insource, const char *icommand, const GBL_call_env &callEnv)
AW_window * create_AWTC_export_window(AW_root *awr, GBDATA *gb_main)
GBDATA * get_any_item() const
NOT4PERL void GB_set_export_sequence_hook(gb_export_sequence_cb escb)
#define AWAR_EXPORT_COMPRESS
int ARB_stricmp(const char *s1, const char *s2)
char * ARB_strdup(const char *str)
#define AWAR_DEFAULT_ALIGNMENT
static ExportFieldScanner fieldScanner
#define AWAR_EXPORT_MULTIPLE_FILES
void AW_POPDOWN(AW_window *window)
char * ARB_stringdup(const std::string &str)
void cat(const char *from)
AW_awar * add_callback(const RootCallback &cb)
#define AWAR_EXPORT_FILENAME
const char * read_char_pntr() const
static AW_root * SINGLETON
WindowCallback makeHelpCallback(const char *helpfile)
#define AWAR_EXPORT_FILEBASE
void announce_source_database(GBDATA *gb_src)
#define AWAR_EXPORT_FILESUFFIX
GBDATA *(* get_selected_item)(GBDATA *gb_main, AW_root *aw_root)
static void update_format_description_and_suffix(const char *eft)
static void error(const char *msg)
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
#define AWAR_EXPORT_FORMATBASE
GB_ERROR get_exportFormat_information(const char *eft_formname, ExportFormatInfo &info)
adfiltercbstruct * awt_create_select_filter(AW_root *aw_root, GBDATA *gb_main, const char *def_name)
GB_ERROR export_by_format(GBDATA *gb_main, ExportWhich which, const char *one_species, AP_filter *filter, int cut_stop_codon, int compress, const char *dbname, const char *formname, const char *field_transfer_set, const char *outname, int multiple, char **real_outname)
#define AWAR_EXPORT_FORMATNAME
AW_window * awt_create_select_filter_win(AW_root *aw_root, adfiltercbstruct *acbs)
char * read_string() const
GB_CSTR GB_path_in_ARBLIB(const char *relative_path)
AW_awar * awar(const char *awar)
const char * XFER_getFullFTS(const char *name)
void AW_refresh_fileselection(AW_root *awr, const char *awar_prefix)
void track_field(const char *fieldname) OVERRIDE
GB_CSTR GB_append_suffix(const char *name, const char *suffix)
AP_filter * awt_get_filter(adfiltercbstruct *acbs)
GB_CSTR GB_concat_path(GB_CSTR anypath_left, GB_CSTR anypath_right)
static void copy(double **i, double **j)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
static void export_go_cb(AW_window *aww, GBDATA *gb_main, adfiltercbstruct *acbs)
#define AWAR_EXPORT_FILTER_NAME
static void export_filename_changed_cb(AW_root *aw_root)
#define awti_assert(cond)
bool GB_is_directory(const char *path)
const struct formatTable formname[]
ItemSelector & SPECIES_get_selector()
char * get_exportFormat_evalForm(const char *eft_formname, GB_ERROR &error)
void aw_message(const char *msg)
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
#define AWAR_EXPORT_FORMAT_DESC
static bool in_export_filename_changed_cb
#define AWAR_EXPORT_MARKED
void add_tracked_to(StrArray &addTo) const
void AWTI_activate_export_test_window(AW_window *awp, GBDATA *gb_main, adfiltercbstruct *acbs)
void AW_create_fileselection(AW_window *aws, const char *awar_prefix, const char *at_prefix, const char *pwd, DirDisplay disp_dirs, bool allow_wildcards)
GB_ERROR write_string(const char *aw_string)
static void avoid_empty_target_name(char *&nameOnly)
const char * get_data() const
GB_transaction ta(gb_var)
#define AWAR_EXPORT_CUTSTOP
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
void XFER_refresh_available_fields(AW_root *awr, const AvailableFieldScanner *fieldScanner, FieldsToScan whatToScan)
void collectKeysRegisteredInDatabase(StrArray &fields, GBDATA *gb_main, ItemSelector &sel, bool skipContainers, bool skipHidden)
char * GBS_global_string_copy(const char *templat,...)