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 * Conversion parameters: 26 * inFile = GtkStyle.html 27 * outPack = gtk 28 * outFile = Style 29 * strct = GtkStyle 30 * realStrct= 31 * ctorStrct= 32 * clss = Style 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_style_ 41 * - gtk_ 42 * omit structs: 43 * omit prefixes: 44 * - gtk_border_ 45 * omit code: 46 * - gtk_style_ref 47 * - gtk_style_unref 48 * omit signals: 49 * imports: 50 * - glib.Str 51 * - gdk.Color 52 * - gdk.Window 53 * - gdk.Rectangle 54 * - gtk.IconSet 55 * - gdk.Pixbuf 56 * - gtk.IconSource 57 * - gtk.Widget 58 * - gdk.Font 59 * - gdk.Drawable 60 * - gobject.Value 61 * - pango.PgLayout 62 * structWrap: 63 * - GValue* -> Value 64 * - GdkColor* -> Color 65 * - GdkDrawable* -> Drawable 66 * - GdkFont* -> Font 67 * - GdkPixbuf* -> Pixbuf 68 * - GdkRectangle* -> Rectangle 69 * - GdkWindow* -> Window 70 * - GtkIconSet* -> IconSet 71 * - GtkIconSource* -> IconSource 72 * - GtkStyle* -> Style 73 * - GtkWidget* -> Widget 74 * - PangoLayout* -> PgLayout 75 * module aliases: 76 * local aliases: 77 * overrides: 78 */ 79 80 module gtk.Style; 81 82 public import gtkc.gtktypes; 83 84 private import gtkc.gtk; 85 private import glib.ConstructionException; 86 private import gobject.ObjectG; 87 88 private import gobject.Signals; 89 public import gtkc.gdktypes; 90 91 private import glib.Str; 92 private import gdk.Color; 93 private import gdk.Window; 94 private import gdk.Rectangle; 95 private import gtk.IconSet; 96 private import gdk.Pixbuf; 97 private import gtk.IconSource; 98 private import gtk.Widget; 99 private import gdk.Font; 100 private import gdk.Drawable; 101 private import gobject.Value; 102 private import pango.PgLayout; 103 104 105 106 private import gobject.ObjectG; 107 108 /** 109 * Description 110 */ 111 public class Style : ObjectG 112 { 113 114 /** the main Gtk struct */ 115 protected GtkStyle* gtkStyle; 116 117 118 public GtkStyle* getStyleStruct() 119 { 120 return gtkStyle; 121 } 122 123 124 /** the main Gtk struct as a void* */ 125 protected override void* getStruct() 126 { 127 return cast(void*)gtkStyle; 128 } 129 130 /** 131 * Sets our main struct and passes it to the parent class 132 */ 133 public this (GtkStyle* gtkStyle) 134 { 135 super(cast(GObject*)gtkStyle); 136 this.gtkStyle = gtkStyle; 137 } 138 139 protected override void setStruct(GObject* obj) 140 { 141 super.setStruct(obj); 142 gtkStyle = cast(GtkStyle*)obj; 143 } 144 145 /** 146 */ 147 int[string] connectedSignals; 148 149 void delegate(Style)[] onRealizeListeners; 150 /** 151 * Emitted when the style has been initialized for a particular 152 * colormap and depth. Connecting to this signal is probably seldom 153 * useful since most of the time applications and widgets only 154 * deal with styles that have been already realized. 155 * Since 2.4 156 */ 157 void addOnRealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 158 { 159 if ( !("realize" in connectedSignals) ) 160 { 161 Signals.connectData( 162 getStruct(), 163 "realize", 164 cast(GCallback)&callBackRealize, 165 cast(void*)this, 166 null, 167 connectFlags); 168 connectedSignals["realize"] = 1; 169 } 170 onRealizeListeners ~= dlg; 171 } 172 extern(C) static void callBackRealize(GtkStyle* styleStruct, Style _style) 173 { 174 foreach ( void delegate(Style) dlg ; _style.onRealizeListeners ) 175 { 176 dlg(_style); 177 } 178 } 179 180 void delegate(Style)[] onUnrealizeListeners; 181 /** 182 * Emitted when the aspects of the style specific to a particular colormap 183 * and depth are being cleaned up. A connection to this signal can be useful 184 * if a widget wants to cache objects like a GdkGC as object data on GtkStyle. 185 * This signal provides a convenient place to free such cached objects. 186 * Since 2.4 187 */ 188 void addOnUnrealize(void delegate(Style) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 189 { 190 if ( !("unrealize" in connectedSignals) ) 191 { 192 Signals.connectData( 193 getStruct(), 194 "unrealize", 195 cast(GCallback)&callBackUnrealize, 196 cast(void*)this, 197 null, 198 connectFlags); 199 connectedSignals["unrealize"] = 1; 200 } 201 onUnrealizeListeners ~= dlg; 202 } 203 extern(C) static void callBackUnrealize(GtkStyle* styleStruct, Style _style) 204 { 205 foreach ( void delegate(Style) dlg ; _style.onUnrealizeListeners ) 206 { 207 dlg(_style); 208 } 209 } 210 211 212 /** 213 * Creates a new GtkStyle. 214 * Throws: ConstructionException GTK+ fails to create the object. 215 */ 216 public this () 217 { 218 // GtkStyle * gtk_style_new (void); 219 auto p = gtk_style_new(); 220 if(p is null) 221 { 222 throw new ConstructionException("null returned by gtk_style_new()"); 223 } 224 this(cast(GtkStyle*) p); 225 } 226 227 /** 228 * Creates a copy of the passed in GtkStyle object. 229 * Returns: a copy of style. [transfer full] 230 */ 231 public Style copy() 232 { 233 // GtkStyle * gtk_style_copy (GtkStyle *style); 234 auto p = gtk_style_copy(gtkStyle); 235 236 if(p is null) 237 { 238 return null; 239 } 240 241 return ObjectG.getDObject!(Style)(cast(GtkStyle*) p); 242 } 243 244 /** 245 * Attaches a style to a window; this process allocates the 246 * colors and creates the GC's for the style - it specializes 247 * it to a particular visual and colormap. The process may 248 * involve the creation of a new style if the style has already 249 * been attached to a window with a different style and colormap. 250 * Since this function may return a new object, you have to use it 251 * Params: 252 * window = a GdkWindow. 253 * Returns: Either style, or a newly-created GtkStyle. If the style is newly created, the style parameter will be unref'ed, and the new style will have a reference count belonging to the caller. 254 */ 255 public Style attach(Window window) 256 { 257 // GtkStyle * gtk_style_attach (GtkStyle *style, GdkWindow *window); 258 auto p = gtk_style_attach(gtkStyle, (window is null) ? null : window.getWindowStruct()); 259 260 if(p is null) 261 { 262 return null; 263 } 264 265 return ObjectG.getDObject!(Style)(cast(GtkStyle*) p); 266 } 267 268 /** 269 * Detaches a style from a window. If the style is not attached 270 * to any windows anymore, it is unrealized. See gtk_style_attach(). 271 */ 272 public void detach() 273 { 274 // void gtk_style_detach (GtkStyle *style); 275 gtk_style_detach(gtkStyle); 276 } 277 278 /** 279 * Sets the background of window to the background color or pixmap 280 * specified by style for the given state. 281 * Params: 282 * window = a GdkWindow 283 * stateType = a state 284 */ 285 public void setBackground(Window window, GtkStateType stateType) 286 { 287 // void gtk_style_set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type); 288 gtk_style_set_background(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType); 289 } 290 291 /** 292 * Params: 293 * area = . [allow-none] 294 */ 295 public void applyDefaultBackground(Window window, int setBg, GtkStateType stateType, Rectangle area, int x, int y, int width, int height) 296 { 297 // void gtk_style_apply_default_background (GtkStyle *style, GdkWindow *window, gboolean set_bg, GtkStateType state_type, const GdkRectangle *area, gint x, gint y, gint width, gint height); 298 gtk_style_apply_default_background(gtkStyle, (window is null) ? null : window.getWindowStruct(), setBg, stateType, (area is null) ? null : area.getRectangleStruct(), x, y, width, height); 299 } 300 301 /** 302 * Looks up color_name in the style's logical color mappings, 303 * filling in color and returning TRUE if found, otherwise 304 * returning FALSE. Do not cache the found mapping, because 305 * it depends on the GtkStyle and might change when a theme 306 * switch occurs. 307 * Since 2.10 308 * Params: 309 * colorName = the name of the logical color to look up 310 * color = the GdkColor to fill in. [out] 311 * Returns: TRUE if the mapping was found. 312 */ 313 public int lookupColor(string colorName, Color color) 314 { 315 // gboolean gtk_style_lookup_color (GtkStyle *style, const gchar *color_name, GdkColor *color); 316 return gtk_style_lookup_color(gtkStyle, Str.toStringz(colorName), (color is null) ? null : color.getColorStruct()); 317 } 318 319 /** 320 * Looks up stock_id in the icon factories associated with style 321 * and the default icon factory, returning an icon set if found, 322 * otherwise NULL. 323 * Params: 324 * stockId = an icon name 325 * Returns: icon set of stock_id. [transfer none] 326 */ 327 public IconSet lookupIconSet(string stockId) 328 { 329 // GtkIconSet * gtk_style_lookup_icon_set (GtkStyle *style, const gchar *stock_id); 330 auto p = gtk_style_lookup_icon_set(gtkStyle, Str.toStringz(stockId)); 331 332 if(p is null) 333 { 334 return null; 335 } 336 337 return ObjectG.getDObject!(IconSet)(cast(GtkIconSet*) p); 338 } 339 340 /** 341 * Renders the icon specified by source at the given size 342 * according to the given parameters and returns the result in a 343 * pixbuf. 344 * Params: 345 * source = the GtkIconSource specifying the icon to render 346 * direction = a text direction 347 * state = a state 348 * size = (type int) the size to render the icon at. A size of 349 * (GtkIconSize)-1 means render at the size of the source and 350 * don't scale. 351 * widget = the widget. [allow-none] 352 * detail = a style detail. [allow-none] 353 * Returns: a newly-created GdkPixbuf containing the rendered icon. [transfer full] 354 */ 355 public Pixbuf renderIcon(IconSource source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, string detail) 356 { 357 // GdkPixbuf * gtk_style_render_icon (GtkStyle *style, const GtkIconSource *source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, GtkWidget *widget, const gchar *detail); 358 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)); 359 360 if(p is null) 361 { 362 return null; 363 } 364 365 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p); 366 } 367 368 /** 369 * Warning 370 * gtk_style_get_font is deprecated and should not be used in newly-written code. 371 * Gets the GdkFont to use for the given style. This is 372 * meant only as a replacement for direct access to style->font 373 * and should not be used in new code. New code should 374 * use style->font_desc instead. 375 * Returns: the GdkFont for the style. This font is owned by the style; if you want to keep around a copy, you must call gdk_font_ref(). 376 */ 377 public Font getFont() 378 { 379 // GdkFont * gtk_style_get_font (GtkStyle *style); 380 auto p = gtk_style_get_font(gtkStyle); 381 382 if(p is null) 383 { 384 return null; 385 } 386 387 return ObjectG.getDObject!(Font)(cast(GdkFont*) p); 388 } 389 390 /** 391 * Warning 392 * gtk_style_set_font is deprecated and should not be used in newly-written code. 393 * Sets the GdkFont to use for a given style. This is 394 * meant only as a replacement for direct access to style->font 395 * and should not be used in new code. New code should 396 * use style->font_desc instead. 397 * Params: 398 * font = a GdkFont, or NULL to use the GdkFont corresponding 399 * to style->font_desc. [allow-none] 400 */ 401 public void setFont(Font font) 402 { 403 // void gtk_style_set_font (GtkStyle *style, GdkFont *font); 404 gtk_style_set_font(gtkStyle, (font is null) ? null : font.getFontStruct()); 405 } 406 407 /** 408 * Queries the value of a style property corresponding to a 409 * widget class is in the given style. 410 * Since 2.16 411 * Params: 412 * widgetType = the GType of a descendant of GtkWidget 413 * propertyName = the name of the style property to get 414 * value = a GValue where the value of the property being 415 * queried will be stored 416 */ 417 public void getStyleProperty(GType widgetType, string propertyName, Value value) 418 { 419 // void gtk_style_get_style_property (GtkStyle *style, GType widget_type, const gchar *property_name, GValue *value); 420 gtk_style_get_style_property(gtkStyle, widgetType, Str.toStringz(propertyName), (value is null) ? null : value.getValueStruct()); 421 } 422 423 /** 424 * Non-vararg variant of gtk_style_get(). 425 * Used primarily by language bindings. 426 * Since 2.16 427 * Params: 428 * widgetType = the GType of a descendant of GtkWidget 429 * firstPropertyName = the name of the first style property to get 430 * varArgs = a va_list of pairs of property names and 431 * locations to return the property values, starting with the 432 * location for first_property_name. 433 */ 434 public void getValist(GType widgetType, string firstPropertyName, void* varArgs) 435 { 436 // void gtk_style_get_valist (GtkStyle *style, GType widget_type, const gchar *first_property_name, va_list var_args); 437 gtk_style_get_valist(gtkStyle, widgetType, Str.toStringz(firstPropertyName), varArgs); 438 } 439 440 /** 441 * Warning 442 * gtk_draw_hline has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_hline() instead. 443 * Draws a horizontal line from (x1, y) to (x2, y) in window 444 * using the given style and state. 445 * Params: 446 * window = a GdkWindow 447 * stateType = a state 448 * x1 = the starting x coordinate 449 * x2 = the ending x coordinate 450 * y = the y coordinate 451 */ 452 public void drawHline(Window window, GtkStateType stateType, int x1, int x2, int y) 453 { 454 // void gtk_draw_hline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gint x1, gint x2, gint y); 455 gtk_draw_hline(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, x1, x2, y); 456 } 457 458 /** 459 * Warning 460 * gtk_draw_vline has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_vline() instead. 461 * Draws a vertical line from (x, y1_) to (x, y2_) in window 462 * using the given style and state. 463 * Params: 464 * window = a GdkWindow 465 * stateType = a state 466 * y1_ = the starting y coordinate 467 * y2_ = the ending y coordinate 468 * x = the x coordinate 469 */ 470 public void drawVline(Window window, GtkStateType stateType, int y1_, int y2_, int x) 471 { 472 // void gtk_draw_vline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gint y1_, gint y2_, gint x); 473 gtk_draw_vline(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, y1_, y2_, x); 474 } 475 476 /** 477 * Warning 478 * gtk_draw_shadow has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_shadow() instead. 479 * Draws a shadow around the given rectangle in window 480 * using the given style and state and shadow type. 481 * Params: 482 * window = a GdkWindow 483 * stateType = a state 484 * shadowType = type of shadow to draw 485 * x = x origin of the rectangle 486 * y = y origin of the rectangle 487 * width = width of the rectangle 488 * height = width of the rectangle 489 */ 490 public void drawShadow(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 491 { 492 // void gtk_draw_shadow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 493 gtk_draw_shadow(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 494 } 495 496 /** 497 * Warning 498 * gtk_draw_polygon has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_polygon() instead. 499 * Draws a polygon on window with the given parameters. 500 * Params: 501 * window = a GdkWindow 502 * stateType = a state 503 * shadowType = type of shadow to draw 504 * points = an array of GdkPoints 505 * fill = TRUE if the polygon should be filled 506 */ 507 public void drawPolygon(Window window, GtkStateType stateType, GtkShadowType shadowType, GdkPoint[] points, int fill) 508 { 509 // void gtk_draw_polygon (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkPoint *points, gint npoints, gboolean fill); 510 gtk_draw_polygon(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, points.ptr, cast(int) points.length, fill); 511 } 512 513 /** 514 * Warning 515 * gtk_draw_arrow has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_arrow() instead. 516 * Draws an arrow in the given rectangle on window using the given 517 * parameters. arrow_type determines the direction of the arrow. 518 * Params: 519 * window = a GdkWindow 520 * stateType = a state 521 * shadowType = the type of shadow to draw 522 * arrowType = the type of arrow to draw 523 * fill = TRUE if the arrow tip should be filled 524 * x = x origin of the rectangle to draw the arrow in 525 * y = y origin of the rectangle to draw the arrow in 526 * width = width of the rectangle to draw the arrow in 527 * height = height of the rectangle to draw the arrow in 528 */ 529 public void drawArrow(Window window, GtkStateType stateType, GtkShadowType shadowType, GtkArrowType arrowType, int fill, int x, int y, int width, int height) 530 { 531 // void gtk_draw_arrow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height); 532 gtk_draw_arrow(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, arrowType, fill, x, y, width, height); 533 } 534 535 /** 536 * Warning 537 * gtk_draw_diamond has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_diamond() instead. 538 * Draws a diamond in the given rectangle on window using the given 539 * parameters. 540 * Params: 541 * window = a GdkWindow 542 * stateType = a state 543 * shadowType = the type of shadow to draw 544 * x = x origin of the rectangle to draw the diamond in 545 * y = y origin of the rectangle to draw the diamond in 546 * width = width of the rectangle to draw the diamond in 547 * height = height of the rectangle to draw the diamond in 548 */ 549 public void drawDiamond(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 550 { 551 // void gtk_draw_diamond (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 552 gtk_draw_diamond(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 553 } 554 555 /** 556 * Warning 557 * gtk_draw_string has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_layout() instead. 558 * Draws a text string on window with the given parameters. 559 * Params: 560 * window = a GdkWindow 561 * stateType = a state 562 * x = x origin 563 * y = y origin 564 * string = the string to draw 565 */ 566 public void drawString(Window window, GtkStateType stateType, int x, int y, string string) 567 { 568 // void gtk_draw_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gint x, gint y, const gchar *string); 569 gtk_draw_string(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, x, y, Str.toStringz(string)); 570 } 571 572 /** 573 * Warning 574 * gtk_draw_box has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_box() instead. 575 * Draws a box on window with the given parameters. 576 * Params: 577 * window = a GdkWindow 578 * stateType = a state 579 * shadowType = the type of shadow to draw 580 * x = x origin of the box 581 * y = y origin of the box 582 * width = the width of the box 583 * height = the height of the box 584 */ 585 public void drawBox(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 586 { 587 // void gtk_draw_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 588 gtk_draw_box(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 589 } 590 591 /** 592 * Warning 593 * gtk_draw_box_gap has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_box_gap() instead. 594 * Draws a box in window using the given style and state and shadow type, 595 * leaving a gap in one side. 596 * Params: 597 * window = a GdkWindow 598 * stateType = a state 599 * shadowType = type of shadow to draw 600 * x = x origin of the rectangle 601 * y = y origin of the rectangle 602 * width = width of the rectangle 603 * height = width of the rectangle 604 * gapSide = side in which to leave the gap 605 * gapX = starting position of the gap 606 * gapWidth = width of the gap 607 */ 608 public void drawBoxGap(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth) 609 { 610 // void gtk_draw_box_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); 611 gtk_draw_box_gap(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height, gapSide, gapX, gapWidth); 612 } 613 614 /** 615 * Warning 616 * gtk_draw_check has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_check() instead. 617 * Draws a check button indicator in the given rectangle on window with 618 * the given parameters. 619 * Params: 620 * window = a GdkWindow 621 * stateType = a state 622 * shadowType = the type of shadow to draw 623 * x = x origin of the rectangle to draw the check in 624 * y = y origin of the rectangle to draw the check in 625 * width = the width of the rectangle to draw the check in 626 * height = the height of the rectangle to draw the check in 627 */ 628 public void drawCheck(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 629 { 630 // void gtk_draw_check (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 631 gtk_draw_check(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 632 } 633 634 /** 635 * Warning 636 * gtk_draw_extension has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_extension() instead. 637 * Draws an extension, i.e. a notebook tab. 638 * Params: 639 * window = a GdkWindow 640 * stateType = a state 641 * shadowType = type of shadow to draw 642 * x = x origin of the extension 643 * y = y origin of the extension 644 * width = width of the extension 645 * height = width of the extension 646 * gapSide = the side on to which the extension is attached 647 */ 648 public void drawExtension(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height, GtkPositionType gapSide) 649 { 650 // void gtk_draw_extension (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height, GtkPositionType gap_side); 651 gtk_draw_extension(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height, gapSide); 652 } 653 654 /** 655 * Warning 656 * gtk_draw_flat_box has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_flat_box() instead. 657 * Draws a flat box on window with the given parameters. 658 * Params: 659 * window = a GdkWindow 660 * stateType = a state 661 * shadowType = the type of shadow to draw 662 * x = x origin of the box 663 * y = y origin of the box 664 * width = the width of the box 665 * height = the height of the box 666 */ 667 public void drawFlatBox(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 668 { 669 // void gtk_draw_flat_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 670 gtk_draw_flat_box(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 671 } 672 673 /** 674 * Warning 675 * gtk_draw_focus has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_focus() instead. 676 * Draws a focus indicator around the given rectangle on window using the 677 * given style. 678 * Params: 679 * window = a GdkWindow 680 * x = the x origin of the rectangle around which to draw a focus indicator 681 * y = the y origin of the rectangle around which to draw a focus indicator 682 * width = the width of the rectangle around which to draw a focus indicator 683 * height = the height of the rectangle around which to draw a focus indicator 684 */ 685 public void drawFocus(Window window, int x, int y, int width, int height) 686 { 687 // void gtk_draw_focus (GtkStyle *style, GdkWindow *window, gint x, gint y, gint width, gint height); 688 gtk_draw_focus(gtkStyle, (window is null) ? null : window.getWindowStruct(), x, y, width, height); 689 } 690 691 /** 692 * Warning 693 * gtk_draw_handle has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_handle() instead. 694 * Draws a handle as used in GtkHandleBox and GtkPaned. 695 * Params: 696 * window = a GdkWindow 697 * stateType = a state 698 * shadowType = type of shadow to draw 699 * x = x origin of the handle 700 * y = y origin of the handle 701 * width = with of the handle 702 * height = height of the handle 703 * orientation = the orientation of the handle 704 */ 705 public void drawHandle(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height, GtkOrientation orientation) 706 { 707 // void gtk_draw_handle (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height, GtkOrientation orientation); 708 gtk_draw_handle(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height, orientation); 709 } 710 711 /** 712 * Warning 713 * gtk_draw_option has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_option() instead. 714 * Draws a radio button indicator in the given rectangle on window with 715 * the given parameters. 716 * Params: 717 * window = a GdkWindow 718 * stateType = a state 719 * shadowType = the type of shadow to draw 720 * x = x origin of the rectangle to draw the option in 721 * y = y origin of the rectangle to draw the option in 722 * width = the width of the rectangle to draw the option in 723 * height = the height of the rectangle to draw the option in 724 */ 725 public void drawOption(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 726 { 727 // void gtk_draw_option (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 728 gtk_draw_option(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 729 } 730 731 /** 732 * Warning 733 * gtk_draw_shadow_gap has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_shadow_gap() instead. 734 * Draws a shadow around the given rectangle in window 735 * using the given style and state and shadow type, leaving a 736 * gap in one side. 737 * Params: 738 * window = a GdkWindow 739 * stateType = a state 740 * shadowType = type of shadow to draw 741 * x = x origin of the rectangle 742 * y = y origin of the rectangle 743 * width = width of the rectangle 744 * height = width of the rectangle 745 * gapSide = side in which to leave the gap 746 * gapX = starting position of the gap 747 * gapWidth = width of the gap 748 */ 749 public void drawShadowGap(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth) 750 { 751 // void gtk_draw_shadow_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); 752 gtk_draw_shadow_gap(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height, gapSide, gapX, gapWidth); 753 } 754 755 /** 756 * Warning 757 * gtk_draw_slider is deprecated and should not be used in newly-written code. 758 * Draws a slider in the given rectangle on window using the 759 * given style and orientation. 760 * Params: 761 * window = a GdkWindow 762 * stateType = a state 763 * shadowType = a shadow 764 * x = the x origin of the rectangle in which to draw a slider 765 * y = the y origin of the rectangle in which to draw a slider 766 * width = the width of the rectangle in which to draw a slider 767 * height = the height of the rectangle in which to draw a slider 768 * orientation = the orientation to be used 769 */ 770 public void drawSlider(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height, GtkOrientation orientation) 771 { 772 // void gtk_draw_slider (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height, GtkOrientation orientation); 773 gtk_draw_slider(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height, orientation); 774 } 775 776 /** 777 * Warning 778 * gtk_draw_tab has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_tab() instead. 779 * Draws an option menu tab (i.e. the up and down pointing arrows) 780 * in the given rectangle on window using the given parameters. 781 * Params: 782 * window = a GdkWindow 783 * stateType = a state 784 * shadowType = the type of shadow to draw 785 * x = x origin of the rectangle to draw the tab in 786 * y = y origin of the rectangle to draw the tab in 787 * width = the width of the rectangle to draw the tab in 788 * height = the height of the rectangle to draw the tab in 789 */ 790 public void drawTab(Window window, GtkStateType stateType, GtkShadowType shadowType, int x, int y, int width, int height) 791 { 792 // void gtk_draw_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, gint x, gint y, gint width, gint height); 793 gtk_draw_tab(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, x, y, width, height); 794 } 795 796 /** 797 * Warning 798 * gtk_draw_expander has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_expander() instead. 799 * Draws an expander as used in GtkTreeView. 800 * Params: 801 * window = a GdkWindow 802 * stateType = a state 803 * x = the x position to draw the expander at 804 * y = the y position to draw the expander at 805 * expanderStyle = the style to draw the expander in 806 */ 807 public void drawExpander(Window window, GtkStateType stateType, int x, int y, GtkExpanderStyle expanderStyle) 808 { 809 // void gtk_draw_expander (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gint x, gint y, GtkExpanderStyle expander_style); 810 gtk_draw_expander(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, x, y, expanderStyle); 811 } 812 813 /** 814 * Warning 815 * gtk_draw_layout is deprecated and should not be used in newly-written code. 816 * Draws a layout on window using the given parameters. 817 * Params: 818 * window = a GdkWindow 819 * stateType = a state 820 * useText = whether to use the text or foreground 821 * graphics context of style 822 * x = x origin 823 * y = y origin 824 * layout = the layout to draw 825 */ 826 public void drawLayout(Window window, GtkStateType stateType, int useText, int x, int y, PgLayout layout) 827 { 828 // void gtk_draw_layout (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gboolean use_text, gint x, gint y, PangoLayout *layout); 829 gtk_draw_layout(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, useText, x, y, (layout is null) ? null : layout.getPgLayoutStruct()); 830 } 831 832 /** 833 * Warning 834 * gtk_draw_resize_grip has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_resize_grip() instead. 835 * Draws a resize grip in the given rectangle on window using the given 836 * parameters. 837 * Params: 838 * window = a GdkWindow 839 * stateType = a state 840 * edge = the edge in which to draw the resize grip 841 * x = the x origin of the rectangle in which to draw the resize grip 842 * y = the y origin of the rectangle in which to draw the resize grip 843 * width = the width of the rectangle in which to draw the resize grip 844 * height = the height of the rectangle in which to draw the resize grip 845 */ 846 public void drawResizeGrip(Window window, GtkStateType stateType, GdkWindowEdge edge, int x, int y, int width, int height) 847 { 848 // void gtk_draw_resize_grip (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkWindowEdge edge, gint x, gint y, gint width, gint height); 849 gtk_draw_resize_grip(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, edge, x, y, width, height); 850 } 851 852 /** 853 * Draws an arrow in the given rectangle on window using the given 854 * parameters. arrow_type determines the direction of the arrow. 855 * Params: 856 * window = a GdkWindow 857 * stateType = a state 858 * shadowType = the type of shadow to draw 859 * area = clip rectangle, or NULL if the 860 * output should not be clipped. [allow-none] 861 * widget = the widget. [allow-none] 862 * detail = a style detail. [allow-none] 863 * arrowType = the type of arrow to draw 864 * fill = TRUE if the arrow tip should be filled 865 * x = x origin of the rectangle to draw the arrow in 866 * y = y origin of the rectangle to draw the arrow in 867 * width = width of the rectangle to draw the arrow in 868 * height = height of the rectangle to draw the arrow in 869 */ 870 public void paintArrow(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, GtkArrowType arrowType, int fill, int x, int y, int width, int height) 871 { 872 // void gtk_paint_arrow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height); 873 gtk_paint_arrow(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), arrowType, fill, x, y, width, height); 874 } 875 876 /** 877 * Draws a box on window with the given parameters. 878 * Params: 879 * window = a GdkWindow 880 * stateType = a state 881 * shadowType = the type of shadow to draw 882 * area = clip rectangle, or NULL if the 883 * output should not be clipped. [allow-none] 884 * widget = the widget. [allow-none] 885 * detail = a style detail. [allow-none] 886 * x = x origin of the box 887 * y = y origin of the box 888 * width = the width of the box 889 * height = the height of the box 890 */ 891 public void paintBox(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 892 { 893 // void gtk_paint_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 894 gtk_paint_box(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 895 } 896 897 /** 898 * Draws a box in window using the given style and state and shadow type, 899 * leaving a gap in one side. 900 * Params: 901 * window = a GdkWindow 902 * stateType = a state 903 * shadowType = type of shadow to draw 904 * area = clip rectangle, or NULL if the 905 * output should not be clipped. [allow-none] 906 * widget = the widget. [allow-none] 907 * detail = a style detail. [allow-none] 908 * x = x origin of the rectangle 909 * y = y origin of the rectangle 910 * width = width of the rectangle 911 * height = width of the rectangle 912 * gapSide = side in which to leave the gap 913 * gapX = starting position of the gap 914 * gapWidth = width of the gap 915 */ 916 public void paintBoxGap(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth) 917 { 918 // void gtk_paint_box_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); 919 gtk_paint_box_gap(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide, gapX, gapWidth); 920 } 921 922 /** 923 * Draws a check button indicator in the given rectangle on window with 924 * the given parameters. 925 * Params: 926 * window = a GdkWindow 927 * stateType = a state 928 * shadowType = the type of shadow to draw 929 * area = clip rectangle, or NULL if the 930 * output should not be clipped. [allow-none] 931 * widget = the widget. [allow-none] 932 * detail = a style detail. [allow-none] 933 * x = x origin of the rectangle to draw the check in 934 * y = y origin of the rectangle to draw the check in 935 * width = the width of the rectangle to draw the check in 936 * height = the height of the rectangle to draw the check in 937 */ 938 public void paintCheck(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 939 { 940 // void gtk_paint_check (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 941 gtk_paint_check(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 942 } 943 944 /** 945 * Draws a diamond in the given rectangle on window using the given 946 * parameters. 947 * Params: 948 * window = a GdkWindow 949 * stateType = a state 950 * shadowType = the type of shadow to draw 951 * area = clip rectangle, or NULL if the 952 * output should not be clipped. [allow-none] 953 * widget = the widget. [allow-none] 954 * detail = a style detail. [allow-none] 955 * x = x origin of the rectangle to draw the diamond in 956 * y = y origin of the rectangle to draw the diamond in 957 * width = width of the rectangle to draw the diamond in 958 * height = height of the rectangle to draw the diamond in 959 */ 960 public void paintDiamond(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 961 { 962 // void gtk_paint_diamond (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 963 gtk_paint_diamond(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 964 } 965 966 /** 967 * Draws an extension, i.e. a notebook tab. 968 * Params: 969 * window = a GdkWindow 970 * stateType = a state 971 * shadowType = type of shadow to draw 972 * area = clip rectangle, or NULL if the 973 * output should not be clipped. [allow-none] 974 * widget = the widget. [allow-none] 975 * detail = a style detail. [allow-none] 976 * x = x origin of the extension 977 * y = y origin of the extension 978 * width = width of the extension 979 * height = width of the extension 980 * gapSide = the side on to which the extension is attached 981 */ 982 public void paintExtension(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide) 983 { 984 // void gtk_paint_extension (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side); 985 gtk_paint_extension(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide); 986 } 987 988 /** 989 * Draws a flat box on window with the given parameters. 990 * Params: 991 * window = a GdkWindow 992 * stateType = a state 993 * shadowType = the type of shadow to draw 994 * area = clip rectangle, or NULL if the 995 * output should not be clipped. [allow-none] 996 * widget = the widget. [allow-none] 997 * detail = a style detail. [allow-none] 998 * x = x origin of the box 999 * y = y origin of the box 1000 * width = the width of the box 1001 * height = the height of the box 1002 */ 1003 public void paintFlatBox(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 1004 { 1005 // void gtk_paint_flat_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 1006 gtk_paint_flat_box(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 1007 } 1008 1009 /** 1010 * Draws a focus indicator around the given rectangle on window using the 1011 * given style. 1012 * Params: 1013 * window = a GdkWindow 1014 * stateType = a state 1015 * area = clip rectangle, or NULL if the 1016 * output should not be clipped. [allow-none] 1017 * widget = the widget. [allow-none] 1018 * detail = a style detail. [allow-none] 1019 * x = the x origin of the rectangle around which to draw a focus indicator 1020 * y = the y origin of the rectangle around which to draw a focus indicator 1021 * width = the width of the rectangle around which to draw a focus indicator 1022 * height = the height of the rectangle around which to draw a focus indicator 1023 */ 1024 public void paintFocus(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 1025 { 1026 // void gtk_paint_focus (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 1027 gtk_paint_focus(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 1028 } 1029 1030 /** 1031 * Draws a handle as used in GtkHandleBox and GtkPaned. 1032 * Params: 1033 * window = a GdkWindow 1034 * stateType = a state 1035 * shadowType = type of shadow to draw 1036 * area = clip rectangle, or NULL if the 1037 * output should not be clipped. [allow-none] 1038 * widget = the widget. [allow-none] 1039 * detail = a style detail. [allow-none] 1040 * x = x origin of the handle 1041 * y = y origin of the handle 1042 * width = with of the handle 1043 * height = height of the handle 1044 * orientation = the orientation of the handle 1045 */ 1046 public void paintHandle(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height, GtkOrientation orientation) 1047 { 1048 // void gtk_paint_handle (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation); 1049 gtk_paint_handle(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, orientation); 1050 } 1051 1052 /** 1053 * Draws a horizontal line from (x1, y) to (x2, y) in window 1054 * using the given style and state. 1055 * Params: 1056 * window = a GdkWindow 1057 * stateType = a state 1058 * area = rectangle to which the output is clipped, or NULL if the 1059 * output should not be clipped. [allow-none] 1060 * widget = the widget. [allow-none] 1061 * detail = a style detail. [allow-none] 1062 * x1 = the starting x coordinate 1063 * x2 = the ending x coordinate 1064 * y = the y coordinate 1065 */ 1066 public void paintHline(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, int x1, int x2, int y) 1067 { 1068 // void gtk_paint_hline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x1, gint x2, gint y); 1069 gtk_paint_hline(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x1, x2, y); 1070 } 1071 1072 /** 1073 * Draws a radio button indicator in the given rectangle on window with 1074 * the given parameters. 1075 * Params: 1076 * window = a GdkWindow 1077 * stateType = a state 1078 * shadowType = the type of shadow to draw 1079 * area = clip rectangle, or NULL if the 1080 * output should not be clipped. [allow-none] 1081 * widget = the widget. [allow-none] 1082 * detail = a style detail. [allow-none] 1083 * x = x origin of the rectangle to draw the option in 1084 * y = y origin of the rectangle to draw the option in 1085 * width = the width of the rectangle to draw the option in 1086 * height = the height of the rectangle to draw the option in 1087 */ 1088 public void paintOption(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 1089 { 1090 // void gtk_paint_option (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 1091 gtk_paint_option(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 1092 } 1093 1094 /** 1095 * Draws a polygon on window with the given parameters. 1096 * Params: 1097 * window = a GdkWindow 1098 * stateType = a state 1099 * shadowType = type of shadow to draw 1100 * area = clip rectangle, or NULL if the 1101 * output should not be clipped. [allow-none] 1102 * widget = the widget. [allow-none] 1103 * detail = a style detail. [allow-none] 1104 * points = an array of GdkPoints 1105 * nPoints = length of points 1106 * fill = TRUE if the polygon should be filled 1107 */ 1108 public void paintPolygon(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, GdkPoint[] points, int nPoints, int fill) 1109 { 1110 // void gtk_paint_polygon (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, const GdkPoint *points, gint n_points, gboolean fill); 1111 gtk_paint_polygon(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), points.ptr, nPoints, fill); 1112 } 1113 1114 /** 1115 * Draws a shadow around the given rectangle in window 1116 * using the given style and state and shadow type. 1117 * Params: 1118 * window = a GdkWindow 1119 * stateType = a state 1120 * shadowType = type of shadow to draw 1121 * area = clip rectangle or NULL if the 1122 * output should not be clipped. [allow-none] 1123 * widget = the widget. [allow-none] 1124 * detail = a style detail. [allow-none] 1125 * x = x origin of the rectangle 1126 * y = y origin of the rectangle 1127 * width = width of the rectangle 1128 * height = width of the rectangle 1129 */ 1130 public void paintShadow(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 1131 { 1132 // void gtk_paint_shadow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 1133 gtk_paint_shadow(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 1134 } 1135 1136 /** 1137 * Draws a shadow around the given rectangle in window 1138 * using the given style and state and shadow type, leaving a 1139 * gap in one side. 1140 * Params: 1141 * window = a GdkWindow 1142 * stateType = a state 1143 * shadowType = type of shadow to draw 1144 * area = clip rectangle, or NULL if the 1145 * output should not be clipped. [allow-none] 1146 * widget = the widget. [allow-none] 1147 * detail = a style detail. [allow-none] 1148 * x = x origin of the rectangle 1149 * y = y origin of the rectangle 1150 * width = width of the rectangle 1151 * height = width of the rectangle 1152 * gapSide = side in which to leave the gap 1153 * gapX = starting position of the gap 1154 * gapWidth = width of the gap 1155 */ 1156 public void paintShadowGap(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height, GtkPositionType gapSide, int gapX, int gapWidth) 1157 { 1158 // void gtk_paint_shadow_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); 1159 gtk_paint_shadow_gap(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, gapSide, gapX, gapWidth); 1160 } 1161 1162 /** 1163 * Draws a slider in the given rectangle on window using the 1164 * given style and orientation. 1165 * Params: 1166 * window = a GdkWindow 1167 * stateType = a state 1168 * shadowType = a shadow 1169 * area = clip rectangle, or NULL if the 1170 * output should not be clipped. [allow-none] 1171 * widget = the widget. [allow-none] 1172 * detail = a style detail. [allow-none] 1173 * x = the x origin of the rectangle in which to draw a slider 1174 * y = the y origin of the rectangle in which to draw a slider 1175 * width = the width of the rectangle in which to draw a slider 1176 * height = the height of the rectangle in which to draw a slider 1177 * orientation = the orientation to be used 1178 */ 1179 public void paintSlider(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height, GtkOrientation orientation) 1180 { 1181 // void gtk_paint_slider (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation); 1182 gtk_paint_slider(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height, orientation); 1183 } 1184 1185 /** 1186 * Draws a spinner on window using the given parameters. 1187 * Since 2.20 1188 * Params: 1189 * window = a GdkWindow 1190 * stateType = a state 1191 * area = clip rectangle, or NULL if the 1192 * output should not be clipped. [allow-none] 1193 * widget = the widget (may be NULL). [allow-none] 1194 * detail = a style detail (may be NULL). [allow-none] 1195 * step = the nth step, a value between 0 and "num-steps" 1196 * x = the x origin of the rectangle in which to draw the spinner 1197 * y = the y origin of the rectangle in which to draw the spinner 1198 * width = the width of the rectangle in which to draw the spinner 1199 * height = the height of the rectangle in which to draw the spinner 1200 */ 1201 public void paintSpinner(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, uint step, int x, int y, int width, int height) 1202 { 1203 // void gtk_paint_spinner (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, guint step, gint x, gint y, gint width, gint height); 1204 gtk_paint_spinner(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), step, x, y, width, height); 1205 } 1206 1207 /** 1208 * Warning 1209 * gtk_paint_string has been deprecated since version 2.0 and should not be used in newly-written code. Use gtk_paint_layout() instead. 1210 * Draws a text string on window with the given parameters. 1211 * Params: 1212 * window = a GdkWindow 1213 * stateType = a state 1214 * area = clip rectangle, or NULL if the 1215 * output should not be clipped. [allow-none] 1216 * widget = the widget. [allow-none] 1217 * detail = a style detail. [allow-none] 1218 * x = x origin 1219 * y = y origin 1220 * string = the string to draw 1221 */ 1222 public void paintString(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, int x, int y, string string) 1223 { 1224 // void gtk_paint_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, const gchar *string); 1225 gtk_paint_string(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, Str.toStringz(string)); 1226 } 1227 1228 /** 1229 * Draws an option menu tab (i.e. the up and down pointing arrows) 1230 * in the given rectangle on window using the given parameters. 1231 * Params: 1232 * window = a GdkWindow 1233 * stateType = a state 1234 * shadowType = the type of shadow to draw 1235 * area = clip rectangle, or NULL if the 1236 * output should not be clipped. [allow-none] 1237 * widget = the widget. [allow-none] 1238 * detail = a style detail. [allow-none] 1239 * x = x origin of the rectangle to draw the tab in 1240 * y = y origin of the rectangle to draw the tab in 1241 * width = the width of the rectangle to draw the tab in 1242 * height = the height of the rectangle to draw the tab in 1243 */ 1244 public void paintTab(Window window, GtkStateType stateType, GtkShadowType shadowType, Rectangle area, Widget widget, string detail, int x, int y, int width, int height) 1245 { 1246 // void gtk_paint_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); 1247 gtk_paint_tab(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, shadowType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, width, height); 1248 } 1249 1250 /** 1251 * Draws a vertical line from (x, y1_) to (x, y2_) in window 1252 * using the given style and state. 1253 * Params: 1254 * window = a GdkWindow 1255 * stateType = a state 1256 * area = rectangle to which the output is clipped, or NULL if the 1257 * output should not be clipped. [allow-none] 1258 * widget = the widget. [allow-none] 1259 * detail = a style detail. [allow-none] 1260 * y1_ = the starting y coordinate 1261 * y2_ = the ending y coordinate 1262 * x = the x coordinate 1263 */ 1264 public void paintVline(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, int y1_, int y2_, int x) 1265 { 1266 // void gtk_paint_vline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint y1_, gint y2_, gint x); 1267 gtk_paint_vline(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), y1_, y2_, x); 1268 } 1269 1270 /** 1271 * Draws an expander as used in GtkTreeView. x and y specify the 1272 * center the expander. The size of the expander is determined by the 1273 * "expander-size" style property of widget. (If widget is not 1274 * specified or doesn't have an "expander-size" property, an 1275 * unspecified default size will be used, since the caller doesn't 1276 * have sufficient information to position the expander, this is 1277 * likely not useful.) The expander is expander_size pixels tall 1278 * in the collapsed position and expander_size pixels wide in the 1279 * expanded position. 1280 * Params: 1281 * window = a GdkWindow 1282 * stateType = a state 1283 * area = clip rectangle, or NULL if the 1284 * output should not be clipped. [allow-none] 1285 * widget = the widget. [allow-none] 1286 * detail = a style detail. [allow-none] 1287 * x = the x position to draw the expander at 1288 * y = the y position to draw the expander at 1289 * expanderStyle = the style to draw the expander in; determines 1290 * whether the expander is collapsed, expanded, or in an 1291 * intermediate state. 1292 */ 1293 public void paintExpander(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, int x, int y, GtkExpanderStyle expanderStyle) 1294 { 1295 // void gtk_paint_expander (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, GtkExpanderStyle expander_style); 1296 gtk_paint_expander(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, expanderStyle); 1297 } 1298 1299 /** 1300 * Draws a layout on window using the given parameters. 1301 * Params: 1302 * window = a GdkWindow 1303 * stateType = a state 1304 * useText = whether to use the text or foreground 1305 * graphics context of style 1306 * area = clip rectangle, or NULL if the 1307 * output should not be clipped. [allow-none] 1308 * widget = the widget. [allow-none] 1309 * detail = a style detail. [allow-none] 1310 * x = x origin 1311 * y = y origin 1312 * layout = the layout to draw 1313 */ 1314 public void paintLayout(Window window, GtkStateType stateType, int useText, Rectangle area, Widget widget, string detail, int x, int y, PgLayout layout) 1315 { 1316 // void gtk_paint_layout (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gboolean use_text, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, PangoLayout *layout); 1317 gtk_paint_layout(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, useText, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), x, y, (layout is null) ? null : layout.getPgLayoutStruct()); 1318 } 1319 1320 /** 1321 * Draws a resize grip in the given rectangle on window using the given 1322 * parameters. 1323 * Params: 1324 * window = a GdkWindow 1325 * stateType = a state 1326 * area = clip rectangle, or NULL if the 1327 * output should not be clipped. [allow-none] 1328 * widget = the widget. [allow-none] 1329 * detail = a style detail. [allow-none] 1330 * edge = the edge in which to draw the resize grip 1331 * x = the x origin of the rectangle in which to draw the resize grip 1332 * y = the y origin of the rectangle in which to draw the resize grip 1333 * width = the width of the rectangle in which to draw the resize grip 1334 * height = the height of the rectangle in which to draw the resize grip 1335 */ 1336 public void paintResizeGrip(Window window, GtkStateType stateType, Rectangle area, Widget widget, string detail, GdkWindowEdge edge, int x, int y, int width, int height) 1337 { 1338 // void gtk_paint_resize_grip (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle *area, GtkWidget *widget, const gchar *detail, GdkWindowEdge edge, gint x, gint y, gint width, gint height); 1339 gtk_paint_resize_grip(gtkStyle, (window is null) ? null : window.getWindowStruct(), stateType, (area is null) ? null : area.getRectangleStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail), edge, x, y, width, height); 1340 } 1341 1342 /** 1343 * Draws a text caret on drawable at location. This is not a style function 1344 * but merely a convenience function for drawing the standard cursor shape. 1345 * Since 2.4 1346 * Params: 1347 * widget = a GtkWidget 1348 * drawable = a GdkDrawable 1349 * area = rectangle to which the output is clipped, or NULL if the 1350 * output should not be clipped. [allow-none] 1351 * location = location where to draw the cursor (location->width is ignored) 1352 * isPrimary = if the cursor should be the primary cursor color. 1353 * direction = whether the cursor is left-to-right or 1354 * right-to-left. Should never be GTK_TEXT_DIR_NONE 1355 * drawArrow = TRUE to draw a directional arrow on the 1356 * cursor. Should be FALSE unless the cursor is split. 1357 */ 1358 public static void drawInsertionCursor(Widget widget, Drawable drawable, Rectangle area, Rectangle location, int isPrimary, GtkTextDirection direction, int drawArrow) 1359 { 1360 // void gtk_draw_insertion_cursor (GtkWidget *widget, GdkDrawable *drawable, const GdkRectangle *area, const GdkRectangle *location, gboolean is_primary, GtkTextDirection direction, gboolean draw_arrow); 1361 gtk_draw_insertion_cursor((widget is null) ? null : widget.getWidgetStruct(), (drawable is null) ? null : drawable.getDrawableStruct(), (area is null) ? null : area.getRectangleStruct(), (location is null) ? null : location.getRectangleStruct(), isPrimary, direction, drawArrow); 1362 } 1363 }