Commit Graph

4190 Commits

Author SHA1 Message Date
Matthias Clasen
b5e00d36f0 Allow building without tests and demos
This is meant to cut down build time in flatpak and similar
situations. Since it produces technically incomplete builds,
we list these options in the status output at the end of
the meson run.
2017-09-06 09:53:20 -04:00
Daniel Boles
b5afe75700 docs: css-overview: Don’t recommend broken syntax
Using this produced warnings about the Pango syntax of <Family> <size>
being deprecated, and the size being invalid due to no unit specified.
Also, that multi-word font family presumably wouldn’t work as expected.
2017-09-03 12:26:07 +01:00
Javier Jardón
bc3968d2ff gtk/gtkshow: Remove deprected gtk_show_uri() 2017-08-28 23:47:36 +01:00
Daniel Boles
5f593ff306 getting_started: Sync filenames & section headings
The order of Examples 3 and 4 was swapped, so the headings updated
themselves, but the filenames were left reflecting the old order.

https://bugzilla.gnome.org/show_bug.cgi?id=786553
2017-08-22 14:15:46 +01:00
Timm Bäder
b24535ea75 container: Remove gtk_container_propagate_draw
It's superseded by gtk_widget_snapshot_child now.
2017-08-21 12:30:42 +02:00
Emmanuele Bassi
9957dd59b0 docs: Update references to Meson CLI utilities
The separate `mesonconf` and `mesontest` binaries have been deprecated,
in favour of `meson` sub-commands.
2017-08-15 14:08:57 +01:00
Emmanuele Bassi
0803ee2df4 docs: Update the 'building gtk' guide
Clean up for Meson.
2017-08-14 22:23:09 +01:00
Emmanuele Bassi
f82f0c7fbc docs: Update the release instructions 2017-08-14 22:23:09 +01:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Timm Bäder
a8a755e5cd widget: Remove gtk_widget_set_redraw_on_alloc
Since gtk+ draws more than the widget and allocates more size to it than
it knows about, this flag doesn't work anymore. Removing it (or setting
it to TRUE for widgets that used to set it to FALSE) fixes drawing
invalidation when these widgets get allocated a new size.
2017-08-09 16:26:26 +02:00
Timm Bäder
5874a30c73 GdkWindow: Remove gdk_window_new_input
Not needed anymore.
2017-08-09 15:19:46 +02:00
Matthias Clasen
80afb8c90a Fix docs build 2017-08-07 22:21:22 -04:00
Daniel Boles
d6e4ce127a docs: gtk/running: Document the GTK_CSD env var
It was not documented before.

https://bugzilla.gnome.org/show_bug.cgi?id=778791#c1
2017-08-06 17:44:18 +01:00
Benjamin Otte
47fe08528d eventbox: Remove 2017-08-02 16:59:09 +01:00
Benjamin Otte
cdba1b8ac8 docs: Don't use GtkEventBox 2017-08-02 16:55:25 +01:00
Timm Bäder
b71f644cf5 eventbox: Remove visible-window property
The GdkWindow that was supposed to back it is gone.
2017-07-27 21:53:42 +02:00
Timm Bäder
5720f2a845 widget: Make _set_clip private
We don't need this anymore since clips are now reported in
size-allocate.
2017-07-19 21:27:16 -04:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
0ebd8840a8 widget: Remove gtk_cairo_transform_to_window
Useless in a world without windows and cairo.
2017-07-19 21:27:15 -04:00
Timm Bäder
c4f6cea111 fix a few documentation problems 2017-07-19 21:27:15 -04:00
Timm Bäder
8dc5e13e8c iconview: Remove bin_window 2017-07-19 21:27:14 -04:00
Timm Bäder
e36ddfec17 Remove all widget style property code 2017-07-19 21:27:14 -04:00
Timm Bäder
a73d3418bc layout: Remove bin_window 2017-07-19 21:27:14 -04:00
Timm Bäder
4a4897a9b6 paned: Reimplement handle dragging 2017-07-19 21:27:13 -04:00
Timm Bäder
b9f70b473c scrollbar: Add new API to gtk4-sections.txt
and update the css node docs
2017-07-19 21:27:13 -04:00
Timm Bäder
34af3d3940 accellabel: Inherit from GtkWidget
Use a box and 2 labels.
2017-07-19 21:27:13 -04:00
Timm Bäder
9ab43dfe9e spinbutton: Add accessors for (max-)width-chars 2017-07-19 21:27:12 -04:00
Timm Bäder
2cedf1be9c widget: Remove gtk_widget_set_allocation 2017-07-19 21:27:12 -04:00
Timm Bäder
f736b071b4 spinbutton: Add text property 2017-07-19 21:27:11 -04:00
Daniel Boles
d7b175a3fb css-overview: Don’t document deleted pseudoclasses
Commit b52966a318 stopped the parser from
handling various deprecated pseudoclasses, which were aliases of others,
but it did not update the documentation to reflect that they were gone.
2017-06-22 23:56:44 +01:00
Daniel Boles
6eb58fa67b css-overview: Fix typo “{with=>which} is disabled” 2017-06-22 20:40:06 +01:00
Matthias Clasen
f135b2527f center box: complete the baseline support
When there is no externally allocated baseline, we should
do the same thing that GtkBox does, and determine one from
the children that want baseline alignment.

