[dasher: 173/217] Changes in control.*.xml file structure.
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 173/217] Changes in control.*.xml file structure.
- Date: Sat, 27 Feb 2016 12:14:52 +0000 (UTC)
commit 1666ae03502df322291fe6662e1a6eee53e217ee
Author: Ada Majorek <amajorek google com>
Date: Wed Jan 13 13:07:57 2016 -0800
Changes in control.*.xml file structure.
Data/control/control.411.xml | 4 +-
Data/control/control.all.xml | 92 ++++++++++++++++++++----------
Data/control/control.dtd | 11 ++--
Data/control/control.edit.xml | 7 ++-
Data/control/control.prepared_speech.xml | 85 +++++++++++----------------
Data/control/control.speak.xml | 91 +++++++++++++++--------------
Src/DasherCore/ControlManager.cpp | 6 +-
7 files changed, 159 insertions(+), 137 deletions(-)
---
diff --git a/Data/control/control.411.xml b/Data/control/control.411.xml
index 982fab4..9cda07c 100644
--- a/Data/control/control.411.xml
+++ b/Data/control/control.411.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE control SYSTEM "control.dtd">
-<nodes>
+<control name="Dasher 4.11">
<alph/>
<node label="Stop" color="242">
@@ -182,4 +182,4 @@
</node>
</node>
-</nodes>
+</control>
diff --git a/Data/control/control.all.xml b/Data/control/control.all.xml
index c4b64b5..c1214ec 100644
--- a/Data/control/control.all.xml
+++ b/Data/control/control.all.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nodes>
+<!DOCTYPE control SYSTEM "control.dtd">
+<control name="All Available Commands">
<alph/>
+
<node label="⏹" color="242">
<stop/>
<alph/>
@@ -211,9 +213,51 @@
</node>
</node>
- <node name="CTL_SPEAK" label="🗣" color="241">
- <alph/>
+ <node name="CTL_COPY" label="📋" color="-1">
+
+ <node label="🗐" color="-1">
+ <copy what="all"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="🆕" color="-1">
+ <copy what="new"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="🔃" color="-1">
+ <copy what="repeat"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="🗏" color="-1">
+ <copy what="page"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="¶" color="-1">
+ <copy what="paragraph"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label=".⁉" color="-1">
+ <copy what="sentence"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="━" color="-1">
+ <copy what="line"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="⬬" color="-1">
+ <copy what="word"/>
+ <alph/>
+ <root/>
+ </node>
+ </node>
+ <node name="CTL_SPEAK" label="🗣" color="241">
<node label="🗐" color="-1">
<speak what="all"/>
<ref name="CTL_SPEAK"/>
@@ -322,49 +366,35 @@
</node>
</node>
- <node name="CTL_COPY" label="📋" color="-1">
-
- <node label="🗐" color="-1">
- <copy what="all"/>
- <alph/>
- <root/>
- </node>
- <node label="🆕" color="-1">
- <copy what="new"/>
- <alph/>
- <root/>
- </node>
- <node label="🔃" color="-1">
- <copy what="repeat"/>
+ <alph/>
+
+ <!--
+ <node label="utf symbols" color="241">
+ <node label="🔇💬🔊🔉🔈↻┅━╍⭙⁉"
color="242">
<alph/>
<root/>
</node>
- <node label="🗏" color="-1">
- <copy what="page"/>
+ <node label="⎚⎘⎗⎌⍾⌫ ⌧⌦🛇‒⦻"
color="242">
<alph/>
<root/>
</node>
- <node label="¶" color="-1">
- <copy what="paragraph"/>
+ <node label="🗣🗗🗖🗕🔔🔃🔁📣🗏🗐"
color="242">
<alph/>
<root/>
</node>
- <node label=".⁉" color="-1">
- <copy what="sentence"/>
+ <node label="📋📁💾✘✂⚠☰┅⬬●•"
color="242">
<alph/>
<root/>
</node>
- <node label="━" color="-1">
- <copy what="line"/>
+ <node label="📋📁💾✘✂⚠☰┅⬬●•"
color="242">
<alph/>
- <root/>
- </node>
- <node label="⬬" color="-1">
- <copy what="word"/>
+ <root/>
+ </node>
+ <node label="⇦🛈🗟⥁⟳⇨↔🆕" color="242">
<alph/>
<root/>
</node>
</node>
-
-</nodes>
+ -->
+</control>
diff --git a/Data/control/control.dtd b/Data/control/control.dtd
index f938a43..5458f93 100644
--- a/Data/control/control.dtd
+++ b/Data/control/control.dtd
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!ELEMENT nodes (node*)>
+<!ELEMENT control ((node|alph)*)>
+<!ATTLIST control name CDATA #REQUIRED>
<!ELEMENT node ((node|move|delete|copy|speak|pause|stop|ref|root|alph)*)>
<!--by specifying the name attribute as type ID rather than CDATA, the XML
@@ -10,17 +11,17 @@
<!ELEMENT move EMPTY>
<!ATTLIST move forward (yes|no) #REQUIRED>
-<!ATTLIST move dist (char|word|line|sentence|paragraph|all) #REQUIRED>
+<!ATTLIST move dist (char|word|line|sentence|paragraph|page|all) #REQUIRED>
<!ELEMENT delete EMPTY>
<!ATTLIST delete forward (yes|no) #REQUIRED>
-<!ATTLIST delete dist (char|word|line|sentence|paragraph|all) #REQUIRED>
+<!ATTLIST delete dist (char|word|line|sentence|paragraph|page|all) #REQUIRED>
<!ELEMENT copy EMPTY>
-<!ATTLIST copy dist (all|new|repeat|sentence|paragraph) #REQUIRED>
+<!ATTLIST copy what (new|repeat|word|line|sentence|paragraph|page|all) #REQUIRED>
<!ELEMENT speak EMPTY>
-<!ATTLIST speak what (cancel|all|new|repeat|sentence|paragraph) #REQUIRED>
+<!ATTLIST speak what (cancel|new|repeat|word|line|sentence|paragraph|page|all) #REQUIRED>
<!ELEMENT pause EMPTY>
diff --git a/Data/control/control.edit.xml b/Data/control/control.edit.xml
index 4eddd90..3e3ba32 100644
--- a/Data/control/control.edit.xml
+++ b/Data/control/control.edit.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nodes>
+<!DOCTYPE control SYSTEM "control.dtd">
+<control name="Edit Larger Document">
<alph/>
+
<node label="⏹" color="242">
<stop/>
<alph/>
@@ -226,5 +228,6 @@
</node>
</node>
-</nodes>
+ <alph/>
+</control>
diff --git a/Data/control/control.prepared_speech.xml b/Data/control/control.prepared_speech.xml
index f2f3757..2297c07 100644
--- a/Data/control/control.prepared_speech.xml
+++ b/Data/control/control.prepared_speech.xml
@@ -1,59 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nodes>
-
- <node name="CTL_SPEAK" label="🗣" color="241">
- <alph/>
-
- <node label="¶" color="-1">
- <speak what="paragraph"/>
- <ref name="CTL_SPEAK"/>
- <node label="⇨¶" color="-1">
- <move forward="yes" dist="paragraph"/>
- <ref name="CTL_SPEAK"/>
- <root/>
- </node>
- </node>
- <node label=".⁉" color="-1">
- <speak what="sentence"/>
- <ref name="CTL_SPEAK"/>
- <node label="⇨.⁉" color="-1">
- <move forward="yes" dist="sentence"/>
- <ref name="CTL_SPEAK"/>
- <root/>
- </node>
- </node>
-
- <node label="🔃" color="241">
- <speak what="repeat"/>
- <ref name="CTL_SPEAK"/>
- <root/>
- </node>
- <node label="🛇" color="241">
- <speak what="cancel"/>
- <ref name="CTL_SPEAK"/>
- <root/>
- </node>
- </node>
+<!DOCTYPE control SYSTEM "control.dtd">
+<control name="Speak From Prepared Document">
<node name="CTL_MOVE" label="✢" color="-1">
+
<node name="CTL_MOVE_BACKWARD" label="⇦" color="-1">
<node label="🗐" color="-1">
<move forward="no" dist="all"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
<node label="¶" color="-1">
<move forward="no" dist="paragraph"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
<node label=".⁉" color="-1">
<move forward="no" dist="sentence"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
</node>
@@ -61,26 +26,46 @@
<node label=".⁉" color="-1">
<move forward="yes" dist="sentence"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
<node label="¶" color="-1">
<move forward="yes" dist="paragraph"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
<node label="🗐" color="-1">
<move forward="yes" dist="all"/>
+ <ref name="CTL_MOVE"/>
<ref name="CTL_SPEAK"/>
- <ref name="CTL_MOVE_BACKWARD"/>
- <ref name="CTL_MOVE_FORWARD"/>
</node>
</node>
+ </node>
-
+ <node name="CTL_SPEAK" label="🗣" color="241">
+
+ <node label="¶" color="-1">
+ <speak what="paragraph"/>
+ <move forward="yes" dist="paragraph"/>
+ <ref name="CTL_MOVE"/>
+ <ref name="CTL_SPEAK"/>
+ </node>
+ <node label=".⁉" color="-1">
+ <speak what="sentence"/>
+ <move forward="yes" dist="sentence"/>
+ <ref name="CTL_MOVE"/>
+ <ref name="CTL_SPEAK"/>
+ </node>
+ <node label="🔃" color="241">
+ <speak what="repeat"/>
+ <ref name="CTL_MOVE"/>
+ <ref name="CTL_SPEAK"/>
+ </node>
+ <node label="🛇" color="241">
+ <speak what="cancel"/>
+ <ref name="CTL_MOVE"/>
+ <ref name="CTL_SPEAK"/>
+ </node>
</node>
-
-</nodes>
+</control>
diff --git a/Data/control/control.speak.xml b/Data/control/control.speak.xml
index 651b6a8..c103843 100644
--- a/Data/control/control.speak.xml
+++ b/Data/control/control.speak.xml
@@ -1,49 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nodes>
+<!DOCTYPE control SYSTEM "control.dtd">
+<control name="Conversation">
- <node name="CTL_SPEAK" label="🗣" color="241">
- <alph/>
-
- <node label="🗐" color="-1">
- <speak what="all"/>
- <ref name="CTL_SPEAK"/>
- <node label="⌧🗐" color="242">
- <delete forward="yes" dist="all"/>
- <delete forward="no" dist="all"/>
- <alph/>
- <root/>
- </node>
- <root/>
- </node>
- <node label="¶" color="-1">
- <speak what="paragraph"/>
- <ref name="CTL_SPEAK"/>
- <node label="⌧¶" color="242">
- <move forward="yes" dist="paragraph"/>
- <delete forward="no" dist="paragraph"/>
- <move forward="no" dist="char"/>
- <alph/>
- <root/>
- </node>
- <node label="⇨¶" color="-1">
- <move forward="yes" dist="paragraph"/>
- <ref name="CTL_SPEAK"/>
- <root/>
- </node>
- </node>
- <node label="🔃" color="241">
- <speak what="repeat"/>
- <alph/>
- <root/>
- </node>
- <node label="🛇" color="241">
- <speak what="cancel"/>
- <alph/>
- <root/>
- </node>
- </node>
<node name="CTL_MOVE" label="✢" color="-1">
+ <alph/>
<node name="CTL_MOVE_BACKWARD" label="⇦" color="-1">
<node label="🗐" color="-1">
<move forward="no" dist="all"/>
@@ -113,8 +74,8 @@
</node>
-
<node name="CTL_DELETE" label="⦻" color="-1">
+ <alph/>
<node name="CTL_DELETE_BACKWARD" label="⌫" color="-1">
<node label="🗐" color="-1">
<delete forward="no" dist="all"/>
@@ -193,5 +154,47 @@
</node>
</node>
-</nodes>
+ <node name="CTL_SPEAK" label="🗣" color="241">
+
+ <node label="🗐" color="-1">
+ <speak what="all"/>
+ <ref name="CTL_SPEAK"/>
+ <node label="⌧🗐" color="242">
+ <delete forward="yes" dist="all"/>
+ <delete forward="no" dist="all"/>
+ <alph/>
+ <root/>
+ </node>
+ <root/>
+ </node>
+ <node label="¶" color="-1">
+ <speak what="paragraph"/>
+ <ref name="CTL_SPEAK"/>
+ <node label="⌧¶" color="242">
+ <move forward="yes" dist="paragraph"/>
+ <delete forward="no" dist="paragraph"/>
+ <move forward="no" dist="char"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="⇨¶" color="-1">
+ <move forward="yes" dist="paragraph"/>
+ <ref name="CTL_SPEAK"/>
+ <root/>
+ </node>
+ </node>
+ <node label="🔃" color="241">
+ <speak what="repeat"/>
+ <alph/>
+ <root/>
+ </node>
+ <node label="🛇" color="241">
+ <speak what="cancel"/>
+ <alph/>
+ <root/>
+ </node>
+ <alph/>
+ </node>
+
+</control>
diff --git a/Src/DasherCore/ControlManager.cpp b/Src/DasherCore/ControlManager.cpp
index 42a5099..166a2d4 100644
--- a/Src/DasherCore/ControlManager.cpp
+++ b/Src/DasherCore/ControlManager.cpp
@@ -193,7 +193,7 @@ bool CControlParser::ParseFile(const string &strFileName, bool bUser) {
}
void CControlParser::XmlStartHandler(const XML_Char *name, const XML_Char **atts) {
- vector<CControlBase::NodeTemplate *> &parent(nodeStack.empty() ? m_vParsed : nodeStack.back()->successors);
+ auto& parent(nodeStack.empty() ? m_vParsed : nodeStack.back()->successors);
if (strcmp(name,"node")==0) {
string label,nodeName; int color=-1;
while (*atts) {
@@ -219,7 +219,7 @@ void CControlParser::XmlStartHandler(const XML_Char *name, const XML_Char **atts
target=*(atts+1);
atts+=2;
}
- map<string,CControlBase::NodeTemplate*>::iterator it=namedNodes.find(target);
+ auto it=namedNodes.find(target);
if (it!=namedNodes.end())
parent.push_back(it->second);
else {
@@ -505,7 +505,7 @@ bool CControlBoxIO::ParseFile(const std::string &strFilename, bool bUser) {
}
void CControlBoxIO::XmlStartHandler(const XML_Char *name, const XML_Char **atts) {
- if (strcmp(name, "nodes") == 0) {
+ if (strcmp(name, "control") == 0) {
string id;
while (*atts != 0) {
if (strcmp(*atts, "name") == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]