pnmixer
Volume mixer for the system tray
hotkey.h
Go to the documentation of this file.
1 /* hotkey.h
2  * PNmixer is written by Nick Lanham, a fork of OBmixer
3  * which was programmed by Lee Ferrett, derived
4  * from the program "AbsVolume" by Paul Sherman
5  * This program is free software; you can redistribute
6  * it and/or modify it under the terms of the GNU General
7  * Public License v3. source code is available at
8  * <http://github.com/nicklan/pnmixer>
9  */
10 
17 #ifndef _HOTKEY_H_
18 #define _HOTKEY_H_
19 
20 #include <gdk/gdkx.h>
21 
22 struct hotkey {
23  /* These values should only be accessed for reading,
24  * and shouldn't be modified outside of hotkey.c
25  */
26  guint code; /* Key code */
27  GdkModifierType mods; /* Key modifier */
28  unsigned long int sym; /* X Key Symbol */
29  gchar *str; /* Gtk Accelerator string */
30 };
31 
32 typedef struct hotkey Hotkey;
33 
34 Hotkey *hotkey_new(guint code, GdkModifierType mods);
35 void hotkey_free(Hotkey *key);
36 gboolean hotkey_matches(Hotkey *hotkey, guint code, GdkModifierType mods);
37 
39 gboolean hotkey_grab(Hotkey *hotkey);
40 
41 gchar *hotkey_code_to_accel(guint code, GdkModifierType mods);
42 void hotkey_accel_to_code(const gchar *accel, gint *code, GdkModifierType *mods);
43 
44 #endif // _HOTKEY_H
unsigned long int sym
Definition: hotkey.h:28
Hotkey * hotkey_new(guint code, GdkModifierType mods)
Definition: hotkey.c:179
void hotkey_free(Hotkey *key)
Definition: hotkey.c:160
gchar * str
Definition: hotkey.h:29
void hotkey_accel_to_code(const gchar *accel, gint *code, GdkModifierType *mods)
Definition: hotkey.c:230
guint code
Definition: hotkey.h:26
void hotkey_ungrab(Hotkey *hotkey)
Definition: hotkey.c:68
Definition: hotkey.h:22
GdkModifierType mods
Definition: hotkey.h:27
gboolean hotkey_matches(Hotkey *hotkey, guint code, GdkModifierType mods)
Definition: hotkey.c:138
gchar * hotkey_code_to_accel(guint code, GdkModifierType mods)
Definition: hotkey.c:208
gboolean hotkey_grab(Hotkey *hotkey)
Definition: hotkey.c:92