[gnome-builder/wip/gtk4-port: 561/1774] plugins/debuggerui: incremental GTK 4 porting
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 561/1774] plugins/debuggerui: incremental GTK 4 porting
- Date: Mon, 11 Jul 2022 22:31:16 +0000 (UTC)
commit 1c80718cea35f6588f286bd7bbf7be52da2b3dd7
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 11 21:20:15 2022 -0700
plugins/debuggerui: incremental GTK 4 porting
Lots to do on this module, so just getting things started here.
src/plugins/debuggerui/debuggerui-plugin.c | 12 +-
.../debuggerui/ide-debugger-breakpoints-view.c | 36 ++-
.../debuggerui/ide-debugger-breakpoints-view.h | 2 +-
.../debuggerui/ide-debugger-breakpoints-view.ui | 2 +-
src/plugins/debuggerui/ide-debugger-controls.c | 2 +-
src/plugins/debuggerui/ide-debugger-editor-addin.h | 39 ---
.../debuggerui/ide-debugger-hover-controls.c | 5 +-
.../debuggerui/ide-debugger-hover-controls.h | 2 +-
.../debuggerui/ide-debugger-hover-controls.ui | 2 +-
.../debuggerui/ide-debugger-libraries-view.c | 28 +-
.../debuggerui/ide-debugger-libraries-view.h | 2 +-
.../debuggerui/ide-debugger-libraries-view.ui | 2 +-
src/plugins/debuggerui/ide-debugger-locals-view.c | 18 +-
src/plugins/debuggerui/ide-debugger-locals-view.h | 2 +-
src/plugins/debuggerui/ide-debugger-locals-view.ui | 2 +-
.../debuggerui/ide-debugger-registers-view.c | 25 +-
.../debuggerui/ide-debugger-registers-view.h | 2 +-
.../debuggerui/ide-debugger-registers-view.ui | 2 +-
src/plugins/debuggerui/ide-debugger-threads-view.c | 42 +--
src/plugins/debuggerui/ide-debugger-threads-view.h | 2 +-
.../debuggerui/ide-debugger-threads-view.ui | 4 +-
...itor-addin.c => ide-debugger-workspace-addin.c} | 321 +++++++++------------
.../debuggerui/ide-debugger-workspace-addin.h | 39 +++
src/plugins/debuggerui/meson.build | 2 +-
24 files changed, 267 insertions(+), 328 deletions(-)
---
diff --git a/src/plugins/debuggerui/debuggerui-plugin.c b/src/plugins/debuggerui/debuggerui-plugin.c
index e240b614c..950da53c2 100644
--- a/src/plugins/debuggerui/debuggerui-plugin.c
+++ b/src/plugins/debuggerui/debuggerui-plugin.c
@@ -22,21 +22,21 @@
#include "config.h"
+#include <libpeas/peas.h>
+
#include <libide-debugger.h>
-#include <libide-editor.h>
#include <libide-gui.h>
-#include <libpeas/peas.h>
-#include "ide-debugger-editor-addin.h"
#include "ide-debugger-hover-provider.h"
+#include "ide-debugger-workspace-addin.h"
void
_gbp_debuggerui_register_types (PeasObjectModule *module)
{
- peas_object_module_register_extension_type (module,
- IDE_TYPE_EDITOR_ADDIN,
- IDE_TYPE_DEBUGGER_EDITOR_ADDIN);
peas_object_module_register_extension_type (module,
IDE_TYPE_HOVER_PROVIDER,
IDE_TYPE_DEBUGGER_HOVER_PROVIDER);
+ peas_object_module_register_extension_type (module,
+ IDE_TYPE_WORKSPACE_ADDIN,
+ IDE_TYPE_DEBUGGER_WORKSPACE_ADDIN);
}
diff --git a/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
index 2f9bfbcd0..a20056b5d 100644
--- a/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
@@ -22,16 +22,14 @@
#include "config.h"
-#include <dazzle.h>
-
#include "ide-debugger-breakpoints-view.h"
struct _IdeDebuggerBreakpointsView
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
/* Owned references */
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debugger_signals;
/* Template references */
GtkCellRendererText *address_cell;
@@ -69,11 +67,11 @@ static GParamSpec *properties [N_PROPS];
static void
ide_debugger_breakpoints_view_bind (IdeDebuggerBreakpointsView *self,
IdeDebugger *debugger,
- DzlSignalGroup *debugger_signals)
+ IdeSignalGroup *debugger_signals)
{
g_assert (IDE_IS_DEBUGGER_BREAKPOINTS_VIEW (self));
g_assert (IDE_IS_DEBUGGER (debugger));
- g_assert (DZL_IS_SIGNAL_GROUP (debugger_signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (debugger_signals));
gtk_list_store_clear (self->list_store);
}
@@ -113,7 +111,7 @@ ide_debugger_breakpoints_view_breakpoint_added (IdeDebuggerBreakpointsView *self
g_assert (IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
g_assert (IDE_IS_DEBUGGER (debugger));
- dzl_gtk_list_store_insert_sorted (self->list_store, &iter, breakpoint, 0,
+ ide_gtk_list_store_insert_sorted (self->list_store, &iter, breakpoint, 0,
(GCompareDataFunc)ide_debugger_breakpoint_compare,
NULL);
@@ -468,38 +466,38 @@ ide_debugger_breakpoints_view_class_init (IdeDebuggerBreakpointsViewClass *klass
static void
ide_debugger_breakpoints_view_init (IdeDebuggerBreakpointsView *self)
{
- DzlShortcutController *controller;
+ IdeShortcutController *controller;
gtk_widget_init_template (GTK_WIDGET (self));
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
g_signal_connect_swapped (self->debugger_signals,
"bind",
G_CALLBACK (ide_debugger_breakpoints_view_bind),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"running",
G_CALLBACK (ide_debugger_breakpoints_view_running),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (ide_debugger_breakpoints_view_stopped),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"breakpoint-added",
G_CALLBACK (ide_debugger_breakpoints_view_breakpoint_added),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"breakpoint-removed",
G_CALLBACK (ide_debugger_breakpoints_view_breakpoint_removed),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"breakpoint-modified",
G_CALLBACK (ide_debugger_breakpoints_view_breakpoint_modified),
self);
@@ -547,12 +545,12 @@ ide_debugger_breakpoints_view_init (IdeDebuggerBreakpointsView *self)
G_CALLBACK (ide_debugger_breakpoints_view_enabled_toggled),
self);
- controller = dzl_shortcut_controller_find (GTK_WIDGET (self->tree_view));
+ controller = ide_shortcut_controller_find (GTK_WIDGET (self->tree_view));
- dzl_shortcut_controller_add_command_callback (controller,
+ ide_shortcut_controller_add_command_callback (controller,
"org.gnome.builder.debugger.delete-breakpoint",
"Delete",
- DZL_SHORTCUT_PHASE_BUBBLE,
+ IDE_SHORTCUT_PHASE_BUBBLE,
(GtkCallback)
ide_debugger_breakpoints_view_delete_breakpoint,
self, NULL);
}
@@ -579,7 +577,7 @@ ide_debugger_breakpoints_view_get_debugger (IdeDebuggerBreakpointsView *self)
g_return_val_if_fail (IDE_IS_DEBUGGER_BREAKPOINTS_VIEW (self), NULL);
if (self->debugger_signals != NULL)
- return dzl_signal_group_get_target (self->debugger_signals);
+ return ide_signal_group_get_target (self->debugger_signals);
else
return NULL;
}
@@ -602,7 +600,7 @@ ide_debugger_breakpoints_view_set_debugger (IdeDebuggerBreakpointsView *self,
if (self->debugger_signals != NULL)
{
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
}
}
diff --git a/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
index 883475b79..8e2251d10 100644
--- a/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_BREAKPOINTS_VIEW (ide_debugger_breakpoints_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerBreakpointsView, ide_debugger_breakpoints_view, IDE,
DEBUGGER_BREAKPOINTS_VIEW, GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerBreakpointsView, ide_debugger_breakpoints_view, IDE,
DEBUGGER_BREAKPOINTS_VIEW, AdwBin)
GtkWidget *ide_debugger_breakpoints_view_new (void);
IdeDebugger *ide_debugger_breakpoints_view_get_debugger (IdeDebuggerBreakpointsView *self);
diff --git a/src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
index 0a184dea4..a42567644 100644
--- a/src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerBreakpointsView" parent="GtkBin">
+ <template class="IdeDebuggerBreakpointsView" parent="AdwBin">
<child>
<object class="GtkScrolledWindow">
<property name="visible">true</property>
diff --git a/src/plugins/debuggerui/ide-debugger-controls.c b/src/plugins/debuggerui/ide-debugger-controls.c
index 25d7735fe..d2a5d4c84 100644
--- a/src/plugins/debuggerui/ide-debugger-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-controls.c
@@ -22,7 +22,7 @@
struct _IdeDebuggerControls
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
};
G_DEFINE_FINAL_TYPE (IdeDebuggerControls, ide_debugger_controls, GTK_TYPE_REVEALER)
diff --git a/src/plugins/debuggerui/ide-debugger-hover-controls.c
b/src/plugins/debuggerui/ide-debugger-hover-controls.c
index 009a7b75c..f37975be2 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.c
@@ -22,7 +22,6 @@
#include "config.h"
-#include <dazzle.h>
#include <libide-debugger.h>
#include <libide-sourceview.h>
@@ -32,7 +31,7 @@
struct _IdeDebuggerHoverControls
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
IdeDebugManager *debug_manager;
GFile *file;
@@ -145,7 +144,7 @@ on_toggle_cb (GtkToggleButton *button,
break;
}
- view = dzl_gtk_widget_get_relative (GTK_WIDGET (self), IDE_TYPE_SOURCE_VIEW);
+ view = ide_gtk_widget_get_relative (GTK_WIDGET (self), IDE_TYPE_SOURCE_VIEW);
gtk_widget_queue_draw (view);
g_signal_handlers_unblock_by_func (self->nobreak, G_CALLBACK (on_toggle_cb), self);
diff --git a/src/plugins/debuggerui/ide-debugger-hover-controls.h
b/src/plugins/debuggerui/ide-debugger-hover-controls.h
index c73df02e1..e5f6c2745 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-controls.h
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_HOVER_CONTROLS (ide_debugger_hover_controls_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerHoverControls, ide_debugger_hover_controls, IDE, DEBUGGER_HOVER_CONTROLS,
GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerHoverControls, ide_debugger_hover_controls, IDE, DEBUGGER_HOVER_CONTROLS,
AdwBin)
GtkWidget *ide_debugger_hover_controls_new (IdeDebugManager *debug_manager,
GFile *file,
diff --git a/src/plugins/debuggerui/ide-debugger-hover-controls.ui
b/src/plugins/debuggerui/ide-debugger-hover-controls.ui
index f0fb71d4a..a989d8e96 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-controls.ui
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerHoverControls" parent="GtkBin">
+ <template class="IdeDebuggerHoverControls" parent="AdwBin">
<child>
<object class="GtkBox">
<property name="visible">true</property>
diff --git a/src/plugins/debuggerui/ide-debugger-libraries-view.c
b/src/plugins/debuggerui/ide-debugger-libraries-view.c
index c06a4473b..8890996dc 100644
--- a/src/plugins/debuggerui/ide-debugger-libraries-view.c
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.c
@@ -22,13 +22,11 @@
#include "config.h"
-#include <dazzle.h>
-
#include "ide-debugger-libraries-view.h"
struct _IdeDebuggerLibrariesView
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
/* Template widgets */
GtkTreeView *tree_view;
@@ -39,7 +37,7 @@ struct _IdeDebuggerLibrariesView
GtkTreeViewColumn *target_column;
/* Onwed refnerences */
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debugger_signals;
};
enum {
@@ -55,7 +53,7 @@ static GParamSpec *properties [N_PROPS];
static void
ide_debugger_libraries_view_bind (IdeDebuggerLibrariesView *self,
IdeDebugger *debugger,
- DzlSignalGroup *signals)
+ IdeSignalGroup *signals)
{
g_assert (IDE_IS_DEBUGGER_LIBRARIES_VIEW (self));
g_assert (IDE_IS_DEBUGGER (debugger));
@@ -66,10 +64,10 @@ ide_debugger_libraries_view_bind (IdeDebuggerLibrariesView *self,
static void
ide_debugger_libraries_view_unbind (IdeDebuggerLibrariesView *self,
- DzlSignalGroup *signals)
+ IdeSignalGroup *signals)
{
g_assert (IDE_IS_DEBUGGER_LIBRARIES_VIEW (self));
- g_assert (DZL_IS_SIGNAL_GROUP (signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (signals));
gtk_widget_set_sensitive (GTK_WIDGET (self->tree_view), FALSE);
}
@@ -107,7 +105,7 @@ ide_debugger_libraries_view_library_loaded (IdeDebuggerLibrariesView *self,
g_assert (IDE_IS_DEBUGGER_LIBRARY (library));
g_assert (IDE_IS_DEBUGGER (debugger));
- dzl_gtk_list_store_insert_sorted (self->list_store,
+ ide_gtk_list_store_insert_sorted (self->list_store,
&iter, library, 0,
(GCompareDataFunc)ide_debugger_library_compare,
NULL);
@@ -290,7 +288,7 @@ ide_debugger_libraries_view_init (IdeDebuggerLibrariesView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
g_signal_connect_swapped (self->debugger_signals,
"bind",
@@ -302,22 +300,22 @@ ide_debugger_libraries_view_init (IdeDebuggerLibrariesView *self)
G_CALLBACK (ide_debugger_libraries_view_unbind),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"running",
G_CALLBACK (ide_debugger_libraries_view_running),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (ide_debugger_libraries_view_stopped),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"library-loaded",
G_CALLBACK (ide_debugger_libraries_view_library_loaded),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"library-unloaded",
G_CALLBACK (ide_debugger_libraries_view_library_unloaded),
self);
@@ -353,7 +351,7 @@ ide_debugger_libraries_view_get_debugger (IdeDebuggerLibrariesView *self)
g_return_val_if_fail (IDE_IS_DEBUGGER_LIBRARIES_VIEW (self), NULL);
if (self->debugger_signals != NULL)
- return dzl_signal_group_get_target (self->debugger_signals);
+ return ide_signal_group_get_target (self->debugger_signals);
return NULL;
}
@@ -364,6 +362,6 @@ ide_debugger_libraries_view_set_debugger (IdeDebuggerLibrariesView *self,
g_return_if_fail (IDE_IS_DEBUGGER_LIBRARIES_VIEW (self));
g_return_if_fail (!debugger || IDE_IS_DEBUGGER (debugger));
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
}
diff --git a/src/plugins/debuggerui/ide-debugger-libraries-view.h
b/src/plugins/debuggerui/ide-debugger-libraries-view.h
index 797b3a521..e4d0959ea 100644
--- a/src/plugins/debuggerui/ide-debugger-libraries-view.h
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_LIBRARIES_VIEW (ide_debugger_libraries_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerLibrariesView, ide_debugger_libraries_view, IDE, DEBUGGER_LIBRARIES_VIEW,
GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerLibrariesView, ide_debugger_libraries_view, IDE, DEBUGGER_LIBRARIES_VIEW,
AdwBin)
GtkWidget *ide_debugger_libraries_view_new (void);
IdeDebugger *ide_debugger_libraries_view_get_debugger (IdeDebuggerLibrariesView *self);
diff --git a/src/plugins/debuggerui/ide-debugger-libraries-view.ui
b/src/plugins/debuggerui/ide-debugger-libraries-view.ui
index e8dd3fbd7..bb2107bd2 100644
--- a/src/plugins/debuggerui/ide-debugger-libraries-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerLibrariesView" parent="GtkBin">
+ <template class="IdeDebuggerLibrariesView" parent="AdwBin">
<child>
<object class="GtkScrolledWindow">
<property name="visible">true</property>
diff --git a/src/plugins/debuggerui/ide-debugger-locals-view.c
b/src/plugins/debuggerui/ide-debugger-locals-view.c
index 35bdc4c1b..2aa51b715 100644
--- a/src/plugins/debuggerui/ide-debugger-locals-view.c
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.c
@@ -22,19 +22,19 @@
#include "config.h"
-#include <dazzle.h>
+#include <glib/gi18n.h>
+
#include <libide-core.h>
#include <libide-threading.h>
-#include <glib/gi18n.h>
#include "ide-debugger-locals-view.h"
struct _IdeDebuggerLocalsView
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
/* Owned references */
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debugger_signals;
/* Template references */
GtkTreeStore *tree_store;
@@ -222,14 +222,14 @@ ide_debugger_locals_view_init (IdeDebuggerLocalsView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"running",
G_CALLBACK (ide_debugger_locals_view_running),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (ide_debugger_locals_view_stopped),
self);
@@ -268,7 +268,7 @@ ide_debugger_locals_view_get_debugger (IdeDebuggerLocalsView *self)
{
g_return_val_if_fail (IDE_IS_DEBUGGER_LOCALS_VIEW (self), NULL);
- return dzl_signal_group_get_target (self->debugger_signals);
+ return ide_signal_group_get_target (self->debugger_signals);
}
void
@@ -278,7 +278,7 @@ ide_debugger_locals_view_set_debugger (IdeDebuggerLocalsView *self,
g_return_if_fail (IDE_IS_DEBUGGER_LOCALS_VIEW (self));
g_return_if_fail (!debugger || IDE_IS_DEBUGGER (debugger));
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
}
diff --git a/src/plugins/debuggerui/ide-debugger-locals-view.h
b/src/plugins/debuggerui/ide-debugger-locals-view.h
index c29887f6e..d4bea605d 100644
--- a/src/plugins/debuggerui/ide-debugger-locals-view.h
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_LOCALS_VIEW (ide_debugger_locals_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerLocalsView, ide_debugger_locals_view, IDE, DEBUGGER_LOCALS_VIEW, GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerLocalsView, ide_debugger_locals_view, IDE, DEBUGGER_LOCALS_VIEW, AdwBin)
GtkWidget *ide_debugger_locals_view_new (void);
IdeDebugger *ide_debugger_locals_view_get_debugger (IdeDebuggerLocalsView *self);
diff --git a/src/plugins/debuggerui/ide-debugger-locals-view.ui
b/src/plugins/debuggerui/ide-debugger-locals-view.ui
index 2c8515100..9e5d0d064 100644
--- a/src/plugins/debuggerui/ide-debugger-locals-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerLocalsView" parent="GtkBin">
+ <template class="IdeDebuggerLocalsView" parent="AdwBin">
<child>
<object class="GtkScrolledWindow">
<property name="min-content-width">300</property>
diff --git a/src/plugins/debuggerui/ide-debugger-registers-view.c
b/src/plugins/debuggerui/ide-debugger-registers-view.c
index 021f0aa8b..8492c2bb2 100644
--- a/src/plugins/debuggerui/ide-debugger-registers-view.c
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.c
@@ -22,17 +22,16 @@
#include "config.h"
-#include <dazzle.h>
#include <libide-core.h>
#include "ide-debugger-registers-view.h"
struct _IdeDebuggerRegistersView
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
/* Owned references */
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debugger_signals;
/* Template references */
GtkTreeView *tree_view;
@@ -58,11 +57,11 @@ static GParamSpec *properties [N_PROPS];
static void
ide_debugger_registers_view_bind (IdeDebuggerRegistersView *self,
IdeDebugger *debugger,
- DzlSignalGroup *signals)
+ IdeSignalGroup *signals)
{
g_assert (IDE_IS_DEBUGGER_REGISTERS_VIEW (self));
g_assert (IDE_IS_DEBUGGER (debugger));
- g_assert (DZL_IS_SIGNAL_GROUP (signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (signals));
gtk_widget_set_sensitive (GTK_WIDGET (self->tree_view),
!ide_debugger_get_is_running (debugger));
@@ -70,10 +69,10 @@ ide_debugger_registers_view_bind (IdeDebuggerRegistersView *self,
static void
ide_debugger_registers_view_unbind (IdeDebuggerRegistersView *self,
- DzlSignalGroup *signals)
+ IdeSignalGroup *signals)
{
g_assert (IDE_IS_DEBUGGER_REGISTERS_VIEW (self));
- g_assert (DZL_IS_SIGNAL_GROUP (signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (signals));
gtk_widget_set_sensitive (GTK_WIDGET (self->tree_view), FALSE);
}
@@ -122,7 +121,7 @@ ide_debugger_registers_view_list_registers_cb (GObject *object,
IdeDebuggerRegister *reg = g_ptr_array_index (registers, i);
GtkTreeIter iter;
- dzl_gtk_list_store_insert_sorted (self->list_store, &iter, reg, 0,
+ ide_gtk_list_store_insert_sorted (self->list_store, &iter, reg, 0,
(GCompareDataFunc)ide_debugger_register_compare,
NULL);
gtk_list_store_set (self->list_store, &iter, 0, reg, -1);
@@ -256,7 +255,7 @@ ide_debugger_registers_view_class_init (IdeDebuggerRegistersViewClass *klass)
static void
ide_debugger_registers_view_init (IdeDebuggerRegistersView *self)
{
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
gtk_widget_init_template (GTK_WIDGET (self));
@@ -270,12 +269,12 @@ ide_debugger_registers_view_init (IdeDebuggerRegistersView *self)
G_CALLBACK (ide_debugger_registers_view_unbind),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"running",
G_CALLBACK (ide_debugger_registers_view_running),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (ide_debugger_registers_view_stopped),
self);
@@ -315,7 +314,7 @@ ide_debugger_registers_view_get_debugger (IdeDebuggerRegistersView *self)
g_return_val_if_fail (IDE_IS_DEBUGGER_REGISTERS_VIEW (self), NULL);
if (self->debugger_signals != NULL)
- return dzl_signal_group_get_target (self->debugger_signals);
+ return ide_signal_group_get_target (self->debugger_signals);
return NULL;
}
@@ -329,7 +328,7 @@ ide_debugger_registers_view_set_debugger (IdeDebuggerRegistersView *self,
if (self->debugger_signals != NULL)
{
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
}
}
diff --git a/src/plugins/debuggerui/ide-debugger-registers-view.h
b/src/plugins/debuggerui/ide-debugger-registers-view.h
index 45b989503..e52d95653 100644
--- a/src/plugins/debuggerui/ide-debugger-registers-view.h
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_REGISTERS_VIEW (ide_debugger_registers_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerRegistersView, ide_debugger_registers_view, IDE, DEBUGGER_REGISTERS_VIEW,
GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerRegistersView, ide_debugger_registers_view, IDE, DEBUGGER_REGISTERS_VIEW,
AdwBin)
GtkWidget *ide_debugger_registers_view_new (void);
IdeDebugger *ide_debugger_registers_view_get_debugger (IdeDebuggerRegistersView *self);
diff --git a/src/plugins/debuggerui/ide-debugger-registers-view.ui
b/src/plugins/debuggerui/ide-debugger-registers-view.ui
index eab4a2b77..83e2fb461 100644
--- a/src/plugins/debuggerui/ide-debugger-registers-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerRegistersView" parent="GtkBin">
+ <template class="IdeDebuggerRegistersView" parent="AdwBin">
<child>
<object class="GtkScrolledWindow">
<property name="visible">true</property>
diff --git a/src/plugins/debuggerui/ide-debugger-threads-view.c
b/src/plugins/debuggerui/ide-debugger-threads-view.c
index c43b97868..3c327de3c 100644
--- a/src/plugins/debuggerui/ide-debugger-threads-view.c
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.c
@@ -22,19 +22,19 @@
#include "config.h"
-#include <dazzle.h>
+#include <glib/gi18n.h>
+
#include <libide-core.h>
#include <libide-gui.h>
-#include <glib/gi18n.h>
#include "ide-debugger-threads-view.h"
struct _IdeDebuggerThreadsView
{
- GtkBin parent_instance;
+ AdwBin parent_instance;
/* Owned references */
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debugger_signals;
/* Template References */
GtkTreeView *frames_tree_view;
@@ -175,7 +175,7 @@ ide_debugger_threads_view_thread_group_added (IdeDebuggerThreadsView *self,
g_assert (IDE_IS_DEBUGGER_THREAD_GROUP (group));
g_assert (IDE_IS_DEBUGGER (debugger));
- dzl_gtk_list_store_insert_sorted (self->thread_groups_store,
+ ide_gtk_list_store_insert_sorted (self->thread_groups_store,
&iter, group, 0,
(GCompareDataFunc)ide_debugger_thread_group_compare,
NULL);
@@ -225,7 +225,7 @@ ide_debugger_threads_view_thread_added (IdeDebuggerThreadsView *self,
g_assert (IDE_IS_DEBUGGER_THREAD (thread));
g_assert (IDE_IS_DEBUGGER (debugger));
- dzl_gtk_list_store_insert_sorted (self->threads_store,
+ ide_gtk_list_store_insert_sorted (self->threads_store,
&iter, thread, 0,
(GCompareDataFunc)ide_debugger_thread_compare,
NULL);
@@ -317,7 +317,7 @@ ide_debugger_threads_view_list_frames_cb (GObject *object,
static void
ide_debugger_threads_view_bind (IdeDebuggerThreadsView *self,
IdeDebugger *debugger,
- DzlSignalGroup *debugger_signals)
+ IdeSignalGroup *debugger_signals)
{
GListModel *thread_groups;
GListModel *threads;
@@ -325,7 +325,7 @@ ide_debugger_threads_view_bind (IdeDebuggerThreadsView *self,
g_assert (IDE_IS_DEBUGGER_THREADS_VIEW (self));
g_assert (IDE_IS_DEBUGGER (debugger));
- g_assert (DZL_IS_SIGNAL_GROUP (debugger_signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (debugger_signals));
/* Add any thread groups already loaded by the debugger */
@@ -356,10 +356,10 @@ ide_debugger_threads_view_bind (IdeDebuggerThreadsView *self,
static void
ide_debugger_threads_view_unbind (IdeDebuggerThreadsView *self,
- DzlSignalGroup *debugger_signals)
+ IdeSignalGroup *debugger_signals)
{
g_assert (IDE_IS_DEBUGGER_THREADS_VIEW (self));
- g_assert (DZL_IS_SIGNAL_GROUP (debugger_signals));
+ g_assert (IDE_IS_SIGNAL_GROUP (debugger_signals));
gtk_list_store_clear (self->thread_groups_store);
gtk_list_store_clear (self->threads_store);
@@ -469,7 +469,7 @@ binary_property_cell_data_func (GtkCellLayout *cell_layout,
g_assert (GTK_IS_TREE_MODEL (model));
g_assert (iter != NULL);
- debugger = dzl_signal_group_get_target (self->debugger_signals);
+ debugger = ide_signal_group_get_target (self->debugger_signals);
if (debugger == NULL)
return;
@@ -559,7 +559,7 @@ ide_debugger_threads_view_threads_row_activated (IdeDebuggerThreadsView *self,
g_assert (GTK_IS_TREE_VIEW (tree_view));
model = gtk_tree_view_get_model (tree_view);
- debugger = dzl_signal_group_get_target (self->debugger_signals);
+ debugger = ide_signal_group_get_target (self->debugger_signals);
if (debugger == NULL)
return;
@@ -721,34 +721,34 @@ ide_debugger_threads_view_init (IdeDebuggerThreadsView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"running",
G_CALLBACK (ide_debugger_threads_view_running),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (ide_debugger_threads_view_stopped),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"thread-group-added",
G_CALLBACK (ide_debugger_threads_view_thread_group_added),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"thread-group-removed",
G_CALLBACK (ide_debugger_threads_view_thread_group_removed),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"thread-added",
G_CALLBACK (ide_debugger_threads_view_thread_added),
self);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"thread-removed",
G_CALLBACK (ide_debugger_threads_view_thread_removed),
self);
@@ -817,7 +817,7 @@ ide_debugger_threads_view_get_debugger (IdeDebuggerThreadsView *self)
{
g_return_val_if_fail (IDE_IS_DEBUGGER_THREADS_VIEW (self), NULL);
- return dzl_signal_group_get_target (self->debugger_signals);
+ return ide_signal_group_get_target (self->debugger_signals);
}
void
@@ -827,5 +827,5 @@ ide_debugger_threads_view_set_debugger (IdeDebuggerThreadsView *self,
g_return_if_fail (IDE_IS_DEBUGGER_THREADS_VIEW (self));
g_return_if_fail (!debugger || IDE_IS_DEBUGGER (debugger));
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
}
diff --git a/src/plugins/debuggerui/ide-debugger-threads-view.h
b/src/plugins/debuggerui/ide-debugger-threads-view.h
index 1cdbaab88..d7d0989f4 100644
--- a/src/plugins/debuggerui/ide-debugger-threads-view.h
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_THREADS_VIEW (ide_debugger_threads_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerThreadsView, ide_debugger_threads_view, IDE, DEBUGGER_THREADS_VIEW, GtkBin)
+G_DECLARE_FINAL_TYPE (IdeDebuggerThreadsView, ide_debugger_threads_view, IDE, DEBUGGER_THREADS_VIEW, AdwBin)
IdeDebugger *ide_debugger_threads_view_get_debugger (IdeDebuggerThreadsView *self);
void ide_debugger_threads_view_set_debugger (IdeDebuggerThreadsView *self,
diff --git a/src/plugins/debuggerui/ide-debugger-threads-view.ui
b/src/plugins/debuggerui/ide-debugger-threads-view.ui
index 2f4ef2bcd..51dc49d9a 100644
--- a/src/plugins/debuggerui/ide-debugger-threads-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.ui
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerThreadsView" parent="GtkBin">
+ <template class="IdeDebuggerThreadsView" parent="AdwBin">
<child>
- <object class="DzlMultiPaned">
+ <object class="IdeMultiPaned">
<property name="orientation">horizontal</property>
<property name="visible">true</property>
<child>
diff --git a/src/plugins/debuggerui/ide-debugger-editor-addin.c
b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
similarity index 56%
rename from src/plugins/debuggerui/ide-debugger-editor-addin.c
rename to src/plugins/debuggerui/ide-debugger-workspace-addin.c
index 4307acbc0..96744565e 100644
--- a/src/plugins/debuggerui/ide-debugger-editor-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
@@ -1,4 +1,4 @@
-/* ide-debugger-editor-addin.c
+/* ide-debugger-workspace-addin.c
*
* Copyright 2017-2019 Christian Hergert <chergert redhat com>
*
@@ -18,23 +18,24 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#define G_LOG_DOMAIN "ide-debugger-editor-addin"
+#define G_LOG_DOMAIN "ide-debugger-workspace-addin"
#include "config.h"
+#include <glib/gi18n.h>
+
#include <libide-code.h>
#include <libide-core.h>
#include <libide-debugger.h>
-#include <libide-editor.h>
+#include <libide-workspace.h>
#include <libide-foundry.h>
#include <libide-gui.h>
#include <libide-io.h>
-#include <glib/gi18n.h>
#include "ide-debugger-breakpoints-view.h"
#include "ide-debugger-controls.h"
#include "ide-debugger-disassembly-view.h"
-#include "ide-debugger-editor-addin.h"
+#include "ide-debugger-workspace-addin.h"
#include "ide-debugger-libraries-view.h"
#include "ide-debugger-locals-view.h"
#include "ide-debugger-registers-view.h"
@@ -42,25 +43,25 @@
#include "ide-debugger-log-view.h"
/**
- * SECTION:ide-debugger-editor-addin
- * @title: IdeDebuggerEditorAddin
- * @short_description: Debugger hooks for the editor perspective
+ * SECTION:ide-debugger-workspace-addin
+ * @title: IdeDebuggerWorkspaceAddin
+ * @short_description: Debugger hooks for the workspace perspective
*
- * This class allows the debugger widgetry to hook into the editor. We add
- * various panels to the editor perpective and ensure they are only visible
+ * This class allows the debugger widgetry to hook into the workspace. We add
+ * various panels to the workspace perpective and ensure they are only visible
* when the process is being debugged.
*
* Since: 3.32
*/
-struct _IdeDebuggerEditorAddin
+struct _IdeDebuggerWorkspaceAddin
{
GObject parent_instance;
- DzlSignalGroup *debug_manager_signals;
- DzlSignalGroup *debugger_signals;
+ IdeSignalGroup *debug_manager_signals;
+ IdeSignalGroup *debugger_signals;
- IdeEditorSurface *editor;
+ IdeWorkspace *workspace;
IdeWorkbench *workbench;
IdeDebuggerDisassemblyView *disassembly_view;
@@ -68,33 +69,33 @@ struct _IdeDebuggerEditorAddin
IdeDebuggerBreakpointsView *breakpoints_view;
IdeDebuggerLibrariesView *libraries_view;
IdeDebuggerLocalsView *locals_view;
- DzlDockWidget *panel;
+ IdeDockWidget *panel;
IdeDebuggerRegistersView *registers_view;
IdeDebuggerThreadsView *threads_view;
IdeDebuggerLogView *log_view;
};
static void
-debugger_stopped (IdeDebuggerEditorAddin *self,
+debugger_stopped (IdeDebuggerWorkspaceAddin *self,
IdeDebuggerStopReason reason,
IdeDebuggerBreakpoint *breakpoint,
IdeDebugger *debugger)
{
IDE_ENTRY;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_assert (IDE_IS_DEBUGGER_STOP_REASON (reason));
g_assert (!breakpoint || IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
g_assert (IDE_IS_DEBUGGER (debugger));
if (breakpoint != NULL)
- ide_debugger_editor_addin_navigate_to_breakpoint (self, breakpoint);
+ ide_debugger_workspace_addin_navigate_to_breakpoint (self, breakpoint);
IDE_EXIT;
}
static void
-send_notification (IdeDebuggerEditorAddin *self,
+send_notification (IdeDebuggerWorkspaceAddin *self,
const gchar *title,
const gchar *body,
const gchar *icon_name,
@@ -104,7 +105,7 @@ send_notification (IdeDebuggerEditorAddin *self,
g_autoptr(GIcon) icon = NULL;
IdeContext *context;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
context = ide_workbench_get_context (self->workbench);
@@ -127,7 +128,7 @@ debugger_run_handler (IdeRunManager *run_manager,
IdeRunner *runner,
gpointer user_data)
{
- IdeDebuggerEditorAddin *self = user_data;
+ IdeDebuggerWorkspaceAddin *self = user_data;
IdeDebugManager *debug_manager;
IdeContext *context;
g_autoptr(GError) error = NULL;
@@ -136,7 +137,7 @@ debugger_run_handler (IdeRunManager *run_manager,
g_assert (IDE_IS_RUN_MANAGER (run_manager));
g_assert (IDE_IS_RUNNER (runner));
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
/*
* Get the currently configured debugger and attach it to our runner.
@@ -156,32 +157,20 @@ debugger_run_handler (IdeRunManager *run_manager,
}
static void
-debug_manager_notify_debugger (IdeDebuggerEditorAddin *self,
- GParamSpec *pspec,
- IdeDebugManager *debug_manager)
+debug_manager_notify_debugger (IdeDebuggerWorkspaceAddin *self,
+ GParamSpec *pspec,
+ IdeDebugManager *debug_manager)
{
IdeDebugger *debugger;
IdeWorkspace *workspace;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_assert (IDE_IS_DEBUG_MANAGER (debug_manager));
- if (!gtk_widget_get_visible (GTK_WIDGET (self->panel)))
- {
- GtkWidget *stack = gtk_widget_get_parent (GTK_WIDGET (self->panel));
-
- gtk_widget_show (GTK_WIDGET (self->panel));
-
- if (GTK_IS_STACK (stack))
- gtk_stack_set_visible_child (GTK_STACK (stack), GTK_WIDGET (self->panel));
- }
+ panel_widget_raise (self->panel);
debugger = ide_debug_manager_get_debugger (debug_manager);
-
- if ((workspace = ide_widget_get_workspace (GTK_WIDGET (self->editor))))
- gtk_widget_insert_action_group (GTK_WIDGET (workspace),
- "debugger",
- G_ACTION_GROUP (debugger));
+ gtk_widget_insert_action_group (GTK_WIDGET (self->workspace), "debugger", G_ACTION_GROUP (debugger));
ide_debugger_breakpoints_view_set_debugger (self->breakpoints_view, debugger);
ide_debugger_locals_view_set_debugger (self->locals_view, debugger);
@@ -190,17 +179,17 @@ debug_manager_notify_debugger (IdeDebuggerEditorAddin *self,
ide_debugger_threads_view_set_debugger (self->threads_view, debugger);
ide_debugger_log_view_set_debugger (self->log_view, debugger);
- dzl_signal_group_set_target (self->debugger_signals, debugger);
+ ide_signal_group_set_target (self->debugger_signals, debugger);
}
static void
-debug_manager_notify_active (IdeDebuggerEditorAddin *self,
+debug_manager_notify_active (IdeDebuggerWorkspaceAddin *self,
GParamSpec *pspec,
IdeDebugManager *debug_manager)
{
gboolean reveal_child = FALSE;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_assert (IDE_IS_DEBUG_MANAGER (debug_manager));
/*
@@ -219,7 +208,7 @@ debug_manager_notify_active (IdeDebuggerEditorAddin *self,
}
static void
-on_frame_activated (IdeDebuggerEditorAddin *self,
+on_frame_activated (IdeDebuggerWorkspaceAddin *self,
IdeDebuggerThread *thread,
IdeDebuggerFrame *frame,
IdeDebuggerThreadsView *threads_view)
@@ -230,7 +219,7 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
IDE_ENTRY;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_assert (IDE_IS_DEBUGGER_THREAD (thread));
g_assert (IDE_IS_DEBUGGER_FRAME (frame));
g_assert (IDE_IS_DEBUGGER_THREADS_VIEW (threads_view));
@@ -251,7 +240,7 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
g_autoptr(GFile) file = g_file_new_for_path (project_path);
location = ide_location_new (file, line, -1);
- ide_editor_surface_focus_location (self->editor, location);
+ ide_workspace_surface_focus_location (self->workspace, location);
IDE_EXIT;
}
@@ -260,7 +249,7 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
if (addr != IDE_DEBUGGER_ADDRESS_INVALID)
{
- ide_debugger_editor_addin_navigate_to_address (self, addr);
+ ide_debugger_workspace_addin_navigate_to_address (self, addr);
IDE_EXIT;
}
@@ -270,134 +259,104 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
}
static void
-ide_debugger_editor_addin_add_ui (IdeDebuggerEditorAddin *self)
+ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
{
- GtkWidget *box;
- GtkWidget *hpaned;
- GtkWidget *utilities;
- GtkWidget *overlay;
+ GtkNotebook *notebook;
+ PanelPaned *hpaned;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_SURFACE (self->editor));
-
-#define OBSERVE_DESTROY(ptr) \
- g_signal_connect ((ptr), "destroy", G_CALLBACK (gtk_widget_destroyed), &(ptr))
-
- overlay = ide_editor_surface_get_overlay (self->editor);
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
+ g_assert (IDE_IS_WORKSPACE_SURFACE (self->workspace));
self->controls = g_object_new (IDE_TYPE_DEBUGGER_CONTROLS,
"transition-duration", 500,
"transition-type", GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
"reveal-child", FALSE,
- "visible", TRUE,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_END,
NULL);
- OBSERVE_DESTROY (self->controls);
- gtk_overlay_add_overlay (GTK_OVERLAY (overlay), GTK_WIDGET (self->controls));
+ ide_workspace_add_overlay (self->workspace, GTK_WIDGET (self->controls));
- self->panel = g_object_new (DZL_TYPE_DOCK_WIDGET,
+ self->panel = g_object_new (IDE_TYPE_PANE,
"title", _("Debugger"),
"icon-name", "builder-debugger-symbolic",
"visible", FALSE,
NULL);
- OBSERVE_DESTROY (self->panel);
- box = g_object_new (GTK_TYPE_NOTEBOOK,
- "visible", TRUE,
- NULL);
- gtk_container_add (GTK_CONTAINER (self->panel), box);
+ notebook = g_object_new (GTK_TYPE_NOTEBOOK, NULL);
+ panel_widget_set_child (PANEL_WIDGET (self->panel), GTK_WIDGET (notebook));
- hpaned = g_object_new (DZL_TYPE_MULTI_PANED,
+ hpaned = g_object_new (PANEL_TYPE_PANED,
"orientation", GTK_ORIENTATION_HORIZONTAL,
"visible", TRUE,
NULL);
- gtk_container_add_with_properties (GTK_CONTAINER (box), GTK_WIDGET (hpaned),
- "tab-label", _("Threads"),
- NULL);
+ gtk_notebook_append_page (notebook, GTK_WIDGET (hpaned), gtk_label_new (_("Threads")));
self->threads_view = g_object_new (IDE_TYPE_DEBUGGER_THREADS_VIEW,
"hexpand", TRUE,
- "visible", TRUE,
NULL);
- OBSERVE_DESTROY (self->threads_view);
g_signal_connect_swapped (self->threads_view,
"frame-activated",
G_CALLBACK (on_frame_activated),
self);
- gtk_container_add (GTK_CONTAINER (hpaned), GTK_WIDGET (self->threads_view));
+ panel_paned_append (hpaned, GTK_WIDGET (self->threads_view));
self->locals_view = g_object_new (IDE_TYPE_DEBUGGER_LOCALS_VIEW,
"width-request", 250,
- "visible", TRUE,
NULL);
- OBSERVE_DESTROY (self->locals_view);
- gtk_container_add (GTK_CONTAINER (hpaned), GTK_WIDGET (self->locals_view));
-
- self->breakpoints_view = g_object_new (IDE_TYPE_DEBUGGER_BREAKPOINTS_VIEW,
- "visible", TRUE,
- NULL);
- OBSERVE_DESTROY (self->breakpoints_view);
- gtk_container_add_with_properties (GTK_CONTAINER (box), GTK_WIDGET (self->breakpoints_view),
- "tab-label", _("Breakpoints"),
- NULL);
+ panel_paned_append (hpaned, GTK_WIDGET (self->locals_view));
- self->libraries_view = g_object_new (IDE_TYPE_DEBUGGER_LIBRARIES_VIEW,
- "visible", TRUE,
- NULL);
- OBSERVE_DESTROY (self->libraries_view);
- gtk_container_add_with_properties (GTK_CONTAINER (box), GTK_WIDGET (self->libraries_view),
- "tab-label", _("Libraries"),
- NULL);
+ self->breakpoints_view = g_object_new (IDE_TYPE_DEBUGGER_BREAKPOINTS_VIEW, NULL);
+ gtk_notebook_append_page (notebook,
+ GTK_WIDGET (self->breakpoints_view),
+ gtk_label_new (_("Breakpoints")));
- self->registers_view = g_object_new (IDE_TYPE_DEBUGGER_REGISTERS_VIEW,
- "visible", TRUE,
- NULL);
- OBSERVE_DESTROY (self->registers_view);
- gtk_container_add_with_properties (GTK_CONTAINER (box), GTK_WIDGET (self->registers_view),
- "tab-label", _("Registers"),
- NULL);
- self->log_view = g_object_new (IDE_TYPE_DEBUGGER_LOG_VIEW,
- "visible", TRUE,
- NULL);
- OBSERVE_DESTROY (self->log_view);
- gtk_container_add_with_properties (GTK_CONTAINER (box), GTK_WIDGET (self->log_view),
- "tab-label", _("Console"),
- NULL);
+ self->libraries_view = g_object_new (IDE_TYPE_DEBUGGER_LIBRARIES_VIEW, NULL);
+ gtk_notebook_append_page (notebook,
+ GTK_WIDGET (self->libraries_view),
+ gtk_label_new (_("Libraries")));
+
+ self->registers_view = g_object_new (IDE_TYPE_DEBUGGER_REGISTERS_VIEW, NULL);
+ gtk_notebook_append_page (notebook,
+ GTK_WIDGET (self->registers_view),
+ gtk_label_new (_("Registers")));
- utilities = ide_editor_surface_get_utilities (self->editor);
- gtk_container_add (GTK_CONTAINER (utilities), GTK_WIDGET (self->panel));
+ self->log_view = g_object_new (IDE_TYPE_DEBUGGER_LOG_VIEW, NULL);
+ gtk_notebook_append_page (notebook,
+ GTK_WIDGET (self->log_view),
+ gtk_label_new (_("Console")));
-#undef OBSERVE_DESTROY
+ position = ide_panel_position_new ();
+ ide_panel_position_set_edge (position, PANEL_DOCK_POSITION_BOTTOM);
+
+ ide_workspace_add_pane (self->workspace, IDE_PANE (self->panel), position);
}
static void
-ide_debugger_editor_addin_load (IdeEditorAddin *addin,
- IdeEditorSurface *editor)
+ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
+ IdeWorkspaceSurface *workspace)
{
- IdeDebuggerEditorAddin *self = (IdeDebuggerEditorAddin *)addin;
- IdeContext *context;
- IdeRunManager *run_manager;
+ IdeDebuggerWorkspaceAddin *self = (IdeDebuggerWorkspaceAddin *)addin;
IdeDebugManager *debug_manager;
+ IdeRunManager *run_manager;
IdeWorkspace *workspace;
+ IdeContext *context;
IDE_ENTRY;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_SURFACE (editor));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
+ g_assert (IDE_IS_WORKSPACE_SURFACE (workspace));
- self->editor = editor;
- self->workbench = ide_widget_get_workbench (GTK_WIDGET (editor));
- workspace = ide_widget_get_workspace (GTK_WIDGET (editor));
+ self->workspace = workspace;
+ self->workbench = ide_widget_get_workbench (GTK_WIDGET (workspace));
if (!ide_workbench_has_project (self->workbench) || !IDE_IS_PRIMARY_WORKSPACE (workspace))
return;
- context = ide_widget_get_context (GTK_WIDGET (editor));
+ context = ide_widget_get_context (GTK_WIDGET (workspace));
run_manager = ide_run_manager_from_context (context);
debug_manager = ide_debug_manager_from_context (context);
- ide_debugger_editor_addin_add_ui (self);
+ ide_debugger_workspace_addin_add_ui (self);
ide_run_manager_add_handler (run_manager,
"debugger",
@@ -408,119 +367,115 @@ ide_debugger_editor_addin_load (IdeEditorAddin *addin,
g_object_ref (self),
g_object_unref);
- self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
+ self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"log",
G_CALLBACK (ide_debugger_log_view_debugger_log),
self->log_view);
- dzl_signal_group_connect_swapped (self->debugger_signals,
+ ide_signal_group_connect_swapped (self->debugger_signals,
"stopped",
G_CALLBACK (debugger_stopped),
self);
- self->debug_manager_signals = dzl_signal_group_new (IDE_TYPE_DEBUG_MANAGER);
+ self->debug_manager_signals = ide_signal_group_new (IDE_TYPE_DEBUG_MANAGER);
- dzl_signal_group_connect_swapped (self->debug_manager_signals,
+ ide_signal_group_connect_swapped (self->debug_manager_signals,
"notify::active",
G_CALLBACK (debug_manager_notify_active),
self);
- dzl_signal_group_connect_swapped (self->debug_manager_signals,
+ ide_signal_group_connect_swapped (self->debug_manager_signals,
"notify::debugger",
G_CALLBACK (debug_manager_notify_debugger),
self);
- dzl_signal_group_set_target (self->debug_manager_signals, debug_manager);
+ ide_signal_group_set_target (self->debug_manager_signals, debug_manager);
IDE_EXIT;
}
static void
-ide_debugger_editor_addin_unload (IdeEditorAddin *addin,
- IdeEditorSurface *editor)
+ide_debugger_workspace_addin_unload (IdeWorkspaceAddin *addin,
+ IdeWorkspaceSurface *workspace)
{
- IdeDebuggerEditorAddin *self = (IdeDebuggerEditorAddin *)addin;
+ IdeDebuggerWorkspaceAddin *self = (IdeDebuggerWorkspaceAddin *)addin;
IdeRunManager *run_manager;
IdeWorkspace *workspace;
IdeContext *context;
IDE_ENTRY;
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_SURFACE (editor));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
+ g_assert (IDE_IS_WORKSPACE_SURFACE (workspace));
if (!ide_workbench_has_project (self->workbench))
return;
- context = ide_workbench_get_context (self->workbench);
- run_manager = ide_run_manager_from_context (context);
-
- if ((workspace = ide_widget_get_workspace (GTK_WIDGET (editor))))
- gtk_widget_insert_action_group (GTK_WIDGET (workspace), "debugger", NULL);
+ gtk_widget_insert_action_group (GTK_WIDGET (self->workspace), "debugger", NULL);
/* Remove the handler to initiate the debugger */
+ context = ide_workbench_get_context (self->workbench);
+ run_manager = ide_run_manager_from_context (context);
ide_run_manager_remove_handler (run_manager, "debugger");
g_clear_object (&self->debugger_signals);
g_clear_object (&self->debug_manager_signals);
- if (self->panel != NULL)
- gtk_widget_destroy (GTK_WIDGET (self->panel));
- if (self->controls != NULL)
- gtk_widget_destroy (GTK_WIDGET (self->controls));
- if (self->disassembly_view != NULL)
- gtk_widget_destroy (GTK_WIDGET (self->disassembly_view));
+ g_clear_pointer ((PanelWidget **)&self->panel, panel_widget_close);
+ g_clear_pointer ((PanelWidget **)&self->disassembly_view, panel_widget_close);
- self->editor = NULL;
+ ide_workspace_remove_overlay (self->workspace, GTK_WIDGET (self->controls));
+
+ self->controls = NULL;
+ self->workspace = NULL;
self->workbench = NULL;
IDE_EXIT;
}
static void
-editor_addin_iface_init (IdeEditorAddinInterface *iface)
+workspace_addin_iface_init (IdeWorkspaceAddinInterface *iface)
{
- iface->load = ide_debugger_editor_addin_load;
- iface->unload = ide_debugger_editor_addin_unload;
+ iface->load = ide_debugger_workspace_addin_load;
+ iface->unload = ide_debugger_workspace_addin_unload;
}
-G_DEFINE_FINAL_TYPE_WITH_CODE (IdeDebuggerEditorAddin, ide_debugger_editor_addin, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_EDITOR_ADDIN, editor_addin_iface_init))
+G_DEFINE_FINAL_TYPE_WITH_CODE (IdeDebuggerWorkspaceAddin, ide_debugger_workspace_addin, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_WORKSPACE_ADDIN, workspace_addin_iface_init))
static void
-ide_debugger_editor_addin_class_init (IdeDebuggerEditorAddinClass *klass)
+ide_debugger_workspace_addin_class_init (IdeDebuggerWorkspaceAddinClass *klass)
{
}
static void
-ide_debugger_editor_addin_init (IdeDebuggerEditorAddin *self)
+ide_debugger_workspace_addin_init (IdeDebuggerWorkspaceAddin *self)
{
}
void
-ide_debugger_editor_addin_navigate_to_file (IdeDebuggerEditorAddin *self,
- GFile *file,
- guint line)
+ide_debugger_workspace_addin_navigate_to_file (IdeDebuggerWorkspaceAddin *self,
+ GFile *file,
+ guint line)
{
g_autoptr(IdeLocation) location = NULL;
- g_return_if_fail (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_return_if_fail (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_return_if_fail (G_IS_FILE (file));
location = ide_location_new (file, line, -1);
-
- ide_editor_surface_focus_location (self->editor, location);
+ ide_editor_focus_location (self->workspace, NULL, location);
}
static void
-ide_debugger_editor_addin_disassemble_cb (GObject *object,
- GAsyncResult *result,
- gpointer user_data)
+ide_debugger_workspace_addin_disassemble_cb (GObject *object,
+ GAsyncResult *result,
+ gpointer user_data)
{
IdeDebugger *debugger = (IdeDebugger *)object;
- g_autoptr(IdeDebuggerEditorAddin) self = user_data;
+ g_autoptr(IdeDebuggerWorkspaceAddin) self = user_data;
g_autoptr(GPtrArray) instructions = NULL;
g_autoptr(GError) error = NULL;
GtkWidget *stack;
@@ -529,7 +484,7 @@ ide_debugger_editor_addin_disassemble_cb (GObject *object,
g_assert (IDE_IS_DEBUGGER (debugger));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
instructions = ide_debugger_disassemble_finish (debugger, result, &error);
@@ -539,38 +494,28 @@ ide_debugger_editor_addin_disassemble_cb (GObject *object,
IDE_EXIT;
}
- if (self->editor == NULL)
+ if (self->workspace == NULL)
IDE_EXIT;
if (self->disassembly_view == NULL)
{
- IdeGrid *grid = ide_editor_surface_get_grid (self->editor);
-
- self->disassembly_view = g_object_new (IDE_TYPE_DEBUGGER_DISASSEMBLY_VIEW,
- "visible", TRUE,
- NULL);
- g_signal_connect (self->disassembly_view,
- "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &self->disassembly_view);
- gtk_container_add (GTK_CONTAINER (grid), GTK_WIDGET (self->disassembly_view));
+ g_autoptr(IdePanelPosition) position = ide_panel_position_new ();
+
+ self->disassembly_view = g_object_new (IDE_TYPE_DEBUGGER_DISASSEMBLY_VIEW, NULL);
+ ide_workspace_add_page (self->workspace, IDE_PAGE (self->disassembly_view), posittion);
}
ide_debugger_disassembly_view_set_instructions (self->disassembly_view, instructions);
/* TODO: Set current instruction */
- /* FIXME: It would be nice if we had a nicer API for this */
- stack = gtk_widget_get_ancestor (GTK_WIDGET (self->disassembly_view), IDE_TYPE_FRAME);
- if (stack != NULL)
- ide_frame_set_visible_child (IDE_FRAME (stack),
- IDE_PAGE (self->disassembly_view));
+ panel_widget_raise (PANEL_WIDGET (self->disassembly_view));
IDE_EXIT;
}
void
-ide_debugger_editor_addin_navigate_to_address (IdeDebuggerEditorAddin *self,
+ide_debugger_workspace_addin_navigate_to_address (IdeDebuggerWorkspaceAddin *self,
IdeDebuggerAddress address)
{
IdeDebugger *debugger;
@@ -578,10 +523,10 @@ ide_debugger_editor_addin_navigate_to_address (IdeDebuggerEditorAddin *self,
IDE_ENTRY;
- g_return_if_fail (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_return_if_fail (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_return_if_fail (address != IDE_DEBUGGER_ADDRESS_INVALID);
- if (NULL == (debugger = dzl_signal_group_get_target (self->debugger_signals)))
+ if (NULL == (debugger = ide_signal_group_get_target (self->debugger_signals)))
IDE_EXIT;
if (address < 0x10)
@@ -597,7 +542,7 @@ ide_debugger_editor_addin_navigate_to_address (IdeDebuggerEditorAddin *self,
ide_debugger_disassemble_async (debugger,
&range,
NULL,
- ide_debugger_editor_addin_disassemble_cb,
+ ide_debugger_workspace_addin_disassemble_cb,
g_object_ref (self));
IDE_EXIT;
@@ -605,7 +550,7 @@ ide_debugger_editor_addin_navigate_to_address (IdeDebuggerEditorAddin *self,
}
void
-ide_debugger_editor_addin_navigate_to_breakpoint (IdeDebuggerEditorAddin *self,
+ide_debugger_workspace_addin_navigate_to_breakpoint (IdeDebuggerWorkspaceAddin *self,
IdeDebuggerBreakpoint *breakpoint)
{
IdeDebuggerAddress address;
@@ -614,7 +559,7 @@ ide_debugger_editor_addin_navigate_to_breakpoint (IdeDebuggerEditorAddin *self,
IDE_ENTRY;
- g_return_if_fail (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+ g_return_if_fail (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_return_if_fail (IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
address = ide_debugger_breakpoint_get_address (breakpoint);
@@ -627,11 +572,11 @@ ide_debugger_editor_addin_navigate_to_breakpoint (IdeDebuggerEditorAddin *self,
if (path != NULL)
{
g_autoptr(GFile) file = g_file_new_for_path (path);
- ide_debugger_editor_addin_navigate_to_file (self, file, line);
+ ide_debugger_workspace_addin_navigate_to_file (self, file, line);
}
else if (address != IDE_DEBUGGER_ADDRESS_INVALID)
{
- ide_debugger_editor_addin_navigate_to_address (self, address);
+ ide_debugger_workspace_addin_navigate_to_address (self, address);
}
IDE_EXIT;
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.h
b/src/plugins/debuggerui/ide-debugger-workspace-addin.h
new file mode 100644
index 000000000..b4b70b5bb
--- /dev/null
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.h
@@ -0,0 +1,39 @@
+/* ide-debugger-workspace-addin.h
+ *
+ * Copyright 2017-2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-debugger.h>
+
+G_BEGIN_DECLS
+
+#define IDE_TYPE_DEBUGGER_WORKSPACE_ADDIN (ide_debugger_workspace_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (IdeDebuggerWorkspaceAddin, ide_debugger_workspace_addin, IDE,
DEBUGGER_WORKSPACE_ADDIN, GObject)
+
+void ide_debugger_workspace_addin_navigate_to_address (IdeDebuggerWorkspaceAddin *self,
+ IdeDebuggerAddress address);
+void ide_debugger_workspace_addin_navigate_to_breakpoint (IdeDebuggerWorkspaceAddin *self,
+ IdeDebuggerBreakpoint *breakpoint);
+void ide_debugger_workspace_addin_navigate_to_file (IdeDebuggerWorkspaceAddin *self,
+ GFile *file,
+ guint line);
+
+G_END_DECLS
diff --git a/src/plugins/debuggerui/meson.build b/src/plugins/debuggerui/meson.build
index d36812c83..1a7aa48fe 100644
--- a/src/plugins/debuggerui/meson.build
+++ b/src/plugins/debuggerui/meson.build
@@ -3,7 +3,7 @@ plugins_sources += files([
'ide-debugger-breakpoints-view.c',
'ide-debugger-controls.c',
'ide-debugger-disassembly-view.c',
- 'ide-debugger-editor-addin.c',
+ 'ide-debugger-workspace-addin.c',
'ide-debugger-hover-controls.c',
'ide-debugger-hover-provider.c',
'ide-debugger-libraries-view.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]