Commit Graph

540 Commits

Author SHA1 Message Date
Benjamin Otte
266fd36f3f inspector: Port to GdkMonitor 2016-10-16 18:17:21 +02:00
Matthias Clasen
0d00e0c3d3 Fix the build 2016-10-10 14:37:09 -04:00
Adam Jackson
434ce02ebe Use eglGetPlatformDisplay{,EXT} if available
Calling eglGetDisplay forces libEGL to guess what kind of pointer you
passed it. Different EGL libraries will do different things here, and in
particular glvnd will do something different than Mesa. Since we do have
an API that allows us to explicitly type the display, use it.

The explicit call to eglGetProcAddress is working around a bug in
libepoxy 1.3, which does not understand the EGL concept of client
extensions. Since it does not, the normal epoxy resolver for
eglGetPlatformDisplayEXT would not find any provider for that entry
point, and crash when you attempted to call it.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:17:09 -04:00
Adam Jackson
3b11575f0b Fix some EGLDisplay * abuse
EGLDisplays are already opaque pointers, and eglGetDisplay returns an
EGLDisplay not a pointer to one.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:17:09 -04:00
Matthias Clasen
74f3d7f6d3 Switch gettext domain from gtk30 to gtk40 2016-10-07 10:34:50 -04:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Timm Bäder
a985e62b25 Use gtk_popover_popdown/popup where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=769706
2016-08-16 11:49:26 -04:00
Matthias Clasen
8430be75ed Fix an array overrun
When I introduced the new input source enum value for
track points, I forgot that there is a fixed-size array
with names for those in the inspector.
2016-06-23 15:47:47 -04:00
Matthias Clasen
57d00e004a inspector: Ellipsize accessible description.
This string can be long, and we don't want to break the ui
2016-06-05 20:56:52 -04:00
Chun-wei Fan
092cb9e202 GTK: Fix build for pre-C99 compilers
Some compilers we support, such as pre-2013 Visual Studio, does not support
for INIFINITY, log2() and exp2(), so check for exp2() and log2() during
configure, and use fallbacks for them and INIFINTY if they are not found.

https://bugzilla.gnome.org/show_bug.cgi?id=766207
2016-05-10 17:14:07 +08:00
Matthias Clasen
3952bd60a5 inspector: Port to new monitor api
Adapt to new monitor apis, and show more information.
2016-04-27 23:18:16 -04:00
Paolo Borelli
6225d435e6 inspector: do not leak seat capabilities descriprion
Factor out an utility function for readability and free the string
with the list of capabilities
2016-04-24 17:49:26 +02:00
Matthias Clasen
8a2061f581 inspector: Don't lie with statistics
If we don't have statistics, despite GOBJECT_DEBUG being set,
explain how to fix this.
2016-04-14 22:52:59 -04:00
Matthias Clasen
abff6e23c0 inspector: simplify some code 2016-04-09 15:48:34 -04:00
Matthias Clasen
af1c873bca inspector: Use GdkAxes instead of GdkAxisUse 2016-04-09 12:14:33 -04:00
Matthias Clasen
d83ad00f9e inspector: Add an origin mark to the slowdown scale
Makes it easier to get back to the original speed.
2016-04-09 11:56:08 -04:00
Matthias Clasen
e6c408c08a inspector: Give the font scale an entry
This matches what Matt did for the slowdown.
2016-04-09 11:56:08 -04:00
Matt Watson
46b120b35e inspector: add slider to control slowdown factor 2016-04-08 16:09:29 -07:00
Christoph Reiter
72346cb209 inspector: add slider for adjusting the font scale
https://bugzilla.gnome.org/show_bug.cgi?id=761435
2016-03-25 16:10:28 -04:00
Matthias Clasen
65927caf84 inspector: Look for themes in system data dirs
This matches what GTK+ does now.
2016-03-22 08:22:48 -04:00
Matthias Clasen
7cb36aba40 Load theme settings from the right location
When loading a per-theme settings.ini file, look for it in
the same directory where we found the gtk.css file for the
theme. Previously, we were always looking in
$prefix/share/themes/THEME/gtk-3.0/, even if the css was
loaded from somewhere else.

https://bugzilla.gnome.org/show_bug.cgi?id=641354
2016-03-21 22:19:19 -04:00
Matthias Clasen
5e68c4e62d inspector: Reset the treewalk when required
The tree walk holds a tree iter, which will become invalid
when we either remove the row that it points to or remove
all rows.

