Commit Graph

54316 Commits

Author SHA1 Message Date
Alexander Larsson
9a7e721181 GdkSurface: Rename various functions and variables
This is an automatic rename of various things related
to the window->surface rename.

Public symbols changed by this is:
 GDK_MODE_WINDOW
 gdk_device_get_window_at_position
 gdk_device_get_window_at_position_double
 gdk_device_get_last_event_window
 gdk_display_get_monitor_at_window
 gdk_drag_context_get_source_window
 gdk_drag_context_get_dest_window
 gdk_drag_context_get_drag_window
 gdk_draw_context_get_window
 gdk_drawing_context_get_window
 gdk_gl_context_get_window
 gdk_synthesize_window_state
 gdk_surface_get_window_type
 gdk_x11_display_set_window_scale
 gsk_renderer_new_for_window
 gsk_renderer_get_window
 gtk_text_view_buffer_to_window_coords
 gtk_tree_view_convert_widget_to_bin_window_coords
 gtk_tree_view_convert_tree_to_bin_window_coords

The commands that generated this are:

git sed -f g "GDK window" "GDK surface"
git sed -f g window_impl surface_impl
(cd gdk; git sed -f g impl_window impl_surface)
git sed -f g WINDOW_IMPL SURFACE_IMPL
git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE
git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface
git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface
git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface
git sed -f g gsk_renderer_get_window gsk_renderer_get_surface
git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface

(cd gdk; git sed -f g window_type surface_type)
git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type

git sed -f g window_at_position surface_at_position
git sed -f g event_window event_surface
git sed -f g window_coord surface_coord
git sed -f g window_state surface_state
git sed -f g window_cursor surface_cursor
git sed -f g window_scale surface_scale
git sed -f g window_events surface_events
git sed -f g monitor_at_window monitor_at_surface
git sed -f g window_under_pointer surface_under_pointer
(cd gdk; git sed -f g for_window for_surface)
git sed -f g window_anchor surface_anchor
git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL
git sed -f g native_window native_surface
git sed -f g source_window source_surface
git sed -f g dest_window dest_surface
git sed -f g drag_window drag_surface
git sed -f g input_window input_surface

git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
2018-03-20 12:05:26 +01:00
Alexander Larsson
890080ebf7 GdkWindow -> GdkSurface: File renames
Rename all *window.[ch] source files.

This is an automatic operation, done by the following commands:

for i in $(git ls-files gdk | grep window); do
    git mv $i $(echo $i | sed s/window/surface/);
    git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ;
done

git checkout NEWS* po-properties po
2018-03-20 11:46:11 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Timm Bäder
1d26879fa5 tests: Add testtexture
a test that simply loads a given file as a texture and renders it.
2018-03-20 09:40:10 +01:00
Timm Bäder
0124740fa0 gl renderer: Support large textures
By tiling them.
2018-03-20 09:40:10 +01:00
Timm Bäder
3f367277fe snapshot: Limit cairo nodes to clip region
In certain cases, we might create large cairo nodes, resulting in
surfaces so large, cairo can't handle them. Fix this by limiting the
cairo node to the current clip region.
2018-03-20 09:40:10 +01:00
Timm Bäder
4240119d64 gl renderer: add basic code to support texture tiling 2018-03-20 09:40:10 +01:00
Timm Bäder
a9fec38680 rendernode: Don't use gdk_texture_download_surface
It can't handle the texture sizes we'd like to support
2018-03-20 09:40:10 +01:00
Timm Bäder
22780044ec rendernode: Don't use gdk_texture_download_surface
It can't handle the texture sizes we'd like to support
2018-03-20 09:37:59 +01:00
Timm Bäder
4353ad224f rendernode: Check cairo surface status after creation 2018-03-20 09:37:59 +01:00
Timm Bäder
85eef63b32 inspector: Use the attach widget as menu parent object
Fixes #101
2018-03-20 09:37:59 +01:00
Timm Bäder
9e9db8607b Revert "gl renderer: Limit texture node size to clip"
This reverts commit 0234e8e2c9.

