Code

Rearrange to enable code that does not directly rely on lcms.
[inkscape.git] / src / dom / views.h
old mode 100755 (executable)
new mode 100644 (file)
index 1d300d5..9e87dfb
@@ -13,7 +13,7 @@
  * Authors:
  *   Bob Jamison
  *
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2005-2008 Bob Jamison
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *  
+ * =========================================================================
+ * NOTES
+ * 
+ * This is the Level 2 Views definition, which is very minimalist.  It is
+ * described here:
+ * http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113
+ * 
+ * Note that SVG uses the DOM Core and Events Level 3, but Level 2 CSS and Views.         
+ * 
+ * The level 3 version is much larger:
+ * http://www.w3.org/TR/2004/NOTE-DOM-Level-3-Views-20040226
+ * Be prepared in the future to adjust to this, if SVG ever switches .
  */
 
 
@@ -51,98 +64,29 @@ typedef dom::Node Node;
 typedef dom::DOMString DOMString;
 
 //forward declarations
-class Segment;
-class VisualResource;
-class VisualCharacter;
-class VisualCharacterRun;
-class VisualFrame;
-class VisualImage;
-class VisualFormButton;
-class VisualFormField;
-
+class DocumentView;
+class AbstractView;
 
 
 
 /*#########################################################################
-## Match
+## AbstractView
 #########################################################################*/
 
 /**
- *
+ * A base interface that all views shall derive from.
  */
-class Match
+class AbstractView
 {
 public:
 
-    typedef enum
-        {
-        IS_EQUAL                       = 0,
-        IS_NOT_EQUAL                   = 1,
-        INT_PRECEDES                   = 2,
-        INT_PRECEDES_OR_EQUALS         = 3,
-        INT_FOLLOWS                    = 4,
-        INT_FOLLOWS_OR_EQUALS          = 5,
-        STR_STARTS_WITH                = 6,
-        STR_ENDS_WITH                  = 7,
-        STR_CONTAINS                   = 8,
-        SET_ANY                        = 9,
-        SET_ALL                        = 10,
-        SET_NOT_ANY                    = 11,
-        SET_NOT_ALL                    = 12
-        } MatchTestGroup;
-
-    /**
-     *
-     */
-    virtual unsigned short test()
-        { return IS_NOT_EQUAL; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    Match() {}
-
     /**
-     *
+     * The source DocumentView of which this is an AbstractView.
      */
-    Match(const Match &other)
+    virtual DocumentView *getDocument()
         {
-        }
-
-    /**
-     *
-     */
-    virtual ~Match() {}
-};
-
-
-
-/*#########################################################################
-## MatchString
-#########################################################################*/
-
-/**
- *
- */
-class MatchString : virtual public Match
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getName()
-        { return name; }
-
-    /**
-     *
-     */
-    virtual DOMString getValue()
-        { return value; }
+        return documentView;
+               }
 
     //##################
     //# Non-API methods
@@ -151,245 +95,64 @@ public:
     /**
      *
      */
-    MatchString() {}
+    AbstractView()
+           { documentView = NULL; }
 
     /**
      *
      */
-    MatchString(const MatchString &other) : Match(other)
+    AbstractView(const AbstractView &other)
         {
-        name  = other.name;
-        value = other.value;
+        assign(other);
         }
 
     /**
      *
      */
-    virtual ~MatchString() {}
-
-protected:
-
-    DOMString name;
-    DOMString value;
-
-
-};
-
-
-
-/*#########################################################################
-## MatchInteger
-#########################################################################*/
-
-/**
- *
- */
-class MatchInteger : virtual public Match
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getName()
-        { return name; }
-
-    /**
-     *
-     */
-    virtual long getValue()
-        { return value; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    MatchInteger() {}
-
-    /**
-     *
-     */
-    MatchInteger(const MatchInteger &other) : Match(other)
+    AbstractView &operator=(const AbstractView &other)
         {
-        name  = other.name;
-        value = other.value;
+        assign(other);
+        return *this;
         }
 
     /**
      *
      */
-    virtual ~MatchInteger() {}
-
-protected:
-
-    DOMString name;
-    long value;
-};
-
-
-
-/*#########################################################################
-## MatchBoolean
-#########################################################################*/
-
-/**
- *
- */
-class MatchBoolean : virtual public Match
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getName()
-        { return name; }
+    virtual ~AbstractView() {}
 