Reset the tree walk in those cases to avoid a crash that
was pointed out by Bastien Nocera.
2016-03-11 13:53:57 -05:00
Matthias Clasen
2e34ce8f7c inspector: Add api to get the current tree walk position
This will be used in the next commit.
2016-03-11 13:53:57 -05:00
Benjamin Otte
eeb945e4c1 inspector: Widgets update automatically when CSS changes
There's no need to force-invalidate their CSS.
2016-03-11 17:00:41 +01:00
Matthias Clasen
97250ea5e6 inspector: Add a switch for the layout debug flag 2016-03-11 00:22:36 -05:00
Matthias Clasen
2b773e07e3 inspector: Show the frame clock in misc
There is no convenient way to get a handle on the frame clock,
otherwise, and the frame clock object is where we show the frame
rate...
2016-03-10 16:21:35 -05:00
Matthias Clasen
30faa9a2a9 inspector: Refine strv editor
Put some spacing between the rows, and link the buttons to
the entries they belong to.
2016-03-09 21:59:43 -05:00
Matthias Clasen
6e9fd6832a inspector: Do a better job with readonly properties
Say if they are non-writable or construct-only, and also
gray out construct-only properties in the list.
2016-03-09 21:59:43 -05:00
Matthias Clasen
c24cc63523 inspector: Minor refactoring
Break out some functions in prop-editor.c
2016-03-09 21:59:43 -05:00
Matthias Clasen
c1c8a861aa inspector: Redo property lists a bit
Break out value types as a separate column, to make the
value column more readable.
2016-03-09 21:59:43 -05:00
Matthias Clasen
0c929b7124 inspector: Avoid overflow when editing doubles
The adjustment double properties allow values from -G_MAXDOUBLE
to G_MAXDOUBLE, which leads to overflow when calculating
max - min / 10. To avoid that, simply use a fixed page_size of 1.0.
2016-03-09 21:59:43 -05:00
Matthias Clasen
6af8e9f3cc inspector: Wording changes
Align the property nicks of GtkCssNode with the column names
in the inspector node tree.
2016-03-09 19:29:58 -05:00
Matthias Clasen
f23c77b14b inspector: Some more cleanup
The last commit left some unused functions behind.
2016-03-09 19:29:58 -05:00
Matthias Clasen
e5a5f0a59a inspector: Remove an unncessary context menu
Now that we have the style properties on the same page again,
we don't need the context menu anymore.
2016-03-09 19:29:58 -05:00
Matthias Clasen
aa193ce4a4 inspector: UI refresh
The sidebar in the object page was using up more space than it deserves.
Replace it with a combo box in the subheader. Now that we have more space,
put the CSS node tree and the style properties in the same page again.
2016-03-07 00:24:15 -05:00
Matthias Clasen
4b5bcdeaa5 inspector: Drop the per-object CSS editor
The global editor is good enough for all uses.
2016-03-06 21:41:46 -05:00
Matthias Clasen
251810ff40 inspector: Avoid pointless selections
The CSS selector and the class hierarchy are purely
informative, no need to select anything here.
2016-03-05 00:35:08 -05:00
Matthias Clasen
e69c1c5a9b inspector: More grid lines
I had forgotten the css property list.
2016-03-05 00:34:39 -05:00
Matthias Clasen
360bad6865 inspector: Some ui refinements
Remove pointless expanders from lists, add grid lines and,
in some places, tree lines.
2016-03-05 00:29:06 -05:00
Matthias Clasen
8b93c013c3 inspector: Simplify general tab setup
Factor out the code to create a listbox row with two labels,
and use it throughout.
2016-02-25 20:49:09 -05:00
Matthias Clasen
4f5f299266 inspector: React to device changes
Recreate the device section in the general tab when
devices come or go.
2016-02-25 20:28:23 -05:00
Ignacio Casal Quinteiro
53fe9c2b0c inspector: use guint to fix the windows build 2016-02-25 15:25:19 +01:00
Matthias Clasen
fe4602acc5 inspector: Show ::num-touches for touch devices
This can be useful information.
2016-02-25 08:27:08 -05:00
Matthias Clasen
84ba01d713 inspector: Update for screen config changes
Repopulate the display section whenever the monitor configuration
changes.
2016-02-25 01:22:01 -05:00
Matthias Clasen
15ccdcd25b inspector: Don't show numeric ids
The vendor and product ids for input devices aren't useful
as-is; need to figure out how to translate them to names.
2016-02-25 01:10:23 -05:00
Matthias Clasen
455935a06a inspector: Show more device information
This adds vendor and product id and axes. This reveals that
the GDK backends have quite different quality when it comes
to returning meaningful information here.
2016-02-25 00:49:50 -05:00
Matthias Clasen
03db14c2d6 inspector: Show some basic device information
Add information about seats and their associated devices
in the General tab.
2016-02-25 00:17:09 -05:00
Matthias Clasen
13e5e83798 Add message contexts to translated strings
The string "None" is used in multiple contexts; add message contexts
to give translators a chance to translate them accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=762165
2016-02-16 18:33:16 -05:00
Benjamin Otte
f5d4fb1a0b inspector: Don't use unused variables
Windows-specific refactorings broke this.
2016-02-11 04:14:56 +01:00
Benjamin Otte
76e56c5038 win32: Stop using _gdk_display global in device code
Use gdk_device_get_display() instead.
2016-02-11 03:44:47 +01:00
Timm Bäder
8ea573b473 css node tree: Fix crash
This function would return "" whenever the state of the css node was
unset, causing a crash when selecting the css node tree from the
sidebar.
2016-02-10 12:28:32 +01:00
Matthias Clasen
dc407dbc8f inspector: Avoid crash in magnifier
We can't use gtk_widget_draw on widgets that are not allocated.
2016-02-08 09:34:24 +01:00
Benjamin Otte
fe6d4cbdf5 inspector: Drop type name from node list
It's not used anymore in the CSS, so people don't need to see it.
2016-02-05 19:31:47 +01:00
Benjamin Otte
b783670820 inspector: Don't hardcode builtin themes
Insteead, enumerate the resources that are available. Fixes windows
themes not being listed in the inspector.
2016-02-04 13:35:21 +01:00
Matthias Clasen
761120a5e2 inspector: Show CSS pseudoclass names for node state
This is a better fit for showing CSS node state, since one
commonly looks at this information to devise CSS selectors,
where the CSS names are needed.
2016-01-24 10:59:46 -05:00
Timm Bäder
d6f989f59c Inspector: Plug a few leaks 2016-01-24 08:01:36 +01:00
Matthias Clasen
57baf6804b inspector: Show baseline value
The misc info page already shows the allocation and clip areas,
the baseline fits right in.
2016-01-22 22:24:46 -05:00
Matthias Clasen
ffc4f8ee11 Forgotten file 2016-01-21 08:18:28 -05:00
Matthias Clasen
e33bda3078 inspector: Show full allocation + clip
Previously, we were only showing the size of the allocation
and clip area. But there is no good reason to hide the position
of these rectangles, so add them, in the traditional format
of X geometry strings: wxh+x+y
2016-01-20 22:52:05 -05:00
Matthias Clasen
449a9c419a inspector: Refine typography
Use thin spaces in the formatting of monitor sizes.
2016-01-20 22:51:25 -05:00
Matthias Clasen
d28959c6db inspector: Make cursor-size combo wider
Cursor sizes typically have 2 digits, lets not clip them.
2016-01-17 13:23:49 -05:00
Matthias Clasen
dc5c82e29c inspector: Don't select 'randomly'
While rescanning the object tree, we were emitting ::object-selected
signals, possibly causing wild blinking in the application window.
Don't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=760572
2016-01-13 23:24:38 -05:00
Matthias Clasen
a45b1d1e3c inspector: Sort themes in the various theme combos
It is nicer if the themes show up in a predictable order,
so sort them alphabetically.
2016-01-07 19:56:05 -05:00
Matthias Clasen
ec02f055ed inspector: Add HighContrastInverse to list of themes 2016-01-07 19:56:05 -05:00
Matthias Clasen
80a91722e5 inspector: Don't leak weak references
These come back to bite us when the inspector is no longer around
at the end of the program.

