summaryrefslogtreecommitdiff
path: root/libnautilus-extension/nautilus-property-page-model.h
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@redhat.com>2018-05-22 15:10:47 +0200
committerCarlos Soriano <csoriano@gnome.org>2018-06-20 09:59:44 +0200
commit02d041d003ad497a07a964ee2fb5a6378073cb34 (patch)
tree5b320d1dc2e3d5163633148b4fef92d2b95639db /libnautilus-extension/nautilus-property-page-model.h
parent813a469d445166e4b37e868e0960f30cde540976 (diff)
downloadnautilus-new-properties-extension.tar.gz
general: Make property extensions gtk version independentnew-properties-extension
Nautilus property extensions to add property pages to the property dialog was providing a GtkWidget to be modified by extensions. This makes the extension need to target a specific gtk version, which with the new gtk versioning might be hard to provide, and it's quite a bad practice since it requires everyone to be on top of any gtk update. This is currently holding the work for porting Nautilus to gtk4, since the Totem extension depends on us having the same gtk+ version, which is unlikely. This work makes the extension for providing property extensions not depend on gtk by providing a plain struct to be filled with data that later on Nautilus will layout on the UI. See https://gitlab.gnome.org/GNOME/nautilus/issues/276
Diffstat (limited to 'libnautilus-extension/nautilus-property-page-model.h')
-rw-r--r--libnautilus-extension/nautilus-property-page-model.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/libnautilus-extension/nautilus-property-page-model.h b/libnautilus-extension/nautilus-property-page-model.h
new file mode 100644
index 000000000..37f38f080
--- /dev/null
+++ b/libnautilus-extension/nautilus-property-page-model.h
@@ -0,0 +1,80 @@
+/*
+ * nautilus-property-page-model.h - Property pages exported by
+ * NautilusPropertyProvider objects.
+ *
+ * Copyright (C) 2003 Novell, Inc.
+ * Copyright (C) 2018 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#pragma once
+
+#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
+#warning "Only <nautilus-extension.h> should be included directly."
+#endif
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NAUTILUS_TYPE_PROPERTY_PAGE_MODEL (nautilus_property_page_model_get_type ())
+
+G_DECLARE_DERIVABLE_TYPE (NautilusPropertyPageModel, nautilus_property_page_model,
+ NAUTILUS, PROPERTY_PAGE_MODEL,
+ GObject)
+
+struct _NautilusPropertyPageModelClass
+{
+ GObjectClass parent_class;
+};
+
+typedef struct
+{
+ int id;
+ char* title;
+} NautilusPropertyPageModelSection;
+
+typedef struct
+{
+ int section_id;
+ char* field;
+ char* value;
+} NautilusPropertyPageModelItem;
+
+NautilusPropertyPageModel *nautilus_property_page_model_new (const char *title,
+ GList *sections,
+ GList *items);
+char * nautilus_property_page_model_get_title (NautilusPropertyPageModel *self);
+void nautilus_property_page_model_set_title (NautilusPropertyPageModel *self,
+ const char *title);
+GList *nautilus_property_page_model_get_sections (NautilusPropertyPageModel *self);
+void
+nautilus_property_page_model_set_sections (NautilusPropertyPageModel *self,
+ GList *sections);
+GList *nautilus_property_page_model_get_items (NautilusPropertyPageModel *self);
+void
+nautilus_property_page_model_set_items (NautilusPropertyPageModel *self,
+ GList *items);
+
+/* NautilusPropertyPageModel has the following properties:
+ * label (string) - the user-visible label of the property page
+ * sections (GList of NautilusPropertyPageModelSection) - the sections
+ * items (GList of NautilusPropertyPageModelItem) - the items
+ */
+
+G_END_DECLS