Commit Graph

1074 Commits

Author SHA1 Message Date
Matthias Clasen
facf78a5b6 inspector: Allow disposing the inspector
We were hiding the inspector when the window
is closed, but that has the side-effect of
keeping references to application windows,
so we would keep them artificially alive,
which can have side-effects.

So, make the inspector go away when closed.
2020-07-17 23:15:42 -04:00
Matthias Clasen
6b19fcd859 inspector: Properly dispose GtkInspectorWindow 2020-07-17 23:15:25 -04:00
Matthias Clasen
ca784e3e1a inspector: Properly dispose GtkInspectorShortcuts 2020-07-17 23:13:29 -04:00
Matthias Clasen
314c8558d7 inspector: Properly dispose GtkInspectorListData 2020-07-17 23:13:07 -04:00
Matthias Clasen
af30a7fe06 inspector: Dispose tree data properly
Another place where we were leaking children.
2020-07-17 22:54:19 -04:00
Matthias Clasen
9ffd7d1970 inspector: Dispose the recorder properly
We were leaking children here.
2020-07-17 22:54:10 -04:00
Matthias Clasen
cb906c80eb inspector: Drop the recorder Private struct 2020-07-17 22:37:24 -04:00
Timm Bäder
f721d2de15 debug: Remove resize highlighting
This has been broken ever since the debug highlighting moved to
inspector overlays.
2020-07-17 05:49:12 +02:00
Benjamin Otte
e518c1f2f3 stringfilter: Make the constructor take an expression
An expression is critically important for a string filter and people
should be made aware of it when constructing the filter.
2020-07-16 20:43:16 +02:00
Matthias Clasen
46eb51bc30 inspector: Avoid losing a reference
This was copying the example in the treelistrowsorter
docs that the previous commit fixed, so we apply
the same fix here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
594ec3d822 inspector: Don't derive from GtkBox
We don't do that anymore. A bin layout
is sufficient here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
f280508209 inspector: Drop a Private struct
These are really not needed in the inspector.
2020-07-16 07:14:01 -04:00
Matthias Clasen
480b88c776 inspector: Drop an unused field 2020-07-16 07:14:01 -04:00
Matthias Clasen
c1c110ba65 inspector: Use substring matching in the property list
This is convenient for things like "set both hexpand and
vexpand", since you can then search for "expand"
2020-07-15 11:29:06 -04:00
Matthias Clasen
2b5dd0082d inspector: Show some information about expressions
This is not too useful, but better than nothing.
2020-07-13 20:49:56 -04:00
Matthias Clasen
1b28353be5 inspector: Ellipsize in the object tree
We don't want a long label to blow up the width
of the inspector window.
2020-07-13 17:32:52 -04:00
Matthias Clasen
a07c030d02 inspector: Fix up input enum names
We've recently added and removed a few values in these
enumerations. Keep the names in sync, so we don't show
nonsense.
2020-07-13 17:13:43 -04:00
Matthias Clasen
08a4f4552c Give the inspector a devel header too
Lets clearly communicate that we're unstable.
2020-07-13 08:28:02 -04:00
Matthias Clasen
4d371b2b16 inspector: Fix property list styling
We use dropdowns here now, so style them.

Also, avoid the swoosh when switching to the
property list, when everything shrinks.
2020-07-07 11:21:42 -04:00
Matthias Clasen
dfc04a590d inspector: Reshuffle the sidebar
Move the sidebar in the object page below the
object header, for a more logical hierarchy.
2020-07-07 02:05:18 -04:00
Matthias Clasen
fe5b364675 inspector: Drop unused properties
The individual pages no longer need the object tree
to show object details, this works with the window
now.
2020-07-07 01:25:21 -04:00
Matthias Clasen
0b38a0663d inspector: Add dom-like navigation controls
Maintain a stack of objects, and add ˂˅˄˃ buttons
that navigate this stack, as well as the widget
tree and list models.
2020-07-07 00:51:18 -04:00
Matthias Clasen
e5c0716293 inspector: Remove an unused field 2020-07-07 00:48:43 -04:00
Benjamin Otte
5080730728 listmodels: Stop respecting item-type
Simplify all view model APIs and always return G_TYPE_OBJECT as the
item-type for every model.

It turns out nobody uses item-type anyway.

So instead of adding lots of APIs, forcing people to think about it and
trying to figure out how to handle filter or map models that modify item
types, just having an easy life is a better approach.

All the models need to be able to deal with any type of object going
through anyway.
2020-07-05 02:59:21 +02:00
Matthias Clasen
f01d695e6c Merge branch 'matthiasc/for-master' into 'master'
inspector: Fix the monitor list width

Closes #2909

See merge request GNOME/gtk!2185
2020-07-03 05:51:29 +00:00
Matthias Clasen
619b2465c1 inspector: Fix the monitor list width
Fixes #2909
2020-07-03 01:07:13 -04:00
Alexander Mikhaylenko
7c3b30036e headerbar: Show title buttons by default
Most of the time show-title-buttons is set to TRUE. Go ahead and make that
the default.
2020-07-02 23:51:16 +05:00
Matthias Clasen
43b9fc6981 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2162
2020-07-01 01:35:56 +00:00
Matthias Clasen
f0ea0be15d Merge branch 'matthiasc/for-master' into 'master'
Drop unnecessary uses of gtk_style_context_add_class

