Commit Graph

2939 Commits

Author SHA1 Message Date
Matthias Clasen
6d1dbec9dd tests: Stop using ::focus-in/out-event
The has-focus property works just as well here.
2018-01-16 14:14:10 -05:00
Matthias Clasen
cf9074a2e9 Add x/y to GtkEventControllerMotion::enter
We have this information available in enter events,
and having it in the controller signal as well makes
porting easier.

Update existing users.
2018-01-16 14:14:10 -05:00
Matthias Clasen
8338b0f0cc testgtk: Stop using ::configure-event 2018-01-16 14:14:10 -05:00
Matthias Clasen
cbf1ff98f7 tests: Stop using ::configure-event
The generic ::event will do.
2018-01-16 14:14:10 -05:00
Matthias Clasen
41e4c93443 Replace all remaining uses of delete-event 2018-01-16 14:14:09 -05:00
Matthias Clasen
1c3f8ba252 testoverlay: Use an event controller
We can stop using ::enter-notify-event here, and use
our new motion event controller instead.
2018-01-16 14:14:09 -05:00
Matthias Clasen
96b2b1b2f3 testgtk: Redo the event watcher case
Make this watch for emissions of ::event, since we
want to get rid of individual signals first.
2018-01-16 14:14:09 -05:00
Matthias Clasen
6ac33215a5 testgtk: Use an event controller for 'testing scrolling'
The current code was not working with smooth scroll events,
for starters.
2018-01-16 14:14:09 -05:00
Matthias Clasen
97f805b888 testinput: Drop some no-op signal handlers
These were not doing anything.
2018-01-16 14:14:09 -05:00
Matthias Clasen
3cb93a479a tests: Avoid a use of ::map-event
We can use the ::map signal here instead.
2018-01-16 14:14:09 -05:00
Matthias Clasen
67649763b6 tests: Stop using the delete-event signal
We can use ::destroy in most cases.
2018-01-16 14:14:09 -05:00
Timm Bäder
04ade9483b testheightforwidth: Remove "vertical labels" test
This was testing lables with the angle property set, which doesn't exist
anymore.
2018-01-10 08:46:22 +01:00
Arnaud Bonatti
295726560e Add test for GtkActionable GtkListBoxRow.
https://bugzilla.gnome.org/show_bug.cgi?id=741633
2018-01-02 17:56:10 -08:00
Matthias Clasen
48bfc9badf testinput: Make this work again
This test was not updated to using a draw func instead
of the ::draw signal yet. At the same time, make it use
::size-allocate instead of ::configure-event.
2018-01-02 18:14:13 -05:00
Matthias Clasen
e522ff0532 testgtk: Fix the test scrolling test
We need to expand here, otherwise things look wrong.
2018-01-02 18:14:13 -05:00
Matthias Clasen
d3014c23b9 testgtk: Fix the scrolledwindow test
We need to expand here, otherwise things look wrong.
2018-01-02 18:14:13 -05:00
Matthias Clasen
4d6fbdd19e Remove testthreads
As far as I can tell, this has not been in the Makefiles
since 2001...
2018-01-02 18:14:13 -05:00
Matthias Clasen
2c2288206e Drop an unintentional use of ::destroy-event
Clearly, ::destroy was meant here.
2018-01-02 18:14:13 -05:00
Matthias Clasen
c0cd46355d Drop a no-longer-working test
Embedding toplevels does not work anymore.
2018-01-02 18:14:13 -05:00
Matthias Clasen
7d659b21e6 Drop deprecated text view layers
These have been marked as deprecated, so lets drop them.
2017-12-29 13:13:36 -05:00
Timm Bäder
c4d5225aac testoutsetshadowdrawing: Add more samples 2017-12-28 16:48:35 +01:00
Timm Bäder
9675b8a310 showrendernode: Add some advanced options
1) Add a --compare cmd line switch that lets people compare the normal
     render path and the render_texture path.
  2) Add a -o cmd line switch that lets people render the given .node
     file to a texture and save that texture to the given png file name.
