OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_GTK_UTIL_H_ | 5 #ifndef CHROME_COMMON_GTK_UTIL_H_ |
6 #define CHROME_COMMON_GTK_UTIL_H_ | 6 #define CHROME_COMMON_GTK_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // want a stock icon but not the stock text to go with it. Returns the button. | 149 // want a stock icon but not the stock text to go with it. Returns the button. |
150 GtkWidget* AddButtonToDialog(GtkWidget* dialog, const gchar* text, | 150 GtkWidget* AddButtonToDialog(GtkWidget* dialog, const gchar* text, |
151 const gchar* stock_id, gint response_id); | 151 const gchar* stock_id, gint response_id); |
152 | 152 |
153 // Sets all the foreground color states of |label| to |color|. | 153 // Sets all the foreground color states of |label| to |color|. |
154 void SetLabelColor(GtkWidget* label, const GdkColor* color); | 154 void SetLabelColor(GtkWidget* label, const GdkColor* color); |
155 | 155 |
156 // Adds the given widget to an alignment identing it by |kGroupIndent|. | 156 // Adds the given widget to an alignment identing it by |kGroupIndent|. |
157 GtkWidget* IndentWidget(GtkWidget* content); | 157 GtkWidget* IndentWidget(GtkWidget* content); |
158 | 158 |
159 // Initialize the font settings in |prefs| (used when creating new renderers) | 159 // Sets (or resets) the font settings in |prefs| (used when creating new |
160 // based on GtkSettings (which itself comes from XSETTINGS). | 160 // renderers) based on GtkSettings (which itself comes from XSETTINGS). |
161 void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs, | 161 void UpdateGtkFontSettings(RendererPreferences* prefs); |
162 bool use_gtk_theme); | |
163 | 162 |
164 // Get the current location of the mouse cursor relative to the screen. | 163 // Get the current location of the mouse cursor relative to the screen. |
165 gfx::Point ScreenPoint(GtkWidget* widget); | 164 gfx::Point ScreenPoint(GtkWidget* widget); |
166 | 165 |
167 // Get the current location of the mouse cursor relative to the widget. | 166 // Get the current location of the mouse cursor relative to the widget. |
168 gfx::Point ClientPoint(GtkWidget* widget); | 167 gfx::Point ClientPoint(GtkWidget* widget); |
169 | 168 |
170 // Reverses a point in RTL mode. Used in making vectors of GdkPoints for window | 169 // Reverses a point in RTL mode. Used in making vectors of GdkPoints for window |
171 // shapes. | 170 // shapes. |
172 GdkPoint MakeBidiGdkPoint(gint x, gint y, gint width, bool ltr); | 171 GdkPoint MakeBidiGdkPoint(gint x, gint y, gint width, bool ltr); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // at the default width. | 217 // at the default width. |
219 // This is called a hack because the gtk docs state that it is logically | 218 // This is called a hack because the gtk docs state that it is logically |
220 // inconsistent for a widget to make its size request depend on its allocation. | 219 // inconsistent for a widget to make its size request depend on its allocation. |
221 // It does, however, have the intended effect of wrapping the label at the | 220 // It does, however, have the intended effect of wrapping the label at the |
222 // proper width. | 221 // proper width. |
223 void WrapLabelAtAllocationHack(GtkWidget* label); | 222 void WrapLabelAtAllocationHack(GtkWidget* label); |
224 | 223 |
225 } // namespace gtk_util | 224 } // namespace gtk_util |
226 | 225 |
227 #endif // CHROME_COMMON_GTK_UTIL_H_ | 226 #endif // CHROME_COMMON_GTK_UTIL_H_ |
OLD | NEW |