Commit Graph

1285 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
89ee42db54 dnd: Make dnd icon API take a paintable
... instead of a texture.
2018-03-16 06:04:44 +01:00
Benjamin Otte
a891a3ae26 demos: Unbreak icon for fishbowl demo
351559fcfa was to eager in simplifying
things.
2018-03-16 06:04:43 +01:00
Timm Bäder
614c3e6721 demo: Remove an expose_event mention 2018-02-06 09:19:40 +01:00
Timm Bäder
f52100c46e iconbrowser: setup image dnd for image6
Otherwise the we fail to set the drag source icon name later on.
2018-02-03 12:22:46 +01:00
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Benjamin Otte
dfc131c7ec toolpalette: Remove
The widget was basically unmaintained since GTK 3.0 and the only known
user was Glade.
2018-02-03 11:52:37 +01:00
Timm Bäder
e8986d18c2 icon browser: Remove usage of stock-size property
Does not exist anymore.
2018-01-30 21:51:59 +01:00
Emmanuele Bassi
f83b3c8af2 Enforce UTF-8 encoding when opening C files
We have a couple of Python 3.x scripts that parse C files, and since C
does not have any encoding, we need to force one ourselves, to avoid the
case when we're running the build in a non-UTF-8 locale.

https://bugzilla.gnome.org/show_bug.cgi?id=792497
2018-01-23 14:04:49 +01:00
Timm Bäder
f595c0dc1b widget-factory: Fix some layout issues
We have to explicitly set some of these to their default values so
expand-set is TRUE and the boxes stop propagating their expansion state
up the hierarchy.
2018-01-19 09:53:39 +01:00
Matthias Clasen
351559fcfa Simplify all ui files again
Now even simpler!
2018-01-18 17:53:44 -05:00
Matthias Clasen
b6d85b9e31 gtk-demo: Add gears to the bowl
Just for fun.
2018-01-17 14:39:46 -05:00
Matthias Clasen
10ac015ac6 gtk-demo: Stop using ::button-release-event 2018-01-16 14:14:10 -05:00
Matthias Clasen
4d31a89ec0 gtk-demo: Stop using ::motion-notify-event in the hypertext demo
We already have a generic ::event handler, just use it for this.
2018-01-16 14:14:10 -05:00
Matthias Clasen
75c92ba867 gtk-demo: Stop using ::button-press-event
Use gestures instead.
2018-01-16 14:14:10 -05:00
Matthias Clasen
d810ff8445 Remove a leftover icon-size property
This made the 'style classes' demo crash.
2018-01-16 14:14:10 -05:00
Matthias Clasen
1e8a336993 gtk-demo: Drop a use of ::event-after
It works just fine with ::event as well.
2018-01-16 14:14:09 -05:00
Matthias Clasen
ff8ba1149d icon-browser: Stop connecting to ::delete-event
We can just use GtkWindow::hide-on-delete
2018-01-16 14:14:09 -05:00
Matthias Clasen
ca227af4ff widget-factory: Stop connecting to ::delete-event
We can use GtkWindow::hide-on-close instead
2018-01-16 14:14:09 -05:00
Matthias Clasen
eda3b43553 gtk-demo: Stop using ::delete-event 2018-01-16 14:14:09 -05:00
Ting-Wei Lan
14b181ebd4 build: Use pkg-config to find iso-codes
Instead of hard-coding the path of iso-codes, we can get the prefix with
pkg-config. We still fallback to /usr when it is not available.

https://bugzilla.gnome.org/show_bug.cgi?id=792282
2018-01-07 14:53:41 +08:00
Matthias Clasen
ebeca18635 gtk-demo: Update font explorer example
Revise the UI (no more double checkboxes), add font variations,
update font features from the dialog, allow tweaking ranges.
2018-01-03 14:56:36 -05:00
Krzesimir Nowak
7f300c9da7 examples, gtk-demo: Fix copy-pasta in signal name 2018-01-03 09:59:19 +01:00
Matthias Clasen
473bbeb475 gtk-demo: Port the drawingarea demo to a gesture
Use a drag gesture here, just like in the drawing example.
2018-01-02 18:14:13 -05:00
Timm Bäder
862fd6f4e8 widgetbowl: Add blurred box shadow demo 2017-12-21 19:12:33 +01:00
Timm Bäder
358c139a43 gl renderer: Rework once more
Last time, I swear.
2017-12-21 19:12:30 +01:00
Timm Bäder
827d04c482 gtk4-demo: Fix font-features UI file 2017-12-19 09:46:27 +01:00
Matthias Clasen
ce251133c0 gtk-demo: Stop using GdkEventWindowState
Use GdkWindow::state instead - the event is going away.
2017-12-14 22:24:06 -05:00
Matthias Clasen
76b93f5598 widget-factory: Avoid a legacy event handler
We can use a gesture instead, here.
2017-12-12 19:46:10 -05:00
Benjamin Otte
7a17865b22 dnd: Remove "delete" argument from gtk_drag_finish()
The argument is ignored by anything but X11.
It's treated like suggested_action == MOVE.

So do that in gtk_drag_finish(), too.
2017-12-10 01:33:38 +01:00
Matthias Clasen
029a84aa74 Fix fallout from the show-close-button rename
I had overlooked ui files. We should really
validate those during build.
2017-12-08 11:29:14 -05:00
Matthias Clasen
fec0dc2b13 Rename GtkHeaderBar::show-close-button
It is about all window buttons, so rename it to ::show-title-buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=779862
2017-12-07 22:37:06 -05:00
Matthias Clasen
62f1695cb3 Move editing to button release
This will free up primary button press for drags.
2017-12-07 21:25:44 -05:00
Matthias Clasen
b6f33919b7 Make sure stopped spinner stay visible
This demo needs stopped spinners to be visible,
so the user can interact with them.
2017-12-06 23:49:48 -05:00