|
|
|
|
|
|
|
|
|
|
|
|||||||
00001 /* 00002 * File: winstl_window_functionals.h 00003 * 00004 * Purpose: Window specific functionals. 00005 * 00006 * Created: 19th January 2001 00007 * Updated: 11th September 2004 00008 * 00009 * Home: http://stlsoft.org/ 00010 * 00011 * Copyright (c) 2001-2004, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are met: 00016 * 00017 * - Redistributions of source code must retain the above copyright notice, this 00018 * list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00023 * any contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00029 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00030 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00031 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00032 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00033 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00034 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00035 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * 00039 00040 00044 00045 #ifndef WINSTL_INCL_H_WINSTL_WINDOW_FUNCTIONALS 00046 #define WINSTL_INCL_H_WINSTL_WINDOW_FUNCTIONALS 00047 00048 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION 00049 # define WINSTL_VER_H_WINSTL_WINDOW_FUNCTIONALS_MAJOR 2 00050 # define WINSTL_VER_H_WINSTL_WINDOW_FUNCTIONALS_MINOR 0 00051 # define WINSTL_VER_H_WINSTL_WINDOW_FUNCTIONALS_REVISION 1 00052 # define WINSTL_VER_H_WINSTL_WINDOW_FUNCTIONALS_EDIT 18 00053 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00054 00055 /* 00056 * Includes 00057 */ 00058 00059 #ifndef WINSTL_INCL_H_WINSTL 00060 # include "winstl.h" // Include the WinSTL root header 00061 #endif /* !WINSTL_INCL_H_WINSTL */ 00062 #ifndef WINSTL_INCL_H_WINSTL_WINDOW_ACCESS 00063 # include "winstl_window_access.h" // get_hwnd() 00064 #endif /* !WINSTL_INCL_H_WINSTL_WINDOW_ACCESS */ 00065 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD 00066 # include <functional> 00067 #endif /* _WINSTL_WINDOW_FUNCTIONALS_NO_STD */ 00068 00069 /* 00070 * Namespace 00071 */ 00072 00073 #ifndef _WINSTL_NO_NAMESPACE 00074 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00075 defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) 00076 /* There is no stlsoft namespace, so must define ::winstl */ 00077 namespace winstl 00078 { 00079 # else 00080 /* Define stlsoft::winstl_project */ 00081 00082 namespace stlsoft 00083 { 00084 00085 namespace winstl_project 00086 { 00087 00088 # endif /* _STLSOFT_NO_NAMESPACE */ 00089 #endif /* !_WINSTL_NO_NAMESPACE */ 00090 00091 /* 00092 00095 00099 00104 00105 /* 00106 * Classes 00107 */ 00108 00110 struct is_visible 00111 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD 00112 : public winstl_ns_qual_std(unary_function)<HWND, ws_bool_t> 00113 #endif /* !_WINSTL_WINDOW_FUNCTIONALS_NO_STD */ 00114 { 00115 public: 00116 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD 00117 00118 private: 00119 typedef winstl_ns_qual_std(unary_function)<HWND, ws_bool_t> parent_class_type; 00120 public: 00122 typedef parent_class_type::argument_type argument_type; 00124 typedef parent_class_type::result_type result_type; 00125 #else 00126 00127 typedef HWND argument_type; 00129 typedef ws_bool_t result_type; 00130 #endif /* _WINSTL_WINDOW_FUNCTIONALS_NO_STD */ 00131 00132 // Operations 00133 public: 00135 ws_bool_t operator ()(HWND hwnd) 00136 { 00137 return ::IsWindowVisible(hwnd) != false; 00138 } 00139 #ifdef __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT 00140 00141 template <ss_typename_param_k W> 00142 ws_bool_t operator ()(W const &w) 00143 { 00144 return operator ()(get_hwnd(w)); 00145 } 00146 #endif // __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT 00147 }; 00148 00149 00150 00152 struct is_enabled 00153 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD 00154 : public winstl_ns_qual_std(unary_function)<HWND, ws_bool_t> 00155 #endif /* !_WINSTL_WINDOW_FUNCTIONALS_NO_STD */ 00156 { 00157 public: 00158 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD 00159 private: 00160 typedef winstl_ns_qual_std(unary_function)<HWND, ws_bool_t> parent_class_type; 00161 public: 00163 typedef parent_class_type::argument_type argument_type; 00165 typedef parent_class_type::result_type result_type; 00166 #else 00167 00168 typedef HWND argument_type; 00170 typedef ws_bool_t result_type; 00171 #endif /* _WINSTL_WINDOW_FUNCTIONALS_NO_STD */ 00172 00173 // Operations 00174 public: 00176 ws_bool_t operator ()(HWND hwnd) 00177 { 00178 return ::IsWindowEnabled(hwnd) != false; 00179 } 00180 #ifdef __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT 00181 00182 template <ss_typename_param_k W> 00183 ws_bool_t operator ()(W const &w) 00184 { 00185 return operator ()(get_hwnd(w)); 00186 } 00187 #endif // __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT 00188 }; 00189 00190 /* 00191 00193 00194 /* 00195 00196 #ifndef _WINSTL_NO_NAMESPACE 00197 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00198 defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) 00199 } // namespace winstl 00200 # else 00201 } // namespace winstl_project 00202 } // namespace stlsoft 00203 # endif /* _STLSOFT_NO_NAMESPACE */ 00204 #endif /* !_WINSTL_NO_NAMESPACE */ 00205 00206 /* 00207 00208 #endif /* WINSTL_INCL_H_WINSTL_WINDOW_FUNCTIONALS */ 00209 00210 /*
|
|
| STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004 |