See merge request GNOME/gtk!2177
2020-06-30 22:52:18 +00:00
Matthias Clasen
c0e2d7c62f Drop unnecessary uses of gtk_style_context_add_class
We can use gtk_widget_add_css_class instead, most places.
2020-06-30 17:42:30 -04:00
Matthias Clasen
cc072eb7cd inspector: Avoid a use of gtk_style_context_add_class
We have gtk_widget_add_css_class for this now.
2020-06-30 17:10:05 -04:00
Matthias Clasen
613213f597 inspector: proper list model support
Add a data tab for list models that allows exploring
the objects in the model.
2020-06-30 17:09:55 -04:00
Matthias Clasen
52666d6fe5 inspector: Rename DataList -> TreeData
Rename the DataList object to TreeData, in preparation
for adding a ListData object for list models. While
we are touching it, modernize it a bit (drop the Private
struct, use a layout manager, etc).
2020-06-30 15:18:37 -04:00
Matthias Clasen
bbb28196e5 inspector: Remove list model support from the property editor
This makes the inspector lock up when used with any production
size list model, and blocks access to properties of the model
itself. Instead, we'll make the model available as an object
and add a data tab for list model contents, like we already
do for tree models.
2020-06-30 14:22:01 -04:00
Matthias Clasen
c267a75eef Stop using GtkFunctionsListItemFactory
This was an early attempt at a factory, and has been
superseded by GtkSignalsListItemFactory. Port all users
the the newer one.
2020-06-29 22:10:34 -04:00
Timm Bäder
8cc2a44268 recorder: Don't select new row when adding recording
This is what makes the recorder slow. We might want to scroll down in
the list though.
2020-06-27 11:30:02 +02:00
Timm Bäder
2534310ce9 recorder: Remove frame time from recording rows
We should bring this back in a different way, e.g. in a way that doesn't
just use the time of the previous recording.
2020-06-27 11:15:51 +02:00
Timm Bäder
3a4fbc5e50 recorder: Remove Full/Partial render distinction
It doesn't exist anymore these days
2020-06-27 11:08:09 +02:00
Timm Bäder
89a67ac719 recorder: s/gint/int/g 2020-06-27 11:04:03 +02:00
Timm Bäder
21b84b1890 recorder: Remove some debug spew
Stop printing the number of nodes we have
2020-06-27 11:01:28 +02:00
Matthias Clasen
0ec868bd69 inspector: Adapt to dropdown api change
The suppported syntax for dropdowns in ui files
has changed. Get with the program.
2020-06-25 16:42:30 -04:00
Matthias Clasen
386b63b85d scrolledwindow: Don't take adjustments in new()
In 99.9% of all cases, these are just NULL, NULL.
So just do away with these arguments, people can
use the setters for the rare cases where they want
the scrolled window to use a different adjustment.
2020-06-24 11:25:09 -04:00
Matthias Clasen
83f22fcce2 Add a few missing includes
These sources are using GtkListStore apis,
but were replying on indirect includes to
get the header. Make this explicit, to prepare
for GtkEntryCompletion losing its tree view
dependencies.
2020-06-23 07:55:53 -04:00
Emmanuele Bassi
1c856a208f Rename master and slave device
We already use the "logical/virtual" and "physical" names in the
documentation, there's no reason to use loaded terms just because X11
uses them.
2020-06-18 19:22:20 +01:00
Matthias Clasen
14f26d2345 inspector: Don't set style classes on app widgets
Due to a mixup, the inspector was setting .dim-label on
widgets that get unmapped, instead of the labels representing
them in the object tree.
2020-06-15 11:22:32 -04:00
Matthias Clasen
37633985bd Drop gtknativeprivate.h
No need to ship empty headers.
2020-06-07 08:52:45 -04:00
Matthias Clasen
03c1fa43f4 inspector: Expand the actions list 2020-06-03 13:32:15 -04:00
Matthias Clasen
3b9f0ab866 inspector: Expand the resource list
This is an experiment with adding a filler column.
2020-06-03 13:32:15 -04:00
Matthias Clasen
9617a00ae3 inspector: Expand the property list
It looks better this way.
2020-06-03 13:32:15 -04:00
Matthias Clasen
1408199957 inspector: Expand the object tree
This is how it used to look, and it looks better that way.
2020-06-03 13:32:15 -04:00
Matthias Clasen
cbe81fd443 Merge branch 'drop-fallback-c89' into 'master'
Drop fallback-c89.c

See merge request GNOME/gtk!1999
2020-05-31 18:14:14 +00:00
Christoph Reiter
2d5cf2b4c4 Drop fallback-c89.c
We require a C compiler supporting C99 now. The main purpose of
these fallbacks was for MSVC. From what I can see this is now all supported
by MSVC 2015+ anyway.

