mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-03 20:34:14 +01:00
Applied patch from Largo to update sound related stuff and documentation
This commit is contained in:
@@ -98,8 +98,8 @@ wmaker_SOURCES = \
|
||||
winspector.c \
|
||||
workspace.c \
|
||||
workspace.h \
|
||||
wmsound.c \
|
||||
wmsound.h \
|
||||
wsound.c \
|
||||
wsound.h \
|
||||
text.c \
|
||||
text.h
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
# include "kwm.h"
|
||||
#endif
|
||||
|
||||
#ifdef WMSOUND
|
||||
#include "wmsound.h"
|
||||
#ifdef WSOUND
|
||||
#include "wsound.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -273,8 +273,8 @@ wShadeWindow(WWindow *wwin)
|
||||
|
||||
XLowerWindow(dpy, wwin->client_win);
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_SHADE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_SHADE);
|
||||
#endif
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
@@ -360,8 +360,8 @@ wUnshadeWindow(WWindow *wwin)
|
||||
wwin->flags.mapped = 1;
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_UNSHADE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_UNSHADE);
|
||||
#endif
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
@@ -515,8 +515,8 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
||||
#endif
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_MAXIMIZE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_MAXIMIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -549,8 +549,8 @@ wUnmaximizeWindow(WWindow *wwin)
|
||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
||||
#endif
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_UNMAXIMIZE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_UNMAXIMIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -970,8 +970,8 @@ wIconifyWindow(WWindow *wwin)
|
||||
unmapTransientsFor(wwin);
|
||||
|
||||
if (present) {
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_ICONIFY);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_ICONIFY);
|
||||
#endif
|
||||
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
@@ -1124,8 +1124,8 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
}
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_DEICONIFY);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_DEICONIFY);
|
||||
#endif
|
||||
|
||||
/* if the window is in another workspace, do it silently */
|
||||
@@ -1242,8 +1242,8 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
||||
|
||||
wClientSetState(wwin, IconicState, icon->icon_win);
|
||||
flushExpose();
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_HIDE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_HIDE);
|
||||
#endif
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations &&
|
||||
@@ -1457,8 +1457,8 @@ unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate,
|
||||
wwin->flags.hidden=0;
|
||||
wwin->flags.mapped=1;
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_UNHIDE);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_UNHIDE);
|
||||
#endif
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#ifdef XDND
|
||||
#include "xdnd.h"
|
||||
#endif
|
||||
#include "wmsound.h"
|
||||
#include "wsound.h"
|
||||
#include "WINGsP.h"
|
||||
|
||||
|
||||
@@ -900,8 +900,8 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
aicon->y_pos);
|
||||
}
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_DOCK);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_DOCK);
|
||||
#endif
|
||||
} else {
|
||||
XMoveWindow(dpy, icon->core->window, x, y);
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
#include "dock.h"
|
||||
|
||||
#ifdef WMSOUND
|
||||
#include "wmsound.h"
|
||||
#ifdef WSOUND
|
||||
#include "wsound.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -414,8 +414,8 @@ wApplicationCreate(WScreen *scr, Window main_window)
|
||||
scr->wapp_list = wapp;
|
||||
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_APPSTART);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_APPSTART);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -517,8 +517,8 @@ wApplicationDestroy(WApplication *wapp)
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_APPEXIT);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_APPEXIT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1220,7 +1220,7 @@ wShowInfoPanel(WScreen *scr)
|
||||
#ifdef OLWM_HINTS
|
||||
list[j++] = "OLWM";
|
||||
#endif
|
||||
#ifdef WMSOUND
|
||||
#ifdef WSOUND
|
||||
list[j++] = "Sound";
|
||||
#endif
|
||||
|
||||
|
||||
14
src/dock.c
14
src/dock.c
@@ -53,7 +53,7 @@
|
||||
#include "workspace.h"
|
||||
#include "framewin.h"
|
||||
#include "superfluous.h"
|
||||
#include "wmsound.h"
|
||||
#include "wsound.h"
|
||||
|
||||
|
||||
#include <proplist.h>
|
||||
@@ -3937,18 +3937,18 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
if (aicon->icon->selected)
|
||||
wIconSelect(aicon->icon);
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_KABOOM);
|
||||
#ifdef WSOUND
|
||||
wSoundPlay(WSOUND_KABOOM);
|
||||
#endif
|
||||
DoKaboom(scr,aicon->icon->core->window, x, y);
|
||||
#ifdef WMSOUND
|
||||
#ifdef WSOUND
|
||||
} else {
|
||||
wSoundPlay(WMSOUND_UNDOCK);
|
||||
wSoundPlay(WSOUND_UNDOCK);
|
||||
#endif
|
||||
}
|
||||
#ifdef WMSOUND
|
||||
#ifdef WSOUND
|
||||
} else {
|
||||
wSoundPlay(WMSOUND_UNDOCK);
|
||||
wSoundPlay(WSOUND_UNDOCK);
|
||||
#endif
|
||||
}
|
||||
if (clip && clip->auto_raise_lower)
|
||||
|
||||
@@ -637,13 +637,9 @@ handleButtonPress(XEvent *event)
|
||||
}
|
||||
#ifdef MOUSE_WS_SWITCH
|
||||
else if (event->xbutton.button==Button5) {
|
||||
|
||||
wWorkspaceRelativeChange(scr, -1);
|
||||
|
||||
} else if (event->xbutton.button==Button4) {
|
||||
|
||||
wWorkspaceRelativeChange(scr, 1);
|
||||
|
||||
}
|
||||
#endif /* MOUSE_WS_SWITCH */
|
||||
#ifdef GNOME_STUFF
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
#include "wconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
#include "funcs.h"
|
||||
#include "wmsound.h"
|
||||
|
||||
#ifdef WMSOUND
|
||||
|
||||
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
|
||||
#if 0
|
||||
void
|
||||
wSoundServerGrab(Window wm_win)
|
||||
{
|
||||
Window *lstChildren;
|
||||
Window retRoot;
|
||||
Window retParent;
|
||||
int indexCount;
|
||||
u_int numChildren;
|
||||
XClassHint *retHint;
|
||||
|
||||
if (XQueryTree(dpy, wm_win, &retRoot, &retParent, &lstChildren, &numChildren)) {
|
||||
for (indexCount = 1; indexCount < numChildren; indexCount++) {
|
||||
retHint = XAllocClassHint();
|
||||
if (!retHint) {
|
||||
XFree(lstChildren);
|
||||
return;
|
||||
}
|
||||
|
||||
XGetClassHint (dpy, lstChildren[indexCount], retHint);
|
||||
|
||||
if (retHint->res_class) {
|
||||
if (strcmp("WMSoundServer", retHint->res_class)==0 ||
|
||||
/*strcmp("WSoundServer", retHint->res_class)==0 ||*/
|
||||
(retHint->res_name &&
|
||||
strcmp("wsoundserver", retHint->res_name)==0 &&
|
||||
strcmp("DockApp", retHint->res_class)==0)) {
|
||||
|
||||
soundServer = lstChildren[indexCount];
|
||||
XFree(lstChildren);
|
||||
if(retHint) {
|
||||
XFree(retHint);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
XFree(retHint);
|
||||
retHint = 0;
|
||||
}
|
||||
XFree(lstChildren);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
wSoundPlay(long event_sound)
|
||||
{
|
||||
static Atom atom = 0;
|
||||
XEvent sound_event;
|
||||
|
||||
if (!atom) {
|
||||
atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
|
||||
}
|
||||
|
||||
if(!wPreferences.no_sound) {
|
||||
Window win = wScreenWithNumber(0)->info_window;
|
||||
|
||||
sound_event.xclient.type = ClientMessage;
|
||||
sound_event.xclient.message_type = atom;
|
||||
sound_event.xclient.format = 32;
|
||||
sound_event.xclient.display = dpy;
|
||||
sound_event.xclient.window = win;
|
||||
sound_event.xclient.data.l[0] = event_sound;
|
||||
XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
|
||||
XFlush(dpy);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* WMSOUND */
|
||||
44
src/wsound.c
Normal file
44
src/wsound.c
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "wconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
#include "funcs.h"
|
||||
#include "wsound.h"
|
||||
|
||||
#ifdef WSOUND
|
||||
|
||||
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
|
||||
void
|
||||
wSoundPlay(long event_sound)
|
||||
{
|
||||
static Atom atom = 0;
|
||||
XEvent sound_event;
|
||||
|
||||
if (!atom) {
|
||||
atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
|
||||
}
|
||||
|
||||
if(!wPreferences.no_sound) {
|
||||
Window win = wScreenWithNumber(0)->info_window;
|
||||
|
||||
sound_event.xclient.type = ClientMessage;
|
||||
sound_event.xclient.message_type = atom;
|
||||
sound_event.xclient.format = 32;
|
||||
sound_event.xclient.display = dpy;
|
||||
sound_event.xclient.window = win;
|
||||
sound_event.xclient.data.l[0] = event_sound;
|
||||
XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
|
||||
XFlush(dpy);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* WSOUND */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* WMSound Server
|
||||
* Window Maker Sound Server
|
||||
*
|
||||
* Copyright (c) 1997 Anthony P. Quinn
|
||||
*
|
||||
@@ -19,34 +19,25 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef WMSOUND_H_
|
||||
#define WMSOUND_H_
|
||||
#ifndef WSOUND_H_
|
||||
#define WSOUND_H_
|
||||
|
||||
#define WMSOUND_SHADE 1001
|
||||
#define WMSOUND_UNSHADE 1002
|
||||
#define WMSOUND_MAXIMIZE 1003
|
||||
#define WMSOUND_UNMAXIMIZE 1004
|
||||
#define WMSOUND_ICONIFY 1005
|
||||
#define WMSOUND_DEICONIFY 1006
|
||||
#define WMSOUND_HIDE 1007
|
||||
#define WMSOUND_UNHIDE 1008
|
||||
#define WMSOUND_APPSTART 1009
|
||||
#define WMSOUND_APPEXIT 1010
|
||||
#define WMSOUND_DOCK 1011
|
||||
#define WMSOUND_UNDOCK 1012
|
||||
#define WMSOUND_KABOOM 1013
|
||||
|
||||
#if 0
|
||||
/* don't delete this */
|
||||
extern WWindow *wSoundServer;
|
||||
extern Atom WSStartup, WSShade, WSUnshade, WSShutdown;
|
||||
extern Atom WSMaximize, WSUnmaximize, WSIconify, WSUniconify, WSAppStart;
|
||||
extern Atom WSHide, WSUnhide, WSAppExit, WSDock, WSUnDock, WSKaboom;
|
||||
extern WApplication *wSoundApp;
|
||||
#endif
|
||||
#define WSOUND_SHADE 1001
|
||||
#define WSOUND_UNSHADE 1002
|
||||
#define WSOUND_MAXIMIZE 1003
|
||||
#define WSOUND_UNMAXIMIZE 1004
|
||||
#define WSOUND_ICONIFY 1005
|
||||
#define WSOUND_DEICONIFY 1006
|
||||
#define WSOUND_HIDE 1007
|
||||
#define WSOUND_UNHIDE 1008
|
||||
#define WSOUND_APPSTART 1009
|
||||
#define WSOUND_APPEXIT 1010
|
||||
#define WSOUND_DOCK 1011
|
||||
#define WSOUND_UNDOCK 1012
|
||||
#define WSOUND_KABOOM 1013
|
||||
|
||||
|
||||
void wSoundPlay(long event_sound);
|
||||
void wSoundServerGrab(Window wm_win);
|
||||
|
||||
#endif /*WMSOUND_H_*/
|
||||
#endif /*WSOUND_H_*/
|
||||
Reference in New Issue
Block a user