To get slist working with both GCC and Sun Studio compiler, different
namespaces for slist, Sun Studio requires -stlport4 to get slit at all
and with -stlport4 compile flag things become much more strict.
This commit should sort that out together with required autoconf magic.
| src/Completer.cc | |
| 19 | @@ -19,6 +19,7 @@ |
| 19 | extern "C" { |
| 20 | #include <sys/types.h> |
| 21 | #include <dirent.h> |
| 22 | #include <stdlib.h> |
| 23 | } |
| 24 | |
| 25 | #include "Completer.hh" |
| ... | |
| src/Observable.cc | |
| 1 | @@ -0,0 +1,50 @@ |
| 1 | // |
| 2 | // Observable.cc for pekwm |
| 3 | // Copyright © 2009 Claes Nästen <me@pekdon.net> |
| 4 | // |
| 5 | // This program is licensed under the GNU GPL. |
| 6 | // See the LICENSE file for more information. |
| 7 | // |
| 8 | |
| 9 | #ifdef HAVE_CONFIG_H |
| 10 | #include "config.h" |
| 11 | #endif // HAVE_CONFIG_H |
| 12 | |
| 13 | #include "Observer.hh" |
| 14 | #include "Observable.hh" |
| 15 | |
| 16 | using SLIST_NAMESPACE::slist; |
| 17 | |
| 18 | /** |
| 19 | * Notify all observers. |
| 20 | */ |
| 21 | void |
| 22 | Observable::notifyObservers(void) |
| 23 | { |
| 24 | if (_observers.size()) { |
| 25 | slist<Observer*>::iterator it(_observers.begin()); |
| 26 | for (; it != _observers.end(); ++it) { |
| 27 | (*it)->notify(this); |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Add observer. |
| 34 | */ |
| 35 | void |
| 36 | Observable::addObserver(Observer *observer) |
| 37 | { |
| 38 | _observers.push_front(observer); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Remove observer from list. |
| 43 | */ |
| 44 | void |
| 45 | Observable::removeObserver(Observer *observer) |
| 46 | { |
| 47 | if (_observers.size()) { |
| 48 | _observers.remove(observer); |
| 49 | } |
| 50 | } |
| ... | |
| src/Observable.hh | |
| 1 | @@ -0,0 +1,34 @@ |
| 1 | // |
| 2 | // Observable.hh for pekwm |
| 3 | // Copyright © 2009 Claes Nästen <me@pekdon.net> |
| 4 | // |
| 5 | // This program is licensed under the GNU GPL. |
| 6 | // See the LICENSE file for more information. |
| 7 | // |
| 8 | |
| 9 | #ifndef _OBSERVABLE_HH_ |
| 10 | #define _OBSERVABLE_HH_ |
| 11 | |
| 12 | #ifdef HAVE_SLIST |
| 13 | #include <slist> |
| 14 | #else // HAVE_EXT_SLIST |
| 15 | #include <ext/slist> |
| 16 | #endif // HAVE_SLIST |
| 17 | |
| 18 | class Observer; |
| 19 | |
| 20 | class Observable { |
| 21 | public: |
| 22 | Observable(void) { } |
| 23 | virtual ~Observable(void) { } |
| 24 | |
| 25 | void notifyObservers(void); |
| 26 | |
| 27 | void addObserver(Observer *observer); |
| 28 | void removeObserver(Observer *observer); |
| 29 | |
| 30 | private: |
| 31 | SLIST_NAMESPACE::slist<Observer*> _observers; /**< List of observers. */ |
| 32 | }; |
| 33 | |
| 34 | #endif // _OBSERVABLE_HH_ |
| ... | |
| configure.ac | |
| 18 | @@ -18,6 +18,14 @@ |
| 18 | dnl scripts it seems. |
| 19 | AC_CHECK_PROG([SH], [sh], [/usr/xpg4/bin/sh], [/bin/sh], [/usr/xpg4/bin]) |
| 20 | |
| 21 | dnl Check for sun studio compiler and add -library=stlport4 compiler flag |
| 22 | dnl to make slist etc available. |
| 23 | AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no]) |
| 24 | if test "x$SUNCC" = "xyes"; then |
| 25 | CPPFLAGS="$CPPFLAGS -library=stlport4" |
| 26 | CXXFLAGS="$CXXFLAGS -library=stlport4" |
| 27 | fi |
| 28 | |
| 29 | dnl Check for iconv |
| 30 | AM_ICONV |
| 31 | if test "x$am_cv_func_iconv" != "xyes"; then |
| ... | |
| 224 | @@ -216,7 +224,34 @@ |
| 224 | |
| 225 | dnl Check for header files |
| 226 | AC_STDC_HEADERS |
| 219 | AC_CHECK_HEADERS([limits]) |
| 228 | AC_CHECK_HEADERS([limits slist ext/slist]) |
| 229 | |
| 230 | dnl Check that at least one of slist or ext/slist exists |
| 231 | if test "x$av_cv_header_slist" = "xno" \ |
| 232 | && test "x$av_cv_header_ext_slist" = "xno"; then |
| 233 | AC_MSG_ERROR([Could not find slist or ext/slist include.]) |
| 234 | fi |
| 235 | |
| 236 | dnl Detect namespace slist is available in |
| 237 | AC_TRY_COMPILE([ |
| 238 | #ifdef HAVE_SLIST |
| 239 | #include <slist> |
| 240 | #else // HAVE_EXT_SLIST |
| 241 | #include <ext/slist> |
| 242 | #endif // HAVE_SLIST |
| 243 | ],[std::slist<int> test;], |
| 244 | AC_DEFINE(SLIST_NAMESPACE, [std], [Name of namespace slist is in]) |
| 245 | slist_std_namespace=yes, []) |
| 246 | if test "x$slist_std_namespace" != "xyes"; then |
| 247 | AC_TRY_COMPILE([ |
| 248 | #ifdef HAVE_SLIST |
| 249 | #include <slist> |
| 250 | #else // HAVE_EXT_SLIST |
| 251 | #include <ext/slist> |
| 252 | #endif // HAVE_SLIST |
| 253 | ],[__gnu_cxx::slist<int> test;], |
| 254 | AC_DEFINE(SLIST_NAMESPACE, [__gnu_cxx], [Name of namespace slist is in]), []) |
| 255 | fi |
| 256 | |
| 257 | dnl Check for library functions |
| 258 | AC_CHECK_FUNC(setenv, [AC_DEFINE(HAVE_SETENV, [1], [Define to 1 if you the setenv systam call])], ) |
| ... | |
| src/TextureHandler.hh | |
| 1 | @@ -1,22 +1,28 @@ |
| 1 | // |
| 2 | // TextureHandler.hh for pekwm |
| 3 | // Copyright (C) 2009 Claes Nasten <pekdon{@}pekdon{.}net> |
| 4 | // Copyright © 2005 Claes Nästén <me@pekdon.net> |
| 5 | // |
| 6 | // This program is licensed under the GNU GPL. |
| 7 | // See the LICENSE file for more information. |
| 8 | // |
| 9 | |
| 10 | #include "../config.h" |
| 11 | |
| 12 | #ifndef _TEXTURE_HANDLER_HH_ |
| 13 | #define _TEXTURE_HANDLER_HH_ |
| 14 | |
| 15 | #ifdef HAVE_CONFIG_H |
| 16 | #include "config.h" |
| 17 | #endif // HAVE_CONFIG_H |
| 18 | |
| 19 | #include "ParseUtil.hh" |
| 20 | |
| 21 | #include <string> |
| 22 | #include <list> |
| 23 | #include <vector> |
| 24 | |
| 25 | extern "C" { |
| 26 | #include <string.h> |
| 27 | } |
| 28 | |
| 29 | class PTexture; |
| 30 | |
| 31 | class TextureHandler { |
| ... | |
| 40 | @@ -34,7 +40,7 @@ |
| 40 | } |
| 41 | |
| 42 | inline bool operator==(const std::string &name) { |
| 37 | return (strcasecmp(_name.c_str(), name.c_str()) == 0); |
| 44 | return (::strcasecmp(_name.c_str(), name.c_str()) == 0); |
| 45 | } |
| 46 | |
| 47 | private: |
| ... | |
| src/AutoProperties.cc | |
| 25 | @@ -25,6 +25,7 @@ |
| 25 | using std::map; |
| 26 | using std::string; |
| 27 | using std::vector; |
| 28 | using std::strtol; |
| 29 | |
| 30 | AutoProperties *AutoProperties::_instance = 0; |
| 31 | |
| ... | |
| src/Compat.cc | |
| 36 | @@ -36,35 +36,37 @@ |
| 36 | * @param ... Formatting arguments. |
| 37 | * @return Number of characters written or -1 on error. |
| 38 | */ |
| 39 | int |
| 40 | swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...) |
| 41 | { |
| 42 | size_t len; |
| 43 | string mb_format(Util::to_mb_str(format)); |
| 44 | namespace std { |
| 45 | int |
| 46 | swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...) |
| 47 | { |
| 48 | size_t len; |
| 49 | string mb_format(Util::to_mb_str(format)); |
| 50 | |
| 51 | // Look for wide string formatting, not yet implemented. |
| 52 | if (mb_format.find("%ls") != string::npos) { |
| 53 | len = std::min(wcslen(SWPRINTF_LS_NOT_SUPPORTED), maxlen - 1); |
| 54 | wmemcpy(wcs, SWPRINTF_LS_NOT_SUPPORTED, len); |
| 55 | } else { |
| 56 | char *res = new char[maxlen]; |
| 57 | // Look for wide string formatting, not yet implemented. |
| 58 | if (mb_format.find("%ls") != string::npos) { |
| 59 | len = std::min(wcslen(SWPRINTF_LS_NOT_SUPPORTED), maxlen - 1); |
| 60 | wmemcpy(wcs, SWPRINTF_LS_NOT_SUPPORTED, len); |
| 61 | } else { |
| 62 | char *res = new char[maxlen]; |
| 63 | |
| 64 | va_list ap; |
| 65 | va_start(ap, format); |
| 66 | vsnprintf(res, maxlen, mb_format.c_str(), ap); |
| 67 | va_end(ap); |
| 68 | va_list ap; |
| 69 | va_start(ap, format); |
| 70 | vsnprintf(res, maxlen, mb_format.c_str(), ap); |
| 71 | va_end(ap); |
| 72 | |
| 73 | wstring w_res(Util::to_wide_str(res)); |
| 74 | len = std::min(maxlen - 1, w_res.size()); |
| 75 | wmemcpy(wcs, w_res.c_str(), len); |
| 76 | wstring w_res(Util::to_wide_str(res)); |
| 77 | len = std::min(maxlen - 1, w_res.size()); |
| 78 | wmemcpy(wcs, w_res.c_str(), len); |
| 79 | |
| 80 | delete [] res; |
| 81 | } |
| 82 | delete [] res; |
| 83 | } |
| 84 | |
| 85 | // Null terminate and return result. |
| 86 | wcs[len] = L'\0'; |
| 87 | // Null terminate and return result. |
| 88 | wcs[len] = L'\0'; |
| 89 | |
| 90 | return wcslen(wcs); |
| 91 | return wcslen(wcs); |
| 92 | } |
| 93 | } |
| 94 | #endif // HAVE_SWPRINTF |
| 95 | |
| ... | |
| src/Compat.hh | |
| 17 | @@ -17,10 +17,16 @@ |
| 17 | #include <cstddef> |
| 18 | |
| 19 | #ifndef HAVE_SWPRINTF |
| 20 | int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); |
| 21 | namespace std { |
| 22 | int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); |
| 23 | } |
| 24 | #endif // HAVE_SWPRINTF |
| 25 | |
| 26 | #ifndef HAVE_SETENV |
| 27 | #ifdef HAVE_SETENV |
| 28 | extern "C" { |
| 29 | #include <stdlib.h> |
| 30 | } |
| 31 | #else // ! HAVE_SETENV |
| 32 | int setenv(const char *name, const char *value, int overwrite); |
| 33 | #endif // HAVE_SETENV |
| 34 | |
| ... | |
| src/Config.cc | |
| 37 | @@ -37,6 +37,8 @@ |
| 37 | using std::pair; |
| 38 | using std::ifstream; |
| 39 | using std::ofstream; |
| 40 | using std::strtol; |
| 41 | using std::getenv; |
| 42 | |
| 43 | Config* Config::_instance = 0; |
| 44 | |
| ... | |
| src/Frame.cc | |
| 12 | @@ -12,6 +12,7 @@ |
| 12 | |
| 13 | #include <algorithm> |
| 14 | #include <cstdio> |
| 15 | #include <cwchar> |
| 16 | #include <functional> |
| 17 | #include <iostream> |
| 18 | |
| ... | |
| 50 | @@ -49,6 +50,7 @@ |
| 50 | using std::string; |
| 51 | using std::vector; |
| 52 | using std::wstring; |
| 53 | using std::swprintf; |
| 54 | |
| 55 | list<Frame*> Frame::_frame_list = list<Frame*>(); |
| 56 | vector<uint> Frame::_frameid_list = vector<uint>(); |
| ... | |
| src/RegexString.cc | |
| 21 | @@ -21,6 +21,7 @@ |
| 21 | using std::list; |
| 22 | using std::string; |
| 23 | using std::wstring; |
| 24 | using std::strtol; |
| 25 | |
| 26 | const char RegexString::SEPARATOR = '/'; |
| 27 | |
| ... | |
| src/Util.cc | |
| 19 | @@ -19,6 +19,9 @@ |
| 19 | #include <sstream> |
| 20 | #include <fstream> |
| 21 | #include <list> |
| 22 | #include <cstdio> |
| 23 | #include <cstring> |
| 24 | #include <cwchar> |
| 25 | |
| 26 | extern "C" { |
| 27 | #include <iconv.h> |
| ... | |
| 29 | @@ -26,13 +29,8 @@ |
| 29 | #include <sys/stat.h> |
| 30 | #include <sys/types.h> |
| 31 | #include <pwd.h> |
| 29 | } |
| 30 | |
| 31 | #ifndef HAVE_SETENV |
| 32 | #include <cstdio> |
| 33 | #include <cstring> |
| 37 | #include <errno.h> |
| 35 | #endif // HAVE_SETENV |
| 39 | } |
| 40 | |
| 41 | #include "Util.hh" |
| 42 | |
| ... | |
| 46 | @@ -48,6 +46,11 @@ |
| 46 | using std::ofstream; |
| 47 | using std::find; |
| 48 | using std::map; |
| 49 | using std::getenv; |
| 50 | using std::wcstombs; |
| 51 | using std::wmemset; |
| 52 | using std::mbstowcs; |
| 53 | using std::exit; |
| 54 | |
| 55 | namespace Util { |
| 56 | |
| ... | |
| src/Util.hh | |
| 24 | @@ -24,6 +24,10 @@ |
| 24 | #include <functional> |
| 25 | #include <sstream> |
| 26 | |
| 27 | extern "C" { |
| 28 | #include <string.h> |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * String utilities, convenience functions for making life easier |
| 33 | * when working with strings. |
| ... | |
| 118 | @@ -114,7 +118,7 @@ |
| 118 | inline bool isTrue(const std::string &value) { |
| 119 | if (value.size() > 0) { |
| 120 | if ((value[0] == '1') // check for 1 / 0 |
| 117 | || ! strncasecmp(value.c_str(), "TRUE", 4)) { |
| 122 | || ! ::strncasecmp(value.c_str(), "TRUE", 4)) { |
| 123 | return true; |
| 124 | } |
| 125 | } |
| ... | |
| src/Action.hh | |
| 152 | @@ -152,7 +152,7 @@ |
| 152 | |
| 153 | Action(uint action, int param_i[3]) : _action(action) |
| 154 | { |
| 155 | ::memcpy(_param_i, param_i, sizeof(param_i)); |
| 156 | std::memcpy(_param_i, param_i, sizeof(param_i)); |
| 157 | } |
| 158 | Action(uint action, const std::string ¶m_s) |
| 159 | : _action(action), _param_s(param_s) |
| ... | |
| src/ColorHandler.hh | |
| 1 | @@ -1,6 +1,6 @@ |
| 1 | // |
| 2 | // ColorHandler.hh for pekwm |
| 3 | // Copyright © 2004-2009 Claes Nasten <me{@}pekdon{.}net> |
| 4 | // Copyright © 2004-2009 Claes Nästén <me@pekdon.net> |
| 5 | // |
| 6 | // This program is licensed under the GNU GPL. |
| 7 | // See the LICENSE file for more information. |
| ... | |
| 19 | @@ -19,6 +19,10 @@ |
| 19 | #include <string> |
| 20 | #include <cstring> |
| 21 | |
| 22 | extern "C" { |
| 23 | #include <string.h> |
| 24 | } |
| 25 | |
| 26 | class ColorHandler { |
| 27 | public: |
| 28 | class Entry { |
| ... | |
| 38 | @@ -34,7 +38,7 @@ |
| 38 | } |
| 39 | |
| 40 | inline bool operator==(const std::string &name) { |
| 37 | return (strcasecmp(_name.c_str(), name.c_str()) == 0); |
| 42 | return (::strcasecmp(_name.c_str(), name.c_str()) == 0); |
| 43 | } |
| 44 | |
| 45 | private: |
| ... | |
| src/Observer.hh | |
| 1 | @@ -0,0 +1,26 @@ |
| 1 | // |
| 2 | // Observer.hh for pekwm |
| 3 | // Copyright © 2009 Claes Nästén <me@pekdon.net> |
| 4 | // |
| 5 | // This program is licensed under the GNU GPL. |
| 6 | // See the LICENSE file for more information. |
| 7 | // |
| 8 | |
| 9 | #ifndef _OBSERVER_HH_ |
| 10 | #define _OBSERVER_HH_ |
| 11 | |
| 12 | #ifdef HAVE_CONFIG_H |
| 13 | #include "config.h" |
| 14 | #endif // HAVE_CONFIG_H |
| 15 | |
| 16 | class Observable; |
| 17 | |
| 18 | class Observer { |
| 19 | public: |
| 20 | Observer(void) { } |
| 21 | virtual ~Observer(void) { } |
| 22 | |
| 23 | virtual void notify(Observable *observable) { } |
| 24 | }; |
| 25 | |
| 26 | #endif // _OBSERVER_HH_ |
| ... | |
| src/CfgParserSource.cc | |
| 1 | @@ -1,5 +1,5 @@ |
| 1 | // |
| 2 | // Copyright © 2005-2009 Claes Nasten <me{@}pekdon{.}net> |
| 3 | // Copyright © 2005-2009 Claes Nästén <me@pekdon.net> |
| 4 | // |
| 5 | // This program is licensed under the GNU GPL. |
| 6 | // See the LICENSE file for more information. |
| ... | |
| 13 | @@ -13,15 +13,20 @@ |
| 13 | #include "Util.hh" |
| 14 | |
| 15 | #include <iostream> |
| 16 | #include <cstdio> |
| 17 | #include <cstdlib> |
| 18 | |
| 19 | extern "C" { |
| 20 | #include <stdio.h> |
| 21 | #include <unistd.h> |
| 22 | } |
| 23 | |
| 24 | using std::cerr; |
| 25 | using std::endl; |
| 26 | using std::string; |
| 27 | using std::fopen; |
| 28 | using std::fclose; |
| 29 | using std::exit; |
| 30 | |
| 31 | unsigned int CfgParserSourceCommand::_sigaction_counter = 0; |
| 32 | |
| ... | |
| 110 | @@ -105,7 +110,7 @@ |
| 110 | |
| 111 | ::close (fd[1]); |
| 112 | |
| 108 | _file = fdopen(fd[0], "r"); |
| 114 | _file = ::fdopen(fd[0], "r"); |
| 115 | } |
| 116 | return true; |
| 117 | } |
| ... | |
| src/CfgParserSource.hh | |
| 43 | @@ -43,7 +43,7 @@ |
| 43 | * Gets a character from _file, increments line count if \n. |
| 44 | */ |
| 45 | inline int getc(void) { |
| 46 | int c = fgetc(_file); |
| 47 | int c = std::fgetc(_file); |
| 48 | if (c == '\n') { |
| 49 | ++_line; |
| 50 | } |
| ... | |
| 54 | @@ -54,7 +54,7 @@ |
| 54 | * Returns a character to _op_file, decrements line count if \n. |
| 55 | */ |
| 56 | inline void ungetc(int c) { |
| 57 | ::ungetc(c, _file); |
| 58 | std::ungetc(c, _file); |
| 59 | if (c == '\n') { |
| 60 | --_line; |
| 61 | } |
| ... | |
| 73 | @@ -73,7 +73,7 @@ |
| 73 | virtual void close(void) throw (std::string&) { } |
| 74 | |
| 75 | protected: |
| 76 | FILE *_file; /**< FILE object source is reading from. */ |
| 77 | std::FILE *_file; /**< FILE object source is reading from. */ |
| 78 | const std::string &_name; /**< Name of source. */ |
| 79 | CfgParserSource::Type _type; /**< Type of source. */ |
| 80 | unsigned int _line; /**< Line number. */ |
| ... | |
| src/PDecor.cc | |
| 49 | @@ -49,6 +49,7 @@ |
| 49 | using std::mem_fun; |
| 50 | using std::string; |
| 51 | using std::vector; |
| 52 | using std::swprintf; |
| 53 | |
| 54 | // PDecor::Button |
| 55 | |
| ... | |
| src/PImageLoaderPng.hh | |
| 20 | @@ -20,7 +20,9 @@ |
| 20 | |
| 21 | #include <cstdio> |
| 22 | |
| 23 | //! @brief PNG Loader class. |
| 24 | /** |
| 25 | * PNG Loader class. |
| 26 | */ |
| 27 | class PImageLoaderPng : public PImageLoader |
| 28 | { |
| 29 | public: |
| ... | |
| 33 | @@ -31,7 +33,7 @@ |
| 33 | bool &alpha, bool &use_alpha); |
| 34 | |
| 35 | private: |
| 34 | bool checkSignature(FILE *fp); |
| 37 | bool checkSignature(std::FILE *fp); |
| 38 | |
| 39 | static const int PNG_SIG_BYTES; |
| 40 | }; |
| ... | |
| src/PImageLoaderXpm.cc | |
| 22 | @@ -22,6 +22,8 @@ |
| 22 | using std::cerr; |
| 23 | using std::endl; |
| 24 | using std::string; |
| 25 | using std::sscanf; |
| 26 | using std::strlen; |
| 27 | |
| 28 | const uint PImageLoaderXpm::CHANNELS = 4; |
| 29 | const uint PImageLoaderXpm::ALPHA_SOLID = 255; |
| ... | |
| src/ParseUtil.hh | |
| 1 | @@ -1,20 +1,26 @@ |
| 1 | // |
| 2 | // ParseUtil.hh for pekwm |
| 3 | // Copyright (C) 2004-2009 Claes Nasten <pekdon{@}pekdon{.}net> |
| 4 | // Copyright © 2004-2009 Claes Nästén <me@pekdon.net> |
| 5 | // |
| 6 | // This program is licensed under the GNU GPL. |
| 7 | // See the LICENSE file for more information. |
| 8 | // |
| 9 | |
| 10 | #include "../config.h" |
| 11 | |
| 12 | #ifndef _PARSE_UTIL_HH_ |
| 13 | #define _PARSE_UTIL_HH_ |
| 14 | |
| 15 | #ifdef HAVE_CONFIG_H |
| 16 | #include "config.h" |
| 17 | #endif // HAVE_CONFIG_H |
| 18 | |
| 19 | #include <map> |
| 20 | #include <string> |
| 21 | #include <cstring> |
| 22 | |
| 23 | extern "C" { |
| 24 | #include <string.h> |
| 25 | } |
| 26 | |
| 27 | namespace ParseUtil { |
| 28 | |
| 29 | class Entry { |
| ... | |
| src/FrameListMenu.cc | |
| 14 | @@ -14,6 +14,7 @@ |
| 14 | |
| 15 | #include <algorithm> |
| 16 | #include <cstdio> |
| 17 | #include <cwchar> |
| 18 | #include <iostream> |
| 19 | |
| 20 | #include "Compat.hh" |
| ... | |
| 36 | @@ -35,6 +36,7 @@ |
| 36 | using std::string; |
| 37 | using std::vector; |
| 38 | using std::wstring; |
| 39 | using std::swprintf; |
| 40 | |
| 41 | //! @brief FrameListMenu constructor. |
| 42 | //! @param scr Pointer to PScreen. |
| ... | |
| 73 | @@ -71,7 +73,9 @@ |
| 73 | |
| 74 | // END - PWinObj interface. |
| 75 | |
| 74 | //! @brief |
| 77 | /** |
| 78 | * Execute item execution. |
| 79 | */ |
| 80 | void |
| 81 | FrameListMenu::handleItemExec(PMenu::Item *item) |
| 82 | { |
| ... | |
| 83 | @@ -79,29 +83,25 @@ |
| 83 | return; |
| 84 | } |
| 85 | |
| 82 | if (! PWinObj::windowObjectExists(_wo_ref)) { |
| 83 | _wo_ref = 0; |
| 84 | } |
| 85 | if (! PWinObj::windowObjectExists(item->getWORef())) { |
| 86 | item->setWORef(0); |
| 87 | } |
| 88 | |
| 93 | Client *item_client = dynamic_cast<Client*>(item->getWORef()); |
| 94 | Client *wo_ref_client = dynamic_cast<Client*>(getWORef()); |
| 95 | |
| 96 | switch (_menu_type) { |
| 97 | case GOTOMENU_TYPE: |
| 98 | case GOTOCLIENTMENU_TYPE: |
| 95 | handleGotomenu(dynamic_cast<Client*>(item->getWORef())); |
| 100 | handleGotomenu(item_client); |
| 101 | break; |
| 102 | case ICONMENU_TYPE: |
| 99 | handleIconmenu(dynamic_cast<Client*>(item->getWORef())); |
| 104 | handleIconmenu(item_client); |
| 105 | break; |
| 106 | case ATTACH_CLIENT_TYPE: |
| 107 | case ATTACH_FRAME_TYPE: |
| 104 | handleAttach(dynamic_cast<Client*>(_wo_ref), dynamic_cast<Client*>(item->getWORef()), |
| 109 | handleAttach(wo_ref_client, item_client, |
| 110 | (_menu_type == ATTACH_FRAME_TYPE)); |
| 111 | break; |
| 112 | case ATTACH_CLIENT_IN_FRAME_TYPE: |
| 113 | case ATTACH_FRAME_IN_FRAME_TYPE: |
| 110 | handleAttach(dynamic_cast<Client*>(item->getWORef()), dynamic_cast<Client*>(_wo_ref), |
| 115 | handleAttach(item_client, wo_ref_client, |
| 116 | (_menu_type == ATTACH_FRAME_IN_FRAME_TYPE)); |
| 117 | break; |
| 118 | default: |
| ... | |
| 147 | @@ -147,7 +147,7 @@ |
| 147 | if (((*it)->getWorkspace() == i) && // sort by workspace |
| 148 | // don't include ourselves if we're not doing a gotoclient menu |
| 149 | ((_menu_type != GOTOCLIENTMENU_TYPE) |
| 150 | ? ((*it)->getActiveChild() != _wo_ref) |
| 151 | ? ((*it)->getActiveChild() != getWORef()) |
| 152 | : true) && |
| 153 | (show_iconified_only |
| 154 | ? (*it)->isIconified() |
| ... | |
| src/InputDialog.cc | |
| 11 | @@ -11,6 +11,8 @@ |
| 11 | #endif // HAVE_CONFIG_H |
| 12 | |
| 13 | #include <list> |
| 14 | #include <cwchar> |
| 15 | #include <cwctype> |
| 16 | |
| 17 | #include "InputDialog.hh" |
| 18 | #include "KeyGrabber.hh" |
| ... | |
| 27 | @@ -25,15 +27,15 @@ |
| 27 | |
| 28 | using std::list; |
| 29 | using std::wstring; |
| 30 | using std::iswprint; |
| 31 | |
| 32 | /** |
| 33 | * InputDialog constructor. |
| 34 | */ |
| 35 | InputDialog::InputDialog(Display *dpy, Theme *theme, const std::wstring &title) |
| 34 | : PDecor(dpy, theme, "INPUTDIALOG"), |
| 35 | _data(theme->getCmdDialogData()), |
| 36 | _pixmap_bg(None), _pos(0), _buf_off(0), _buf_chars(0), |
| 37 | _wo_ref(0) |
| 40 | : PDecor(dpy, theme, "INPUTDIALOG"), PWinObjReference(0), |
| 41 | _data(theme->getCmdDialogData()), |
| 42 | _pixmap_bg(None), _pos(0), _buf_off(0), _buf_chars(0) |
| 43 | { |
| 44 | // PWinObj attributes |
| 45 | _layer = LAYER_NONE; // hack, goes over LAYER_MENU |
| ... | |
| src/PImageLoaderJpeg.cc | |
| 17 | @@ -17,6 +17,7 @@ |
| 17 | #include <iostream> |
| 18 | |
| 19 | extern "C" { |
| 20 | #include <stdio.h> |
| 21 | #include <jpeglib.h> |
| 22 | } |
| 23 | |
| ... | |
| src/PScreen.cc | |
| 1 | @@ -1,6 +1,6 @@ |
| 1 | // |
| 2 | // PScreen.cc for pekwm |
| 3 | // Copyright © 2003-2009 Claes Nästén <me{@}pekdon{.}net> |
| 4 | // Copyright © 2003-2009 Claes Nästén <me@pekdon.net> |
| 5 | // |
| 6 | // This program is licensed under the GNU GPL. |
| 7 | // See the LICENSE file for more information. |
| ... | |
| 13 | @@ -13,6 +13,7 @@ |
| 13 | #include <string> |
| 14 | #include <iostream> |
| 15 | #include <cassert> |
| 16 | #include <cstring> // required for memset in FD_ZERO |
| 17 | |
| 18 | #ifdef HAVE_LIMITS |
| 19 | #include <limits> |
| ... | |
| 50 | @@ -49,6 +50,7 @@ |
| 50 | using std::list; |
| 51 | using std::map; |
| 52 | using std::string; |
| 53 | using std::memset; // required for FD_ZERO |
| 54 | |
| 55 | const uint PScreen::MODIFIER_TO_MASK[] = { |
| 56 | ShiftMask, LockMask, ControlMask, |
| ... | |