Author: sytyi
Date: Mon Aug 22 23:45:56 2011
New Revision: 50883

URL: http://svn.gna.org/viewcvs/wesnoth?rev=50883&view=rev
Log:
Updated schema markup for GUI WML

Modified:
    trunk/data/gui/schema.cfg
    trunk/src/gui/auxiliary/canvas.cpp
    trunk/src/gui/auxiliary/window_builder.cpp
    trunk/src/gui/auxiliary/window_builder/scrollbar_panel.cpp
    trunk/src/gui/widgets/settings.cpp

Modified: trunk/data/gui/schema.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/schema.cfg?rev=50883&r1=50882&r2=50883&view=diff
==============================================================================
--- trunk/data/gui/schema.cfg (original)
+++ trunk/data/gui/schema.cfg Mon Aug 22 23:45:56 2011
@@ -5,7 +5,7 @@
     [/type]
     [type]
         name=border
-        value="^top|bottom|left|right|all*$"
+        
value="^(top|bottom|left|right|all)?(,\s*(top|bottom|left|right|all))*$"
     [/type]
     [type]
         name=color
@@ -57,7 +57,7 @@
     [/type]
     [type]
         name=string
-        value="^.+$"
+        value="^.*$"
     [/type]
     [type]
         name=t_string
@@ -1517,12 +1517,7 @@
                                         name="definition"
                                         min="0"
                                         max="1"
-                                        [tag]
-                                            name="row"
-                                            min="1"
-                                            max="1"
-                                            
super="gui/window/resolution/grid/row"
-                                        [/tag]
+                                        super="gui/window/resolution/grid"
                                     [/tag]
                                     [key]
                                         name="horizontal_scrollbar_mode"
@@ -1748,6 +1743,16 @@
                                 default=0
                             [/key]
                         [/tag]
+                        [key]
+                            name="id"
+                            type="string"
+                            default=""
+                        [/key]
+                        [key]
+                            name="linked_group"
+                            type="string"
+                            default=0
+                        [/key]
                     [/tag]
                     [tag]
                         name="helptip"
@@ -1894,91 +1899,5 @@
                 mandatory="true"
             [/key]
         [/tag]
-        [tag]
-            name="wml_schema"
-            min="0"
-            max="0"
-            [tag]
-                name="tag"
-                min="0"
-                max="1"
-                [tag]
-                    name="key"
-                    min="0"
-                    max="-1"
-                    [key]
-                        name="default"
-                        type="string"
-                        mandatory="true"
-                    [/key]
-                    [key]
-                        name="mandatory"
-                        type="string"
-                        mandatory="true"
-                    [/key]
-                    [key]
-                        name="name"
-                        type="string"
-                        mandatory="true"
-                    [/key]
-                    [key]
-                        name="type"
-                        type="string"
-                        mandatory="true"
-                    [/key]
-                [/tag]
-                [tag]
-                    name="link"
-                    min="0"
-                    max="-1"
-                    [key]
-                        name="name"
-                        type="string"
-                        mandatory="true"
-                    [/key]
-                [/tag]
-                [tag]
-                    name="tag"
-                    min="0"
-                    max="-1"
-                    super="wml_schema/tag"
-                [/tag]
-                [key]
-                    name="max"
-                    type="int"
-                    mandatory="true"
-                [/key]
-                [key]
-                    name="min"
-                    type="int"
-                    mandatory="true"
-                [/key]
-                [key]
-                    name="name"
-                    type="string"
-                    mandatory="true"
-                [/key]
-                [key]
-                    name="super"
-                    type="string"
-                    default=""
-                [/key]
-            [/tag]
-            [tag]
-                name="type"
-                min="0"
-                max="-1"
-                [key]
-                    name="name"
-                    type="string"
-                    mandatory="true"
-                [/key]
-                [key]
-                    name="value"
-                    type="string"
-                    mandatory="true"
-                [/key]
-            [/tag]
-        [/tag]
     [/tag]
 [/wml_schema]

Modified: trunk/src/gui/auxiliary/canvas.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/canvas.cpp?rev=50883&r1=50882&r2=50883&view=diff
==============================================================================
--- trunk/src/gui/auxiliary/canvas.cpp (original)
+++ trunk/src/gui/auxiliary/canvas.cpp Mon Aug 22 23:45:56 2011
@@ -530,7 +530,7 @@
  * @allow{type}{name="f_int"}{value="^.*$"}
  * @allow{type}{name="bool"}{value="^true|false|yes|no$"}
  * @allow{type}{name="f_bool"}{value="^.*$"}
