Commit Graph

27561 Commits

Author SHA1 Message Date
Matthias Clasen
712196c416 Don't confuse gtk-doc
Empty doc comments make gtk-doc complain about undocumented
functions, even though these functions are not supposed to
be documented in the first place.
2016-11-19 12:39:09 -05:00
Matthias Clasen
3dc53dab69 Document ::snapshot vfunc 2016-11-19 12:37:19 -05:00
Matthias Clasen
c9c391bd55 Drop macro wrappers for get_version functions
These are not really useful, and were added long ago
as a clutch for transitioning to the new names.
2016-11-19 12:28:52 -05:00
Benjamin Otte
9dae0a9b00 widgetnode: We never need widget paths anymore
Backwards compat is not necessary in GTK4.
2016-11-19 18:08:35 +01:00
Matthias Clasen
0d1c54b6cc Remove once again, empty doc comments that break the docs
This is just more breakage from introspection ursurping doc
comments. Somebody needs to find a proper solution before this
is brought back.
2016-11-19 12:02:07 -05:00
Matthias Clasen
0392acd875 Reduce the text shadow warnings
They make it hard to see other useful information.
2016-11-19 08:05:42 -05:00
Benjamin Otte
dc634fe6db render: Compute extents correctly
I multiplied matrices the wrong way. Again.
2016-11-19 03:15:51 +01:00
Simon Steinbeiss
a1deb8e459 progressbar: add empty and full classes on trough based on fill-level
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-11-19 03:02:46 +01:00
Matthias Clasen
295066dad8 inspector: Show render node properties 2016-11-18 20:59:10 -05:00
Benjamin Otte
dbfc1d72fc csstransform: Handle matrix3d() 2016-11-18 21:44:25 +01:00
Benjamin Otte
ff4b8512be csstransform: Implement 3D scale and transform matrices 2016-11-18 21:44:25 +01:00
Benjamin Otte
ef6d95879f csstransforms: Parse 3D rotations 2016-11-18 21:44:25 +01:00
Benjamin Otte
d52fcd914c csstransform: Convert to use graphene_matrix_t
Pre-work to use 3D-transforms.
2016-11-18 21:44:25 +01:00
Matthias Clasen
0a75bb4353 Work towards a clean docs build
Remove various no-longer-existing functions from the sections
file, and exclude more private headers, etc.
2016-11-18 14:43:34 -05:00
Matthias Clasen
0311a1883c snapshot: Name api parameters consistently
gtk-doc gets upset otherwise.
2016-11-18 07:57:10 -05:00
Matthias Clasen
95c13ee471 Document GtkSnapshot
This is just some initial documentation, more detail needed.
2016-11-18 07:43:39 -05:00
Benjamin Otte
dd6fb87443 printunixdialog: Use new drawing area API 2016-11-18 06:40:53 +01:00
Benjamin Otte
b0f392534f coloreditor: Don't draw a background on boxes
Boxes know how to draw backgrounds these days.
2016-11-18 06:40:53 +01:00
Benjamin Otte
5940625e9e drawingarea: Add gtk_drawing_area_set_draw_func() 2016-11-18 06:40:53 +01:00
Benjamin Otte
41d1e1fea8 drawingarea: Add content-width and content-height properties
People should use these instead of gtk_widget_set_size_request().
2016-11-18 06:40:53 +01:00
Benjamin Otte
100ac17505 drawingarea: Clean up
No need to send configure events anymore and this should be a no-window
widget.
2016-11-18 06:40:53 +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
efa1c6cbd5 widget: Add a defualt snapshot vfunc
Just to avoid having to do NULL checks when calling
widget_class->snapshot. We were crashing with drawing areas who don't
have a draw or a snapshot vfunc (woot!).
2016-11-18 00:47:56 +01:00
Benjamin Otte
9a06b0fd5f widget: Fix math screwups in clip calculation
We need so subtract the allocation from the clip to get the clip offset,
not the other way around.

This was screwing in particular with marks on GtkScale, because GtkScale
mark clip computation is broken and always returns (0,0) which makes
scales have a waaaaay too large clip.
But that's another bug.
2016-11-17 23:16:14 +01:00
Matthias Clasen
214eb5860d placeview: Don't leak the file enumerator
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774634
2016-11-17 13:50:25 -05:00
Matthias Clasen
0cec768b54 entry: Fix input window position for icons
This makes the icon in the placesview address entry and
in widget-factory's progress entry work again.
2016-11-17 12:04:35 -05:00
Timm Bäder
55fda57c44 filechooserwidget: Forward file filter to entry
And in the entry, apply the currently used filter as a second step to
the completion items.

