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 static struct MutableItemSelector EXP_item_selector = { // @@@ move to SL/ITEMS
205  -1, // unknown
207  "experiment",
208  "experiments",
209  "name",
218 };
219 
221 
223 
224 AW_window *EXP_create_experiment_query_window(AW_root *aw_root, GBDATA *gb_main) { // @@@ move to SL/DB_UI
225  static AW_window_simple_menu *aws = NULp;
226  if (!aws) {
227  aws = new AW_window_simple_menu;
228  aws->init(aw_root, "EXPERIMENT_QUERY", "Experiment SEARCH and QUERY");
229  aws->create_menu("More functions", "f");
230  aws->load_xfig("ad_query.fig");
231 
233 
234  awtqs.gb_main = gb_main;
236  awtqs.tree_name = AWAR_TREE;
238  awtqs.use_menu = 1;
239  awtqs.ere_pos_fig = "ere3";
240  awtqs.where_pos_fig = "where3";
241  awtqs.by_pos_fig = "by3";
242  awtqs.qbox_pos_fig = "qbox";
243  awtqs.key_pos_fig = NULp;
244  awtqs.query_pos_fig = "content";
245  awtqs.result_pos_fig = "result";
246  awtqs.count_pos_fig = "count";
247  awtqs.do_query_pos_fig = "doquery";
248  awtqs.config_pos_fig = "doconfig";
249  awtqs.do_mark_pos_fig = "domark";
250  awtqs.do_unmark_pos_fig = "dounmark";
251  awtqs.do_delete_pos_fig = "dodelete";
252  awtqs.do_set_pos_fig = "doset";
253  awtqs.do_refresh_pos_fig = "dorefresh";
254  awtqs.open_parser_pos_fig = "openparser";
256 
257  QUERY::DbQuery *query = create_query_box(aws, &awtqs, "exp");
258  GLOBAL_experiment_query = query;
259 
260  aws->create_menu("More search", "s");
261  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));
262  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));
263 
264  aws->button_length(7);
265 
266  aws->at("close");
267  aws->callback(AW_POPDOWN);
268  aws->create_button("CLOSE", "CLOSE", "C");
269 
270  aws->at("help");
271  aws->callback(makeHelpCallback("experiment_search.hlp"));
272  aws->create_button("HELP", "HELP", "H");
273  }
274  return aws;
275 }
276 
278  if (aw_ask_sure("experiment_delete", "Are you sure to delete the experiment")) {
279  GB_transaction ta(gb_main);
280  GBDATA *gb_experiment = EXP_get_current_experiment(gb_main, aww->get_root());
281 
282  GB_ERROR error = gb_experiment ? GB_delete(gb_experiment) : "Please select a experiment first";
283  if (error) {
284  error = ta.close(error);
285  aw_message(error);
286  }
287  }
288 }
289 
290 static GB_ERROR experiment_create_handler(const char *dest, GBDATA *gb_main) {
292 
293  if (!error) {
294  AW_root *aw_root = AW_root::SINGLETON;
295  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
296 
297  if (!gb_experiment_data) error = "Please select an organism";
298  else {
299  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
300  if (gb_dest) {
301  error = GBS_global_string("Experiment '%s' already exists", dest);
302  }
303  else {
304  gb_dest = EXP_find_or_create_experiment_rel_exp_data(gb_experiment_data, dest);
305  if (!gb_dest) error = GB_await_error();
306  else aw_root->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
307  }
308  }
309  }
310 
311  error = GB_end_transaction(gb_main, error);
312  return error;
313 }
314 static GB_ERROR experiment_rename_handler(const char *dest, GBDATA *gb_main) {
316  const char *source = awr->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
317  GB_ERROR error = NULp;
318 
319  if (strcmp(source, dest) != 0) {
320  error = GB_begin_transaction(gb_main);
321  if (!error) {
322  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
323 
324  if (!gb_experiment_data) error = "Please select an organism";
325  else {
326  GBDATA *gb_source = EXP_find_experiment_rel_exp_data(gb_experiment_data, source);
327  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
328 
329  if (!gb_source) error = "Please select an experiment";
330  else if (gb_dest) error = GB_export_errorf("Experiment '%s' already exists", dest);
331  else {
332  GBDATA *gb_name = GB_search(gb_source, "name", GB_STRING);
333  if (!gb_name) error = GB_await_error();
334  else {
335  error = GB_write_string(gb_name, dest);
336  if (!error) awr->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
337  }
338  }
339  }
340  }
341  error = GB_end_transaction(gb_main, error);
342  }
343 
344  return error;
345 }
346 static GB_ERROR experiment_copy_handler(const char *dest, GBDATA *gb_main) {
348  const char *source = awr->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
350 
351  if (!error) {
352  GBDATA *gb_experiment_data = get_current_experiment_data(gb_main);
353 
354  if (!gb_experiment_data) error = "Please select an organism";
355  else {
356  GBDATA *gb_source = EXP_find_experiment_rel_exp_data(gb_experiment_data, source);
357  GBDATA *gb_dest = EXP_find_experiment_rel_exp_data(gb_experiment_data, dest);
358 
359  if (!gb_source) error = "Please select an experiment";
360  else if (gb_dest) error = GB_export_errorf("Experiment '%s' already exists", dest);
361  else {
362  gb_dest = GB_create_container(gb_experiment_data, "experiment");
363  if (!gb_dest) error = GB_await_error();
364  else error = GB_copy_dropProtectMarksAndTempstate(gb_dest, gb_source);
365 
366  if (!error) {
367  error = GBT_write_string(gb_dest, "name", dest);
368  if (!error) awr->awar(AWAR_EXPERIMENT_NAME)->write_string(dest);
369  }
370  }
371  }
372  }
373 
374  error = GB_end_transaction(gb_main, error);
375  return error;
376 }
378  ResultHandler handler = makeResultHandler(experiment_create_handler, gb_main);
379  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
380  AWT_activate_prompt("Create experiment", "Enter name of new experiment:", source, "Create", handler);
381 }
383  ResultHandler handler = makeResultHandler(experiment_rename_handler, gb_main);
384  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
385  AWT_activate_prompt("Rename experiment", "Enter new experiment name:", source, "Rename", handler);
386 }
388  ResultHandler handler = makeResultHandler(experiment_copy_handler, gb_main);
389  const char *source = aww->get_root()->awar(AWAR_EXPERIMENT_NAME)->read_char_pntr();
390  AWT_activate_prompt("Copy experiment", "Enter name of new experiment:", source, "Copy", handler);
391 }
392 
394  static BoundItemSel *bis = new BoundItemSel(gb_main, EXP_get_selector());
395  exp_assert(bis->gb_main == gb_main);
396 
397  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));
398  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));
399  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));
400  aws->sep______________();
401  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));
402  aws->insert_menu_topic("exp_refresh_fields", "Refresh fields", "f", "scandb.hlp", AD_F_ALL, makeWindowCallback(experiment_field_selection_list_update_cb, gb_main));
403 }
404 
405 static AW_window *popup_new_experiment_window(AW_root *aw_root, GBDATA *gb_main, int detach_id);
406 
407 static void popup_detached_experiment_window(AW_window *aw_parent, const InfoWindow *infoWin) {
409  if (reusable) {
410  reusable->reuse();
411  }
412  else { // create a new window if none is reusable
414  infoWin->get_gbmain(),
416  }
417 }
418 
419 static AW_window *popup_new_experiment_window(AW_root *aw_root, GBDATA *gb_main, int detach_id) { // INFO_WINDOW_CREATOR
421  const ItemSelector& itemType = EXP_get_selector();
422 
423  DBUI::init_info_window(aw_root, aws, itemType, detach_id);
424  aws->load_xfig("ad_spec.fig");
425 
426  aws->button_length(8);
427 
428  aws->at("close");
429  aws->callback(AW_POPDOWN);
430  aws->create_button("CLOSE", "CLOSE", "C");
431 
432  aws->at("search");
433  aws->callback(makeCreateWindowCallback(EXP_create_experiment_query_window, gb_main));
434  aws->create_button("SEARCH", "SEARCH", "S", "+");
435 
436  aws->at("help");
437  aws->callback(makeHelpCallback("experiment_info.hlp"));
438  aws->create_button("HELP", "HELP", "H");
439 
440  DbScanner *scanner = DbScanner::create(gb_main,
441  InfoWindowRegistry::localize_scanner_id("experiment", detach_id),
442  aws, "box", "field", "enable", DB_KEYVIEWER, "mark", itemType);
443 
444  const InfoWindow& infoWin = InfoWindowRegistry::infowin.registerInfoWindow(aws, scanner, detach_id);
445 
446  if (infoWin.is_maininfo()) {
447  aws->create_menu("EXPERIMENT", "E", AD_F_ALL);
448  aws->insert_menu_topic("experiment_delete", "Delete", "D", "spa_delete.hlp", AD_F_ALL, makeWindowCallback(experiment_delete_cb, gb_main));
449  aws->insert_menu_topic("experiment_rename", "Rename ...", "R", "spa_rename.hlp", AD_F_ALL, makeWindowCallback(experiment_rename_cb, gb_main));
450  aws->insert_menu_topic("experiment_copy", "Copy ...", "y", "spa_copy.hlp", AD_F_ALL, makeWindowCallback(experiment_copy_cb, gb_main));
451  aws->insert_menu_topic("experiment_create", "Create ...", "C", "spa_create.hlp", AD_F_ALL, makeWindowCallback(experiment_create_cb, gb_main));
452  }
453 
454  aws->create_menu("FIELDS", "F", AD_F_ALL);
455  EXP_create_field_items(aws, gb_main);
456 
457  aws->at("detach");
459 
460  aws->show();
461  infoWin.attach_selected_item();
462 
463  return aws;
464 }
465 
466 void EXP_popup_experiment_window(AW_root *aw_root, GBDATA *gb_main) { // @@@ move to SL/DB_UI
467  static AW_window *aws = NULp;
468  if (!aws) {
469  aws = popup_new_experiment_window(aw_root, gb_main, InfoWindow::MAIN_WINDOW);
470  }
471  else {
473  }
474 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2528
GB_ERROR GB_copy_dropProtectMarksAndTempstate(GBDATA *dest, GBDATA *source)
Definition: arbdb.cxx:2152
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:288
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:595
GB_ERROR GBT_restore_marked_species(GBDATA *gb_main, const char *stored_marked)
Definition: aditem.cxx:446
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
Definition: arbdb.cxx:1387
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
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:2561
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:404
void(* add_selection_changed_cb)(AW_root *aw_root, const RootCallback &cb)
Definition: items.h:77
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:2354
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
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:728
const char * open_parser_pos_fig
Definition: db_query.h:66
GBDATA * GB_get_grandfather(GBDATA *gbd)
Definition: arbdb.cxx:1728
GBDATA * GB_get_father(GBDATA *gbd)
Definition: arbdb.cxx:1722
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:231
GB_ERROR GB_delete(GBDATA *&source)
Definition: arbdb.cxx:1916
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:168
GB_ERROR GB_export_error(const char *error)
Definition: arb_msg.cxx:257
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:342
static AW_root * SINGLETON
Definition: aw_root.hxx:102
void show()
Definition: AW_window.cxx:1683
GBDATA * GB_create_container(GBDATA *father, const char *key)
Definition: arbdb.cxx:1829
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:472
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:773
ItemSelector & EXP_get_selector()
static void error(const char *msg)
Definition: mkptypes.cxx:96
GBDATA * GB_get_root(GBDATA *gbd)
Definition: arbdb.cxx:1740
#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:198
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:1191
static GBDATA * EXP_get_current_experiment(GBDATA *gb_main, AW_root *aw_root)
QUERY_RANGE
Definition: items.h:41
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:262
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:35
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:86
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:1142
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:354
GBDATA * GBT_next_species(GBDATA *gb_species)
Definition: aditem.cxx:128
#define NULp
Definition: cxxforward.h:114
GBDATA * EXP_get_experiment_data(GBDATA *gb_species)
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:139
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:753
#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:747
char * GBT_store_marked_species(GBDATA *gb_main, bool unmark_all)
Definition: aditem.cxx:377
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:133
GBDATA * gb_main
Definition: db_query.h:39
GBDATA * gb_main
Definition: adname.cxx:32
GBDATA * GEN_first_marked_organism(GBDATA *gb_main)
Definition: adGene.cxx:767
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:459
const char * do_set_pos_fig
Definition: db_query.h:65
GBDATA * GEN_first_marked_pseudo_species(GBDATA *gb_main)
Definition: adGene.cxx:711
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:106
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:2845
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:194
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:448
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