Initial commit of Command & Conquer Generals and Command & Conquer Generals Zero Hour source code.

This commit is contained in:
LFeenanEA 2025-02-27 17:34:39 +00:00
parent 2e338c00cb
commit 3d0ee53a05
No known key found for this signature in database
GPG key ID: C6EBE8C2EA08F7E0
6072 changed files with 2283311 additions and 0 deletions

View file

@ -0,0 +1,74 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: DialogProc.h /////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: GUIEdit
//
// File name: DialogProc.h
//
// Created: Colin Day, July 2001
//
// Desc: Header for dialog procedures so we can easily have them
// all in one place.
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __DIALOGPROC_H_
#define __DIALOGPROC_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
#include <windows.h>
// USER INCLUDES //////////////////////////////////////////////////////////////
// FORWARD REFERENCES /////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
// INLINING ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
extern LRESULT CALLBACK NewLayoutDialogProc( HWND hWndDialog, UINT message,
WPARAM wParam, LPARAM lParam );
extern BOOL CALLBACK GridSettingsDialogProc( HWND hWndDialog, UINT message,
WPARAM wParam, LPARAM lParam );
extern BOOL CALLBACK CallbackEditorDialogProc( HWND hWndDialog, UINT message,
WPARAM wParam, LPARAM lParam );
#endif // __DIALOGPROC_H_

View file

@ -0,0 +1,208 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: EditWindow.h /////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: RTS3
//
// File name: EditWindow.h
//
// Created: Colin Day, July 2001
//
// Desc: Main edit window for the GUI editing tool
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __EDITWINDOW_H_
#define __EDITWINDOW_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <windows.h>
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "GUIEditColor.h"
#include "Lib/BaseType.h"
#include "GameClient/Image.h"
#include "GameClient/GameWindow.h"
#include "WW3D2/AssetMgr.h"
#include "WW3D2/Render2D.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// EditWindow -----------------------------------------------------------------
/** The edit window singleton definition, this is where we create and
* interact with GUI controls for this tool */
//-----------------------------------------------------------------------------
class EditWindow
{
public:
EditWindow( void );
~EditWindow( void );
/// initialize the edit window singleton
void init( UnsignedInt clientWidth, UnsignedInt clientHeight );
void shutdown( void ); ///< free all data
void draw( void ); ///< draw the edit window
void updatePulse( void ); ///< pulse message from timer
HWND getWindowHandle( void ); ///< get window handle
void setSize( ICoord2D *size ); ///< set width and height for edit window
void getSize( ICoord2D *size ); ///< get width and height for edit window
RGBColorReal getBackgroundColor( void ); ///< return the background color
void setBackgroundColor( RGBColorReal color ); ///< set background color
void setDragMoveOrigin( ICoord2D *pos ); ///< for drag moving
void setDragMoveDest( ICoord2D *pos ); ///< for drag moving
ICoord2D getDragMoveOrigin( void ); ///< for keybord moving
ICoord2D getDragMoveDest( void ); ///< for keyboard moving
void notifyWindowDeleted( GameWindow *window ); ///< window has been deleted
/// mouse event has occurred, button up/down, move etc.
void mouseEvent( UnsignedInt windowsMessage, WPARAM wParam, LPARAM lParam );
void getPopupMenuClickPos( ICoord2D *pos ); ///< get popup menu click loc
void openPopupMenu( Int x, Int y ); ///< open floating popup right click menu
// **************************************************************************
/// draw a line on the display in screen coordinates
void drawLine( Int startX, Int startY, Int endX, Int endY,
Real lineWidth, UnsignedInt lineColor );
/// draw a rect border on the display in pixel coordinates with the specified color
void drawOpenRect( Int startX, Int startY, Int width, Int height,
Real lineWidth, UnsignedInt lineColor );
/// draw a filled rect on the display in pixel coords with the specified color
void drawFillRect( Int startX, Int startY, Int width, Int height,
UnsignedInt color );
/// draw an image fit within the screen coordinates
void drawImage( const Image *image, Int startX, Int startY,
Int endX, Int endY, Color color = 0xFFFFFFFF );
/// image clipping support
void setClipRegion( IRegion2D *region ) {m_clipRegion = *region; m_isClippedEnabled = TRUE;}
Bool isClippingEnabled( void ) { return m_isClippedEnabled; }
void enableClipping( Bool onoff ) { m_isClippedEnabled = onoff; }
protected:
void registerEditWindowClass( void ); ///< register class with OS
/// callback from windows, NOTE that it's static and has no this pointer
static LRESULT CALLBACK editProc( HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam );
void drawGrid( void ); ///< draw the grid
void drawSeeThruOutlines( GameWindow *windowList, Color c );
void drawHiddenOutlines( GameWindow *windowList, Color c );
void drawUIFeedback( void ); ///< draw UI visual feedback
/// if mouse is close to selected window allow resize
void handleResizeAvailable( Int mouseX, Int mouseY );
//
// these methods check to see if the mouse is close enough to the
// given geometry region (usually for resizing controls)
//
Bool inCornerTolerance( ICoord2D *dest, ICoord2D *source, Int tolerance );
Bool inLineTolerance( ICoord2D *dest, ICoord2D *lineStart, ICoord2D *lineEnd,
Int tolerance );
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static Bool m_classRegistered; ///< TRUE when we've register with OS
static char *m_className; ///< name for windows class
ICoord2D m_size; ///< width and height of edit window
UnsignedByte m_bitDepth; ///< bit depth for edit window
HWND m_editWindowHWnd; ///< edit window handle
Int m_pulse; ///< for visual feedback that looks cool!
RGBColorReal m_backgroundColor; ///< the background color
Bool m_w3dInitialized; ///< TRUE once W3D is up
WW3DAssetManager *m_assetManager; ///< asset manager for WW3D
Render2DClass *m_2DRender; ///< our 2D renderer
ICoord2D m_popupMenuClickPos; ///< position where popup menu was created at
GameWindow *m_pickedWindow; ///< picked window from mouse click editing
ICoord2D m_dragMoveOrigin; ///< mouse click position to start drag move
ICoord2D m_dragMoveDest; ///< destination for drag move
Bool m_dragSelecting; ///< TRUE when drawing a selection box
IRegion2D m_selectRegion; ///< region for selection box
Bool m_resizingWindow; ///< TRUE when drag resizing a window
GameWindow *m_windowToResize; ///< the window to resize
ICoord2D m_resizeOrigin; ///< mouse clicked down here to drag resize
ICoord2D m_resizeDest; ///< mouse pos when dragging around to resize
IRegion2D m_clipRegion; ///< the clipping region for images
Bool m_isClippedEnabled; ///<used by 2D drawing operations to define clip re
}; // end EditWindow
///////////////////////////////////////////////////////////////////////////////
// INLINING ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
inline HWND EditWindow::getWindowHandle( void ) { return m_editWindowHWnd; }
inline void EditWindow::getSize( ICoord2D *size ) { *size = m_size; }
inline void EditWindow::getPopupMenuClickPos( ICoord2D *pos ) { *pos = m_popupMenuClickPos; }
inline void EditWindow::setDragMoveDest( ICoord2D *pos ) { if( pos ) m_dragMoveDest = *pos; }
inline void EditWindow::setDragMoveOrigin( ICoord2D *pos ) { if( pos ) m_dragMoveOrigin = *pos; }
inline ICoord2D EditWindow::getDragMoveDest( void ) { return m_dragMoveDest; }
inline ICoord2D EditWindow::getDragMoveOrigin( void ) { return m_dragMoveOrigin; }
///////////////////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
extern EditWindow *TheEditWindow; ///< edit window singleton extern
#endif // __EDITWINDOW_H_