-    /**
-     *
-     */
-    virtual bool getValue()
-        { return value; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    MatchBoolean() {}
+private:
 
-    /**
-     *
-     */
-    MatchBoolean(const MatchBoolean &other) : Match(other)
+    void assign(const AbstractView &other)
         {
-        name  = other.name;
-        value = other.value;
-        }
-
-    /**
-     *
-     */
-    virtual ~MatchBoolean() {}
-
-protected:
+        documentView = other.documentView;
+               }
 
-    DOMString name;
-    bool value;
+       DocumentView *documentView;
+               
 };
 
 
-
 /*#########################################################################
-## MatchContent
+## DocumentView
 #########################################################################*/
 
-/**
- *
- */
-class MatchContent : virtual public Match
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getName()
-        { return name; }
-
-    /**
-     *
-     */
-    virtual Node *getNodeArg()
-        { return nodeArg; }
-
-
-    /**
-     *
-     */
-    virtual unsigned long getOffset()
-        { return offset; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    MatchContent()
-        {
-        nodeArg = NULL;
-        offset  = 0L;
-        }
-
-    /**
-     *
-     */
-    MatchContent(const MatchContent &other) : Match(other)
-        {
-        name    = other.name;
-        nodeArg = other.nodeArg;
-        offset  = other.offset;
-        }
-
-    /**
-     *
-     */
-    virtual ~MatchContent() {}
-
-protected:
-
-    DOMString     name;
-    Node          *nodeArg;
-    unsigned long offset;
-
-
-
-};
-
-
-
-/*#########################################################################
-## MatchSet
-#########################################################################*/
 
 /**
- *
+ * The DocumentView interface is implemented by Document objects in DOM 
+ * implementations supporting DOM Views. It provides an attribute to retrieve the 
+ * default view of a document.
  */
-class MatchSet : virtual public Match
+class DocumentView
 {
 public:
 
     /**
-     *
-     */
-    virtual Node *getNodeArg()
-        { return nodeArg; }
-
-    /**
-     *
-     */
-    virtual void addMatch(const Match &match)
-        { matches.push_back(match); }
-
-    /**
-     *
+     * The default AbstractView for this Document, or null if none available.
      */
-    virtual Match getMatch(unsigned long index)
+    virtual AbstractView *getDefaultView()
         {
-        if (index >= matches.size())
-            {
-            Match match;
-            return match;
-            }
-        return matches[index];
-        }
+               return defaultView;
+               }
 
     //##################
     //# Non-API methods
@@ -398,1553 +161,43 @@ public:
     /**
      *
      */
-    MatchSet()
-        {
-        nodeArg = NULL;
-        }
+    DocumentView() {}
 
     /**
      *
      */
-    MatchSet(const MatchSet &other) : Match(other)
+    DocumentView(const DocumentView &other)
         {
-        nodeArg = other.nodeArg;
-        matches = other.matches;
+        assign(other);
         }
 
     /**
      *
      */
-    virtual ~MatchSet() {}
-
-protected:
-
-    Node *nodeArg;
-
-    std::vector<Match> matches;
-
-};
-
-
-
-/*#########################################################################
-## Item
-#########################################################################*/
-
-/**
- *
- */
-class Item
-{
-public:
-
-    /**
-     *
-     */
-    virtual bool getExists()
-        { return exists; }
-
-    /**
-     *
-     */
-    virtual DOMString getName()
-        { return name; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    Item() {}
-
-    /**
-     *
-     */
-    Item(const Item &other)
+    DocumentView &operator=(const DocumentView &other)
         {
-        exists = other.exists;
-        name   = other.name;
+        assign(other);
+        return *this;
         }
 
     /**
      *
      */
-    virtual ~Item() {}
-
-protected:
-
-    bool exists;
-
-    DOMString name;
-
-
-};
-
-
-
-/*#########################################################################
-## StringItem
-#########################################################################*/
-
-/**
- *
- */
-class StringItem : virtual public Item
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getValue()
-        { return value; }
-
-    //##################
-    //# Non-API methods
-    //##################
+    virtual ~DocumentView() {}
 
-    /**
-     *
-     */
-    StringItem() {}
+private:
 
-    /**
-     *
-     */
-    StringItem(const StringItem &other) : Item(other)
+    void assign(const DocumentView &other)
         {
-        value = other.value;
-        }
-
-    /**
-     *
-     */
-    virtual ~StringItem() {}
-
-protected:
-
-    DOMString value;
-
+        defaultView = other.defaultView;
+               }
 