2017-12-28 16:48:35 +01:00
Timm Bäder
3158b481b7 testoutsetshadowdrawing: Add adwaita CSD window test case 2017-12-28 16:48:35 +01:00
Timm Bäder
006f2e32cf testheaderbar: Fix custom CSS 2017-12-28 16:48:35 +01:00
Timm Bäder
8b880de4a2 tests: Add outset shadow drawing test 2017-12-21 19:12:33 +01:00
Timm Bäder
5eb4f65c32 showrendernode: Show at least the root node bounds 2017-12-21 19:12:32 +01:00
Timm Bäder
ac6b7b24f9 tests: Add border drawing test 2017-12-21 19:12:32 +01:00
Timm Bäder
7a739e80ef showrendernode: Resize window to a reasonable size instead 2017-12-21 19:12:30 +01:00
Timm Bäder
851a5d48c3 add tests/showrendernode
A .node file viewer.
2017-12-21 18:25:52 +01:00
Matthias Clasen
9620e1e97f tests: Stop using gtk_font_button_get_font_name
It is going away.
2017-12-21 11:10:13 -05:00
Matthias Clasen
2c267a3cf1 testgtk: Stop using GdkEventWindowState
Use GdkWindow::state instead - the event is going away.
2017-12-14 22:24:06 -05:00
Matthias Clasen
54a6273191 Drop gdk_atom_intern
Atoms are just interned strings now, so we can just
use g_intern_string.
2017-12-13 23:39:03 -05:00
Benjamin Otte
a4b42f0b73 gdk: Remove selection defines
And with it, remove the selections section from the docs.

So selections are gone for good now.
2017-12-14 03:05:34 +01:00
Carlos Garnacho
f79ac6d30b gdk: Remove gdk_window_[gs]et_event_compression()
Motion compression is now the unmodifiable default, callers may
call gdk_event_get_motion_history() to check the uncoalesced
motion history.
2017-12-14 01:05:48 +01:00
Benjamin Otte
54f9aef0d4 gdk: Remove gdk_selection_convert()
It's not used anymore.
2017-12-14 00:44:26 +01:00
Benjamin Otte
53081bd1d8 tests: Remove testselection
With selections goig away, this test is not very useful anymore.
2017-12-13 19:40:24 +01:00
Benjamin Otte
b66052f3ce gdk: Remove gdk_selection_add_targets()
It's not needed anymore, now that we can look at the content provider's
formats.

Alose remove all the API in GTK that was used to set it.
2017-12-13 19:27:51 +01:00
Matthias Clasen
d871fd12cc Try to make a composite entry
This is an attempt to see how much work is needed to
reproduce entry icons by just putting an entry and images
in a box, with some css glue.
2017-12-12 09:42:05 -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
Timm Bäder
484e453780 Fix a few overlooked casts
glib warns about these now.
2017-12-09 13:14:00 +01:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05: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
Benjamin Otte
4658d7ea54 dnd: Remove x/y coordinates from drag-data-received
This is in preparation of using input streams to show that these
coordinates aren't needed most of the time and can otherwise be saved
during GtkWidget::drag-drop.
2017-12-05 05:29:00 +01:00
Timm Bäder
78832732c4 testswitch: Remove unnecessary gtk_widget_show calls 2017-12-04 12:24:27 +01:00
Benjamin Otte
2d5c82b4ec gtk: Remove GtkClipboard 2017-12-03 05:46:49 +01:00
Benjamin Otte
18bf0eb61a clipboard: Change image convenience APIs
Don't use pixbufs anymore, use textures.
2017-12-03 05:46:49 +01:00
Benjamin Otte
3ea258de26 tests: Don't crash if widgets go away before clipboard
Don't g_signal_connect() to the clipboard without protection - the
clipboard might outlast you and still emit signals.
2017-12-03 05:46:48 +01:00
Benjamin Otte
6b326b14c0 gdk: Add GDK_TYPE_FILE_LIST with serializers
This is a GSList of GFile and we want it so we can operate with lists of
files and text/uri-list.

I chose GSList over GList because that's what the GtkFileChooser API
uses, too.
2017-12-03 05:46:48 +01:00
Benjamin Otte
928c98a84e gdk: Add serializers and deserializers for GFile
in particular, support:
GFile <=> text/uri-list
GFile  => text/plain
2017-12-03 05:46:48 +01:00
Benjamin Otte
39d4622563 tests: Improve formats list for testclipboard2 2017-12-03 05:46:48 +01:00
Benjamin Otte
6fffa5b171 tests: Open a 2nd display in testclipboard2
This allows testing local transfer of data as well as remote transfer
(by transferring data between clipboards of both Displays).
2017-12-03 05:46:47 +01:00
Benjamin Otte
e2014850b9 tests: Add possibility to set invalid UTF-8 and clear clipboard 2017-12-03 05:46:47 +01:00
Benjamin Otte
7426f1a16b gdkcontentformats: Change the matching API
Instead of having just one function that has the gtype and mime type as
out arguments, have 3 functions: 1 that finds any match, 1 that finds a
GType match and one for a mime type match.

