| 1 | // =========================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : awt.hxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 7 | // http://www.arb-home.de/ // |
|---|
| 8 | // // |
|---|
| 9 | // =========================================================== // |
|---|
| 10 | |
|---|
| 11 | #ifndef AWT_HXX |
|---|
| 12 | #define AWT_HXX |
|---|
| 13 | |
|---|
| 14 | #ifndef AW_BASE_HXX |
|---|
| 15 | #include <aw_base.hxx> |
|---|
| 16 | #endif |
|---|
| 17 | #ifndef ARBDB_BASE_H |
|---|
| 18 | #include <arbdb_base.h> |
|---|
| 19 | #endif |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | #define awt_assert(cond) arb_assert(cond) |
|---|
| 23 | |
|---|
| 24 | // ------------------------------------------------------------ |
|---|
| 25 | |
|---|
| 26 | // holds all stuff needed to make ad_.. functions work with species _and_ genes (and more..) |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | // ------------------------------------------------------------ |
|---|
| 30 | |
|---|
| 31 | void awt_set_string(AW_window *aws, AW_CL varname, AW_CL value); // set an awar |
|---|
| 32 | |
|---|
| 33 | void AWT_create_ascii_print_window(AW_root *awr, const char *text_to_print, const char *title=0); |
|---|
| 34 | void AWT_show_file(AW_root *awr, const char *filename); |
|---|
| 35 | |
|---|
| 36 | // open database viewer using input-mask-file |
|---|
| 37 | class awt_item_type_selector; |
|---|
| 38 | GB_ERROR AWT_initialize_input_mask(AW_root *root, GBDATA *gb_main, const awt_item_type_selector *sel, const char* mask_name, bool localMask); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | class awt_input_mask_descriptor { |
|---|
| 42 | private: |
|---|
| 43 | char *title; // title of the input mask |
|---|
| 44 | char *internal_maskname; // starts with 0 for local mask and with 1 for global mask |
|---|
| 45 | // followed by file name w/o path |
|---|
| 46 | char *itemtypename; // name of the itemtype |
|---|
| 47 | bool local_mask; // true if mask file was found in "~/.arb_prop/inputMasks" |
|---|
| 48 | bool hidden; // if true, mask is NOT shown in Menus |
|---|
| 49 | |
|---|
| 50 | public: |
|---|
| 51 | awt_input_mask_descriptor(const char *title_, const char *maskname_, const char *itemtypename_, bool local, bool hidden_); |
|---|
| 52 | awt_input_mask_descriptor(const awt_input_mask_descriptor& other); |
|---|
| 53 | virtual ~awt_input_mask_descriptor(); |
|---|
| 54 | |
|---|
| 55 | awt_input_mask_descriptor& operator = (const awt_input_mask_descriptor& other); |
|---|
| 56 | |
|---|
| 57 | const char *get_title() const { return title; } |
|---|
| 58 | const char *get_maskname() const { return internal_maskname+1; } |
|---|
| 59 | const char *get_internal_maskname() const { return internal_maskname; } |
|---|
| 60 | const char *get_itemtypename() const { return itemtypename; } |
|---|
| 61 | |
|---|
| 62 | bool is_local_mask() const { return local_mask; } |
|---|
| 63 | bool is_hidden() const { return hidden; } |
|---|
| 64 | }; |
|---|
| 65 | |
|---|
| 66 | const awt_input_mask_descriptor *AWT_look_input_mask(int id); // id starts with 0; returns 0 if no more masks |
|---|
| 67 | |
|---|
| 68 | #if defined(DEBUG) |
|---|
| 69 | // database browser : |
|---|
| 70 | void AWT_create_db_browser_awars(AW_root *aw_root, AW_default aw_def); |
|---|
| 71 | void AWT_announce_db_to_browser(GBDATA *gb_main, const char *description); |
|---|
| 72 | void AWT_browser_forget_db(GBDATA *gb_main); |
|---|
| 73 | |
|---|
| 74 | void AWT_create_debug_menu(AW_window *awmm); |
|---|
| 75 | #endif // DEBUG |
|---|
| 76 | |
|---|
| 77 | AW_root *AWT_create_root(const char *properties, const char *program); |
|---|
| 78 | |
|---|
| 79 | void AWT_install_cb_guards(); |
|---|
| 80 | |
|---|
| 81 | #else |
|---|
| 82 | #error awt.hxx included twice |
|---|
| 83 | #endif // AWT_HXX |
|---|