[gimp] app: Add and use gimp_dock_get_n_dockables()
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] app: Add and use gimp_dock_get_n_dockables()
- Date: Sun, 13 Sep 2009 09:48:50 +0000 (UTC)
commit dc3521e074b409748e0067b338ad3b853b983622
Author: Martin Nordholts <martinn src gnome org>
Date: Sun Sep 13 11:51:39 2009 +0200
app: Add and use gimp_dock_get_n_dockables()
app/widgets/gimpdock.c | 21 +++++++++++++++------
app/widgets/gimpdock.h | 1 +
2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c
index 3b95d0b..7e33ea4 100644
--- a/app/widgets/gimpdock.c
+++ b/app/widgets/gimpdock.c
@@ -246,13 +246,8 @@ gimp_dock_delete_event (GtkWidget *widget,
GdkEventAny *event)
{
GimpDock *dock = GIMP_DOCK (widget);
- GList *list;
- gint n;
- for (list = dock->p->dockbooks, n = 0; list; list = list->next)
- n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
-
- if (n > 1)
+ if (gimp_dock_get_n_dockables (dock) > 1)
{
GimpSessionInfo *info = gimp_session_info_new ();
@@ -343,6 +338,20 @@ gimp_dock_get_dockbooks (GimpDock *dock)
return dock->p->dockbooks;
}
+gint
+gimp_dock_get_n_dockables (GimpDock *dock)
+{
+ GList *list = NULL;
+ gint n = 0;
+
+ g_return_val_if_fail (GIMP_IS_DOCK (dock), 0);
+
+ for (list = dock->p->dockbooks; list; list = list->next)
+ n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
+
+ return n;
+}
+
GtkWidget *
gimp_dock_get_main_vbox (GimpDock *dock)
{
diff --git a/app/widgets/gimpdock.h b/app/widgets/gimpdock.h
index cb57876..f0365db 100644
--- a/app/widgets/gimpdock.h
+++ b/app/widgets/gimpdock.h
@@ -75,6 +75,7 @@ GList * gimp_dock_get_aux_info (GimpDock *dock);
GimpContext * gimp_dock_get_context (GimpDock *dock);
GimpDialogFactory * gimp_dock_get_dialog_factory (GimpDock *dock);
GList * gimp_dock_get_dockbooks (GimpDock *dock);
+gint gimp_dock_get_n_dockables (GimpDock *dock);
GtkWidget * gimp_dock_get_main_vbox (GimpDock *dock);
GtkWidget * gimp_dock_get_vbox (GimpDock *dock);
gint gimp_dock_get_id (GimpDock *dock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]