From 1b587b01ee4d266dfc4495548bbb1340c60ba23a Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 18 Jan 2001 01:33:44 +0000 Subject: [PATCH] Applied patch from Largo to update sound related stuff and documentation --- INSTALL | 23 +++++--- WPrefs.app/Appearance.c | 2 +- WPrefs.app/Configurations.c | 10 ++-- WPrefs.app/Expert.c | 2 +- WPrefs.app/TexturePanel.c | 1 - WPrefs.app/WPrefs.h | 1 - WindowMaker/Defaults/WMWindowAttributes.in | 2 +- acconfig.h | 2 +- configure.in | 2 +- src/Makefile.am | 4 +- src/actions.c | 36 ++++++------ src/appicon.c | 6 +- src/application.c | 12 ++-- src/dialog.c | 2 +- src/dock.c | 14 ++--- src/event.c | 4 -- src/wmsound.c | 89 ------------------------------ src/wsound.c | 44 +++++++++++++++ src/{wmsound.h => wsound.h} | 43 ++++++--------- 19 files changed, 122 insertions(+), 177 deletions(-) delete mode 100644 src/wmsound.c create mode 100644 src/wsound.c rename src/{wmsound.h => wsound.h} (51%) diff --git a/INSTALL b/INSTALL index 9b85716a..46727fd9 100644 --- a/INSTALL +++ b/INSTALL @@ -334,15 +334,6 @@ apply. INSTALLATION: ============= -Unpack WindowMaker-extra-.tar.gz in /usr/local/share - -You can get the file at ftp://ftp.windowmaker.org. This file is optional -and only have a few icons, and themes. Look for the latest -available. -Also there is a WindowMaker-extra.readme to instruct you where that package -should go. - - Build Window Maker ------------------ For a quick start, type the following in your shell prompt: @@ -417,6 +408,20 @@ Read the User Guide for a more in-depth explanation of Window Maker. You might want to take a look at the FAQ too. + +Installing the extras package +----------------------------- + +Unpack WindowMaker-extra-.tar.gz in /usr/local/share + +You can get the file at ftp://ftp.windowmaker.org. This file is optional +and only have a few icons, and themes. Look for the latest +available. +Also there is a WindowMaker-extra.readme to instruct you where that package +should go. + + + I don't have the root password :( --------------------------------- diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index e3151c17..1a0a2f81 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -1921,7 +1921,7 @@ createPanel(Panel *p) WMMapSubwidgets(panel->bgF); -#endif +#endif /* unfinished */ /*** options ***/ panel->optF = WMCreateFrame(panel->frame); WMSetFrameRelief(panel->optF, WRFlat); diff --git a/WPrefs.app/Configurations.c b/WPrefs.app/Configurations.c index 86b0fbdf..d3dec117 100644 --- a/WPrefs.app/Configurations.c +++ b/WPrefs.app/Configurations.c @@ -386,8 +386,8 @@ createPanel(Panel *p) } WMSetBalloonTextForView(_("Disable/enable `superfluous' features and\n" "animations. These include the `ghosting' of the\n" - "dock when it's being moved to the another side\n" - "and the explosion animation for undocked icons."), + "dock when it's being moved to another side and\n" + "the explosion animation when undocking icons."), WMWidgetView(panel->supB)); panel->sfxB = WMCreateButton(panel->animF, WBTToggle); @@ -409,7 +409,7 @@ createPanel(Panel *p) "for actions like shading and closing a window.\n" "You will need a module distributed separately\n" "for this. You can get it at:\n" - "http://www.frontiernet.net/~southgat/wmsound"), + "http://shadowmere.student.utwente.nl/"), WMWidgetView(panel->sfxB)); panel->noteL = WMCreateLabel(panel->animF); @@ -463,7 +463,7 @@ createPanel(Panel *p) WMMoveWidget(panel->dith2L, 180, 50); WMSetLabelTextAlignment(panel->dith2L, WACenter); WMSetLabelFont(panel->dith2L, font); - WMSetLabelText(panel->dith2L, _("More colors for\nWindowMaker")); + WMSetLabelText(panel->dith2L, _("More colors for\nWindow Maker")); WMMapSubwidgets(panel->dithF); @@ -522,7 +522,7 @@ InitConfigurations(WMScreen *scr, WMWindow *win) panel->description = _("Animation speeds, titlebar styles, various option\n" "toggling and number of colors to reserve for\n" - "Window Maker in 8bit displays."); + "Window Maker on 8bit displays."); panel->win = win; diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 1e94d49a..3ca67263 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -75,7 +75,7 @@ createPanel(Panel *p) WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for miniaturized windows). For use with KDE/GNOME.")); WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)")); - WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker")); + WMSetButtonText(panel->swi[2], _("Automatically save session when exiting Window Maker")); WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects")); WMSetButtonText(panel->swi[4], _("Use Windoze style cycling")); WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command")); diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c index 6ccf7d20..035ff03b 100644 --- a/WPrefs.app/TexturePanel.c +++ b/WPrefs.app/TexturePanel.c @@ -38,7 +38,6 @@ #include "TexturePanel.h" - #define MAX_SECTION_PARTS 5 typedef struct _TexturePanel { diff --git a/WPrefs.app/WPrefs.h b/WPrefs.app/WPrefs.h index d0482e6a..b91c8cdc 100644 --- a/WPrefs.app/WPrefs.h +++ b/WPrefs.app/WPrefs.h @@ -45,7 +45,6 @@ #define WVERSION "0.43" #define WMVERSION "0.62.x" - extern char *NOptionValueChanged; typedef struct _Panel Panel; diff --git a/WindowMaker/Defaults/WMWindowAttributes.in b/WindowMaker/Defaults/WMWindowAttributes.in index a676dc41..016cab7b 100644 --- a/WindowMaker/Defaults/WMWindowAttributes.in +++ b/WindowMaker/Defaults/WMWindowAttributes.in @@ -4,7 +4,7 @@ Logo.WMClip = {Icon = clip.#extension#;}; Dockit = {Icon = GNUstep3D.#extension#;}; DockApp = {NoAppIcon = NO;}; - WMSoundServer = {Icon = sound.#extension#;}; + WSoundServer = {Icon = sound.#extension#;}; panel.Panel = {NoAppIcon = YES;}; gmc.Gmc = {NoAppIcon = YES;}; XTerm = {Icon = Terminal.#extension#;}; diff --git a/acconfig.h b/acconfig.h index 9aae89e5..d3800a49 100644 --- a/acconfig.h +++ b/acconfig.h @@ -55,7 +55,7 @@ #undef I18N /* define if you want sound support */ -#undef WMSOUND +#undef WSOUND /* define if you want the 'lite' version */ #undef LITE diff --git a/configure.in b/configure.in index 67c9b744..90fac591 100644 --- a/configure.in +++ b/configure.in @@ -758,7 +758,7 @@ AC_ARG_ENABLE(sound, [ --disable-sound disable sound support ], sound=$enableval, sound=yes) if test "$sound" = yes; then - AC_DEFINE(WMSOUND) + AC_DEFINE(WSOUND) fi diff --git a/src/Makefile.am b/src/Makefile.am index 2533f272..742cdfc4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,8 +98,8 @@ wmaker_SOURCES = \ winspector.c \ workspace.c \ workspace.h \ - wmsound.c \ - wmsound.h \ + wsound.c \ + wsound.h \ text.c \ text.h diff --git a/src/actions.c b/src/actions.c index d7c55628..f1be29b2 100644 --- a/src/actions.c +++ b/src/actions.c @@ -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 diff --git a/src/appicon.c b/src/appicon.c index 1b88d297..6e65469d 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -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); diff --git a/src/application.c b/src/application.c index 391cbd6c..20106d1b 100644 --- a/src/application.c +++ b/src/application.c @@ -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 } diff --git a/src/dialog.c b/src/dialog.c index 5d1ce505..62f5fe04 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1220,7 +1220,7 @@ wShowInfoPanel(WScreen *scr) #ifdef OLWM_HINTS list[j++] = "OLWM"; #endif -#ifdef WMSOUND +#ifdef WSOUND list[j++] = "Sound"; #endif diff --git a/src/dock.c b/src/dock.c index 2bb51975..4a91c7a3 100644 --- a/src/dock.c +++ b/src/dock.c @@ -53,7 +53,7 @@ #include "workspace.h" #include "framewin.h" #include "superfluous.h" -#include "wmsound.h" +#include "wsound.h" #include @@ -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) diff --git a/src/event.c b/src/event.c index 465be4b5..2ad6875b 100644 --- a/src/event.c +++ b/src/event.c @@ -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 diff --git a/src/wmsound.c b/src/wmsound.c deleted file mode 100644 index e8b35bcc..00000000 --- a/src/wmsound.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "wconfig.h" - -#include -#include -#include -#include -#include -#include - -#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 */ diff --git a/src/wsound.c b/src/wsound.c new file mode 100644 index 00000000..d02f3c4c --- /dev/null +++ b/src/wsound.c @@ -0,0 +1,44 @@ +#include "wconfig.h" + +#include +#include +#include +#include +#include +#include + +#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 */ diff --git a/src/wmsound.h b/src/wsound.h similarity index 51% rename from src/wmsound.h rename to src/wsound.h index 8fe33e6c..2eab2542 100644 --- a/src/wmsound.h +++ b/src/wsound.h @@ -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_*/ -- 2.11.4.GIT