Page MenuHomeWildfire Games

Move GUIbase structs to separate files
ClosedPublic

Authored by elexis on Oct 1 2019, 2:32 PM.

Details

Summary

The file GUIbase.h is a bit irritating, because

  • it contains a number of unrelated classes and functions, so it's not clear what it's designed purpose is, it's not clear when it should be included (other than requiring one of the types),
  • while all other GUI files contain one file per class
  • GUIbase.cpp only contains the implementation for CGUISize that is named CClientArea and relates to JSI_GUISize.
Test Plan

Notice that removing these last few error codes in GUIbase.h require separate refactoring and code behavior changes.
Notice that renaming CClientArea should be done in a separate commit, so that it is easier to track changes.
Notice that there is no modified implementation in this diff.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Oct 1 2019, 2:32 PM
Vulcan added a comment.Oct 1 2019, 2:35 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/367/display/redirect

elexis added a comment.Oct 1 2019, 2:42 PM

Few words on IRC:

2019-09/2019-09-23-QuakeNet-#0ad-dev.log:11:19 < elexis> then we can also move GUIbase.h types there probably
2019-09/2019-09-23-QuakeNet-#0ad-dev.log:11:23 < Vladislav> I'd like to rename GUIbase
2019-09/2019-09-23-QuakeNet-#0ad-dev.log:11:24 < elexis> GUIbase -> split

The rename will be done after this commit, since there are also 54 class renames in the code then.

source/gui/CGUI.h
30 ↗(On Diff #10030)

Could forward declare SGUIStyle, but only if moving the Getter functions into the implementation file, which means the linker would have to be smart enough and it adds indirection (i.e. making it less likely to inline), and adds includes in several other files.

40 ↗(On Diff #10030)

This is to be removed.

Vulcan added a comment.Oct 1 2019, 2:43 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/IGUIObject.h
|  53| class·IGUIObject
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classIGUIObject{' is invalid C code. Use --std or --language to configure the language.

source/gui/GUIbase.h
|  32| class·CClientArea
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCClientArea{' is invalid C code. Use --std or --language to configure the language.

source/gui/IGUIScrollBar.h
| 150| class·IGUIScrollBar
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classIGUIScrollBar{' is invalid C code. Use --std or --language to configure the language.

source/gui/CGUIText.h
|  53| class·CGUIText
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIText{' is invalid C code. Use --std or --language to configure the language.

source/gui/CGUI.h
|  55| class·CGUI
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUI{' is invalid C code. Use --std or --language to configure the language.

source/gui/SGUIStyle.h
|  35| »   std::map<CStr,·CStrW>·m_SettingsDefaults;
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'std::map' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/883/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Oct 1 2019, 2:47 PM
This revision was automatically updated to reflect the committed changes.