summaryrefslogtreecommitdiffstats
path: root/ui/iface_toolbar.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /ui/iface_toolbar.c
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/iface_toolbar.c')
-rw-r--r--ui/iface_toolbar.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/ui/iface_toolbar.c b/ui/iface_toolbar.c
new file mode 100644
index 00000000..95424da9
--- /dev/null
+++ b/ui/iface_toolbar.c
@@ -0,0 +1,43 @@
+/* iface_toolbar.cpp
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+#include "iface_toolbar.h"
+
+
+static iface_toolbar_add_cb_t iface_toolbar_add_cb;
+static iface_toolbar_remove_cb_t iface_toolbar_remove_cb;
+
+void iface_toolbar_add(const iface_toolbar *toolbar)
+{
+ if (iface_toolbar_add_cb) {
+ iface_toolbar_add_cb(toolbar);
+ }
+}
+
+void iface_toolbar_remove(const gchar *menu_title)
+{
+ if (iface_toolbar_remove_cb) {
+ iface_toolbar_remove_cb(menu_title);
+ }
+}
+
+gboolean iface_toolbar_use(void)
+{
+ return iface_toolbar_add_cb ? TRUE : FALSE;
+}
+
+void iface_toolbar_register_cb(iface_toolbar_add_cb_t add_cb, iface_toolbar_remove_cb_t remove_cb)
+{
+ iface_toolbar_add_cb = add_cb;
+ iface_toolbar_remove_cb = remove_cb;
+}