+    AbstractView *defaultView;
+               
 };
 
 
 
-/*#########################################################################
-## IntegerItem
-#########################################################################*/
-
-/**
- *
- */
-class IntegerItem : virtual public Item
-{
-public:
-
-
-    /**
-     *
-     */
-    virtual long getValue()
-        { return value; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    IntegerItem() {}
-
-    /**
-     *
-     */
-    IntegerItem(const IntegerItem &other) : Item(other)
-        {
-        value = other.value;
-        }
-
-    /**
-     *
-     */
-    virtual ~IntegerItem() {}
-
-protected:
-
-    long value;
-
-};
-
-
-/*#########################################################################
-## BooleanItem
-#########################################################################*/
-
-/**
- *
- */
-class BooleanItem : virtual public Item
-{
-public:
-
-    /**
-     *
-     */
-    virtual bool getValue()
-        { return value; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    BooleanItem() {}
-
-    /**
-     *
-     */
-    BooleanItem(const BooleanItem &other) : Item(other)
-        {
-        value = other.value;
-        }
-
-    /**
-     *
-     */
-    virtual ~BooleanItem() {}
-
-protected:
-
-    bool value;
-
-};
-
-
-/*#########################################################################
-## ContentItem
-#########################################################################*/
-
-/**
- *
- */
-class ContentItem : virtual public Item
-{
-public:
-
-    /**
-     *
-     */
-    virtual Node *getNodeArg()
-        { return nodeArg; }
-
-    /**
-     *
-     */
-    virtual unsigned long getOffset()
-        { return offset; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    ContentItem()
-        {
-        nodeArg = NULL;
-        }
-
-    /**
-     *
-     */
-    ContentItem(const ContentItem &other) : Item(other)
-        {
-        nodeArg = other.nodeArg;
-        offset  = other.offset;
-        }
-
-    /**
-     *
-     */
-    virtual ~ContentItem() {}
-
-protected:
-
-    Node *nodeArg;
-    long offset;
-
-
-};
-
-
-
-
-
-
-
-/*#########################################################################
-## Segment
-#########################################################################*/
-
-/**
- *
- */
-class Segment : virtual public Match
-{
-public:
-
-    /**
-     *
-     */
-    virtual Match getCriteria()
-        { return criteria; }
-
-    /**
-     *
-     */
-    virtual void setCriteria(const Match &val)
-        { criteria = val; }
-
-
-    /**
-     *
-     */
-    virtual DOMString getOrder()
-        { return order; }
-
-    /**
-     *
-     */
-    virtual void setOrder(const DOMString &val)
-        { order = val; }
-
-    /**
-     *
-     */
-    virtual MatchString createMatchString(unsigned short test,
-                                         const DOMString &name,
-                                         const DOMString &value)
-        {
-        MatchString ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual MatchInteger createMatchInteger(unsigned short test,
-                                          const DOMString &name,
-                                          long value)
-        {
-        MatchInteger ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual MatchBoolean createMatchBoolean(unsigned short test,
-                                          const DOMString &name,
-                                          bool value)
-        {
-        MatchBoolean ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual MatchContent createMatchContent(unsigned short test,
-                                          const DOMString &name,
-                                          unsigned long offset,
-                                          const Node *nodeArg)
-        {
-        MatchContent ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual MatchSet createMatchSet(unsigned short test)
-        {
-        MatchSet ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual StringItem createStringItem(const DOMString &name)
-        {
-        StringItem ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual IntegerItem createIntegerItem(const DOMString &name)
-        {
-        IntegerItem ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual BooleanItem createBooleanItem(const DOMString &name)
-        {
-        BooleanItem ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual ContentItem createContentItem(const DOMString &name)
-        {
-        ContentItem ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual void addItem(const Item &item)
-        {
-        items.push_back(item);
-        }
-
-    /**
-     *
-     */
-    virtual Item getItem(unsigned long index)
-        {
-        if (index >= items.size())
-            {
-            Item item;
-            return item;
-            }
-        return items[index];
-        }
-
-    /**
-     *
-     */
-    virtual bool getNext()
-        {
-        return false;
-        }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    Segment() {}
-
-    /**
-     *
-     */
-    Segment(const Segment &other) : Match(other)
-        {
-        criteria = other.criteria;
-        order    = other.order;
-        items    = other.items;
-        }
-
-    /**
-     *
-     */
-    virtual ~Segment() {}
-
-protected:
-
-    Match criteria;
-
-    DOMString order;
-
-    std::vector<Item> items;
-
-};
-
-
-
-
-
-
-
-
-
-
-
-
-/*#########################################################################
-## View
-#########################################################################*/
-
-/**
- *
- */
-class View
-{
-public:
-
-    /**
-     *
-     */
-    virtual void select(const Node *boundary,
-                        unsigned long offset,
-                        bool extend,
-                        bool add)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual Segment createSegment()
-        {
-        Segment ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual bool matchFirstSegment(Segment &todo) //inout parm, not const
-                                        throw(dom::DOMException)
-        {
-        return false;
-        }
-
-    /**
-     *
-     */
-    virtual long getIntegerProperty(const DOMString &name)
-                                        throw(dom::DOMException)
-        {
-        long val=0;
-        return val;
-        }
-
-    /**
-     *
-     */
-    virtual DOMString getStringProperty(const DOMString &name)
-                                        throw(dom::DOMException)
-        {
-        DOMString val;
-        return val;
-        }
-
-    /**
-     *
-     */
-    virtual bool getBooleanProperty(bool name)
-                                        throw(dom::DOMException)
-        {
-        bool val=false;
-        return val;
-        }
-
-    /**
-     *
-     */
-    virtual Node *getContentPropertyNode(const DOMString &name)
-                                        throw(dom::DOMException)
-        {
-        Node *val = NULL;
-        return val;
-        }
-
-    /**
-     *
-     */
-    virtual unsigned long getContentPropertyOffset(const DOMString &name)
-                                        throw(dom::DOMException)
-        {
-        long val=0;
-        return val;
-        }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    View() {}
-
-    /**
-     *
-     */
-    View(const View &other)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual ~View() {}
-};
-
-
-/*#########################################################################
-## VisualResource
-#########################################################################*/
-
-/**
- *
- */
-class VisualResource
-{
-public:
-
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualResource() {}
-
-    /**
-     *
-     */
-    VisualResource(const VisualResource &other)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualResource() {}
-};
-
-
-/*#########################################################################
-## VisualFont
-#########################################################################*/
-
-/**
- *
- */
-class VisualFont : virtual public VisualResource
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getMatchFontName()
-        { return matchFontName; }
-
-    /**
-     *
-     */
-    virtual void setMatchFontName(const DOMString &val)
-        { matchFontName = val; }
-
-    /**
-     *
-     */
-    virtual bool getExists()
-        { return true; }
-
-    /**
-     *
-     */
-    virtual DOMString getFontName()
-        { return fontName; }
-
-    /**
-     *
-     */
-    virtual bool getNext()
-        { return next; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualFont() {}
-
-    /**
-     *
-     */
-    VisualFont(const VisualFont &other) : VisualResource(other)
-        {
-        matchFontName = other.matchFontName;
-        fontName      = other.fontName;
-        next          = other.next;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualFont() {}
-
-protected:
-
-    DOMString matchFontName;
-    DOMString fontName;
-    bool next;
-
-
-};
-
-
-/*#########################################################################
-## VisualSegment
-#########################################################################*/
-
-/**
- *
- */
-class VisualSegment : virtual public VisualResource
-{
-public:
-
-
-    /**
-     *
-     */
-    virtual bool getMatchPosition()
-        { return matchPosition; }
-
-    /**
-     *
-     */
-    virtual void setMatchPosition(bool val)
-        { matchPosition = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchInside()
-        { return matchInside; }
-
-    /**
-     *
-     */
-    virtual void setMatchInside(bool val)
-        { matchInside = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchContaining()
-        { return matchContaining; }
-
-    /**
-     *
-     */
-    virtual void setMatchContaining(bool val)
-        { matchContaining = val; }
-
-    /**
-     *
-     */
-    virtual long getMatchX()
-        { return matchX; }
-
-    /**
-     *
-     */
-    virtual void setMatchX(long val)
-        { matchX = val; }
-
-    /**
-     *
-     */
-    virtual long getMatchY()
-        { return matchY; }
-
-    /**
-     *
-     */
-    virtual void setMatchY(long val)
-        { matchY = val; }
-
-    /**
-     *
-     */
-    virtual long getMatchXR()
-        { return matchXR; }
-
-    /**
-     *
-     */
-    virtual void setMatchXR(long val)
-        { matchXR = val; }
-
-    /**
-     *
-     */
-    virtual long getMatchYR()
-        { return matchYR; }
-
-    /**
-     *
-     */
-    virtual void setMatchYR(long val)
-        { matchYR = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchContent()
-        { return matchContent; }
-
-    /**
-     *
-     */
-    virtual void setMatchContent(bool val)
-        { matchContent = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchRange()
-        { return matchRange; }
-
-    /**
-     *
-     */
-    virtual void setMatchRange(bool val)
-        { matchRange = val; }
-
-    /**
-     *
-     */
-    virtual Node *getMatchNode()
-        { return matchNode; }
-
-    /**
-     *
-     */
-    virtual void setMatchNode(const Node *val)
-        { matchNode = (Node *)val; }
-
-    /**
-     *
-     */
-    virtual unsigned long getMatchOffset()
-        { return matchOffset; }
-
-    /**
-     *
-     */
-    virtual void setMatchOffset(unsigned long val)
-        { matchOffset = val; }
-
-    /**
-     *
-     */
-    virtual Node *getMatchNodeR()
-        { return matchNodeR; }
-
-    /**
-     *
-     */
-    virtual void setMatchNodeR(const Node *val)
-        { matchNodeR = (Node *)val; }
-
-    /**
-     *
-     */
-    virtual unsigned long getMatchOffsetR()
-        { return matchOffsetR; }
-
-    /**
-     *
-     */
-    virtual void setMatchOffsetR(unsigned long val)
-        { matchOffsetR = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchContainsSelected()
-        { return matchContainsSelected; }
-
-    /**
-     *
-     */
-    virtual void setMatchContainsSelected(bool val)
-        { matchContainsSelected = val; }
-
-    /**
-     *
-     */
-    virtual bool getMatchContainsVisible()
-        { return matchContainsVisible; }
-
-    /**
-     *
-     */
-    virtual void setMatchContainsVisible(bool val)
-        { matchContainsVisible = val; }
-
-
-    /**
-     *
-     */
-    virtual bool getExists()
-        { return exists; }
-
-    /**
-     *
-     */
-    virtual Node *getStartNode()
-        { return startNode; }
-
-    /**
-     *
-     */
-    virtual unsigned long getStartOffset()
-        { return startOffset; }
-
-    /**
-     *
-     */
-    virtual Node *getEndNode()
-        { return endNode; }
-
-    /**
-     *
-     */
-    virtual unsigned long getEndOffset()
-        { return endOffset; }
-
-    /**
-     *
-     */
-    virtual long getTopOffset()
-        { return topOffset; }
-
-    /**
-     *
-     */
-    virtual long getBottomOffset()
-        { return bottomOffset; }
-
-    /**
-     *
-     */
-    virtual long getLeftOffset()
-        { return leftOffset; }
-
-    /**
-     *
-     */
-    virtual long  getRightOffset()
-        { return rightOffset; }
-
-    /**
-     *
-     */
-    virtual unsigned long getWidth()
-        { return width; }
-
-    /**
-     *
-     */
-    virtual unsigned long getHeight()
-        { return height; }
-
-    /**
-     *
-     */
-    virtual bool getSelected()
-        { return selected; }
-
-    /**
-     *
-     */
-    virtual bool getVisible()
-        { return visible; }
-
-    /**
-     *
-     */
-    virtual unsigned long getForegroundColor()
-        { return foregroundColor; }
-
-    /**
-     *
-     */
-    virtual unsigned long getBackgroundColor()
-        { return backgroundColor; }
-
-    /**
-     *
-     */
-    virtual DOMString getFontName()
-        { return fontName; }
-
-    /**
-     *
-     */
-    virtual DOMString getFontHeight()
-        { return fontHeight; }
-
-    /**
-     *
-     */
-    virtual bool getNext()
-        { return next; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualSegment() {}
-
-    /**
-     *
-     */
-    VisualSegment(const VisualSegment &other) : VisualResource(other)
-        {
-        matchPosition         = other.matchPosition;
-        matchInside           = other.matchInside;
-        matchContaining       = other.matchContaining;
-        matchX                = other.matchX;
-        matchY                = other.matchY;
-        matchXR               = other.matchXR;
-        matchYR               = other.matchYR;
-        matchContent          = other.matchContent;
-        matchRange            = other.matchRange;
-        matchNode             = other.matchNode;
-        matchOffset           = other.matchOffset;
-        matchNodeR            = other.matchNodeR;
-        matchOffsetR          = other.matchOffsetR;
-        matchContainsSelected = other.matchContainsSelected;
-        matchContainsVisible  = other.matchContainsVisible;
-        exists                = other.exists;
-        startNode             = other.startNode;
-        startOffset           = other.startOffset;
-        endNode               = other.endNode;
-        endOffset             = other.endOffset;
-        topOffset             = other.topOffset;
-        bottomOffset          = other.bottomOffset;
-        leftOffset            = other.leftOffset;
-        rightOffset           = other.rightOffset;
-        width                 = other.width;
-        height                = other.height;
-        selected              = other.selected;
-        visible               = other.visible;
-        foregroundColor       = other.foregroundColor;
-        backgroundColor       = other.backgroundColor;
-        fontName              = other.fontName;
-        fontHeight            = other.fontHeight;
-        next                  = other.next;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualSegment() {}
-
-
-protected:
-
-    bool            matchPosition;
-    bool            matchInside;
-    bool            matchContaining;
-    long            matchX;
-    long            matchY;
-    long            matchXR;
-    long            matchYR;
-    bool            matchContent;
-    bool            matchRange;
-    Node *          matchNode;
-    unsigned long   matchOffset;
-    Node *          matchNodeR;
-    unsigned long   matchOffsetR;
-    bool            matchContainsSelected;
-    bool            matchContainsVisible;
-    bool            exists;
-    Node *          startNode;
-    unsigned long   startOffset;
-    Node *          endNode;
-    unsigned long   endOffset;
-    long            topOffset;
-    long            bottomOffset;
-    long            leftOffset;
-    long            rightOffset;
-    unsigned long   width;
-    unsigned long   height;
-    bool            selected;
-    bool            visible;
-    unsigned long   foregroundColor;
-    unsigned long   backgroundColor;
-    DOMString       fontName;
-    DOMString       fontHeight;
-    bool            next;
-
-
-};
-
-
-/*#########################################################################
-## VisualCharacter
-#########################################################################*/
-
-/**
- *
- */
-class VisualCharacter : virtual public VisualSegment
-{
-public:
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualCharacter()
-        {}
-
-    /**
-     *
-     */
-    VisualCharacter(const VisualCharacter &other) : VisualResource(other),
-                                                    VisualSegment(other)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualCharacter() {}
-};
-
-
-
-/*#########################################################################
-## VisualCharacterRun
-#########################################################################*/
-
-/**
- *
- */
-class VisualCharacterRun : virtual public VisualSegment
-{
-public:
-
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualCharacterRun() {}
-
-    /**
-     *
-     */
-    VisualCharacterRun(const VisualCharacterRun &other) : VisualResource(other),
-                                                          VisualSegment(other)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualCharacterRun() {}
-
-protected:
-
-
-};
-
-
-
-/*#########################################################################
-## VisualFrame
-#########################################################################*/
-
-/**
- *
- */
-class VisualFrame : virtual public VisualSegment
-{
-public:
-
-
-    /**
-     *
-     */
-    virtual VisualSegment getEmbedded()
-        { return embedded; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualFrame() {}
-
-    /**
-     *
-     */
-    VisualFrame(const VisualFrame &other) : VisualResource(other),
-                                            VisualSegment(other)
-        {
-        embedded = other.embedded;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualFrame() {}
-
-protected:
-
-    VisualSegment embedded;
-};
-
-
-
-/*#########################################################################
-## VisualImage
-#########################################################################*/
-
-/**
- *
- */
-class VisualImage : virtual public VisualSegment
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getImageURL()
-        { return imageURL; }
-
-    /**
-     *
-     */
-    virtual bool getIsLoaded()
-        { return isLoaded; }
-
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualImage() {}
-
-    /**
-     *
-     */
-    VisualImage(const VisualImage &other) : VisualResource(other),
-                                            VisualSegment(other)
-        {
-        imageURL = other.imageURL;
-        isLoaded = other.isLoaded;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualImage() {}
-
-protected:
-
-    DOMString imageURL;
-    bool isLoaded;
-
-};
-
-
-
-/*#########################################################################
-## VisualFormButton
-#########################################################################*/
-
-/**
- *
- */
-class VisualFormButton : virtual public VisualSegment
-{
-public:
-
-    /**
-     *
-     */
-    virtual bool getIsPressed()
-        { return isPressed; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualFormButton()
-        { isPressed = false; }
-
-    /**
-     *
-     */
-    VisualFormButton(const VisualFormButton &other) : VisualResource(other),
-                                                      VisualSegment(other)
-        {
-        isPressed = other.isPressed;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualFormButton() {}
-
-protected:
-
-    bool isPressed;
-
-};
-
-
-
-/*#########################################################################
-## VisualFormField
-#########################################################################*/
-
-/**
- *
- */
-class VisualFormField : virtual public VisualSegment
-{
-public:
-
-    /**
-     *
-     */
-    virtual DOMString getFormValue()
-        { return formValue; }
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualFormField() {}
-
-    /**
-     *
-     */
-    VisualFormField(const VisualFormField &other) : VisualResource(other),
-                                                    VisualSegment(other)
-        {
-        formValue = other.formValue;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualFormField() {}
-
-protected:
-
-    DOMString formValue;
-
-};
-
-
-
-/*#########################################################################
-## VisualView
-#########################################################################*/
-
-/**
- *
- */
-class VisualView
-{
-public:
-
-    /**
-     *
-     */
-    virtual bool getValue()
-        { return value; }
-
-    /**
-     *
-     */
-    virtual DOMString getFontScheme()
-        { return fontScheme; }
-
-    /**
-     *
-     */
-    virtual unsigned long getWidth()
-        { return width; }
-
-    /**
-     *
-     */
-    virtual unsigned long getHeight()
-        { return height; }
-
-    /**
-     *
-     */
-    virtual unsigned long getHorizontalDPI()
-        { return horizontalDPI; }
-
-    /**
-     *
-     */
-    virtual unsigned long getVerticalDPI()
-        { return verticalDPI; }
-
-    /**
-     *
-     */
-    virtual VisualCharacter createVisualCharacter()
-        {
-        VisualCharacter ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual VisualCharacterRun createVisualCharacterRun()
-        {
-        VisualCharacterRun ret;
-        return ret;
-        }
-    /**
-     *
-     */
-    virtual VisualFrame createVisualFrame()
-        {
-        VisualFrame ret;
-        return ret;
-        }
-
-
-    /**
-     *
-     */
-    virtual VisualImage createVisualImage()
-        {
-        VisualImage ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual VisualFormButton createVisualFormButton()
-        {
-        VisualFormButton ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual VisualFormField createVisualFormField()
-        {
-        VisualFormField ret;
-        return ret;
-        }
-
-    /**
-     *
-     */
-    virtual void select(const Node *boundary,
-                        unsigned long offset,
-                        bool extend,
-                        bool add)
-        {
-        }
-
-    /**
-     *
-     */
-    virtual void matchSegment(const VisualResource *segment)
-        {
-        }
-
-
-    //##################
-    //# Non-API methods
-    //##################
-
-    /**
-     *
-     */
-    VisualView() {}
-
-    /**
-     *
-     */
-    VisualView(const VisualView &other)
-        {
-        value         = other.value;
-        fontScheme    = other.fontScheme;
-        width         = other.width;
-        height        = other.height;
-        horizontalDPI = other.horizontalDPI;
-        verticalDPI   = other.verticalDPI;
-        }
-
-    /**
-     *
-     */
-    virtual ~VisualView() {}
-
-protected:
-
-    bool value;
-
-    DOMString fontScheme;
-
-    unsigned long width;
-    unsigned long height;
-    unsigned long horizontalDPI;
-    unsigned long verticalDPI;
-
-};
-