The only other change this includes is to replace isnanf() with the
(type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
2020-05-31 17:09:23 +02:00
Matthias Clasen
2a9d2cc7e9 inspector: Touch up list styling
This is just the minimal amount of work to make
headers recognizable.
2020-05-31 09:24:19 -04:00
Matthias Clasen
0d9873d8bc inspector: Use a column view for actions
A straight conversion from list box to column view.
2020-05-31 09:24:12 -04:00
Matthias Clasen
23bc38ed06 inspector: Make the resource list sortable
This is using a GtkTreeListRowSorter to keep expanded
state of the tree while changing the sorting.
2020-05-31 09:24:04 -04:00
Matthias Clasen
42d26b4b05 inspector: Use a column view for the resource list
A conversion from tree view to column view.
2020-05-31 09:23:51 -04:00
Matthias Clasen
04700789e1 inspector: Use a column view for properties
Just a straight conversion from list box to column view.
2020-05-31 09:23:45 -04:00
Matthias Clasen
e23baa59f0 inspector: Add columns to the object tree
Add columnview columns in the object tree.
We do the same for treeview columns.
2020-05-31 09:23:37 -04:00
Matthias Clasen
b331e29e43 inspector: Use dropdowns in the visual page
Convert everything in the visual page to dropdowns.
2020-05-30 19:31:38 -04:00
Matthias Clasen
54cdafdd67 inspector: Use a dropdown for size groups
Use a GtkDropDown for the modes of size groups.
2020-05-30 19:31:38 -04:00
Matthias Clasen
30541201b6 inspector: Use a dropdown for controllers
Use a GtkDropDown for the phases of event controllers.
2020-05-30 19:31:38 -04:00
Matthias Clasen
6346fa960c inspector: Use a dropdown for attribute mapping
Use a GtkDropDown for the attribute mapping editor.
2020-05-30 19:31:38 -04:00
Matthias Clasen
99c98d0736 inspector: Use dropdowns in property editor
Replace combo boxes by dropdowns in the property editor.
2020-05-30 19:31:38 -04:00
Benjamin Otte
650688c635 inspector: Remove private struct for prop editor 2020-05-30 19:26:46 -04:00
Benjamin Otte
2787e916b2 inspector: Make Controller page a GtkWidget 2020-05-30 19:26:46 -04:00
Benjamin Otte
e72119e9bb inspector: Remove private struct from controllers 2020-05-30 19:26:46 -04:00
Benjamin Otte
6e3b6980de inspector: Port object tree to GtkColumnView 2020-05-30 19:26:46 -04:00
Benjamin Otte
d7b5966fa7 inspector: Make the recorder node list use a ListView
It's quite a bit faster now, but the code is also a bit more awkward.

Pain points:

- GtkTreeListModel cannot be created in UI files because it needs
  a CreateModelFunc.
  Using a signal for this doesn't work because autoexpand wants to
  expand the model before the signal handler is connected.

- The list item factory usage is still awkward. It's bearable here
  because the list items are very simple, but still.
2020-05-30 19:26:45 -04:00
Benjamin Otte
bb44120ae3 inspector: Use a GtkTreeExpander in the object tree 2020-05-30 19:26:45 -04:00
Benjamin Otte
8b1f034242 inspector: Use a treeexpander in the recorder 2020-05-30 19:26:45 -04:00
Matthias Clasen
11a1f8f36a Redo sort list model with GtkSorter
Reshuffle the api to take full advantage
of GtkSorter. Update all callers.
2020-05-30 19:26:44 -04:00
Benjamin Otte
4abdf695e3 filterlistmodel: Rewrite to use GtkFilter 2020-05-30 12:30:23 -04:00
Matthias Clasen
a8df81b27c inspector: Drop app-menu support
Don't add app menu to the object tree anymore;
this property is going away.
2020-05-22 17:31:05 -04:00
Timm Bäder
a5e7e72dd8 inspector: Fix overlay coordinates
Get the native transform only once, for all overlays. Unfortunately we
have to undo this for the updates overlay since that one gets values
in surface coordinates.
2020-05-20 17:06:54 +02:00
Timm Bäder
8e8e869853 inspector: Don't offset layout overlay too much
We already do this earlier.
2020-05-20 17:06:54 +02:00
Matthias Clasen
75d9310986 Change coordinate translation apis to take doubles
Change gtk_widget_translate_coordinates and
gtk_native_get_surface_transform to operate
on doubles. Update all callers.
2020-05-17 17:17:31 -04:00
Benjamin Otte
b353221185 Merge branch 'wip/otte/monitors' into 'master'
various GDK cleanups

See merge request GNOME/gtk!1920
2020-05-17 16:57:52 +00:00
Timm Bäder
a4bb81b61c inspector: Apply toplevel transform before snapshotting overlays 2020-05-17 15:30:44 +02:00
Matthias Clasen
38af49d4fd inspector: Take surface transform into account 2020-05-17 02:10:56 -04:00
Matthias Clasen
c5b2bbf01b inspector: Use tabular numbers in the fps overlay
It is a lot more readable if it doesn't constantly jitter.
2020-05-15 21:30:14 -04:00
Matthias Clasen
8912a6eb75 gtk: Handle seatless displays
If you run weston with the headless backend, you get a Wayland
display with no seat, which is just fine by the protocol.

gdk_display_get_default_seat() returns NULL in this case. Various
widgets assume that we always have a seat with a keyboard and a
pointer, since that is what X guarantees. Make things survive
without that, so we can run the testsuite under a headless
Wayland compositor.
2020-05-15 14:11:53 -04:00
Matthias Clasen
4c8688b846 inspector: Disable recursive inspection
We can't inspect the inspector, it doesn't work.
Therefore, disable the keybindings in the
inspector window.
2020-05-13 18:56:25 -04:00
Benjamin Otte
d9c0d98871 inspector: Use the monitor list to list monitors 2020-05-13 07:49:56 +02:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
88141103cd Don't use container api on GtkListBox 2020-05-11 22:21:39 -04:00
Matthias Clasen
025375ff5f Replace gtk_widget_destroy everywhere
Replace all remaining uses of gtk_widget_destroy
by gtk_container_remove or g_object_unref.
2020-05-11 12:20:59 -04:00
Matthias Clasen
cd0081d08a Use gtk_window_destroy
Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
2020-05-11 12:20:57 -04:00
Matthias Clasen
92bcf4c7a7 inspector: Stop using ::size-allocate
This signal is going away. Currently, there is no
other way for the inspector to monitor the allocation.
2020-05-06 14:27:45 -04:00
Matthias Clasen
81c68b86ea inspector: Fix css tree popovers
Adding popovers to a treeview doesn't work. Instead,
attach them to the cssnodetree widget, which is using
a layout manager - popovers work in that case.
2020-05-05 23:51:37 -04:00
Matthias Clasen
3c165b3b77 Drop GtkBin
It is no longer used anywhere.
2020-05-04 22:53:08 -04:00
Matthias Clasen
8d0773fad0 inspector: Derive recorder from GtkWidget 2020-05-04 22:53:08 -04:00
Matthias Clasen
12ecbd1508 listboxrow: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
f59f355190 Use gtk_window_set_child throughout
Replace all uses of gtk_container_add on windows
by gtk_window_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
af6e0ee2b3 Use gtk_button_set_child throughout
Replace all uses of gtk_container_add on buttons
by gtk_button_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
67759d4c3e Use gtk_scrolled_window_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_scrolled_window_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
8e261056b9 Use gtk_popover_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_popover_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
e9ddf0fda5 Use gtk_viewport_set_child throughout
Replace all uses of gtk_container_add on viewports
by gtk_viewport_set_child.
2020-05-04 17:01:18 -04:00
Matthias Clasen
1706b80815 Use gtk_frame_set_child throughout
Replace all uses of gtk_container_add for
frames with gtk_frame_set_child.
2020-05-04 17:01:18 -04:00
Matthias Clasen
5f01f6f36b Drop GtkStack:homogeneous
We have hhomogeneous and vhomogeneous properties
that can be set individually.

Fixes: #2673
2020-04-28 20:00:12 -04:00
Matthias Clasen
5477c1cdfe inspector: Show the media backend 2020-04-28 00:37:54 -04:00
Matthias Clasen
2dfd1404ff inspector: Make the resource tab play videos
We can do this easily, so why not. This can be
seen in action with gtk-logo.webm, e.g. in gtk4-demo.
2020-04-26 14:08:40 -04:00
Matthias Clasen
b339bde6a5 inspector: Use the new scroll-to-focus 2020-04-18 14:43:48 -04:00
Matthias Clasen
df1816a29c button: Drop relief
We are only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
285aa226e5 scrolledwindow: Drop shadow-type
We were only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
726a7ac705 inspector: Fix a crash
Don't crash while picking. The event signal broke
when GdkEvent was turned into a type instance,
since the automatic marshallers don't know how to
deal with that. Manually set the right marshaller.
2020-04-17 08:37:45 -04:00
Matthias Clasen
f97180beee inspector: Show scales other than 2
We were hardcoding that monitor scales can only be
1 or 2. Not true.
2020-04-13 09:17:46 -04:00
Matthias Clasen
394ea32e93 Use gtk_widget_add/remove_css_class more
Replace most uses of gtk_style_context_add/remove_class
by the new APIs. The only remaining uses of the old API
are in save/restore situations.
2020-04-10 12:09:57 -04:00
Matthias Clasen
97ff1b83dc widget: Make the :has-focus property readonly
The only place where this should be set is when making
a widget the focus-widget of a window. We still keep
the property around in readonly form, since there are
a few places where we rely on property notification
for it.
2020-04-09 17:50:29 -04:00
Matthias Clasen
b3b29e37fd inspector: Drop more uses of can-focus 2020-04-09 17:50:29 -04:00
Matthias Clasen
f996ba6585 inspector: Remove can-focus from ui files 2020-04-09 17:50:29 -04:00
Emmanuele Bassi
d701a89281 Turn GskRenderNode into a derivable type
Language bindings—especially ones based on introspection—cannot deal
with custom type hiearchies. Luckily for us, GType has a derivable type
with low overhead: GTypeInstance.

By turning GskRenderNode into a GTypeInstance, and creating derived
types for each class of node, we can provide an introspectable API to
our non-C API consumers, with no functional change to the C API itself.
2020-04-08 15:40:15 +01:00
Matthias Clasen
c297d45b8a gtk: Stop using modifier intents
Reviewing the existing settings, the only backend with
some differences in the modifier intent settings is OS X,
and we would rather have that implemented by interpreting
the existing modifiers in the appropriate way.

                X11      Wayland  Win32    OS X

primary         ctrl     ctrl     ctrl     mod2
mnemonic        alt      alt      alt      alt
context menu    -        -        -        ctrl
extend sel      shift    shift    shift    shift
modify sel      ctrl     ctrl     ctrl     mod2
no text         alt|ctrl alt|ctrl alt|ctrl mod2|ctrl
shift group     varies   -        -        alt

GTK now uses the following modifiers:

primary         ctrl
mnemonic        alt
extend sel      shift
modify sel      ctrl
no text         alt|ctrl

The context menu and shift group intents were not used
in GTK at all.

Update tests to no longer expect <Primary> to roundtrip
through the accelerator parsing and formatting code.
2020-04-06 16:32:03 -04:00
Matthias Clasen
c90b0581dd inspector: Show shortcuts
At a tab that lists the shortcuts contained in a
GtkShortcutController.
2020-03-25 23:14:44 -04:00
Timm Bäder
3b2adf5d1f inspector: Fix child widget life cycle
unparent them in dispose
2020-03-24 10:44:06 +01:00
Matthias Clasen
fd58b116cf inspector: Make picking work again
We used to either make the inspector see- and click-thru
or lower it, but sadly translucency broke after we
removed surface opacity, and lowering doesn't work
on Wayland. So just hide the inspector window while
we are picking.

Fixes: #2528
2020-03-21 09:42:58 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Matthias Clasen
f5134a833c inspector: Show shortcuts
At a tab that lists the shortcuts contained in a
GtkShortcutController.
2020-03-18 23:00:51 -04:00
Matthias Clasen
513eb11c7c inspector: Stop raising and lowering windows
We should always be composited, so this should not
matter in practice.
2020-03-11 19:35:56 -04:00
Matthias Clasen
8f87555176 inspector: Fix the "Software GL" switch
This was crashing.
2020-02-28 14:42:19 -05:00
Matthias Clasen
90376d6d6e Fix a leftover occurrence of ::expand 2020-02-26 19:31:25 -05:00
Matthias Clasen
37a2cae10e Small fixups
Trying to get the ci style test to pass.
2020-02-26 08:13:45 -05:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7 Drop the expand property
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Timm Bäder
0bca4a276a inspect-button: Use new gtk_window_set_extra_input_region 2020-02-25 14:18:24 +01:00
Timm Bäder
dae06d82ae inspector: Remove double borders in recorder 2020-02-25 11:08:25 +01:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Emmanuele Bassi
063ad28b1a Remove overwrite confirmation machinery from GtkFileChooser
Overwrite confirmation should not be optional, and it should not loop
into application code to create their own dialog and user response.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
5f070ff233 Remove filename/URI API from GtkFileChooser
GtkFileChooser's API predates GIO by a few years, so it started off with
filenames and URI as character arrays. After introducing GIO as a
dependency, the API included GFile-based entry points.

It's much more appropriate to use GFile everywhere, as we want to
encourage people to use GIO instead of passing random bytes to low level
POSIX API.

See: #2455
2020-02-22 15:22:06 +00:00
Matthias Clasen
b1eaa502df events: reorganize getters
Restructure the getters for event fields to
be more targeted at particular event types.

Update all callers, and replace all direct
event struct access with getters.

As a side-effect, this drops some unused getters.
2020-02-21 00:51:03 -05:00
Benjamin Otte
c1f71ee3e8 window: Remove GtkWindowType and window->type
And remove code that was making decisions on the type and just use
the part for toplevels.
2020-02-14 21:18:49 +01:00
Matthias Clasen
4a978dc8c4 inspector: Draw baselines as an overlay 2020-02-10 00:10:43 -05:00
Matthias Clasen
a46f9af1c0 Remove primary monitor api
We only have implementations of this on X11 and Win32,
so make it available as backend api there.

Update all callers to use either the backend api, or
just monitor 0.
2020-01-30 21:33:37 +01:00
Alexander Larsson
6a15e9169d Rename GtkIcon widget to GtkBuiltinIcon
This is an internal widget whose name is not very important, and we
want to rename GtkIconInfo to GtkIcon, so lets rename this.
2020-01-30 10:53:33 +01:00
Matthias Clasen
10e4c04e61 Use style values directly
Replace uses of gtk_css_style_get_value with direct access,
throughout the tree. We don't replace all uses, just those
where we are dealing with a fixed property. Be careful to
handle the currentColor special case for color properties.
2020-01-29 11:07:32 +01:00
Benjamin Otte
146b921246 cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.

As a side effect we also save 64 bytes per declaration.
2020-01-28 02:17:03 +01:00
Matthias Clasen
92cfc03821 inspector: Avoid an array overrun
Commit 3f56af3738 added a new value to the
GdkInputSource enum, forgetting that the inspector
has an array of names to match this enum.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2385
2020-01-18 11:49:16 -05:00
Matthias Clasen
7ee5779efc gtk: Remove menu code
GtkMenu, GtkMenuBar, GtkMenuItem and their subclasses
and supporting classes are replaced by model-based popover
implementations.
2019-12-29 20:31:58 -05:00
Matthias Clasen
b59521bb82 inspector: Remove menu special-casing 2019-12-29 20:31:58 -05:00
Matthias Clasen
6b89d8a199 inspector: Add a focus overlay
It helps to see what is going on.
2019-12-27 17:35:09 -05:00
Matthias Clasen
280bdb0567 inspector: Fix a small memory leak
We were leaking overlays.
2019-12-25 09:47:22 -05:00
Matthias Clasen
1a94e5fb0e inspector: Fix a small memory leak
The property editor was leaking a few GValues.
2019-12-25 09:47:22 -05:00
Matthias Clasen
b6cfe59460 inspector: Small cleanup 2019-12-25 09:47:22 -05:00
Matthias Clasen
442f13ef6f inspector: Give better advice
Provide the meson syntax for building a debug-enabled GLib.
2019-12-21 21:09:18 -05:00
Matthias Clasen
92ab450983 inspector: Avoid critical warnings
We were still using this but it's not defined in the UI xml.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2295
2019-12-07 19:39:02 -05:00
Matthias Clasen
c89c652401 inspector: Make the css tree respect inspected display
The display is used here to force reparsing the theme
on the right settings object.
2019-12-07 18:07:44 -05:00
Matthias Clasen
f0f57d156b inspector: Make logs respect inspected display 2019-12-07 18:07:05 -05:00
Matthias Clasen
cecf4f2763 inspector: Make inspect button use inspected display
This may not matter, but just for cleanliness.
2019-12-07 18:07:05 -05:00
Matthias Clasen
4eeed47c7b inspector: Make general respect inspected display 2019-12-07 18:07:05 -05:00
Matthias Clasen
bd1f7e057a inspector: Make visual settings respect the inspected display
This is not quite complete, GTK and GSK debug flags
are not per display, and slowdown and text direction
are not either.
2019-12-07 18:07:05 -05:00
Matthias Clasen
174d8b72a5 inspector: Make css editor respect inspected display
Stop using gdk_display_get_default and use the
inspected display instead.
2019-12-07 18:07:05 -05:00
Matthias Clasen
1437b0856c inspector: Make object tree respect inspected display
Stop using gdk_display_get_dfault and use the
inspected display instead.
2019-12-07 14:59:49 -05:00
Matthias Clasen
a207a4b3cd inspector: Attach inspector window to display
Give the inspector window a ::inspected-display
property, and pass a display when obtaining an
inspector window. Update the caller.
2019-12-07 14:59:49 -05:00
Matthias Clasen
baacd9efbf inspector: Init yourself
No need to have GTK call this from the outside.
2019-12-07 14:59:49 -05:00
Matthias Clasen
abde37a4d7 inspector: Cleanup
Remove an unused enum.
2019-12-07 14:59:49 -05:00
Matthias Clasen
d4180931f8 Merge branch 'seal-popover-menu' into 'master'
Privatize popover menu pieces

See merge request GNOME/gtk!925
2019-11-18 01:57:55 +00:00
Timm Bäder
c2306d3ba6 inspector: Select an object when activating it 2019-11-14 09:15:58 +01:00
Matthias Clasen
bfa0509f08 Privatize popover menu pieces
Don't allow manual creation of popover menus
anymore. This lets us also make GtkModelButton
private
2019-11-11 12:42:06 +01:00
Matthias Clasen
745a701b3d inspector: Add a switch for fallback rendering 2019-10-30 22:31:47 -04:00
Matthias Clasen
03738634ac inspector: Remove fallback from logs
There are no logs that this debug flag produces.
2019-10-30 22:31:47 -04:00
Timm Bäder
44137574a1 inspector: Fix expander arrow node names
They vanished after the GtkExpander node rename
2019-10-22 09:37:08 +02:00
Timm Bäder
e5de03144f inspector: Don't add padding to spinbuttons
That looks stupid.
2019-10-09 16:57:22 +02:00
Timm Bäder
7c723dfc58 inspect-button: Inline deemphasize_window() into only caller 2019-09-09 17:36:25 +02:00
Timm Bäder
72814a8153 inspect-button: Inline some functions into only caller
Make them clearer for later commits.
2019-09-09 17:36:25 +02:00
Timm Bäder
4bfe8605cb layoutoverlay: Fix everything
This code is better because:

  1) The coordinates translations are actually correct and not sometimes
     wrong like before
  2) We clip widgets that have overflow set
  3) We honor the widget's transform
  4) It is less code
