changeset 1202:2f3d523a3871

Parse all scenes when start handling a document
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 03 Jan 2011 14:06:18 +0800
parents 582d3410e546
children b90a1e2eb9ec
files pyink/MBScene.py
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/MBScene.py	Mon Jan 03 13:57:00 2011 +0800
+++ b/pyink/MBScene.py	Mon Jan 03 14:06:18 2011 +0800
@@ -303,6 +303,7 @@
 	
 	self._start_monitor()	# start MBScene_dom_monitor
 	self._init_metadata()
+	self._parse_all_scenes()
 	pass
    
     def dumpattr(self, n):
@@ -370,7 +371,26 @@
 		pass
 	    pass
 	pass
+
+    ## \brief Parse all scenes node in svg:metadata subtree.
+    #
+    def _parse_all_scenes(self):
+	root = self._root
+	for child in root.childList():
+	    if child.name() != 'svg:metadata':
+		continue
+
+	    metadata_node = child
+	    for metachild in metadata_node.childList():
+		if metachild.name() == 'ns0:scenes':
+		    self._parse_one_scenes(metachild)
+		    pass
+		pass
+	    pass
+	pass
     
+    ## \brief Create a scenes node if not existed.
+    #
     def _init_metadata(self):
 	for node in self._root.childList():
 	    if node.name() == 'svg:metadata':