1 /* vifm
2 * Copyright (C) 2014 xaizek.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #include "mode.h"
20
21 static vle_mode_t current_mode;
22 static vle_mode_t primary_mode;
23
24 vle_mode_t
vle_mode_get(void)25 vle_mode_get(void)
26 {
27 return current_mode;
28 }
29
30 int
vle_mode_is(vle_mode_t mode)31 vle_mode_is(vle_mode_t mode)
32 {
33 return current_mode == mode;
34 }
35
36 vle_mode_t
vle_mode_get_primary(void)37 vle_mode_get_primary(void)
38 {
39 return primary_mode;
40 }
41
42 int
vle_primary_mode_is(vle_mode_t mode)43 vle_primary_mode_is(vle_mode_t mode)
44 {
45 return primary_mode == mode;
46 }
47
48 void
vle_mode_set(vle_mode_t mode,VleModeType type)49 vle_mode_set(vle_mode_t mode, VleModeType type)
50 {
51 current_mode = mode;
52 if(type == VMT_PRIMARY)
53 {
54 primary_mode = mode;
55 }
56 }
57
58 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
59 /* vim: set cinoptions+=t0 filetype=c : */
60