Ui: Centralize PacketList helper prototypes

To implement loading a packet list, a lot of helper
methods are required. Those prototypes where split up
over two places and have been moved to packet_list_utils.h
to ensure a single place for lookup
This commit is contained in:
Roland Knall 2022-06-29 11:03:44 +02:00
parent 94c439f603
commit 505226d1e2
6 changed files with 23 additions and 18 deletions

1
file.c
View File

@ -55,6 +55,7 @@
#include "ui/progress_dlg.h"
#include "ui/urls.h"
#include "ui/ws_ui_util.h"
#include "ui/packet_list_utils.h"
/* Needed for addrinfo */
#include <sys/types.h>

View File

@ -36,6 +36,26 @@ gboolean right_justify_column (gint col, capture_file *cf);
*/
gboolean resolve_column (gint col, capture_file *cf);
/**
* @brief The following methods have to be implemented by any class that
* whishes to represent a packet list.
*/
/** Write all packet list geometry values to the recent file.
*
* @param rf recent file handle from caller
*/
extern void packet_list_recent_write_all(FILE *rf);
extern void packet_list_clear(void);
extern void packet_list_freeze(void);
extern void packet_list_recreate_visible_rows(void);
extern void packet_list_thaw(void);
extern guint packet_list_append(column_info *cinfo, frame_data *fdata);
extern void packet_list_queue_draw(void);
extern gboolean packet_list_select_row_from_data(frame_data *fdata_needle);
extern gboolean packet_list_multi_select_active(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -25,6 +25,7 @@
#include "ui/last_open_dir.h"
#include "ui/recent.h"
#include "ui/recent_utils.h"
#include "ui/packet_list_utils.h"
#include "ui/simple_dialog.h"
#include <wsutil/file_util.h>

View File

@ -46,12 +46,6 @@ extern gboolean dfilter_combo_add_recent(const gchar *dftext);
*/
extern void dfilter_recent_combo_write_all(FILE *rf);
/** Write all packet list geometry values to the recent file.
*
* @param rf recent file handle from caller
*/
extern void packet_list_recent_write_all(FILE *rf);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -17,7 +17,7 @@
#include "time_shift.h"
#include "ui/ws_ui_util.h"
#include "ui/packet_list_utils.h"
#define SHIFT_POS 0
#define SHIFT_NEG 1

View File

@ -50,17 +50,6 @@ typedef gboolean (*pipe_input_cb_t) (gint source, gpointer user_data);
/* install callback function, called if pipe input is available */
extern void pipe_input_set_handler(gint source, gpointer user_data, ws_process_id *child_process, pipe_input_cb_t input_cb);
/* packet_list.c */
void packet_list_clear(void);
void packet_list_freeze(void);
void packet_list_recreate_visible_rows(void);
void packet_list_thaw(void);
guint packet_list_append(column_info *cinfo, frame_data *fdata);
void packet_list_queue_draw(void);
gboolean packet_list_select_row_from_data(frame_data *fdata_needle);
gboolean packet_list_multi_select_active(void);
/* XXX - Yes this isn't the best place, but they are used by file_dlg_win32.c, which is supposed
to be GUI independent, but has lots of GTK leanings. But if you put these in a GTK UI
header file, file_dlg_win32.c complains about all of the GTK structures also in the header