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 /** */ 101 public static GType getType() 102 { 103 return gtk_style_get_type(); 104 } 105 106 /** 107 * Creates a new #GtkStyle. 108 * 109 * Deprecated: Use #GtkStyleContext 110 * 111 * Return: a new #GtkStyle. 112 * 113 * Throws: ConstructionException GTK+ fails to create the object. 114 */ 115 public this() 116 { 117 auto p = gtk_style_new(); 118 119 if(p is null) 120 { 121 throw new ConstructionException("null returned by new"); 122 } 123 124 this(cast(GtkStyle*) p, true); 125 } 126 127 /** 128 * 129 * 130 * Deprecated: Use #GtkStyleContext instead 131 */ 132 public void applyDefaultBackground(Context cr, Window window, GtkStateType stateType, int x, int y, int width, int height) 133 { 134 gtk_style_apply_default_background(gtkStyle, (cr is null) ? null : cr.getContextStruct(), (window is null) ? null : window.getWindowStruct(), stateType, x, y, width, height); 135 } 136 137 /** 138 * Attaches a style to a window; this process allocates the 139 * colors and creates the GC’s for the style - it specializes 140 * it to a particular visual. The process may involve the creation 141 * of a new style if the style has already been attached to a 142 * window with a different style and visual. 143 * 144 * Since this function may return a new object, you have to use it 145 * in the following way: 146 * `style = gtk_style_attach (style, window)` 147 * 148 * Deprecated: Use gtk_widget_style_attach() instead 149 * 150 * Params: 151 * window = a #GdkWindow. 152 * 153 * Return: Either @style, or a newly-created #GtkStyle. 154 * If the style is newly created, the style parameter 155 * will be unref'ed, and the new style will have 156 * a reference count belonging to the caller. 157 */ 158 public Style attach(Window window) 159 { 160 auto p = gtk_style_attach(gtkStyle, (window is null) ? null : window.getWindowStruct()); 161 162 if(p is null) 163 { 164 return null; 165 } 166 167 return ObjectG.getDObject!(Style)(cast(GtkStyle*) p); 168 } 169 170 /** 171 * Creates a copy of the passed in #GtkStyle object. 172 * 173 * Deprecated: Use #GtkStyleContext instead 174 * 175 * Return: a copy of @style 176 */ 177 public Style copy() 178 { 179 auto p = gtk_style_copy(gtkStyle); 180 181 if(p is null) 182 { 183 return null; 184 } 185 186 return ObjectG.getDObject!(Style)(cast(GtkStyle*) p, true); 187 } 188 189 /** 190 * Detaches a style from a window. If the style is not attached 191 * to any windows anymore, it is unrealized. See gtk_style_attach(). 192 * 193 * Deprecated: Use #GtkStyleContext instead 194 */ 195 public void detach() 196 { 197 gtk_style_detach(gtkStyle); 198 } 199 200 /** 201 * Queries the value of a style property corresponding to a 202 * widget class is in the given style. 203 * 204 * Params: 205 * widgetType = the #GType of a descendant of #GtkWidget 206 * propertyName = the name of the style property to get 207 * value = a #GValue where the value of the property being 208 * queried will be stored 209 * 210 * Since: 2.16 211 */ 212 public void getStyleProperty(GType widgetType, string propertyName, out Value value) 213 { 214 GValue* outvalue = gMalloc!GValue(); 215 216 gtk_style_get_style_property(gtkStyle, widgetType, Str.toStringz(propertyName), outvalue); 217 218 value = ObjectG.getDObject!(Value)(outvalue); 219 } 220 221 /** 222 * Non-vararg variant of gtk_style_get(). 223 * Used primarily by language bindings. 224 * 225 * Params: 226 * widgetType = the #GType of a descendant of #GtkWidget 227 * firstPropertyName = the name of the first style property to get 228 * varArgs = a va_list of pairs of property names and 229 * locations to return the property values, starting with the 230 * location for @first_property_name. 231 * 232 * Since: 2.16 233 */ 234 public void getValist(GType widgetType, string firstPropertyName, void* varArgs) 235 { 236 gtk_style_get_valist(gtkStyle, widgetType, Str.toStringz(firstPropertyName), varArgs); 237 } 238 239 /** 240 * Returns whether @style has an associated #GtkStyleContext. 241 * 242 * Return: %TRUE if @style has a #GtkStyleContext 243 * 244 * Since: 3.0 245 */ 246 public bool hasContext() 247 { 248 return gtk_style_has_context(gtkStyle) != 0; 249 } 250 251 /** 252 * Looks up @color_name in the style’s logical color mappings, 253 * filling in @color and returning %TRUE if found, otherwise 254 * returning %FALSE. Do not cache the found mapping, because 255 * it depends on the #GtkStyle and might change when a theme 256 * switch occurs. 257 * 258 * Deprecated: Use gtk_style_context_lookup_color() instead 259 * 260 * Params: 261 * colorName = the name of the logical color to look up 262 * color = the #GdkColor to fill in 263 * 264 * Return: %TRUE if the mapping was found. 265 * 266 * Since: 2.10 267 */ 268 public bool lookupColor(string colorName, out Color color) 269 { 270 GdkColor* outcolor = gMalloc!GdkColor(); 271 272 auto p = gtk_style_lookup_color(gtkStyle, Str.toStringz(colorName), outcolor) != 0; 273 274 color = ObjectG.getDObject!(Color)(outcolor); 275 276 return p; 277 } 278 279 /** 280 * Looks up @stock_id in the icon factories associated with @style 281 * and the default icon factory, returning an icon set if found, 282 * otherwise %NULL. 283 * 284 * Deprecated: Use gtk_style_context_lookup_icon_set() instead 285 * 286 * Params: 287 * stockId = an icon name 288 * 289 * Return: icon set of @stock_id 290 */ 291 public IconSet lookupIconSet(string stockId) 292 { 293 auto p = gtk_style_lookup_icon_set(gtkStyle, Str.toStringz(stockId)); 294 295 if(p is null) 296 { 297 return null; 298 } 299 300 return ObjectG.getDObject!(IconSet)(cast(GtkIconSet*) p); 301 } 302 303 /** 304 * Renders the icon specified by @source at the given @size 305 * according to the given parameters and returns the result in a 306 * pixbuf. 307 * 308 * Deprecated: Use gtk_render_icon_pixbuf() instead 309 * 310 * Params: 311 * source = the #GtkIconSource specifying the icon to render 312 * direction = a text direction 313 * state = a state 314 * size = the size to render the icon at. A size of 315 * (GtkIconSize)-1 means render at the size of the source and 316 * don’t scale. 317 * widget = the widget 318 * detail = a style detail 319 * 320 * Return: a newly-created #GdkPixbuf 321 * containing the rendered icon 322 */ 323 public Pixbuf renderIcon(IconSource source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, string detail) 324 { 325 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)); 326 327 if(p is null) 328 { 329 return null; 330 } 331 332 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 333 } 334 335 /** 336 * Sets the background of @window to the background color or pixmap 337 * specified by @style for the given state. 338 * 339 * Deprecated: Use gtk_style_context_set_background() instead 340 * 341 * Params: 342 * window = a #GdkWindow 343 * stateType = a state 344 */ 345 public void setBackground(Window window, GtkStateType stateType) 346 { 347 gtk_style_set_background(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType); 348 } 349 350 int[string] connectedSignals; 351 352 void delegate(Style)[] onRealizeListeners; 353 /** 354 * Emitted when the style has been initialized for a particular 355 * visual. Connecting to this signal is probably seldom 356 * useful since most of the time applications and widgets only 357 * deal with styles that have been already realized. 358 * 359 * Since: 2.4 360 */ 361 void addOnRealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 362 { 363 if ( "realize" !in connectedSignals ) 364 { 365 Signals.connectData( 366 this, 367 "realize", 368 cast(GCallback)&callBackRealize, 369 cast(void*)this, 370 null, 371 connectFlags); 372 connectedSignals["realize"] = 1; 373 } 374 onRealizeListeners ~= dlg; 375 } 376 extern(C) static void callBackRealize(GtkStyle* styleStruct, Style _style) 377 { 378 foreach ( void delegate(Style) dlg; _style.onRealizeListeners ) 379 { 380 dlg(_style); 381 } 382 } 383 384 void delegate(Style)[] onUnrealizeListeners; 385 /** 386 * Emitted when the aspects of the style specific to a particular visual 387 * is being cleaned up. A connection to this signal can be useful 388 * if a widget wants to cache objects as object data on #GtkStyle. 389 * This signal provides a convenient place to free such cached objects. 390 * 391 * Since: 2.4 392 */ 393 void addOnUnrealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 394 { 395 if ( "unrealize" !in connectedSignals ) 396 { 397 Signals.connectData( 398 this, 399 "unrealize", 400 cast(GCallback)&callBackUnrealize, 401 cast(void*)this, 402 null, 403 connectFlags); 404 connectedSignals["unrealize"] = 1; 405 } 406 onUnrealizeListeners ~= dlg; 407 } 408 extern(C) static void callBackUnrealize(GtkStyle* styleStruct, Style _style) 409 { 410 foreach ( void delegate(Style) dlg; _style.onUnrealizeListeners ) 411 { 412 dlg(_style); 413 } 414 } 415 416 /** 417 * Draws an arrow in the given rectangle on @cr using the given 418 * parameters. @arrow_type determines the direction of the arrow. 419 * 420 * Deprecated: Use gtk_render_arrow() instead 421 * 422 * Params: 423 * style = a #GtkStyle 424 * cr = a #cairo_t 425 * stateType = a state 426 * shadowType = the type of shadow to draw 427 * widget = the widget 428 * detail = a style detail 429 * arrowType = the type of arrow to draw 430 * fill = %TRUE if the arrow tip should be filled 431 * x = x origin of the rectangle to draw the arrow in 432 * y = y origin of the rectangle to draw the arrow in 433 * width = width of the rectangle to draw the arrow in 434 * height = height of the rectangle to draw the arrow in 435 */ 436 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) 437 { 438 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); 439 } 440 441 /** 442 * Draws a box on @cr with the given parameters. 443 * 444 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead 445 * 446 * Params: 447 * style = a #GtkStyle 448 * cr = a #cairo_t 449 * stateType = a state 450 * shadowType = the type of shadow to draw 451 * widget = the widget 452 * detail = a style detail 453 * x = x origin of the box 454 * y = y origin of the box 455 * width = the width of the box 456 * height = the height of the box 457 */ 458 public static void paintBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 459 { 460 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); 461 } 462 463 /** 464 * Draws a box in @cr using the given style and state and shadow type, 465 * leaving a gap in one side. 466 * 467 * Deprecated: Use gtk_render_frame_gap() instead 468 * 469 * Params: 470 * style = a #GtkStyle 471 * cr = a #cairo_t 472 * stateType = a state 473 * shadowType = type of shadow to draw 474 * widget = the widget 475 * detail = a style detail 476 * x = x origin of the rectangle 477 * y = y origin of the rectangle 478 * width = width of the rectangle 479 * height = width of the rectangle 480 * gapSide = side in which to leave the gap 481 * gapX = starting position of the gap 482 * gapWidth = width of the gap 483 */ 484 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) 485 { 486 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); 487 } 488 489 /** 490 * Draws a check button indicator in the given rectangle on @cr with 491 * the given parameters. 492 * 493 * Deprecated: Use gtk_render_check() instead 494 * 495 * Params: 496 * style = a #GtkStyle 497 * cr = a #cairo_t 498 * stateType = a state 499 * shadowType = the type of shadow to draw 500 * widget = the widget 501 * detail = a style detail 502 * x = x origin of the rectangle to draw the check in 503 * y = y origin of the rectangle to draw the check in 504 * width = the width of the rectangle to draw the check in 505 * height = the height of the rectangle to draw the check in 506 */ 507 public static void paintCheck(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 508 { 509 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); 510 } 511 512 /** 513 * Draws a diamond in the given rectangle on @window using the given 514 * parameters. 515 * 516 * Deprecated: Use cairo instead 517 * 518 * Params: 519 * style = a #GtkStyle 520 * cr = a #cairo_t 521 * stateType = a state 522 * shadowType = the type of shadow to draw 523 * widget = the widget 524 * detail = a style detail 525 * x = x origin of the rectangle to draw the diamond in 526 * y = y origin of the rectangle to draw the diamond in 527 * width = width of the rectangle to draw the diamond in 528 * height = height of the rectangle to draw the diamond in 529 */ 530 public static void paintDiamond(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 531 { 532 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); 533 } 534 535 /** 536 * Draws an expander as used in #GtkTreeView. @x and @y specify the 537 * center the expander. The size of the expander is determined by the 538 * “expander-size” style property of @widget. (If widget is not 539 * specified or doesn’t have an “expander-size” property, an 540 * unspecified default size will be used, since the caller doesn't 541 * have sufficient information to position the expander, this is 542 * likely not useful.) The expander is expander_size pixels tall 543 * in the collapsed position and expander_size pixels wide in the 544 * expanded position. 545 * 546 * Deprecated: Use gtk_render_expander() instead 547 * 548 * Params: 549 * style = a #GtkStyle 550 * cr = a #cairo_t 551 * stateType = a state 552 * widget = the widget 553 * detail = a style detail 554 * x = the x position to draw the expander at 555 * y = the y position to draw the expander at 556 * expanderStyle = the style to draw the expander in; determines 557 * whether the expander is collapsed, expanded, or in an 558 * intermediate state. 559 */ 560 public static void paintExpander(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, GtkExpanderStyle expanderStyle) 561 { 562 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); 563 } 564 565 /** 566 * Draws an extension, i.e. a notebook tab. 567 * 568 * Deprecated: Use gtk_render_extension() instead 569 * 570 * Params: 571 * style = a #GtkStyle 572 * cr = a #cairo_t 573 * stateType = a state 574 * shadowType = type of shadow to draw 575 * widget = the widget 576 * detail = a style detail 577 * x = x origin of the extension 578 * y = y origin of the extension 579 * width = width of the extension 580 * height = width of the extension 581 * gapSide = the side on to which the extension is attached 582 */ 583 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) 584 { 585 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); 586 } 587 588 /** 589 * Draws a flat box on @cr with the given parameters. 590 * 591 * Deprecated: Use gtk_render_frame() and gtk_render_background() instead 592 * 593 * Params: 594 * style = a #GtkStyle 595 * cr = a #cairo_t 596 * stateType = a state 597 * shadowType = the type of shadow to draw 598 * widget = the widget 599 * detail = a style detail 600 * x = x origin of the box 601 * y = y origin of the box 602 * width = the width of the box 603 * height = the height of the box 604 */ 605 public static void paintFlatBox(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 606 { 607 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); 608 } 609 610 /** 611 * Draws a focus indicator around the given rectangle on @cr using the 612 * given style. 613 * 614 * Deprecated: Use gtk_render_focus() instead 615 * 616 * Params: 617 * style = a #GtkStyle 618 * cr = a #cairo_t 619 * stateType = a state 620 * widget = the widget 621 * detail = a style detail 622 * x = the x origin of the rectangle around which to draw a focus indicator 623 * y = the y origin of the rectangle around which to draw a focus indicator 624 * width = the width of the rectangle around which to draw a focus indicator 625 * height = the height of the rectangle around which to draw a focus indicator 626 */ 627 public static void paintFocus(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x, int y, int width, int height) 628 { 629 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); 630 } 631 632 /** 633 * Draws a handle as used in #GtkHandleBox and #GtkPaned. 634 * 635 * Deprecated: Use gtk_render_handle() instead 636 * 637 * Params: 638 * style = a #GtkStyle 639 * cr = a #cairo_t 640 * stateType = a state 641 * shadowType = type of shadow to draw 642 * widget = the widget 643 * detail = a style detail 644 * x = x origin of the handle 645 * y = y origin of the handle 646 * width = with of the handle 647 * height = height of the handle 648 * orientation = the orientation of the handle 649 */ 650 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) 651 { 652 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); 653 } 654 655 /** 656 * Draws a horizontal line from (@x1, @y) to (@x2, @y) in @cr 657 * using the given style and state. 658 * 659 * Deprecated: Use gtk_render_line() instead 660 * 661 * Params: 662 * style = a #GtkStyle 663 * cr = a #caio_t 664 * stateType = a state 665 * widget = the widget 666 * detail = a style detail 667 * x1 = the starting x coordinate 668 * x2 = the ending x coordinate 669 * y = the y coordinate 670 */ 671 public static void paintHline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int x1, int x2, int y) 672 { 673 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); 674 } 675 676 /** 677 * Draws a layout on @cr using the given parameters. 678 * 679 * Deprecated: Use gtk_render_layout() instead 680 * 681 * Params: 682 * style = a #GtkStyle 683 * cr = a #cairo_t 684 * stateType = a state 685 * useText = whether to use the text or foreground 686 * graphics context of @style 687 * widget = the widget 688 * detail = a style detail 689 * x = x origin 690 * y = y origin 691 * layout = the layout to draw 692 */ 693 public static void paintLayout(Style style, Context cr, GtkStateType stateType, bool useText, Widget widget, string detail, int x, int y, PgLayout layout) 694 { 695 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()); 696 } 697 698 /** 699 * Draws a radio button indicator in the given rectangle on @cr with 700 * the given parameters. 701 * 702 * Deprecated: Use gtk_render_option() instead 703 * 704 * Params: 705 * style = a #GtkStyle 706 * cr = a #cairo_t 707 * stateType = a state 708 * shadowType = the type of shadow to draw 709 * widget = the widget 710 * detail = a style detail 711 * x = x origin of the rectangle to draw the option in 712 * y = y origin of the rectangle to draw the option in 713 * width = the width of the rectangle to draw the option in 714 * height = the height of the rectangle to draw the option in 715 */ 716 public static void paintOption(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 717 { 718 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); 719 } 720 721 /** 722 * Draws a resize grip in the given rectangle on @cr using the given 723 * parameters. 724 * 725 * Deprecated: Use gtk_render_handle() instead 726 * 727 * Params: 728 * style = a #GtkStyle 729 * cr = a #cairo_t 730 * stateType = a state 731 * widget = the widget 732 * detail = a style detail 733 * edge = the edge in which to draw the resize grip 734 * x = the x origin of the rectangle in which to draw the resize grip 735 * y = the y origin of the rectangle in which to draw the resize grip 736 * width = the width of the rectangle in which to draw the resize grip 737 * height = the height of the rectangle in which to draw the resize grip 738 */ 739 public static void paintResizeGrip(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, GdkWindowEdge edge, int x, int y, int width, int height) 740 { 741 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); 742 } 743 744 /** 745 * Draws a shadow around the given rectangle in @cr 746 * using the given style and state and shadow type. 747 * 748 * Deprecated: Use gtk_render_frame() instead 749 * 750 * Params: 751 * style = a #GtkStyle 752 * cr = a #cairo_t 753 * stateType = a state 754 * shadowType = type of shadow to draw 755 * widget = the widget 756 * detail = a style detail 757 * x = x origin of the rectangle 758 * y = y origin of the rectangle 759 * width = width of the rectangle 760 * height = width of the rectangle 761 */ 762 public static void paintShadow(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 763 { 764 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); 765 } 766 767 /** 768 * Draws a shadow around the given rectangle in @cr 769 * using the given style and state and shadow type, leaving a 770 * gap in one side. 771 * 772 * Deprecated: Use gtk_render_frame_gap() instead 773 * 774 * Params: 775 * style = a #GtkStyle 776 * cr = a #cairo_t 777 * stateType = a state 778 * shadowType = type of shadow to draw 779 * widget = the widget 780 * detail = a style detail 781 * x = x origin of the rectangle 782 * y = y origin of the rectangle 783 * width = width of the rectangle 784 * height = width of the rectangle 785 * gapSide = side in which to leave the gap 786 * gapX = starting position of the gap 787 * gapWidth = width of the gap 788 */ 789 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) 790 { 791 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); 792 } 793 794 /** 795 * Draws a slider in the given rectangle on @cr using the 796 * given style and orientation. 797 * 798 * Deprecated: Use gtk_render_slider() instead 799 * 800 * Params: 801 * style = a #GtkStyle 802 * cr = a #cairo_t 803 * stateType = a state 804 * shadowType = a shadow 805 * widget = the widget 806 * detail = a style detail 807 * x = the x origin of the rectangle in which to draw a slider 808 * y = the y origin of the rectangle in which to draw a slider 809 * width = the width of the rectangle in which to draw a slider 810 * height = the height of the rectangle in which to draw a slider 811 * orientation = the orientation to be used 812 */ 813 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) 814 { 815 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); 816 } 817 818 /** 819 * Draws a spinner on @window using the given parameters. 820 * 821 * Deprecated: Use gtk_render_activity() instead 822 * 823 * Params: 824 * style = a #GtkStyle 825 * cr = a #cairo_t 826 * stateType = a state 827 * widget = the widget (may be %NULL) 828 * detail = a style detail (may be %NULL) 829 * step = the nth step 830 * x = the x origin of the rectangle in which to draw the spinner 831 * y = the y origin of the rectangle in which to draw the spinner 832 * width = the width of the rectangle in which to draw the spinner 833 * height = the height of the rectangle in which to draw the spinner 834 */ 835 public static void paintSpinner(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, uint step, int x, int y, int width, int height) 836 { 837 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); 838 } 839 840 /** 841 * Draws an option menu tab (i.e. the up and down pointing arrows) 842 * in the given rectangle on @cr using the given parameters. 843 * 844 * Deprecated: Use cairo instead 845 * 846 * Params: 847 * style = a #GtkStyle 848 * cr = a #cairo_t 849 * stateType = a state 850 * shadowType = the type of shadow to draw 851 * widget = the widget 852 * detail = a style detail 853 * x = x origin of the rectangle to draw the tab in 854 * y = y origin of the rectangle to draw the tab in 855 * width = the width of the rectangle to draw the tab in 856 * height = the height of the rectangle to draw the tab in 857 */ 858 public static void paintTab(Style style, Context cr, GtkStateType stateType, GtkShadowType shadowType, Widget widget, string detail, int x, int y, int width, int height) 859 { 860 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); 861 } 862 863 /** 864 * Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @cr 865 * using the given style and state. 866 * 867 * Deprecated: Use gtk_render_line() instead 868 * 869 * Params: 870 * style = a #GtkStyle 871 * cr = a #cairo_t 872 * stateType = a state 873 * widget = the widget 874 * detail = a style detail 875 * y1 = the starting y coordinate 876 * y2 = the ending y coordinate 877 * x = the x coordinate 878 */ 879 public static void paintVline(Style style, Context cr, GtkStateType stateType, Widget widget, string detail, int y1, int y2, int x) 880 { 881 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); 882 } 883 }