summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2008-09-25 00:47:18 +0200
committerKristian Lyngstol <kristian@nihilus.(none)>2008-09-25 00:47:18 +0200
commit5940cf7c91d5927fc681dea4f73a1591b44cb0bc (patch)
tree2db5baeded61b4feab15ed943721b07b34f23eef
parentdc577807ace5f7fd517e4870efad635e0d96f616 (diff)
downloadpink-elephants-repo-5940cf7c91d5927fc681dea4f73a1591b44cb0bc.tar.gz
pink-elephants-repo-5940cf7c91d5927fc681dea4f73a1591b44cb0bc.tar.bz2
CleanupHEADmaster
-rw-r--r--xineramainfo/xgetxineramainfo.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/xineramainfo/xgetxineramainfo.c b/xineramainfo/xgetxineramainfo.c
index c22a2b7..0b80e1d 100644
--- a/xineramainfo/xgetxineramainfo.c
+++ b/xineramainfo/xgetxineramainfo.c
@@ -2,38 +2,42 @@
*
* GNU GPLv2 goes here.
*
- * Tiny utility app to fetch xinerama info.
+ * Tiny utility app to fetch xinerama info. Maybe some day I'll make it
+ * actually helpful.
*
- * Coding style per compiz... Please don't hurt me.
*/
#include <stdio.h>
-#include <X11/extensions/Xinerama.h>
-#include <X11/Xlib.h>
#include <stdlib.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/Xinerama.h>
+
int xineramaEvent, xineramaError;
int majorVersion, minorVersion;
Display *dpy;
XineramaScreenInfo *screenInfo;
int nScreenInfo;
+
void bail(char *str)
{
perror ("The flux capacitor is broken! Bailing!");
perror (str);
exit (1);
}
+
void verbose (char *str)
{
printf (str);
}
+
void printVersion ()
{
Status ret;
ret = XineramaQueryVersion (dpy, &majorVersion, &minorVersion);
printf ("Xinerama version: %d.%d\n", majorVersion,minorVersion);
if (!ret)
- bail ("Incompatible xinerama version. XineramaQueryVersion failed!");
-
+ bail ("Incompatible xinerama version. XineramaQueryVersion "\
+ "false.");
}
int main (int argc, char **argv)
@@ -41,7 +45,7 @@ int main (int argc, char **argv)
Bool ret;
dpy = XOpenDisplay (0);
if (!dpy)
- bail ("Couldn't open display. OH WOE IS ME.");
+ bail ("Couldn't open display.");
ret = XineramaQueryExtension (dpy, &xineramaEvent, &xineramaError);
if (!ret)
@@ -52,7 +56,7 @@ int main (int argc, char **argv)
screenInfo = XineramaQueryScreens (dpy, &nScreenInfo);
int i;
if (nScreenInfo == 0)
- verbose ("Only 0 heads? HELP THIS DOES NOT MAKE SENSE. I think. right.\n");
+ verbose ("nScreenInfo == 0. No screen info found.\n");
printf ("Screen\tx_org\ty_org\twidth\theight\n");
for (i = 0; i < nScreenInfo; i++)
printf ("%d\t%d\t%d\t%d\t%d\n",
@@ -61,7 +65,6 @@ int main (int argc, char **argv)
screenInfo[i].y_org,
screenInfo[i].width,
screenInfo[i].height);
- verbose ("Gee, that's all. Thanks for tuning in.\n");
+ verbose ("Done.\n");
return 0;
-
}