2019-09-09 17:36:25 +02:00
Matthias Clasen
7eb5dfd294 inspector: Show the pango backend 2019-07-28 11:39:16 -04:00
Timm Bäder
58e6c277b0 fpsoverlay: Fix fps overlay position 2019-07-10 18:34:16 +02:00
Matthias Clasen
a515fca63f inspector: Fix actions visibility
We need to always hide the page when setting
an object, otherwise the initial visibility
sticks.
2019-06-20 22:49:22 -04:00
Matthias Clasen
b6baa15e0a inspector: Use event controller names
Use these in the same place we use widget names.
2019-06-20 22:48:42 -04:00
Matthias Clasen
bda5a8214b inspector: Don't duplicate popovers
Popovers are now regular children in the widget
tree, no need to duplicate them as toplevels
in the object tree.
2019-06-16 23:03:27 -04:00
Matthias Clasen
3ad8797068 inspector: Add a refresh button for actions
Action state updates may not always be precise.
2019-06-16 23:03:19 -04:00
Matthias Clasen
2457ed03c2 inspector: Fix centering of subtitles 2019-06-16 23:03:12 -04:00
Matthias Clasen
44970b5182 inspector: Fix actionable handling 2019-06-15 21:40:28 -04:00
Matthias Clasen
00c828e752 inspector: Redo the action page
Instead of iterating action groups manually,
just show what the action muxer provides. This
gives an accurate view of what actions are
available in a widgets context, and saves us
the trouble of juggling prefixes manually.
2019-06-15 21:40:22 -04:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
211128fb7c inspector: Stop deriving from scrolled window 2019-05-28 22:35:36 +00:00
Matthias Clasen
a4b1ff7736 Forgotten file 2019-05-28 22:35:36 +00:00
Matthias Clasen
908632138c inspector: Show surface and renderer 2019-05-28 20:25:17 +00:00
Matthias Clasen
db21cbdfb3 inspector: Avoid a critical warning 2019-05-28 20:25:16 +00:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
6ab8ab87c8 Reimplement GtkPopover 2019-05-28 20:25:13 +00:00
Matthias Clasen
c1d5e82d95 Use GtkNative APIs instead of GtkRoot 2019-05-28 20:24:39 +00:00
Benjamin Otte
0cd8dd4294 inspector: Make updates overlay not crash
... when a window gets hidden and later reshown.

