Commit Graph

570 Commits

Author SHA1 Message Date
Benjamin Otte
fcb08a28bf stylecontext: Remove unused typedef 2020-02-05 04:03:43 +01:00
Timm Bäder
416182a20d style context: Remove parent relationship
We don't have foreign drawing anymore, so we don't need this.
2020-02-05 04:03:43 +01:00
Benjamin Otte
31713ab5ef stylecontext: Remove gtk_style_context_new()
It's private now, no more foreign drawing of any sort.

To be fair, it was entirely useless without widget paths already.
2020-02-05 04:03:43 +01:00
Benjamin Otte
db9730b734 stylecontext: Remove the "changed" signal
Instead, always go directly to the GtkWidget::css_changed() call.
2020-02-05 04:03:43 +01:00
Benjamin Otte
546a748cd8 widget: Replace style-updated signal with css_changed vfunc
1. Rename the thing
2. Turn it from a signal to a vfunc
3. Pass the GtkCssStyleChange to it

We don't export any public API about the GtkCssStyleChange yet, it's
just a boring opaque struct.
2020-02-05 02:46:13 +01:00
Matthias Clasen
10e4c04e61 Use style values directly
Replace uses of gtk_css_style_get_value with direct access,
throughout the tree. We don't replace all uses, just those
where we are dealing with a fixed property. Be careful to
handle the currentColor special case for color properties.
2020-01-29 11:07:32 +01:00
Benjamin Otte
632fab0ca7 stylecontext: Get rid of gtk_style_context_get()
... and replace all the calls to it with
gtk_style_context_peek_property().

All the calls are hacks that need to go away btw.
2020-01-28 02:58:02 +01:00
Benjamin Otte
18cb15a05a stylecontext: Remove gtk_style_context_get_section()
The inspectors gets values differently these days.
2020-01-28 02:17:03 +01:00
Benjamin Otte
146b921246 cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.

As a side effect we also save 64 bytes per declaration.
2020-01-28 02:17:03 +01:00
Benjamin Otte
49b47c9133 Remove GtkWidgetPath
... and all associated demos and tests.
2020-01-28 02:17:02 +01:00
Benjamin Otte
e6a0a2f587 stylecontext: Remove excess gtk_css_node_invalidate() call
This call is not necessary, because gtk_css_node_set_parent() does the
right thing. (It probably hasn't been necessary for years, but I'm
not gonna try my luck on GTK3 at this stage.)

This code is usually called the first time
gtk_widget_get_style_context() is called on a widget and its style
context gets create. At that point however, the css nodes are in the
right place already, so no invalidation should happen.
2020-01-21 14:49:25 +01:00
Benjamin Otte
c85d9a3259 stylecontext: Change semantics of gtk_style_context_get_path()
Widget contexts now return NULL here. A non-NULL result requires a
previous call to gtk_style_context_set_path()
2020-01-21 12:47:16 +01:00
Timm Bäder
67991ed0f4 Remove GtkCssRgbaValue
The differenciation between a literal color value and an RGBA value
caused problems in various situations. Just treat the two the same but
don't allow access to the rgba value of a non-literal color value.

This gets rid of around 1.6k rgba values in the widget-factory.
2020-01-18 08:49:51 +01:00
Philip Withnall
13f4d639fd gtkstyleprovider: Rename -gtk-style-changed signal to have a valid name
Signal names must start with a letter. They can’t start with a hyphen.

It was originally added in commit 74f4c6f6bd with no given reason
for why the signal name was chosen as it was.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-12 19:51:33 +00:00
Timm Bäder
26aa620efe stylecontext: Stop exporting _resolve_color
Only used in gtkstylecontext.c
2019-09-09 17:36:24 +02:00
Christian Hergert
f507a79056 marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:22:31 -07:00
Matthias Clasen
c2c4133eb0 Fix up the border/background-color removal
I overlooked one level of indirection here. Oops.
2019-03-31 20:43:19 -04:00
Matthias Clasen
0230cc55bc Drop deprecated style context api 2019-03-31 15:35:20 -04:00
Matthias Clasen
6f5675ef3c Stop using deprecated style context api
Use the non-deprecated one it wraps, instead.
Yes, this is cheating...
2019-03-31 15:35:20 -04:00
Benjamin Otte
380c4ece8d stylecontext: Use new snapshot transforms 2019-02-21 19:47:28 +01:00
Timm Bäder
131e8d8905 Remove some unnecessary gtkwindow.h includes 2019-02-05 08:11:43 -05:00
Timm Bäder
04eb7eef29 Remove icon extents API 2018-07-17 17:33:47 +02:00
Timm Bäder
218b39fe01 GtkStyleContext: Remove the frame clock
It's unused within GtkStyleContext.
2018-06-18 17:35:03 +02:00
Daniel Boles
acd05d09aa StyleContext: Don't advise using invalidate()
It doesn't exist anymore! Also, set_display() is not needed/used in the
demo cited, and we were still referring to gtk3-demo, not gtk4-demo.
2018-05-21 23:39:47 +01:00
Matthias Clasen
7fdf3d1769 Fixes to the gtk docs 2018-05-05 18:03:31 -04:00
Timm Bäder
e379ea617a stylecontext: Draw arrow-less insertion cursors as color nodes
This lets us avoid an often used cairo node.
2018-05-05 07:25:10 +02:00
Timm Bäder
f44959fa59 stylecontext: Remove outdated comment
gtktextview:invalidate_cursor_windwo is no more.
2018-05-05 07:25:10 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Christoph Reiter
f440c48dea gtkstylecontext: guard against gtk_css_widget_node_get_widget() returning NULL in more places
When the widget gets finalized it clears the widgetnode and gtk_css_widget_node_get_widget
returns NULL. Guard against gtk_css_widget_node_get_widget() returning NULL like in other
places.

