ARB
GDE.cxx
Go to the documentation of this file.
1 #include "GDE_extglob.h"
2 #include "GDE_awars.h"
3 
4 #include <awt_sel_boxes.hxx>
5 #include <awt_filter.hxx>
6 
7 #include <aw_msg.hxx>
8 #include <aw_awar.hxx>
9 #include <aw_file.hxx>
10 #include <aw_root.hxx>
11 #include <aw_awar_defs.hxx>
12 #include <aw_select.hxx>
13 
14 #include <arb_str.h>
15 
16 #include <cmath>
17 #include <awt_config_manager.hxx>
18 
19 // AISC_MKPT_PROMOTE:#ifndef GDE_MENU_H
20 // AISC_MKPT_PROMOTE:#include "GDE_menu.h"
21 // AISC_MKPT_PROMOTE:#endif
22 
24 
26 int num_menus = 0;
27 
28 static char GDEBLANK[] = "\0";
29 
30 #define SLIDERFIELDWIDTH 5 // width of numeric input fields with slider
31 #define SLIDERWIDTH 200 // with of the slider itself
32 
33 #define AWAR_GDE_ALIGNMENT AWAR_PREFIX_GDE_TEMP "/alignment"
34 #define AWAR_GDE_FILTER_NAME AWAR_PREFIX_GDE_TEMP "/filter/name"
35 
36 struct gde_iteminfo {
38  int idx;
39  gde_iteminfo(GmenuItem *item_, int idx_) : item(item_), idx(idx_) {}
40 };
41 
42 static void GDE_showhelp_cb(UNFIXED, GmenuItem *gmenuitem) {
43  if (gmenuitem->help) {
44  AW_help_popup(NULp, gmenuitem->help);
45  }
46  else {
47  aw_message("Sorry - no help available (please report to devel@arb-home.de)");
48  }
49 }
50 
51 static char *GDE_makeawarname_in(GmenuItem *gmenuitem, long i, const char *awar_root) {
52  char *gmenu_label = GBS_string_2_key(gmenuitem->parent_menu->label);
53  char *gmenuitem_label = GBS_string_2_key(gmenuitem->label);
54  char *arg = GBS_string_2_key(gmenuitem->arg[i].symbol);
55 
56  char *name = GBS_global_string_copy("%s/%s/%s/%s", awar_root, gmenu_label, gmenuitem_label, arg);
57 
58  free(gmenu_label);
59  free(gmenuitem_label);
60  free(arg);
61 
62  return name;
63 }
64 
65 char *GDE_makeawarname (GmenuItem *gmenuitem, long i) { return GDE_makeawarname_in(gmenuitem, i, AWAR_PREFIX_GDE); }
66 char *GDE_maketmpawarname(GmenuItem *gmenuitem, long i) { return GDE_makeawarname_in(gmenuitem, i, AWAR_PREFIX_GDE_TEMP); }
67 
68 static char *gde_filter_weights(GBDATA *gb_sai) {
69  char *ali_name = GBT_get_default_alignment(GB_get_root(gb_sai));
70  GBDATA *gb_ali = GB_entry(gb_sai, ali_name);
71  char *result = NULp;
72 
73  if (gb_ali) {
74  GBDATA *gb_type = GB_entry(gb_ali, "_TYPE");
75  if (gb_type) {
76  const char *type = GB_read_char_pntr(gb_type);
77 
78  if (GBS_string_matches(type, "PV?:*", GB_MIND_CASE)) {
79  result = GBS_global_string_copy("%s: %s", GBT_get_name_or_description(gb_sai), type);
80  }
81 
82  }
83  }
84 
85  free(ali_name);
86  return result;
87 
88 }
89 
91  saisel->refresh();
92 }
93 
94 static AW_window *GDE_create_filename_browser_window(AW_root *aw_root, const char *awar_prefix, const char *title) {
95  AW_window_simple *aws = new AW_window_simple;
96 
97  {
98  char *wid = GBS_string_2_key(awar_prefix);
99  aws->init(aw_root, wid, title);
100  free(wid);
101  }
102  aws->load_xfig("sel_box.fig");
103 
104  aws->at("close");
105  aws->callback(AW_POPDOWN);
106  aws->create_button("CLOSE", "CLOSE", "C");
107 
108  AW_create_standard_fileselection(aws, awar_prefix);
109 
110  return aws;
111 }
112 
113 static void GDE_popup_filename_browser(AW_window *aw, gde_iteminfo *info, const char *title) {
114  GmenuItem *gmenuitem = info->item;
115  int idx = info->idx;
116  char *base_awar = GDE_maketmpawarname(gmenuitem, idx);
117 
118  static GB_HASH *popup_hash = NULp;
119  if (!popup_hash) popup_hash = GBS_create_hash(20, GB_MIND_CASE);
120 
121  AW_window *aw_browser = (AW_window*)GBS_read_hash(popup_hash, base_awar);
122  if (!aw_browser) {
123  aw_browser = GDE_create_filename_browser_window(aw->get_root(), base_awar, title);
124  GBS_write_hash(popup_hash, base_awar, (long)aw_browser);
125  }
126  aw_browser->activate();
127  free(base_awar);
128 }
129 
130 inline bool shall_store_in_config(const GmenuItemArg& itemarg) {
131  return itemarg.type != FILE_SELECTOR;
132 }
133 inline bool want_config_manager(GmenuItem *gmenuitem) {
134  for (int i=0; i<gmenuitem->numargs; i++) {
135  const GmenuItemArg& itemarg = gmenuitem->arg[i];
136  if (shall_store_in_config(itemarg)) return true;
137  }
138  return false;
139 }
140 static void setup_gde_config_def(AWT_config_definition& cdef, GmenuItem *gmenuitem) {
141  for (int i=0; i<gmenuitem->numargs; i++) {
142  const GmenuItemArg& itemarg = gmenuitem->arg[i];
143  if (shall_store_in_config(itemarg)) {
144  char *awar = GDE_makeawarname(gmenuitem, i);
145 
146  gde_assert(awar);
147  gde_assert(itemarg.symbol);
148 
149  if (awar) {
150  cdef.add(awar, itemarg.symbol);
151  free(awar);
152  }
153  }
154  }
155 }
156 
157 static AW_window *GDE_menuitem_cb(AW_root *aw_root, GmenuItem *gmenuitem) {
158 #define BUFSIZE 200
159  char bf[BUFSIZE+1];
160  IF_ASSERTION_USED(int printed =)
161  sprintf(bf, "GDE / %s / %s", gmenuitem->parent_menu->label, gmenuitem->label);
162 
163  gde_assert(printed<=BUFSIZE);
164  char seqtype = gmenuitem->seqtype;
165 
166  if (!gmenuitem->aws) {
167  AW_window_simple *aws = new AW_window_simple;
168  aws->init(aw_root, bf, bf);
169 
170  switch (db_access.window_type) {
171  case GDE_WINDOWTYPE_DEFAULT: {
172  if (seqtype == '-') aws->load_xfig("gdeitem_simple.fig");
173  else aws->load_xfig("gdeitem.fig");
174  break;
175  }
177  gde_assert(seqtype != '-');
178  aws->load_xfig("gde3item.fig");
179  break;
180  }
181 
182  aws->button_length(10);
183  aws->at(10, 10);
184  aws->auto_space(0, 10);
185 
186  aws->at("help");
187  aws->callback(makeWindowCallback(GDE_showhelp_cb, gmenuitem));
188  aws->create_button("GDE_HELP", "HELP", "H");
189 
190  aws->at("start");
191  aws->callback(makeWindowCallback(GDE_startaction_cb, gmenuitem));
192  aws->create_button("GO", "GO", "O");
193 
194  aws->at("cancel");
195  aws->callback(AW_POPDOWN);
196  aws->create_button("CLOSE", "CLOSE", "C");
197 
198  if (want_config_manager(gmenuitem)) {
199  aws->at("config");
200  AWT_insert_config_manager(aws, AW_ROOT_DEFAULT, aws->window_defaults_name, makeConfigSetupCallback(setup_gde_config_def, gmenuitem));
201  }
202 
203  if (gmenuitem->numinputs>0) {
204  switch (db_access.window_type) {
205  case GDE_WINDOWTYPE_DEFAULT: {
206  if (seqtype != '-') { // '-' means "skip sequence export"
207  aws->at("which_alignment");
208  const char *ali_filter = seqtype == 'A' ? "pro=:ami=" : (seqtype == 'N' ? "dna=:rna=" : "*=");
210 
211  aws->at("which_species");
212  aws->create_toggle_field(AWAR_GDE_SPECIES);
213  aws->insert_toggle ("all", "a", 0);
214  aws->insert_default_toggle("marked", "m", 1);
215  aws->update_toggle_field();
216 
217  if (seqtype != 'N') {
218  aws->at("stop_codon");
219  aws->label("Cut stop-codon");
220  aws->create_toggle(AWAR_GDE_CUTOFF_STOPCODON);
221  }
222  }
223  break;
224  }
226  aws->at("topk"); aws->create_toggle("gde/top_area_kons");
227  aws->at("middlek"); aws->create_toggle("gde/middle_area_kons");
228  aws->at("topr"); aws->create_toggle("gde/top_area_remark");
229  aws->at("middler"); aws->create_toggle("gde/middle_area_remark");
230  aws->at("top"); aws->create_toggle("gde/top_area");
231  aws->at("topsai"); aws->create_toggle("gde/top_area_sai");
232  aws->at("toph"); aws->create_toggle("gde/top_area_helix");
233  aws->at("middle"); aws->create_toggle("gde/middle_area");
234  aws->at("middlesai"); aws->create_toggle("gde/middle_area_sai");
235  aws->at("middleh"); aws->create_toggle("gde/middle_area_helix");
236  break;
237  }
238 
239  if (seqtype != '-') {
240  aws->at("compression");
241  aws->create_option_menu(AWAR_GDE_COMPRESSION, true);
242  aws->insert_option ("none", "n", COMPRESS_NONE);
243  aws->insert_option ("vertical gaps", "v", COMPRESS_VERTICAL_GAPS);
244  aws->insert_default_option("columns w/o info", "i", COMPRESS_NONINFO_COLUMNS);
245  aws->insert_option ("all gaps", "g", COMPRESS_ALL);
246  aws->update_option_menu();
247 
248  aws->button_length(12);
249  aws->at("filtername");
250  if (!agde_filter) { // create only one filter - used for all GDE calls
251  agde_filter = awt_create_select_filter(aws->get_root(), db_access.gb_main, AWAR_GDE_FILTER_NAME);
252  }
253  aws->callback(makeCreateWindowCallback(awt_create_select_filter_win, agde_filter));
254  aws->create_button("SELECT_FILTER", AWAR_GDE_FILTER_NAME);
255  }
256 
257  aws->at("paramsb");
258  }
259  else {
260  aws->at("paramsb");
261  }
262 
263 
264  int labellength = 1;
265  for (int i=0; i<gmenuitem->numargs; i++) {
266  if (!(gmenuitem->arg[i].label)) gmenuitem->arg[i].label = GDEBLANK;
267 
268  const char *label = gmenuitem->arg[i].label;
269  const char *linefeed = strchr(label, '\n');
270 
271  int lablen;
272  while (linefeed) {
273  lablen = linefeed-label;
274  if (lablen>labellength) {
275  labellength = lablen;
276  }
277  label = linefeed+1;
278  linefeed = strchr(label, '\n');
279  }
280 
281  lablen = strlen(label);
282  if (lablen>labellength) {
283  labellength = lablen;
284  }
285  }
286  aws->label_length(labellength);
287  aws->auto_space(0, 0);
288 
289  for (int i=0; i<gmenuitem->numargs; i++) {
290  const GmenuItemArg& itemarg = gmenuitem->arg[i];
291 
292  if (itemarg.type==SLIDER) {
293  char *awarName = GDE_makeawarname(gmenuitem, i);
294  AW_awar *awar = NULp;
295 
296  if (int(itemarg.fvalue) == itemarg.fvalue &&
297  int(itemarg.min) == itemarg.min &&
298  int(itemarg.max) == itemarg.max)
299  {
300  awar = aw_root->awar_int(awarName, (long)itemarg.fvalue, AW_ROOT_DEFAULT);
301  }
302  else {
303  awar = aw_root->awar_float(awarName, itemarg.fvalue, AW_ROOT_DEFAULT);
304  }
305  awar->set_minmax(itemarg.min, itemarg.max);
306 
307  aws->label(itemarg.label);
308  aws->sens_mask(itemarg.active_mask);
309  aws->create_input_field_with_scaler(awarName, SLIDERFIELDWIDTH, SLIDERWIDTH, AW_SCALER_LINEAR);
310  free(awarName);
311  }
312  else if (itemarg.type==CHOOSER) {
313  char *defopt = itemarg.choice[0].method;
314  char *newawar = GDE_makeawarname(gmenuitem, i);
315  AW_awar *curr_awar = aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
316  char *curr_value = curr_awar->read_string();
317  bool curr_value_legal = false;
318 
319  aws->label(itemarg.label);
320  aws->sens_mask(itemarg.active_mask);
321  if ((strcasecmp(itemarg.choice[0].label, "no") == 0) ||
322  (strcasecmp(itemarg.choice[0].label, "yes") == 0))
323  {
324  aws->create_toggle_field(newawar, 1);
325  }
326  else {
327  aws->create_toggle_field(newawar);
328  }
329 
330  for (long j=0; j<itemarg.numchoices; j++) {
331  if (strcmp(itemarg.choice[j].method, curr_value) == 0) curr_value_legal = true;
332 
333  if (!j) {
334  aws->insert_default_toggle(itemarg.choice[j].label, "1", itemarg.choice[j].method);
335  }
336  else {
337  aws->insert_toggle(itemarg.choice[j].label, "1", itemarg.choice[j].method);
338  }
339  }
340  if (!curr_value_legal) curr_awar->write_string(defopt); // if saved value no longer occurs in choice -> overwrite with default
341  free(curr_value);
342  aws->update_toggle_field();
343  free(newawar);
344  }
345  else if (itemarg.type==CHOICE_MENU) {
346  char *defopt = itemarg.choice[itemarg.ivalue].method;
347  char *newawar = GDE_makeawarname(gmenuitem, i);
348  AW_awar *curr_awar = aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
349  char *curr_value = curr_awar->read_string();
350  bool curr_value_legal = false;
351 
352  if (itemarg.label[0]) aws->label(itemarg.label);
353  aws->sens_mask(itemarg.active_mask);
354  aws->create_option_menu(newawar, true);
355 
356  for (long j=0; j<itemarg.numchoices; j++) {
357  if (strcmp(itemarg.choice[j].method, curr_value) == 0) curr_value_legal = true;
358  aws->insert_option(itemarg.choice[j].label, "1", itemarg.choice[j].method);
359  }
360  if (!curr_value_legal) curr_awar->write_string(defopt); // if saved value no longer occurs in choice -> overwrite with default
361  free(curr_value);
362  aws->update_option_menu();
363  free(newawar);
364  }
365  else if (itemarg.type==TEXTFIELD) {
366  char *defopt = itemarg.textvalue;
367  char *newawar = GDE_makeawarname(gmenuitem, i);
368  aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
369  aws->label(itemarg.label);
370  aws->sens_mask(itemarg.active_mask);
371  aws->create_input_field(newawar, itemarg.textwidth); // TEXTFIELDWIDTH
372  free(newawar);
373  }
374  else if (itemarg.type==FILE_SELECTOR) {
375  char *base_awar = GDE_maketmpawarname(gmenuitem, i);
376  char *name_awar = GBS_global_string_copy("%s/file_name", base_awar);
377 
378  AW_create_fileselection_awars(aw_root, base_awar, "", itemarg.textvalue, "");
379 
380  aws->label(itemarg.label);
381  aws->sens_mask(itemarg.active_mask);
382  aws->create_input_field(name_awar, 40);
383  aws->callback(makeWindowCallback(GDE_popup_filename_browser, new gde_iteminfo(gmenuitem, i), ARB_strdup(itemarg.label)));
384  aws->create_button("", "Browse");
385 
386  free(name_awar);
387  free(base_awar);
388  }
389  else if (itemarg.type==CHOICE_TREE) {
390  char *defopt = itemarg.textvalue;
391  char *newawar = GDE_makeawarname(gmenuitem, i);
392  aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
393  aws->sens_mask(itemarg.active_mask);
394  if (itemarg.label[0]) aws->create_button(NULp, itemarg.label);
395  awt_create_TREE_selection_list(db_access.gb_main, aws, newawar, true);
396  free(newawar);
397  }
398  else if (itemarg.type==CHOICE_SAI) {
399  char *defopt = itemarg.textvalue;
400  char *newawar = GDE_makeawarname(gmenuitem, i);
401  aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
402  aws->sens_mask(itemarg.active_mask);
403  if (itemarg.label[0]) aws->create_button(NULp, itemarg.label);
404  awt_create_SAI_selection_list(db_access.gb_main, aws, newawar, true);
405  free(newawar);
406  }
407  else if (itemarg.type==CHOICE_WEIGHTS) {
408  char *defopt = itemarg.textvalue;
409  char *newawar = GDE_makeawarname(gmenuitem, i);
410 
411  aw_root->awar_string(newawar, defopt, AW_ROOT_DEFAULT);
412  aws->sens_mask(itemarg.active_mask);
413  if (itemarg.label[0]) aws->create_button(NULp, itemarg.label);
414  AW_DB_selection *saisel = awt_create_SAI_selection_list(db_access.gb_main, aws, newawar, true, makeSaiSelectionlistFilterCallback(gde_filter_weights));
415  free(newawar);
416  aw_root->awar(AWAR_GDE_ALIGNMENT)->add_callback(makeRootCallback(refresh_weights_sellist_cb, saisel));
417  }
418 
419  aws->at_newline();
420  }
421  aws->at_newline();
422  aws->window_fit();
423 
424  gmenuitem->aws = aws;
425  }
426  return gmenuitem->aws;
427 #undef BUFSIZE
428 }
429 
430 
431 
432 
433 void GDE_load_menu(AW_window *awm, AW_active /*mask*/, const char *menulabel) {
434  // Load GDE menu items.
435  //
436  // If 'menulabel' == NULp -> load all menus
437  // Else -> load specified menu
438  //
439  // Always loads complete menu(s).
440 
441  gde_assert(db_access.gb_main); // forgot to call GDE_init() ?
442 
443  char hotkey[] = "x";
444  bool topicInserted = false;
445 
446  for (long nmenu = 0; nmenu<num_menus; nmenu++) {
447  {
448  const char *menuname = menu[nmenu].label;
449  if (menulabel) {
450  if (strcmp(menulabel, menuname)) {
451  continue;
452  }
453  }
454  else {
455  hotkey[0] = menu[nmenu].meta;
456  awm->insert_sub_menu(menuname, hotkey, menu[nmenu].active_mask);
457  }
458  }
459 
460  long num_items = menu[nmenu].numitems;
461  for (long nitem=0; nitem<num_items; nitem++) {
462  GmenuItem *menuitem = &menu[nmenu].item[nitem];
463  gde_assert(!menuitem->help || ARB_strBeginsWith(menuitem->help, "agde_"));
464  hotkey[0] = menuitem->meta;
465 
466  if (!menuitem->popup) {
467  menuitem->popup = new WindowCallback(AW_window::makeWindowPopper(makeCreateWindowCallback(GDE_menuitem_cb, menuitem)));
468  }
469  awm->insert_menu_topic(menuitem->label, menuitem->label, hotkey, menuitem->help, menuitem->active_mask, *menuitem->popup);
470  topicInserted = true;
471  }
472 
473  if (!menulabel) {
474  awm->close_sub_menu();
475  }
476  }
477 
478  if (!topicInserted && menulabel && strcmp(menulabel, "User") != 0) { // accepts empty 'User' menu; see ../GDEHELP/ARB_GDEmenus.source@User
479  fprintf(stderr, "GDE-Warning: Could not find any topics for menu '%s' \n", menulabel);
480  gde_assert(0); // nothing found -> fix
481  }
482 }
483 
485 
487  db_access.get_sequences = get_sequences;
488  db_access.format_ali = format_ali;
489  db_access.window_type = window_type;
490  db_access.gb_main = gb_main;
491 
492 
493  switch (db_access.window_type) {
495  aw_root->awar_int("gde/top_area_kons", 1, aw_def);
496  aw_root->awar_int("gde/top_area_remark", 1, aw_def);
497  aw_root->awar_int("gde/middle_area_kons", 1, aw_def);
498  aw_root->awar_int("gde/middle_area_remark", 1, aw_def);
499  aw_root->awar_int("gde/top_area", 1, aw_def);
500  aw_root->awar_int("gde/top_area_sai", 1, aw_def);
501  aw_root->awar_int("gde/top_area_helix", 1, aw_def);
502  aw_root->awar_int("gde/middle_area", 1, aw_def);
503  aw_root->awar_int("gde/middle_area_sai", 1, aw_def);
504  aw_root->awar_int("gde/middle_area_helix", 1, aw_def);
505  aw_root->awar_int("gde/bottom_area", 1, aw_def);
506  aw_root->awar_int("gde/bottom_area_sai", 1, aw_def);
507  aw_root->awar_int("gde/bottom_area_helix", 1, aw_def);
508  break;
510  break;
511  }
512 
513  AW_awar *awar_defali = aw_root->awar_string(AWAR_DEFAULT_ALIGNMENT, "", db_access.gb_main);
514  aw_root->awar_string(AWAR_GDE_ALIGNMENT, "", aw_def)->map(awar_defali);
515 
517 
518  aw_root->awar_int(AWAR_GDE_CUTOFF_STOPCODON, 0, aw_def);
519  aw_root->awar_int(AWAR_GDE_SPECIES, 1, aw_def);
520 
522 
523  return LoadMenus();
524 }
525 
void awt_create_filter_awars(AW_root *aw_root, AW_default aw_def, const char *awar_filtername, const char *awar_mapto_alignment)
Definition: AWT_filter.cxx:193
static char * GDE_makeawarname_in(GmenuItem *gmenuitem, long i, const char *awar_root)
Definition: GDE.cxx:51
const char * GB_ERROR
Definition: arb_core.h:25
AW_bitset AW_active
Definition: aw_base.hxx:45
string result
GB_TYPES type
void add(const char *awar_name, const char *config_name)
char * textvalue
Definition: GDE_menu.h:33
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
Definition: adhash.cxx:457
#define AWAR_GDE_COMPRESSION
Definition: GDE_awars.h:20
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
int numargs
Definition: GDE_menu.h:57
char * method
Definition: GDE_menu.h:23
static void refresh_weights_sellist_cb(AW_root *, AW_DB_selection *saisel)
Definition: GDE.cxx:90
static void GDE_showhelp_cb(UNFIXED, GmenuItem *gmenuitem)
Definition: GDE.cxx:42
int numinputs
Definition: GDE_menu.h:59
double min
Definition: GDE_menu.h:29
#define CHOICE_TREE
Definition: GDE_def.h:23
GBDATA * gb_main
Definition: GDE_menu.h:90
void AW_create_standard_fileselection(AW_window *aws, const char *awar_prefix)
Definition: aw_file.hxx:30
#define SLIDERFIELDWIDTH
Definition: GDE.cxx:30
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
void AWT_insert_config_manager(AW_window *aww, AW_default default_file_, const char *id, const StoreConfigCallback &store_cb, const RestoreConfigCallback &load_or_reset_cb, const char *macro_id, const AWT_predefined_config *predef)
#define AWAR_DEFAULT_ALIGNMENT
Definition: aw_awar_defs.hxx:8
int numitems
Definition: GDE_menu.h:78
char * label
Definition: GDE_menu.h:79
AW_awar * set_minmax(float min, float max)
Definition: AW_awar.cxx:532
struct Gmenu * parent_menu
Definition: GDE_menu.h:71
const char * title
Definition: readseq.c:22
#define CHOOSER
Definition: GDE_def.h:20
int num_menus
Definition: GDE.cxx:26
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
char * GBS_string_2_key(const char *str)
Definition: adstring.cxx:52
AW_window * aws
Definition: GDE_menu.h:72
void activate()
Definition: aw_window.hxx:354
GmenuItem * item
Definition: GDE.cxx:37
int ivalue
Definition: GDE_menu.h:28
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
char seqtype
Definition: GDE_menu.h:66
char * symbol
Definition: GDE_menu.h:36
char * GDE_maketmpawarname(GmenuItem *gmenuitem, long i)
Definition: GDE.cxx:66
GB_ERROR GDE_init(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main, GDE_get_sequences_cb get_sequences, GDE_format_alignment_cb format_ali, gde_window_type window_type)
Definition: GDE.cxx:486
bool shall_store_in_config(const GmenuItemArg &itemarg)
Definition: GDE.cxx:130
gde_window_type window_type
Definition: GDE_menu.h:89
char * label
Definition: GDE_menu.h:60
int idx
Definition: GDE.cxx:38
void GDE_load_menu(AW_window *awm, AW_active, const char *menulabel)
Definition: GDE.cxx:433
GB_ERROR LoadMenus()
#define AWAR_GDE_CUTOFF_STOPCODON
Definition: GDE_awars.h:18
#define AWAR_GDE_FILTER_NAME
Definition: GDE.cxx:34
#define AWAR_GDE_ALIGNMENT
Definition: GDE.cxx:33
void GDE_startaction_cb(AW_window *aw, GmenuItem *gmenuitem)
Definition: GDE_event.cxx:575
char * label
Definition: GDE_menu.h:35
static AW_window * GDE_menuitem_cb(AW_root *aw_root, GmenuItem *gmenuitem)
Definition: GDE.cxx:157
#define CHOICE_WEIGHTS
Definition: GDE_def.h:25
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:560
GDE_get_sequences_cb get_sequences
Definition: GDE_menu.h:87
int numchoices
Definition: GDE_menu.h:32
struct gde_database_access db_access
Definition: GDE.cxx:484
char * GDE_makeawarname(GmenuItem *gmenuitem, long i)
Definition: GDE.cxx:65
int textwidth
Definition: GDE_menu.h:34
GBDATA * GB_get_root(GBDATA *gbd)
Definition: arbdb.cxx:1714
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
Definition: AW_file.cxx:72
#define FILE_SELECTOR
Definition: GDE_def.h:26
#define AWAR_GDE_SPECIES
Definition: GDE_awars.h:19
GmenuItem * item
Definition: GDE_menu.h:80
#define GDEMAXMENU
Definition: GDE_extglob.h:20
adfiltercbstruct * awt_create_select_filter(AW_root *aw_root, GBDATA *gb_main, const char *def_name)
Definition: AWT_filter.cxx:224
double max
Definition: GDE_menu.h:30
AW_window * awt_create_select_filter_win(AW_root *aw_root, adfiltercbstruct *acbs)
Definition: AWT_filter.cxx:364
#define SLIDERWIDTH
Definition: GDE.cxx:31
GargChoice * choice
Definition: GDE_menu.h:37
char * read_string() const
Definition: AW_awar.cxx:201
GDE_format_alignment_cb format_ali
Definition: GDE_menu.h:88
WindowCallback * popup
Definition: GDE_menu.h:74
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:642
char * help
Definition: GDE_menu.h:68
GmenuItemArg * arg
Definition: GDE_menu.h:64
static AW_window_menu_modes_opengl * awm
Gmenu menu[GDEMAXMENU]
Definition: GDE.cxx:25
AW_DB_selection * awt_create_ALI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match)
#define CHOICE_MENU
Definition: GDE_def.h:21
gde_window_type
Definition: gde.hxx:22
AW_DB_selection * awt_create_TREE_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, bool fallback2default)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
#define CHOICE_SAI
Definition: GDE_def.h:24
#define IF_ASSERTION_USED(x)
Definition: arb_assert.h:308
double fvalue
Definition: GDE_menu.h:31
GB_ERROR(* GDE_format_alignment_cb)(GBDATA *gb_main, const char *ali_name)
Definition: gde.hxx:33
#define TEXTFIELD
Definition: GDE_def.h:18
AW_active active_mask
Definition: GDE_menu.h:39
AW_awar * map(const char *awarn)
Definition: AW_awar.cxx:523
static char * gde_filter_weights(GBDATA *gb_sai)
Definition: GDE.cxx:68
#define SLIDER
Definition: GDE_def.h:19
static void setup_gde_config_def(AWT_config_definition &cdef, GmenuItem *gmenuitem)
Definition: GDE.cxx:140
#define AWAR_PREFIX_GDE_TEMP
Definition: GDE_awars.h:15
static WindowCallback makeWindowPopper(const CreateWindowCallback &cwcb)
Definition: aw_window.hxx:559
void close_sub_menu()
Definition: AW_window.cxx:483
void aw_message(const char *msg)
Definition: AW_status.cxx:932
static AW_window * GDE_create_filename_browser_window(AW_root *aw_root, const char *awar_prefix, const char *title)
Definition: GDE.cxx:94
AW_root * get_root()
Definition: aw_window.hxx:348
AW_active active_mask
Definition: GDE_menu.h:73
#define NULp
Definition: cxxforward.h:97
void AW_help_popup(UNFIXED, const char *help_file)
Definition: AW_help.cxx:622
GB_ERROR write_string(const char *aw_string)
bool ARB_strBeginsWith(const char *str, const char *with)
Definition: arb_str.h:42
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:675
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, bool fallback2default, const SaiSelectionlistFilterCallback &fcb)
#define AWAR_PREFIX_GDE
Definition: GDE_awars.h:16
char * label
Definition: GDE_menu.h:22
char meta
Definition: GDE_menu.h:65
Definition: GDE_menu.h:77
char *(* GDE_get_sequences_cb)(GBDATA **&the_species, uchar **&the_names, uchar **&the_sequences, long &numberspecies, long &maxalignlen)
Definition: gde.hxx:27
bool want_config_manager(GmenuItem *gmenuitem)
Definition: GDE.cxx:133
#define BUFSIZE
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
Definition: arbdb.cxx:874
GBDATA * gb_main
Definition: adname.cxx:33
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
char meta
Definition: GDE_menu.h:82
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
Definition: admatch.cxx:193
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
Definition: aditem.cxx:437
static char GDEBLANK[]
Definition: GDE.cxx:28
gde_iteminfo(GmenuItem *item_, int idx_)
Definition: GDE.cxx:39
static int info[maxsites+1]
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
#define gde_assert(bed)
Definition: GDE_def.h:12
long GBS_read_hash(const GB_HASH *hs, const char *key)
Definition: adhash.cxx:395
GBDATA * GB_entry(GBDATA *father, const char *key)
Definition: adquery.cxx:334
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:195
static void GDE_popup_filename_browser(AW_window *aw, gde_iteminfo *info, const char *title)
Definition: GDE.cxx:113
const char * label
GB_HASH * GBS_create_hash(long estimated_elements, GB_CASE case_sens)
Definition: adhash.cxx:253
void refresh()
Definition: AW_select.cxx:184
adfiltercbstruct * agde_filter
Definition: GDE.cxx:23