diff options
-rw-r--r-- | Userland/DevTools/Profiler/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/TimelineTrack.cpp (renamed from Userland/DevTools/Profiler/ProfileTimelineWidget.cpp) | 16 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/TimelineTrack.h (renamed from Userland/DevTools/Profiler/ProfileTimelineWidget.h) | 9 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/TimelineView.h | 10 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/main.cpp | 4 |
5 files changed, 22 insertions, 21 deletions
diff --git a/Userland/DevTools/Profiler/CMakeLists.txt b/Userland/DevTools/Profiler/CMakeLists.txt index d39fcd544d..539fdb7269 100644 --- a/Userland/DevTools/Profiler/CMakeLists.txt +++ b/Userland/DevTools/Profiler/CMakeLists.txt @@ -6,8 +6,8 @@ set(SOURCES ProcessPickerWidget.cpp Profile.cpp ProfileModel.cpp - ProfileTimelineWidget.cpp - SamplesModel.cpp + TimelineTrack.cpp + SamplesModel.cpp TimelineView.cpp ) diff --git a/Userland/DevTools/Profiler/ProfileTimelineWidget.cpp b/Userland/DevTools/Profiler/TimelineTrack.cpp index 4181d32e1d..b1b8f39c3f 100644 --- a/Userland/DevTools/Profiler/ProfileTimelineWidget.cpp +++ b/Userland/DevTools/Profiler/TimelineTrack.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "ProfileTimelineWidget.h" +#include "TimelineTrack.h" #include "Profile.h" #include "TimelineView.h" #include <LibGUI/Painter.h> @@ -13,7 +13,7 @@ namespace Profiler { -ProfileTimelineWidget::ProfileTimelineWidget(TimelineView& view, Profile& profile, Process const& process) +TimelineTrack::TimelineTrack(TimelineView& view, Profile& profile, Process const& process) : m_view(view) , m_profile(profile) , m_process(process) @@ -25,11 +25,11 @@ ProfileTimelineWidget::ProfileTimelineWidget(TimelineView& view, Profile& profil set_frame_thickness(1); } -ProfileTimelineWidget::~ProfileTimelineWidget() +TimelineTrack::~TimelineTrack() { } -void ProfileTimelineWidget::paint_event(GUI::PaintEvent& event) +void TimelineTrack::paint_event(GUI::PaintEvent& event) { GUI::Frame::paint_event(event); @@ -97,14 +97,14 @@ void ProfileTimelineWidget::paint_event(GUI::PaintEvent& event) } } -u64 ProfileTimelineWidget::timestamp_at_x(int x) const +u64 TimelineTrack::timestamp_at_x(int x) const { float column_width = (float)frame_inner_rect().width() / (float)m_profile.length_in_ms(); float ms_into_profile = (float)x / column_width; return m_profile.first_timestamp() + (u64)ms_into_profile; } -void ProfileTimelineWidget::mousedown_event(GUI::MouseEvent& event) +void TimelineTrack::mousedown_event(GUI::MouseEvent& event) { if (event.button() != GUI::MouseButton::Left) return; @@ -116,7 +116,7 @@ void ProfileTimelineWidget::mousedown_event(GUI::MouseEvent& event) update(); } -void ProfileTimelineWidget::mousemove_event(GUI::MouseEvent& event) +void TimelineTrack::mousemove_event(GUI::MouseEvent& event) { m_view.set_hover_time({}, timestamp_at_x(event.x())); @@ -128,7 +128,7 @@ void ProfileTimelineWidget::mousemove_event(GUI::MouseEvent& event) update(); } -void ProfileTimelineWidget::mouseup_event(GUI::MouseEvent& event) +void TimelineTrack::mouseup_event(GUI::MouseEvent& event) { if (event.button() != GUI::MouseButton::Left) return; diff --git a/Userland/DevTools/Profiler/ProfileTimelineWidget.h b/Userland/DevTools/Profiler/TimelineTrack.h index 8bb8ab3a82..525f48d780 100644 --- a/Userland/DevTools/Profiler/ProfileTimelineWidget.h +++ b/Userland/DevTools/Profiler/TimelineTrack.h @@ -14,10 +14,11 @@ class Process; class Profile; class TimelineView; -class ProfileTimelineWidget final : public GUI::Frame { - C_OBJECT(ProfileTimelineWidget) +class TimelineTrack final : public GUI::Frame { + C_OBJECT(TimelineTrack); + public: - virtual ~ProfileTimelineWidget() override; + virtual ~TimelineTrack() override; private: virtual void paint_event(GUI::PaintEvent&) override; @@ -25,7 +26,7 @@ private: virtual void mousemove_event(GUI::MouseEvent&) override; virtual void mouseup_event(GUI::MouseEvent&) override; - explicit ProfileTimelineWidget(TimelineView&, Profile&, Process const&); + explicit TimelineTrack(TimelineView&, Profile&, Process const&); u64 timestamp_at_x(int x) const; diff --git a/Userland/DevTools/Profiler/TimelineView.h b/Userland/DevTools/Profiler/TimelineView.h index fd5da55594..11f3ba4529 100644 --- a/Userland/DevTools/Profiler/TimelineView.h +++ b/Userland/DevTools/Profiler/TimelineView.h @@ -10,7 +10,7 @@ namespace Profiler { -class ProfileTimelineWidget; +class TimelineTrack; class TimelineView final : public GUI::Widget { C_OBJECT(TimelineView); @@ -23,22 +23,22 @@ public: u64 select_end_time() const { return m_select_end_time; } u64 hover_time() const { return m_hover_time; } - void set_selecting(Badge<ProfileTimelineWidget>, bool value) + void set_selecting(Badge<TimelineTrack>, bool value) { m_selecting = value; update(); } - void set_select_start_time(Badge<ProfileTimelineWidget>, u64 value) + void set_select_start_time(Badge<TimelineTrack>, u64 value) { m_select_start_time = value; update(); } - void set_select_end_time(Badge<ProfileTimelineWidget>, u64 value) + void set_select_end_time(Badge<TimelineTrack>, u64 value) { m_select_end_time = value; update(); } - void set_hover_time(Badge<ProfileTimelineWidget>, u64 value) + void set_hover_time(Badge<TimelineTrack>, u64 value) { m_hover_time = value; update(); diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index c6d5f15ba1..b3c8aee35c 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -7,7 +7,7 @@ #include "IndividualSampleModel.h" #include "ProcessPickerWidget.h" #include "Profile.h" -#include "ProfileTimelineWidget.h" +#include "TimelineTrack.h" #include "TimelineView.h" #include <LibCore/ArgsParser.h> #include <LibCore/ElapsedTimer.h> @@ -99,7 +99,7 @@ int main(int argc, char** argv) } if (!event_count) continue; - timeline_view->add<ProfileTimelineWidget>(*timeline_view, *profile, process); + timeline_view->add<TimelineTrack>(*timeline_view, *profile, process); } auto& scrollable_container = main_widget.add<GUI::ScrollableContainerWidget>(); |