source: tags/cvs_2_svn/GENOM/GEN_graphic.hxx

Last change on this file was 5390, checked in by westram, 16 years ago
  • TAB-Ex
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/*********************************************************************************
2 *  Coded by Ralf Westram (coder@reallysoft.de) in 2001                          *
3 *  Institute of Microbiology (Technical University Munich)                      *
4 *  http://www.mikro.biologie.tu-muenchen.de/                                    *
5 *********************************************************************************/
6
7#ifndef GEN_GRAPHIC_HXX
8#define GEN_GRAPHIC_HXX
9
10#include <aw_color_groups.hxx>
11
12enum {
13    GEN_GC_DEFAULT    = 0,
14    GEN_GC_FIRST_FONT = GEN_GC_DEFAULT,
15
16    GEN_GC_GENE,
17    GEN_GC_MARKED,
18    GEN_GC_CURSOR,
19
20    GEN_GC_LAST_FONT = GEN_GC_CURSOR,
21
22    GEN_GC_FIRST_COLOR_GROUP,
23
24    GEN_GC_MAX = GEN_GC_FIRST_COLOR_GROUP+AW_COLOR_GROUPS
25
26};                              // AW_gc
27
28typedef enum {
29    GEN_DISPLAY_STYLE_RADIAL,
30    GEN_DISPLAY_STYLE_BOOK,
31    GEN_DISPLAY_STYLE_VERTICAL,
32
33    GEN_DISPLAY_STYLES // counter
34} GEN_DisplayStyle;
35
36
37//  -----------------------------------------------
38//      class GEN_graphic : public AWT_graphic
39//  -----------------------------------------------
40
41typedef void (*GEN_graphic_cb_installer)(bool install, AWT_canvas*, GEN_graphic*);
42
43class GEN_graphic : public AWT_nonDB_graphic {
44    AW_root                  *aw_root;
45    GBDATA                   *gb_main;
46    GEN_graphic_cb_installer  callback_installer;
47    int                       window_nr;
48    GEN_root                 *gen_root;
49    GEN_DisplayStyle          style;
50    bool                      want_zoom_reset; // true -> do zoom reset on next refresh
51
52    void delete_gen_root(AWT_canvas *ntw);
53
54protected:
55
56    // variables - tree compatibility
57    AW_clicked_line rot_cl;
58    AW_clicked_text rot_ct;
59    AW_clicked_line old_rot_cl;
60
61    AW_device *disp_device;     // device for recursive functions
62
63public:
64    GEN_graphic(AW_root *aw_root, GBDATA *gb_main, GEN_graphic_cb_installer callback_installer_, int window_nr_);
65    virtual ~GEN_graphic();
66
67    void reinit_gen_root(AWT_canvas *ntw, bool force_reinit);
68
69    void set_display_style(GEN_DisplayStyle type);
70    GEN_DisplayStyle get_display_style() const { return style; }
71
72    virtual     AW_gc_manager init_devices(AW_window *,AW_device *,AWT_canvas *ntw,AW_CL);
73
74    virtual     void show(AW_device *device);
75    virtual void info(AW_device *device, AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct);
76    virtual void command(AW_device *device, AWT_COMMAND_MODE cmd, int button, AW_key_mod key_modifier, AW_key_code key_code, char key_char, AW_event_type type, AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct);
77
78    virtual int check_update(GBDATA *gbdummy);
79
80    AW_root *get_aw_root() const { return aw_root; }
81    GBDATA *get_gb_main() const { return gb_main; }
82    const GEN_root *get_gen_root() const { return gen_root; }
83    AW_device *get_device() const { return disp_device; }
84};
85
86#else
87#error GEN_graphic.hxx included twice
88#endif // GEN_GRAPHIC_HXX
Note: See TracBrowser for help on using the repository browser.