Commit Graph

547 Commits

Author SHA1 Message Date
Emmanuele Bassi
5cc6b3e342 docs: Add missing annotation 2021-11-01 12:54:35 +00:00
Benjamin Otte
cf3830704b icontheme: Fix variable mixup leading to crashes
Note: Don't have 2 variables named "icon" and "gicon", you will screw
them up.

reftests included.

Fixes #4269
2021-09-17 17:41:13 +00:00
Benjamin Otte
37a7c6780a icontheme: Implement gtk_icon_theme_lookup_by_gicon() for textures
More feature parity.

Before this, it would have worked just as well - just going via a PNG
bytes step inbetween.
2021-09-17 04:31:46 +02:00
Benjamin Otte
e58f70d7bb pixbufutils: Don't hardcode formats
Just let the loaders figure out the file format themselves.
2021-09-17 02:34:15 +02:00
Benjamin Otte
4fcf54757f icontheme: Insist that people provide proper values
Seriously...
2021-09-17 02:29:59 +02:00
Benjamin Otte
b5da07f0e1 icontheme: Use textures more
We were going via GLoadablieIcon/GInputStream for everything previously
and we have no API for that with GdkTexture.

With this commit, gdk-pixbuf isn't used anymore when starting
widget-factory for anything but SVG.
2021-09-17 02:12:07 +02:00
Benjamin Otte
a85f4ec6c2 icontheme: Load textures directly when possible
This doesn't fix the codepaths for SVG (both for recoloring and
resizing) and doesn't handle streams yet.
2021-09-17 02:02:51 +02:00
Benjamin Otte
9237c8be67 icontheme: Refactor gtk_icon_theme_lookup_symbolic_colors()
With the new enum, the code looks much cleaner.
2021-08-30 04:52:47 +02:00
Benjamin Otte
2808f9c75b gtk: Port icontheme to GtkSymbolicPaintable 2021-08-29 04:29:53 +02:00
Matthias Clasen
19b534f7de Avoid copying static debug strings
The g_source_set_name calls were showing up as a
major source of strdups in our profiles. Avoid that
by using new GLib api when available.
2021-07-28 22:42:46 -04:00
Marc-André Lureau
337c5e5e59 Add missing "Since: 4.X" tags
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-07 23:35:38 +04:00
Benjamin Otte
e9d3d3e3cf icontheme: Fix binding annotation 2021-06-30 18:55:25 +00:00
Matthias Clasen
a4598567b9 icontheme: Add detail to the 'not found' message
Name the icon theme we're using.

Fixes: #2271
2021-06-04 09:49:05 -04:00
Matthias Clasen
8bcc6b1d96 docs: Fix up syntax
There's no [type_func@...[ syntax, it is all [func@...].
2021-05-22 20:56:14 -04:00
Matthias Clasen
91f7b9663f gtk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Matthias Clasen
4a0d3d7acc docs: Reduce redundancy
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.

This adds a few missing nullable annotations too.
2021-05-20 20:45:06 -04:00
Matthias Clasen
7fe0610b68 introspection: Stop using allow-none
allow-none has been deprecated for a long time
already. Instead use optional and nullable everywhere.
2021-05-20 19:17:49 -04:00
Matthias Clasen
8ba16eb4f1 Documentation fixes
Mostly fixing up indentation of continuation lines,
and other small cleanups.
2021-05-20 19:17:49 -04:00
Matthias Clasen
5940de98dd icontheme: Add gtk_icon_theme_has_gicon
Add a utility function to check whether the icontheme
will produce something better than missing-image for
a GIcon. Obviously, we can only answer this question
if the GIcon is a themed icon the begin with.
2021-03-26 13:17:51 -04:00
Matthias Clasen
6f82408056 Add logging for icon fallback
Add GTK_DEBUG=iconfallback which prints out what icon names
we fall back to image-missing for.
2021-03-25 17:26:15 -04:00
Matthias Clasen
19df22f784 icontheme: Convert docs 2021-03-11 16:37:36 +00:00
Emmanuele Bassi
e8b6e6cad0 docs: Clean up the first paragraph for various symbols
The documentation engine will use the first paragraph as the summary for
a type or constant.
2021-03-11 16:37:30 +00:00
Timm Bäder
7e1f20bf4c icontheme: Make a parameter const 2021-01-03 11:01:29 +01:00
Timm Bäder
21299cc7e4 icontheme: Make some constant values const 2020-12-21 10:26:02 +01:00
Timm Bäder
810cd7881e icontheme: Make icon_paintable_ensure_texture() return an unowned value
It's private, has only one caller and that one doesn't need the extra
ref.
2020-12-21 10:26:02 +01:00
Matthias Clasen
6d1dcaa92a docs: Explain the symbolic icon paintable situation
Add a paragraph to the migration guide that explains
how to properly render symbolic GtkIconPaintables.

