Skip to content

Commit

Permalink
Merge pull request #5439 from Pentarctagon/gui2-wiki-cleanup
Browse files Browse the repository at this point in the history
Convert custom doc comments to doxygen.
  • Loading branch information
Vultraz committed Jan 16, 2021
2 parents 3d81892 + 6389c1e commit 73593ac
Show file tree
Hide file tree
Showing 164 changed files with 1,648 additions and 5,111 deletions.
36 changes: 0 additions & 36 deletions src/editor/toolkit/brush.cpp
Expand Up @@ -20,42 +20,6 @@

namespace editor {

/*WIKI
* @page = EditorWML
* @order = 1_header
*
* {{AutogeneratedWML}}
*
* = Brush =
*
* Each brush tag defines one brush. (0,0) is the hotspot, that is, the brush
* is always moved so the mouse is over the brush's (0,0) coordinate. The
* following keys and tags are recognized:
*
* (Note the 1.5 version and the mandatory image are for testing only.)
*
* @begin{description}{wml_reference}
* name & string & "" & &
* Name for the brush (will possibly show up in the tooltip for the
* brush). $
* image & filename & "" & &
* Icon for the brush to de displayed on the toolbar. $
* radius & integer & 0 & &
* Include in the brushall hexes that are this or closer to the center
* of the brush, excluding the (0,0) point. $
* [relative] & node & 1 & & Include in the brush a single hex with
* coordinates relative from the center of the brush. $
*
* @begin{description}{wml_reference}
* x & int & 0 & & The relative x coordinate. $
* y & int & 0 & & The relative y coordinate. $
* @end{description}
*
* @end{description}
* A brush that has neither a radius nor any [relative] hexes will be empty
* which is not desired and a warning or error is to be expected.
*/

brush::brush()
: relative_tiles_()
, name_()
Expand Down
568 changes: 0 additions & 568 deletions src/gui/core/canvas.cpp

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/gui/core/canvas.hpp
Expand Up @@ -223,8 +223,7 @@ class canvas
* the config object is no longer required and thus not stored in the
* object.
*
* @param cfg The config object with the data to draw, see
* https://www.wesnoth.org/wiki/GUICanvasWML
* @param cfg The config object with the data to draw, see @ref GUICanvasWML
*/
void parse_cfg(const config& cfg);

Expand Down
192 changes: 171 additions & 21 deletions src/gui/core/canvas_private.hpp

Large diffs are not rendered by default.

110 changes: 0 additions & 110 deletions src/gui/core/widget_definition.cpp
Expand Up @@ -24,99 +24,12 @@
namespace gui2
{

/*WIKI
* @page = GUIToolkitWML
* @order = 1_widget
*
* == State ==
*
* @begin{parent}{name="generic/"}
* @begin{tag}{name="state"}{min=0}{max=1}
* Definition of a state. A state contains the info what to do in a state.
* Atm this is rather focused on the drawing part, might change later.
* Keys:
* @begin{table}{config}
* draw & section & & Section with drawing directions for a
*canvas. $
* @end{table}
* @end{tag}{name="state"}
* @end{parent}{name="generic/"}
*
*/
state_definition::state_definition(const config& cfg)
: canvas_cfg_(cfg ? cfg.child("draw") : cfg)
{
VALIDATE(canvas_cfg_, _("No state or draw section defined."));
}

/*WIKI
* @page = GUIToolkitWML
* @order = 1_widget
* @begin{parent}{name=generic/widget_definition/}
* == Resolution ==
* @begin{tag}{name="resolution"}{min="0"}{max="-1"}
*
* Depending on the resolution a widget can look different. Resolutions are
* evaluated in order of appearance. The ''window_width'' and ''window_height''
* are the upper limit this resolution is valid for. When one of the sizes
* gets above the limit, the next resolution is selected. There's one special
* case where both values are ''0''. This resolution always matches. (Resolution
* definitions behind that one will never be picked.) This resolution can be
* used as upper limit or if there's only one resolution.
*
* The default (and also minimum) size of a button is determined by two items,
* the wanted default size and the size needed for the text. The size of the
* text differs per used widget so needs to be determined per button.
*
* Container widgets like panels and windows have other rules for their sizes.
* Their sizes are based on the size of their children (and the border they need
* themselves). It's wise to set all sizes to 0 for these kind of widgets.
*
* @begin{table}{config}
* window_width & unsigned & 0 & Width of the application window. $
* window_height & unsigned & 0 & Height of the application window. $
*
*
* min_width & unsigned & 0 & The minimum width of the widget. $
* min_height & unsigned & 0 & The minimum height of the widget. $
*
*
* default_width & unsigned & 0 & The default width of the widget. $
* default_height & unsigned & 0 & The default height of the widget. $
*
*
* max_width & unsigned & 0 & The maximum width of the widget. $
* max_height & unsigned & 0 & The maximum height of the widget. $
*
* text_extra_width & unsigned & 0 &
* The extra width needed to determine the minimal size for the text. $
*
* text_extra_height & unsigned & 0 &
* The extra height needed to determine the minimal size for the text. $
*
* text_font_family & font_family & "" &
* The font family, needed to determine the minimal size for the text. $
*
* text_font_size & formula for unsigned & 0 &
* The font size, which needs to be used to determine the minimal size for
* the text. Currently, the only variables supported in this formula are
* those available from the global GUI2 settings object, namely screen_width,
* screen_height, screen_pitch_microns, gamemap_width, gamemap_height, and
* gamemap_x_offset. $
*
* text_font_style & font_style & "" &
* The font style, which needs to be used to determine the minimal size for
* the text. $
*
*
* state & section & &
* Every widget has one or more state sections. Note they aren't called
* state but state_xxx the exact names are listed per widget. $
* @end{table}
* @end{tag}{name="resolution"}
* @end{parent}{name=generic/widget_definition/}
*/

resolution_definition::resolution_definition(const config& cfg)
: window_width(cfg["window_width"])
, window_height(cfg["window_height"])
Expand All @@ -140,29 +53,6 @@ resolution_definition::resolution_definition(const config& cfg)
linked_groups = parse_linked_group_definitions(cfg);
}

/*WIKI
* @page = GUIWidgetDefinitionWML
* @order = 1
*
* {{Autogenerated}}
*
* = Widget definition =
*
* This page describes the definition of all widgets in the toolkit. Every
* widget has some parts in common, first of all; every definition has the
* following fields.
* @begin{parent}{name="generic/"}
* @begin{tag}{name=widget_definition}{min=0}{max=1}
* @begin{table}{config}
* id & string & & Unique id for this gui (theme). $
* description & t_string & & Unique translatable name for this gui. $
*
* resolution & section & & The definitions of the widget in various
* resolutions. $
* @end{table}
* @end{tag}{name=widget_definition}
* @end{parent}{name="generic/"}
*/
styled_widget_definition::styled_widget_definition(const config& cfg)
: id(cfg["id"]), description(cfg["description"].t_str()), resolutions()
{
Expand Down
35 changes: 34 additions & 1 deletion src/gui/core/widget_definition.hpp
Expand Up @@ -39,7 +39,40 @@ struct state_definition
config canvas_cfg_;
};

/** Base class of a resolution, contains the common keys for a resolution. */
/**
* Base class of a resolution, contains the common keys for a resolution.
*
* Depending on the resolution a widget can look different. Resolutions are evaluated in order of appearance.
* The window_width and window_height are the upper limit this resolution is valid for.
* When one of the sizes gets above the limit, the next resolution is selected.
* There's one special case where both values are 0. This resolution always matches.
* (Resolution definitions behind that one will never be picked.)
* This resolution can be used as upper limit or if there's only one resolution.
*
* The default (and also minimum) size of a button is determined by two items, the wanted default size and the size needed for the text.
* The size of the text differs per used widget so needs to be determined per button.
*
* Container widgets like panels and windows have other rules for their sizes.
* Their sizes are based on the size of their children (and the border they need themselves).
* It's wise to set all sizes to 0 for these kind of widgets.
*
* Key |Type |Default |Description
* -----------------|------------------------------------|---------|-------------
* window_width | @ref guivartype_unsigned "unsigned"|0 |Width of the application window.
* window_height | @ref guivartype_unsigned "unsigned"|0 |Height of the application window.
* min_width | @ref guivartype_unsigned "unsigned"|0 |The minimum width of the widget.
* min_height | @ref guivartype_unsigned "unsigned"|0 |The minimum height of the widget.
* default_width | @ref guivartype_unsigned "unsigned"|0 |The default width of the widget.
* default_height | @ref guivartype_unsigned "unsigned"|0 |The default height of the widget.
* max_width | @ref guivartype_unsigned "unsigned"|0 |TThe maximum width of the widget.
* max_height | @ref guivartype_unsigned "unsigned"|0 |The maximum height of the widget.
* text_extra_width | @ref guivartype_unsigned "unsigned"|0 |The extra width needed to determine the minimal size for the text.
* text_extra_height| @ref guivartype_unsigned "unsigned"|0 |The extra height needed to determine the minimal size for the text.
* text_font_family | font_family |"" |The font family, needed to determine the minimal size for the text.
* text_font_size | @ref guivartype_unsigned "unsigned"|0 |The font size, which needs to be used to determine the minimal size for the text.
* text_font_style | font_style |"" |The font style, which needs to be used to determine the minimal size for the text.
* state | @ref guivartype_section "section" |mandatory|Every widget has one or more state sections. Note they aren't called state but state_xxx the exact names are listed per widget.
*/
struct resolution_definition
{
explicit resolution_definition(const config& cfg);
Expand Down

0 comments on commit 73593ac

Please sign in to comment.