| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the |
| 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 17 | * Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
| 22 | * file for a list of people on the GTK+ Team. See the ChangeLog |
| 23 | * files for a list of changes. These files are distributed with |
| 24 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
| 25 | */ |
| 26 | |
| 27 | #ifndef __GTK_STYLE_H__ |
| 28 | #define __GTK_STYLE_H__ |
| 29 | |
| 30 | |
| 31 | #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
| 32 | #error "Only <gtk/gtk.h> can be included directly." |
| 33 | #endif |
| 34 | |
| 35 | #include <gdk/gdk.h> |
| 36 | #include <gtk/gtkenums.h> |
| 37 | |
| 38 | |
| 39 | G_BEGIN_DECLS |
| 40 | |
| 41 | #define GTK_TYPE_STYLE (gtk_style_get_type ()) |
| 42 | #define GTK_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle)) |
| 43 | #define GTK_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass)) |
| 44 | #define GTK_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_STYLE)) |
| 45 | #define GTK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE)) |
| 46 | #define GTK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass)) |
| 47 | |
| 48 | #define GTK_TYPE_BORDER (gtk_border_get_type ()) |
| 49 | |
| 50 | /* Some forward declarations needed to rationalize the header |
| 51 | * files. |
| 52 | */ |
| 53 | typedef struct _GtkBorder GtkBorder; |
| 54 | typedef struct _GtkStyle GtkStyle; |
| 55 | typedef struct _GtkStyleClass GtkStyleClass; |
| 56 | typedef struct _GtkThemeEngine GtkThemeEngine; |
| 57 | typedef struct _GtkRcStyle GtkRcStyle; |
| 58 | typedef struct _GtkIconSet GtkIconSet; |
| 59 | typedef struct _GtkIconSource GtkIconSource; |
| 60 | typedef struct _GtkRcProperty GtkRcProperty; |
| 61 | typedef struct _GtkSettings GtkSettings; |
| 62 | typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec, |
| 63 | const GString *rc_string, |
| 64 | GValue *property_value); |
| 65 | |
| 66 | /* We make this forward declaration here, since we pass |
| 67 | * GtkWidget's to the draw functions. |
| 68 | */ |
| 69 | typedef struct _GtkWidget GtkWidget; |
| 70 | |
| 71 | #define GTK_STYLE_ATTACHED(style) (GTK_STYLE (style)->attach_count > 0) |
| 72 | |
| 73 | struct _GtkStyle |
| 74 | { |
| 75 | GObject parent_instance; |
| 76 | |
| 77 | /*< public >*/ |
| 78 | |
| 79 | GdkColor fg[5]; |
| 80 | GdkColor bg[5]; |
| 81 | GdkColor light[5]; |
| 82 | GdkColor dark[5]; |
| 83 | GdkColor mid[5]; |
| 84 | GdkColor text[5]; |
| 85 | GdkColor base[5]; |
| 86 | GdkColor text_aa[5]; /* Halfway between text/base */ |
| 87 | |
| 88 | GdkColor black; |
| 89 | GdkColor white; |
| 90 | PangoFontDescription *font_desc; |
| 91 | |
| 92 | gint xthickness; |
| 93 | gint ythickness; |
| 94 | |
| 95 | GdkGC *fg_gc[5]; |
| 96 | GdkGC *bg_gc[5]; |
| 97 | GdkGC *light_gc[5]; |
| 98 | GdkGC *dark_gc[5]; |
| 99 | GdkGC *mid_gc[5]; |
| 100 | GdkGC *text_gc[5]; |
| 101 | GdkGC *base_gc[5]; |
| 102 | GdkGC *text_aa_gc[5]; |
| 103 | GdkGC *black_gc; |
| 104 | GdkGC *white_gc; |
| 105 | |
| 106 | GdkPixmap *bg_pixmap[5]; |
| 107 | |
| 108 | /*< private >*/ |
| 109 | |
| 110 | gint attach_count; |
| 111 | |
| 112 | gint depth; |
| 113 | GdkColormap *colormap; |
| 114 | GdkFont *private_font; |
| 115 | PangoFontDescription *private_font_desc; /* Font description for style->private_font or %NULL */ |
| 116 | |
| 117 | /* the RcStyle from which this style was created */ |
| 118 | GtkRcStyle *rc_style; |
| 119 | |
| 120 | GSList *styles; /* of type GtkStyle* */ |
| 121 | GArray *property_cache; |
| 122 | GSList *icon_factories; /* of type GtkIconFactory* */ |
| 123 | }; |
| 124 | |
| 125 | struct _GtkStyleClass |
| 126 | { |
| 127 | GObjectClass parent_class; |
| 128 | |
| 129 | /* Initialize for a particular colormap/depth |
| 130 | * combination. style->colormap/style->depth will have |
| 131 | * been set at this point. Will typically chain to parent. |
| 132 | */ |
| 133 | void (*realize) (GtkStyle *style); |
| 134 | |
| 135 | /* Clean up for a particular colormap/depth combination. Will |
| 136 | * typically chain to parent. |
| 137 | */ |
| 138 | void (*unrealize) (GtkStyle *style); |
| 139 | |
| 140 | /* Make style an exact duplicate of src. |
| 141 | */ |
| 142 | void (*copy) (GtkStyle *style, |
| 143 | GtkStyle *src); |
| 144 | |
| 145 | /* Create an empty style of the same type as this style. |
| 146 | * The default implementation, which does |
| 147 | * g_object_new (G_OBJECT_TYPE (style), NULL); |
| 148 | * should work in most cases. |
| 149 | */ |
| 150 | GtkStyle *(*clone) (GtkStyle *style); |
| 151 | |
| 152 | /* Initialize the GtkStyle with the values in the GtkRcStyle. |
| 153 | * should chain to the parent implementation. |
| 154 | */ |
| 155 | void (*init_from_rc) (GtkStyle *style, |
| 156 | GtkRcStyle *rc_style); |
| 157 | |
| 158 | void (*set_background) (GtkStyle *style, |
| 159 | GdkWindow *window, |
| 160 | GtkStateType state_type); |
| 161 | |
| 162 | |
| 163 | GdkPixbuf * (* render_icon) (GtkStyle *style, |
| 164 | const GtkIconSource *source, |
| 165 | GtkTextDirection direction, |
| 166 | GtkStateType state, |
| 167 | GtkIconSize size, |
| 168 | GtkWidget *widget, |
| 169 | const gchar *detail); |
| 170 | |
| 171 | /* Drawing functions |
| 172 | */ |
| 173 | |
| 174 | void (*draw_hline) (GtkStyle *style, |
| 175 | GdkWindow *window, |
| 176 | GtkStateType state_type, |
| 177 | GdkRectangle *area, |
| 178 | GtkWidget *widget, |
| 179 | const gchar *detail, |
| 180 | gint x1, |
| 181 | gint x2, |
| 182 | gint y); |
| 183 | void (*draw_vline) (GtkStyle *style, |
| 184 | GdkWindow *window, |
| 185 | GtkStateType state_type, |
| 186 | GdkRectangle *area, |
| 187 | GtkWidget *widget, |
| 188 | const gchar *detail, |
| 189 | gint y1_, |
| 190 | gint y2_, |
| 191 | gint x); |
| 192 | void (*draw_shadow) (GtkStyle *style, |
| 193 | GdkWindow *window, |
| 194 | GtkStateType state_type, |
| 195 | GtkShadowType shadow_type, |
| 196 | GdkRectangle *area, |
| 197 | GtkWidget *widget, |
| 198 | const gchar *detail, |
| 199 | gint x, |
| 200 | gint y, |
| 201 | gint width, |
| 202 | gint height); |
| 203 | void (*draw_polygon) (GtkStyle *style, |
| 204 | GdkWindow *window, |
| 205 | GtkStateType state_type, |
| 206 | GtkShadowType shadow_type, |
| 207 | GdkRectangle *area, |
| 208 | GtkWidget *widget, |
| 209 | const gchar *detail, |
| 210 | GdkPoint *point, |
| 211 | gint npoints, |
| 212 | gboolean fill); |
| 213 | void (*draw_arrow) (GtkStyle *style, |
| 214 | GdkWindow *window, |
| 215 | GtkStateType state_type, |
| 216 | GtkShadowType shadow_type, |
| 217 | GdkRectangle *area, |
| 218 | GtkWidget *widget, |
| 219 | const gchar *detail, |
| 220 | GtkArrowType arrow_type, |
| 221 | gboolean fill, |
| 222 | gint x, |
| 223 | gint y, |
| 224 | gint width, |
| 225 | gint height); |
| 226 | void (*draw_diamond) (GtkStyle *style, |
| 227 | GdkWindow *window, |
| 228 | GtkStateType state_type, |
| 229 | GtkShadowType shadow_type, |
| 230 | GdkRectangle *area, |
| 231 | GtkWidget *widget, |
| 232 | const gchar *detail, |
| 233 | gint x, |
| 234 | gint y, |
| 235 | gint width, |
| 236 | gint height); |
| 237 | void (*draw_string) (GtkStyle *style, |
| 238 | GdkWindow *window, |
| 239 | GtkStateType state_type, |
| 240 | GdkRectangle *area, |
| 241 | GtkWidget *widget, |
| 242 | const gchar *detail, |
| 243 | gint x, |
| 244 | gint y, |
| 245 | const gchar *string); |
| 246 | void (*draw_box) (GtkStyle *style, |
| 247 | GdkWindow *window, |
| 248 | GtkStateType state_type, |
| 249 | GtkShadowType shadow_type, |
| 250 | GdkRectangle *area, |
| 251 | GtkWidget *widget, |
| 252 | const gchar *detail, |
| 253 | gint x, |
| 254 | gint y, |
| 255 | gint width, |
| 256 | gint height); |
| 257 | void (*draw_flat_box) (GtkStyle *style, |
| 258 | GdkWindow *window, |
| 259 | GtkStateType state_type, |
| 260 | GtkShadowType shadow_type, |
| 261 | GdkRectangle *area, |
| 262 | GtkWidget *widget, |
| 263 | const gchar *detail, |
| 264 | gint x, |
| 265 | gint y, |
| 266 | gint width, |
| 267 | gint height); |
| 268 | void (*draw_check) (GtkStyle *style, |
| 269 | GdkWindow *window, |
| 270 | GtkStateType state_type, |
| 271 | GtkShadowType shadow_type, |
| 272 | GdkRectangle *area, |
| 273 | GtkWidget *widget, |
| 274 | const gchar *detail, |
| 275 | gint x, |
| 276 | gint y, |
| 277 | gint width, |
| 278 | gint height); |
| 279 | void (*draw_option) (GtkStyle *style, |
| 280 | GdkWindow *window, |
| 281 | GtkStateType state_type, |
| 282 | GtkShadowType shadow_type, |
| 283 | GdkRectangle *area, |
| 284 | GtkWidget *widget, |
| 285 | const gchar *detail, |
| 286 | gint x, |
| 287 | gint y, |
| 288 | gint width, |
| 289 | gint height); |
| 290 | void (*draw_tab) (GtkStyle *style, |
| 291 | GdkWindow *window, |
| 292 | GtkStateType state_type, |
| 293 | GtkShadowType shadow_type, |
| 294 | GdkRectangle *area, |
| 295 | GtkWidget *widget, |
| 296 | const gchar *detail, |
| 297 | gint x, |
| 298 | gint y, |
| 299 | gint width, |
| 300 | gint height); |
| 301 | void (*draw_shadow_gap) (GtkStyle *style, |
| 302 | GdkWindow *window, |
| 303 | GtkStateType state_type, |
| 304 | GtkShadowType shadow_type, |
| 305 | GdkRectangle *area, |
| 306 | GtkWidget *widget, |
| 307 | const gchar *detail, |
| 308 | gint x, |
| 309 | gint y, |
| 310 | gint width, |
| 311 | gint height, |
| 312 | GtkPositionType gap_side, |
| 313 | gint gap_x, |
| 314 | gint gap_width); |
| 315 | void (*draw_box_gap) (GtkStyle *style, |
| 316 | GdkWindow *window, |
| 317 | GtkStateType state_type, |
| 318 | GtkShadowType shadow_type, |
| 319 | GdkRectangle *area, |
| 320 | GtkWidget *widget, |
| 321 | const gchar *detail, |
| 322 | gint x, |
| 323 | gint y, |
| 324 | gint width, |
| 325 | gint height, |
| 326 | GtkPositionType gap_side, |
| 327 | gint gap_x, |
| 328 | gint gap_width); |
| 329 | void (*draw_extension) (GtkStyle *style, |
| 330 | GdkWindow *window, |
| 331 | GtkStateType state_type, |
| 332 | GtkShadowType shadow_type, |
| 333 | GdkRectangle *area, |
| 334 | GtkWidget *widget, |
| 335 | const gchar *detail, |
| 336 | gint x, |
| 337 | gint y, |
| 338 | gint width, |
| 339 | gint height, |
| 340 | GtkPositionType gap_side); |
| 341 | void (*draw_focus) (GtkStyle *style, |
| 342 | GdkWindow *window, |
| 343 | GtkStateType state_type, |
| 344 | GdkRectangle *area, |
| 345 | GtkWidget *widget, |
| 346 | const gchar *detail, |
| 347 | gint x, |
| 348 | gint y, |
| 349 | gint width, |
| 350 | gint height); |
| 351 | void (*draw_slider) (GtkStyle *style, |
| 352 | GdkWindow *window, |
| 353 | GtkStateType state_type, |
| 354 | GtkShadowType shadow_type, |
| 355 | GdkRectangle *area, |
| 356 | GtkWidget *widget, |
| 357 | const gchar *detail, |
| 358 | gint x, |
| 359 | gint y, |
| 360 | gint width, |
| 361 | gint height, |
| 362 | GtkOrientation orientation); |
| 363 | void (*draw_handle) (GtkStyle *style, |
| 364 | GdkWindow *window, |
| 365 | GtkStateType state_type, |
| 366 | GtkShadowType shadow_type, |
| 367 | GdkRectangle *area, |
| 368 | GtkWidget *widget, |
| 369 | const gchar *detail, |
| 370 | gint x, |
| 371 | gint y, |
| 372 | gint width, |
| 373 | gint height, |
| 374 | GtkOrientation orientation); |
| 375 | |
| 376 | void (*draw_expander) (GtkStyle *style, |
| 377 | GdkWindow *window, |
| 378 | GtkStateType state_type, |
| 379 | GdkRectangle *area, |
| 380 | GtkWidget *widget, |
| 381 | const gchar *detail, |
| 382 | gint x, |
| 383 | gint y, |
| 384 | GtkExpanderStyle expander_style); |
| 385 | void (*draw_layout) (GtkStyle *style, |
| 386 | GdkWindow *window, |
| 387 | GtkStateType state_type, |
| 388 | gboolean use_text, |
| 389 | GdkRectangle *area, |
| 390 | GtkWidget *widget, |
| 391 | const gchar *detail, |
| 392 | gint x, |
| 393 | gint y, |
| 394 | PangoLayout *layout); |
| 395 | void (*draw_resize_grip) (GtkStyle *style, |
| 396 | GdkWindow *window, |
| 397 | GtkStateType state_type, |
| 398 | GdkRectangle *area, |
| 399 | GtkWidget *widget, |
| 400 | const gchar *detail, |
| 401 | GdkWindowEdge edge, |
| 402 | gint x, |
| 403 | gint y, |
| 404 | gint width, |
| 405 | gint height); |
| 406 | void (*draw_spinner) (GtkStyle *style, |
| 407 | GdkWindow *window, |
| 408 | GtkStateType state_type, |
| 409 | GdkRectangle *area, |
| 410 | GtkWidget *widget, |
| 411 | const gchar *detail, |
| 412 | guint step, |
| 413 | gint x, |
| 414 | gint y, |
| 415 | gint width, |
| 416 | gint height); |
| 417 | |
| 418 | /* Padding for future expansion */ |
| 419 | void (*_gtk_reserved1) (void); |
| 420 | void (*_gtk_reserved2) (void); |
| 421 | void (*_gtk_reserved3) (void); |
| 422 | void (*_gtk_reserved4) (void); |
| 423 | void (*_gtk_reserved5) (void); |
| 424 | void (*_gtk_reserved6) (void); |
| 425 | void (*_gtk_reserved7) (void); |
| 426 | void (*_gtk_reserved8) (void); |
| 427 | void (*_gtk_reserved9) (void); |
| 428 | void (*_gtk_reserved10) (void); |
| 429 | void (*_gtk_reserved11) (void); |
| 430 | }; |
| 431 | |
| 432 | struct _GtkBorder |
| 433 | { |
| 434 | gint left; |
| 435 | gint right; |
| 436 | gint top; |
| 437 | gint bottom; |
| 438 | }; |
| 439 | |
| 440 | GType gtk_style_get_type (void) G_GNUC_CONST; |
| 441 | GtkStyle* gtk_style_new (void); |
| 442 | GtkStyle* gtk_style_copy (GtkStyle *style); |
| 443 | GtkStyle* gtk_style_attach (GtkStyle *style, |
| 444 | GdkWindow *window) G_GNUC_WARN_UNUSED_RESULT; |
| 445 | void gtk_style_detach (GtkStyle *style); |
| 446 | |
| 447 | #ifndef GTK_DISABLE_DEPRECATED |
| 448 | GtkStyle* gtk_style_ref (GtkStyle *style); |
| 449 | void gtk_style_unref (GtkStyle *style); |
| 450 | |
| 451 | GdkFont * gtk_style_get_font (GtkStyle *style); |
| 452 | void gtk_style_set_font (GtkStyle *style, |
| 453 | GdkFont *font); |
| 454 | #endif /* GTK_DISABLE_DEPRECATED */ |
| 455 | |
| 456 | void gtk_style_set_background (GtkStyle *style, |
| 457 | GdkWindow *window, |
| 458 | GtkStateType state_type); |
| 459 | void gtk_style_apply_default_background (GtkStyle *style, |
| 460 | GdkWindow *window, |
| 461 | gboolean set_bg, |
| 462 | GtkStateType state_type, |
| 463 | const GdkRectangle *area, |
| 464 | gint x, |
| 465 | gint y, |
| 466 | gint width, |
| 467 | gint height); |
| 468 | |
| 469 | GtkIconSet* gtk_style_lookup_icon_set (GtkStyle *style, |
| 470 | const gchar *stock_id); |
| 471 | gboolean gtk_style_lookup_color (GtkStyle *style, |
| 472 | const gchar *color_name, |
| 473 | GdkColor *color); |
| 474 | |
| 475 | GdkPixbuf* gtk_style_render_icon (GtkStyle *style, |
| 476 | const GtkIconSource *source, |
| 477 | GtkTextDirection direction, |
| 478 | GtkStateType state, |
| 479 | GtkIconSize size, |
| 480 | GtkWidget *widget, |
| 481 | const gchar *detail); |
| 482 | |
| 483 | #ifndef GTK_DISABLE_DEPRECATED |
| 484 | void gtk_draw_hline (GtkStyle *style, |
| 485 | GdkWindow *window, |
| 486 | GtkStateType state_type, |
| 487 | gint x1, |
| 488 | gint x2, |
| 489 | gint y); |
| 490 | void gtk_draw_vline (GtkStyle *style, |
| 491 | GdkWindow *window, |
| 492 | GtkStateType state_type, |
| 493 | gint y1_, |
| 494 | gint y2_, |
| 495 | gint x); |
| 496 | void gtk_draw_shadow (GtkStyle *style, |
| 497 | GdkWindow *window, |
| 498 | GtkStateType state_type, |
| 499 | GtkShadowType shadow_type, |
| 500 | gint x, |
| 501 | gint y, |
| 502 | gint width, |
| 503 | gint height); |
| 504 | void gtk_draw_polygon (GtkStyle *style, |
| 505 | GdkWindow *window, |
| 506 | GtkStateType state_type, |
| 507 | GtkShadowType shadow_type, |
| 508 | GdkPoint *points, |
| 509 | gint npoints, |
| 510 | gboolean fill); |
| 511 | void gtk_draw_arrow (GtkStyle *style, |
| 512 | GdkWindow *window, |
| 513 | GtkStateType state_type, |
| 514 | GtkShadowType shadow_type, |
| 515 | GtkArrowType arrow_type, |
| 516 | gboolean fill, |
| 517 | gint x, |
| 518 | gint y, |
| 519 | gint width, |
| 520 | gint height); |
| 521 | void gtk_draw_diamond (GtkStyle *style, |
| 522 | GdkWindow *window, |
| 523 | GtkStateType state_type, |
| 524 | GtkShadowType shadow_type, |
| 525 | gint x, |
| 526 | gint y, |
| 527 | gint width, |
| 528 | gint height); |
| 529 | void gtk_draw_box (GtkStyle *style, |
| 530 | GdkWindow *window, |
| 531 | GtkStateType state_type, |
| 532 | GtkShadowType shadow_type, |
| 533 | gint x, |
| 534 | gint y, |
| 535 | gint width, |
| 536 | gint height); |
| 537 | void gtk_draw_flat_box (GtkStyle *style, |
| 538 | GdkWindow *window, |
| 539 | GtkStateType state_type, |
| 540 | GtkShadowType shadow_type, |
| 541 | gint x, |
| 542 | gint y, |
| 543 | gint width, |
| 544 | gint height); |
| 545 | void gtk_draw_check (GtkStyle *style, |
| 546 | GdkWindow *window, |
| 547 | GtkStateType state_type, |
| 548 | GtkShadowType shadow_type, |
| 549 | gint x, |
| 550 | gint y, |
| 551 | gint width, |
| 552 | gint height); |
| 553 | void gtk_draw_option (GtkStyle *style, |
| 554 | GdkWindow *window, |
| 555 | GtkStateType state_type, |
| 556 | GtkShadowType shadow_type, |
| 557 | gint x, |
| 558 | gint y, |
| 559 | gint width, |
| 560 | gint height); |
| 561 | void gtk_draw_tab (GtkStyle *style, |
| 562 | GdkWindow *window, |
| 563 | GtkStateType state_type, |
| 564 | GtkShadowType shadow_type, |
| 565 | gint x, |
| 566 | gint y, |
| 567 | gint width, |
| 568 | gint height); |
| 569 | void gtk_draw_shadow_gap (GtkStyle *style, |
| 570 | GdkWindow *window, |
| 571 | GtkStateType state_type, |
| 572 | GtkShadowType shadow_type, |
| 573 | gint x, |
| 574 | gint y, |
| 575 | gint width, |
| 576 | gint height, |
| 577 | GtkPositionType gap_side, |
| 578 | gint gap_x, |
| 579 | gint gap_width); |
| 580 | void gtk_draw_box_gap (GtkStyle *style, |
| 581 | GdkWindow *window, |
| 582 | GtkStateType state_type, |
| 583 | GtkShadowType shadow_type, |
| 584 | gint x, |
| 585 | gint y, |
| 586 | gint width, |
| 587 | gint height, |
| 588 | GtkPositionType gap_side, |
| 589 | gint gap_x, |
| 590 | gint gap_width); |
| 591 | void gtk_draw_extension (GtkStyle *style, |
| 592 | GdkWindow *window, |
| 593 | GtkStateType state_type, |
| 594 | GtkShadowType shadow_type, |
| 595 | gint x, |
| 596 | gint y, |
| 597 | gint width, |
| 598 | gint height, |
| 599 | GtkPositionType gap_side); |
| 600 | void gtk_draw_focus (GtkStyle *style, |
| 601 | GdkWindow *window, |
| 602 | gint x, |
| 603 | gint y, |
| 604 | gint width, |
| 605 | gint height); |
| 606 | void gtk_draw_slider (GtkStyle *style, |
| 607 | GdkWindow *window, |
| 608 | GtkStateType state_type, |
| 609 | GtkShadowType shadow_type, |
| 610 | gint x, |
| 611 | gint y, |
| 612 | gint width, |
| 613 | gint height, |
| 614 | GtkOrientation orientation); |
| 615 | void gtk_draw_handle (GtkStyle *style, |
| 616 | GdkWindow *window, |
| 617 | GtkStateType state_type, |
| 618 | GtkShadowType shadow_type, |
| 619 | gint x, |
| 620 | gint y, |
| 621 | gint width, |
| 622 | gint height, |
| 623 | GtkOrientation orientation); |
| 624 | void gtk_draw_expander (GtkStyle *style, |
| 625 | GdkWindow *window, |
| 626 | GtkStateType state_type, |
| 627 | gint x, |
| 628 | gint y, |
| 629 | GtkExpanderStyle expander_style); |
| 630 | void gtk_draw_layout (GtkStyle *style, |
| 631 | GdkWindow *window, |
| 632 | GtkStateType state_type, |
| 633 | gboolean use_text, |
| 634 | gint x, |
| 635 | gint y, |
| 636 | PangoLayout *layout); |
| 637 | void gtk_draw_resize_grip (GtkStyle *style, |
| 638 | GdkWindow *window, |
| 639 | GtkStateType state_type, |
| 640 | GdkWindowEdge edge, |
| 641 | gint x, |
| 642 | gint y, |
| 643 | gint width, |
| 644 | gint height); |
| 645 | #endif /* GTK_DISABLE_DEPRECATED */ |
| 646 | |
| 647 | void gtk_paint_hline (GtkStyle *style, |
| 648 | GdkWindow *window, |
| 649 | GtkStateType state_type, |
| 650 | const GdkRectangle *area, |
| 651 | GtkWidget *widget, |
| 652 | const gchar *detail, |
| 653 | gint x1, |
| 654 | gint x2, |
| 655 | gint y); |
| 656 | void gtk_paint_vline (GtkStyle *style, |
| 657 | GdkWindow *window, |
| 658 | GtkStateType state_type, |
| 659 | const GdkRectangle *area, |
| 660 | GtkWidget *widget, |
| 661 | const gchar *detail, |
| 662 | gint y1_, |
| 663 | gint y2_, |
| 664 | gint x); |
| 665 | void gtk_paint_shadow (GtkStyle *style, |
| 666 | GdkWindow *window, |
| 667 | GtkStateType state_type, |
| 668 | GtkShadowType shadow_type, |
| 669 | const GdkRectangle *area, |
| 670 | GtkWidget *widget, |
| 671 | const gchar *detail, |
| 672 | gint x, |
| 673 | gint y, |
| 674 | gint width, |
| 675 | gint height); |
| 676 | void gtk_paint_polygon (GtkStyle *style, |
| 677 | GdkWindow *window, |
| 678 | GtkStateType state_type, |
| 679 | GtkShadowType shadow_type, |
| 680 | const GdkRectangle *area, |
| 681 | GtkWidget *widget, |
| 682 | const gchar *detail, |
| 683 | const GdkPoint *points, |
| 684 | gint n_points, |
| 685 | gboolean fill); |
| 686 | void gtk_paint_arrow (GtkStyle *style, |
| 687 | GdkWindow *window, |
| 688 | GtkStateType state_type, |
| 689 | GtkShadowType shadow_type, |
| 690 | const GdkRectangle *area, |
| 691 | GtkWidget *widget, |
| 692 | const gchar *detail, |
| 693 | GtkArrowType arrow_type, |
| 694 | gboolean fill, |
| 695 | gint x, |
| 696 | gint y, |
| 697 | gint width, |
| 698 | gint height); |
| 699 | void gtk_paint_diamond (GtkStyle *style, |
| 700 | GdkWindow *window, |
| 701 | GtkStateType state_type, |
| 702 | GtkShadowType shadow_type, |
| 703 | const GdkRectangle *area, |
| 704 | GtkWidget *widget, |
| 705 | const gchar *detail, |
| 706 | gint x, |
| 707 | gint y, |
| 708 | gint width, |
| 709 | gint height); |
| 710 | void gtk_paint_box (GtkStyle *style, |
| 711 | GdkWindow *window, |
| 712 | GtkStateType state_type, |
| 713 | GtkShadowType shadow_type, |
| 714 | const GdkRectangle *area, |
| 715 | GtkWidget *widget, |
| 716 | const gchar *detail, |
| 717 | gint x, |
| 718 | gint y, |
| 719 | gint width, |
| 720 | gint height); |
| 721 | void gtk_paint_flat_box (GtkStyle *style, |
| 722 | GdkWindow *window, |
| 723 | GtkStateType state_type, |
| 724 | GtkShadowType shadow_type, |
| 725 | const GdkRectangle *area, |
| 726 | GtkWidget *widget, |
| 727 | const gchar *detail, |
| 728 | gint x, |
| 729 | gint y, |
| 730 | gint width, |
| 731 | gint height); |
| 732 | void gtk_paint_check (GtkStyle *style, |
| 733 | GdkWindow *window, |
| 734 | GtkStateType state_type, |
| 735 | GtkShadowType shadow_type, |
| 736 | const GdkRectangle *area, |
| 737 | GtkWidget *widget, |
| 738 | const gchar *detail, |
| 739 | gint x, |
| 740 | gint y, |
| 741 | gint width, |
| 742 | gint height); |
| 743 | void gtk_paint_option (GtkStyle *style, |
| 744 | GdkWindow *window, |
| 745 | GtkStateType state_type, |
| 746 | GtkShadowType shadow_type, |
| 747 | const GdkRectangle *area, |
| 748 | GtkWidget *widget, |
| 749 | const gchar *detail, |
| 750 | gint x, |
| 751 | gint y, |
| 752 | gint width, |
| 753 | gint height); |
| 754 | void gtk_paint_tab (GtkStyle *style, |
| 755 | GdkWindow *window, |
| 756 | GtkStateType state_type, |
| 757 | GtkShadowType shadow_type, |
| 758 | const GdkRectangle *area, |
| 759 | GtkWidget *widget, |
| 760 | const gchar *detail, |
| 761 | gint x, |
| 762 | gint y, |
| 763 | gint width, |
| 764 | gint height); |
| 765 | void gtk_paint_shadow_gap (GtkStyle *style, |
| 766 | GdkWindow *window, |
| 767 | GtkStateType state_type, |
| 768 | GtkShadowType shadow_type, |
| 769 | const GdkRectangle *area, |
| 770 | GtkWidget *widget, |
| 771 | const gchar *detail, |
| 772 | gint x, |
| 773 | gint y, |
| 774 | gint width, |
| 775 | gint height, |
| 776 | GtkPositionType gap_side, |
| 777 | gint gap_x, |
| 778 | gint gap_width); |
| 779 | void gtk_paint_box_gap (GtkStyle *style, |
| 780 | GdkWindow *window, |
| 781 | GtkStateType state_type, |
| 782 | GtkShadowType shadow_type, |
| 783 | const GdkRectangle *area, |
| 784 | GtkWidget *widget, |
| 785 | const gchar *detail, |
| 786 | gint x, |
| 787 | gint y, |
| 788 | gint width, |
| 789 | gint height, |
| 790 | GtkPositionType gap_side, |
| 791 | gint gap_x, |
| 792 | gint gap_width); |
| 793 | void gtk_paint_extension (GtkStyle *style, |
| 794 | GdkWindow *window, |
| 795 | GtkStateType state_type, |
| 796 | GtkShadowType shadow_type, |
| 797 | const GdkRectangle *area, |
| 798 | GtkWidget *widget, |
| 799 | const gchar *detail, |
| 800 | gint x, |
| 801 | gint y, |
| 802 | gint width, |
| 803 | gint height, |
| 804 | GtkPositionType gap_side); |
| 805 | void gtk_paint_focus (GtkStyle *style, |
| 806 | GdkWindow *window, |
| 807 | GtkStateType state_type, |
| 808 | const GdkRectangle *area, |
| 809 | GtkWidget *widget, |
| 810 | const gchar *detail, |
| 811 | gint x, |
| 812 | gint y, |
| 813 | gint width, |
| 814 | gint height); |
| 815 | void gtk_paint_slider (GtkStyle *style, |
| 816 | GdkWindow *window, |
| 817 | GtkStateType state_type, |
| 818 | GtkShadowType shadow_type, |
| 819 | const GdkRectangle *area, |
| 820 | GtkWidget *widget, |
| 821 | const gchar *detail, |
| 822 | gint x, |
| 823 | gint y, |
| 824 | gint width, |
| 825 | gint height, |
| 826 | GtkOrientation orientation); |
| 827 | void gtk_paint_handle (GtkStyle *style, |
| 828 | GdkWindow *window, |
| 829 | GtkStateType state_type, |
| 830 | GtkShadowType shadow_type, |
| 831 | const GdkRectangle *area, |
| 832 | GtkWidget *widget, |
| 833 | const gchar *detail, |
| 834 | gint x, |
| 835 | gint y, |
| 836 | gint width, |
| 837 | gint height, |
| 838 | GtkOrientation orientation); |
| 839 | void gtk_paint_expander (GtkStyle *style, |
| 840 | GdkWindow *window, |
| 841 | GtkStateType state_type, |
| 842 | const GdkRectangle *area, |
| 843 | GtkWidget *widget, |
| 844 | const gchar *detail, |
| 845 | gint x, |
| 846 | gint y, |
| 847 | GtkExpanderStyle expander_style); |
| 848 | void gtk_paint_layout (GtkStyle *style, |
| 849 | GdkWindow *window, |
| 850 | GtkStateType state_type, |
| 851 | gboolean use_text, |
| 852 | const GdkRectangle *area, |
| 853 | GtkWidget *widget, |
| 854 | const gchar *detail, |
| 855 | gint x, |
| 856 | gint y, |
| 857 | PangoLayout *layout); |
| 858 | void gtk_paint_resize_grip (GtkStyle *style, |
| 859 | GdkWindow *window, |
| 860 | GtkStateType state_type, |
| 861 | const GdkRectangle *area, |
| 862 | GtkWidget *widget, |
| 863 | const gchar *detail, |
| 864 | GdkWindowEdge edge, |
| 865 | gint x, |
| 866 | gint y, |
| 867 | gint width, |
| 868 | gint height); |
| 869 | void gtk_paint_spinner (GtkStyle *style, |
| 870 | GdkWindow *window, |
| 871 | GtkStateType state_type, |
| 872 | const GdkRectangle *area, |
| 873 | GtkWidget *widget, |
| 874 | const gchar *detail, |
| 875 | guint step, |
| 876 | gint x, |
| 877 | gint y, |
| 878 | gint width, |
| 879 | gint height); |
| 880 | |
| 881 | GType gtk_border_get_type (void) G_GNUC_CONST; |
| 882 | GtkBorder *gtk_border_new (void) G_GNUC_MALLOC; |
| 883 | GtkBorder *gtk_border_copy (const GtkBorder *border_); |
| 884 | void gtk_border_free (GtkBorder *border_); |
| 885 | |
| 886 | void gtk_style_get_style_property (GtkStyle *style, |
| 887 | GType widget_type, |
| 888 | const gchar *property_name, |
| 889 | GValue *value); |
| 890 | void gtk_style_get_valist (GtkStyle *style, |
| 891 | GType widget_type, |
| 892 | const gchar *first_property_name, |
| 893 | va_list var_args); |
| 894 | void gtk_style_get (GtkStyle *style, |
| 895 | GType widget_type, |
| 896 | const gchar *first_property_name, |
| 897 | ...) G_GNUC_NULL_TERMINATED; |
| 898 | |
| 899 | /* --- private API --- */ |
| 900 | const GValue* _gtk_style_peek_property_value (GtkStyle *style, |
| 901 | GType widget_type, |
| 902 | GParamSpec *pspec, |
| 903 | GtkRcPropertyParser parser); |
| 904 | |
| 905 | void _gtk_style_init_for_settings (GtkStyle *style, |
| 906 | GtkSettings *settings); |
| 907 | |
| 908 | void _gtk_style_shade (const GdkColor *a, |
| 909 | GdkColor *b, |
| 910 | gdouble k); |
| 911 | |
| 912 | /* deprecated */ |
| 913 | #ifndef GTK_DISABLE_DEPRECATED |
| 914 | #define gtk_style_apply_default_pixmap(s,gw,st,a,x,y,w,h) gtk_style_apply_default_background (s,gw,1,st,a,x,y,w,h) |
| 915 | void gtk_draw_string (GtkStyle *style, |
| 916 | GdkWindow *window, |
| 917 | GtkStateType state_type, |
| 918 | gint x, |
| 919 | gint y, |
| 920 | const gchar *string); |
| 921 | void gtk_paint_string (GtkStyle *style, |
| 922 | GdkWindow *window, |
| 923 | GtkStateType state_type, |
| 924 | const GdkRectangle *area, |
| 925 | GtkWidget *widget, |
| 926 | const gchar *detail, |
| 927 | gint x, |
| 928 | gint y, |
| 929 | const gchar *string); |
| 930 | #endif /* GTK_DISABLE_DEPRECATED */ |
| 931 | |
| 932 | void gtk_draw_insertion_cursor (GtkWidget *widget, |
| 933 | GdkDrawable *drawable, |
| 934 | const GdkRectangle *area, |
| 935 | const GdkRectangle *location, |
| 936 | gboolean is_primary, |
| 937 | GtkTextDirection direction, |
| 938 | gboolean draw_arrow); |
| 939 | GdkGC *_gtk_widget_get_cursor_gc (GtkWidget *widget); |
| 940 | void _gtk_widget_get_cursor_color (GtkWidget *widget, |
| 941 | GdkColor *color); |
| 942 | |
| 943 | G_END_DECLS |
| 944 | |
| 945 | #endif /* __GTK_STYLE_H__ */ |
| 946 | |