]> Dogcows Code - chaz/openbox/blobdiff - util/xftlsfonts.cc
modified focus() to accept a no-raise parameter
[chaz/openbox] / util / xftlsfonts.cc
index 0651065bbd6096d6feaed4101d48fe3b347c3005..94e47d5df708f48fc3bb2af9deb028398817b1a1 100644 (file)
@@ -1,3 +1,22 @@
+const char *NAME = "xftlsfonts";
+const char *VERSION = "1.0";
+
+#ifdef    HAVE_CONFIG_H
+#include "../config.h"
+#endif // HAVE_CONFIG_H
+
+#ifndef   XFT
+#include <iostream>
+
+int main(int, char **) {
+  cout << NAME << " version " << VERSION << endl;
+  cout << "Copyright (c) 2002, Ben Jansens <ben@orodu.net>" << endl;
+  cout << endl;
+  cout << "Openbox was built without support for Xft fonts. This utility must"
+    << endl;
+  cout << "must be built with Xft support in order to function." << endl;
+}
+#else  // XFT
 extern "C" {
 #include <X11/Xlib.h>
 #include <X11/Xft/Xft.h>
@@ -7,9 +26,6 @@ extern "C" {
 #include <string>
 #include <vector>
 
-const char *NAME = "xftlsfonts";
-const char *VERSION = "1.0";
-
 using std::string;
 using std::cout;
 using std::endl;
@@ -34,11 +50,15 @@ int main(int argc, char **argv) {
       }
 
   Display *display = XOpenDisplay(NULL);
+  if (! display) {
+    cout << "Failed to open connection to X display\n";
+    return 2;
+  }
 
   XftObjectSet *obj = XftObjectSetCreate();
   if (! obj) {
     cout << "Failed to create an XftObjectSet\n";
-    exit(2);
+    return 2;
   }
 
   XftObjectSetAdd(obj, XFT_FAMILY);
@@ -125,3 +145,5 @@ int main(int argc, char **argv) {
   XCloseDisplay(display);
   return 0;
 }
+#endif // XFT
+
This page took 0.023268 seconds and 4 git commands to generate.