stlab.adobe.com Adobe Systems Incorporated

platform_metrics.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2006-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /****************************************************************************************************/
00008 
00009 // This header defines functions which can return various widget metrics
00010 // on Windows systems. When available, the UXTHEME library is used to
00011 // discover metrics. When UXTHEME is not available some reasonable
00012 // defaults (precalculated on a system without UXTHEME) are returned.
00013 
00014 /****************************************************************************************************/
00015 
00016 #ifndef ADOBE_METRICS_HPP
00017 #define ADOBE_METRICS_HPP
00018 
00019 /****************************************************************************************************/
00020 
00021 #include <adobe/config.hpp>
00022 
00023 #define WINDOWS_LEAN_AND_MEAN 1
00024 #include <windows.h>
00025 
00026 #include <adobe/extents.hpp>
00027 #include <adobe/future/widgets/headers/widget_utils.hpp>
00028 
00029 #include <uxtheme.h>
00030 #include <tmschema.h>
00031 
00032 #include <string>
00033 
00034 /****************************************************************************************************/
00035 
00036 namespace adobe {
00037 
00038 /****************************************************************************************************/
00039 
00050 
00051 /****************************************************************************************************/
00052 
00053 namespace metrics {
00054 
00055 /****************************************************************************************************/
00056 
00057 //
00061 //
00062 
00063 extents_t measure_text(const std::string& text, HWND window, int platform_placeable_type);
00064 
00065 /****************************************************************************************************/
00066 
00067 //
00071 //
00072 
00073 extents_t measure(HWND window, int platform_placeable_type);
00074 
00075 /****************************************************************************************************/
00076 
00077 //
00095 //
00096 
00097 extents_t compose_measurements(const SIZE*       widget_size,
00098                                       const MARGINS*    widget_margins,
00099                                       const TEXTMETRIC* font_metrics,
00100                                       const RECT*       text_extents,
00101                                       const int*        border);
00102 
00103 /****************************************************************************************************/
00104 
00113 
00114 bool get_font(int widget_type, LOGFONTW& out_font);
00115 
00123 
00124 bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics);
00125 
00135 
00136 bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents, const RECT* in_extents = NULL);
00137 
00147 
00148 bool get_integer(int widget_type, int measurement, int& out_val);
00149 
00158 
00159 bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size);
00160 
00170 
00171 bool get_margins(int widget_type, MARGINS& out_margins);
00172 
00183 
00184 bool get_button_text_margins(int widget_type, RECT& out_margins);
00185 
00190 
00191 bool using_styles();
00192 
00201 
00202 void draw_parent_background(HWND window, HDC dc);
00203 
00215 
00216 bool set_window(HWND window);
00217 
00222 
00223 void set_theme_name(const WCHAR* theme_name);
00224 
00225 /****************************************************************************************************/
00226 
00227 } // namespace metrics
00228 
00229 /****************************************************************************************************/
00230 
00231 } // namespace adobe
00232 
00233 /****************************************************************************************************/
00234 
00235 #endif
00236 
00237 /****************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google