Commit Graph

816 Commits

Author SHA1 Message Date
Matthias Clasen
2681f7c7af textview: Refine touch popup
The touch popup was meant to have linked buttons.
2019-04-17 23:40:32 +00:00
Benjamin Otte
0791924bf7 Convert fallthrough comments to G_GNUC_FALLTHROUGH
This way it's very obvious that fallthrough is indeed what we want.

Also bump the glib requirement to 2.59 which introduced
G_GNUC_FALLTHROUGH.
2019-04-15 14:40:25 +02:00
Matthias Clasen
c2c4133eb0 Fix up the border/background-color removal
I overlooked one level of indirection here. Oops.
2019-03-31 20:43:19 -04:00
Matthias Clasen
6f5675ef3c Stop using deprecated style context api
Use the non-deprecated one it wraps, instead.
Yes, this is cheating...
2019-03-31 15:35:20 -04:00
Benjamin Otte
d10a73f509 textview: Paint border windows in the right spot
Fixes textview-border-windows reftest
2019-03-29 09:56:52 +01:00
Benjamin Otte
70100d888a textview: Use new snapshot transforms 2019-02-21 19:47:28 +01:00
Benjamin Otte
e522641920 textview: Use gtk_widget_set_overflow() 2019-02-08 18:26:42 +01:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Matthias Clasen
99c5a3d72c gtk: Stop using deprecated pango api 2019-02-04 18:28:31 -05:00
Timm Bäder
55faaf1aa1 Merge branch 'jjardon/no_G_TYPE_INSTANCE_GET_PRIVATE' into 'master'
Stop using G_TYPE_INSTANCE_GET_PRIVATE completely

See merge request GNOME/gtk!402
2018-11-15 09:59:01 +00:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Javier Jardón
c37c86a9bf gtk/gtktextview.c: Remove unused GTK_TEXT_VIEW_GET_PRIVATE() macro 2018-11-06 13:45:58 +00:00
Benjamin Otte
cbb1e74bb5 textview: Only create cairo context in gtktextdisplay.c
Everything else is done using GtkSnapshot now, including renaming the
draw_layer vfunc to snapshot_layer.
2018-07-14 05:27:54 +02:00
Benjamin Otte
88af7b44aa textview: Use snapshot on the sidebars 2018-07-13 14:56:04 +02:00
Matthias Clasen
b94c3166bf dnd: Rename gtk_drag_begin_with_coordinates
Now that the coordiate-less variant is gone,
rename this back to the shorter gtk_drag_begin.
2018-07-12 13:02:42 +02:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Benjamin Otte
9a91d3739d widget: Remove time argument from drag_data_get() vfunc 2018-06-18 23:49:53 +02:00
Benjamin Otte
b00609c21c dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
6d7cb2b781 dnd: Make drag-data-received use a GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10 widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
5b0a6a52c1 dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Matthias Clasen
287c900bdb Remove key-press-event from more docs
This signal will be going away, so stop mentioning it so much.
2018-05-19 23:36:01 -04:00
Matthias Clasen
71718b9cd1 textview: Don't scroll for pastes in another view
GtkTextView scrolls to the insertion point when the text
buffer signals a paste is done. This is wrong when there
are multiple views on the same buffer, and the paste
happened in another view.

To fix this, flip the handling of the scroll_after_paste
boolean to only be TRUE if we know that we want to scroll.
2018-05-14 13:03:34 +01:00
Mohammed Sadiq
3c7ea78d68 textview: Always show select-all button in touch popup
"Select all" action is possible regardless of the text selection state
or if the text is editable or not.
2018-05-11 16:09:57 +05:30
Mohammed Sadiq
b73857faa9 textview: Reset bubble source id once run
The bubble_timeout_id was reset only on some special case.
And so warnings were shown when the source is being tried
to be removed with the already removed id.

Fix this by unconditionally resetting the id on start of the function.
2018-05-11 16:09:50 +05:30
Mohammed Sadiq
8e0cc8169e textview: Simplify creating bubble action buttons
Buttons can be created simply with gtk_button_new_from_icon_name().
2018-05-11 16:09:44 +05:30
Matthias Clasen
1dcb76bc26 Merge branch 'wip/carlosg/controller' into 'master'
carlosg/controller

See merge request GNOME/gtk!131
2018-05-01 12:35:53 +00:00
Benjamin Otte
5166767e8b Merge branch '169-gtktextview-accesses-already-disposed-object' into 'master'
Resolve "GtkTextView accesses already disposed object"

Closes #169

See merge request GNOME/gtk!109
2018-04-30 11:56:36 +00:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4f3058f195 eventcontrollermotion: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
1e6eb1f8b9 draggesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Timm Bäder
1a24a360bd textview: Remove handling_key_event flag
It's not used anymore.
2018-04-21 15:45:47 +02:00
Marek Kasik
0abf8efd2f TextView: Don't access already disposed text mark
Instead of asking of TextMark for its buffer,
let's reference also the buffer in the SelectionData.

Closes #169
2018-04-17 16:01:54 +02:00
Benjamin Otte
0afdd84a2a css: Clipping changes don't need a queue_allocate() anymore
Now that queue_draw() isn't restricted to clip anymore, we don't need to
care about clip in the CSS engine either.

We do keep GTK_CSS_AFFECTS_CLIP around though because GtkWindow does
care for the window's size.
2018-04-09 20:20:55 +02:00
Carlos Garnacho
b0cd5cd7c8 gtktextview: Use key controller for focus changes 2018-04-05 19:26:55 +02:00
Carlos Garnacho
87b4dc4c67 gtktextview: Stop using ::key-press-event
Use GtkEventControllerKey for the task
2018-04-05 19:26:54 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of 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
7e078cd940 gtk: Remove debug updates
With the soon-to-arrive automatic updates (aka computing invalid region
from render nodes), this will no longer be necessary.
2018-04-05 14:56:38 +02:00
Benjamin Otte
9afbf02bc2 textview: Port dnd icon to be a GdkPaintable 2018-03-26 18:16:37 +02: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
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
fef4f0704a textview: Use content size when validating contents 2018-02-25 16:47:20 +01:00
Peter Bloomfield
1828c6b1cd text-view: make measure() use the layout height
GtkTextView::measure should include the height of the text-layout in its
minimum and natural heights. This fixes scrolling when a text-view has a
scrolled-window ancestor that is not its immediate parent.
2018-02-21 08:22:42 -05:00
Timm Bäder
78c6f713dd textview: Implement measure()
Don't use the current layout size as minimum size anymore, that doesn't
make sense. Also move the code from size_request() from gtk2 into the
now current measure() function.
2018-02-16 17:41:41 +01: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
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