Commit Graph

2895 Commits

Author SHA1 Message Date
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
Benjamin Otte
a2e625692e gtk-demo: Remove calls to gtk_style_context_reset_widgets()
Those calls have been unneeded for a long time - since we gained the
changed signal on the StyleProvider in fact.
2017-10-31 03:05:54 +01:00
Matthias Clasen
ffb3bc438e tests: Stop using gdk_pango_context_get.
We can just as well get the display ourselves.
2017-10-30 21:35:48 -04:00
Alexander Larsson
96b04836d8 Drop all uses of GdkPixbufAnimation in the gtk APIs
These are basically animated gifs, and don't fit well in how
modern things animate.
2017-10-23 16:56:49 +02:00
Alexander Larsson
2b194089dd GtkImage: Drop support for storing pixbufs
This drops the pixbuf property and the pixbuf getters. We keep
gtk_image_new/set_from_pixbuf, but these are small helpers that
immediately convert to a surface, and there is no way to later get
back the pixbuf you passed in.

The from file/resource codepaths are also changed to load a surface
instead of a pixbuf.
2017-10-23 15:28:33 +02:00
Alexander Larsson
d3fc937b4d GtkWindow/GdkWindow: Finish converting icons to surfaces
There were some parts left, for instance gdk_window_set_icon_list.
2017-10-23 13:45:25 +02:00
Alexander Larsson
6f8644ad25 GtkEntry: Use surfaces, not pixbufs for bitmapped icons 2017-10-23 13:45:25 +02:00
Matthias Clasen
b72cda47fa Use surface apis in testnotebookdnd
Stop using gtk_drag_set_icon_pixbuf.
This api is going away.
2017-10-23 05:58:54 +02:00
Matthias Clasen
89ad359628 tests: Use surface apis in testimage
Stop using gtk_drag_set_icon_pixbuf.
This api is going away.
2017-10-23 05:58:54 +02:00
Matthias Clasen
a783470491 tests: Convert dnd test to surface apis
Stop using gtk_drag_set_icon_pixbuf in testdnd2.
This api is going away.
2017-10-23 05:58:54 +02:00
Matthias Clasen
243bd4f0c8 gsk: Tweak cairo node apis
Rename the surface getter to peek, following other render
node getters, and make the surface-based constructor private,
since it is not something we want to encourage.

Update all callers.
2017-10-20 13:54:01 +02:00
Timm Bäder
ac7e1081b5 tests: Add testgridbaseline
Which shows that GtkGrid currently computes baselines for all rows even
though not all of them might request a baseline.
2017-10-11 08:50:18 +02:00
Umang Jain
74a677a79d Create tests for cairo node
https://bugzilla.gnome.org/show_bug.cgi?id=788534
2017-10-08 18:22:34 +05:30
Daniel Boles
6cafb62e9b testmenubutton: Fix inverted keynav in the GtkMenu
GtkMenu’s own keynav code, which actually bothers to account for the
layout of items, only happens if columns > 1. So, adding items to 1
column using a reverse loop meant they were placed in the Menu’s list of
children in that order, and because we only have 1 column, Menu passes
keynav up to MenuShell, which doesn’t adjust for the items’ positions.

‘Fix’ that here by adding items in the same order they’ll have when laid
out in the Menu, so keynav does what you’d expect, not the opposite. For
that, it’s simpler just to use gtk_container_add().

Let’s presume users are using add(), attach() with a non-inverted loop,
or attach() with arguments that create 2+ columns and so GtkMenu keynav.
2017-10-08 13:17:04 +01:00
Daniel Boles
06941c593d testcombo: Test grid :row- and :column-span-column
Ditch two items that were white and so weren’t visible on our standard
theme anyway, and use the new space to test extra grid-mode properties.

Note that if we do this then, as before, we set the ListStore on the
ComboBox before appending to it, that produced runtime warnings like:

Gtk-CRITICAL **: gtk_menu_attach: assertion 'left_attach < right_attach' failed

