mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +00:00
libsysprof-ui: hook up zoom-manager to visualizers
This commit is contained in:
@ -26,7 +26,6 @@
|
|||||||
#include "sysprof-capture-view.h"
|
#include "sysprof-capture-view.h"
|
||||||
#include "sysprof-marks-view.h"
|
#include "sysprof-marks-view.h"
|
||||||
#include "sysprof-visualizer-view.h"
|
#include "sysprof-visualizer-view.h"
|
||||||
#include "sysprof-zoom-manager.h"
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -516,7 +515,13 @@ sysprof_capture_view_class_init (SysprofCaptureViewClass *klass)
|
|||||||
static void
|
static void
|
||||||
sysprof_capture_view_init (SysprofCaptureView *self)
|
sysprof_capture_view_init (SysprofCaptureView *self)
|
||||||
{
|
{
|
||||||
|
SysprofCaptureViewPrivate *priv = sysprof_capture_view_get_instance_private (self);
|
||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
|
gtk_widget_insert_action_group (GTK_WIDGET (self),
|
||||||
|
"zoom",
|
||||||
|
G_ACTION_GROUP (priv->zoom_manager));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -585,3 +590,21 @@ sysprof_capture_view_reset (SysprofCaptureView *self)
|
|||||||
|
|
||||||
/* TODO: reset */
|
/* TODO: reset */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysprof_capture_view_get_zoom_manager:
|
||||||
|
* @self: a #SysprofCaptureView
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): a #SysprofZoomManager
|
||||||
|
*
|
||||||
|
* Since: 3.34
|
||||||
|
*/
|
||||||
|
SysprofZoomManager *
|
||||||
|
sysprof_capture_view_get_zoom_manager (SysprofCaptureView *self)
|
||||||
|
{
|
||||||
|
SysprofCaptureViewPrivate *priv = sysprof_capture_view_get_instance_private (self);
|
||||||
|
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_CAPTURE_VIEW (self), NULL);
|
||||||
|
|
||||||
|
return priv->zoom_manager;
|
||||||
|
}
|
||||||
|
|||||||
@ -23,6 +23,8 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <sysprof-capture.h>
|
#include <sysprof-capture.h>
|
||||||
|
|
||||||
|
#include "sysprof-zoom-manager.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define SYSPROF_TYPE_CAPTURE_VIEW (sysprof_capture_view_get_type())
|
#define SYSPROF_TYPE_CAPTURE_VIEW (sysprof_capture_view_get_type())
|
||||||
@ -48,20 +50,22 @@ struct _SysprofCaptureViewClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GtkWidget *sysprof_capture_view_new (void);
|
GtkWidget *sysprof_capture_view_new (void);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
SysprofCaptureReader *sysprof_capture_view_get_reader (SysprofCaptureView *self);
|
SysprofZoomManager *sysprof_capture_view_get_zoom_manager (SysprofCaptureView *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
void sysprof_capture_view_load_async (SysprofCaptureView *self,
|
SysprofCaptureReader *sysprof_capture_view_get_reader (SysprofCaptureView *self);
|
||||||
SysprofCaptureReader *reader,
|
|
||||||
GCancellable *cancellable,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
gboolean sysprof_capture_view_load_finish (SysprofCaptureView *self,
|
void sysprof_capture_view_load_async (SysprofCaptureView *self,
|
||||||
GAsyncResult *result,
|
SysprofCaptureReader *reader,
|
||||||
GError **error);
|
GCancellable *cancellable,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
gboolean sysprof_capture_view_get_busy (SysprofCaptureView *self);
|
gboolean sysprof_capture_view_load_finish (SysprofCaptureView *self,
|
||||||
|
GAsyncResult *result,
|
||||||
|
GError **error);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
gboolean sysprof_capture_view_get_busy (SysprofCaptureView *self);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
@ -6,12 +6,70 @@
|
|||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkStackSwitcher">
|
<object class="GtkBox">
|
||||||
<property name="stack">sections_stack</property>
|
<property name="orientation">horizontal</property>
|
||||||
<property name="halign">center</property>
|
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<property name="margin-top">6</property>
|
<child>
|
||||||
<property name="margin-bottom">6</property>
|
<object class="GtkBox">
|
||||||
|
<property name="margin-start">12</property>
|
||||||
|
<property name="margin-end">12</property>
|
||||||
|
<property name="orientation">horizontal</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="action-name">zoom.zoom-out</property>
|
||||||
|
<property name="focus-on-click">false</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="icon-name">zoom-out-symbolic</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="action-name">zoom.zoom-one</property>
|
||||||
|
<property name="focus-on-click">false</property>
|
||||||
|
<property name="label" bind-source="zoom_manager" bind-property="zoom-label" bind-flags="sync-create"/>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="action-name">zoom.zoom-in</property>
|
||||||
|
<property name="focus-on-click">false</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="icon-name">zoom-in-symbolic</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="center">
|
||||||
|
<object class="GtkStackSwitcher">
|
||||||
|
<property name="stack">sections_stack</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="visible">true</property>
|
||||||
|
<property name="margin-top">6</property>
|
||||||
|
<property name="margin-bottom">6</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -28,6 +86,7 @@
|
|||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="SysprofVisualizerView" id="visualizer_view">
|
<object class="SysprofVisualizerView" id="visualizer_view">
|
||||||
|
<property name="zoom-manager">zoom_manager</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
@ -66,6 +125,5 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</template>
|
</template>
|
||||||
<object class="SysprofZoomManager" id="zoom_manager">
|
<object class="SysprofZoomManager" id="zoom_manager"/>
|
||||||
</object>
|
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
Reference in New Issue
Block a user