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