diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-02-07 00:54:46 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-02-07 00:54:46 +0000 |
commit | 1c6b2cf0e350951dc9b0b4a6e783db33ad24e480 (patch) | |
tree | 5e047e9ae04cd327b2be4652d850490555991aab /file.h | |
parent | 7be4ff2a9278d862ebd16e40fe850eef9e540de5 (diff) | |
download | wireshark-1c6b2cf0e350951dc9b0b4a6e783db33ad24e480.tar.gz wireshark-1c6b2cf0e350951dc9b0b4a6e783db33ad24e480.tar.bz2 wireshark-1c6b2cf0e350951dc9b0b4a6e783db33ad24e480.zip |
Instead of calling each single thing when doing/finish a file operation, file.c shouldn't call all the GUI related functions itself, instead throwing some kind of Events to it's caller(s).
I've implemented a very simple callback mechanism which provides exactly this. I've tried GHook from GLib before, but this doesn't seem to be the right thing, as it's too inflexible for the purpose here.
So I've implemented a callback function in main.c which receives all "events" and spreads them to menu, statusbar and itself.
I would see this implementation as a prototype which may need improvements. Please comment the changes.
svn path=/trunk/; revision=13330
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -55,6 +55,29 @@ typedef enum { CF_PRINT_WRITE_ERROR /**< print operation failed while writing to the printer */ } cf_print_status_t; +typedef enum { + cf_cb_file_closed, + cf_cb_file_read_start, + cf_cb_file_read_finished, + cf_cb_live_capture_started, + cf_cb_live_capture_finished, + cf_cb_packet_selected, + cf_cb_packet_unselected, + cf_cb_field_unselected, + cf_cb_file_safe_started, + cf_cb_file_safe_finished, + cf_cb_file_safe_reload_finished, + cf_cb_file_safe_failed +} cf_cbs; + +typedef void (*cf_callback_t) (gint event, gpointer data, gpointer user_data); + +extern void +cf_callback_add(cf_callback_t func, gpointer user_data); + +extern void +cf_callback_remove(cf_callback_t func); + /** * Open a capture file. * |