Commit Graph

232 Commits

Author SHA1 Message Date
William Jon McCann
285d216d3e docs: use apostrophe in *'ll 2014-02-07 13:35:54 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
f116f0071e docs: use links instead of <xref> 2014-02-07 11:13:11 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
5dd751f006 docs: don't use ulink. use markdown instead 2014-02-04 18:53:51 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
76447c3512 docs: use quotes instead of <firstterm> 2014-02-04 18:10:11 -05:00
Matthias Clasen
30cc1512e6 Docs: Use markdown for lists
This greatly reduces the amount of xml in the docs.
2014-02-02 01:07:39 -05:00
Jasper St. Pierre
f929a61399 gtkicontheme: Don't query CONTENT_TYPE to determine if something is an SVG
We already know based on the suffix of the filename.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-01-31 14:34:52 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
22586ea7c2 docs: use #*-struct instead of <structname> 2014-01-27 19:59:55 -05:00
William Jon McCann
6bf71d13c3 docs: fix function link 2014-01-21 18:57:40 -05:00
William Hua
fd13713230 GtkIconInfo: add gtk_icon_info_is_symbolic()
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 02:10:14 -05:00
Matthias Clasen
a093cd2a22 Icon theme: Hardcode fallback through the 'gnome' icon theme
This is what we used to get through the Net/FallbackIcontheme
setting. Nobody has ever set this setting to a different value,
and people have come to rely on GTK+ applications getting their
icons this way.
2013-10-21 12:58:29 -04:00
Matthias Clasen
4b7eaee959 Fix an oversight
Followup for 3c41d4865e
2013-10-15 21:30:35 -04:00
Matthias Clasen
6d5cbf16d6 Fall back to non-symbolic icons
When doing fallback for symbolic icons, we first shorten
the name at dashes while preserving the -symbolic suffix.
But after exhausting that, we should also try stripping
the suffix.

https://bugzilla.gnome.org/show_bug.cgi?id=708163
2013-10-15 21:19:17 -04:00
Matthias Clasen
6b7981d2f5 Set an error when loading a GtkIconInfo fails
Failure to do so leads to assertion failures.
https://bugzilla.gnome.org/show_bug.cgi?id=710073
2013-10-15 20:06:24 -04:00
Matthias Clasen
d967266b77 Fix a crash in icon handling
The load_error was freed in two places.
Fix based on a patch in
https://bugzilla.gnome.org/show_bug.cgi?id=709967
2013-10-15 08:04:25 -04:00
Benjamin Otte
a4c7f188de icontheme: Use gdk_rgba_to_string()
This gives us valid CSS. And now that librsvg parses valid CSS, that's a
fine thing to use.

And it fixes the problem where %g is locale-dependent.
2013-10-05 21:32:09 +02:00
Benjamin Otte
303cf53f3f icontheme: Use rgba() when loading symbolic icons
This way, we correctly pass on translucency information. Note: This
currently requires librsvg master.
2013-10-05 13:57:51 +02:00
Bastien Nocera
8938f3c47d icon-theme: Fix 2 memory leaks in GtkIconInfo
https://bugzilla.gnome.org/show_bug.cgi?id=709264
2013-10-02 17:21:48 +02:00
Bastien Nocera
7c595bcc53 icon-theme: Use g_clear_* helpers in finalize
https://bugzilla.gnome.org/show_bug.cgi?id=709264
2013-10-02 17:21:48 +02:00
Cosimo Cecchi
3d602f5b0a icontheme: use g_file_load_contents() for symbolic icons
When loading a symbolic icon, g_file_get_contents() is currently used
with the icon pathname, to load its SVG data. This won't work when the
icon is not a local file, for instance when a symbolic icon is loaded
from a GFileIcon with a GResource path.
Fortunately GtkIconInfo already holds a GFile, so we can just use
g_file_load_contents() to load the data instead.