https://bugzilla.gnome.org/show_bug.cgi?id=773007
2016-11-17 15:42:25 +01:00
Timm Bäder
f4929360aa sizerequest: rename _compute_size_for_orientation to _measure
They have the exact same parameters and gtk_widget_measure did
unnecessary work before. Also better stack traces!
2016-11-17 15:42:25 +01:00
Matthias Clasen
5b3b111260 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:06:57 -05:00
Matthias Clasen
2f197ac0c2 Revert "GtkFileChooser: Make local-only default to FALSE"
This reverts commit 0bc79910e0.
2016-11-17 09:05:47 -05:00
Matthias Clasen
0bc79910e0 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:02:29 -05:00
Ondrej Holy
16bce17168 gtkplacesview: Add example of IPv6 address in guidance
Square brackets are mandatory for IPv6 addresses. Add example of IPv6
address in the guidance to make it obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-11-17 08:15:40 -05:00
Benjamin Otte
ab60cbd86a snapshot: Implement gtk_snapshot_clips_rect()
And use this to cull widgets and gadgets that are completely outside the
clip region.

A potential optimization is to apply this clip region to cairo contexts
created with gtk_snapshot_append_cairo_node(), but for that we'd need to
apply the inverse matrix to the clip region, and that causes rounding
errors.