Also mention this in the GtkIconPaintable docs.

There's a reason you can't spell 'paintable' without
'pain'...
2020-10-15 11:42:50 -04:00
Matthias Clasen
9fdb71cbd2 icontheme: Add a missing getter
We want to have a get_display() method on every object
that is tied to the display, so add one here.
2020-10-03 13:11:20 -04:00
Matthias Clasen
9d701129cc icontheme: Clarify the docs
Mention that icons directly in /$app_id/icons/ are treated
as unthemed icons.

See #3216
2020-09-30 08:55:39 -04:00
Matthias Clasen
929a56e53c Clean up lots of GTK+ -> GTK
Replace most remaining uses of GTK+ in the docs and
user-visible strings by GTK. Also remove some leftover
"Was added in 3.x" sentences from the docs.
2020-09-12 12:01:04 -04:00
Matthias Clasen
125ed52ccb Merge branch 'new-sysprof' into 'master'
Port profiling to sysprof-collector api

See merge request GNOME/gtk!2457
2020-08-21 23:58:09 +00:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02:00
Matthias Clasen
ff42c94174 gtkicontheme: Stop using GTimeVal
It has been deprecated and the deprecation warnings
break our -Werror build in ci.
2020-07-31 11:22:16 -04:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Timm Bäder
46bb3e3046 icontheme: Indentation 2020-07-17 05:49:11 +02:00
Benjamin Otte
088b5fc57f icontheme: Use GdkArray 2020-07-16 18:09:58 +02:00
Yuri Chornoivan
c0cf839729 Fix minor typos 2020-06-18 10:47:16 +03:00
Christoph Reiter
2d5cf2b4c4 Drop fallback-c89.c
We require a C compiler supporting C99 now. The main purpose of
these fallbacks was for MSVC. From what I can see this is now all supported
by MSVC 2015+ anyway.

The only other change this includes is to replace isnanf() with the
(type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
2020-05-31 17:09:23 +02:00
Yuri Chornoivan
01bd4cc4e1 Fix minor typos 2020-05-28 11:00:03 +03:00
Corentin Noël
076b2f11d2 docs: Fix several missing references in the documentation
This fixes several typos and missing references
2020-05-11 19:26:20 +02:00
Georges Basile Stavracas Neto
6fc706f983 icontheme: Don't free array element
When setting a clear function on a GArray, unlike
most other places, this free func is expected to
*not* free the array element itself -- only its
contents.

Don't free the array element.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2717
2020-05-06 18:14:36 -03:00
Timm Bäder
63bbc79f48 icontheme: Save dir_mtimes in a GArray, not a GList 2020-05-05 08:20:09 +02:00
Matthias Clasen
a59cb5dfa6 icontheme: Call gtk_system_setting_changed
When the icon theme changes, we want to both initiate
a css SOURCE change (since css values may depend on the
icon theme), as well as calling gtk_system_setting_changed,
since widgets need to drop cached images, e.g. in GtkIconHelper.
2020-04-22 19:30:48 -04:00
Matthias Clasen
fe6ef5256b icontheme: Keep a serial
This will let us identify when we have to re-lookup
icons because they may have changed despite the theme
object being the same.
2020-04-22 15:18:16 -04:00
Alexander Larsson
e75bc2833d icon-theme: Fix deadlock in GktIconTheme dispose
When freeing the display GtkIconTheme and that was the last owner we
ran into a deadlock, because we unref the "next-to-last" ref inside a
gtk_icon_theme_ref_aquire/release() pair, which makes the final unref
to happen in the release(), while the ref lock still was held.
The unref triggers dispose which tries to NULL out the ref, but that then
deadlocks on the mutex being held by the caller already.

We fix this by moving the release unref outside the lock. This is safe
because refcounts are atomic, and we *do* own the ref.
2020-04-22 12:20:57 -04:00
Arnaud Bonatti
8c769ea3f3 Fix typo in IconTheme.
The add_search_path() method was
using the resource_path property
in place of the search_path one.
2020-04-14 20:43:06 +02:00
Benjamin Otte
e356d59a92 build: Add -Wnull-dereference
Sprinkle various g_assert() around the code where gcc cannot figure out
on its own that a variable is not NULL and too much refactoring would be
needed to make it do that.

Also fix usage of g_assert_nonnull(x) to use g_assert(x) because the
first is not marked as G_GNUC_NORETURN because of course GTester
supports not aborting on aborts.
2020-03-05 08:14:37 +01:00
Benjamin Otte
4be4799316 icontheme: Remove unused parameter
It's only ever set to NULL (and then dereferenced, too)
2020-03-05 07:59:59 +01:00
Benjamin Otte
fdd4630952 icontheme: Don't crash on icon lookup failure 2020-03-05 07:59:05 +01:00