source: tags/ms_r16q2/GENOM/GEN_graphic.hxx

Last change on this file was 14838, checked in by westram, 8 years ago
  • no longer pseudo-hide gc-manager-object
    • aw_gc_managerAW_gc_manager
    • use pointers to AW_gc_manager instead of pointer-typedef
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 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    bool                      want_zoom_reset; // true -> do zoom reset on next refresh
61
62    void delete_gen_root(AWT_canvas *scr, bool just_forget_callbacks);
63
64    void update_structure() {}
65
66protected:
67
68    AW_device *disp_device;     // device for recursive functions
69
70public:
71    GEN_graphic(AW_root *aw_root, GBDATA *gb_main, GEN_graphic_cb_installer callback_installer_, int window_nr_);
72    virtual ~GEN_graphic() OVERRIDE;
73
74    void reinit_gen_root(AWT_canvas *scr, bool force_reinit);
75
76    void set_display_style(GEN_DisplayStyle type);
77    GEN_DisplayStyle get_display_style() const { return style; }
78
79    AW_gc_manager *init_devices(AW_window *, AW_device *, AWT_canvas *scr) OVERRIDE;
80
81    virtual void show(AW_device *device) OVERRIDE;
82
83    void handle_command(AW_device *device, AWT_graphic_event& event) OVERRIDE;
84    virtual int check_update(GBDATA *gbdummy) OVERRIDE;
85
86    AW_root *get_aw_root() const { return aw_root; }
87    GBDATA *get_gb_main() const { return gb_main; }
88    const GEN_root *get_gen_root() const { return gen_root; }
89    AW_device *get_device() const { return disp_device; }
90};
91
92#else
93#error GEN_graphic.hxx included twice
94#endif // GEN_GRAPHIC_HXX
Note: See TracBrowser for help on using the repository browser.