00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00047 #ifndef WINSTL_INCL_WINSTL_FUNCTIONAL_HPP_WINDOW
00048 #define WINSTL_INCL_WINSTL_FUNCTIONAL_HPP_WINDOW
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_WINDOW_MAJOR 4
00052 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_WINDOW_MINOR 1
00053 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_WINDOW_REVISION 1
00054 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_WINDOW_EDIT 41
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00062 # include <winstl/winstl.h>
00063 #endif
00064 #ifndef WINSTL_INCL_SHIMS_ATTRIBUTE_HPP_GET_HWND
00065 # include <winstl/shims/attribute/get_HWND.hpp>
00066 #endif
00067 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD
00068 # include <functional>
00069 #else
00070 # error Now need to write that std_binary_function stuff!!
00071 #endif
00072
00073
00074
00075
00076
00077 #ifndef _WINSTL_NO_NAMESPACE
00078 # if defined(_STLSOFT_NO_NAMESPACE) || \
00079 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00080
00081 namespace winstl
00082 {
00083 # else
00084
00085
00086 namespace stlsoft
00087 {
00088
00089 namespace winstl_project
00090 {
00091
00092 # endif
00093 #endif
00094
00095
00096
00097
00098
00104
00105 struct is_visible
00106 : public winstl_ns_qual_std(unary_function)<HWND, BOOL>
00107 {
00108 private:
00109 typedef winstl_ns_qual_std(unary_function)<HWND, BOOL> parent_class_type;
00110 public:
00112 typedef parent_class_type::argument_type argument_type;
00114 typedef parent_class_type::result_type result_type;
00115
00116
00117 public:
00119 result_type operator ()(HWND hwnd) const
00120 {
00121 return ::IsWindowVisible(hwnd);
00122 }
00123 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00125 template <ss_typename_param_k W>
00126 result_type operator ()(W const& w) const
00127 {
00128 return ::IsWindowVisible(winstl_ns_qual(get_HWND)(w));
00129 }
00130 #endif // STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00131 };
00132
00138
00139 struct is_enabled
00140 : public winstl_ns_qual_std(unary_function)<HWND, BOOL>
00141 {
00142 private:
00143 typedef winstl_ns_qual_std(unary_function)<HWND, BOOL> parent_class_type;
00144 public:
00146 typedef parent_class_type::argument_type argument_type;
00148 typedef parent_class_type::result_type result_type;
00149
00150
00151 public:
00153 result_type operator ()(HWND hwnd) const
00154 {
00155 return ::IsWindowEnabled(hwnd);
00156 }
00157 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00159 template <ss_typename_param_k W>
00160 result_type operator ()(W const& w) const
00161 {
00162 return ::IsWindowEnabled(winstl_ns_qual(get_HWND)(w));
00163 }
00164 #endif // STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00165 };
00166
00167
00168
00169
00170
00176
00177 struct window_show
00178 : public std::unary_function<HWND, void>
00179 {
00180 public:
00182 typedef window_show class_type;
00183 public:
00184 ss_explicit_k window_show(ws_bool_t bShow = true)
00185 : m_bShow(bShow)
00186 {}
00187 window_show(window_show const& rhs)
00188 : m_bShow(rhs.m_bShow)
00189 {}
00190 public:
00191 void operator ()(HWND hwnd) const
00192 {
00193 show_(hwnd, m_bShow);
00194 }
00195 template <ss_typename_param_k W>
00196 void operator ()(W &wnd) const
00197 {
00198 show_(winstl_ns_qual(get_HWND)(wnd), m_bShow);
00199 }
00200 private:
00201 static void show_(HWND hwnd, ws_bool_t bShow)
00202 {
00203 ::ShowWindow(hwnd, bShow ? SW_SHOW : SW_HIDE);
00204 }
00205 private:
00206 const ws_bool_t m_bShow;
00207
00208 private:
00209 class_type& operator =(class_type const&);
00210 };
00211
00217
00218 struct window_enable
00219 : public std::unary_function<HWND, void>
00220 {
00221 public:
00223 typedef window_enable class_type;
00224 public:
00225 ss_explicit_k window_enable(ws_bool_t bEnable = true)
00226 : m_bEnable(bEnable)
00227 {}
00228 window_enable(window_enable const& rhs)
00229 : m_bEnable(rhs.m_bEnable)
00230 {}
00231 public:
00232 void operator ()(HWND hwnd) const
00233 {
00234 enable_(hwnd, m_bEnable);
00235 }
00236 template <ss_typename_param_k W>
00237 void operator ()(W &wnd) const
00238 {
00239 enable_(winstl_ns_qual(get_HWND)(wnd), m_bEnable);
00240 }
00241 private:
00242 static void enable_(HWND hwnd, ws_bool_t bEnable)
00243 {
00244 ::EnableWindow(hwnd, bEnable);
00245 }
00246 private:
00247 const ws_bool_t m_bEnable;
00248
00249 private:
00250 class_type& operator =(class_type const&);
00251 };
00252
00253
00254
00255 #ifndef _WINSTL_NO_NAMESPACE
00256 # if defined(_STLSOFT_NO_NAMESPACE) || \
00257 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00258 }
00259 # else
00260 }
00261 }
00262 # endif
00263 #endif
00264
00265
00266
00267 #endif
00268
00269