diff options
Diffstat (limited to 'gtk+-mingw/share/gtk-doc/html/gtk3/GtkCssProvider.html')
-rw-r--r-- | gtk+-mingw/share/gtk-doc/html/gtk3/GtkCssProvider.html | 2006 |
1 files changed, 0 insertions, 2006 deletions
diff --git a/gtk+-mingw/share/gtk-doc/html/gtk3/GtkCssProvider.html b/gtk+-mingw/share/gtk-doc/html/gtk3/GtkCssProvider.html deleted file mode 100644 index 28efe7e..0000000 --- a/gtk+-mingw/share/gtk-doc/html/gtk3/GtkCssProvider.html +++ /dev/null @@ -1,2006 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>GtkCssProvider</title> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> -<link rel="home" href="index.html" title="GTK+ 3 Reference Manual"> -<link rel="up" href="theming.html" title="Part III. Theming in GTK+"> -<link rel="prev" href="GtkStyleContext.html" title="GtkStyleContext"> -<link rel="next" href="GtkStyleProvider.html" title="GtkStyleProvider"> -<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)"> -<link rel="stylesheet" href="style.css" type="text/css"> -</head> -<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> -<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> -<tr valign="middle"> -<td><a accesskey="p" href="GtkStyleContext.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> -<td><a accesskey="u" href="theming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> -<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> -<th width="100%" align="center">GTK+ 3 Reference Manual</th> -<td><a accesskey="n" href="GtkStyleProvider.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> -</tr> -<tr><td colspan="5" class="shortcuts"> -<a href="#GtkCssProvider.synopsis" class="shortcut">Top</a> - | - <a href="#GtkCssProvider.description" class="shortcut">Description</a> - | - <a href="#GtkCssProvider.object-hierarchy" class="shortcut">Object Hierarchy</a> - | - <a href="#GtkCssProvider.implemented-interfaces" class="shortcut">Implemented Interfaces</a> - | - <a href="#GtkCssProvider.signals" class="shortcut">Signals</a> -</td></tr> -</table> -<div class="refentry"> -<a name="GtkCssProvider"></a><div class="titlepage"></div> -<div class="refnamediv"><table width="100%"><tr> -<td valign="top"> -<h2><span class="refentrytitle"><a name="GtkCssProvider.top_of_page"></a>GtkCssProvider</span></h2> -<p>GtkCssProvider — CSS-like styling for widgets</p> -</td> -<td valign="top" align="right"></td> -</tr></table></div> -<div class="refsynopsisdiv"> -<a name="GtkCssProvider.synopsis"></a><h2>Synopsis</h2> -<a name="GtkCssSection"></a><pre class="synopsis"> -#include <gtk/gtk.h> - -struct <a class="link" href="GtkCssProvider.html#GtkCssProvider-struct" title="struct GtkCssProvider">GtkCssProvider</a>; -<a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-provider-get-default" title="gtk_css_provider_get_default ()">gtk_css_provider_get_default</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-provider-get-named" title="gtk_css_provider_get_named ()">gtk_css_provider_get_named</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *variant</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-data" title="gtk_css_provider_load_from_data ()">gtk_css_provider_load_from_data</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-file" title="gtk_css_provider_load_from_file ()">gtk_css_provider_load_from_file</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="type">GFile</span></a> *file</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-path" title="gtk_css_provider_load_from_path ()">gtk_css_provider_load_from_path</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); -<a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-provider-new" title="gtk_css_provider_new ()">gtk_css_provider_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">char</span> * <a class="link" href="GtkCssProvider.html#gtk-css-provider-to-string" title="gtk_css_provider_to_string ()">gtk_css_provider_to_string</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *provider</code></em>); -#define <a class="link" href="GtkCssProvider.html#GTK-CSS-PROVIDER-ERROR:CAPS" title="GTK_CSS_PROVIDER_ERROR">GTK_CSS_PROVIDER_ERROR</a> -enum <a class="link" href="GtkCssProvider.html#GtkCssProviderError" title="enum GtkCssProviderError">GtkCssProviderError</a>; - - <a class="link" href="GtkCssProvider.html#GtkCssSection-struct" title="GtkCssSection">GtkCssSection</a>; -enum <a class="link" href="GtkCssProvider.html#GtkCssSectionType" title="enum GtkCssSectionType">GtkCssSectionType</a>; -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-section-get-end-line" title="gtk_css_section_get_end_line ()">gtk_css_section_get_end_line</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-section-get-end-position" title="gtk_css_section_get_end_position ()">gtk_css_section_get_end_position</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="returnvalue">GFile</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-section-get-file" title="gtk_css_section_get_file ()">gtk_css_section_get_file</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="returnvalue">GtkCssSection</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-section-get-parent" title="gtk_css_section_get_parent ()">gtk_css_section_get_parent</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a class="link" href="GtkCssProvider.html#GtkCssSectionType" title="enum GtkCssSectionType"><span class="returnvalue">GtkCssSectionType</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-section-get-section-type" title="gtk_css_section_get_section_type ()">gtk_css_section_get_section_type</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-section-get-start-line" title="gtk_css_section_get_start_line ()">gtk_css_section_get_start_line</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkCssProvider.html#gtk-css-section-get-start-position" title="gtk_css_section_get_start_position ()">gtk_css_section_get_start_position</a> (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="returnvalue">GtkCssSection</span></a> * <a class="link" href="GtkCssProvider.html#gtk-css-section-ref" title="gtk_css_section_ref ()">gtk_css_section_ref</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -<span class="returnvalue">void</span> <a class="link" href="GtkCssProvider.html#gtk-css-section-unref" title="gtk_css_section_unref ()">gtk_css_section_unref</a> (<em class="parameter"><code><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>); -</pre> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.object-hierarchy"></a><h2>Object Hierarchy</h2> -<pre class="synopsis"> - <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a> - +----GtkCssProvider -</pre> -<pre class="synopsis"> - GBoxed - +----GtkCssSection -</pre> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.implemented-interfaces"></a><h2>Implemented Interfaces</h2> -<p> -GtkCssProvider implements - <a class="link" href="GtkStyleProvider.html" title="GtkStyleProvider">GtkStyleProvider</a> and GtkStyleProviderPrivate.</p> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.signals"></a><h2>Signals</h2> -<pre class="synopsis"> - "<a class="link" href="GtkCssProvider.html#GtkCssProvider-parsing-error" title='The "parsing-error" signal'>parsing-error</a>" : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a> -</pre> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.description"></a><h2>Description</h2> -<p> -GtkCssProvider is an object implementing the <a class="link" href="GtkStyleProvider.html" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> interface. -It is able to parse <a class="ulink" href="http://www.w3.org/TR/CSS2" target="_top">CSS</a>-like -input in order to style widgets. -</p> -<p> -</p> -<div class="refsect2"> -<a name="gtkcssprovider-files"></a><h3>Default files</h3> -<p> -An application can cause GTK+ to parse a specific CSS style sheet by -calling <a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-file" title="gtk_css_provider_load_from_file ()"><code class="function">gtk_css_provider_load_from_file()</code></a> and adding the provider with -<a class="link" href="GtkStyleContext.html#gtk-style-context-add-provider" title="gtk_style_context_add_provider ()"><code class="function">gtk_style_context_add_provider()</code></a> or <a class="link" href="GtkStyleContext.html#gtk-style-context-add-provider-for-screen" title="gtk_style_context_add_provider_for_screen ()"><code class="function">gtk_style_context_add_provider_for_screen()</code></a>. -In addition, certain files will be read when GTK+ is initialized. First, -the file <code class="filename"><code class="envar">$XDG_CONFIG_HOME</code>/gtk-3.0/gtk.css</code> -is loaded if it exists. Then, GTK+ tries to load -<code class="filename"><code class="envar">$HOME</code>/.themes/<em class="replaceable"><code>theme-name</code></em>/gtk-3.0/gtk.css</code>, -falling back to -<code class="filename"><em class="replaceable"><code>datadir</code></em>/share/themes/<em class="replaceable"><code>theme-name</code></em>/gtk-3.0/gtk.css</code>, -where <em class="replaceable"><code>theme-name</code></em> is the name of the current theme -(see the <a class="link" href="GtkSettings.html#GtkSettings--gtk-theme-name" title='The "gtk-theme-name" property'><span class="type">"gtk-theme-name"</span></a> setting) and <em class="replaceable"><code>datadir</code></em> -is the prefix configured when GTK+ was compiled, unless overridden by the -<code class="envar">GTK_DATA_PREFIX</code> environment variable. -</p> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-stylesheets"></a><h3>Style sheets</h3> -<p> -The basic structure of the style sheets understood by this provider is -a series of statements, which are either rule sets or '@-rules', separated -by whitespace. -</p> -<p> -A rule set consists of a selector and a declaration block, which is -a series of declarations enclosed in curly braces ({ and }). The -declarations are separated by semicolons (;). Multiple selectors can -share the same declaration block, by putting all the separators in -front of the block, separated by commas. -</p> -<div class="example"> -<a name="id596379"></a><p class="title"><b>Example 23. A rule set with two selectors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">,</span><span class="normal"> <a href="GtkEntry.html">GtkEntry</a> </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #ff00ea</span><span class="symbol">;</span> -<span class="normal"> font</span><span class="symbol">:</span><span class="normal"> Comic Sans </span><span class="number">12</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-selectors"></a><h3>Selectors</h3> -<p> -Selectors work very similar to the way they do in CSS, with widget class -names taking the role of element names, and widget names taking the role -of IDs. When used in a selector, widget names must be prefixed with a -'#' character. The '*' character represents the so-called universal -selector, which matches any widget. -</p> -<p> -To express more complicated situations, selectors can be combined in -various ways: -</p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> -<li class="listitem"><p>To require that a widget satisfies several conditions, - combine several selectors into one by concatenating them. E.g. - <code class="literal">GtkButton#button1</code> matches a GtkButton widget - with the name button1.</p></li> -<li class="listitem"><p>To only match a widget when it occurs inside some other - widget, write the two selectors after each other, separated by whitespace. - E.g. <code class="literal">GtkToolBar GtkButton</code> matches GtkButton widgets - that occur inside a GtkToolBar.</p></li> -<li class="listitem"><p>In the previous example, the GtkButton is matched even - if it occurs deeply nested inside the toolbar. To restrict the match - to direct children of the parent widget, insert a '>' character between - the two selectors. E.g. <code class="literal">GtkNotebook > GtkLabel</code> matches - GtkLabel widgets that are direct children of a GtkNotebook.</p></li> -</ul></div> -<p> -</p> -<div class="example"> -<a name="id581522"></a><p class="title"><b>Example 24. Widget classes and names in selectors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="comment">/* Theme labels that are descendants of a window */</span> -<span class="usertype">GtkWindow</span><span class="normal"> <a href="GtkLabel.html">GtkLabel</a> </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #</span><span class="number">898989</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme notebooks, and anything that's within these */</span> -<span class="normal"><a href="GtkNotebook.html">GtkNotebook</a> </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #a939f0</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme combo boxes, and entries that</span> -<span class="comment"> are direct children of a notebook */</span> -<span class="normal"><a href="GtkComboBox.html">GtkComboBox</a></span><span class="symbol">,</span> -<span class="normal"><a href="GtkNotebook.html">GtkNotebook</a> </span><span class="symbol">></span><span class="normal"> <a href="GtkEntry.html">GtkEntry</a> </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> @fg_color</span><span class="symbol">;</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #1209a2</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme any widget within a GtkBin */</span> -<span class="normal"><a href="GtkBin.html">GtkBin</a> </span><span class="symbol">*</span><span class="normal"> </span><span class="cbracket">{</span> -<span class="normal"> font</span><span class="symbol">:</span><span class="normal"> Sans </span><span class="number">20</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme a label named title-label */</span> -<span class="normal">GtkLabel#title</span><span class="symbol">-</span><span class="normal">label </span><span class="cbracket">{</span> -<span class="normal"> font</span><span class="symbol">:</span><span class="normal"> Sans </span><span class="number">15</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme any widget named main-entry */</span> -<span class="preproc">#main</span><span class="symbol">-</span><span class="normal">entry </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #f0a810</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -Widgets may also define style classes, which can be used for matching. -When used in a selector, style classes must be prefixed with a '.' -character. -</p> -<p> -Refer to the documentation of individual widgets to learn which -style classes they define and see <a class="xref" href="GtkStyleContext.html#gtkstylecontext-classes" title="Style classes and regions">the section called “Style classes and regions”</a> -for a list of all style classes used by GTK+ widgets. -</p> -<p> -Note that there is some ambiguity in the selector syntax when it comes -to differentiation widget class names from regions. GTK+ currently treats -a string as a widget class name if it contains any uppercase characters -(which should work for more widgets with names like GtkLabel). -</p> -<div class="example"> -<a name="id596215"></a><p class="title"><b>Example 25. Style classes in selectors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="comment">/* Theme all widgets defining the class entry */</span> -<span class="symbol">.</span><span class="normal">entry </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #39f1f9</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme spinbuttons' entry */</span> -<span class="normal"><a href="GtkSpinButton.html">GtkSpinButton</a></span><span class="symbol">.</span><span class="normal">entry </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #</span><span class="number">900185</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -In complicated widgets like e.g. a GtkNotebook, it may be desirable -to style different parts of the widget differently. To make this -possible, container widgets may define regions, whose names -may be used for matching in selectors. -</p> -<p> -Some containers allow to further differentiate between regions by -applying so-called pseudo-classes to the region. For example, the -tab region in GtkNotebook allows to single out the first or last -tab by using the :first-child or :last-child pseudo-class. -When used in selectors, pseudo-classes must be prefixed with a -':' character. -</p> -<p> -Refer to the documentation of individual widgets to learn which -regions and pseudo-classes they define and see -<a class="xref" href="GtkStyleContext.html#gtkstylecontext-classes" title="Style classes and regions">the section called “Style classes and regions”</a> for a list of all regions -used by GTK+ widgets. -</p> -<div class="example"> -<a name="id596254"></a><p class="title"><b>Example 26. Regions in selectors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="comment">/* Theme any label within a notebook */</span> -<span class="usertype">GtkNotebook</span><span class="normal"> <a href="GtkLabel.html">GtkLabel</a> </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #f90192</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme labels within notebook tabs */</span> -<span class="normal"><a href="GtkNotebook.html">GtkNotebook</a> </span><span class="usertype">tab</span><span class="normal"> <a href="GtkLabel.html">GtkLabel</a> </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #</span><span class="number">703910</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme labels in the any first notebook</span> -<span class="comment"> tab, both selectors are equivalent */</span> -<span class="usertype">GtkNotebook</span><span class="normal"> tab</span><span class="symbol">:</span><span class="normal">nth</span><span class="symbol">-</span><span class="function">child</span><span class="symbol">(</span><span class="normal">first</span><span class="symbol">)</span><span class="normal"> <a href="GtkLabel.html">GtkLabel</a></span><span class="symbol">,</span> -<span class="usertype">GtkNotebook</span><span class="normal"> tab</span><span class="symbol">:</span><span class="normal">first</span><span class="symbol">-</span><span class="usertype">child</span><span class="normal"> <a href="GtkLabel.html">GtkLabel</a> </span><span class="cbracket">{</span> -<span class="normal"> color</span><span class="symbol">:</span><span class="normal"> #89d012</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -Another use of pseudo-classes is to match widgets depending on their -state. This is conceptually similar to the :hover, :active or :focus -pseudo-classes in CSS. The available pseudo-classes for widget states -are :active, :prelight (or :hover), :insensitive, :selected, :focused -and :inconsistent. -</p> -<div class="example"> -<a name="id628792"></a><p class="title"><b>Example 27. Styling specific widget states</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="comment">/* Theme active (pressed) buttons */</span> -<span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">:</span><span class="normal">active </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #0274d9</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme buttons with the mouse pointer on it,</span> -<span class="comment"> both are equivalent */</span> -<span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">:</span><span class="normal">hover</span><span class="symbol">,</span> -<span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">:</span><span class="normal">prelight </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #3085a9</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme insensitive widgets, both are equivalent */</span> -<span class="symbol">:</span><span class="normal">insensitive</span><span class="symbol">,</span> -<span class="symbol">*:</span><span class="normal">insensitive </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #320a91</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme selection colors in entries */</span> -<span class="normal"><a href="GtkEntry.html">GtkEntry</a></span><span class="symbol">:</span><span class="normal">selected </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #56f9a0</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme focused labels */</span> -<span class="normal"><a href="GtkLabel.html">GtkLabel</a></span><span class="symbol">:</span><span class="normal">focused </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #b4940f</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="comment">/* Theme inconsistent checkbuttons */</span> -<span class="normal"><a href="GtkCheckButton.html">GtkCheckButton</a></span><span class="symbol">:</span><span class="normal">inconsistent </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> #20395a</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -Widget state pseudoclasses may only apply to the last element -in a selector. -</p> -<p> -To determine the effective style for a widget, all the matching rule -sets are merged. As in CSS, rules apply by specificity, so the rules -whose selectors more closely match a widget path will take precedence -over the others. -</p> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-rules"></a><h3>@ Rules</h3> -<p> -GTK+'s CSS supports the @import rule, in order to load another -CSS style sheet in addition to the currently parsed one. -</p> -<div class="example"> -<a name="id628838"></a><p class="title"><b>Example 28. Using the @import rule</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="normal">@</span><span class="usertype">import</span><span class="normal"> </span><span class="function">url</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"path/to/common.css"</span><span class="symbol">);</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p><a name="css-binding-set"></a> -In order to extend key bindings affecting different widgets, GTK+ -supports the @binding-set rule to parse a set of bind/unbind -directives, see <a class="link" href="gtk3-Bindings.html#GtkBindingSet" title="struct GtkBindingSet"><span class="type">GtkBindingSet</span></a> for the supported syntax. Note that -the binding sets defined in this way must be associated with rule sets -by setting the gtk-key-bindings style property. -</p> -<p> -Customized key bindings are typically defined in a separate -<code class="filename">gtk-keys.css</code> CSS file and GTK+ loads this file -according to the current key theme, which is defined by the -<a class="link" href="GtkSettings.html#GtkSettings--gtk-key-theme-name" title='The "gtk-key-theme-name" property'><span class="type">"gtk-key-theme-name"</span></a> setting. -</p> -<div class="example"> -<a name="id598200"></a><p class="title"><b>Example 29. Using the @binding rule</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="normal">@binding</span><span class="symbol">-</span><span class="usertype">set</span><span class="normal"> binding</span><span class="symbol">-</span><span class="normal">set1 </span><span class="cbracket">{</span> -<span class="normal"> bind </span><span class="string">"<alt>Left"</span><span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="string">"move-cursor"</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">visual</span><span class="symbol">-</span><span class="normal">positions</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">3</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span> -<span class="normal"> unbind </span><span class="string">"End"</span><span class="symbol">;</span> -<span class="cbracket">}</span><span class="symbol">;</span> - -<span class="normal">@binding</span><span class="symbol">-</span><span class="usertype">set</span><span class="normal"> binding</span><span class="symbol">-</span><span class="normal">set2 </span><span class="cbracket">{</span> -<span class="normal"> bind </span><span class="string">"<alt>Right"</span><span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="string">"move-cursor"</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">visual</span><span class="symbol">-</span><span class="normal">positions</span><span class="symbol">,</span><span class="normal"> </span><span class="number">3</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span> -<span class="normal"> bind </span><span class="string">"<alt>KP_space"</span><span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="string">"delete-from-cursor"</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">whitespace</span><span class="symbol">,</span><span class="normal"> </span><span class="number">1</span><span class="symbol">)</span> -<span class="normal"> </span><span class="string">"insert-at-cursor"</span><span class="normal"> </span><span class="symbol">(</span><span class="string">" "</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span> -<span class="cbracket">}</span><span class="symbol">;</span> - -<span class="normal"><a href="GtkEntry.html">GtkEntry</a> </span><span class="cbracket">{</span> -<span class="normal"> gtk</span><span class="symbol">-</span><span class="normal">key</span><span class="symbol">-</span><span class="normal">bindings</span><span class="symbol">:</span><span class="normal"> binding</span><span class="symbol">-</span><span class="normal">set1</span><span class="symbol">,</span><span class="normal"> binding</span><span class="symbol">-</span><span class="normal">set2</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -GTK+ also supports an additional @define-color rule, in order -to define a color name which may be used instead of color numeric -representations. Also see the <a class="link" href="GtkSettings.html#GtkSettings--gtk-color-scheme" title='The "gtk-color-scheme" property'><span class="type">"gtk-color-scheme"</span></a> setting -for a way to override the values of these named colors. -</p> -<div class="example"> -<a name="id598232"></a><p class="title"><b>Example 30. Defining colors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="normal">@define</span><span class="symbol">-</span><span class="usertype">color</span><span class="normal"> bg_color #f9a039</span><span class="symbol">;</span> - -<span class="symbol">*</span><span class="normal"> </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> @bg_color</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-symbolic-colors"></a><h3>Symbolic colors</h3> -<p> -Besides being able to define color names, the CSS parser is also able -to read different color expressions, which can also be nested, providing -a rich language to define colors which are derived from a set of base -colors. -</p> -<div class="example"> -<a name="id598264"></a><p class="title"><b>Example 31. Using symbolic colors</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="normal">@define</span><span class="symbol">-</span><span class="usertype">color</span><span class="normal"> entry</span><span class="symbol">-</span><span class="usertype">color</span><span class="normal"> </span><span class="function">shade</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">@bg_color</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.7</span><span class="symbol">);</span> - -<span class="normal"><a href="GtkEntry.html">GtkEntry</a> </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> @entry</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">;</span> -<span class="cbracket">}</span> - -<span class="normal"><a href="GtkEntry.html">GtkEntry</a></span><span class="symbol">:</span><span class="normal">focused </span><span class="cbracket">{</span> -<span class="normal"> background</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">:</span><span class="normal"> </span><span class="function">mix</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">@entry</span><span class="symbol">-</span><span class="normal">color</span><span class="symbol">,</span> -<span class="normal"> </span><span class="function">shade</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">#fff</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">),</span> -<span class="normal"> </span><span class="number">0.8</span><span class="symbol">);</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> - The various ways to express colors in GTK+ CSS are: -</p> -<div class="informaltable"><table border="1"> -<colgroup> -<col> -<col> -<col> -</colgroup> -<thead><tr> -<th>Syntax</th> -<th>Explanation</th> -<th>Examples</th> -</tr></thead> -<tbody> -<tr> -<td>rgb(<em class="parameter"><code>r</code></em>, <em class="parameter"><code>g</code></em>, <em class="parameter"><code>b</code></em>)</td> -<td>An opaque color; <em class="parameter"><code>r</code></em>, <em class="parameter"><code>g</code></em>, <em class="parameter"><code>b</code></em> can be either integers between - 0 and 255 or percentages</td> -<td><div class="literallayout"><p>rgb(128, 10, 54)<br> -rgb(20%, 30%, 0%)</p></div></td> -</tr> -<tr> -<td>rgba(<em class="parameter"><code>r</code></em>, <em class="parameter"><code>g</code></em>, <em class="parameter"><code>b</code></em>, <em class="parameter"><code>a</code></em>)</td> -<td>A translucent color; <em class="parameter"><code>r</code></em>, <em class="parameter"><code>g</code></em>, <em class="parameter"><code>b</code></em> are as in the previous row, - <em class="parameter"><code>a</code></em> is a floating point number between 0 and 1</td> -<td><div class="literallayout"><p>rgba(255, 255, 0, 0.5)</p></div></td> -</tr> -<tr> -<td>#<em class="parameter"><code>xxyyzz</code></em> -</td> -<td>An opaque color; <em class="parameter"><code>xx</code></em>, <em class="parameter"><code>yy</code></em>, <em class="parameter"><code>zz</code></em> are hexadecimal numbers - specifying <em class="parameter"><code>r</code></em>, <em class="parameter"><code>g</code></em>, <em class="parameter"><code>b</code></em> variants with between 1 and 4 - hexadecimal digits per component are allowed</td> -<td><div class="literallayout"><p>#ff12ab<br> -#f0c</p></div></td> -</tr> -<tr> -<td>@name</td> -<td>Reference to a color that has been defined with - @define-color - </td> -<td>@bg_color</td> -</tr> -<tr> -<td>mix(<em class="parameter"><code>color1</code></em>, <em class="parameter"><code>color2</code></em>, <em class="parameter"><code>f</code></em>)</td> -<td>A linear combination of <em class="parameter"><code>color1</code></em> and <em class="parameter"><code>color2</code></em>. <em class="parameter"><code>f</code></em> is a - floating point number between 0 and 1.</td> -<td><div class="literallayout"><p>mix(#ff1e0a, @bg_color, 0.8)</p></div></td> -</tr> -<tr> -<td>shade(<em class="parameter"><code>color</code></em>, <em class="parameter"><code>f</code></em>)</td> -<td>A lighter or darker variant of <em class="parameter"><code>color</code></em>. <em class="parameter"><code>f</code></em> is a - floating point number. - </td> -<td>shade(@fg_color, 0.5)</td> -</tr> -<tr> -<td>lighter(<em class="parameter"><code>color</code></em>)</td> -<td>A lighter variant of <em class="parameter"><code>color</code></em> -</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>darker(<em class="parameter"><code>color</code></em>)</td> -<td>A darker variant of <em class="parameter"><code>color</code></em> -</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>alpha(<em class="parameter"><code>color</code></em>, <em class="parameter"><code>f</code></em>)</td> -<td>Modifies passed color's alpha by a factor <em class="parameter"><code>f</code></em>. <em class="parameter"><code>f</code></em> is a - floating point number. <em class="parameter"><code>f</code></em> < 1.0 results in a more transparent - color while <em class="parameter"><code>f</code></em> > 1.0 results in a more opaque color. - </td> -<td>alhpa(blue, 0.5)</td> -</tr> -</tbody> -</table></div> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-gradients"></a><h3>Gradients</h3> -<p> -Linear or radial Gradients can be used as background images. -</p> -<p> -A linear gradient along the line from (<em class="parameter"><code>start_x</code></em>, <em class="parameter"><code>start_y</code></em>) to -(<em class="parameter"><code>end_x</code></em>, <em class="parameter"><code>end_y</code></em>) is specified using the syntax -</p> -<div class="literallayout"><p>-gtk-gradient (linear,<br> - <em class="parameter"><code>start_x</code></em> <em class="parameter"><code>start_y</code></em>, <em class="parameter"><code>end_x</code></em> <em class="parameter"><code>end_y</code></em>,<br> - color-stop (<em class="parameter"><code>position</code></em>, <em class="parameter"><code>color</code></em>),<br> - ...)</p></div> -<p> -where <em class="parameter"><code>start_x</code></em> and <em class="parameter"><code>end_x</code></em> can be either a floating point number between -0 and 1 or one of the special values 'left', 'right' or 'center', <em class="parameter"><code>start_y</code></em> -and <em class="parameter"><code>end_y</code></em> can be either a floating point number between 0 and 1 or one -of the special values 'top', 'bottom' or 'center', <em class="parameter"><code>position</code></em> is a floating -point number between 0 and 1 and <em class="parameter"><code>color</code></em> is a color expression (see above). -The color-stop can be repeated multiple times to add more than one color -stop. 'from (<em class="parameter"><code>color</code></em>)' and 'to (<em class="parameter"><code>color</code></em>)' can be used as abbreviations for -color stops with position 0 and 1, respectively. -</p> -<div class="example"> -<a name="id632072"></a><p class="title"><b>Example 32. A linear gradient</b></p> -<div class="example-contents"> -<img src="gradient1.png"><p>This gradient was specified with -</p> -<div class="literallayout"><p>-gtk-gradient (linear,<br> - left top, right bottom,<br> - from(@yellow), to(@blue))</p></div> -</div> -</div> -<br class="example-break"><div class="example"> -<a name="id632098"></a><p class="title"><b>Example 33. Another linear gradient</b></p> -<div class="example-contents"> -<img src="gradient2.png"><p>This gradient was specified with -</p> -<div class="literallayout"><p>-gtk-gradient (linear,<br> - 0 0, 0 1,<br> - color-stop(0, @yellow),<br> - color-stop(0.2, @blue),<br> - color-stop(1, #0f0))</p></div> -</div> -</div> -<br class="example-break"><p> -A radial gradient along the two circles defined by (<em class="parameter"><code>start_x</code></em>, <em class="parameter"><code>start_y</code></em>, -<em class="parameter"><code>start_radius</code></em>) and (<em class="parameter"><code>end_x</code></em>, <em class="parameter"><code>end_y</code></em>, <em class="parameter"><code>end_radius</code></em>) is specified using the -syntax -</p> -<div class="literallayout"><p>-gtk-gradient (radial,<br> - <em class="parameter"><code>start_x</code></em> <em class="parameter"><code>start_y</code></em>, <em class="parameter"><code>start_radius</code></em>,<br> - <em class="parameter"><code>end_x</code></em> <em class="parameter"><code>end_y</code></em>, <em class="parameter"><code>end_radius</code></em>,<br> - color-stop (<em class="parameter"><code>position</code></em>, <em class="parameter"><code>color</code></em>),<br> - ...)</p></div> -<p> -where <em class="parameter"><code>start_radius</code></em> and <em class="parameter"><code>end_radius</code></em> are floating point numbers and -the other parameters are as before. -</p> -<div class="example"> -<a name="id632244"></a><p class="title"><b>Example 34. A radial gradient</b></p> -<div class="example-contents"> -<img src="gradient3.png"><p>This gradient was specified with -</p> -<div class="literallayout"><p>-gtk-gradient (radial,<br> - center center, 0,<br> - center center, 1,<br> - from(@yellow), to(@green))</p></div> -</div> -</div> -<br class="example-break"><div class="example"> -<a name="id632271"></a><p class="title"><b>Example 35. Another radial gradient</b></p> -<div class="example-contents"> -<img src="gradient4.png"><p>This gradient was specified with -</p> -<div class="literallayout"><p>-gtk-gradient (radial,<br> - 0.4 0.4, 0.1,<br> - 0.6 0.6, 0.7,<br> - color-stop (0, #f00),<br> - color-stop (0.1, #a0f),<br> - color-stop (0.2, @yellow),<br> - color-stop (1, @green))</p></div> -</div> -</div> -<br class="example-break"> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-shadows"></a><h3>Text shadow</h3> -<p> -A shadow list can be applied to text or symbolic icons, using the CSS3 -text-shadow syntax, as defined in -<a class="ulink" href="http://www.w3.org/TR/css3-text/#text-shadow" target="_top">the CSS3 specification</a>. -</p> -<p> -A text shadow is specified using the syntax -</p> -<div class="literallayout"><p>text-shadow: <em class="parameter"><code>horizontal_offset</code></em> <em class="parameter"><code>vertical_offset</code></em> [ <em class="parameter"><code>blur_radius</code></em> ] <em class="parameter"><code>color</code></em></p></div> -<p> -The offset of the shadow is specified with the <em class="parameter"><code>horizontal_offset</code></em> and <em class="parameter"><code>vertical_offset</code></em> -parameters. The optional blur radius is parsed, but it is currently not rendered by -the GTK+ theming engine. -</p> -<p> -To set multiple shadows on an element, you can specify a comma-separated list -of shadow elements in the text-shadow property. Shadows are always rendered -front-back, i.e. the first shadow specified is on top of the others. Shadows -can thus overlay each other, but they can never overlay the text itself, -which is always rendered on top of the shadow layer. -</p> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="id632379"></a><h3>Box shadow</h3> -<p> -Themes can apply shadows on framed elements using the CSS3 box-shadow syntax, -as defined in -<a class="ulink" href="http://www.w3.org/TR/css3-background/#the-box-shadow" target="_top">the CSS3 specification</a>. -</p> -<p> -A box shadow is specified using the syntax -</p> -<div class="literallayout"><p>box-shadow: [ <em class="parameter"><code>inset</code></em> ] <em class="parameter"><code>horizontal_offset</code></em> <em class="parameter"><code>vertical_offset</code></em> [ <em class="parameter"><code>blur_radius</code></em> ] [ <em class="parameter"><code>spread</code></em> ] <em class="parameter"><code>color</code></em></p></div> -<p> -A positive offset will draw a shadow that is offset to the right (down) of the box, -a negative offset to the left (top). The optional spread parameter defines an additional -distance to expand the shadow shape in all directions, by the specified radius. -The optional blur radius parameter is parsed, but it is currently not rendered by -the GTK+ theming engine. -The inset parameter defines whether the drop shadow should be rendered inside or outside -the box canvas. Only inset box-shadows are currently supported by the GTK+ theming engine, -non-inset elements are currently ignored. -</p> -<p> -To set multiple box-shadows on an element, you can specify a comma-separated list -of shadow elements in the box-shadow property. Shadows are always rendered -front-back, i.e. the first shadow specified is on top of the others, so they may -overlap other boxes or other shadows. -</p> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-border-image"></a><h3>Border images</h3> -<p> -Images and gradients can also be used in slices for the purpose of creating -scalable borders. -For more information, see the CSS3 documentation for the border-image property, -which can be found <a class="ulink" href="http://www.w3.org/TR/css3-background/#border-images" target="_top">here</a>. -</p> -<img src="slices.png"><p> -The parameters of the slicing process are controlled by -four separate properties. Note that you can use the -</p> -<div class="literallayout"><p>border-image</p></div> -<p> shorthand property -to set values for the three properties at the same time. -</p> -<p> -</p> -<div class="literallayout"><p>border-image-source: url(<em class="parameter"><code>path</code></em>)<br> -(or border-image-source: -gtk-gradient(...))</p></div> -<p>: -Specifies the source of the border image, and it can either -be an URL or a gradient (see above). -</p> -<p> -</p> -<div class="literallayout"><p>border-image-slice: <em class="parameter"><code>top</code></em> <em class="parameter"><code>right</code></em> <em class="parameter"><code>bottom</code></em> <em class="parameter"><code>left</code></em></p></div> -<p> -The sizes specified by the <em class="parameter"><code>top</code></em>, <em class="parameter"><code>right</code></em>, <em class="parameter"><code>bottom</code></em> and <em class="parameter"><code>left</code></em> parameters -are the offsets, in pixels, from the relevant edge where the image -should be "cut off" to build the slices used for the rendering -of the border. -</p> -<p> -</p> -<div class="literallayout"><p>border-image-width: <em class="parameter"><code>top</code></em> <em class="parameter"><code>right</code></em> <em class="parameter"><code>bottom</code></em> <em class="parameter"><code>left</code></em></p></div> -<p> -The sizes specified by the <em class="parameter"><code>top</code></em>, <em class="parameter"><code>right</code></em>, <em class="parameter"><code>bottom</code></em> and <em class="parameter"><code>left</code></em> parameters -are inward distances from the border box edge, used to specify the -rendered size of each slice determined by border-image-slice. -If this property is not specified, the values of border-width will -be used as a fallback. -</p> -<p> -</p> -<div class="literallayout"><p>border-image-repeat: [stretch|repeat|round|space] ? <br> -[stretch|repeat|round|space]</p></div> -<p> -Specifies how the image slices should be rendered in the area -outlined by border-width. -The default (stretch) is to resize the slice to fill in the whole -allocated area. -If the value of this property is 'repeat', the image slice -will be tiled to fill the area. -If the value of this property is 'round', the image slice will -be tiled to fill the area, and scaled to fit it exactly -a whole number of times. -If the value of this property is 'space', the image slice will -be tiled to fill the area, and if it doesn't fit it exactly a whole -number of times, the extra space is distributed as padding around -the slices. -If two options are specified, the first one affects -the horizontal behaviour and the second one the vertical behaviour. -If only one option is specified, it affects both. -</p> -<div class="example"> -<a name="id632669"></a><p class="title"><b>Example 36. A border image</b></p> -<div class="example-contents"> -<img src="border1.png"><p>This border image was specified with -</p> -<div class="literallayout"><p>url("gradient1.png") 10 10 10 10</p></div> -<p> -</p> -</div> -</div> -<br class="example-break"><div class="example"> -<a name="id632696"></a><p class="title"><b>Example 37. A repeating border image</b></p> -<div class="example-contents"> -<img src="border2.png"><p>This border image was specified with -</p> -<div class="literallayout"><p>url("gradient1.png") 10 10 10 10 repeat</p></div> -<p> -</p> -</div> -</div> -<br class="example-break"><div class="example"> -<a name="id632724"></a><p class="title"><b>Example 38. A stretched border image</b></p> -<div class="example-contents"> -<img src="border3.png"><p>This border image was specified with -</p> -<div class="literallayout"><p>url("gradient1.png") 10 10 10 10 stretch</p></div> -<p> -</p> -</div> -</div> -<br class="example-break"> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-transitions"></a><p>Styles can specify transitions that will be used to create a gradual -change in the appearance when a widget state changes. The following -syntax is used to specify transitions: -</p> -<div class="literallayout"><p><em class="parameter"><code>duration</code></em> [s|ms] [linear|ease|ease-in|ease-out|ease-in-out] [loop]?</p></div> -<p> -The <em class="parameter"><code>duration</code></em> is the amount of time that the animation will take for -a complete cycle from start to end. If the loop option is given, the -animation will be repated until the state changes again. -The option after the duration determines the transition function from a -small set of predefined functions. -</p> -<div class="figure"> -<a name="id632784"></a><p class="title"><b>Figure 3. Linear transition</b></p> -<div class="figure-contents"><div><img src="linear.png" alt="Linear transition"></div></div> -</div> -<p><br class="figure-break"> -</p> -<div class="figure"> -<a name="id632800"></a><p class="title"><b>Figure 4. Ease transition</b></p> -<div class="figure-contents"><div><img src="ease.png" alt="Ease transition"></div></div> -</div> -<p><br class="figure-break"> -</p> -<div class="figure"> -<a name="id632816"></a><p class="title"><b>Figure 5. Ease-in-out transition</b></p> -<div class="figure-contents"><div><img src="ease-in-out.png" alt="Ease-in-out transition"></div></div> -</div> -<p><br class="figure-break"> -</p> -<div class="figure"> -<a name="id632832"></a><p class="title"><b>Figure 6. Ease-in transition</b></p> -<div class="figure-contents"><div><img src="ease-in.png" alt="Ease-in transition"></div></div> -</div> -<p><br class="figure-break"> -</p> -<div class="figure"> -<a name="id632848"></a><p class="title"><b>Figure 7. Ease-out transition</b></p> -<div class="figure-contents"><div><img src="ease-out.png" alt="Ease-out transition"></div></div> -</div> -<p><br class="figure-break"> -</p> -</div> -<p> -</p> -<hr> -<div class="refsect2"> -<a name="gtkcssprovider-properties"></a><h3>Supported properties</h3> -<p> -Properties are the part that differ the most to common CSS, -not all properties are supported (some are planned to be -supported eventually, some others are meaningless or don't -map intuitively in a widget based environment). -</p> -<p> -The currently supported properties are: -</p> -<div class="informaltable"><table border="1"> -<colgroup> -<col> -<col> -<col> -<col> -</colgroup> -<thead><tr> -<th>Property name</th> -<th>Syntax</th> -<th>Maps to</th> -<th>Examples</th> -</tr></thead> -<tbody> -<tr> -<td>engine</td> -<td>engine-name</td> -<td><a class="link" href="GtkThemingEngine.html" title="GtkThemingEngine"><span class="type">GtkThemingEngine</span></a></td> -<td>engine: clearlooks; - engine: none; /* use the default (i.e. builtin) engine) */ </td> -</tr> -<tr> -<td>background-color</td> -<td rowspan="3">color (see above)</td> -<td rowspan="8"><a href="http://developer.gnome.org/gdk/gdk3-RGBA-Colors.html#GdkRGBA"><span class="type">GdkRGBA</span></a></td> -<td rowspan="8"> -<div class="literallayout"><p>background-color: #fff;<br> -color: &color1;<br> -background-color: shade (&color1, 0.5);<br> -color: mix (&color1, #f0f, 0.8);</p></div> - </td> -</tr> -<tr><td>color</td></tr> -<tr> -<td>border-top-color</td> -<td rowspan="5">transparent|color (see above)</td> -</tr> -<tr> -<td>border-right-color</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-bottom-color</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-left-color</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-color</td> -<td>[transparent|color]{1,4}</td> -</tr> -<tr> -<td>font-family</td> -<td> -<em class="parameter"><code>family</code></em> [, <em class="parameter"><code>family</code></em>]*</td> -<td><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#gchararray"><span class="type">gchararray</span></a></td> -<td>font-family: Sans, Arial;</td> -</tr> -<tr> -<td>font-style</td> -<td>[normal|oblique|italic]</td> -<td><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PANGO-TYPE-STYLE:CAPS"><span class="type">PANGO_TYPE_STYLE</span></a></td> -<td>font-style: italic;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>font-variant</td> -<td>[normal|small-caps]</td> -<td><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PANGO-TYPE-VARIANT:CAPS"><span class="type">PANGO_TYPE_VARIANT</span></a></td> -<td>font-variant: normal;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>font-weight</td> -<td>[normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900]</td> -<td><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PANGO-TYPE-WEIGHT:CAPS"><span class="type">PANGO_TYPE_WEIGHT</span></a></td> -<td>font-weight: bold;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>font-size</td> -<td>Font size in point</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>font-size: 13;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>font</td> -<td> -<em class="parameter"><code>family</code></em> [<em class="parameter"><code>style</code></em>] [<em class="parameter"><code>size</code></em>]</td> -<td><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td> -<td>font: Sans 15;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>margin-top</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>margin-top: 0;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>margin-left</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>margin-left: 1;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>margin-bottom</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>margin-bottom: 2;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>margin-right</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>margin-right: 4;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>margin</td> -<td rowspan="2"> -<div class="literallayout"><p><em class="parameter"><code>width</code></em><br> -<em class="parameter"><code>vertical_width</code></em> <em class="parameter"><code>horizontal_width</code></em><br> -<em class="parameter"><code>top_width</code></em> <em class="parameter"><code>horizontal_width</code></em> <em class="parameter"><code>bottom_width</code></em><br> -<em class="parameter"><code>top_width</code></em> <em class="parameter"><code>right_width</code></em> <em class="parameter"><code>bottom_width</code></em> <em class="parameter"><code>left_width</code></em></p></div> - </td> -<td rowspan="2"><a class="link" href="GtkStyleContext.html#GtkBorder"><span class="type">GtkBorder</span></a></td> -<td rowspan="2"> -<div class="literallayout"><p>margin: 5;<br> -margin: 5 10;<br> -margin: 5 10 3;<br> -margin: 5 10 3 5;</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>padding-top</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>padding-top: 5;</td> -</tr> -<tr> -<td>padding-left</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>padding-left: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>padding-bottom</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>padding-bottom: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>padding-right</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>padding-right: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>padding</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>background-image</td> -<td><div class="literallayout"><p>gradient (see above) or<br> -url(<em class="parameter"><code>path</code></em>)</p></div></td> -<td><a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-pattern-t.html#cairo-pattern-t"><span class="type">cairo_pattern_t</span></a></td> -<td> -<div class="literallayout"><p>-gtk-gradient (linear,<br> - left top, right top,<br> - from (#fff), to (#000));<br> --gtk-gradient (linear, 0.0 0.5, 0.5 1.0,<br> - from (#fff),<br> - color-stop (0.5, #f00),<br> - to (#000));<br> --gtk-gradient (radial,<br> - center center, 0.2,<br> - center center, 0.8,<br> - color-stop (0.0, #fff),<br> - color-stop (1.0, #000));<br> -url ('background.png');</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>background-repeat</td> -<td>[repeat|no-repeat]</td> -<td>internal</td> -<td> -<div class="literallayout"><p>background-repeat: no-repeat;</p></div> - If not specified, the style doesn't respect the CSS3 - specification, since the background will be - stretched to fill the area. - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-top-width</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>border-top-width: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-left-width</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>border-left-width: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-bottom-width</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>border-bottom-width: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-right-width</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>border-right-width: 5;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-width</td> -<td rowspan="2"><a class="link" href="GtkStyleContext.html#GtkBorder"><span class="type">GtkBorder</span></a></td> -<td rowspan="2"> -<div class="literallayout"><p>border-width: 1;<br> -border-width: 1 2;<br> -border-width: 1 2 3;<br> -border-width: 1 2 3 5;</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-radius</td> -<td>integer</td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> -<td>border-radius: 5;</td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-style</td> -<td>[none|solid|inset|outset]</td> -<td><a class="link" href="gtk3-Standard-Enumerations.html#GtkBorderStyle" title="enum GtkBorderStyle"><span class="type">GtkBorderStyle</span></a></td> -<td>border-style: solid;</td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>border-image</td> -<td><div class="literallayout"><p>border image (see above)</p></div></td> -<td>internal use only</td> -<td> -<div class="literallayout"><p>border-image: url("/path/to/image.png") 3 4 3 4 stretch;<br> -border-image: url("/path/to/image.png") 3 4 4 3 repeat stretch;</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>text-shadow</td> -<td>shadow list (see above)</td> -<td><span class="type">GtkTextShadow</span></td> -<td><div class="literallayout"><p>text-shadow: 1 1 0 blue, -4 -4 red;</p></div></td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>transition</td> -<td>transition (see above)</td> -<td>internal use only</td> -<td> -<div class="literallayout"><p>transition: 150ms ease-in-out;<br> -transition: 1s linear loop;</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -<tr> -<td>gtk-key-bindings</td> -<td>binding set name list</td> -<td>internal use only</td> -<td> -<div class="literallayout"><p>gtk-bindings: binding1, binding2, ...;</p></div> - </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -<td class="auto-generated"> </td> -</tr> -</tbody> -</table></div> -<p> -GtkThemingEngines can register their own, engine-specific style properties -with the function <a class="link" href="GtkThemingEngine.html#gtk-theming-engine-register-property" title="gtk_theming_engine_register_property ()"><code class="function">gtk_theming_engine_register_property()</code></a>. These properties -can be set in CSS like other properties, using a name of the form -</p> -<div class="literallayout"><p>-<em class="replaceable"><code>namespace</code></em>-<em class="replaceable"><code>name</code></em></p></div> -<p>, where <em class="replaceable"><code>namespace</code></em> is typically -the name of the theming engine, and <em class="replaceable"><code>name</code></em> is the -name of the property. Style properties that have been registered by widgets -using <a class="link" href="GtkWidget.html#gtk-widget-class-install-style-property" title="gtk_widget_class_install_style_property ()"><code class="function">gtk_widget_class_install_style_property()</code></a> can also be set in this -way, using the widget class name for <em class="replaceable"><code>namespace</code></em>. -</p> -<div class="example"> -<a name="id625396"></a><p class="title"><b>Example 39. Using engine-specific style properties</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="symbol">*</span><span class="normal"> </span><span class="cbracket">{</span> -<span class="normal"> engine</span><span class="symbol">:</span><span class="normal"> clearlooks</span><span class="symbol">;</span> -<span class="normal"> border</span><span class="symbol">-</span><span class="normal">radius</span><span class="symbol">:</span><span class="normal"> </span><span class="number">4</span><span class="symbol">;</span> -<span class="normal"> </span><span class="symbol">-</span><span class="normal"><a href="GtkPaned.html">GtkPaned</a></span><span class="symbol">-</span><span class="normal">handle</span><span class="symbol">-</span><span class="normal">size</span><span class="symbol">:</span><span class="normal"> </span><span class="number">6</span><span class="symbol">;</span> -<span class="normal"> </span><span class="symbol">-</span><span class="normal">clearlooks</span><span class="symbol">-</span><span class="normal">colorize</span><span class="symbol">-</span><span class="normal">scrollbar</span><span class="symbol">:</span><span class="normal"> false</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"> -</div> -<p> -</p> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.details"></a><h2>Details</h2> -<div class="refsect2"> -<a name="GtkCssProvider-struct"></a><h3>struct GtkCssProvider</h3> -<pre class="programlisting">struct GtkCssProvider;</pre> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-get-default"></a><h3>gtk_css_provider_get_default ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * gtk_css_provider_get_default (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns the provider containing the style settings used as a -fallback for all widgets. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>The provider used for fallback styling. -This memory is owned by GTK+, and you must not free it. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-get-named"></a><h3>gtk_css_provider_get_named ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * gtk_css_provider_get_named (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *variant</code></em>);</pre> -<p> -Loads a theme from the usual theme paths -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td> -<td>A theme name</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>variant</code></em> :</span></p></td> -<td>variant to load, for example, "dark", or -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the default. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> with the theme loaded. -This memory is owned by GTK+, and you must not free it. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-load-from-data"></a><h3>gtk_css_provider_load_from_data ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_css_provider_load_from_data (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> -<p> -Loads <em class="parameter"><code>data</code></em> into <em class="parameter"><code>css_provider</code></em>, making it clear any previously loaded -information. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>css_provider</code></em> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td> -<td>CSS data loaded in memory. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td> -<td>the length of <em class="parameter"><code>data</code></em> in bytes, or -1 for NUL terminated strings. If -<em class="parameter"><code>length</code></em> is not -1, the code will assume it is not NUL terminated and will -potentially do a copy.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the data could be loaded.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-load-from-file"></a><h3>gtk_css_provider_load_from_file ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_css_provider_load_from_file (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="type">GFile</span></a> *file</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> -<p> -Loads the data contained in <em class="parameter"><code>file</code></em> into <em class="parameter"><code>css_provider</code></em>, making it -clear any previously loaded information. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>css_provider</code></em> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="type">GFile</span></a> pointing to a file to load</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the data could be loaded.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-load-from-path"></a><h3>gtk_css_provider_load_from_path ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_css_provider_load_from_path (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *css_provider</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> -<p> -Loads the data contained in <em class="parameter"><code>path</code></em> into <em class="parameter"><code>css_provider</code></em>, making it clear -any previously loaded information. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>css_provider</code></em> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td> -<td>the path of a filename to load, in the GLib filename encoding</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the data could be loaded.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-new"></a><h3>gtk_css_provider_new ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="returnvalue">GtkCssProvider</span></a> * gtk_css_provider_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns a newly created <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>A new <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-provider-to-string"></a><h3>gtk_css_provider_to_string ()</h3> -<pre class="programlisting"><span class="returnvalue">char</span> * gtk_css_provider_to_string (<em class="parameter"><code><a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *provider</code></em>);</pre> -<p> -Convertes the <em class="parameter"><code>provider</code></em> into a string representation in CSS -format. -</p> -<p> -Using <a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-data" title="gtk_css_provider_load_from_data ()"><code class="function">gtk_css_provider_load_from_data()</code></a> with the return value -from this function on a new provider created with -<a class="link" href="GtkCssProvider.html#gtk-css-provider-new" title="gtk_css_provider_new ()"><code class="function">gtk_css_provider_new()</code></a> will basicallu create a duplicate of -this <em class="parameter"><code>provider</code></em>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>provider</code></em> :</span></p></td> -<td>the provider to write to a string</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a new string representing the <em class="parameter"><code>provider</code></em>.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="GTK-CSS-PROVIDER-ERROR:CAPS"></a><h3>GTK_CSS_PROVIDER_ERROR</h3> -<pre class="programlisting">#define GTK_CSS_PROVIDER_ERROR (gtk_css_provider_error_quark ()) -</pre> -</div> -<hr> -<div class="refsect2"> -<a name="GtkCssProviderError"></a><h3>enum GtkCssProviderError</h3> -<pre class="programlisting">typedef enum { - GTK_CSS_PROVIDER_ERROR_FAILED, - GTK_CSS_PROVIDER_ERROR_SYNTAX, - GTK_CSS_PROVIDER_ERROR_IMPORT, - GTK_CSS_PROVIDER_ERROR_NAME, - GTK_CSS_PROVIDER_ERROR_DEPRECATED, - GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE -} GtkCssProviderError; -</pre> -</div> -<hr> -<div class="refsect2"> -<a name="GtkCssSection-struct"></a><h3>GtkCssSection</h3> -<pre class="programlisting">typedef struct _GtkCssSection GtkCssSection;</pre> -<p> -Defines a part of a CSS document. Because sections are nested into -one another, you can use <a class="link" href="GtkCssProvider.html#gtk-css-section-get-parent" title="gtk_css_section_get_parent ()"><code class="function">gtk_css_section_get_parent()</code></a> to get the -containing region. -</p> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="GtkCssSectionType"></a><h3>enum GtkCssSectionType</h3> -<pre class="programlisting">typedef enum { - GTK_CSS_SECTION_DOCUMENT, - GTK_CSS_SECTION_IMPORT, - GTK_CSS_SECTION_COLOR_DEFINITION, - GTK_CSS_SECTION_BINDING_SET, - GTK_CSS_SECTION_RULESET, - GTK_CSS_SECTION_SELECTOR, - GTK_CSS_SECTION_DECLARATION, - GTK_CSS_SECTION_VALUE -} GtkCssSectionType; -</pre> -<p> -The different types of sections indicate parts of a CSS document as -parsed by GTK's CSS parser. They are oriented towards the CSS grammar -<a class="ulink" href="http://www.w3.org/TR/CSS21/grammar.html" target="_top">CSS grammer</a>, -but may contain extensions. -</p> -<p> -More types might be added in the future as the parser incorporates -more features. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><a name="GTK-CSS-SECTION-DOCUMENT:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_DOCUMENT</code></span></p></td> -<td>The section describes a complete document. - This section time is the only one where <a class="link" href="GtkCssProvider.html#gtk-css-section-get-parent" title="gtk_css_section_get_parent ()"><code class="function">gtk_css_section_get_parent()</code></a> - might return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-IMPORT:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_IMPORT</code></span></p></td> -<td>The section defines an import rule. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-COLOR-DEFINITION:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_COLOR_DEFINITION</code></span></p></td> -<td>The section defines a color. This - is a GTK extension to CSS. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-BINDING-SET:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_BINDING_SET</code></span></p></td> -<td>The section defines a binding set. This - is a GTK extension to CSS. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-RULESET:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_RULESET</code></span></p></td> -<td>The section defines a CSS ruleset. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-SELECTOR:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_SELECTOR</code></span></p></td> -<td>The section defines a CSS selector. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-DECLARATION:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_DECLARATION</code></span></p></td> -<td>The section defines the declaration of - a CSS variable. -</td> -</tr> -<tr> -<td><p><a name="GTK-CSS-SECTION-VALUE:CAPS"></a><span class="term"><code class="literal">GTK_CSS_SECTION_VALUE</code></span></p></td> -<td>The section defines the value of a CSS declaration. -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-end-line"></a><h3>gtk_css_section_get_end_line ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_css_section_get_end_line (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Returns the line in the CSS document where this section end. -The line number is 0-indexed, so the first line of the document -will return 0. -This value may change in future invocations of this function if -<em class="parameter"><code>section</code></em> is not yet parsed completely. This will for example -happen in the GtkCssProvider::parsing-error signal. -The end position and line may be identical to the start -position and line for sections which failed to parse anything -successfully. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the line number</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-end-position"></a><h3>gtk_css_section_get_end_position ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_css_section_get_end_position (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Returns the offset in bytes from the start of the current line -returned via <a class="link" href="GtkCssProvider.html#gtk-css-section-get-end-line" title="gtk_css_section_get_end_line ()"><code class="function">gtk_css_section_get_end_line()</code></a>. -This value may change in future invocations of this function if -<em class="parameter"><code>section</code></em> is not yet parsed completely. This will for example -happen in the GtkCssProvider::parsing-error signal. -The end position and line may be identical to the start -position and line for sections which failed to parse anything -successfully. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the offset in bytes from the start of the line.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-file"></a><h3>gtk_css_section_get_file ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="returnvalue">GFile</span></a> * gtk_css_section_get_file (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Gets the file that <em class="parameter"><code>section</code></em> was parsed from. If no such file exists, -for example because the CSS was loaded via -<em class="parameter"><code><a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-data" title="gtk_css_provider_load_from_data ()"><code class="function">gtk_css_provider_load_from_data()</code></a></code></em>, then <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the <a href="http://library.gnome.org/devel/gio/unstable/GFile.html"><span class="type">GFile</span></a> that <em class="parameter"><code>section</code></em> was parsed from -or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>section</code></em> was parsed from other data. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-parent"></a><h3>gtk_css_section_get_parent ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="returnvalue">GtkCssSection</span></a> * gtk_css_section_get_parent (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Gets the parent section for the given <em class="parameter"><code>section</code></em>. The parent section is -the section that contains this <em class="parameter"><code>section</code></em>. A special case are sections of -type <span class="type">GTK_CSS_SECTION_TYPE_DOCUMENT</span>. Their parent will either be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> -if they are the original CSS document that was loaded by -<a class="link" href="GtkCssProvider.html#gtk-css-provider-load-from-file" title="gtk_css_provider_load_from_file ()"><code class="function">gtk_css_provider_load_from_file()</code></a> or a section of type -<span class="type">GTK_CSS_SECTION_TYPE_IMPORT</span> if it was loaded with an import rule from -a different file. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the parent section or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-section-type"></a><h3>gtk_css_section_get_section_type ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html#GtkCssSectionType" title="enum GtkCssSectionType"><span class="returnvalue">GtkCssSectionType</span></a> gtk_css_section_get_section_type (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Gets the type of information that <em class="parameter"><code>section</code></em> describes. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the type of <em class="parameter"><code>section</code></em> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-start-line"></a><h3>gtk_css_section_get_start_line ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_css_section_get_start_line (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Returns the line in the CSS document where this section starts. -The line number is 0-indexed, so the first line of the document -will return 0. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the line number</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-get-start-position"></a><h3>gtk_css_section_get_start_position ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_css_section_get_start_position (<em class="parameter"><code>const <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Returns the offset in bytes from the start of the current line -returned via <a class="link" href="GtkCssProvider.html#gtk-css-section-get-start-line" title="gtk_css_section_get_start_line ()"><code class="function">gtk_css_section_get_start_line()</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>the section</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the offset in bytes from the start of the line.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-ref"></a><h3>gtk_css_section_ref ()</h3> -<pre class="programlisting"><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="returnvalue">GtkCssSection</span></a> * gtk_css_section_ref (<em class="parameter"><code><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Increments the reference count on <em class="parameter"><code>section</code></em>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<em class="parameter"><code>section</code></em> itself.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-css-section-unref"></a><h3>gtk_css_section_unref ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_css_section_unref (<em class="parameter"><code><a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section</code></em>);</pre> -<p> -Decrements the reference count on <em class="parameter"><code>section</code></em>, freeing the -structure if the reference count reaches 0. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>a <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 3.2</p> -</div> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.signal-details"></a><h2>Signal Details</h2> -<div class="refsect2"> -<a name="GtkCssProvider-parsing-error"></a><h3>The <code class="literal">"parsing-error"</code> signal</h3> -<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a> *provider, - <a class="link" href="GtkCssProvider.html#GtkCssSection"><span class="type">GtkCssSection</span></a> *section, - <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error, - <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre> -<p> -Signals that a parsing error occured. the <em class="parameter"><code>path</code></em>, <em class="parameter"><code>line</code></em> and <em class="parameter"><code>position</code></em> -describe the actual location of the error as accurately as possible. -</p> -<p> -Parsing errors are never fatal, so the parsing will resume after -the error. Errors may however cause parts of the given -data or even all of it to not be parsed at all. So it is a useful idea -to check that the parsing succeeds by connecting to this signal. -</p> -<p> -Note that this signal may be emitted at any time as the css provider -may opt to defer parsing parts or all of the input to a later time -than when a loading function was called. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>provider</code></em> :</span></p></td> -<td>the provider that had a parsing error</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>section</code></em> :</span></p></td> -<td>section the error happened in</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>The parsing error</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> -<td>user data set when the signal handler was connected.</td> -</tr> -</tbody> -</table></div> -</div> -</div> -<div class="refsect1"> -<a name="GtkCssProvider.see-also"></a><h2>See Also</h2> -<a class="link" href="GtkStyleContext.html" title="GtkStyleContext"><span class="type">GtkStyleContext</span></a>, <a class="link" href="GtkStyleProvider.html" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> -</div> -</div> -<div class="footer"> -<hr> - Generated by GTK-Doc V1.18.1</div> -</body> -</html>
\ No newline at end of file |