1 /* GTK - The GIMP Toolkit 2 * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org> 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, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef __GTK_STYLE_CONTEXT_H__ 19 #define __GTK_STYLE_CONTEXT_H__ 20 21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) 22 #error "Only <gtk/gtk.h> can be included directly." 23 #endif 24 25 #include <gtk/gtkborder.h> 26 #include <gtk/gtkcsssection.h> 27 #include <gtk/gtkstyleprovider.h> 28 #include <gtk/gtktypes.h> 29 #include <atk/atk.h> 30 31 G_BEGIN_DECLS 32 33 #define GTK_TYPE_STYLE_CONTEXT (gtk_style_context_get_type ()) 34 #define GTK_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext)) 35 #define GTK_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass)) 36 #define GTK_IS_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT)) 37 #define GTK_IS_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_CONTEXT)) 38 #define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass)) 39 40 typedef struct _GtkStyleContextClass GtkStyleContextClass; 41 typedef struct _GtkStyleContextPrivate GtkStyleContextPrivate; 42 43 struct _GtkStyleContext 44 { 45 GObject parent_object; 46 GtkStyleContextPrivate *priv; 47 }; 48 49 struct _GtkStyleContextClass 50 { 51 GObjectClass parent_class; 52 53 void (* changed) (GtkStyleContext *context); 54 55 /* Padding for future expansion */ 56 void (*_gtk_reserved1) (void); 57 void (*_gtk_reserved2) (void); 58 void (*_gtk_reserved3) (void); 59 void (*_gtk_reserved4) (void); 60 }; 61 62 /* Default set of properties that GtkStyleContext may contain */ 63 64 /** 65 * GTK_STYLE_PROPERTY_BACKGROUND_COLOR: 66 * 67 * A property holding the background color of rendered elements as a #GdkRGBA. 68 */ 69 #define GTK_STYLE_PROPERTY_BACKGROUND_COLOR "background-color" 70 71 /** 72 * GTK_STYLE_PROPERTY_COLOR: 73 * 74 * A property holding the foreground color of rendered elements as a #GdkRGBA. 75 */ 76 #define GTK_STYLE_PROPERTY_COLOR "color" 77 78 /** 79 * GTK_STYLE_PROPERTY_FONT: 80 * 81 * A property holding the font properties used when rendering text 82 * as a #PangoFontDescription. 83 */ 84 #define GTK_STYLE_PROPERTY_FONT "font" 85 86 /** 87 * GTK_STYLE_PROPERTY_PADDING: 88 * 89 * A property holding the rendered element’s padding as a #GtkBorder. The 90 * padding is defined as the spacing between the inner part of the element border 91 * and its child. It’s the innermost spacing property of the padding/border/margin 92 * series. 93 */ 94 #define GTK_STYLE_PROPERTY_PADDING "padding" 95 96 /** 97 * GTK_STYLE_PROPERTY_BORDER_WIDTH: 98 * 99 * A property holding the rendered element’s border width in pixels as 100 * a #GtkBorder. The border is the intermediary spacing property of the 101 * padding/border/margin series. 102 * 103 * gtk_render_frame() uses this property to find out the frame line width, 104 * so #GtkWidgets rendering frames may need to add up this padding when 105 * requesting size 106 */ 107 #define GTK_STYLE_PROPERTY_BORDER_WIDTH "border-width" 108 109 /** 110 * GTK_STYLE_PROPERTY_MARGIN: 111 * 112 * A property holding the rendered element’s margin as a #GtkBorder. The 113 * margin is defined as the spacing between the border of the element 114 * and its surrounding elements. It is external to #GtkWidget's 115 * size allocations, and the most external spacing property of the 116 * padding/border/margin series. 117 */ 118 #define GTK_STYLE_PROPERTY_MARGIN "margin" 119 120 /** 121 * GTK_STYLE_PROPERTY_BORDER_RADIUS: 122 * 123 * A property holding the rendered element’s border radius in pixels as a #gint. 124 */ 125 #define GTK_STYLE_PROPERTY_BORDER_RADIUS "border-radius" 126 127 /** 128 * GTK_STYLE_PROPERTY_BORDER_STYLE: 129 * 130 * A property holding the element’s border style as a #GtkBorderStyle. 131 */ 132 #define GTK_STYLE_PROPERTY_BORDER_STYLE "border-style" 133 134 /** 135 * GTK_STYLE_PROPERTY_BORDER_COLOR: 136 * 137 * A property holding the element’s border color as a #GdkRGBA. 138 */ 139 #define GTK_STYLE_PROPERTY_BORDER_COLOR "border-color" 140 141 /** 142 * GTK_STYLE_PROPERTY_BACKGROUND_IMAGE: 143 * 144 * A property holding the element’s background as a #cairo_pattern_t. 145 */ 146 #define GTK_STYLE_PROPERTY_BACKGROUND_IMAGE "background-image" 147 148 /* Predefined set of CSS classes */ 149 150 /** 151 * GTK_STYLE_CLASS_CELL: 152 * 153 * A CSS class to match content rendered in cell views. 154 * 155 * Refer to individual widget documentation for used style classes. 156 */ 157 #define GTK_STYLE_CLASS_CELL "cell" 158 159 /** 160 * GTK_STYLE_CLASS_DIM_LABEL: 161 * 162 * A CSS class to match dimmed labels. 163 * 164 * Refer to individual widget documentation for used style classes. 165 */ 166 #define GTK_STYLE_CLASS_DIM_LABEL "dim-label" 167 168 /** 169 * GTK_STYLE_CLASS_ENTRY: 170 * 171 * A CSS class to match text entries. 172 * 173 * Refer to individual widget documentation for used style classes. 174 */ 175 #define GTK_STYLE_CLASS_ENTRY "entry" 176 177 /** 178 * GTK_STYLE_CLASS_LABEL: 179 * 180 * A CSS class to match labels. 181 * 182 * Refer to individual widget documentation for used style classes. 183 * 184 * Since: 3.16 185 */ 186 #define GTK_STYLE_CLASS_LABEL "label" 187 188 /** 189 * GTK_STYLE_CLASS_COMBOBOX_ENTRY: 190 * 191 * A CSS class to match combobox entries. 192 * 193 * Refer to individual widget documentation for used style classes. 194 */ 195 #define GTK_STYLE_CLASS_COMBOBOX_ENTRY "combobox-entry" 196 197 /** 198 * GTK_STYLE_CLASS_BUTTON: 199 * 200 * A CSS class to match buttons. 201 * 202 * Refer to individual widget documentation for used style classes. 203 */ 204 #define GTK_STYLE_CLASS_BUTTON "button" 205 206 /** 207 * GTK_STYLE_CLASS_LIST: 208 * 209 * A CSS class to match lists. 210 * 211 * Refer to individual widget documentation for used style classes. 212 */ 213 #define GTK_STYLE_CLASS_LIST "list" 214 215 /** 216 * GTK_STYLE_CLASS_LIST_ROW: 217 * 218 * A CSS class to match list rows. 219 * 220 * Refer to individual widget documentation for used style classes. 221 */ 222 #define GTK_STYLE_CLASS_LIST_ROW "list-row" 223 224 /** 225 * GTK_STYLE_CLASS_CALENDAR: 226 * 227 * A CSS class to match calendars. 228 * 229 * Refer to individual widget documentation for used style classes. 230 */ 231 #define GTK_STYLE_CLASS_CALENDAR "calendar" 232 233 /** 234 * GTK_STYLE_CLASS_SLIDER: 235 * 236 * A CSS class to match sliders. 237 * 238 * Refer to individual widget documentation for used style classes. 239 */ 240 #define GTK_STYLE_CLASS_SLIDER "slider" 241 242 /** 243 * GTK_STYLE_CLASS_BACKGROUND: 244 * 245 * A CSS class to match the window background. 246 * 247 * Refer to individual widget documentation for used style classes. 248 */ 249 #define GTK_STYLE_CLASS_BACKGROUND "background" 250 251 /** 252 * GTK_STYLE_CLASS_RUBBERBAND: 253 * 254 * A CSS class to match the rubberband selection rectangle. 255 * 256 * Refer to individual widget documentation for used style classes. 257 */ 258 #define GTK_STYLE_CLASS_RUBBERBAND "rubberband" 259 260 /** 261 * GTK_STYLE_CLASS_CSD: 262 * 263 * A CSS class that gets added to windows which have client-side decorations. 264 * 265 * Refer to individual widget documentation for used style classes. 266 * 267 * Since: 3.14 268 */ 269 #define GTK_STYLE_CLASS_CSD "csd" 270 271 /** 272 * GTK_STYLE_CLASS_TOOLTIP: 273 * 274 * A CSS class to match tooltip windows. 275 * 276 * Refer to individual widget documentation for used style classes. 277 */ 278 #define GTK_STYLE_CLASS_TOOLTIP "tooltip" 279 280 /** 281 * GTK_STYLE_CLASS_MENU: 282 * 283 * A CSS class to match menus. 284 * 285 * Refer to individual widget documentation for used style classes. 286 */ 287 #define GTK_STYLE_CLASS_MENU "menu" 288 289 /** 290 * GTK_STYLE_CLASS_CONTEXT_MENU: 291 * 292 * A CSS class to match context menus. 293 * 294 * Refer to individual widget documentation for used style classes. 295 */ 296 #define GTK_STYLE_CLASS_CONTEXT_MENU "context-menu" 297 298 /** 299 * GTK_STYLE_CLASS_TOUCH_SELECTION: 300 * 301 * A CSS class for touch selection popups on entries 302 * and text views. 303 * 304 * Refer to individual widget documentation for used style classes. 305 * 306 * Since: 3.16 307 */ 308 #define GTK_STYLE_CLASS_TOUCH_SELECTION "touch-selection" 309 310 /** 311 * GTK_STYLE_CLASS_MENUBAR: 312 * 313 * A CSS class to menubars. 314 * 315 * Refer to individual widget documentation for used style classes. 316 */ 317 #define GTK_STYLE_CLASS_MENUBAR "menubar" 318 319 /** 320 * GTK_STYLE_CLASS_MENUITEM: 321 * 322 * A CSS class to match menu items. 323 * 324 * Refer to individual widget documentation for used style classes. 325 */ 326 #define GTK_STYLE_CLASS_MENUITEM "menuitem" 327 328 /** 329 * GTK_STYLE_CLASS_TOOLBAR: 330 * 331 * A CSS class to match toolbars. 332 * 333 * Refer to individual widget documentation for used style classes. 334 */ 335 #define GTK_STYLE_CLASS_TOOLBAR "toolbar" 336 337 /** 338 * GTK_STYLE_CLASS_PRIMARY_TOOLBAR: 339 * 340 * A CSS class to match primary toolbars. 341 * 342 * Refer to individual widget documentation for used style classes. 343 */ 344 #define GTK_STYLE_CLASS_PRIMARY_TOOLBAR "primary-toolbar" 345 346 /** 347 * GTK_STYLE_CLASS_INLINE_TOOLBAR: 348 * 349 * A CSS class to match inline toolbars. 350 * 351 * Refer to individual widget documentation for used style classes. 352 */ 353 #define GTK_STYLE_CLASS_INLINE_TOOLBAR "inline-toolbar" 354 355 /** 356 * GTK_STYLE_CLASS_STATUSBAR: 357 * 358 * A CSS class to match statusbars. 359 * 360 * Refer to individual widget documentation for used style classes. 361 * 362 * Since: 3.16 363 */ 364 #define GTK_STYLE_CLASS_STATUSBAR "statusbar" 365 366 /** 367 * GTK_STYLE_CLASS_RADIO: 368 * 369 * A CSS class to match radio buttons. 370 * 371 * Refer to individual widget documentation for used style classes. 372 */ 373 #define GTK_STYLE_CLASS_RADIO "radio" 374 375 /** 376 * GTK_STYLE_CLASS_CHECK: 377 * 378 * A CSS class to match check boxes. 379 * 380 * Refer to individual widget documentation for used style classes. 381 */ 382 #define GTK_STYLE_CLASS_CHECK "check" 383 384 /** 385 * GTK_STYLE_CLASS_DEFAULT: 386 * 387 * A CSS class to match the default widget. 388 * 389 * Refer to individual widget documentation for used style classes. 390 */ 391 #define GTK_STYLE_CLASS_DEFAULT "default" 392 393 /** 394 * GTK_STYLE_CLASS_TROUGH: 395 * 396 * A CSS class to match troughs, as in scrollbars and progressbars. 397 * 398 * Refer to individual widget documentation for used style classes. 399 */ 400 #define GTK_STYLE_CLASS_TROUGH "trough" 401 402 /** 403 * GTK_STYLE_CLASS_SCROLLBAR: 404 * 405 * A CSS class to match scrollbars. 406 * 407 * Refer to individual widget documentation for used style classes. 408 */ 409 #define GTK_STYLE_CLASS_SCROLLBAR "scrollbar" 410 411 /** 412 * GTK_STYLE_CLASS_SCROLLBARS_JUNCTION: 413 * 414 * A CSS class to match the junction area between an horizontal 415 * and vertical scrollbar, when they’re both shown. 416 * 417 * Refer to individual widget documentation for used style classes. 418 */ 419 #define GTK_STYLE_CLASS_SCROLLBARS_JUNCTION "scrollbars-junction" 420 421 /** 422 * GTK_STYLE_CLASS_SCALE: 423 * 424 * A CSS class to match scale widgets. 425 * 426 * Refer to individual widget documentation for used style classes. 427 */ 428 #define GTK_STYLE_CLASS_SCALE "scale" 429 430 /** 431 * GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE: 432 * 433 * A CSS class to match scale widgets with marks attached, 434 * all the marks are above for horizontal #GtkScale. 435 * left for vertical #GtkScale. 436 * 437 * Refer to individual widget documentation for used style classes. 438 */ 439 #define GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE "scale-has-marks-above" 440 441 /** 442 * GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW: 443 * 444 * A CSS class to match scale widgets with marks attached, 445 * all the marks are below for horizontal #GtkScale, 446 * right for vertical #GtkScale. 447 * 448 * Refer to individual widget documentation for used style classes. 449 */ 450 #define GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW "scale-has-marks-below" 451 452 /** 453 * GTK_STYLE_CLASS_HEADER: 454 * 455 * A CSS class to match a header element. 456 * 457 * Refer to individual widget documentation for used style classes. 458 */ 459 #define GTK_STYLE_CLASS_HEADER "header" 460 461 /** 462 * GTK_STYLE_CLASS_ACCELERATOR: 463 * 464 * A CSS class to match an accelerator. 465 * 466 * Refer to individual widget documentation for used style classes. 467 */ 468 #define GTK_STYLE_CLASS_ACCELERATOR "accelerator" 469 470 /** 471 * GTK_STYLE_CLASS_RAISED: 472 * 473 * A CSS class to match a raised control, such as a raised 474 * button on a toolbar. 475 * 476 * Refer to individual widget documentation for used style classes. 477 */ 478 #define GTK_STYLE_CLASS_RAISED "raised" 479 480 /** 481 * GTK_STYLE_CLASS_LINKED: 482 * 483 * A CSS class to match a linked area, such as a box containing buttons 484 * belonging to the same control. 485 * 486 * Refer to individual widget documentation for used style classes. 487 */ 488 #define GTK_STYLE_CLASS_LINKED "linked" 489 490 /** 491 * GTK_STYLE_CLASS_GRIP: 492 * 493 * A CSS class defining a resize grip. 494 * 495 * Refer to individual widget documentation for used style classes. 496 */ 497 #define GTK_STYLE_CLASS_GRIP "grip" 498 499 /** 500 * GTK_STYLE_CLASS_DOCK: 501 * 502 * A CSS class defining a dock area. 503 * 504 * Refer to individual widget documentation for used style classes. 505 */ 506 #define GTK_STYLE_CLASS_DOCK "dock" 507 508 /** 509 * GTK_STYLE_CLASS_PROGRESSBAR: 510 * 511 * A CSS class to use when rendering activity as a progressbar. 512 * 513 * Refer to individual widget documentation for used style classes. 514 */ 515 #define GTK_STYLE_CLASS_PROGRESSBAR "progressbar" 516 517 /** 518 * GTK_STYLE_CLASS_SPINNER: 519 * 520 * A CSS class to use when rendering activity as a “spinner”. 521 * 522 * Refer to individual widget documentation for used style classes. 523 */ 524 #define GTK_STYLE_CLASS_SPINNER "spinner" 525 526 /** 527 * GTK_STYLE_CLASS_MARK: 528 * 529 * A CSS class defining marks in a widget, such as in scales. 530 * 531 * Refer to individual widget documentation for used style classes. 532 */ 533 #define GTK_STYLE_CLASS_MARK "mark" 534 535 /** 536 * GTK_STYLE_CLASS_EXPANDER: 537 * 538 * A CSS class defining an expander, such as those in treeviews. 539 * 540 * Refer to individual widget documentation for used style classes. 541 */ 542 #define GTK_STYLE_CLASS_EXPANDER "expander" 543 544 /** 545 * GTK_STYLE_CLASS_SPINBUTTON: 546 * 547 * A CSS class defining an spinbutton. 548 * 549 * Refer to individual widget documentation for used style classes. 550 */ 551 #define GTK_STYLE_CLASS_SPINBUTTON "spinbutton" 552 553 /** 554 * GTK_STYLE_CLASS_NOTEBOOK: 555 * 556 * A CSS class defining a notebook. 557 * 558 * Refer to individual widget documentation for used style classes. 559 */ 560 #define GTK_STYLE_CLASS_NOTEBOOK "notebook" 561 562 /** 563 * GTK_STYLE_CLASS_VIEW: 564 * 565 * A CSS class defining a view, such as iconviews or treeviews. 566 * 567 * Refer to individual widget documentation for used style classes. 568 */ 569 #define GTK_STYLE_CLASS_VIEW "view" 570 571 /** 572 * GTK_STYLE_CLASS_SIDEBAR: 573 * 574 * A CSS class defining a sidebar, such as the left side in 575 * a file chooser. 576 * 577 * Refer to individual widget documentation for used style classes. 578 */ 579 #define GTK_STYLE_CLASS_SIDEBAR "sidebar" 580 581 /** 582 * GTK_STYLE_CLASS_IMAGE: 583 * 584 * A CSS class defining an image, such as the icon in an entry. 585 * 586 * Refer to individual widget documentation for used style classes. 587 */ 588 #define GTK_STYLE_CLASS_IMAGE "image" 589 590 /** 591 * GTK_STYLE_CLASS_HIGHLIGHT: 592 * 593 * A CSS class defining a highlighted area, such as headings in 594 * assistants and calendars. 595 * 596 * Refer to individual widget documentation for used style classes. 597 */ 598 #define GTK_STYLE_CLASS_HIGHLIGHT "highlight" 599 600 /** 601 * GTK_STYLE_CLASS_FRAME: 602 * 603 * A CSS class defining a frame delimiting content, such as 604 * #GtkFrame or the scrolled window frame around the 605 * scrollable area. 606 * 607 * Refer to individual widget documentation for used style classes. 608 */ 609 #define GTK_STYLE_CLASS_FRAME "frame" 610 611 /** 612 * GTK_STYLE_CLASS_DND: 613 * 614 * A CSS class for a drag-and-drop indicator. 615 * 616 * Refer to individual widget documentation for used style classes. 617 */ 618 #define GTK_STYLE_CLASS_DND "dnd" 619 620 /** 621 * GTK_STYLE_CLASS_PANE_SEPARATOR: 622 * 623 * A CSS class for a pane separator, such as those in #GtkPaned. 624 * 625 * Refer to individual widget documentation for used style classes. 626 */ 627 #define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator" 628 629 /** 630 * GTK_STYLE_CLASS_SEPARATOR: 631 * 632 * A CSS class for a separator. 633 * 634 * Refer to individual widget documentation for used style classes. 635 */ 636 #define GTK_STYLE_CLASS_SEPARATOR "separator" 637 638 /** 639 * GTK_STYLE_CLASS_INFO: 640 * 641 * A CSS class for an area displaying an informational message, 642 * such as those in infobars. 643 * 644 * Refer to individual widget documentation for used style classes. 645 */ 646 #define GTK_STYLE_CLASS_INFO "info" 647 648 /** 649 * GTK_STYLE_CLASS_WARNING: 650 * 651 * A CSS class for an area displaying a warning message, 652 * such as those in infobars. 653 * 654 * Refer to individual widget documentation for used style classes. 655 */ 656 #define GTK_STYLE_CLASS_WARNING "warning" 657 658 /** 659 * GTK_STYLE_CLASS_QUESTION: 660 * 661 * A CSS class for an area displaying a question to the user, 662 * such as those in infobars. 663 * 664 * Refer to individual widget documentation for used style classes. 665 */ 666 #define GTK_STYLE_CLASS_QUESTION "question" 667 668 /** 669 * GTK_STYLE_CLASS_ERROR: 670 * 671 * A CSS class for an area displaying an error message, 672 * such as those in infobars. 673 * 674 * Refer to individual widget documentation for used style classes. 675 */ 676 #define GTK_STYLE_CLASS_ERROR "error" 677 678 /** 679 * GTK_STYLE_CLASS_HORIZONTAL: 680 * 681 * A CSS class for horizontally layered widgets. 682 * 683 * Refer to individual widget documentation for used style classes. 684 */ 685 #define GTK_STYLE_CLASS_HORIZONTAL "horizontal" 686 687 /** 688 * GTK_STYLE_CLASS_VERTICAL: 689 * 690 * A CSS class for vertically layered widgets. 691 * 692 * Refer to individual widget documentation for used style classes. 693 */ 694 #define GTK_STYLE_CLASS_VERTICAL "vertical" 695 696 /** 697 * GTK_STYLE_CLASS_TOP: 698 * 699 * A CSS class to indicate an area at the top of a widget. 700 * 701 * Refer to individual widget documentation for used style classes. 702 */ 703 #define GTK_STYLE_CLASS_TOP "top" 704 705 /** 706 * GTK_STYLE_CLASS_BOTTOM: 707 * 708 * A CSS class to indicate an area at the bottom of a widget. 709 * 710 * Refer to individual widget documentation for used style classes. 711 */ 712 #define GTK_STYLE_CLASS_BOTTOM "bottom" 713 714 /** 715 * GTK_STYLE_CLASS_LEFT: 716 * 717 * A CSS class to indicate an area at the left of a widget. 718 * 719 * Refer to individual widget documentation for used style classes. 720 */ 721 #define GTK_STYLE_CLASS_LEFT "left" 722 723 /** 724 * GTK_STYLE_CLASS_RIGHT: 725 * 726 * A CSS class to indicate an area at the right of a widget. 727 * 728 * Refer to individual widget documentation for used style classes. 729 */ 730 #define GTK_STYLE_CLASS_RIGHT "right" 731 732 /** 733 * GTK_STYLE_CLASS_PULSE: 734 * 735 * A CSS class to use when rendering a pulse in an indeterminate progress bar. 736 * 737 * Refer to individual widget documentation for used style classes. 738 */ 739 #define GTK_STYLE_CLASS_PULSE "pulse" 740 741 /** 742 * GTK_STYLE_CLASS_ARROW: 743 * 744 * A CSS class used when rendering an arrow element. 745 * 746 * Refer to individual widget documentation for used style classes. 747 */ 748 #define GTK_STYLE_CLASS_ARROW "arrow" 749 750 /** 751 * GTK_STYLE_CLASS_OSD: 752 * 753 * A CSS class used when rendering an OSD (On Screen Display) element, 754 * on top of another container. 755 * 756 * Refer to individual widget documentation for used style classes. 757 */ 758 #define GTK_STYLE_CLASS_OSD "osd" 759 760 /** 761 * GTK_STYLE_CLASS_LEVEL_BAR: 762 * 763 * A CSS class used when rendering a level indicator, such 764 * as a battery charge level, or a password strength. 765 * 766 * Refer to individual widget documentation for used style classes. 767 */ 768 #define GTK_STYLE_CLASS_LEVEL_BAR "level-bar" 769 770 /** 771 * GTK_STYLE_CLASS_CURSOR_HANDLE: 772 * 773 * A CSS class used when rendering a drag handle for 774 * text selection. 775 * 776 * Refer to individual widget documentation for used style classes. 777 */ 778 #define GTK_STYLE_CLASS_CURSOR_HANDLE "cursor-handle" 779 780 /** 781 * GTK_STYLE_CLASS_INSERTION_CURSOR: 782 * 783 * A CSS class used when rendering a drag handle for 784 * the insertion cursor position. 785 * 786 * Refer to individual widget documentation for used style classes. 787 */ 788 #define GTK_STYLE_CLASS_INSERTION_CURSOR "insertion-cursor" 789 790 /** 791 * GTK_STYLE_CLASS_TITLEBAR: 792 * 793 * A CSS class used when rendering a titlebar in a toplevel window. 794 * 795 * Refer to individual widget documentation for used style classes. 796 */ 797 #define GTK_STYLE_CLASS_TITLEBAR "titlebar" 798 799 /** 800 * GTK_STYLE_CLASS_TITLE: 801 * 802 * A CSS class used for the title label in a titlebar in 803 * a toplevel window. 804 * 805 * Refer to individual widget documentation for used style classes. 806 * 807 * Since: 3.14 808 */ 809 #define GTK_STYLE_CLASS_TITLE "title" 810 811 /** 812 * GTK_STYLE_CLASS_SUBTITLE: 813 * 814 * A CSS class used for the subtitle label in a titlebar in 815 * a toplevel window. 816 * 817 * Refer to individual widget documentation for used style classes. 818 * 819 * Since: 3.14 820 */ 821 #define GTK_STYLE_CLASS_SUBTITLE "subtitle" 822 823 /** 824 * GTK_STYLE_CLASS_NEEDS_ATTENTION: 825 * 826 * A CSS class used when an element needs the user attention, 827 * for instance a button in a stack switcher corresponding to 828 * a hidden page that changed state. 829 * 830 * Refer to individual widget documentation for used style classes. 831 * 832 * Since: 3.12 833 */ 834 #define GTK_STYLE_CLASS_NEEDS_ATTENTION "needs-attention" 835 836 /** 837 * GTK_STYLE_CLASS_SUGGESTED_ACTION: 838 * 839 * A CSS class used when an action (usually a button) is the 840 * primary suggested action in a specific context. 841 * 842 * Refer to individual widget documentation for used style classes. 843 * 844 * Since: 3.12 845 */ 846 #define GTK_STYLE_CLASS_SUGGESTED_ACTION "suggested-action" 847 848 /** 849 * GTK_STYLE_CLASS_DESTRUCTIVE_ACTION: 850 * 851 * A CSS class used when an action (usually a button) is 852 * one that is expected to remove or destroy something visible 853 * to the user. 854 * 855 * Refer to individual widget documentation for used style classes. 856 * 857 * Since: 3.12 858 */ 859 #define GTK_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action" 860 861 /** 862 * GTK_STYLE_CLASS_POPOVER: 863 * 864 * A CSS class that matches popovers. 865 * 866 * Refer to individual widget documentation for used style classes. 867 * 868 * Since: 3.14 869 */ 870 #define GTK_STYLE_CLASS_POPOVER "popover" 871 872 /* Predefined set of widget regions */ 873 874 /** 875 * GTK_STYLE_CLASS_POPUP: 876 * 877 * A CSS class that is added to the toplevel windows used for menus. 878 * 879 * Refer to individual widget documentation for used style classes. 880 * 881 * Since: 3.14 882 */ 883 #define GTK_STYLE_CLASS_POPUP "popup" 884 885 /** 886 * GTK_STYLE_CLASS_MESSAGE_DIALOG: 887 * 888 * A CSS class that is added to message dialogs. 889 * 890 * Refer to individual widget documentation for used style classes. 891 * 892 * Since: 3.14 893 */ 894 #define GTK_STYLE_CLASS_MESSAGE_DIALOG "message-dialog" 895 896 /** 897 * GTK_STYLE_CLASS_FLAT: 898 * 899 * A CSS class that is added when widgets that usually have 900 * a frame or border (like buttons or entries) should appear 901 * without it. 902 * 903 * Refer to individual widget documentation for used style classes. 904 * 905 * Since: 3.14 906 */ 907 #define GTK_STYLE_CLASS_FLAT "flat" 908 909 /** 910 * GTK_STYLE_CLASS_READ_ONLY: 911 * 912 * A CSS class used to indicate a read-only state. 913 * 914 * Refer to individual widget documentation for used style classes. 915 */ 916 #define GTK_STYLE_CLASS_READ_ONLY "read-only" 917 918 /** 919 * GTK_STYLE_CLASS_OVERSHOOT: 920 * 921 * A CSS class that is added on the visual hints that happen 922 * when scrolling is attempted past the limits of a scrollable 923 * area. 924 * 925 * Refer to individual widget documentation for used style classes. 926 * 927 * Since: 3.14 928 */ 929 #define GTK_STYLE_CLASS_OVERSHOOT "overshoot" 930 931 /** 932 * GTK_STYLE_CLASS_UNDERSHOOT: 933 * 934 * A CSS class that is added on the visual hints that happen 935 * where content is 'scrolled off' and can be made visible 936 * by scrolling. 937 * 938 * Refer to individual widget documentation for used style classes. 939 * 940 * Since: 3.16 941 */ 942 #define GTK_STYLE_CLASS_UNDERSHOOT "undershoot" 943 944 /** 945 * GTK_STYLE_CLASS_PAPER: 946 * 947 * A CSS class that is added to areas that should look like paper. 948 * 949 * This is used in print previews and themes are encouraged to 950 * style it as black text on white background. 951 * 952 * Refer to individual widget documentation for used style classes. 953 * 954 * Since: 3.16 955 */ 956 #define GTK_STYLE_CLASS_PAPER "paper" 957 958 /** 959 * GTK_STYLE_CLASS_MONOSPACE: 960 * 961 * A CSS class that is added to text view that should use 962 * a monospace font. 963 * 964 * Refer to individual widget documentation for used style classes. 965 * 966 * Since: 3.16 967 */ 968 #define GTK_STYLE_CLASS_MONOSPACE "monospace" 969 970 /** 971 * GTK_STYLE_CLASS_WIDE: 972 * 973 * A CSS class to indicate that a UI element should be 'wide'. 974 * Used by #GtkPaned. 975 * 976 * Refer to individual widget documentation for used style classes. 977 * 978 * Since: 3.16 979 */ 980 #define GTK_STYLE_CLASS_WIDE "wide" 981 982 /** 983 * GTK_STYLE_REGION_ROW: 984 * 985 * A widget region name to define a treeview row. 986 * 987 * Deprecated: 3.20: Don't use regions. 988 */ 989 #define GTK_STYLE_REGION_ROW "row" 990 991 /** 992 * GTK_STYLE_REGION_COLUMN: 993 * 994 * A widget region name to define a treeview column. 995 * 996 * Deprecated: 3.20: Don't use regions. 997 */ 998 #define GTK_STYLE_REGION_COLUMN "column" 999 1000 /** 1001 * GTK_STYLE_REGION_COLUMN_HEADER: 1002 * 1003 * A widget region name to define a treeview column header. 1004 * 1005 * Deprecated: 3.20: Don't use regions. 1006 */ 1007 #define GTK_STYLE_REGION_COLUMN_HEADER "column-header" 1008 1009 /** 1010 * GTK_STYLE_REGION_TAB: 1011 * 1012 * A widget region name to define a notebook tab. 1013 * 1014 * Deprecated: 3.20: Don't use regions. 1015 */ 1016 #define GTK_STYLE_REGION_TAB "tab" 1017 1018 GDK_AVAILABLE_IN_ALL 1019 GType gtk_style_context_get_type (void) G_GNUC_CONST; 1020 1021 GDK_AVAILABLE_IN_ALL 1022 GtkStyleContext * gtk_style_context_new (void); 1023 1024 GDK_AVAILABLE_IN_ALL 1025 void gtk_style_context_add_provider_for_screen (GdkScreen *screen, 1026 GtkStyleProvider *provider, 1027 guint priority); 1028 GDK_AVAILABLE_IN_ALL 1029 void gtk_style_context_remove_provider_for_screen (GdkScreen *screen, 1030 GtkStyleProvider *provider); 1031 1032 GDK_AVAILABLE_IN_ALL 1033 void gtk_style_context_add_provider (GtkStyleContext *context, 1034 GtkStyleProvider *provider, 1035 guint priority); 1036 1037 GDK_AVAILABLE_IN_ALL 1038 void gtk_style_context_remove_provider (GtkStyleContext *context, 1039 GtkStyleProvider *provider); 1040 1041 GDK_AVAILABLE_IN_ALL 1042 void gtk_style_context_save (GtkStyleContext *context); 1043 GDK_AVAILABLE_IN_ALL 1044 void gtk_style_context_restore (GtkStyleContext *context); 1045 1046 GDK_AVAILABLE_IN_ALL 1047 GtkCssSection * gtk_style_context_get_section (GtkStyleContext *context, 1048 const gchar *property); 1049 GDK_AVAILABLE_IN_ALL 1050 void gtk_style_context_get_property (GtkStyleContext *context, 1051 const gchar *property, 1052 GtkStateFlags state, 1053 GValue *value); 1054 GDK_AVAILABLE_IN_ALL 1055 void gtk_style_context_get_valist (GtkStyleContext *context, 1056 GtkStateFlags state, 1057 va_list args); 1058 GDK_AVAILABLE_IN_ALL 1059 void gtk_style_context_get (GtkStyleContext *context, 1060 GtkStateFlags state, 1061 ...) G_GNUC_NULL_TERMINATED; 1062 1063 GDK_AVAILABLE_IN_ALL 1064 void gtk_style_context_set_state (GtkStyleContext *context, 1065 GtkStateFlags flags); 1066 GDK_AVAILABLE_IN_ALL 1067 GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context); 1068 1069 GDK_AVAILABLE_IN_3_10 1070 void gtk_style_context_set_scale (GtkStyleContext *context, 1071 gint scale); 1072 GDK_AVAILABLE_IN_3_10 1073 gint gtk_style_context_get_scale (GtkStyleContext *context); 1074 1075 GDK_DEPRECATED_IN_3_6 1076 gboolean gtk_style_context_state_is_running (GtkStyleContext *context, 1077 GtkStateType state, 1078 gdouble *progress); 1079 1080 GDK_AVAILABLE_IN_ALL 1081 void gtk_style_context_set_path (GtkStyleContext *context, 1082 GtkWidgetPath *path); 1083 GDK_AVAILABLE_IN_ALL 1084 const GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context); 1085 GDK_AVAILABLE_IN_3_4 1086 void gtk_style_context_set_parent (GtkStyleContext *context, 1087 GtkStyleContext *parent); 1088 GDK_AVAILABLE_IN_ALL 1089 GtkStyleContext *gtk_style_context_get_parent (GtkStyleContext *context); 1090 1091 GDK_AVAILABLE_IN_ALL 1092 GList * gtk_style_context_list_classes (GtkStyleContext *context); 1093 1094 GDK_AVAILABLE_IN_ALL 1095 void gtk_style_context_add_class (GtkStyleContext *context, 1096 const gchar *class_name); 1097 GDK_AVAILABLE_IN_ALL 1098 void gtk_style_context_remove_class (GtkStyleContext *context, 1099 const gchar *class_name); 1100 GDK_AVAILABLE_IN_ALL 1101 gboolean gtk_style_context_has_class (GtkStyleContext *context, 1102 const gchar *class_name); 1103 1104 GDK_DEPRECATED_IN_3_14 1105 GList * gtk_style_context_list_regions (GtkStyleContext *context); 1106 1107 GDK_DEPRECATED_IN_3_14 1108 void gtk_style_context_add_region (GtkStyleContext *context, 1109 const gchar *region_name, 1110 GtkRegionFlags flags); 1111 GDK_DEPRECATED_IN_3_14 1112 void gtk_style_context_remove_region (GtkStyleContext *context, 1113 const gchar *region_name); 1114 GDK_DEPRECATED_IN_3_14 1115 gboolean gtk_style_context_has_region (GtkStyleContext *context, 1116 const gchar *region_name, 1117 GtkRegionFlags *flags_return); 1118 1119 GDK_AVAILABLE_IN_ALL 1120 void gtk_style_context_get_style_property (GtkStyleContext *context, 1121 const gchar *property_name, 1122 GValue *value); 1123 GDK_AVAILABLE_IN_ALL 1124 void gtk_style_context_get_style_valist (GtkStyleContext *context, 1125 va_list args); 1126 GDK_AVAILABLE_IN_ALL 1127 void gtk_style_context_get_style (GtkStyleContext *context, 1128 ...); 1129 1130 GDK_DEPRECATED_IN_3_10_FOR(gtk_icon_theme_lookup_icon) 1131 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context, 1132 const gchar *stock_id); 1133 GDK_DEPRECATED_IN_3_10 1134 GdkPixbuf * gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set, 1135 GtkStyleContext *context, 1136 GtkIconSize size); 1137 GDK_DEPRECATED_IN_3_10 1138 cairo_surface_t * 1139 gtk_icon_set_render_icon_surface (GtkIconSet *icon_set, 1140 GtkStyleContext *context, 1141 GtkIconSize size, 1142 int scale, 1143 GdkWindow *for_window); 1144 1145 GDK_AVAILABLE_IN_ALL 1146 void gtk_style_context_set_screen (GtkStyleContext *context, 1147 GdkScreen *screen); 1148 GDK_AVAILABLE_IN_ALL 1149 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context); 1150 1151 GDK_AVAILABLE_IN_3_8 1152 void gtk_style_context_set_frame_clock (GtkStyleContext *context, 1153 GdkFrameClock *frame_clock); 1154 GDK_AVAILABLE_IN_3_8 1155 GdkFrameClock *gtk_style_context_get_frame_clock (GtkStyleContext *context); 1156 1157 GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_set_state) 1158 void gtk_style_context_set_direction (GtkStyleContext *context, 1159 GtkTextDirection direction); 1160 GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get_state) 1161 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context); 1162 1163 GDK_AVAILABLE_IN_ALL 1164 void gtk_style_context_set_junction_sides (GtkStyleContext *context, 1165 GtkJunctionSides sides); 1166 GDK_AVAILABLE_IN_ALL 1167 GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext *context); 1168 1169 GDK_AVAILABLE_IN_ALL 1170 gboolean gtk_style_context_lookup_color (GtkStyleContext *context, 1171 const gchar *color_name, 1172 GdkRGBA *color); 1173 1174 GDK_DEPRECATED_IN_3_6 1175 void gtk_style_context_notify_state_change (GtkStyleContext *context, 1176 GdkWindow *window, 1177 gpointer region_id, 1178 GtkStateType state, 1179 gboolean state_value); 1180 GDK_DEPRECATED_IN_3_6 1181 void gtk_style_context_cancel_animations (GtkStyleContext *context, 1182 gpointer region_id); 1183 GDK_DEPRECATED_IN_3_6 1184 void gtk_style_context_scroll_animations (GtkStyleContext *context, 1185 GdkWindow *window, 1186 gint dx, 1187 gint dy); 1188 1189 GDK_DEPRECATED_IN_3_6 1190 void gtk_style_context_push_animatable_region (GtkStyleContext *context, 1191 gpointer region_id); 1192 GDK_DEPRECATED_IN_3_6 1193 void gtk_style_context_pop_animatable_region (GtkStyleContext *context); 1194 1195 /* Some helper functions to retrieve most common properties */ 1196 GDK_AVAILABLE_IN_ALL 1197 void gtk_style_context_get_color (GtkStyleContext *context, 1198 GtkStateFlags state, 1199 GdkRGBA *color); 1200 GDK_DEPRECATED_IN_3_16_FOR(gtk_render_background) 1201 void gtk_style_context_get_background_color (GtkStyleContext *context, 1202 GtkStateFlags state, 1203 GdkRGBA *color); 1204 GDK_DEPRECATED_IN_3_16_FOR(gtk_render_frame) 1205 void gtk_style_context_get_border_color (GtkStyleContext *context, 1206 GtkStateFlags state, 1207 GdkRGBA *color); 1208 1209 GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get) 1210 const PangoFontDescription * 1211 gtk_style_context_get_font (GtkStyleContext *context, 1212 GtkStateFlags state); 1213 GDK_AVAILABLE_IN_ALL 1214 void gtk_style_context_get_border (GtkStyleContext *context, 1215 GtkStateFlags state, 1216 GtkBorder *border); 1217 GDK_AVAILABLE_IN_ALL 1218 void gtk_style_context_get_padding (GtkStyleContext *context, 1219 GtkStateFlags state, 1220 GtkBorder *padding); 1221 GDK_AVAILABLE_IN_ALL 1222 void gtk_style_context_get_margin (GtkStyleContext *context, 1223 GtkStateFlags state, 1224 GtkBorder *margin); 1225 1226 GDK_DEPRECATED_IN_3_12 1227 void gtk_style_context_invalidate (GtkStyleContext *context); 1228 GDK_AVAILABLE_IN_ALL 1229 void gtk_style_context_reset_widgets (GdkScreen *screen); 1230 1231 GDK_DEPRECATED_IN_3_18_FOR(gtk_render_background) 1232 void gtk_style_context_set_background (GtkStyleContext *context, 1233 GdkWindow *window); 1234 1235 GDK_AVAILABLE_IN_3_4 1236 void gtk_render_insertion_cursor 1237 (GtkStyleContext *context, 1238 cairo_t *cr, 1239 gdouble x, 1240 gdouble y, 1241 PangoLayout *layout, 1242 int index, 1243 PangoDirection direction); 1244 GDK_DEPRECATED_IN_3_4 1245 void gtk_draw_insertion_cursor (GtkWidget *widget, 1246 cairo_t *cr, 1247 const GdkRectangle *location, 1248 gboolean is_primary, 1249 GtkTextDirection direction, 1250 gboolean draw_arrow); 1251 1252 typedef enum { 1253 GTK_STYLE_CONTEXT_PRINT_NONE = 0, 1254 GTK_STYLE_CONTEXT_PRINT_RECURSE = 1 << 0, 1255 GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1 1256 } GtkStyleContextPrintFlags; 1257 1258 GDK_AVAILABLE_IN_3_20 1259 char * gtk_style_context_to_string (GtkStyleContext *context, 1260 GtkStyleContextPrintFlags flags); 1261 1262 G_END_DECLS 1263 1264 #endif /* __GTK_STYLE_CONTEXT_H__ */ 1265