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_WINDOW_H_GDI_FUNCTIONS
00048 #define WINSTL_INCL_WINSTL_WINDOW_H_GDI_FUNCTIONS
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define WINSTL_VER_WINSTL_WINDOW_H_GDI_FUNCTIONS_MAJOR 4
00052 # define WINSTL_VER_WINSTL_WINDOW_H_GDI_FUNCTIONS_MINOR 0
00053 # define WINSTL_VER_WINSTL_WINDOW_H_GDI_FUNCTIONS_REVISION 2
00054 # define WINSTL_VER_WINSTL_WINDOW_H_GDI_FUNCTIONS_EDIT 136
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00062 # include <winstl/winstl.h>
00063 #endif
00064
00065
00066
00067
00068
00069 #if !defined(_WINSTL_NO_NAMESPACE) && \
00070 !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00071 # if defined(_STLSOFT_NO_NAMESPACE)
00072
00073 namespace winstl
00074 {
00075 # else
00076
00077
00078 namespace stlsoft
00079 {
00080
00081 namespace winstl_project
00082 {
00083
00084 # endif
00085 #endif
00086
00087
00088
00089
00090
00091 STLSOFT_INLINE ws_size_t winstl__get_BITMAP(HBITMAP hbmp, BITMAP *pbmp)
00092 {
00093 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hbmp, sizeof(BITMAP), pbmp));
00094 }
00095
00096 STLSOFT_INLINE ws_size_t winstl__get_DIBSECTION(HBITMAP hbmp, DIBSECTION *pds)
00097 {
00098 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hbmp, sizeof(DIBSECTION), pds));
00099 }
00100
00101 STLSOFT_INLINE ws_size_t winstl__get_LOGPEN(HPEN hpen, LOGPEN *plp)
00102 {
00103 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hpen, sizeof(LOGPEN), plp));
00104 }
00105
00106 STLSOFT_INLINE ws_size_t winstl__get_EXTLOGPEN(HPEN hpen, EXTLOGPEN *pxlp)
00107 {
00108 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hpen, sizeof(EXTLOGPEN), pxlp));
00109 }
00110
00111 STLSOFT_INLINE ws_size_t winstl__get_LOGBRUSH(HBRUSH hpal, LOGBRUSH *pbr)
00112 {
00113 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hpal, sizeof(LOGBRUSH), pbr));
00114 }
00115
00116 STLSOFT_INLINE ws_size_t winstl__get_LOGFONT(HFONT hpal, LOGFONT *pfnt)
00117 {
00118 return stlsoft_static_cast(ws_size_t, STLSOFT_NS_GLOBAL(GetObject)(hpal, sizeof(LOGFONT), pfnt));
00119 }
00120
00121
00122
00123
00124
00125 #ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
00126 namespace winstl
00127 {
00128 #endif
00129
00130
00131
00132
00133
00134 #if defined(__cplusplus)
00135
00136 inline ws_size_t get_object(HBITMAP h, BITMAP &desc)
00137 {
00138 return winstl__get_BITMAP(h, &desc);
00139 }
00140
00141 inline ws_size_t get_object(HBITMAP h, DIBSECTION &desc)
00142 {
00143 return winstl__get_DIBSECTION(h, &desc);
00144 }
00145
00146 inline ws_size_t get_object(HPEN h, EXTLOGPEN &desc)
00147 {
00148 return winstl__get_EXTLOGPEN(h, &desc);
00149 }
00150
00151 inline ws_size_t get_object(HPEN h, LOGPEN &desc)
00152 {
00153 return winstl__get_LOGPEN(h, &desc);
00154 }
00155
00156 inline ws_size_t get_object(HBRUSH h, LOGBRUSH &desc)
00157 {
00158 return winstl__get_LOGBRUSH(h, &desc);
00159 }
00160
00161 inline ws_size_t get_object(HFONT h, LOGFONT &desc)
00162 {
00163 return winstl__get_LOGFONT(h, &desc);
00164 }
00165
00166 template< ss_typename_param_k D
00167 , ss_typename_param_k H
00168 >
00169 inline D get_object_helper(H h)
00170 {
00171 D d;
00172
00173 return get_object(h, d) ? d : D();
00174 }
00175
00176 inline BITMAP get_BITMAP(HBITMAP h)
00177 {
00178 return get_object_helper<BITMAP>(h);
00179 }
00180
00181 inline DIBSECTION get_DIBSECTION(HBITMAP h)
00182 {
00183 return get_object_helper<DIBSECTION>(h);
00184 }
00185
00186 inline EXTLOGPEN get_EXTLOGPEN(HPEN h)
00187 {
00188 return get_object_helper<EXTLOGPEN>(h);
00189 }
00190
00191 inline LOGPEN get_LOGPEN(HPEN h)
00192 {
00193 return get_object_helper<LOGPEN>(h);
00194 }
00195
00196 inline LOGBRUSH get_LOGBRUSH(HBRUSH h)
00197 {
00198 return get_object_helper<LOGBRUSH>(h);
00199 }
00200
00201 inline LOGFONT get_LOGFONT(HFONT h)
00202 {
00203 return get_object_helper<LOGFONT>(h);
00204 }
00205
00206 #endif
00207
00208
00209
00210 #ifndef _WINSTL_NO_NAMESPACE
00211 # if defined(_STLSOFT_NO_NAMESPACE) || \
00212 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00213 }
00214 # else
00215 }
00216 }
00217 # endif
00218 #endif
00219
00220
00221
00222 #endif
00223
00224