https://bugzilla.gnome.org/show_bug.cgi?id=709056
2013-09-30 09:45:22 -07:00
Alexander Larsson
68c450468e icon-theme: Better handling of unscaled icon directories
If an icon is in a Fixed or Threshold directory we normally don't
scale it. However, in the case of HiDPI scaling we *do* want to
scale it, to avoid different layouts in Lo/HiDPI. We look up whatever
the size of the icon would have been in LoDPI and scale to that
in the no-scaling case, thus getting the same layout as the
unscaled case.

https://bugzilla.gnome.org/show_bug.cgi?id=708384
2013-09-23 12:45:34 +02:00
Alexander Larsson
a001dc0ec7 icon-theme: Make icon_info_new() have some args
This gets rid of a bunch of duplicated code.
2013-09-23 12:45:34 +02:00
Florian Müllner
f081552da1 icontheme: Make sure icon_info->scale doesn't end up 0
GdkPixbuf will fail returning %NULL if we try to scale a pixbuf to (0, 0),
which will then trigger an assertion in gtk_icon_info_load_icon_finish();
we never want a scale of 0, so ensure it is at least 1.

https://bugzilla.gnome.org/show_bug.cgi?id=708384
2013-09-20 14:42:41 +02:00
Matthias Clasen
6aa56979dc More documentation fixes 2013-09-17 01:28:39 -04:00
Chun-wei Fan
0e01f9cc9c GDK/GTK on Windows: Fix build
Due to the work on gdk_cursor_new_from_surface (commit b2113b73),
get_cursor_for_pixbuf() in GdkDisplayClass was converted to
get_cursor_for_surface(), which means the GDK Win32 backend needs to be
updated for the code to build and run on Windows, plus some function
prototypes and declarations/calls need to be updated as well.

https://bugzilla.gnome.org/show_bug.cgi?id=705980
2013-08-26 10:29:23 +08:00
Alexander Larsson
d5e5616ae6 icon-theme: Add ScaledDirectories support
For backwards compat support we don't want old implementations not
supporting scaling to see the new scaled directories, so move these
to a separate list.
2013-08-19 16:01:57 +02:00
Alexander Larsson
8ae81bb395 icon-theme: Use "Scale" for key as per the spec
The latest spec proposal uses "Scale", not "OutputScale", so use this.
2013-08-19 16:01:57 +02:00
Matthias Clasen
7b4f82ccc6 Make symbolic icons work with the current rsvg
The rsvg loader now restricts what external files it will
allow to load from an svg. Thus our xinclude trick doesn't work
anymore. To work around that, embed the payload in a  data: uri.
This is somewhat ugly, but the best we could come up with.
2013-08-16 22:05:38 -04:00
Cosimo Cecchi
b52844031f icontheme: correctly fallback to symbolic icons
When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.

Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.

https://bugzilla.gnome.org/show_bug.cgi?id=680926
2013-08-13 17:22:47 +02:00
Ryan Lortie
03147b0e72 gtkicontheme: check for GdkPixbuf first
We checked for G_IS_LOADABLE_ICON() before GDK_IS_PIXBUF().

Since we made GdkPixbuf implement GLoadableIcon, the special case for
pixbufs is never used, and the much much slower GLoadableIcon path is
taken instead.  Move the GdkPixbuf one to be first to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=705320
2013-08-02 15:00:08 +02:00
Murray Cumming
ac792f4a06 docs: gtk_icon_theme_lookup_by_gicon_for_scale() is new
It was added in commit 58adb70d43 .
2013-07-27 21:38:48 +02:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Alexander Larsson
1d0bb3e010 GtkIconTheme: Add helpers to load to cairo_surface_t
Right now this just uses the pixbuf load code and converts
it to a surface. In the future we could cache the pattern
to allow reusing the surface.
2013-07-03 14:39:26 +02:00
Carlos Garnacho
58adb70d43 icontheme: Add support for high resolution icons
An optional OutputScale integer key has been added to index.theme
subdirs description, so icon themes may provide icons that are
more suitable to render at a (typically 2x) integer upscaled
resolution. This way it is possible to make eg. a 16x16@2x icon has a
real size of 32x32, but contains a similar level of detail to the
16x16 icon so things don't look any more cluttered on high-dpi
screens.

