[evince] libdocument: Added can-have-popup property to EvAnnotationMarkups.
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libdocument: Added can-have-popup property to EvAnnotationMarkups.
- Date: Sun, 12 Apr 2015 09:42:19 +0000 (UTC)
commit e39e492585602485af62b47a52fcbf6205b5aac0
Author: Philipp Reinkemeier <philipp reinkemeier offis de>
Date: Wed Mar 18 18:41:01 2015 +0100
libdocument: Added can-have-popup property to EvAnnotationMarkups.
This patch adds a property can-have-popup to EvAnnotationMarkup.
https://bugzilla.gnome.org/show_bug.cgi?id=733603
libdocument/ev-annotation.c | 32 ++++++++++++++++++++++++++++++++
libdocument/ev-annotation.h | 1 +
2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/libdocument/ev-annotation.c b/libdocument/ev-annotation.c
index b77bef8..fde990f 100644
--- a/libdocument/ev-annotation.c
+++ b/libdocument/ev-annotation.c
@@ -97,6 +97,7 @@ enum {
PROP_MARKUP_0,
PROP_MARKUP_LABEL,
PROP_MARKUP_OPACITY,
+ PROP_MARKUP_CAN_HAVE_POPUP,
PROP_MARKUP_HAS_POPUP,
PROP_MARKUP_RECTANGLE,
PROP_MARKUP_POPUP_IS_OPEN
@@ -656,6 +657,7 @@ ev_annotation_set_rgba (EvAnnotation *annot,
typedef struct {
gchar *label;
gdouble opacity;
+ gboolean can_have_popup;
gboolean has_popup;
gboolean popup_is_open;
EvRectangle rectangle;
@@ -684,6 +686,14 @@ ev_annotation_markup_default_init (EvAnnotationMarkupInterface *iface)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_interface_install_property (iface,
+ g_param_spec_boolean ("can-have-popup",
+ "Can have popup",
+ "Whether it is allowed to have a
popup "
+ "window for this type of markup
annotation",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("has-popup",
"Has popup",
"Whether the markup annotation has
"
@@ -753,6 +763,13 @@ ev_annotation_markup_set_property (GObject *object,
case PROP_MARKUP_OPACITY:
ev_annotation_markup_set_opacity (markup, g_value_get_double (value));
break;
+ case PROP_MARKUP_CAN_HAVE_POPUP: {
+ EvAnnotationMarkupProps *props;
+
+ props = ev_annotation_markup_get_properties (markup);
+ props->can_have_popup = g_value_get_boolean (value);
+ break;
+ }
case PROP_MARKUP_HAS_POPUP:
ev_annotation_markup_set_has_popup (markup, g_value_get_boolean (value));
break;
@@ -784,6 +801,9 @@ ev_annotation_markup_get_property (GObject *object,
case PROP_MARKUP_OPACITY:
g_value_set_double (value, props->opacity);
break;
+ case PROP_MARKUP_CAN_HAVE_POPUP:
+ g_value_set_boolean (value, props->can_have_popup);
+ break;
case PROP_MARKUP_HAS_POPUP:
g_value_set_boolean (value, props->has_popup);
break;
@@ -806,6 +826,7 @@ ev_annotation_markup_class_install_properties (GObjectClass *klass)
g_object_class_override_property (klass, PROP_MARKUP_LABEL, "label");
g_object_class_override_property (klass, PROP_MARKUP_OPACITY, "opacity");
+ g_object_class_override_property (klass, PROP_MARKUP_CAN_HAVE_POPUP, "can-have-popup");
g_object_class_override_property (klass, PROP_MARKUP_HAS_POPUP, "has-popup");
g_object_class_override_property (klass, PROP_MARKUP_RECTANGLE, "rectangle");
g_object_class_override_property (klass, PROP_MARKUP_POPUP_IS_OPEN, "popup-is-open");
@@ -875,6 +896,17 @@ ev_annotation_markup_set_opacity (EvAnnotationMarkup *markup,
}
gboolean
+ev_annotation_markup_can_have_popup (EvAnnotationMarkup *markup)
+{
+ EvAnnotationMarkupProps *props;
+
+ g_return_val_if_fail (EV_IS_ANNOTATION_MARKUP (markup), FALSE);
+
+ props = ev_annotation_markup_get_properties (markup);
+ return props->can_have_popup;
+}
+
+gboolean
ev_annotation_markup_has_popup (EvAnnotationMarkup *markup)
{
EvAnnotationMarkupProps *props;
diff --git a/libdocument/ev-annotation.h b/libdocument/ev-annotation.h
index d9e0aaa..109ef71 100644
--- a/libdocument/ev-annotation.h
+++ b/libdocument/ev-annotation.h
@@ -152,6 +152,7 @@ gboolean ev_annotation_markup_set_label (EvAnnotationMarkup
gdouble ev_annotation_markup_get_opacity (EvAnnotationMarkup *markup);
gboolean ev_annotation_markup_set_opacity (EvAnnotationMarkup *markup,
gdouble opacity);
+gboolean ev_annotation_markup_can_have_popup (EvAnnotationMarkup *markup);
gboolean ev_annotation_markup_has_popup (EvAnnotationMarkup *markup);
gboolean ev_annotation_markup_set_has_popup (EvAnnotationMarkup *markup,
gboolean has_popup);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]