2 Copyright (C) 1999 Paul Barton-Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtkmm2ext_hexentry_h__
21 #define __gtkmm2ext_hexentry_h__
27 class HexEntry : public Gtk::Entry
31 /* Take a byte-level representation of a series of hexadecimal
32 values and use them to set the displayed text of the entry.
33 Eg. if hexbuf[0] = 0xff and hexbuf[1] = 0xa1 and buflen = 2,
34 then the text will be set to "ff a1".
37 void set_hex (unsigned char *hexbuf, unsigned int buflen);
39 /* puts byte-level representation of current entry text
40 into hexbuf, and returns number of bytes written there.
42 NOTE: this will release the existing memory pointed to
43 by hexbuf if buflen indicates that it is not long enough
44 to hold the new representation, and hexbuf is not zero.
46 If the returned length is zero, the contents of hexbuf
50 unsigned int get_hex (unsigned char *hexbuf, size_t buflen);
53 bool on_key_press_event (GdkEventKey *);
58 #endif /* __gtkmm2ext_hexentry_h__ */