~ctf/unity-settings-daemon/bug1389099_mic_volume_icons

« back to all changes in this revision

Viewing changes to plugins/common/gsd-keygrab.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-02-07 11:44:36 UTC
  • Revision ID: package-import@ubuntu.com-20140207114436-7t5u3yvwc4ul7w3e
Tags: upstream-14.04.0
ImportĀ upstreamĀ versionĀ 14.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2008 Jens Granseuer <jensgr@gmx.net>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
#ifndef __GSD_COMMON_KEYGRAB_H
 
21
#define __GSD_COMMON_KEYGRAB_H
 
22
 
 
23
G_BEGIN_DECLS
 
24
 
 
25
#include <glib.h>
 
26
#include <X11/keysym.h>
 
27
#include <X11/extensions/XInput2.h>
 
28
 
 
29
typedef struct {
 
30
        guint keysym;
 
31
        guint state;
 
32
        guint *keycodes;
 
33
} Key;
 
34
 
 
35
typedef enum {
 
36
        GSD_KEYGRAB_NORMAL           = 0,
 
37
        GSD_KEYGRAB_ALLOW_UNMODIFIED = 1 << 0,
 
38
        GSD_KEYGRAB_SYNCHRONOUS      = 1 << 1
 
39
} GsdKeygrabFlags;
 
40
 
 
41
void            grab_key_unsafe (Key     *key,
 
42
                                 GsdKeygrabFlags flags,
 
43
                                 GSList  *screens);
 
44
 
 
45
void            ungrab_key_unsafe (Key     *key,
 
46
                                   GSList  *screens);
 
47
 
 
48
gboolean        match_xi2_key   (Key           *key,
 
49
                                 XIDeviceEvent *event);
 
50
 
 
51
gboolean        key_uses_keycode (const Key *key,
 
52
                                  guint keycode);
 
53
 
 
54
Key *           parse_key        (const char    *str);
 
55
void            free_key         (Key           *key);
 
56
 
 
57
void            grab_button      (int      deviceid,
 
58
                                  gboolean grab,
 
59
                                  GSList  *screens);
 
60
 
 
61
G_END_DECLS
 
62
 
 
63
#endif /* __GSD_COMMON_KEYGRAB_H */