ARB
EXP_interface.cxx
Go to the documentation of this file.
1 // ==================================================================== //
2 // //
3 // File : EXP_interface.cxx //
4 // Purpose : //
5 // //
6 // //
7 // Coded by Ralf Westram (coder@reallysoft.de) in September 2001 //
8 // Copyright Department of Microbiology (Technical University Munich) //
9 // //
10 // Visit our web site at: http://www.arb-home.de/ //
11 // //
12 // //
13 // ==================================================================== //
14 
15 #include "EXP_local.hxx"
16 #include "GEN_local.hxx"
17 
18 #include <db_query.h>
19 #include <db_scanner.hxx>
20 #include <dbui.h>
21 #include <item_sel_list.h>
22 #include <info_window.h>
23 
24 #include <awt_prompt.hxx>
25 #include <awt_sel_boxes.hxx>
26 
27 #include <aw_awar_defs.hxx>
28 #include <aw_root.hxx>
29 #include <aw_msg.hxx>
30 #include <aw_question.hxx>
31 
32 using namespace std;
33 
34 #define AD_F_ALL AWM_ALL
35 
37  GBDATA *gb_species = GEN_get_current_organism(gb_main);
38  GBDATA *gb_experiment_data = NULp;
39 
40  if (gb_species) gb_experiment_data = EXP_get_experiment_data(gb_species);
41 
42  return gb_experiment_data;
43 }
44 
45 static void EXP_select_experiment(GBDATA* /* gb_main */, AW_root *aw_root, const char *item_name) {
46  char *name = ARB_strdup(item_name);
47  char *slash = strchr(name, '/');
48 
49  if (slash) {
50  slash[0] = 0;
51  aw_root->awar(AWAR_ORGANISM_NAME)->write_string(name);
52  aw_root->awar(AWAR_EXPERIMENT_NAME)->write_string(slash+1);
53  }
54  free(name);
55 }
56 
57 static char *EXP_get_experiment_id(GBDATA * /* gb_main */, GBDATA *gb_experiment) {
58  GBDATA *gb_species = GB_get_grandfather(gb_experiment);
59  return GBS_global_string_copy("%s/%s", GBT_get_name_or_description(gb_species), GBT_get_name_or_description(gb_experiment));
60 }
61 
62 static GBDATA *EXP_find_experiment_by_id(GBDATA *gb_main, const char *id) {
63  char *organism = ARB_strdup(id);
64  char *exp = strchr(organism, '/');
65  GBDATA *result = NULp;
66 
67  if (exp) {
68  *exp++ = 0;
69  GBDATA *gb_organism = GEN_find_organism(gb_main, organism);
70  if (gb_organism) {
71  result = EXP_find_experiment(gb_organism, exp);
72  }
73  }
74 
75  free(organism);
76  return result;
77 }
78 
79 static char *old_species_marks = NULp; // configuration storing marked species
80 
82  if (old_species_marks) {
83  GBT_restore_marked_species(gb_main, old_species_marks);
84  freenull(old_species_marks);
85  }
86 }
87 
89  GBDATA *gb_organism = NULp;
91 
92  gen_assert(!old_species_marks); // old_species_marks may be out of date (better call EXP_get_(first|next)_experiment_data until it returns NULp!)
94 
95  switch (range) {
96  case QUERY_CURRENT_ITEM: {
97  char *species_name = aw_root->awar(AWAR_ORGANISM_NAME)->read_string();
98  gb_organism = GBT_find_species(gb_main, species_name);
99  free(species_name);
100  break;
101  }
102  case QUERY_MARKED_ITEMS: {
103  GBDATA *gb_pseudo = GEN_first_marked_pseudo_species(gb_main);
104 
105  if (gb_pseudo) { // there are marked pseudo-species..
106  old_species_marks = GBT_store_marked_species(gb_main, true); // store and unmark marked species
107  error = GBT_with_stored_species(gb_main, old_species_marks, GEN_mark_organism_or_corresponding_organism, NULp); // mark organisms related with stored
108 
109  if (!error) {
110  gb_organism = GEN_first_marked_organism(gb_main);
111  if (!gb_organism) exp_restore_old_species_marks(gb_main); // got all -> clean up
112  }
113  }
114  else {
115  gb_organism = GEN_first_marked_organism(gb_main);
116  }
117  break;
118  }
119  case QUERY_ALL_ITEMS: {
120  gb_organism = GBT_first_species(gb_main);
121  break;
122  }
123  default: {
124  gen_assert(0);
125  break;
126  }
127  }
128 
129  if (error) GB_export_error(error);
130  return gb_organism ? EXP_get_experiment_data(gb_organism) : NULp;
131 }
132 
133 static GBDATA *EXP_get_next_experiment_data(GBDATA *gb_experiment_data, QUERY_RANGE range) {
134  GBDATA *gb_organism = NULp;
135  switch (range) {
136  case QUERY_CURRENT_ITEM: {
137  break;
138  }
139  case QUERY_MARKED_ITEMS: {
140  GBDATA *gb_last_species = GB_get_father(gb_experiment_data);
141  gb_organism = GEN_next_marked_organism(gb_last_species);
142 
143  if (!gb_organism) exp_restore_old_species_marks(GB_get_root(gb_experiment_data)); // got all -> clean up
144  break;
145  }
146  case QUERY_ALL_ITEMS: {
147  GBDATA *gb_last_species = GB_get_father(gb_experiment_data);
148  gb_organism = GBT_next_species(gb_last_species);
149  break;
150  }
151  default: {
152  gen_assert(0);
153  break;
154  }
155  }
156 
157  return gb_organism ? EXP_get_experiment_data(gb_organism) : NULp;
158 }
159 
161  GBDATA *gb_organism = GEN_get_current_organism(gb_main);
162  GBDATA *gb_experiment = NULp;
163 
164  if (gb_organism) {
165  char *experiment_name = aw_root->awar(AWAR_EXPERIMENT_NAME)->read_string();
166  gb_experiment = EXP_find_experiment(gb_organism, experiment_name);
167  free(experiment_name);
168  }
169 
170  return gb_experiment;
171 }
172 
173 static void add_selected_experiment_changed_cb(AW_root *aw_root, const RootCallback& cb) {
174  aw_root->awar(AWAR_EXPERIMENT_NAME)->add_callback(cb);
176 }
177 
178 static GBDATA *first_experiment_in_range(GBDATA *gb_experiment_data, QUERY_RANGE range) {
179  GBDATA *gb_first = NULp;
180  switch (range) {
181  case QUERY_ALL_ITEMS: gb_first = EXP_first_experiment_rel_exp_data(gb_experiment_data); break;
182  case QUERY_MARKED_ITEMS: gb_first = GB_first_marked(gb_experiment_data, "experiment"); break;
183  case QUERY_CURRENT_ITEM: gb_first = EXP_get_current_experiment(GB_get_root(gb_experiment_data), AW_root::SINGLETON); break;
184  }
185  return gb_first;
186 }
188  GBDATA *gb_next = NULp;
189  switch (range) {
190  case QUERY_ALL_ITEMS: gb_next = EXP_next_experiment(gb_prev); break;
191  case QUERY_MARKED_ITEMS: gb_next = GB_next_marked(gb_prev, "experiment"); break;
192  case QUERY_CURRENT_ITEM: gb_next = NULp; break;
193  }
194  return gb_next;
195 }
196 
197 static void refresh_displayed_experiments() {} // nothing todo here
198 
199 #if defined(WARN_TODO)
200 #warning move EXP_item_selector to SL/ITEMS
201 #endif
202 
209  -1, // unknown
211  "experiment",
212  "experiments",
213  "name",
222 };
223 
225 
227 
228 #if defined(WARN_TODO)
229 #warning move EXP_create_experiment_query_window to SL/DB_UI
230 #endif
231 
233  static AW_window_simple_menu *aws = NULp;
234  if (!aws) {
235  aws = new AW_window_simple_menu;
236  aws->init(aw_root, "EXPERIMENT_QUERY", "Experiment SEARCH and QUERY");
237  aws->create_menu("More functions", "f");
238  aws->load_xfig("ad_query.fig");
239 
241 
242  awtqs.gb_main = gb_main;
244  awtqs.tree_name = AWAR_TREE;
246  awtqs.use_menu = 1;
247  awtqs.ere_pos_fig = "ere3";
248  awtqs.where_pos_fig = "where3";
249  awtqs.by_pos_fig = "by3";
250  awtqs.qbox_pos_fig = "qbox";
251  awtqs.key_pos_fig = NULp;
252  awtqs.query_pos_fig = "content";
253  awtqs.result_pos_fig = "result";
254  awtqs.count_pos_fig = "count";
255  awtqs.do_query_pos_fig = "doquery";
256  awtqs.config_pos_fig = "doconfig";
257  awtqs.do_mark_pos_fig = "domark";
258  awtqs.do_unmark_pos_fig = "dounmark";
259  awtqs.do_delete_pos_fig = "dodelete";
260  awtqs.do_set_pos_fig = "doset";
261  awtqs.do_refresh_pos_fig = "dorefresh";
262  awtqs.open_parser_pos_fig = "openparser";
264 
265  QUERY::DbQuery *query = create_query_box(aws, &awtqs, "exp");
266  GLOBAL_experiment_query = query;
267 
268  aws->create_menu("More search", "s");
269  aws->insert_menu_topic("exp_search_equal_fields_within_db", "Search For Equal Fields and Mark Duplicates", "E", "search_duplicates.hlp", AWM_ALL, makeWindowCallback(QUERY::search_duplicated_field_content, query, false));
270  aws->insert_menu_topic("exp_search_equal_words_within_db", "Search For Equal Words Between Fields and Mark Duplicates", "W", "search_duplicates.hlp", AWM_ALL, makeWindowCallback(QUERY::search_duplicated_field_content, query, true));
271 
272  aws->button_length(7);
273 
274  aws->at("close");
275  aws->callback(AW_POPDOWN);
276  aws->create_button("CLOSE", "CLOSE", "C");
277 
278  aws->at("help");
279  aws->callback(makeHelpCallback("experiment_search.hlp"));
280  aws->create_button("HELP", "HELP", "H");
281  }
282  return aws;
283 }
284 
286  if (aw_ask_sure("experiment_delete", "Are you sure to delete the experiment")) {
287  GB_transaction ta(gb_main);
288  GBDATA *gb_experiment = EXP_get_current_experiment(gb_main, aww->get_root());
289 
290  GB_ERROR error = gb_experiment ? GB_delete(gb_experiment) : "Please select a experiment first";
291  if (error) {
292  error = ta.close(error);
293  aw_message(error);
294  }
295  }
296 }
297 
298 static GB_ERROR experiment_create_handler(const char *dest, GBDATA *gb_main) {
300 
301  if (!error) {
302  AW_root *aw_root = AW_root::SINGLETON;
303  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
304 
305  if (!gb_experiment_data) error = "Please select an organism";
306  else {
307  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
308  if (gb_dest) {
309  error = GBS_global_string("Experiment '%s' already exists", dest);
310  }
311  else {
312  gb_dest = EXP_find_or_create_experiment_rel_exp_data(gb_experiment_data, dest);
313  if (!gb_dest) error = GB_await_error();
314  else aw_root->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
315  }
316  }
317  }
318 
319  error = GB_end_transaction(gb_main, error);
320  return error;
321 }
322 static GB_ERROR experiment_rename_handler(const char *dest, GBDATA *gb_main) {
324  const char *source = awr->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
325  GB_ERROR error = NULp;
326 
327  if (strcmp(source, dest) != 0) {
328  error = GB_begin_transaction(gb_main);
329  if (!error) {
330  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
331 
332  if (!gb_experiment_data) error = "Please select an organism";
333  else {
334  GBDATA *gb_source = EXP_find_experiment_rel_exp_data(gb_experiment_data, source);
335  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
336 
337  if (!gb_source) error = "Please select an experiment";
338  else if (gb_dest) error = GB_export_errorf("Experiment '%s' already exists", dest);
339  else {
340  GBDATA *gb_name = GB_search(gb_source, "name", GB_STRING);
341  if (!gb_name) error = GB_await_error();
342  else {
343  error = GB_write_string(gb_name, dest);
344  if (!error) awr->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
345  }
346  }
347  }
348  }
349  error = GB_end_transaction(gb_main, error);
350  }
351 
352  return error;
353 }
354 static GB_ERROR experiment_copy_handler(const char *dest, GBDATA *gb_main) {
356  const char *source = awr->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
358 
359  if (!error) {
360  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
361 
362  if (!gb_experiment_data) error = "Please select an organism";
363  else {
364  GBDATA *gb_source = EXP_find_experiment_rel_exp_data(gb_experiment_data, source);
365  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
366 
367  if (!gb_source) error = "Please select an experiment";
368  else if (gb_dest) error = GB_export_errorf("Experiment '%s' already exists", dest);
369  else {
370  gb_dest = GB_create_container(gb_experiment_data, "experiment");
371  if (!gb_dest) error = GB_await_error();
372  else error = GB_copy_dropProtectMarksAndTempstate(gb_dest, gb_source);
373 
374  if (!error) {
375  error = GBT_write_string(gb_dest, "name", dest);
376  if (!error) awr->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
377  }
378  }
379  }
380  }
381 
382  error = GB_end_transaction(gb_main, error);
383  return error;
384 }
386  ResultHandler handler = makeResultHandler(experiment_create_handler, gb_main);
387  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
388  AWT_activate_prompt("Create experiment", "Enter name of new experiment:", source, "Create", handler);
389 }
391  ResultHandler handler = makeResultHandler(experiment_rename_handler, gb_main);
392  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
393  AWT_activate_prompt("Rename experiment", "Enter new experiment name:", source, "Rename", handler);
394 }
396  ResultHandler handler = makeResultHandler(experiment_copy_handler, gb_main);
397  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
398  AWT_activate_prompt("Copy experiment", "Enter name of new experiment:", source, "Copy", handler);
399 }
400 
402  static BoundItemSel *bis = new BoundItemSel(gb_main, EXP_get_selector());
403  exp_assert(bis->gb_main == gb_main);
404 
405  aws->insert_menu_topic(aws->local_id("exp_reorder_fields"), "Reorder fields ...", "R", "spaf_reorder.hlp", AD_F_ALL, makeCreateWindowCallback(DBUI::create_fields_reorder_window, bis));
406  aws->insert_menu_topic(aws->local_id("exp_delete_field"), "Delete/Hide Field ...", "D", "spaf_delete.hlp", AD_F_ALL, makeCreateWindowCallback(DBUI::create_field_delete_window, bis));
407  aws->insert_menu_topic(aws->local_id("exp_create_field"), "Create fields ...", "C", "spaf_create.hlp", AD_F_ALL, makeCreateWindowCallback(DBUI::create_field_create_window, bis));
408  aws->sep______________();
409  aws->insert_menu_topic("exp_unhide_fields", "Show all hidden fields", "S", "scandb.hlp", AD_F_ALL, makeWindowCallback(experiment_field_selection_list_unhide_all_cb, gb_main));
410  aws->insert_menu_topic("exp_refresh_fields", "Refresh fields", "f", "scandb.hlp", AD_F_ALL, makeWindowCallback(experiment_field_selection_list_update_cb, gb_main));
411 }
412 
413 #if defined(WARN_TODO)
414 #warning move EXP_create_experiment_window to SL/DB_UI
415 #endif
416 
417 static AW_window *popup_new_experiment_window(AW_root *aw_root, GBDATA *gb_main, int detach_id);
418 
419 static void popup_detached_experiment_window(AW_window *aw_parent, const InfoWindow *infoWin) {
421  if (reusable) {
422  reusable->reuse();
423  }
424  else { // create a new window if none is reusable
426  infoWin->get_gbmain(),
428  }
429 }
430 
431 static AW_window *popup_new_experiment_window(AW_root *aw_root, GBDATA *gb_main, int detach_id) { // INFO_WINDOW_CREATOR
433  const ItemSelector& itemType = EXP_get_selector();
434 
435  DBUI::init_info_window(aw_root, aws, itemType, detach_id);
436  aws->load_xfig("ad_spec.fig");
437 
438  aws->button_length(8);
439 
440  aws->at("close");
441  aws->callback(AW_POPDOWN);
442  aws->create_button("CLOSE", "CLOSE", "C");
443 
444  aws->at("search");
445  aws->callback(makeCreateWindowCallback(EXP_create_experiment_query_window, gb_main));
446  aws->create_button("SEARCH", "SEARCH", "S", "+");
447 
448  aws->at("help");
449  aws->callback(makeHelpCallback("experiment_info.hlp"));
450  aws->create_button("HELP", "HELP", "H");
451 
452  DbScanner *scanner = DbScanner::create(gb_main,
453  InfoWindowRegistry::localize_scanner_id("experiment", detach_id),
454  aws, "box", "field", "enable", DB_KEYVIEWER, "mark", itemType);
455 
456  const InfoWindow& infoWin = InfoWindowRegistry::infowin.registerInfoWindow(aws, scanner, detach_id);
457 
458  if (infoWin.is_maininfo()) {
459  aws->create_menu("EXPERIMENT", "E", AD_F_ALL);
460  aws->insert_menu_topic("experiment_delete", "Delete", "D", "spa_delete.hlp", AD_F_ALL, makeWindowCallback(experiment_delete_cb, gb_main));
461  aws->insert_menu_topic("experiment_rename", "Rename ...", "R", "spa_rename.hlp", AD_F_ALL, makeWindowCallback(experiment_rename_cb, gb_main));
462  aws->insert_menu_topic("experiment_copy", "Copy ...", "y", "spa_copy.hlp", AD_F_ALL, makeWindowCallback(experiment_copy_cb, gb_main));
463  aws->insert_menu_topic("experiment_create", "Create ...", "C", "spa_create.hlp", AD_F_ALL, makeWindowCallback(experiment_create_cb, gb_main));
464  }
465 
466  aws->create_menu("FIELDS", "F", AD_F_ALL);
467  EXP_create_field_items(aws, gb_main);
468 
469  aws->at("detach");
471 
472  aws->show();
473  infoWin.attach_selected_item();
474 
475  return aws;
476 }
477 
479  static AW_window *aws = NULp;
480  if (!aws) {
481  aws = popup_new_experiment_window(aw_root, gb_main, InfoWindow::MAIN_WINDOW);
482  }
483  else {
485  }
486 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2492
GB_ERROR GB_copy_dropProtectMarksAndTempstate(GBDATA *dest, GBDATA *source)
Definition: arbdb.cxx:2120
static void popup_detached_experiment_window(AW_window *aw_parent, const InfoWindow *infoWin)
static char * old_species_marks
const char * GB_ERROR
Definition: arb_core.h:25
const InfoWindow * find_reusable_of_same_type_as(const InfoWindow &other)
Definition: info_window.h:172
string result
static GBDATA * EXP_get_next_experiment_data(GBDATA *gb_experiment_data, QUERY_RANGE range)
void button_length(int length)
Definition: AW_at.cxx:283
static GBDATA * get_current_experiment_data(GBDATA *gb_main)
const char * config_pos_fig
Definition: db_query.h:61
AwarName species_name
Definition: db_query.h:42
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:592
GB_ERROR GBT_restore_marked_species(GBDATA *gb_main, const char *stored_marked)
Definition: aditem.cxx:424
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
Definition: arbdb.cxx:1361
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:717
ItemSelector & ORGANISM_get_selector()
Definition: species.cxx:140
const char * key_pos_fig
Definition: db_query.h:53
static const int MAIN_WINDOW
Definition: info_window.h:67
#define AWAR_ORGANISM_NAME
int allocate_detach_id(const InfoWindow &other)
Definition: info_window.h:160
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
Definition: arbdb.cxx:2525
void at(int x, int y)
Definition: AW_at.cxx:93
static AW_window * popup_new_experiment_window(AW_root *aw_root, GBDATA *gb_main, int detach_id)
const char * ere_pos_fig
Definition: db_query.h:48
static void refresh_displayed_experiments()
GBDATA * EXP_first_experiment_rel_exp_data(GBDATA *gb_experiment_data)
GBDATA * GEN_get_current_organism(GBDATA *gb_main)
NOT4PERL GB_ERROR GBT_with_stored_species(GBDATA *gb_main, const char *stored, species_callback doit, int *clientdata)
Definition: aditem.cxx:382
void(* add_selection_changed_cb)(AW_root *aw_root, const RootCallback &cb)
Definition: items.h:76
const char * where_pos_fig
Definition: db_query.h:49
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
DbQuery * create_query_box(AW_window *aws, query_spec *awtqs, const char *query_id)
Definition: db_query.cxx:2346
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
const char * result_pos_fig
Definition: db_query.h:57
STL namespace.
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
GBDATA * GEN_find_organism(GBDATA *gb_main, const char *name)
Definition: adGene.cxx:738
const char * open_parser_pos_fig
Definition: db_query.h:66
GBDATA * GB_get_grandfather(GBDATA *gbd)
Definition: arbdb.cxx:1702
GBDATA * GB_get_father(GBDATA *gbd)
Definition: arbdb.cxx:1696
static void experiment_copy_cb(AW_window *aww, GBDATA *gb_main)
#define cb(action)
#define gen_assert(bed)
Definition: GEN_local.hxx:19
AW_window * EXP_create_experiment_query_window(AW_root *aw_root, GBDATA *gb_main)
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
GB_ERROR GB_delete(GBDATA *&source)
Definition: arbdb.cxx:1880
GBDATA * EXP_next_experiment(GBDATA *gb_experiment)
GBDATA * EXP_find_experiment(GBDATA *gb_species, const char *name)
const char * read_char_pntr() const
Definition: AW_awar.cxx:171
GB_ERROR GB_export_error(const char *error)
Definition: arb_msg.cxx:259
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:353
static AW_root * SINGLETON
Definition: aw_root.hxx:102
void show()
Definition: AW_window.cxx:1658
GBDATA * GB_create_container(GBDATA *father, const char *key)
Definition: arbdb.cxx:1803
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
static struct MutableItemSelector EXP_item_selector
static void experiment_delete_cb(AW_window *aww, GBDATA *gb_main)
void reuse() const
Definition: info_window.h:114
GBDATA * get_gbmain() const
Definition: info_window.h:85
static GBDATA * first_experiment_in_range(GBDATA *gb_experiment_data, QUERY_RANGE range)
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:469
const char * qbox_pos_fig
Definition: db_query.h:52
void init_info_window(AW_root *aw_root, AW_window_simple_menu *aws, const ItemSelector &itemType, int detach_id)
Definition: info_window.cxx:36
GBDATA * GEN_next_marked_organism(GBDATA *gb_organism)
Definition: adGene.cxx:783
ItemSelector & EXP_get_selector()
static void error(const char *msg)
Definition: mkptypes.cxx:96
GBDATA * GB_get_root(GBDATA *gbd)
Definition: arbdb.cxx:1714
#define AWAR_EXPERIMENT_NAME
Definition: EXP.hxx:30
#define AWAR_TREE
static void add_selected_experiment_changed_cb(AW_root *aw_root, const RootCallback &cb)
static InfoWindowRegistry infowin
Definition: info_window.h:187
static QUERY::DbQuery * GLOBAL_experiment_query
static GBDATA * next_experiment_in_range(GBDATA *gb_prev, QUERY_RANGE range)
static void reactivate(AW_window *aww)
Definition: info_window.h:189
#define AWAR_SPECIES_NAME
const char * count_pos_fig
Definition: db_query.h:58
void attach_selected_item() const
Definition: info_window.h:110
bool is_maininfo() const
Definition: info_window.h:82
static GB_ERROR experiment_rename_handler(const char *dest, GBDATA *gb_main)
static DbScanner * create(GBDATA *gb_main, const char *scanner_id, AW_window *aws, const char *box_pos_fig, const char *edit_pos_fig, const char *edit_enable_pos_fig, DB_SCANNERMODE scannermode, const char *mark_pos_fig, ItemSelector &selector)
Definition: db_scanner.cxx:227
const char * by_pos_fig
Definition: db_query.h:50
char * read_string() const
Definition: AW_awar.cxx:201
static void EXP_select_experiment(GBDATA *, AW_root *aw_root, const char *item_name)
static void experiment_create_cb(AW_window *aww, GBDATA *gb_main)
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
static GB_ERROR experiment_create_handler(const char *dest, GBDATA *gb_main)
#define exp_assert(bed)
Definition: EXP_local.hxx:22
static GB_ERROR experiment_copy_handler(const char *dest, GBDATA *gb_main)
AW_window * create_fields_reorder_window(AW_root *root, BoundItemSel *bound_selector)
Definition: ui_species.cxx:590
void search_duplicated_field_content(AW_window *dummy, DbQuery *query, bool tokenize)
Definition: db_query.cxx:1194
static GBDATA * EXP_get_current_experiment(GBDATA *gb_main, AW_root *aw_root)
QUERY_RANGE
Definition: items.h:40
void exp_restore_old_species_marks(GBDATA *gb_main)
bool aw_ask_sure(const char *unique_id, const char *msg)
static void EXP_create_field_items(AW_window *aws, GBDATA *gb_main)
GB_ERROR GB_export_errorf(const char *templat,...)
Definition: arb_msg.cxx:264
static GBDATA * EXP_find_experiment_by_id(GBDATA *gb_main, const char *id)
GBDATA * EXP_find_or_create_experiment_rel_exp_data(GBDATA *gb_experiment_data, const char *name)
popup_info_window_cb popup_info_window
Definition: db_query.h:69
void EXP_popup_experiment_window(AW_root *aw_root, GBDATA *gb_main)
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:32
GBDATA * GB_next_marked(GBDATA *gbd, const char *keystring)
Definition: adquery.cxx:670
static char * EXP_get_experiment_id(GBDATA *, GBDATA *gb_experiment)
GB_ERROR GBT_write_string(GBDATA *gb_container, const char *fieldpath, const char *content)
Definition: adtools.cxx:451
AW_window * create_field_create_window(AW_root *root, BoundItemSel *bound_selector)
Definition: ui_species.cxx:787
const char * do_mark_pos_fig
Definition: db_query.h:62
#define AD_F_ALL
static GBDATA * EXP_get_first_experiment_data(GBDATA *gb_main, AW_root *aw_root, QUERY_RANGE range)
GBDATA * GBT_first_species(GBDATA *gb_main)
Definition: aditem.cxx:124
GBDATA * gb_main
Definition: items.h:85
AW_window * create_field_delete_window(AW_root *root, BoundItemSel *bound_selector)
Definition: ui_species.cxx:720
const char * query_pos_fig
Definition: db_query.h:54
#define CHANGE_KEY_PATH_EXPERIMENTS
Definition: arbdbt.h:88
void aw_message(const char *msg)
Definition: AW_status.cxx:932
const char * do_query_pos_fig
Definition: db_query.h:60
void add_detach_area(detached_uppopper popup_detached_cb) const
AW_root * get_root()
Definition: aw_window.hxx:348
GBDATA * GBT_next_species(GBDATA *gb_species)
Definition: aditem.cxx:128
#define NULp
Definition: cxxforward.h:97
GBDATA * EXP_get_experiment_data(GBDATA *gb_species)
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:136
GBDATA * EXP_find_experiment_rel_exp_data(GBDATA *gb_experiment_data, const char *name)
GB_ERROR write_string(const char *aw_string)
void sep______________()
Definition: AW_window.cxx:750
#define GB_USERFLAG_QUERY
Definition: arbdb.h:55
static void experiment_rename_cb(AW_window *aww, GBDATA *gb_main)
const char * local_id(const char *id) const
Definition: AW_window.cxx:744
char * GBT_store_marked_species(GBDATA *gb_main, bool unmark_all)
Definition: aditem.cxx:354
GBDATA * GB_first_marked(GBDATA *gbd, const char *keystring)
Definition: adquery.cxx:655
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:130
GBDATA * gb_main
Definition: db_query.h:39
GBDATA * gb_main
Definition: adname.cxx:33
GBDATA * GEN_first_marked_organism(GBDATA *gb_main)
Definition: adGene.cxx:777
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
Definition: aditem.cxx:437
const char * do_set_pos_fig
Definition: db_query.h:65
GBDATA * GEN_first_marked_pseudo_species(GBDATA *gb_main)
Definition: adGene.cxx:721
AwarName tree_name
Definition: db_query.h:43
void experiment_field_selection_list_update_cb(AW_window *, GBDATA *gb_main)
Definition: changekey.cxx:195
GB_ERROR GEN_mark_organism_or_corresponding_organism(GBDATA *gb_species, int *)
const MutableBoundItemSel BoundItemSel
Definition: items.h:105
void experiment_field_selection_list_unhide_all_cb(AW_window *, GBDATA *gb_main)
Definition: changekey.cxx:194
const InfoWindow & registerInfoWindow(AW_window *aww, DbScanner *scanner, int detach_id)
Definition: info_window.h:142
void init(AW_root *root, const char *wid, const char *windowname)
Definition: AW_window.cxx:2817
const char * do_delete_pos_fig
Definition: db_query.h:64
const char * do_unmark_pos_fig
Definition: db_query.h:63
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:195
const char * do_refresh_pos_fig
Definition: db_query.h:67
static const char * localize_scanner_id(const char *scanner_id, int detach_id)
Definition: info_window.h:195
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:446
void AWT_activate_prompt(const char *title, const char *prompt, const char *defaultResult, const char *button, const ResultHandler &handle_result, const char *helpfile, const char *srt)
Definition: AWT_prompt.cxx:62