]> git.street.me.uk Git - andy/viking.git/blob - src/toolbar.h
[QA] Reusable function for freeing the waypoint image cache.
[andy/viking.git] / src / toolbar.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  *      toolbar.h - this file was part of Geany (v1.24.1), a fast and lightweight IDE
4  *
5  *      Copyright 2009-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
6  *      Copyright 2009-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7  *      Copyright 2014 Rob Norris <rw_norris@hotmail.com>
8  *
9  *      This program is free software; you can redistribute it and/or modify
10  *      it under the terms of the GNU General Public License as published by
11  *      the Free Software Foundation; either version 2 of the License, or
12  *      (at your option) any later version.
13  *
14  *      This program is distributed in the hope that it will be useful,
15  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *      GNU General Public License for more details.
18  *
19  *      You should have received a copy of the GNU General Public License along
20  *      with this program; if not, write to the Free Software Foundation, Inc.,
21  *      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #ifndef VIKING_TOOLBAR_H
25 #define VIKING_TOOLBAR_H 1
26
27 #include <gtk/gtk.h>
28
29 G_BEGIN_DECLS
30
31 #define VIK_TOOLBAR_TYPE             (vik_toolbar_get_type ())
32 #define VIK_TOOLBAR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TOOLBAR_TYPE, VikToolbar))
33 #define VIK_TOOLBAR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TOOLBAR_TYPE, VikToolbarClass))
34 #define VIK_IS_TOOLBAR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TOOLBAR_TYPE))
35 #define VIK_IS_TOOLBAR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TOOLBAR_TYPE))
36 #define VIK_TOOLBAR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), VIK_TOOLBAR_TYPE, VikToolbarClass))
37
38 typedef struct _VikToolbarClass VikToolbarClass;
39 typedef struct _VikToolbar VikToolbar;
40
41 GType vik_toolbar_get_type ();
42
43 VikToolbar *vik_toolbar_new (void);
44 void vik_toolbar_finalize ( VikToolbar *vtb );
45
46 GtkWidget *toolbar_get_widget_by_name(VikToolbar *vtb, const gchar *name);
47 GtkAction *toolbar_get_action_by_name(VikToolbar *vtb, const gchar *name);
48
49 void toolbar_action_tool_entry_register(VikToolbar *vtb, GtkRadioActionEntry *action);
50 void toolbar_action_mode_entry_register(VikToolbar *vtb, GtkRadioActionEntry *action);
51 void toolbar_action_toggle_entry_register(VikToolbar *vtb, GtkToggleActionEntry *action, gpointer callback);
52 void toolbar_action_entry_register(VikToolbar *vtb, GtkActionEntry *action);
53
54 void toolbar_action_set_sensitive (VikToolbar *vtb, const gchar *name, gboolean sensitive);
55
56 typedef void (ToolCB) (GtkAction *, GtkAction *, gpointer); // gpointer is actually a VikWindow
57 typedef void (ReloadCB) (GtkActionGroup *, gpointer); // gpointer is actually a VikWindow
58
59 void toolbar_init(VikToolbar *vtb,
60                   GtkWindow *parent,
61                   GtkWidget *vbox,
62                   GtkWidget *hbox,
63                   ToolCB tool_cb,
64                   ReloadCB reload_cb,
65                   gpointer user_data);
66
67 void toolbar_apply_settings(VikToolbar *vtb,
68                             GtkWidget *vbox,
69                             GtkWidget *hbox,
70                             gboolean reset);
71
72 GtkWidget* toolbar_get_widget(VikToolbar *vtb);
73
74 void a_toolbar_init (void);
75
76 void a_toolbar_uninit (void);
77
78 G_END_DECLS
79
80 #endif