# HG changeset patch # User rubidium # Date 1224012428 0 # Node ID 5076964d81a1e185cdd9fb5437fd08b3a67a2b7d # Parent c55922dabb25a5d15dcd8fbd66e5f6d9a6f61169 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation. diff -r c55922dabb25 -r 5076964d81a1 src/command_type.h --- a/src/command_type.h Tue Oct 14 18:49:21 2008 +0000 +++ b/src/command_type.h Tue Oct 14 19:27:08 2008 +0000 @@ -64,7 +64,7 @@ /** * Multiplies the cost of the command by the given factor. - * @param cost factor to multiply the costs with + * @param factor factor to multiply the costs with * @return this class */ CommandCost MultiplyCost(int factor) diff -r c55922dabb25 -r 5076964d81a1 src/console_gui.cpp --- a/src/console_gui.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/console_gui.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -1,6 +1,6 @@ /* $Id$ */ -/** @file console.cpp Handling of the in-game console. */ +/** @file console_gui.cpp Handling the GUI of the in-game console. */ #include "stdafx.h" #include "openttd.h" diff -r c55922dabb25 -r 5076964d81a1 src/fileio.cpp --- a/src/fileio.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/fileio.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -1029,7 +1029,7 @@ /** * Scan for files with the given extention in the given search path. * @param extension the extension of files to search for. - * @param sp the sub directory to search in. + * @param sd the sub directory to search in. * @param tars whether to search in the tars too. * @return the number of found files, i.e. the number of times that * AddFile returned true. diff -r c55922dabb25 -r 5076964d81a1 src/network/network_func.h --- a/src/network/network_func.h Tue Oct 14 18:49:21 2008 +0000 +++ b/src/network/network_func.h Tue Oct 14 19:27:08 2008 +0000 @@ -1,6 +1,6 @@ /* $Id$ */ -/** @file network_internal.h Variables and function used internally. */ +/** @file network_func.h Network functions used by other parts of OpenTTD. */ #ifndef NETWORK_FUNC_H #define NETWORK_FUNC_H diff -r c55922dabb25 -r 5076964d81a1 src/vehiclelist.cpp --- a/src/vehiclelist.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/vehiclelist.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -1,6 +1,6 @@ /* $Id$ */ -/** @file vehicle.cpp Base implementations of all vehicles. */ +/** @file vehiclelist.cpp Lists of vehicles. */ #include "stdafx.h" #include "openttd.h" diff -r c55922dabb25 -r 5076964d81a1 src/viewport.cpp --- a/src/viewport.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/viewport.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -1549,6 +1549,9 @@ ViewportDrawChk(vp, left, top, right, bottom); } +/** + * Draw the viewport of this window. + */ void Window::DrawViewport() const { DrawPixelInfo *dpi = _cur_dpi; diff -r c55922dabb25 -r 5076964d81a1 src/widget.cpp --- a/src/widget.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/widget.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -204,7 +204,6 @@ /** * Paint all widgets of a window. - * @param w Window */ void Window::DrawWidgets() const { @@ -616,8 +615,8 @@ w->resize.height += delta_y; } -/** Draw a sort button's up or down arrow symbol. - * @param w Window of widget +/** + * Draw a sort button's up or down arrow symbol. * @param widget Sort button widget * @param state State of sort button */ diff -r c55922dabb25 -r 5076964d81a1 src/window.cpp --- a/src/window.cpp Tue Oct 14 18:49:21 2008 +0000 +++ b/src/window.cpp Tue Oct 14 19:27:08 2008 +0000 @@ -51,6 +51,13 @@ byte _special_mouse_mode; +/** + * Sets the enabled/disabled status of a list of widgets. + * By default, widgets are enabled. + * On certain conditions, they have to be disabled. + * @param disab_stat status to use ie: disabled = true, enabled = false + * @param widgets list of widgets ended by WIDGET_LIST_END + */ void CDECL Window::SetWidgetsDisabledState(bool disab_stat, int widgets, ...) { va_list wdg_list; @@ -65,6 +72,13 @@ va_end(wdg_list); } +/** + * Sets the hidden/shown status of a list of widgets. + * By default, widgets are visible. + * On certain conditions, they have to be hidden. + * @param hidden_stat status to use ie. hidden = true, visible = false + * @param widgets list of widgets ended by WIDGET_LIST_END + */ void CDECL Window::SetWidgetsHiddenState(bool hidden_stat, int widgets, ...) { va_list wdg_list; @@ -79,6 +93,11 @@ va_end(wdg_list); } +/** + * Sets the lowered/raised status of a list of widgets. + * @param lowered_stat status to use ie: lowered = true, raised = false + * @param widgets list of widgets ended by WIDGET_LIST_END + */ void CDECL Window::SetWidgetsLoweredState(bool lowered_stat, int widgets, ...) { va_list wdg_list; @@ -93,6 +112,9 @@ va_end(wdg_list); } +/** + * Raise all buttons of the window + */ void Window::RaiseButtons() { for (uint i = 0; i < this->widget_count; i++) { @@ -103,6 +125,10 @@ } } +/** + * Invalidate a widget, i.e. mark it as being changed and in need of redraw. + * @param widget_index the widget to redraw. + */ void Window::InvalidateWidget(byte widget_index) const { const Widget *wi = &this->widget[widget_index]; @@ -113,6 +139,11 @@ SetDirtyBlocks(this->left + wi->left, this->top + wi->top, this->left + wi->right + 1, this->top + wi->bottom + 1); } +/** + * Do all things to make a button look clicked and mark it to be + * unclicked in a few ticks. + * @param widget the widget to "click" + */ void Window::HandleButtonClick(byte widget) { this->LowerWidget(widget); @@ -340,7 +371,6 @@ /** * Mark entire window as dirty (in need of re-paint) - * @param w Window to redraw * @ingroup dirty */ void Window::SetDirty() const @@ -792,6 +822,10 @@ this->SetDirty(); } +/** + * Resize window towards the default size given in the window description. + * @param desc the description to get the default size from. + */ void Window::FindWindowPlacementAndResize(const WindowDesc *desc) { this->FindWindowPlacementAndResize(desc->default_width, desc->default_height); diff -r c55922dabb25 -r 5076964d81a1 src/window_gui.h --- a/src/window_gui.h Tue Oct 14 18:49:21 2008 +0000 +++ b/src/window_gui.h Tue Oct 14 19:27:08 2008 +0000 @@ -82,7 +82,10 @@ byte type; ///< Widget type, see WindowWidgetTypes byte display_flags; ///< Resize direction, alignment, etc. during resizing. @see ResizeFlags byte color; ///< Widget colour, see docs/ottd-colourtext-palette.png - int16 left, right, top, bottom; ///< The position offsets inside the window + int16 left; ///< The left edge of the widget + int16 right; ///< The right edge of the widget + int16 top; ///< The top edge of the widget + int16 bottom; ///< The bottom edge of the widget uint16 data; ///< The String/Image or special code (list-matrixes) of a widget StringID tooltips; ///< Tooltips that are shown when rightclicking on a widget }; @@ -183,9 +186,10 @@ * Data structure for an opened window */ struct Window : ZeroedMemoryAllocator { + /** State whether an event is handled or not */ enum EventState { - ES_HANDLED, - ES_NOT_HANDLED, + ES_HANDLED, ///< The passed event is handled + ES_NOT_HANDLED, ///< The passed event is not handled }; protected: @@ -483,6 +487,7 @@ WWT_PUSHIMGBTN = WWT_IMGBTN | WWB_PUSHBUTTON, }; +/** Marker for the "end of widgets" in a Window(Desc) widget table. */ #define WIDGETS_END WWT_LAST, RESIZE_NONE, 0, 0, 0, 0, 0, 0, STR_NULL /** @@ -512,9 +517,8 @@ /** * Open a new window. - * @param *desc The pointer to the WindowDesc to be created + * @param desc The pointer to the WindowDesc to be created * @param window_number the window number of the new window - * @param data arbitrary data that is send with the WE_CREATE message * @return see Window pointer of the newly created window */ template @@ -535,6 +539,8 @@ /* window.cpp */ extern Window *_z_windows[]; extern Window **_last_z_window; + +/** Iterate over all windows */ #define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++) /** @@ -587,8 +593,8 @@ * Sets the enabled/disabled status of a widget. * By default, widgets are enabled. * On certain conditions, they have to be disabled. - * @param widget_index : index of this widget in the window - * @param disab_stat : status to use ie: disabled = true, enabled = false + * @param widget_index index of this widget in the window + * @param disab_stat status to use ie: disabled = true, enabled = false */ inline void Window::SetWidgetDisabledState(byte widget_index, bool disab_stat) { @@ -598,7 +604,7 @@ /** * Sets a widget to disabled. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::DisableWidget(byte widget_index) { @@ -607,7 +613,7 @@ /** * Sets a widget to Enabled. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::EnableWidget(byte widget_index) { @@ -616,7 +622,7 @@ /** * Gets the enabled/disabled status of a widget. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window * @return status of the widget ie: disabled = true, enabled = false */ inline bool Window::IsWidgetDisabled(byte widget_index) const @@ -640,7 +646,7 @@ /** * Sets a widget hidden. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::HideWidget(byte widget_index) { @@ -649,7 +655,7 @@ /** * Sets a widget visible. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::ShowWidget(byte widget_index) { @@ -658,7 +664,7 @@ /** * Gets the visibility of a widget. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window * @return status of the widget ie: hidden = true, visible = false */ inline bool Window::IsWidgetHidden(byte widget_index) const @@ -669,8 +675,8 @@ /** * Sets the lowered/raised status of a widget. - * @param widget_index : index of this widget in the window - * @param lowered_stat : status to use ie: lowered = true, raised = false + * @param widget_index index of this widget in the window + * @param lowered_stat status to use ie: lowered = true, raised = false */ inline void Window::SetWidgetLoweredState(byte widget_index, bool lowered_stat) { @@ -680,7 +686,7 @@ /** * Invert the lowered/raised status of a widget. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::ToggleWidgetLoweredState(byte widget_index) { @@ -690,7 +696,7 @@ /** * Marks a widget as lowered. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::LowerWidget(byte widget_index) { @@ -699,7 +705,7 @@ /** * Marks a widget as raised. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window */ inline void Window::RaiseWidget(byte widget_index) { @@ -708,7 +714,7 @@ /** * Gets the lowered state of a widget. - * @param widget_index : index of this widget in the window + * @param widget_index index of this widget in the window * @return status of the widget ie: lowered = true, raised= false */ inline bool Window::IsWidgetLowered(byte widget_index) const diff -r c55922dabb25 -r 5076964d81a1 src/window_type.h --- a/src/window_type.h Tue Oct 14 18:49:21 2008 +0000 +++ b/src/window_type.h Tue Oct 14 19:27:08 2008 +0000 @@ -100,6 +100,8 @@ }; struct Window; + +/** Number to differentiate different windows of the same class */ typedef int32 WindowNumber; #endif /* WINDOW_TYPE_H */