View file

@ -0,0 +1,383 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: GUIEdit.h ////////////////////////////////////////////////////////////////////////////////
// Created: Colin Day, July 2001
// Desc: GUI Edit and window layout entry point
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __GUIEDIT_H_
#define __GUIEDIT_H_
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
#include <windows.h>
#include <stdio.h>
#include "GameClient/GameWindow.h"
#include "GameClient/WindowLayout.h"
#include "GameClient/GameWindowManager.h"
#include "GUIEditColor.h"
#include "Common/AsciiString.h"
// TYPE DEFINES ///////////////////////////////////////////////////////////////////////////////////
#define GUIEDIT_CONFIG_FILENAME "GUIEdit.cfg"
#define GUIEDIT_FONT_FILENAME "GUIEFont.txt"
#define GUIEDIT_NONE_STRING "[None]"
#define STATUS_BAR_ID 1
#define TOOLBAR_ID 2
//-------------------------------------------------------------------------------------------------
/** Edit mode states for editor */
//-------------------------------------------------------------------------------------------------
typedef enum
{
MODE_UNDEFINED = 0, ///< undefined mode
MODE_EDIT, ///< normal edit mode
MODE_TEST_RUN, ///< test input like ingame
MODE_DRAG_MOVE, ///< moving windows with the mouse
MODE_RESIZE_TOP_LEFT, ///< resize dragging top left corner
MODE_RESIZE_TOP_RIGHT, ///< resize dragging top right cornder
MODE_RESIZE_BOTTOM_RIGHT, ///< resize dragging bottom right corner
MODE_RESIZE_BOTTOM_LEFT, ///< resize dragging bottom left corner
MODE_RESIZE_TOP, ///< resize dragging top horizontal
MODE_RESIZE_RIGHT, ///< resize dragging right vertical
MODE_RESIZE_BOTTOM, ///< resize dragging bottom horizontal
MODE_RESIZE_LEFT, ///< resize dragging left vertical
MODE_KEYBOARD_MOVE, ///< moving windows with the Keyboard
MODE_NUM_MODES ///< keep this last!
} EditMode;
//-------------------------------------------------------------------------------------------------
/** The status bar is this many pieces and we can access them this way */
//-------------------------------------------------------------------------------------------------
typedef enum
{
STATUS_MODE = 0,
STATUS_PART2, /// change to meaningful name when decided what goes here
STATUS_PART3, /// change to meaningful name when decided what goes here
STATUS_PART4, /// change to meaningful name when decided what goes here
STATUS_MOUSE_COORDS,
STATUS_NUM_PARTS ///< keep this last!
} StatusPart;
//-------------------------------------------------------------------------------------------------
/** Types of pointing cursors */
//-------------------------------------------------------------------------------------------------
typedef enum
{
CURSOR_NORMAL,
CURSOR_MOVE,
CURSOR_SIZE_NESW,
CURSOR_SIZE_NS,
CURSOR_SIZE_NWSE,
CURSOR_SIZE_WE,
CURSOR_WAIT,
CURSOR_NUM_CURSORS // keep last
} CursorType;
//-------------------------------------------------------------------------------------------------
/** These entrys make up the selection list of windows */
//-------------------------------------------------------------------------------------------------
struct WindowSelectionEntry
{
GameWindow *window; ///< the window
WindowSelectionEntry *next;
WindowSelectionEntry *prev;
};
//-------------------------------------------------------------------------------------------------
/** Framework for GUI editor data */
//-------------------------------------------------------------------------------------------------
class GUIEdit
{
public:
GUIEdit( void );
~GUIEdit( void );
void init( void ); ///< initialize data
void shutdown( void ); ///< shutdown all our data
void update( void ); ///< process the universe
Bool readConfigFile( char *filename ); ///< read the configuration file
Bool writeConfigFile( char *filename ); ///< write the configuration file
void readFontFile( char *filename ); ///< read file with available font definitions
void writeFontFile( char *filename ); ///< write all loaded fonts to a file
char *getSaveFilename( void );
char *getSavePathAndFilename( void );
void setSaveFile( char *fullPathAndFilename ); ///< set filename to use for saving
HWND getWindowHandle( void ); ///< get window handle
HINSTANCE getInstance( void ); ///< get application instance
HWND getStatusBarWindowHandle( void ); ///< get status bar HWND
void createStatusBar( void ); ///< create status bar
void statusMessage( StatusPart part, char *message ); ///< set status bar textl
void createToolbar( void ); ///< create the toolbar
void setCursor( CursorType type ); ///< set cursor
void setPropertyTarget( GameWindow *window ); ///< set window for property editing
GameWindow *getPropertyTarget( void ); ///< get window editing properties
void loadGUIEditFontLibrary( FontLibrary *library ); ///< fonts available in the editor
Bool isNameDuplicate( GameWindow *root, GameWindow *ignore, AsciiString name );
EditMode getMode( void ); ///< return the current mode
void setMode( EditMode mode ); ///< set the new mode
void setUnsaved( Bool unsaved ); ///< set unsaved flag to FALSE or TRUE
Bool newLayout( void ); ///< reset editor for new layout
// grid settings
void setGridResolution( Int res );
Int getGridResolution( void );
void setGridVisible( Bool visible );
Bool isGridVisible( void );
void setGridSnap( Bool on );
Bool isGridSnapOn( void );
void setGridColor( RGBColorInt *color );
RGBColorInt *getGridColor( void );
void gridSnapLocation( ICoord2D *source, ICoord2D *snapped );
// display options for hidden/see thru windows
void setShowHiddenOutlines( Bool show );
Bool getShowHiddenOutlines( void );
void setShowSeeThruOutlines( Bool show );
Bool getShowSeeThruOutlines( void );
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// manipulating windows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bool windowIsGadget( GameWindow *window ); ///< is the window a gadget
// selection help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WindowSelectionEntry *getSelectList( void ); ///< get the selected list head
GameWindow *getFirstSelected( void ); ///< get first selected window
void moveWindowTo( GameWindow *window, Int x, Int y ); ///< move window
Bool isWindowSelected( GameWindow *window ); ///< is window selected
void selectWindow( GameWindow *window ); ///< add to selection list
void unSelectWindow( GameWindow *window ); ///< remove from selection list
void clearSelections( void ); ///< clear selection list
Int selectionCount( void ); ///< return # of selected windows
void deleteSelected( void ); ///< delete selected windows
void bringSelectedToTop( void ); ///< bring selected windows to top
/// select the windows that are FULLY in the region specified
void selectWindowsInRegion( IRegion2D *region );
// resizing/moving help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void dragMoveSelectedWindows( ICoord2D *dragOrigin, ICoord2D *dragDest ); ///< move windows via drag move
/// given a position to move a window to, keep it onscreen and inside parent
void computeSafeLocation( GameWindow *window, Int x, Int y,
Int *safeX, Int *safeY );
/// given position and size to move a window to, keep it inside parent and on screen
void computeSafeSizeLocation( GameWindow *window,
Int newX, Int newY,
Int newWidth, Int newHeight,
Int *safeX, Int *safeY,
Int *safeWidth, Int *safeHeight );
/// compute new size of window using drag-resize logic
void computeResizeLocation( EditMode resizeMode,
GameWindow *window,
ICoord2D *resizeOrigin,
ICoord2D *resizeDest,
ICoord2D *resultLoc,
ICoord2D *resultSize );
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// creating new windows and controls ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/** this is called after a window is added to the editor, the window may
contain children so this might be recursively called from inside */
void notifyNewWindow( GameWindow *window );
GameWindow *getWindowAtPos( Int x, Int y ); ///< get topmost window at pos
void deleteAllWindows( void ); ///< delete all windows in the editor
void removeWindowCleanup( GameWindow *window ); ///< to cleanup before delete
void deleteWindow( GameWindow *window ); ///< delete a game window
/** when creating child windows we don't want them to exist outside the
parent so we use this to clip them to the the parent size and locations */
void clipCreationParamsToParent( GameWindow *parent,
Int *x, Int *y, Int *width, Int *height );
GameWindow *newWindow( UnsignedInt windowStyle,
GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newUserWindow( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newPushButton( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newCheckBox( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newRadioButton( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newTabControl( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newHorizontalSlider( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newVerticalSlider( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newProgressBar( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newListbox( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newTextEntry( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newStaticText( GameWindow *parent,
Int x, Int y,
Int width, Int height );
GameWindow *newComboBox( GameWindow *parent,
Int x, Int y,
Int width, Int height );
// menu options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bool menuNew( void ); ///< start a new layout process
Bool menuOpen( void ); ///< hit open on menu
void stripNameDecorations( GameWindow *root ); ///< after a load
void revertDefaultCallbacks( GameWindow *root ); ///< after a load
Bool menuSave( void ); ///< hit save on menu
Bool menuSaveAs( void ); ///< hit save as on menu
Bool menuExit( void ); ///< exit application
Bool menuCopy( void ); ///< copy selected windows into copy buffer
Bool menuPaste( void ); ///< paste contents of copy buffer
Bool menuCut( void ); ///< cut selected windows into copy buffer
void checkMenuItem( Int item );
void unCheckMenuItem( Int item );
// global layout functions callbacks ------------------------------------------------------------
void setLayoutInit( AsciiString init ); ///< set layout init function name
void setLayoutUpdate( AsciiString update ); ///< set layout update function name
void setLayoutShutdown( AsciiString shutdown ); ///< set layout shutdown function name
AsciiString getLayoutInit( void ); ///< get layout init function name
AsciiString getLayoutUpdate( void ); ///< get layout update function name
AsciiString getLayoutShutdown( void ); ///< get layout shutdown function name
protected:
char *saveAsDialog( void ); ///< save as standard browser
char *openDialog( void ); ///< open standard browser
void validateNames( GameWindow *root, char *filename, Bool *valid );
void updateRadioScreenIdentifiers( GameWindow *window, Int screenID );
Bool saveData( char *filePathAndFilename, char *filename ); ///< save data to file in filePath
Bool validateParentForCreate( GameWindow *parent ); ///< validate parent OK
/// normalize a region so that lo and hi are really lo and hi
void normalizeRegion( IRegion2D *region );
/// find selection entry associated with this window
WindowSelectionEntry *findSelectionEntry( GameWindow *window );
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HINSTANCE m_appInst; ///< main application hInstance
HWND m_appHWnd; ///< main application hWnd
HWND m_statusBarHWnd; ///< status bar window handle
HWND m_toolbarHWnd; ///< toolbar window handle
EditMode m_mode; ///< the current editor "mode"
Bool m_unsaved; ///< TRUE when contents are unsaved
char m_savePathAndFilename[ _MAX_PATH ]; ///< full path and filename to file
char m_saveFilename[ _MAX_PATH ]; ///< filename only with extension
WindowSelectionEntry *m_selectList; ///< list of "selected" windows
GameWindow *m_propertyTarget; ///< the window to edit properties on
Bool m_gridVisible; ///< TRUE when grid is visible
Int m_gridResolution; ///< pixels between the grid marks
Bool m_snapToGrid; ///< TRUE when it's on
RGBColorInt m_gridColor; ///< the grid draw color
Bool m_showHiddenOutlines; ///< show outlines around hidden windows
Bool m_showSeeThruOutlines; ///< show outliens around see-thru windows
AsciiString m_layoutInitString; ///< layout initi function name
AsciiString m_layoutUpdateString; ///< layout update function name
AsciiString m_layoutShutdownString;///< layout shutdown function name
}; // end GUIEdit
// INLINING ///////////////////////////////////////////////////////////////////////////////////////
inline HWND GUIEdit::getWindowHandle( void ) { return m_appHWnd; }
inline HINSTANCE GUIEdit::getInstance( void ) { return m_appInst; }
inline HWND GUIEdit::getStatusBarWindowHandle( void ) { return m_statusBarHWnd; }
inline EditMode GUIEdit::getMode( void ) { return m_mode; }
inline void GUIEdit::setPropertyTarget( GameWindow *window ) { m_propertyTarget = window; }
inline GameWindow *GUIEdit::getPropertyTarget( void ) { return m_propertyTarget; }
inline char *GUIEdit::getSaveFilename( void ) { return m_saveFilename; }
inline char *GUIEdit::getSavePathAndFilename( void ) { return m_savePathAndFilename; }
inline void GUIEdit::setGridResolution( Int res ) { m_gridResolution = res; }
inline Int GUIEdit::getGridResolution( void ) { return m_gridResolution; }
inline void GUIEdit::setGridVisible( Bool visible ) { m_gridVisible = visible; }
inline Bool GUIEdit::isGridVisible( void ) { return m_gridVisible; }
inline void GUIEdit::setGridSnap( Bool on ) { m_snapToGrid = on; }
inline Bool GUIEdit::isGridSnapOn( void ) { return m_snapToGrid; }
inline void GUIEdit::setGridColor( RGBColorInt *color ) { m_gridColor = *color; }
inline RGBColorInt *GUIEdit::getGridColor( void ) { return &m_gridColor; }
inline Bool GUIEdit::getShowHiddenOutlines( void ) { return m_showHiddenOutlines; }
inline Bool GUIEdit::getShowSeeThruOutlines( void ) { return m_showSeeThruOutlines; }
inline void GUIEdit::setLayoutInit( AsciiString init ) { m_layoutInitString = init; }
inline void GUIEdit::setLayoutUpdate( AsciiString update ) { m_layoutUpdateString = update; }
inline void GUIEdit::setLayoutShutdown( AsciiString shutdown ) { m_layoutShutdownString = shutdown; }
inline AsciiString GUIEdit::getLayoutInit( void ) { return m_layoutInitString; }
inline AsciiString GUIEdit::getLayoutUpdate( void ) { return m_layoutUpdateString; }
inline AsciiString GUIEdit::getLayoutShutdown( void ) { return m_layoutShutdownString; }
// EXTERNALS //////////////////////////////////////////////////////////////////////////////////////
extern GUIEdit *TheEditor; ///< editor application singleton
#endif // __GUIEDIT_H_

View file

@ -0,0 +1,101 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: GUIEditColor.h ///////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: GUIEdit
//
// File name: GUIEditColor.h
//
// Created: Colin Day, July 2001
//
// Desc: Color structures for the editor
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __GUIEDITCOLOR_H_
#define __GUIEDITCOLOR_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
// USER INCLUDES //////////////////////////////////////////////////////////////
// FORWARD REFERENCES /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// RGBColorInt ----------------------------------------------------------------
/** Integer color representation */
//-----------------------------------------------------------------------------
struct RGBColorInt
{
Int red;
Int green;
Int blue;
Int alpha;
}; // end RGBColorInt
// RGBColorReal ---------------------------------------------------------------
/** Colors using 0.0 to 1.0 reals */
//-----------------------------------------------------------------------------
struct RGBColorReal
{
Real red;
Real green;
Real blue;
Real alpha;
}; // end RGBColorReal
// HSVColorReal ---------------------------------------------------------------
/** Colors using hue, saturation, value using 0.0 to 1.0 reals */
//-----------------------------------------------------------------------------
struct HSVColorReal
{
Real hue;
Real saturation;
Real value;
Real alpha;
}; // end HSVReal
// INLINING ///////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
extern RGBColorInt *SelectColor( Int red, Int green, Int blue, Int alpha,
Int mouseX = 0, Int mouseY = 0 );
#endif // __GUIEDITCOLOR_H_

View file

@ -0,0 +1,140 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: GUIEditDisplay.h /////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: RTS3
//
// File name: GUIEditDisplay.h
//
// Created: Colin Day, July 2001
//
// Desc: Display implementation for the GUI edit tool
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __GUIEDITDISPLAY_H_
#define __GUIEDITDISPLAY_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "GameClient/Display.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
class VideoBuffer;
// TYPE DEFINES ///////////////////////////////////////////////////////////////
// GUIEditDisplay -------------------------------------------------------------
/** Stripped down display for the GUI tool editor */
//-----------------------------------------------------------------------------
class GUIEditDisplay : public Display
{
public:
GUIEditDisplay( void );
virtual ~GUIEditDisplay( void );
virtual void draw( void ) { };
/// draw a line on the display in pixel coordinates with the specified color
virtual void drawLine( Int startX, Int startY, Int endX, Int endY,
Real lineWidth, UnsignedInt lineColor );
virtual void drawLine( Int startX, Int startY, Int endX, Int endY,
Real lineWidth, UnsignedInt lineColor1, UnsignedInt lineColor2 ) { }
/// draw a rect border on the display in pixel coordinates with the specified color
virtual void drawOpenRect( Int startX, Int startY, Int width, Int height,
Real lineWidth, UnsignedInt lineColor );
/// draw a filled rect on the display in pixel coords with the specified color
virtual void drawFillRect( Int startX, Int startY, Int width, Int height,
UnsignedInt color );
/// Draw a percentage of a rectange, much like a clock
virtual void drawRectClock(Int startX, Int startY, Int width, Int height, Int percent, UnsignedInt color) { }
virtual void drawRemainingRectClock(Int startX, Int startY, Int width, Int height, Int percent, UnsignedInt color) { }
/// draw an image fit within the screen coordinates
virtual void drawImage( const Image *image, Int startX, Int startY,
Int endX, Int endY, Color color = 0xFFFFFFFF, DrawImageMode mode=DRAW_IMAGE_ALPHA);
/// image clipping support
virtual void setClipRegion( IRegion2D *region );
virtual Bool isClippingEnabled( void );
virtual void enableClipping( Bool onoff );
// These are stub functions to allow compilation:
/// Create a video buffer that can be used for this display
virtual VideoBuffer* createVideoBuffer( void ) { return NULL; }
/// draw a video buffer fit within the screen coordinates
virtual void drawVideoBuffer( VideoBuffer *buffer, Int startX, Int startY,
Int endX, Int endY ) { }
virtual void takeScreenShot(void){ }
virtual void toggleMovieCapture(void) {}
// methods that we need to stub
virtual void setTimeOfDay( TimeOfDay tod ) {}
virtual void createLightPulse( const Coord3D *pos, const RGBColor *color, Real innerRadius, Real attenuationWidth,
UnsignedInt increaseFrameTime, UnsignedInt decayFrameTime ) {}
virtual void setShroudLevel(Int x, Int y, CellShroudStatus setting) {}
void setBorderShroudLevel(UnsignedByte level){}
virtual void clearShroud() {}
virtual void preloadModelAssets( AsciiString model ) {}
virtual void preloadTextureAssets( AsciiString texture ) {}
virtual void toggleLetterBox(void) {}
virtual void enableLetterBox(Bool enable) {}
#if defined(_DEBUG) || defined(_INTERNAL)
virtual void dumpModelAssets(const char *path) {}
#endif
virtual void doSmartAssetPurgeAndPreload(const char* usageFileName) {}
#if defined(_DEBUG) || defined(_INTERNAL)
virtual void dumpAssetUsage(const char* mapname) {}
#endif
virtual Real getAverageFPS(void) { return 0; }
virtual Int getLastFrameDrawCalls( void ) { return 0; }
protected:
}; // end GUIEditDisplay
// INLINING ///////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
#endif // __GUIEDITDISPLAY_H_

View file

@ -0,0 +1,119 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: GUIEditWindowManager.h ///////////////////////////////////////////////////////////////////
// Created: Colin Day, July 2001
// Desc: Window manager for the GUI edit tool, we want this up
// fast and to look like what we use in the game so we're going
// to use the WW3D window manager, and just override the
// drawing functions to draw lines and images to the
// display. We will also be adding our own functionality
// here for editing and interacting with the GUI windows.
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __GUIEDITWINDOWMANAGER_H_
#define __GUIEDITWINDOWMANAGER_H_
#include <stdlib.h>
#include "W3DDevice/GameClient/W3DGameWindowManager.h"
//-------------------------------------------------------------------------------------------------
/** GUI edit interface for window manager */
//-------------------------------------------------------------------------------------------------
class GUIEditWindowManager : public W3DGameWindowManager
{
public:
GUIEditWindowManager( void );
virtual ~GUIEditWindowManager( void );
virtual void init( void ); ///< initialize system
virtual Int winDestroy( GameWindow *window ); ///< destroy this window
/// create a new window by setting up parameters and callbacks
virtual GameWindow *winCreate( GameWindow *parent, UnsignedInt status,
Int x, Int y, Int width, Int height,
GameWinSystemFunc system,
WinInstanceData *instData = NULL );
// **************************************************************************
// GUIEdit specific methods *************************************************
// **************************************************************************
/** unlink the window to move and place it ahead of the target window
in the master chain or the child chain */
void moveAheadOf( GameWindow *windowToMove, GameWindow *aheadOf );
/// make target a child of the parent
void makeChildOf( GameWindow *target, GameWindow *parent );
void validateClipboardNames( GameWindow *root ); ///< ensure unique names
void incrementName( GameWindow *window ); ///< make a new unique name
void resetClipboard( void ); ///< reset the clipboard to empty
Bool isClipboardEmpty( void ); ///< is the clipboard empty
void duplicateSelected( GameWindow *root ); ///< dupe the selected windows into the clipboard
void copySelectedToClipboard( void ); ///< copy selected windows to clipboard
void cutSelectedToClipboard( void ); ///< cut selected windows to clipboard
void pasteClipboard( void ); ///< paste the contents of the clipboard
GameWindow *getClipboardList( void ); ///< get the clipboard list
GameWindow *getClipboardDupeList( void ); ///< get clipboard dupe list
protected:
/** validate window is part of the clipboard at the top level */
Bool isWindowInClipboard( GameWindow *window, GameWindow **list );
void linkToClipboard( GameWindow *window, GameWindow **list ); ///< add window to clipboard
void unlinkFromClipboard( GameWindow *window, GameWindow **list ); ///< remove window from clipboard
/** remove selected children from the select list that have a parent
also in the select list */
void removeSupervisedChildSelections( void );
/** selected windows that are children will cut loose their parents
and become adults (their parent will be NULL, otherwise the screen) */
// void orphanSelectedChildren( void );
/// dupe a window and its children
GameWindow *duplicateWindow( GameWindow *source, GameWindow *parent );
void createClipboardDuplicate( void ); ///< duplicate the clipboard on the dup list
GameWindow *m_clipboard; ///< list of windows in the clipboard
GameWindow *m_clipboardDup; ///< list duplicate of the clipboard used for pasting
Int m_copySpacing; ///< keeps multiple pastes from being on top of each other
Int m_numCopiesPasted; ///< keeps multiple pastes from being on top of each other
};
// INLINE /////////////////////////////////////////////////////////////////////////////////////////
inline GameWindow *GUIEditWindowManager::getClipboardList( void ) { return m_clipboard; }
inline GameWindow *GUIEditWindowManager::getClipboardDupeList( void ) { return m_clipboardDup; }
// EXTERN /////////////////////////////////////////////////////////////////////////////////////////
extern GUIEditWindowManager *TheGUIEditWindowManager; ///< editor use only
#endif // __GUIEDITWINDOWMANAGER_H_

View file

@ -0,0 +1,157 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: HierarchyView.h //////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: GUIEdit
//
// File name: HierarchyView.h
//
// Created: Colin Day, July 2001
//
// Desc: Manipulation the widows heirarchy through the tree
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __HIERARCHYVIEW_H_
#define __HIERARCHYVIEW_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
#include <windows.h>
#include <commctrl.h>
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Lib/BaseType.h"
#include "GameClient/GameWindow.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// HierarchyOption ------------------------------------------------------------
//-----------------------------------------------------------------------------
typedef enum
{
HIERARCHY_ADD_AT_TOP,
HIERARCHY_ADD_AT_BOTTOM,
} HierarchyOption;
// HierarchyView --------------------------------------------------------------
/** This view allows users to manipulate the windows hierarchy using
* a tree view control */
//-----------------------------------------------------------------------------
class HierarchyView
{
public:
HierarchyView( void );
~HierarchyView( void );
void init( void );
void reset( void );
void shutdown( void );
char *getWindowTreeName( GameWindow *window );
void addWindow( GameWindow *window, HierarchyOption option ); ///< add a window to the view
void removeWindow( GameWindow *window ); ///< remove window from tree
void bringWindowToTop( GameWindow *window ); ///< bring window to top of parent list
void updateWindowName( GameWindow *window ); ///< update tree entry based on name
void selectWindow( GameWindow *window ); ///< select window
HWND getTreeHandle( void ); ///< get the tree control handle
HWND getHierarchyHandle( void ); ///< get window handle for the whole dialog
void setDialogPos( ICoord2D *pos );
void getDialogPos( ICoord2D *pos );
void setDialogSize( ICoord2D *size );
void getDialogSize( ICoord2D *size );
void setDragWindow( GameWindow *window );
void setDragTarget( GameWindow *window );
GameWindow *getDragWindow( void );
GameWindow *getDragTarget( void );
void moveWindowAheadOf( GameWindow *window, GameWindow *aheadOf ); ///< move hierarchy representation
void moveWindowChildOf( GameWindow *window, GameWindow *parent ); ///< move hierarchy representation
Bool validateDragDropOperation( GameWindow *source, GameWindow *target );
void setPopupTarget( GameWindow *window ); ///< set target for popup menu
GameWindow *getPopupTarget( void ); ///< get the popup target window
HTREEITEM treePointToItem( Int x, Int y ); ///< translate mouse pos to item location
GameWindow *getWindowFromItem( HTREEITEM treeItem ); ///< get game window from user data in the tree item
protected:
static LRESULT CALLBACK dialogProc( HWND hWndDialog, UINT message,
WPARAM wParam, LPARAM lParam );
void addWindowToTree( GameWindow *window, HTREEITEM treeParent,
HierarchyOption option, Bool addChildren,
Bool addSiblings ); ///< workhorse for addWindow()
HTREEITEM findItemEntry( HTREEITEM node, GameWindow *window ); ///< workhorse for findTreeEntry
HTREEITEM findTreeEntry( GameWindow *window ); ///< return entry if in tree
HWND m_dialog; ///< window handle for our control dialog
HWND m_tree; ///< window handle for the tree control
GameWindow *m_dragWindow; ///< for drag drop operations
GameWindow *m_dragTarget; ///< target for drag and drop operations while mouse is moving
GameWindow *m_popupTarget; ///< the target for right mouse popup menus
}; // end HierarchyView
///////////////////////////////////////////////////////////////////////////////
// INLINING ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
inline HWND HierarchyView::getTreeHandle( void ) { return m_tree; }
inline HWND HierarchyView::getHierarchyHandle( void ) { return m_dialog; }
inline void HierarchyView::setDragWindow( GameWindow *window ) { m_dragWindow = window; }
inline void HierarchyView::setDragTarget( GameWindow *window ) { m_dragTarget = window; }
inline GameWindow *HierarchyView::getDragWindow( void ) { return m_dragWindow; }
inline GameWindow *HierarchyView::getDragTarget( void ) { return m_dragTarget; }
inline void HierarchyView::setPopupTarget( GameWindow *window ) { m_popupTarget = window; }
inline GameWindow *HierarchyView::getPopupTarget( void ) { return m_popupTarget; }
// EXTERNALS //////////////////////////////////////////////////////////////////
extern HierarchyView *TheHierarchyView; ///< singleton for our view
#endif // __CONTROLPALETTE_H_

View file

@ -0,0 +1,152 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: LayoutScheme.h ///////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: GUIEdit
//
// File name: LayoutScheme.h
//
// Created: Colin Day, August 2001
//
// Desc: Layout scheme editing and loading
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __LAYOUTSCHEME_H_
#define __LAYOUTSCHEME_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
#include <windows.h>
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Lib/BaseType.h"
#include "Properties.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// LayoutScheme ---------------------------------------------------------------
/** The layout scheme provides a place for default look of newly
* created controls and windows */
//-----------------------------------------------------------------------------
class LayoutScheme
{
public:
LayoutScheme();
~LayoutScheme();
void init( void );
void openDialog( void ); ///< open the scheme info and editing dialog
char *getSchemeFilename( void ); ///< get the scheme filename
void setSchemeFilename( char *filename ); ///< set the scheme filename
Bool saveScheme( char *filename ); ///< save the current scheme to file
Bool loadScheme( char *filename ); ///< load the scheme file
ImageAndColorInfo *getImageAndColor( StateIdentifier id );
void storeImageAndColor( StateIdentifier id, const Image *image,
Color color, Color borderColor );
void setFont( GameFont *font );
GameFont *getFont( void );
Color getEnabledTextColor( void );
Color getEnabledTextBorderColor( void );
Color getDisabledTextColor( void );
Color getDisabledTextBorderColor( void );
Color getHiliteTextColor( void );
Color getHiliteTextBorderColor( void );
void setEnabledTextColor( Color c );
void setEnabledTextBorderColor( Color c );
void setDisabledTextColor( Color c );
void setDisabledTextBorderColor( Color c );
void setHiliteTextColor( Color c );
void setHiliteTextBorderColor( Color c );
/** apply the image and color info stored in the state identifer tables
used for "property editing" to all appropriate windows currently
loaded in the editor */
void applyPropertyTablesToWindow( GameWindow *root );
protected:
ImageAndColorInfo *findEntry( StateIdentifier id );
char m_schemeFilename[ _MAX_PATH ]; ///< filename
ImageAndColorInfo m_imageAndColorTable[ NUM_STATE_IDENTIFIERS ]; // the color and image info
TextDrawData m_enabledText; ///< default text colors
TextDrawData m_disabledText; ///< default text colors
TextDrawData m_hiliteText; ///< default text colors
GameFont *m_font; ///< default font
}; // end LayoutScheme
///////////////////////////////////////////////////////////////////////////////
// INLINING ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
inline char *LayoutScheme::getSchemeFilename( void ) { return m_schemeFilename; }
inline void LayoutScheme::setSchemeFilename( char *filename ) { strcpy( m_schemeFilename, filename ); }
inline Color LayoutScheme::getEnabledTextColor( void ) { return m_enabledText.color; }
inline Color LayoutScheme::getEnabledTextBorderColor( void ) { return m_enabledText.borderColor; }
inline Color LayoutScheme::getDisabledTextColor( void ) { return m_disabledText.color; }
inline Color LayoutScheme::getDisabledTextBorderColor( void ) { return m_disabledText.borderColor; }
inline Color LayoutScheme::getHiliteTextColor( void ) { return m_hiliteText.color; }
inline Color LayoutScheme::getHiliteTextBorderColor( void ) { return m_hiliteText.borderColor; }
inline void LayoutScheme::setEnabledTextColor( Color c ) { m_enabledText.color = c; }
inline void LayoutScheme::setEnabledTextBorderColor( Color c ) { m_enabledText.borderColor = c; }
inline void LayoutScheme::setDisabledTextColor( Color c ) { m_disabledText.color = c; }
inline void LayoutScheme::setDisabledTextBorderColor( Color c ) { m_disabledText.borderColor = c; }
inline void LayoutScheme::setHiliteTextColor( Color c ) { m_hiliteText.color = c; }
inline void LayoutScheme::setHiliteTextBorderColor( Color c ) { m_hiliteText.borderColor = c; }
inline void LayoutScheme::setFont( GameFont *font ) { m_font = font; }
inline GameFont *LayoutScheme::getFont( void ) { return m_font; }
///////////////////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
extern LayoutScheme *TheDefaultScheme;
#endif // end __LAYOUTSCHEME_H_

View file

@ -0,0 +1,429 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: Properties.h /////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: GUIEdit
//
// File name: Properties.h
//
// Created: Colin Day, August 2001
//
// Desc: Header for bringing up property dialogs for windows and
// window gadgets.
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __PROPERTIES_H_
#define __PROPERTIES_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "GameClient/GameWindow.h"
#include "GUIEditColor.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ColorControl ---------------------------------------------------------------
/** This makes it easier for us to associate colors with dialog
* control ID's for purposes of custom color buttons */
//-----------------------------------------------------------------------------
struct ColorControl
{
UnsignedInt controlID; ///< controlID from resource file
RGBColorInt color; ///< the color for this controlID
};
// StateIdentifiers -----------------------------------------------------------
/** These state identifiers link to image and color info entries */
//-----------------------------------------------------------------------------
typedef enum
{
IDENTIFIER_INVALID = 0, // keep this 0 and keep it first
FIRST_VALID_IDENTIFIER = 1,
BUTTON_ENABLED = FIRST_VALID_IDENTIFIER,
BUTTON_ENABLED_PUSHED,
BUTTON_DISABLED,
BUTTON_DISABLED_PUSHED,
BUTTON_HILITE,
BUTTON_HILITE_PUSHED,
RADIO_ENABLED,
RADIO_ENABLED_UNCHECKED_BOX,
RADIO_ENABLED_CHECKED_BOX,
RADIO_DISABLED,
RADIO_DISABLED_UNCHECKED_BOX,
RADIO_DISABLED_CHECKED_BOX,
RADIO_HILITE,
RADIO_HILITE_UNCHECKED_BOX,
RADIO_HILITE_CHECKED_BOX,
CHECK_BOX_ENABLED,
CHECK_BOX_ENABLED_UNCHECKED_BOX,
CHECK_BOX_ENABLED_CHECKED_BOX,
CHECK_BOX_DISABLED,
CHECK_BOX_DISABLED_UNCHECKED_BOX,
CHECK_BOX_DISABLED_CHECKED_BOX,
CHECK_BOX_HILITE,
CHECK_BOX_HILITE_UNCHECKED_BOX,
CHECK_BOX_HILITE_CHECKED_BOX,
COMBOBOX_ENABLED,
COMBOBOX_ENABLED_SELECTED_ITEM_LEFT,
COMBOBOX_ENABLED_SELECTED_ITEM_RIGHT,
COMBOBOX_ENABLED_SELECTED_ITEM_CENTER,
COMBOBOX_ENABLED_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_DISABLED,
COMBOBOX_DISABLED_SELECTED_ITEM_LEFT,
COMBOBOX_DISABLED_SELECTED_ITEM_RIGHT,
COMBOBOX_DISABLED_SELECTED_ITEM_CENTER,
COMBOBOX_DISABLED_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_HILITE,
COMBOBOX_HILITE_SELECTED_ITEM_LEFT,
COMBOBOX_HILITE_SELECTED_ITEM_RIGHT,
COMBOBOX_HILITE_SELECTED_ITEM_CENTER,
COMBOBOX_HILITE_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_DROP_DOWN_BUTTON_ENABLED,
COMBOBOX_DROP_DOWN_BUTTON_ENABLED_PUSHED,
COMBOBOX_DROP_DOWN_BUTTON_DISABLED,
COMBOBOX_DROP_DOWN_BUTTON_DISABLED_PUSHED,
COMBOBOX_DROP_DOWN_BUTTON_HILITE,
COMBOBOX_DROP_DOWN_BUTTON_HILITE_PUSHED,
COMBOBOX_EDIT_BOX_ENABLED_LEFT,
COMBOBOX_EDIT_BOX_ENABLED_RIGHT,
COMBOBOX_EDIT_BOX_ENABLED_CENTER,
COMBOBOX_EDIT_BOX_ENABLED_SMALL_CENTER,
COMBOBOX_EDIT_BOX_DISABLED_LEFT,
COMBOBOX_EDIT_BOX_DISABLED_RIGHT,
COMBOBOX_EDIT_BOX_DISABLED_CENTER,
COMBOBOX_EDIT_BOX_DISABLED_SMALL_CENTER,
COMBOBOX_EDIT_BOX_HILITE_LEFT,
COMBOBOX_EDIT_BOX_HILITE_RIGHT,
COMBOBOX_EDIT_BOX_HILITE_CENTER,
COMBOBOX_EDIT_BOX_HILITE_SMALL_CENTER,
COMBOBOX_LISTBOX_ENABLED,
COMBOBOX_LISTBOX_ENABLED_SELECTED_ITEM_LEFT,
COMBOBOX_LISTBOX_ENABLED_SELECTED_ITEM_RIGHT,
COMBOBOX_LISTBOX_ENABLED_SELECTED_ITEM_CENTER,
COMBOBOX_LISTBOX_ENABLED_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_LISTBOX_DISABLED,
COMBOBOX_LISTBOX_DISABLED_SELECTED_ITEM_LEFT,
COMBOBOX_LISTBOX_DISABLED_SELECTED_ITEM_RIGHT,
COMBOBOX_LISTBOX_DISABLED_SELECTED_ITEM_CENTER,
COMBOBOX_LISTBOX_DISABLED_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_LISTBOX_HILITE,
COMBOBOX_LISTBOX_HILITE_SELECTED_ITEM_LEFT,
COMBOBOX_LISTBOX_HILITE_SELECTED_ITEM_RIGHT,
COMBOBOX_LISTBOX_HILITE_SELECTED_ITEM_CENTER,
COMBOBOX_LISTBOX_HILITE_SELECTED_ITEM_SMALL_CENTER,
COMBOBOX_LISTBOX_UP_BUTTON_ENABLED,
COMBOBOX_LISTBOX_UP_BUTTON_ENABLED_PUSHED,
COMBOBOX_LISTBOX_UP_BUTTON_DISABLED,
COMBOBOX_LISTBOX_UP_BUTTON_DISABLED_PUSHED,
COMBOBOX_LISTBOX_UP_BUTTON_HILITE,
COMBOBOX_LISTBOX_UP_BUTTON_HILITE_PUSHED,
COMBOBOX_LISTBOX_DOWN_BUTTON_ENABLED,
COMBOBOX_LISTBOX_DOWN_BUTTON_ENABLED_PUSHED,
COMBOBOX_LISTBOX_DOWN_BUTTON_DISABLED,
COMBOBOX_LISTBOX_DOWN_BUTTON_DISABLED_PUSHED,
COMBOBOX_LISTBOX_DOWN_BUTTON_HILITE,
COMBOBOX_LISTBOX_DOWN_BUTTON_HILITE_PUSHED,
COMBOBOX_LISTBOX_SLIDER_ENABLED_TOP,
COMBOBOX_LISTBOX_SLIDER_ENABLED_BOTTOM,
COMBOBOX_LISTBOX_SLIDER_ENABLED_CENTER,
COMBOBOX_LISTBOX_SLIDER_ENABLED_SMALL_CENTER,
COMBOBOX_LISTBOX_SLIDER_DISABLED_TOP,
COMBOBOX_LISTBOX_SLIDER_DISABLED_BOTTOM,
COMBOBOX_LISTBOX_SLIDER_DISABLED_CENTER,
COMBOBOX_LISTBOX_SLIDER_DISABLED_SMALL_CENTER,
COMBOBOX_LISTBOX_SLIDER_HILITE_TOP,
COMBOBOX_LISTBOX_SLIDER_HILITE_BOTTOM,
COMBOBOX_LISTBOX_SLIDER_HILITE_CENTER,
COMBOBOX_LISTBOX_SLIDER_HILITE_SMALL_CENTER,
COMBOBOX_LISTBOX_SLIDER_THUMB_ENABLED,
COMBOBOX_LISTBOX_SLIDER_THUMB_ENABLED_PUSHED,
COMBOBOX_LISTBOX_SLIDER_THUMB_DISABLED,
COMBOBOX_LISTBOX_SLIDER_THUMB_DISABLED_PUSHED,
COMBOBOX_LISTBOX_SLIDER_THUMB_HILITE,
COMBOBOX_LISTBOX_SLIDER_THUMB_HILITE_PUSHED,
VSLIDER_ENABLED_TOP,
VSLIDER_ENABLED_BOTTOM,
VSLIDER_ENABLED_CENTER,
VSLIDER_ENABLED_SMALL_CENTER,
VSLIDER_DISABLED_TOP,
VSLIDER_DISABLED_BOTTOM,
VSLIDER_DISABLED_CENTER,
VSLIDER_DISABLED_SMALL_CENTER,
VSLIDER_HILITE_TOP,
VSLIDER_HILITE_BOTTOM,
VSLIDER_HILITE_CENTER,
VSLIDER_HILITE_SMALL_CENTER,
VSLIDER_THUMB_ENABLED,
VSLIDER_THUMB_ENABLED_PUSHED,
VSLIDER_THUMB_DISABLED,
VSLIDER_THUMB_DISABLED_PUSHED,
VSLIDER_THUMB_HILITE,
VSLIDER_THUMB_HILITE_PUSHED,
HSLIDER_ENABLED_LEFT,
HSLIDER_ENABLED_RIGHT,
HSLIDER_ENABLED_CENTER,
HSLIDER_ENABLED_SMALL_CENTER,
HSLIDER_DISABLED_LEFT,
HSLIDER_DISABLED_RIGHT,
HSLIDER_DISABLED_CENTER,
HSLIDER_DISABLED_SMALL_CENTER,
HSLIDER_HILITE_LEFT,
HSLIDER_HILITE_RIGHT,
HSLIDER_HILITE_CENTER,
HSLIDER_HILITE_SMALL_CENTER,
HSLIDER_THUMB_ENABLED,
HSLIDER_THUMB_ENABLED_PUSHED,
HSLIDER_THUMB_DISABLED,
HSLIDER_THUMB_DISABLED_PUSHED,
HSLIDER_THUMB_HILITE,
HSLIDER_THUMB_HILITE_PUSHED,
LISTBOX_ENABLED,
LISTBOX_ENABLED_SELECTED_ITEM_LEFT,
LISTBOX_ENABLED_SELECTED_ITEM_RIGHT,
LISTBOX_ENABLED_SELECTED_ITEM_CENTER,
LISTBOX_ENABLED_SELECTED_ITEM_SMALL_CENTER,
LISTBOX_DISABLED,
LISTBOX_DISABLED_SELECTED_ITEM_LEFT,
LISTBOX_DISABLED_SELECTED_ITEM_RIGHT,
LISTBOX_DISABLED_SELECTED_ITEM_CENTER,
LISTBOX_DISABLED_SELECTED_ITEM_SMALL_CENTER,
LISTBOX_HILITE,
LISTBOX_HILITE_SELECTED_ITEM_LEFT,
LISTBOX_HILITE_SELECTED_ITEM_RIGHT,
LISTBOX_HILITE_SELECTED_ITEM_CENTER,
LISTBOX_HILITE_SELECTED_ITEM_SMALL_CENTER,
LISTBOX_UP_BUTTON_ENABLED,
LISTBOX_UP_BUTTON_ENABLED_PUSHED,
LISTBOX_UP_BUTTON_DISABLED,
LISTBOX_UP_BUTTON_DISABLED_PUSHED,
LISTBOX_UP_BUTTON_HILITE,
LISTBOX_UP_BUTTON_HILITE_PUSHED,
LISTBOX_DOWN_BUTTON_ENABLED,
LISTBOX_DOWN_BUTTON_ENABLED_PUSHED,
LISTBOX_DOWN_BUTTON_DISABLED,
LISTBOX_DOWN_BUTTON_DISABLED_PUSHED,
LISTBOX_DOWN_BUTTON_HILITE,
LISTBOX_DOWN_BUTTON_HILITE_PUSHED,
LISTBOX_SLIDER_ENABLED_TOP,
LISTBOX_SLIDER_ENABLED_BOTTOM,
LISTBOX_SLIDER_ENABLED_CENTER,
LISTBOX_SLIDER_ENABLED_SMALL_CENTER,
LISTBOX_SLIDER_DISABLED_TOP,
LISTBOX_SLIDER_DISABLED_BOTTOM,
LISTBOX_SLIDER_DISABLED_CENTER,
LISTBOX_SLIDER_DISABLED_SMALL_CENTER,
LISTBOX_SLIDER_HILITE_TOP,
LISTBOX_SLIDER_HILITE_BOTTOM,
LISTBOX_SLIDER_HILITE_CENTER,
LISTBOX_SLIDER_HILITE_SMALL_CENTER,
LISTBOX_SLIDER_THUMB_ENABLED,
LISTBOX_SLIDER_THUMB_ENABLED_PUSHED,
LISTBOX_SLIDER_THUMB_DISABLED,
LISTBOX_SLIDER_THUMB_DISABLED_PUSHED,
LISTBOX_SLIDER_THUMB_HILITE,
LISTBOX_SLIDER_THUMB_HILITE_PUSHED,
PROGRESS_BAR_ENABLED_LEFT,
PROGRESS_BAR_ENABLED_RIGHT,
PROGRESS_BAR_ENABLED_CENTER,
PROGRESS_BAR_ENABLED_SMALL_CENTER,
PROGRESS_BAR_ENABLED_BAR_LEFT,
PROGRESS_BAR_ENABLED_BAR_RIGHT,
PROGRESS_BAR_ENABLED_BAR_CENTER,
PROGRESS_BAR_ENABLED_BAR_SMALL_CENTER,
PROGRESS_BAR_DISABLED_LEFT,
PROGRESS_BAR_DISABLED_RIGHT,
PROGRESS_BAR_DISABLED_CENTER,
PROGRESS_BAR_DISABLED_SMALL_CENTER,
PROGRESS_BAR_DISABLED_BAR_LEFT,
PROGRESS_BAR_DISABLED_BAR_RIGHT,
PROGRESS_BAR_DISABLED_BAR_CENTER,
PROGRESS_BAR_DISABLED_BAR_SMALL_CENTER,
PROGRESS_BAR_HILITE_LEFT,
PROGRESS_BAR_HILITE_RIGHT,
PROGRESS_BAR_HILITE_CENTER,
PROGRESS_BAR_HILITE_SMALL_CENTER,
PROGRESS_BAR_HILITE_BAR_LEFT,
PROGRESS_BAR_HILITE_BAR_RIGHT,
PROGRESS_BAR_HILITE_BAR_CENTER,
PROGRESS_BAR_HILITE_BAR_SMALL_CENTER,
STATIC_TEXT_ENABLED,
STATIC_TEXT_DISABLED,
STATIC_TEXT_HILITE,
TEXT_ENTRY_ENABLED_LEFT,
TEXT_ENTRY_ENABLED_RIGHT,
TEXT_ENTRY_ENABLED_CENTER,
TEXT_ENTRY_ENABLED_SMALL_CENTER,
TEXT_ENTRY_DISABLED_LEFT,
TEXT_ENTRY_DISABLED_RIGHT,
TEXT_ENTRY_DISABLED_CENTER,
TEXT_ENTRY_DISABLED_SMALL_CENTER,
TEXT_ENTRY_HILITE_LEFT,
TEXT_ENTRY_HILITE_RIGHT,
TEXT_ENTRY_HILITE_CENTER,
TEXT_ENTRY_HILITE_SMALL_CENTER,
TC_TAB_0_ENABLED,
TC_TAB_0_DISABLED,
TC_TAB_0_HILITE,
TC_TAB_1_ENABLED,
TC_TAB_1_DISABLED,
TC_TAB_1_HILITE,
TC_TAB_2_ENABLED,
TC_TAB_2_DISABLED,
TC_TAB_2_HILITE,
TC_TAB_3_ENABLED,
TC_TAB_3_DISABLED,
TC_TAB_3_HILITE,
TC_TAB_4_ENABLED,
TC_TAB_4_DISABLED,
TC_TAB_4_HILITE,
TC_TAB_5_ENABLED,
TC_TAB_5_DISABLED,
TC_TAB_5_HILITE,
TC_TAB_6_ENABLED,
TC_TAB_6_DISABLED,
TC_TAB_6_HILITE,
TC_TAB_7_ENABLED,
TC_TAB_7_DISABLED,
TC_TAB_7_HILITE,
TAB_CONTROL_ENABLED,
TAB_CONTROL_DISABLED,
TAB_CONTROL_HILITE,
GENERIC_ENABLED,
GENERIC_DISABLED,
GENERIC_HILITE,
NUM_STATE_IDENTIFIERS // keep this last
} StateIdentifier;
// ImageAndColorInfo ----------------------------------------------------------
/** This is a place for us to store image and color information for
* all the various states for each of the controls, it makes it easier
* for us cause we can just put and get queries in this table and
* work with only one set of dialog controls on all the property
* dialog windows */
//-----------------------------------------------------------------------------
struct ImageAndColorInfo
{
UnsignedInt windowType; ///< this entry applies to these kind of windows
StateIdentifier stateID; ///< state identifier
char *stateName; ///< string state name that this affects
const Image *image; ///< the image for this entry
Color color; ///< color for this entry
Color borderColor; ///< border color for this entry
};
// INLINING ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
extern void InitPropertiesDialog( GameWindow *window, Int x, Int y );
extern HWND InitPushButtonPropertiesDialog( GameWindow *window );
extern HWND InitRadioButtonPropertiesDialog( GameWindow *window );
extern HWND InitCheckBoxPropertiesDialog( GameWindow *window );
extern HWND InitListboxPropertiesDialog( GameWindow *window );
extern HWND InitComboBoxPropertiesDialog( GameWindow *window );
extern HWND InitProgressBarPropertiesDialog( GameWindow *window );
extern HWND InitTabControlPropertiesDialog( GameWindow *window );
extern HWND InitStaticTextPropertiesDialog( GameWindow *window );
extern HWND InitTextEntryPropertiesDialog( GameWindow *window );
extern HWND InitSliderPropertiesDialog( GameWindow *window );
extern HWND InitUserWinPropertiesDialog( GameWindow *window );
// these functions help us in managing the dialog "engine"
extern Bool HandleCommonDialogMessages( HWND hWndDialog, UINT message,
WPARAM wParam, LPARAM lParam,
Int *returnCode );
extern void CommonDialogInitialize( GameWindow *window, HWND dialog );
extern void LoadImageListComboBox( HWND comboBox );
extern void LoadHeaderTemplateListComboBox( HWND comboBox, AsciiString selected );
extern const Image *ComboBoxSelectionToImage( HWND comboBox );
extern RGBColorInt *GetControlColor( UnsignedInt controlID );
extern void SetControlColor( UnsignedInt controlID, Color color );
extern void PositionWindowOnScreen( HWND window, Int x, Int y );
extern Bool SaveCommonDialogProperties( HWND dialog, GameWindow *window );
extern void LoadStateCombo( UnsignedInt style, HWND comboBox );
extern void LoadTextStateCombo( HWND comboBox,
Color enabled, Color enabledBorder,
Color disabled, Color disabledBorder,
Color hilite, Color hiliteBorder );
extern void InitCallbackCombos( HWND dialog, GameWindow *window );
extern void SaveCallbacks( GameWindow *window, HWND dialog );
extern ImageAndColorInfo *GetStateInfo( StateIdentifier id );
extern ImageAndColorInfo *GetCurrentStateInfo( HWND dialog );
void SwitchToState( StateIdentifier id, HWND dialog );
extern void StoreImageAndColor( StateIdentifier id, const Image *image,
Color color, Color borderColor );
extern void StoreColor( StateIdentifier id, Color color, Color borderColor );
extern void LoadFontCombo( HWND comboBox, GameFont *currFont );
extern GameFont *GetSelectedFontFromCombo( HWND combo );
extern Color GetPropsEnabledTextColor( void );
extern Color GetPropsEnabledTextBorderColor( void );
extern Color GetPropsDisabledTextColor( void );
extern Color GetPropsDisabledTextBorderColor( void );
extern Color GetPropsHiliteTextColor( void );
extern Color GetPropsHiliteTextBorderColor( void );
#endif // __PROPERTIES_H_

View file

@ -0,0 +1,70 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: WinMain.h ////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: RTS3
//
// File name: WinMain.h
//
// Created: Colin Day, July 2001
//
// Desc: WinMain header for GUIEdit
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __WINMAIN_H_
#define __WINMAIN_H_
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
#include <windows.h>
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Win32Device/GameClient/Win32Mouse.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
#define TIMER_EDIT_WINDOW_PULSE 1
// INLINING ///////////////////////////////////////////////////////////////////
// EXTERNALS //////////////////////////////////////////////////////////////////
extern HWND ApplicationHWnd; ///< application main window handle
extern HINSTANCE ApplicationHInstance; ///< application main instance handle
extern Win32Mouse *TheWin32Mouse; ///< the mouse for win processing
#endif // __WINMAIN_H_