- * @allow{type}{name="string"}{value="^.+$"}
+ * @allow{type}{name="string"}{value="^.*$"}
  * @allow{type}{name="t_string"}{value="^_?.*$"}
  * @allow{type}{name="f_string"}{value="^.*$"}
  * @allow{type}{name="f_tstring"}{value="^_?.*$"}
@@ -541,7 +541,7 @@
  * @allow{type}{name="v_align"}{value="^top|bottom|center$"}
  * @allow{type}{name="h_align"}{value="^left|right|center$"}
  * @allow{type}{name="f_h_align"}{value="^.*$"}
- * @allow{type}{name="border"}{value="^top|bottom|left|right|all*$"}
+ * 
@allow{type}{name="border"}{value="^(top|bottom|left|right|all)?(,\s*(top|bottom|left|right|all))*$"}
  * 
@allow{type}{name="scrollbar_mode"}{value="^always|never|auto|initial_auto$"}
  * @allow{type}{name="resize_mode"}{value="^scale|stretch|tile$"}
  *

Modified: trunk/src/gui/auxiliary/window_builder.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/window_builder.cpp?rev=50883&r1=50882&r2=50883&view=diff
==============================================================================
--- trunk/src/gui/auxiliary/window_builder.cpp (original)
+++ trunk/src/gui/auxiliary/window_builder.cpp Mon Aug 22 23:45:56 2011
@@ -443,6 +443,12 @@
  * @begin{parent}{name="gui/window/resolution/"}
  * = Cell =
  * @begin{tag}{name="grid"}{min="1"}{max="1"}
+ * @begin{table}{config}
+ *     id & string & "" &      A grid is a widget and can have an id. This 
isn't
+ *                                      used that often, but is allowed. $
+ *     linked_group & string & 0 &       $
+ * @end{table}
+ *
  * Every grid cell has some cell configuration values and one widget in the 
grid
  * cell. Here we describe the what is available more information about the 
usage
  * can be found here [[GUILayout]].

Modified: trunk/src/gui/auxiliary/window_builder/scrollbar_panel.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/window_builder/scrollbar_panel.cpp?rev=50883&r1=50882&r2=50883&view=diff
==============================================================================
--- trunk/src/gui/auxiliary/window_builder/scrollbar_panel.cpp (original)
+++ trunk/src/gui/auxiliary/window_builder/scrollbar_panel.cpp Mon Aug 22 
23:45:56 2011
@@ -124,9 +124,7 @@
  *                                     definition for 1 row of the list. $
  *
  * @end{table}
- * @begin{tag}{name="definition"}{min=0}{max=1}
- * 
@begin{tag}{name="row"}{min=1}{max=1}{super="gui/window/resolution/grid/row"}
- * @end{tag}{name="row"}
+ * 
@begin{tag}{name="definition"}{min=0}{max=1}{super="gui/window/resolution/grid"}
  * @end{tag}{name="definition"}
  * @end{tag}{name="scrollbar_panel"}
  * @end{parent}{name="gui/window/resolution/grid/row/column/"}

Modified: trunk/src/gui/widgets/settings.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.cpp?rev=50883&r1=50882&r2=50883&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Mon Aug 22 23:45:56 2011
@@ -482,20 +482,20 @@
        // Read file.
        config cfg;
        try {
-//             schema_validation::schema_validator
-//                             validator (get_wml_location("gui/schema.cfg"));
+               schema_validation::schema_validator
+                               validator (get_wml_location("gui/schema.cfg"));
                preproc_map preproc(
                                
game_config::config_cache::instance().get_preproc_map());
                scoped_istream stream = 
preprocess_file(get_wml_location("gui/default.cfg"), &preproc);
 
-               read(cfg, *stream/*, &validator*/);
+               read(cfg, *stream, &validator);
        } catch(config::error&) {
                ERR_GUI_P << "Setting: could not read file 
'data/gui/default.cfg'.\n";
        }
-//     catch(abstract_validator::error e){
-//                     ERR_GUI_P << "Setting: could not read file 
'data/gui/schema.cfg'.\n";
-//                     ERR_GUI_P << e.message;
-//     }
+       catch(abstract_validator::error e){
+                       ERR_GUI_P << "Setting: could not read file 
'data/gui/schema.cfg'.\n";
+                       ERR_GUI_P << e.message;
+       }
        // Parse guis
        foreach (const config &g, cfg.child_range("gui")) {
                std::pair<std::string, tgui_definition> child;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to