diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-07 00:54:46 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-07 00:54:46 +0000 |
commit | 4c7def914f4eee5f20fc21429a0d7369a612ac16 (patch) | |
tree | 5e047e9ae04cd327b2be4652d850490555991aab /file.h | |
parent | 6a916966d0a5bda514832f31092d5dce923bd485 (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13330 f5534014-38df-0310-8fa8-9805f1628bb7
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. * |