ControlBarPrintPositions.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: ControlBarPrintPositions.cpp /////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Electronic Arts Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2002 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // created: Sep 2002
  34. //
  35. // Filename: ControlBarPrintPositions.cpp
  36. //
  37. // author: Chris Huybregts
  38. //
  39. // purpose: Convience function for degayifying the whole squished control bar
  40. // process
  41. //
  42. //-----------------------------------------------------------------------------
  43. ///////////////////////////////////////////////////////////////////////////////
  44. //-----------------------------------------------------------------------------
  45. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  46. //-----------------------------------------------------------------------------
  47. #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
  48. #include <stdio.h>
  49. //-----------------------------------------------------------------------------
  50. // USER INCLUDES //////////////////////////////////////////////////////////////
  51. //-----------------------------------------------------------------------------
  52. #include "GameClient/GameWindowManager.h"
  53. #include "GameClient/WindowLayout.h"
  54. //-----------------------------------------------------------------------------
  55. // DEFINES ////////////////////////////////////////////////////////////////////
  56. //-----------------------------------------------------------------------------
  57. //-----------------------------------------------------------------------------
  58. // PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
  59. //-----------------------------------------------------------------------------
  60. void PrintInfoRecursive( GameWindow *win, FILE *fp)
  61. {
  62. if(!win)
  63. return;
  64. ICoord2D pos, size;
  65. win->winGetSize(&size.x, &size.y);
  66. win->winGetPosition(&pos.x, &pos.y);
  67. fprintf(fp, "ControlBarResizer %s\n",win->winGetInstanceData()->m_decoratedNameString.str());
  68. fprintf(fp, " AltPosition = X:%d Y:%d\n",pos.x, pos.y);
  69. fprintf(fp, " AltSize = X:%d Y:%d\n",size.x, size.y);
  70. fprintf(fp, "END\n\n");
  71. PrintInfoRecursive(win->winGetChild(),fp);
  72. PrintInfoRecursive(win->winGetNext(),fp);
  73. }
  74. void PrintOffsetsFromControlBarParent( void )
  75. {
  76. GameWindow *controlBarParent = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ControlBarParent" ));
  77. if(!controlBarParent)
  78. return;
  79. WindowLayout *layout = TheWindowManager->winCreateLayout("controlBarHidden.wnd");
  80. if(!layout)
  81. return;
  82. FILE *fp = fopen("ControlBarEasier.txt", "w");
  83. if(!fp)
  84. return;
  85. PrintInfoRecursive(layout->getFirstWindow(), fp);
  86. fclose(fp);
  87. layout->destroyWindows();
  88. layout->deleteInstance();
  89. }
  90. //-----------------------------------------------------------------------------
  91. // PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
  92. //-----------------------------------------------------------------------------