OSDN Git Service

VBufStorage: add an updateAncestor property to VBufStorage_fieldNode_t which allows...
authorMichael Curran <mick@kulgan.net>
Tue, 6 Nov 2012 07:41:29 +0000 (17:41 +1000)
committerMichael Curran <mick@kulgan.net>
Tue, 6 Nov 2012 07:41:29 +0000 (17:41 +1000)
nvdaHelper/vbufBase/backend.cpp
nvdaHelper/vbufBase/storage.cpp
nvdaHelper/vbufBase/storage.h

index 7d6f6f0..c09709c 100644 (file)
@@ -130,6 +130,8 @@ void VBufBackend_t::renderThread_terminate() {
 }\r
 \r
 bool VBufBackend_t::invalidateSubtree(VBufStorage_controlFieldNode_t* node) {\r
+       VBufStorage_controlFieldNode_t* updateAncestor=node->getUpdateAncestor();\r
+       if(updateAncestor) node=updateAncestor;\r
        if(!isNodeInBuffer(node)) {\r
                LOG_DEBUGWARNING(L"Node at "<<node<<L" not in buffer at "<<this);\r
                return false;\r
index 852f5ec..74a0c14 100644 (file)
@@ -284,7 +284,7 @@ void VBufStorage_fieldNode_t::disassociateFromBuffer(VBufStorage_buffer_t* buffe
        LOG_DEBUG(L"Disassociating fieldNode from buffer");\r
 }\r
 \r
-VBufStorage_fieldNode_t::VBufStorage_fieldNode_t(int lengthArg, bool isBlockArg): parent(NULL), previous(NULL), next(NULL), firstChild(NULL), lastChild(NULL), length(lengthArg), isBlock(isBlockArg), isHidden(false), attributes() {\r
+VBufStorage_fieldNode_t::VBufStorage_fieldNode_t(int lengthArg, bool isBlockArg): parent(NULL), previous(NULL), next(NULL), firstChild(NULL), lastChild(NULL), length(lengthArg), isBlock(isBlockArg), isHidden(false), updateAncestor(NULL), attributes() {\r
        LOG_DEBUG(L"field node initialization at "<<this<<L"length is "<<length);\r
 }\r
 \r
@@ -297,6 +297,11 @@ VBufStorage_controlFieldNode_t* VBufStorage_fieldNode_t::getParent() {
        return parent;\r
 }\r
 \r
+VBufStorage_controlFieldNode_t* VBufStorage_fieldNode_t::getUpdateAncestor() {\r
+       LOG_DEBUG(L"updateAncestor at "<<updateAncestor);\r
+       return updateAncestor;\r
+}\r
+\r
 VBufStorage_fieldNode_t* VBufStorage_fieldNode_t::getPrevious() {\r
        LOG_DEBUG(L"previous at "<<previous);\r
        return previous;\r
@@ -348,6 +353,10 @@ void VBufStorage_fieldNode_t::setIsHidden(bool isHidden) {
        this->isHidden=isHidden;\r
 }\r
 \r
+void VBufStorage_fieldNode_t::setUpdateAncestor(VBufStorage_controlFieldNode_t* node) {\r
+       this->updateAncestor=node;\r
+}\r
+\r
 int VBufStorage_fieldNode_t::getLength() {\r
                return this->length;\r
        }\r
index 091cda5..35c2eef 100644 (file)
@@ -147,6 +147,11 @@ class VBufStorage_fieldNode_t {
        bool isHidden;\r
 \r
 /**\r
+ * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
+ */\r
+       VBufStorage_controlFieldNode_t* updateAncestor;\r
+\r
+       /**\r
  * a map to hold attributes for this field.\r
  */\r
        VBufStorage_attributeMap_t attributes;\r
@@ -302,6 +307,16 @@ class VBufStorage_fieldNode_t {
        void setIsHidden(bool isHidden);\r
 \r
 /**\r
+ * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
+ */\r
+       VBufStorage_controlFieldNode_t* getUpdateAncestor();\r
+\r
+/**\r
+ * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
+ */\r
+       void setUpdateAncestor(VBufStorage_controlFieldNode_t* updateAncestor);\r
+\r
+/**\r
  * Getter for isBlock\r
  */\r
        bool getIsBlock() {\r