X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Futil.cc;h=03df393e40139d5a45052599b1801631ed412b87;hb=838f76cd216aaadce186ab5dd4302845d89dd2f8;hp=a3ec0034ac35e9105d1a8a1a6086303c3e52f9ea;hpb=e8f5cf2940667a60698d28fe0cae208792357676;p=chaz%2Fopenbox diff --git a/otk/util.cc b/otk/util.cc index a3ec0034..03df393e 100644 --- a/otk/util.cc +++ b/otk/util.cc @@ -1,35 +1,29 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif // HAVE_CONFIG_H +#include "config.h" extern "C" { #include -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - #ifdef HAVE_UNISTD_H #include #endif // HAVE_UNISTD_H -#if defined(HAVE_PROCESS_H) && defined(__EMX__) -# include -#endif // HAVE_PROCESS_H __EMX__ +// this is not checked in configure anymore!! +//#if defined(HAVE_PROCESS_H) && defined(__EMX__) +//# include +//#endif // HAVE_PROCESS_H __EMX__ -#include "gettext.h" +#include "../src/gettext.h" #define _(str) gettext(str) -#include } #include +#include +#include +#include +#include #include "util.hh" @@ -48,40 +42,16 @@ string expandTilde(const string& s) { void bexec(const string& command, const string& displaystring) { -#ifndef __EMX__ +//#ifndef __EMX__ if (! fork()) { setsid(); putenv(displaystring); int ret = execl("/bin/sh", "/bin/sh", "-c", command.c_str(), NULL); exit(ret); } -#else // __EMX__ - spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", command.c_str(), NULL); -#endif // !__EMX__ -} - - -string textPropertyToString(Display *display, XTextProperty& text_prop) { - string ret; - - if (text_prop.value && text_prop.nitems > 0) { - if (text_prop.encoding == XA_STRING) { - ret = (char *) text_prop.value; - } else { - text_prop.nitems = strlen((char *) text_prop.value); - - char **list; - int num; - if (XmbTextPropertyToTextList(display, &text_prop, - &list, &num) == Success && - num > 0 && *list) { - ret = *list; - XFreeStringList(list); - } - } - } - - return ret; +//#else // __EMX__ +// spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", command.c_str(), NULL); +//#endif // !__EMX__ }