[lasem] svg_view: getter to referencing element
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [lasem] svg_view: getter to referencing element
- Date: Thu, 5 Mar 2015 23:06:36 +0000 (UTC)
commit a2d59016ea79565196ba724cd257ee57842c1bce
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Fri Mar 6 00:04:49 2015 +0100
svg_view: getter to referencing element
It's the last but one element in element stack.
src/lsmsvgview.c | 12 ++++++++++++
src/lsmsvgview.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/lsmsvgview.c b/src/lsmsvgview.c
index 59ddadf..00a60e7 100644
--- a/src/lsmsvgview.c
+++ b/src/lsmsvgview.c
@@ -2226,6 +2226,18 @@ lsm_svg_view_pop_element (LsmSvgView *view)
view->element_stack = g_slist_delete_link (view->element_stack, view->element_stack);
}
+LsmSvgElement *
+lsm_svg_view_get_referencing_element (LsmSvgView *view)
+{
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), NULL);
+
+ if (view->element_stack == NULL ||
+ view->element_stack->next == NULL)
+ return NULL;
+
+ return view->element_stack->next->data;
+}
+
static gboolean
lsm_svg_view_circular_reference_check (LsmSvgView *view, LsmSvgElement *element)
{
diff --git a/src/lsmsvgview.h b/src/lsmsvgview.h
index c60203c..df27365 100644
--- a/src/lsmsvgview.h
+++ b/src/lsmsvgview.h
@@ -155,6 +155,7 @@ void lsm_svg_view_pop_matrix (LsmSvgView *view);
void lsm_svg_view_push_element (LsmSvgView *view, const LsmSvgElement *element);
void lsm_svg_view_pop_element (LsmSvgView *view);
+LsmSvgElement * lsm_svg_view_get_referencing_element (LsmSvgView *view);
void lsm_svg_view_push_style (LsmSvgView *view, LsmSvgStyle *style);
void lsm_svg_view_pop_style (LsmSvgView *view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]