Nemiver  0.3
nmv-hex-editor.h
Go to the documentation of this file.
1 //Author: Jonathon Jongsma
2 /*
3  *This file is part of the Nemiver project
4  *
5  *Nemiver is free software; you can redistribute
6  *it and/or modify it under the terms of
7  *the GNU General Public License as published by the
8  *Free Software Foundation; either version 2,
9  *or (at your option) any later version.
10  *
11  *Nemiver is distributed in the hope that it will
12  *be useful, but WITHOUT ANY WARRANTY;
13  *without even the implied warranty of
14  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *See the GNU General Public License for more details.
16  *
17  *You should have received a copy of the
18  *GNU General Public License along with Nemiver;
19  *see the file COPYING.
20  *If not, write to the Free Software Foundation,
21  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  *See COPYRIGHT file copyright information.
24  */
25 #ifndef __NMV_HEX_EDITOR_H__
26 #define __NMV_HEX_EDITOR_H__
27 
28 #include "common/nmv-object.h"
30 #include "common/nmv-ustring.h"
32 #include <gtkhex.h> // for GROUP_* defines
33 
34 namespace Gtk {
35  class Widget;
36 }
42 
43 NEMIVER_BEGIN_NAMESPACE (nemiver)
44 NEMIVER_BEGIN_NAMESPACE (Hex)
45 
46 class Editor;
48 
49 class Editor : public Object {
50  class Priv;
51  SafePtr<Priv> m_priv;
52 
53 protected:
54  Editor (const DocumentSafePtr &a_document);
55 
56 public:
57  virtual ~Editor ();
58  static EditorSafePtr create (const DocumentSafePtr &a_document);
59  void set_cursor (int);
60  void set_cursor_xy (int, int);
61  void set_nibble (int);
62 
63  guint get_cursor ();
64  guchar get_byte (guint);
65 
66  void set_group_type (guint);
67 
68  void set_starting_offset (int a_starting_offset);
69  void show_offsets (bool show=true);
70  void set_font (const Pango::FontDescription& a_desc);
71 
72  void set_insert_mode (bool);
73 
74  void set_geometry (int cpl, int vis_lines);
75  void get_geometry (int& cpl, int& vis_lines) const;
76 
77  void copy_to_clipboard ();
78  void cut_to_clipboard ();
79  void paste_from_clipboard ();
80 
81  void set_selection (int start, int end);
82  bool get_selection (int& start, int& end);
83  void clear_selection ();
84  void delete_selection ();
85 
86  virtual Gtk::Container& get_widget () const;
87 };//end class Editor
88 
89 NEMIVER_END_NAMESPACE (Hex)
90 NEMIVER_END_NAMESPACE (nemiver)
91 #endif //__NMV_HEX_EDITOR_H__
92 
nmv-safe-ptr-utils.h
nemiver::common::Object
Definition: nmv-object.h:43
nemiver
Definition: nmv-address.h:31
nemiver::common::ObjectRef
Definition: nmv-safe-ptr-utils.h:45
nmv-ustring.h
nemiver::common::UString
Definition: nmv-ustring.h:45
nmv-hex-document.h
nemiver::Hex::Editor
Definition: nmv-hex-editor.h:49
Gtk
Definition: nmv-asm-utils.h:30
nemiver::common::ObjectUnref
Definition: nmv-safe-ptr-utils.h:55
nmv-object.h
nemiver::common::SafePtr
Definition: nmv-safe-ptr.h:71