/usr/include/d/gtkd-3/gtk/CellView.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gtk.CellView;
private import gdk.Color;
private import gdk.RGBA;
private import gdkpixbuf.Pixbuf;
private import glib.ConstructionException;
private import glib.MemorySlice;
private import gobject.ObjectG;
private import gtk.CellArea;
private import gtk.CellAreaContext;
private import gtk.CellLayoutIF;
private import gtk.CellLayoutT;
private import gtk.OrientableIF;
private import gtk.OrientableT;
private import gtk.Requisition;
private import gtk.TreeModelIF;
private import gtk.TreePath;
private import gtk.Widget;
private import gtk.c.functions;
public import gtk.c.types;
public import gtkc.gtktypes;
/**
* A #GtkCellView displays a single row of a #GtkTreeModel using a #GtkCellArea
* and #GtkCellAreaContext. A #GtkCellAreaContext can be provided to the
* #GtkCellView at construction time in order to keep the cellview in context
* of a group of cell views, this ensures that the renderers displayed will
* be properly aligned with eachother (like the aligned cells in the menus
* of #GtkComboBox).
*
* #GtkCellView is #GtkOrientable in order to decide in which orientation
* the underlying #GtkCellAreaContext should be allocated. Taking the #GtkComboBox
* menu as an example, cellviews should be oriented horizontally if the menus are
* listed top-to-bottom and thus all share the same width but may have separate
* individual heights (left-to-right menus should be allocated vertically since
* they all share the same height but may have variable widths).
*
* # CSS nodes
*
* GtkCellView has a single CSS node with name cellview.
*/
public class CellView : Widget, CellLayoutIF, OrientableIF
{
/** the main Gtk struct */
protected GtkCellView* gtkCellView;
/** Get the main Gtk struct */
public GtkCellView* getCellViewStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gtkCellView;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gtkCellView;
}
protected override void setStruct(GObject* obj)
{
gtkCellView = cast(GtkCellView*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GtkCellView* gtkCellView, bool ownedRef = false)
{
this.gtkCellView = gtkCellView;
super(cast(GtkWidget*)gtkCellView, ownedRef);
}
// add the CellLayout capabilities
mixin CellLayoutT!(GtkCellView);
// add the Orientable capabilities
mixin OrientableT!(GtkCellView);
/**
* Creates a new GtkCellView widget, adds a GtkCellRendererText
* to it, and makes its show text.
* If markup is true the text can be marked up with the Pango text
* markup language.
* Since: 2.6
* Params:
* text = the text to display in the cell view
* Returns:
* A newly created GtkCellView widget.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this (string text, bool markup=true)
{
GtkCellView* p;
if ( markup )
{
// GtkWidget* gtk_cell_view_new_with_markup (const gchar *markup);
p = cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text));
}
else
{
// GtkWidget* gtk_cell_view_new_with_text (const gchar *text);
p = cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text));
}
if(p is null)
{
throw new ConstructionException("null returned by gtk_cell_view_new_with_");
}
this(p);
}
/**
*/
/** */
public static GType getType()
{
return gtk_cell_view_get_type();
}
/**
* Creates a new #GtkCellView widget.
*
* Returns: A newly created #GtkCellView widget.
*
* Since: 2.6
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this()
{
auto p = gtk_cell_view_new();
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GtkCellView*) p);
}
/**
* Creates a new #GtkCellView widget with a specific #GtkCellArea
* to layout cells and a specific #GtkCellAreaContext.
*
* Specifying the same context for a handfull of cells lets
* the underlying area synchronize the geometry for those cells,
* in this way alignments with cellviews for other rows are
* possible.
*
* Params:
* area = the #GtkCellArea to layout cells
* context = the #GtkCellAreaContext in which to calculate cell geometry
*
* Returns: A newly created #GtkCellView widget.
*
* Since: 2.6
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(CellArea area, CellAreaContext context)
{
auto p = gtk_cell_view_new_with_context((area is null) ? null : area.getCellAreaStruct(), (context is null) ? null : context.getCellAreaContextStruct());
if(p is null)
{
throw new ConstructionException("null returned by new_with_context");
}
this(cast(GtkCellView*) p);
}
/**
* Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf
* to it, and makes it show @pixbuf.
*
* Params:
* pixbuf = the image to display in the cell view
*
* Returns: A newly created #GtkCellView widget.
*
* Since: 2.6
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(Pixbuf pixbuf)
{
auto p = gtk_cell_view_new_with_pixbuf((pixbuf is null) ? null : pixbuf.getPixbufStruct());
if(p is null)
{
throw new ConstructionException("null returned by new_with_pixbuf");
}
this(cast(GtkCellView*) p);
}
/**
* Returns a #GtkTreePath referring to the currently
* displayed row. If no row is currently displayed,
* %NULL is returned.
*
* Returns: the currently displayed row or %NULL
*
* Since: 2.6
*/
public TreePath getDisplayedRow()
{
auto p = gtk_cell_view_get_displayed_row(gtkCellView);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(TreePath)(cast(GtkTreePath*) p, true);
}
/**
* Gets whether @cell_view is configured to draw all of its
* cells in a sensitive state.
*
* Returns: whether @cell_view draws all of its
* cells in a sensitive state
*
* Since: 3.0
*/
public bool getDrawSensitive()
{
return gtk_cell_view_get_draw_sensitive(gtkCellView) != 0;
}
/**
* Gets whether @cell_view is configured to request space
* to fit the entire #GtkTreeModel.
*
* Returns: whether @cell_view requests space to fit
* the entire #GtkTreeModel.
*
* Since: 3.0
*/
public bool getFitModel()
{
return gtk_cell_view_get_fit_model(gtkCellView) != 0;
}
/**
* Returns the model for @cell_view. If no model is used %NULL is
* returned.
*
* Returns: a #GtkTreeModel used or %NULL
*
* Since: 2.16
*/
public TreeModelIF getModel()
{
auto p = gtk_cell_view_get_model(gtkCellView);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(TreeModelIF)(cast(GtkTreeModel*) p);
}
/**
* Sets @requisition to the size needed by @cell_view to display
* the model row pointed to by @path.
*
* Deprecated: Combo box formerly used this to calculate the
* sizes for cellviews, now you can achieve this by either using
* the #GtkCellView:fit-model property or by setting the currently
* displayed row of the #GtkCellView and using gtk_widget_get_preferred_size().
*
* Params:
* path = a #GtkTreePath
* requisition = return location for the size
*
* Returns: %TRUE
*
* Since: 2.6
*/
public bool getSizeOfRow(TreePath path, out Requisition requisition)
{
GtkRequisition* outrequisition = sliceNew!GtkRequisition();
auto p = gtk_cell_view_get_size_of_row(gtkCellView, (path is null) ? null : path.getTreePathStruct(), outrequisition) != 0;
requisition = ObjectG.getDObject!(Requisition)(outrequisition, true);
return p;
}
/**
* Sets the background color of @view.
*
* Deprecated: Use gtk_cell_view_set_background_rgba() instead.
*
* Params:
* color = the new background color
*
* Since: 2.6
*/
public void setBackgroundColor(Color color)
{
gtk_cell_view_set_background_color(gtkCellView, (color is null) ? null : color.getColorStruct());
}
/**
* Sets the background color of @cell_view.
*
* Params:
* rgba = the new background color
*
* Since: 3.0
*/
public void setBackgroundRgba(RGBA rgba)
{
gtk_cell_view_set_background_rgba(gtkCellView, (rgba is null) ? null : rgba.getRGBAStruct());
}
/**
* Sets the row of the model that is currently displayed
* by the #GtkCellView. If the path is unset, then the
* contents of the cellview “stick” at their last value;
* this is not normally a desired result, but may be
* a needed intermediate state if say, the model for
* the #GtkCellView becomes temporarily empty.
*
* Params:
* path = a #GtkTreePath or %NULL to unset.
*
* Since: 2.6
*/
public void setDisplayedRow(TreePath path)
{
gtk_cell_view_set_displayed_row(gtkCellView, (path is null) ? null : path.getTreePathStruct());
}
/**
* Sets whether @cell_view should draw all of its
* cells in a sensitive state, this is used by #GtkComboBox menus
* to ensure that rows with insensitive cells that contain
* children appear sensitive in the parent menu item.
*
* Params:
* drawSensitive = whether to draw all cells in a sensitive state.
*
* Since: 3.0
*/
public void setDrawSensitive(bool drawSensitive)
{
gtk_cell_view_set_draw_sensitive(gtkCellView, drawSensitive);
}
/**
* Sets whether @cell_view should request space to fit the entire #GtkTreeModel.
*
* This is used by #GtkComboBox to ensure that the cell view displayed on
* the combo box’s button always gets enough space and does not resize
* when selection changes.
*
* Params:
* fitModel = whether @cell_view should request space for the whole model.
*
* Since: 3.0
*/
public void setFitModel(bool fitModel)
{
gtk_cell_view_set_fit_model(gtkCellView, fitModel);
}
/**
* Sets the model for @cell_view. If @cell_view already has a model
* set, it will remove it before setting the new model. If @model is
* %NULL, then it will unset the old model.
*
* Params:
* model = a #GtkTreeModel
*
* Since: 2.6
*/
public void setModel(TreeModelIF model)
{
gtk_cell_view_set_model(gtkCellView, (model is null) ? null : model.getTreeModelStruct());
}
}
|