Change to the linux kernel coding style
[wmaker-crm.git] / src / wsound.c
1 #include "wconfig.h"
2
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <X11/X.h>
6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h>
8 #include <X11/Xproto.h>
9
10 #include "WindowMaker.h"
11 #include "funcs.h"
12 #include "wsound.h"
13
14 extern WPreferences wPreferences;
15
16 void wSoundPlay(long event_sound)
17 {
18 static Atom atom = 0;
19 XEvent sound_event;
20
21 if (!atom) {
22 atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
23 }
24
25 if (!wPreferences.no_sound) {
26 Window win = wScreenWithNumber(0)->info_window;
27
28 sound_event.xclient.type = ClientMessage;
29 sound_event.xclient.message_type = atom;
30 sound_event.xclient.format = 32;
31 sound_event.xclient.display = dpy;
32 sound_event.xclient.window = win;
33 sound_event.xclient.data.l[0] = event_sound;
34 XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
35 XFlush(dpy);
36 }
37 }