This commit adds a GtkCenterBox::baseline-position property
with setters and getters.
2017-06-10 09:14:16 -04:00
Matthias Clasen
e936a35d66 Make GtkCenterBox public
It provides functionality that GtkBox used to have,
and is generally useful.
2017-06-04 21:20:27 -04:00
Carlos Garnacho
d9d0c56eb7 gtktoolitem: Remove gtk_tool_item_set_use_drag_window()
This API call is not necessary anymore, since it's no longer necessary
to receive events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
02932bc406 gtkgesture: Drop GdkWindow checks
Those are now needless and wrong, as we get guarantees that handled
events will contain widget-relative coordinates. A side effect is
that these events are very possibly not explicitly sent to the
GdkWindow that implementations expect, any extra checks performed
through gtk_gesture_set_window() will be wrong, so the function has
been dropped entirely.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
fee289cd06 gdk: Add gdk_rectangle_contains_point() call
A little helper function for a somewhat common operation.
2017-05-25 16:25:58 +02:00
Matthias Clasen
c05b317b1e Fix the docs build
gtk-doc behavior changed, it seems, and these options now
cause the build to break.
2017-05-22 17:35:58 -04:00
Emmanuele Bassi
db2c80d9db meson: Generate man pages for the installed tools 2017-05-05 11:35:31 +01:00
Timm Bäder
3d21128dbb Remove gtk_widget_get_preferred_*
They are unnecessary now that we have gtk_widget_measure.
2017-05-05 11:18:25 +02:00
Emmanuele Bassi
8acf5a8174 build: Update autotools for API reference changes 2017-05-03 15:10:58 +01:00
Emmanuele Bassi
c984c3b55e build: Initial attempt at fixing the docs build
We need to reference the types file directly, because it won't be copied
into the builddir by Meson — except for GTK, which needs to generate its
own types file using configure_file().
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
ba87e857e2 build: Generate the API references (WIP)
Still a work in progress.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
f942aa53e2 docs: Rename files to match type and version
The main GDK API reference index is XML, not SGML.

The overrides file is for GDK 4.x, not 3.x.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
98b1075764 gdk: Remove GdkX11DisplayManager from the build
We don't instantiate it, and we don't use it any more.
2017-05-03 14:15:57 +01:00
Matthias Clasen
92b0d2e8ea Remove GtkWindow::hide-titlebar-when-maximized
This was only every implemented under X11, and with CSD,
this is clearly in the application realm. We should not
pretend that we can support it on the toolkit level.

