1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.Style;
26 
27 private import cairo.Context;
28 private import gdk.Color;
29 private import gdk.Window;
30 private import gdkpixbuf.Pixbuf;
31 private import glib.ConstructionException;
32 private import glib.MemorySlice;
33 private import glib.Str;
34 private import gobject.ObjectG;
35 private import gobject.Signals;
36 private import gobject.Value;
37 private import gtk.IconSet;
38 private import gtk.IconSource;
39 private import gtk.Widget;
40 private import gtk.c.functions;
41 public  import gtk.c.types;
42 public  import gtkc.gtktypes;
43 private import pango.PgLayout;
44 private import std.algorithm;
45 
46 
47 /**
48  * A #GtkStyle object encapsulates the information that provides the look and
49  * feel for a widget.
50  * 
51  * > In GTK+ 3.0, GtkStyle has been deprecated and replaced by
52  * > #GtkStyleContext.
53  * 
54  * Each #GtkWidget has an associated #GtkStyle object that is used when
55  * rendering that widget. Also, a #GtkStyle holds information for the five
56  * possible widget states though not every widget supports all five
57  * states; see #GtkStateType.
58  * 
59  * Usually the #GtkStyle for a widget is the same as the default style that
60  * is set by GTK+ and modified the theme engine.
61  * 
62  * Usually applications should not need to use or modify the #GtkStyle of
63  * their widgets.
64  */
65 public class Style : ObjectG
66 {
67 	/** the main Gtk struct */
68 	protected GtkStyle* gtkStyle;
69 
70 	/** Get the main Gtk struct */
71 	public GtkStyle* getStyleStruct(bool transferOwnership = false)
72 	{
73 		if (transferOwnership)
74 			ownedRef = false;
75 		return gtkStyle;
76 	}
77 
78 	/** the main Gtk struct as a void* */
79 	protected override void* getStruct()
80 	{
81 		return cast(void*)gtkStyle;
82 	}
83 
84 	/**
85 	 * Sets our main struct and passes it to the parent class.
86 	 */
87 	public this (GtkStyle* gtkStyle, bool ownedRef = false)
88 	{
89 		this.gtkStyle = gtkStyle;
90 		super(cast(GObject*)gtkStyle, ownedRef);
91 	}
92 
93 	//TODO:
94 	//deprecated:
95 
96 	/**
97 	 */
98 
99 	/** */
100 	public static GType getType()
101 	{
102 		return gtk_style_get_type();
103 	}
104 
105 	/**
106 	 * Creates a new #GtkStyle.
107 	 *
108 	 * Deprecated: Use #GtkStyleContext
109 	 *
110 	 * Returns: a new #GtkStyle.
111 	 *
112 	 * Throws: ConstructionException GTK+ fails to create the object.
113 	 */
114 	public this()
115 	{
116 		auto p = gtk_style_new();
117 
118 		if(p is null)
119 		{
120 			throw new ConstructionException("null returned by new");
121 		}
122 
123 		this(cast(GtkStyle*) p, true);
124 	}
125 
126 	/**
127 	 *
128 	 *
129 	 * Deprecated: Use #GtkStyleContext instead
130 	 */
131 	public void applyDefaultBackground(Context cr, Window window, GtkStateType stateType, int x, int y, int width, int height)
132 	{
133 		gtk_style_apply_default_background(gtkStyle, (cr is null) ? null : cr.getContextStruct(), (window is null) ? null : window.getWindowStruct(), stateType, x, y, width, height);
134 	}
135 
136 	/**
137 	 * Attaches a style to a window; this process allocates the
138 	 * colors and creates the GC’s for the style - it specializes
139 	 * it to a particular visual. The process may involve the creation
140 	 * of a new style if the style has already been attached to a
141 	 * window with a different style and visual.
142 	 *
143 	 * Since this function may return a new object, you have to use it
144 	 * in the following way:
145 	 * `style = gtk_style_attach (style, window)`
146 	 *
147 	 * Deprecated: Use gtk_widget_style_attach() instead
148 	 *
149 	 * Params:
150 	 *     window = a #GdkWindow.
151 	 *
152 	 * Returns: Either @style, or a newly-created #GtkStyle.
153 	 *     If the style is newly created, the style parameter
154 	 *     will be unref'ed, and the new style will have
155 	 *     a reference count belonging to the caller.
156 	 */
157 	public Style attach(Window window)
158 	{
159 		auto p = gtk_style_attach(gtkStyle, (window is null) ? null : window.getWindowStruct());
160 
161 		if(p is null)
162 		{
163 			return null;
164 		}
165 
166 		return ObjectG.getDObject!(Style)(cast(GtkStyle*) p);
167 	}
168 
169 	/**
170 	 * Creates a copy of the passed in #GtkStyle object.
171 	 *
172 	 * Deprecated: Use #GtkStyleContext instead
173 	 *
174 	 * Returns: a copy of @style
175 	 */
176 	public Style copy()
177 	{
178 		auto p = gtk_style_copy(gtkStyle);
179 
180 		if(p is null)
181 		{
182 			return null;
183 		}
184 
185 		return ObjectG.getDObject!(Style)(cast(GtkStyle*) p, true);
186 	}
187 
188 	/**
189 	 * Detaches a style from a window. If the style is not attached
190 	 * to any windows anymore, it is unrealized. See gtk_style_attach().
191 	 *
192 	 * Deprecated: Use #GtkStyleContext instead
193 	 */
194 	public void detach()
195 	{
196 		gtk_style_detach(gtkStyle);
197 	}
198 
199 	/**
200 	 * Queries the value of a style property corresponding to a
201 	 * widget class is in the given style.
202 	 *
203 	 * Params:
204 	 *     widgetType = the #GType of a descendant of #GtkWidget
205 	 *     propertyName = the name of the style property to get
206 	 *     value = a #GValue where the value of the property being
207 	 *         queried will be stored
208 	 *
209 	 * Since: 2.16
210 	 */
211 	public void getStyleProperty(GType widgetType, string propertyName, out Value value)
212 	{
213 		GValue* outvalue = sliceNew!GValue();
214 
215 		gtk_style_get_style_property(gtkStyle, widgetType, Str.toStringz(propertyName), outvalue);
216 
217 		value = ObjectG.getDObject!(Value)(outvalue, true);
218 	}
219 
220 	/**
221 	 * Non-vararg variant of gtk_style_get().
222 	 * Used primarily by language bindings.
223 	 *
224 	 * Params:
225 	 *     widgetType = the #GType of a descendant of #GtkWidget
226 	 *     firstPropertyName = the name of the first style property to get
227 	 *     varArgs = a va_list of pairs of property names and
228 	 *         locations to return the property values, starting with the
229 	 *         location for @first_property_name.
230 	 *
231 	 * Since: 2.16
232 	 */
233 	public void getValist(GType widgetType, string firstPropertyName, void* varArgs)
234 	{
235 		gtk_style_get_valist(gtkStyle, widgetType, Str.toStringz(firstPropertyName), varArgs);
236 	}
237 
238 	/**
239 	 * Returns whether @style has an associated #GtkStyleContext.
240 	 *
241 	 * Returns: %TRUE if @style has a #GtkStyleContext
242 	 *
243 	 * Since: 3.0
244 	 */
245 	public bool hasContext()
246 	{
247 		return gtk_style_has_context(gtkStyle) != 0;
248 	}
249 
250 	/**
251 	 * Looks up @color_name in the style’s logical color mappings,
252 	 * filling in @color and returning %TRUE if found, otherwise
253 	 * returning %FALSE. Do not cache the found mapping, because
254 	 * it depends on the #GtkStyle and might change when a theme
255 	 * switch occurs.
256 	 *
257 	 * Deprecated: Use gtk_style_context_lookup_color() instead
258 	 *
259 	 * Params:
260 	 *     colorName = the name of the logical color to look up
261 	 *     color = the #GdkColor to fill in
262 	 *
263 	 * Returns: %TRUE if the mapping was found.
264 	 *
265 	 * Since: 2.10
266 	 */
267 	public bool lookupColor(string colorName, out Color color)
268 	{
269 		GdkColor* outcolor = sliceNew!GdkColor();
270 
271 		auto p = gtk_style_lookup_color(gtkStyle, Str.toStringz(colorName), outcolor) != 0;
272 
273 		color = ObjectG.getDObject!(Color)(outcolor, true);
274 
275 		return p;
276 	}
277 
278 	/**
279 	 * Looks up @stock_id in the icon factories associated with @style
280 	 * and the default icon factory, returning an icon set if found,
281 	 * otherwise %NULL.
282 	 *
283 	 * Deprecated: Use gtk_style_context_lookup_icon_set() instead
284 	 *
285 	 * Params:
286 	 *     stockId = an icon name
287 	 *
288 	 * Returns: icon set of @stock_id
289 	 */
290 	public IconSet lookupIconSet(string stockId)
291 	{
292 		auto p = gtk_style_lookup_icon_set(gtkStyle, Str.toStringz(stockId));
293 
294 		if(p is null)
295 		{
296 			return null;
297 		}
298 
299 		return ObjectG.getDObject!(IconSet)(cast(GtkIconSet*) p);
300 	}
301 
302 	/**
303 	 * Renders the icon specified by @source at the given @size
304 	 * according to the given parameters and returns the result in a
305 	 * pixbuf.
306 	 *
307 	 * Deprecated: Use gtk_render_icon_pixbuf() instead
308 	 *
309 	 * Params:
310 	 *     source = the #GtkIconSource specifying the icon to render
311 	 *     direction = a text direction
312 	 *     state = a state
313 	 *     size = the size to render the icon at (#GtkIconSize). A size of
314 	 *         `(GtkIconSize)-1` means render at the size of the source and
315 	 *         don’t scale.
316 	 *     widget = the widget
317 	 *     detail = a style detail
318 	 *
319 	 * Returns: a newly-created #GdkPixbuf
320 	 *     containing the rendered icon
321 	 */
322 	public Pixbuf renderIcon(IconSource source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, string detail)
323 	{
324 		auto p = gtk_style_render_icon(gtkStyle, (source is null) ? null : source.getIconSourceStruct(), direction, state, size, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail));
325 
326 		if(p is null)
327 		{
328 			return null;
329 		}
330 
331 		return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true);
332 	}
333 
334 	/**
335 	 * Sets the background of @window to the background color or pixmap
336 	 * specified by @style for the given state.
337 	 *
338 	 * Deprecated: Use gtk_style_context_set_background() instead
339 	 *
340 	 * Params:
341 	 *     window = a #GdkWindow
342 	 *     stateType = a state
343 	 */
344 	public void setBackground(Window window, GtkStateType stateType)
345 	{
346 		gtk_style_set_background(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType);
347 	}
348 
349 	/**
350 	 * Emitted when the style has been initialized for a particular
351 	 * visual. Connecting to this signal is probably seldom
352 	 * useful since most of the time applications and widgets only
353 	 * deal with styles that have been already realized.
354 	 *
355 	 * Since: 2.4
356 	 */
357 	gulong addOnRealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
358 	{
359 		return Signals.connect(this, "realize", dlg, connectFlags ^ ConnectFlags.SWAPPED);
360 	}
361 
362 	/**
363 	 * Emitted when the aspects of the style specific to a particular visual
364 	 * is being cleaned up. A connection to this signal can be useful
365 	 * if a widget wants to cache objects as object data on #GtkStyle.
366 	 * This signal provides a convenient place to free such cached objects.
367 	 *
368 	 * Since: 2.4
369 	 */
370 	gulong addOnUnrealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
371 	{
372 		return Signals.connect(this, "unrealize", dlg, connectFlags ^ ConnectFlags.SWAPPED);
373 	}
374 
375 	/**
376 	 * Draws an arrow in the given rectangle on @cr using the given
377 	 * parameters. @arrow_type determines the direction of the arrow.
378 	 *
379 	 * Deprecated: Use gtk_render_arrow() instead
380 	 *
381 	 * Params:
382 	 *     style = a #GtkStyle
383 	 *     cr = a #cairo_t
384 	 *     stateType = a state
385 	 *     shadowType = the type of shadow to draw
386 	 *     widget = the widget
387 	 *     detail = a style detail
388 	 *     arrowType = the type of arrow to draw
389 	 *     fill = %TRUE if the arrow tip should be filled
390 	 *     x = x origin of the rectangle to draw the arrow in
391 	 *     y = y origin of the rectangle to draw the arrow in
392 	 *     width = width of the rectangle to draw the arrow in
393 	 *     height = height of the rectangle to draw the arrow in
394 	 */
395 	public static void paintArrow(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, GtkArrowType arrowType, bool fill, int x, int y, int width, int height)
396 	{
397 		gtk_paint_arrow((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), arrowType, fill, x, y, width, height);
398 	}
399 
400 	/**
401 	 * Draws a box on @cr with the given parameters.
402 	 *
403 	 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead
404 	 *
405 	 * Params:
406 	 *     style = a #GtkStyle
407 	 *     cr = a #cairo_t
408 	 *     stateType = a state
409 	 *     shadowType = the type of shadow to draw
410 	 *     widget = the widget
411 	 *     detail = a style detail
412 	 *     x = x origin of the box
413 	 *     y = y origin of the box
414 	 *     width = the width of the box
415 	 *     height = the height of the box
416 	 */
417 	public static void paintBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
418 	{
419 		gtk_paint_box((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
420 	}
421 
422 	/**
423 	 * Draws a box in @cr using the given style and state and shadow type,
424 	 * leaving a gap in one side.
425 	 *
426 	 * Deprecated: Use gtk_render_frame_gap() instead
427 	 *
428 	 * Params:
429 	 *     style = a #GtkStyle
430 	 *     cr = a #cairo_t
431 	 *     stateType = a state
432 	 *     shadowType = type of shadow to draw
433 	 *     widget = the widget
434 	 *     detail = a style detail
435 	 *     x = x origin of the rectangle
436 	 *     y = y origin of the rectangle
437 	 *     width = width of the rectangle
438 	 *     height = width of the rectangle
439 	 *     gapSide = side in which to leave the gap
440 	 *     gapX = starting position of the gap
441 	 *     gapWidth = width of the gap
442 	 */
443 	public static void paintBoxGap(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth)
444 	{
445 		gtk_paint_box_gap((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide, gapX, gapWidth);
446 	}
447 
448 	/**
449 	 * Draws a check button indicator in the given rectangle on @cr with
450 	 * the given parameters.
451 	 *
452 	 * Deprecated: Use gtk_render_check() instead
453 	 *
454 	 * Params:
455 	 *     style = a #GtkStyle
456 	 *     cr = a #cairo_t
457 	 *     stateType = a state
458 	 *     shadowType = the type of shadow to draw
459 	 *     widget = the widget
460 	 *     detail = a style detail
461 	 *     x = x origin of the rectangle to draw the check in
462 	 *     y = y origin of the rectangle to draw the check in
463 	 *     width = the width of the rectangle to draw the check in
464 	 *     height = the height of the rectangle to draw the check in
465 	 */
466 	public static void paintCheck(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
467 	{
468 		gtk_paint_check((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
469 	}
470 
471 	/**
472 	 * Draws a diamond in the given rectangle on @window using the given
473 	 * parameters.
474 	 *
475 	 * Deprecated: Use cairo instead
476 	 *
477 	 * Params:
478 	 *     style = a #GtkStyle
479 	 *     cr = a #cairo_t
480 	 *     stateType = a state
481 	 *     shadowType = the type of shadow to draw
482 	 *     widget = the widget
483 	 *     detail = a style detail
484 	 *     x = x origin of the rectangle to draw the diamond in
485 	 *     y = y origin of the rectangle to draw the diamond in
486 	 *     width = width of the rectangle to draw the diamond in
487 	 *     height = height of the rectangle to draw the diamond in
488 	 */
489 	public static void paintDiamond(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
490 	{
491 		gtk_paint_diamond((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
492 	}
493 
494 	/**
495 	 * Draws an expander as used in #GtkTreeView. @x and @y specify the
496 	 * center the expander. The size of the expander is determined by the
497 	 * “expander-size” style property of @widget.  (If widget is not
498 	 * specified or doesn’t have an “expander-size” property, an
499 	 * unspecified default size will be used, since the caller doesn't
500 	 * have sufficient information to position the expander, this is
501 	 * likely not useful.) The expander is expander_size pixels tall
502 	 * in the collapsed position and expander_size pixels wide in the
503 	 * expanded position.
504 	 *
505 	 * Deprecated: Use gtk_render_expander() instead
506 	 *
507 	 * Params:
508 	 *     style = a #GtkStyle
509 	 *     cr = a #cairo_t
510 	 *     stateType = a state
511 	 *     widget = the widget
512 	 *     detail = a style detail
513 	 *     x = the x position to draw the expander at
514 	 *     y = the y position to draw the expander at
515 	 *     expanderStyle = the style to draw the expander in; determines
516 	 *         whether the expander is collapsed, expanded, or in an
517 	 *         intermediate state.
518 	 */
519 	public static void paintExpander(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, GtkExpanderStyle expanderStyle)
520 	{
521 		gtk_paint_expander((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, expanderStyle);
522 	}
523 
524 	/**
525 	 * Draws an extension, i.e. a notebook tab.
526 	 *
527 	 * Deprecated: Use gtk_render_extension() instead
528 	 *
529 	 * Params:
530 	 *     style = a #GtkStyle
531 	 *     cr = a #cairo_t
532 	 *     stateType = a state
533 	 *     shadowType = type of shadow to draw
534 	 *     widget = the widget
535 	 *     detail = a style detail
536 	 *     x = x origin of the extension
537 	 *     y = y origin of the extension
538 	 *     width = width of the extension
539 	 *     height = width of the extension
540 	 *     gapSide = the side on to which the extension is attached
541 	 */
542 	public static void paintExtension(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide)
543 	{
544 		gtk_paint_extension((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide);
545 	}
546 
547 	/**
548 	 * Draws a flat box on @cr with the given parameters.
549 	 *
550 	 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead
551 	 *
552 	 * Params:
553 	 *     style = a #GtkStyle
554 	 *     cr = a #cairo_t
555 	 *     stateType = a state
556 	 *     shadowType = the type of shadow to draw
557 	 *     widget = the widget
558 	 *     detail = a style detail
559 	 *     x = x origin of the box
560 	 *     y = y origin of the box
561 	 *     width = the width of the box
562 	 *     height = the height of the box
563 	 */
564 	public static void paintFlatBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
565 	{
566 		gtk_paint_flat_box((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
567 	}
568 
569 	/**
570 	 * Draws a focus indicator around the given rectangle on @cr using the
571 	 * given style.
572 	 *
573 	 * Deprecated: Use gtk_render_focus() instead
574 	 *
575 	 * Params:
576 	 *     style = a #GtkStyle
577 	 *     cr = a #cairo_t
578 	 *     stateType = a state
579 	 *     widget = the widget
580 	 *     detail = a style detail
581 	 *     x = the x origin of the rectangle around which to draw a focus indicator
582 	 *     y = the y origin of the rectangle around which to draw a focus indicator
583 	 *     width = the width of the rectangle around which to draw a focus indicator
584 	 *     height = the height of the rectangle around which to draw a focus indicator
585 	 */
586 	public static void paintFocus(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, int width, int height)
587 	{
588 		gtk_paint_focus((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
589 	}
590 
591 	/**
592 	 * Draws a handle as used in #GtkHandleBox and #GtkPaned.
593 	 *
594 	 * Deprecated: Use gtk_render_handle() instead
595 	 *
596 	 * Params:
597 	 *     style = a #GtkStyle
598 	 *     cr = a #cairo_t
599 	 *     stateType = a state
600 	 *     shadowType = type of shadow to draw
601 	 *     widget = the widget
602 	 *     detail = a style detail
603 	 *     x = x origin of the handle
604 	 *     y = y origin of the handle
605 	 *     width = with of the handle
606 	 *     height = height of the handle
607 	 *     orientation = the orientation of the handle
608 	 */
609 	public static void paintHandle(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height, GtkOrientation orientation)
610 	{
611 		gtk_paint_handle((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, orientation);
612 	}
613 
614 	/**
615 	 * Draws a horizontal line from (@x1, @y) to (@x2, @y) in @cr
616 	 * using the given style and state.
617 	 *
618 	 * Deprecated: Use gtk_render_line() instead
619 	 *
620 	 * Params:
621 	 *     style = a #GtkStyle
622 	 *     cr = a #caio_t
623 	 *     stateType = a state
624 	 *     widget = the widget
625 	 *     detail = a style detail
626 	 *     x1 = the starting x coordinate
627 	 *     x2 = the ending x coordinate
628 	 *     y = the y coordinate
629 	 */
630 	public static void paintHline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x1, int x2, int y)
631 	{
632 		gtk_paint_hline((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x1, x2, y);
633 	}
634 
635 	/**
636 	 * Draws a layout on @cr using the given parameters.
637 	 *
638 	 * Deprecated: Use gtk_render_layout() instead
639 	 *
640 	 * Params:
641 	 *     style = a #GtkStyle
642 	 *     cr = a #cairo_t
643 	 *     stateType = a state
644 	 *     useText = whether to use the text or foreground
645 	 *         graphics context of @style
646 	 *     widget = the widget
647 	 *     detail = a style detail
648 	 *     x = x origin
649 	 *     y = y origin
650 	 *     layout = the layout to draw
651 	 */
652 	public static void paintLayout(Style style, Context cr, GtkStateType stateType, bool useText, Widget widget, string detail, int x, int y, PgLayout layout)
653 	{
654 		gtk_paint_layout((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, useText, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, (layout is null) ? null : layout.getPgLayoutStruct());
655 	}
656 
657 	/**
658 	 * Draws a radio button indicator in the given rectangle on @cr with
659 	 * the given parameters.
660 	 *
661 	 * Deprecated: Use gtk_render_option() instead
662 	 *
663 	 * Params:
664 	 *     style = a #GtkStyle
665 	 *     cr = a #cairo_t
666 	 *     stateType = a state
667 	 *     shadowType = the type of shadow to draw
668 	 *     widget = the widget
669 	 *     detail = a style detail
670 	 *     x = x origin of the rectangle to draw the option in
671 	 *     y = y origin of the rectangle to draw the option in
672 	 *     width = the width of the rectangle to draw the option in
673 	 *     height = the height of the rectangle to draw the option in
674 	 */
675 	public static void paintOption(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
676 	{
677 		gtk_paint_option((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
678 	}
679 
680 	/**
681 	 * Draws a resize grip in the given rectangle on @cr using the given
682 	 * parameters.
683 	 *
684 	 * Deprecated: Use gtk_render_handle() instead
685 	 *
686 	 * Params:
687 	 *     style = a #GtkStyle
688 	 *     cr = a #cairo_t
689 	 *     stateType = a state
690 	 *     widget = the widget
691 	 *     detail = a style detail
692 	 *     edge = the edge in which to draw the resize grip
693 	 *     x = the x origin of the rectangle in which to draw the resize grip
694 	 *     y = the y origin of the rectangle in which to draw the resize grip
695 	 *     width = the width of the rectangle in which to draw the resize grip
696 	 *     height = the height of the rectangle in which to draw the resize grip
697 	 */
698 	public static void paintResizeGrip(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, GdkWindowEdge edge, int x, int y, int width, int height)
699 	{
700 		gtk_paint_resize_grip((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), edge, x, y, width, height);
701 	}
702 
703 	/**
704 	 * Draws a shadow around the given rectangle in @cr
705 	 * using the given style and state and shadow type.
706 	 *
707 	 * Deprecated: Use gtk_render_frame() instead
708 	 *
709 	 * Params:
710 	 *     style = a #GtkStyle
711 	 *     cr = a #cairo_t
712 	 *     stateType = a state
713 	 *     shadowType = type of shadow to draw
714 	 *     widget = the widget
715 	 *     detail = a style detail
716 	 *     x = x origin of the rectangle
717 	 *     y = y origin of the rectangle
718 	 *     width = width of the rectangle
719 	 *     height = width of the rectangle
720 	 */
721 	public static void paintShadow(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
722 	{
723 		gtk_paint_shadow((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
724 	}
725 
726 	/**
727 	 * Draws a shadow around the given rectangle in @cr
728 	 * using the given style and state and shadow type, leaving a
729 	 * gap in one side.
730 	 *
731 	 * Deprecated: Use gtk_render_frame_gap() instead
732 	 *
733 	 * Params:
734 	 *     style = a #GtkStyle
735 	 *     cr = a #cairo_t
736 	 *     stateType = a state
737 	 *     shadowType = type of shadow to draw
738 	 *     widget = the widget
739 	 *     detail = a style detail
740 	 *     x = x origin of the rectangle
741 	 *     y = y origin of the rectangle
742 	 *     width = width of the rectangle
743 	 *     height = width of the rectangle
744 	 *     gapSide = side in which to leave the gap
745 	 *     gapX = starting position of the gap
746 	 *     gapWidth = width of the gap
747 	 */
748 	public static void paintShadowGap(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth)
749 	{
750 		gtk_paint_shadow_gap((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide, gapX, gapWidth);
751 	}
752 
753 	/**
754 	 * Draws a slider in the given rectangle on @cr using the
755 	 * given style and orientation.
756 	 *
757 	 * Deprecated: Use gtk_render_slider() instead
758 	 *
759 	 * Params:
760 	 *     style = a #GtkStyle
761 	 *     cr = a #cairo_t
762 	 *     stateType = a state
763 	 *     shadowType = a shadow
764 	 *     widget = the widget
765 	 *     detail = a style detail
766 	 *     x = the x origin of the rectangle in which to draw a slider
767 	 *     y = the y origin of the rectangle in which to draw a slider
768 	 *     width = the width of the rectangle in which to draw a slider
769 	 *     height = the height of the rectangle in which to draw a slider
770 	 *     orientation = the orientation to be used
771 	 */
772 	public static void paintSlider(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height, GtkOrientation orientation)
773 	{
774 		gtk_paint_slider((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, orientation);
775 	}
776 
777 	/**
778 	 * Draws a spinner on @window using the given parameters.
779 	 *
780 	 * Deprecated: Use gtk_render_icon() and the #GtkStyleContext
781 	 * you are drawing instead
782 	 *
783 	 * Params:
784 	 *     style = a #GtkStyle
785 	 *     cr = a #cairo_t
786 	 *     stateType = a state
787 	 *     widget = the widget (may be %NULL)
788 	 *     detail = a style detail (may be %NULL)
789 	 *     step = the nth step
790 	 *     x = the x origin of the rectangle in which to draw the spinner
791 	 *     y = the y origin of the rectangle in which to draw the spinner
792 	 *     width = the width of the rectangle in which to draw the spinner
793 	 *     height = the height of the rectangle in which to draw the spinner
794 	 */
795 	public static void paintSpinner(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, uint step, int x, int y, int width, int height)
796 	{
797 		gtk_paint_spinner((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), step, x, y, width, height);
798 	}
799 
800 	/**
801 	 * Draws an option menu tab (i.e. the up and down pointing arrows)
802 	 * in the given rectangle on @cr using the given parameters.
803 	 *
804 	 * Deprecated: Use cairo instead
805 	 *
806 	 * Params:
807 	 *     style = a #GtkStyle
808 	 *     cr = a #cairo_t
809 	 *     stateType = a state
810 	 *     shadowType = the type of shadow to draw
811 	 *     widget = the widget
812 	 *     detail = a style detail
813 	 *     x = x origin of the rectangle to draw the tab in
814 	 *     y = y origin of the rectangle to draw the tab in
815 	 *     width = the width of the rectangle to draw the tab in
816 	 *     height = the height of the rectangle to draw the tab in
817 	 */
818 	public static void paintTab(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
819 	{
820 		gtk_paint_tab((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, shadowType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height);
821 	}
822 
823 	/**
824 	 * Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @cr
825 	 * using the given style and state.
826 	 *
827 	 * Deprecated: Use gtk_render_line() instead
828 	 *
829 	 * Params:
830 	 *     style = a #GtkStyle
831 	 *     cr = a #cairo_t
832 	 *     stateType = a state
833 	 *     widget = the widget
834 	 *     detail = a style detail
835 	 *     y1 = the starting y coordinate
836 	 *     y2 = the ending y coordinate
837 	 *     x = the x coordinate
838 	 */
839 	public static void paintVline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int y1, int y2, int x)
840 	{
841 		gtk_paint_vline((style is null) ? null : style.getStyleStruct(), (cr is null) ? null : cr.getContextStruct(), stateType, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), y1, y2, x);
842 	}
843 }