Commit Graph

37 Commits

Author SHA1 Message Date
Matthias Clasen
c31eadc3a1 css provider: Make not subclassable
Part of being more explicit about what
we allow to be subclassed and what not.
2019-05-19 18:41:33 +00:00
Timm Bäder
3da6e83609 cssprovider: Fix a parameter name mismatch 2019-04-23 17:24:07 +02:00
Benjamin Otte
1aa1610611 cssprovider: Export correct API
gtk_css_provider_get_named() is the old GTK3 style API to load themes.

Instead, export the function we currently use,
gtk_css_provider_load_named().

As a side effect we allow people to load a theme as often as they want
without conflicting with GTK's theme.
2019-04-18 02:26:04 +02:00
Benjamin Otte
2e0a56665a css: Move gtkcsssection.[ch] into gtk/css 2019-04-12 19:34:28 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Alberts Muktupāvels
7a8f5ca970 gtkcssprovider: remove gtk_css_provider_get_default
This function is unused since cdc6e82720 commit and does not
contain fallback style.

https://gitlab.gnome.org/GNOME/gtk/issues/1226
2018-07-19 19:25:17 +03:00
Timm Bäder
aa32fc1708 cssprovider: Remove priv pointer 2018-02-13 18:48:44 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Benjamin Otte
4322b69528 cssprovider: Return void, not TRUE
Parsing a css file always succeeds as CSS can recover from parsing
errors.
2016-10-17 17:41:03 +02:00
Benjamin Otte
dbeeaf7de6 cssprovider: Remove GError out argument from load functions
People should use the GtkCssProvider::parsing-error signal instead.
2016-10-17 16:52:05 +02:00
Emmanuele Bassi
605f2efa73 docs: Fix annotation for GtkCssProviderError
https://bugzilla.gnome.org/show_bug.cgi?id=740374
2014-11-25 22:15:24 -05:00
Matthias Clasen
f73db86a63 Fix docs for gtk_css_provider_load_from_resource 2014-10-22 00:32:38 -04:00
Matthias Clasen
a00842fa99 Add a function to load css from a resource
This is common enough that we should just provide an API for it
- we already had a function for this purpose anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=672946
2014-10-04 15:52:02 -04:00
William Jon McCann
b28f04d6e9 docs: add docs for GtkCssProviderError 2014-01-21 13:33:45 -05:00
Matthias Clasen
20c8c8b91c Add annotations to gtk headers
Add annotations to all exported functions in GTK+ headers.
2013-05-05 15:38:47 -04:00
Matthias Clasen
ab3d6a0b0a Revert "Bind the themes to the livecycle of the screen"
This reverts commit 1f5dea9eba,
since it was causeing noticable behaviour changes.

Previously, GTK_DATA_PREFIX=/ ./gtk3-demo would start
gtk3-demo with the Raleigh theme. With that change, it
was starting with no theme at all (i.e. all black).
2012-09-17 22:31:25 -04:00
William Jon McCann
1f5dea9eba Bind the themes to the lifecycle of the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:20:44 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
2c25bd85b8 gtk: Use versioned deprecations
This patch changes all uses of GDK_DEPRECATED(_FOR) in gtk headers
by the versioned variants, GDK_DEPRECATED_IN_3_x(_FOR). At the same
time, we add GDK_AVAILABLE_IN_3_x annotations for all API additions
in 3.2 and 3.4.
2012-02-27 07:11:43 -05:00
Benjamin Otte
26e9d07718 API: cssprovider: Change parsing-error signal
Instead of path, line and position, emit the section the error happened
in. This has a lot more information to consume.
2011-08-26 16:26:28 +02:00
Murray Cumming
fe7125e00c gtkcssprovider.h: Remove a trailing comma. 2011-06-09 20:36:14 +02:00
Benjamin Otte
e875c619ef css: No more special code for regions
Just treat regions the same as elements.
2011-05-18 22:17:55 +02:00
Benjamin Otte
7ccb9db79e css: Rewrite the parser
Instead of relying on GScanner and its idea of syntax, code up a parser
that obeys the CSS spec.
This also has the great side effect of reporting correct line numbers
and positions.

Also included is a reorganization of the returned error values. Instead
of error values describing what type of syntax error was returned, the
code just returns SYNTAX_ERROR. Other messages exist for when actual
values don't work or when errors shouldn't be fatal due to backwards
compatibility.
2011-05-18 22:17:55 +02:00
Benjamin Otte
ee53156762 API: cssprovider: Add more error codes 2011-05-18 21:58:44 +02:00
Benjamin Otte
78afa9671e API: cssprovider: Make error a signal 2011-05-18 21:58:44 +02:00
Benjamin Otte
b1556abe04 API: gtk: Add gtk_css_provider_to_string()
This is intented to convert the contents of a CSS provider back to a
string.
It is not complete yet but good enough for starting a testsuite. :)
2011-05-18 21:58:43 +02:00
Benjamin Otte
0094621e82 cssprovider: #include gio
We reference GFile...
2011-04-27 00:42:44 +02:00
Benjamin Otte
a5e1337ad7 cssprovider: Move private struct definition to header
consistency, improved debugging, etc
2011-04-16 22:31:25 +02:00
Michael Natterer
3933f99ed7 gtk: add missing class padding
Sorry for this late ABI break, but the newly added style classes
definitely need padding, so I can just as well add missing padding
globally.
2011-01-25 22:29:00 +01:00
Matthias Clasen
f92c352f96 Some error reporting
When we take a GError argument, better use it.
2010-12-04 15:39:16 +01:00
Matthias Clasen
5f13b65065 Fix prototype of gtk_css_style_provider_load_from_data
GError arguments must be **.
2010-12-04 15:39:16 +01:00
Carlos Garnacho
a79626b7fb Add theming docs
Both API and file format is documented, there's still missing
a migration doc though.
2010-12-04 15:38:21 +01:00
Carlos Garnacho
679ff63d5c GtkCssProvider: Add gtk_css_provider_get_named()
This functions loads a CSS file from a installed theme.
2010-12-04 15:38:15 +01:00
Carlos Garnacho
9dfba95f09 GtkCssProvider: Add gtk_css_provider_load_from_path() 2010-12-04 15:38:09 +01:00
Carlos Garnacho
85398fc05f GtkCssProvider: Add gtk_css_provider_get_default().
This method returns a GtkCssProvider with the default style information
loaded.
2010-12-04 15:37:26 +01:00
Carlos Garnacho
875237187c GtkCssProvider: Add priv pointer to object struct. 2010-12-04 15:37:17 +01:00
Carlos Garnacho
bccad0c65c Added GtkCssProvider.
GtkCssProvider is a GtkStyleProvider implementation which is able to read
CSS-like input to style widgets.

At the moment, only the basic parser features are available.
2010-12-04 15:37:02 +01:00