https://bugzilla.gnome.org/show_bug.cgi?id=775061
2017-05-01 13:26:46 -04:00
Timm Bäder
bb1deaafa4 migration guide: Extend GtkBox child property section
Mention the removed expand and fill child properties as well.
2017-04-28 17:14:10 +02:00
Timm Bäder
db4b1d28f5 label: Remove angle property 2017-04-25 20:30:37 +02:00
Timm Bäder
fb927d1993 box: Remove center child 2017-04-25 20:30:37 +02:00
Timm Bäder
c92b7d4224 box: Remove fill child property
GtkWidget:halign and GtkWidget:valign are sufficient
2017-04-25 20:30:37 +02:00
Timm Bäder
5729ea7744 box: Remove expand child property
GtkWidget already has hexpand/vexpand properties.
2017-04-25 20:30:37 +02:00
Timm Bäder
ba363fbb71 widget: Add gtk_widget_insert_before/after
To insert a widget into the widget tree before or after a child widget
of the soon-to-be parent.
2017-04-25 20:29:02 +02:00
Timm Bäder
d5c6692104 gtk4-sections: Add missing GtkWidget child/sibling accessors 2017-04-24 14:15:57 +02:00
Jeremy Bicha
fc70267158 docs: Use https for more links
https://bugzilla.gnome.org/show_bug.cgi?id=780878
2017-04-03 16:02:22 -04:00
Jeremy Bicha
183e5bb8a4 docs: Point links to correct versions
https://bugzilla.gnome.org/show_bug.cgi?id=780878
2017-04-03 16:02:22 -04:00
Timm Bäder
0ce9f26dc5 window: Remove has-toplevel-focus property
Since embedded toplevels don't exist anymore, :has-toplevel-focus is
equivalent to :active.
2017-03-31 09:50:39 +02:00
Timm Bäder
6353433f0e Make gtk_container_set_focus_child private 2017-03-31 09:50:39 +02:00
Timm Bäder
0d480a3eb0 Remove gtk_container_get_focus_child 2017-03-31 09:50:39 +02:00
Matthias Clasen
e70380a4dd Document GTK_INSPECTOR_RENDERER
Also add GTK_INSPECTOR_DISPLAY to the docs at the same time.
2017-03-30 09:15:22 -04:00
Daniel Boles
a2b72f89e2 css-overview: Fix inconsistent British English use 2017-03-18 12:31:29 +00:00
Daniel Boles
c3892874cb css-overview: Fix+Explain color expr number ranges
Last try, promise. They don’t all use 0 to 1. We should probably explain
the effects too. Hopefully this manages that while not being too verbose
2017-03-18 01:17:14 +00:00
Daniel Boles
e5ae946be3 css-overview: Elaborate how color expressions work 2017-03-17 23:56:25 +00:00
Daniel Boles
a69083c95e docs/css-overview: Fix color functions’ arg orders
shade/alpha/mix() take colour(s) and a number that is the ratio by which
to transform them. It was written here that these shall be passed in the
order (number, colour). That was wrong: they must be passed in the order
(colour[s], number) to work, and for the Inspector not to flag an error.
2017-03-17 23:31:41 +00:00
Murray Cumming
158015be6c
docs: Remove mentions of gtk_init_with_args().
Because it has been removed: See commit 7e8eb3ddcd
2017-03-17 21:12:12 +01:00
Timm Bäder
f860ff8647 widget: Remove get_valign_with_baseline
This only existed for backwards compat reasons which aren't interesting
for gtk4.
2017-03-05 15:18:32 +01:00
Daniel Boles
385e1236a7 docs/css-properties: Fix info on 3value properties
https://developer.mozilla.org/en/docs/Web/CSS/margin#Values
2017-02-17 15:18:24 +00:00
Chris Martin
705fc62840 getting-started: typo tie->the
https://bugzilla.gnome.org/show_bug.cgi?id=775864
2017-02-05 20:02:10 +00:00
Timm Bäder
2aea8dfee9 togglebutton: Move :inconsistent to GtkCheckButton 2017-01-30 18:11:00 +01:00
Timm Bäder
66d584ce6e togglebutton: Move :draw-indicator property to GtkCheckButton
It's not used in GtkToggleButton at all, only in GtkCheckButton and
GtkRadioButton.
2017-01-30 18:11:00 +01:00
Timm Bäder
6c6ed7496c widget: Remove gtk_widget_class_list_style_properties
Unused.
2017-01-30 18:11:00 +01:00
Daniel Boles
19e2f347e1 3to4: Fix typo in previous commit 2017-01-21 22:43:50 +00:00
Daniel Boles
0a347c6ff2 3to4: Fix suggested replacements for border-width
The new CSS border-spacing does what Grid::(row|column)_spacing and
Box::spacing already did, i.e. controlling the space added between child
widgets, so it’s not a replacement for Container::border-width.
2017-01-21 22:39:06 +00:00
Daniel Boles
439fcf7578 combobox: Remove property cell-area
The CellArea is going to become a pure implementation detail & be moved
to the .ui, instead of letting users mess with it (if anyone ever did).
2017-01-21 21:34:45 +00:00
Timm Bäder
f4341ee9f7 widget: Remove show-all property
Doesn't make sense anymore now that gtk_widget_show_all is gone.
2017-01-20 21:37:07 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Matthias Clasen
47bc8603b0 Add a section about initialization to the migration guide
Just the facts.
2017-01-19 13:53:11 -05:00
Matthias Clasen
2c7e567f05 Update callers
Adapt all our tests and examples to the new initialization api.
2017-01-19 13:50:17 -05:00
Matthias Clasen
cfb599bf67 We no longer have gdktestutils
Update the docs build to reflect that.
2017-01-16 17:50:02 -05:00
Timm Bäder
32783a8187 gtk4-section: Add GtkInfoBar:revealed setter+getter 2017-01-16 17:22:11 +01: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
b58de2d16c snapshot: Redo pop() API
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()

