source: tags/svn.1.5.4/SECEDIT/SEC_graphic.hxx

Last change on this file was 7623, checked in by westram, 14 years ago
  • merge from dev [7450] [7452] [7456] [7457] [7458] [7459] [7460] [7461] [7464] [7465] [7466] [7467] [7468] [7469] [7482]
    • tweaked compiler options
      • activated -Weffc++
        • postfilter warnings where Scott Meyers' advices are too general.
          • base classes should not always have virtual destructors, since that renders tiny classes useless and
          • members should not always be initialized via initialization list, since that often violates the DRY principle
        • fix gcc's inability to detect that Noncopyable implements a private copy-ctor and op=
        • this slows down complete ARB recompilation by ~5%
    • added -Wold-style-cast (inactive)
    • removed -Wno-non-template-friend added in [7447]
  • postcompile.pl
    • added option —original to show unmodified compiler output
  • declared op= for classes which had a copy-ctor
  • moved op= macros to arbtools.h
  • derived classes containing pointers from Noncopyable (use Noncopyable virtually) or
  • made them copyable if needed (awt_mask_item, KnownDB, Code, AWT_registered_itemtype, GEN_gene, PosGene, PartialSequence, PlugIn, Range, Convaln_exception)
  • other related changes
    • user mask destruction working now
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : sec_graphic.hxx                                   //
4//   Purpose   : interface to structure GUI                        //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11
12#ifndef SEC_GRAPHIC_HXX
13#define SEC_GRAPHIC_HXX
14
15#ifndef _GLIBCXX_CCTYPE
16#include <cctype>
17#endif
18#ifndef AWT_CANVAS_HXX
19#include <awt_canvas.hxx>
20#endif
21
22using namespace AW;
23
24// names for database:
25#define NAME_OF_STRUCT_SEQ      "_STRUCT"
26#define NAME_OF_REF_SEQ         "_REF"
27
28class SEC_root;
29
30enum SEC_update_request {
31    SEC_UPDATE_OK              = 0, // no update needed
32    SEC_UPDATE_ZOOM_RESET      = 1, // zoom reset needed
33    SEC_UPDATE_SHOWN_POSITIONS = 2, // recalculation of shown positions needed
34    SEC_UPDATE_RECOUNT         = 4, // complete relayout needed
35    SEC_UPDATE_RELOAD          = 8, // reload structure from DB
36};
37
38class SEC_base;
39
40class SEC_graphic : public AWT_graphic, virtual Noncopyable {
41    SEC_update_request  update_requested;
42    char               *load_error; // error occurred during load()
43
44protected:
45
46    // variables - tree compatibility
47    AW_clicked_line rot_cl;
48    AW_clicked_text rot_ct;
49    AW_clicked_line old_rot_cl;
50
51    AW_device *disp_device; // device for recursive functions
52
53    GB_ERROR handleKey(AW_event_type event, AW_key_mod key_modifier, AW_key_code key_code, char key_char);
54    GB_ERROR handleMouse(AW_device *device, AW_event_type event, int button, AWT_COMMAND_MODE cmd, const Position& world, SEC_base *elem, int abspos);
55
56public:
57
58    GBDATA *gb_main;
59    AW_root *aw_root;
60    SEC_root *sec_root;
61
62    GBDATA *gb_struct;          // used to save the structure
63    GBDATA *gb_struct_ref;      // used to save reference numbers
64
65    mutable long last_saved;    // the transaction serial id when we last saved everything
66
67    // *********** public section
68    SEC_graphic(AW_root *aw_root, GBDATA *gb_main);
69    virtual ~SEC_graphic();
70
71    virtual AW_gc_manager init_devices(AW_window *, AW_device *, AWT_canvas *ntw, AW_CL);
72
73    virtual void show(AW_device *device);
74    virtual void info(AW_device *device, AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct);
75    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,
76             AW_pos x, AW_pos y, AW_clicked_line *cl, AW_clicked_text *ct);
77
78    GB_ERROR load(GBDATA *gb_main, const char *name, AW_CL cd1, AW_CL cd2); // load structure from DB
79    GB_ERROR save(GBDATA *gb_main, const char *name, AW_CL cd1, AW_CL cd2); // save structure to DB
80    int check_update(GBDATA *gb_main);  // perform requested updates
81    void update(GBDATA *gb_main);
82
83    GB_ERROR write_data_to_db(const char *data, const char *x_string) const;
84    GB_ERROR read_data_from_db(char **data, char **x_string) const;
85
86    void request_update(SEC_update_request req) { update_requested = static_cast<SEC_update_request>(update_requested|req); }
87};
88
89
90#endif
Note: See TracBrowser for help on using the repository browser.