| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef APP_GFX_FONT_H_ | 5 #ifndef APP_GFX_FONT_H_ |
| 6 #define APP_GFX_FONT_H_ | 6 #define APP_GFX_FONT_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 class HFontRef : public base::RefCounted<HFontRef> { | 162 class HFontRef : public base::RefCounted<HFontRef> { |
| 163 public: | 163 public: |
| 164 // This constructor takes control of the HFONT, and will delete it when | 164 // This constructor takes control of the HFONT, and will delete it when |
| 165 // the HFontRef is deleted. | 165 // the HFontRef is deleted. |
| 166 HFontRef(HFONT hfont, | 166 HFontRef(HFONT hfont, |
| 167 int height, | 167 int height, |
| 168 int baseline, | 168 int baseline, |
| 169 int ave_char_width, | 169 int ave_char_width, |
| 170 int style, | 170 int style, |
| 171 int dlu_base_x); | 171 int dlu_base_x); |
| 172 ~HFontRef(); | |
| 173 | 172 |
| 174 // Accessors | 173 // Accessors |
| 175 HFONT hfont() const { return hfont_; } | 174 HFONT hfont() const { return hfont_; } |
| 176 int height() const { return height_; } | 175 int height() const { return height_; } |
| 177 int baseline() const { return baseline_; } | 176 int baseline() const { return baseline_; } |
| 178 int ave_char_width() const { return ave_char_width_; } | 177 int ave_char_width() const { return ave_char_width_; } |
| 179 int style() const { return style_; } | 178 int style() const { return style_; } |
| 180 int dlu_base_x() const { return dlu_base_x_; } | 179 int dlu_base_x() const { return dlu_base_x_; } |
| 181 const std::wstring& font_name() const { return font_name_; } | 180 const std::wstring& font_name() const { return font_name_; } |
| 182 | 181 |
| 183 private: | 182 private: |
| 183 friend class base::RefCounted<HFontRef>; |
| 184 |
| 185 ~HFontRef(); |
| 186 |
| 184 const HFONT hfont_; | 187 const HFONT hfont_; |
| 185 const int height_; | 188 const int height_; |
| 186 const int baseline_; | 189 const int baseline_; |
| 187 const int ave_char_width_; | 190 const int ave_char_width_; |
| 188 const int style_; | 191 const int style_; |
| 189 // Constants used in converting dialog units to pixels. | 192 // Constants used in converting dialog units to pixels. |
| 190 const int dlu_base_x_; | 193 const int dlu_base_x_; |
| 191 std::wstring font_name_; | 194 std::wstring font_name_; |
| 192 | 195 |
| 193 DISALLOW_COPY_AND_ASSIGN(HFontRef); | 196 DISALLOW_COPY_AND_ASSIGN(HFontRef); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 int height_; | 263 int height_; |
| 261 int ascent_; | 264 int ascent_; |
| 262 int avg_width_; | 265 int avg_width_; |
| 263 #endif | 266 #endif |
| 264 | 267 |
| 265 }; | 268 }; |
| 266 | 269 |
| 267 } // namespace gfx | 270 } // namespace gfx |
| 268 | 271 |
| 269 #endif // APP_GFX_FONT_H_ | 272 #endif // APP_GFX_FONT_H_ |
| OLD | NEW |