Commit Graph

3867 Commits

Author SHA1 Message Date
Benjamin Otte
c74854fe49 paintable: Introduce gdk_paintable_new_empty()
Also, use it where appropriate.
2018-04-05 14:56:39 +02:00
Benjamin Otte
fc6de135fe widget: Don't keep track of clip anymore.
It's not used anywhere, so why would we need it?
2018-04-05 14:56:38 +02:00
Benjamin Otte
73650c6da2 gtk: Remove gtk_widget_queue_draw_region()
... and gtk_widget_queue_draw_area().

They don't doi anything anymore.
2018-04-05 14:56:38 +02:00
Benjamin Otte
a468714849 widget: Stop tracking invalidations
Instead of calling gdk_surface_invalidate_region(), just
gdk_surface_queue_expose() and rely on the renderer computing the diff
from the previous rendering.
2018-04-05 14:56:38 +02:00
Benjamin Otte
d0873c7dec gsk: Fold gsk_renderer_begin_draw_frame() into renderer
It doesn't need to be exported anymore.

As a side effect, the inspector no longer has any information about the
render region, so remove the code that was taking care of that.
2018-04-05 14:56:38 +02:00
Benjamin Otte
2d10c2568c gtk: Add GtkWidgetPaintable
A GtkWidgetPaintable is a paintable that observes a given GtkWidget and
renders that widget into a paintable.
2018-04-05 14:56:38 +02:00
Benjamin Otte
5e99646e1c dnd: Remove gtk_drag_set_icon_surface()
All users are gone. Use gtk_drag_set_icon_paintable() instead.
2018-03-26 18:32:38 +02:00
Benjamin Otte
7fdcc58532 snapshot: Add gtk_snapshot_to_paintable()
This is intended for DND icons
2018-03-26 18:16:36 +02:00
Benjamin Otte
9b83116fcb snapshot: Export gtk_snapshot_append_layout()
This is the equivalent snapshot function to pango_cairo_show_layout().

Not to be confused with gtk_snapshot_render_layout(), which is the
equivalent to gtk_render_layout().
2018-03-26 18:16:36 +02:00
Alexander Larsson
39851fbdbf Continue renaming window to surface
This renames a lot of arguments, local variables and functions.
2018-03-21 11:49:14 +01:00
Benjamin Otte
8202f333ea surface: Stop tracking clip region
It's not needed because we're not using it for anything anymore now that
client-side surfaces aren't drawn anymore.
2018-03-21 04:10:07 +01:00
Benjamin Otte
0ce19eed08 gdk: Remove gdk_surface_shape_combine_region()
If you want transparent region, you can just render them transparent.
If you want input shaping, use gdk_surface_input_shape_combine_region().

Also remove gtk_widget_shape_combine_region().
2018-03-21 04:10:07 +01:00
Benjamin Otte
ef693f317c surface: Remove gdk_surface_get_clip_region()
... and gdk_surface_get_visible_region() APIs. They are unused.
2018-03-21 04:10:07 +01:00
Benjamin Otte
7862894f11 surface: Remove gdk_surface_invalidate_maybe_recurse()
This also means we can now get rid of child funcs because they're not
used anymore.
2018-03-21 00:43:28 +01:00
Benjamin Otte
a1898d678b surface: Remove gdk_surface_scroll()
It's yet another fancy way to call gdk_surface_invalidate_region().

Also remove the one testgtk test that was still using it.
2018-03-21 00:43:28 +01:00
Benjamin Otte
d6ba10bacf surface: Remove gdk_surface_move_region()
It's just a cute version of gdk_surface_invalidate_region()
these days and people can call that function instead.
2018-03-21 00:43:28 +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
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
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
Benjamin Otte
b64a403100 selection: Remove surface APIs 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
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
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
536714a147 paintable: Add gdk_paintable_compute_concrete_size()
Do the CSS size computation routine. This will be used elsewhere soon.
2018-03-16 06:04:44 +01:00
Benjamin Otte
d1be2b29cf entry: Make icons a paintable 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
8f43d7e188 gdk: Add GdkPaintable 2018-03-16 06:04:44 +01:00
Benjamin Otte
e5813b3ae7 texture: Export gdk_memory_texture_new() and GdkMemoryFormat
Also add tests for all these newfangled formats.
2018-03-12 17:21:45 +01:00
Matthias Clasen
7c18911c00 GtkSnapshot: Add getters
These getters can be useful when creating new snapshots
in a snapshot() vfunc.
2018-03-11 00:31:44 -05:00
Matthias Clasen
890cd45ce4 Document new snapshot api 2018-03-11 00:31:44 -05:00
Timm Bäder
4dfe4a6476 expander: Remove label-fill property
It's just setting some internal boolean and nothing else. It's like this
in gtk3 as well so it can't be too important either.
2018-03-07 20:17:39 +01:00
Benjamin Otte
db6fed1496 overlay: Add GtkOverlay::measure child property
It determines whether a child is included in the overlay's size
measurement.

The first user is (gonna be) GtkVideo.
2018-03-07 16:17:15 +01:00
Benjamin Otte
88de098711 entry: Remove cursor adjustment APIs 2018-03-02 02:00:25 +01:00
Matthias Clasen
ef556689f8 Update docs for changed options 2018-02-24 21:34:40 -05:00
Matthias Clasen
ca794f909a Update docs for immodules 2018-02-24 21:34:40 -05:00
Matthias Clasen
5b4082ac87 Remove gtkmodules.h
We don't use these definitions anymore.

Also clean up the docs wrt to modules.
2018-02-18 09:41:29 -05:00
Matthias Clasen
656f67eeb7 Merge branch 'wip/issue-21' into 'master'
Mention gtk_button_set_image() and friends in the migration docs

Closes #21

See merge request GNOME/gtk!6
2018-02-15 03:06:28 +00:00
Carlos Garnacho
3b568fbe77 gdk/wayland: Add GdkDisplay call to query available globals
The internal known_globals hashtable is used to carry accounting for
interfaces that depend on others (as ordering is not guaranteed), extend
its usage so it also keeps track of unimplemented interfaces (here at
least).

The API call will then use this to allow querying the globals offered by
the compositor, it will be useful to determine whether we can use
text-input protocols or should fallback to other IMs.
2018-02-13 15:47:57 +01:00
Emmanuele Bassi
7ee69fc7b2 Mention gtk_button_set_image() and friends in the migration docs
The image-related API for GtkButton has been dropped, but still needs
to be mentioned in the migration guide.

Closes: #21
2018-02-13 12:57:18 +00:00
Emmanuele Bassi
5c3c95a96c docs: Mention G_ENABLE_DIAGNOSTIC in the porting notes
Since part of our type system is resolved at run time, we need to use
run time facilities to get diagnostic messages, like deprecation
warnings for properties and signals.

We should mention the G_ENABLE_DIAGNOSTIC environment variable in the
migration guide, to let developers know how to catch deprecations and
changes while porting their code.
2018-02-09 19:38:17 +00:00
Matthias Clasen
601c5fd734 Drop event filters from the docs
No longer public API.
2018-02-07 15:13:31 -05:00
Matthias Clasen
0fe3fafac1 gdk: Drop gdk_x11_window_set_frame_extents
This function is unused and has been deprecated
for a long time.
2018-02-06 01:16:32 -05:00
Matthias Clasen
d400c50ca3 fix the docs build
The GtkPlacesSidebar does not exist anymore in public API.
2018-02-06 01:16:32 -05:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00