summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:04:09 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:04:09 +0000
commit9b186ebf782312d8813abf65ac66c3d66466d69e (patch)
treece8e5ab1cfd0b2da6f754c8747b342678c7d0f8a
parent500a078602d5db1e420a07c81dada5a676e0cc90 (diff)
-rw-r--r--xsetroot.c72
-rw-r--r--xsetroot.man9
2 files changed, 45 insertions, 36 deletions
diff --git a/xsetroot.c b/xsetroot.c
index 628f067..4dd1b3d 100644
--- a/xsetroot.c
+++ b/xsetroot.c
@@ -32,14 +32,17 @@ in this Software without prior written authorization from The Open Group.
* Author: Mark Lillibridge, MIT Project Athena
* 11-Jun-87
*/
+/* $XFree86: xc/programs/xsetroot/xsetroot.c,v 1.8 2001/12/14 20:02:23 dawes Exp $ */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
+#include <X11/Xmu/CurUtil.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "X11/bitmaps/gray"
-
#define Dynamic 1
char *program_name;
@@ -53,7 +56,19 @@ int save_colors = 0;
int unsave_past = 0;
Pixmap save_pixmap = (Pixmap)None;
-usage()
+static void usage(void);
+static void FixupState(void);
+static void SetBackgroundToBitmap(Pixmap bitmap,
+ unsigned int width, unsigned int height);
+static Cursor CreateCursorFromFiles(char *cursor_file, char *mask_file);
+static Cursor CreateCursorFromName(char *name);
+static Pixmap MakeModulaBitmap(int mod_x, int mod_y);
+static XColor NameToXColor(char *name, unsigned long pixel);
+static unsigned long NameToPixel(char *name, unsigned long pixel);
+static Pixmap ReadBitmapFile(char *filename, unsigned int *width, unsigned int *height, int *x_hot, int *y_hot);
+
+static void
+usage(void)
{
fprintf(stderr, "usage: %s [options]\n", program_name);
fprintf(stderr, " where options are:\n");
@@ -74,14 +89,9 @@ usage()
/*NOTREACHED*/
}
-Pixmap MakeModulaBitmap(), ReadBitmapFile();
-XColor NameToXColor();
-unsigned long NameToPixel();
-Cursor CreateCursorFromName();
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char *argv[])
{
int excl = 0;
int nonexcl = 0;
@@ -264,7 +274,8 @@ main(argc, argv)
/* Free past incarnation if needed, and retain state if needed. */
-FixupState()
+static void
+FixupState(void)
{
Atom prop, type;
int format;
@@ -299,9 +310,8 @@ FixupState()
* SetBackgroundToBitmap: Set the root window background to a caller supplied
* bitmap.
*/
-SetBackgroundToBitmap(bitmap, width, height)
- Pixmap bitmap;
- unsigned int width, height;
+static void
+SetBackgroundToBitmap(Pixmap bitmap, unsigned int width, unsigned int height)
{
Pixmap pix;
GC gc;
@@ -336,8 +346,8 @@ SetBackgroundToBitmap(bitmap, width, height)
*/
#define BITMAP_HOT_DEFAULT 8
-CreateCursorFromFiles(cursor_file, mask_file)
- char *cursor_file, *mask_file;
+static Cursor
+CreateCursorFromFiles(char *cursor_file, char *mask_file)
{
Pixmap cursor_bitmap, mask_bitmap;
unsigned int width, height, ww, hh;
@@ -381,9 +391,8 @@ CreateCursorFromFiles(cursor_file, mask_file)
return(cursor);
}
-Cursor
-CreateCursorFromName (name)
- char *name;
+static Cursor
+CreateCursorFromName(char *name)
{
XColor fg, bg, temp;
int i;
@@ -407,21 +416,21 @@ CreateCursorFromName (name)
/*
* MakeModulaBitmap: Returns a modula bitmap based on an x & y mod.
*/
-Pixmap MakeModulaBitmap(mod_x, mod_y)
- int mod_x, mod_y;
+static Pixmap
+MakeModulaBitmap(int mod_x, int mod_y)
{
int i;
long pattern_line = 0;
char modula_data[16*16/8];
- for (i=0; i<16; i++) {
+ for (i=16; i--; ) {
pattern_line <<=1;
if ((i % mod_x) == 0) pattern_line |= 0x0001;
}
for (i=0; i<16; i++) {
if ((i % mod_y) == 0) {
- modula_data[i*2] = 0xff;
- modula_data[i*2+1] = 0xff;
+ modula_data[i*2] = (char)0xff;
+ modula_data[i*2+1] = (char)0xff;
} else {
modula_data[i*2] = pattern_line & 0xff;
modula_data[i*2+1] = (pattern_line>>8) & 0xff;
@@ -435,9 +444,8 @@ Pixmap MakeModulaBitmap(mod_x, mod_y)
/*
* NameToXColor: Convert the name of a color to its Xcolor value.
*/
-XColor NameToXColor(name, pixel)
- char *name;
- unsigned long pixel;
+static XColor
+NameToXColor(char *name, unsigned long pixel)
{
XColor c;
@@ -453,9 +461,8 @@ XColor NameToXColor(name, pixel)
return(c);
}
-unsigned long NameToPixel(name, pixel)
- char *name;
- unsigned long pixel;
+static unsigned long
+NameToPixel(char *name, unsigned long pixel)
{
XColor ecolor;
@@ -479,10 +486,9 @@ unsigned long NameToPixel(name, pixel)
return(ecolor.pixel);
}
-Pixmap ReadBitmapFile(filename, width, height, x_hot, y_hot)
- char *filename;
- unsigned int *width, *height;
- int *x_hot, *y_hot;
+static Pixmap
+ReadBitmapFile(char *filename, unsigned int *width, unsigned int *height,
+ int *x_hot, int *y_hot)
{
Pixmap bitmap;
int status;
diff --git a/xsetroot.man b/xsetroot.man
index 145b34c..a57eff6 100644
--- a/xsetroot.man
+++ b/xsetroot.man
@@ -22,7 +22,10 @@
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
-.TH XSETROOT 1 "Release 6.4" "X Version 11"
+.\"
+.\" $XFree86: xc/programs/xsetroot/xsetroot.man,v 1.8 2001/12/14 20:02:23 dawes Exp $
+.\"
+.TH XSETROOT 1 __xorgversion__
.SH NAME
xsetroot \- root window parameter setting utility for X
.SH SYNOPSIS
@@ -102,8 +105,8 @@ Usually a name is assigned to a window so that the
window manager can use a text representation when the window is iconified.
This option is unused since you can't iconify the background.
.IP "\fB-display\fP \fIdisplay\fP"
-Specifies the server to connect to; see \fIX(1)\fP.
+Specifies the server to connect to; see \fIX(__miscmansuffix__)\fP.
.SH "SEE ALSO"
-X(1), xset(1), xrdb(1)
+X(__miscmansuffix__), xset(1), xrdb(1)
.SH AUTHOR
Mark Lillibridge, MIT Project Athena