source: tags/svn.1.5.4/GENOM/GEN_graphic.hxx

Last change on this file was 7812, checked in by westram, 13 years ago

merge from dev [7751] [7752]

  • updated many old-style typedefs (typedef struct/enum)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 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    GEN_DISPLAY_STYLES // counter
44};
45
46
47//  -----------------------------------------------
48//      class GEN_graphic : public AWT_graphic
49//  -----------------------------------------------
50
51typedef void (*GEN_graphic_cb_installer)(bool 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 *ntw);
63
64protected:
65
66    // variables - tree compatibility
67    AW_clicked_line rot_cl;
68    AW_clicked_text rot_ct;
69    AW_clicked_line old_rot_cl;
70
71    AW_device *disp_device;     // device for recursive functions
72
73public:
74    GEN_graphic(AW_root *aw_root, GBDATA *gb_main, GEN_graphic_cb_installer callback_installer_, int window_nr_);
75    virtual ~GEN_graphic();
76
77    void reinit_gen_root(AWT_canvas *ntw, bool force_reinit);
78
79    void set_display_style(GEN_DisplayStyle type);
80    GEN_DisplayStyle get_display_style() const { return style; }
81
82    virtual     AW_gc_manager init_devices(AW_window *, AW_device *, AWT_canvas *ntw, AW_CL);
83
84    virtual     void show(AW_device *device);
85    virtual void info(AW_device *device, AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct);
86    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);
87
88    virtual int check_update(GBDATA *gbdummy);
89
90    AW_root *get_aw_root() const { return aw_root; }
91    GBDATA *get_gb_main() const { return gb_main; }
92    const GEN_root *get_gen_root() const { return gen_root; }
93    AW_device *get_device() const { return disp_device; }
94};
95
96#else
97#error GEN_graphic.hxx included twice
98#endif // GEN_GRAPHIC_HXX
Note: See TracBrowser for help on using the repository browser.