Commit Graph

156 Commits

Author SHA1 Message Date
ceb7c02f93 sysprof-ui: add missing header to sysprof-ui.h 2016-10-09 20:31:10 -07:00
e239887a9b empty-state: make empty state labels changable 2016-10-09 15:12:50 -07:00
ff8ef76d38 theme-manager: remove debug code 2016-10-09 15:12:38 -07:00
034a7d881f visualizer-view: ensure types are registered
These have the chance of being dropped unless we export them
here manually. We probably should change how we export symbols
so this isn't required in the future.
2016-10-09 12:36:28 -07:00
3b2f2505d3 sysprof-ui: add missing header to public API 2016-10-09 12:36:17 -07:00
34f493d553 capture: use SpClock for current timestamp
It is important that our capture current time matches the
same clock we are using for events. Otherwise we could have
drift between CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW.
2016-10-08 20:29:16 -07:00
62189670af callgraph: update callgraph when selection changes
When the visualizer selection is changed, we can update the
callgraph to ensure all samples fall within the time range.
2016-10-08 20:09:49 -07:00
00b9b1fbf5 visualizer-selection: move selection to sysprof.h
This allows us to use the selection in profile components
without the use of Gtk.

We will probably end up renaming this class to SpSelection or
something like that.
2016-10-08 20:08:56 -07:00
1e38dc7b37 callgraph-view: add missing get_profile() accessor 2016-10-08 19:20:45 -07:00
37edc29cbb callgraph-view: clear models when unloading 2016-10-08 19:20:30 -07:00
42b82f69c9 visualizer-selection: add visualizer helpers
Adds a copy helper (for thread access) and a contains helper.
2016-10-08 19:19:46 -07:00
7c55f379bb theme-manager: add SpThemeManager and use it for custom css
We want to set some custom backgrounds for the visualizers, and
those need to track with the current theme. SpThemeManager will
watch the systems theme changes (including dark theme) and
update the loaded CSS resources as necessary.
2016-10-08 16:28:18 -07:00
7ca8493130 viewport: remove SpViewport
We didn't end up using this by using plain GtkViewport.
2016-10-08 16:27:27 -07:00
aa61c43547 visualizer-view: fix selections when scrolling
If we have a scrolled view, we might be a bit off on the
selected range until this commit. This adjusts for the scrolled
area and ensures that both ticks and selections land in the
right place.
2016-10-08 15:36:01 -07:00
70aeeb66bc visualizer-selection: initial visualizer selection support
This gets started on allowing the user to select a region.
Nothing is yet responding to the changes in selection, but
that can come later.

Ideally, we will truncate (or mark rows invisible/insensitive)
if they do not fall within the selected time region.
2016-10-08 13:40:12 -07:00
e85707f5c9 visualizer-ticks: make lines sharper
These multi-width lines were blurry, so for now just make them
1px wide.
2016-10-07 12:58:30 -07:00
8f613b5352 visualizer-ticks: fix msec value 2016-10-06 22:26:52 -07:00
72a8276faf visualizer-view: fix time range for ticks
This uses the graph_width to get the proper time range of the
visualizer row. Mostly, this is just complicated because we
the ticks to be an overlay rather than inline with the list
rows.
2016-10-06 21:03:01 -07:00
c5fb8b5fc9 visualizer-row: add private access to graph_width
Having this makes a few things easier now that we are relying
on pixel cache for scrolling.
2016-10-06 21:02:00 -07:00
51ed367b74 wip: visualizer work 2016-10-05 09:40:08 -07:00
6d9656e6fe visualizer-view: use queue_resize instead of queue_draw
We need everything to update from this widget down the widget
hierarchy so they all get redrawn. Queuing a resize will ensure
that happens.
2016-10-04 12:29:50 -07:00
8d8c879384 visualizer-view: add helper viewport for scrolling
We can avoid using the inline scrollbar in favor of overlay
scrolling if we bridge the adjustment into the GtkViewport.
This sadly requires us to subclass things to get it just
right.
2016-10-03 16:08:13 -07:00
59cbd8fc3f visualizer-view: fix logic on swapping times 2016-10-03 16:06:00 -07:00
6eee3343de visualizer-ticks: avoid FPE 2016-09-30 18:25:22 -07:00
974f0b45fb line-visualizer-row: adjust surface when time range changes
We can reuse the existing surface, but we need to render it
at an offset so that we aren't so shaky under scrolling.
2016-09-30 18:07:39 -07:00
fef48610da visualizer-row: allow begin/end time to be NULL 2016-09-30 17:33:33 -07:00
5adb7d6d2c multi-paned: only mark position if sequence is accepted
This fixes a bug where any time we touch the adjacent scrollbar,
the position of the paned gets set.
2016-09-30 17:11:29 -07:00
76b92cec99 visualizer-ticks: don't render 00:00:00.0000
If we are at the beginning of a capture, we would end up drawing
the msec because h/m/s were all zero. Make sure we also have a
non-zero msec or just fallback to regular timestamps.
2016-09-30 17:07:33 -07:00
5c53dd5d6e visualizer-view: avoid overscroll upon zoom change
When changing the zoom (zooming out), we could potentially
let the scrollbar be past the end. This looks pretty bad when
the GtkWindow doesn't clip correctly.

