Debian Codegraph @

gtk/src/cellareacontext.hg

raw
1 /* Copyright (C) 2010 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 _CONFIGINCLUDE(gtkmmconfig.h)
18
19 #include <glibmm/object.h>
20 _DEFS(gtkmm,gtk)
21 _PINCLUDE(glibmm/private/object_p.h)
22
23
24 namespace Gtk
25 {
26
27 class GTKMM_API CellArea;
28
29 /** This stores geometrical information for a series of rows in a CellArea.
30 *
31 * CellAreaContext is used by widgets such as TreeView and IconView,
32 * but application developers do not usually need to be aware of it.
33 *
34 * The CellAreaContext object is created by a given CellArea
35 * and is used to store cell sizes and alignments for a series of
36 * TreeModel rows that are requested and rendered in the same context.
37 *
38 * CellLayout widgets can create any number of contexts in which to
39 * request and render groups of data rows. However. it's important that the
40 * same context which was used to request sizes for a given TreeModel
41 * row also be used for the same row when calling other CellArea APIs
42 * such as gtk_cell_area_render() and gtk_cell_area_event().
43 */
44 class GTKMM_API CellAreaContext : public Glib::Object
45 {
46 _CLASS_GOBJECT(CellAreaContext, GtkCellAreaContext, GTK_CELL_AREA_CONTEXT, Glib::Object, GObject, , , GTKMM_API)
47 public:
48
49
50 protected:
51
52 public:
53
54 _WRAP_METHOD(Glib::RefPtr<CellArea> get_area(), gtk_cell_area_context_get_area, refreturn)
55 _WRAP_METHOD(Glib::RefPtr<const CellArea> get_area() const, gtk_cell_area_context_get_area, refreturn, constversion)
56
57 _WRAP_METHOD(void allocate(int width, int height), gtk_cell_area_context_allocate)
58 _WRAP_METHOD(void reset(), gtk_cell_area_context_reset)
59
60 _WRAP_METHOD(void get_preferred_width(int& minimum_width, int& natural_width) const, gtk_cell_area_context_get_preferred_width)
61 _WRAP_METHOD(void get_preferred_height(int& minimum_height, int& natural_height) const, gtk_cell_area_context_get_preferred_height)
62 _WRAP_METHOD(void get_preferred_height_for_width(int width, int& minimum_height, int& natural_height) const, gtk_cell_area_context_get_preferred_height_for_width)
63 _WRAP_METHOD(void get_preferred_width_for_height(int height, int& minimum_width, int& natural_width) const, gtk_cell_area_context_get_preferred_width_for_height)
64
65 _WRAP_METHOD(void get_allocation(int& width, int& height) const, gtk_cell_area_context_get_allocation)
66
67 _WRAP_METHOD(void push_preferred_width(int minimum_width, int natural_width), gtk_cell_area_context_push_preferred_width)
68 _WRAP_METHOD(void push_preferred_height(int minimum_height, int natural_height), gtk_cell_area_context_push_preferred_height)
69
70 _WRAP_PROPERTY("area", CellArea*)
71 _WRAP_PROPERTY("minimum-width", int)
72 _WRAP_PROPERTY("natural-width", int)
73 _WRAP_PROPERTY("minimum-height", int)
74 _WRAP_PROPERTY("natural-height", int)
75 };
76
77 } //namespace Gtk