So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
2017-01-13 03:38:36 +01:00
Benjamin Otte
bc3ba68641 snapshot: Add gtk_snapshot_push_blend()
and use it for backgrounds.
2017-01-13 03:38:36 +01:00
Benjamin Otte
d9b0685b49 Add gtk_snapshot_push_cross_fade()
... and use it.

The function is a bit awkward because it requires 2 calls to
gtk_snapshot_pop(), but once you accept that, it's very convenient to
use, as can be seen by the 2 implementations.
2017-01-13 03:38:36 +01:00
Matthias Clasen
0868757cfd More filter documentation updates
Actually document the filter property, not just -gtk-icon-filter.
2017-01-11 14:07:56 -05:00
Matthias Clasen
5f2a7ed3c1 Correct the -gtk-icon-filter docs
I was overlooking that it is possible to specify multiple
functions. Also add a reference to the relevant spec draft.
2017-01-11 13:42:58 -05:00
Matthias Clasen
249a0b1f22 Some updates to the migration guide 2017-01-10 21:21:26 -05:00
Matthias Clasen
8a83362fb8 Document -gtk-icon-filter
Not much detail here yet, but the syntax is documented.
2017-01-10 21:21:26 -05:00
Timm Bäder
3d5a62a0c9 actionbar: Add revealed property
So we can show and hide it with a transition as well as bind another
property to it.
2017-01-08 14:57:11 +01:00
Benjamin Otte
7ade6e3f46 gdk: Remove testing functions
They were unused and unimplemented.
2017-01-08 03:46:30 +01:00
Benjamin Otte
2a9ae1e8df tests: Remove gtk_widget_send_key()
It's unused in GTK.
2017-01-08 03:46:30 +01:00
Benjamin Otte
daf0270f1a tests: Remove widget find functions
They are all unused by GTK.

And other people can write their own find functions if they need any in
their tests.
2017-01-08 03:36:05 +01:00
Benjamin Otte
c1f1dae997 viewport: Remove API to query GdkWindows 2017-01-08 00:48:13 +01:00
Benjamin Otte
d50b73f66d treeview: Remove gtk_tree_view_get_bin_window()
We don't want to expose GdkWindows in the public API.
2017-01-08 00:48:12 +01:00
Timm Bäder
47d4ad71fb Remove gtk_container_snapshot_child
Replace it with the already existing gtk_widget_snapshot_child.
2017-01-07 17:19:30 +01:00
Timm Bäder
5ab2377afa widget: Remove gtk_widget_style_get_property 2017-01-07 17:19:30 +01:00
Benjamin Otte
b993acfe2c gsk: Add GskRepeatNode
Also add gtk_snapshot_push_repeat() and use that to draw backgrounds.

