Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: views/widget/gtk_views_fixed.h

Issue 2768006: Test + Fix for GTK window resizing when using toolkit views. (Closed)
Patch Set: Return a gfx::Size instead. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « views/controls/tabbed_pane/tabbed_pane_unittest.cc ('k') | views/widget/gtk_views_fixed.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 VIEWS_WIDGET_GTK_VIEWS_FIXED_H_ 5 #ifndef VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
6 #define VIEWS_WIDGET_GTK_VIEWS_FIXED_H_ 6 #define VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gdk/gdk.h> 9 #include <gdk/gdk.h>
10 #include <gtk/gtkfixed.h> 10 #include <gtk/gtkfixed.h>
11 11
12 // GtkViewsFixed is a subclass of GtkFixed that can give child widgets their 12 // GtkViewsFixed is a subclass of GtkFixed that can give child widgets
13 // current size rather than their requested size. This behavior is controlled 13 // a set size rather than their requisitioned size (which is actually
14 // by gtk_views_fixed_set_use_allocated_size; the default is to use the 14 // a minimum size, and that can cause issues). This behavior is
15 // Widget's requested size. 15 // controlled by gtk_views_fixed_set_widget_size; the default is to
16 // use the Widget's requisitioned size.
16 17
17 G_BEGIN_DECLS 18 G_BEGIN_DECLS
18 19
19 #define GTK_TYPE_VIEWS_FIXED (gtk_views_fixed_get_type ()) 20 #define GTK_TYPE_VIEWS_FIXED (gtk_views_fixed_get_type ())
20 #define GTK_VIEWS_FIXED(obj) \ 21 #define GTK_VIEWS_FIXED(obj) \
21 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed)) 22 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed))
22 #define GTK_VIEWS_FIXED_CLASS(klass) \ 23 #define GTK_VIEWS_FIXED_CLASS(klass) \
23 (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_VIEWS_FIXED, GtkViewsFixedClass)) 24 (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_VIEWS_FIXED, GtkViewsFixedClass))
24 #define GTK_IS_VIEWS_FIXED(obj) \ 25 #define GTK_IS_VIEWS_FIXED(obj) \
25 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWS_FIXED)) 26 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWS_FIXED))
(...skipping 10 matching lines...) Expand all
36 }; 37 };
37 38
38 struct _GtkViewsFixedClass { 39 struct _GtkViewsFixedClass {
39 GtkFixedClass parent_class; 40 GtkFixedClass parent_class;
40 }; 41 };
41 42
42 GtkWidget* gtk_views_fixed_new(); 43 GtkWidget* gtk_views_fixed_new();
43 44
44 GType gtk_views_fixed_get_type(); 45 GType gtk_views_fixed_get_type();
45 46
46 void gtk_views_fixed_set_use_allocated_size(GtkWidget* widget, bool value); 47 // If width and height are 0, go back to using the requisitioned size.
48 // Queues up a re-size on the widget.
49 void gtk_views_fixed_set_widget_size(GtkWidget* widget, int width, int height);
50
51 bool gtk_views_fixed_get_widget_size(GtkWidget* widget,
52 int* width, int* height);
47 53
48 G_END_DECLS 54 G_END_DECLS
49 55
50 #endif // VIEWS_WIDGET_GTK_VIEWS_FIXED_H 56 #endif // VIEWS_WIDGET_GTK_VIEWS_FIXED_H
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/tabbed_pane_unittest.cc ('k') | views/widget/gtk_views_fixed.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698