source: tags/ms_r17q2/GENOM/GEN_graphic.hxx

Last change on this file was 15665, checked in by westram, 7 years ago
  • reintegrates 'refactor' into 'trunk'
    • refactored AWT_graphic
      • now have explicit states with different permissions
        1. update model + request view/DB updates (AWT_auto_refresh)
          • always preceeded by DB→model up-to-date-check
          • automatically updates the view on destruction
        2. update (DB and view) from model
        3. neither
    • benefits
      • saves several view-updates
      • unproblematic nesting of functions requesting view-updates
      • will allow
        • delayed view-updates and
        • easier modification of update logic
    • fixes a bunch of update-issues (found on the way)
  • adds: log:branches/refactor@15613:15615,15627:15637,15639:15664
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : GEN_graphic.hxx                                   //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Coded by Ralf Westram (coder@reallysoft.de) in 2001           //
7//   Institute of Microbiology (Technical University Munich)       //
8//   http://www.arb-home.de/                                       //
9//                                                                 //
10// =============================================================== //
11
12#ifndef GEN_GRAPHIC_HXX
13#define GEN_GRAPHIC_HXX
14
15#ifndef AW_COLOR_GROUPS_HXX
16#include <aw_color_groups.hxx>
17#endif
18#ifndef AWT_CANVAS_HXX
19#include <awt_canvas.hxx>
20#endif
21
22enum {
23    GEN_GC_DEFAULT    = 0,
24    GEN_GC_FIRST_FONT = GEN_GC_DEFAULT,
25
26    GEN_GC_GENE,
27    GEN_GC_MARKED,
28    GEN_GC_CURSOR,
29
30    GEN_GC_LAST_FONT = GEN_GC_CURSOR,
31
32    GEN_GC_FIRST_COLOR_GROUP,
33
34    GEN_GC_MAX = GEN_GC_FIRST_COLOR_GROUP+AW_COLOR_GROUPS
35
36};
37
38enum GEN_DisplayStyle {
39    GEN_DISPLAY_STYLE_RADIAL,
40    GEN_DISPLAY_STYLE_BOOK,
41    GEN_DISPLAY_STYLE_VERTICAL,
42};
43
44#define GEN_DISPLAY_STYLES (GEN_DISPLAY_STYLE_VERTICAL+1)
45
46
47// ---------------------
48//      GEN_graphic
49
50enum CbInstallMode { INSTALL_CBS, REMOVE_CBS, FORGET_CBS };
51typedef void (*GEN_graphic_cb_installer)(CbInstallMode install, AWT_canvas*, GEN_graphic*);
52
53class GEN_graphic : public AWT_nonDB_graphic, virtual Noncopyable {
54    AW_root                  *aw_root;
55    GBDATA                   *gb_main;
56    GEN_graphic_cb_installer  callback_installer;
57    int                       window_nr;
58    GEN_root                 *gen_root;
59    GEN_DisplayStyle          style;
60
61    void delete_gen_root(AWT_canvas *scr, bool just_forget_callbacks);
62
63    void update_structure() OVERRIDE {}
64
65protected:
66
67    AW_device *disp_device;     // device for recursive functions
68
69public:
70    GEN_graphic(AW_root *aw_root, GBDATA *gb_main, GEN_graphic_cb_installer callback_installer_, int window_nr_);
71    ~GEN_graphic() OVERRIDE;
72
73    void reinit_gen_root(AWT_canvas *scr, bool force_reinit);
74
75    void set_display_style(GEN_DisplayStyle type);
76    GEN_DisplayStyle get_display_style() const { return style; }
77
78    AW_gc_manager *init_devices(AW_window *, AW_device *, AWT_canvas *scr) OVERRIDE;
79
80    void show(AW_device *device) OVERRIDE;
81
82    void handle_command(AW_device *device, AWT_graphic_event& event) OVERRIDE;
83    void check_for_DB_update(GBDATA *gbdummy) OVERRIDE;
84
85    AW_root *get_aw_root() const { return aw_root; }
86    GBDATA *get_gb_main() const { return gb_main; }
87    const GEN_root *get_gen_root() const { return gen_root; }
88    AW_device *get_device() const { return disp_device; }
89};
90
91#else
92#error GEN_graphic.hxx included twice
93#endif // GEN_GRAPHIC_HXX
Note: See TracBrowser for help on using the repository browser.