Change to the linux kernel coding style
[wmaker-crm.git] / src / wsound.c
Commit [+]AuthorDateLineData
1b587b01 dan2001-01-18 01:33:44 +00001#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
1b587b01 dan2001-01-18 01:33:44 +000014extern WPreferences wPreferences;
15
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020016void wSoundPlay(long event_sound)
1b587b01 dan2001-01-18 01:33:44 +000017{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020018 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 }
1b587b01 dan2001-01-18 01:33:44 +000037}