https://bugzilla.gnome.org/show_bug.cgi?id=759768
2015-12-26 21:42:10 -05:00
Matthias Clasen
787f600d33 inspector: Remove some dead code
Since commit bffeae6203, the
tree path is not used for anything useful anymore, so do away
with it entirely.
2015-12-26 21:42:10 -05:00
Matthias Clasen
6a67df79a8 inspector: Avoid criticals in the css editro
We can't keep text iters around after text buffer has been
changed. Just clear the list errors when the buffer changes
before we've passed it again.
2015-12-20 14:43:14 -05:00
Timm Bäder
e8aa9b0440 Add a way to highlight resizing widgets
https://bugzilla.gnome.org/show_bug.cgi?id=759586
2015-12-18 16:20:19 +01:00
Lionel Landwerlin
776778efc8 inspector: Ensure clip is always shown 2015-12-17 01:14:31 +00:00
Matthias Clasen
117ab50922 inspector: Always show clip
It is less confusing than hiding it sometimes.
2015-12-16 19:24:43 -05:00
Carlos Garnacho
3f7eefb922 inspector: Use seat grabs for the "inspect widget" feature
And remove some usages of GdkDeviceManager API.
2015-12-16 19:47:07 +01:00
Benjamin Otte
26d536a69b inspector: Fix quick-fix
Constructing GtkCssStyleChange objects without styles is forbidden, so
don't do it. Instead untangle the callback from the actual update
function and call that untangled function directly.
2015-12-15 01:15:51 +01:00
Benjamin Otte
971a277419 cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.

