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