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.Str;
33 private import gobject.ObjectG;
34 private import gobject.Signals;
35 private import gobject.Value;
36 private import gtk.IconSet;
37 private import gtk.IconSource;
38 private import gtk.Widget;
39 public  import gtkc.gdktypes;
40 private import gtkc.gtk;
41 public  import gtkc.gtktypes;
42 private import pango.PgLayout;
43 
44 
45 /**
46  * A #GtkStyle object encapsulates the information that provides the look and
47  * feel for a widget.
48  * 
49  * > In GTK+ 3.0, GtkStyle has been deprecated and replaced by
50  * > #GtkStyleContext.
51  * 
52  * Each #GtkWidget has an associated #GtkStyle object that is used when
53  * rendering that widget. Also, a #GtkStyle holds information for the five
54  * possible widget states though not every widget supports all five
55  * states; see #GtkStateType.
56  * 
57  * Usually the #GtkStyle for a widget is the same as the default style that
58  * is set by GTK+ and modified the theme engine.
59  * 
60  * Usually applications should not need to use or modify the #GtkStyle of
61  * their widgets.
62  */
63 public class Style : ObjectG
64 {
65 	/** the main Gtk struct */
66 	protected GtkStyle* gtkStyle;
67 
68 	/** Get the main Gtk struct */
69 	public GtkStyle* getStyleStruct()
70 	{
71 		return gtkStyle;
72 	}
73 
74 	/** the main Gtk struct as a void* */
75 	protected override void* getStruct()
76 	{
77 		return cast(void*)gtkStyle;
78 	}
79 
80 	protected override void setStruct(GObject* obj)
81 	{
82 		gtkStyle = cast(GtkStyle*)obj;
83 		super.setStruct(obj);
84 	}
85 
86 	/**
87 	 * Sets our main struct and passes it to the parent class.
88 	 */
89 	public this (GtkStyle* gtkStyle, bool ownedRef = false)
90 	{
91 		this.gtkStyle = gtkStyle;
92 		super(cast(GObject*)gtkStyle, ownedRef);
93 	}
94 
95 	deprecated:
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 	 * Return: 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 	 * Return: 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 	 * Return: 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 = new GValue;
214 		
215 		gtk_style_get_style_property(gtkStyle, widgetType, Str.toStringz(propertyName), outvalue);
216 		
217 		value = ObjectG.getDObject!(Value)(outvalue);
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 	 * Return: %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 	 * Return: %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 = new GdkColor;
270 		
271 		auto p = gtk_style_lookup_color(gtkStyle, Str.toStringz(colorName), outcolor) != 0;
272 		
273 		color = ObjectG.getDObject!(Color)(outcolor);
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 	 * Return: 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. 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 	 * Return: 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 	int[string] connectedSignals;
350 
351 	void delegate(Style)[] onRealizeListeners;
352 	/**
353 	 * Emitted when the style has been initialized for a particular
354 	 * visual. Connecting to this signal is probably seldom
355 	 * useful since most of the time applications and widgets only
356 	 * deal with styles that have been already realized.
357 	 *
358 	 * Since: 2.4
359 	 */
360 	void addOnRealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
361 	{
362 		if ( "realize" !in connectedSignals )
363 		{
364 			Signals.connectData(
365 				this,
366 				"realize",
367 				cast(GCallback)&callBackRealize,
368 				cast(void*)this,
369 				null,
370 				connectFlags);
371 			connectedSignals["realize"] = 1;
372 		}
373 		onRealizeListeners ~= dlg;
374 	}
375 	extern(C) static void callBackRealize(GtkStyle* styleStruct, Style _style)
376 	{
377 		foreach ( void delegate(Style) dlg; _style.onRealizeListeners )
378 		{
379 			dlg(_style);
380 		}
381 	}
382 
383 	void delegate(Style)[] onUnrealizeListeners;
384 	/**
385 	 * Emitted when the aspects of the style specific to a particular visual
386 	 * is being cleaned up. A connection to this signal can be useful
387 	 * if a widget wants to cache objects as object data on #GtkStyle.
388 	 * This signal provides a convenient place to free such cached objects.
389 	 *
390 	 * Since: 2.4
391 	 */
392 	void addOnUnrealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
393 	{
394 		if ( "unrealize" !in connectedSignals )
395 		{
396 			Signals.connectData(
397 				this,
398 				"unrealize",
399 				cast(GCallback)&callBackUnrealize,
400 				cast(void*)this,
401 				null,
402 				connectFlags);
403 			connectedSignals["unrealize"] = 1;
404 		}
405 		onUnrealizeListeners ~= dlg;
406 	}
407 	extern(C) static void callBackUnrealize(GtkStyle* styleStruct, Style _style)
408 	{
409 		foreach ( void delegate(Style) dlg; _style.onUnrealizeListeners )
410 		{
411 			dlg(_style);
412 		}
413 	}
414 
415 	/**
416 	 * Draws an arrow in the given rectangle on @cr using the given
417 	 * parameters. @arrow_type determines the direction of the arrow.
418 	 *
419 	 * Deprecated: Use gtk_render_arrow() instead
420 	 *
421 	 * Params:
422 	 *     style = a #GtkStyle
423 	 *     cr = a #cairo_t
424 	 *     stateType = a state
425 	 *     shadowType = the type of shadow to draw
426 	 *     widget = the widget
427 	 *     detail = a style detail
428 	 *     arrowType = the type of arrow to draw
429 	 *     fill = %TRUE if the arrow tip should be filled
430 	 *     x = x origin of the rectangle to draw the arrow in
431 	 *     y = y origin of the rectangle to draw the arrow in
432 	 *     width = width of the rectangle to draw the arrow in
433 	 *     height = height of the rectangle to draw the arrow in
434 	 */
435 	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)
436 	{
437 		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);
438 	}
439 
440 	/**
441 	 * Draws a box on @cr with the given parameters.
442 	 *
443 	 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead
444 	 *
445 	 * Params:
446 	 *     style = a #GtkStyle
447 	 *     cr = a #cairo_t
448 	 *     stateType = a state
449 	 *     shadowType = the type of shadow to draw
450 	 *     widget = the widget
451 	 *     detail = a style detail
452 	 *     x = x origin of the box
453 	 *     y = y origin of the box
454 	 *     width = the width of the box
455 	 *     height = the height of the box
456 	 */
457 	public static void paintBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
458 	{
459 		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);
460 	}
461 
462 	/**
463 	 * Draws a box in @cr using the given style and state and shadow type,
464 	 * leaving a gap in one side.
465 	 *
466 	 * Deprecated: Use gtk_render_frame_gap() instead
467 	 *
468 	 * Params:
469 	 *     style = a #GtkStyle
470 	 *     cr = a #cairo_t
471 	 *     stateType = a state
472 	 *     shadowType = type of shadow to draw
473 	 *     widget = the widget
474 	 *     detail = a style detail
475 	 *     x = x origin of the rectangle
476 	 *     y = y origin of the rectangle
477 	 *     width = width of the rectangle
478 	 *     height = width of the rectangle
479 	 *     gapSide = side in which to leave the gap
480 	 *     gapX = starting position of the gap
481 	 *     gapWidth = width of the gap
482 	 */
483 	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)
484 	{
485 		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);
486 	}
487 
488 	/**
489 	 * Draws a check button indicator in the given rectangle on @cr with
490 	 * the given parameters.
491 	 *
492 	 * Deprecated: Use gtk_render_check() instead
493 	 *
494 	 * Params:
495 	 *     style = a #GtkStyle
496 	 *     cr = a #cairo_t
497 	 *     stateType = a state
498 	 *     shadowType = the type of shadow to draw
499 	 *     widget = the widget
500 	 *     detail = a style detail
501 	 *     x = x origin of the rectangle to draw the check in
502 	 *     y = y origin of the rectangle to draw the check in
503 	 *     width = the width of the rectangle to draw the check in
504 	 *     height = the height of the rectangle to draw the check in
505 	 */
506 	public static void paintCheck(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
507 	{
508 		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);
509 	}
510 
511 	/**
512 	 * Draws a diamond in the given rectangle on @window using the given
513 	 * parameters.
514 	 *
515 	 * Deprecated: Use cairo instead
516 	 *
517 	 * Params:
518 	 *     style = a #GtkStyle
519 	 *     cr = a #cairo_t
520 	 *     stateType = a state
521 	 *     shadowType = the type of shadow to draw
522 	 *     widget = the widget
523 	 *     detail = a style detail
524 	 *     x = x origin of the rectangle to draw the diamond in
525 	 *     y = y origin of the rectangle to draw the diamond in
526 	 *     width = width of the rectangle to draw the diamond in
527 	 *     height = height of the rectangle to draw the diamond in
528 	 */
529 	public static void paintDiamond(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
530 	{
531 		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);
532 	}
533 
534 	/**
535 	 * Draws an expander as used in #GtkTreeView. @x and @y specify the
536 	 * center the expander. The size of the expander is determined by the
537 	 * “expander-size” style property of @widget.  (If widget is not
538 	 * specified or doesn’t have an “expander-size” property, an
539 	 * unspecified default size will be used, since the caller doesn't
540 	 * have sufficient information to position the expander, this is
541 	 * likely not useful.) The expander is expander_size pixels tall
542 	 * in the collapsed position and expander_size pixels wide in the
543 	 * expanded position.
544 	 *
545 	 * Deprecated: Use gtk_render_expander() instead
546 	 *
547 	 * Params:
548 	 *     style = a #GtkStyle
549 	 *     cr = a #cairo_t
550 	 *     stateType = a state
551 	 *     widget = the widget
552 	 *     detail = a style detail
553 	 *     x = the x position to draw the expander at
554 	 *     y = the y position to draw the expander at
555 	 *     expanderStyle = the style to draw the expander in; determines
556 	 *         whether the expander is collapsed, expanded, or in an
557 	 *         intermediate state.
558 	 */
559 	public static void paintExpander(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, GtkExpanderStyle expanderStyle)
560 	{
561 		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);
562 	}
563 
564 	/**
565 	 * Draws an extension, i.e. a notebook tab.
566 	 *
567 	 * Deprecated: Use gtk_render_extension() instead
568 	 *
569 	 * Params:
570 	 *     style = a #GtkStyle
571 	 *     cr = a #cairo_t
572 	 *     stateType = a state
573 	 *     shadowType = type of shadow to draw
574 	 *     widget = the widget
575 	 *     detail = a style detail
576 	 *     x = x origin of the extension
577 	 *     y = y origin of the extension
578 	 *     width = width of the extension
579 	 *     height = width of the extension
580 	 *     gapSide = the side on to which the extension is attached
581 	 */
582 	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)
583 	{
584 		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);
585 	}
586 
587 	/**
588 	 * Draws a flat box on @cr with the given parameters.
589 	 *
590 	 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead
591 	 *
592 	 * Params:
593 	 *     style = a #GtkStyle
594 	 *     cr = a #cairo_t
595 	 *     stateType = a state
596 	 *     shadowType = the type of shadow to draw
597 	 *     widget = the widget
598 	 *     detail = a style detail
599 	 *     x = x origin of the box
600 	 *     y = y origin of the box
601 	 *     width = the width of the box
602 	 *     height = the height of the box
603 	 */
604 	public static void paintFlatBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
605 	{
606 		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);
607 	}
608 
609 	/**
610 	 * Draws a focus indicator around the given rectangle on @cr using the
611 	 * given style.
612 	 *
613 	 * Deprecated: Use gtk_render_focus() instead
614 	 *
615 	 * Params:
616 	 *     style = a #GtkStyle
617 	 *     cr = a #cairo_t
618 	 *     stateType = a state
619 	 *     widget = the widget
620 	 *     detail = a style detail
621 	 *     x = the x origin of the rectangle around which to draw a focus indicator
622 	 *     y = the y origin of the rectangle around which to draw a focus indicator
623 	 *     width = the width of the rectangle around which to draw a focus indicator
624 	 *     height = the height of the rectangle around which to draw a focus indicator
625 	 */
626 	public static void paintFocus(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, int width, int height)
627 	{
628 		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);
629 	}
630 
631 	/**
632 	 * Draws a handle as used in #GtkHandleBox and #GtkPaned.
633 	 *
634 	 * Deprecated: Use gtk_render_handle() instead
635 	 *
636 	 * Params:
637 	 *     style = a #GtkStyle
638 	 *     cr = a #cairo_t
639 	 *     stateType = a state
640 	 *     shadowType = type of shadow to draw
641 	 *     widget = the widget
642 	 *     detail = a style detail
643 	 *     x = x origin of the handle
644 	 *     y = y origin of the handle
645 	 *     width = with of the handle
646 	 *     height = height of the handle
647 	 *     orientation = the orientation of the handle
648 	 */
649 	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)
650 	{
651 		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);
652 	}
653 
654 	/**
655 	 * Draws a horizontal line from (@x1, @y) to (@x2, @y) in @cr
656 	 * using the given style and state.
657 	 *
658 	 * Deprecated: Use gtk_render_line() instead
659 	 *
660 	 * Params:
661 	 *     style = a #GtkStyle
662 	 *     cr = a #caio_t
663 	 *     stateType = a state
664 	 *     widget = the widget
665 	 *     detail = a style detail
666 	 *     x1 = the starting x coordinate
667 	 *     x2 = the ending x coordinate
668 	 *     y = the y coordinate
669 	 */
670 	public static void paintHline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x1, int x2, int y)
671 	{
672 		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);
673 	}
674 
675 	/**
676 	 * Draws a layout on @cr using the given parameters.
677 	 *
678 	 * Deprecated: Use gtk_render_layout() instead
679 	 *
680 	 * Params:
681 	 *     style = a #GtkStyle
682 	 *     cr = a #cairo_t
683 	 *     stateType = a state
684 	 *     useText = whether to use the text or foreground
685 	 *         graphics context of @style
686 	 *     widget = the widget
687 	 *     detail = a style detail
688 	 *     x = x origin
689 	 *     y = y origin
690 	 *     layout = the layout to draw
691 	 */
692 	public static void paintLayout(Style style, Context cr, GtkStateType stateType, bool useText, Widget widget, string detail, int x, int y, PgLayout layout)
693 	{
694 		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());
695 	}
696 
697 	/**
698 	 * Draws a radio button indicator in the given rectangle on @cr with
699 	 * the given parameters.
700 	 *
701 	 * Deprecated: Use gtk_render_option() instead
702 	 *
703 	 * Params:
704 	 *     style = a #GtkStyle
705 	 *     cr = a #cairo_t
706 	 *     stateType = a state
707 	 *     shadowType = the type of shadow to draw
708 	 *     widget = the widget
709 	 *     detail = a style detail
710 	 *     x = x origin of the rectangle to draw the option in
711 	 *     y = y origin of the rectangle to draw the option in
712 	 *     width = the width of the rectangle to draw the option in
713 	 *     height = the height of the rectangle to draw the option in
714 	 */
715 	public static void paintOption(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
716 	{
717 		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);
718 	}
719 
720 	/**
721 	 * Draws a resize grip in the given rectangle on @cr using the given
722 	 * parameters.
723 	 *
724 	 * Deprecated: Use gtk_render_handle() instead
725 	 *
726 	 * Params:
727 	 *     style = a #GtkStyle
728 	 *     cr = a #cairo_t
729 	 *     stateType = a state
730 	 *     widget = the widget
731 	 *     detail = a style detail
732 	 *     edge = the edge in which to draw the resize grip
733 	 *     x = the x origin of the rectangle in which to draw the resize grip
734 	 *     y = the y origin of the rectangle in which to draw the resize grip
735 	 *     width = the width of the rectangle in which to draw the resize grip
736 	 *     height = the height of the rectangle in which to draw the resize grip
737 	 */
738 	public static void paintResizeGrip(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, GdkWindowEdge edge, int x, int y, int width, int height)
739 	{
740 		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);
741 	}
742 
743 	/**
744 	 * Draws a shadow around the given rectangle in @cr
745 	 * using the given style and state and shadow type.
746 	 *
747 	 * Deprecated: Use gtk_render_frame() instead
748 	 *
749 	 * Params:
750 	 *     style = a #GtkStyle
751 	 *     cr = a #cairo_t
752 	 *     stateType = a state
753 	 *     shadowType = type of shadow to draw
754 	 *     widget = the widget
755 	 *     detail = a style detail
756 	 *     x = x origin of the rectangle
757 	 *     y = y origin of the rectangle
758 	 *     width = width of the rectangle
759 	 *     height = width of the rectangle
760 	 */
761 	public static void paintShadow(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
762 	{
763 		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);
764 	}
765 
766 	/**
767 	 * Draws a shadow around the given rectangle in @cr
768 	 * using the given style and state and shadow type, leaving a
769 	 * gap in one side.
770 	 *
771 	 * Deprecated: Use gtk_render_frame_gap() instead
772 	 *
773 	 * Params:
774 	 *     style = a #GtkStyle
775 	 *     cr = a #cairo_t
776 	 *     stateType = a state
777 	 *     shadowType = type of shadow to draw
778 	 *     widget = the widget
779 	 *     detail = a style detail
780 	 *     x = x origin of the rectangle
781 	 *     y = y origin of the rectangle
782 	 *     width = width of the rectangle
783 	 *     height = width of the rectangle
784 	 *     gapSide = side in which to leave the gap
785 	 *     gapX = starting position of the gap
786 	 *     gapWidth = width of the gap
787 	 */
788 	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)
789 	{
790 		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);
791 	}
792 
793 	/**
794 	 * Draws a slider in the given rectangle on @cr using the
795 	 * given style and orientation.
796 	 *
797 	 * Deprecated: Use gtk_render_slider() instead
798 	 *
799 	 * Params:
800 	 *     style = a #GtkStyle
801 	 *     cr = a #cairo_t
802 	 *     stateType = a state
803 	 *     shadowType = a shadow
804 	 *     widget = the widget
805 	 *     detail = a style detail
806 	 *     x = the x origin of the rectangle in which to draw a slider
807 	 *     y = the y origin of the rectangle in which to draw a slider
808 	 *     width = the width of the rectangle in which to draw a slider
809 	 *     height = the height of the rectangle in which to draw a slider
810 	 *     orientation = the orientation to be used
811 	 */
812 	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)
813 	{
814 		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);
815 	}
816 
817 	/**
818 	 * Draws a spinner on @window using the given parameters.
819 	 *
820 	 * Deprecated: Use gtk_render_activity() instead
821 	 *
822 	 * Params:
823 	 *     style = a #GtkStyle
824 	 *     cr = a #cairo_t
825 	 *     stateType = a state
826 	 *     widget = the widget (may be %NULL)
827 	 *     detail = a style detail (may be %NULL)
828 	 *     step = the nth step
829 	 *     x = the x origin of the rectangle in which to draw the spinner
830 	 *     y = the y origin of the rectangle in which to draw the spinner
831 	 *     width = the width of the rectangle in which to draw the spinner
832 	 *     height = the height of the rectangle in which to draw the spinner
833 	 */
834 	public static void paintSpinner(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, uint step, int x, int y, int width, int height)
835 	{
836 		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);
837 	}
838 
839 	/**
840 	 * Draws an option menu tab (i.e. the up and down pointing arrows)
841 	 * in the given rectangle on @cr using the given parameters.
842 	 *
843 	 * Deprecated: Use cairo instead
844 	 *
845 	 * Params:
846 	 *     style = a #GtkStyle
847 	 *     cr = a #cairo_t
848 	 *     stateType = a state
849 	 *     shadowType = the type of shadow to draw
850 	 *     widget = the widget
851 	 *     detail = a style detail
852 	 *     x = x origin of the rectangle to draw the tab in
853 	 *     y = y origin of the rectangle to draw the tab in
854 	 *     width = the width of the rectangle to draw the tab in
855 	 *     height = the height of the rectangle to draw the tab in
856 	 */
857 	public static void paintTab(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height)
858 	{
859 		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);
860 	}
861 
862 	/**
863 	 * Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @cr
864 	 * using the given style and state.
865 	 *
866 	 * Deprecated: Use gtk_render_line() instead
867 	 *
868 	 * Params:
869 	 *     style = a #GtkStyle
870 	 *     cr = a #cairo_t
871 	 *     stateType = a state
872 	 *     widget = the widget
873 	 *     detail = a style detail
874 	 *     y1 = the starting y coordinate
875 	 *     y2 = the ending y coordinate
876 	 *     x = the x coordinate
877 	 */
878 	public static void paintVline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int y1, int y2, int x)
879 	{
880 		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);
881 	}
882 }