1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
/*****************************************************************************
xdwapi.h - header file of the xdesktopwaves API
Copyright (C) 2004 Oliver Hamann (olha@users.sourceforge.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
#ifndef XDWAPI_H
#define XDWAPI_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _XLIB_H_
#include <X11/Xlib.h>
#endif
typedef void * xdwApiContext;
xdwApiContext xdwApiOpen(Display * display);
/* Open the API for a given display.
* Parameters:
* display - The X display.
* Return value:
* A context for the API. It is required for the other functions.
*/
void xdwApiClose(xdwApiContext context);
/* Close the API.
* Parameters:
* context - The API context.
*/
Bool xdwApiPing(xdwApiContext context);
/* This sends a command which performs nothing, just for testing the
* command sending.
* Parameters:
* context - The API context.
* Return value:
* True on success, False on error (xdesktopwaves probably not
* running).
*/
Bool xdwApiClear(xdwApiContext context);
/* Clear the water from all waves.
* Parameters:
* context - The API context.
* Return value:
* True on success, False on error (xdesktopwaves probably not
* running).
*/
Bool xdwApiSetRain(xdwApiContext context, int intensity);
/* Set intensity of the rain feature.
* Parameters:
* context - The API context.
* intensity - Intensity of the rain. Valid range: 0 to 10
* Return value:
* True on success, False on error (xdesktopwaves probably not
* running).
*/
Bool xdwApiSetStorm(xdwApiContext context, int intensity);
/* Set intensity of the storm feature.
* Parameters:
* context - The API context.
* intensity - Intensity of the storm. Valid range: 0 to 10
* Return value:
* True on success, False on error (xdesktopwaves probably not
* running).
*/
Bool xdwApiPutRaindrop(xdwApiContext context, int x, int y, int volume);
/* Put one raindrop.
* Parameters:
* context - The API context.
* x,y - X- and Y-coordinates of the raindrop, in pixel units
* relative to the root window origin.
* volume - Volume of the raindrop. Valid range: 0 to 100
* Return value:
* True on success, False on error (xdesktopwaves probably not
* running).
*/
int xdwApiPutGhostRect(xdwApiContext context, int milliSecs, int removeId,
int x, int y, int width, int height);
int xdwApiPutGhostCircle(xdwApiContext context, int milliSecs, int removeId,
int x, int y, int radius);
/* Put a temporary custom rectangular or circular "ghost" onto the
* water. It generates waves like a window (ship or shore), but it is
* not drawn. The ghost is automatically removed after a given lifetime.
* Additionally, putting a ghost can remove another ghost. This way a
* ghost can be animated by substituting it again and again.
* Parameters:
* context - The API context.
* milliSecs - Lifetime of the ghost in milliseconds. The ghost is
* removed automatically after this time has passed.
* Valid range: 0 to 32767
* removeId - Identification of another ghost to be removed, or 0 for
* not removing any ghost.
* x,y - Coordinates in pixel units relative to the root window
* origin. It is the upper-left corner of the rectangle
* respectively the center of the circle.
* width - Width of the rectangle in pixel units.
* height - Height of the rectangle in pixel units.
* radius - Radius of the circle in pixel units.
* Return value:
* The identification for the new ghost, or 0 on error. The
* identification comes from a pseudo random number generator. Most
* likely it is unique, but there is no guarantee.
*/
void xdwApiSetWavesByWindow(xdwApiContext context, Window window,
Bool wavesByWindow);
/* Override the waves-by-windows option for a given window.
* Parameters:
* context - The API context.
* window - The window.
* wavesByWindow - True if waves are to be generated by the window,
* False if not.
*/
void xdwApiDefaultWavesByWindow(xdwApiContext context, Window window);
/* Remove the overriding of the waves-by-windows option for a given
* window.
* Parameters:
* context - The API context.
* window - The window.
*/
#ifdef __cplusplus
}
#endif
#endif
|