From f918245b2d1fb8bd87a9ad6d576fb9eda811e504 Mon Sep 17 00:00:00 2001 From: g-cont Date: Thu, 26 Apr 2018 00:00:00 +0300 Subject: [PATCH] 26 Apr 2018 --- backup.lst | 1 - change.log | 91 ++ debug.bat | 4 - engine/client/cl_game.c | 2 +- engine/client/cl_gameui.c | 2 + engine/client/cl_main.c | 11 +- engine/client/cl_parse.c | 4 +- engine/client/cl_pmove.c | 4 +- engine/client/cl_scrn.c | 2 +- engine/client/gl_image.c | 4 +- engine/client/gl_rmain.c | 5 +- engine/client/gl_vidnt.c | 7 +- engine/common/cmd.c | 2 +- engine/common/console.c | 4 +- engine/common/crtlib.c | 5 +- engine/common/filesystem.c | 2 +- engine/common/host.c | 38 +- engine/common/hpak.c | 2 +- engine/common/mod_bmodel.c | 2 +- engine/common/sys_win.c | 2 +- engine/common/zone.c | 13 +- engine/menu_int.h | 2 + engine/server/sv_cmds.c | 7 +- engine/server/sv_frame.c | 22 +- engine/server/sv_game.c | 4 + game_launch/game.cpp | 4 +- release.bat | 4 - utils/vgui/lib/App.cpp | 693 -------------- utils/vgui/lib/Bitmap.cpp | 89 -- utils/vgui/lib/BitmapTGA.cpp | 334 ------- utils/vgui/lib/Border.cpp | 70 -- utils/vgui/lib/BorderLayout.cpp | 137 --- utils/vgui/lib/BorderPair.cpp | 42 - utils/vgui/lib/BuildGroup.cpp | 287 ------ utils/vgui/lib/Button.cpp | 273 ------ utils/vgui/lib/ButtonGroup.cpp | 29 - utils/vgui/lib/CheckButton.cpp | 72 -- utils/vgui/lib/Color.cpp | 78 -- utils/vgui/lib/ConfigWizard.cpp | 62 -- utils/vgui/lib/Cursor.cpp | 38 - utils/vgui/lib/DataInputStream.cpp | 235 ----- utils/vgui/lib/Desktop.cpp | 105 -- utils/vgui/lib/DesktopIcon.cpp | 165 ---- utils/vgui/lib/EditPanel.cpp | 602 ------------ utils/vgui/lib/EtchedBorder.cpp | 34 - utils/vgui/lib/FileInputStream.cpp | 101 -- utils/vgui/lib/FlowLayout.cpp | 30 - utils/vgui/lib/FocusNavGroup.cpp | 61 -- utils/vgui/lib/Font.cpp | 58 -- utils/vgui/lib/Frame.cpp | 699 -------------- utils/vgui/lib/GridLayout.cpp | 14 - utils/vgui/lib/HeaderPanel.cpp | 208 ---- utils/vgui/lib/Image.cpp | 158 --- utils/vgui/lib/ImagePanel.cpp | 40 - utils/vgui/lib/IntLabel.cpp | 41 - utils/vgui/lib/Label.cpp | 425 --------- utils/vgui/lib/Layout.cpp | 22 - utils/vgui/lib/LineBorder.cpp | 52 - utils/vgui/lib/ListPanel.cpp | 107 --- utils/vgui/lib/LoweredBorder.cpp | 34 - utils/vgui/lib/Menu.cpp | 29 - utils/vgui/lib/MenuItem.cpp | 22 - utils/vgui/lib/MenuSeparator.cpp | 48 - utils/vgui/lib/MessageBox.cpp | 76 -- utils/vgui/lib/MiniApp.cpp | 38 - utils/vgui/lib/Panel.cpp | 1216 ------------------------ utils/vgui/lib/PopupMenu.cpp | 24 - utils/vgui/lib/ProgressBar.cpp | 68 -- utils/vgui/lib/RadioButton.cpp | 71 -- utils/vgui/lib/RaisedBorder.cpp | 34 - utils/vgui/lib/Scheme.cpp | 78 -- utils/vgui/lib/ScrollBar.cpp | 262 ----- utils/vgui/lib/ScrollPanel.cpp | 204 ---- utils/vgui/lib/Slider.cpp | 449 --------- utils/vgui/lib/StackLayout.cpp | 37 - utils/vgui/lib/String.cpp | 146 --- utils/vgui/lib/Surface.cpp | 23 - utils/vgui/lib/SurfaceBase.cpp | 96 -- utils/vgui/lib/TabPanel.cpp | 266 ------ utils/vgui/lib/TablePanel.cpp | 440 --------- utils/vgui/lib/TaskBar.cpp | 157 --- utils/vgui/lib/TextEntry.cpp | 552 ----------- utils/vgui/lib/TextGrid.cpp | 132 --- utils/vgui/lib/TextImage.cpp | 312 ------ utils/vgui/lib/TextPanel.cpp | 61 -- utils/vgui/lib/ToggleButton.cpp | 83 -- utils/vgui/lib/TreeFolder.cpp | 250 ----- utils/vgui/lib/WizardPanel.cpp | 453 --------- utils/vgui/lib/vgui.cpp | 103 -- utils/vgui/lib/vgui.dsp | 845 ---------------- utils/vgui/lib/win32_vc6/App.cpp | 332 ------- utils/vgui/lib/win32_vc6/Cursor.cpp | 62 -- utils/vgui/lib/win32_vc6/Font.cpp | 345 ------- utils/vgui/lib/win32_vc6/Surface.cpp | 769 --------------- utils/vgui/lib/win32_vc6/fileimage.cpp | 208 ---- utils/vgui/lib/win32_vc6/fileimage.h | 100 -- utils/vgui/lib/win32_vc6/vfontdata.cpp | 66 -- utils/vgui/lib/win32_vc6/vfontdata.h | 35 - utils/vgui/lib/win32_vc6/vgui.cpp | 41 - utils/vgui/lib/win32_vc6/vgui.lib | Bin 416150 -> 416680 bytes utils/vgui/lib/win32_vc6/vgui_win32.h | 99 -- xash.dsw | 12 - 102 files changed, 195 insertions(+), 14094 deletions(-) delete mode 100644 utils/vgui/lib/App.cpp delete mode 100644 utils/vgui/lib/Bitmap.cpp delete mode 100644 utils/vgui/lib/BitmapTGA.cpp delete mode 100644 utils/vgui/lib/Border.cpp delete mode 100644 utils/vgui/lib/BorderLayout.cpp delete mode 100644 utils/vgui/lib/BorderPair.cpp delete mode 100644 utils/vgui/lib/BuildGroup.cpp delete mode 100644 utils/vgui/lib/Button.cpp delete mode 100644 utils/vgui/lib/ButtonGroup.cpp delete mode 100644 utils/vgui/lib/CheckButton.cpp delete mode 100644 utils/vgui/lib/Color.cpp delete mode 100644 utils/vgui/lib/ConfigWizard.cpp delete mode 100644 utils/vgui/lib/Cursor.cpp delete mode 100644 utils/vgui/lib/DataInputStream.cpp delete mode 100644 utils/vgui/lib/Desktop.cpp delete mode 100644 utils/vgui/lib/DesktopIcon.cpp delete mode 100644 utils/vgui/lib/EditPanel.cpp delete mode 100644 utils/vgui/lib/EtchedBorder.cpp delete mode 100644 utils/vgui/lib/FileInputStream.cpp delete mode 100644 utils/vgui/lib/FlowLayout.cpp delete mode 100644 utils/vgui/lib/FocusNavGroup.cpp delete mode 100644 utils/vgui/lib/Font.cpp delete mode 100644 utils/vgui/lib/Frame.cpp delete mode 100644 utils/vgui/lib/GridLayout.cpp delete mode 100644 utils/vgui/lib/HeaderPanel.cpp delete mode 100644 utils/vgui/lib/Image.cpp delete mode 100644 utils/vgui/lib/ImagePanel.cpp delete mode 100644 utils/vgui/lib/IntLabel.cpp delete mode 100644 utils/vgui/lib/Label.cpp delete mode 100644 utils/vgui/lib/Layout.cpp delete mode 100644 utils/vgui/lib/LineBorder.cpp delete mode 100644 utils/vgui/lib/ListPanel.cpp delete mode 100644 utils/vgui/lib/LoweredBorder.cpp delete mode 100644 utils/vgui/lib/Menu.cpp delete mode 100644 utils/vgui/lib/MenuItem.cpp delete mode 100644 utils/vgui/lib/MenuSeparator.cpp delete mode 100644 utils/vgui/lib/MessageBox.cpp delete mode 100644 utils/vgui/lib/MiniApp.cpp delete mode 100644 utils/vgui/lib/Panel.cpp delete mode 100644 utils/vgui/lib/PopupMenu.cpp delete mode 100644 utils/vgui/lib/ProgressBar.cpp delete mode 100644 utils/vgui/lib/RadioButton.cpp delete mode 100644 utils/vgui/lib/RaisedBorder.cpp delete mode 100644 utils/vgui/lib/Scheme.cpp delete mode 100644 utils/vgui/lib/ScrollBar.cpp delete mode 100644 utils/vgui/lib/ScrollPanel.cpp delete mode 100644 utils/vgui/lib/Slider.cpp delete mode 100644 utils/vgui/lib/StackLayout.cpp delete mode 100644 utils/vgui/lib/String.cpp delete mode 100644 utils/vgui/lib/Surface.cpp delete mode 100644 utils/vgui/lib/SurfaceBase.cpp delete mode 100644 utils/vgui/lib/TabPanel.cpp delete mode 100644 utils/vgui/lib/TablePanel.cpp delete mode 100644 utils/vgui/lib/TaskBar.cpp delete mode 100644 utils/vgui/lib/TextEntry.cpp delete mode 100644 utils/vgui/lib/TextGrid.cpp delete mode 100644 utils/vgui/lib/TextImage.cpp delete mode 100644 utils/vgui/lib/TextPanel.cpp delete mode 100644 utils/vgui/lib/ToggleButton.cpp delete mode 100644 utils/vgui/lib/TreeFolder.cpp delete mode 100644 utils/vgui/lib/WizardPanel.cpp delete mode 100644 utils/vgui/lib/vgui.cpp delete mode 100644 utils/vgui/lib/vgui.dsp delete mode 100644 utils/vgui/lib/win32_vc6/App.cpp delete mode 100644 utils/vgui/lib/win32_vc6/Cursor.cpp delete mode 100644 utils/vgui/lib/win32_vc6/Font.cpp delete mode 100644 utils/vgui/lib/win32_vc6/Surface.cpp delete mode 100644 utils/vgui/lib/win32_vc6/fileimage.cpp delete mode 100644 utils/vgui/lib/win32_vc6/fileimage.h delete mode 100644 utils/vgui/lib/win32_vc6/vfontdata.cpp delete mode 100644 utils/vgui/lib/win32_vc6/vfontdata.h delete mode 100644 utils/vgui/lib/win32_vc6/vgui.cpp delete mode 100644 utils/vgui/lib/win32_vc6/vgui_win32.h diff --git a/backup.lst b/backup.lst index e88a840b..442d99e7 100644 --- a/backup.lst +++ b/backup.lst @@ -30,5 +30,4 @@ mainui\legacy utils\ utils\vgui\ utils\vgui\include\ -utils\vgui\lib\ utils\vgui\lib\win32_vc6\ \ No newline at end of file diff --git a/change.log b/change.log index f2b49160..8e2b83fa 100644 --- a/change.log +++ b/change.log @@ -1,3 +1,94 @@ +LEGEND: + +Client: - client.dll or client part of xash.dll +Server: - hl.dll or server part of xash.dll +Engine: - xash.dll +Network: - a network part of xash.dll +Render: - a render part of xash.dll +FS: - a filesystem part of xash.dll +GameUI - menu.dll +Sound: - a sound part of xash.dll +Input: - a input code of xash.dll +ImageLib: - image loader in xash.dll +SoundLib: - sound loader in xash.dll +Console: - console code in xash.dll +VGUI: - a VGUI implementation code in xash.dll +Memory: - a memory manager in xash.dll +Physic: - a server physics code in xash.dll + +build 4097 + +Client: implement predictable laser spot for weapon RPG +Server: fix bug with chat code that doesn't passed russian letters +Engine: BSP31 now is obsolete and removed from the engine (please use bsp31migrate.exe tool for migration) +Engine: new version of extended BSP30 map format (increase clipnode limits, tuneable lightmap resolution, per-vertex lighting etc) +Render: mirrors are no longer support and has been removed from the engine (but leaved in the mods like XashXT or P2:Savior) +Engine: mextrasurf_t was reorganized, please check your source code +Engine: event API was reorganized, two functions was removed new one added +Engine: engine feature ENGINE_FIXED_FRAMERATE are no longer supported +Engine: RenderAPI was changed version to 37 and reorganized +Server: "decalfrequency" is now stored into config.cfg +Engine: some unused functions from undocumented part of game and client interface was replaced with stubs +GameUI: import interface was updated with two new functions (save file and remove file) +Console: rewrite debug messages system like in Quake (Con_Printf instead of MsgDev) +Network: completely rewrite the network connection to allow downloading and uploading files (missing resources, player logos) +Network: first implementation of player customization (logos) +Network: protocol was changed to version 49 +Engine: demo protocol was changed to version 3 +Engine: implement timedemo command +Network: implement a signon sequence +Sound: fixup static sounds save\restore bug +Network: user messages max size will be increased up to 2048 bytes +Client: rewrite HudSprite manager allow to download missed HUD sprites +Client: rewrite SPR_GetList to prevent memory leak (old Half-Life bug) +Console: fix the ConsolePrint to allow to goes message only to notify buffer +Engine: fix very old bug in CheckParm export function (internal version is not bugged) +Client: getAppID was changed to 70 +Network: IPX protocol will no longer supported and has been removed +Client: single export for client.dll was renamed to GetClientAPI +VGUI: class CEngineApp was declared as static +GameUI: fix old crash with playersetup and changelevel on a background map +Engine: new queue system for change maps (not sticked with Cbuf_Execute) +Engine: experimental function CL_ChangeGame was removed from the engine +Engine: enable interpolation for addangle (fixangle = 2) +Network: new experimenal system to get maximum pack size for UDP (official size 1200 bytes but in theory it can be larger up to 64000 bytes) +Network: new generic resource system that included sounds, models, events, decals and all other types +Client: add mp3 command like in GoldSrc (warn this is not tested) +Server: implement instanced baselines (baselines that specified by user) +Server: implement a consistency resource check (model CRC and bounds) +Network: StudioDecal message is completely moved out from the engine +Client: request cvar value now can detect mismatch between cvar.string and cvar.value for detect potential cheaters +Render: allow remap colors on a alias player models (Quake1) +Client: added built-in resource pathes to list of download resources +Client: do revision of tempents code, fix some bugs +Client: make work EF_MUZZLEFLASH for alias-models +Render: tune intencity from dymanic lights (alias and studio models affected) +Render: enable built-in MSAA feature (cvar gl_enable_msaa in opengl.cfg) +Render: fix bug with 'sticky bind' while texture is uploaded +Render: the most of internal procedural textures has been moved out from the engine (keep'd only textures that engine is used himself) +Render: R_LightPoint has a contain VERY old bug from Quake1 with inaccurate samples from lightmap color and produce invalid results in some cases +Render: new extension of BSP file format (lightmaps that based on luxel per units instead of luxel per texels). Also check P2:Savior compile tools +Render: fix bug with sort STUDIO_NF_ADDITIVE meshes in studio models (old Half-Life bug) +Render: fix water subdivision bug that kill the prefomance while water is rendering +Render: r_drawentities 7 is now shows world position of luxel for lighting +Render: removed all unused GL-extensions +Render: fixed 16-bit color mode and NPOT textures case +Render: throw a system error on failed initalization video sybsystem instead of fallthrough into dedicated mode +Render: remove of rotational sky support (it's just was not used by nobody) +Sound: some minor changes in DirectSound backend code +VGUI: rewrite Font manager, enable vertex arrays support +Network: fragmented packets it's can be compressed by LZSS algorhytm +Console: mapinfo now shows information about editor and compiler +Engine: handle exception in Q_vsnprintf to prevent crash engine from the mistake of formatted args +Engine: new polymorphic BSP loader +Memory: fix bug in Mem_CheckFilename +Server: first implementation of server game log +Server: cmd 'changelevel' was no longer provided (only internal cnhagelevel is possible) +Server: cmd 'kill' moved from server to the client +Server: new save\restore system that compatible sav. files from GoldSrc +Server: implement server fps control that called a 'sv_fps' use with precaution +Server: fix some bugs with unlag system + build 3886 Client: fixup processing russian leter 'ÿ' in READ_STRING() diff --git a/debug.bat b/debug.bat index 237dc300..eb702325 100644 --- a/debug.bat +++ b/debug.bat @@ -14,9 +14,6 @@ if errorlevel 1 set BUILD_ERROR=1 %MSDEV% mainui/mainui.dsp %CONFIG%"mainui - Win32 Debug" %build_target% if errorlevel 1 set BUILD_ERROR=1 -%MSDEV% utils/vgui/lib/vgui.dsp %CONFIG%"vgui - Win32 Debug" %build_target% -if errorlevel 1 set BUILD_ERROR=1 - if "%BUILD_ERROR%"=="" goto build_ok echo ********************* @@ -38,7 +35,6 @@ goto done rem //delete log files if exist engine\engine.plg del /f /q engine\engine.plg if exist mainui\mainui.plg del /f /q mainui\mainui.plg -if exist utils/vgui/lib/vgui.plg del /f /q utils/vgui/lib/vgui.plg echo echo Build succeeded! diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index deb016cb..1a3c1476 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -237,7 +237,7 @@ void CL_InitCDAudio( const char *filename ) if( ++c > MAX_CDTRACKS - 1 ) { - MsgDev( D_WARN, "CD_Init: too many tracks %i in %s\n", filename, MAX_CDTRACKS ); + MsgDev( D_WARN, "CD_Init: too many tracks %i in %s\n", MAX_CDTRACKS, filename ); break; } } diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index 69b35664..dfb40ee8 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -985,6 +985,8 @@ static ui_enginefuncs_t gEngfuncs = GL_ProcessTexture, COM_CompareFileTime, VID_GetModeString, + COM_SaveFile, + FS_Delete, }; void UI_UnloadProgs( void ) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index aaa16d38..f70cbadc 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -195,7 +195,7 @@ int CL_GetFragmentSize( void *unused ) if( Netchan_IsLocal( &cls.netchan )) return FRAGMENT_LOCAL_SIZE; - return bound( FRAGMENT_MIN_SIZE, cl_dlmax->value, FRAGMENT_MAX_SIZE ); + return FRAGMENT_MIN_SIZE; } /* @@ -1091,7 +1091,7 @@ void CL_CheckForResend( void ) if( cls.connect_retry == CL_TEST_RETRIES_NORESPONCE ) { // too many fails use default connection method - Msg( "hi-speed coonection is failed, use default method\n" ); + Con_Printf( "hi-speed connection is failed, use default method\n" ); Netchan_OutOfBandPrint( NS_CLIENT, adr, "getchallenge\n" ); Cvar_SetValue( "cl_dlmax", FRAGMENT_MIN_SIZE ); cls.connect_time = host.realtime; @@ -1801,7 +1801,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) if( cls.connect_retry >= CL_TEST_RETRIES ) { // too many fails use default connection method - Msg( "hi-speed coonection is failed, use default method\n" ); + Con_Printf( "hi-speed connection is failed, use default method\n" ); Netchan_OutOfBandPrint( NS_CLIENT, from, "getchallenge\n" ); Cvar_SetValue( "cl_dlmax", FRAGMENT_MIN_SIZE ); cls.connect_time = host.realtime; @@ -1833,7 +1833,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) if( cls.connect_retry >= CL_TEST_RETRIES ) { // too many fails use default connection method - Msg( "hi-speed coonection is failed, use default method\n" ); + Con_Printf( "hi-speed connection is failed, use default method\n" ); Netchan_OutOfBandPrint( NS_CLIENT, from, "getchallenge\n" ); Cvar_SetValue( "cl_dlmax", FRAGMENT_MIN_SIZE ); cls.connect_time = host.realtime; @@ -2216,7 +2216,8 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename ) } else { - Con_Printf( "Downloaded %i bytes for purported %i byte file, ignoring download\n", p->nDownloadSize ); + Con_Printf( "Downloaded %i bytes for purported %i byte file, ignoring download\n", + cls.netchan.tempbuffersize, p->nDownloadSize ); } if( cls.netchan.tempbuffer ) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 4a2495ca..4d52300e 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -730,7 +730,7 @@ void CL_BatchResourceRequest( qboolean initialize ) if( !COM_IsSafeFileToDownload( p->szFileName )) { CL_RemoveFromResourceList( p ); - MsgDev( D_WARN, "Invalid file type...skipping download of %s\n", p ); + MsgDev( D_WARN, "Invalid file type...skipping download of %s\n", p->szFileName ); Mem_Free( p ); break; } @@ -1039,7 +1039,7 @@ void CL_CreateCustomizationList( void ) pResource = &cl.resourcelist[i]; if( !COM_CreateCustomization( &pPlayer->customdata, pResource, cl.playernum, 0, NULL, NULL )) - Con_Printf( "problem with client customization %i, ignoring...", pResource ); + Con_Printf( "problem with client customization %s, ignoring...", pResource->szFileName ); } } diff --git a/engine/client/cl_pmove.c b/engine/client/cl_pmove.c index fa879b87..13af30b4 100644 --- a/engine/client/cl_pmove.c +++ b/engine/client/cl_pmove.c @@ -1220,6 +1220,7 @@ void CL_PredictMovement( qboolean repredicting ) int i, stoppoint; qboolean runfuncs; double f = 1.0; + cl_entity_t *ent; double time; if( cls.state != ca_active || cls.spectator ) @@ -1349,8 +1350,7 @@ void CL_PredictMovement( qboolean repredicting ) if( FBitSet( to->client.flags, FL_ONGROUND )) { - cl_entity_t *ent = CL_GetEntityByIndex( cl.local.lastground ); - + ent = CL_GetEntityByIndex( cl.local.lastground ); cl.local.onground = cl.local.lastground; cl.local.moving = false; diff --git a/engine/client/cl_scrn.c b/engine/client/cl_scrn.c index 9a6cf9bc..cd744cb3 100644 --- a/engine/client/cl_scrn.c +++ b/engine/client/cl_scrn.c @@ -126,7 +126,7 @@ void SCR_NetSpeeds( void ) if( !host.allow_console ) return; - if( !net_speeds->value || cls.demoplayback || cls.state != ca_active ) + if( !net_speeds->value || cls.state != ca_active ) return; // prevent to get too big values at max diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index fb39b84b..0999ca78 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -311,9 +311,9 @@ void R_SetTextureParameters( void ) if( GL_Support( GL_TEXTURE_LOD_BIAS )) { if( gl_texture_lodbias->value < -glConfig.max_texture_lod_bias ) - Cvar_SetValue( "gl_mipmap_bias", -glConfig.max_texture_lod_bias ); + Cvar_SetValue( "gl_texture_lodbias", -glConfig.max_texture_lod_bias ); else if( gl_texture_lodbias->value > glConfig.max_texture_lod_bias ) - Cvar_SetValue( "gl_mipmap_bias", glConfig.max_texture_lod_bias ); + Cvar_SetValue( "gl_texture_lodbias", glConfig.max_texture_lod_bias ); } ClearBits( gl_texture_anisotropy->flags, FCVAR_CHANGED ); diff --git a/engine/client/gl_rmain.c b/engine/client/gl_rmain.c index 9d74332b..d2656ecf 100644 --- a/engine/client/gl_rmain.c +++ b/engine/client/gl_rmain.c @@ -1119,10 +1119,7 @@ void R_EndFrame( void ) R_Set2DMode( false ); if( !pwglSwapBuffers( glw_state.hDC )) - { - Con_Printf( S_ERROR "failed to swap buffers\n" ); - Host_NewInstance( va("#%s", GI->gamefolder ), "stopped" ); - } + Sys_Error( "failed to swap buffers\nCheck your video driver and as possible of reinstall it" ); } /* diff --git a/engine/client/gl_vidnt.c b/engine/client/gl_vidnt.c index e649b37d..57af78c2 100644 --- a/engine/client/gl_vidnt.c +++ b/engine/client/gl_vidnt.c @@ -361,7 +361,10 @@ static void CALLBACK GL_DebugOutput( GLuint source, GLuint type, GLuint id, GLui Con_Printf( S_OPENGL_NOTE "%s\n", message ); break; case GL_DEBUG_TYPE_OTHER_ARB: - default: Con_Printf( S_OPENGL_NOTE "%s\n", message ); + default: + if( host_developer.value < DEV_EXTENDED ) + return; + Con_Printf( S_OPENGL_NOTE "%s\n", message ); break; } } @@ -904,7 +907,7 @@ void VID_CreateFakeWindow( void ) pwglGetPixelFormatAttribiv = GL_GetProcAddress( "wglGetPixelFormatAttribivARB" ); pwglChoosePixelFormat = GL_GetProcAddress( "wglChoosePixelFormatARB" ); - // destory now it's no longer needed + // destroy now it's no longer needed VID_DestroyFakeWindow(); } diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 241c1bac..d2245637 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -328,7 +328,7 @@ void Cmd_Echo_f( void ) int i; for( i = 1; i < Cmd_Argc(); i++ ) - Con_Printf( Cmd_Argv( i )); + Con_Printf( "%s", Cmd_Argv( i )); Con_Printf( "\n" ); } diff --git a/engine/common/console.c b/engine/common/console.c index bbe2960f..02cc46d7 100644 --- a/engine/common/console.c +++ b/engine/common/console.c @@ -1940,9 +1940,9 @@ void Con_DrawDebug( void ) if( scr_download->value != -1.0f ) { - Q_snprintf( dlstring, sizeof( dlstring ), "Downloading [%d remaining]: ^2%s^7 %5.1f%%", + Q_snprintf( dlstring, sizeof( dlstring ), "Downloading [%d remaining]: ^2%s^7 %5.1f%% time %.f secs", host.downloadcount, host.downloadfile, scr_download->value, Sys_DoubleTime() - timeStart ); - x = glState.width - 400; + x = glState.width - 500; y = con.curFont->charHeight * 1.05f; Con_DrawString( x, y, dlstring, g_color_table[7] ); } diff --git a/engine/common/crtlib.c b/engine/common/crtlib.c index 46307556..feb3a3b7 100644 --- a/engine/common/crtlib.c +++ b/engine/common/crtlib.c @@ -569,8 +569,9 @@ int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list ar // to prevent crash while output __except( EXCEPTION_EXECUTE_HANDLER ) { - memset( buffer, 0, buffersize ); - result = -1; + Q_strncpy( buffer, "^1sprintf throw exception^7\n", buffersize ); +// memset( buffer, 0, buffersize ); + result = buffersize; } if( result < 0 || result >= buffersize ) diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 6c514fce..2c1811ed 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -1502,7 +1502,7 @@ static file_t *FS_SysOpen( const char *filepath, const char *mode ) opt |= O_BINARY; break; default: - MsgDev( D_ERROR, "FS_SysOpen: %s: unknown char in mode (%c)\n", filepath, mode, mode[ind] ); + MsgDev( D_ERROR, "FS_SysOpen: %s: unknown char (%c) in mode (%s)\n", filepath, mode[ind], mode ); break; } } diff --git a/engine/common/host.c b/engine/common/host.c index a31ba1c5..e1fba461 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -30,10 +30,10 @@ host_parm_t host; // host parms sysinfo_t SI; CVAR_DEFINE( host_developer, "developer", "0", 0, "engine is in development-mode" ); +CVAR_DEFINE_AUTO( sys_ticrate, "100", 0, "framerate in dedicated mode" ); convar_t *host_gameloaded; convar_t *host_clientloaded; convar_t *host_limitlocal; -convar_t host_developer; convar_t *host_maxfps; convar_t *host_framerate; convar_t *con_gamemaps; @@ -130,7 +130,7 @@ void Host_CheckSleep( void ) if( host.type == HOST_DEDICATED ) { // let the dedicated server some sleep -// Sys_Sleep( 1 ); + Sys_Sleep( 1 ); } else { @@ -393,13 +393,20 @@ double Host_CalcFPS( void ) // NOTE: we should play demos with same fps as it was recorded if( CL_IsPlaybackDemo() || CL_IsRecordDemo( )) + { fps = CL_GetDemoFramerate(); + } else if( Host_IsLocalGame( )) + { fps = host_maxfps->value; + } + else if( host.type == HOST_DEDICATED ) + { + fps = sys_ticrate.value; + } else { fps = host_maxfps->value; - if( fps == 0.0 ) fps = HOST_FPS; // default for multiplayer fps = bound( MIN_FPS, fps, MAX_FPS ); } @@ -439,8 +446,16 @@ qboolean Host_FilterTime( float time ) // limit fps to withing tolerable range fps = bound( MIN_FPS, fps, MAX_FPS ); - if(( host.realtime - oldtime ) < ( 1.0 / fps )) - return false; + if( host.type == HOST_DEDICATED ) + { + if(( host.realtime - oldtime ) < ( 1.0 / ( fps + 1.0 ))) + return false; + } + else + { + if(( host.realtime - oldtime ) < ( 1.0 / fps )) + return false; + } } host.frametime = host.realtime - oldtime; @@ -589,6 +604,7 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame ) { MEMORYSTATUS lpBuffer; char dev_level[4]; + char ticrate[16]; char progname[128]; char cmdline[128]; qboolean parse_cmdline = false; @@ -596,6 +612,7 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame ) int developer = 0; string szRootPath; char *in, *out; + double fps; lpBuffer.dwLength = sizeof( MEMORYSTATUS ); GlobalMemoryStatus( &lpBuffer ); @@ -713,6 +730,8 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame ) // member console allowing host.allow_console_init = host.allow_console; + timeBeginPeriod( 1 ); + Con_CreateConsole(); // system console used by dedicated server or show fatal errors // NOTE: this message couldn't be passed into game console but it doesn't matter @@ -731,6 +750,13 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame ) // share developer level across all dlls Q_snprintf( dev_level, sizeof( dev_level ), "%i", developer ); Cvar_DirectSet( &host_developer, dev_level ); + Cvar_RegisterVariable( &sys_ticrate ); + + if( Sys_GetParmFromCmdLine( "-sys_ticrate", ticrate )) + { + fps = bound( MIN_FPS, atof( ticrate ), MAX_FPS ); + Cvar_SetValue( "sys_ticrate", fps ); + } Con_Init(); // early console running to catch all the messages Cmd_AddCommand( "exec", Host_Exec_f, "execute a script file" ); @@ -787,7 +813,7 @@ int EXPORT Host_Main( const char *progname, int bChangeGame, pfnChangeGame func Cmd_AddCommand ( "crash", Host_Crash_f, "a way to force a bus error for development reasons"); } - host_maxfps = Cvar_Get( "fps_max", "100", FCVAR_ARCHIVE, "host fps upper limit" ); + host_maxfps = Cvar_Get( "fps_max", "72", FCVAR_ARCHIVE, "host fps upper limit" ); host_framerate = Cvar_Get( "host_framerate", "0", 0, "locks frame timing to this value in seconds" ); host_gameloaded = Cvar_Get( "host_gameloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded game.dll" ); host_clientloaded = Cvar_Get( "host_clientloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded client.dll" ); diff --git a/engine/common/hpak.c b/engine/common/hpak.c index c493d8b1..17767d38 100644 --- a/engine/common/hpak.c +++ b/engine/common/hpak.c @@ -1023,7 +1023,7 @@ void HPAK_Extract_f( void ) if( entry->disksize <= 0 || entry->disksize >= HPAK_MAX_SIZE ) { - MsgDev( D_WARN, "Unable to extract data, size invalid: %s\n", nDataSize ); + MsgDev( D_WARN, "Unable to extract data, size invalid: %s\n", Q_memprint( entry->disksize )); continue; } diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 369640c9..cc603897 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -1528,7 +1528,7 @@ static void Mod_LoadEntities( dbspmodel_t *bmod ) { if( ft1 > ft2 ) { - Con_Printf( S_WARN "Entity patch is older than bsp. Ignored.\n", entfilename ); + Con_Printf( S_WARN "Entity patch is older than bsp. Ignored.\n" ); } else if(( entpatch = FS_LoadFile( entfilename, &entpatchsize, true )) != NULL ) { diff --git a/engine/common/sys_win.c b/engine/common/sys_win.c index db5effce..b9257b38 100644 --- a/engine/common/sys_win.c +++ b/engine/common/sys_win.c @@ -114,7 +114,7 @@ freeze application for some time */ void Sys_Sleep( int msec ) { - msec = bound( 1, msec, 1000 ); + msec = bound( 0, msec, 1000 ); Sleep( msec ); } diff --git a/engine/common/zone.c b/engine/common/zone.c index 08e79309..6ae18b4f 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -164,11 +164,16 @@ static const char *Mem_CheckFilename( const char *filename ) const char *out = filename; int i; - if( !out ) return dummy; + if( !COM_CheckString( out )) + return dummy; + for( i = 0; i < 128; i++, out++ ) - if( out == '\0' ) break; // valid name - if( i == 128 ) return dummy; - return filename; + { + if( *out == '\0' ) + return filename; // valid name + } + + return dummy; } static void Mem_FreeBlock( memheader_t *mem, const char *filename, int fileline ) diff --git a/engine/menu_int.h b/engine/menu_int.h index f977b135..7688a71c 100644 --- a/engine/menu_int.h +++ b/engine/menu_int.h @@ -162,6 +162,8 @@ typedef struct ui_enginefuncs_s int (*pfnCompareFileTime)( char *filename1, char *filename2, int *iCompare ); const char *(*pfnGetModeString)( int vid_mode ); + int (*COM_SaveFile)( const char *filename, const void *data, long len ); + int (*COM_RemoveFile)( const char *filepath ); } ui_enginefuncs_t; typedef struct diff --git a/engine/server/sv_cmds.c b/engine/server/sv_cmds.c index 58b91196..fdc068d2 100644 --- a/engine/server/sv_cmds.c +++ b/engine/server/sv_cmds.c @@ -72,8 +72,11 @@ void SV_BroadcastPrintf( sv_client_t *ignore, char *fmt, ... ) } } - // echo to console - Con_DPrintf( string ); + if( host.type == HOST_DEDICATED ) + { + // echo to console + Con_DPrintf( string ); + } } /* diff --git a/engine/server/sv_frame.c b/engine/server/sv_frame.c index efbcd48a..2ab0dd17 100644 --- a/engine/server/sv_frame.c +++ b/engine/server/sv_frame.c @@ -60,8 +60,8 @@ static void SV_AddEntitiesToPacket( edict_t *pViewEnt, edict_t *pClient, client_ byte *clientpvs; byte *clientphs; qboolean fullvis = false; - sv_client_t *netclient; sv_client_t *cl = NULL; + qboolean player; entity_state_t *state; int e; @@ -101,15 +101,29 @@ static void SV_AddEntitiesToPacket( edict_t *pViewEnt, edict_t *pClient, client_ if( CHECKVISBIT( ents->sended, e )) continue; + if( e >= 1 && e <= svs.maxclients ) + player = 1; + else player = 0; + + if( player ) + { + sv_client_t *cl = &svs.clients[e - 1]; + + if( cl->state != cs_spawned ) + continue; + + if( FBitSet( cl->flags, FCL_HLTV_PROXY )) + continue; + } + if( FBitSet( ent->v.effects, EF_REQUEST_PHS )) pset = clientphs; else pset = clientpvs; state = &ents->entities[ents->num_entities]; - netclient = SV_ClientFromEdict( ent, true ); // add entity to the net packet - if( svgame.dllFuncs.pfnAddToFullPack( state, e, ent, pClient, sv.hostflags, ( netclient != NULL ), pset )) + if( svgame.dllFuncs.pfnAddToFullPack( state, e, ent, pClient, sv.hostflags, player, pset )) { // to prevent adds it twice through portals SETVISBIT( ents->sended, e ); @@ -807,7 +821,7 @@ void SV_SendClientMessages( void ) { cl = sv.current_client; - if( !cl->state || FBitSet( cl->flags, FCL_FAKECLIENT )) + if( cl->state <= cs_zombie || FBitSet( cl->flags, FCL_FAKECLIENT )) continue; if( FBitSet( cl->flags, FCL_SKIP_NET_MESSAGE )) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 4f64ac8e..4430bd45 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -874,6 +874,10 @@ void SV_InitEdict( edict_t *pEdict ) SV_FreePrivateData( pEdict ); memset( &pEdict->v, 0, sizeof( entvars_t )); pEdict->v.pContainingEntity = pEdict; + pEdict->v.controller[0] = 0x7F; + pEdict->v.controller[1] = 0x7F; + pEdict->v.controller[2] = 0x7F; + pEdict->v.controller[3] = 0x7F; pEdict->free = false; } diff --git a/game_launch/game.cpp b/game_launch/game.cpp index cef6ad43..bc1881ba 100644 --- a/game_launch/game.cpp +++ b/game_launch/game.cpp @@ -19,8 +19,8 @@ GNU General Public License for more details. #ifdef WIN32 // enable NVIDIA High Performance Graphics while using Integrated Graphics. -__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 1; +extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 1; #endif typedef void (*pfnChangeGame)( const char *progname ); diff --git a/release.bat b/release.bat index dab7e7c4..dae2d16c 100644 --- a/release.bat +++ b/release.bat @@ -14,9 +14,6 @@ if errorlevel 1 set BUILD_ERROR=1 %MSDEV% mainui/mainui.dsp %CONFIG%"mainui - Win32 Release" %build_target% if errorlevel 1 set BUILD_ERROR=1 -%MSDEV% utils/vgui/lib/vgui.dsp %CONFIG%"vgui - Win32 Release" %build_target% -if errorlevel 1 set BUILD_ERROR=1 - if "%BUILD_ERROR%"=="" goto build_ok echo ********************* @@ -38,7 +35,6 @@ goto done rem //delete log files if exist engine\engine.plg del /f /q engine\engine.plg if exist mainui\mainui.plg del /f /q mainui\mainui.plg -if exist utils\vgui\lib\vgui.plg del /f /q utils\vgui\lib\vgui.plg echo echo Build succeeded! diff --git a/utils/vgui/lib/App.cpp b/utils/vgui/lib/App.cpp deleted file mode 100644 index a233701f..00000000 --- a/utils/vgui/lib/App.cpp +++ /dev/null @@ -1,693 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -static char *staticKeyTrans[KEY_LAST]; -App *App::_instance=null; - -App::App() -{ - init(); -} - -App::App(bool externalMain) -{ - init(); - _externalMain=externalMain; -} - -void App::init() -{ - _instance=this; - _externalMain=false; - _running=false; - _keyFocus=null; - _oldMouseFocus=null; - _mouseFocus=null; - _mouseCapture=null; - _wantedKeyFocus=null; - _scheme=new Scheme(); - _buildMode=false; - _wantedBuildMode=false; - _mouseArenaPanel=null; - _cursorOveride=null; - _nextTickMillis=getTimeMillis(); - _minimumTickMillisInterval=50; - - int i; - for(i=0;isetWindowedMode(); - } -} - -void App::stop() -{ - _running=false; -} - -void App::surfaceBaseCreated(SurfaceBase* surfaceBase) -{ - _surfaceBaseDar.putElement(surfaceBase); -} - -void App::surfaceBaseDeleted(SurfaceBase* surfaceBase) -{ - _surfaceBaseDar.removeElement(surfaceBase); - _mouseFocus=null; - _mouseCapture=null; - _keyFocus=null; -} - -void App::updateMouseFocus(int x,int y,SurfaceBase* surfaceBase) -{ - if(_mouseCapture!=null) - { - setMouseFocus(_mouseCapture); - return; - } - - if(surfaceBase->isWithin(x,y)) - { - Panel* focus=surfaceBase->getPanel()->isWithinTraverse(x,y); - - if(focus!=null) - { - setMouseFocus(focus); - } - } -} - -void App::internalCursorMoved(int x,int y,SurfaceBase* surfaceBase) -{ - surfaceBase->getPanel()->localToScreen(x,y); - - if(!_buildMode) - { - //cursor has moved, so make sure the mouseFocus is current - updateMouseFocus(x,y,surfaceBase); - - //UpdateMouseFocus would have set _mouseFocus current, so tell the panel with the mouseFocus the mouse has moved - if(_mouseFocus!=null) - { - _mouseFocus->internalCursorMoved(x,y); - } - } -} - -void App::internalMousePressed(MouseCode code,SurfaceBase* surfaceBzase) -{ - //set mouse state - _mousePressed[code]=1; - _mouseDown[code]=1; - - if(!_buildMode) - { - if(_mouseFocus!=null) - { - _mouseFocus->internalMousePressed(code); - } - } -} - -void App::internalMouseDoublePressed(MouseCode code,SurfaceBase* surfaceBase) -{ - //set mouse state - _mouseDoublePressed[code]=1; - - if(!_buildMode) - { - if(_mouseFocus!=null) - { - _mouseFocus->internalMouseDoublePressed(code); - } - } -} - -void App::internalMouseReleased(MouseCode code,SurfaceBase* surfaceBase) -{ - //set mouse state - _mouseReleased[code]=1; - _mouseDown[code]=0; - - if(!_buildMode) - { - if(_mouseFocus!=null) - { - _mouseFocus->internalMouseReleased(code); - } - } -} - -void App::internalMouseWheeled(int delta,SurfaceBase* surfaceBase) -{ - if(!_buildMode) - { - if(_keyFocus!=null) - { - _keyFocus->internalMouseWheeled(delta); - } - } -} - -void App::internalKeyPressed(KeyCode code,SurfaceBase* surfaceBase) -{ - if((code < 0)||(code >= KEY_LAST)) - { - return; - } - - //set key state - _keyPressed[code]=1; - _keyDown[code]=1; - - if(!_buildMode) - { - if(_keyFocus!=null) - { - _keyFocus->internalKeyPressed(code); - } - } -} - -void App::internalKeyTyped(KeyCode code,SurfaceBase* surfaceBase) -{ - if((code < 0)||(code >= KEY_LAST)) - { - return; - } - - //set key state - _keyTyped[code]=1; - - if(!_buildMode) - { - if(_keyFocus!=null) - { - _keyFocus->internalKeyTyped(code); - } - } -} - -void App::internalKeyReleased(KeyCode code,SurfaceBase* surfaceBase) -{ - if((code < 0)||(code >= KEY_LAST)) - { - return; - } - - //set key state - _keyReleased[code]=1; - _keyDown[code]=0; - - if(!_buildMode) - { - if(_keyFocus!=null) - { - _keyFocus->internalKeyReleased(code); - } - } -} - -bool App::wasMousePressed(MouseCode code,Panel* panel) -{ - return _mousePressed[code]; -} - -bool App::wasMouseDoublePressed(MouseCode code,Panel* panel) -{ - return _mouseDoublePressed[code]; -} - -bool App::isMouseDown(MouseCode code,Panel* panel) -{ - return _mouseDown[code]; -} - -bool App::wasMouseReleased(MouseCode code,Panel* panel) -{ - return _mouseReleased[code]; -} - -bool App::wasKeyPressed(KeyCode code,Panel* panel) -{ - if((panel!=null)&&(panel!=_keyFocus)) - { - return false; - } - - return _keyPressed[code]; -} - -bool App::isKeyDown(KeyCode code,Panel* panel) -{ - if((panel!=null)&&(panel!=_keyFocus)) - { - return false; - } - - return _keyDown[code]; -} - -bool App::wasKeyTyped(KeyCode code,Panel* panel) -{ - if((panel!=null)&&(panel!=_keyFocus)) - { - return false; - } - - return _keyTyped[code]; -} - -bool App::wasKeyReleased(KeyCode code,Panel* panel) -{ - if((panel!=null)&&(panel!=_keyFocus)) - { - return false; - } - - return _keyReleased[code]; -} - -void App::addTickSignal(TickSignal* s) -{ - _tickSignalDar.putElement(s); -} - -void App::internalTick() -{ - int i; - - if(getTimeMillis()<_nextTickMillis) - { - return; - } - platTick(); - - int cursorX,cursorY; - getCursorPos(cursorX,cursorY); - - bool mouseOverAnySurface=false; - for(i=0;i<_surfaceBaseDar.getCount();i++) - { - updateMouseFocus(cursorX,cursorY,_surfaceBaseDar[i]); - - if(_surfaceBaseDar[i]->isWithin(cursorX,cursorY)) - { - mouseOverAnySurface=true; - } - - _surfaceBaseDar[i]->setEmulatedCursorPos(cursorX,cursorY); - } - if(!mouseOverAnySurface) - { - setMouseFocus(null); - } - - if(_mouseFocus!=null) - { - _mouseFocus->internalSetCursor(); - } - - for(i=0;i<_tickSignalDar.getCount();i++) - { - _tickSignalDar[i]->ticked(); - } - - if(_keyFocus!=null) - { - _keyFocus->internalKeyFocusTicked(); - } - - //clear mouse and key states - for(i=0;ihasFocus()) - { - break; - } - } - if(i==_surfaceBaseDar.getCount()) - { - _wantedKeyFocus=null; - } - - if(_keyFocus!=_wantedKeyFocus) - { - if(_keyFocus!=null) - { - _keyFocus->internalFocusChanged(true); - _keyFocus->repaint(); - } - if(_wantedKeyFocus!=null) - { - _wantedKeyFocus->internalFocusChanged(false); - _wantedKeyFocus->repaint(); - } - } - - _keyFocus=_wantedKeyFocus; - _buildMode=_wantedBuildMode; - - for(i=0;i<_surfaceBaseDar.getCount();i++) - { - _surfaceBaseDar[i]->getPanel()->solveTraverse(); - _surfaceBaseDar[i]->applyChanges(); - } - - if(_mouseArenaPanel!=null) - { - SurfaceBase* sur=_mouseArenaPanel->getSurfaceBase(); - if(sur!=null) - { - int x,y,extents[4]; - sur->getPanel()->getPos(x,y); - _mouseArenaPanel->getAbsExtents(extents[0],extents[1],extents[2],extents[3]); - internalSetMouseArena(x+extents[0],y+extents[1],x+extents[2],y+extents[3],true); - } - } - - _nextTickMillis=getTimeMillis()+_minimumTickMillisInterval; -} - -void App::setMouseCapture(Panel* panel) -{ - if(panel==null) - { - if(_mouseCapture!=null) - { - _mouseCapture->_surfaceBase->enableMouseCapture(false); - } - } - else - { - panel->_surfaceBase->enableMouseCapture(true); - } - - _mouseCapture = panel; -} - -void App::requestFocus(Panel* panel) -{ - _wantedKeyFocus=panel; -} - -Panel* App::getFocus() -{ - return _keyFocus; -} - -void App::repaintAll() -{ - for(int i=0;i<_surfaceBaseDar.getCount();i++) - { - _surfaceBaseDar[i]->getPanel()->repaintAll(); - _surfaceBaseDar[i]->invalidate(_surfaceBaseDar[i]->getPanel()); - } -} - -void App::setScheme(Scheme* scheme) -{ - if(scheme!=null) - { - _scheme=scheme; - repaintAll(); - } -} - -Scheme* App::getScheme() -{ - return _scheme; -} - -void App::enableBuildMode() -{ - _wantedBuildMode=true; -} - -char App::getKeyCodeChar(KeyCode code,bool shifted) -{ - if(shifted) - { - return staticKeyTrans[code][1]; - } - else - { - return staticKeyTrans[code][0]; - } -} - -void App::getKeyCodeText(KeyCode code,char* buf,int buflen) -{ - if (!buf) - return; - - // copy text into buf up to buflen in length - // skip 2 in staticKeyTrans because the first two are for getKeyCodeChar - for (int i = 0; i < buflen; i++) - { - char ch = staticKeyTrans[code][i+2]; - buf[i] = ch; - if (ch == 0) - break; - } -} - -void App::reset() -{ - _keyFocus=null; - _mouseFocus=null; - _mouseCapture=null; - _wantedKeyFocus=null; - _buildMode=false; - _wantedBuildMode=false; - _mouseArenaPanel=null; - _tickSignalDar.removeAll(); - Font_Reset(); - setScheme(new Scheme()); -} - -void App::setMouseArena(Panel* panel) -{ - _mouseArenaPanel=panel; -} - -void App::setMouseArena(int x0,int y0,int x1,int y1,bool enabled) -{ - setMouseArena(false); - internalSetMouseArena(x0,y0,x1,y1,enabled); -} - -void App::setCursorOveride(Cursor* cursor) -{ - _cursorOveride=cursor; -} - -Cursor* App::getCursorOveride() -{ - return _cursorOveride; -} - -void App::setMinimumTickMillisInterval(int interval) -{ - _minimumTickMillisInterval=interval; -} - -void App::setMouseFocus(Panel* newMouseFocus) -{ - if(_mouseFocus!=newMouseFocus) - { - _oldMouseFocus=_mouseFocus; - _mouseFocus=newMouseFocus; - - if(_oldMouseFocus!=null) - { - _oldMouseFocus->internalCursorExited(); - } - - if(_mouseFocus!=null) - { - _mouseFocus->internalCursorEntered(); - } - } -} diff --git a/utils/vgui/lib/Bitmap.cpp b/utils/vgui/lib/Bitmap.cpp deleted file mode 100644 index 0190e773..00000000 --- a/utils/vgui/lib/Bitmap.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -Bitmap::Bitmap() : Image() -{ - _rgba=null; - _id=0; - _uploaded=false; -} - -void Bitmap::setSize(int wide,int tall) -{ - Image::setSize(wide,tall); - - if(_rgba!=null) - { - delete[] _rgba; - } - - _rgba=new uchar[wide*tall*4]; -} - -void Bitmap::setRGBA(int x,int y,uchar r,uchar g,uchar b,uchar a) -{ - if(_rgba==null) - { - return; - } - - int wide,tall; - getSize(wide,tall); - - if ((x>=0)&&(x=0)&&(ygetSurfaceBase()==null) - { - return; - } - - _id=panel->getSurfaceBase()->createNewTextureID(); - } - - if(!_uploaded) - { - drawSetTextureRGBA(_id,(const char*)_rgba,wide,tall); - _uploaded=true; - } - - Color color; - getColor(color); - - int r,g,b,a; - color.getColor(r,g,b,a); - drawSetTexture(_id); - drawSetColor(r,g,b,a); - - int x,y; - getPos(x,y); - drawTexturedRect(x,y,x+wide,y+tall); -} diff --git a/utils/vgui/lib/BitmapTGA.cpp b/utils/vgui/lib/BitmapTGA.cpp deleted file mode 100644 index cdecd19e..00000000 --- a/utils/vgui/lib/BitmapTGA.cpp +++ /dev/null @@ -1,334 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -BitmapTGA::BitmapTGA(InputStream* is,bool invertAlpha) : Bitmap() -{ - loadTGA(is,invertAlpha); -} - -bool BitmapTGA::loadTGA(InputStream* is,bool invertAlpha) -{ - if(is==null) - { - return false; - } - - DataInputStream dis(is); - - bool success=false; - - uchar id_length=dis.readUChar(success); - if(!success) - { - return false; - } - - uchar colormap_type=dis.readUChar(success); - if(!success) - { - return false; - } - - uchar image_type=dis.readUChar(success); - if(!success) - { - return false; - } - - ushort colormap_index=dis.readUShort(success); - if(!success) - { - return false; - } - - ushort colormap_length=dis.readUShort(success); - if(!success) - { - return false; - } - - uchar colormap_size=dis.readUChar(success); - if(!success) - { - return false; - } - - ushort x_origin=dis.readUShort(success); - if(!success) - { - return false; - } - - ushort y_origin=dis.readUShort(success); - if(!success) - { - return false; - } - - int wide=dis.readUShort(success); - if(!success) - { - return false; - } - - int tall=dis.readUShort(success); - if(!success) - { - return false; - } - - uchar pixel_size=dis.readUChar(success); - if(!success) - { - return false; - } - - uchar attributes=dis.readUChar(success); - if(!success) - { - return false; - } - - if (image_type!=2 - && image_type!=10) - { - return false; - } - - if (colormap_type !=0 - || (pixel_size!=32 && pixel_size!=24)) - { - return false; - } - - setSize(wide,tall); - - if(_rgba==null) - { - return false; - } - - if (id_length != 0) - dis.seekRelative(id_length,success); // skip TARGA image comment - - int column, row; - uchar* ptr; - if (image_type==2) { // Uncompressed, RGB images - for(row=tall-1; row>=0; row--) { - ptr = _rgba + row*wide*4; - for(column=0; column=0; row--) { - ptr = _rgba + row*wide*4; - for(column=0; column0) - row--; - else - goto breakOut; - ptr = _rgba + row*wide*4; - } - } - } - else { // non run-length packet - for(j=0;j0) - row--; - else - goto breakOut; - ptr = _rgba + row*wide*4; - } - } - } - } - breakOut:; - } - } - - return true; -} diff --git a/utils/vgui/lib/Border.cpp b/utils/vgui/lib/Border.cpp deleted file mode 100644 index 37bb7b37..00000000 --- a/utils/vgui/lib/Border.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -Border::Border() : Image() -{ - _inset[0]=0; - _inset[1]=0; - _inset[2]=0; - _inset[3]=0; - _panel=null; -} - -Border::Border(int left,int top,int right,int bottom) : Image() -{ - _inset[0]=0; - _inset[1]=0; - _inset[2]=0; - _inset[3]=0; - _panel=null; - setInset(left,top,right,bottom); -} - -void Border::setInset(int left,int top,int right,int bottom) -{ - _inset[0]=left; - _inset[1]=top; - _inset[2]=right; - _inset[3]=bottom; -} - -void Border::getInset(int& left,int& top,int& right,int& bottom) -{ - left=_inset[0]; - top=_inset[1]; - right=_inset[2]; - bottom=_inset[3]; -} - -void Border::drawFilledRect(int x0,int y0,int x1,int y1) -{ - Image::drawFilledRect(x0-_inset[0],y0-_inset[1],x1-_inset[0],y1-_inset[1]); -} - -void Border::drawOutlinedRect(int x0,int y0,int x1,int y1) -{ - Image::drawOutlinedRect(x0-_inset[0],y0-_inset[1],x1-_inset[0],y1-_inset[1]); -} - -void Border::drawSetTextPos(int x,int y) -{ - Image::drawSetTextPos(x-_inset[0],y-_inset[1]); -} - -void Border::drawPrintText(int x,int y,const char* str,int strlen) -{ - Image::drawPrintText(x-_inset[0],y-_inset[1],str,strlen); -} - -void Border::drawPrintChar(int x,int y,char ch) -{ - Image::drawPrintChar(x-_inset[0],y-_inset[1],ch); -} diff --git a/utils/vgui/lib/BorderLayout.cpp b/utils/vgui/lib/BorderLayout.cpp deleted file mode 100644 index 0e5f4455..00000000 --- a/utils/vgui/lib/BorderLayout.cpp +++ /dev/null @@ -1,137 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -class BorderLayoutInfo : public LayoutInfo -{ -public: - BorderLayout::Alignment _alignment; -public: - BorderLayoutInfo(BorderLayout::Alignment alignment) - { - _alignment=alignment; - } - virtual LayoutInfo* getThis() - { - return this; - } -}; - -BorderLayout::BorderLayout(int inset) : Layout() -{ - _inset=inset; -} - -LayoutInfo* BorderLayout::createLayoutInfo(Alignment alignment) -{ - return new BorderLayoutInfo(alignment); -} - -void BorderLayout::performLayout(Panel* panel) -{ - int wide,tall; - panel->getSize(wide,tall); - - int maxNorth=0; - int maxSouth=0; - int maxEast=0; - int maxWest=0; - - int i; - - for(i=0;igetChildCount();i++) - { - BorderLayoutInfo* info=dynamic_cast(panel->getChild(i)->getLayoutInfo()); - if(info!=null) - { - Panel* child=panel->getChild(i); - - switch(info->_alignment) - { - case a_north: - { - if(child->getTall()>maxNorth) - { - maxNorth=child->getTall(); - } - break; - } - case a_south: - { - if(child->getTall()>maxSouth) - { - maxSouth=child->getTall(); - } - break; - } - case a_west: - { - if(child->getWide()>maxWest) - { - maxWest=child->getWide(); - } - break; - } - case a_east: - { - if(child->getTall()>maxEast) // getWide? - { - maxEast=child->getWide(); - } - break; - } - } - } - } - - int x0=_inset+maxWest; - int y0=_inset+maxNorth; - int x1=wide-_inset-maxEast; - int y1=tall-_inset-maxSouth; - - for(i=0;igetChildCount();i++) - { - BorderLayoutInfo* info=dynamic_cast(panel->getChild(i)->getLayoutInfo());if(info==null){continue;} - Alignment alignment=info->_alignment; - - Panel* child=panel->getChild(i); - - switch(alignment) - { - case a_north: - { - child->setBounds(0,0,wide,y0); - break; - } - case a_south: - { - child->setBounds(0,y1,wide,tall-y1); - break; - } - case a_west: - { - child->setBounds(0,y0,x0,y1-y0); - break; - } - case a_east: - { - child->setBounds(x1,y0,wide-x1,y1-y0); - break; - } - case a_center: - { - child->setBounds(x0,y0,x1-x0,y1-y0); - break; - } - } - } -} diff --git a/utils/vgui/lib/BorderPair.cpp b/utils/vgui/lib/BorderPair.cpp deleted file mode 100644 index e1ad7158..00000000 --- a/utils/vgui/lib/BorderPair.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -BorderPair::BorderPair(Border* border0,Border* border1) -{ - _border[0]=border0; - _border[1]=border1; -} - -void BorderPair::doPaint(Panel* panel) -{ - if(_border[0]!=null) - { - _border[0]->doPaint(panel); - } - - if(_border[1]!=null) - { - _border[1]->doPaint(panel); - } -} - -void BorderPair::paint(Panel* panel) -{ - if(_border[0]!=null) - { - _border[0]->paint(panel); - } - - if(_border[1]!=null) - { - _border[1]->paint(panel); - } -} diff --git a/utils/vgui/lib/BuildGroup.cpp b/utils/vgui/lib/BuildGroup.cpp deleted file mode 100644 index d4f244c9..00000000 --- a/utils/vgui/lib/BuildGroup.cpp +++ /dev/null @@ -1,287 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -BuildGroup::BuildGroup() -{ - _enabled=false; - _snapX=4; - _snapY=4; - _cursor_sizenwse=new Cursor(Cursor::dc_sizenwse); - _cursor_sizenesw=new Cursor(Cursor::dc_sizenesw); - _cursor_sizewe=new Cursor(Cursor::dc_sizewe); - _cursor_sizens=new Cursor(Cursor::dc_sizens); - _cursor_sizeall=new Cursor(Cursor::dc_sizeall); - _currentPanel=null; - _dragging=false; -} - -void BuildGroup::setEnabled(bool state) -{ - if(_enabled!=state) - { - if(_currentPanel!=null) - { - _currentPanel=null; - fireCurrentPanelChangeSignal(); - } - - _currentPanel=null; - } - - _enabled=state; -} - -bool BuildGroup::isEnabled() -{ - return _enabled; -} - -void BuildGroup::cursorMoved(int x,int y,Panel* panel) -{ - assert(panel); - - if(_dragging) - { - panel->getApp()->getCursorPos(x,y); - - if(_dragMouseCode==MOUSE_RIGHT) - { - panel->setSize(x-_dragStartCursorPos[0],y-_dragStartCursorPos[1]); - applySnap(panel); - } - else - { - panel->setSize(_dragStartPanelPos[0]+(x-_dragStartCursorPos[0]),_dragStartPanelPos[1]+(y-_dragStartCursorPos[1])); - applySnap(panel); - } - - panel->repaintParent(); - } -} - -void BuildGroup::mousePressed(MouseCode code,Panel* panel) -{ - assert(panel); - - if(code==MOUSE_RIGHT) - { - int lx,ly; - panel->getApp()->getCursorPos(lx,ly); - panel->screenToLocal(lx,ly); - - Panel *newPanel=new Label("Label",lx,ly,0,0); - newPanel->setBorder(new LineBorder()); - newPanel->setParent(panel); - newPanel->setBuildGroup(this, "Label"); - panel=newPanel; - } - - _dragging=true; - _dragMouseCode=code; - panel->requestFocus(); - - int x,y; - panel->getApp()->getCursorPos(x,y); - _dragStartCursorPos[0]=x; - _dragStartCursorPos[1]=y; - - panel->getPos(x,y); - _dragStartPanelPos[0]=x; - _dragStartPanelPos[1]=y; - - panel->getApp()->setMouseCapture(panel); - - if(_currentPanel!=panel) - { - _currentPanel=panel; - fireCurrentPanelChangeSignal(); - } -} - -void BuildGroup::mouseReleased(MouseCode code,Panel* panel) -{ - assert(panel); - - _dragging=false; - panel->getApp()->setMouseCapture(null); -} - -void BuildGroup::mouseDoublePressed(MouseCode code,Panel* panel) -{ - assert(panel); -} - -void BuildGroup::keyTyped(KeyCode code,Panel* panel) -{ - assert(panel); - - int dx=0; - int dy=0; - - bool shift=(panel->isKeyDown(KEY_LSHIFT)||panel->isKeyDown(KEY_RSHIFT)); - bool ctrl=(panel->isKeyDown(KEY_LCONTROL)||panel->isKeyDown(KEY_RCONTROL)); - - switch(code) - { - case KEY_LEFT: - { - dx-=_snapX; - break; - } - case KEY_RIGHT: - { - dx+=_snapX; - break; - } - case KEY_UP: - { - dy-=_snapY; - break; - } - case KEY_DOWN: - { - dy+=_snapY; - break; - } - case KEY_C: - { - if(ctrl) - { - copyPropertiesToClipboard(); - } - break; - } - } - - if(dx||dy) - { - //TODO: make this stuff actually snap - - int x,y,wide,tall; - - panel->getBounds(x,y,wide,tall); - - if(shift) - { - panel->setSize(wide+dx,tall+dy); - } - else - { - panel->setPos(x+dx,y+dy); - } - - applySnap(panel); - - panel->repaint(); - if(panel->getParent()!=null) - { - panel->getParent()->repaint(); - } - } -} - -Cursor* BuildGroup::getCursor(Panel* panel) -{ - assert(panel); - - int x,y,wide,tall; - panel->getApp()->getCursorPos(x,y); - panel->screenToLocal(x,y); - panel->getSize(wide,tall); - - if(x < 2) - { - if(y < 4) - { - return _cursor_sizenwse; - } - else - if(y<(tall-4)) - { - return _cursor_sizewe; - } - else - { - return _cursor_sizenesw; - } - } - - return _cursor_sizeall; -} - -void BuildGroup::applySnap(Panel* panel) -{ - assert(panel); - - int x,y,wide,tall; - panel->getBounds(x,y,wide,tall); - - x=(x/_snapX)*_snapX; - y=(y/_snapY)*_snapY; - panel->setPos(x,y); - - int xx,yy; - xx=x+wide; - yy=y+tall; - - xx=(xx/_snapX)*_snapX; - yy=(yy/_snapY)*_snapY; - panel->setSize(xx-x,yy-y); -} - -void BuildGroup::addCurrentPanelChangeSignal(ChangeSignal* s) -{ - _currentPanelChangeSignalDar.putElement(s); -} - -void BuildGroup::fireCurrentPanelChangeSignal() -{ - for(int i=0;i<_currentPanelChangeSignalDar.getCount();i++) - { - _currentPanelChangeSignalDar[i]->valueChanged(null); - } -} - -Panel* BuildGroup::getCurrentPanel() -{ - return _currentPanel; -} - -void BuildGroup::panelAdded(Panel* panel,const char* panelName) -{ - assert(panel); - - _panelDar.addElement(panel); - _panelNameDar.addElement(vgui_strdup(panelName)); -} - -void BuildGroup::copyPropertiesToClipboard() -{ - char text[32768]; - text[0]=0; - - for(int i=0;i<_panelDar.getCount();i++) - { - char buf[512]; - _panelDar[i]->getPersistanceText(buf,sizeof(buf)); - strcat(text,_panelNameDar[i]); - strcat(text,buf); - } - - App::getInstance()->setClipboardText(text,strlen(text)); - - vgui_printf("Copied to clipboard\n"); -} diff --git a/utils/vgui/lib/Button.cpp b/utils/vgui/lib/Button.cpp deleted file mode 100644 index 735c837e..00000000 --- a/utils/vgui/lib/Button.cpp +++ /dev/null @@ -1,273 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultButtonController : public ButtonController, public InputSignal -{ -public: - FooDefaultButtonController(Button* button) - { - _button=button; - } -public: - virtual void addSignals(Button* button) - { - button->addInputSignal(this); - } - virtual void removeSignals(Button* button) - { - button->removeInputSignal(this); - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - if(_button->isEnabled()) - { - if(_button->isMouseClickEnabled(code)) - { - _button->setSelected(true); - _button->repaint(); - } - } - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - if(_button->isEnabled()) - { - if(_button->isMouseClickEnabled(code)) - { - _button->setSelected(false); - _button->fireActionSignal(); - _button->repaint(); - } - } - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } -protected: - Button* _button; -}; -} - -void Button::init() -{ - _armed=false; - _selected=false; - _buttonBorderEnabled=true; - _mouseClickMask=0; - _buttonController=null; - _buttonGroup=null; - setMouseClickEnabled(MOUSE_LEFT,true); - setButtonController(new FooDefaultButtonController(this)); -} - -Button::Button(const char* text,int x,int y,int wide,int tall) : Label(text,x,y,wide,tall) -{ - init(); -} - -Button::Button(const char* text,int x,int y) : Label(text,x,y) -{ - init(); -} - -void Button::setButtonBorderEnabled(bool state) -{ - _buttonBorderEnabled=state; - repaint(); -} - -void Button::setSelected(bool state) -{ - if(_buttonGroup!=null) - { - _buttonGroup->setSelected(this); - return; - } - - setSelectedDirect(state); -} - -void Button::setSelectedDirect(bool state) -{ - _selected=state; - repaint(); -} - -void Button::setArmed(bool state) -{ - _armed=state; - repaint(); -} - -bool Button::isArmed() -{ - return _armed; -} - -void Button::doClick() -{ - setSelected(true); - fireActionSignal(); - setSelected(false); -} - -bool Button::isSelected() -{ - return _selected; -} - -void Button::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - if(isSelected()) - { - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(0,0,wide,tall); - } - else - { - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); - - if(_buttonBorderEnabled) - { - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(0,0,_size[0]-1,1); // top - drawFilledRect(2,_size[1]-2,_size[0]-1,_size[1]-1); // bottom - drawFilledRect(0,1,1,_size[1]-1); // left - drawFilledRect(_size[0]-2,2,_size[0]-1,_size[1]-2); // right - - drawSetColor(Scheme::sc_white); - drawFilledRect(1,1,_size[0]-2,2); // top - drawFilledRect(1,_size[1]-1,_size[0],_size[1]); // bottom - drawFilledRect(1,2,2,_size[1]-2); // left - drawFilledRect(_size[0]-1,1,_size[0],_size[1]-1); // right - } - } - - if(isArmed()) - { - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,wide,2); - drawFilledRect(0,2,2,tall); - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(2,tall-2,wide,tall); - drawFilledRect(wide-2,2,wide,tall-1); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(1,tall-1,wide,tall); - drawFilledRect(wide-1,1,wide,tall-1); - } -} - -void Button::setButtonGroup(ButtonGroup* buttonGroup) -{ - _buttonGroup=buttonGroup; - - if(_buttonGroup!=null) - { - _buttonGroup->addButton(this); - } -} - -void Button::setMouseClickEnabled(MouseCode code,bool state) -{ - if(state) - { - //set bit to 1 - _mouseClickMask|=1<<((int)(code+1)); - } - else - { - //set bit to 0 - _mouseClickMask&=~(1<<((int)(code+1))); - } -} - -bool Button::isMouseClickEnabled(MouseCode code) -{ - if(_mouseClickMask&(1<<((int)(code+1)))) - { - return true; - } - return false; -} - -void Button::addActionSignal(ActionSignal* s) -{ - _actionSignalDar.putElement(s); -} - -void Button::fireActionSignal() -{ - for(int i=0;i<_actionSignalDar.getCount();i++) - { - _actionSignalDar[i]->actionPerformed(this); - } -} - -void Button::setButtonController(ButtonController* buttonController) -{ - if(_buttonController!=null) - { - _buttonController->removeSignals(this); - } - - _buttonController=buttonController; - _buttonController->addSignals(this); -} - -Panel* Button::createPropertyPanel() -{ - Panel* parentPropertyPanel=Label::createPropertyPanel(); - - TreeFolder* folder=new TreeFolder("Button"); - parentPropertyPanel->addChild(folder); - folder->addChild(new Label("setSelected")); - folder->addChild(new Label("setArmed")); - - return parentPropertyPanel; -} diff --git a/utils/vgui/lib/ButtonGroup.cpp b/utils/vgui/lib/ButtonGroup.cpp deleted file mode 100644 index f49a8e64..00000000 --- a/utils/vgui/lib/ButtonGroup.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -void ButtonGroup::addButton(Button* button) -{ - _buttonDar.putElement(button); -} - -void ButtonGroup::setSelected(Button* button) -{ - for(int i=0;i<_buttonDar.getCount();i++) - { - if(_buttonDar[i]!=button) - { - _buttonDar[i]->setSelectedDirect(false); - } - } - - button->setSelectedDirect(true); -} diff --git a/utils/vgui/lib/CheckButton.cpp b/utils/vgui/lib/CheckButton.cpp deleted file mode 100644 index ccfa2631..00000000 --- a/utils/vgui/lib/CheckButton.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -namespace -{ -class FooCheckImage : public Image -{ -public: - FooCheckImage(CheckButton* checkButton) : Image() - { - _checkButton=checkButton; - setSize(20,20); - } -public: - virtual void paint() - { - drawSetTextFont(Scheme::sf_secondary1); - drawSetTextColor(Scheme::sc_white); - drawPrintChar(0,0,'g'); - drawSetTextColor(Scheme::sc_secondary2); - drawPrintChar(0,0,'c'); - drawSetTextColor(Scheme::sc_white); - drawPrintChar(0,0,'d'); - drawSetTextColor(Scheme::sc_black); - drawPrintChar(0,0,'e'); - drawSetTextColor(Scheme::sc_secondary3); - drawPrintChar(0,0,'f'); - drawSetTextColor(Scheme::sc_black); - if(_checkButton->isSelected()) - { - drawSetTextColor(Scheme::sc_black); - drawPrintChar(0,0,'a'); - } - } -protected: - CheckButton* _checkButton; -}; - -} - -CheckButton::CheckButton(const char* text,int x,int y,int wide,int tall) : ToggleButton(text,x,y,wide,tall) -{ - setTextAlignment(Label::a_east); - setImage(new FooCheckImage(this)); -} - -CheckButton::CheckButton(const char* text,int x,int y) : ToggleButton(text,x,y) -{ - setTextAlignment(Label::a_east); - setImage(new FooCheckImage(this)); - - int wide,tall; - getContentSize(wide,tall); - setSize(wide,tall); -} - -void CheckButton::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); -} diff --git a/utils/vgui/lib/Color.cpp b/utils/vgui/lib/Color.cpp deleted file mode 100644 index 310ac8d2..00000000 --- a/utils/vgui/lib/Color.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -void Color::init() -{ - _color[0]=0; - _color[1]=0; - _color[2]=0; - _color[3]=0; - _schemeColor=Scheme::sc_user; -} - -Color::Color() -{ - init(); -} - -Color::Color(int r,int g,int b,int a) -{ - init(); - setColor(r,g,b,a); -} - -Color::Color(Scheme::SchemeColor sc) -{ - init(); - setColor(sc); -} - -void Color::setColor(int r,int g,int b,int a) -{ - _color[0]=r; - _color[1]=g; - _color[2]=b; - _color[3]=a; - _schemeColor=Scheme::sc_user; -} - -void Color::setColor(Scheme::SchemeColor sc) -{ - _schemeColor=sc; -} - -void Color::getColor(int& r,int& g,int& b,int& a) -{ - if(_schemeColor==Scheme::sc_user) - { - r=_color[0]; - g=_color[1]; - b=_color[2]; - a=_color[3]; - } - else - { - App::getInstance()->getScheme()->getColor(_schemeColor,r,g,b,a); - } -} - -void Color::getColor(Scheme::SchemeColor& sc) -{ - sc=_schemeColor; -} - -int Color::operator[](int index) -{ - int co[4]; - getColor(co[0],co[1],co[2],co[3]); - return co[index]; -} diff --git a/utils/vgui/lib/ConfigWizard.cpp b/utils/vgui/lib/ConfigWizard.cpp deleted file mode 100644 index 73aac4fc..00000000 --- a/utils/vgui/lib/ConfigWizard.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -ConfigWizard::ConfigWizard(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - setBorder(new LineBorder()); - - _treeFolder=new TreeFolder("DonkeyFoo"); - _treeFolder->setParent(this); - _treeFolder->setBorder(new LoweredBorder()); - - _client=new Panel(80,30,64,64); - _client->setParent(this); - _treeFolder->setBorder(new LineBorder()); - - _okButton=new Button("Ok",80,80,60,20); - _okButton->setParent(this); - - _cancelButton=new Button("Cancel",120,80); - _cancelButton->setParent(this); - - _applyButton=new Button("Apply",160,80); - _applyButton->setParent(this); - - _helpButton=new Button("Help",200,80); - _helpButton->setParent(this); -} - -Panel* ConfigWizard::getClient() -{ - return _client; -} - -TreeFolder* ConfigWizard::getFolder() -{ - return _treeFolder; -} - -void ConfigWizard::setSize(int wide,int tall) -{ - setSize(wide,tall); - getPaintSize(wide,tall); - - _treeFolder->setBounds(10,10,160,tall-60); - _client->setBounds(180,10,wide-190,tall-60); - _helpButton->setPos(wide-80,tall-25); - _applyButton->setPos(wide-150,tall-25); - _cancelButton->setPos(wide-220,tall-25); - _okButton->setPos(wide-290,tall-25); -} diff --git a/utils/vgui/lib/Cursor.cpp b/utils/vgui/lib/Cursor.cpp deleted file mode 100644 index bcbafa1d..00000000 --- a/utils/vgui/lib/Cursor.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -Cursor::Cursor(Bitmap* bitmap,int hotspotX,int hotspotY) -{ - _dc=dc_user; - privateInit(bitmap,hotspotX,hotspotY); -} - -void Cursor::privateInit(Bitmap* bitmap,int hotspotX,int hotspotY) -{ - _hotspot[0]=hotspotX; - _hotspot[1]=hotspotY; -} - -Bitmap* Cursor::getBitmap() -{ - return _bitmap; -} - -Cursor::DefaultCursor Cursor::getDefaultCursor() -{ - return _dc; -} - -void Cursor::getHotspot(int& x,int& y) -{ - x=_hotspot[0]; - x=_hotspot[1]; -} diff --git a/utils/vgui/lib/DataInputStream.cpp b/utils/vgui/lib/DataInputStream.cpp deleted file mode 100644 index 58712461..00000000 --- a/utils/vgui/lib/DataInputStream.cpp +++ /dev/null @@ -1,235 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -DataInputStream::DataInputStream(InputStream* is) -{ - _is=is; -} - -void DataInputStream::seekStart(bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->seekStart(success); -} - -void DataInputStream::seekRelative(int count,bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->seekRelative(count,success); -} - -void DataInputStream::seekEnd(bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->seekEnd(success); -} - -int DataInputStream::getAvailable(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - return _is->getAvailable(success); -} - -void DataInputStream::readUChar(uchar* buf,int count,bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->readUChar(buf,count,success); -} - -void DataInputStream::close(bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->close(success); -} - -void DataInputStream::close() -{ - bool success; - _is->close(success); -} - -bool DataInputStream::readBool(bool& success) -{ - if(_is==null) - { - success=false; - return false; - } - - return _is->readUChar(success)!=0; -} - -char DataInputStream::readChar(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - return _is->readUChar(success); -} - -uchar DataInputStream::readUChar(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - return _is->readUChar(success); -} - -short DataInputStream::readShort(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - short ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -ushort DataInputStream::readUShort(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - ushort ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -int DataInputStream::readInt(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - int ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -uint DataInputStream::readUInt(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - uint ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -long DataInputStream::readLong(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - long ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -ulong DataInputStream::readULong(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - ulong ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -float DataInputStream::readFloat(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - float ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -double DataInputStream::readDouble(bool& success) -{ - if(_is==null) - { - success=false; - return 0; - } - - double ret; - _is->readUChar((uchar*)&ret,sizeof(ret),success); - return ret; -} - -void DataInputStream::readLine(char* buf,int bufLen,bool& success) -{ - if(_is==null) - { - success=false; - return; - } - - _is->readUChar((uchar*)buf,bufLen,success); -} diff --git a/utils/vgui/lib/Desktop.cpp b/utils/vgui/lib/Desktop.cpp deleted file mode 100644 index b5768eb5..00000000 --- a/utils/vgui/lib/Desktop.cpp +++ /dev/null @@ -1,105 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -Desktop::Desktop(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - setBgColor(0,128,128,0); - setPaintBorderEnabled(false); - setPaintBackgroundEnabled(false); - setPaintEnabled(false); - - _background=new Panel(0,0,wide,tall-36); - _background->setParent(this); - _background->setBgColor(0,128,128,0); - _foreground=new Panel(0,0,wide,tall-36); - _foreground->setPaintBorderEnabled(false); - _foreground->setPaintBackgroundEnabled(false); - _foreground->setPaintEnabled(false); - _foreground->setParent(this); - - _taskBar=new TaskBar(0,tall-36,wide,36); - _taskBar->setParent(this); - - _cascade[0]=50; - _cascade[1]=50; -} - -void Desktop::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - getPaintSize(wide,tall); - - _background->setBounds(0,0,wide,tall-36); - _foreground->setBounds(0,0,wide,tall-36); - _taskBar->setBounds(0,tall-36,wide,36); -} - -Panel* Desktop::getBackground() -{ - return _background; -} - -Panel* Desktop::getForeground() -{ - return _foreground; -} - -void Desktop::addIcon(DesktopIcon* icon) -{ - icon->setDesktop(this); - icon->setParent(_foreground); - icon->setPos(10,10); - _desktopIconDar.addElement(icon); -} - -void Desktop::iconActivated(DesktopIcon* icon) -{ - MiniApp* miniApp=icon->getMiniApp(); - Frame* frame=miniApp->createInstance(); - - if(frame!=null) - { - frame->setPos(_cascade[0],_cascade[1]); - frame->setParent(_foreground); - _taskBar->addFrame(frame); - frame->requestFocus(); - - _cascade[0]+=25; - _cascade[1]+=50; - - if(_cascade[1]>400) - { - _cascade[0]=50; - _cascade[1]=50; - } - } -} - -void Desktop::arrangeIcons() -{ - int x=15; - int y=10; - for(int i=0;i<_desktopIconDar.getCount();i++) - { - _desktopIconDar[i]->setPos(x,y); - y+=60; - - if(y>340) - { - x+=50; - y=10; - } - } -} diff --git a/utils/vgui/lib/DesktopIcon.cpp b/utils/vgui/lib/DesktopIcon.cpp deleted file mode 100644 index 095ae6a3..00000000 --- a/utils/vgui/lib/DesktopIcon.cpp +++ /dev/null @@ -1,165 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooHandler : public InputSignal -{ -public: - FooHandler(DesktopIcon* desktopIcon) - { - _desktopIcon=desktopIcon; - _dragging=false; - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - if(_dragging) - { - panel->getApp()->getCursorPos(x,y); - _desktopIcon->setPos(x+_dragOrgPos[0]-_dragStart[0],y+_dragOrgPos[1]-_dragStart[1]); - - if(_desktopIcon->getParent()!=null) - { - _desktopIcon->getParent()->repaint(); - } - } - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - int x,y; - panel->getApp()->getCursorPos(x,y); - _dragging=true; - _dragStart[0]=x; - _dragStart[1]=y; - _desktopIcon->getPos(_dragOrgPos[0],_dragOrgPos[1]); - - panel->getApp()->setMouseCapture(panel); - _desktopIcon->requestFocus(); - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - _desktopIcon->doActivate(); - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - _dragging=false; - panel->getApp()->setMouseCapture(null); - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } -protected: - DesktopIcon* _desktopIcon; - bool _dragging; - int _dragOrgPos[2]; - int _dragStart[2]; -}; -} - -DesktopIcon::DesktopIcon(MiniApp* miniApp,Image* image) : Panel(0,0,32,50) -{ - _desktop=null; - _miniApp=miniApp; - setImage(image); - - if(image!=null) - { - int wide,tall; - image->getSize(wide,tall); - setSize(wide,tall); - } - - addInputSignal(new FooHandler(this)); -} - -void DesktopIcon::paintBackground() -{ - Panel::paintBackground(); - - int wide,tall; - getPaintSize(wide,tall); - - if(_image!=null) - { - _image->doPaint(this); - } - - Font* font=getApp()->getScheme()->getFont(Scheme::sf_primary2); - - drawSetTextFont(Scheme::sf_primary1); - drawSetTextColor(Scheme::sc_black); - - if(_miniApp!=null) - { - char buf[256]; - _miniApp->getName(buf,sizeof(buf)); - int tWide,tTall; - font->getTextSize(buf,tWide,tTall); - drawSetTextColor(255,255,255,0); - drawSetTextPos(wide/2-(tWide/2),tall-20); - drawPrintText(buf,strlen(buf)); - } -} - -void DesktopIcon::setDesktop(Desktop* desktop) -{ - _desktop=desktop; -} - -void DesktopIcon::doActivate() -{ - if(_desktop!=null) - { - _desktop->iconActivated(this); - } -} - -void DesktopIcon::setImage(Image* image) -{ - _image=image; - - if(_image!=null) - { - int wide,tall; - _image->getSize(wide,tall); - setSize(wide,tall); - } -} - -MiniApp* DesktopIcon::getMiniApp() -{ - return _miniApp; -} diff --git a/utils/vgui/lib/EditPanel.cpp b/utils/vgui/lib/EditPanel.cpp deleted file mode 100644 index 2c4ba998..00000000 --- a/utils/vgui/lib/EditPanel.cpp +++ /dev/null @@ -1,602 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultEditPanelSignal : public InputSignal -{ -public: - FooDefaultEditPanelSignal(EditPanel* editPanel) - { - _editPanel=editPanel; - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - _editPanel->requestFocus(); - _editPanel->repaint(); - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - bool shift=(_editPanel->isKeyDown(KEY_LSHIFT)||_editPanel->isKeyDown(KEY_RSHIFT)); - - switch(code) - { - case KEY_UP: - { - _editPanel->doCursorUp(); - break; - } - case KEY_DOWN: - { - _editPanel->doCursorDown(); - break; - } - case KEY_LEFT: - { - _editPanel->doCursorLeft(); - break; - } - case KEY_RIGHT: - { - _editPanel->doCursorRight(); - break; - } - case KEY_HOME: - { - _editPanel->doCursorToStartOfLine(); - break; - } - case KEY_END: - { - _editPanel->doCursorToEndOfLine(); - break; - } - case KEY_BACKSPACE: - { - _editPanel->doCursorBackspace(); - break; - } - case KEY_DELETE: - { - _editPanel->doCursorDelete(); - break; - } - case KEY_ENTER: - { - _editPanel->doCursorNewLine(); - break; - } - default: - { - _editPanel->doCursorInsertChar(_editPanel->getApp()->getKeyCodeChar(code,shift)); - break; - } - case KEY_LSHIFT: - case KEY_RSHIFT: - case KEY_LALT: - case KEY_RALT: - case KEY_LCONTROL: - case KEY_RCONTROL: - { - break; - } - } - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - bool blink; - int nextBlinkTime; - _editPanel->getCursorBlink(blink,nextBlinkTime); - - int time=_editPanel->getApp()->getTimeMillis(); - if(time>nextBlinkTime) - { - _editPanel->setCursorBlink(!blink); - } - } -private: - EditPanel* _editPanel; -}; -} - -EditPanel::EditPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _cursor[0]=0; - _cursor[1]=0; - _font=null; - setCursorBlink(true); - addInputSignal(new FooDefaultEditPanelSignal(this)); - getLine(0); -} - -void EditPanel::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,wide,tall); -} - -void EditPanel::addLine() -{ -} - -Dar* EditPanel::getLine(int lineIndex) -{ - if(lineIndex<0) - { - return null; - } - - if((lineIndex==0)&&(_lineDarDar.getCount()==0)) - { - Dar* lineDar=new Dar; - _lineDarDar.addElement(lineDar); - return lineDar; - } - - if(lineIndex>=_lineDarDar.getCount()) - { - return null; - } - - return _lineDarDar[lineIndex]; -} - -void EditPanel::getText(int lineIndex, int offset,char* buf,int bufLen) -{ - if((lineIndex>=0)&&(lineIndex<_lineDarDar.getCount())) - { - Dar* dataStr=_lineDarDar[lineIndex]; - - int j=0; - for(int i=offset;igetCount()&&(j* lineDar,int x,char ch,char fill) -{ - if((lineDar==null)||(x<0)) - { - return; - } - - int count=lineDar->getCount(); - if(x>=count) - { - lineDar->ensureCapacity(x+1); - lineDar->setCount(x+1); - for(int i=count;isetElementAt(fill,i); - } - } - lineDar->setElementAt(ch,x); -} - -void EditPanel::setChar(Dar* lineDar,int x,char ch) -{ - setChar(lineDar,x,ch,' '); -} - -int EditPanel::getLineCount() -{ - return _lineDarDar.getCount(); -} - -int EditPanel::getVisibleLineCount() -{ - int wide,tall; - getPaintSize(wide,tall); - - Font* font=_font; - if(font==null) - { - font=getApp()->getScheme()->getFont(Scheme::sf_primary1); - } - - return tall/font->getTall(); -} - -void EditPanel::setCursorBlink(bool state) -{ - _cursorBlink=state; - _cursorNextBlinkTime=getApp()->getTimeMillis()+400; - repaint(); -} - -void EditPanel::getCursorBlink(bool& blink,int& nextBlinkTime) -{ - blink=_cursorBlink; - nextBlinkTime=_cursorNextBlinkTime; -} - -void EditPanel::shiftLineLeft(Dar* lineDar,int x,int count) -{ - if((x<0)||(x>lineDar->getCount())) - { - return; - } - - if(count<0) - { - return; - } - - for(int i=x;igetCount();i++) - { - int xx=x-count; - if(xx>=0) - { - setChar(lineDar,xx,(*lineDar)[i]); - } - } - lineDar->setCount(lineDar->getCount()-count); -} - -void EditPanel::shiftLineRight(Dar* lineDar,int x,int count) -{ - if(x<0) - { - return; - } - - if(count<0) - { - return; - } - - for(int i=lineDar->getCount()-1;i>=x;i--) - { - setChar(lineDar,i-count,(*lineDar)[i]); - } -} - -int EditPanel::spatialCharOffsetBetweenTwoLines(Dar* srcDar,Dar* dstDar,int x) -{ - if((srcDar==null)||(dstDar==null)) - { - return x; - } - - Font* font=_font; - if(font==null) - { - font=getApp()->getScheme()->getFont(Scheme::sf_primary1); - } - - int i; - - int x0=0; - for(i=0;igetCount()) - { - ch=(*srcDar)[i]; - } - - int a,b,c; - font->getCharABCwide(ch,a,b,c); - x0+=a+b+c; - } - - int x1=0; - for(i=0;;i++) - { - char ch=' '; - if(igetCount()) - { - ch=(*dstDar)[i]; - } - - int a,b,c; - font->getCharABCwide(ch,a,b,c); - - int mid=x1+(a+b+c)/2; - if (x1>x0) - { - if(mid>x0) - { - } - else if (x1+(a+b+c)>x0) - { - return i+1; - } - } - else - { - if(mid>x0) - { - return i; - } - else if(x1+(a+b+c)>x0) - { - return i+1; - } - } - x1+=a+b+c; - } - -} - -void EditPanel::paint() -{ - Font* font=_font; - if(font==null) - { - font=getApp()->getScheme()->getFont(Scheme::sf_primary1); - } - - drawSetTextFont(font); - drawSetTextColor(Scheme::sc_black); - - int yy=0; - for(int j=0;j<_lineDarDar.getCount();j++) - { - int cx=0; - int xx=0; - Dar* lineDar=_lineDarDar[j]; - for(int i=0;igetCount();i++) - { - char ch=(*lineDar)[i]; - drawPrintChar(xx,yy,ch); - - if((_cursor[0]==i)&&(_cursor[1]==j)) - { - cx=xx; - } - - int a,b,c; - font->getCharABCwide(ch,a,b,c); - xx+=a+b+c; - } - - if((_cursor[1]==j)&&_cursorBlink) - { - if(_cursor[0]>=lineDar->getCount()) - { - int a,b,c; - font->getCharABCwide(' ',a,b,c); - cx=xx+(_cursor[0]-lineDar->getCount())*(a+b+c); - } - drawSetColor(255,0,0,0); - drawFilledRect(cx-1,yy,cx+1,yy+font->getTall()); - } - yy+=font->getTall(); - } -} - -void EditPanel::doCursorUp() -{ - _cursor[0]=spatialCharOffsetBetweenTwoLines(getLine(_cursor[1]),getLine(_cursor[1]-1),_cursor[0]); - _cursor[1]--; - - if(_cursor[1]<0) - { - _cursor[1]=0; - } - - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorDown() -{ - int lCount=getVisibleLineCount(); - _cursor[0]=spatialCharOffsetBetweenTwoLines(getLine(_cursor[1]),getLine(_cursor[1]+1),_cursor[0]); - - if(lCount>getLineCount()) - { - lCount=getLineCount(); - } - - if(_cursor[1]+1>=lCount) - { - return; - } - - _cursor[1]++; - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorLeft() -{ - _cursor[0]--; - - if(_cursor[0]<0) - { - _cursor[0]=0; - } - - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorRight() -{ - _cursor[0]++; - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorToStartOfLine() -{ - _cursor[0]=0; - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorToEndOfLine() -{ - Dar* lineDar=getLine(_cursor[1]); - if(lineDar==null) - { - return; - } - _cursor[0]=lineDar->getCount(); - setCursorBlink(true); - repaint(); -} - -void EditPanel::doCursorInsertChar(char ch) -{ - Dar* lineDar=getLine(_cursor[1]); - if(lineDar==null) - { - return; - } - shiftLineRight(lineDar,_cursor[0],1); - setChar(lineDar,_cursor[0],ch); - doCursorRight(); - repaint(); -} - -void EditPanel::doCursorBackspace() -{ - Dar* lineDar=getLine(_cursor[1]); - if(lineDar==null) - { - return; - } - - if(_cursor[0]==0) - { - Dar* prevLineDar=getLine(_cursor[1]-1); - if(prevLineDar==null) - { - return; - } - - int len=prevLineDar->getCount(); - for(int i=0;igetCount();i++) - { - setChar(prevLineDar,len+i,(*lineDar)[i]); - } - - if(_cursor[1]>=0) - { - _lineDarDar.removeElementAt(_cursor[1]); - doCursorUp(); - _cursor[0]=prevLineDar->getCount(); - } - repaint(); - } - else - { - shiftLineLeft(lineDar,_cursor[0],1); - doCursorLeft(); - repaint(); - } -} - -void EditPanel::doCursorNewLine() -{ - Dar* lineDar=getLine(_cursor[1]); - if(lineDar==null) - { - return; - } - - Dar* newLineDar=new Dar; - _lineDarDar.insertElementAt(newLineDar,_cursor[1]+1); - - for(int i=_cursor[0];igetCount();i++) - { - setChar(newLineDar,i-_cursor[0],(*lineDar)[i]); - } - lineDar->setCount(_cursor[0]); - - _cursor[0]=0; - doCursorDown(); - repaint(); -} - -void EditPanel::doCursorDelete() -{ - Dar* lineDar=getLine(_cursor[1]); - if(lineDar==null) - { - return; - } - - doCursorRight(); - shiftLineRight(lineDar,_cursor[0],1); - doCursorLeft(); - repaint(); -} - -void EditPanel::doCursorPrintf(char* format,...) -{ - va_list argList; - va_start(argList,format); - char buf[8192]; - vsprintf(buf,format,argList); - va_end(argList); - - for(int i=0;i -#include - -using namespace vgui; - -EtchedBorder::EtchedBorder() : Border() -{ - setInset(2,2,2,2); -} - -void EtchedBorder::paint(Panel* panel) -{ - int wide,tall; - panel->getSize(wide,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,wide,2); - drawFilledRect(0,tall-2,wide,tall); - drawFilledRect(0,2,2,tall-2); - drawFilledRect(wide-2,2,wide,tall-2); - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(0,0,wide-1,1); - drawFilledRect(0,tall-2,wide-1,tall-1); - drawFilledRect(0,1,1,tall-2); - drawFilledRect(wide-2,1,wide-1,tall-2); -} diff --git a/utils/vgui/lib/FileInputStream.cpp b/utils/vgui/lib/FileInputStream.cpp deleted file mode 100644 index d231c920..00000000 --- a/utils/vgui/lib/FileInputStream.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -FileInputStream::FileInputStream(const char* fileName,bool textMode) -{ - _fp=fopen(fileName,textMode?"rt":"rb"); -} - -void FileInputStream::seekStart(bool& success) -{ - if(_fp==null) - { - success=false; - return; - } - - success=(fseek(_fp,0,SEEK_SET)!=0); -} - -void FileInputStream::seekRelative(int count,bool& success) -{ - if(_fp==null) - { - success=false; - return; - } - - success=(fseek(_fp,SEEK_CUR,count)!=0); -} - -void FileInputStream::seekEnd(bool& success) -{ - if(_fp==null) - { - success=false; - return; - } - - success=(fseek(_fp,SEEK_END,0)!=0); -} - -int FileInputStream::getAvailable(bool& success) -{ - if(_fp==null) - { - success=false; - return 0; - } - - success=false; - return 0; -} - -uchar FileInputStream::readUChar(bool& success) -{ - if(_fp==null) - { - success=false; - return 0; - } - - uchar ret; - success=(fread(&ret,sizeof(ret),1,_fp)==1); - return ret; -} - -void FileInputStream::readUChar(uchar* buf,int count,bool& success) -{ - if(_fp==null) - { - success=false; - return; - } - - success=(fread(buf,count,1,_fp)==1); -} - -void FileInputStream::close(bool& success) -{ - if(_fp==null) - { - success=false; - return; - } - - success=(fclose(_fp)==0); -} - -void FileInputStream::close() -{ - bool success; - close(success); -} diff --git a/utils/vgui/lib/FlowLayout.cpp b/utils/vgui/lib/FlowLayout.cpp deleted file mode 100644 index c8aa525e..00000000 --- a/utils/vgui/lib/FlowLayout.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ - -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -FlowLayout::FlowLayout(int hgap) : Layout() -{ - _hgap=hgap; -} - -void FlowLayout::performLayout(Panel* panel) -{ - int xx=0; - for(int i=0;igetChildCount();i++) - { - int x,y,wide,tall; - Panel* child=panel->getChild(i); - child->getBounds(x,y,wide,tall); - child->setPos(xx,y); - xx+=wide+_hgap; - } -} diff --git a/utils/vgui/lib/FocusNavGroup.cpp b/utils/vgui/lib/FocusNavGroup.cpp deleted file mode 100644 index d26193d7..00000000 --- a/utils/vgui/lib/FocusNavGroup.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -FocusNavGroup::FocusNavGroup() -{ - _currentIndex=0; -} - -void FocusNavGroup::addPanel(Panel* panel) -{ - _panelDar.putElement(panel); -} - -void FocusNavGroup::requestFocusPrev() -{ - if(_panelDar.getCount()==0) - { - return; - } - _currentIndex--; - if(_currentIndex<0) - { - _currentIndex=_panelDar.getCount()-1; - } - _panelDar[_currentIndex]->requestFocus(); -} - -void FocusNavGroup::requestFocusNext() -{ - if(_panelDar.getCount()==0) - { - return; - } - _currentIndex++; - if(_currentIndex>=_panelDar.getCount()) - { - _currentIndex=0; - } - _panelDar[_currentIndex]->requestFocus(); -} - -void FocusNavGroup::setCurrentPanel(Panel* panel) -{ - for(int i=0;i<_panelDar.getCount();i++) - { - if(_panelDar[i]==panel) - { - _currentIndex=i; - break; - } - } -} diff --git a/utils/vgui/lib/Font.cpp b/utils/vgui/lib/Font.cpp deleted file mode 100644 index 502ba351..00000000 --- a/utils/vgui/lib/Font.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -void Font::getTextSize(const char* text,int& wide,int& tall) -{ - wide=0; - tall=0; - - if(text==null) - { - return; - } - - tall=getTall(); - - int xx=0; - for(int i=0;;i++) - { - char ch=text[i]; - - if(ch==0) - { - break; - } - if(ch=='\n') - { - tall+=getTall(); - xx=0; - continue; - } - - int a,b,c; - getCharABCwide(ch,a,b,c); - xx+=a+b+c; - if(xx>wide) - { - wide=xx; - } - } -} - -int Font::getId() -{ - return _id; -} - -BaseFontPlat* Font::getPlat() -{ - return _plat; -} diff --git a/utils/vgui/lib/Frame.cpp b/utils/vgui/lib/Frame.cpp deleted file mode 100644 index 87ffa000..00000000 --- a/utils/vgui/lib/Frame.cpp +++ /dev/null @@ -1,699 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDraggerSignal : public InputSignal -{ -protected: - Frame* _frame; - -public: - FooDraggerSignal(Frame* frame) - { - _frame=frame; - _dragging=false; - } - -public: - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - } - - virtual void cursorMoved(int x,int y,Panel* panel) - { - if(!_dragging) - return; - - panel=panel->getParent(); - if(panel==null) - return; - - panel->getApp()->getCursorPos(x,y); - Frame* frame=dynamic_cast(panel); - if(frame==null) - return; - - if(frame->isInternal()) - { - moved(x-_dragStart[0],y-_dragStart[1],true,panel,panel->getParent()); - if(panel->getParent()!=null) - panel->getParent()->repaint(); - panel->repaint(); - } - else - { - Panel* parent=panel->getParent(); - if(parent!=null) - { - moved(x-_dragStart[0],y-_dragStart[1],false,panel,parent); - if(parent->getParent()!=null) - parent->getParent()->repaint(); - parent->repaint(); - } - } - } - - virtual void cursorEntered(Panel* panel) - { - } - - virtual void cursorExited(Panel* panel) - { - } - - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - - virtual void mousePressed(MouseCode code,Panel* panel) - { - Panel* opanel=panel->getParent(); - if(opanel==null) - return; - - Frame* frame=dynamic_cast(opanel); - if(frame==null) - return; - - if(code==MOUSE_LEFT) - { - _dragging=true; - - int x,y; - opanel->getApp()->getCursorPos(x,y); - _dragStart[0]=x; - _dragStart[1]=y; - opanel->getPos(_dragOrgPos[0],_dragOrgPos[1]); - opanel->getSize(_dragOrgSize[0],_dragOrgSize[1]); - if(opanel->getParent()!=null) - { - opanel->getParent()->getPos(_dragOrgPos2[0],_dragOrgPos2[1]); - opanel->getParent()->getSize(_dragOrgSize2[0],_dragOrgSize2[1]); - - int x0,y0,x1,y1; - opanel->getParent()->getAbsExtents(x0,y0,x1,y1); - opanel->getApp()->setMouseArena(x0,y0,x1,y1,true); - - Panel* parent=opanel->getParent(); - parent->removeChild(opanel); - parent->addChild(opanel); - } - - opanel->getApp()->setMouseCapture(panel); - opanel->requestFocus(); - opanel->repaintAll(); - } - } - - virtual void mouseReleased(MouseCode code,Panel* panel) - { - _dragging=false; - panel->getApp()->setMouseArena(0,0,0,0,false); - panel->getApp()->setMouseCapture(null); - } - - virtual void mouseWheeled(int delta,Panel* panel){} - virtual void keyPressed(KeyCode code,Panel* panel){} - virtual void keyTyped(KeyCode code,Panel* panel){} - virtual void keyReleased(KeyCode code,Panel* panel){} - virtual void keyFocusTicked(Panel* panel){} - -protected: - bool _dragging; - int _dragOrgPos[2]; - int _dragOrgPos2[2]; - int _dragOrgSize[2]; - int _dragOrgSize2[2]; - int _dragStart[2]; -}; - -class FooTopGripSignal : public FooDraggerSignal -{ -public: - FooTopGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0],_dragOrgPos[1]+dy); - panel->setSize(_dragOrgSize[0],_dragOrgSize[1]-dy); - } - else - { - parent->setPos(_dragOrgPos2[0],_dragOrgPos2[1]+dy); - parent->setSize(_dragOrgSize2[0],_dragOrgSize2[1]-dy); - } - } -}; - -class FooBottomGripSignal : public FooDraggerSignal -{ -public: - FooBottomGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setSize(_dragOrgSize[0],_dragOrgSize[1]+dy); - } - else - { - parent->setSize(_dragOrgSize2[0],_dragOrgSize2[1]+dy); - } - } -}; - -class FooLeftGripSignal : public FooDraggerSignal -{ -public: - FooLeftGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0]+dx,_dragOrgPos[1]); - panel->setSize(_dragOrgSize[0]-dx,_dragOrgSize[1]); - } - else - { - parent->setPos(_dragOrgPos2[0]+dx,_dragOrgPos2[1]); - parent->setSize(_dragOrgSize2[0]-dx,_dragOrgSize2[1]); - } - } -}; - -class FooRightGripSignal : public FooDraggerSignal -{ -public: - FooRightGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setSize(_dragOrgSize[0]+dx,_dragOrgSize[1]); - } - else - { - parent->setSize(_dragOrgSize2[0]+dx,_dragOrgSize2[1]); - } - } -}; - -class FooTopLeftGripSignal : public FooDraggerSignal -{ -public: - FooTopLeftGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0]+dx,_dragOrgPos[1]+dy); - panel->setSize(_dragOrgSize[0]-dx,_dragOrgSize[1]-dy); - } - else - { - parent->setPos(_dragOrgPos2[0]+dx,_dragOrgPos2[1]+dy); - parent->setSize(_dragOrgSize2[0]-dx,_dragOrgSize2[1]-dy); - } - } -}; - -class FooTopRightGripSignal : public FooDraggerSignal -{ -public: - FooTopRightGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0],_dragOrgPos[1]+dy); - panel->setSize(_dragOrgSize[0]+dx,_dragOrgSize[1]-dy); - } - else - { - parent->setPos(_dragOrgPos2[0],_dragOrgPos2[1]+dy); - parent->setSize(_dragOrgSize2[0]+dx,_dragOrgSize2[1]-dy); - } - } -}; - -class FooBottomLeftGripSignal : public FooDraggerSignal -{ -public: - FooBottomLeftGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0]+dx,_dragOrgPos[1]); - panel->setSize(_dragOrgSize[0]-dx,_dragOrgSize[1]+dy); - } - else - { - parent->setPos(_dragOrgPos2[0]+dx,_dragOrgPos2[1]); - parent->setSize(_dragOrgSize2[0]-dx,_dragOrgSize2[1]+dy); - } - } -}; - -class FooBottomRightGripSignal : public FooDraggerSignal -{ -public: - FooBottomRightGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setSize(_dragOrgSize[0]+dx,_dragOrgSize[1]+dy); - } - else - { - parent->setSize(_dragOrgSize2[0]+dx,_dragOrgSize2[1]+dy); - } - } -}; - -class FooCaptionGripSignal : public FooDraggerSignal -{ -public: - FooCaptionGripSignal(Frame* frame) : FooDraggerSignal(frame) - { - } - - virtual void moved(int dx,int dy,bool internal,Panel* panel,Panel* parent) - { - if(!_frame->isSizeable()) - return; - - if(internal) - { - panel->setPos(_dragOrgPos[0]+dx,_dragOrgPos[1]+dy); - } - else - { - parent->setPos(_dragOrgPos2[0]+dx,_dragOrgPos2[1]+dy); - } - } -}; - -class FooCloseButtonHandler : public ActionSignal -{ -public: - FooCloseButtonHandler(Frame* frame) - { - _frame=frame; - } -public: - virtual void actionPerformed(Panel* panel) - { - _frame->fireClosingSignal(); - } -protected: - Frame* _frame; -}; - -class FooMinimizeButtonHandler : public ActionSignal -{ -public: - FooMinimizeButtonHandler(Frame* frame) - { - _frame=frame; - } -public: - virtual void actionPerformed(Panel* panel) - { - _frame->fireMinimizingSignal(); - } -protected: - Frame* _frame; -}; -} - -Frame::Frame(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _title=null; - _internal=true; - _moveable=true; - _sizeable=true; - _title=vgui_strdup("Untitled"); - setMinimumSize(64,33); - - bool showGrip=false; - - _topGrip=new Panel(15,0,wide-30,5); - _topGrip->setParent(this); - _topGrip->setCursor(new Cursor(Cursor::dc_sizens)); - _topGrip->addInputSignal(new FooTopGripSignal(this)); - _topGrip->setPaintBorderEnabled(false); - _topGrip->setPaintBackgroundEnabled(false); - _topGrip->setPaintEnabled(false); - - _bottomGrip=new Panel(15,tall-5,wide-30,5); - _bottomGrip->setParent(this); - _bottomGrip->setCursor(new Cursor(Cursor::dc_sizens)); - _bottomGrip->addInputSignal(new FooBottomGripSignal(this)); - _bottomGrip->setPaintBorderEnabled(false); - _bottomGrip->setPaintBackgroundEnabled(false); - _bottomGrip->setPaintEnabled(false); - - _leftGrip=new Panel(0,15,5,tall-30); - _leftGrip->setParent(this); - _leftGrip->setCursor(new Cursor(Cursor::dc_sizewe)); - _leftGrip->addInputSignal(new FooLeftGripSignal(this)); - _leftGrip->setPaintBorderEnabled(false); - _leftGrip->setPaintBackgroundEnabled(false); - _leftGrip->setPaintEnabled(false); - - _rightGrip=new Panel(wide-5,15,5,tall-30); - _rightGrip->setParent(this); - _rightGrip->setCursor(new Cursor(Cursor::dc_sizewe)); - _rightGrip->addInputSignal(new FooRightGripSignal(this)); - _rightGrip->setPaintBorderEnabled(false); - _rightGrip->setPaintBackgroundEnabled(false); - _rightGrip->setPaintEnabled(false); - - _topLeftGrip=new Panel(0,0,15,15); - _topLeftGrip->setParent(this); - _topLeftGrip->setCursor(new Cursor(Cursor::dc_sizenwse)); - _topLeftGrip->addInputSignal(new FooTopLeftGripSignal(this)); - _topLeftGrip->setPaintBorderEnabled(false); - _topLeftGrip->setPaintBackgroundEnabled(false); - _topLeftGrip->setPaintEnabled(false); - - _topRightGrip=new Panel(wide-15,0,15,15); - _topRightGrip->setParent(this); - _topRightGrip->setCursor(new Cursor(Cursor::dc_sizenesw)); - _topRightGrip->addInputSignal(new FooTopRightGripSignal(this)); - _topRightGrip->setPaintBorderEnabled(false); - _topRightGrip->setPaintBackgroundEnabled(false); - _topRightGrip->setPaintEnabled(false); - - _bottomLeftGrip=new Panel(0,tall-15,15,15); - _bottomLeftGrip->setParent(this); - _bottomLeftGrip->setCursor(new Cursor(Cursor::dc_sizenesw)); - _bottomLeftGrip->addInputSignal(new FooBottomLeftGripSignal(this)); - _bottomLeftGrip->setPaintBorderEnabled(false); - _bottomLeftGrip->setPaintBackgroundEnabled(false); - _bottomLeftGrip->setPaintEnabled(false); - - _bottomRightGrip=new Panel(wide-15,tall-15,15,15); - _bottomRightGrip->setParent(this); - _bottomRightGrip->setCursor(new Cursor(Cursor::dc_sizenwse)); - _bottomRightGrip->addInputSignal(new FooBottomRightGripSignal(this)); - _bottomRightGrip->setPaintBorderEnabled(false); - _bottomRightGrip->setPaintBackgroundEnabled(false); - _bottomRightGrip->setPaintEnabled(false); - - _captionGrip=new Panel(5,5,wide-10,23); - _captionGrip->setParent(this); - _captionGrip->setCursor(new Cursor(Cursor::dc_sizeall)); - _captionGrip->addInputSignal(new FooCaptionGripSignal(this)); - _captionGrip->setPaintBorderEnabled(false); - _captionGrip->setPaintBackgroundEnabled(false); - _captionGrip->setPaintEnabled(false); - - _client=new Panel(5,29,wide-10,tall-34); - _client->setParent(this); - _client->addInputSignal(new FooDraggerSignal(this)); - - _trayButton=new Button(".",wide-85,8,18,18); - _trayButton->setParent(this); - - _minimizeButton=new Button("2",wide-65,8,18,18); - _minimizeButton->setFont(Scheme::sf_secondary1); - _minimizeButton->setParent(this); - _minimizeButton->addActionSignal(new FooMinimizeButtonHandler(this)); - - _maximizeButton=new Button("1",wide-45,8,18,18); - _maximizeButton->setFont(Scheme::sf_secondary1); - _maximizeButton->setParent(this); - - _closeButton=new Button("r",wide-25,8,18,18); - _closeButton->setFont(Scheme::sf_secondary1); - _closeButton->setParent(this); - _closeButton->addActionSignal(new FooCloseButtonHandler(this)); - - _menuButton=new Button("s",7,8,18,18); - _menuButton->setFont(Scheme::sf_secondary1); - _menuButton->setParent(this); -} - -void Frame::setSize(int wide,int tall) -{ - if((getWide()==wide)&&(getTall()==tall)) - { - return; - } - - Panel::setSize(wide,tall); - - _topGrip->setBounds(15,0,_size[0]-30,5); - _bottomGrip->setBounds(15,_size[1]-5,_size[0]-30,5); - _leftGrip->setBounds(0,15,5,_size[1]-30); - _rightGrip->setBounds(_size[0]-5,15,5,_size[1]-30); - _topLeftGrip->setBounds(0,0,15,15); - _topRightGrip->setBounds(_size[0]-15,0,15,15); - _bottomLeftGrip->setBounds(0,_size[1]-15,15,15); - _bottomRightGrip->setBounds(_size[0]-15,_size[1]-15,15,15); - _captionGrip->setSize(_size[0]-10,23); - _client->setSize(_size[0]-10,_size[1]-34); - _trayButton->setPos(_size[0]-85,8); - _minimizeButton->setPos(_size[0]-65,8); - _maximizeButton->setPos(_size[0]-45,8); - _closeButton->setPos(_size[0]-25,8); - _client->invalidateLayout(false); -} - -void Frame::setInternal(bool state) -{ - _internal=state; -} - -bool Frame::isInternal() -{ - return _internal; -} - -Panel* Frame::getClient() -{ - return _client; -} - -void Frame::setTitle(const char* title) -{ - delete[] _title; - _title=vgui_strdup(title); - repaint(); -} - -void Frame::getTitle(char* buf,int bufLen) -{ - vgui_strcpy(buf,bufLen,_title); -} - -void Frame::setMoveable(bool state) -{ - _moveable=state; -} - -void Frame::setSizeable(bool state) -{ - _sizeable=state; -} - -bool Frame::isMoveable() -{ - return _moveable; -} - -bool Frame::isSizeable() -{ - return _sizeable; -} - -void Frame::paintBackground() -{ - int wide=_size[0]; - int tall=_size[1]; - - const int captionTall=23; - - Scheme::SchemeColor color1=Scheme::sc_secondary1; - Scheme::SchemeColor color2=Scheme::sc_secondary2; - Scheme::SchemeColor color3=Scheme::sc_secondary3; - - if(getSurfaceBase()->hasFocus()) - { - Panel* trav=getApp()->getFocus(); - while(trav!=null) - { - if(trav==this) - { - color1=Scheme::sc_primary1; - color2=Scheme::sc_primary2; - color3=Scheme::sc_primary3; - } - trav=trav->getParent(); - } - } - - drawSetColor(color3); - drawFilledRect(5,5,wide-5,28); - - drawSetColor(Scheme::sc_white); - drawFilledRect(120,10,wide-70,11); - drawFilledRect(120,15,wide-70,16); - drawFilledRect(120,20,wide-70,21); - - drawSetColor(color1); - drawFilledRect(120,12,wide-70,13); - drawFilledRect(120,17,wide-70,18); - drawFilledRect(120,22,wide-70,23); - - drawSetColor(color1); - drawFilledRect(1,0,wide-1,5); - drawFilledRect(1,tall-5,wide-1,tall); - drawFilledRect(0,1,5,tall-1); - drawFilledRect(wide-5,1,wide,tall-1); - drawFilledRect(5,5,6,6); - drawFilledRect(wide-6,5,wide-5,6); - drawFilledRect(5,28,wide-5,29); - - drawSetColor(Scheme::sc_black); - drawFilledRect(13,2,wide-13,3); - drawFilledRect(13,tall-3,wide-13,tall-2); - drawFilledRect(2,13,3,tall-13); - drawFilledRect(wide-3,13,wide-2,tall-13); - - drawSetColor(color2); - drawFilledRect(14,3,wide-12,4); - drawFilledRect(14,tall-2,wide-12,tall-1); - drawFilledRect(3,14,4,tall-12); - drawFilledRect(wide-2,14,wide-1,tall-12); - - if(_title!=null) - { - drawSetTextFont(Scheme::sf_primary1); - drawSetTextColor(Scheme::sc_black); - drawPrintText(28,7,_title,strlen(_title)); - } -} - -void Frame::addFrameSignal(FrameSignal* s) -{ - _frameSignalDar.putElement(s); -} - -void Frame::fireClosingSignal() -{ - for(int i=0;i<_frameSignalDar.getCount();i++) - { - _frameSignalDar[i]->closing(this); - } -} - -void Frame::fireMinimizingSignal() -{ - for(int i=0;i<_frameSignalDar.getCount();i++) - { - _frameSignalDar[i]->minimizing(this,false); - } -} - -void Frame::setVisible(bool state) -{ - Panel::setVisible(state); - - if(getParent()!=null) - { - getParent()->repaint(); - } -} - -void Frame::setMenuButtonVisible(bool state) -{ - _menuButton->setVisible(state); -} - -void Frame::setTrayButtonVisible(bool state) -{ - _trayButton->setVisible(state); -} - -void Frame::setMinimizeButtonVisible(bool state) -{ - _minimizeButton->setVisible(state); -} - -void Frame::setMaximizeButtonVisible(bool state) -{ - _maximizeButton->setVisible(state); -} - -void Frame::setCloseButtonVisible(bool state) -{ - _closeButton->setVisible(state); -} diff --git a/utils/vgui/lib/GridLayout.cpp b/utils/vgui/lib/GridLayout.cpp deleted file mode 100644 index 8608688d..00000000 --- a/utils/vgui/lib/GridLayout.cpp +++ /dev/null @@ -1,14 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -/*GridLayout::GridLayout(int rows,int cols,int hgap,int vgap) : Layout() -{ -}*/ diff --git a/utils/vgui/lib/HeaderPanel.cpp b/utils/vgui/lib/HeaderPanel.cpp deleted file mode 100644 index 2f8b8ba3..00000000 --- a/utils/vgui/lib/HeaderPanel.cpp +++ /dev/null @@ -1,208 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class HeaderPanelSignal : public InputSignal -{ -private: - HeaderPanel* _headerPanel; -public: - HeaderPanelSignal(HeaderPanel* headerPanel) - { - _headerPanel=headerPanel; - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - _headerPanel->privateCursorMoved(x,y,panel); - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - _headerPanel->privateMousePressed(code,panel); - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - _headerPanel->privateMouseReleased(code,panel); - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } -}; -} - -HeaderPanel::HeaderPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _sliderWide=11; - _dragging=false; - _sectionLayer=new Panel(0,0,wide,tall); - _sectionLayer->setPaintBorderEnabled(false); - _sectionLayer->setPaintBackgroundEnabled(false); - _sectionLayer->setPaintEnabled(false); - _sectionLayer->setParent(this); -} - -void HeaderPanel::addSectionPanel(Panel* panel) -{ - invalidateLayout(true); - - int x=0; - int y=999999999,wide=999999999,tall=999999999; // uninitialize - for(int i=0;i<_sectionPanelDar.getCount();i++) - { - _sectionPanelDar[i]->getBounds(x,y,wide,tall); - x+=wide+_sliderWide; - } - _sectionPanelDar.addElement(panel); - - panel->setPos(x,0); - panel->setParent(_sectionLayer); - panel->setBounds(x,y,wide,tall); - - getPaintSize(wide,tall); - - Panel* slider=new Panel(0,0,_sliderWide,tall); - slider->setPaintBorderEnabled(false); - slider->setPaintBackgroundEnabled(false); - slider->setPaintEnabled(false); - slider->setPos(x+wide,0); - slider->addInputSignal(new HeaderPanelSignal(this)); - slider->setCursor(getApp()->getScheme()->getCursor(Scheme::scu_sizewe)); - slider->setParent(this); - _sliderPanelDar.addElement(slider); - - invalidateLayout(false); - fireChangeSignal(); - repaint(); -} - -void HeaderPanel::setSliderPos(int sliderIndex,int pos) -{ - _sliderPanelDar[sliderIndex]->setPos(pos-_sliderWide/2,0); - - invalidateLayout(false); - fireChangeSignal(); - repaint(); -} - -int HeaderPanel::getSectionCount() -{ - return _sectionPanelDar.getCount(); -} - -void HeaderPanel::getSectionExtents(int sectionIndex,int& x0,int& x1) -{ - int x,y,wide,tall; - _sectionPanelDar[sectionIndex]->getBounds(x,y,wide,tall); - x0=x; - x1=x+wide; -} - -void HeaderPanel::addChangeSignal(ChangeSignal* s) -{ - _changeSignalDar.putElement(s); -} - -void HeaderPanel::fireChangeSignal() -{ - invalidateLayout(true); - - for(int i=0;i<_changeSignalDar.getCount();i++) - { - _changeSignalDar[i]->valueChanged(this); - } -} - -void HeaderPanel::performLayout() -{ - int x0=0; - int x1; - int x,y,wide,tall; - getPaintSize(wide,tall); - _sectionLayer->setBounds(0,0,wide,tall); - - for(int i=0;i<_sectionPanelDar.getCount();i++) - { - Panel* slider=_sliderPanelDar[i]; - slider->getPos(x,y); - x1=x+(_sliderWide/2); - - Panel* panel=_sectionPanelDar[i]; - panel->setBounds(x0,0,x1-x0,tall); - x0=x1; - } -} - -void HeaderPanel::privateCursorMoved(int x,int y,Panel* panel) -{ - if(!_dragging) - { - return; - } - - getApp()->getCursorPos(x,y); - screenToLocal(x,y); - - setSliderPos(_dragSliderIndex,x+_dragSliderStartPos-_dragSliderStartX); - invalidateLayout(false); - repaint(); -} - -void HeaderPanel::privateMousePressed(MouseCode code,Panel* panel) -{ - int mx,my; - getApp()->getCursorPos(mx,my); - screenToLocal(mx,my); - - for(int i=0;i<_sliderPanelDar.getCount();i++) - { - Panel* slider=_sliderPanelDar[i]; - if(slider==panel) - { - int x,y; - panel->getPos(x,y); - _dragging=true; - _dragSliderIndex=i; - _dragSliderStartPos=x+(_sliderWide/2); - _dragSliderStartX=mx; - panel->setAsMouseCapture(true); - break; - } - } -} - -void HeaderPanel::privateMouseReleased(MouseCode code,Panel* panel) -{ -} diff --git a/utils/vgui/lib/Image.cpp b/utils/vgui/lib/Image.cpp deleted file mode 100644 index 0a01e835..00000000 --- a/utils/vgui/lib/Image.cpp +++ /dev/null @@ -1,158 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -Image::Image() -{ - _panel=null; - setPos(0,0); - setSize(0,0); - setColor(Color(255,255,255,0)); -} - -void Image::setPos(int x,int y) -{ - _pos[0]=x; - _pos[1]=y; -} - -void Image::getPos(int& x,int& y) -{ - x=_pos[0]; - y=_pos[1]; -} - -void Image::getSize(int& wide,int& tall) -{ - wide=_size[0]; - tall=_size[1]; -} - -void Image::setColor(Color color) -{ - _color=color; -} - -void Image::getColor(Color& color) -{ - color=_color; -} - -void Image::setSize(int wide,int tall) -{ - _size[0]=wide; - _size[1]=tall; -} - -void Image::drawSetColor(Scheme::SchemeColor sc) -{ - _panel->drawSetColor(sc); -} - -void Image::drawSetColor(int r,int g,int b,int a) -{ - _panel->drawSetColor(r,g,b,a); -} - -void Image::drawFilledRect(int x0,int y0,int x1,int y1) -{ - x0+=_pos[0]; - y0+=_pos[1]; - x1+=_pos[0]; - y1+=_pos[1]; - _panel->drawFilledRect(x0,y0,x1,y1); -} - -void Image::drawOutlinedRect(int x0,int y0,int x1,int y1) -{ - x0+=_pos[0]; - y0+=_pos[1]; - x1+=_pos[0]; - y1+=_pos[1]; - _panel->drawOutlinedRect(x0,y0,x1,y1); -} - -void Image::drawSetTextFont(Scheme::SchemeFont sf) -{ - _panel->drawSetTextFont(sf); -} - -void Image::drawSetTextFont(Font* font) -{ - _panel->drawSetTextFont(font); -} - -void Image::drawSetTextColor(Scheme::SchemeColor sc) -{ - _panel->drawSetTextColor(sc); -} - -void Image::drawSetTextColor(int r,int g,int b,int a) -{ - _panel->drawSetTextColor(r,g,b,a); -} - -void Image::drawSetTextPos(int x,int y) -{ - x+=_pos[0]; - y+=_pos[1]; - _panel->drawSetTextPos(x,y); -} - -void Image::drawPrintText(const char* str,int strlen) -{ - _panel->drawPrintText(str,strlen); -} - -void Image::drawPrintText(int x,int y,const char* str,int strlen) -{ - x+=_pos[0]; - y+=_pos[1]; - _panel->drawPrintText(x,y,str,strlen); -} - -void Image::drawPrintChar(char ch) -{ - _panel->drawPrintChar(ch); -} - -void Image::drawPrintChar(int x,int y,char ch) -{ - x+=_pos[0]; - y+=_pos[1]; - _panel->drawPrintChar(x,y,ch); -} - -void Image::drawSetTextureRGBA(int id,const char* rgba,int wide,int tall) -{ - _panel->drawSetTextureRGBA(id,rgba,wide,tall); -} - -void Image::drawSetTexture(int id) -{ - _panel->drawSetTexture(id); -} - -void Image::drawTexturedRect(int x0,int y0,int x1,int y1) -{ - _panel->drawTexturedRect(x0,y0,x1,y1); -} - -void Image::paint(Panel* panel) -{ -} - -void Image::doPaint(Panel* panel) -{ - _panel=panel; - paint(panel); - _panel=null; -} diff --git a/utils/vgui/lib/ImagePanel.cpp b/utils/vgui/lib/ImagePanel.cpp deleted file mode 100644 index 43206f54..00000000 --- a/utils/vgui/lib/ImagePanel.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -ImagePanel::ImagePanel(Image* image) : Panel(0,0,64,64) -{ - _image=null; - setImage(image); -} - -void ImagePanel::setImage(Image* image) -{ - _image=image; - - if(_image!=null) - { - int wide,tall; - _image->getSize(wide,tall); - setSize(wide,tall); - } - - repaint(); -} - -void ImagePanel::paintBackground() -{ - if(_image!=null) - { - drawSetColor(Scheme::sc_white); - _image->doPaint(this); - } -} diff --git a/utils/vgui/lib/IntLabel.cpp b/utils/vgui/lib/IntLabel.cpp deleted file mode 100644 index 376f21f1..00000000 --- a/utils/vgui/lib/IntLabel.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -IntLabel::IntLabel(int value,int x,int y,int wide,int tall) : Label(null,x,y,wide,tall) -{ - _value=0; - setValue(value); -} - -void IntLabel::setValue(int value) -{ - if(_value!=value) - { - _value=value; - repaint(); - } -} - -void IntLabel::intChanged(int value,Panel* panel) -{ - setValue(value); -} - -void IntLabel::paintBackground() -{ - char buf[50]; - sprintf(buf,"%d",_value); - Panel::paintBackground(); - drawSetTextFont(Scheme::sf_primary1); - drawSetTextColor(Scheme::sc_black); - drawPrintText(0,0,buf,strlen(buf)); -} diff --git a/utils/vgui/lib/Label.cpp b/utils/vgui/lib/Label.cpp deleted file mode 100644 index e1e7b6b0..00000000 --- a/utils/vgui/lib/Label.cpp +++ /dev/null @@ -1,425 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDumb : public Panel, public ActionSignal -{ -private: - Label* _label; - TextEntry*_textEntry; -public: - FooDumb(Label* label) : Panel(0,0,200,20) - { - _label=label; - - setLayout(new FlowLayout(2)); - - Label* lll=new Label("setText"); - lll->setParent(this); - - _textEntry=new TextEntry("",0,0,80,20); - _textEntry->setParent(this); - _textEntry->addActionSignal(this); - } -public: - void actionPerformed(Panel* panel) - { - char buf[256]; - _textEntry->getText(0,buf,sizeof(buf)); - _label->setText(buf); - _label->repaint(); - } -}; -} - -void Label::init(int textBufferLen,const char* text,bool textFitted) -{ - _contentFitted=textFitted; - _textAlignment=a_center; - _contentAlignment=a_center; - _textImage=new TextImage(textBufferLen,text); - _textImage->setColor(Color(Scheme::sc_black)); - _image=null; - setText(textBufferLen,text); -} - -Label::Label(int textBufferLen,const char* text,int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - init(textBufferLen,text,false); -} - -Label::Label(const char* text,int x,int y,int wide,int tall): Panel(x,y,wide,tall) -{ - init(strlen(text)+1,text,false); -} - -Label::Label(const char* text,int x,int y) : Panel(x,y,10,10) -{ - init(strlen(text)+1,text,true); -} - -Label::Label(const char* text) : Panel(0,0,10,10) -{ - init(strlen(text)+1,text,true); -} - -void Label::getTextSize(int& wide,int& tall) -{ - _textImage->getTextSize(wide,tall); -} - -void Label::getContentSize(int& wide,int& tall) -{ - int tx0,ty0,tx1,ty1,ix0,iy0,ix1,iy1,minX,minY,maxX,maxY; - computeAlignment(tx0,ty0,tx1,ty1,ix0,iy0,ix1,iy1,minX,minY,maxX,maxY); - wide=maxX-minX; - tall=maxY-minY; -} - -void Label::setFont(Scheme::SchemeFont schemeFont) -{ - _textImage->setFont(schemeFont); - recomputeMinimumSize(); - repaint(); -} - -void Label::setImage(Image* image) -{ - _image=image; - recomputeMinimumSize(); - - if(_image!=null) - { - repaint(); - } -} - -void Label::setText(int textBufferLen,const char* text) -{ - _textImage->setText(textBufferLen,text); - recomputeMinimumSize(); - repaint(); -} - -void Label::setText(const char* format,...) -{ - char buf[4096]; - va_list argList; - - va_start(argList,format); - int ret=_vsnprintf(buf,sizeof(buf),format,argList); - buf[sizeof(buf)-1]=0; - va_end(argList); - - setText(strlen(buf)+1,buf); -} - -void Label::computeAlignment(int& tx0,int& ty0,int& tx1,int& ty1,int& ix0,int& iy0,int& ix1,int& iy1,int& minX,int& minY,int& maxX,int& maxY) -{ - int wide,tall; - getPaintSize(wide,tall); - - int tWide,tTall; - getTextSize(tWide,tTall); - - int iWide=0; - int iTall=0; - - if(_image!=null) - { - _image->getSize(iWide,iTall); - } - - ix0=0; - iy0=0; - ix1=iWide; - iy1=iTall; - - tx0=0; - ty0=0; - tx1=tWide; - ty1=tTall; - - switch(_textAlignment) - { - // left - case Label::a_northwest: - case Label::a_west: - case Label::a_southwest: - { - tx0=ix0-tWide; - break; - } - // center - case Label::a_north: - case Label::a_center: - case Label::a_south: - { - tx0=((ix1-ix0)/2)-((tx1-tx0)/2); - break; - } - // right - case Label::a_northeast: - case Label::a_east: - case Label::a_southeast: - { - tx0=ix1; - break; - } - } - - switch(_textAlignment) - { - // top - case Label::a_northwest: - case Label::a_north: - case Label::a_northeast: - { - ty0=iy0-tTall; - break; - } - // center - case Label::a_west: - case Label::a_center: - case Label::a_east: - { - ty0=((iy1-iy0)/2)-((ty1-ty0)/2); - break; - } - // south - case Label::a_southwest: - case Label::a_south: - case Label::a_southeast: - { - ty0=iy1; - break; - } - } - - tx1=tx0+tWide; - ty1=ty0+tTall; - - minX=tx0; - minY=ty0; - - if(ix0maxX) - { - maxX=ix1; - } - if(iy1>maxY) - { - maxY=iy1; - } - - tx0-=minX; - ty0-=minY; - tx1-=minX; - ty1-=minY; - - ix0-=minX; - iy0-=minY; - ix1-=minX; - iy1-=minY; - - maxX-=minX; - maxY-=minY; - minX=0; - minY=0; - - int offX,offY; - switch(_contentAlignment) - { - // left - case Label::a_northwest: - case Label::a_west: - case Label::a_southwest: - { - offX=0; - break; - } - // center - case Label::a_north: - case Label::a_center: - case Label::a_south: - { - offX=(wide/2)-((maxX-minX)/2); - break; - } - // right - case Label::a_northeast: - case Label::a_east: - case Label::a_southeast: - { - offX=minX+wide-maxX; - break; - } - } - - switch(_contentAlignment) - { - // top - case Label::a_northwest: - case Label::a_north: - case Label::a_northeast: - { - offY=0; - break; - } - // center - case Label::a_west: - case Label::a_center: - case Label::a_east: - { - offY=(tall/2)-(maxY/2); - break; - } - // south - case Label::a_southwest: - case Label::a_south: - case Label::a_southeast: - { - offY=tall-maxY; - break; - } - } - - tx0+=offX; - ty0+=offY; - tx1+=offX; - ty1+=offY; - - ix0+=offX; - iy0+=offY; - ix1+=offX; - iy1+=offY; - - minX+=offX; - minY+=offY; - maxX+=offX; - maxY+=offY; - - int pad=4; - minX-=pad; - minY-=pad; - maxX+=pad; - maxY+=pad; -} - -void Label::paint() -{ - int tx0,ty0,tx1,ty1,ix0,iy0,ix1,iy1,minX,minY,maxX,maxY; - computeAlignment(tx0,ty0,tx1,ty1,ix0,iy0,ix1,iy1,minX,minY,maxX,maxY); - - if(_image!=null) - { - _image->setPos(ix0,iy0); - _image->doPaint(this); - } - - if(_textImage!=null) - { - _textImage->setPos(tx0,ty0); - _textImage->doPaint(this); - } - - if(hasFocus()) - { - drawSetColor(Scheme::sc_primary2); - drawOutlinedRect(tx0,ty0,tx1,ty1); - } -} - -void Label::setTextAlignment(Alignment alignment) -{ - _textAlignment=alignment; - recomputeMinimumSize(); - repaint(); -} - -void Label::setContentAlignment(Alignment alignment) -{ - _contentAlignment=alignment; - recomputeMinimumSize(); - repaint(); -} - -Panel* Label::createPropertyPanel() -{ - Panel* parentPropertyPanel=Panel::createPropertyPanel(); - - TreeFolder* folder=new TreeFolder("Label"); - parentPropertyPanel->addChild(folder); - folder->addChild(new FooDumb(this)); - folder->addChild(new Label("setContentAlignment")); - - return parentPropertyPanel; -} - -void Label::recomputeMinimumSize() -{ - int wide,tall; - getContentSize(wide,tall); - setPreferredSize(wide,tall); - - if(_contentFitted) - { - setSize(wide,tall); - } -} - -void Label::setFont(Font* font) -{ - _textImage->setFont(font); - recomputeMinimumSize(); - repaint(); -} - -void Label::setFgColor(int r,int g,int b,int a) -{ - Panel::setFgColor(r,g,b,a); - Color color=Color(r,g,b,a); - _textImage->setColor(color); - repaint(); -} - -void Label::setFgColor(vgui::Scheme::SchemeColor sc) -{ - Panel::setFgColor(sc); - _textImage->setColor(sc); - repaint(); -} - -void Label::setContentFitted(bool state) -{ - _contentFitted=state; - recomputeMinimumSize(); - repaint(); -} diff --git a/utils/vgui/lib/Layout.cpp b/utils/vgui/lib/Layout.cpp deleted file mode 100644 index 93433f62..00000000 --- a/utils/vgui/lib/Layout.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -Layout::Layout() -{ -} - -/*void Layout::setPanel(Panel* panel) -{ -}*/ - -void Layout::performLayout(Panel* panel) -{ -} diff --git a/utils/vgui/lib/LineBorder.cpp b/utils/vgui/lib/LineBorder.cpp deleted file mode 100644 index dfb6bfaf..00000000 --- a/utils/vgui/lib/LineBorder.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -LineBorder::LineBorder() : Border() -{ - init(1,Color(0,0,0,0)); -} - -LineBorder::LineBorder(int thickness) : Border() -{ - init(thickness,Color(0,0,0,0)); -} - -LineBorder::LineBorder(Color color) : Border() -{ - init(1,color); -} - -LineBorder::LineBorder(int thickness,Color color) : Border() -{ - init(thickness,color); -} - -void LineBorder::init(int thickness,Color color) -{ - setInset(thickness,thickness,thickness,thickness); - _color=color; -} - -void LineBorder::paint(Panel* panel) -{ - int wide,tall; - panel->getSize(wide,tall); - - int r,g,b,a; - _color.getColor(r,g,b,a); - drawSetColor(r,g,b,a); - - drawFilledRect(0,0,wide,_inset[1]); - drawFilledRect(0,tall-_inset[3],wide,tall); - drawFilledRect(0,_inset[1],_inset[0],tall-_inset[3]); - drawFilledRect(wide-_inset[2],_inset[1],wide,tall-_inset[3]); -} diff --git a/utils/vgui/lib/ListPanel.cpp b/utils/vgui/lib/ListPanel.cpp deleted file mode 100644 index 5b2ccd64..00000000 --- a/utils/vgui/lib/ListPanel.cpp +++ /dev/null @@ -1,107 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultListPanelSignal : public IntChangeSignal -{ -public: - FooDefaultListPanelSignal(ListPanel* listPanel) - { - _listPanel=listPanel; - } - virtual void intChanged(int value,Panel* panel) - { - _listPanel->setPixelScroll(-value); - } -protected: - ListPanel* _listPanel; -}; -} - -ListPanel::ListPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _vpanel=new Panel(0,0,wide-15,tall*2); - _vpanel->setParent(this); - - setLayout(new StackLayout(1,false)); - setBgColor(0,0,100,0); - - _scroll=new ScrollBar(wide-15,0,15,tall,true); - _scroll->setParent(this); - _scroll->addIntChangeSignal(new FooDefaultListPanelSignal(this)); -} - -void ListPanel::paintBackground() -{ - Panel::paintBackground(); -} - -void ListPanel::addString(const char* str) -{ - addItem(new Label(str,0,0,80,20)); -} - -void ListPanel::addItem(Panel* panel) -{ - panel->setParent(_vpanel); - _vpanel->invalidateLayout(true); - Panel* last=_vpanel->getChild(_vpanel->getChildCount()-1); - int x,y,wide,tall,vwide,vtall; - last->getBounds(x,y,wide,tall); - _vpanel->getSize(vwide,vtall); - _vpanel->setSize(vwide,y+tall); - _scroll->setRange(0,y+tall-_size[1]); -} - -void ListPanel::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - invalidateLayout(false); -} - -void ListPanel::performLayout() -{ - Panel* last=_vpanel->getChild(_vpanel->getChildCount()-1); - if(last==null) - { - return; - } - - int x,y,wide,tall; - last->getBounds(x,y,wide,tall); - - int vwide,vtall; - _vpanel->getSize(vwide,vtall); - _vpanel->setSize(_size[0]-15,tall); - _scroll->setBounds(_size[0]-15,0,15,_size[1]); - _scroll->setRange(0,y+tall-_size[1]); -} - -void ListPanel::setPixelScroll(int value) -{ - _vpanel->setPos(0,value); - repaint(); - _vpanel->repaint(); -} - -void ListPanel::translatePixelScroll(int delta) -{ - int x,y; - _vpanel->getPos(x,y); - _vpanel->setPos(0,y+delta); - repaint(); - _vpanel->repaint(); -} diff --git a/utils/vgui/lib/LoweredBorder.cpp b/utils/vgui/lib/LoweredBorder.cpp deleted file mode 100644 index c389be2a..00000000 --- a/utils/vgui/lib/LoweredBorder.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -LoweredBorder::LoweredBorder() : Border() -{ - setInset(2,2,2,2); -} - -void LoweredBorder::paint(Panel* panel) -{ - int wide,tall; - panel->getSize(wide,tall); - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(0,0,wide,2); - drawFilledRect(0,2,2,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(1,tall-2,wide,tall); - drawFilledRect(wide-2,1,wide,tall-1); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(1,1,wide-1,2); - drawFilledRect(1,2,2,tall-1); -} diff --git a/utils/vgui/lib/Menu.cpp b/utils/vgui/lib/Menu.cpp deleted file mode 100644 index fa6ec75e..00000000 --- a/utils/vgui/lib/Menu.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -Menu::Menu(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - setBorder(new RaisedBorder()); - setLayout(new StackLayout(1,true)); -} - -Menu::Menu(int wide,int tall) : Panel(0,0,wide,tall) -{ - setBorder(new RaisedBorder()); - setLayout(new StackLayout(1,true)); -} - -void Menu::addMenuItem(Panel* panel) -{ - addChild(panel); -} diff --git a/utils/vgui/lib/MenuItem.cpp b/utils/vgui/lib/MenuItem.cpp deleted file mode 100644 index df4720f3..00000000 --- a/utils/vgui/lib/MenuItem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -MenuItem::MenuItem(const char* text) : Button(text,0,0) -{ - setButtonBorderEnabled(false); - _subMenu=null; -} - -MenuItem::MenuItem(const char* text,Menu* subMenu) : Button(text,0,0) -{ - setButtonBorderEnabled(false); - _subMenu=subMenu; -} diff --git a/utils/vgui/lib/MenuSeparator.cpp b/utils/vgui/lib/MenuSeparator.cpp deleted file mode 100644 index abed2e7f..00000000 --- a/utils/vgui/lib/MenuSeparator.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -MenuSeparator::MenuSeparator(const char* text) : Label(text) -{ - setFont(Scheme::sf_primary3); -} - -void MenuSeparator::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); - - int textWide,textTall; - int gap=2; - int tgap=2; - - getTextSize(textWide,textTall); - - if(textWide>0) - { - textWide+=(gap*2); - } - - int wide2=(textWide/2); - int tall2=(textTall/2)-(tgap/2); - int x0=(wide/2)-wide2; - int x1=(wide/2)+wide2; - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(gap,tall2,x0,tall2+(tgap/2)); - drawFilledRect(x1,tall2,wide-gap,tall2+(tgap/2)); - - drawSetColor(Scheme::sc_white); - drawFilledRect(gap,tall2+(tgap/2),x0,tall2+tgap); - drawFilledRect(x1,tall2+(tgap/2),wide-gap,tall2+tgap); -} diff --git a/utils/vgui/lib/MessageBox.cpp b/utils/vgui/lib/MessageBox.cpp deleted file mode 100644 index 03c0d702..00000000 --- a/utils/vgui/lib/MessageBox.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooButtonHandler : public ActionSignal -{ -private: - MessageBox* _messageBox; -public: - FooButtonHandler(MessageBox* messageBox) - { - _messageBox=messageBox; - } -public: - virtual void actionPerformed(Panel* panel) - { - _messageBox->fireActionSignal(); - } -}; -} - -MessageBox::MessageBox(const char* title,const char* text,int x,int y) : Frame(x,y,64,64) -{ - setTitle(title); - setMenuButtonVisible(false); - setTrayButtonVisible(false); - setMinimizeButtonVisible(false); - setMaximizeButtonVisible(false); - setCloseButtonVisible(false); - setSizeable(false); - - _messageLabel=new Label(text); - _messageLabel->setParent(getClient()); - - _okButton=new Button("Ok",10,10); - _okButton->setParent(getClient()); - _okButton->addActionSignal(new FooButtonHandler(this)); - - int wide,tall; - _messageLabel->getSize(wide,tall); - setSize(wide+100,tall+100); -} - -void MessageBox::addActionSignal(ActionSignal* s) -{ - _actionSignalDar.putElement(s); -} - -void MessageBox::fireActionSignal() -{ - for(int i=0;i<_actionSignalDar.getCount();i++) - { - _actionSignalDar[i]->actionPerformed(this); - } -} - -void MessageBox::performLayout() -{ - int wide,tall; - getClient()->getSize(wide,tall); - - _messageLabel->setPos((wide/2)-(_messageLabel->getWide()/2),(tall/2)-(_messageLabel->getTall()/2)); - _okButton->setPos((wide/2)-(_okButton->getWide()/2),(tall/2)-(_okButton->getTall()/2)); -} diff --git a/utils/vgui/lib/MiniApp.cpp b/utils/vgui/lib/MiniApp.cpp deleted file mode 100644 index 061b675f..00000000 --- a/utils/vgui/lib/MiniApp.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -MiniApp::MiniApp() -{ - _name=null; -} - -void MiniApp::getName(char* buf,int bufLen) -{ - if(buf==null) - { - return; - } - - int len=strlen(_name)+1; - if(len>bufLen) - { - len=bufLen; - } - - memcpy(buf,_name,len-1); - buf[len-1]=0; -} - -void MiniApp::setName(const char* name) -{ - _name=strdup(_name); -} diff --git a/utils/vgui/lib/Panel.cpp b/utils/vgui/lib/Panel.cpp deleted file mode 100644 index 489dfd0b..00000000 --- a/utils/vgui/lib/Panel.cpp +++ /dev/null @@ -1,1216 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -void Panel::init(int x,int y,int wide,int tall) -{ - _pos[0]=x; - _pos[1]=y; - _size[0]=wide; - _size[1]=tall; - _loc[0]=0; - _loc[1]=0; - _needsRepaint=false; - _parent=null; - _surfaceBase=null; - _visible=true; - _minimumSize[0]=0; - _minimumSize[1]=0; - _cursor=null; - _schemeCursor=Scheme::scu_arrow; - _layout=null; - _needsLayout=true; - _focusNavGroup=null; - _border=null; - _buildGroup=null; - _enabled=true; - _layoutInfo=null; - _paintBorderEnabled=true; - _paintBackgroundEnabled=true; - _paintEnabled=true; - setFgColor(Scheme::sc_black); - setBgColor(Scheme::sc_secondary3); - setAutoFocusNavEnabled(true); -} - -Panel::Panel() -{ - init(0,0,64,64); -} - -Panel::Panel(int x,int y,int wide,int tall) -{ - init(x,y,wide,tall); -} - -void Panel::setPos(int x,int y) -{ - _pos[0]=x; - _pos[1]=y; -} - -void Panel::getPos(int& x,int& y) -{ - x=_pos[0]; - y=_pos[1]; -} - -void Panel::setSize(int wide,int tall) -{ - if (wide<_minimumSize[0]) - { - wide=_minimumSize[0]; - } - if (tall<_minimumSize[1]) - { - tall=_minimumSize[1]; - } - - _size[0]=wide; - _size[1]=tall; -} - -void Panel::getSize(int& wide,int& tall) -{ - wide=_size[0]; - tall=_size[1]; -} - -void Panel::setBounds(int x,int y,int wide,int tall) -{ - setPos(x,y); - setSize(wide,tall); -} - -void Panel::getBounds(int& x,int& y,int& wide,int& tall) -{ - getPos(x,y); - getSize(wide,tall); -} - -Panel* Panel::getParent() -{ - return _parent; -} - -void Panel::setVisible(bool state) -{ - _visible=state; -} - -bool Panel::isVisible() -{ - return _visible; -} - -bool Panel::isVisibleUp() -{ - Panel* trav=this; - while(trav!=null) - { - if(trav->_visible==false) - { - return false; - } - trav=trav->getParent(); - } - return true; -} - -void Panel::repaint() -{ - _needsRepaint=true; - - if(_surfaceBase!=null) - { - _surfaceBase->_needsSwap=true; - _surfaceBase->invalidate(this); - } - - for(int i=0;i<_repaintSignalDar.getCount();i++) - { - _repaintSignalDar[i]->panelRepainted(this); - } -} - -void Panel::repaintAll() -{ - _surfaceBase->getPanel()->repaint(); -} - -void Panel::solveTraverse() -{ - if(!_visible) - { - return; - } - - solve(); - - if(_needsLayout) - { - internalPerformLayout(); - } - - solve(); - - for(int i=0;i<_childDar.getCount();i++) - { - _childDar[i]->solveTraverse(); - } -} - -void Panel::solve() -{ - _loc[0] = _pos[0]; - _loc[1] = _pos[1]; - - // put into parent space - if (_parent) - { - int pinset[4]; - _parent->getInset(pinset[0],pinset[1],pinset[2],pinset[3]); - - _loc[0]+=_parent->_loc[0]+pinset[0]; - _loc[1]+=_parent->_loc[1]+pinset[1]; - } - - // set initial bounds - _clipRect[0] = _loc[0]; - _clipRect[1] = _loc[1]; - - _clipRect[2] = _loc[0] + _size[0]; - _clipRect[3] = _loc[1] + _size[1]; - - // clip to parent - if (_parent) - { - if (_clipRect[0] < _parent->_clipRect[0]) - { - _clipRect[0] = _parent->_clipRect[0]; - } - - if (_clipRect[1] < _parent->_clipRect[1]) - { - _clipRect[1] = _parent->_clipRect[1]; - } - - if(_clipRect[2] > _parent->_clipRect[2]) - { - _clipRect[2] = _parent->_clipRect[2]; - } - - if(_clipRect[3] > _parent->_clipRect[3]) - { - _clipRect[3] = _parent->_clipRect[3]; - } - } -} - -void Panel::paintTraverse() -{ - paintTraverse(_needsRepaint); -} - -void Panel::paintTraverse(bool repaint) -{ - if(!_visible) - { - return; - } - - if(_needsRepaint) - { - repaint=true; - } - - _needsRepaint=false; - - if ((_clipRect[2] <= _clipRect[0]) || (_clipRect[3] <= _clipRect[1])) - { - repaint = false; - } - - if (repaint && (_paintBorderEnabled || _paintBackgroundEnabled || _paintEnabled)) - { - _surfaceBase->pushMakeCurrent(this, true); - if (_border != null && _paintBorderEnabled) - { - _border->doPaint(this); - } - if (_paintBackgroundEnabled) - { - paintBackground(); - } - if (_paintEnabled) - { - paint(); - } - _surfaceBase->popMakeCurrent(this); - } - - for(int i=0;i<_childDar.getCount();i++) - { - _childDar[i]->paintTraverse(repaint); - } - - if (repaint) - { - if (isBuildGroupEnabled() && hasFocus()) - { - _surfaceBase->pushMakeCurrent(this, false); - paintBuildOverlay(); - _surfaceBase->popMakeCurrent(this); - } - } - - if((_surfaceBase->_needsSwap)&&(_surfaceBase->getPanel()==this)) - { - _surfaceBase->_needsSwap=false; - _surfaceBase->swapBuffers(); - } -} - -void Panel::paintBackground() -{ - int wide,tall,r,g,b,a; - getPaintSize(wide,tall); - getBgColor(r,g,b,a); - drawSetColor(r,g,b,a); - drawFilledRect(0,0,wide,tall); -} - -void Panel::paint() -{ -} - -void Panel::paintBuildOverlay() -{ - int wide,tall; - getSize(wide,tall); - drawSetColor(Scheme::sc_black); - - drawFilledRect(0,0,wide,2); //top - drawFilledRect(0,tall-2,wide,tall); //bottom - drawFilledRect(0,2,2,tall-2); //left - drawFilledRect(wide-2,2,wide,tall-2); //right -} - -void Panel::drawSetColor(Scheme::SchemeColor sc) -{ - Scheme* scheme=getApp()->getScheme(); - drawSetColor(scheme->_color[sc][0],scheme->_color[sc][1],scheme->_color[sc][2],scheme->_color[sc][3]); -} - -void Panel::drawSetColor(int r,int g,int b,int a) -{ - _surfaceBase->drawSetColor(r,g,b,a); -} - -void Panel::drawFilledRect(int x0,int y0,int x1,int y1) -{ - _surfaceBase->drawFilledRect(x0,y0,x1,y1); -} - -void Panel::drawOutlinedRect(int x0,int y0,int x1,int y1) -{ - _surfaceBase->drawOutlinedRect(x0,y0,x1,y1); -} - -void Panel::drawSetTextFont(Scheme::SchemeFont sf) -{ - Scheme* scheme=getApp()->getScheme(); - _surfaceBase->drawSetTextFont(scheme->_font[sf]); -} - -void Panel::drawSetTextFont(Font* font) -{ - _surfaceBase->drawSetTextFont(font); -} - -void Panel::drawSetTextColor(Scheme::SchemeColor sc) -{ - Scheme* scheme=getApp()->getScheme(); - drawSetTextColor(scheme->_color[sc][0],scheme->_color[sc][1],scheme->_color[sc][2],scheme->_color[sc][3]); -} - -void Panel::drawSetTextColor(int r,int g,int b,int a) -{ - _surfaceBase->drawSetTextColor(r,g,b,a); -} - -void Panel::drawSetTextPos(int x,int y) -{ - _surfaceBase->drawSetTextPos(x,y); -} - -void Panel::drawPrintText(const char* str,int strlen) -{ - _surfaceBase->drawPrintText(str,strlen); -} - -void Panel::drawPrintText(int x,int y,const char* str,int strlen) -{ - _surfaceBase->drawSetTextPos(x,y); - _surfaceBase->drawPrintText(str,strlen); -} - -void Panel::drawPrintChar(char ch) -{ - _surfaceBase->drawPrintText(&ch,1); -} - -void Panel::drawPrintChar(int x,int y,char ch) -{ - _surfaceBase->drawSetTextPos(x,y); - _surfaceBase->drawPrintText(&ch,1); -} - -void Panel::drawSetTextureRGBA(int id,const char* rgba,int wide,int tall) -{ - if(_surfaceBase!=null) - { - _surfaceBase->drawSetTextureRGBA(id,rgba,wide,tall); - } -} - -void Panel::drawSetTexture(int id) -{ - _surfaceBase->drawSetTexture(id); -} - -void Panel::drawTexturedRect(int x0,int y0,int x1,int y1) -{ - _surfaceBase->drawTexturedRect(x0,y0,x1,y1); -} - -void Panel::getAbsExtents(int& x0,int& y0,int& x1,int& y1) -{ - x0=_loc[0]; - y0=_loc[1]; - x1=x0+_size[0]; - y1=y0+_size[1]; -} - -void Panel::setParent(Panel* newParent) -{ - if(_parent!=null) - { - _parent->removeChild(this); - } - - if(newParent!=null) - { - _parent=newParent; - _parent->_childDar.putElement(this); - setSurfaceBaseTraverse(_parent->_surfaceBase); - } -} - -void Panel::addChild(Panel* child) -{ - if(child->_parent!=null) - { - child->_parent->removeChild(child); - } - - child->_parent=this; - _childDar.putElement(child); - child->setSurfaceBaseTraverse(_surfaceBase); -} - -void Panel::insertChildAt(Panel* child,int index) -{ - if(_childDar.hasElement(child)) - { - return; - } - - if(child->_parent!=null) - { - child->_parent->removeChild(child); - } - - child->_parent=this; - _childDar.insertElementAt(child,index); - child->setSurfaceBaseTraverse(_surfaceBase); -} - -void Panel::removeChild(Panel* child) -{ - child->_parent=null; - child->_surfaceBase=null; - _childDar.removeElement(child); -} - -void Panel::setSurfaceBaseTraverse(SurfaceBase* surfaceBase) -{ - _surfaceBase=surfaceBase; - - for(int i=0;i<_childDar.getCount();i++) - { - _childDar[i]->setSurfaceBaseTraverse(surfaceBase); - } -} - -bool Panel::wasMousePressed(MouseCode code) -{ - return getApp()->wasMousePressed(code,this); -} - -bool Panel::wasMouseDoublePressed(MouseCode code) -{ - return getApp()->wasMouseDoublePressed(code,this); -} - -bool Panel::isMouseDown(MouseCode code) -{ - return getApp()->isMouseDown(code,this); -} - -bool Panel::wasMouseReleased(MouseCode code) -{ - return getApp()->wasMouseReleased(code,this); -} - -bool Panel::wasKeyPressed(KeyCode code) -{ - return getApp()->wasKeyPressed(code,this); -} - -bool Panel::isKeyDown(KeyCode code) -{ - return getApp()->isKeyDown(code,this); -} - -bool Panel::wasKeyTyped(KeyCode code) -{ - return getApp()->wasKeyTyped(code,this); -} - -bool Panel::wasKeyReleased(KeyCode code) -{ - return getApp()->wasKeyReleased(code,this); -} - -void Panel::addInputSignal(InputSignal* s) -{ - _inputSignalDar.putElement(s); -} - -void Panel::removeInputSignal(InputSignal* s) -{ - _inputSignalDar.removeElement(s); -} - -void Panel::addRepaintSignal(RepaintSignal* s) -{ - _repaintSignalDar.putElement(s); -} - -void Panel::removeRepaintSignal(RepaintSignal* s) -{ - _repaintSignalDar.removeElement(s); -} - -void Panel::internalCursorMoved(int x,int y) -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - _buildGroup->cursorMoved(x,y,this); - return; - } - - screenToLocal(x,y); - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->cursorMoved(x,y,this); - } -} - -void Panel::internalCursorEntered() -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->cursorEntered(this); - } -} - -void Panel::internalCursorExited() -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->cursorExited(this); - } -} - -void Panel::internalMousePressed(MouseCode code) -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - _buildGroup->mousePressed(code,this); - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->mousePressed(code,this); - } -} - -void Panel::internalMouseDoublePressed(MouseCode code) -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - _buildGroup->mouseDoublePressed(code,this); - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->mouseDoublePressed(code,this); - } -} - -void Panel::internalMouseReleased(MouseCode code) -{ - if(isCursorNone()) - { - return; - } - - if(isBuildGroupEnabled()) - { - _buildGroup->mouseReleased(code,this); - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->mouseReleased(code,this); - } -} - -void Panel::internalMouseWheeled(int delta) -{ - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->mouseWheeled(delta,this); - } -} - -void Panel::internalKeyPressed(KeyCode code) -{ - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->keyPressed(code,this); - } -} - -void Panel::internalKeyTyped(KeyCode code) -{ - if(isBuildGroupEnabled()) - { - _buildGroup->keyTyped(code,this); - return; - } - - if(code==KEY_TAB) - { - if(isAutoFocusNavEnabled()) - { - if(isKeyDown(KEY_LSHIFT)||isKeyDown(KEY_RSHIFT)) - { - requestFocusPrev(); - } - else - { - requestFocusNext(); - } - } - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->keyTyped(code,this); - } -} - -void Panel::internalKeyReleased(KeyCode code) -{ - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->keyReleased(code,this); - } -} - -void Panel::internalKeyFocusTicked() -{ - if(isBuildGroupEnabled()) - { - return; - } - - for(int i=0;i<_inputSignalDar.getCount();i++) - { - _inputSignalDar[i]->keyFocusTicked(this); - } -} - -void Panel::internalSetCursor() -{ - if(isBuildGroupEnabled()) - { - _buildGroup->getCursor(this); - } - - if(_surfaceBase!=null) - { - _surfaceBase->setCursor(getCursor()); - } -} - -bool Panel::isWithin(int x,int y) -{ - screenToLocal(x,y); - - if(x<0) - { - return false; - } - - if(y<0) - { - return false; - } - - if(x>=_size[0]) - { - return false; - } - - if(y>=_size[1]) - { - return false; - } - - return true; -} - -Panel* Panel::isWithinTraverse(int x,int y) -{ - if(!_visible) - { - return null; - } - - if(!isWithin(x,y)) - { - return null; - } - - for(int i=_childDar.getCount()-1;i>=0;i--) - { - Panel* panel=_childDar[i]->isWithinTraverse(x,y); - if(panel!=null) - { - return panel; - } - } - - return this; -} - -void Panel::localToScreen(int& x,int& y) -{ - x+=_loc[0]; - y+=_loc[1]; -} - -void Panel::screenToLocal(int& x,int& y) -{ - x-=_loc[0]; - y-=_loc[1]; -} - -void Panel::setCursor(Cursor* cursor) -{ - _schemeCursor=Scheme::scu_user; - _cursor=cursor; -} - -void Panel::setCursor(Scheme::SchemeCursor scu) -{ - _cursor=null; - _schemeCursor=scu; -} - -Cursor* Panel::getCursor() -{ - if(getApp()->getCursorOveride()!=null) - { - return getApp()->getCursorOveride(); - } - - if(_schemeCursor!=null) - { - return getApp()->getScheme()->getCursor(_schemeCursor); - } - - return _cursor; -} - -void Panel::setMinimumSize(int wide,int tall) -{ - _minimumSize[0]=wide; - _minimumSize[1]=tall; -} - -void Panel::requestFocus() -{ - getApp()->requestFocus(this); -} - -bool Panel::hasFocus() -{ - if(getApp()->getFocus()==this) - { - return true; - } - return false; -} - -void Panel::getClipRect(int& x0,int& y0,int& x1,int& y1) -{ - x0=_clipRect[0]; - y0=_clipRect[1]; - x1=_clipRect[2]; - y1=_clipRect[3]; -} - -int Panel::getChildCount() -{ - return _childDar.getCount(); -} - -Panel* Panel::getChild(int index) -{ - return _childDar[index]; -} - -void Panel::setLayout(Layout* layout) -{ - _layout=layout; - invalidateLayout(false); -} - -void Panel::invalidateLayout(bool layoutNow) -{ - _needsLayout=true; - - if(_needsLayout) - { - internalPerformLayout(); - } -} - -void Panel::performLayout() -{ -} - -void Panel::internalPerformLayout() -{ - _needsLayout=false; - - if(_layout!=null) - { - _layout->performLayout(this); - } - else - { - performLayout(); - } - - repaint(); -} - -void Panel::setFocusNavGroup(FocusNavGroup* focusNavGroup) -{ - _focusNavGroup=focusNavGroup; - - if(_focusNavGroup!=null) - { - _focusNavGroup->addPanel(this); - } -} - -void Panel::requestFocusPrev() -{ - if(_focusNavGroup!=null) - { - _focusNavGroup->requestFocusPrev(); - } -} - -void Panel::requestFocusNext() -{ - if(_focusNavGroup!=null) - { - _focusNavGroup->requestFocusNext(); - } -} - -void Panel::addFocusChangeSignal(FocusChangeSignal* s) -{ - _focusChangeSignalDar.putElement(s); -} - -void Panel::internalFocusChanged(bool lost) -{ - //if focus is gained tell the focusNavGroup about it so its current can be correct - if( (!lost) && (_focusNavGroup!=null) ) - { - _focusNavGroup->setCurrentPanel(this); - } - - for(int i=0;i<_focusChangeSignalDar.getCount();i++) - { - _focusChangeSignalDar[i]->focusChanged(lost,this); - } -} - -bool Panel::isAutoFocusNavEnabled() -{ - return _autoFocusNavEnabled; -} - -void Panel::setAutoFocusNavEnabled(bool state) -{ - _autoFocusNavEnabled=state; -} - -void Panel::setBorder(Border* border) -{ - _border=border; -} - -void Panel::getMinimumSize(int& wide,int& tall) -{ - wide=_minimumSize[0]; - tall=_minimumSize[1]; -} - -void Panel::setPaintBorderEnabled(bool state) -{ - _paintBorderEnabled=state; -} - -void Panel::setPaintBackgroundEnabled(bool state) -{ - _paintBackgroundEnabled=state; -} - -void Panel::setPaintEnabled(bool state) -{ - _paintEnabled=state; -} - -void Panel::getInset(int& left,int& top,int& right,int& bottom) -{ - if(_border!=null) - { - _border->getInset(left,top,right,bottom); - } - else - { - left=0; - top=0; - right=0; - bottom=0; - } -} - -void Panel::getPaintSize(int& wide,int& tall) -{ - wide=_size[0]; - tall=_size[1]; - - if(_border!=null) - { - int left,top,right,bottom; - _border->getInset(left,top,right,bottom); - wide-=(right+left); - tall-=(bottom+top); - } -} - -void Panel::setPreferredSize(int wide,int tall) -{ - _preferredSize[0]=wide; - _preferredSize[1]=tall; -} - -void Panel::getPreferredSize(int& wide,int& tall) -{ - wide=_preferredSize[0]; - tall=_preferredSize[1]; -} - -SurfaceBase* Panel::getSurfaceBase() -{ - return _surfaceBase; -} - -int Panel::getWide() -{ - return _size[0]; -} - -int Panel::getTall() -{ - return _size[1]; -} - -bool Panel::isEnabled() -{ - return _enabled; -} - -void Panel::setEnabled(bool state) -{ - _enabled=state; -} - -void Panel::setBuildGroup(BuildGroup* buildGroup,const char* panelPersistanceName) -{ - //TODO: remove from old group - - assert(buildGroup!=null); - - _buildGroup=buildGroup; - - _buildGroup->panelAdded(this,panelPersistanceName); -} - -bool Panel::isBuildGroupEnabled() -{ - if(_buildGroup==null) - { - return false; - } - - return _buildGroup->isEnabled(); -} - -void Panel::removeAllChildren() -{ - _childDar.removeAll(); -} - -void Panel::repaintParent() -{ - if(_parent!=null) - { - _parent->repaint(); - } -} - -Panel* Panel::createPropertyPanel() -{ - TreeFolder* root=new TreeFolder("Properties"); - - TreeFolder* folder=new TreeFolder("Panel"); - folder->addChild(new Label("setPos")); - folder->addChild(new Label("setSize")); - folder->addChild(new Label("setBorder")); - folder->addChild(new Label("setLayout")); - root->addChild(folder); - - return root; -} - -void Panel::getPersistanceText(char* buf,int bufLen) -{ - const int version=0; - int x,y,wide,tall; - getBounds(x,y,wide,tall); - sprintf(buf,"->setBounds(%d,%d,%d,%d);\n",x,y,wide,tall); -} - -void Panel::applyPersistanceText(const char* buf) -{ -} - -void Panel::setFgColor(Scheme::SchemeColor sc) -{ - _fgColor.setColor(sc); -} - -void Panel::setBgColor(Scheme::SchemeColor sc) -{ - _bgColor.setColor(sc); -} - -void Panel::setFgColor(int r,int g,int b,int a) -{ - _fgColor.setColor(r,g,b,a); -} - -void Panel::setBgColor(int r,int g,int b,int a) -{ - _bgColor.setColor(r,g,b,a); -} - -void Panel::getFgColor(int& r,int& g,int& b,int& a) -{ - _fgColor.getColor(r,g,b,a); -} - -void Panel::getBgColor(int& r,int& g,int& b,int& a) -{ - _bgColor.getColor(r,g,b,a); -} - -void Panel::setAsMouseCapture(bool state) -{ - if(state) - { - getApp()->setMouseCapture(this); - } - else - { - getApp()->setMouseCapture(null); - } -} - -void Panel::setAsMouseArena(bool state) -{ - getApp()->setMouseArena(this); -} - -App* Panel::getApp() -{ - return App::getInstance(); -} - -void Panel::setBgColor(Color color) -{ - _bgColor=color; -} - -void Panel::setFgColor(Color color) -{ - _fgColor=color; -} - -void Panel::getBgColor(Color& color) -{ - color=_bgColor; -} - -void Panel::getFgColor(Color& color) -{ - color=_fgColor; -} - -void Panel::getVirtualSize(int& wide,int& tall) -{ - getSize(wide,tall); -} - -void Panel::setLayoutInfo(LayoutInfo* layoutInfo) -{ - _layoutInfo=layoutInfo; -} - -LayoutInfo* Panel::getLayoutInfo() -{ - return _layoutInfo; -} - -bool Panel::isCursorNone() -{ - Cursor* cursor=getCursor(); - - if(cursor==null) - { - return true; - } - - if(cursor->getDefaultCursor()==Cursor::dc_none) - { - return true; - } - - return false; -} diff --git a/utils/vgui/lib/PopupMenu.cpp b/utils/vgui/lib/PopupMenu.cpp deleted file mode 100644 index 1be4dd64..00000000 --- a/utils/vgui/lib/PopupMenu.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -PopupMenu::PopupMenu(int x,int y,int wide,int tall) : Menu(x,y,wide,tall) -{ -} - -PopupMenu::PopupMenu(int wide,int tall) : Menu(wide,tall) -{ -} - -void PopupMenu::showModal(Panel* panel) -{ - panel->getSurfaceBase()->createPopup(this); -} diff --git a/utils/vgui/lib/ProgressBar.cpp b/utils/vgui/lib/ProgressBar.cpp deleted file mode 100644 index 6d8ed462..00000000 --- a/utils/vgui/lib/ProgressBar.cpp +++ /dev/null @@ -1,68 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -ProgressBar::ProgressBar(int segmentCount) -{ - _segmentCount=segmentCount; - _progress=0; -} - -void ProgressBar::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(0,0,wide,tall); - - const int segmentGap=2; - int segmentWide=wide/_segmentCount-segmentGap; - - const float rr=0; - const float gg=0; - const float bb=100; - - int x=0; - - int litSeg=(int)floor(_progress); - for(int i=litSeg;i>0;i--) - { - drawSetColor((int)rr,(int)gg,(int)bb,0); - drawFilledRect(x,0,x+segmentWide,tall); - x+=segmentWide+segmentGap; - } - - if(_segmentCount>_progress) - { - float frac=_progress-(float)floor(_progress); - float r=0; - float g=255-(frac*155); - float b=0; - - drawSetColor((int)r,(int)g,(int)b,0); - drawFilledRect(x,0,x+segmentWide,tall); - } -} - -void ProgressBar::setProgress(float progress) -{ - if(_progress!=progress) - { - _progress=progress; - repaint(); - } -} - -int ProgressBar::getSegmentCount() -{ - return _segmentCount; -} diff --git a/utils/vgui/lib/RadioButton.cpp b/utils/vgui/lib/RadioButton.cpp deleted file mode 100644 index 1d07cd53..00000000 --- a/utils/vgui/lib/RadioButton.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include - -using namespace vgui; - -namespace -{ -class FooRadioImage : public Image -{ -public: - FooRadioImage(RadioButton* radioButton) : Image() - { - _radioButton=radioButton; - setSize(20,20); - } -public: - virtual void paint() - { - drawSetTextFont(Scheme::sf_secondary1); - drawSetTextColor(Scheme::sc_white); - drawPrintChar(0,0,'n'); - drawSetTextColor(Scheme::sc_secondary2); - drawPrintChar(0,0,'j'); - drawSetTextColor(Scheme::sc_white); - drawPrintChar(0,0,'k'); - drawSetTextColor(Scheme::sc_black); - drawPrintChar(0,0,'l'); - drawSetTextColor(Scheme::sc_secondary3); - drawPrintChar(0,0,'m'); - if(_radioButton->isSelected()) - { - drawSetTextColor(Scheme::sc_black); - drawPrintChar(0,0,'h'); - } - } -protected: - RadioButton* _radioButton; -}; - -} - -RadioButton::RadioButton(const char* text,int x,int y,int wide,int tall) : ToggleButton(text,x,y,wide,tall) -{ - setTextAlignment(Label::a_east); - setImage(new FooRadioImage(this)); -} - -RadioButton::RadioButton(const char* text,int x,int y) : ToggleButton(text,x,y) -{ - setTextAlignment(Label::a_east); - setImage(new FooRadioImage(this)); - - int wide,tall; - getContentSize(wide,tall); - setSize(wide,tall); -} - -void RadioButton::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); -} diff --git a/utils/vgui/lib/RaisedBorder.cpp b/utils/vgui/lib/RaisedBorder.cpp deleted file mode 100644 index cd7706b2..00000000 --- a/utils/vgui/lib/RaisedBorder.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -RaisedBorder::RaisedBorder() : Border() -{ - setInset(2,2,2,2); -} - -void RaisedBorder::paint(Panel* panel) -{ - int wide,tall; - panel->getSize(wide,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,wide,2); - drawFilledRect(0,2,2,tall); - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(2,tall-2,wide,tall); - drawFilledRect(wide-2,2,wide,tall-1); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(1,tall-1,wide,tall); - drawFilledRect(wide-1,1,wide,tall-1); -} diff --git a/utils/vgui/lib/Scheme.cpp b/utils/vgui/lib/Scheme.cpp deleted file mode 100644 index 15daeded..00000000 --- a/utils/vgui/lib/Scheme.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -Scheme::Scheme() -{ - setColor(sc_black,0,0,0,0); - setColor(sc_white,255,255,255,0); - setColor(sc_primary1,102,102,153,0); - setColor(sc_primary2,153,153,204,0); - setColor(sc_primary3,204,204,255,0); - setColor(sc_secondary1,102,102,102,0); - setColor(sc_secondary2,153,153,153,0); - setColor(sc_secondary3,204,204,204,0); - setColor(sc_user,0,0,0,0); - setFont(sf_primary1,new Font("Arial",0,0,20,0,0,400,false,false,false,false)); - setFont(sf_primary2,new Font("FixedSys",0,0,18,0,0,400,false,false,false,false)); - setFont(sf_primary3,new Font("Arial",0,0,12,0,0,400,false,false,false,false)); - setFont(sf_secondary1,new Font("Marlett",0,0,16,0,0,0,false,false,false,true)); - setCursor(scu_none,new Cursor(Cursor::dc_none)); - setCursor(scu_arrow,new Cursor(Cursor::dc_arrow)); - setCursor(scu_ibeam,new Cursor(Cursor::dc_ibeam)); - setCursor(scu_hourglass,new Cursor(Cursor::dc_hourglass)); - setCursor(scu_crosshair,new Cursor(Cursor::dc_crosshair)); - setCursor(scu_up,new Cursor(Cursor::dc_up)); - setCursor(scu_sizenwse,new Cursor(Cursor::dc_sizenwse)); - setCursor(scu_sizenesw,new Cursor(Cursor::dc_sizenesw)); - setCursor(scu_sizewe,new Cursor(Cursor::dc_sizewe)); - setCursor(scu_sizens,new Cursor(Cursor::dc_sizens)); - setCursor(scu_sizeall,new Cursor(Cursor::dc_sizeall)); - setCursor(scu_no,new Cursor(Cursor::dc_no)); - setCursor(scu_hand,new Cursor(Cursor::dc_hand)); -} - -void Scheme::setColor(SchemeColor sc,int r,int g,int b,int a) -{ - _color[sc][0]=r; - _color[sc][1]=g; - _color[sc][2]=b; - _color[sc][3]=a; -} - -void Scheme::getColor(SchemeColor sc,int& r,int& g,int& b,int& a) -{ - r=_color[sc][0]; - g=_color[sc][1]; - b=_color[sc][2]; - a=_color[sc][3]; -} - -void Scheme::setFont(SchemeFont sf,Font* font) -{ - _font[sf]=font; -} - -Font* Scheme::getFont(SchemeFont sf) -{ - return _font[sf]; -} - -void Scheme::setCursor(SchemeCursor scu,Cursor* cursor) -{ - _cursor[scu]=cursor; -} - -Cursor* Scheme::getCursor(SchemeCursor scu) -{ - return _cursor[scu]; -} diff --git a/utils/vgui/lib/ScrollBar.cpp b/utils/vgui/lib/ScrollBar.cpp deleted file mode 100644 index a0711ab5..00000000 --- a/utils/vgui/lib/ScrollBar.cpp +++ /dev/null @@ -1,262 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - - -namespace -{ -class FooDefaultScrollBarIntChangeSignal : public IntChangeSignal -{ -public: - FooDefaultScrollBarIntChangeSignal(ScrollBar* scrollBar) - { - _scrollBar=scrollBar; - } - virtual void intChanged(int value,Panel* panel) - { - _scrollBar->fireIntChangeSignal(); - } -protected: - ScrollBar* _scrollBar; -}; - -class FooDefaultButtonSignal : public ActionSignal -{ -public: - ScrollBar* _scrollBar; - int _buttonIndex; -public: - FooDefaultButtonSignal(ScrollBar* scrollBar,int buttonIndex) - { - _scrollBar=scrollBar; - _buttonIndex=buttonIndex; - } -public: - virtual void actionPerformed(Panel* panel) - { - _scrollBar->doButtonPressed(_buttonIndex); - } -}; - -} - -ScrollBar::ScrollBar(int x,int y,int wide,int tall,bool vertical) : Panel(x,y,wide,tall) -{ - _slider=null; - _button[0]=null; - _button[1]=null; - - if(vertical) - { - setSlider(new Slider(0,wide-1,wide,(tall-(wide*2))+2,true)); - setButton(new Button("",0,0,wide,wide),0); - setButton(new Button("",0,tall-wide,wide,wide),1); - } - else - { - // untested code - setSlider(new Slider(tall,0,wide-(tall*2),tall,false)); - setButton(new Button("",0,0,tall+1,tall+1),0); - setButton(new Button("",wide-tall,0,tall+1,tall+1),1); - } - - setPaintBorderEnabled(true); - setPaintBackgroundEnabled(true); - setPaintEnabled(true); - setButtonPressedScrollValue(15); - - validate(); - } - -void ScrollBar::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - - if(_slider==null) - { - return; - } - - if(_button[0]==null) - { - return; - } - - if(_button[1]==null) - { - return; - } - - getPaintSize(wide,tall); - - if(_slider->isVertical()) - { - _slider->setBounds(0,wide,wide,tall-(wide*2)); - //_slider->setBounds(0,0,wide,tall); - _button[0]->setBounds(0,0,wide,wide); - _button[1]->setBounds(0,tall-wide,wide,wide); - } - else - { - _slider->setBounds(tall,0,wide-(tall*2),tall); - //_slider->setBounds(0,0,wide,tall); - _button[0]->setBounds(0,0,tall,tall); - _button[1]->setBounds((wide-tall),0,tall,tall); - } -} - -void ScrollBar::performLayout() -{ -} - -void ScrollBar::setValue(int value) -{ - _slider->setValue(value); -} - -int ScrollBar::getValue() -{ - return _slider->getValue(); -} - -void ScrollBar::addIntChangeSignal(IntChangeSignal* s) -{ - _intChangeSignalDar.putElement(s); - _slider->addIntChangeSignal(new FooDefaultScrollBarIntChangeSignal(this)); -} - -void ScrollBar::setRange(int min,int max) -{ - _slider->setRange(min,max); -} - -void ScrollBar::fireIntChangeSignal() -{ - for(int i=0;i<_intChangeSignalDar.getCount();i++) - { - _intChangeSignalDar[i]->intChanged(_slider->getValue(),this); - } -} - -bool ScrollBar::isVertical() -{ - return _slider->isVertical(); -} - -bool ScrollBar::hasFullRange() -{ - return _slider->hasFullRange(); -} - -//LEAK: new and old slider will leak -void ScrollBar::setButton(Button* button,int index) -{ - if(_button[index]!=null) - { - removeChild(_button[index]); - } - _button[index]=button; - addChild(_button[index]); - - _button[index]->addActionSignal(new FooDefaultButtonSignal(this,index)); - - validate(); - - //_button[index]->setVisible(false); -} - -Button* ScrollBar::getButton(int index) -{ - return _button[index]; -} - -//LEAK: new and old slider will leak -void ScrollBar::setSlider(Slider *slider) -{ - if(_slider!=null) - { - removeChild(_slider); - } - _slider=slider; - addChild(_slider); - - _slider->addIntChangeSignal(new FooDefaultScrollBarIntChangeSignal(this)); - - validate(); -} - -Slider *ScrollBar::getSlider() -{ - return _slider; -} - -void ScrollBar::doButtonPressed(int buttonIndex) -{ - if(buttonIndex==0) - { - _slider->setValue(_slider->getValue()-_buttonPressedScrollValue); - } - else - { - _slider->setValue(_slider->getValue()+_buttonPressedScrollValue); - } - -} - -void ScrollBar::setButtonPressedScrollValue(int value) -{ - _buttonPressedScrollValue=value; -} - -void ScrollBar::setRangeWindow(int rangeWindow) -{ - _slider->setRangeWindow(rangeWindow); -} - -void ScrollBar::setRangeWindowEnabled(bool state) -{ - _slider->setRangeWindowEnabled(state); -} - -void ScrollBar::validate() -{ - if(_slider!=null) - { - int buttonOffset=0; - - for(int i=0;i<2;i++) - { - if(_button[i]!=null) - { - if(_button[i]->isVisible()) - { - if(_slider->isVertical()) - { - buttonOffset+=_button[i]->getTall(); - } - else - { - buttonOffset+=_button[i]->getWide(); - } - } - } - } - - _slider->setButtonOffset(buttonOffset); - } - - int wide,tall; - getSize(wide,tall); - setSize(wide,tall); -} diff --git a/utils/vgui/lib/ScrollPanel.cpp b/utils/vgui/lib/ScrollPanel.cpp deleted file mode 100644 index 55ea7e3e..00000000 --- a/utils/vgui/lib/ScrollPanel.cpp +++ /dev/null @@ -1,204 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -namespace -{ -class ChangeHandler : public IntChangeSignal -{ -private: - ScrollPanel* _scrollPanel; -public: - ChangeHandler(ScrollPanel* scrollPanel) - { - _scrollPanel=scrollPanel; - } -public: - virtual void intChanged(int value,Panel* panel) - { - _scrollPanel->recomputeScroll(); - } -}; -} - -ScrollPanel::ScrollPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - setPaintBorderEnabled(true); - setPaintBackgroundEnabled(false); - setPaintEnabled(false); - - _clientClip=new Panel(0,0,wide-16,tall-16); - _clientClip->setParent(this); - _clientClip->setBgColor(Color(0,128,0,0)); - _clientClip->setPaintBorderEnabled(true); - _clientClip->setPaintBackgroundEnabled(false); - _clientClip->setPaintEnabled(false); - - _client=new Panel(0,0,wide*2,tall*2); - _client->setParent(_clientClip); - _client->setPaintBorderEnabled(true); - _client->setPaintBackgroundEnabled(false); - _client->setPaintEnabled(false); - - _horizontalScrollBar=new ScrollBar(0,tall-16,wide-16,16,false); - _horizontalScrollBar->setParent(this); - _horizontalScrollBar->addIntChangeSignal(new ChangeHandler(this)); - _horizontalScrollBar->setVisible(false); - - _verticalScrollBar=new ScrollBar(wide-16,0,16,tall-16,true); - _verticalScrollBar->setParent(this); - _verticalScrollBar->addIntChangeSignal(new ChangeHandler(this)); - _verticalScrollBar->setVisible(false); - - _autoVisible[0]=true; - _autoVisible[1]=true; - - validate(); -} - -void ScrollPanel::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - getPaintSize(wide,tall); - - if(_autoVisible[0]) - { - _horizontalScrollBar->setVisible(!_horizontalScrollBar->hasFullRange()); - } - - if(_autoVisible[1]) - { - _verticalScrollBar->setVisible(!_verticalScrollBar->hasFullRange()); - } - - if(_verticalScrollBar->isVisible()) - { - wide-=_verticalScrollBar->getWide(); - } - - if(_horizontalScrollBar->isVisible()) - { - tall-=_horizontalScrollBar->getTall(); - } - - _verticalScrollBar->setBounds(wide,0,_verticalScrollBar->getWide(),tall); - _horizontalScrollBar->setBounds(0,tall,wide,_horizontalScrollBar->getTall()); - _clientClip->setSize(wide,tall); - recomputeClientSize(); - repaint(); -} - -void ScrollPanel::setScrollBarVisible(bool horizontal,bool vertical) -{ - _horizontalScrollBar->setVisible(horizontal); - _verticalScrollBar->setVisible(horizontal); - - validate(); -} - -Panel* ScrollPanel::getClient() -{ - return _client; -} - -Panel* ScrollPanel::getClientClip() -{ - return _clientClip; -} - -void ScrollPanel::setScrollValue(int horizontal,int vertical) -{ - _horizontalScrollBar->setValue(horizontal); - _verticalScrollBar->setValue(horizontal); - recomputeScroll(); -} - -void ScrollPanel::getScrollValue(int& horizontal,int& vertical) -{ - horizontal=_horizontalScrollBar->getValue(); - vertical=_verticalScrollBar->getValue(); -} - -void ScrollPanel::recomputeScroll() -{ - int x,y; - getScrollValue(x,y); - _client->setPos(-x,-y); - _clientClip->repaint(); -} - -void ScrollPanel::setScrollBarAutoVisible(bool horizontal,bool vertical) -{ - _autoVisible[0]=horizontal; - _autoVisible[1]=vertical; - - validate(); -} - -void ScrollPanel::recomputeClientSize() -{ - int wide=0; - int tall=0; - - for(int i=0;i<_client->getChildCount();i++) - { - Panel* child=_client->getChild(i); - if(child->isVisible()) - { - int x,y,w,t; - child->getPos(x,y); - child->getVirtualSize(w,t); - x+=w; - y+=t; - - if(x>wide) - { - wide=x; - } - if(t>tall) - { - tall=t; - } - } - } - - _client->setSize(wide,tall); - - _horizontalScrollBar->setRange(0,_client->getWide()-_clientClip->getWide()); - _horizontalScrollBar->setRangeWindow(_client->getWide()); - - _verticalScrollBar->setRange(0,_client->getTall()-_clientClip->getTall()); - _verticalScrollBar->setRangeWindow(_client->getTall()); -} - -ScrollBar* ScrollPanel::getHorizontalScrollBar() -{ - return _horizontalScrollBar; -} - -ScrollBar* ScrollPanel::getVerticalScrollBar() -{ - return _verticalScrollBar; -} - -void ScrollPanel::validate() -{ - _horizontalScrollBar->setRangeWindowEnabled(true); - _verticalScrollBar->setRangeWindowEnabled(true); - - int wide,tall; - getSize(wide,tall); - setSize(wide,tall); - setSize(wide,tall); - setSize(wide,tall); - setSize(wide,tall); -} diff --git a/utils/vgui/lib/Slider.cpp b/utils/vgui/lib/Slider.cpp deleted file mode 100644 index ad6770de..00000000 --- a/utils/vgui/lib/Slider.cpp +++ /dev/null @@ -1,449 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultSliderSignal : public InputSignal -{ -private: - Slider* _slider; -public: - FooDefaultSliderSignal(Slider* slider) - { - _slider=slider; - } -public: - void cursorMoved(int x,int y,Panel* panel) - { - _slider->privateCursorMoved(x,y,panel); - } - void cursorEntered(Panel* panel){} - void cursorExited(Panel* panel){} - void mouseDoublePressed(MouseCode code,Panel* panel){} - void mousePressed(MouseCode code,Panel* panel) - { - _slider->privateMousePressed(code,panel); - } - void mouseReleased(MouseCode code,Panel* panel) - { - _slider->privateMouseReleased(code,panel); - } - void mouseWheeled(int delta,Panel* panel){} - void keyPressed(KeyCode code,Panel* panel){} - void keyTyped(KeyCode code,Panel* panel){} - void keyReleased(KeyCode code,Panel* panel){} - void keyFocusTicked(Panel* panel){} -}; -} - -Slider::Slider(int x,int y,int wide,int tall,bool vertical) : Panel(x,y,wide,tall) -{ - _vertical=vertical; - _dragging=false; - _value=0; - _range[0]=0; - _range[1]=299; - _rangeWindow=0; - _rangeWindowEnabled=false; - _buttonOffset=0; - recomputeNobPosFromValue(); - addInputSignal(new FooDefaultSliderSignal(this)); -} - -void Slider::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - recomputeNobPosFromValue(); -} - -bool Slider::isVertical() -{ - return _vertical; -} - -void Slider::setValue(int value) -{ - int oldValue=_value; - - if(value<_range[0]) - { - value=_range[0]; - } - - if(value>_range[1]) - { - value=_range[1]; - } - - _value=value; - recomputeNobPosFromValue(); - - if(_value!=oldValue) - { - fireIntChangeSignal(); - } -} - -int Slider::getValue() -{ - return _value; -} - -void Slider::recomputeNobPosFromValue() -{ - int wide,tall; - - getPaintSize(wide,tall); - - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float fvalue=(float)(_value-_range[0]); - float fper=fvalue/frange; - float frangewindow=(float)(_rangeWindow); - - if(frangewindow<0) - { - frangewindow=0; - } - - if(!_rangeWindowEnabled) - { - frangewindow=frange; - } - - if ( frangewindow > 0 ) - { - if(_vertical) - { - float fnobsize=ftall/frangewindow*ftall; - float freepixels = ftall - fnobsize; - - float firstpixel = freepixels * fper; - - _nobPos[0]=(int)( firstpixel ); - _nobPos[1]=(int)( firstpixel + fnobsize ); - - if(_nobPos[1]>tall) - { - _nobPos[0]=tall-((int)fnobsize); - _nobPos[1]=tall; - } - } - else - { - float fnobsize=fwide/frangewindow*fwide; - float freepixels = fwide - fnobsize; - - float firstpixel = freepixels * fper; - - _nobPos[0]=(int)( firstpixel ); - _nobPos[1]=(int)( firstpixel + fnobsize ); - - if(_nobPos[1]>wide) - { - _nobPos[0]=wide-((int)fnobsize); - _nobPos[1]=wide; - } - } - } - - repaint(); -} - -void Slider::recomputeValueFromNobPos() -{ - int wide,tall; - getPaintSize(wide,tall); - - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float fvalue=(float)(_value-_range[0]); - float fnob=(float)_nobPos[0]; - float frangewindow=(float)(_rangeWindow); - - if(frangewindow<0) - { - frangewindow=0; - } - - if(!_rangeWindowEnabled) - { - frangewindow=frange; - } - - if ( frangewindow > 0 ) - { - float fnobsize; - - if(_vertical) - { - fnobsize=ftall/frangewindow*ftall; - fvalue=frange*(fnob/(ftall-fnobsize)); - } - else - { - fnobsize=fwide/frangewindow*fwide; - fvalue=frange*(fnob/(fwide-fnobsize)); - } - } - // Take care of rounding issues. - _value=(int)(fvalue+_range[0]+0.5); - - // Clamp final result - _value = ( _value < _range[1] ) ? _value : _range[1]; -} - -bool Slider::hasFullRange() -{ - int wide,tall; - getPaintSize(wide,tall); - - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float frangewindow=(float)(_rangeWindow); - - if(frangewindow<0) - { - frangewindow=0; - } - - if(!_rangeWindowEnabled) - { - frangewindow=frange; - } - - if ( frangewindow > 0 ) - { - if(_vertical) - { - if( frangewindow <= ( ftall + _buttonOffset ) ) - { - return true; - } - } - else - { - if( frangewindow <= ( fwide + _buttonOffset ) ) - { - return true; - } - } - } - - return false; -} - -void Slider::addIntChangeSignal(IntChangeSignal* s) -{ - _intChangeSignalDar.putElement(s); -} - -void Slider::fireIntChangeSignal() -{ - for(int i=0;i<_intChangeSignalDar.getCount();i++) - { - _intChangeSignalDar[i]->intChanged(getValue(),this); - } -} - -void Slider::paintBackground() -{ - int wide,tall; - getPaintSize(wide,tall); - - if (_vertical) - { - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(0,0,wide,1); // top - drawFilledRect(0,tall-1,wide,tall); // bottom - drawFilledRect(0,1,1,tall-1); // left - drawFilledRect(wide-1,1,wide,tall-1); // right - - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(1,1,wide-1,2); - drawFilledRect(1,2,3,tall-1); - drawFilledRect(2,_nobPos[1],wide-1,_nobPos[1]+1); - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(2,2,wide-1,tall-1); - - drawSetColor(Scheme::sc_primary1); - drawFilledRect(0,_nobPos[0],wide,_nobPos[0]+1); // top - drawFilledRect(0,_nobPos[1],wide,_nobPos[1]+1); // bottom - drawFilledRect(0,_nobPos[0]+1,1,_nobPos[1]); // left - drawFilledRect(wide-1,_nobPos[0]+1,wide,_nobPos[1]); // right - - drawSetColor(Scheme::sc_primary3); - drawFilledRect(1,_nobPos[0]+1,wide-1,_nobPos[0]+2); - drawFilledRect(1,_nobPos[0]+2,2,_nobPos[1]); - - drawSetColor(Scheme::sc_primary2); - drawFilledRect(2,_nobPos[0]+2,wide-1,_nobPos[1]); - } - else - { - //!! doesn't work - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); - - drawSetColor(Scheme::sc_black); - drawOutlinedRect(0,0,wide,tall); - - drawSetColor(Scheme::sc_primary2); - drawFilledRect(_nobPos[0],0,_nobPos[1],tall); - - drawSetColor(Scheme::sc_black); - drawOutlinedRect(_nobPos[0],0,_nobPos[1],tall); - } -} - -void Slider::setRange(int min,int max) -{ - if(maxmax) - { - min=max; - } - - _range[0]=min; - _range[1]=max; -} - -void Slider::getRange(int& min,int& max) -{ - min=_range[0]; - max=_range[1]; -} - -void Slider::privateCursorMoved(int x,int y,Panel* panel) -{ - if(!_dragging) - { - return; - } - - getApp()->getCursorPos(x,y); - screenToLocal(x,y); - - int wide,tall; - getPaintSize(wide,tall); - - if(_vertical) - { - _nobPos[0]=_nobDragStartPos[0]+(y-_dragStartPos[1]); - _nobPos[1]=_nobDragStartPos[1]+(y-_dragStartPos[1]); - - if(_nobPos[1]>tall) - { - _nobPos[0]=tall-(_nobPos[1]-_nobPos[0]); - _nobPos[1]=tall; - } - - if(_nobPos[0]<0) - { - _nobPos[1]=_nobPos[1]-_nobPos[0]; - _nobPos[0]=0; - } - } - else - { - _nobPos[0]=_nobDragStartPos[0]+(x-_dragStartPos[0]); - _nobPos[1]=_nobDragStartPos[1]+(x-_dragStartPos[0]); - - if(_nobPos[1]>wide) - { - _nobPos[0]=wide-(_nobPos[1]-_nobPos[0]); - _nobPos[1]=wide; - } - - if(_nobPos[0]<0) - { - _nobPos[1]=_nobPos[1]-_nobPos[0]; - _nobPos[0]=0; - } - } - - recomputeValueFromNobPos(); - repaint(); - fireIntChangeSignal(); -} - -void Slider::privateMousePressed(MouseCode code,Panel* panel) -{ - int x,y; - getApp()->getCursorPos(x,y); - screenToLocal(x,y); - - if(_vertical) - { - if((y>=_nobPos[0])&&(y<_nobPos[1])) - { - _dragging=true; - getApp()->setMouseCapture(this); - _nobDragStartPos[0]=_nobPos[0]; - _nobDragStartPos[1]=_nobPos[1]; - _dragStartPos[0]=x; - _dragStartPos[1]=y; - } - } - else - { - if((x>=_nobPos[0])&&(x<_nobPos[1])) - { - _dragging=true; - getApp()->setMouseCapture(this); - _nobDragStartPos[0]=_nobPos[0]; - _nobDragStartPos[1]=_nobPos[1]; - _dragStartPos[0]=x; - _dragStartPos[1]=y; - } - } - -} - -void Slider::privateMouseReleased(MouseCode code,Panel* panel) -{ - _dragging=false; - getApp()->setMouseCapture(null); -} - -void Slider::getNobPos(int& min, int& max) -{ - min=_nobPos[0]; - max=_nobPos[1]; -} - -void Slider::setRangeWindow(int rangeWindow) -{ - _rangeWindow=rangeWindow; -} - -void Slider::setRangeWindowEnabled(bool state) -{ - _rangeWindowEnabled=state; -} - -void Slider::setButtonOffset(int buttonOffset) -{ - _buttonOffset=buttonOffset; -} \ No newline at end of file diff --git a/utils/vgui/lib/StackLayout.cpp b/utils/vgui/lib/StackLayout.cpp deleted file mode 100644 index 5926c367..00000000 --- a/utils/vgui/lib/StackLayout.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -StackLayout::StackLayout(int vgap,bool fitWide) : Layout() -{ - _vgap=vgap; - _fitWide=fitWide; -} - -void StackLayout::performLayout(Panel* panel) -{ - int yy=0; - for(int i=0;igetChildCount();i++) - { - int x,y,wide,tall; - Panel* child=panel->getChild(i); - child->getBounds(x,y,wide,tall); - child->setPos(x,yy); - - if(_fitWide) - { - int pwide,ptall; - panel->getPaintSize(pwide,ptall); - child->setSize(pwide,tall); - } - y+=tall+_vgap; - } -} diff --git a/utils/vgui/lib/String.cpp b/utils/vgui/lib/String.cpp deleted file mode 100644 index 3d2b0109..00000000 --- a/utils/vgui/lib/String.cpp +++ /dev/null @@ -1,146 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -String::String() -{ - _text=""; -} - -String::String(const char* text) -{ - int len=getCount(text); - _text=new char[len+1]; - memcpy(_text,text,len); - _text[len]=0; -} - -String::String(const String& src) -{ - _text=src._text; -} - -String::~String() -{ - _text=null; -} - -int String::getCount(const char* text) -{ - int ctr; - for(ctr=0;;ctr++) - { - if(text[ctr]==0) - { - break; - } - } - return ctr; -} - -int String::getCount() -{ - return getCount(_text); -} - -String String::operator+(String text) -{ - int len0=getCount(); - int len1=text.getCount(); - - String* newString=new String(); - newString->_text=new char[len0+len1+1]; - memcpy(newString->_text,_text,len0); - memcpy(newString->_text+len0,text._text,len1); - newString->_text[len0+len1]=0; - - return String(*newString); -} - -String String::operator+(const char* text) -{ - int len0=getCount(); - int len1=getCount(text); - - String* newString=new String(); - newString->_text=new char[len0+len1+1]; - memcpy(newString->_text,_text,len0); - memcpy(newString->_text+len0,text,len1); - newString->_text[len0+len1]=0; - - return String(*newString); -} - -bool String::operator==(String text) -{ - char *text2=text._text; - - int ctr; - for(ctr=0;;ctr++) - { - if(_text[ctr]!=text2[ctr]) - { - return false; - } - if(_text[ctr]==0) - { - break; - } - } - return true; -} - -bool String::operator==(const char* text) -{ - int ctr; - for(ctr=0;;ctr++) - { - if(_text[ctr]!=text[ctr]) - { - return false; - } - if(_text[ctr]==0) - { - break; - } - } - return true; -} - -char String::operator[](int index) -{ - return _text[index]; -} - -const char* String::getChars() -{ - return _text; -} - -void String::test() -{ -#ifdef _WIN32 - printf("{\n"); - String aa("aa"); - printf("aa [%s]\n",aa); - String bb("bb"); - printf("bb [%s]\n",bb); - String cc("cc"); - printf("cc [%s]\n",cc); - String dd("dd"); - printf("dd [%s]\n",dd); - String aacc=aa+cc; - printf("aacc [%s]\n",aacc); - String aabb("aa"); - printf("}\n"); -#endif -} diff --git a/utils/vgui/lib/Surface.cpp b/utils/vgui/lib/Surface.cpp deleted file mode 100644 index ec0682b3..00000000 --- a/utils/vgui/lib/Surface.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -Surface::Surface(Panel* embeddedPanel) : SurfaceBase(embeddedPanel) -{ - createPlat(); - recreateContext(); -} - -void Surface::createPopup(Panel* embeddedPanel) -{ - embeddedPanel->setParent(null); - new Surface(embeddedPanel); -} \ No newline at end of file diff --git a/utils/vgui/lib/SurfaceBase.cpp b/utils/vgui/lib/SurfaceBase.cpp deleted file mode 100644 index a11ce63a..00000000 --- a/utils/vgui/lib/SurfaceBase.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -SurfaceBase::SurfaceBase(Panel* embeddedPanel) -{ - _embeddedPanel=embeddedPanel; - _needsSwap=true; - _emulatedCursor=new ImagePanel(null); - _emulatedCursor->setVisible(false); - _currentCursor=null; - _embeddedPanel->setSurfaceBaseTraverse(this); - getApp()->surfaceBaseCreated(this); - _emulatedCursor->setParent(getPanel()); -} - -SurfaceBase::~SurfaceBase() -{ - getApp()->surfaceBaseDeleted(this); -} - -Panel* SurfaceBase::getPanel() -{ - return _embeddedPanel; -} - -void SurfaceBase::requestSwap() -{ - _needsSwap=true; -} - -void SurfaceBase::resetModeInfo() -{ - _modeInfoDar.removeAll(); -} - -int SurfaceBase::getModeInfoCount() -{ - return _modeInfoDar.getCount(); -} - -bool SurfaceBase::getModeInfo(int index,int& wide,int& tall,int& bpp) -{ - if((index<0)||(index>=_modeInfoDar.getCount())) - { - return false; - } - - sscanf(_modeInfoDar[index],"%dx%dx%d",&wide,&tall,&bpp); - return true; -} - -void SurfaceBase::addModeInfo(int wide,int tall,int bpp) -{ - char buf[256]; - sprintf(buf,"%dx%dx%d",wide,tall,bpp); - _modeInfoDar.putElement(vgui_strdup(buf)); -} - -App* SurfaceBase::getApp() -{ - return App::getInstance(); -} - -void SurfaceBase::setEmulatedCursorVisible(bool state) -{ - _emulatedCursor->setVisible(state); -} - -void SurfaceBase::setEmulatedCursorPos(int x,int y) -{ - getPanel()->removeChild(_emulatedCursor); - getPanel()->addChild(_emulatedCursor); - getPanel()->screenToLocal(x,y); - - if((_currentCursor!=null)&&(!_emulatedCursor->isVisible())) - { - int hx,hy; - _currentCursor->getHotspot(hx,hy); - x-=hx; - y-=hy; - } - - _emulatedCursor->setPos(x,y); -} diff --git a/utils/vgui/lib/TabPanel.cpp b/utils/vgui/lib/TabPanel.cpp deleted file mode 100644 index 34b0507a..00000000 --- a/utils/vgui/lib/TabPanel.cpp +++ /dev/null @@ -1,266 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooTabPanelTab : public ToggleButton, public ActionSignal -{ -public: - FooTabPanelTab(TabPanel* tabPanel,const char* text,int x,int y) : ToggleButton(text,x,y) - { - _tabPanel=tabPanel; - addActionSignal(this); - } -public: - virtual bool isWithin(int x,int y) - { - return Panel::isWithin(x,y); - } - virtual void actionPerformed(Panel* panel) - { - _tabPanel->setSelectedTab(this); - } -protected: - virtual void paintBackground() - { - int wide,tall; - getPaintSize(wide,tall); - - if(isSelected()) - { - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(0,0,wide,1); - drawFilledRect(0,1,1,tall-1); - drawFilledRect(wide-1,1,wide,tall-1); - - drawSetColor(Scheme::sc_white); - drawFilledRect(1,1,wide-1,2); - drawFilledRect(1,2,2,tall); - drawFilledRect(0,tall-1,1,tall); - drawFilledRect(wide-1,tall-1,wide,tall); - } - else - { - drawSetColor(Scheme::sc_secondary2); - drawFilledRect(0,0,wide,tall); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(0,0,wide,1); - drawFilledRect(0,1,1,tall-1); - drawFilledRect(wide-1,1,wide,tall-1); - - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(1,1,wide-1,2); - drawFilledRect(1,2,2,tall); - drawFilledRect(0,tall-1,1,tall); - drawFilledRect(wide-1,tall-1,wide,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(0,tall-1,wide,tall); - } - } -protected: - TabPanel* _tabPanel; -}; - -class FooClientBorder : public Border -{ -protected: - virtual void paintBorder(Panel* panel) - { - int wide,tall; - panel->getSize(wide,tall); - - drawSetColor(Scheme::sc_black); - drawFilledRect(0,0,wide-1,1); - drawFilledRect(0,1,1,tall-1); - - drawSetColor(Scheme::sc_secondary1); - drawFilledRect(0,tall-1,wide,tall); - drawFilledRect(wide-1,0,wide,tall-1); - } -}; - -class FooTabAreaBorder : public Border -{ -protected: - virtual void paintBorder(Panel* panel) - { - int wide,tall; - panel->getSize(wide,tall); - - drawSetColor(Scheme::sc_white); - drawFilledRect(0,tall-1,wide,tall); - } -}; -} - -TabPanel::TabPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _tabPlacement=tp_top; - - _clientArea=new Panel(5,5,wide-10,tall-10); - _clientArea->setParent(this); - _clientArea->setBorder(new FooClientBorder()); - - _tabArea=new Panel(5,5,wide,5); - _tabArea->setParent(this); - _tabArea->setBorder(new FooTabAreaBorder()); - - _selectedTab=null; - _selectedPanel=null; - _buttonGroup=new ButtonGroup(); -} - -Panel* TabPanel::addTab(const char* text) -{ - FooTabPanelTab* tab=new FooTabPanelTab(this,text,0,0); - _tabArea->insertChildAt(tab,0); - tab->setButtonGroup(_buttonGroup); - - Panel* panel=new Panel(0,0,20,20); - _clientArea->insertChildAt(panel,0); - panel->setVisible(false); - - if(_selectedTab==null) - { - _selectedTab=tab; - _selectedPanel=panel; - panel->setVisible(true); - tab->setSelected(true); - } - - recomputeLayout(); - return panel; -} - -void TabPanel::setSelectedTab(Panel* tab) -{ - if(tab==null) - { - return; - } - - if(tab==_selectedTab) - { - return; - } - - for(int i=0;i<_tabArea->getChildCount();i++) - { - if(_tabArea->getChild(i)==tab) - { - _selectedPanel->setVisible(false); - _selectedPanel=_clientArea->getChild(i); - _selectedPanel->setVisible(true); - _selectedTab=tab; - break; - } - } - - recomputeLayout(); -} - -void TabPanel::recomputeLayoutTop() -{ - int x=0; - int y=0; - int i,wide,tall; - - int paintWide,paintTall; - getPaintSize(paintWide,paintTall); - - const int minx=5; - int maxx=paintWide-minx; - int inRowCount=0; - - x=minx; - for(i=_tabArea->getChildCount()-1;i>=0;i--) - { - _tabArea->getChild(i)->getPreferredSize(wide,tall); - _tabArea->getChild(i)->setSize(wide,tall); - if(x+wide>maxx) - { - if(inRowCount!=0) - { - int extra=(maxx-x)/inRowCount; - int error=maxx-(inRowCount*extra)-x; - int extraAccum=0; - for(int j=i+inRowCount;j>i;j--) - { - int ww,tt,xx,yy; - int extra2=extra; - if(j==i+inRowCount) - { - extra2+=error; - } - _tabArea->getChild(j)->getPreferredSize(ww,tt); - _tabArea->getChild(j)->getPos(xx,yy); - _tabArea->getChild(j)->setBounds(xx+extraAccum,yy,ww+extra2,tt); - extraAccum+=extra2; - } - } - maxx-=minx; - x=minx; - y-=tall-4; - inRowCount=0; - } - _tabArea->getChild(i)->setPos(x,y); - inRowCount++; - x+=wide-1; - } - - int miny; - _tabArea->getChild(0)->getPos(x,miny); - for(i=0;i<_tabArea->getChildCount();i++) - { - _tabArea->getChild(i)->getPos(x,y); - _tabArea->getChild(i)->setPos(x,y-miny); - } - - _tabArea->getChild(0)->getSize(wide,tall); - _tabArea->setBounds(0,5,paintWide,tall-miny); - _tabArea->getSize(wide,tall); - _clientArea->setBounds(0,tall+4,paintWide,paintTall-tall-5); - _clientArea->getSize(wide,tall); - - for(i=0;i<_clientArea->getChildCount();i++) - { - _clientArea->getChild(i)->setBounds(5,5,wide-10,tall-10); - _clientArea->getChild(i)->invalidateLayout(false); - } -} - -void TabPanel::recomputeLayout() -{ - if(_tabArea->getChildCount()!=0) - { - if(_tabPlacement==0) - { - recomputeLayoutTop(); - } - repaint(); - } -} - -void TabPanel::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - - recomputeLayout(); -} diff --git a/utils/vgui/lib/TablePanel.cpp b/utils/vgui/lib/TablePanel.cpp deleted file mode 100644 index 7a88ef9e..00000000 --- a/utils/vgui/lib/TablePanel.cpp +++ /dev/null @@ -1,440 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace vgui -{ -class FooVGuiTablePanelHandler : public ChangeSignal, public InputSignal, public RepaintSignal -{ -private: - TablePanel* _table; -public: - FooVGuiTablePanelHandler(TablePanel* table) - { - _table=table; - } -public: - virtual void valueChanged(Panel* panel) - { - HeaderPanel* header=dynamic_cast(panel); - - int cols=_table->getColumnCount(); - - for(int i=0;igetSectionCount()&&(igetSectionExtents(i,x0,x1); - _table->setColumnExtents(i,x0,x1); - } - } - virtual void cursorMoved(int x,int y,Panel* panel) - { - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - _table->privateMousePressed(code,panel); - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - _table->privateMouseDoublePressed(code,panel); - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - _table->privateKeyTyped(code,panel); - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } - virtual void panelRepainted(Panel* panel) - { - _table->repaint(); - } -}; -} - -TablePanel::TablePanel(int x,int y,int wide,int tall,int columnCount) : Panel(x,y,wide,tall) -{ - setGridSize(2,2); - setGridVisible(false,false); - setColumnCount(columnCount); - setFgColor(Color(Scheme::sc_black)); - _selectedCell[0]=-1; - _selectedCell[1]=-1; - _fakeInputPanel=new Panel(); - _columnSelectionEnabled=false; - _rowSelectionEnabled=true; - _cellSelectionEnabled=true; - _mouseOverCell[0]=0; - _mouseOverCell[1]=0; - _editableCell[0]=-1; - _editableCell[1]=-1; - _editableCellPanel=null; - _virtualSize[0]=wide; - _virtualSize[1]=tall; - _cellEditingEnabled=true; - addInputSignal(new FooVGuiTablePanelHandler(this)); -} - -void TablePanel::setCellEditingEnabled(bool state) -{ - _cellEditingEnabled=state; -} - -void TablePanel::setGridSize(int wide,int tall) -{ - _gridWide=wide; - _gridTall=tall; -} - -void TablePanel::setGridVisible(bool horizontal,bool vertical) -{ - _gridVisible[0]=horizontal; - _gridVisible[1]=horizontal; // vertical? -} - -void TablePanel::setColumnCount(int columnCount) -{ - _columnDar.ensureCapacity(columnCount); - _columnDar.setCount(columnCount); -} - -int TablePanel::getColumnCount() -{ - return _columnDar.getCount(); -} - -void TablePanel::setColumnExtents(int column,int x0,int x1) -{ - _columnDar.setElementAt((x0<<12)+x1,column); - repaint(); -} - -void TablePanel::setSelectedCell(int column,int row) -{ - if((_selectedCell[0]!=column)||(_selectedCell[1]!=row)) - { - repaint(); - stopCellEditing(); - } - _selectedCell[0]=column; - _selectedCell[1]=row; -} - -void TablePanel::getSelectedCell(int& column,int& row) -{ - column=_selectedCell[0]; - row=_selectedCell[1]; -} - -void TablePanel::setColumnSelectionEnabled(bool state) -{ - _columnSelectionEnabled=state; - repaint(); -} - -void TablePanel::setRowSelectionEnabled(bool state) -{ - _rowSelectionEnabled=state; - repaint(); -} - -void TablePanel::setCellSectionEnabled(bool state) -{ - _cellSelectionEnabled=state; - repaint(); -} - -void TablePanel::setEditableCell(int column,int row) -{ - if((_editableCell[0]!=column)||(_editableCell[1]!=row)) - { - stopCellEditing(); - _editableCellPanel=startCellEditing(column,row); - if(_editableCellPanel!=null) - { - _editableCellPanel->setParent(this); - } - } - _editableCell[0]=column; - _editableCell[1]=row; -} - -void TablePanel::stopCellEditing() -{ - if(_editableCellPanel!=null) - { - _editableCellPanel->setParent(null); - _editableCellPanel=null; - _editableCell[0]=-1; - _editableCell[1]=-1; - } -} - -void TablePanel::setHeaderPanel(HeaderPanel* header) -{ - header->addChangeSignal(new FooVGuiTablePanelHandler(this)); - header->fireChangeSignal(); - repaint(); -} - -void TablePanel::privateMousePressed(MouseCode code,Panel* panel) -{ - if(!_cellEditingEnabled) - { - return; - } - - setSelectedCell(_mouseOverCell[0],_mouseOverCell[1]); - requestFocus(); -} - -void TablePanel::privateMouseDoublePressed(MouseCode code,Panel* panel) -{ - if(!_cellEditingEnabled) - { - return; - } - - setSelectedCell(_mouseOverCell[0],_mouseOverCell[1]); - int column,row; - getSelectedCell(column,row); - setEditableCell(_mouseOverCell[0],_mouseOverCell[1]); -} - -void TablePanel::privateKeyTyped(KeyCode code,Panel* panel) -{ - if(!_cellEditingEnabled) - { - return; - } - - int column,row; - getSelectedCell(column,row); - - switch(code) - { - case KEY_UP: - { - row--; - if(row<0) - { - row=0; - } - setSelectedCell(column,row); - break; - } - case KEY_DOWN: - { - row++; - setSelectedCell(column,row); - break; - } - case KEY_LEFT: - { - column--; - if(column<0) - { - column=0; - } - setSelectedCell(column,row); - break; - } - case KEY_RIGHT: - { - column++; - setSelectedCell(column,row); - break; - } - case KEY_ENTER: - { - setEditableCell(column,row); - break; - } - } -} - -void TablePanel::paint() -{ - int x0gap=(_gridWide/2)-1; - int x1gap=_gridWide-x0gap; - - int i,wide,tall,maxX; - getPaintSize(wide,tall); - - Color fgColor; - getFgColor(fgColor); - int r,g,b,a; - fgColor.getColor(r,g,b,a); - - if(_gridVisible[1]) - { - maxX=0; - for(i=0;i<_columnDar.getCount();i++) - { - maxX=(_columnDar[i]&0xFFF); - int x0=maxX+x0gap; - int x1=maxX-x1gap; - drawSetColor(r,g,b,a); - drawFilledRect(x1,0,x0,tall); - } - } - else - { - maxX=wide; - } - if(_gridVisible[0]) - { - int y0=0; - for(int j=0;j>12)&0xFFF; - int x1=(_columnDar[i])&0xFFF; - - x0+=x0gap; - x1-=x1gap; - - if(x1>_virtualSize[0]) - { - _virtualSize[0]=x1; - } - - int y0=_gridTall; - for(int j=0;jsetBounds(x0,y0,x1-x0,getCellTall(j)); - _editableCellPanel->repaint(); - _editableCellPanel->solveTraverse(); - } - } - else - { - Panel* panel=getCellRenderer(i,j,columnSelected,rowSelected,cellSelected); - if(panel) - { - panel->setParent(this); - panel->setBounds(x0,y0,x1-x0,getCellTall(j)); - panel->repaint(); - panel->solveTraverse(); - panel->paintTraverse(); - panel->setParent(null); - } - } - - y0+=_gridTall+getCellTall(j); - if(y0>_virtualSize[1]) - { - _virtualSize[1]=x1; - } - } - } -} - -Panel* TablePanel::isWithinTraverse(int x,int y) -{ - Panel* panel=Panel::isWithinTraverse(x,y); - if(panel!=this) - { - return panel; - } - - int x0gap=(_gridWide/2)-1; - int x1gap=_gridWide-x0gap; - - for(int i=0;i<_columnDar.getCount();i++) - { - int x0=(_columnDar[i]>>12)&0xFFF; - int x1=(_columnDar[i])&0xFFF; - - x0+=x0gap; - x1-=x1gap; - - int y0=_gridTall; - for(int j=0;jsetParent(this); - _fakeInputPanel->setBounds(x0,y0,x1-x0,getCellTall(j)); - _fakeInputPanel->solveTraverse(); - panel=_fakeInputPanel->isWithinTraverse(x,y); - _fakeInputPanel->setParent(null); - - if(panel==_fakeInputPanel) - { - _mouseOverCell[0]=i; - _mouseOverCell[1]=j; - return this; - } - - y0+=_gridTall+getCellTall(j); - } - } - - return this; -} - -void TablePanel::getVirtualSize(int& wide,int& tall) -{ - wide=_virtualSize[0]; - tall=_virtualSize[1]; -} diff --git a/utils/vgui/lib/TaskBar.cpp b/utils/vgui/lib/TaskBar.cpp deleted file mode 100644 index b6f0687a..00000000 --- a/utils/vgui/lib/TaskBar.cpp +++ /dev/null @@ -1,157 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooClock : public Panel, public TickSignal -{ -public: - FooClock(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) - { - _hour=0; - _minute=0; - _second=0; - getApp()->addTickSignal(this); - } - virtual void paintBackground() - { - char buf[50]; - if(_hour>12) - { - sprintf(buf,"%d:%.2d:%.2d PM",_hour-12,_minute,_second); - } - else - { - sprintf(buf,"%d:%.2d:%.2d AM",_hour,_minute,_second); - } - - Panel::paintBackground(); - drawSetTextFont(Scheme::sf_primary1); - drawSetTextColor(Scheme::sc_black); - drawPrintText(buf,strlen(buf)); - } - virtual void ticked() - { - struct tm* newtime; - time_t aclock; - time(&aclock); - newtime=localtime(&aclock); - - int hour=newtime->tm_hour; - int minute=newtime->tm_min; - int second=newtime->tm_sec; - if((_hour!=hour)||(_minute!=minute)||(_second!=second)) - { - _hour=hour; - _minute=minute; - _second=second; - repaint(); - } - } -protected: - int _hour; - int _minute; - int _second; -}; - -class FooTaskBarButtonHandler : public ActionSignal, public FrameSignal, public FocusChangeSignal -{ -public: - FooTaskBarButtonHandler(Button* button,Frame* frame) - { - _button=button; - _frame=frame; - } -public: - virtual void actionPerformed(Panel* panel) - { - _frame->setVisible(true); - _frame->requestFocus(); - } - virtual void closing(Frame* frame) - { - } - virtual void minimizing(Frame* frame,bool toTray) - { - _frame->setVisible(false); - _frame->getApp()->requestFocus(null); - } - virtual void focusChanged(bool lost,Panel* panel) - { - _button->setSelected(!lost); - } -protected: - Button* _button; - Frame* _frame; -}; -} - -TaskBar::TaskBar(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - setBorder(new RaisedBorder()); - - _tray=new Panel(100,0,120,26); - _tray->setBorder(new LoweredBorder()); - _tray->setParent(this); - - FooClock* clock=new FooClock(25,2,85,20); - clock->setParent(_tray); -} - -void TaskBar::addFrame(Frame* frame) -{ - _frameDar.addElement(frame); - - char buf[256]; - frame->getTitle(buf,sizeof(buf)); - - Button* button=new Button(buf,2,2); - FooTaskBarButtonHandler* handler=new FooTaskBarButtonHandler(button,frame); - button->setParent(this); - button->addActionSignal(handler); - frame->addFrameSignal(handler); - frame->addFocusChangeSignal(handler); - _taskButtonDar.addElement(button); - - invalidateLayout(false); -} - -void TaskBar::performLayout() -{ - int wide,tall; - getPaintSize(wide,tall); - - int twide,ttall; - _tray->getSize(twide,ttall); - _tray->setBounds(wide-twide-3,2,twide,tall-4); - - int xx=3; - for(int i=0;i<_taskButtonDar.getCount();i++) - { - Button* button=_taskButtonDar[i]; - - int x,y; - button->getBounds(x,y,wide,tall); - button->setPos(xx,y); - xx+=wide+3; - } -} diff --git a/utils/vgui/lib/TextEntry.cpp b/utils/vgui/lib/TextEntry.cpp deleted file mode 100644 index eb10a403..00000000 --- a/utils/vgui/lib/TextEntry.cpp +++ /dev/null @@ -1,552 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultTextEntrySignal : public FocusChangeSignal -{ -public: - FooDefaultTextEntrySignal(TextEntry* textEntry) - { - _textEntry=textEntry; - } -public: - virtual void focusChanged(bool lost,Panel* panel) - { - _textEntry->resetCursorBlink(); - _textEntry->doSelectNone(); - } -protected: - TextEntry* _textEntry; -}; -} - -TextEntry::TextEntry(const char* text,int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _font=null; - _hideText=false; - _cursorPos=0; - _cursorBlinkRate=400; - _select[0]=-1; - _select[1]=-1; - - resetCursorBlink(); - setText(text,strlen(text)); - doGotoEndOfLine(); - addInputSignal(this); - addFocusChangeSignal(new FooDefaultTextEntrySignal(this)); -} - -void TextEntry::setText(const char* text,int textLen) -{ - _lineDar.removeAll(); - _lineDar.ensureCapacity(textLen); - - for(int i=0;igetTimeMillis()+_cursorBlinkRate; -} - -void TextEntry::setTextHidden(bool bHideText) -{ - _hideText=bHideText; - repaint(); -} - -int TextEntry::cursorToPixelSpace(int cursorPos) -{ - Font* font=_font; - if(font==null) - { - font=getApp()->getScheme()->getFont(Scheme::sf_primary1); - } - - int cx=0; - for(int i=0;i<_lineDar.getCount();i++) - { - if(i==cursorPos) - { - break; - } - - int a,b,c; - if(_hideText) - { - font->getCharABCwide('*',a,b,c); - } - else - { - font->getCharABCwide(_lineDar[i],a,b,c); - } - cx+=a+b+c; - } - - return cx; -} - -void TextEntry::paintBackground() -{ - Font* font=_font; - if(font==null) - { - font=getApp()->getScheme()->getFont(Scheme::sf_primary1); - } - - int fTall=font->getTall(); - - int x0,x1; - if(getSelectedPixelRange(x0,x1)) - { - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,x0,fTall+1); - drawFilledRect(x1,0,_size[0],fTall+1); - drawSetColor(0,0,200,0); - drawFilledRect(x0,0,x1,fTall+1); - } - else - { - drawSetColor(Scheme::sc_white); - drawFilledRect(0,0,_size[0],_size[1]); - } - - drawSetTextFont(font); - drawSetColor(Scheme::sc_black); - drawSetTextPos(3,0); - - for(int i=0;i<_lineDar.getCount();i++) - { - if(_hideText) - { - drawPrintChar('*'); - } - else - { - drawPrintChar(_lineDar[i]); - } - } - - if(hasFocus()) - { - drawSetColor(Scheme::sc_black); - drawFilledRect(0,0,_size[0],1); - drawFilledRect(0,_size[1]-1,_size[0],_size[1]); - drawFilledRect(0,1,1,_size[1]-1); - drawFilledRect(_size[0]-1,1,_size[0],_size[1]-1); - - if(!_cursorBlink) - { - int cx=cursorToPixelSpace(_cursorPos); - drawSetColor(Scheme::sc_black); - drawFilledRect(cx+3,2,cx+4,fTall-1); - } - } -} - -void TextEntry::cursorMoved(int x,int y,Panel* panel) -{ -} - -void TextEntry::cursorEntered(Panel* panel) -{ -} - -void TextEntry::cursorExited(Panel* panel) -{ -} - -void TextEntry::mousePressed(MouseCode code,Panel* panel) -{ - resetCursorBlink(); - requestFocus(); - repaint(); -} - -void TextEntry::mouseDoublePressed(MouseCode code,Panel* panel) -{ -} - -void TextEntry::mouseReleased(MouseCode code,Panel* panel) -{ -} - -void TextEntry::mouseWheeled(int delta,Panel* panel) -{ -} - -void TextEntry::keyPressed(KeyCode code,Panel* panel) -{ -} - -void TextEntry::keyTyped(KeyCode code,Panel* panel) -{ - bool shift=(panel->isKeyDown(KEY_LSHIFT)||panel->isKeyDown(KEY_RSHIFT)); - bool ctrl=(panel->isKeyDown(KEY_LCONTROL)||panel->isKeyDown(KEY_RCONTROL)); - - if(ctrl) - { - switch(code) - { - case KEY_C: - { - doCopySelected(); - break; - } - case KEY_V: - { - doPaste(); - break; - } - } - } - else - { - char ch; - switch(code) - { - case KEY_ENTER: - case KEY_TAB: - case KEY_LSHIFT: - case KEY_RSHIFT: - { - break; - } - case KEY_INSERT: - { - if(shift) - { - doPaste(); - } - break; - } - case KEY_DELETE: - { - if(shift) - { - doDeleteSelected(); - } - else - { - doDelete(); - } - break; - } - case KEY_LEFT: - { - doGotoLeft(); - break; - } - case KEY_RIGHT: - { - doGotoRight(); - break; - } - case KEY_HOME: - { - doGotoFirstOfLine(); - break; - } - case KEY_END: - { - doGotoEndOfLine(); - break; - } - case KEY_BACKSPACE: - { - doBackspace(); - break; - } - default: - { - ch=getApp()->getKeyCodeChar(code,(panel->isKeyDown(KEY_LSHIFT)||panel->isKeyDown(KEY_RSHIFT))); - if(ch!=0) - { - doInsertChar(ch); - } - break; - } - } - } - - _select[1]=_cursorPos; - - if(code==KEY_ENTER) - { - fireActionSignal(); - } -} - -void TextEntry::keyReleased(KeyCode code,Panel* panel) -{ -} - -void TextEntry::keyFocusTicked(Panel* panel) -{ - int time=getApp()->getTimeMillis(); - if(time>_cursorNextBlinkTime) - { - _cursorBlink=!_cursorBlink; - _cursorNextBlinkTime=time+_cursorBlinkRate; - repaint(); - } -} - -void TextEntry::selectCheck() -{ - if (!(isKeyDown(KEY_LSHIFT) || isKeyDown(KEY_RSHIFT))) - { - _select[0] = -1; - } - else if (_select[0] == -1) - { - _select[0] = _cursorPos; - } -} - -void TextEntry::doGotoLeft() -{ - selectCheck(); - _cursorPos--; - - if(_cursorPos<0) - { - _cursorPos=0; - } - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doGotoRight() -{ - selectCheck(); - _cursorPos++; - - if(_cursorPos>_lineDar.getCount()) - { - _cursorPos=_lineDar.getCount(); - } - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doGotoFirstOfLine() -{ - selectCheck(); - _cursorPos=0; - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doGotoEndOfLine() -{ - selectCheck(); - _cursorPos=_lineDar.getCount(); - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doInsertChar(char ch) -{ - _lineDar.setCount(_lineDar.getCount()+1); - for(int i=_lineDar.getCount()-1;i>=_cursorPos;i--) - { - setCharAt(_lineDar[i],i+1); - } - setCharAt(ch,_cursorPos); - _cursorPos++; - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doBackspace() -{ - if(_cursorPos==0) - { - return; - } - - if(_lineDar.getCount()==0) - { - return; - } - - for(int i=_cursorPos;i<_lineDar.getCount();i++) - { - setCharAt(_lineDar[i],i-1); - } - _lineDar.setCount(_lineDar.getCount()-1); - _cursorPos--; - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doDelete() -{ - if(_lineDar.getCount()==0) - { - return; - } - - if(_cursorPos!=_lineDar.getCount()) - { - return; - } - - for(int i=_cursorPos+1;i<_lineDar.getCount();i++) - { - setCharAt(_lineDar[i],i-1); - } - _lineDar.setCount(_lineDar.getCount()-1); - _cursorPos--; - - resetCursorBlink(); - repaint(); -} - -void TextEntry::doSelectNone() -{ - _select[0]=-1; - repaint(); -} - -bool TextEntry::getSelectedRange(int& cx0,int& cx1) -{ - if(_select[0]==-1) - { - return false; - } - - cx0=_select[0]; - cx1=_select[1]; - int temp; - if(cx1=x1) - { - break; - } - buf[i]=_lineDar[x0+i]; - } - buf[i]=0; - getApp()->setClipboardText(buf,i); - } -} - -void TextEntry::doPaste() -{ - char buf[256]; - int c=getApp()->getClipboardText(0,buf,sizeof(buf)); - for(int i=0;i=_lineDar.getCount()) - { - break; - } - buf[i-offset]=_lineDar[i]; - } - buf[bufLen-1]=0; -} - -void TextEntry::addActionSignal(ActionSignal* s) -{ - _actionSignalDar.putElement(s); -} - -void TextEntry::fireActionSignal() -{ - for(int i=0;i<_actionSignalDar.getCount();i++) - { - _actionSignalDar[i]->actionPerformed(this); - } -} - -void TextEntry::setFont(Font* font) -{ - _font=font; -} diff --git a/utils/vgui/lib/TextGrid.cpp b/utils/vgui/lib/TextGrid.cpp deleted file mode 100644 index ef8db845..00000000 --- a/utils/vgui/lib/TextGrid.cpp +++ /dev/null @@ -1,132 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -TextGrid::TextGrid(int gridWide,int gridTall,int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _grid=null; - _gridSize[0]=0; - _gridSize[1]=0; - setXY(0,0); - setBgColor(255,255,255,0); - setFgColor(0,0,0,0); - setGridSize(gridWide,gridTall); -} - -void TextGrid::setGridSize(int wide,int tall) -{ - if((wide<=0)||(tall<=0)) - { - return; - } - - delete[] _grid; - _grid=new char[wide*tall*7]; - memset(_grid,0,wide*tall*7); - - _gridSize[0]=wide; - _gridSize[1]=tall; -} - -void TextGrid::newLine() -{ - if(_xy[1]==(_gridSize[1]-1)) - { - if(_gridSize[1]>1) - { - memset(&_grid[((_xy[1]*_gridSize[0])+_xy[0])*7],0,_gridSize[0]-_xy[0]); - for(int j=1;j<_gridSize[1];j++) - { - memcpy(&_grid[((j-1)*_gridSize[0])*7],&_grid[(j*_gridSize[0])*7],_gridSize[0]*7); - } - memset(&_grid[(_xy[1]*_gridSize[0])*7],0,_gridSize[0]*7); - } - - _xy[0]=0; - } - else - { - _xy[0]=0; - _xy[1]++; - } -} - -void TextGrid::setXY(int x,int y) -{ - _xy[0]=x; - _xy[1]=y; -} - -int TextGrid::vprintf(const char* format,va_list argList) -{ - char buf[2048]; - int ret=vsprintf(buf,format,argList); - for(int i=0;i<2048;i++) - { - if(buf[i]==0) - { - break; - } - if(buf[i]=='\n') - { - newLine(); - continue; - } - if((_xy[0]>=0)&&(_xy[0]<_gridSize[0])) - { - if((_xy[1]>=0)&&(_xy[1]<_gridSize[1])) - { - _grid[((_xy[1]*_gridSize[0])+_xy[0])*7]=buf[i]; - _xy[0]++; - } - } - } - - repaint(); - return ret; -} - -int TextGrid::printf(const char* format,...) -{ - va_list argList; - va_start(argList,format); - return vprintf(format,argList); -} - -void TextGrid::paintBackground() -{ - Panel::paintBackground(); - - Font* font=getApp()->getScheme()->getFont(Scheme::sf_primary2); - int abc[3]; - font->getCharABCwide('W',abc[0],abc[1],abc[2]); - int fwide=abc[0]+abc[1]+abc[2]; - int ftall=font->getTall(); - drawSetTextFont(Scheme::sf_primary2); - - int r,g,b,a; - - for(int j=0;j<_gridSize[1];j++) - { - for(int i=0;i<_gridSize[0];i++) - { - char ch=_grid[((j*_gridSize[0])+i)*7]; - if(ch!=0) - { - getFgColor(r,g,b,a); - drawSetTextColor(r,g,b,a); - drawPrintChar(fwide*i,ftall*j,ch); - } - } - } -} diff --git a/utils/vgui/lib/TextImage.cpp b/utils/vgui/lib/TextImage.cpp deleted file mode 100644 index dfeca9c9..00000000 --- a/utils/vgui/lib/TextImage.cpp +++ /dev/null @@ -1,312 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -void TextImage::init(int textBufferLen,const char* text) -{ - _text=null; - _font=null; - _textBufferLen=0; - _schemeFont=Scheme::sf_primary1; - int wide,tall; - setText(textBufferLen,text); - getTextSize(wide,tall); - setSize(wide,tall); -} - -TextImage::TextImage(int textBufferLen,const char* text) : Image() -{ - init(textBufferLen,text); -} - -TextImage::TextImage(const char* text) : Image() -{ - init(strlen(text)+1,text); -} - -void TextImage::setText(int textBufferLen,const char* text) -{ - if(textBufferLen>_textBufferLen) - { - delete[] _text; - _textBufferLen=textBufferLen; - _text=new char[textBufferLen]; - if(_text==null) - { - _textBufferLen=0; - } - } - if(_text!=null) - { - vgui_strcpy(_text,_textBufferLen,text); - } - - int wide,tall; - getTextSize(wide,tall); - Image::setSize(wide,tall); -} - -void TextImage::setText(const char* text) -{ - setText(strlen(text)+1,text); -} - -void TextImage::setFont(vgui::Scheme::SchemeFont schemeFont) -{ - _schemeFont=schemeFont; -} - -void TextImage::setFont(vgui::Font* font) -{ - _font=font; -} - -Font* TextImage::getFont() -{ - if(_font==null) - { - return App::getInstance()->getScheme()->getFont(_schemeFont); - } - return _font; -} - -void TextImage::setSize(int wide,int tall) -{ - Image::setSize(wide,tall); -} - -void TextImage::paint(Panel* panel) -{ - int wide,tall; - getSize(wide,tall); - - if(_text==null) - { - return; - } - - Color color; - getColor(color); - - int r,g,b,a; - color.getColor(r,g,b,a); - drawSetTextColor(r,g,b,a); - - Font* font=getFont(); - drawSetTextFont(font); - - int yAdd=font->getTall(); - int x=0,y=0; - - for(int i=0;;i++) - { - int ch=_text[i]; - - int a,b,c; - - font->getCharABCwide(ch,a,b,c); - int len=a+b+c; - - if(ch==0) - { - break; - } - else - if(ch=='\r') - { - } - else - if(ch=='\n') - { - x=0; - y+=yAdd; - } - else - if(ch==' ') - { - char nextch; - nextch = _text[i+1]; - - font->getCharABCwide(' ',a,b,c); - - if ( !(nextch==0) && !(nextch=='\n') && !(nextch=='\r') ) - { - x+=a+b+c; - if(x>wide) - { - x=0; - y+=yAdd; - } - } - } - else - { - int ctr; - for(ctr=1;;ctr++) - { - ch=_text[i+ctr]; - if( (ch==0) || (ch=='\n') || (ch=='\r') || (ch==' ') ) - { - break; - } - else - { - int a,b,c; - font->getCharABCwide(ch,a,b,c); - len+=a+b+c; - } - } - - if((x+len)>wide) - { - x=0; - y+=yAdd; - } - - for(int j=0;jgetCharABCwide(ch,a,b,c); - drawPrintChar(x,y,ch); - x+=a+b+c; - } - - i+=ctr-1; - } - } -} - -void TextImage::getTextSizeWrapped(int& wideo,int& tallo) -{ - wideo=0; - tallo=0; - - if(_text==null) - { - return; - } - - int wide,tall; - getSize(wide,tall); - - Font* font=getFont(); - - int yAdd=font->getTall(); - int x=0,y=0; - - for(int i=0;;i++) - { - int ch=_text[i]; - - int a,b,c; - - font->getCharABCwide(ch,a,b,c); - int len=a+b+c; - - if(ch==0) - { - break; - } - else - if(ch=='\r') - { - } - else - if(ch=='\n') - { - x=0; - y+=yAdd; - } - else - if(ch==' ') - { - char nextch; - nextch = _text[i+1]; - - font->getCharABCwide(' ',a,b,c); - - if ( !(nextch==0) && !(nextch=='\n') && !(nextch=='\r') ) - { - x+=a+b+c; - if(x>wide) - { - x=0; - y+=yAdd; - } - } - } - else - { - int ctr; - for(ctr=1;;ctr++) - { - ch=_text[i+ctr]; - if( (ch==0) || (ch=='\n') || (ch=='\r') || (ch==' ') ) - { - break; - } - else - { - int a,b,c; - font->getCharABCwide(ch,a,b,c); - len+=a+b+c; - } - } - - if((x+len)>wide) - { - x=0; - y+=yAdd; - } - - for(int j=0;jgetCharABCwide(ch,a,b,c); - - if((x+a+b+c)>wideo) - { - wideo=x+a+b+c; - } - if((y+yAdd)>tallo) - { - tallo=y+yAdd; - } - - x+=a+b+c; - } - - i+=ctr-1; - } - } -} - -void TextImage::getTextSize(int& wide,int& tall) -{ - wide=0; - tall=0; - - if(_text==null) - { - return; - } - - Font* font=getFont(); - - if(font==null) - { - return; - } - - font->getTextSize(_text,wide,tall); -} diff --git a/utils/vgui/lib/TextPanel.cpp b/utils/vgui/lib/TextPanel.cpp deleted file mode 100644 index cabb14b1..00000000 --- a/utils/vgui/lib/TextPanel.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -TextPanel::TextPanel(const char* text,int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _textImage=new TextImage(text); - _textImage->setSize(wide,tall); -} - -void TextPanel::setText(const char* text) -{ - _textImage->setText(text); -} - -void TextPanel::setFont(vgui::Scheme::SchemeFont schemeFont) -{ - _textImage->setFont(schemeFont); -} - -void TextPanel::setFont(vgui::Font* font) -{ - _textImage->setFont(font); -} - -void TextPanel::paint() -{ - _textImage->doPaint(this); -} - -void TextPanel::setSize(int wide,int tall) -{ - Panel::setSize(wide,tall); - getPaintSize(wide,tall); - _textImage->setSize(wide,tall); -} - -void TextPanel::setFgColor(int r,int g,int b,int a) -{ - Panel::setFgColor(r,g,b,a); - _textImage->setColor(Color(r,g,b,a)); -} - -void TextPanel::setFgColor(Scheme::SchemeColor sc) -{ - Panel::setFgColor(sc); - _textImage->setColor(Color(sc)); -} - -TextImage* TextPanel::getTextImage() -{ - return _textImage; -} diff --git a/utils/vgui/lib/ToggleButton.cpp b/utils/vgui/lib/ToggleButton.cpp deleted file mode 100644 index 825cf927..00000000 --- a/utils/vgui/lib/ToggleButton.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooDefaultToggleButtonController : public ButtonController, public InputSignal -{ -public: - FooDefaultToggleButtonController(ToggleButton* button) - { - _button=button; - } -public: - virtual void addSignals(Button* button) - { - button->addInputSignal(this); - } - virtual void removeSignals(Button* button) - { - button->removeInputSignal(this); - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - _button->setSelected(!_button->isEnabled()); - _button->fireActionSignal(); - _button->repaint(); - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } -protected: - ToggleButton* _button; -}; - -} - -ToggleButton::ToggleButton(const char* text,int x,int y,int wide,int tall) : Button(text,x,y,wide,tall) -{ - setButtonController(new FooDefaultToggleButtonController(this)); -} - -ToggleButton::ToggleButton(const char* text,int x,int y) : Button(text,x,y) -{ - setButtonController(new FooDefaultToggleButtonController(this)); -} diff --git a/utils/vgui/lib/TreeFolder.cpp b/utils/vgui/lib/TreeFolder.cpp deleted file mode 100644 index 0a4600f5..00000000 --- a/utils/vgui/lib/TreeFolder.cpp +++ /dev/null @@ -1,250 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooTabFolderVerticalLayout : public Layout -{ -public: - FooTabFolderVerticalLayout() : Layout() - { - _hgap=30; - _vgap=3; - } -public: - virtual void performLayout(Panel* panel) - { - TreeFolder* folder; - - int maxx=0; - int wide,tall,xx,yy=0; - - for(int i=0;igetChildCount();i++) - { - Panel* child=panel->getChild(i); - - folder=dynamic_cast(child); - if(folder!=null) - { - folder->invalidateLayout(true); - } - - child->getSize(wide,tall); - - if(i==0) - { - xx=0; - } - else - { - xx=_hgap; - } - - child->setPos(xx,yy); - - if(xx+wide>maxx) - { - maxx=xx+wide; - } - - yy+=tall+_vgap; - } - - folder=dynamic_cast(panel); - if(folder!=null) - { - if(folder->isOpened()) - { - panel->setSize(maxx+2,yy); - } - else - { - Panel*child=panel->getChild(0); - if(child!=null) - { - child->getSize(wide,tall); - folder->setSize(wide,tall); - } - } - } - } -protected: - int _hgap; - int _vgap; -}; - -class FooTreeFolderDefaultHandler : public InputSignal -{ -public: - FooTreeFolderDefaultHandler(TreeFolder* treeFolder) - { - _treeFolder=treeFolder; - } -public: - virtual void cursorMoved(int x,int y,Panel* panel) - { - } - virtual void cursorEntered(Panel* panel) - { - } - virtual void cursorExited(Panel* panel) - { - } - virtual void mousePressed(MouseCode code,Panel* panel) - { - _treeFolder->setOpened(!_treeFolder->isOpened()); - } - virtual void mouseDoublePressed(MouseCode code,Panel* panel) - { - } - virtual void mouseReleased(MouseCode code,Panel* panel) - { - } - virtual void mouseWheeled(int delta,Panel* panel) - { - } - virtual void keyPressed(KeyCode code,Panel* panel) - { - } - virtual void keyTyped(KeyCode code,Panel* panel) - { - } - virtual void keyReleased(KeyCode code,Panel* panel) - { - } - virtual void keyFocusTicked(Panel* panel) - { - } -protected: - TreeFolder* _treeFolder; -}; -} - -void TreeFolder::init(const char* name) -{ - _opened=false; - - Label* label=new Label(name,0,0); - label->addInputSignal(new FooTreeFolderDefaultHandler(this)); - label->setParent(this); - - setLayout(new FooTabFolderVerticalLayout()); -} - -TreeFolder::TreeFolder(const char* name) : Panel(0,0,500,500) -{ - init(name); -} - -TreeFolder::TreeFolder(const char* name,int x,int y) : Panel(x,y,500,500) -{ - init(name); -} - -void TreeFolder::setOpened(bool state) -{ - if(_opened!=state) - { - _opened=state; - - TreeFolder* top=null; - Panel* trav=this; - while(trav!=null) - { - TreeFolder* folder=dynamic_cast(trav); - if(folder!=null) - { - folder->invalidateLayout(true); - top=folder; - } - trav=trav->getParent(); - } - if(top!=null) - { - top->repaintParent(); - } - } -} - -bool TreeFolder::isOpened() -{ - return _opened; -} - -void TreeFolder::paintBackground() -{ - drawSetColor(Scheme::sc_black); - - const int x0=15; - const int x1=30; - const int y0=10; - int y1=10; - - int i; - for(i=1;igetBounds(x,y,wide,tall); - if(dynamic_cast(child)!=null) - { - y+=10; - } - else - { - y+=tall/2; - } - - drawFilledRect(x0,y,x1,y+1); - y1=y; - } - - drawFilledRect(x0,y0,x0+1,y1); - - for(i=1;igetBounds(x,y,wide,tall); - TreeFolder* folder=dynamic_cast(child); - if(folder!=null) - { - y+=10; - drawSetColor(Scheme::sc_white); - drawFilledRect(x0-5,y-5,x0+6,y+6); - drawSetColor(Scheme::sc_black); - drawOutlinedRect(x0-5,y-5,x0+6,y+6); - drawFilledRect(x0-3,y,x0+4,y+1); - - if(!folder->isOpened()) - { - drawFilledRect(x0,y-3,x0+1,y+4); - } - } - } -} - -void TreeFolder::setOpenedTraverse(bool state) -{ - setOpened(true); - - for(int i=0;i(getChild(i)); - if(folder!=null) - { - folder->setOpenedTraverse(state); - } - } -} diff --git a/utils/vgui/lib/WizardPanel.cpp b/utils/vgui/lib/WizardPanel.cpp deleted file mode 100644 index c57cd5d5..00000000 --- a/utils/vgui/lib/WizardPanel.cpp +++ /dev/null @@ -1,453 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include - -using namespace vgui; - -namespace -{ -class FooBackHandler : public ActionSignal -{ -private: - WizardPanel* _wizardPanel; -public: - FooBackHandler(WizardPanel* wizardPanel) - { - _wizardPanel=wizardPanel; - } -public: - virtual void actionPerformed(Panel* panel) - { - _wizardPanel->doBack(); - } -}; - -class FooNextHandler : public ActionSignal -{ -private: - WizardPanel* _wizardPanel; -public: - FooNextHandler(WizardPanel* wizardPanel) - { - _wizardPanel=wizardPanel; - } -public: - virtual void actionPerformed(Panel* panel) - { - _wizardPanel->doNext(); - } -}; - -void fooGetText(const char* src,char* dst,int dstLen) -{ - assert(dst!=null); - assert(dstLen>=0); - assert(src!=null); - - int srcLen=strlen(src)+1; - if(srcLen>dstLen) - { - srcLen=dstLen; - } - - memcpy(dst,src,srcLen-1); - dst[srcLen-1]=0; -} -} - -void WizardPanel::WizardPage::init() -{ - _backWizardPage=null; - _nextWizardPage=null; - _backButtonEnabled=false; - _nextButtonEnabled=false; - _finishedButtonEnabled=false; - _cancelButtonEnabled=true; - _backButtonText=null; - _nextButtonText=null; - _finishedButtonText=null; - _cancelButtonText=null; - _wantedFocus=null; - _title=null; - _backButtonVisible=true; - _nextButtonVisible=true; - _finishedButtonVisible=true; - _cancelButtonVisible=true; - - setTitle("Untitled"); - setBackButtonText("<< Back"); - setNextButtonText("Next >>"); - setFinishedButtonText("Finished"); - setCancelButtonText("Cancel"); -} - -WizardPanel::WizardPage::WizardPage() : Panel(0,0,64,64) -{ - init(); -} - -WizardPanel::WizardPage::WizardPage(int wide,int tall) : Panel(0,0,wide,tall) -{ - init(); -} - -void WizardPanel::WizardPage::setBackWizardPage(WizardPage* backWizardPage) -{ - _backWizardPage=backWizardPage; - setBackButtonEnabled(backWizardPage!=null); -} - -void WizardPanel::WizardPage::setNextWizardPage(WizardPage* nextWizardPage) -{ - _nextWizardPage=nextWizardPage; - setNextButtonEnabled(nextWizardPage!=null); -} - -WizardPanel::WizardPage* WizardPanel::WizardPage::getBackWizardPage() -{ - return _backWizardPage; -} - -WizardPanel::WizardPage* WizardPanel::WizardPage::getNextWizardPage() -{ - return _nextWizardPage; -} - -bool WizardPanel::WizardPage::isBackButtonEnabled() -{ - return _backButtonEnabled; -} - -bool WizardPanel::WizardPage::isNextButtonEnabled() -{ - return _nextButtonEnabled; -} - -bool WizardPanel::WizardPage::isFinishedButtonEnabled() -{ - return _finishedButtonEnabled; -} - -bool WizardPanel::WizardPage::isCancelButtonEnabled() -{ - return _cancelButtonEnabled; -} - -void WizardPanel::WizardPage::setBackButtonEnabled(bool state) -{ - _backButtonEnabled=state; -} - -void WizardPanel::WizardPage::setNextButtonEnabled(bool state) -{ - _nextButtonEnabled=state; -} - -void WizardPanel::WizardPage::setFinishedButtonEnabled(bool state) -{ - _finishedButtonEnabled=state; -} - -void WizardPanel::WizardPage::setCancelButtonEnabled(bool state) -{ - _cancelButtonEnabled=state; -} - -bool WizardPanel::WizardPage::isBackButtonVisible() -{ - return _backButtonVisible; -} - -bool WizardPanel::WizardPage::isNextButtonVisible() -{ - return _nextButtonVisible; -} - -bool WizardPanel::WizardPage::isFinishedButtonVisible() -{ - return _finishedButtonVisible; -} - -bool WizardPanel::WizardPage::isCancelButtonVisible() -{ - return _cancelButtonVisible; -} - -void WizardPanel::WizardPage::setBackButtonVisible(bool state) -{ - _backButtonVisible=state; -} - -void WizardPanel::WizardPage::setNextButtonVisible(bool state) -{ - _nextButtonVisible=state; -} - -void WizardPanel::WizardPage::setFinishedButtonVisible(bool state) -{ - _finishedButtonVisible=state; -} - -void WizardPanel::WizardPage::setCancelButtonVisible(bool state) -{ - _cancelButtonVisible=state; -} - -void WizardPanel::WizardPage::getBackButtonText(char* text,int textLen) -{ - fooGetText(_backButtonText,text,textLen); -} - -void WizardPanel::WizardPage::getNextButtonText(char* text,int textLen) -{ - fooGetText(_nextButtonText,text,textLen); -} - -void WizardPanel::WizardPage::getFinishedButtonText(char* text,int textLen) -{ - fooGetText(_finishedButtonText,text,textLen); -} - -void WizardPanel::WizardPage::getCancelButtonText(char* text,int textLen) -{ - fooGetText(_cancelButtonText,text,textLen); -} - -void WizardPanel::WizardPage::setBackButtonText(const char* text) -{ - delete[] _backButtonText; - _backButtonText=vgui_strdup(text); -} - -void WizardPanel::WizardPage::setNextButtonText(const char* text) -{ - delete[] _nextButtonText; - _nextButtonText=vgui_strdup(text); -} - -void WizardPanel::WizardPage::setFinishedButtonText(const char* text) -{ - delete[] _finishedButtonText; - _finishedButtonText=vgui_strdup(text); -} - -void WizardPanel::WizardPage::setCancelButtonText(const char* text) -{ - delete[] _cancelButtonText; - _cancelButtonText=vgui_strdup(text); -} - -void WizardPanel::WizardPage::addSwitchingToBackPageSignal(ActionSignal* s) -{ - _switchingToBackPageSignalDar.putElement(s); -} - -void WizardPanel::WizardPage::addSwitchingToNextPageSignal(ActionSignal* s) -{ - _switchingToNextPageSignalDar.putElement(s); -} - -void WizardPanel::WizardPage::fireSwitchingToBackPageSignals() -{ - for(int i=0;i<_switchingToBackPageSignalDar.getCount();i++) - { - _switchingToBackPageSignalDar[i]->actionPerformed(this); - } -} - -void WizardPanel::WizardPage::fireSwitchingToNextPageSignals() -{ - for(int i=0;i<_switchingToBackPageSignalDar.getCount();i++) - { - _switchingToBackPageSignalDar[i]->actionPerformed(this); - } -} - -void WizardPanel::WizardPage::setTitle(const char* title) -{ - delete[] _title; - _title=vgui_strdup(title); -} - -void WizardPanel::WizardPage::getTitle(char* buf,int bufLen) -{ - vgui_strcpy(buf,bufLen,_title); -} - -void WizardPanel::WizardPage::setWantedFocus(Panel* panel) -{ - _wantedFocus=panel; -} - -Panel* WizardPanel::WizardPage::getWantedFocus() -{ - return _wantedFocus; -} - -WizardPanel::WizardPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) -{ - _currentWizardPage=null; - - _backButton=new Button("back",20,100); - _backButton->setParent(this); - _backButton->addActionSignal(new FooBackHandler(this)); - - _nextButton=new Button("next",80,100); - _nextButton->setParent(this); - _nextButton->addActionSignal(new FooNextHandler(this)); - - _nextButton=new Button("finished",120,100); - _nextButton->setParent(this); - - _nextButton=new Button("cancel",180,100); - _nextButton->setParent(this); -} - -void WizardPanel::performLayout() -{ - int wide,tall; - getPaintSize(wide,tall); - - _backButton->setVisible(false); - _nextButton->setVisible(false); - _finishedButton->setVisible(false); - _cancelButton->setVisible(false); - - if(_currentWizardPage!=null) - { - int bTall=_backButton->getTall(); - _currentWizardPage->setBounds(2,2,wide-4,tall-bTall-8); - - char buf[256]; - int gap=2; - int x=wide-(gap*2); - int y=tall-bTall-gap; - - _currentWizardPage->getCancelButtonText(buf,sizeof(buf)); - _cancelButton->setText(buf); - _cancelButton->setEnabled(_currentWizardPage->isCancelButtonEnabled()); - _cancelButton->setVisible(_currentWizardPage->isCancelButtonVisible()); - _cancelButton->setPos(x-_cancelButton->getWide(),y); - if(_currentWizardPage->isCancelButtonVisible()) - { - x-=_cancelButton->getWide()+(gap*2); - } - - _currentWizardPage->getFinishedButtonText(buf,sizeof(buf)); - _finishedButton->setText(buf); - _finishedButton->setEnabled(_currentWizardPage->isFinishedButtonEnabled()); - _finishedButton->setVisible(_currentWizardPage->isFinishedButtonVisible()); - _finishedButton->setPos(x-_finishedButton->getWide(),y); - if(_currentWizardPage->isFinishedButtonVisible()) - { - x-=_finishedButton->getWide()+(gap*2); - } - - _currentWizardPage->getNextButtonText(buf,sizeof(buf)); - _nextButton->setText(buf); - _nextButton->setEnabled(_currentWizardPage->isNextButtonEnabled()); - _nextButton->setVisible(_currentWizardPage->isNextButtonVisible()); - _nextButton->setPos(x-_nextButton->getWide(),y); - if(_currentWizardPage->isNextButtonVisible()) - { - x-=_nextButton->getWide()+(gap*2); - } - - _currentWizardPage->getBackButtonText(buf,sizeof(buf)); - _backButton->setText(buf); - _backButton->setEnabled(_currentWizardPage->isBackButtonEnabled()); - _backButton->setVisible(_currentWizardPage->isBackButtonVisible()); - _backButton->setPos(x-_backButton->getWide(),y); - if(_currentWizardPage->isBackButtonVisible()) - { - x-=_backButton->getWide()+(gap*2); - } - } -} - -void WizardPanel::setCurrentWizardPage(WizardPage* currentWizardPage) -{ - if(_currentWizardPage!=null) - { - removeChild(_currentWizardPage); - } - _currentWizardPage=currentWizardPage; - - if(_currentWizardPage!=null) - { - _currentWizardPage->setParent(this); - getApp()->requestFocus(_currentWizardPage->getWantedFocus()); - } - - firePageChangedActionSignal(); - invalidateLayout(false); -} - -void WizardPanel::addFinishedActionSignal(ActionSignal* s) -{ - _finishedButton->addActionSignal(s); -} - -void WizardPanel::addCancelledActionSignal(ActionSignal* s) -{ - _cancelButton->addActionSignal(s); -} - -void WizardPanel::addPageChangedActionSignal(ActionSignal* s) -{ - _pageChangedActionSignalDar.putElement(s); -} - -void WizardPanel::fireFinishedActionSignal() -{ - _finishedButton->fireActionSignal(); -} - -void WizardPanel::fireCancelledActionSignal() -{ - _cancelButton->fireActionSignal(); -} - -void WizardPanel::firePageChangedActionSignal() -{ - for(int i=0;i<_pageChangedActionSignalDar.getCount();i++) - { - _pageChangedActionSignalDar[i]->actionPerformed(this); - } -} - -void WizardPanel::doBack() -{ - if(_currentWizardPage!=null) - { - _currentWizardPage->fireSwitchingToBackPageSignals(); - setCurrentWizardPage(_currentWizardPage->getBackWizardPage()); - } -} - -void WizardPanel::doNext() -{ - if(_currentWizardPage!=null) - { - _currentWizardPage->fireSwitchingToNextPageSignals(); - setCurrentWizardPage(_currentWizardPage->getNextWizardPage()); - } -} - -void WizardPanel::getCurrentWizardPageTitle(char* buf,int bufLen) -{ - _currentWizardPage->getTitle(buf,bufLen); -} - -WizardPanel::WizardPage* WizardPanel::getCurrentWizardPage() -{ - return _currentWizardPage; -} diff --git a/utils/vgui/lib/vgui.cpp b/utils/vgui/lib/vgui.cpp deleted file mode 100644 index 6e59ed5f..00000000 --- a/utils/vgui/lib/vgui.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#if defined( OSX ) -#include -#else -#include -#endif -#include -#include -#include -#include - -static void*(*staticMalloc)(size_t size)=malloc; -static void(*staticFree)(void* memblock)=free; - -void *operator new(size_t size) -{ - return staticMalloc(size); -} - -void operator delete(void* memblock) -{ - staticFree(memblock); -} - -void *operator new [] (size_t size) -{ - return staticMalloc(size); -} - -void operator delete [] (void *pMem) -{ - staticFree(pMem); -} - -void vgui_setMalloc(void *(*theMalloc)(size_t size)) -{ - if(theMalloc==null) - { - theMalloc=malloc; - } - - staticMalloc=theMalloc; -} - -void vgui_setFree(void (*theFree)(void* memblock)) -{ - if(theFree==null) - { - theFree=free; - } - - staticFree=theFree; -} - -namespace vgui -{ -void vgui_strcpy(char* dst,int dstLen,const char* src) -{ - assert(dst!=null); - assert(dstLen>=0); - assert(src!=null); - - int srcLen=strlen(src)+1; - if(srcLen>dstLen) - { - srcLen=dstLen; - } - - memcpy(dst,src,srcLen-1); - dst[srcLen-1]=0; -} - -char* vgui_strdup(const char* src) -{ - assert(src!=null); - - int len=strlen(src)+1; - char* dst=new char[len]; - memcpy(dst,src,len-1); - dst[len-1]=0; - return dst; -} - -int vgui_printf(const char* format,...) -{ - char buf[2048]; - va_list argList; - - va_start(argList,format); - int ret=vsprintf(buf,format,argList); - va_end(argList); - - printf("%s",buf); - return ret; -} -} diff --git a/utils/vgui/lib/vgui.dsp b/utils/vgui/lib/vgui.dsp deleted file mode 100644 index 73b0ee6a..00000000 --- a/utils/vgui/lib/vgui.dsp +++ /dev/null @@ -1,845 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vgui" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=vgui - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vgui.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vgui.mak" CFG="vgui - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vgui - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "vgui - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\temp\vgui\!release" -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VGUI_DLL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /W3 /GR /GX /O2 /I "..\include" /I "..\..\..\engine" /I "..\..\..\common" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 msvcrt.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /opt:nowin98 -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\vgui\!release -InputPath=\Xash3D\src_main\temp\vgui\!release\vgui.dll -SOURCE="$(InputPath)" - -BuildCmds= \ - copy $(TargetDir)\vgui.dll "D:\Xash3D\vgui.dll" \ - copy $(TargetDir)\vgui.lib "D:\Xash3D\src_main\utils\vgui\lib\win32_vc6\vgui.lib" \ - - -"D:\Xash3D\vgui.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"D:\Xash3D\src_main\utils\vgui\lib\win32_vc6\vgui.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\temp\vgui\!debug" -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VGUI_DLL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /Gi /GR /GX /ZI /Od /I "..\include" /I "..\..\..\engine" /I "..\..\..\common" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FAs /FR /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 msvcrtd.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBCMTD" /pdbtype:sept -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\vgui\!debug -InputPath=\Xash3D\src_main\temp\vgui\!debug\vgui.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\src_main\utils\vgui\lib\win32_vc6\vgui.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\vgui.dll "D:\Xash3D\vgui.dll" - copy $(TargetDir)\vgui.lib "D:\Xash3D\src_main\utils\vgui\lib\win32_vc6\vgui.lib" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "vgui - Win32 Release" -# Name "vgui - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "win32" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE="win32_vc6\App.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\Cursor.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\fileimage.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\fileimage.h" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\Font.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\Surface.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\vfontdata.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\vfontdata.h" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\vgui.cpp" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="win32_vc6\vgui_win32.h" - -!IF "$(CFG)" == "vgui - Win32 Release" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!release\win32" - -!ELSEIF "$(CFG)" == "vgui - Win32 Debug" - -# PROP Intermediate_Dir "..\..\..\temp\vgui\!debug\win32" - -!ENDIF - -# End Source File -# End Group -# Begin Source File - -SOURCE="App.cpp" -# End Source File -# Begin Source File - -SOURCE="Bitmap.cpp" -# End Source File -# Begin Source File - -SOURCE="BitmapTGA.cpp" -# End Source File -# Begin Source File - -SOURCE="Border.cpp" -# End Source File -# Begin Source File - -SOURCE="BorderLayout.cpp" -# End Source File -# Begin Source File - -SOURCE="BorderPair.cpp" -# End Source File -# Begin Source File - -SOURCE="BuildGroup.cpp" -# End Source File -# Begin Source File - -SOURCE="Button.cpp" -# End Source File -# Begin Source File - -SOURCE="ButtonGroup.cpp" -# End Source File -# Begin Source File - -SOURCE="CheckButton.cpp" -# End Source File -# Begin Source File - -SOURCE="Color.cpp" -# End Source File -# Begin Source File - -SOURCE="ConfigWizard.cpp" -# End Source File -# Begin Source File - -SOURCE="Cursor.cpp" -# End Source File -# Begin Source File - -SOURCE="DataInputStream.cpp" -# End Source File -# Begin Source File - -SOURCE="Desktop.cpp" -# End Source File -# Begin Source File - -SOURCE="DesktopIcon.cpp" -# End Source File -# Begin Source File - -SOURCE="EditPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="EtchedBorder.cpp" -# End Source File -# Begin Source File - -SOURCE="FileInputStream.cpp" -# End Source File -# Begin Source File - -SOURCE="FlowLayout.cpp" -# End Source File -# Begin Source File - -SOURCE="FocusNavGroup.cpp" -# End Source File -# Begin Source File - -SOURCE="Font.cpp" -# End Source File -# Begin Source File - -SOURCE="Frame.cpp" -# End Source File -# Begin Source File - -SOURCE="GridLayout.cpp" -# End Source File -# Begin Source File - -SOURCE="HeaderPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="Image.cpp" -# End Source File -# Begin Source File - -SOURCE="ImagePanel.cpp" -# End Source File -# Begin Source File - -SOURCE="IntLabel.cpp" -# End Source File -# Begin Source File - -SOURCE="Label.cpp" -# End Source File -# Begin Source File - -SOURCE="Layout.cpp" -# End Source File -# Begin Source File - -SOURCE="LineBorder.cpp" -# End Source File -# Begin Source File - -SOURCE="ListPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="LoweredBorder.cpp" -# End Source File -# Begin Source File - -SOURCE="Menu.cpp" -# End Source File -# Begin Source File - -SOURCE="MenuItem.cpp" -# End Source File -# Begin Source File - -SOURCE="MenuSeparator.cpp" -# End Source File -# Begin Source File - -SOURCE="MessageBox.cpp" -# End Source File -# Begin Source File - -SOURCE="MiniApp.cpp" -# End Source File -# Begin Source File - -SOURCE="Panel.cpp" -# End Source File -# Begin Source File - -SOURCE="PopupMenu.cpp" -# End Source File -# Begin Source File - -SOURCE="ProgressBar.cpp" -# End Source File -# Begin Source File - -SOURCE="RadioButton.cpp" -# End Source File -# Begin Source File - -SOURCE="RaisedBorder.cpp" -# End Source File -# Begin Source File - -SOURCE="Scheme.cpp" -# End Source File -# Begin Source File - -SOURCE="ScrollBar.cpp" -# End Source File -# Begin Source File - -SOURCE="ScrollPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="Slider.cpp" -# End Source File -# Begin Source File - -SOURCE="StackLayout.cpp" -# End Source File -# Begin Source File - -SOURCE="String.cpp" -# End Source File -# Begin Source File - -SOURCE="Surface.cpp" -# End Source File -# Begin Source File - -SOURCE="SurfaceBase.cpp" -# End Source File -# Begin Source File - -SOURCE="TablePanel.cpp" -# End Source File -# Begin Source File - -SOURCE="TabPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="TaskBar.cpp" -# End Source File -# Begin Source File - -SOURCE="TextEntry.cpp" -# End Source File -# Begin Source File - -SOURCE="TextGrid.cpp" -# End Source File -# Begin Source File - -SOURCE="TextImage.cpp" -# End Source File -# Begin Source File - -SOURCE="TextPanel.cpp" -# End Source File -# Begin Source File - -SOURCE="ToggleButton.cpp" -# End Source File -# Begin Source File - -SOURCE="TreeFolder.cpp" -# End Source File -# Begin Source File - -SOURCE="vgui.cpp" -# End Source File -# Begin Source File - -SOURCE="WizardPanel.cpp" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\include\VGUI.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ActionSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_App.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Bitmap.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_BitmapTGA.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Border.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_BorderLayout.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_BorderPair.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_BuildGroup.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Button.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ButtonController.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ButtonGroup.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ChangeSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_CheckButton.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Color.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ComboKey.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ConfigWizard.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Cursor.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Dar.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_DataInputStream.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Desktop.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_DesktopIcon.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_EditPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_EtchedBorder.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_FileInputStream.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_FlowLayout.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_FocusChangeSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_FocusNavGroup.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Font.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Frame.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_FrameSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_GridLayout.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_HeaderPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Image.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ImagePanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_InputSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_InputStream.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_IntChangeSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_IntLabel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_KeyCode.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Label.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Layout.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_LayoutInfo.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_LineBorder.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ListPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_LoweredBorder.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Menu.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_MenuItem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_MenuSeparator.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_MessageBox.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_MiniApp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_MouseCode.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Panel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Point.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_PopupMenu.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ProgressBar.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_RadioButton.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_RaisedBorder.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_RepaintSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Scheme.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ScrollBar.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ScrollPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Slider.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_StackLayout.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_String.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_Surface.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_SurfaceBase.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_SurfaceGL.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TablePanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TabPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TaskBar.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TextEntry.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TextGrid.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TextImage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TextPanel.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TickSignal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_ToggleButton.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_TreeFolder.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\VGUI_WizardPanel.h -# End Source File -# End Group -# End Target -# End Project diff --git a/utils/vgui/lib/win32_vc6/App.cpp b/utils/vgui/lib/win32_vc6/App.cpp deleted file mode 100644 index da94018f..00000000 --- a/utils/vgui/lib/win32_vc6/App.cpp +++ /dev/null @@ -1,332 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include"vgui_win32.h" - -using namespace vgui; - -void App::platTick() -{ - ::MSG msg; - while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - BOOL ret = ::GetMessage(&msg, NULL, 0, 0); - if (ret == 0) - break; - - if (ret == -1) - { - stop(); - break; - } - - ::DispatchMessage(&msg); - } -} - -void App::setCursorPos(int x,int y) -{ -} - -void App::getCursorPos(int& x,int& y) -{ -} - -void App::internalSetMouseArena(int x0,int y0,int x1,int y1,bool enabled) -{ - RECT rc; - rc.left = x0; - rc.top = y0; - rc.bottom = y1; - rc.right = x1; - ClipCursor(enabled?&rc:NULL); -} - -long App::getTimeMillis() -{ - return GetTickCount(); -} - -void App::setClipboardText(const char* text,int textLen) -{ - if (!text) - return; - - if (textLen <= 0) - return; - - if (!OpenClipboard(NULL)) - return; - - EmptyClipboard(); - - HANDLE hmem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, textLen + 1); - if (hmem) - { - void *ptr = GlobalLock(hmem); - if (ptr != null) - { - memset(ptr, 0, textLen + 1); - memcpy(ptr, text, textLen); - GlobalUnlock(hmem); - - SetClipboardData(CF_TEXT, hmem); - } - } - - CloseClipboard(); -} - -int App::getClipboardTextCount() -{ - int count = 0; - if (!OpenClipboard(NULL)) - return 0; - - HANDLE hmem = GetClipboardData(CF_TEXT); - if (hmem) - { - count = GlobalSize(hmem); - } - - CloseClipboard(); - return count; -} - -int App::getClipboardText(int offset,char* buf,int bufLen) -{ - if (!buf) - return 0; - - if (bufLen <= 0) - return 0; - - int count = 0; - if (!OpenClipboard(NULL)) - return 0; - - HANDLE hmem = GetClipboardData(CF_UNICODETEXT); - if (hmem) - { - int len = GlobalSize(hmem); - count = len - offset; - if (count <= 0) - { - count = 0; - } - else - { - if (bufLen < count) - { - count = bufLen; - } - void *ptr = GlobalLock(hmem); - if (ptr) - { - memcpy(buf, ((char *)ptr) + offset, count); - GlobalUnlock(hmem); - } - } - } - - CloseClipboard(); - return count; -} - -static bool staticSplitRegistryKey(const char *key, char *key0, int key0Len, char *key1, int key1Len) -{ - if(key==null) - { - return false; - } - - int len=strlen(key); - if(len<=0) - { - return false; - } - - int state=0; - int Start=-1; - for(int i=len-1;i>=0;i--) - { - if(key[i]=='\\') - { - break; - } - else - { - Start=i; - } - } - - if(Start==-1) - { - return false; - } - - vgui_strcpy(key0,Start+1,key); - vgui_strcpy(key1,(len-Start)+1,key+Start); - - return true; -} - -bool App::setRegistryString(const char* key,const char* value) -{ - HKEY hKey; - - HKEY hSlot = HKEY_CURRENT_USER; - if (!strncmp(key, "HKEY_LOCAL_MACHINE", 18)) - { - hSlot = HKEY_LOCAL_MACHINE; - key += 19; - } - else if (!strncmp(key, "HKEY_CURRENT_USER", 17)) - { - hSlot = HKEY_CURRENT_USER; - key += 18; - } - - char key0[256],key1[256]; - if(!staticSplitRegistryKey(key,key0,256,key1,256)) - { - return false; - } - - if(RegCreateKeyEx(hSlot,key0,null,null,REG_OPTION_NON_VOLATILE,KEY_WRITE,null,&hKey,null)!=ERROR_SUCCESS) - { - return false; - } - - if(RegSetValueEx(hKey,key1,null,REG_SZ,(uchar*)value,strlen(value)+1)==ERROR_SUCCESS) - { - RegCloseKey(hKey); - return true; - } - - RegCloseKey(hKey); - - return false; -} - -bool App::getRegistryString(const char* key,char* value,int valueLen) -{ - HKEY hKey; - - HKEY hSlot = HKEY_CURRENT_USER; - if (!strncmp(key, "HKEY_LOCAL_MACHINE", 18)) - { - hSlot = HKEY_LOCAL_MACHINE; - key += 19; - } - else if (!strncmp(key, "HKEY_CURRENT_USER", 17)) - { - hSlot = HKEY_CURRENT_USER; - key += 18; - } - - char key0[256],key1[256]; - if(!staticSplitRegistryKey(key,key0,256,key1,256)) - { - return false; - } - - if(RegOpenKeyEx(hSlot,key0,null,KEY_READ,&hKey)!=ERROR_SUCCESS) - { - return false; - } - - ulong len=valueLen; - if(RegQueryValueEx(hKey,key1,null,null,(uchar*)value,&len)==ERROR_SUCCESS) - { - RegCloseKey(hKey); - return true; - } - - RegCloseKey(hKey); - return false; -} - -bool App::setRegistryInteger(const char* key,int value) -{ - HKEY hKey; - HKEY hSlot = HKEY_CURRENT_USER; - if (!strncmp(key, "HKEY_LOCAL_MACHINE", 18)) - { - hSlot = HKEY_LOCAL_MACHINE; - key += 19; - } - else if (!strncmp(key, "HKEY_CURRENT_USER", 17)) - { - hSlot = HKEY_CURRENT_USER; - key += 18; - } - - char key0[256],key1[256]; - if(!staticSplitRegistryKey(key,key0,256,key1,256)) - { - return false; - } - - if(RegCreateKeyEx(hSlot,key0,null,null,REG_OPTION_NON_VOLATILE,KEY_WRITE,null,&hKey,null)!=ERROR_SUCCESS) - { - return false; - } - - if(RegSetValueEx(hKey,key1,null,REG_DWORD,(uchar*)&value,4)==ERROR_SUCCESS) - { - RegCloseKey(hKey); - return true; - } - - RegCloseKey(hKey); - return false; -} - -bool App::getRegistryInteger(const char* key,int& value) -{ - HKEY hKey; - HKEY hSlot = HKEY_CURRENT_USER; - if (!strncmp(key, "HKEY_LOCAL_MACHINE", 18)) - { - hSlot = HKEY_LOCAL_MACHINE; - key += 19; - } - else if (!strncmp(key, "HKEY_CURRENT_USER", 17)) - { - hSlot = HKEY_CURRENT_USER; - key += 18; - } - - char key0[256],key1[256]; - if(!staticSplitRegistryKey(key,key0,256,key1,256)) - { - return false; - } - - if(RegOpenKeyEx(hSlot,key0,null,KEY_READ,&hKey)!=ERROR_SUCCESS) - { - return false; - } - - ulong len=4; - if(RegQueryValueEx(hKey,key1,null,null,(uchar*)&value,&len)==ERROR_SUCCESS) - { - RegCloseKey(hKey); - return true; - } - - RegCloseKey(hKey); - return false; -} - -App* App::getInstance() -{ - return _instance; -} diff --git a/utils/vgui/lib/win32_vc6/Cursor.cpp b/utils/vgui/lib/win32_vc6/Cursor.cpp deleted file mode 100644 index 79b3d237..00000000 --- a/utils/vgui/lib/win32_vc6/Cursor.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -using namespace vgui; - -class CursorBitmap : public Bitmap -{ -private: - int _hotspot[2]; -public: - CursorBitmap(Cursor::DefaultCursor dc) - { - _hotspot[0]=8; - _hotspot[1]=8; - - if(dc!=Cursor::dc_none) - { - int wide=16; - int tall=16; - setSize(wide,tall); - - int i,j; - for(j=0;j<16;j++) - { - for(i=0;i<16;i++) - { - setRGBA(i,j,0,0,0,0); - } - } - for(i=0;i<16;i++) - { - setRGBA(i,8,0,255,0,255); - } - for(i=0;i<16;i++) - { - setRGBA(8,i,0,0,255,255); - } - } - } - virtual void getHotspot(int& x,int& y) - { - x=_hotspot[0]; - y=_hotspot[1]; - } -}; - -Cursor::Cursor(Cursor::DefaultCursor dc) -{ - _dc=dc; - CursorBitmap *cursorBitmap=new CursorBitmap(_dc); - - int hx,hy; - cursorBitmap->getHotspot(hx,hy); - privateInit(_bitmap,hx,hy); -} diff --git a/utils/vgui/lib/win32_vc6/Font.cpp b/utils/vgui/lib/win32_vc6/Font.cpp deleted file mode 100644 index 90d77370..00000000 --- a/utils/vgui/lib/win32_vc6/Font.cpp +++ /dev/null @@ -1,345 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include"vgui_win32.h" - -using namespace vgui; - -static int staticFontId=100; -static Dar staticFontPlatDar; - -FontPlat::FontPlat(const char* name,int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - m_szName = strdup(name); - m_iTall = tall; - m_iWide = wide; - m_flRotation = rotation; - m_iWeight = weight; - m_bItalic = italic; - m_bUnderline = underline; - m_bStrikeOut = strikeout; - m_bSymbol = symbol; - - int charset = symbol ? SYMBOL_CHARSET : ANSI_CHARSET; - m_hFont = ::CreateFontA(tall, wide, (int)(rotation*10), (int)(rotation*10), - weight, - italic, - underline, - strikeout, - charset, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, - DEFAULT_PITCH, - m_szName); - - m_hDC = ::CreateCompatibleDC(NULL); - - // set as the active font - ::SelectObject(m_hDC, m_hFont); - ::SetTextAlign(m_hDC, TA_LEFT | TA_TOP | TA_UPDATECP); - - // get info about the font - GetTextMetrics(m_hDC, &tm); - - // code for rendering to a bitmap - bufSize[0] = tm.tmMaxCharWidth; - bufSize[1] = tm.tmHeight + tm.tmAscent + tm.tmDescent; - - ::BITMAPINFOHEADER header; - memset(&header, 0, sizeof(header)); - header.biSize = sizeof(header); - header.biWidth = bufSize[0]; - header.biHeight = -bufSize[1]; - header.biPlanes = 1; - header.biBitCount = 32; - header.biCompression = BI_RGB; - - m_hDIB = ::CreateDIBSection(m_hDC, (BITMAPINFO*)&header, DIB_RGB_COLORS, (void**)(&buf), NULL, 0); - ::SelectObject(m_hDC, m_hDIB); - - // get char spacing - // a is space before character (can be negative) - // b is the width of the character - // c is the space after the character - memset(m_ABCWidthsCache, 0, sizeof(m_ABCWidthsCache)); - if (!::GetCharABCWidthsA(m_hDC, 0, ABCWIDTHS_CACHE_SIZE - 1, m_ABCWidthsCache)) - { - // since that failed, it must be fixed width, zero everything so a and c will be zeros, then - // fill b with the value from TEXTMETRIC - for (int i = 0; i < ABCWIDTHS_CACHE_SIZE; i++) - { - m_ABCWidthsCache[i].abcB = (char)tm.tmAveCharWidth; - } - } -} - -FontPlat::~FontPlat() -{ -} - -bool FontPlat::equals(const char* name,int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - if (!stricmp(name, m_szName) - && m_iTall == tall - && m_iWide == wide - && m_flRotation == rotation - && m_iWeight == weight - && m_bItalic == italic - && m_bUnderline == underline - && m_bStrikeOut == strikeout - && m_bSymbol == symbol) - return true; - - return false; -} - -void FontPlat::getCharRGBA(int ch,int rgbaX,int rgbaY,int rgbaWide,int rgbaTall,uchar* rgba) -{ - // set us up to render into our dib - ::SelectObject(m_hDC, m_hFont); - - // use render-to-bitmap to get our font texture - ::SetBkColor(m_hDC, RGB(0, 0, 0)); - ::SetTextColor(m_hDC, RGB(255, 255, 255)); - ::SetBkMode(m_hDC, OPAQUE); - ::MoveToEx(m_hDC, -m_ABCWidthsCache[ch].abcA, 0, NULL); - - // render the character - char wch = (char)ch; - ::ExtTextOutA(m_hDC, 0, 0, 0, NULL, &wch, 1, NULL); - ::SetBkMode(m_hDC, TRANSPARENT); - - int wide = m_ABCWidthsCache[ch].abcB; - if (wide > bufSize[0]) - { - wide = bufSize[0]; - } - int tall = tm.tmHeight; - if (tall > bufSize[1]) - { - tall = bufSize[1]; - } - - // iterate through copying the generated dib into the texture - for (int j = 0; j < tall; j++) - { - for (int i = 0; i < wide; i++) - { - int x = rgbaX + i; - int y = rgbaY + j; - if ((x < rgbaWide) && (y < rgbaTall)) - { - unsigned char *src = &buf[(j*bufSize[0]+i)*4]; - - float r = (src[0]) / 255.0f; - float g = (src[1]) / 255.0f; - float b = (src[2]) / 255.0f; - - // Don't want anything drawn for tab characters. - if (ch == '\t') - { - r = g = b = 0; - } - - unsigned char *dst = &rgba[(y*rgbaWide+x)*4]; - dst[0] = (unsigned char)(r * 255.0f); - dst[1] = (unsigned char)(g * 255.0f); - dst[2] = (unsigned char)(b * 255.0f); - dst[3] = (unsigned char)((r * 0.34f + g * 0.55f + b * 0.11f) * 255.0f); - } - } - } -} - -void FontPlat::getCharABCwide(int ch,int& a,int& b,int& c) -{ - a = m_ABCWidthsCache[ch].abcA; - b = m_ABCWidthsCache[ch].abcB; - c = m_ABCWidthsCache[ch].abcC; - - if (a < 0) - { - a = 0; - } -} - -int FontPlat::getTall() -{ - return tm.tmHeight; -} - -void FontPlat::drawSetTextFont(SurfacePlat* plat) -{ - ::SelectObject(plat->hdc, m_hFont); -} - -FontPlat_Bitmap::FontPlat_Bitmap() -{ - m_pName=null; -} - -FontPlat_Bitmap::~FontPlat_Bitmap() -{ -} - -FontPlat_Bitmap* FontPlat_Bitmap::Create(const char* name, FileImageStream* pStream) -{ - FontPlat_Bitmap* pBitmap=new FontPlat_Bitmap(); - if(pBitmap==null) - { - return null; - } - - if(!LoadVFontDataFrom32BitTGA(pStream,&pBitmap->m_FontData)) - { - delete pBitmap; - return null; - } - - pBitmap->m_pName=new char[strlen(name)+1]; - if(pBitmap->m_pName==null) - { - delete pBitmap; - return null; - } - - strcpy(pBitmap->m_pName,name); - return pBitmap; -} - -bool FontPlat_Bitmap::equals(const char* name,int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - return false; -} - -void FontPlat_Bitmap::getCharRGBA(int ch,int rgbaX,int rgbaY,int rgbaWide,int rgbaTall,uchar* rgba) -{ - uchar* pSrcPos; - uchar* pOutPos; - int x,y,outX,outY; - - if(ch<0) - ch=0; - else if(ch>=256) - ch=256; - - for(y=0;y255) - ch=255; - - a=c=0; - b=m_FontData.m_CharWidths[ch]+1; -} - -int FontPlat_Bitmap::getTall() -{ - return m_FontData.m_BitmapCharHeight; -} - -void FontPlat_Bitmap::drawSetTextFont(SurfacePlat* plat) -{ -} - -Font::Font(const char* name,int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - init(name,null,0,wide,tall,rotation,weight,italic,underline,strikeout,symbol); -} - -Font::Font(const char* name,void *pFileData,int fileDataLen, int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - init(name,pFileData,fileDataLen,wide,tall,rotation,weight,italic,underline,strikeout,symbol); -} - -void Font::init(const char* name,void *pFileData,int fileDataLen, int tall,int wide,float rotation,int weight,bool italic,bool underline,bool strikeout,bool symbol) -{ - FontPlat_Bitmap*pBitmapFont=null; - - _name=strdup(name); - _id=-1; - - if(pFileData!=null) - { - FileImageStream_Memory memStream(pFileData,fileDataLen); - pBitmapFont=FontPlat_Bitmap::Create(name,&memStream); - if(pBitmapFont!=null) - { - _plat=pBitmapFont; - staticFontPlatDar.addElement(_plat); - _id=staticFontId++; - } - } - else - { - _plat=null; - for(int i=0;iequals(name,tall,wide,rotation,weight,italic,underline,strikeout,symbol)) - { - _plat=staticFontPlatDar[i]; - break; - } - } - if(_plat==null) - { - _plat=new FontPlat(name,tall,wide,rotation,weight,italic,underline,strikeout,symbol); - staticFontPlatDar.addElement(_plat); - _id=staticFontId++; - } - } -} - -void Font::getCharRGBA(int ch,int rgbaX,int rgbaY,int rgbaWide,int rgbaTall,uchar* rgba) -{ - _plat->getCharRGBA(ch,rgbaX,rgbaY,rgbaWide,rgbaTall,rgba); -} - -void Font::getCharABCwide(int ch,int& a,int& b,int& c) -{ - _plat->getCharABCwide(ch,a,b,c); -} - -int Font::getTall() -{ - return _plat->getTall(); -} - -namespace vgui -{ -void Font_Reset() -{ - staticFontPlatDar.removeAll(); -} -} diff --git a/utils/vgui/lib/win32_vc6/Surface.cpp b/utils/vgui/lib/win32_vc6/Surface.cpp deleted file mode 100644 index 01645939..00000000 --- a/utils/vgui/lib/win32_vc6/Surface.cpp +++ /dev/null @@ -1,769 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include"vgui_win32.h" -#include - -using namespace vgui; - -class Texture -{ -public: - int _id; - HBITMAP _bitmap; - int _wide; - int _tall; - void *_dib; -}; - -#define MAXTEXTURECOUNT 128 -static int staticTextureCount = 0; -static Texture staticTexture[MAXTEXTURECOUNT]; -static Texture *staticTextureCurrent = NULL; - -static Texture *staticGetTextureById(int id) -{ - if(staticTextureCurrent!=null) - { - if(staticTextureCurrent->_id==id) - { - return staticTextureCurrent; - } - } - - for(int i=0;igetBounds(x,y,wide,tall); - - //create the window and initialize platform specific data - //window is initial a popup and not visible - //when applyChanges is called the window will be shown unless - //it setVisible(false) is called - SurfacePlat *plat = new SurfacePlat(); - plat->hwnd = CreateWindowEx(0, "Surface", "", WS_POPUP, x, y, wide, tall, NULL, NULL, GetModuleHandle(NULL), NULL); - plat->clipRgn = CreateRectRgn(0,0,64,64); - plat->hdc = CreateCompatibleDC(NULL); - plat->hwndDC = GetDC(_plat->hwnd); - plat->bitmap = null; - plat->bitmapSize[0] = 0; - plat->bitmapSize[1] = 0; - plat->isFullscreen = false; - - ::SetBkMode(plat->hdc, TRANSPARENT); - ::SetWindowLong(plat->hwnd, GWL_USERDATA, (LONG)this); - ::SetTextAlign(plat->hdc, TA_LEFT | TA_TOP | TA_UPDATECP); - - return true; -} - -static LRESULT CALLBACK staticProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam) -{ - LRESULT ret = TRUE; - - Surface *surface = (Surface *)GetWindowLong(hwnd, GWL_USERDATA); - - switch (msg) - { - case WM_SETFOCUS: - { - surface->getPanel()->requestFocus(); - break; - } - case WM_SETCURSOR: - { - SetCursor(staticCurrentCursor); - break; - } - case WM_MOUSEMOVE: - { - POINT pt; - pt.x = (short)LOWORD(lparam); - pt.y = (short)HIWORD(lparam); - surface->getApp()->internalCursorMoved(pt.x, pt.y, surface); - break; - } - case WM_LBUTTONDOWN: - { - surface->getApp()->internalMousePressed(MOUSE_LEFT, surface); - break; - } - case WM_RBUTTONDOWN: - { - surface->getApp()->internalMousePressed(MOUSE_RIGHT, surface); - break; - } - case WM_MBUTTONDOWN: - { - surface->getApp()->internalMousePressed(MOUSE_MIDDLE, surface); - break; - } - case WM_LBUTTONDBLCLK: - { - surface->getApp()->internalMouseDoublePressed(MOUSE_LEFT, surface); - break; - } - case WM_RBUTTONDBLCLK: - { - surface->getApp()->internalMouseDoublePressed(MOUSE_RIGHT, surface); - break; - } - case WM_MBUTTONDBLCLK: - { - surface->getApp()->internalMouseDoublePressed(MOUSE_MIDDLE, surface); - break; - } - case WM_LBUTTONUP: - { - surface->getApp()->internalMouseReleased(MOUSE_LEFT, surface); - break; - } - case WM_RBUTTONUP: - { - surface->getApp()->internalMouseReleased(MOUSE_RIGHT, surface); - break; - } - case WM_MBUTTONUP: - { - surface->getApp()->internalMouseReleased(MOUSE_MIDDLE, surface); - break; - } - case WM_MOUSEWHEEL: - { - surface->getApp()->internalMouseWheeled(((short)HIWORD(wparam))/WHEEL_DELTA, surface); - break; - } - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - { - int code = wparam; - if (!(lparam & (1<<30))) - { - surface->getApp()->internalKeyPressed(s_pVirtualKeyToKeyCode[code], surface); - } - surface->getApp()->internalKeyTyped(s_pVirtualKeyToKeyCode[code], surface); - break; - } - case WM_KEYUP: - case WM_SYSKEYUP: - { - int code=wparam; - surface->getApp()->internalKeyReleased(s_pVirtualKeyToKeyCode[code], surface); - break; - } - case WM_ERASEBKGND: - { - //since the vgui invalidate call does not erase the background - //this will only be called when windows itselfs wants a repaint. - //this is the desired behavior because this call will for the - //surface and all its children to end up being repainted, which - //is what you want when windows wants you to repaint the surface, - //but not what you want when say a control wants to be painted - //Panel::repaint will always invalidate the surface so it will - //get a WM_PAINT, but that does not necessarily mean you want - //the whole surface painted - //simply this means.. this call only happens when windows wants the repaint - //and WM_PAINT gets called just after this to do the real painting - - surface->getPanel()->repaint(); - break; - } - case WM_PAINT: - { - //surface was by repainted vgui or by windows itself, do the repainting all repainting - //will goes through here and nowhere else - - PAINTSTRUCT ps; - HDC hDC=::BeginPaint(hwnd,&ps); - surface->getPanel()->solveTraverse(); - surface->getPanel()->paintTraverse(); - ::EndPaint(hwnd,&ps); - - //clear the update rectangle so it does not get another repaint - ::ValidateRect(hwnd, NULL); - - break; - } - } - return DefWindowProc(hwnd,msg,wparam,lparam); -} - -bool Surface::recreateContext() -{ - int wide,tall; - getPanel()->getSize(wide,tall); - - // rebuild bitmap only if necessary - // simple scheme to prevent excessive allocations by allocating only when - // bigger. It also adds in 100 extra for subsequent sizings - // it will also realloc if the size is 200 smaller to shrink memory usage - if ((wide > _plat->bitmapSize[0]) - || (tall > _plat->bitmapSize[1]) - || (wide < (_plat->bitmapSize[0] - 200)) - || (tall < (_plat->bitmapSize[1] - 200))) - { - if (_plat->bitmap != null) - { - ::DeleteObject(_plat->bitmap); - } - - _plat->hwndDC = GetDC(_plat->hwnd); - - _plat->bitmap = ::CreateCompatibleBitmap(_plat->hwndDC, wide + 100, tall + 100); - _plat->bitmapSize[0] = wide + 100; - _plat->bitmapSize[1] = tall + 100; - - ::SelectObject(_plat->hdc, _plat->bitmap); - _plat->textureDC = ::CreateCompatibleDC(_plat->hdc); - } - - return true; -} - -void Surface::applyChanges() -{ - RECT rect; - int x, y, wide, tall, sx, sy, swide, stall; - - // get how big the win32 window - ::GetWindowRect(_plat->hwnd, &rect); - sx = rect.left; - sy = rect.top; - swide = rect.right-rect.left; - stall = rect.bottom-rect.top; - - // how big is the embedded Panel - getPanel()->getBounds(x, y, wide, tall); - - // if they are not the same, then adjust the win32 window so it is - if ((x != sx) || (y != sy) || (wide != swide) || (tall != stall)) - { - ::SetWindowPos(_plat->hwnd, null, x, y, wide, tall, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS); - } - - // check to see if the win32 window is visible - if (::GetWindowLong(_plat->hwnd, GWL_STYLE) & WS_VISIBLE) - { - //check to see if embedded Panel is not visible, if so then hide the win32 window - if (getPanel()->isVisible()) - { - ::ShowWindow(_plat->hwnd, SW_HIDE); - } - } - else // win32 window is hidden - { - //check to see if embedded Panel is visible, if so then show the win32 window - if (getPanel()->isVisible()) - { - ::ShowWindow(_plat->hwnd, SW_SHOWNA); - } - } - - //if the win32 window changed size and is visible, then the context needs to be recreated - if (((wide != swide) || (tall != stall)) && getPanel()->isVisible()) - { - recreateContext(); - } -} - -void Surface::swapBuffers() -{ - int wide,tall; - getPanel()->getSize(wide,tall); - - // reset origin and clipping then blit - ::SetRectRgn(_plat->clipRgn, 0, 0, wide, tall); - ::SelectObject(_plat->hdc, _plat->clipRgn); - ::SetViewportOrgEx(_plat->hdc, 0, 0, NULL); - ::BitBlt(_plat->hwndDC, 0, 0, wide, tall, _plat->hdc, 0, 0, SRCCOPY); -} - -void Surface::drawSetColor(int r,int g,int b,int a) -{ - SetBkColor(_plat->hdc,RGB(r,g,b)); -} - -void Surface::drawFilledRect(int x0,int y0,int x1,int y1) -{ - // trick to draw filled rectangles using current background color - RECT rect = { x0, y0, x1, y1}; - BOOL res = ExtTextOut(_plat->hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); -} - -void Surface::drawOutlinedRect(int x0,int y0,int x1,int y1) -{ - // draw an outline of a rectangle using 4 filledRect - drawFilledRect(x0,y0,x1,y0+1); // top - drawFilledRect(x0,y1-1,x1,y1); // bottom - drawFilledRect(x0,y0+1,x0+1,y1-1); // left - drawFilledRect(x1-1,y0+1,x1,y1-1); // right -} - -void Surface::drawSetTextColor(int r,int g,int b,int a) -{ - SetTextColor(_plat->hdc,RGB(r,g,b)); -} - -void Surface::drawPrintText(const char* text,int textLen) -{ - assert(text); - if (!text) - return; - - if (textLen < 1) - return; - - ExtTextOut(_plat->hdc, 0, 0, 0, NULL, text, textLen, NULL); -} - -int Surface::createNewTextureID(void) -{ - //!! hack, arbitrary base - static int staticBindIndex = 2700; - return staticBindIndex++; -} - -HBITMAP staticCreateBitmapHandle(int wide, int tall, HDC hdc, int bpp, void **dib) -{ - BITMAPINFOHEADER bitmapInfoHeader; - memset(&bitmapInfoHeader, 0, sizeof(bitmapInfoHeader)); - bitmapInfoHeader.biSize = sizeof(bitmapInfoHeader); - bitmapInfoHeader.biWidth = wide; - bitmapInfoHeader.biHeight = -tall; - bitmapInfoHeader.biPlanes = 1; - bitmapInfoHeader.biBitCount = bpp; - bitmapInfoHeader.biCompression = BI_RGB; - - return ::CreateDIBSection(hdc, (BITMAPINFO*)&bitmapInfoHeader, DIB_RGB_COLORS, dib, null, 0); -} - -void Surface::drawSetTextureRGBA(int id,const char* rgba,int wide,int tall) -{ - Texture *texture = staticGetTextureById(id); - if (!texture) - { - if (staticTextureCount >= MAXTEXTURECOUNT) - return; - - // allocate a new texture - texture = &staticTexture[staticTextureCount++]; - texture->_id = id; - } - - if (texture->_bitmap) - { - ::DeleteObject(texture->_bitmap); - } - - { - // no texture or forced load the new texture - texture->_wide = wide; - texture->_tall = tall; - texture->_bitmap = staticCreateBitmapHandle(texture->_wide, - texture->_tall, _plat->hdc, 32, &texture->_dib ); - - // copy over the texture data - memcpy(texture->_dib,rgba,wide*tall*4); - - } -} - -void Surface::drawSetTexture(int id) -{ - staticTextureCurrent = staticGetTextureById(id); -} - -void Surface::drawTexturedRect(int x0,int y0,int x1,int y1) -{ - if (staticTextureCurrent == null) - { - return; - } - - if (_plat->textureDC == null) - { - return; - } - - HBITMAP bitmap = staticTextureCurrent->_bitmap; - int wide = staticTextureCurrent->_wide; - int tall = staticTextureCurrent->_tall; - - ::SelectObject(_plat->textureDC, bitmap); - ::StretchBlt(_plat->hdc,x0,y0,x1-x0,y1-y0,_plat->textureDC,0,0,wide,tall,SRCCOPY); -} - -void Surface::pushMakeCurrent(Panel* panel,bool useInsets) -{ - int inset[4]; - - //!! need to make the inset part of Panel - panel->getInset(inset[0],inset[1],inset[2],inset[3]); - - if(!useInsets) - { - inset[0]=0; - inset[1]=0; - inset[2]=0; - inset[3]=0; - } - - int absThis[4]; - getPanel()->getAbsExtents(absThis[0],absThis[1],absThis[2],absThis[3]); - - int absPanel[4]; - panel->getAbsExtents(absPanel[0],absPanel[1],absPanel[2],absPanel[3]); - - int clipRect[4]; - panel->getClipRect(clipRect[0],clipRect[1],clipRect[2],clipRect[3]); - - if ( getPanel() == panel ) - { - // this panel has it's own window, so use screen space - ::SetViewportOrgEx(_plat->hdc,0+inset[0],0+inset[1],null); - } - else - { - // child window, so set win32 up so all subsequent drawing calls are done in local space - ::SetViewportOrgEx(_plat->hdc,(absPanel[0]+inset[0])-absThis[0],(absPanel[1]+inset[1])-absThis[1],null); - } - - // setup clipping - // get and translate clipRect into surface space, then factor in inset - int x0 = clipRect[0] - absThis[0]; - int y0 = clipRect[1] - absThis[1]; - int x1 = clipRect[2] - absThis[0]; - int y1 = clipRect[3] - absThis[1]; - - //set the rect and select to make it current - ::SetRectRgn(_plat->clipRgn,x0,y0,x1,y1); - ::SelectObject(_plat->hdc, _plat->clipRgn); -} - -void Surface::popMakeCurrent(Panel* panel) -{ -} - -void Surface::enableMouseCapture(bool state) -{ - if (state) - { - HWND wnd = ::SetCapture(_plat->hwnd); - } - else - { - ::ReleaseCapture(); - } -} - -void Surface::setCursor(Cursor* cursor) -{ - _currentCursor = cursor; - - if (cursor != null) - { - _emulatedCursor->setImage(cursor->getBitmap()); - - switch (cursor->getDefaultCursor()) - { - case Cursor::dc_none: - case Cursor::dc_arrow: - case Cursor::dc_ibeam: - case Cursor::dc_hourglass: - case Cursor::dc_crosshair: - case Cursor::dc_up: - case Cursor::dc_sizenwse: - case Cursor::dc_sizenesw: - case Cursor::dc_sizewe: - case Cursor::dc_sizens: - case Cursor::dc_sizeall: - case Cursor::dc_no: - case Cursor::dc_hand: - { - staticCurrentCursor = staticDefaultCursor[cursor->getDefaultCursor()]; - break; - } - case Cursor::dc_user: - { - break; - } - } - } - else - { - staticCurrentCursor = NULL; - _emulatedCursor->setImage(null); - } - - ::SetCursor(staticCurrentCursor); -} - -void Surface::invalidate(Panel *panel) -{ - InvalidateRect(_plat->hwnd, NULL, false); -} - -void Surface::drawSetTextFont(Font* font) -{ - assert(font); - if (!font) - { - return; - } - - font->getPlat()->drawSetTextFont(_plat); -} - -void Surface::setTitle(const char* title) -{ - SetWindowTextA(_plat->hwnd, title); -} - -bool Surface::hasFocus() -{ - return GetFocus() == _plat->hwnd; -} - -int Surface::getModeInfoCount() -{ - resetModeInfo(); - addModeInfo(640,480,16); - addModeInfo(800,600,16); - return SurfaceBase::getModeInfoCount(); -} - -bool Surface::setFullscreenMode(int wide,int tall,int bpp) -{ - if (_plat->isFullscreen && _plat->fullscreenInfo[0] == wide && _plat->fullscreenInfo[1] == tall && _plat->fullscreenInfo[2] == bpp) - { - return true; - } - - if (_modeInfoDar.getCount() == 0) - { - getModeInfoCount(); - } - for (int i = 0; i < _modeInfoDar.getCount(); i++) - { - int modewide, modetall, modebpp; - sscanf(_modeInfoDar[i], "%dx%dx%d", &modewide, &modetall, &modebpp); - if (wide == modewide && tall == modetall && bpp == modebpp) - { - DEVMODE dm; - memset(&dm, 0, sizeof(dm)); - - dm.dmSize = sizeof(dm); - dm.dmPelsWidth = wide; - dm.dmPelsHeight = tall; - dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL; - dm.dmBitsPerPel = bpp; - - if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL) - { - if (!_plat->isFullscreen) - { - getPanel()->getBounds(_plat->restoreInfo[0], _plat->restoreInfo[1], _plat->restoreInfo[2], _plat->restoreInfo[3]); - SetWindowPos(_plat->hwnd,HWND_TOPMOST,-1,-1,-1,-1,SWP_NOMOVE|SWP_NOSIZE); - } - getPanel()->setBounds(0,0,wide,tall); - applyChanges(); - _plat->isFullscreen = true; - _plat->fullscreenInfo[0] = wide; - _plat->fullscreenInfo[1] = tall; - _plat->fullscreenInfo[2] = bpp; - getPanel()->repaint(); - return true; - } - } - } - - return false; -} - -void Surface::setWindowedMode() -{ - if (_plat->isFullscreen) - { - getPanel()->setBounds(_plat->restoreInfo[0], _plat->restoreInfo[1], _plat->restoreInfo[2], _plat->restoreInfo[3]); - ChangeDisplaySettings(NULL, 0); - applyChanges(); - _plat->isFullscreen = false; - getPanel()->repaint(); - } -} - -void Surface::drawSetTextPos(int x,int y) -{ - MoveToEx(_plat->hdc,x,y,null); -} - -void Surface::setAsTopMost(bool state) -{ - if (state) - SetWindowPos(_plat->hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); - else - SetWindowPos(_plat->hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); -} - -bool Surface::isWithin(int x,int y) -{ - POINT pnt={x,y}; - return _plat->hwnd == WindowFromPoint(pnt); -} diff --git a/utils/vgui/lib/win32_vc6/fileimage.cpp b/utils/vgui/lib/win32_vc6/fileimage.cpp deleted file mode 100644 index e4226b21..00000000 --- a/utils/vgui/lib/win32_vc6/fileimage.cpp +++ /dev/null @@ -1,208 +0,0 @@ -//========= Copyright ?1996-2003, Valve LLC, All rights reserved. ============ -// -// The copyright to the contents herein is the property of Valve, L.L.C. -// The contents may be used and/or copied only with the written permission of -// Valve, L.L.C., or in accordance with the terms and conditions stipulated in -// the agreement/contract under which the contents have been supplied. -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include "fileimage.h" - -// TGA header. -#pragma pack(1) - class TGAFileHeader - { - public: - unsigned char m_IDLength; - unsigned char m_ColorMapType; - unsigned char m_ImageType; - unsigned short m_CMapStart; - unsigned short m_CMapLength; - unsigned char m_CMapDepth; - unsigned short m_XOffset; - unsigned short m_YOffset; - unsigned short m_Width; - unsigned short m_Height; - unsigned char m_PixelDepth; - unsigned char m_ImageDescriptor; - }; -#pragma pack() - - - -// ---------------------------------------------------------------------------------------- // -// FileImageStream_Memory. -// ---------------------------------------------------------------------------------------- // -FileImageStream_Memory::FileImageStream_Memory(void *pData, int dataLen) -{ - m_pData = (unsigned char*)pData; - m_DataLen = dataLen; - m_CurPos = 0; - m_bError = false; -} - -void FileImageStream_Memory::Read(void *pData, int len) -{ - unsigned char *pOut; - int i; - - pOut = (unsigned char*)pData; - for(i=0; i < len; i++) - { - if(m_CurPos < m_DataLen) - { - pOut[i] = m_pData[m_CurPos]; - ++m_CurPos; - } - else - { - pOut[i] = 0; - m_bError = true; - } - } -} - -bool FileImageStream_Memory::ErrorStatus() -{ - bool ret=m_bError; - m_bError=false; - return ret; -} - - - -// ---------------------------------------------------------------------------------------- // -// Encode/decode functions. -// ---------------------------------------------------------------------------------------- // -static void WriteRun(unsigned char *pColor, FILE *fp, int runLength) -{ - unsigned char runCount; - - runCount = runLength - 1; - runCount |= (1 << 7); - fwrite( &runCount, 1, 1, fp ); - fwrite( pColor, 1, 4, fp ); -} - - -// Load in a 32-bit TGA file. -bool Load32BitTGA( - FileImageStream *fp, - FileImage *pImage) -{ - TGAFileHeader hdr; - char dummyChar; - int i, x, y; - long color; - int runLength, curOut; - unsigned char *pLine; - unsigned char packetHeader; - - - pImage->Term(); - - // Read and verify the header. - fp->Read(&hdr, sizeof(hdr)); - if(hdr.m_PixelDepth != 32 || hdr.m_ImageType != 10) - return false; - - // Skip the ID area.. - for(i=0; i < hdr.m_IDLength; i++) - fp->Read(&dummyChar, 1); - - pImage->m_Width = hdr.m_Width; - pImage->m_Height = hdr.m_Height; - pImage->m_pData = new unsigned char[hdr.m_Width * hdr.m_Height * 4]; - if(!pImage->m_pData) - return false; - - // Read in the data.. - for(y=pImage->m_Height-1; y >= 0; y--) - { - pLine = &pImage->m_pData[y*pImage->m_Width*4]; - - curOut = 0; - while(curOut < pImage->m_Width) - { - fp->Read(&packetHeader, 1); - - runLength = (int)(packetHeader & ~(1 << 7)) + 1; - if(curOut + runLength > pImage->m_Width) - return false; - - if(packetHeader & (1 << 7)) - { - fp->Read(&color, 4); - for(x=0; x < runLength; x++) - { - *((long*)pLine) = color; - pLine += 4; - } - } - else - { - for(x=0; x < runLength; x++) - { - fp->Read(&color, 4); - *((long*)pLine) = color; - pLine += 4; - } - } - - curOut += runLength; - } - } - - return true; -} - - -// Write a 32-bit TGA file. -void Save32BitTGA( - FILE *fp, - FileImage *pImage) -{ - TGAFileHeader hdr; - int y, runStart, x; - unsigned char *pLine; - - - memset(&hdr, 0, sizeof(hdr)); - hdr.m_PixelDepth = 32; - hdr.m_ImageType = 10; // Run-length encoded RGB. - hdr.m_Width = pImage->m_Width; - hdr.m_Height = pImage->m_Height; - - fwrite(&hdr, 1, sizeof(hdr), fp ); - - // Lines are written bottom-up. - for(y=pImage->m_Height-1; y >= 0; y--) - { - pLine = &pImage->m_pData[y*pImage->m_Width*4]; - - runStart = 0; - for(x=0; x < pImage->m_Width; x++) - { - if((x - runStart) >= 128 || - *((long*)&pLine[runStart*4]) != *((long*)&pLine[x*4])) - { - // Encode this Run. - WriteRun(&pLine[runStart*4], fp, x - runStart); - runStart = x; - } - } - - // Encode the last Run. - if(x - runStart > 0) - { - WriteRun(&pLine[runStart*4], fp, x - runStart); - } - } -} - - diff --git a/utils/vgui/lib/win32_vc6/fileimage.h b/utils/vgui/lib/win32_vc6/fileimage.h deleted file mode 100644 index d3e2bfcc..00000000 --- a/utils/vgui/lib/win32_vc6/fileimage.h +++ /dev/null @@ -1,100 +0,0 @@ -//========= Copyright © 1996-2003, Valve LLC, All rights reserved. ============ -// -// The copyright to the contents herein is the property of Valve, L.L.C. -// The contents may be used and/or copied only with the written permission of -// Valve, L.L.C., or in accordance with the terms and conditions stipulated in -// the agreement/contract under which the contents have been supplied. -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#ifndef __FILEIMAGE_H__ -#define __FILEIMAGE_H__ - -#ifdef _WIN32 -#pragma once -#endif - -#include - -typedef void *FileHandle_t; - -class FileImageStream -{ -public: - virtual void Read(void *pOut, int len)=0; - - // Returns true if there were any Read errors. - // Clears error status. - virtual bool ErrorStatus()=0; -}; - - -// Use to read out of a memory buffer.. -class FileImageStream_Memory : public FileImageStream -{ -public: - FileImageStream_Memory(void *pData, int dataLen); - - virtual void Read(void *pOut, int len); - virtual bool ErrorStatus(); - - -private: - unsigned char *m_pData; - int m_DataLen; - int m_CurPos; - bool m_bError; -}; - - - -// Generic image representation.. -class FileImage -{ -public: - FileImage() - { - Clear(); - } - - ~FileImage() - { - Term(); - } - - void Term() - { - if(m_pData) - delete [] m_pData; - - Clear(); - } - - // Clear the structure without deallocating. - void Clear() - { - m_Width = m_Height = 0; - m_pData = NULL; - } - - int m_Width, m_Height; - unsigned char *m_pData; -}; - - -// Functions to load/save FileImages. -bool Load32BitTGA( - FileImageStream *fp, - FileImage *pImage); - -void Save32BitTGA( - FileHandle_t fp, - FileImage *pImage); - - -#endif - - diff --git a/utils/vgui/lib/win32_vc6/vfontdata.cpp b/utils/vgui/lib/win32_vc6/vfontdata.cpp deleted file mode 100644 index 5c7507f9..00000000 --- a/utils/vgui/lib/win32_vc6/vfontdata.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include "vfontdata.h" - -VFontData::VFontData() -{ - m_BitmapCharWidth = m_BitmapCharHeight = 0; - m_pBitmap = NULL; -} - -VFontData::~VFontData() -{ - if (m_pBitmap) - delete [] m_pBitmap; -} - -bool LoadVFontDataFrom32BitTGA(FileImageStream *fp, VFontData *pData) -{ - FileImage fileImage; - - unsigned char *pInLine, *pOutLine; - int i, x, y; - int rightX; - - if (!Load32BitTGA(fp, &fileImage)) - return false; - - pData->m_pBitmap = new unsigned char [fileImage.m_Width*fileImage.m_Height]; - if (pData->m_pBitmap) - { - pData->m_BitmapCharWidth = fileImage.m_Width/256; - pData->m_BitmapCharHeight = fileImage.m_Height; - - for (i = 0; i < 256; i++) - { - rightX = 0; - pInLine = &fileImage.m_pData[i*pData->m_BitmapCharWidth*4]; - pOutLine = &pData->m_pBitmap[i*pData->m_BitmapCharWidth]; - - for (y = 0; y < pData->m_BitmapCharHeight; y++) - { - for (x = 0; x < pData->m_BitmapCharWidth; x++) - { - if (pInLine[x*4+0] != 0 || pInLine[x*4+1] != 0 || pInLine[x*4 +2] != 0 || pInLine[x*4+2] != 0) - { - pOutLine[x] = 1; - if (x > rightX) - rightX = x; - } - else - pOutLine[x] = 0; - } - pInLine += 256*pData->m_BitmapCharWidth*4; - pOutLine += 256*pData->m_BitmapCharWidth; - } - pData->m_CharWidths[i] = (i == 32) ? pData->m_BitmapCharWidth/4 : rightX; - } - } - - return true; -} diff --git a/utils/vgui/lib/win32_vc6/vfontdata.h b/utils/vgui/lib/win32_vc6/vfontdata.h deleted file mode 100644 index cab6d3fe..00000000 --- a/utils/vgui/lib/win32_vc6/vfontdata.h +++ /dev/null @@ -1,35 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#ifndef __VFONTDATA_H__ -#define __VFONTDATA_H__ - -#ifdef _WIN32 -#pragma once -#endif - -#include "fileimage.h" - -class VFontData -{ -public: - VFontData(); - ~VFontData(); - -public: - int GetLineWidth(); - int m_CharWidths[256]; - int m_BitmapCharWidth; - int m_BitmapCharHeight; - unsigned char *m_pBitmap; -}; - -bool LoadVFontDataFrom32BitTGA( - FileImageStream *fp, VFontData *pData); - -#endif - diff --git a/utils/vgui/lib/win32_vc6/vgui.cpp b/utils/vgui/lib/win32_vc6/vgui.cpp deleted file mode 100644 index 89941608..00000000 --- a/utils/vgui/lib/win32_vc6/vgui.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include -#include - -namespace vgui -{ -int vgui_dprintf(const char* format,...) -{ - char buf[2048]; - va_list argList; - - va_start(argList,format); - int ret=vsprintf(buf,format,argList); - va_end(argList); - - ::OutputDebugString(buf); - return ret; -} - -int vgui_dprintf2(const char* format,...) -{ - char buf[2048]; - va_list argList; - static int ctr=0; - - sprintf(buf,"%d:",ctr++); - - va_start(argList,format); - int ret=vsprintf(buf+strlen(buf),format,argList); - va_end(argList); - - ::OutputDebugString(buf); - return ret; -} -} diff --git a/utils/vgui/lib/win32_vc6/vgui.lib b/utils/vgui/lib/win32_vc6/vgui.lib index 58878f734003c257ae308b800822c9c557c633cd..aff77160c68e81162d591b53579221dd23619ab5 100644 GIT binary patch delta 62894 zcmcef3w(}c{QtlAb+`>Pa~fu5PK%kD89ASlBs7wc7)cTuNs>HBk~Cx5Es2pN2_Ymg zlB8iIA%~G9p^+qs|L3~y*}d!8^!xu_uiq=L*ZX<4=e`c#>wCHm_x()Tnu<%;S4^o; ztVxq5cQ=S_7}q$$NjPnV`WiHfz`w*|L`7dGzAK9OZm_2>iR5l1;x@W8SWQCH2=Aa_ z7nf$ENhlgGcWHEkgraenOZ+AhiYConn%g84@v$y<`(}~28#Ef~((nix22FdrG|56m z(Dby1U(P0lc(y%>b^#iG>I^AlzbuX2Wh!YpUn5&lgSjLmlMQ5B;qpjZl0Nm)bEr#? zP?CzrVq6}*K~m8x#ie&9NyS6>O!0l3#;)3%6f$Us%guEp72j=gsZfKYqWnCKIJ$@w zvc_ogsTVtLutsK~aYd?m+G*k z;?>e5dO;Y#bBbxi$bls833Mr!Lqahrmc&D-u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