The pixbuf lookup has changed so it prefers a minimal scale change
that yields the minimal real size difference, so if looking up for
a 16x16 icon at 2x, it would first prefer 16x16@2x, then 32x32, and
then any other icon that's closest to match

There is now *_for_scale() variants for all GtkIconTheme ways
to directly or indirectly fetch a GdkPixbuf.

This is based on code by Carlos Garnacho with changes by Alexander
Larsson
2013-07-03 14:39:26 +02:00
William Jon McCann
aa78c888eb Deprecate and ignore gtk-fallback-icon-theme
The standard icon themes have built in fallbacks.
2013-06-26 12:47:43 -04:00
Alexander Larsson
159cccfe7b IconTheme: Move changed emission to an idle
By delaying the emission to an idle we avoid a lot of tricky
reentrancy issues. For instance, a normal gtk_icon_theme_choose_icon()
call could in very rare cases (when a user updated an icon theme) emit
a signal which could affect the icon currently being looked up.  This
kind of reentrancy is very hard to test against, especially when it is
so rare, so we're better of avoiding it.

There is no real value to get the change signal directly anyway. All
it can do is affect which icon is rendered the next frame, and we will
handle the queued emission before rendering. Not to mention that icon
theme change detection is polled anyway, so it is already delayed.

https://bugzilla.gnome.org/show_bug.cgi?id=694755
2013-06-19 11:15:37 +02:00
Alexander Larsson
1ee36713fe IconTheme: Clear caches when reloading theme
When we're reloading the theme in ensure_valid_themes (due to noticing
that a theme dir has changed) we need to also clear the icon cache
as it will not be valid for the new theme.

We already do this in do_theme_change(), but ensure_valid_themes()
was missing this.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Alexander Larsson
280d606cd4 IconCache: Keep a ref on the GtkIconData
The icon data in GttkIconInfo->data is currently owned by the
IconThemeDir->icon_data hashtable. However, on e.g. a theme change
blow_themes() destroys the dirs and thus the data, meaning any
outstanding GtkIconInfo points to stale data.

We solve this by adding a refcount to GtkIconData and reffing it
from GtkIconInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Benjamin Otte
e255cf15fb icontheme: Remove unused function 2013-04-06 10:47:55 +02:00
Will Thompson
507bf6e5cf docs: correct various spelling and grammar errors
I noticed a few cases of "wether", and while fixing them noticed a few
"its" which should be "it's". It all went downhill from there.
2013-03-04 22:48:22 +00:00
Giovanni Campagna
9d81b69e06 GtkIconTheme: fix regression from 0db32f0632
icon_info_dup() is now called also for GtkIconInfos that already have
a pixbuf, so we must make sure that we correctly carry that from
the original icon_info to the copy.
2013-03-04 21:34:23 +01:00
Giovanni Campagna
0db32f0632 GtkIconTheme: fix failed assertion when asynchrnously loading emblemed icons
If you tried to lookup an icon that was not emblemed, and then looked up
an emblemed icon with the same base, we would override the iconinfo adding
the emblems inline. Later, when the icon finished rendering, inside
gtk_icon_info_load_icon_finish, we would copy the result from the duplicate
(which did not include the emblem infos), but the icon would still fail the
assertion, because emblems infos are present but emblem_applied is false
(they were not requested in the first place!).
Solve this by avoiding the overwrite on a cached iconinfo, and instead duplicate
the iconinfo before adding the emblems. It is expected that another layer
of caching (such as StTextureCache in gnome-shell) will take care of avoiding
multiple rendering of the same icon+emblem combination.

https://bugzilla.gnome.org/show_bug.cgi?id=694968
2013-03-04 16:28:00 +01:00
Jasper St. Pierre
367364a8e1 Fix deprecations for GtkIconInfo 2013-02-15 19:48:56 -05:00
Jasper St. Pierre
489a10f488 gtkicontheme: Mark copy/free compat symbols as skip 2013-02-15 19:48:56 -05:00