[gnome-builder/wip/gtk4-port: 610/736] plugins/debuggerui: finish basic port of debuggerui
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 610/736] plugins/debuggerui: finish basic port of debuggerui
- Date: Tue, 26 Apr 2022 01:46:32 +0000 (UTC)
commit e348bdac195a410c91cb3a6cd52095fdbe2b575b
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 18 07:11:35 2022 -0700
plugins/debuggerui: finish basic port of debuggerui
Nothing has been tested yet of course, but this at least gets things to
compile in what we'd expect the changes to be like.
src/plugins/debuggerui/debuggerui-plugin.c | 2 +-
.../debuggerui/ide-debugger-breakpoints-view.c | 26 ++--
.../debuggerui/ide-debugger-breakpoints-view.h | 2 +-
src/plugins/debuggerui/ide-debugger-controls.c | 40 +++++-
src/plugins/debuggerui/ide-debugger-controls.h | 13 +-
src/plugins/debuggerui/ide-debugger-controls.ui | 143 +++++++++++----------
.../debuggerui/ide-debugger-disassembly-view.c | 9 +-
.../debuggerui/ide-debugger-hover-controls.c | 15 +--
.../debuggerui/ide-debugger-hover-controls.h | 2 +-
.../debuggerui/ide-debugger-hover-provider.c | 48 ++++---
.../debuggerui/ide-debugger-libraries-view.c | 13 +-
.../debuggerui/ide-debugger-libraries-view.h | 2 +-
src/plugins/debuggerui/ide-debugger-locals-view.c | 2 +-
src/plugins/debuggerui/ide-debugger-locals-view.h | 2 +-
src/plugins/debuggerui/ide-debugger-log-view.c | 4 +-
.../debuggerui/ide-debugger-registers-view.c | 12 +-
.../debuggerui/ide-debugger-registers-view.h | 2 +-
src/plugins/debuggerui/ide-debugger-threads-view.c | 2 +-
src/plugins/debuggerui/ide-debugger-threads-view.h | 2 +-
.../debuggerui/ide-debugger-workspace-addin.c | 56 ++++----
src/plugins/meson.build | 2 +-
21 files changed, 220 insertions(+), 179 deletions(-)
---
diff --git a/src/plugins/debuggerui/debuggerui-plugin.c b/src/plugins/debuggerui/debuggerui-plugin.c
index 950da53c2..6412c2a37 100644
--- a/src/plugins/debuggerui/debuggerui-plugin.c
+++ b/src/plugins/debuggerui/debuggerui-plugin.c
@@ -34,7 +34,7 @@ void
_gbp_debuggerui_register_types (PeasObjectModule *module)
{
peas_object_module_register_extension_type (module,
- IDE_TYPE_HOVER_PROVIDER,
+ GTK_SOURCE_TYPE_HOVER_PROVIDER,
IDE_TYPE_DEBUGGER_HOVER_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_WORKSPACE_ADDIN,
diff --git a/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
index a20056b5d..7efdddb22 100644
--- a/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
@@ -22,6 +22,8 @@
#include "config.h"
+#include <libide-gtk.h>
+
#include "ide-debugger-breakpoints-view.h"
struct _IdeDebuggerBreakpointsView
@@ -60,7 +62,7 @@ enum {
N_PROPS
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerBreakpointsView, ide_debugger_breakpoints_view, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerBreakpointsView, ide_debugger_breakpoints_view, ADW_TYPE_BIN)
static GParamSpec *properties [N_PROPS];
@@ -340,6 +342,7 @@ bool_property_cell_data_func (GtkCellLayout *cell_layout,
g_object_set_property (G_OBJECT (cell), "active", &value);
}
+#if 0
static void
ide_debugger_breakpoints_view_delete_breakpoint (GtkTreeView *tree_view,
IdeDebuggerBreakpointsView *self)
@@ -369,15 +372,16 @@ ide_debugger_breakpoints_view_delete_breakpoint (GtkTreeView *tre
ide_debugger_remove_breakpoint_async (debugger, breakpoint, NULL, NULL, NULL);
}
}
+#endif
static void
-ide_debugger_breakpoints_view_destroy (GtkWidget *widget)
+ide_debugger_breakpoints_view_dispose (GObject *object)
{
- IdeDebuggerBreakpointsView *self = (IdeDebuggerBreakpointsView *)widget;
+ IdeDebuggerBreakpointsView *self = (IdeDebuggerBreakpointsView *)object;
g_clear_object (&self->debugger_signals);
- GTK_WIDGET_CLASS (ide_debugger_breakpoints_view_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (ide_debugger_breakpoints_view_parent_class)->dispose (object);
}
static void
@@ -424,11 +428,10 @@ ide_debugger_breakpoints_view_class_init (IdeDebuggerBreakpointsViewClass *klass
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = ide_debugger_breakpoints_view_dispose;
object_class->get_property = ide_debugger_breakpoints_view_get_property;
object_class->set_property = ide_debugger_breakpoints_view_set_property;
- widget_class->destroy = ide_debugger_breakpoints_view_destroy;
-
properties [PROP_DEBUGGER] =
g_param_spec_object ("debugger",
"Debugger",
@@ -466,8 +469,6 @@ ide_debugger_breakpoints_view_class_init (IdeDebuggerBreakpointsViewClass *klass
static void
ide_debugger_breakpoints_view_init (IdeDebuggerBreakpointsView *self)
{
- IdeShortcutController *controller;
-
gtk_widget_init_template (GTK_WIDGET (self));
self->debugger_signals = ide_signal_group_new (IDE_TYPE_DEBUGGER);
@@ -544,15 +545,6 @@ ide_debugger_breakpoints_view_init (IdeDebuggerBreakpointsView *self)
"toggled",
G_CALLBACK (ide_debugger_breakpoints_view_enabled_toggled),
self);
-
- controller = ide_shortcut_controller_find (GTK_WIDGET (self->tree_view));
-
- ide_shortcut_controller_add_command_callback (controller,
- "org.gnome.builder.debugger.delete-breakpoint",
- "Delete",
- IDE_SHORTCUT_PHASE_BUBBLE,
- (GtkCallback)
ide_debugger_breakpoints_view_delete_breakpoint,
- self, NULL);
}
GtkWidget *
diff --git a/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
index 8e2251d10..1d3b187b7 100644
--- a/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debugger.h"
diff --git a/src/plugins/debuggerui/ide-debugger-controls.c b/src/plugins/debuggerui/ide-debugger-controls.c
index d2a5d4c84..2d6e259e4 100644
--- a/src/plugins/debuggerui/ide-debugger-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-controls.c
@@ -18,22 +18,41 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
+#define G_LOG_DOMAIN "ide-debugger-controls"
+
+#include "config.h"
+
#include "ide-debugger-controls.h"
struct _IdeDebuggerControls
{
- AdwBin parent_instance;
+ GtkWidget parent_instance;
+ GtkRevealer *revealer;
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerControls, ide_debugger_controls, GTK_TYPE_REVEALER)
+G_DEFINE_FINAL_TYPE (IdeDebuggerControls, ide_debugger_controls, GTK_TYPE_WIDGET)
+
+static void
+ide_debugger_controls_dispose (GObject *object)
+{
+ IdeDebuggerControls *self = (IdeDebuggerControls *)object;
+
+ g_clear_pointer ((GtkWidget **)&self->revealer, gtk_widget_unparent);
+
+ G_OBJECT_CLASS (ide_debugger_controls_parent_class)->dispose (object);
+}
static void
ide_debugger_controls_class_init (IdeDebuggerControlsClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = ide_debugger_controls_dispose;
+
gtk_widget_class_set_template_from_resource (widget_class, "/plugins/debuggerui/ide-debugger-controls.ui");
gtk_widget_class_set_css_name (widget_class, "idedebuggercontrols");
+ gtk_widget_class_bind_template_child (widget_class, IdeDebuggerControls, revealer);
}
static void
@@ -41,3 +60,20 @@ ide_debugger_controls_init (IdeDebuggerControls *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
+
+void
+ide_debugger_controls_set_reveal_child (IdeDebuggerControls *self,
+ gboolean reveal_child)
+{
+ g_return_if_fail (IDE_IS_DEBUGGER_CONTROLS (self));
+
+ gtk_revealer_set_reveal_child (self->revealer, reveal_child);
+}
+
+gboolean
+ide_debugger_controls_get_reveal_child (IdeDebuggerControls *self)
+{
+ g_return_val_if_fail (IDE_IS_DEBUGGER_CONTROLS (self), FALSE);
+
+ return gtk_revealer_get_reveal_child (self->revealer);
+}
diff --git a/src/plugins/debuggerui/ide-debugger-controls.h b/src/plugins/debuggerui/ide-debugger-controls.h
index eaff84473..0ea8b4b2b 100644
--- a/src/plugins/debuggerui/ide-debugger-controls.h
+++ b/src/plugins/debuggerui/ide-debugger-controls.h
@@ -28,10 +28,13 @@ G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_CONTROLS (ide_debugger_controls_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerControls, ide_debugger_controls, IDE, DEBUGGER_CONTROLS, GtkRevealer)
-
-IdeDebugger *ide_debugger_controls_get_debugger (IdeDebuggerControls *self);
-void ide_debugger_controls_set_debugger (IdeDebuggerControls *self,
- IdeDebugger *debugger);
+G_DECLARE_FINAL_TYPE (IdeDebuggerControls, ide_debugger_controls, IDE, DEBUGGER_CONTROLS, GtkWidget)
+
+IdeDebugger *ide_debugger_controls_get_debugger (IdeDebuggerControls *self);
+void ide_debugger_controls_set_debugger (IdeDebuggerControls *self,
+ IdeDebugger *debugger);
+gboolean ide_debugger_controls_get_reveal_child (IdeDebuggerControls *self);
+void ide_debugger_controls_set_reveal_child (IdeDebuggerControls *self,
+ gboolean reveal_child);
G_END_DECLS
diff --git a/src/plugins/debuggerui/ide-debugger-controls.ui b/src/plugins/debuggerui/ide-debugger-controls.ui
index 6bc79c5aa..b2ae4bd21 100644
--- a/src/plugins/debuggerui/ide-debugger-controls.ui
+++ b/src/plugins/debuggerui/ide-debugger-controls.ui
@@ -2,104 +2,111 @@
<interface>
<template class="IdeDebuggerControls" parent="GtkRevealer">
<child>
- <object class="GtkFrame">
- <property name="visible">true</property>
+ <object class="GtkRevealer" id="revealer">
+ <property name="reveal-child">false</property>
+ <property name="transition-type">slide-up</property>
+ <property name="transition-duration">300</property>
<child>
- <object class="GtkBox">
- <property name="orientation">horizontal</property>
+ <object class="GtkFrame">
<property name="visible">true</property>
- <style>
- <class name="linked"/>
- </style>
<child>
- <object class="GtkButton" id="pause_button">
- <property name="action-name">debugger.stop</property>
- <property name="tooltip-text" translatable="yes">Interrupt the program</property>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
<property name="visible">true</property>
+ <style>
+ <class name="linked"/>
+ </style>
<child>
- <object class="GtkImage">
- <property name="icon-name">media-playback-pause-symbolic</property>
+ <object class="GtkButton" id="pause_button">
+ <property name="action-name">debugger.stop</property>
+ <property name="tooltip-text" translatable="yes">Interrupt the program</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">media-playback-pause-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="continue_button">
- <property name="action-name">debugger.continue</property>
- <property name="tooltip-text" translatable="yes">Continue running the program</property>
- <property name="visible">true</property>
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-continue-symbolic</property>
+ <object class="GtkButton" id="continue_button">
+ <property name="action-name">debugger.continue</property>
+ <property name="tooltip-text" translatable="yes">Continue running the program</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-continue-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <!--
- <child>
- <object class="GtkButton" id="execute_from_cursor_button">
- <property name="action-name">debugger.execute-from-cursor</property>
- <property name="tooltip-text" translatable="yes">Execute from the current cursor
position</property>
- <property name="visible">true</property>
+ <!--
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-execute-from-cursor-symbolic</property>
+ <object class="GtkButton" id="execute_from_cursor_button">
+ <property name="action-name">debugger.execute-from-cursor</property>
+ <property name="tooltip-text" translatable="yes">Execute from the current cursor
position</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-execute-from-cursor-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="execute_to_cursor_button">
- <property name="action-name">debugger.execute-to-cursor</property>
- <property name="tooltip-text" translatable="yes">Execute until reaching the current cursor
position</property>
- <property name="visible">true</property>
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-execute-to-cursor-symbolic</property>
+ <object class="GtkButton" id="execute_to_cursor_button">
+ <property name="action-name">debugger.execute-to-cursor</property>
+ <property name="tooltip-text" translatable="yes">Execute until reaching the current
cursor position</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-execute-to-cursor-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- -->
- <child>
- <object class="GtkButton" id="step_in_button">
- <property name="action-name">debugger.step-in</property>
- <property name="tooltip-text" translatable="yes">Execute the current line, stepping into any
function calls</property>
- <property name="visible">true</property>
+ -->
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-step-in-symbolic</property>
+ <object class="GtkButton" id="step_in_button">
+ <property name="action-name">debugger.step-in</property>
+ <property name="tooltip-text" translatable="yes">Execute the current line, stepping into
any function calls</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-step-in-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="step_over_button">
- <property name="action-name">debugger.step-over</property>
- <property name="tooltip-text" translatable="yes">Execute the current line, stepping over any
function calls</property>
- <property name="visible">true</property>
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-step-over-symbolic</property>
+ <object class="GtkButton" id="step_over_button">
+ <property name="action-name">debugger.step-over</property>
+ <property name="tooltip-text" translatable="yes">Execute the current line, stepping over
any function calls</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-step-over-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="finish_button">
- <property name="action-name">debugger.finish</property>
- <property name="tooltip-text" translatable="yes">Run until the end of the function</property>
- <property name="visible">true</property>
<child>
- <object class="GtkImage">
- <property name="icon-name">debug-step-out-symbolic</property>
+ <object class="GtkButton" id="finish_button">
+ <property name="action-name">debugger.finish</property>
+ <property name="tooltip-text" translatable="yes">Run until the end of the
function</property>
<property name="visible">true</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">debug-step-out-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/plugins/debuggerui/ide-debugger-disassembly-view.c
b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
index eb88ec1da..80239aca0 100644
--- a/src/plugins/debuggerui/ide-debugger-disassembly-view.c
+++ b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
@@ -44,21 +44,22 @@ struct _IdeDebuggerDisassemblyView
G_DEFINE_FINAL_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE_TYPE_PAGE)
static void
-ide_debugger_disassembly_view_destroy (GtkWidget *widget)
+ide_debugger_disassembly_view_dispose (GObject *object)
{
- IdeDebuggerDisassemblyView *self = (IdeDebuggerDisassemblyView *)widget;
+ IdeDebuggerDisassemblyView *self = (IdeDebuggerDisassemblyView *)object;
g_clear_pointer (&self->instructions, g_ptr_array_unref);
- GTK_WIDGET_CLASS (ide_debugger_disassembly_view_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (ide_debugger_disassembly_view_parent_class)->dispose (object);
}
static void
ide_debugger_disassembly_view_class_init (IdeDebuggerDisassemblyViewClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->destroy = ide_debugger_disassembly_view_destroy;
+ object_class->dispose = ide_debugger_disassembly_view_dispose;
gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-disassembly-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerDisassemblyView, source_buffer);
diff --git a/src/plugins/debuggerui/ide-debugger-hover-controls.c
b/src/plugins/debuggerui/ide-debugger-hover-controls.c
index f37975be2..037d8294e 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.c
@@ -42,25 +42,26 @@ struct _IdeDebuggerHoverControls
GtkToggleButton *countpoint;
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerHoverControls, ide_debugger_hover_controls, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerHoverControls, ide_debugger_hover_controls, ADW_TYPE_BIN)
static void
-ide_debugger_hover_controls_destroy (GtkWidget *widget)
+ide_debugger_hover_controls_dispose (GObject *object)
{
- IdeDebuggerHoverControls *self = (IdeDebuggerHoverControls *)widget;
+ IdeDebuggerHoverControls *self = (IdeDebuggerHoverControls *)object;
g_clear_object (&self->debug_manager);
g_clear_object (&self->file);
- GTK_WIDGET_CLASS (ide_debugger_hover_controls_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (ide_debugger_hover_controls_parent_class)->dispose (object);
}
static void
ide_debugger_hover_controls_class_init (IdeDebuggerHoverControlsClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->destroy = ide_debugger_hover_controls_destroy;
+ object_class->dispose = ide_debugger_hover_controls_dispose;
gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-hover-controls.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerHoverControls, nobreak);
@@ -81,7 +82,6 @@ on_toggle_cb (GtkToggleButton *button,
g_autoptr(IdeDebuggerBreakpoints) breakpoints = NULL;
IdeDebuggerBreakMode break_type = IDE_DEBUGGER_BREAK_NONE;
IdeDebuggerBreakpoint *breakpoint;
- GtkWidget *view;
g_assert (GTK_IS_TOGGLE_BUTTON (button));
g_assert (IDE_IS_DEBUGGER_HOVER_CONTROLS (self));
@@ -144,9 +144,6 @@ on_toggle_cb (GtkToggleButton *button,
break;
}
- 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);
g_signal_handlers_unblock_by_func (self->breakpoint, G_CALLBACK (on_toggle_cb), self);
g_signal_handlers_unblock_by_func (self->countpoint, 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 e5f6c2745..ab254640f 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-controls.h
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debug-manager.h"
diff --git a/src/plugins/debuggerui/ide-debugger-hover-provider.c
b/src/plugins/debuggerui/ide-debugger-hover-provider.c
index 108f93e60..631fe4256 100644
--- a/src/plugins/debuggerui/ide-debugger-hover-provider.c
+++ b/src/plugins/debuggerui/ide-debugger-hover-provider.c
@@ -40,12 +40,12 @@ struct _IdeDebuggerHoverProvider
};
static void
-ide_debugger_hover_provider_hover_async (IdeHoverProvider *provider,
- IdeHoverContext *context,
- const GtkTextIter *iter,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+ide_debugger_hover_provider_populate_async (GtkSourceHoverProvider *provider,
+ GtkSourceHoverContext *context,
+ GtkSourceHoverDisplay *display,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
IdeDebuggerHoverProvider *self = (IdeDebuggerHoverProvider *)provider;
g_autoptr(IdeTask) task = NULL;
@@ -53,46 +53,52 @@ ide_debugger_hover_provider_hover_async (IdeHoverProvider *provider,
IdeDebugManager *dbgmgr;
const gchar *lang_id;
IdeBuffer *buffer;
+ GtkTextIter iter;
GFile *file;
guint line;
+ IDE_ENTRY;
+
g_assert (IDE_IS_DEBUGGER_HOVER_PROVIDER (provider));
- g_assert (IDE_IS_HOVER_CONTEXT (context));
- g_assert (iter != NULL);
+ g_assert (GTK_SOURCE_IS_HOVER_CONTEXT (context));
+ g_assert (GTK_SOURCE_IS_HOVER_DISPLAY (display));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
task = ide_task_new (self, cancellable, callback, user_data);
- ide_task_set_source_tag (task, ide_debugger_hover_provider_hover_async);
+ ide_task_set_source_tag (task, ide_debugger_hover_provider_populate_async);
- buffer = IDE_BUFFER (gtk_text_iter_get_buffer (iter));
+ buffer = IDE_BUFFER (gtk_source_hover_context_get_buffer (context));
- if (gtk_source_buffer_iter_has_context_class (GTK_SOURCE_BUFFER (buffer), iter, "comment"))
+ if (!gtk_source_hover_context_get_iter (context, &iter) ||
+ gtk_source_buffer_iter_has_context_class (GTK_SOURCE_BUFFER (buffer), &iter, "comment"))
{
ide_task_return_boolean (task, TRUE);
- return;
+ IDE_EXIT;
}
lang_id = ide_buffer_get_language_id (buffer);
icontext = ide_buffer_ref_context (buffer);
dbgmgr = ide_debug_manager_from_context (icontext);
file = ide_buffer_get_file (buffer);
- line = gtk_text_iter_get_line (iter);
+ line = gtk_text_iter_get_line (&iter);
if (ide_debug_manager_get_active(dbgmgr) && ide_debug_manager_supports_language (dbgmgr, lang_id))
{
GtkWidget *controls;
controls = ide_debugger_hover_controls_new (dbgmgr, file, line + 1);
- ide_hover_context_add_widget (context, DEBUGGER_HOVER_PRIORITY, _("Debugger"), controls);
+ gtk_source_hover_display_prepend (display, controls);
}
ide_task_return_boolean (task, TRUE);
+
+ IDE_EXIT;
}
static gboolean
-ide_debugger_hover_provider_hover_finish (IdeHoverProvider *provider,
- GAsyncResult *result,
- GError **error)
+ide_debugger_hover_provider_populate_finish (GtkSourceHoverProvider *provider,
+ GAsyncResult *result,
+ GError **error)
{
g_assert (IDE_IS_DEBUGGER_HOVER_PROVIDER (provider));
g_assert (IDE_IS_TASK (result));
@@ -101,14 +107,14 @@ ide_debugger_hover_provider_hover_finish (IdeHoverProvider *provider,
}
static void
-hover_provider_iface_init (IdeHoverProviderInterface *iface)
+hover_provider_iface_init (GtkSourceHoverProviderInterface *iface)
{
- iface->hover_async = ide_debugger_hover_provider_hover_async;
- iface->hover_finish = ide_debugger_hover_provider_hover_finish;
+ iface->populate_async = ide_debugger_hover_provider_populate_async;
+ iface->populate_finish = ide_debugger_hover_provider_populate_finish;
}
G_DEFINE_FINAL_TYPE_WITH_CODE (IdeDebuggerHoverProvider, ide_debugger_hover_provider, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_HOVER_PROVIDER, hover_provider_iface_init))
+ G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_HOVER_PROVIDER,
hover_provider_iface_init))
static void
ide_debugger_hover_provider_class_init (IdeDebuggerHoverProviderClass *klass)
diff --git a/src/plugins/debuggerui/ide-debugger-libraries-view.c
b/src/plugins/debuggerui/ide-debugger-libraries-view.c
index 8890996dc..ed986baba 100644
--- a/src/plugins/debuggerui/ide-debugger-libraries-view.c
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.c
@@ -22,6 +22,8 @@
#include "config.h"
+#include <libide-gtk.h>
+
#include "ide-debugger-libraries-view.h"
struct _IdeDebuggerLibrariesView
@@ -46,7 +48,7 @@ enum {
N_PROPS
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerLibrariesView, ide_debugger_libraries_view, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerLibrariesView, ide_debugger_libraries_view, ADW_TYPE_BIN)
static GParamSpec *properties [N_PROPS];
@@ -205,13 +207,13 @@ string_property_cell_data_func (GtkCellLayout *cell_layout,
}
static void
-ide_debugger_libraries_view_destroy (GtkWidget *widget)
+ide_debugger_libraries_view_dispose (GObject *object)
{
- IdeDebuggerLibrariesView *self = (IdeDebuggerLibrariesView *)widget;
+ IdeDebuggerLibrariesView *self = (IdeDebuggerLibrariesView *)object;
g_clear_object (&self->debugger_signals);
- GTK_WIDGET_CLASS (ide_debugger_libraries_view_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (ide_debugger_libraries_view_parent_class)->dispose (object);
}
static void
@@ -258,11 +260,10 @@ ide_debugger_libraries_view_class_init (IdeDebuggerLibrariesViewClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = ide_debugger_libraries_view_dispose;
object_class->get_property = ide_debugger_libraries_view_get_property;
object_class->set_property = ide_debugger_libraries_view_set_property;
- widget_class->destroy = ide_debugger_libraries_view_destroy;
-
properties [PROP_DEBUGGER] =
g_param_spec_object ("debugger",
"Debugger",
diff --git a/src/plugins/debuggerui/ide-debugger-libraries-view.h
b/src/plugins/debuggerui/ide-debugger-libraries-view.h
index e4d0959ea..350d11e0f 100644
--- a/src/plugins/debuggerui/ide-debugger-libraries-view.h
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debugger.h"
diff --git a/src/plugins/debuggerui/ide-debugger-locals-view.c
b/src/plugins/debuggerui/ide-debugger-locals-view.c
index 2aa51b715..960df0c20 100644
--- a/src/plugins/debuggerui/ide-debugger-locals-view.c
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.c
@@ -53,7 +53,7 @@ enum {
N_PROPS
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerLocalsView, ide_debugger_locals_view, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerLocalsView, ide_debugger_locals_view, ADW_TYPE_BIN)
static GParamSpec *properties [N_PROPS];
diff --git a/src/plugins/debuggerui/ide-debugger-locals-view.h
b/src/plugins/debuggerui/ide-debugger-locals-view.h
index d4bea605d..1f716e02a 100644
--- a/src/plugins/debuggerui/ide-debugger-locals-view.h
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debugger.h"
diff --git a/src/plugins/debuggerui/ide-debugger-log-view.c b/src/plugins/debuggerui/ide-debugger-log-view.c
index ad23110ae..26c9a9c03 100644
--- a/src/plugins/debuggerui/ide-debugger-log-view.c
+++ b/src/plugins/debuggerui/ide-debugger-log-view.c
@@ -113,7 +113,7 @@ on_entry_activate_cb (GObject *source,
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (IDE_IS_DEBUGGER_LOG_VIEW (self));
- gtk_entry_set_text (self->commandentry, "");
+ gtk_editable_set_text (GTK_EDITABLE (self->commandentry), "");
gtk_widget_set_sensitive (GTK_WIDGET (self->commandentry), TRUE);
gtk_widget_grab_focus (GTK_WIDGET (self->commandentry));
@@ -137,7 +137,7 @@ on_entry_activate (IdeDebuggerLogView *self,
g_return_if_fail (IDE_IS_DEBUGGER_LOG_VIEW (self));
g_return_if_fail (GTK_IS_ENTRY (entry));
- text = g_strstrip (g_strdup (gtk_entry_get_text (entry)));
+ text = g_strstrip (g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry))));
if (ide_str_empty0 (text))
return;
diff --git a/src/plugins/debuggerui/ide-debugger-registers-view.c
b/src/plugins/debuggerui/ide-debugger-registers-view.c
index 8492c2bb2..4014a5b42 100644
--- a/src/plugins/debuggerui/ide-debugger-registers-view.c
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <libide-core.h>
+#include <libide-gtk.h>
#include "ide-debugger-registers-view.h"
@@ -50,7 +51,7 @@ enum {
N_PROPS
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerRegistersView, ide_debugger_registers_view, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerRegistersView, ide_debugger_registers_view, ADW_TYPE_BIN)
static GParamSpec *properties [N_PROPS];
@@ -172,13 +173,13 @@ string_property_cell_data_func (GtkCellLayout *cell_layout,
}
static void
-ide_debugger_registers_view_destroy (GtkWidget *widget)
+ide_debugger_registers_view_dispose (GObject *object)
{
- IdeDebuggerRegistersView *self = (IdeDebuggerRegistersView *)widget;
+ IdeDebuggerRegistersView *self = (IdeDebuggerRegistersView *)object;
g_clear_object (&self->debugger_signals);
- GTK_WIDGET_CLASS (ide_debugger_registers_view_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (ide_debugger_registers_view_parent_class)->dispose (object);
}
static void
@@ -225,11 +226,10 @@ ide_debugger_registers_view_class_init (IdeDebuggerRegistersViewClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = ide_debugger_registers_view_dispose;
object_class->get_property = ide_debugger_registers_view_get_property;
object_class->set_property = ide_debugger_registers_view_set_property;
- widget_class->destroy = ide_debugger_registers_view_destroy;
-
properties [PROP_DEBUGGER] =
g_param_spec_object ("debugger",
"Debugger",
diff --git a/src/plugins/debuggerui/ide-debugger-registers-view.h
b/src/plugins/debuggerui/ide-debugger-registers-view.h
index e52d95653..d5d57a27d 100644
--- a/src/plugins/debuggerui/ide-debugger-registers-view.h
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debugger.h"
diff --git a/src/plugins/debuggerui/ide-debugger-threads-view.c
b/src/plugins/debuggerui/ide-debugger-threads-view.c
index 3c327de3c..3124ef81c 100644
--- a/src/plugins/debuggerui/ide-debugger-threads-view.c
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.c
@@ -70,7 +70,7 @@ enum {
N_SIGNALS
};
-G_DEFINE_FINAL_TYPE (IdeDebuggerThreadsView, ide_debugger_threads_view, GTK_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeDebuggerThreadsView, ide_debugger_threads_view, ADW_TYPE_BIN)
static GParamSpec *properties [N_PROPS];
static guint signals [N_SIGNALS];
diff --git a/src/plugins/debuggerui/ide-debugger-threads-view.h
b/src/plugins/debuggerui/ide-debugger-threads-view.h
index d7d0989f4..37776ecab 100644
--- a/src/plugins/debuggerui/ide-debugger-threads-view.h
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.h
@@ -20,7 +20,7 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include "ide-debugger.h"
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
index fc01151cf..e1cba10ea 100644
--- a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
@@ -27,8 +27,9 @@
#include <libide-code.h>
#include <libide-core.h>
#include <libide-debugger.h>
-#include <libide-workspace.h>
+#include <libide-editor.h>
#include <libide-foundry.h>
+#include <libide-gtk.h>
#include <libide-gui.h>
#include <libide-io.h>
@@ -64,12 +65,14 @@ struct _IdeDebuggerWorkspaceAddin
IdeWorkspace *workspace;
IdeWorkbench *workbench;
+ IdeRunManager *run_manager;
+
IdeDebuggerDisassemblyView *disassembly_view;
IdeDebuggerControls *controls;
IdeDebuggerBreakpointsView *breakpoints_view;
IdeDebuggerLibrariesView *libraries_view;
IdeDebuggerLocalsView *locals_view;
- IdeDockWidget *panel;
+ IdePane *panel;
IdeDebuggerRegistersView *registers_view;
IdeDebuggerThreadsView *threads_view;
IdeDebuggerLogView *log_view;
@@ -162,12 +165,11 @@ debug_manager_notify_debugger (IdeDebuggerWorkspaceAddin *self,
IdeDebugManager *debug_manager)
{
IdeDebugger *debugger;
- IdeWorkspace *workspace;
g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
g_assert (IDE_IS_DEBUG_MANAGER (debug_manager));
- panel_widget_raise (self->panel);
+ panel_widget_raise (PANEL_WIDGET (self->panel));
debugger = ide_debug_manager_get_debugger (debug_manager);
gtk_widget_insert_action_group (GTK_WIDGET (self->workspace), "debugger", G_ACTION_GROUP (debugger));
@@ -204,7 +206,7 @@ debug_manager_notify_active (IdeDebuggerWorkspaceAddin *self,
reveal_child = TRUE;
}
- gtk_revealer_set_reveal_child (GTK_REVEALER (self->controls), reveal_child);
+ ide_debugger_controls_set_reveal_child (self->controls, reveal_child);
}
static void
@@ -235,12 +237,13 @@ on_frame_activated (IdeDebuggerWorkspaceAddin *self,
if (path != NULL)
{
IdeContext *context = ide_widget_get_context (GTK_WIDGET (threads_view));
- g_autoptr(IdeLocation) location = NULL;
g_autofree gchar *project_path = ide_context_build_filename (context, path, NULL);
g_autoptr(GFile) file = g_file_new_for_path (project_path);
+ g_autoptr(IdePanelPosition) position = ide_panel_position_new ();
+ g_autoptr(IdeLocation) location = NULL;
location = ide_location_new (file, line, -1);
- ide_workspace_surface_focus_location (self->workspace, location);
+ ide_editor_focus_location (self->workspace, position, location);
IDE_EXIT;
}
@@ -261,11 +264,12 @@ on_frame_activated (IdeDebuggerWorkspaceAddin *self,
static void
ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
{
+ g_autoptr(IdePanelPosition) position = NULL;
GtkNotebook *notebook;
PanelPaned *hpaned;
g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
- g_assert (IDE_IS_WORKSPACE_SURFACE (self->workspace));
+ g_assert (self->workspace != NULL);
self->controls = g_object_new (IDE_TYPE_DEBUGGER_CONTROLS,
"transition-duration", 500,
@@ -281,7 +285,7 @@ ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
"icon-name", "builder-debugger-symbolic",
"visible", FALSE,
NULL),
- (IdePanel **)&self->panel);
+ (IdePane **)&self->panel);
notebook = g_object_new (GTK_TYPE_NOTEBOOK, NULL);
panel_widget_set_child (PANEL_WIDGET (self->panel), GTK_WIDGET (notebook));
@@ -333,19 +337,18 @@ ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
}
static void
-ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
- IdeWorkspaceSurface *workspace)
+ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
+ IdeWorkspace *workspace)
{
IdeDebuggerWorkspaceAddin *self = (IdeDebuggerWorkspaceAddin *)addin;
IdeDebugManager *debug_manager;
IdeRunManager *run_manager;
- IdeWorkspace *workspace;
IdeContext *context;
IDE_ENTRY;
g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
- g_assert (IDE_IS_WORKSPACE_SURFACE (workspace));
+ g_assert (IDE_IS_WORKSPACE (workspace));
self->workspace = workspace;
self->workbench = ide_widget_get_workbench (GTK_WIDGET (workspace));
@@ -357,6 +360,8 @@ ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
run_manager = ide_run_manager_from_context (context);
debug_manager = ide_debug_manager_from_context (context);
+ self->run_manager = g_object_ref (run_manager);
+
ide_debugger_workspace_addin_add_ui (self);
ide_run_manager_add_handler (run_manager,
@@ -398,38 +403,32 @@ ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
}
static void
-ide_debugger_workspace_addin_unload (IdeWorkspaceAddin *addin,
- IdeWorkspaceSurface *workspace)
+ide_debugger_workspace_addin_unload (IdeWorkspaceAddin *addin,
+ IdeWorkspace *workspace)
{
IdeDebuggerWorkspaceAddin *self = (IdeDebuggerWorkspaceAddin *)addin;
- IdeRunManager *run_manager;
- IdeWorkspace *workspace;
- IdeContext *context;
IDE_ENTRY;
g_assert (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
- g_assert (IDE_IS_WORKSPACE_SURFACE (workspace));
+ g_assert (IDE_IS_WORKSPACE (workspace));
if (!ide_workbench_has_project (self->workbench))
return;
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");
+ ide_run_manager_remove_handler (self->run_manager, "debugger");
g_clear_object (&self->debugger_signals);
g_clear_object (&self->debug_manager_signals);
+ g_clear_object (&self->run_manager);
+
+ ide_workspace_remove_overlay (self->workspace, GTK_WIDGET (self->controls));
+ self->controls = NULL;
ide_clear_pane ((IdePane **)&self->panel);
ide_clear_page ((IdePage **)&self->disassembly_view);
- ide_workspace_remove_overlay (self->workspace, GTK_WIDGET (self->controls));
-
- self->controls = NULL;
self->workspace = NULL;
self->workbench = NULL;
@@ -479,7 +478,6 @@ ide_debugger_workspace_addin_disassemble_cb (GObject *object,
g_autoptr(IdeDebuggerWorkspaceAddin) self = user_data;
g_autoptr(GPtrArray) instructions = NULL;
g_autoptr(GError) error = NULL;
- GtkWidget *stack;
IDE_ENTRY;
@@ -504,7 +502,7 @@ ide_debugger_workspace_addin_disassemble_cb (GObject *object,
ide_page_observe (g_object_new (IDE_TYPE_DEBUGGER_DISASSEMBLY_VIEW, NULL),
(IdePage **)&self->disassembly_view);
- ide_workspace_add_page (self->workspace, IDE_PAGE (self->disassembly_view), posittion);
+ ide_workspace_add_page (self->workspace, IDE_PAGE (self->disassembly_view), position);
}
ide_debugger_disassembly_view_set_instructions (self->disassembly_view, instructions);
diff --git a/src/plugins/meson.build b/src/plugins/meson.build
index f68ec0e9a..ab3cc4d84 100644
--- a/src/plugins/meson.build
+++ b/src/plugins/meson.build
@@ -58,7 +58,7 @@ subdir('copyright')
subdir('c-pack')
#subdir('create-project')
#subdir('ctags')
-#subdir('debuggerui')
+subdir('debuggerui')
#subdir('devhelp')
#subdir('deviceui')
#subdir('deviced')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]