Plus, I hope that cairo drawing becomes exceedingly rare so it won't be
used for the whole widget factory like today (which might also explain
why no culling happens in the widget factory outside the header bar.
2016-11-17 03:33:50 +01:00
Benjamin Otte
28b32d336f snapshot: Pass the clip region to the snapshot 2016-11-17 02:14:10 +01:00
Benjamin Otte
7493f90662 snapshot: Add GtkSnapshotState
Essentially copies cairo_gstate_t.

This is in preparation for attaching more information to the snapshot.
2016-11-17 01:55:26 +01:00
Benjamin Otte
5dfe788e9e snapshot: Fix graphene misunderstandings
The equivalent to cairo_matrix_multiply (a, b, c) is
graphene_matrix_multiply (c, b, a).

graphene_matrix_multiply (a, b, c) may not be called with b and c being
the same matrix.
2016-11-17 01:05:15 +01:00
Benjamin Otte
6d9725f7fd snapshot: Add infrastructure to snapshot CSS images
Use this infrastructure to render builtin images. Which means from now
on, GtkCheckbutton, GtkSpinner and a few others use snapshots.
2016-11-16 20:51:53 +01:00
Benjamin Otte
c22a9a03f9 renderbackground: Remove unused functions 2016-11-16 19:31:47 +01:00
Benjamin Otte
bcf70e3a03 API: Remove everything relating to "grip"
Grips have long been unused in GTK, so remove all support for them.
This removes the GTK_STYLE_CLASS_GRIP and the special
gtk_render_handle() code for drawing those grips.
2016-11-16 19:27:43 +01:00
Benjamin Otte
56e11f057c API: Remove gtk_render_extension()
This is long-gone drawing API.
2016-11-16 18:36:10 +01:00
Benjamin Otte
40565fb030 gsk: Rework GskTexture
We do no longer bind textures to a renderer, instead they are a way for
applications to provide texture data.

For now, that's it. We've reverted to uploading it from scratch every
frame.
2016-11-16 17:36:33 +01:00
Benjamin Otte
f728f33382 container: ensure we only append a single node
The snapshot vfuncs must only append at most a single node,
otherwise things are going to break if the widget is the root node.

Unfortunately there is no code that can check this in a generic fashion,
so we'll have to debug this on a case-by-case basis.
2016-11-15 22:39:26 +01:00
Benjamin Otte
2e9ff11c85 snapshot: push/pop mismatch is critical
This is broken code that needs to be fixed right now.
2016-11-15 22:39:05 +01:00
Benjamin Otte
b8710d8962 widget: Remove get_render_node() vfunc 2016-11-15 17:49:19 +01:00
Benjamin Otte
313a708006 snapshot: Convert inspector's RenderNodeView 2016-11-15 17:49:19 +01:00
Benjamin Otte
e2fb970889 container: Remove get_render_node() support API
It's unused now.
2016-11-15 17:49:19 +01:00
Benjamin Otte
e8381f84d6 snapshot: Convert GtkPopover 2016-11-15 17:49:19 +01:00
Benjamin Otte
475cffd7f8 gadget: Remove gtk_css_gadget_get_render_node()
It's unused now that we can snapshot.
2016-11-15 17:49:19 +01:00
Benjamin Otte
ada70f4872 snapshot: Convert GtkIcon 2016-11-15 17:49:19 +01:00
Benjamin Otte
d38cf9fee2 snapshot: Convert GtkExpander 2016-11-15 17:49:19 +01:00
Benjamin Otte
82eb223c58 Revert "GtkFrame: Convert to indirect rendering"
This reverts commit a0b2b3745f.

Frames cannot be rendered by GSK yet, because they do clipping.
2016-11-15 17:49:19 +01:00
Benjamin Otte
9c1da58ad1 snapshot: Convert GtkSeparator 2016-11-15 17:49:19 +01:00
Benjamin Otte
47a82640a8 Revert "Covert GtkOverlay to indirect rendering"
This reverts commit fd4a1cdad6.

GtkOverlay uses clipping and render nodes can't clip yet.
2016-11-15 17:49:19 +01:00
Benjamin Otte
30e0bbeaaa snapshot: convert GtkListBox 2016-11-15 17:49:19 +01:00
Benjamin Otte
150f75af66 snapshot: Convert GtkFlowBox 2016-11-15 17:49:19 +01:00
Benjamin Otte
a2b1aef6bd Revert "paned: Convert to indirect rendering"
This reverts commit ba9193fc81.

Paneds can do indirect rendering yet as we need clipping support first.
2016-11-15 17:49:19 +01:00
Benjamin Otte
dad8703e03 snapshot: Convert GtkSpinner 2016-11-15 17:49:19 +01:00
Benjamin Otte
0cf9f70ccd snapshot: Convert box gadget
Makes spinbuttons have text again!
2016-11-15 17:49:19 +01:00
Benjamin Otte
703d80eac0 window: Unrealize renderer last
We want to unrealize the renderer only after all widgets have been
unrealized. Otherwise, the widgets cannot release rendering resources
like textures.
2016-11-15 17:49:19 +01:00
Benjamin Otte
4b8b06bb08 image: Invalidate icon helper when unrealizing
This frees up any cached surfaces and textures in the iconhelper,
ensuring that the renderer can release its texture data.
2016-11-15 17:49:19 +01:00
Benjamin Otte
c0aa065ac1 snapshot: Convert GtkImage and GtkIconHelper
Adds a bunch of new APIs to render textures with theming.

FIXME: Cannot draw shadows for textures.
2016-11-15 17:49:19 +01:00
Benjamin Otte
92e6b3a000 snapshot: Port GtkHeaderBar 2016-11-15 17:48:45 +01:00
Benjamin Otte
55de4e7140 snapshot: Convert GtkFixed 2016-11-15 17:48:45 +01:00
Benjamin Otte
9b6dfa83e2 snapshot: Convert GtkComboBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
349f55f2fe snapshot: Convert GtkLabel and GtkAccelLabel
Also adds gtk_snapshot_render_insertion_cursor().
2016-11-15 17:48:45 +01:00
Benjamin Otte
ab47479045 snapshot: Convert GtkButton and subclasses 2016-11-15 17:48:45 +01:00
Benjamin Otte
4c9033b62d snapshot: Port GtkActionBar 2016-11-15 17:48:45 +01:00
Benjamin Otte
8c77b6f7f1 snapshot: Convert GtkButtonBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
cc1b422f64 snapshot: Convert GtkGrid 2016-11-15 17:48:45 +01:00
Benjamin Otte
64e802c441 snapshot: Convert entry and spinbutton 2016-11-15 17:48:45 +01:00
Benjamin Otte
8ac7918e0b snapshot: convert GtkBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
e3b1c9f1cd snapshot: Port to GtkSwitch
Included is the addition of gtk_snapshot_render_layout(), which is meant
to replace gtk_render_layout().
2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
4e06d8f73c snapshot: Add gtk_css_gadget_snapshot()
Including a snpahsot() vfunc, wee!
2016-11-15 17:48:45 +01:00
Benjamin Otte
ae2477b1bc container: Add snapshot() implementation
Note that this implementation does not respect GDK windows at all. If
your widget requires respecting them, you should write your own
snapshot implementation and not chain up.
2016-11-15 17:48:45 +01:00
Benjamin Otte
2cd9e5170e widget: Add more sophisticated detection of rendering method
We now look at which of get_render_mode, draw or snapshot vfuncs is the
latest to have been overwritten in the class tree and then use that one.

This allows GtkContainerClass and GtkBinClass to override all of them
for without screwing things up.
2016-11-15 17:48:45 +01:00
Benjamin Otte
79d2d0e40d snapshot: Add gtk_snapshot_render_background()
and gtk_snapshot_render_frame() to be direct replacements for the
old gtk_render_*() functions.

Use them to replace Cairo usage completely in gtk_window_snapshot().
2016-11-15 17:48:45 +01:00
Benjamin Otte
9006e697fb flowbox: children per line may not be 0 2016-11-15 17:48:45 +01:00
Benjamin Otte
d1fec79c00 snapshot: Completely reengineer API
We now try to emulate cairo_t:

We keep a stack of nodes via push/pop and a transform matrix.

So whenever a new node is added to the snapshot, we transform it
by the current transform matrix and append it to the current node.
2016-11-15 17:48:45 +01:00
Benjamin Otte
bb9626dc29 window: Implement snapshot() 2016-11-15 17:48:45 +01:00
Benjamin Otte
b1154be1c4 widget: Add GtkWidgetClass.snapshot() vfunc
Does the same thing as the render vfunc, only that it uses a different
prototype.
2016-11-15 17:48:45 +01:00
Benjamin Otte
93cbba6c3e gtk: Add gtk_widget_snapshot()
It's functionally equivalent to gtk_widget_get_render_node() but uses a
GtkSnapshot argument to carry the state.
2016-11-15 17:48:45 +01:00
Matthias Clasen
d462c31233 entry: Avoid recursion in gtk_entry_ensure_layout
This was unintentional, and lead to a memory leak.
2016-11-14 15:17:41 -05:00
Lauri Kasanen
8b75268d1c recent-manager: Fix a memory leak caused by "recent-manager: Add a limit to the list's size"
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-14 14:26:34 -05:00
Matthias Clasen
34e26017e3 appchooser: Plug a memory leak
We were not dropping the reference that the model gives us.

https://bugzilla.gnome.org/show_bug.cgi?id=774352
2016-11-14 14:19:58 -05:00
Olivier Fourdan
03b8a8a880 gtkstack: reorder size_allocate and move_window
Unlike other container widgets, GtkStack would allocate its children
prior to moving its windows, which might prevent further valid size
allocation signals to be emitted.

Re-order the size allocation of child widgets to be performed after
moving the GtkStack windows.

Thanks to Owen for spotting the real issue here.

https://bugzilla.gnome.org/show_bug.cgi?id=767713
2016-11-14 12:24:18 +01:00
Matthias Clasen
2520662d13 Allow replacing input file in gtk-builder-tool simplify 2016-11-12 22:33:01 -05:00
Timm Bäder
c944bf7330 Call gtk_widget_set_has_window for missing windowed widgets 2016-11-12 21:48:23 +01:00
Timm Bäder
4e445e8e53 window: Properly propagate for_size=-1 2016-11-12 20:37:30 +01:00
Timm Bäder
0d88fe65ba stack: Use gtk_widget_measure 2016-11-12 20:37:22 +01:00
Timm Bäder
95eed97586 listbox: Use gtk_widget_measure 2016-11-12 20:37:18 +01:00
Timm Bäder
9a0513d911 window: Use gtk_widget_measure 2016-11-12 20:37:14 +01:00
Timm Bäder
997fd3c81e grid: Use gtk_wiget_measure 2016-11-12 20:37:10 +01:00
Timm Bäder
26746c8369 toolitemgroup: Remove style properties
Replace them with their default values
2016-11-12 08:10:02 +01:00
Timm Bäder
fdc0c6426b combobox: Remove appears-as-list style property
Remove all the code handling the appears-as-list=TRUE case.
2016-11-12 08:10:02 +01:00
Timm Bäder
5e06701f53 treeview: Remove style properties
Replace them with the Adwaita default values
2016-11-12 08:09:58 +01:00
Lauri Kasanen
0d364173f6 recent-manager: Add a limit to the list's size
This fixes a DOS where any app can cause all running gtk apps
to use arbitrary amounts of memory.

Originally reported against mate-panel, where running a big slideshow
in eye-of-mate caused increasing RAM usage in mate-panel.

v2: Hardcode the value
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-10 17:09:45 -05:00
Matthias Clasen
3c27774a5d places sidebar: Don't leak a reference
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185
2016-11-10 15:16:05 -05:00
Matthias Clasen
5e19e06dcc Fix a copy-paste error
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185#c3
2016-11-10 15:07:08 -05:00
Matthias Clasen
547970b0bc headerbar: Don't leak widgets
We were not properly freeing separators that we end up
not using.

https://bugzilla.gnome.org/show_bug.cgi?id=774066
2016-11-10 15:03:35 -05:00