| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
iface_toolbar.h
Go to the documentation of this file.
1
9
10#ifndef __IFACE_TOOLBAR_H__
11#define __IFACE_TOOLBAR_H__
12
13#include <stdbool.h>
14
15#include <glib.h>
16
17#ifdef __cplusplus
18 extern "C" {
19#endif /* __cplusplus */
20
24 typedef enum {
25 INTERFACE_TYPE_UNKNOWN,
26 INTERFACE_TYPE_BOOLEAN,
27 INTERFACE_TYPE_BUTTON,
28 INTERFACE_TYPE_SELECTOR,
29 INTERFACE_TYPE_STRING
30} iface_toolbar_ctrl_type;
31
35 typedef enum {
36 INTERFACE_ROLE_UNKNOWN,
37 INTERFACE_ROLE_CONTROL,
38 INTERFACE_ROLE_HELP,
39 INTERFACE_ROLE_LOGGER,
40 INTERFACE_ROLE_RESTORE
41} iface_toolbar_ctrl_role;
42
46 typedef struct _iface_toolbar_value {
47 int num;
48 char *value;
49 char *display;
50 bool is_default;
51} iface_toolbar_value;
52
56 typedef struct _iface_toolbar_control {
57 int num;
58 iface_toolbar_ctrl_type ctrl_type;
59 iface_toolbar_ctrl_role ctrl_role;
60 char *display;
61 char *validation;
62 bool is_required;
63 char *tooltip;
64 char *placeholder;
65 union {
66 bool boolean;
67 char *string;
68 } default_value;
69 GList *values;
70} iface_toolbar_control;
71
75 typedef struct _iface_toolbar {
76 char *menu_title;
77 char *help;
78 GList *ifnames;
79 GList *controls;
80} iface_toolbar;
81
82 typedef struct _iface_toolbar_message_t {
83 const char* ifname;
84 int ifnum;
85 int command;
86 GBytes *payload;
87} iface_toolbar_message_t;
88
89 typedef void (*iface_toolbar_add_cb_t)(const iface_toolbar *);
90 typedef void (*iface_toolbar_remove_cb_t)(const char *);
91
97 void iface_toolbar_add(const iface_toolbar *toolbar);
98
104 void iface_toolbar_remove(const char *menu_title);
105
111 bool iface_toolbar_use(void);
112
119 void iface_toolbar_register_cb(iface_toolbar_add_cb_t add_cb, iface_toolbar_remove_cb_t remove_cb);
120
121 void iface_toolbar_message_free(iface_toolbar_message_t *message);
122
123#ifdef __cplusplus
124}
125#endif /* __cplusplus */
126
127#endif /* __IFACE_TOOLBAR_H__ */
iface_toolbar_add
void iface_toolbar_add(const iface_toolbar *toolbar)
Adds an interface toolbar to the application.
Definition iface_toolbar.c:20
iface_toolbar_ctrl_type
iface_toolbar_ctrl_type
Data type of a toolbar control widget exposed by an interface toolbar.
Definition iface_toolbar.h:24
INTERFACE_TYPE_BUTTON
@ INTERFACE_TYPE_BUTTON
Definition iface_toolbar.h:27
INTERFACE_TYPE_SELECTOR
@ INTERFACE_TYPE_SELECTOR
Definition iface_toolbar.h:28
INTERFACE_TYPE_BOOLEAN
@ INTERFACE_TYPE_BOOLEAN
Definition iface_toolbar.h:26
INTERFACE_TYPE_UNKNOWN
@ INTERFACE_TYPE_UNKNOWN
Definition iface_toolbar.h:25
INTERFACE_TYPE_STRING
@ INTERFACE_TYPE_STRING
Definition iface_toolbar.h:29
iface_toolbar_use
bool iface_toolbar_use(void)
Checks if the interface toolbar is in use.
Definition iface_toolbar.c:34
iface_toolbar_register_cb
void iface_toolbar_register_cb(iface_toolbar_add_cb_t add_cb, iface_toolbar_remove_cb_t remove_cb)
Registers callback functions for interface toolbar operations.
Definition iface_toolbar.c:39
iface_toolbar
struct _iface_toolbar iface_toolbar
Describes an interface toolbar and the set of controls it exposes.
iface_toolbar_remove
void iface_toolbar_remove(const char *menu_title)
Removes an interface toolbar item from the menu.
Definition iface_toolbar.c:27
iface_toolbar_value
struct _iface_toolbar_value iface_toolbar_value
A single selectable value entry for a selector-type toolbar control.
iface_toolbar_ctrl_role
iface_toolbar_ctrl_role
Functional role of a toolbar control within the interface toolbar.
Definition iface_toolbar.h:35
INTERFACE_ROLE_CONTROL
@ INTERFACE_ROLE_CONTROL
Definition iface_toolbar.h:37
INTERFACE_ROLE_UNKNOWN
@ INTERFACE_ROLE_UNKNOWN
Definition iface_toolbar.h:36
INTERFACE_ROLE_HELP
@ INTERFACE_ROLE_HELP
Definition iface_toolbar.h:38
INTERFACE_ROLE_RESTORE
@ INTERFACE_ROLE_RESTORE
Definition iface_toolbar.h:40
INTERFACE_ROLE_LOGGER
@ INTERFACE_ROLE_LOGGER
Definition iface_toolbar.h:39
iface_toolbar_control
struct _iface_toolbar_control iface_toolbar_control
Describes a single control widget within an interface toolbar.
_iface_toolbar_control
Describes a single control widget within an interface toolbar.
Definition iface_toolbar.h:56
_iface_toolbar_control::default_value
union _iface_toolbar_control::@275266256006102355322226160033234070141006021077 default_value
_iface_toolbar_control::ctrl_type
iface_toolbar_ctrl_type ctrl_type
Definition iface_toolbar.h:58
_iface_toolbar_control::tooltip
char * tooltip
Definition iface_toolbar.h:63
_iface_toolbar_control::values
GList * values
Definition iface_toolbar.h:69
_iface_toolbar_control::boolean
bool boolean
Definition iface_toolbar.h:66
_iface_toolbar_control::ctrl_role
iface_toolbar_ctrl_role ctrl_role
Definition iface_toolbar.h:59
_iface_toolbar_control::is_required
bool is_required
Definition iface_toolbar.h:62
_iface_toolbar_control::validation
char * validation
Definition iface_toolbar.h:61
_iface_toolbar_control::string
char * string
Definition iface_toolbar.h:67
_iface_toolbar_control::num
int num
Definition iface_toolbar.h:57
_iface_toolbar_control::placeholder
char * placeholder
Definition iface_toolbar.h:64
_iface_toolbar_control::display
char * display
Definition iface_toolbar.h:60
_iface_toolbar_message_t
Definition iface_toolbar.h:82
_iface_toolbar_value
A single selectable value entry for a selector-type toolbar control.
Definition iface_toolbar.h:46
_iface_toolbar_value::num
int num
Definition iface_toolbar.h:47
_iface_toolbar_value::is_default
bool is_default
Definition iface_toolbar.h:50
_iface_toolbar_value::value
char * value
Definition iface_toolbar.h:48
_iface_toolbar_value::display
char * display
Definition iface_toolbar.h:49
_iface_toolbar
Describes an interface toolbar and the set of controls it exposes.
Definition iface_toolbar.h:75
_iface_toolbar::help
char * help
Definition iface_toolbar.h:77
_iface_toolbar::ifnames
GList * ifnames
Definition iface_toolbar.h:78
_iface_toolbar::menu_title
char * menu_title
Definition iface_toolbar.h:76
_iface_toolbar::controls
GList * controls
Definition iface_toolbar.h:79