See https://gitlab.gnome.org/GNOME/pygobject/issues/28#note_82862
2018-03-20 16:02:51 +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
Matthias Clasen
e92c0e85ec Replace gdk_keymap_get_for_display by gdk_display_get_keymap
Replace all uses of the old function by the new one.
No functional change.
2017-12-15 07:44:58 -05:00
Benjamin Otte
5b94fe6342 stylecontext: Make first property name explicit
Insist that a first non-NULL property is passed to
gtk_style_context_get().

This is in particular relevant because of dropping the state argument
since GTK3, and code like
  gtk_style_context_get (context, state, "font", &font);
would keep compiling without warnings without this change.
2017-11-10 14:56:42 +01:00
Matthias Clasen
e41936c19c Fix a typo
A display is not of type GDK_TYPE_SCREEN.
2017-11-01 19:44:28 -04:00
Benjamin Otte
3967072c66 docs: Fix up some places that still said screen instead of display 2017-10-31 08:25:37 +01:00
Benjamin Otte
83fb7a649f css: Merge GtkStyleProviderPrivate into GtkStyleProvider
This is just lots of renaming.

The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
2017-10-31 04:33:54 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Daniel Boles
3354ad080b StyleContext: Add CSS snippet language comments
The language is useful for parsing tools, such as that of gtkmm, which
otherwise assumes these are C snippets and elides them from its
generated documentation.
2017-10-12 19:40:45 +01:00
Timm Bäder
c1af127c28 stylecontext: Fix doc comment
There is no @cr here anymore.
2017-10-10 09:49:35 +02:00
Timm Bäder
0f6574dd05 stylecontext: Drop priv pointer 2017-10-01 09:19:09 +02:00
Timm Bäder
f537d36d0a GtkStyleContext: Create path node in _new
So we can avoid creating a GtkCssPathNode in _init and then throwing it
away right after when using the _new_with_node constructor, which is the
one we use for all widgets.
2017-07-19 21:27:16 -04:00
Timm Bäder
fc47be9339 GtkStyleContext: Remove property cache
It was only used for widget style properties which don't exist anymore.
2017-07-19 21:27:16 -04:00
Timm Bäder
e36ddfec17 Remove all widget style property code 2017-07-19 21:27:14 -04:00
Benjamin Otte
87497ca2e1 snapshot: Rename gtk_snapshot_translate_2d()
It's now called gtk_snapshot_offset().
2017-01-13 14:37:48 +01:00
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Benjamin Otte
95a2a5c54c gtk: Remove GtkJunctionSides 2016-12-20 18:01:12 +01:00
Benjamin Otte
0d68b22479 stylecontext: Remove a bunch of unneeded headers 2016-12-03 18:15:49 +01:00
Matthias Clasen
39e3b3a483 style context: Don't leak a widget path
Found by valgrind.
2016-11-17 20:22:42 -05:00
Benjamin Otte
349f55f2fe snapshot: Convert GtkLabel and GtkAccelLabel
Also adds gtk_snapshot_render_insertion_cursor().
2016-11-15 17:48:45 +01:00
Matthias Clasen
1410031e57 Drop support for symbolic colors
-gtk-gradient was the last internal user of this code, so
we can drop it now.
2016-11-07 14:46:41 -05:00
Matthias Clasen
d674e9c8fa Drop support for -gtk-gradient
The standard CSS radial-gradient can be used instead, and Adwaita
and HighContrast have been ported over.
2016-11-07 14:46:41 -05:00