summaryrefslogtreecommitdiffstats
path: root/app/gtk_util.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 18:32:14 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 18:32:14 +0000
commit6e64343accab0d5b5436645e40a36f5ff20d17ec (patch)
treecbf33d783e15f8fcd27bd1c27b79046fac0fb4be /app/gtk_util.h
parentede729d4d7a1e6a1dc07d58e0fff2ca5cc6e7131 (diff)
downloadchromium_src-6e64343accab0d5b5436645e40a36f5ff20d17ec.zip
chromium_src-6e64343accab0d5b5436645e40a36f5ff20d17ec.tar.gz
chromium_src-6e64343accab0d5b5436645e40a36f5ff20d17ec.tar.bz2
Final removal of the bad dependency of chrome/common on chrome/browser
Also convert app/gtk_dnd_util.h from a class to a namespace for consistency with added app/gtk_util.h. TEST=none BUG=none Review URL: http://codereview.chromium.org/669268 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gtk_util.h')
-rw-r--r--app/gtk_util.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/gtk_util.h b/app/gtk_util.h
new file mode 100644
index 0000000..22ab7d2
--- /dev/null
+++ b/app/gtk_util.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APP_GTK_UTIL_H_
+#define APP_GTK_UTIL_H_
+
+typedef struct _GtkWidget GtkWidget;
+
+namespace gtk_util {
+
+// Calculates the size of given widget based on the size specified in
+// number of characters/lines (in locale specific resource file) and
+// font metrics.
+// NOTE: Make sure to realize |widget| before using this method, or a
+// default font size will be used instead of the actual font size.
+void GetWidgetSizeFromResources(
+ GtkWidget* widget, int width_chars, int height_lines,
+ int* width, int* height);
+
+// As above, but uses number of characters/lines directly rather than looking
+// up a resource.
+void GetWidgetSizeFromCharacters(
+ GtkWidget* widget, double width_chars, double height_lines,
+ int* width, int* height);
+
+// A helper function for gtk_message_dialog_new() to work around a KDE 3
+// window manager bugs. You should always call it after creating a dialog
+// with gtk_message_dialog_new.
+void ApplyMessageDialogQuirks(GtkWidget* dialog);
+
+} // namespace gtk_util
+
+#endif // APP_GTK_UTIL_H_