This makes the API way more convenient to use.
2017-12-03 05:46:47 +01:00
Benjamin Otte
12ca641ff5 clipboard: Implement local fallback clipboard transfers
This requires implementing a "pipe" so we can have 2 streams running:
  contentprovider => serializer => outputstream
  inputstream => deserializer => reader
And the pipe shoves the data from the outputstream into the inputstream.
2017-12-03 05:46:47 +01:00
Benjamin Otte
888e5257e0 clipboard: Introduce GdkContentProvider
GdkContentProvider is the object that represents local data in the
clipboard.

This patch only introduces the object and adds the clipboard properties,
it does not yet provide a way for the actual implementations to access
it.

The only access that is implemented is the local shortcut GValue access.
2017-12-03 05:46:47 +01:00
Benjamin Otte
88684baecf clipboard: Add gdk_clipboard_read_text_async()
Also add deserializers for G_TYPE_STRING.
2017-12-03 05:46:28 +01:00
Benjamin Otte
02d1f90d13 clipboard: Add gdk_clipboard_read_pixbuf_async() 2017-12-03 05:46:28 +01:00
Benjamin Otte
91910ba013 gdk: Im[plement content deserializing
Add infrastructure to do GInputStream => GType conversions. Use that to
implement gdk_clipboard_read_value() which reads into GValues.
2017-12-03 05:46:27 +01:00
Benjamin Otte
41f70e18af clipboard: Refactor gdk_clipboard_read() to be async
This allows us not just to pass any mime type to the read function, but
it also makes it possible to pass multiple mime types and the clipboard
can then try them in order until it finds a supported one.

This is so far not implemented though.
2017-12-03 05:46:26 +01:00
Benjamin Otte
3506ae6085 tests: Add a new test app for GdkClipboard 2017-12-03 05:43:24 +01:00
Benjamin Otte
3d4743ee62 textview: Remove serialization API
It's unused. Plain text is not using that framework, neither is
in-process same-display transmission.

So it was only useful for sharing text with custom tags across
applications, and nobody is doing that.
2017-11-29 23:03:33 -05:00
Matthias Clasen
a8a156e63c Fix the build 2017-11-29 20:12:43 -05:00
Matthias Clasen
c51703be60 testdnd: Stop using gtk_drag_source_set_icon_pixbuf
We can avoid it here as well.
2017-11-29 20:02:01 -05:00
Matthias Clasen
c0d3ed0739 Fix the build
A stray GdkScreen leftover.
2017-11-25 11:02:29 -05:00
Benjamin Otte
c82378ea57 gdk: Add GType support to GdkContentFormats
This is not used by anything yet, but add it now, so people looking at
this new code can make sense of it.
Plus, the documentation mentions it, so better have the docs make sense.

It will be used once we add support for conversions to GDK and allow
doing cipboard/dnd by GValue.
2017-11-20 23:22:28 +01:00
Benjamin Otte
1a70ca75e8 gdk: Sanitize GdkContentFormats API
Make sure the API reflects the idea that GdkContentFormats is a set
containing mime types. In particular, treat the object itself as a
plural - it's named content format`S' after all - and therefor use
the correct verb form.

Also make GdkContentFormats keep an array instead of a list, now that
it's immutable.
2017-11-20 23:15:11 +01:00
Benjamin Otte
fc2ce5a925 gdk: Make GdkContentFormats immutable 2017-11-20 23:13:10 +01:00
Benjamin Otte
d6a209816b gdkdnd: Make GdkDragContext->formats a GdkContentFormats
Instead of it being a GList of GdkAtoms.
2017-11-20 23:12:33 +01:00
Benjamin Otte
9a6ec4e959 contentformats: Rename GtkTargetList
It's now called GdkContentsFormat
2017-11-20 23:12:33 +01:00
Benjamin Otte
c863ac0f90 dnd: Remove GtkTargetEntry and GtkTargetFlags
warning: We don't do any same-app checks anymore so you currently can
copy local data into external apps.

This will be fixed later.
2017-11-20 23:12:33 +01:00
Matthias Clasen
fe93bc7627 tests: Test the x11-specific error trap api
The other one is gone.
2017-11-17 00:08:24 -05:00
Benjamin Otte
3f5178dc21 selection: Remove the info uint
Instead of allowing people to pass a uint user-data, insist on them
comparing mime types.

The user data was a uint instead of a pointer anyway, so uniqueness
could not be guaranteed and it caused more issues than it was worth.
And that's ignoring the fact that it basically wasn't used.
2017-11-16 22:59:43 +01:00
Matthias Clasen
0d23606653 Drop gtk_icon_size_lookup
Add a new, private gtk_image_get_image_size to replace it, and
update the remaining callers in a suitable way.
2017-11-15 14:22:17 -05:00
Matthias Clasen
2301d8d90b enums: Change GtkIconSize values
The new values are the ones we intend to keep. The old ones had
duplicated meanings and nobody knew which one to take.
2017-11-15 14:22:17 -05:00
Matthias Clasen
dbfaa99107 image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.

Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
049cc6aa01 image: Change getters
Instead of returning the icon size with them, make
gtk_image_get_icon_name() and gtk_image_get_gicon() only return the icon
itself.

As a benefit, we can turn them into regular getters that return values
instead of requiring out parameters.

Instead, provide gtk_image_get_icon_size() to query the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
f53b72e5ff button: Get rid of icon size
In fact, make gtk_button_new_from_icon_name() just set the icon-name
property instead of creating a GtkImage.
2017-11-15 14:22:16 -05:00
Benjamin Otte
a7754a14b5 toolbar: Remove icon sizes 2017-11-15 14:22:16 -05:00
Benjamin Otte
8df61992d7 tooltips: Remove GtkIconSize usage 2017-11-15 14:22:16 -05:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Benjamin Otte
5a1a11bcde dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
2017-11-15 19:07:17 +01:00
Benjamin Otte
7efc5a1558 clipboard: Consistently use GtkTargetList
Some code was using GtkTargetList, some used GtkTargetEntry and some
GtkTargetPair.
2017-11-15 19:07:16 +01:00
Benjamin Otte
ed1b6a9bed gdkwindow: Remove event_mask arguments from constructors 2017-11-13 23:41:38 +01:00
Benjamin Otte
723bf44887 calendar: Fix for GTK4 changes 2017-11-10 14:56:42 +01:00
Benjamin Otte
f4e1a2b849 testgtk: Draw the right area in alpha window test
Even broken stuff is easier now.
2017-11-10 14:56:42 +01:00
Benjamin Otte
2ff5038b09 testgtk: Fix some more old drawing area uses 2017-11-10 14:56:42 +01:00
Benjamin Otte
2620323fac tests: After 20 years, update the simple test to modern GTK
It's 3 lines shorter!
And it works again!
2017-11-10 14:56:42 +01:00
Benjamin Otte
93c42bcbe0 testgtk: Fix rotated text demo
Use proper DrawingArea APIs here.
2017-11-10 14:56:42 +01:00
Benjamin Otte
22472c1924 entry: Remove surface icons
We have texture icons.
2017-11-05 06:45:01 +01:00
Benjamin Otte
a409320cda gtk: Use gtk_widget_set_cursor()
... and gtk_widget_set_cursor_from_name() instead of setting cursors on
GdkWindows.
2017-11-04 01:37:03 +01:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Timm Bäder
8fa20f87e4 testwidgetfocus: Make focused button more obvious 2017-11-02 11:25:41 +01:00
Matthias Clasen
47fb329279 tests: Stop using gdk_cursor_new_for_display
The name-based api is the one we prefer.
2017-11-01 21:22:21 -04:00
Matthias Clasen
1641ef4799 tests: Stop using gdk_pango_get_context_for_display
This api is going away.
2017-10-31 18:14:08 -04:00
Benjamin Otte
e78402ec94 tests: Remove completely outdated test
The test was fiddling with screens and trying crazy stuff. We don't do
things like that anymore.
2017-10-31 19:03:55 +01:00
Benjamin Otte
07164e098a window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.

Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
2017-10-31 08:25:37 +01:00
Benjamin Otte
ecd5b399a4 icontheme: Use GdkDisplay instead of GdkScreen 2017-10-31 03:05:55 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00