[gnome-builder] htmldocument: implement read-only interface property
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] htmldocument: implement read-only interface property
- Date: Thu, 1 Jan 2015 05:33:13 +0000 (UTC)
commit 9e2f111b48a5c39cd421d97328d661014ada8d47
Author: Christian Hergert <christian hergert me>
Date: Wed Dec 31 21:32:08 2014 -0800
htmldocument: implement read-only interface property
src/html/gb-html-document.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/html/gb-html-document.c b/src/html/gb-html-document.c
index bae1540..706c0a7 100644
--- a/src/html/gb-html-document.c
+++ b/src/html/gb-html-document.c
@@ -44,6 +44,7 @@ enum {
PROP_0,
PROP_BUFFER,
PROP_MODIFIED,
+ PROP_READ_ONLY,
PROP_TITLE,
LAST_PROP
};
@@ -222,6 +223,12 @@ gb_html_document_create_view (GbDocument *document)
NULL);
}
+static gboolean
+gb_html_document_get_read_only (GbDocument *document)
+{
+ return TRUE;
+}
+
static void
gb_html_document_finalize (GObject *object)
{
@@ -252,6 +259,10 @@ gb_html_document_get_property (GObject *object,
gb_html_document_get_modified (GB_DOCUMENT (self)));
break;
+ case PROP_READ_ONLY:
+ g_value_set_boolean (value, TRUE);
+ break;
+
case PROP_TITLE:
g_value_set_string (value,
gb_html_document_get_title (GB_DOCUMENT (self)));
@@ -291,6 +302,7 @@ gb_html_document_class_init (GbHtmlDocumentClass *klass)
object_class->set_property = gb_html_document_set_property;
g_object_class_override_property (object_class, PROP_MODIFIED, "modified");
+ g_object_class_override_property (object_class, PROP_READ_ONLY, "read-only");
g_object_class_override_property (object_class, PROP_TITLE, "title");
gParamSpecs [PROP_BUFFER] =
@@ -317,6 +329,7 @@ gb_html_document_init_document (GbDocumentInterface *iface)
iface->get_title = gb_html_document_get_title;
iface->get_modified = gb_html_document_get_modified;
iface->create_view = gb_html_document_create_view;
+ iface->get_read_only = gb_html_document_get_read_only;
}
gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]