[gnome-control-center/gbsneto/panel-widget-in-sidebar: 5/14] panel: Add get_sidebar_widget() vfunc
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/panel-widget-in-sidebar: 5/14] panel: Add get_sidebar_widget() vfunc
- Date: Fri, 16 Nov 2018 17:20:43 +0000 (UTC)
commit 75167f45fd2b7db7071d5c6223d7ff171e9d1e99
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Nov 12 00:36:53 2018 -0200
panel: Add get_sidebar_widget() vfunc
This vfunc is the entry point for panels that have
a sidebar widget. It must never return NULL.
At this point, nothing uses it and this vfunc does
not impact execution of the program.
shell/cc-panel.c | 18 ++++++++++++++++++
shell/cc-panel.h | 3 +++
2 files changed, 21 insertions(+)
---
diff --git a/shell/cc-panel.c b/shell/cc-panel.c
index f4d7c4316..e01a6af78 100644
--- a/shell/cc-panel.c
+++ b/shell/cc-panel.c
@@ -214,3 +214,21 @@ cc_panel_get_title_widget (CcPanel *panel)
return NULL;
}
+
+GtkWidget*
+cc_panel_get_sidebar_widget (CcPanel *panel)
+{
+ CcPanelClass *class = CC_PANEL_GET_CLASS (panel);
+
+ if (class->get_sidebar_widget)
+ {
+ GtkWidget *sidebar_widget;
+
+ sidebar_widget = class->get_sidebar_widget (panel);
+ g_assert (sidebar_widget != NULL);
+
+ return sidebar_widget;
+ }
+
+ return NULL;
+}
diff --git a/shell/cc-panel.h b/shell/cc-panel.h
index ae73d5fa4..2103451ca 100644
--- a/shell/cc-panel.h
+++ b/shell/cc-panel.h
@@ -82,6 +82,7 @@ struct _CcPanelClass
const char * (* get_help_uri) (CcPanel *panel);
GtkWidget * (* get_title_widget) (CcPanel *panel);
+ GtkWidget * (* get_sidebar_widget) (CcPanel *panel);
};
CcShell* cc_panel_get_shell (CcPanel *panel);
@@ -92,5 +93,7 @@ const char *cc_panel_get_help_uri (CcPanel *panel);
GtkWidget *cc_panel_get_title_widget (CcPanel *panel);
+GtkWidget* cc_panel_get_sidebar_widget (CcPanel *panel);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]