I didn’t look into that yet, but it may indicate that attaching items
vs. recognising their spans don’t occur in the correct order. For the
purposes of testing this, I just create the CB after filling its model.
2017-10-04 11:17:57 +01:00
Matthias Clasen
47464ce4da Create tests for gsk box shadows 2017-10-01 22:55:32 -04:00
Matthias Clasen
a4d984fb18 Create tests for GskTextNode 2017-10-01 22:09:43 -04:00
Matthias Clasen
e1ea408161 tests: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Carlos Garnacho
8a26fd3308 tests: Update testoverlay "Chase" testcase to gtk4 crossing events
The intent is detecting enter events into the overlayed label, so just
connect to ::enter-notify-event on the label with no GdkWindow checks.
2017-09-15 21:11:22 +02:00
Matthias Clasen
93c67eaf6d Add a test for overlay blur 2017-09-04 14:28:16 -04:00
Timm Bäder
98281bc60a testcenterbox: Properly quit on window close 2017-09-03 09:17:35 +02:00
Daniel Boles
1e832b2e16 testpopover: Use HeaderBar to get CSD decorations
This helps test whether the Popover positioning gets messed up by the
presence of CSD shadow or other accessories around the content area.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
2017-08-24 21:32:05 +01:00
Timm Bäder
86c294b952 testgtk: Remove some invalid css 2017-08-23 11:05:37 +02:00
Daniel Boles
fb66f539ae testpopover: Sync initial vals of controls & props
The ComboBoxes were initially empty, rather than reflecting the initial
values of the properties. The CheckButtons were only correct by chance.
Fix this by setting the initial values on the widgets and binding them
to the properties using SYNC_CREATE, so the two are always synced up.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
2017-08-14 23:15:11 +01:00
Emmanuele Bassi
6240082e12 Drop old MSC makefiles 2017-08-14 22:23:09 +01:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Matthias Clasen
e24ffbbc21 Add a testcase for the new Emoji chooser
For now, add it in testentryicons.
2017-08-12 18:48:14 -04:00
Matthias Clasen
535e604b91 Drop the shape window example in testgtk
Not sure this can be rescued without root window coordinates.
It is also somewhat inherently X11-specific.
2017-08-11 15:46:00 -04:00
Benjamin Otte
29b0954c45 testgtk: Actually expand the scrolled window 2017-08-02 00:23:43 +01:00
Benjamin Otte
7297aeb54c testgtk: Get rid of GtkEventBox 2017-08-02 00:23:30 +01:00
Benjamin Otte
69da7836f9 tests: Get rid of GtkEventBox 2017-08-02 00:15:10 +01:00
Daniel Boles
e74be1728e testentryicons: Set tooltips on all icons
Just to test tooltips in all cases; what was already here
should have been sufficient, but this doesn't hurt.

While here, also add some instructive placeholder text.

https://bugzilla.gnome.org/show_bug.cgi?id=780938
2017-07-31 20:01:30 +01:00
Timm Bäder
b71f644cf5 eventbox: Remove visible-window property
The GdkWindow that was supposed to back it is gone.
2017-07-27 21:53:42 +02:00
Timm Bäder
b838cc0d65 testflowbox: hexpand the flowbox 2017-07-22 06:52:46 +02:00
Chun-wei Fan
171ff43340 tests: Include system headers appropriately
Don't include unistd.h on Windows, and include the appropriate headers on
Windows as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-07-21 23:36:03 +08:00
Chun-wei Fan
4d3aa827f6 tests/rendernode-create-tests.c: Don't use VLAs
Replace uses of VLAs (variable-length arrays) using g_newa(), since
Visual Studio builds will unlikely ever support VLAs (which became optional
in C11).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-07-21 23:35:54 +08:00
Timm Bäder
500d25e3c8 gdkgears: Add window content spacing back
This was lost when border-width was removed.
2017-07-20 12:41:12 +02:00
Timm Bäder
52875b7639 testgtk: Remove unused local variable 2017-07-19 21:27:16 -04:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
c26731968b testpopover: Remove expand GtkBox child properties 2017-07-19 21:27:15 -04:00
Timm Bäder
d6bb1625e9 testbaseline: Add a horizontal spinbutton 2017-07-19 21:27:14 -04:00
Timm Bäder
1bffccd583 testnotebookdnd: quit when the toplevel gets closed 2017-07-19 21:27:14 -04:00
Timm Bäder
e36ddfec17 Remove all widget style property code 2017-07-19 21:27:14 -04:00
Timm Bäder
a73d3418bc layout: Remove bin_window 2017-07-19 21:27:14 -04:00
Timm Bäder
ee8a8c49e2 testwidgetfocus: Drop SPACING constant in favor for CSS
This makes it easier to test various other properties of widgets.
2017-07-19 21:27:13 -04:00