The code now properly cleans up a window when it gets unmapped instead
of trying to retain previous updates information.
2019-05-25 22:32:35 +02:00
Benjamin Otte
a1d08b4b52 rendernode: Take a graphene_point_t for the offset
... instead of 2 floats.
2019-05-21 06:43:59 +02:00
Matthias Clasen
5327799046 inspector: Don't apply button api to menu buttons 2019-05-20 23:33:45 +00:00
Matthias Clasen
0eb7784785 Update all users for menubutton changes 2019-05-18 13:06:32 +00:00
Matthias Clasen
97b450dfd7 Improve the action editor more 2019-05-08 03:34:14 +00:00
Matthias Clasen
46c1e154f1 inspector: Fix showing the frame clock
We want to go to the object, not just select it
in the list (which does not even contain frame clocks).
2019-05-08 02:44:24 +00:00
Matthias Clasen
4cc27285b1 inspector: Port actions to a list view 2019-05-08 02:20:50 +00:00
Matthias Clasen
e1c1c46e34 inspector: Style the property list
Make the property list look more like a list.
2019-05-07 22:04:41 +00:00
Matthias Clasen
eff4b6377d Merge branch 'inspector-menus' into 'master'
inspector: Fix showing of menus

See merge request GNOME/gtk!810
2019-05-02 02:12:28 +00:00
Matthias Clasen
c7df0c907a inspector: Fix showing of menus
We were hitting an assertion in some leftover
code that assumed property editors are popovers.
2019-05-02 02:05:46 +00:00
Matthias Clasen
cd5c39834d inspector: Show the default.activate action
We were hardcoding that GtkApplicationWindow only
has a single action group with prefix 'win', but
that is no longer the case. Simply use the code
for the general widget case that can handle multiple
action groups.
2019-05-02 01:53:57 +00:00
Matthias Clasen
0fa4d54316 inspector: Track readonly property values
That a property can't be set does not mean
its value can't change. This was showing up
as the cursor-position and selection-bound
properties in GtkText not showing their
current value in the inspector.
2019-05-01 04:57:54 +00:00
Matthias Clasen
e7cbb7a76c inspector: Don't listen for notify twice
The property list now uses property editors
for the value, which listen for updates by
themselves, so no need for the list to do it.
2019-05-01 04:44:07 +00:00
Matthias Clasen
8880d27460 inspector: Stop showing default widget in misc
This is just a regular window property now,
no need for special casing.
2019-04-28 23:23:11 +00:00
Matthias Clasen
b6c1786165 inspector: Make property list sortable again
We lost this when moving from a treeview to
a listbox. Bring it back, with homegrown list
headers.
2019-04-28 21:56:10 +00:00
Matthias Clasen
68d6c51dbc inspector: Use the new show-separators property
Add separators to the list boxes on the Settings page.
2019-04-12 20:25:54 -04:00
Matthias Clasen
9a1da43890 inspector: Fix editing in the property list
The type-to-search was interfering with using
entries in the list. Avoid that by watching
where the focus is.
2019-04-12 19:48:23 -04:00
Matthias Clasen
a2db956492 inspector: Show readonly property values 2019-04-12 15:08:01 -04:00
Matthias Clasen
8d51038cb1 inspector: Cosmetics 2019-04-12 15:08:01 -04:00
Matthias Clasen
86c86e0860 inspector: Revamp attribute and action info
This also needs to be turned into single-line data.
2019-04-12 15:08:01 -04:00
Benjamin Otte
2e0a56665a css: Move gtkcsssection.[ch] into gtk/css 2019-04-12 19:34:28 +02:00
Benjamin Otte
04d24b7cd2 csssection: Make printing functions public 2019-04-12 19:34:28 +02:00
Benjamin Otte
a8f712b09a cssection: Return locations, not numbers
Now that we have GtkCssLocation, actually use it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Matthias Clasen
42ea95c54e inspector: Modernize action references
Now that we do inline editing, we need to
show this in a single line.
2019-04-12 13:01:19 -04:00
Matthias Clasen
46e7b44ffa inspector: Drop binding info
Thia was relying on non-public implementation details
and was broken since 2015.
2019-04-12 12:35:06 -04:00
Matthias Clasen
fde21b57cd inspector: Improve property list editing
Replace the treeview with popups on the property
page with a listbox with inline editing.
2019-04-12 11:12:55 -04:00
Matthias Clasen
0842d084dd inspector: Cometic fixes for controllers
Add a frame, and make the rows not activatable.
2019-04-11 22:28:15 -04:00
Matthias Clasen
838b25177f inspector: Make rows activatable
Rows containing just a switch should be activatable,
and toggle the switch.
2019-04-11 22:06:16 -04:00
Matthias Clasen
b39d0cec3c inspector: Fix css autosave
We were creating the directory with improper permissions.
2019-04-11 19:39:44 -04:00
Matthias Clasen
ef982b7d46 Rename things
Rename the can-pick property to can-target,
and redo the pick flags with more descriptive names.
2019-04-08 08:42:25 -04:00
Matthias Clasen
0e15b4a367 inspector: Allow picking insensitive widgets again
Use the new argument to gtk_widget_pick to allow picking
insensitive widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/51
2019-04-07 17:23:17 +00:00
Matthias Clasen
b804235aea Add a flags argument to gtk_widget_pick
This will be used to let the inspector and other users
pick insensitive widgets again. For now, update all
callers to pass no flags, preserving the current
behavior.
2019-04-07 17:19:09 +00:00
Matthias Clasen
a0e6353667 inspector: Disable autoloaded custom css initially
This is a safeguard against possible crashing css
being autoloaded.
2019-04-06 23:08:10 +00:00
Matthias Clasen
721a12826d inspector: Warn if using the default display 2019-04-06 18:19:40 +00:00
Matthias Clasen
4b40cc27a9 inspector: Autosave css
Save and restore the contents of the css editor in a file.
2019-04-06 18:00:09 +00:00
Matthias Clasen
c92e53622f inspector: Rearrange settings a bit
Keep only the software gl setting for GL, and put it together
with the simulate touchscreen setting in a 'misc' box. This
keeps all the 'show' options nicely grouped.
2019-04-06 17:39:00 +00:00
Matthias Clasen
c31185b419 inspector: Clean up on finalize
Just a matter of cleanliness.
2019-04-06 16:53:35 +00:00
Matthias Clasen
5ff59c12b0 inspector: Fix a copy-paste error
We were stuffing the layout overlay into the updates_overlay
field, leaving the layout_overlay field unused.
2019-04-06 16:53:35 +00:00
Matthias Clasen
cb3d61bb0e inspector: Avoid a critical
If a layout manager does not have layout children,
quietly hide the layout page.
2019-04-05 19:44:16 +00:00
Matthias Clasen
ef9dc43474 Show layout children in the inspector 2019-04-05 19:15:55 +00:00
Matthias Clasen
7a29462ca6 Fix the inspector
One of the inspector ui files was still using
child properties.
2019-04-05 14:41:46 -04:00
Zander Brown
e493b9b702
inspector: Type info for misc pane
Replaces the class hierarchy page with a button/popover on the misc page
2019-04-03 23:50:24 +01:00
Carlos Garnacho
dc88a1ebc4 inspector: Fix prop-list search
Instead of handle_event(), use set_key_capture_widget().

