unused variables. Remove confusing informational messages with the word
"error" in them.
+2003-11-19 Carl Worth <cworth@isi.edu>
+
+ * xcompmgr.c: Eliminate several compiler warnings: missing
+ includes, static functions, unused variables. Remove confusing
+ informational messages with the word "error" in them.
+
2003-11-14 Keith Packard <keithp@keithp.com>
* xcompmgr.c: (main):
2003-11-14 Keith Packard <keithp@keithp.com>
* xcompmgr.c: (main):
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <sys/poll.h>
#include <math.h>
#include <sys/poll.h>
+#include <sys/time.h>
+#include <time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xcomposite.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xcomposite.h>
#define SHADOW_OFFSET_Y (-SHADOW_RADIUS)
#define SHADOW_OFFSET_Y (-SHADOW_RADIUS)
gaussian (double r, double x, double y)
{
return ((1 / (sqrt (2 * M_PI * r))) *
gaussian (double r, double x, double y)
{
return ((1 / (sqrt (2 * M_PI * r))) *
make_gaussian_map (Display *dpy, double r)
{
conv *c;
make_gaussian_map (Display *dpy, double r)
{
conv *c;
* center +-----+-------------------+-----+
*/
* center +-----+-------------------+-----+
*/
sum_gaussian (conv *map, double opacity, int x, int y, int width, int height)
{
int fx, fy;
sum_gaussian (conv *map, double opacity, int x, int y, int width, int height)
{
int fx, fy;
double *g_data;
double *g_line = map->data;
int g_size = map->size;
double *g_data;
double *g_line = map->data;
int g_size = map->size;
return ((unsigned int) (v * opacity * 255.0));
}
return ((unsigned int) (v * opacity * 255.0));
}
make_shadow (Display *dpy, double opacity, int width, int height)
{
XImage *ximage;
make_shadow (Display *dpy, double opacity, int width, int height)
{
XImage *ximage;
- double *gdata = gussianMap->data;
unsigned char *data;
int gsize = gussianMap->size;
int ylimit, xlimit;
unsigned char *data;
int gsize = gussianMap->size;
int ylimit, xlimit;
int sheight = height + gsize;
int center = gsize / 2;
int x, y;
int sheight = height + gsize;
int center = gsize / 2;
int x, y;
- int fx, fy;
- int sx, sy;
- double v;
- unsigned char c;
data = malloc (swidth * sheight * sizeof (unsigned char));
ximage = XCreateImage (dpy,
data = malloc (swidth * sheight * sizeof (unsigned char));
ximage = XCreateImage (dpy,
shadow_picture (Display *dpy, double opacity, int width, int height, int *wp, int *hp)
{
XImage *shadowImage = make_shadow (dpy, opacity, width, height);
shadow_picture (Display *dpy, double opacity, int width, int height, int *wp, int *hp)
{
XImage *shadowImage = make_shadow (dpy, opacity, width, height);
find_win (Display *dpy, Window id)
{
win *w;
find_win (Display *dpy, Window id)
{
win *w;
root_tile (Display *dpy)
{
Picture picture;
root_tile (Display *dpy)
{
Picture picture;
paint_root (Display *dpy)
{
if (!rootTile)
paint_root (Display *dpy)
{
if (!rootTile)
0, 0, 0, 0, 0, 0, root_width, root_height);
}
0, 0, 0, 0, 0, 0, root_width, root_height);
}
win_extents (Display *dpy, win *w)
{
XRectangle r;
win_extents (Display *dpy, win *w)
{
XRectangle r;
return XFixesCreateRegion (dpy, &r, 1);
}
return XFixesCreateRegion (dpy, &r, 1);
}
border_size (Display *dpy, win *w)
{
XserverRegion border;
border_size (Display *dpy, win *w)
{
XserverRegion border;
paint_all (Display *dpy, XserverRegion region)
{
win *w;
paint_all (Display *dpy, XserverRegion region)
{
win *w;
XFixesSetPictureClipRegion (dpy, rootPicture, 0, 0, region);
for (w = list; w; w = w->next)
{
XFixesSetPictureClipRegion (dpy, rootPicture, 0, 0, region);
for (w = list; w; w = w->next)
{
if (w->a.map_state != IsViewable)
continue;
if (!w->picture)
if (w->a.map_state != IsViewable)
continue;
if (!w->picture)
0, 0, 0, 0, 0, 0, root_width, root_height);
}
0, 0, 0, 0, 0, 0, root_width, root_height);
}
add_damage (Display *dpy, XserverRegion damage)
{
if (allDamage)
add_damage (Display *dpy, XserverRegion damage)
{
if (allDamage)
repair_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
repair_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
add_damage (dpy, parts);
}
add_damage (dpy, parts);
}
map_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
map_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
unmap_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
unmap_win (Display *dpy, Window id)
{
win *w = find_win (dpy, id);
add_win (Display *dpy, Window id, Window prev)
{
win *new = malloc (sizeof (win));
win **p;
add_win (Display *dpy, Window id, Window prev)
{
win *new = malloc (sizeof (win));
win **p;
XRenderPictureAttributes pa;
XRenderPictFormat *format;
XRenderPictureAttributes pa;
XRenderPictFormat *format;
configure_win (Display *dpy, XConfigureEvent *ce)
{
win *w = find_win (dpy, ce->window);
configure_win (Display *dpy, XConfigureEvent *ce)
{
win *w = find_win (dpy, ce->window);
destroy_win (Display *dpy, Window id, Bool gone)
{
win **prev, *w;
destroy_win (Display *dpy, Window id, Bool gone)
{
win **prev, *w;
- for (prev = &list; w = *prev; prev = &w->next)
+ for (prev = &list; (w = *prev); prev = &w->next)
if (w->id == id)
{
if (!gone)
if (w->id == id)
{
if (!gone)
- printf ("\t%08x: %d x %d + %d + %d (%d)\n", w->id,
+ printf ("\t%08lx: %d x %d + %d + %d (%d)\n", w->id,
w->a.width, w->a.height, w->a.x, w->a.y, w->a.border_width);
}
w->a.width, w->a.height, w->a.x, w->a.y, w->a.border_width);
}
dump_wins (void)
{
win *w;
dump_wins (void)
{
win *w;
for (w = list; w; w = w->next)
dump_win (w);
}
for (w = list; w; w = w->next)
dump_win (w);
}
damage_win (Display *dpy, XDamageNotifyEvent *de)
{
repair_win (dpy, de->drawable);
}
damage_win (Display *dpy, XDamageNotifyEvent *de)
{
repair_win (dpy, de->drawable);
}
error (Display *dpy, XErrorEvent *ev)
{
printf ("error %d request %d minor %d\n",
ev->error_code, ev->request_code, ev->minor_code);
error (Display *dpy, XErrorEvent *ev)
{
printf ("error %d request %d minor %d\n",
ev->error_code, ev->request_code, ev->minor_code);
expose_root (Display *dpy, Window root, XRectangle *rects, int nrects)
{
XserverRegion region = XFixesCreateRegion (dpy, rects, nrects);
expose_root (Display *dpy, Window root, XRectangle *rects, int nrects)
{
XserverRegion region = XFixesCreateRegion (dpy, rects, nrects);
add_damage (dpy, region);
}
add_damage (dpy, region);
}
+#define INTERVAL 0
+
+#if INTERVAL
+static int
+time_in_millis (void)
{
struct timeval tp;
gettimeofday (&tp, 0);
return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
}
{
struct timeval tp;
gettimeofday (&tp, 0);
return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
}
-#define INTERVAL 0
-
-main ()
{
XEvent ev;
int event_base, error_base;
{
XEvent ev;
int event_base, error_base;
XRenderPictureAttributes pa;
XRenderColor c;
XRectangle *expose_rects = 0;
XRenderPictureAttributes pa;
XRenderColor c;
XRectangle *expose_rects = 0;
int size_expose = 0;
int n_expose = 0;
int size_expose = 0;
int n_expose = 0;
- struct pollfd ufd;
- int n;
- int last_update;
- int now;
#if INTERVAL
int timeout;
#endif
#if INTERVAL
int timeout;
#endif
fprintf (stderr, "No composite extension\n");
exit (1);
}
fprintf (stderr, "No composite extension\n");
exit (1);
}
- printf ("Composite error %d\n", error_base);
if (!XDamageQueryExtension (dpy, &damage_event, &damage_error))
{
fprintf (stderr, "No damage extension\n");
exit (1);
}
if (!XDamageQueryExtension (dpy, &damage_event, &damage_error))
{
fprintf (stderr, "No damage extension\n");
exit (1);
}
- printf ("Damage error %d\n", damage_error);
if (!XFixesQueryExtension (dpy, &xfixes_event, &xfixes_error))
{
fprintf (stderr, "No XFixes extension\n");
exit (1);
}
if (!XFixesQueryExtension (dpy, &xfixes_event, &xfixes_error))
{
fprintf (stderr, "No XFixes extension\n");
exit (1);
}
- printf ("XFixes error %d\n", xfixes_error);
allDamage = None;
XGrabServer (dpy);
XCompositeRedirectSubwindows (dpy, root, CompositeRedirectManual);
allDamage = None;
XGrabServer (dpy);
XCompositeRedirectSubwindows (dpy, root, CompositeRedirectManual);