With that change, CSS background snapshots are created without Cairo
nodes.
2017-01-01 19:53:36 +01:00
Benjamin Otte
2571036c07 gsk: Turn GskTexture into a GObject 2017-01-01 19:53:36 +01:00
Benjamin Otte
8973191278 snapshot: Add gtk_snapshot_push_color_matrix()
So far, this is unused.
2016-12-31 02:49:47 +01:00
Benjamin Otte
7540702cf0 gsk: Add GskColorMatrixNode
This node essentially implements the feColorMatrix SVG filter. I got the
idea yesterday after looking at the opacity implementation.

It can be used for opacity (not sure if we want to) and to implement a
bunch of the CSS filters.
2016-12-31 02:49:47 +01:00
Benjamin Otte
677c5bdedf cellrenderer: Move snapshotting down into cell renderers
Now that every call to GtkCellArea is a snapshot call and no more cairo
calls are left, move the actual differentiation between Cairo and
Snapshot down to the cell renderer.
2016-12-23 09:23:04 +01:00
Benjamin Otte
4bb0c70c11 gsk: Add docs and error handling to serialization API 2016-12-23 08:11:01 +01:00
Benjamin Otte
5e089c4345 gsk: Add gsk_render_node_write_to_file()
For when you're in a debugger and need to have a closer look at this
node...
2016-12-23 08:11:01 +01:00
Benjamin Otte
6c56793147 gsk: Add gsk_texture_download() API
Now users can download pixels and make everything slooooooow.
2016-12-23 08:11:01 +01:00
Benjamin Otte
be8c999fe8 docs: Add GskTexture 2016-12-23 08:11:01 +01:00
Benjamin Otte
373e08d6d4 gsk: Add gsk_renderer_render_texture()
... and implement it for the Cairo renderer.

It's an API that instructs a renderer to render to a texture.
So far this is mostly meant to be used for testing, but I could imagine
it being useful for rendering DND icons.
2016-12-23 08:11:01 +01:00
Benjamin Otte
735846cc82 gsk: Export gsk_render_node_get_bounds()
I'll need it in tests/testsuite soon.
2016-12-23 08:11:00 +01:00
Matthias Clasen
924efd988d Fixes for the gdk docs 2016-12-21 13:57:16 -05:00
Matthias Clasen
961286b7cd Make gsk docs build 2016-12-21 13:57:16 -05:00
Alexander Larsson
4ee45b76ca gsk docs: gsk_render_node_iter_get_type doesn't exist anymore 2016-12-21 14:01:34 +01:00
Benjamin Otte
def94f03e2 debug: Add GTK_DEBUG=snapshot
This causes the snapshotting algorithm to dump all widget nodes into
their own container node. We then name that group accordingly (ie
"GtkSwitch<0xdeadbeef>") so you can easily see which node belongs where.

The feature is toggleable in the inspector's visual tab.

There's a few problems with it, becuse GtkSnapshot optimized container
nodes away if they are not needed, so we are losing some widgets...
2016-12-20 19:26:40 +01:00
Benjamin Otte
c4065b9ee0 API: Export gtk_container_snapshot_child()
It's equivalent to gtk_container_propagate_draw() and then one is
public, too.
2016-12-20 19:26:40 +01:00
Benjamin Otte
22a657004b debug: Remove pixel-cache debug categories
We have no more pixel cache, so they are kind of useless.
2016-12-20 19:26:40 +01:00
Benjamin Otte
4d9eedafcd roundedbox: Add gtk_rounded_boxes_init_for_style()
Instead of making people intiialize a rectangle and then applying border
radius manually, provide a constructor that does it for them.
While doing that, also allow people to instead request the padding box
or the content box.

