summaryrefslogtreecommitdiffstats
path: root/ui/views/widget/gtk_views_fixed.h
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 17:18:14 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 17:18:14 +0000
commitd57afa518d4ad5192b5a2d0f7227b2ddebd21ab9 (patch)
tree0f26ebcbcb4708db3b4520ba46929bc6a3727d1d /ui/views/widget/gtk_views_fixed.h
parentc999f81499325506e3be3e373b1637bc3d71e85e (diff)
downloadchromium_src-d57afa518d4ad5192b5a2d0f7227b2ddebd21ab9.zip
chromium_src-d57afa518d4ad5192b5a2d0f7227b2ddebd21ab9.tar.gz
chromium_src-d57afa518d4ad5192b5a2d0f7227b2ddebd21ab9.tar.bz2
views: Move widget/ directory to ui/views.
BUG=104039 R=ben@chromium.org Review URL: http://codereview.chromium.org/8598031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/widget/gtk_views_fixed.h')
-rw-r--r--ui/views/widget/gtk_views_fixed.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/ui/views/widget/gtk_views_fixed.h b/ui/views/widget/gtk_views_fixed.h
new file mode 100644
index 0000000..fbb6f14
--- /dev/null
+++ b/ui/views/widget/gtk_views_fixed.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 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 UI_VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
+#define UI_VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
+#pragma once
+
+#include <gdk/gdk.h>
+#include <gtk/gtkfixed.h>
+
+// GtkViewsFixed is a subclass of GtkFixed that can give child widgets
+// a set size rather than their requisitioned size (which is actually
+// a minimum size, and that can cause issues). This behavior is
+// controlled by gtk_views_fixed_set_widget_size; the default is to
+// use the Widget's requisitioned size.
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_VIEWS_FIXED (gtk_views_fixed_get_type ())
+#define GTK_VIEWS_FIXED(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed))
+#define GTK_VIEWS_FIXED_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_VIEWS_FIXED, GtkViewsFixedClass))
+#define GTK_IS_VIEWS_FIXED(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWS_FIXED))
+#define GTK_IS_VIEWS_FIXED_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VIEWS_FIXED))
+#define GTK_VIEWS_FIXED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed))
+
+typedef struct _GtkViewsFixed GtkViewsFixed;
+typedef struct _GtkViewsFixedClass GtkViewsFixedClass;
+
+struct _GtkViewsFixed {
+ GtkFixed fixed;
+};
+
+struct _GtkViewsFixedClass {
+ GtkFixedClass parent_class;
+};
+
+GtkWidget* gtk_views_fixed_new();
+
+GType gtk_views_fixed_get_type();
+
+// If width and height are 0, go back to using the requisitioned size.
+// Queues up a re-size on the widget.
+void gtk_views_fixed_set_widget_size(GtkWidget* widget, int width, int height);
+
+bool gtk_views_fixed_get_widget_size(GtkWidget* widget,
+ int* width, int* height);
+
+G_END_DECLS
+
+#endif // UI_VIEWS_WIDGET_GTK_VIEWS_FIXED_H