Page MenuHome

Cleanup: GHOST_ISystem::toggleConsole API
ClosedPublic

Authored by Shrey Aggarwal (shrey_agg) on Feb 5 2022, 9:20 AM.

Details

Summary

Task T95505
Add a GHOST_TConsoleWindowState enum to GHOST_Types.h encapsulating all 4 options.
Update GHOST_ISystem.h with the new function signature (int setConsoleWindowState(GHOST_TConsoleWindowState action);
Update GHOST_SystemWin32.cpp and GHOST_SystemWin32.h with the new function signature.
Update GHOST_SystemWayland.cpp and GHOST_SystemWayland.h with the new function signature.
Update GHOST_SystemX11.h with the new function signature.
Update GHOST_SystemSDL.h with the new function signature.
Update GHOST_SystemNULL.h with the new function signature.
Update GHOST_SystemCocoa.h with the new function signature.
Update GHOST_C-api.cpp and GHOST_C-api.h with the new function signature.
Update wm_init_exit.c to call the new function.
Update wm_operators.c to call the new function.
Given the enum is now used everywhere, cleanup (remove) any comments that still refer to the 4 magic integer values.

Diff Detail

Repository
rB Blender
Branch
Ghost (branched from master)
Build Status
Buildable 20356
Build 20356: arc lint + arc unit

Event Timeline

Shrey Aggarwal (shrey_agg) requested review of this revision.Feb 5 2022, 9:20 AM
Shrey Aggarwal (shrey_agg) created this revision.
Shrey Aggarwal (shrey_agg) retitled this revision from Cleanup: GHOST_ISystem::toggleConsole API Task T95505 - Add a GHOST_TConsoleWindowState enum to GHOST_Types.h encapsulating all 4 options. Update GHOST_ISystem.h with the new function signature (int setConsoleWindowState... to Cleanup: GHOST_ISystem::toggleConsole API .Feb 5 2022, 9:23 AM
Shrey Aggarwal (shrey_agg) edited the summary of this revision. (Show Details)
Ray Molenkamp (LazyDodo) requested changes to this revision.Feb 7 2022, 4:51 PM
Ray Molenkamp (LazyDodo) added inline comments.
intern/ghost/GHOST_Types.h
147

* - 3: Hides if it runs not from command line

GHOST_kConsoleWindowStateShowCLI is probably not the best name here, GHOST_kConsoleWindowStateHideForNonConsoleLaunch is a little long but covers what is happening nicely.

intern/ghost/intern/GHOST_SystemWin32.cpp
108

Best not to include things from other patches.

2236

Given the enum names are descriptive enough, this comment can be removed, same for the others in this function.

intern/ghost/intern/GHOST_SystemX11.h
272

that semicolon at the end breaks the linux build

This revision now requires changes to proceed.Feb 7 2022, 4:51 PM
Ankit Meel (ankitm) added inline comments.
intern/ghost/GHOST_C-api.h
894

Given the enum is now used everywhere, cleanup (remove) any comments that still refer to the 4 magic integer values.

pending here and 2 places below in "(1 -visible, 0 - hidden)"

also is int return type instead of the enum intended ?

intern/ghost/GHOST_C-api.h
894

it would have to be a new enum, as GHOST_TConsoleWindowState doesn't really cover it, for now an int will be fine.

Shrey Aggarwal (shrey_agg) marked 3 inline comments as done.
Shrey Aggarwal (shrey_agg) retitled this revision from Cleanup: GHOST_ISystem::toggleConsole API to Cleanup: GHOST_ISystem::toggleConsole API.
  • updated revision
intern/ghost/intern/GHOST_SystemWayland.cpp
1476

sorry, missed this on an earlier pass, stray semicolon.

intern/ghost/intern/GHOST_SystemWayland.cpp
1477

also given you uncommented the action variable, this will give out an unused variable Waring.

intern/ghost/intern/GHOST_SystemX11.h
273

given you uncommented the action variable, this will give out an unused variable Waring.

Shrey Aggarwal (shrey_agg) marked 3 inline comments as done.
  • removed semicolon and comented "action" variable
This revision was not accepted when it landed; it landed in state Needs Review.Feb 9 2022, 1:41 AM
This revision was automatically updated to reflect the committed changes.