| 1 | // ================================================================= // |
|---|
| 2 | // // |
|---|
| 3 | // File : aw_base.hxx // |
|---|
| 4 | // Purpose : forward declare some gui types // |
|---|
| 5 | // // |
|---|
| 6 | // Coded by Ralf Westram (coder@reallysoft.de) in September 2010 // |
|---|
| 7 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 8 | // http://www.arb-home.de/ // |
|---|
| 9 | // // |
|---|
| 10 | // ================================================================= // |
|---|
| 11 | |
|---|
| 12 | #ifndef AW_BASE_HXX |
|---|
| 13 | #define AW_BASE_HXX |
|---|
| 14 | |
|---|
| 15 | #ifndef CXXFORWARD_H |
|---|
| 16 | #include <cxxforward.h> |
|---|
| 17 | #endif |
|---|
| 18 | |
|---|
| 19 | class AW_root; |
|---|
| 20 | class AW_window; |
|---|
| 21 | |
|---|
| 22 | typedef long AW_CL; // client data (casted from pointer or value) // @@@ [CB] eliminate later |
|---|
| 23 | |
|---|
| 24 | typedef void (*AW_postcb_cb)(AW_window *); |
|---|
| 25 | |
|---|
| 26 | struct GBDATA; |
|---|
| 27 | typedef GBDATA *AW_default; |
|---|
| 28 | |
|---|
| 29 | typedef double AW_pos; |
|---|
| 30 | |
|---|
| 31 | struct AW_world { |
|---|
| 32 | AW_pos t, b, l, r; |
|---|
| 33 | void clear() { t = b = l = r = 0.0; } |
|---|
| 34 | }; |
|---|
| 35 | struct AW_screen_area { |
|---|
| 36 | int t, b, l, r; |
|---|
| 37 | void clear() { t = b = l = r = 0; } |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | typedef AW_screen_area AW_borders; // not an area, but size spec at all borders |
|---|
| 41 | |
|---|
| 42 | typedef int AW_font; |
|---|
| 43 | |
|---|
| 44 | typedef long AW_bitset; |
|---|
| 45 | typedef AW_bitset AW_active; // bits to activate/inactivate buttons |
|---|
| 46 | typedef float AW_grey_level; // <0 don't fill 0.0 white 1.0 black |
|---|
| 47 | |
|---|
| 48 | typedef struct _WidgetRec *Widget; |
|---|
| 49 | |
|---|
| 50 | #define AW_NO_COLOR (-1UL) |
|---|
| 51 | typedef unsigned long AW_rgb; |
|---|
| 52 | |
|---|
| 53 | enum AW_VARIABLE_TYPE { |
|---|
| 54 | AW_NONE = 0, |
|---|
| 55 | AW_BIT = 1, |
|---|
| 56 | AW_BYTE = 2, |
|---|
| 57 | AW_INT = 3, |
|---|
| 58 | AW_FLOAT = 4, |
|---|
| 59 | AW_POINTER = 5, |
|---|
| 60 | AW_BITS = 6, |
|---|
| 61 | // 7 is unused |
|---|
| 62 | AW_BYTES = 8, |
|---|
| 63 | AW_INTS = 9, |
|---|
| 64 | AW_FLOATS = 10, |
|---|
| 65 | AW_STRING = 12, |
|---|
| 66 | // 13 is reserved (GB_STRING_SHRT) |
|---|
| 67 | // 14 is unused |
|---|
| 68 | AW_DB = 15, |
|---|
| 69 | |
|---|
| 70 | // keep AW_VARIABLE_TYPE consistent with GB_TYPES |
|---|
| 71 | // see ../ARBDB/arbdb.h@sync_GB_TYPES_AW_VARIABLE_TYPE |
|---|
| 72 | |
|---|
| 73 | AW_TYPE_MAX = 16 |
|---|
| 74 | }; |
|---|
| 75 | |
|---|
| 76 | enum AW_area { |
|---|
| 77 | AW_INFO_AREA, |
|---|
| 78 | AW_MIDDLE_AREA, |
|---|
| 79 | AW_BOTTOM_AREA, |
|---|
| 80 | AW_MAX_AREA |
|---|
| 81 | }; |
|---|
| 82 | |
|---|
| 83 | enum AW_color_idx { |
|---|
| 84 | AW_WINDOW_BG, |
|---|
| 85 | AW_WINDOW_FG, |
|---|
| 86 | AW_WINDOW_C1, |
|---|
| 87 | AW_WINDOW_C2, |
|---|
| 88 | AW_WINDOW_C3, |
|---|
| 89 | AW_WINDOW_DRAG, |
|---|
| 90 | AW_DATA_BG, |
|---|
| 91 | AW_STD_COLOR_IDX_MAX |
|---|
| 92 | }; |
|---|
| 93 | |
|---|
| 94 | enum GcChange { |
|---|
| 95 | // value 0 is reserved (used internally in GC-manager) |
|---|
| 96 | |
|---|
| 97 | GC_COLOR_CHANGED = 1, // -> normally a refresh should do |
|---|
| 98 | GC_FONT_CHANGED, // -> display needs a resize |
|---|
| 99 | GC_COLOR_GROUP_USE_CHANGED, // -> might need extra calculations |
|---|
| 100 | |
|---|
| 101 | // Note: higher values should cover lower values, |
|---|
| 102 | // i.e. a resize (GC_FONT_CHANGED) always does a refresh (GC_COLOR_CHANGED) |
|---|
| 103 | }; |
|---|
| 104 | |
|---|
| 105 | AW_default get_AW_ROOT_DEFAULT(); |
|---|
| 106 | #define AW_ROOT_DEFAULT get_AW_ROOT_DEFAULT() |
|---|
| 107 | |
|---|
| 108 | #else |
|---|
| 109 | #error aw_base.hxx included twice |
|---|
| 110 | #endif // AW_BASE_HXX |
|---|