Page MenuHomeWildfire Games

Unfriend IGUIObject from CGUI
ClosedPublic

Authored by elexis on Aug 10 2019, 2:24 PM.

Details

Summary

This removes the ability of every IGUIObject to read, modify and possibly break CGUIs private members. (This furthers the protection of the private CGUI struct maps that were made const in rP22637)

This is achieved by making CGUI GetFocusedObject, UpdateObjects public,
by introducing public CGUI GetBaseObject, GetMousePos, GetMouseButtons, HasStyle, GetStyle getters,
and by removing the pointless IGUIObject GetMousePos proxy instead of calling it more often and changing it to const reference over copying.

Delete GetGUI() checks that are either always or never true following rP22587

Test Plan

Notice that CGUI* can even become CGUI&, and that those removed ifs will be correct for that diff then as well.
See also discussion with wraitii on http://irclogs.wildfiregames.com/2019-08/2019-08-09-QuakeNet-%230ad-dev.log

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8800
Build 14430: Vulcan BuildJenkins
Build 14429: arc lint + arc unit

Event Timeline

elexis created this revision.Aug 10 2019, 2:24 PM

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

Linter detected issues:
Executing section Source...

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

source/gui/CGUI.h
|  27| #include·"GUIbase.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classGUITooltip{' 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/350/display/redirect

elexis edited the test plan for this revision. (Show Details)Aug 10 2019, 2:47 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 10 2019, 2:51 PM
This revision was automatically updated to reflect the committed changes.
elexis edited the summary of this revision. (Show Details)Aug 10 2019, 2:54 PM