Refactor all relevant code to use this new constructor.
2016-12-20 18:01:12 +01:00
Benjamin Otte
95a2a5c54c gtk: Remove GtkJunctionSides 2016-12-20 18:01:12 +01:00
Benjamin Otte
2034e83a20 gsk: Add GskOutsetShadowNode 2016-12-20 18:01:12 +01:00
Benjamin Otte
fcc1f554d6 gsk: Add GskInsetShadowNode
And again lots of shadow code gets copied to GSK. But we're now almost
at a stage where widget-factory does not use cairo nodes anymore.
2016-12-20 18:01:12 +01:00
Benjamin Otte
4fc64ae3dd gsk: Add contains/intersect functions for GskRoundedRect
... and use them.
2016-12-20 18:01:12 +01:00
Benjamin Otte
2480e0d575 gsk: Add GskShadowNode
... and make the icon rendering code use it.

This requires moving even more shadow renering code into GSK, but so be
it. At least the "shadows not implemented" warning is now gone!
2016-12-20 18:01:12 +01:00
Benjamin Otte
071c9a8221 API: gdk: Add gdk_rgba_is_clear() and gdk_rgba_is_opaque()
I want to use these inside GSK, and I'm not a fan of putting GdkRGBA
APIs into it or duplicating it into GTK.

So public API it is.
2016-12-20 18:01:12 +01:00
Benjamin Otte
15e8a22f08 gsk: Move gtk/gtkcairoblur.c to gsk/gskcairoblur.c 2016-12-20 18:01:11 +01:00
Benjamin Otte
75b76af221 gsk: Add GskBorderNode
The node draws a solid CSS border, which can be used to cover everything
but dashed and dotted borders (double, groove, inset, ...).

For different border styles, we overlay multiple nodes and set their
colors to transparent for sides with non-matching styles.
2016-12-20 18:01:11 +01:00
Benjamin Otte
a9809e5d30 gsk: Add gsk_rounded_rect_shrink()
... and replace _gtk_rounded_box_grow() and _gtk_rounded_box_shrink()
with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
30438c6e8b gsk: Add cross-fade node
And implement stack crossfades with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
e8cd71228a gsk: Implement linear gradient render nodes 2016-12-20 18:01:11 +01:00
Benjamin Otte
cf520b7a1f gsk: Add blend nodes
Implement blend mode support in GTK background compositing with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
23e35706b4 gsk: Add support for rounded clip rectangles
Also add support to GtkSnapshot, so people can push rounded clips.
2016-12-20 18:01:10 +01:00
Benjamin Otte
59d638a09f gsk: Add GskRoundedRect
It's essentially a port of GtkRoundedBox to graphene.
2016-12-20 18:01:10 +01:00
Benjamin Otte
1137483d15 snapshot: Work on pushing and popping again
It is now possible to call push() subfunctions for simple container
nodes with just a single child. So you can for example
gtk_snapshot_push_clip() a clip region that all the nodes that get
appended later will then obey.

gtk_snapshot_pop() will then not return a container node, but a clip
node containing the container node (and similar for the transform
example).

This is implemented internally by providing a "collect function" when
pushing that is called when popping to collects all the accumulated
nodes and combine them into the single node that gets returned.

To simplify things even more, gtk_snapshot_pop_and_append() has been
added, which pops the currently pushed node and appends it to the
parent.

The icon rendering code has been converted to this approach.
2016-12-20 18:01:10 +01:00
Benjamin Otte
1f988d8b05 gsk: Add gsk_clip_node_new()
The node is a simple clipping node: It does a rectangular clip of its
contents.
2016-12-20 18:01:10 +01:00
Benjamin Otte
07d39299ea gsk: Replace gsk_render_node_set_opacity()
... with gsk_opacity_node_new().