This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
2015-12-12 02:16:04 +01:00
Matthias Clasen
0ad259a178 inspector: Hide request mode for non-widgets
Only widgets have a request mode.
2015-12-11 17:12:44 -05:00
Matthias Clasen
326f4739ca inspector: Redo the CSS node page
Showing two lists in a paned was a bit awkward, and space was
getting too limited. Go back to showing just the node list at
first, and make the CSS properties available via a stack. At
the same time, add a right-click context menu to the node list
to make the name and class editing more easily available.
2015-12-06 23:06:33 -05:00
Matthias Clasen
6f1c945010 inspector: Avoid a crash
gkt_cell_layout_get_area may return NULL, handle it.
2015-12-06 17:25:31 -05:00
Matthias Clasen
150728d6b0 inspector: Show the size request mode
This is not a property, so show it in the misc page.
2015-11-30 22:27:27 -05:00
Timm Bäder
df2cb5befc inspector: Leave unneeded widgets out of source files 2015-11-24 11:17:10 +01:00
Matthias Clasen
036ee7a68b inspector: Always underline at least one char
Empty underlines are hard to make out. Since we get somewhat
unreliable section information from the CSS parser, we just
make sure that we always underline at least one character.
2015-11-20 20:59:53 -05:00
Matthias Clasen
df55412ba2 inspector: Fix css warning tags
The builder syntax for tags was invalid here (why did this not
get flagged as error ?!). While we're at it, give the warning
underline a nice, orange color.
2015-11-20 20:35:39 -05:00
Matthias Clasen
ad49103b93 inspector: Show css parsing errors
The squiggly underline is useful, but seeing the error message
is much better, so show it in a tooltip.
2015-11-20 18:18:01 -05:00
Matthias Clasen
e9449f6014 inspector: Don't grow horizontally
Labels in the object tree are application data. Ellipsize them
to avoid growing extremely wide if the data is bogus.
2015-11-10 17:36:33 -05:00
Matthias Clasen
774b6f94d5 inspector: fix a typo 2015-11-10 17:36:23 -05:00
Matthias Clasen
b9613cc416 inspector: Some improvements to the CSS node tree
Set a min-content-height for the property list, and
allow horizontal scrolling.
2015-11-04 00:00:56 -05:00
Matthias Clasen
d077f627ef inspector: Really show the selected CSS node
Try harder to scroll the selected CSS node into view.
2015-11-03 23:55:50 -05:00
Matthias Clasen
c711906f8c inspector: Replace a use of gtk_button_set_focus_on_click
It is deprecated now.
2015-11-03 07:44:17 -05:00
Florian Müllner
e364ae3ea8 Use gtk_widget_set_focus_on_click() instead of deprecated setters
https://bugzilla.gnome.org/show_bug.cgi?id=757269
2015-11-03 07:44:17 -05:00
Benjamin Otte
7cdfee71da inspector: Do not show transient nodes
This is kind of a hack the way it's implemented, but it's necessary
for performance to ignore transient nodes as they get created all the
time (via gtk_style_context_save()) and invalidate the whole treeview.
And that causes resizes and redrawing of the treeview and performance of
the inspector would go down the drain now that we display a larger part
of the node tree.
2015-11-02 20:32:12 +01:00
Benjamin Otte
81de33e906 inspector: Always show full CSS node tree
Just select the node of the current widget whenever a new one gets
selected.
2015-11-02 20:32:12 +01:00
Benjamin Otte
5c53e873b1 inspector: Track updates of node styles
When the CSS style of a node changes, we want to display the new values
in the inspector.

This for example allows to see how styles update on hover or during
animations.
2015-11-01 16:45:11 +01:00
Benjamin Otte
e0f4bf5d35 inspector: Store the current node in the priv struct 2015-11-01 02:42:36 +01:00
Benjamin Otte
b89939f5a4 inspector: Split out a function 2015-11-01 02:42:36 +01:00
Matthias Clasen
b6fda5dc0a inspector: Show CSS node state
This is useful when debugging state propagation issues between
CSS nodes.
2015-10-31 00:07:19 -04:00
Matthias Clasen
af3789bb87 inspector: Drop the style property list
Style properties are now shown for each CSS node in the
CSS node tab, so we don't need a separate per-widget tab
for this.
2015-10-30 06:51:43 -04:00
Matthias Clasen
91af42263b inspector: Drop the style classes list
Style classes can now be added/removed for each CSS node in
the CSS node tab, so we don't need a separate per-widget tab
for this.
2015-10-30 06:51:43 -04:00
Matthias Clasen
37eb5c08a4 inspector: Cosmetic changes to the hierarchy tab
Put the interfaces below GInterface.
2015-10-28 00:41:13 -04:00
Matthias Clasen
3869bdbc2b inspector: Add css node style properties
Add a per-cssnode view of style properties.
2015-10-28 00:33:14 -04:00
Matthias Clasen
ed00d86496 inspector: Allow editing css node properties
This reuses the property editor infrastructure from the
property list pages. Good that css nodes are objects.
2015-10-26 23:39:51 -04:00
Matthias Clasen
6852a1eef9 inspector: Support editing interned string properties
Sadly, interned string properties cannot be handled generically
at all - GObject insists on inserting a strcpy in any attempt
to set a string property with generic api, destroying the
internedness of the string.

