Commit Graph

54226 Commits

Author SHA1 Message Date
Benjamin Otte
5bd85058d9 gtk-demo: Add a video example (with controls) to the images demo 2018-03-18 21:01:23 +01:00
Benjamin Otte
7cf6da60da gtk: Add GtkVideo
GtkVideo is a simple video player widget. It probably needs some more
configurability, but it does its job.
2018-03-18 21:01:23 +01:00
Benjamin Otte
9700a98f48 gtk: Add GtkMediaControls
This is a basic first implementation of controls for a GtkMediaStream,
modeled after Totem's UI.
2018-03-18 21:01:23 +01:00
Benjamin Otte
800bcb5cb4 gtk: Add ffmpeg implementation of GtkMediaFile
This adds a module using ffmpeg to implement the GtkMediaFile interface.
2018-03-18 21:01:23 +01:00
Matthias Clasen
e4338c4d42 mediafile: Turn into an extension point
This way, we can support external libraries providing implementations of
GtkMediaFile.

We also add a media backend called 'nomedia' that can be enabled to not
compile any support for GtkMediaFile. This is useful when people want to
statically compile GTK into an application that does not use media.
For now, this option is the default.

We also support a new environment variable GTK_MEDIA that allows
selecting the implementation to use.
GTK_MEDIA=help can be used to get info about the available
implementations.
2018-03-18 21:01:23 +01:00
Benjamin Otte
29cccf5e84 gtk: Add GtkMediaFile
GtkMediaFile is an implementation of GtkMediaStream to play back files.

Except it isn't an implementation yet, but only an interface.
2018-03-18 21:01:23 +01:00
Benjamin Otte
4db1a5f5c4 gtk: Add GtkMediaStream
GtkMediaStream is the new base class for playback of audio and video
streams.

It implements GdkPaintable for rendering.
2018-03-18 21:01:23 +01:00
Rico Tzschichholz
4642e86284 texture: Fix compilation by avoiding to include not-yet available headers 2018-03-18 20:52:46 +01:00
Benjamin Otte
ea84e974e6 snapshot: Turn into GObject
This makes GdkSnapshot the base class for GtkSnapshot and hopefully
stops confusing bindings.

C code should see no difference to before.
2018-03-18 19:21:33 +01:00
Benjamin Otte
abc9b944f9 testsuite: Update C++ keywords test to GTK 3.0.0 2018-03-18 19:20:46 +01:00
Benjamin Otte
87fa7ff314 build: Fix printbackends
There's no "auto" option anymore, so remove checks for that option.
2018-03-18 19:08:28 +01:00
Benjamin Otte
6dc29f2852 gltexture: Rename variable
Makes docs build happy.
2018-03-18 18:42:20 +01:00
Benjamin Otte
82a99a3643 texture: Expose subclasses as subclasses
This is necessary so that bidnings work properly and don't make
gdk_gl_texture_release() a function on GdkTexture.
It also allows code to identify what type of texture they are dealing
with.

Finally, we can now decide to add getters later without screwing
anything up, if we want to allow people to access GL textures directly.
2018-03-18 05:57:07 +01:00
Benjamin Otte
d54ca3c74f gdk: Add GDK_MEMORY_DEFAULT
This is the default memory format.

I added it because it is way better than including a private header and
using GDK_MEMORY_CAIRO_FORMAT_ARGB32.
2018-03-18 05:57:07 +01:00
Benjamin Otte
ee8e42f19b gdk: Remove gdk_texture_new_from_data()
Use gdk_memory_texture_new() instead.
2018-03-18 05:57:07 +01:00
Daniel Boles
41a5e744d8 SpinButton: Desensitise +/- buttons as appropriate
The logic for this in 3 got lost in the move from gadgets to widgets. We
must update the sensitivities when :wrap, :value, or the bounds change.

Close: https://gitlab.gnome.org/GNOME/gtk/issues/88
2018-03-17 15:53:50 +00:00
Timm Bäder
a25dcd0f74 snapshot: Fix some indentation 2018-03-17 14:13:42 +01:00
Timm Bäder
7351848c75 container: Fix scroll adjustment coordinates 2018-03-17 14:05:55 +01:00
Timm Bäder
bb04808eea testgtk: Remove alpha widgets demo
This used to test that "windowed widgets" and "non-windowed widgets"
handle alpha correctly, but none of the mentioned widgets are windowed
at all anymore. For the rest, this is more easily and dynamically
testable by simply using the inspector.
2018-03-17 14:05:40 +01:00
Timm Bäder
004d0f2fc1 testgtk: GtkSpinButton is not a GtkEntry anymore 2018-03-17 12:09:30 +01:00
Timm Bäder
fb763cd4ca layout: Fix scrolling
We accidentally dropped the code that takes the adjustments into account
at some point.
2018-03-17 12:09:30 +01:00
Timm Bäder
a5e20c5ffc layout: remove map implementation
gtk_widget_real_map already maps all the child widgets.
2018-03-17 12:09:30 +01:00
Timm Bäder
3ca298ec94 container: Remove focus widget sorting code
The more general version of this code lives in gtkwidgetfocus.s now.
2018-03-17 12:09:30 +01:00
Timm Bäder
ad85a75c2e window: Use widget facilities to sort focus menubars 2018-03-17 12:09:30 +01:00
Timm Bäder
1a8e7d97ae menubar: Use GtkWidget focusing facilities 2018-03-17 12:09:30 +01:00
Timm Bäder
1eb22e7927 radibutton: Use focusing facilities from GtkWidget
Instead of the ones from GtkContainer which will hopefully soon go away.
2018-03-17 12:09:30 +01:00
Timm Bäder
fd28bddde1 container: Only do custom focus management if a focus chain is set
Otherwise, the process should be the same one we use in GtkWidget.
2018-03-17 12:09:30 +01:00
Timm Bäder
ca4f08136a container: Rename parent_class to gtk_container_parent_class
To match the name we have everywhere else.
2018-03-17 12:09:30 +01:00
Timm Bäder
16689a1e81 widget: Fix a few typos in cursor documentation 2018-03-17 12:09:30 +01:00
Timm Bäder
24e708a770 popover: Remove an unneeded local variable 2018-03-17 12:09:30 +01:00
Timm Bäder
64e128629f magnifier: Clip child node to magnifier size
It's still broken in several other ways, but now one less.
2018-03-17 12:09:30 +01:00
Timm Bäder
6cfb720ab7 Fix a few get_allocated_width/height usages 2018-03-17 12:09:30 +01:00
Timm Bäder
3e6fea0550 widgetbowl: Add a proper description
Instead of the copy/pasted one from the fishbowl demo.
2018-03-17 12:09:30 +01:00
Daniel Boles
146082d464 Notebook: Don’t show raw underline/markup in popup
If @menu_label == NULL, we create a default page->menu_label. This took
@tab_label.get_label() and passed that to page->menu_label.set_text().
This is wrong because we set the plain text of the menu_label from the
rich text of @tab_label. So, if @tab_label used mnemonics or markup, our
menu_label got the raw underline or markup tags shown in it as raw text.

