source: tags/arb-6.0/GENOM/GEN_graphic.hxx

Last change on this file was 11126, checked in by westram, 10 years ago
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 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
50typedef void (*GEN_graphic_cb_installer)(bool install, AWT_canvas*, GEN_graphic*);
51
52class GEN_graphic : public AWT_nonDB_graphic, virtual Noncopyable {
53    AW_root                  *aw_root;
54    GBDATA                   *gb_main;
55    GEN_graphic_cb_installer  callback_installer;
56    int                       window_nr;
57    GEN_root                 *gen_root;
58    GEN_DisplayStyle          style;
59    bool                      want_zoom_reset; // true -> do zoom reset on next refresh
60
61    void delete_gen_root(AWT_canvas *scr);
62
63    void update_structure() {}
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    virtual ~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    virtual void show(AW_device *device) OVERRIDE;
81    virtual void info(AW_device *device, AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct) 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.