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