As we call set_text() on the menu Label, the fix is to be symmetric: use
@tab_label’s get_text() as source, as that strips underlines and markup.

It’s not worth making the default Label ‘inherit’ :use-underline/markup;
that’s a slippery slope, and users wanting such things can just create a
fully fledged GtkLabel to pass as @menu_label to suppress the default.

https://bugzilla.gnome.org/show_bug.cgi?id=705509
2018-03-16 22:34:05 +00:00
Benjamin Otte
b64a403100 selection: Remove surface APIs 2018-03-16 06:04:45 +01:00
Benjamin Otte
12409ee075 cellrendererpixbuf: Store the texture in the iconhelper paintable
That's kinda weird but allows us to delete the texture case from
GtkIconHelper and GTK_IMAGE_TEXTURE from the GtkImageType enum.

And it doesn't cause any other problems because the cell renderer
can't deal with paintables - otherwise it would mirror GtkImage and have
a "paintable" property instead.
2018-03-16 06:04:45 +01:00
Benjamin Otte
cbe40f5f46 image: Remove gtk_image_set_texture()
gtk_image_get_paintable() is a perfect replacement, so use that one.
2018-03-16 06:04:45 +01:00
Benjamin Otte
2935ef8128 image: Add gtk_image_set_can_shrink()
Images with that value set will request a 0x0 minimum size and scale
down their contents.
2018-03-16 06:04:45 +01:00
Benjamin Otte
c6541853ab image: Add gtk_image_set_keep_aspect_ratio()
If set, the image will draw its contents while keeping their aspect
ratio. That means empty areas show up on the top/bottom or left/right.

Also move the special-case snapshotting code for icons to
GtkIconHelper. That's where it belongs.
2018-03-16 06:04:45 +01:00
Benjamin Otte
0a08c03885 iconhelper: Implement GdkPaintable
This only implements the vfuncs, but does not actually emit signals
yet.

It's also not useed for anything other than snapshot() so far, this
will come in later commits.
2018-03-16 06:04:45 +01:00
Benjamin Otte
af18796312 icontheme: Remove surface support
It's not used anymore.
2018-03-16 06:04:45 +01:00
Benjamin Otte
9e54c22c49 image: Don't handle surfaces anymore
Lots of special cases that are no longer needed because no code uses
surfaces.

Also remove the GdkCellRendererPixbuf:surface property.
2018-03-16 06:04:45 +01:00
Benjamin Otte
01f996447e tests: Port from surface to texture 2018-03-16 06:04:45 +01:00
Benjamin Otte
a8608618a9 dragsource: Replace gtk_drag_source_set_icon_surface()
... with gtk_drag_source_set_icon_paintable().
2018-03-16 06:04:45 +01:00
Benjamin Otte
1f4839d4c8 inspector: Use Textures for images in the property view 2018-03-16 06:04:44 +01:00
Benjamin Otte
3c7ee010f5 cellrendererpixbuf: Put pixbufs into textures
... instead of going via surfaces.

A side effect is that the pixbuf property is no longer readable because
we have no good way to get the pixbuf back out of the texture, but I
don't think this matters a lot.

If people want to read the pixbuf property, we need to add some code to
make that work.
2018-03-16 06:04:44 +01:00
Benjamin Otte
7844320f10 image: Load resources and files into textures
Instead of loading them into surfaces (which we want to get rid of), we
load into textures.
In fact, we introduce a new paintable subclass called a GtkScaler that
takes care of tracking scaling.

This also ideally gets rid of an extra conversion once renderers learn
to render textures directly.
2018-03-16 06:04:44 +01:00
Benjamin Otte
c9557c207f iconhelper: Handle texture scale again
We will need that in the next commits.
2018-03-16 06:04:44 +01:00
Benjamin Otte
2016f56176 iconhelper: Turn into a GObject 2018-03-16 06:04:44 +01:00
Benjamin Otte
3427639b08 iconhelper: Rework to allow resizing of paintables
GtkImage will now allow paintables to be rendered to the full image and
the image will be sized according to CSS rules for image sizing.
2018-03-16 06:04:44 +01:00