This just adjusts things so we push ourselves back into the
visible area.
2016-09-30 17:04:48 -07:00
e54c496f7d visualizer-view: set hscrollbar policy to never
Because we are using ListBox, we can't quite do scrolling the
way we'd like (naturally using the scrolled window). So for now
we need to just disable hscrolling here.

However, it would be nice if we could teach the viewport to
handle this correctly so that it wires up the
GtkScrollable:hscrollbar-adjustment to our internal one.
2016-09-30 16:59:11 -07:00
0d8f45f034 visualizer-ticks: draw position labels next to ticks
This adds label text next to important epochs. We determine
which epochs are important by trying to choose the waypoints
that had more than 2 epochs land in view.

This avoids showing numbers for multiple time-spans, but giving
enough context to be useful.
2016-09-30 16:54:17 -07:00
a20ba80f3d line-visualizer-row: disable time optimization
This is overactive because we could be zoomed in so far that we
don't pick up the adjacent frame. We need something more clever
that can pick up frames adjacent to the visible area of the
capture.
2016-09-30 14:02:58 -07:00
c116120563 visualizer-ticks: adjust ticks for capture epoch
We need to take into account the real start of the capture to
land the ticks in the right position. Add "epoch" concept
to SpVisualizerTicks for just this purpose.
2016-09-30 13:21:17 -07:00
54116ba765 sysprof-ui: make SpVisualizerTicks and SpVisualizerList private
This classes are implementation details and should not be
exposed into our public API/ABI.
2016-09-30 13:09:13 -07:00
428cbcbfbb sysprof-ui: add SpMultiPaned to public API
This adds sp-multi-paned.h to the public API of libsysprof-ui-2
2016-09-30 13:01:57 -07:00
d64bd3fe51 visualizer-view: set vexpand on scrolledwindow
This ensures that the scrolled window expands to the visible
area, which is indeed the desired effect.
2016-09-30 12:59:57 -07:00
f9e19131b5 multi-paned: add SpMultiPaned
This is copy/paste from PnlMultiPaned. The feature we want from
it is the ability to resize paned halves based on their natural
sizing up until the user has manually changed the paned handle
position.
2016-09-30 12:59:09 -07:00
69d5dd2f5f avoid warnings on shutdown
Occasionally we could get a few warnings during shutdown due
to inconsistent teardown state. This tries to handle those so
we shutdown cleanly.
2016-09-30 10:54:53 -07:00
fa58f7a941 visualizer-view: hide scrollbar by default 2016-09-29 18:14:50 -07:00
4bd72708d7 line-visualizer-row: handle HiDPI properly
When we find ourselves on a HiDPI display, we need to make sure
we setup the device scale factor properly and adjust our render
checks for valid surface sizes.
2016-09-29 18:13:35 -07:00
75332678a6 visualizer-view: dynamically toggle scrollbar visibility
Generally we want this thing hidden, so only show it if we have
zoomed in enough to cause it to be useful.

We need to also find a way for the container to be able to
handle the change in size request and adjust the GtkPaned
to be non-ugly.
2016-09-29 17:49:53 -07:00
0766bd6b93 line-visualizer-row: restrict data points to visible range
We don't want to cache all the datapoints from the underlying
capture, just the datapoints for the visible region (and some
at the edges so we get proper cairo_curve_to() x,y coordinates).

This isn't a major optimization yet until we start supporting
much larger capture sizes. But that will mostly be improved with
capture indexes anyway.
2016-09-29 14:59:02 -07:00
caa95fcca7 visualizer-view: implement basic panning
There are lots of little things that need fixing, such as the
ticks positioning, and reusing surfaces as much as possible, but
this gets our "MVP" panning in place.
2016-09-29 14:37:00 -07:00
b9b96184cd visualizers: wire zoom manager to visualizers
This gets the basic zoom control working. I anticipate we'll
need some additional changes once we land panning support.
2016-09-28 19:56:39 -07:00
e6ecad548a zoom-manager: add zoom manager to simplify zoom control
This will give us a single place to deal with the mechanics of
how zoom works, and then our UI code can simply apply the value
as necessary.
2016-09-28 17:13:24 -07:00
4d48f98f6d visualizer-ticks: remove extraneous assertion
This isn't exactly true anymore, so we need to remove it now
that we can have more interesting time spans.
2016-09-28 14:13:15 -07:00
7831b767d0 visualizer-view: shrink time range when necessary
If we don't have a minute worth of input, we should shrink the
visible area to exactly what we came across.

We still have the issue of the UI creating the capture file
before auth has completed, but we can fix that later so we
have a "semantically" correct start time.
2016-09-28 14:10:29 -07:00
527ad1476c cpu-visualizer: reset colors upon new reader
We want to reset our colors so that we look the same on
subsequent loads, which is what the user would expect.
2016-09-28 14:09:53 -07:00
baabf7692c color-cycle: add reset helper
This will reset the colors and move back to position 0.
2016-09-28 14:09:32 -07:00
b5fccca069 visualizer-view: add ::visualizer-added and ::visualizer-removed
These signals are emitted when a visualizer row has been added
or removed from the view. This might be handy if you want to
resize a paned based on the natural size of the visualizers.
2016-09-28 13:22:51 -07:00