@@ -97,6 +97,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE)
KsTraceGraph.cpp
KsTraceViewer.cpp
KsMainWindow.cpp
+ KsPluginsGUI.cpp
KsCaptureDialog.cpp
KsQuickContextMenu.cpp
KsAdvFilteringDialog.cpp)
new file mode 100644
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: LGPL-2.1
+
+/*
+ * Copyright 2022 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@gmail.com>
+ */
+
+/**
+ * @file KsPluginsGUI.cpp
+ * @brief KernelShark C++ plugin declarations.
+ */
+
+// KernelShark
+#include "KsPluginsGUI.hpp"
+#include "KsMainWindow.hpp"
+#include "KsDualMarker.hpp"
+
+void markEntryA(void *ks_ptr, const kshark_entry *e)
+{
+ KsMainWindow *ks = static_cast<KsMainWindow *>(ks_ptr);
+ ks->markEntry(e, DualMarkerState::A);
+}
+
+void markEntryB(void *ks_ptr, const kshark_entry *e)
+{
+ KsMainWindow *ks = static_cast<KsMainWindow *>(ks_ptr);
+ ks->markEntry(e, DualMarkerState::B);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: LGPL-2.1 */
+
+/*
+ * Copyright 2022 VMware Inc, Yordan Karadzhov <y.karadz@gmail.com>
+ */
+
+/**
+ * @file KsPluginsGUI.hpp
+ * @brief KernelShark C++ plugin declarations.
+ */
+
+#ifndef _KS_PLUGINS_GUI_H
+#define _KS_PLUGINS_GUI_H
+
+// KernelShark
+#include "libkshark.h"
+
+void markEntryA(void *ks_ptr, const kshark_entry *e);
+
+void markEntryB(void *ks_ptr, const kshark_entry *e);
+
+#endif
Here we will place all GUI-related APIs that will be exposed to the external plugins. For the moment we add only two such APIs that will allow the plugins to manipulate the markers. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- src/CMakeLists.txt | 1 + src/KsPluginsGUI.cpp | 27 +++++++++++++++++++++++++++ src/KsPluginsGUI.hpp | 22 ++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/KsPluginsGUI.cpp create mode 100644 src/KsPluginsGUI.hpp