more
[metze/wireshark/wip.git] / ui / iface_toolbar.c
1 /* iface_toolbar.cpp
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9
10 #include "config.h"
11
12 #include <glib.h>
13
14 #include "iface_toolbar.h"
15
16
17 static iface_toolbar_add_cb_t iface_toolbar_add_cb;
18 static iface_toolbar_remove_cb_t iface_toolbar_remove_cb;
19
20 void iface_toolbar_add(const iface_toolbar *toolbar)
21 {
22     if (iface_toolbar_add_cb) {
23         iface_toolbar_add_cb(toolbar);
24     }
25 }
26
27 void iface_toolbar_remove(const gchar *menu_title)
28 {
29     if (iface_toolbar_remove_cb) {
30         iface_toolbar_remove_cb(menu_title);
31     }
32 }
33
34 gboolean iface_toolbar_use(void)
35 {
36     return iface_toolbar_add_cb ? TRUE : FALSE;
37 }
38
39 void iface_toolbar_register_cb(iface_toolbar_add_cb_t add_cb, iface_toolbar_remove_cb_t remove_cb)
40 {
41     iface_toolbar_add_cb = add_cb;
42     iface_toolbar_remove_cb = remove_cb;
43 }
44
45 /*
46  * Editor modelines
47  *
48  * Local Variables:
49  * c-basic-offset: 4
50  * tab-width: 8
51  * indent-tabs-mode: nil
52  * End:
53  *
54  * ex: set shiftwidth=4 tabstop=8 expandtab:
55  * :indentSize=4:tabSize=8:noTabs=true:
56  */