Also, use the fact that we now propagate key events throughout the
stage, and connect to the GtkInspectorPropList instead of the toplevel.
We only want the search bar to be active while that widget is mapped
and able to receive events.

And also, handle the "search bar" visibility on ::search-started.
2019-04-03 13:23:34 +02:00
Matthias Clasen
cf3aa570c2 inspector: Rename a few pages
"Global" and "Visual" are not very good names for
the content of these pages. Rename them to
"Information and "Settings".
2019-04-02 23:36:45 +00:00
Matthias Clasen
7c2ce72b5f inspector: Manage visibility of stack pages
The hand-rolled stack combo we were using before
was looking at the visibility of the page itself
to show or hide items. Other stack switchers
expect us to use the GtkStackPage::visible
property for this.
2019-04-02 23:36:45 +00:00
Matthias Clasen
5371055495 inspector: Redo the object page switcher
The combobox for page switching was not very good.
Instead, do a sidebar that can be hidden.
2019-04-02 23:29:22 +00:00
Matthias Clasen
4d6acd5d76 inspector: Drop the child property page
Child properties are on the way out.
2019-04-02 23:08:17 +00:00
Matthias Clasen
285e67c044 inspector: Drop the class hierarchy page
This was just  not useful enough to keep around.
2019-04-02 21:50:09 +00:00
Matthias Clasen
d7987e73c9 inspector: Drop the css selector page
This was just not useful enough to keep around.
2019-04-02 21:47:02 +00:00
Matthias Clasen
e13a8102b4 inspector: Drop the signals page
This was just not useful enough to keep around.
2019-04-02 21:39:47 +00:00
Matthias Clasen
12c4766dd0 inspector: Properly clean up
I got a crash in inspector code when I hit
cancel in the confirmation dialog for it.
2019-04-02 21:21:46 +00:00
Matthias Clasen
c0aaa43122 Rename gdk_device_get_surface_at_position_double
We can drop the double suffix now.
2019-03-26 18:12:55 -04:00
Matthias Clasen
562cc8b9ab gtk: Stop using gtk_device_get_surface_at_position
We should always use the double variant of the api.
2019-03-26 18:12:55 -04:00
Matthias Clasen
21580309d3 Rename gdk_surface_get_device_position_double
Drop the _double suffix, now that the int version is gone.
2019-03-26 18:12:54 -04:00
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Matthias Clasen
d279c666a9 inspector: Stop using ::set-focus
The focus-widget is just a regular property now that shows
up on the property page. No need to special-case it on
the misc page anymore.
2019-03-16 21:24:44 -04:00
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Benjamin Otte
3cc84d2860 transform: Make category public API
Also rename it from GskMatrixCategory to GskTransformCategory.
2019-03-04 23:15:24 +01:00
Benjamin Otte
3a3c2d14ab rendernode: Make the transform node take a GskTransform
This is an attempt to push GskTransform deeper into the stack.
2019-03-04 23:15:07 +01:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
9861887f1a inspector: Avoid grabs for inspecting
Instead of using a grab on a GtkInvisible, use
a hook in the GTK event propagation machinery to
get events.

The only downside of this approach is that we
lose the crosshair cursor. But we get rid of
the last use of GtkInvisible.
2019-02-24 09:41:13 -05:00
Matthias Clasen
704e377fae inspector: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
2019-02-23 22:24:50 -05:00
Matthias Clasen
47249431e3 inspector: Stop using ::hierarchy-changed
Use the new root and unroot vfuncs instead.
2019-02-23 09:43:57 -05:00
Timm Bäder
9d0e8b85c1 inspector: Fix an uninitialized value warning 2019-02-22 19:22:58 +01:00
Benjamin Otte
d8482edaf5 layoutoverlay: Use new snapshot transforms 2019-02-21 19:47:28 +01:00
Benjamin Otte
baefee17c5 fpsoverlay: Use new snapshot transforms 2019-02-21 19:47:28 +01:00