Commit Graph

302 Commits

Author SHA1 Message Date
Benjamin Otte
234d34366a clipboard: Add the useful stuff from reverted commit
This is the parts of dc50e0637f that
should have been committed but were reverted in
b5c62cf86f to unbreak the build.
2017-12-10 01:09:14 +01:00
Matthias Clasen
b5c62cf86f Revert "clipboard: Add gdk_clipboard_set()"
This reverts commit dc50e0637f.

This broke the build.
2017-12-04 23:09:54 -08:00
Benjamin Otte
dc50e0637f clipboard: Add gdk_clipboard_set()
This API allows specifying a GType and va_args of a value of that type
to set the clipboard contents. This massively simplifies setting weird
object types into the clipboard.
2 example patches included in this patch are the GtkTextBuffer and the
file list in the file chooser.

Using gobject-introspection, this should work without specifying the
type, so that you can literlally say
  clipboard.set ("Hello World")
or
  clipboard.set (pixbuf)
which is why I've also marked all other setters as (skip). They just
exist in C as wrappers for type safety reasons.
2017-12-05 05:29:03 +01: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
Benjamin Otte
ca96fac488 filechooserwidget: Port to new clipboard
We use the new GDK_TYPE_FILE_LIST here.
2017-12-03 05:46:48 +01:00
Benjamin Otte
a59572f96d widget: gtk_widget_get_clipboard => gtk_widget_get_old_clipboard
Just rename the function, so the previous one can be used for the
new clipboard.
2017-12-03 05:46:47 +01:00
Benjamin Otte
fc2ce5a925 gdk: Make GdkContentFormats immutable 2017-11-20 23:13:10 +01:00
Benjamin Otte
9a6ec4e959 contentformats: Rename GtkTargetList
It's now called GdkContentsFormat
2017-11-20 23:12:33 +01:00
Matthias Clasen
a8531605db Some more interning
This avoids more strdups at startup.
2017-11-18 08:18:11 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -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
67268bcc23 filechooserwidget: icon size is always 16 2017-11-15 14:22:17 -05: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
Matthias Clasen
8460034f58 filechooserwidget: Use GIcons
This lets us avoid much of the symbolic icon rendering api.
2017-11-08 21:56:28 -05: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
648d040395 widget: Remove gtk_widget_get_screen()
Replace the remaining users with "correct" code that does not need that
function anymore.
2017-10-31 08:25:37 +01:00
Benjamin Otte
1c36c6ed4d widget: Remove gtk_widget_has_screen()
All widgets always have a screen (or display).
2017-10-31 04:33:11 +01:00
Benjamin Otte
44614394e6 widget: Turn screen-changed signal into display-changed 2017-10-31 00:43:11 +01:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Matthias Clasen
c586a6486f file chooser widget: Covert to GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
c48a196d77 filechooser: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Daniel Boles
6609173779 FileChooserWidget: Remove an unused #include 2017-08-31 19:59:25 +01:00
Javier Jardón
d3954f614c Use gtk_show_uri_on_window() instead gtk_show_uri() 2017-08-28 23:47:36 +01: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
cc7038b740 filechooserwidget: Fix save widgets
Now that GtkFileChooserWidget is not a GtkBox anymore, we can't just
gtk_box_pack_start child widgets to it.
2017-07-19 21:27:13 -04:00
Timm Bäder
3505e0d6e7 filechooserwidget: Add GtkFileChooserErrorStack
Showing all the different errors and warnings when renaming and creating
files/folders without potentially resizing popovers on every keystroke
requires us to know the size of the error messages beforehand, so pack
all of the possible error messages and warnings in labels and those into
a stack. This way we can also neatly crossfade transition between them.

https://bugzilla.gnome.org/show_bug.cgi?id=775636
2017-07-18 15:11:26 -04:00
Timm Bäder
5c4934cfc0 Chain up in size-allocate implementations
Otherwise we're not setting an allocation at all.
2017-05-01 21:21:40 +02:00
Timm Bäder
a50dc94381 filechooserwidget: Remove always-false error case
_gtk_search_engine_new never returns NULL, it always returns a valid
GObject with at least the simple search engine initialized.
2017-04-28 11:27:08 +02:00
Timm Bäder
c92b7d4224 box: Remove fill child property
GtkWidget:halign and GtkWidget:valign are sufficient
2017-04-25 20:30:37 +02:00
Timm Bäder
5729ea7744 box: Remove expand child property
GtkWidget already has hexpand/vexpand properties.
2017-04-25 20:30:37 +02:00
Timm Bäder
3d2c81c8f1 filechooserwidget: Remove useless gtk_widget_show call 2017-04-02 18:24:17 +02:00
Timm Bäder
806c4f7d2f filechooserwidget: Inherit from GtkWidget 2017-03-31 09:50:38 +02:00
Timm Bäder
a65fbf2d49 filechooserwidget: Remvoe useless gtk_widget_show call
And a comment above. Even if it is not correct, it doesn't matter since
we call gtk_widget_show on it again later in that function.
2017-03-13 12:45:38 +01:00
Timm Bäder
4d3b15e37c filechooserwidget: Avoid a gtk_widget_destroy 2017-03-13 12:08:58 +01:00
Timm Bäder
fa5c39942c filechooserwidget: Remove unnecessary gtk_widget_show calls 2017-03-13 12:08:58 +01:00
Timm Bäder
aebea7d644 filechooserwidget: Fix profiling code compilation 2017-02-17 18:23:01 +01:00
Timm Bäder
d637b0eeed filechooserwidget: Fix rename popover position calculation
Since the browse_file_popover is positioned correctly, just convert the
coordinates in the same way we do there.

https://bugzilla.gnome.org/show_bug.cgi?id=778746
2017-02-17 18:22:15 +01:00
Bastien Nocera
76dfef6257 gtk: Ignore gtk_show_uri() deprecation warnings
https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:37:55 +01:00
Piotr Drąg
bfaed659f1 Fix translator comments
They need to be exactly one line above a string to show up in .po files.
2017-01-28 01:13:12 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Timm Bäder
13b001b77c widget: Remove show_all vfunc 2017-01-20 21:33:38 +01:00
Timm Bäder
55fda57c44 filechooserwidget: Forward file filter to entry
And in the entry, apply the currently used filter as a second step to
the completion items.

https://bugzilla.gnome.org/show_bug.cgi?id=773007
2016-11-17 15:42:25 +01:00
Matthias Clasen
5b3b111260 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:06:57 -05:00
Matthias Clasen
2f197ac0c2 Revert "GtkFileChooser: Make local-only default to FALSE"
This reverts commit 0bc79910e0.
2016-11-17 09:05:47 -05:00
Matthias Clasen
0bc79910e0 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:02:29 -05:00
Emmanuele Bassi
590e7e68d8 filechooserwidget: Rename error variable
Avoid shadowing an existing error.
2016-10-17 11:44:10 +01:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00