Also implement support for opacity in gtk_widget_snapshot() using this
new node.
2016-12-20 18:01:10 +01:00
Benjamin Otte
c258ee403a snapshot: Make gtk_snapshot_get_renderer() private
Public API doesn't need to be concerned with renderers. Worst case, they
can use NULL instead of the actual renderer.
2016-12-20 18:01:10 +01:00
Benjamin Otte
b120075698 snapshot: Add API for colors and textures 2016-12-20 18:01:10 +01:00
Benjamin Otte
6129daf29b gsk: Add gsk_color_node_new() 2016-12-20 18:01:10 +01:00
Benjamin Otte
e82d02432e gsk: Add gsk_render_node_draw()
Draws a node to a given cairo_t. This is mostly intended for fallback
usage.
2016-12-20 18:01:10 +01:00
Benjamin Otte
02131d590e snapshot: Change how gtk_snapshot_push/pop works
Instead of appending a container node and adding the nodes to it as they
come in, we now collect the nodes until gtk_snapshot_pop() is called and
then hand them out in a container node.

The caller of gtk_snapshot_push() is then responsible for doing whatever
he wants with the created node.

Another addigion is the keep_coordinates flag to gtk_snapshot_push()
which allows callers to keep the current offset and clip region or
discard it. Discarding is useful when doing transforms, keeping it is
useful when inserting effect nodes (like the ones I'm about to add).
2016-12-20 18:01:10 +01:00
Benjamin Otte
67fb129ed7 gsk: gsk_render_node_set_transform() => GskTransformNode
Instead of having a setter for the transform, have a GskTransformNode.

Most of the oprations that GTK does do not require a transform, so it
doesn't make sense to have it as a primary attribute.

Also, changing the transform requires updating the uniforms of the GL
renderer, so we're happy if we can avoid that.
2016-12-20 18:01:10 +01:00
Benjamin Otte
19753062c4 gsK: Move children handling to GskContainerNode 2016-12-20 18:01:09 +01:00
Benjamin Otte
e2625f8649 gsk: Remove GskRenderNode::parent
... and all related APIs.
2016-12-20 18:01:09 +01:00
Benjamin Otte
3eb7c4719b gsk: Remove gsk_render_node_set_bounds()
gsk_render_node_get_bounds() still exists and is computed via vfunc
call:
- containers dynamically compute the bounds from their children
- surface and texture nodes get bounds passed on construction
2016-12-20 18:01:09 +01:00
Benjamin Otte
e4ee65fd19 gsk: Remove gsk_render_node_set_opaque()
If we ever feel, we need this function again, we can readd it later.

But nobody is using it other than for overriding opactiy. And you can
just override opacity directly if you care.
2016-12-20 18:01:09 +01:00
Benjamin Otte
a97b819b81 gsk: Add gsk_container_node_new()
It replaces gsk_renderer_create_render_node() which was doing the eact
same thing, only taking an unused extra argument.
2016-12-20 18:01:09 +01:00
Benjamin Otte
8830a1a1ad gtk: Remove gtk_snapshot_append()
It does not make sense to append an empty container node. Those should
only be push()'d.
2016-12-20 18:01:09 +01:00
Benjamin Otte
cb5c5170f4 gsk: Remove unneeded children modifiers
Creating render nodes is fire-and-forget, so all one should do is create
a container, append, append, append and then send it off to the
renderer. So there's no need to replace, insert between or anything
else.
2016-12-20 18:01:09 +01:00
Benjamin Otte
52d2faef88 gsk: Add gsk_cairo_node_new()
Split off Cairo drawn content nodes and require you to allocate them
using this new function.
2016-12-20 18:01:09 +01:00
Benjamin Otte
d1b80a6baa gtk: Don't push cairo nodes
We want to split nodes into containers and nodes that do actual drawing.
So pushing nodes that do drawing is exactly the wrong thing.

Also fix up GtkPopover. There's no need for it to push anything.
2016-12-20 18:01:09 +01:00
Benjamin Otte
8c8691b469 gsk: Add gsk_texture_node_new()
Start the transition into the different node types.
2016-12-20 18:01:09 +01:00
Benjamin Otte
ac5e277a71 gsk: Add GskRenderNodeType
For now, this is unused.
2016-12-20 18:01:09 +01:00
Benjamin Otte
f258af9cce gsk: Remove GskRenderNodeIter 2016-12-20 18:01:09 +01:00
Benjamin Otte
9bff1c12d4 gsk: Remove custom GValue API for GskRenderNode 2016-12-20 18:01:09 +01:00