summaryrefslogtreecommitdiff
path: root/common/tablet_mode.c
blob: 4a9a0b2364adb43fe7960c348e683d20a5ee3441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "hooks.h"

/* Return 1 if in tablet mode, 0 otherwise */
static int tablet_mode = 1;

int tablet_get_mode(void)
{
	return tablet_mode;
}

void tablet_set_mode(int mode)
{
	if (tablet_mode != mode) {
		tablet_mode = mode;
		hook_notify(HOOK_TABLET_MODE_CHANGE);
	}
}