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