[gnome-builder] libide/gui: add id helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/gui: add id helper
- Date: Sat, 17 Sep 2022 04:10:51 +0000 (UTC)
commit 56f19b5c46959d40abda1a47428461c29fd97227
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 16 20:53:10 2022 -0700
libide/gui: add id helper
This just lets us pretend the type name is the ID for some panels. It's
mostly just transitionary for now.
src/libide/gui/ide-pane.c | 16 ++++++++++++++++
src/libide/gui/ide-pane.h | 2 ++
2 files changed, 18 insertions(+)
---
diff --git a/src/libide/gui/ide-pane.c b/src/libide/gui/ide-pane.c
index f030292d4..8ea947489 100644
--- a/src/libide/gui/ide-pane.c
+++ b/src/libide/gui/ide-pane.c
@@ -250,3 +250,19 @@ ide_pane_get_position (IdePane *self)
{
return panel_widget_get_position (PANEL_WIDGET (self));
}
+
+const char *
+ide_pane_get_id (IdePane *self)
+{
+ const char *id;
+
+ g_return_val_if_fail (IDE_IS_PANE (self), NULL);
+
+ if (!(id = panel_widget_get_id (PANEL_WIDGET (self))))
+ {
+ if (G_OBJECT_TYPE (self) != IDE_TYPE_PANE)
+ id = G_OBJECT_TYPE_NAME (self);
+ }
+
+ return id;
+}
diff --git a/src/libide/gui/ide-pane.h b/src/libide/gui/ide-pane.h
index 473d9bcf9..0b83ef156 100644
--- a/src/libide/gui/ide-pane.h
+++ b/src/libide/gui/ide-pane.h
@@ -45,6 +45,8 @@ struct _IdePaneClass
IDE_AVAILABLE_IN_ALL
GtkWidget *ide_pane_new (void);
IDE_AVAILABLE_IN_ALL
+const char *ide_pane_get_id (IdePane *self);
+IDE_AVAILABLE_IN_ALL
void ide_pane_destroy (IdePane *self);
IDE_AVAILABLE_IN_ALL
void ide_pane_observe (IdePane *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]