| 1 | // =============================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : aw_preset.hxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 7 | // http://www.arb-home.de/ // |
|---|
| 8 | // // |
|---|
| 9 | // =============================================================== // |
|---|
| 10 | |
|---|
| 11 | #ifndef AW_PRESET_HXX |
|---|
| 12 | #define AW_PRESET_HXX |
|---|
| 13 | |
|---|
| 14 | #ifndef AW_WINDOW_HXX |
|---|
| 15 | #include "aw_window.hxx" |
|---|
| 16 | #endif |
|---|
| 17 | #ifndef ATTRIBUTES_H |
|---|
| 18 | #include <attributes.h> |
|---|
| 19 | #endif |
|---|
| 20 | #ifndef CB_H |
|---|
| 21 | #include <cb.h> |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | #define AWP_COLORNAME_TEMPLATE "GCS/%s/MANAGE_GCS/%s/colorname" |
|---|
| 25 | #define AWP_FONTNAME_TEMPLATE "GCS/%s/MANAGE_GCS/%s/font" |
|---|
| 26 | #define AWP_FONTSIZE_TEMPLATE "GCS/%s/MANAGE_GCS/%s/size" |
|---|
| 27 | |
|---|
| 28 | void AW_save_properties(AW_window *aw); // use this if you're unsure |
|---|
| 29 | void AW_save_specific_properties(AW_window *aw, const char *filename); |
|---|
| 30 | |
|---|
| 31 | AW_window *AW_preset_window(AW_root *root); |
|---|
| 32 | |
|---|
| 33 | void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm); |
|---|
| 34 | void AW_insert_common_property_menu_entries(AW_window_simple_menu *awsm); |
|---|
| 35 | |
|---|
| 36 | enum AW_GCM_AREA { |
|---|
| 37 | AW_GCM_DATA_AREA, |
|---|
| 38 | AW_GCM_WINDOW_AREA |
|---|
| 39 | }; |
|---|
| 40 | |
|---|
| 41 | /* creates some GC pairs: one for normal operation, |
|---|
| 42 | the other for drag mode |
|---|
| 43 | eg. |
|---|
| 44 | AW_manage_GC(aww,"ARB_NT",device,10,20,AW_GCM_DATA_AREA, my_expose_cb, cd1 ,cd2, "name","#sequence",NULL); |
|---|
| 45 | |
|---|
| 46 | (see implementation for more details on parameter strings) |
|---|
| 47 | |
|---|
| 48 | will create 4 GCs: |
|---|
| 49 | GC 10 (normal) and 20 (drag) |
|---|
| 50 | GC 11 (normal and monospaced (indicated by '#') |
|---|
| 51 | 21 drag and monospaced |
|---|
| 52 | don't forget the 0 at the end of the fontname field |
|---|
| 53 | |
|---|
| 54 | When the GCs are modified the 'changecb' is called |
|---|
| 55 | */ |
|---|
| 56 | |
|---|
| 57 | AW_gc_manager AW_manage_GC(AW_window *aww, |
|---|
| 58 | const char *gc_base_name, |
|---|
| 59 | AW_device *device, int base_gc, int base_drag, AW_GCM_AREA area, |
|---|
| 60 | const WindowCallback& changecb, |
|---|
| 61 | bool define_color_groups, |
|---|
| 62 | const char *default_background_color, |
|---|
| 63 | ...) __ATTR__SENTINEL; |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | AW_window *AW_create_gc_window(AW_root *aw_root, AW_gc_manager id); // opens the properties Window |
|---|
| 69 | |
|---|
| 70 | // same as AW_create_gc_window, but uses different window id and name |
|---|
| 71 | // (use if if there are two or more color def windows in one application, |
|---|
| 72 | // otherwise they save the same window properties) |
|---|
| 73 | AW_window *AW_create_gc_window_named(AW_root * aw_root, AW_gc_manager id_par, const char *wid, const char *windowname); |
|---|
| 74 | |
|---|
| 75 | void AW_copy_GCs(AW_root *aw_root, const char *source_window, const char *dest_window, bool has_font_info, const char *id0, ...) __ATTR__SENTINEL; |
|---|
| 76 | |
|---|
| 77 | #else |
|---|
| 78 | #error aw_preset.hxx included twice |
|---|
| 79 | #endif // AW_PRESET_HXX |
|---|