This broke partially clipped-away nodes when they are being transformed,
e.g. by a rotation
2018-03-20 09:37:59 +01:00
Timm Bäder
8ef2b10f70 gldriver: Name driver instances 'self' 2018-03-20 09:37:59 +01:00
Timm Bäder
50ffa86d18 progressbar: Remove priv pointer 2018-03-20 09:37:59 +01:00
Timm Bäder
2210078a64 progressbar: Remove snapshot implementation 2018-03-20 09:37:59 +01:00
Timm Bäder
25ab5b9f0b levelbar: Remove priv pointer 2018-03-20 09:37:59 +01:00
Timm Bäder
f261bf2fc6 switch: Avoid a gtk_widget_get_clip call
Since we get the correct clip anyway from the gtk_widget_size_allocate
call above.
2018-03-20 09:37:59 +01:00
Timm Bäder
922b2cf99a grid: Remove child list
Save the child info using g_object_set_qdata and just use the widget's
built-in child list for everthing else. This is especially simple for
GtkGrid since it has never supported reordering its child widgets.
2018-03-20 09:37:59 +01:00
Timm Bäder
c8b0c55284 paned: Remove priv pointer 2018-03-20 09:37:59 +01:00
Timm Bäder
93aa5ce167 container: Don't use forall() in compute_expand
Use the widget list instead, which saves some code.
2018-03-20 09:37:58 +01:00
Timm Bäder
781400f6d3 container: Don't use forall() in get_request_mode
We can just use the widget child list, which save some code.
2018-03-20 09:37:58 +01:00
Rico Tzschichholz
f7326ff828 texture: Fix documentation block of gdk_texture_download 2018-03-19 20:31:15 +01:00
Samuel Thibault
9561b97dc4 Fix some accessibility issues in demos
Fixes #110
2018-03-19 18:07:25 +01:00
Samuel Thibault
bd986f9534 gtkbuilder: add accessibility role declaration
This allows to override the role declared to the atk stack.  For
instance,

<accessibility>
  <role type="static"/>
</accessibility>

allows to tell the accessibility stack that a label is just a message in
a message box.

Fixes #109
2018-03-19 18:07:06 +01:00
Daniel Boles
a15080c640 gdkrgba: Add a missing apostrophe in a doc comment 2018-03-19 15:14:20 +00:00
Quentin Glidic
f431e28ce3 gtkimcontextsimple.c: Use X11_DATA_PREFIX only on X11
Unlike what commit d01ea18dc3 says, X11 is
not a requirement for Wayland, so a Wayland-only build is possible. We
just use the same logic as other non-X11 platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=784615

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2018-03-19 11:39:47 +01:00
Daniel van Vugt
0ad27cc598 x11/xi2: Report touchpads as TOUCHPAD, not MOUSE
is_touchpad_device() for XI2 was hardcoded to look for libinput only.
Extend it slightly to correctly identify other Xorg touchpad drivers.

https://gitlab.gnome.org/GNOME/gtk/issues/97
2018-03-19 12:08:29 +08:00
Benjamin Otte
1a1373779f mediafile: Improve error message
We are using media plugins these days, so this is not a compile-time
issue.
2018-03-19 00:28:20 +01:00
Benjamin Otte
2aee39d12c video: Add gtk_video_get_file()
That function was missing.
2018-03-19 00:28:20 +01:00
Rico Tzschichholz
158df3c1bb gtk: Fix some g-i annotations warnings 2018-03-18 21:47:10 +01:00
Piotr Drąg
f1e1e9a71e Update POTFILES.in 2018-03-18 21:12:29 +01:00
Benjamin Otte
04a3b8b6df mediastream: Add gtk_media_stream_realize/unrealize()
This allows widget to attach their streams to GdkWindow(s)

The idea is to allow attaching a stream to windowing system(s) so the
stream can make use of its resources, in particular GL contexts.

I am however unsure what to attach to:
- GtkWindow
- GdkWindow
- GtkWidget
- GskRenderer
Each of these provide advantages and disadvantages.

So I'm very much open to better suggestions.
2018-03-18 21:01:23 +01:00
Benjamin Otte
09a21f1cd2 build: Make GStreamer backend the default
Instead of compiling without media backend by default, we now use the
GStreamer backend.

This means that CI now requires gstreamer support.
2018-03-18 21:01:23 +01:00
Benjamin Otte
0f4ab5862a gtk-demo: Add a simple video player example
For now, it's impossible to unfullscreen. Somebody should figure out a
way to do this.
2018-03-18 21:01:23 +01:00
Benjamin Otte
2362e4d41e gtk: Add a GStreamer implementation of GtkMediaFile 2018-03-18 21:01:23 +01:00
Benjamin Otte
182f39aba7 demos: Round up the paintable demos with a media stream 2018-03-18 21:01:23 +01:00
Benjamin Otte
3d9cb477aa demos: Add an animated paintable demo
This builds on the paintable demo.
2018-03-18 21:01:23 +01:00
Benjamin Otte
357175f0b1 gtk-demo: Add paintable demo 2018-03-18 21:01:23 +01:00
Benjamin Otte
b410b48eed demos: Add a video benchmark to widgetbowl demo 2018-03-18 21:01:23 +01:00
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