Commit Graph

54426 Commits

Author SHA1 Message Date
Christoph Reiter
feb7bf2fbe gitlab-ci: enable gtk+:gdk tests
xvfb doesn't like C.utf8 and returns XLocaleNotSupported.

While (afaik) C.utf8 and C.UTF.8 should be the same thing, and the former
is returned by locale -a on Fedora, switch to C.UTF-8 to make xvfb happy.

This makes gtk+:gdk tests pass.
2018-03-20 17:31:38 +01:00
Alexander Larsson
695d141f32 Merge branch 'rename-window-to-surface' into 'master'
Rename window to surface

See merge request GNOME/gtk!72
2018-03-20 16:16:57 +00:00
Matthias Clasen
b83ba41f2d Merge branch 'accessible-role' into 'master'
gtkbuilder: add accessibility role declaration

Closes #109

See merge request GNOME/gtk!69
2018-03-20 15:46:20 +00:00
Benjamin Otte
e798eedfb6 Merge branch 'style-context-null-widget-guard-master' into 'master'
gtkstylecontext: guard against gtk_css_widget_node_get_widget() returning NULL in more places

See merge request GNOME/gtk!71
2018-03-20 15:36:19 +00:00
Matthias Clasen
e6cd6f8db6 Merge branch 'a11y-fixes' into 'master'
Fix some accessibility issues in demos

Closes #110

See merge request GNOME/gtk!68
2018-03-20 15:33:35 +00:00
Alexander Larsson
4ac450b324 Convert all references to GdkEvent->surface 2018-03-20 16:25:50 +01: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
Alexander Larsson
19ca2789c0 GtkWidget: Continuer rename of widget->surface
This completes the rename manually.
2018-03-20 15:40:31 +01:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Alexander Larsson
3dce0dcca7 GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is
that event.window is now event.surface.
2018-03-20 15:14:10 +01:00
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