Therefore, we have to special-case GtkCssNode in the property
editor code :-(
2015-10-26 23:39:51 -04:00
Matthias Clasen
f55e3f7eda inspector: Be more careful with dead objects
gtk_inspector_object_tree_find_object accesses the type information
of the object, so we can't safely use it on an already decaying
object when we get a weak notify. Instead just walk the tree and
compare pointers, that is safe.

https://bugzilla.gnome.org/show_bug.cgi?id=756852
2015-10-25 13:11:17 -04:00
Matthias Clasen
4305aa1def inspector: Improve css node UI
All the other object pages have a title, this one was missing it.
Add one, so the page fits in with the rest.
2015-10-25 09:20:43 -04:00
Matthias Clasen
1e112ca75e inspector: Allow editing strv-valued properties
These do occur in some places, and we can easily allow editing
them.
2015-10-25 02:14:04 -04:00
Matthias Clasen
e0d9250a07 inspector: Show names for css nodes
Currently, we don't have any css nodes with names, but we will soon.
2015-10-22 20:58:08 -04:00
Sébastien Wilmet
9d3e9c9375 inspector: remove gtk_text_buffer_get_iter_at_line_index() workaround
The function is now safe to use.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-10-16 08:43:27 +02:00
Matthias Clasen
47237ddd94 inspector: Add a reset button for settings
This is exercising the new gtk_settings_reset_property api.

https://bugzilla.gnome.org/show_bug.cgi?id=755008
2015-10-03 22:42:12 -04:00
Matthias Clasen
ac72a9cedc inspector: Ellipsize the accessible name
It can be long, and we don't want the inspector to grow excessively.
2015-09-23 07:01:15 -04:00
Benjamin Otte
bcc0a54383 inspector: Store the parent for the object tree
This allows selecting newly added random objects.

https://bugzilla.gnome.org/show_bug.cgi?id=754987
2015-09-14 23:36:37 +02:00
Benjamin Otte
bffeae6203 inspector: Handle object destruction without row references
This way, we can live without row references.

A side effect is that opening the inspector on the gtk-demo list box
example now only takes 0.5s instead of the previous 3 minutes.
2015-08-26 16:33:52 +02:00
Benjamin Otte
1f2bd47965 inspector: Implement find_object() without GtkTreeRowReference
Tree row references are slow to update. And we update the widget list
quite a bit, so when it grows it can get REALLY slow.
2015-08-26 15:46:07 +02:00
Benjamin Otte
c7ed2c2130 inspector: Refactor object tree construction
Instead of having lots of if statements, create a vtable. This will be
useful for the following patches.
2015-08-26 15:46:07 +02:00
Timm Bäder
571da2a8b3 Inspector: Protect against childless windows 2015-08-26 12:04:44 +02:00
Timm Bäder
30d56933d4 Inspector: Make monitor rows unactivatable 2015-08-25 18:11:46 +02:00
Matthias Clasen
56d39241a9 inspector: Fix a typo
Blocking a signal should be paired with unblocking.
Spotted by Krzesimir Nowak
2015-08-04 07:11:34 -04:00
Matthias Clasen
142efd186d Inspector: Preserve selection when rescanning
We are semiregularly repopulating the object tree. Whenever
we do, we loose the selection, needlessly. Do the extra work
to preserve it.

http://bugzilla.gnome.org/show_bug.cgi?id=753130
2015-08-02 15:20:17 -04:00
Matthias Clasen
df50858dfd inspector: Show monitor information
This is useful to verify the monitor information returned by
other backends.
2015-07-28 01:14:49 -04:00
Matthias Clasen
bc68600cb0 inspector: Show wayland display information
Don't call it "X display" when we show useful information under
Wayland as well.
2015-07-28 00:46:34 -04:00
Matthias Clasen
5c2759af3c Use standard cursor names
This changes GTK+ to use gdk_cursor_new_from_name() with the
'standard' css names, instead of GdkCursorType.

https://bugzilla.gnome.org/show_bug.cgi?id=652085
2015-07-26 01:45:06 -04:00
Matthias Clasen
9a44f18940 inspector: Add a function to rescan
Currently, we only ever scanned the toplevel list and
widget tree once. That is not enough.
2015-07-23 21:27:37 -04:00
Matthias Clasen
c27b90cc79 Fix the build 2015-07-17 20:45:28 -04:00
Matthias Clasen
d8a40c4587 inspector: Avoid a NULL deref
Coverity pointed out that getting a class name requires
dereferencing the pointer, so only don't do it if it is NULL.
2015-07-17 19:52:52 -04:00
Matthias Clasen
2eb39a3b7a inspector: Remove some dead code
Not sure what I was thinking here. Coverity pointed this out.
2015-07-17 18:47:39 -04:00
Matthias Clasen
ff86433ea1 inspector: Avoid a NULL deref 2015-07-17 18:42:24 -04:00
Matthias Clasen
1b8d06da2d inspector: Check a return value
We don't care about the error here, but we were relying on
g_resources_get_info to zero the size even in case of error.
No need to do that, we can just check the return value. Plus,
it makes coverity happy.
2015-07-17 16:11:16 -04:00
Matthias Clasen
f960d4f486 inspector: Annotate a call whose return value we don't need
The way this code is written, we know that there is an item in
the hash table and the iter_next call will give it to us, so
no need to check the return value. Annotate the call to tell
coverity.
2015-07-17 16:11:16 -04:00
Matthias Clasen
02577ddb06 inspector: Avoid a gratitious use of g_strv_length
No need to count the strings first before iterating over them.
2015-07-16 23:42:55 -04:00
Emmanuele Bassi
e259b2f30d Avoid O(n²) walking of string arrays
"Yo, we heard you like traversing NULL-terminated arrays to operate on
them, so we called g_strv_length() as the for condition, so you can
iterate the array while iterating the array."

Instead of making famed rapper and television producer Xzibit proud, we
should avoid calling g_strv_length() on an array while looping on the
array, to avoid quadratic complexity.

We do this in various places that deal with arrays of strings that we
cannot really guess are short enough not to matter — e.g. the list of
CSS selectors in the inspector, or the required authentication
information for printing.
2015-07-16 16:19:55 +01:00
Christian Hergert
fa6f956489 inspector: allow object read-only properties in prop-editor
If we have a GObject property that is also a GObject, we should be able
to view additional information on that object (even if the param spec
is read-only).
2015-05-05 22:00:54 -07:00
Timm Bäder
b08a1702d1 inspector/misc-info: Fix typo 2015-05-02 17:27:29 +02:00
Chun-wei Fan
efd3758f6a gtk/inspector/css-node-tree.c: Fix Build
strcasecmp() is unfortunately not universally available, along with
strings.h.  Fix the build by replacing strcasecmp() with
g_ascii_strcasecmp(), and remove the strings.h include.

https://bugzilla.gnome.org/show_bug.cgi?id=747604
2015-04-10 17:18:07 +08:00
Ignacio Casal Quinteiro
7719784733 inspector: fix warning about not using the right format for an int64 2015-03-24 13:36:36 +01:00
Vadim Rutkovsky
3211e82b59 inspector: show accessible name and description 2015-03-19 17:01:23 +01:00
Bastien Nocera
7dac38f841 inspector: Make it easier to cut'n'paste advice message
The message says "Enable statistics with GOBJECT_DEBUG=instance-count"
but the message itself isn't selectable, making it hard to cut'n'paste.

https://bugzilla.gnome.org/show_bug.cgi?id=746391
2015-03-18 22:05:46 -04:00
Benjamin Otte
d55c261079 inspector: Add a new page that lists the CSS node tree 2015-03-18 15:23:33 +01:00
Carlos Garnacho
70e7b4c848 inspector: Remove flash timeout from widgets being unmapped
Otherwise the timeout can keep running, even if the widget is being
destroyed.
2015-03-16 16:29:37 +01:00
Matthias Clasen
073a9c9cd5 inspector: Add some margin to css editor
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=745918
2015-03-10 14:07:27 -04:00
Carlos Garnacho
85ad434290 inspector: Destroy popovers on unmap
As an implementation detail, the popover hooks the fade out animation
on ::hide. Destroying the popover right away here is not a problem, but
prevents the animation from actually running. ::unmap will be run after
the animation is finished, so destroy the popover there.
2015-02-20 14:44:17 +01:00
Lars Uebernickel
f3110e4103 Rename GtkSidebar to GtkStackSidebar
GtkSidebar is too generic and doesn't fully convey what the widget does.

https://bugzilla.gnome.org/show_bug.cgi?id=744094
2015-02-13 18:01:56 +01:00
Matthias Clasen
354536d464 inspector: Use some of the new GtkSearchEntry API
Avoid repetitive, manual event handling in various places
in GtkInspector.
2015-01-24 08:44:30 -05:00
Timm Bäder
ad180c4335 inspector: Make gl extension rows unactivatable 2015-01-22 21:18:25 +01:00
Benjamin Otte
ebb64c2288 inspector: Remove unused hash table 2015-01-20 06:30:19 +01:00
Benjamin Otte
7ba7dff69e inspector: Remove unused treemodel properties
As a side effect, we can use _gtk_css_section_to_string() to format the
section and save a lot of code.
2015-01-20 06:30:19 +01:00
Benjamin Otte
4ba710ea30 inspector: Use GtkCssStyle and gtk_css_value_to_string() 2015-01-20 06:30:19 +01:00
Benjamin Otte
ad8d30ad86 inspector: Remove a bunch of unused variables 2015-01-17 02:37:36 +01:00
Matthias Clasen
6384167054 inspector: Don't use GSettings directly
It is not necessary here, and using GtkSettings gives us
a greater chance to not fail e.g. on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 15:29:34 -05:00
Matthias Clasen
c2ff89bbe3 inspector: be careful about gsize vs guint64
Since gsize doesn't work as a typename in a ui file,
we have to be careful not to pass pointers to wrongly
sized variables when getting the guint64 values out
of the model.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 14:44:26 -05:00
Matthias Clasen
80969e34bc inspector: Show object address
This is useful information when running the application
in a debugger.
https://bugzilla.gnome.org/show_bug.cgi?id=742518
2015-01-09 00:07:01 -05:00
Jasper St. Pierre
915e4c6dd7 inspector: Update translations .ui.h file 2014-12-28 18:13:34 -08:00
Matthias Clasen
b4375cde48 Inspector: Show some X display characteristics
This helps diagnose e.g. csd problems.
2014-12-28 11:36:10 -05:00
Matthias Clasen
20f1c06eed Restore a missing file
No wonder nobody has tried my awesome magnifier yet...
2014-12-28 11:14:39 -05:00
Matthias Clasen
1e1c5c65d1 inspector: Remove an errant shadow 2014-12-20 19:39:09 -05:00
Matthias Clasen
2b07b6c069 inspector: Add a magnifier
Add a magnifier that shows the selected widget up to 5 times
enlarged.
2014-12-20 19:24:08 -05:00
Matthias Clasen
c118e51d52 inspector: Fix capitalization 2014-12-12 23:47:26 -05:00
Matthias Clasen
31ccc372f0 inspector: Add a cursor theme control 2014-12-12 23:46:28 -05:00
Jasper St. Pierre
b6acc8f2c5 actions: Fix compile warning 2014-12-12 17:39:46 -08:00
Christian Hergert
661da5558c widget: add helpers to resolve GActionGroups available to GtkWidget
These functions, while added for use by the GTK inspector, are generally
useful to applications that need to resolve what action groups are
available to a particular GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=741386
2014-12-11 15:25:41 -08:00
Matthias Clasen
23c5f11391 inspector: Make header buttons as !focus-on-click
Moving the focus to the header bar is unexpected and disruptive,
so don't do it.
2014-12-10 22:47:16 -05:00
Matthias Clasen
c5b7f9f11c inspector: Make sure something is focusable on the stats page
Without this, the focus will not be inside the top_stack when
we switch to the statistics page and it shows the excuse. This
in turn will make the next page not take focus as expected when
switching away from the statistics page again.
2014-12-10 22:41:45 -05:00
Matthias Clasen
18799d22cf inspector: Fix focus in css editor
Give the text view initial focus, so things work as expected
when switching to the css editor for the first time.
2014-12-10 22:39:50 -05:00
Matthias Clasen
cf4afd0e93 inspector: Don't force-switch to the objects tab
We used to switch to the objects tab when an object is
picked, but now may have two places with picker buttons:
the objects tab and the interactive tab.

So, just don't do that anymore.
2014-12-09 20:57:58 -05:00
Matthias Clasen
702b647d4e inspector: Allow extensions to request a picker
Look for a 'use-picker' property on the extension page
and add a picker button to the header bar if says so.
2014-12-09 20:57:51 -05:00
Matthias Clasen
44bf61baac inspector: Another indentation fix 2014-12-09 19:23:54 -05:00
Matthias Clasen
536b10800f inspector: Reindent ui file 2014-12-09 17:49:23 -05:00
Alexander Larsson
2d6ae59d7f Inspector: Support extending the inspector using GIOModules
This allows external modules to add a page to the Gtk Inspector.

https://bugzilla.gnome.org/show_bug.cgi?id=740983
2014-12-08 17:34:54 -05:00
Benjamin Otte
4d7369d1a8 inspector: Properly update flashing hilight
Previously, the inspector would not change the hilight while the
previous hilight was still flashing.
This is inconvenient while arrowing through the object selection
treeview though where you want the currently selected row to hilight
when arrowing quickly.
2014-12-01 15:43:43 +01:00
Matthias Clasen
383d5b137b inspector: Build nonrecursively 2014-11-30 16:11:56 -05:00
Matthias Clasen
2679f889a5 Drop an unused variable 2014-11-28 14:25:42 -05:00
Matthias Clasen
d3c96f9f17 inspector: Simplify some code 2014-11-27 23:21:42 -05:00
Matthias Clasen
4634fd81ba inspector: Make close buttons in search bars have no relief
Make our home-grown searchbar lookalike look more alike.
2014-11-25 08:42:26 -05:00
Matthias Clasen
bef9d05812 inspector: minor cleanup 2014-11-24 20:36:00 -05:00
Matthias Clasen
6b95810aae inspector: Show object title in menu tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
a7ba57f751 inspector: Add menu models to the tree
Add both the appmenu and the menubar models as children of the
application, if they exist.
2014-11-22 21:38:47 -05:00
Matthias Clasen
0a37493384 inspector: Show object title in size groups tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
d09f66579b inspector: Show object title in data tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
af12993c4b inspector: Show object title on the style property list
As with the property list, this replaces the search bar by
a stack containing a search entry.
2014-11-22 21:38:47 -05:00
Matthias Clasen
f38081a4a5 inspector: Show object title on selector tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
38c3600d8b inspector: Show object title in actions tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
d2aad06513 inspector: Show object title in hierarchy tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
85380f22f3 inspector: Show object title in the classes tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
fe5f9c560b inspector: Show object title in the css tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
c2326aa5cf inspector: Show object title in the gestures tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
9e3d0651e1 inspector: Show object title in the signals tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
7a1c5845ef inspector: Show object title in the properties tab
Replace the search bar with a search entry in a stack to make
this work without unseemly height changes.
2014-11-22 21:38:47 -05:00
Matthias Clasen
2ea3171ff9 inspector: Show object title in the misc tab 2014-11-22 21:38:47 -05:00
Matthias Clasen
5b7233f136 inspector: Store object title on object 2014-11-22 21:38:46 -05:00
Matthias Clasen
84463b78e5 inspector: Drop an unused argument 2014-11-22 21:38:46 -05:00
Matthias Clasen
9fb2d6a6b9 inspector: Trivial typo fix 2014-11-22 21:38:46 -05:00
Matthias Clasen
85a539ce6d inspector: Add frame clock info
Add the frame clocks of toplevel widgets to the object tree,
and show their frame count and frame rate in the misc tab.
2014-11-12 22:52:59 -05:00
Matthias Clasen
45528440e6 inspector: Show the refcount on the misc tab 2014-11-12 21:58:08 -05:00
Matthias Clasen
72b9d2861c inspector: Update misc-info while the tab is shown
Update the values on the page once per second, while the tab
is shown.
2014-11-12 21:45:16 -05:00
Matthias Clasen
21e3d4f2f7 inspector: Turn off search where we don't have a search bar yet
Avoid the builtin treeview search popup everywhere.
2014-11-11 22:42:51 -05:00
Matthias Clasen
8b95515c0c inspector: Only set debug-updates for the default display
Use the new private API to isolate the inspector itself from
this setting.
2014-11-10 15:24:08 -05:00
Matthias Clasen
5c5c8bdd81 inspector: Add a rendering mode control 2014-11-10 15:07:52 -05:00
Javier Jardón
710f332082 configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
2014-11-10 15:12:17 +00:00
Matthias Clasen
8a8c6c0722 Inspector: hide the selector tab for non-widgets 2014-11-08 21:43:26 -05:00
Matthias Clasen
9a84d8a261 inspector: Hide the size-groups tab when empty 2014-11-08 21:30:12 -05:00
Matthias Clasen
0c20ba7dcb inspector: Hide the inspector tab when empty 2014-11-08 21:29:51 -05:00
Matthias Clasen
ae4aaf7354 inspector: Set statistics button sensitivity
After moving the button the header, it is now visible when
statistics are not available. Disable it in this case.
2014-11-08 09:57:48 -05:00
Matthias Clasen
592a0d46b4 inspector: Add more GL information
Add version and extension information to the general tab.
2014-11-08 02:16:35 -05:00
Emmanuele Bassi
585af218a3 Move GDK GL flags accessors to the private vtable
This allows us to use the GDK_PRIVATE_CALL macro inside gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Matthias Clasen
713d3834f6 inspector: Reserve space for buttons
Make the button area in the top left a stack that is parallel
to the main page stack. This avoids size changes as we switch
between pages.
2014-11-08 00:09:30 -05:00