2004-09-17 Dan Doel <dolio@case.edu>
+ * xcompmgr.c: (win_extents), (usage), (main):
+ Added various client-side shadow options (opacity, offset, radius)
+ based on the work of Thomas Luebking.
+ * xcompmgr.1:
+ Added descriptions of the options in the man page.
+
+2004-09-17 Dan Doel <dolio@case.edu>
+
* xcompmgr.c: (usage):
Changed the usage function to describe the available options.
xcompmgr \- sample X compositing manager
.SH SYNOPSIS
.nf
-.B xcompmgr [\-d display] [\-acfnsCFS]
+.B xcompmgr [\-d display] [\-r radius] [\-o opacity] [\-l left-offset] [\-t top-offset] [\-acCfFnsS]
.fi
.SH DESCRIPTION
.B xcompmgr
.BI \-d\ display
Specifies the display to manage.
.TP
+.BI \-r\ radius
+Specifies the blur radius for client-side shadows.
+.TP
+.BI \-o\ opacity
+Specifies the opacity for client-side shadows.
+.TP
+.BI \-l\ left-offset
+Specifies the left offset for client-side shadows.
+.TP
+.BI \-t\ top-offset
+Specifies the top offset for client-side shadows.
+.TP
.BI \-a
Automatic server-side compositing. This instructs the server to use the
standard composition rules. Useful for debugging.
Probably. Please report any you find to http://bugs.freedesktop.org/.
.SH AUTHORS
Keith Packard, with contributions from Matthew Allum, Eric Anholt, Dan Doel,
-Matthew Hawn, Ely Levy, Phil Blundell, and Carl Worth.
+Thomas Luebking, Matthew Hawn, Ely Levy, Phil Blundell, and Carl Worth.
CompMode compMode = CompSimple;
int shadowRadius = 12;
+int shadowOffsetX = -15;
+int shadowOffsetY = -15;
+double shadowOpacity = .75;
double fade_in_step = 0.028;
double fade_out_step = 0.03;
fade_time = now + fade_delta;
}
-#define SHADOW_OPACITY 0.75
-#define SHADOW_OFFSET_X (-shadowRadius * 5 / 4)
-#define SHADOW_OFFSET_Y (-shadowRadius * 5 / 4)
-
static double
gaussian (double r, double x, double y)
{
}
else
{
- w->shadow_dx = SHADOW_OFFSET_X;
- w->shadow_dy = SHADOW_OFFSET_Y;
+ w->shadow_dx = shadowOffsetX;
+ w->shadow_dy = shadowOffsetY;
if (!w->shadow)
{
- double opacity = SHADOW_OPACITY;
+ double opacity = shadowOpacity;
if (w->mode == WINDOW_TRANS)
opacity = opacity * ((double)w->opacity)/((double)OPAQUE);
w->shadow = shadow_picture (dpy, opacity, w->alphaPict,
void
usage (char *program)
{
- fprintf (stderr, "usage: %s [-d display] [-acCfFnsS]\n", program);
+ fprintf (stderr, "usage: %s [options]\n", program);
fprintf (stderr, "Options\n");
fprintf (stderr, " -d display\n Specifies which display should be managed.\n");
+ fprintf (stderr, " -r radius\n Specifies the blur radius for client-side shadows. (default 12)\n");
+ fprintf (stderr, " -o opacity\n Specifies the translucency for client-side shadows. (default .75)\n");
+ fprintf (stderr, " -l left-offset\n Specifies the left offset for client-side shadows. (default -15)\n");
+ fprintf (stderr, " -t top-offset\n Specifies the top offset for clinet-side shadows. (default -15)\n");
fprintf (stderr, " -a\n Use automatic server-side compositing. Faster, but no special effects.\n");
fprintf (stderr, " -c\n Draw client-side shadows with fuzzy edges.\n");
fprintf (stderr, " -C\n Avoid drawing shadows on dock/panel windows.\n");
char *display = 0;
int o;
- while ((o = getopt (argc, argv, "d:scnfFCaS")) != -1)
+ while ((o = getopt (argc, argv, "d:r:o:l:t:scnfFCaS")) != -1)
{
switch (o) {
case 'd':
case 'S':
synchronize = True;
break;
+ case 'r':
+ shadowRadius = atoi (optarg);
+ break;
+ case 'o':
+ shadowOpacity = atof (optarg);
+ break;
+ case 'l':
+ shadowOffsetX = atoi (optarg);
+ break;
+ case 't':
+ shadowOffsetY = atoi (optarg);
+ break;
default:
usage (argv[0]);
break;