diff options
Diffstat (limited to 'soldep/inc')
-rw-r--r-- | soldep/inc/appdef.hxx | 161 | ||||
-rw-r--r-- | soldep/inc/dep.hxx | 69 | ||||
-rw-r--r-- | soldep/inc/dtsodcmp.hrc | 99 | ||||
-rw-r--r-- | soldep/inc/minormk.hxx | 77 | ||||
-rw-r--r-- | soldep/inc/prodmap.hxx | 86 | ||||
-rw-r--r-- | soldep/inc/soldep/connctr.hxx | 86 | ||||
-rw-r--r-- | soldep/inc/soldep/depper.hxx | 208 | ||||
-rw-r--r-- | soldep/inc/soldep/depwin.hxx | 75 | ||||
-rw-r--r-- | soldep/inc/soldep/graphwin.hxx | 54 | ||||
-rw-r--r-- | soldep/inc/soldep/hashobj.hxx | 45 | ||||
-rw-r--r-- | soldep/inc/soldep/hashtbl.hxx | 204 | ||||
-rw-r--r-- | soldep/inc/soldep/objwin.hxx | 160 | ||||
-rw-r--r-- | soldep/inc/soldep/prj.hxx | 480 | ||||
-rw-r--r-- | soldep/inc/soldep/sdtresid.hxx | 52 | ||||
-rw-r--r-- | soldep/inc/soldep/soldep.hxx | 116 | ||||
-rw-r--r-- | soldep/inc/soldep/soldlg.hrc | 79 | ||||
-rw-r--r-- | soldep/inc/soldep/soldlg.hxx | 160 | ||||
-rw-r--r-- | soldep/inc/soldep/tbox.hxx | 102 |
18 files changed, 2313 insertions, 0 deletions
diff --git a/soldep/inc/appdef.hxx b/soldep/inc/appdef.hxx new file mode 100644 index 000000000000..cc8d5d0f2f8b --- /dev/null +++ b/soldep/inc/appdef.hxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _MHAPPDEF_HXX +#define _MHAPPDEF_HXX + + +#ifdef UNX +#define DEFAULT_INI_ROOT "/so/env" +#define DEFAULT_BS_ROOT "/so/env/b_server" +#define DEFAULT_EIS_ROOT "/so/env/merge" +#define PATH_SEPARATOR '/' +#define S_PATH_SEPARATOR "/" +#else +#define DEFAULT_INI_ROOT "r:" +#define DEFAULT_BS_ROOT "n:" +#define DEFAULT_EIS_ROOT "w:" +#define PATH_SEPARATOR '\\' +#define S_PATH_SEPARATOR "\\" +#endif + +#define _INI_DRV DEFAULT_INI_ROOT +#define B_SERVER_ROOT DEFAULT_BS_ROOT +#define DEFAULT_INI_FILE B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "b_server.ini" +#define BINARYROOT B_SERVER_ROOT S_PATH_SEPARATOR "bin" +#define _JOB_DIR B_SERVER_ROOT S_PATH_SEPARATOR "server" S_PATH_SEPARATOR "db" +#define _INJOB_DIR B_SERVER_ROOT S_PATH_SEPARATOR "server" S_PATH_SEPARATOR "dbin" +#define _OUTJOB_DIR B_SERVER_ROOT S_PATH_SEPARATOR "server" S_PATH_SEPARATOR "dbout" +#define _ERRJOB_DIR B_SERVER_ROOT S_PATH_SEPARATOR "server" S_PATH_SEPARATOR "dberr" +#define _BUILDPATTERN_DIR B_SERVER_ROOT S_PATH_SEPARATOR "pattern" +#define _COMMENT_DIR B_SERVER_ROOT S_PATH_SEPARATOR "comment" +#define _SOLARLIST B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "solar.lst" +#define _DEF_STAND_LIST B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "stand.lst" +#define _DEF_DEFAULT_LIST B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "default.lst" +#define _DEF_SSOLARINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "ssolar.ini" +#define _DEF_SSCOMMON B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "ssolar.cmn" +#define _SERVER_IDENT_FLAG B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "server.id" +#define _CUSTOMJOBINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "custom.ini" +#define _BUILDCOMMANDINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "bcommand.ini" +#define _DATABASEINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "database.ini" +#define _ZNINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "bszn.ini" +#define _ERRORINFOFILE B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "errinf.lst" +#define _REGEXPINFOFILE B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "regexp.lst" +#define _POSITIVERRORINFOFILE B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "perrinf.lst" +#define _POSITIVREGEXPINFOFILE B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "pregexp.lst" +#define _INIROOT B_SERVER_ROOT S_PATH_SEPARATOR "config" +#define _INIROOT_OLD B_SERVER_ROOT S_PATH_SEPARATOR "config" +#define _ENV_DIR B_SERVER_ROOT S_PATH_SEPARATOR "config" +#define _REDIRECTIONPATH B_SERVER_ROOT S_PATH_SEPARATOR "redir" +#define _ZLOGSPATH B_SERVER_ROOT S_PATH_SEPARATOR "zlogs" +#define DEFAULT_PROTPATH B_SERVER_ROOT S_PATH_SEPARATOR "filesize" +#define _INI_UNC "\\\\jumbo2.germany.sun.com\\R-Laufwerk" +#define _INI_UNC_OLD "\\\\jumbo2.germany.sun.com\\R-Laufwerk" +#define LOG_DIR B_SERVER_ROOT S_PATH_SEPARATOR "log" + +#define _REDIRECTIONSIZE "10000" +#define _EISPATH DEFAULT_EIS_ROOT S_PATH_SEPARATOR "EIS" + +#define _BUILDEVENTPATH _EISPATH S_PATH_SEPARATOR "EventImport" + +#define _WRITE_LOGFILES "1" +#define _WRITE_JOBFILES "1" + +#define _VERSION_WINDOW "0" +#define _JOB_WINDOW "0" +#define _APPWIN_MAXIMIZED "0" +#define _CONTEXT_TBOX "0" + +#define _COLOR_DROPED COL_GRAY +#define _COLOR_WAIT COL_BLUE +#define _COLOR_BUILD COL_GREEN +#define _COLOR_ERROR COL_RED +#define _COLOR_BUILDERROR COL_MAGENTA +#define _COLOR_OK COL_BLACK +#define _COLOR_DELIVERED COL_CYAN +#define _COLOR_MASTERSTOP COL_LIGHTRED + +#define _ASYNCHRON "1" + +// folowing defines are used to write filesize information for binaries +#define OH_GOTT "*" +#define UNX_DEFAULT_FILESIZES "bin/" OH_GOTT ".bin;bin/" OH_GOTT ".res;bin/" OH_GOTT ".tlb;lib/" OH_GOTT ".so" +#define DOS_DEFAULT_FILESIZES "bin\\*.exe;bin\\*.res;bin\\*.dll;bin\\*.tlb" + +#ifdef UNX +#define DEFAULT_FILESIZES UNX_DEFAULT_FILESIZES +#else +#define DEFAULT_FILESIZES DOS_DEFAULT_FILESIZES +#endif + +/** States for BuildServer projects and directories +*/ +#ifndef BuildStatus +#define BuildStatus USHORT +#endif +#define BS_DROPED 0 /// project is waiting for dispatching +#define BS_BUILD 1 /// project/directory is building +#define BS_WAIT 2 /// project/directory is waiting for building +#define BS_OK 3 /// project/directory builded whithout errors +#define BS_BUILDANDERROR 4 /// project is in build, any errors accured +#define BS_ERROR 5 /// project/directory builded with errors +#define BS_NON 6 /// no state is set +#define BS_DELIVERED 7 /// project was delivered without errors +#define BS_DELIVEREDANDERROR 8 /// project was delivered with errors +#define BS_FIXED 9 /// errors are fixed +#define BS_NOTDELIVERED 10 /// project is ready to deliver +#define BS_BUILD_PRIO 11 /// build projects with prio +#define BS_BUILD_ORDER 12 /// build project in correct order +#define BS_BUILD_DEPEND 13 /// build projects using dependencies +#define BS_BUILD_DELIVER 14 /// build projects using dependencies and deliver builded projects +#define BS_BUILD_NORMAL 15 /// build projects without using dependencies +#define BS_BUILD_DELIVER_NO_DEPEND 16 /// build projects without using dependencies and deliver builded projects +#define BS_BUILD_DOUBLE_LOG 17 /// error with double log names + +#define LF_STARDIV "StarDivision" +#define LF_UNIX "UNIX" +#define LF_MAC "Macintosh" +#define LF_OS2 "OS/2" + +// path conversion +const char* GetDefStandList(); +const char* GetIniRoot(); +const char* GetIniRootOld(); +const char* GetSSolarIni(); +const char* GetSSCommon(); +const char* GetBServerRoot(); + +const char* GetEnv( const char *pVar ); +const char* GetEnv( const char *pVar, const char *pDefault ); + +#define CONVERT_R_TO_HOSTFSYS( sPath ) { sPath.ToLowerAscii().SearchAndReplace( "r:", GetEnv("ISERVERBASE", DEFAULT_INI_ROOT ) ); sPath.SearchAndReplaceAll( "\\", S_PATH_SEPARATOR ); } + +// Only for usage inside IServer! +#define ISERVER_DEF_STAND_LIST "r:\\b_server\\config\\stand.lst" +#define ISERVER_DEF_DEPEND_LIST "r:\\b_server\\config\\depend.lst" + +#endif diff --git a/soldep/inc/dep.hxx b/soldep/inc/dep.hxx new file mode 100644 index 000000000000..f7ef15ace882 --- /dev/null +++ b/soldep/inc/dep.hxx @@ -0,0 +1,69 @@ + /************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DEP_HXX +#define _DEP_HXX + +#include <bootstrp/sstring.hxx> + +class SByteExtStringList : public SByteStringList +{ + private: + BOOL bDeleteStrings; + public: + SByteExtStringList(BOOL bDelete = TRUE) : bDeleteStrings (bDelete) {} + ~SByteExtStringList(); +}; + +class VersionDepInfo : public SByteExtStringList +{ + private: + ByteString* pVersion; + public: + VersionDepInfo() : pVersion (NULL) {} + VersionDepInfo(const ByteString& rCurrentVersion) : pVersion (NULL) { pVersion = new ByteString(rCurrentVersion); } + ~VersionDepInfo(); + void Clear(); + const ByteString* GetVersion() { return pVersion; } + //void SetVersion(ByteString* pStr) { pVersion = pStr; } +}; + +DECLARE_LIST( VersionDepInfoList_Impl, VersionDepInfo* ) + +class VersionDepInfoList : public VersionDepInfoList_Impl +{ + public: + VersionDepInfoList () {} + ~VersionDepInfoList () {} + VersionDepInfo* GetVersion (ByteString& rVersion); + void RemoveVersion (ByteString& rVersion); + VersionDepInfo* InsertVersion (ByteString& rVersion); + +}; + + +#endif diff --git a/soldep/inc/dtsodcmp.hrc b/soldep/inc/dtsodcmp.hrc new file mode 100644 index 000000000000..bfeca821562b --- /dev/null +++ b/soldep/inc/dtsodcmp.hrc @@ -0,0 +1,99 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DTSODCMP_HRC +#define _DTSODCMP_HRC + +//======================================================================== +// Bereiche +#define RID_SD_STRING_START 26000 +#define RID_SD_MENU_START 27000 +#define RID_SD_CONTEXTMENU_START 28500 +#define RID_SD_TOOLBOX_START 29000 +#define RID_SD_WINDOW_START 30000 +#define RID_SD_STATUSBAR_START 30500 +#define RID_SD_IMAGE_START 31000 +#define RID_SD_BITMAP_START 31250 +#define RID_SD_DIALOG_START 31500 +#define RID_SD_DEPPER_DIALOG_START 31750 +// end is at 31999 + +#define SID_START 0 + +//======================================================================== +// Window-Ids + +//======================================================================== +// Menu-Ids +#define RID_SD_MENU_APP (RID_SD_MENU_START) +#define RID_SD_MENU_FILE (RID_SD_MENU_START + 1) +#define RID_SD_MENU_FILE_NEW (RID_SD_MENU_START + 2) +#define RID_SD_MENU_FILE_OPEN (RID_SD_MENU_START + 3) +#define RID_SD_MENU_FILE_SAVE (RID_SD_MENU_START + 4) +#define RID_SD_MENU_FILE_SAVEAS (RID_SD_MENU_START + 5) +#define RID_SD_MENU_FILE_EXIT (RID_SD_MENU_START + 6) +#define RID_SD_MENU_NEW_OBJECT (RID_SD_MENU_START + 7) +#define RID_SD_MENU_REMOVE_LAST (RID_SD_MENU_START + 8) +#define RID_SD_MENU_AUTO (RID_SD_MENU_START + 9) +#define RID_SD_MENU_RUN_TEST (RID_SD_MENU_START + 10) + +//======================================================================== +// ContextMenu-Ids + +//======================================================================== +// ToolBox-Ids +#define RID_SD_TOOLBOX_APP (RID_SD_TOOLBOX_START) +#define RID_SD_TOOLBOX_FILE_NEW (RID_SD_TOOLBOX_START + 1) +#define RID_SD_TOOLBOX_FILE_OPEN (RID_SD_TOOLBOX_START + 2) +#define RID_SD_TOOLBOX_FILE_SAVE (RID_SD_TOOLBOX_START + 3) + + +//======================================================================== +// StatusBar-Ids + +//======================================================================== +// Image-Ids +#define RID_SD_CP_IMAGE (RID_SD_IMAGE_START) + +//======================================================================== +// Dialog-Ids +#define RID_SD_DIALOG_NEWPROJECT (RID_SD_DEPPER_DIALOG_START) +#define RID_SD_DIALOG_NEWDIRECTORY (RID_SD_DEPPER_DIALOG_START + 1) +#define RID_SD_DIALOG_HELP (RID_SD_DEPPER_DIALOG_START + 2) + +//======================================================================== +// String-Ids +#define RID_SD_CP_NAME (RID_SD_STRING_START) + +//======================================================================== +// Slot-Ids + +//======================================================================== +// Format-Ids + +#endif //_DTSODCMP_HRC + diff --git a/soldep/inc/minormk.hxx b/soldep/inc/minormk.hxx new file mode 100644 index 000000000000..0f14497dbaa7 --- /dev/null +++ b/soldep/inc/minormk.hxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <tools/stream.hxx> + +class GenericInformationList; + +// +// class MinorMk +// + +class MinorMk : public SvFileStream +{ +private: + ByteString sRSCVERSION; + ByteString sRSCREVISION; + ByteString sBUILD; + ByteString sLAST_MINOR; + + BOOL bExists; + + void ReadMinorMk( const String &rFileName ); + +public: + MinorMk( + GenericInformationList *pList, + const ByteString &rVersion, + const ByteString &rWorkStamp, + const ByteString &rEnvironment, + const ByteString &rMinor + ); + MinorMk( + const ByteString &rMinor, + const ByteString &rEnvironment + ); + MinorMk( + GenericInformationList *pList, + const ByteString rVersion + ); + ~MinorMk(); + + ByteString GetRscVersion() + { return sRSCVERSION; } + ByteString GetRscRevision() + { return sRSCREVISION; } + ByteString GetBuildNr() + { return sBUILD; } + ByteString GetLastMinor() + { return sLAST_MINOR; } + + BOOL Exists() + { return bExists; } +}; diff --git a/soldep/inc/prodmap.hxx b/soldep/inc/prodmap.hxx new file mode 100644 index 000000000000..97b554b9e52d --- /dev/null +++ b/soldep/inc/prodmap.hxx @@ -0,0 +1,86 @@ + /************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef PRODUCT_MAPPER_HXX +#define PRODUCT_MAPPER_HXX + +#ifndef _SSTRING_HXX +#include <bootstrp/sstring.hxx> +#endif + +class GenericInformation; +class GenericInformationList; + +DECLARE_LIST( BaseProductList, ByteString * ) + +// +// class ProductMapper +// + +#define PRODUCT_MAPPER_OK 0x0000 +#define PRODUCT_MAPPER_NO_PRODUCT 0x0001 +#define PRODUCT_MAPPER_NO_VERSION_INFORMATION 0x0002 + +class ProductMapper +{ +private: + GenericInformationList *pVersionList; + GenericInformationList *pProductList; + + SByteStringList aBaseList; + SByteStringList aPrintedList; + + USHORT PrintDependentTargets( const ByteString &rProduct, USHORT nLevel = 0 ); + USHORT PrintAndDeleteBaseList(); + + SByteStringList *GetMinorList( const ByteString &rVersion, const ByteString &rEnvironment ); + BaseProductList *GetBases( GenericInformation *pProductInfo, USHORT nLevel = 0, BaseProductList *pBases = NULL ); + + USHORT PrintSingleMinorList( GenericInformation *pProductInfo, BaseProductList *pBases, const ByteString rEnvironment ); + +public: + ProductMapper(); + ProductMapper( GenericInformationList *pVerList ); + + ~ProductMapper(); + + void CreateProductList( GenericInformationList *pVerList ); + + USHORT GetProductInformation( const ByteString &rProduct, GenericInformation *& pProductInfo ); + USHORT PrintDependencies( const ByteString &rProduct ); + USHORT PrintProductList(); + + USHORT PrintMinorList( const ByteString rProduct, const ByteString rEnvironment ); + + static String GetVersionRoot( GenericInformationList *pList, const ByteString &rVersion ); + + GenericInformationList *GetProductList() { return pProductList; } +}; + + +#endif // PRODUCT_MAPPER_HXX + diff --git a/soldep/inc/soldep/connctr.hxx b/soldep/inc/soldep/connctr.hxx new file mode 100644 index 000000000000..40ef986245e5 --- /dev/null +++ b/soldep/inc/soldep/connctr.hxx @@ -0,0 +1,86 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _FMRWRK_CONNCTR_HXX +#define _FMRWRK_CONNCTR_HXX + + +#ifndef _SV_WINDOW_HXX +#include <vcl/window.hxx> +#endif +#include <bootstrp/listmacr.hxx> +#include <tools/stream.hxx> + +class DepWin; +class ObjectWin; + +static Rectangle aEmptyRect( Point( 0, 0), Point( 0, 0)); + +class Connector +{ + ObjectWin *mpStartWin, *mpEndWin; + ULONG mnStartId, mnEndId; + Point mStart, mEnd, mCenter; + DepWin* mpParent; + + BOOL bVisible; + BOOL mbHideIndependend; + static BOOL msbHideMode; + + +public: + double len; + Connector( DepWin* pParent, WinBits nWinStyle ); + ~Connector(); + + void Initialize( ObjectWin* pStartWin, ObjectWin* pEndWin, BOOL bVis = FALSE ); + Point GetMiddle(); + void Paint( const Rectangle& rRect ); + void UpdatePosition( ObjectWin* pWin, BOOL bPaint = TRUE ); + USHORT Save( SvFileStream& rOutFile ); + USHORT Load( SvFileStream& rInFile ); + ULONG GetStartId(){ return mnStartId; }; + ULONG GetEndId(){ return mnEndId; }; + ObjectWin* GetStartWin(){ return mpStartWin; }; + ObjectWin* GetEndWin(){ return mpEndWin; }; + ObjectWin* GetOtherWin( ObjectWin* pWin ); + ULONG GetOtherId( ULONG nId ); + ULONG GetLen(); + BOOL IsStart( ObjectWin* pWin ); + void SetHideIndependend( BOOL bHide) { mbHideIndependend = bHide; }; + + BOOL IsVisible() { return bVisible; } + void SetVisibility( BOOL visible ) { bVisible = visible; } + void UpdateVisibility(); + void SetHideMode(BOOL bHide) { msbHideMode = bHide; }; + void DrawOutput( OutputDevice* pDevice, const Point& rOffset ); +}; + +DECLARE_LIST( ConnectorList, Connector* ) + +#endif diff --git a/soldep/inc/soldep/depper.hxx b/soldep/inc/soldep/depper.hxx new file mode 100644 index 000000000000..a9de33c57043 --- /dev/null +++ b/soldep/inc/soldep/depper.hxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_DEPPER_HXX +#define _FMRWRK_DEPPER_HXX + +#include <vcl/window.hxx> +#include <vcl/wrkwin.hxx> +#include <tools/resmgr.hxx> +#include <soldep/objwin.hxx> +#include <soldep/depwin.hxx> +#include <soldep/graphwin.hxx> +#include <soldep/tbox.hxx> +#include <soldep/soldlg.hrc> +#include <soldep/hashtbl.hxx> +#include <soldep/hashobj.hxx> +#include <soldep/soldlg.hxx> +#include <soldep/prj.hxx> +#include <soldep/sdtresid.hxx> + +DECLARE_HASHTABLE_OWNER(SolIdMapper,ByteString,MyHashObject*) + +// just for conversion - convert char* to String +class ProgressBar; +class FixedText; + +#define SOLDEPL_NAME "StarDepend V1.0" + +#define DEPPER_ID 4711 + +//User Events +#define VCLEVENT_USER_MOUSEBUTTON_DOWN 5000 +#define VCLEVENT_USER_MOUSEBUTTON_DOWN_ALT 5001 +#define VCLEVENT_USER_MOUSEBUTTON_DOWN_CTRL 5002 +#define VCLEVENT_USER_MOUSEBUTTON_UP 5003 +#define VCLEVENT_USER_MOUSEBUTTON_UP_ALT 5004 +#define VCLEVENT_USER_MOUSEBUTTON_UP_CTRL 5005 +#define VCLEVENT_USER_MOUSEBUTTON_UP_SHFT 5006 +#define VCLEVENT_USER_MOUSEBUTTON_DOWN_DBLCLICK 5007 +#define VCLEVENT_USER_TBOX_RESIZE 5008 +#define VCLEVENT_USER_TBOX_RESIZE_APP 5009 +#define VCLEVENT_USER_TBOX_FIND 5010 +#define VCLEVENT_USER_TBOX_HIDE_INDEPENDEND 5011 +#define VCLEVENT_USER_TBOX_SELECT_WORKSPACE 5012 +#define VCLEVENT_USER_TBOX_BACK 5013 + +#define OBJWIN_X_SPACING 50 +#define OBJWIN_Y_SPACING 12 +#define DEPPER_MAX_DEPTH 100 +#define DEPPER_MAX_WIDTH 12 +#define DEPPER_MAX_LEVEL_WIDTH 10 * DEPPER_MAX_WIDTH + + +#define DEP_OK 0 +#define DEP_OBJECT_NOT_FOUND 1 +#define DEP_STARTID_NOT_FOUND 2 +#define DEP_ENDID_NOT_FOUND 3 +#define DEP_CONNECTOR_NOT_FOUND 4 +#define DEP_ENDLES_RECURSION_FOUND DEPPER_MAX_DEPTH + 1 + +#define DEPPOPUP_NEW 1 +#define DEPPOPUP_AUTOARRANGE 2 +#define DEPPOPUP_LOAD 3 +#define DEPPOPUP_SAVE 4 +#define DEPPOPUP_WRITE_SOURCE 5 +#define DEPPOPUP_READ_SOURCE 6 +#define DEPPOPUP_OPEN_SOURCE 7 +#define DEPPOPUP_ZOOMIN 8 +#define DEPPOPUP_ZOOMOUT 9 +#define DEPPOPUP_CLEAR 10 +#define DEPPOPUP_CLOSE 11 +#define DEPPOPUP_HELP 12 +#define DEPPOPUP_SHOW_TOOLBOX 13 +#define DEPPOPUP_TEST 0xff + +struct depper_head +{ + ULONG nID; + ULONG nObjectCount; + ULONG nCnctrCount; + +}; + +enum DistType +{ + BOTTOMUP = 0, + TOPDOWN = 1, + BOTH = 2 +}; + + +class Depper : public SolDevDll, public Window +{ + BOOL mbIsPrjView; + ULONG mnMinDynXOffs; + Point maDefPos; + Size maDefSize; + + long nZoomed; + + ULONG mnViewMask; + + ProgressBar* pSubBar; + ProgressBar* pMainBar; + FixedText* pSubText; + FixedText* pMainText; + SolAutoarrangeDlg maArrangeDlg; + + +protected: + Prj* mpPrj; + SolIdMapper* mpSolIdMapper; + SolIdMapper* mpPrjIdMapper; + StarWriter* mpStarWriter; + StarWriter* mpPrjStarWriter; //for inside prj-view + ULONG mnSolWinCount; + ULONG mnSolLastId; + ULONG mnPrjWinCount; + ULONG mnPrjLastId; + ObjectList* mpObjectList; //Extended ObjWinList class + ObjectList* mpObjectPrjList; //for module internal dependencies + DepWin* mpBaseWin; + DepWin* mpBasePrjWin; //for inside prj-view + GraphWin* mpGraphWin; + GraphWin* mpGraphPrjWin; //for inside prj-view + Window* mpProcessWin; + Window* mpParentProcessWin; + ObjectWin* ObjIdToPtr( ObjectList* pObjLst, ULONG nId ); + SoldepToolBox maToolBox; + FloatingWindow maTaskBarFrame; // For ToolBox + + ULONG AddObjectToList(DepWin* pParentWin, ObjectList* pObjLst, ULONG &LastID, ULONG &WinCount, ByteString& rBodyText, BOOL bInteract=TRUE ); + ULONG AddObjectToList( DepWin* pParentWin, ObjectList* pObjLst, ULONG &LastID, ULONG &WinCount, ByteString& rBodyText, Point& rPos, Size& rSize ); + ObjectWin* RemoveObjectFromList( ObjectList* pObjLst, ULONG &WinCount, USHORT nId, BOOL bDelete ); + USHORT AddConnectorToObjects( ObjectList* pObjLst, ULONG nStartId, ULONG nEndId ); + USHORT RemoveConnectorFromObjects( ObjectList* pObjLst, ULONG nStartId, ULONG nEndId ); + USHORT AddConnectorToObjects( ObjectWin* pStartWin, ObjectWin* pEndWin ); + USHORT RemoveConnectorFromObjects( ObjectWin* pStartWin, ObjectWin* pEndWin ); + +public: + Depper( Window* pBaseWindow ); + ~Depper(); + BOOL TogglePrjViewStatus(); + void SetPrjViewStatus(BOOL state) { mbIsPrjView = state; } + BOOL IsPrjView() { return mbIsPrjView; } + GraphWin* GetGraphWin() { return (!mbIsPrjView) ? mpGraphWin : mpGraphPrjWin; } //scrollbar window + DepWin* GetDepWin() { return (!mbIsPrjView) ? mpBaseWin : mpBasePrjWin; } //content of scrollbar window + ProgressBar* GetMainProgressBar() { return pMainBar; } + void SetMainProgressBar( USHORT i); + void UpdateMainProgressBar(USHORT i, USHORT nScaleVal, USHORT &nStep, BOOL bCountingDown = FALSE); + void UpdateSubProgrssBar(ULONG i); + void SetTitle( const String &rTitle ) { mpProcessWin->SetText( rTitle ); } + virtual void RemoveAllObjects( ObjectList* ObjLst ); + USHORT Save( const ByteString& rFileName ); +// USHORT Load( const ByteString& rFileName ); + virtual USHORT WriteSource(); + virtual USHORT ReadSource( BOOL bUpdater ); + virtual USHORT OpenSource(); + void SetDefPos( Point& rPos ) { maDefPos = rPos; }; + Point& GetDefPos() { return maDefPos; }; + void SetDefSize( Size& rSize ) { maDefSize = rSize; }; + Size& GetDefSize() { return maDefSize; }; + virtual USHORT AutoArrangeDlgStart(); + virtual USHORT AutoArrangeDlgStop(); + virtual USHORT Zoom( MapMode& rMapMode ); + virtual BOOL ViewContent( ByteString& ) { return FALSE; }; + virtual USHORT CloseWindow() { return 0; }; + virtual void ShowHelp(){}; + ObjectList* GetObjectList() { return (!mbIsPrjView) ? mpObjectList : mpObjectPrjList; } + ULONG HandleNewPrjDialog( ByteString &rBodyText ); + ULONG HandleNewDirectoryDialog( ByteString &rBodyText ); + void HideObjectsAndConnections( ObjectList* pObjLst ); + void ShowObjectsAndConnections( ObjectList* pObjLst ); + //virtual void MouseButtonDown( const MouseEvent& rMEvt ); +//#ifdef DEBUG + virtual void test(){}; + DECL_LINK( PopupSelected, PopupMenu* ); +//#endif + + //void SetViewMask( ULONG nMask ); + ULONG GetViewMask() { return mnViewMask; } +}; + +#endif diff --git a/soldep/inc/soldep/depwin.hxx b/soldep/inc/soldep/depwin.hxx new file mode 100644 index 000000000000..4464e91aa59a --- /dev/null +++ b/soldep/inc/soldep/depwin.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_DEPWIN_HXX +#define _FMRWRK_DEPWIN_HXX + +#ifndef _SV_WRKWIN_HXX +#include <vcl/wrkwin.hxx> +#endif +#include <vcl/menu.hxx> +#include <svtools/scrwin.hxx> +#include <soldep/connctr.hxx> + +class Depper; + +class DepWin : public Window +{ +private: + ConnectorList ConList; + + ObjectWin* mpNewConWin; + BOOL mbStartNewCon; + Point maNewConStart; + Point maNewConEnd; + ObjectWin* mpSelectedProject; + +public: + PopupMenu* mpPopup; +// Depper* mpDepperDontuseme; + + DepWin( Window* pParent, WinBits nWinStyle ); + ~DepWin(); + void AddConnector( Connector* pNewCon ); + void RemoveConnector( Connector* piOldCon ); + void NewConnector( ObjectWin* pWin ); + ConnectorList* GetConnectorList(); + void ClearConnectorList() { ConList.Clear();} + void Paint( const Rectangle& rRect ); + void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void Command( const CommandEvent& rEvent); +// void Resize(); + void MouseMove( const MouseEvent& rMEvt ); + BOOL IsStartNewCon() { return mbStartNewCon; }; + void SetPopupHdl( void* pHdl ); + void SetSelectedProject( ObjectWin* object ) { mpSelectedProject = object; }; + ObjectWin* GetSelectedProject() { return mpSelectedProject; }; +// DECL_LINK( PopupSelected, PopupMenu* ); + void DrawOutput( OutputDevice* pDevice, const Point& rOffset ); +}; + +#endif diff --git a/soldep/inc/soldep/graphwin.hxx b/soldep/inc/soldep/graphwin.hxx new file mode 100644 index 000000000000..e0152d6e34f7 --- /dev/null +++ b/soldep/inc/soldep/graphwin.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_GRAPHWIN_HXX +#define _FMRWRK_GRAPHWIN_HXX + +#include <svtools/scrwin.hxx> + +class GraphWin : public ScrollableWindow +{ +private: + void* mpClass; + +protected: + Window aBufferWindow; + +public: + GraphWin( Window * pParent, void * pClass ); + void CalcSize(); + virtual void EndScroll( long nDeltaX, long nDeltaY ); + virtual void Resize(); + virtual void Command( const CommandEvent& rEvent); + Window* GetBufferWindow(){ return &aBufferWindow; }; +}; + +#define PIXELS( nLeft, nTop, nWidth, nHeight )\ + LogicToPixel( Point( nLeft, nTop ) ), LogicToPixel( Size( nWidth, nHeight ) ) + +#endif // _FMRWRK_GRAPHWIN_HXX + diff --git a/soldep/inc/soldep/hashobj.hxx b/soldep/inc/soldep/hashobj.hxx new file mode 100644 index 000000000000..73d4daf699e7 --- /dev/null +++ b/soldep/inc/soldep/hashobj.hxx @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_HASHOBJ_HXX +#define _FMRWRK_HASHOBJ_HXX + +#include <soldep/hashtbl.hxx> + +class ObjectWin; + +class MyHashObject +{ + ObjectWin* mpWin; + ULONG mnId; +public: + MyHashObject( ULONG nId, ObjectWin* pWin ); + ULONG GetId() { return mnId; }; +}; + +#endif + diff --git a/soldep/inc/soldep/hashtbl.hxx b/soldep/inc/soldep/hashtbl.hxx new file mode 100644 index 000000000000..0308a6a33e0e --- /dev/null +++ b/soldep/inc/soldep/hashtbl.hxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _HASHTBL_HXX +#define _HASHTBL_HXX + +#include <tools/gen.hxx> +#include <tools/string.hxx> + +// ADT hash table +// +// Invariante: +// 1. m_lElem < m_lSize +// 2. die Elemente in m_Array wurden double-hashed erzeugt +// +class HashItem; + +class HashTable +{ + ULONG m_lSize; + ULONG m_lElem; + HashItem *m_pData; + double m_dMaxLoadFactor; + double m_dGrowFactor; + BOOL m_bOwner; + + ULONG Hash(ByteString const& Key) const; + ULONG DHash(ByteString const& Key, ULONG lHash) const; + ULONG Probe(ULONG lPos) const; + + HashItem* FindPos(ByteString const& Key) const; + void SmartGrow(); + double CalcLoadFactor() const; + +// Statistik +#ifdef DBG_UTIL +private: + struct + { + ULONG m_lSingleHash; + ULONG m_lDoubleHash; + ULONG m_lProbe; + } + m_aStatistic; +#endif + +protected: + friend class HashTableIterator; + + virtual void OnDeleteObject(void* pObject); + + void* GetObjectAt(ULONG lPos) const; + +// Default-Werte +public: + static double m_defMaxLoadFactor; + static double m_defDefGrowFactor; + +public: + HashTable + ( + ULONG lSize, + BOOL bOwner, + double dMaxLoadFactor = HashTable::m_defMaxLoadFactor /* 0.8 */, + double dGrowFactor = HashTable::m_defDefGrowFactor /* 2.0 */ + ); + + virtual ~HashTable(); + + BOOL IsFull() const; + ULONG GetSize() const { return m_lSize; } + + void* Find (ByteString const& Key) const; + BOOL Insert (ByteString const& Key, void* pObject); + void* Delete (ByteString const& Key); +}; + +// ADT hash table iterator +// +// Invariante: 0 <= m_lAt < m_aTable.GetCount() +// +class HashTableIterator +{ + ULONG m_lAt; + HashTable const& m_aTable; + + void* FindValidObject(BOOL bForward); + +protected: + void* GetFirst(); // Interation _ohne_ Sortierung + void* GetNext(); + void* GetLast(); + void* GetPrev(); + +public: + HashTableIterator(HashTable const&); +}; + +// typsichere Makros --------------------------------------------------- + +#define DECLARE_HASHTABLE_INTERN(ClassName,Owner,KeyType,ObjType) \ + class ClassName : public HashTable \ + { \ + public: \ + ClassName \ + ( \ + ULONG lSize, \ + double dMaxLoadFactor = HashTable::m_defMaxLoadFactor, \ + double dGrowFactor = HashTable::m_defDefGrowFactor \ + ) \ + : HashTable(lSize,Owner,dMaxLoadFactor,dGrowFactor) {} \ + \ + ObjType Find (KeyType const& Key) const \ + { return (ObjType) HashTable::Find(ByteString(Key)); } \ + \ + using HashTable::Insert; \ + BOOL Insert (KeyType const& Key, ObjType Object) \ + { return HashTable::Insert(ByteString(Key), (void*) Object); } \ + \ + ObjType Delete (KeyType const&Key) \ + { return (ObjType) HashTable::Delete (ByteString(Key)); } \ + }; + +// HashTable OHNE Owner-Verhalten +#define DECLARE_HASHTABLE(ClassName,KeyType,ObjType) \ + DECLARE_HASHTABLE_INTERN(ClassName,FALSE,KeyType,ObjType) + +// HashTable MIT Owner-Verhalten +#define DECLARE_HASHTABLE_OWNER(ClassName,KeyType,ObjType) \ + DECLARE_HASHTABLE_INTERN(ClassName##2,TRUE,KeyType,ObjType) \ + class ClassName : public ClassName##2 \ + { \ + protected: \ + virtual void OnDeleteObject(void* pObject); \ + public: \ + ClassName \ + ( \ + ULONG lSize, \ + double dMaxLoadFactor = HashTable::m_defMaxLoadFactor, \ + double dGrowFactor = HashTable::m_defDefGrowFactor \ + ) \ + : ClassName##2(lSize,dMaxLoadFactor,dGrowFactor) {} \ + ~ClassName(); \ + }; + +#define IMPLEMENT_HASHTABLE_OWNER(ClassName,KeyType,ObjType) \ + void ClassName::OnDeleteObject(void* pObject) \ + { delete (ObjType) pObject; } \ + \ + ClassName::~ClassName() \ + { \ + for (ULONG i=0; i<GetSize(); i++) \ + { \ + void *pObject = GetObjectAt(i); \ + if (pObject != NULL) \ + OnDeleteObject(pObject); \ + } \ + } + +// Iterator-Makros -------------------------------------------------- + +#define DECLARE_HASHTABLE_ITERATOR(ClassName,ObjType) \ + class ClassName : public HashTableIterator \ + { \ + public: \ + ClassName(HashTable const& aTable) \ + : HashTableIterator(aTable) {} \ + \ + ObjType GetFirst() \ + { return (ObjType)HashTableIterator::GetFirst(); } \ + ObjType GetNext() \ + { return (ObjType)HashTableIterator::GetNext(); } \ + ObjType GetLast() \ + { return (ObjType)HashTableIterator::GetLast(); } \ + ObjType GetPrev() \ + { return (ObjType)HashTableIterator::GetPrev(); } \ + }; + + +#endif // _HASHTBL_HXX diff --git a/soldep/inc/soldep/objwin.hxx b/soldep/inc/soldep/objwin.hxx new file mode 100644 index 000000000000..e7bc94826858 --- /dev/null +++ b/soldep/inc/soldep/objwin.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_OBJWIN_HXX +#define _FMRWRK_OBJWIN_HXX + +#ifndef _SV_WINDOW_HXX +#include <vcl/window.hxx> +#endif +#include <vcl/menu.hxx> +#include <vcl/timer.hxx> +#include <bootstrp/listmacr.hxx> +#include <tools/stream.hxx> + +#include <soldep/connctr.hxx> + +#define OBJWIN_EDIT_TEXT 1 +#define OBJWIN_ADD_CONNECTOR 2 +#define OBJWIN_REMOVE_WIN 3 +#define OBJWIN_VIEW_CONTENT 4 + +#define MARKMODE_DEFAULT 0 +#define MARKMODE_DEPENDING 1 +#define MARKMODE_NEEDED 2 +#define MARKMODE_ACTIVATED 4 +#define MARKMODE_SELECTED 8 + +class Depper; +class Connector; +class ObjectWin; + +class ObjectWin : public Window +{ + Point maMouseOffset; + Point maCalcPos; + ByteString msBodyText; + ByteString msTipText; + ULONG mnObjectId; + PopupMenu* mpPopup; + USHORT mnPopupStaticItems; + Wallpaper maObjWallpaper; + ConnectorList mConnections; + ULONG mnMarkMode; + ULONG mnViewMask; + BOOL mbVisible; + BOOL mbMenuExecute; + static BOOL msbHideMode; + static ULONG msnGlobalViewMask; //will be set by SolDep + +public: + BOOL mbVisited; +// double x, y; + + USHORT mnRootDist; + USHORT mnHeadDist; + BOOL mbFixed; + //Depper* mpDepperDontuseme; + Timer aTipTimer; + + ObjectWin( Window* pParent, WinBits nWinStyle ); + ~ObjectWin(); + void SetHideMode(BOOL bHide); + BOOL ToggleHideMode(); + BOOL IsHideMode() { return msbHideMode; }; + BOOL IsNullObject() { return (msBodyText == "null"); }; + void SetGlobalViewMask(ULONG gvm) { msnGlobalViewMask = gvm; }; + void SetBodyText( const ByteString& rNewText ); + ByteString& GetBodyText(); + ULONG GetIdByName( const ByteString& rText ); + void SetTipText( const ByteString& rNewText ); + ByteString& GetTipText(); + Point GetFixPoint( const Point& rRefPoint, BOOL bUseRealPos = TRUE ); + + void SetCalcPosPixel( const Point& rNewPos ){ maCalcPos = rNewPos; }; + Point GetCalcPosPixel() const { return maCalcPos; } + + void AddConnector( Connector* pNewCon ); + void RemoveConnector( Connector* pOldCon ); + Connector* GetConnector( ULONG nIndex ); + Connector* GetConnector( ULONG nStartId, ULONG nEndId ); + virtual void SetMarkMode( ULONG nMarkMode = 0 ); + virtual void UnsetMarkMode( ULONG nMarkMode ); + ULONG GetMarkMode(){ return mnMarkMode; }; + Wallpaper GetActualWallpaper() { return maObjWallpaper;}; + void SetActualWallpaper(const Wallpaper& aWp) { maObjWallpaper = aWp;}; + void MarkNeeded( BOOL bReset = FALSE ); + void MarkDepending( BOOL bReset = FALSE ); + void Paint( const Rectangle& rRecct ); + void MouseButtonDown( const MouseEvent& rMEvt ); + void MouseButtonUp( const MouseEvent& rMEvt ); + void MouseMove( const MouseEvent& rMEvt ); +// void DoubleClick(); + USHORT Save( SvFileStream& rOutFile ); + USHORT Load( SvFileStream& rInFile ); + void SetId( ULONG nId ); + ULONG GetId(); + void UpdateConnectors(); + void SetAllConnectorsUnvisible(); + virtual void Command( const CommandEvent& rEvent); + + void SetViewMask( ULONG nMask ); + ULONG GetViewMask() { return mnViewMask; } + using Window::IsVisible; + BOOL IsVisible() { return mbVisible; } + + DECL_LINK( PopupSelected, PopupMenu * ); + DECL_LINK( PopupDeactivated, PopupMenu * ); + DECL_LINK( TipHdl, void * ); + + //virtual void GetFocus(); + virtual void LoseFocus(); + + BOOL ConnectionExistsInAnyDirection( ObjectWin *pWin ); + void DrawOutput( OutputDevice* pDevice, const Point& rOffset ); + BOOL IsTop(); +}; + +DECL_DEST_LIST( TmpObjWinList, ObjWinList, ObjectWin* ) + +//Extend ObjWinList +class ObjectList : public ObjWinList +{ +private: + ObjectWin* pSelectedObjectWin; +protected: + BOOL mbHideMode; +public: + ObjectList(); + ~ObjectList() {}; + void ResetSelectedObject(); + ObjectWin* GetPtrByName( const ByteString& rText ); + ObjectList* FindTopLevelModules(); +}; + +#endif + diff --git a/soldep/inc/soldep/prj.hxx b/soldep/inc/soldep/prj.hxx new file mode 100644 index 000000000000..b04d6ac1fe4e --- /dev/null +++ b/soldep/inc/soldep/prj.hxx @@ -0,0 +1,480 @@ + /************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _PRJ_HXX +#define _PRJ_HXX + +#include <tools/fsys.hxx> +#include <tools/stream.hxx> +#ifndef _LISTMACR_HXX +#include <bootstrp/listmacr.hxx> +#endif +#include <vos/mutex.hxx> +#include <tools/string.hxx> + +#define XML_EXT "xlist" + +#define OS_NONE 0x0000 +#define OS_WIN16 0x0001 +#define OS_WIN32 0x0002 +#define OS_OS2 0x0004 +#define OS_UNX 0x0008 +#define OS_MAC 0x0010 +#define OS_ALL ( OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX | OS_MAC ) + +#define COMMAND_PROJECTROOT 0x0000 +#define COMMAND_NMAKE 0x0001 +#define COMMAND_GET 0x0002 +#define COMMAND_USER_START 0x0003 +#define COMMAND_USER_END 0xFFFE +#define COMMAND_ALLDIRS 0xFFFF + +class SByteStringList; +class GenericInformationList; + +/* +// Pfade auf Konfigurationsdateien des Build-Servers + +#define REQUEST_DIR \\src\data4\source\b_server\server\newjob +*/ +/********************************************************************* +* +* Die Klasse CommandData haelte alle Informationen, die fuer die +* Abarbeitung eines Kommandos (nmake, get) noetig sind +* +*********************************************************************/ + +class CommandData +{ + ByteString aPrj; + ByteString aLogFileName; + ByteString aInpath; + ByteString aUpd; + ByteString aUpdMinor; + ByteString aProduct; + ByteString aCommand; + ByteString aPath; + ByteString aPrePath; + ByteString aPreFix; + ByteString aCommandPara; + ByteString aComment; + ByteString sClientRestriction; + SByteStringList *pDepList; + SByteStringList *pCommandList; + USHORT nOSType; + USHORT nCommand; + + ULONG nDepth; // Tiefe der Abhaenigkeit + +public: + CommandData(); + ~CommandData(); + ByteString GetProjectName(){return aPrj;} + void SetProjectName( ByteString aName ){aPrj = aName;} + ByteString GetLogFile(){return aLogFileName;} + void SetLogFile( ByteString aName ){aLogFileName = aName;} + ByteString GetInpath(){return aInpath;} + void SetInpath( ByteString aName ){aInpath = aName;} + ByteString GetUpd(){return aUpd;} + void SetUpd( ByteString aName ){aUpd = aName;} + ByteString GetUpdMinor(){return aUpdMinor;} + void SetUpdMinor( ByteString aName ){aUpdMinor = aName;} + ByteString GetProduct(){return aProduct;} + void SetProduct( ByteString aName ){aProduct = aName;} + ByteString GetCommand(){return aCommand;} + void SetCommand ( ByteString aName ){aCommand = aName;} + ByteString GetCommandPara(){return aCommandPara;} + void SetCommandPara ( ByteString aName ){aCommandPara = aName;} + ByteString GetComment(){return aComment;} + void SetComment ( ByteString aCommentString ){aComment = aCommentString;} + ByteString GetPath(){return aPath;} + void SetPath( ByteString aName ){aPath = aName;} + ByteString GetPrePath(){return aPrePath;} + void SetPrePath( ByteString aName ){aPrePath = aName;} + USHORT GetOSType(){return nOSType;} + ByteString GetOSTypeString(); + void SetOSType( USHORT nType ){nOSType = nType;} + USHORT GetCommandType(){return nCommand;} + ByteString GetCommandTypeString(); + void SetCommandType( USHORT nCommandType ){nCommand = nCommandType;} + SByteStringList* GetDependencies(){return pDepList;} + void SetDependencies( SByteStringList *pList ){pDepList = pList;} + ByteString GetClientRestriction() { return sClientRestriction; } + void SetClientRestriction( ByteString sRestriction ) { sClientRestriction = sRestriction; } + + void AddDepth(){nDepth++;} + ULONG GetDepth(){return nDepth;} + + void AddCommand(ByteString* pCommand); + SByteStringList* GetCommandList() {return pCommandList;} + + CommandData& operator<< ( SvStream& rStream ); + CommandData& operator>> ( SvStream& rStream ); +}; + +/********************************************************************* +* +* Die Klasse SimpleConfig kann benutzt werden, um aus einer Textdatei +* alle Tokens zu lesen +* +*********************************************************************/ + +class SimpleConfig +{ + long nLine; + String aFileName; + SvFileStream aFileStream; + ByteString aTmpStr; + ByteString aStringBuffer; + + ByteString GetNextLine(); +public: + SimpleConfig(String aSimpleConfigFileName); + SimpleConfig(DirEntry& rDirEntry); + ~SimpleConfig(); + ByteString GetNext(); + ByteString GetCleanedNextLine( BOOL bReadComments = FALSE ); +}; + +#define ENV_GUI 0x00000000 +#define ENV_OS 0x00000001 +#define ENV_UPD 0x00000002 +#define ENV_UPDMIN 0x00000004 +#define ENV_INPATH 0x00000008 +#define ENV_OUTPATH 0x00000010 +#define ENV_GUIBASE 0x00000020 +#define ENV_CVER 0x00000040 +#define ENV_GVER 0x00000080 +#define ENV_GUIENV 0x00000100 +#define ENV_CPU 0x00000200 +#define ENV_CPUNAME 0x00000400 +#define ENV_DLLSUFF 0x00000800 +#define ENV_COMEX 0x00001000 +#define ENV_COMPATH 0x00002000 +#define ENV_INCLUDE 0x00004000 +#define ENV_LIB 0x00008000 +#define ENV_PATH 0x00010000 +#define ENV_SOLVER 0x00020000 +#define ENV_SOLENV 0x00040000 +#define ENV_SOLROOT 0x00080000 +#define ENV_DEVROOT 0x00100000 +#define ENV_EMERG 0x00200000 +#define ENV_STAND 0x00400000 + +DECL_DEST_LIST ( PrjList_tmp, PrjList, CommandData * ) + +/********************************************************************* +* +* class DepInfo +* Struct mit Modeinfos +* +*********************************************************************/ + +class DepInfo +{ + private: + ByteString* pProject; + SByteStringList* pModeList; + BOOL bAllModes; + + void RemoveProject (); + void RemoveModeList (); + public: + DepInfo() : pProject(0), pModeList(0), bAllModes(FALSE) {} + DepInfo(ByteString* pString) : pProject(0), pModeList(0), bAllModes(FALSE) {pProject = pString;} + DepInfo(ByteString* pString, SByteStringList* pList) : pProject(0), pModeList(0), bAllModes(FALSE) {pProject = pString; pModeList = pList;} + ~DepInfo(); + + void SetProject (ByteString* pStr); + ByteString* GetProject() {return pProject;} + void PutModeString (ByteString* pStr); + SByteStringList* GetModeList() {return pModeList;} + void SetModeList (SByteStringList* pList) {pModeList = pList;} + BOOL IsAllModes() {return bAllModes;} + void SetAllModes(BOOL bModes=TRUE) {bAllModes = bModes;} + + DepInfo& operator<< ( SvStream& rStream ); + DepInfo& operator>> ( SvStream& rStream ); +}; + +DECLARE_LIST( DepInfoList, DepInfo* ) + +/********************************************************************* +* +* class SDepInfoList +* Struct mit Modeinfos + Listen Methoden +* +*********************************************************************/ + +class SDepInfoList : public DepInfoList +{ + SByteStringList* pAllModeList; // only pointer to strings + + public: + SDepInfoList(); + ~SDepInfoList(); + + // neuen ByteString in Liste einfuegen + ULONG PutString( ByteString*, ByteString*); + ULONG PutString( ByteString*); + void PutModeString( DepInfo* pInfoList, ByteString* pStr ); + + ByteString* RemoveString( const ByteString& rName ); + + // Position des ByteString in Liste, wenn nicht enthalten, dann + // return = NOT_THERE + ULONG IsString( ByteString* ); + + // Vorgaenger ermitteln ( auch wenn selbst noch nicht in + // Liste enthalten + ULONG GetPrevString( ByteString* ); + SByteStringList* GetAllDepModes(); + + SDepInfoList& operator<< ( SvStream& rStream ); + SDepInfoList& operator>> ( SvStream& rStream ); +}; + + +/********************************************************************* +* +* class Prj +* alle Daten eines Projektes werden hier gehalten +* +*********************************************************************/ + +class Star; +class Prj : public PrjList +{ +friend class Star; +private: + + ByteString aPrjPath; + ByteString aProjectName; + ByteString aProjectPrefix; // max. 2-buchstabige Abk. + SByteStringList* pPrjInitialDepList; + SByteStringList* pPrjDepList; + SDepInfoList* pPrjDepInfoList; + BOOL bSorted; + BOOL bHardDependencies; + BOOL bFixedDependencies; + BOOL bVisited; + BOOL bIsAvailable; + SByteStringList* RemoveStringList(SByteStringList* pStringList ); + SDepInfoList* RemoveDepInfoList(SDepInfoList* pInfoList ); + PrjList* pTempCommandDataList; + BOOL bTempCommandDataListPermanent; +public: + Prj(); + Prj( ByteString aName ); + ~Prj(); + void SetPreFix( ByteString aPre ){aProjectPrefix = aPre;} + ByteString GetPreFix(){return aProjectPrefix;} + ByteString GetProjectName() + {return aProjectName;} + void SetProjectName(ByteString aName) + {aProjectName = aName;} + BOOL InsertDirectory( ByteString aDirName , USHORT aWhat, + USHORT aWhatOS, ByteString aLogFileName, + const ByteString &rClientRestriction ); + CommandData* RemoveDirectory( ByteString aLogFileName ); + CommandData* GetDirectoryList ( USHORT nWhatOs, USHORT nCommand ); + CommandData* GetDirectoryData( ByteString aLogFileName ); + inline CommandData* GetData( ByteString aLogFileName ) + { return GetDirectoryData( aLogFileName ); }; + + SByteStringList* GetDependencies( BOOL bExpanded = TRUE ); + SDepInfoList* GetModeAndDependencies() {return pPrjDepInfoList;} + void AddDependencies( ByteString aStr ); + void AddDependencies( ByteString aStr, ByteString aModeStr ); + void SetMode(SByteStringList* pModeList); + void HasHardDependencies( BOOL bHard ) { bHardDependencies = bHard; } + BOOL HasHardDependencies() { return bHardDependencies; } + void HasFixedDependencies( BOOL bFixed ) { bFixedDependencies = bFixed; } + BOOL HasFixedDependencies() { return bFixedDependencies; } + + BOOL IsAvailable() { return bIsAvailable; } + void IsAvailable( BOOL bAvailable ) { bIsAvailable=bAvailable; } + + void ExtractDependencies(); + + PrjList* GetCommandDataList (); + void RemoveTempCommandDataList(); + void GenerateTempCommandDataList(); + void GenerateEmptyTempCommandDataList(); + BOOL HasTempCommandDataList() {return pTempCommandDataList != NULL;} + void SetTempCommandDataListPermanent (BOOL bVar = TRUE) {bTempCommandDataListPermanent = bVar;} + BOOL IsTempCommandDataListPermanent() {return bTempCommandDataListPermanent;} + + Prj& operator<< ( SvStream& rStream ); + Prj& operator>> ( SvStream& rStream ); +}; + +/********************************************************************* +* +* class Star +* Diese Klasse liest die Projectstruktur aller StarDivision Projekte +* aus \\dev\data1\upenv\data\config\solar.lst aus +* +*********************************************************************/ + +DECL_DEST_LIST ( StarList_tmp, StarList, Prj* ) +DECLARE_LIST ( SolarFileList, String* ) + +class StarFile +{ +private: + String aFileName; + Date aDate; + Time aTime; + Date aDateCreated; + Time aTimeCreated; + + BOOL bExists; + +public: + StarFile( const String &rFile ); + const String &GetName() { return aFileName; } + Date GetDate() { return aDate; } + Time GetTime() { return aTime; } + + BOOL NeedsUpdate(); + BOOL Exists() { return bExists; } +}; + +DECLARE_LIST( StarFileList, StarFile * ) + +#define STAR_MODE_SINGLE_PARSE 0x0000 +//#define STAR_MODE_RECURSIVE_PARSE 0x0001 it dosen't work anymore +#define STAR_MODE_MULTIPLE_PARSE 0x0002 + +class Star : public StarList +{ +private: + Link aDBNotFoundHdl; + ByteString aStarName; // no idee what this should be + +protected: + NAMESPACE_VOS( OMutex ) aMutex; + + USHORT nStarMode; + SolarFileList aFileList; + StarFileList aLoadedFilesList; + String sSourceRoot; + String sFileName; + SByteStringList* pDepMode; + SByteStringList* pAllDepMode; + + Link aFileIOErrorHdl; // called with &String as parameter!!! + + void InsertSolarList( String sProject ); + String CreateFileName( String& rProject, String& rSourceRoot ); + + void Expand_Impl(); + void ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj ); + ULONG SearchFileEntry( StarFileList *pStarFiles, StarFile* pFile ); + +public: + Star(); + Star( String aFileName, USHORT nMode = STAR_MODE_SINGLE_PARSE ); + Star( SolarFileList *pSolarFiles ); + Star( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bLocal = FALSE, + const char *pSourceRoot = NULL ); + + ~Star(); + + void SetDBNotFoundHdl( const Link &rLink ) { aDBNotFoundHdl = rLink; } + void SetFileIOErrorHdl( const Link &rLink ) { aFileIOErrorHdl = rLink; } + + ByteString GetName(){ return aStarName; }; // dummy function of VG + void Read( String &rFileName ); + void Read( SolarFileList *pSOlarFiles ); +// void ReadXmlBuildList(const ByteString& sBuildLstPath); + + + BOOL HasProject( ByteString aProjectName ); + Prj* GetPrj( ByteString aProjectName ); + ByteString GetPrjName( DirEntry &rPath ); + BOOL RemovePrj ( Prj* pPrj ); + void RemoveAllPrj (); + + void InsertToken( char *pChar ); + BOOL NeedsUpdate(); + SolarFileList* NeedsFilesForUpdate(); + void ReplaceFileEntry( StarFileList *pStarFiles, StarFile* pFile ); + void UpdateFileList( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bRead = FALSE, + BOOL bLocal = FALSE, const char *pSourceRoot = NULL ); + void FullReload( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bRead = FALSE, + BOOL bLocal = FALSE, const char *pSourceRoot = NULL ); + void GenerateFileLoadList( SolarFileList *pSolarFiles ); + BOOL CheckFileLoadList(SolarFileList *pSolarFiles); + + USHORT GetMode() { return nStarMode; } + String GetFileName(){ return sFileName; }; + String GetSourceRoot(){ return sSourceRoot; }; + SByteStringList* GetAvailableDeps (); + void ClearAvailableDeps (); + SByteStringList* GetCurrentDeps () {return pDepMode;} + void SetCurrentDeps (SByteStringList* pDepList); + void ClearCurrentDeps (); + + int GetOSType ( ByteString& aWhatOS ); + int GetJobType ( ByteString& JobType ); + + void ClearLoadedFilesList (); + + void PutPrjIntoStream (SByteStringList* pPrjNameList, SvStream* pStream); + Star& operator<< ( SvStream& rStream ); + Star& operator>> ( SvStream& rStream ); +}; + +class StarWriter : public Star +{ +private: + USHORT WritePrj( Prj *pPrj, SvFileStream& rStream ); + +public: + StarWriter( String aFileName, BOOL bReadComments = FALSE, USHORT nMode = STAR_MODE_SINGLE_PARSE ); + StarWriter( SolarFileList *pSolarFiles, BOOL bReadComments = FALSE ); + StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, ByteString &rMinor, + BOOL bReadComments = FALSE, BOOL bLocal = FALSE, const char *pSourceRoot = NULL ); + + void CleanUp(); + + BOOL InsertProject ( Prj* pNewPrj ); + Prj* RemoveProject ( ByteString aProjectName ); + + USHORT Read( String aFileName, BOOL bReadComments = FALSE, USHORT nMode = STAR_MODE_SINGLE_PARSE ); + USHORT Read( SolarFileList *pSolarFiles, BOOL bReadComments = FALSE ); + USHORT Write( String aFileName ); + USHORT WriteMultiple( String rSourceRoot ); + + void InsertTokenLine( ByteString& rString ); +}; + +#endif + + diff --git a/soldep/inc/soldep/sdtresid.hxx b/soldep/inc/soldep/sdtresid.hxx new file mode 100644 index 000000000000..02a3a57e37ea --- /dev/null +++ b/soldep/inc/soldep/sdtresid.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SOLDEV_RESID_HXX_ +#define _SOLDEV_RESID_HXX_ +#include <tools/resmgr.hxx> +#include <tools/shl.hxx> +#include <vcl/svapp.hxx> + + +class SolDevDll +{ + ResMgr* pResMgr; +public: + SolDevDll(); + ~SolDevDll(); + + ResMgr* GetResMgr() { return pResMgr; } +}; + +class DtSodResId : public ResId +{ +public: + DtSodResId(USHORT nId); +}; + +#endif + diff --git a/soldep/inc/soldep/soldep.hxx b/soldep/inc/soldep/soldep.hxx new file mode 100644 index 000000000000..55fb4fc0e11c --- /dev/null +++ b/soldep/inc/soldep/soldep.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_SOLDEP_HXX +#define _FMRWRK_SOLDEP_HXX + +#define SOURCEROOT "SOLARSRC" + +#include <tools/string.hxx> + +#include <soldep/depper.hxx> + +#define SOURCEROOT "SOLARSRC" + +class ObjectWin; + +class SolDep : public Depper +{ + BOOL mbBServer; //call from build server + ULONG mnMinDynXOffs; + ULONG mnLevelOffset; + ULONG mnXOffset; + ObjWinList* mpTravellerList; + + String msSourceName; + ByteString msVersionMajor; + ByteString msVersionMinor; + ByteString msProject; + ObjectWin* mpFocusWin; + BOOL mbIsHide; + + GenericInformationList *mpStandLst; + + DECL_LINK( ChildWindowEventListener, VclSimpleEvent* ); + DECL_LINK( ToolSelect, SoldepToolBox* ); + + SolarFileList* GetPrjListFromDir(); + + Point CalcPos( USHORT nSet, USHORT nIndex ); + ULONG CalcXOffset( ULONG nObjectsToFit ); + double CalcDistSum( ObjWinList* pObjList, DistType eDistType = TOPDOWN ); + USHORT Impl_Traveller( ObjectWin* pWin, USHORT nDepth ); + double Impl_PermuteMin( ObjWinList& rObjList, Point* pPosArray, ObjWinList& rResultList, + double dMinDist, ULONG nStart, ULONG nSize, DistType eDisType = TOPDOWN ); + USHORT Load( const ByteString& rFileName ); + void WriteToErrorFile(); + BOOL MarkObjects( ObjectWin* pObjectWin ); + void InitContextMenueMainWnd(); + void InitContextMenuePrjViewWnd(DepWin* pWin); +protected: + /// will be called for any VclWindowEvent events broadcasted by our VCL window + virtual void ProcessChildWindowEvent( const VclWindowEvent& _rVclWindowEvent ); + inline bool isAlive() const { return NULL != mpProcessWin; } + + +public: + SolDep( Window* pBaseWindow ); + ~SolDep(); + BOOL IsHideMode() { return mbIsHide;}; + void ToggleHideDependency(); + + virtual ULONG GetStart(SolIdMapper* pIdMapper, ObjectList* pObjList); + ULONG GetStartPrj(SolIdMapper* pIdMapper, ObjectList* pObjList); + virtual USHORT ReadSource( BOOL bUpdater = FALSE ); + virtual USHORT WriteSource(); + virtual USHORT OpenSource(); + BOOL GetVersion(); + void Init(); + void Init( ByteString &rVersion, GenericInformationList *pVersionList = NULL ); + BOOL InitPrj( ByteString& rListName ); +// using Depper::AddObject; + virtual ULONG AddObject( ByteString& rBodyText, BOOL Interact=TRUE ); + ULONG AddPrjObject( ByteString& rBodyText, BOOL Interact=TRUE ); + virtual ObjectWin* RemoveObject( USHORT nId, BOOL bDelete = TRUE ); + virtual void RemoveAllObjects( ObjectList* pObjLst ); + virtual USHORT AddConnector( ObjectWin* pStartWin, ObjectWin* pEndWin ); + USHORT AddConnectorPrjView( ObjectWin* pStartWin, ObjectWin* pEndWin ); + virtual USHORT RemoveConnector( ObjectWin* pStartWin, ObjectWin* pEndWin ); + USHORT RemoveConnectorPrjView( ObjectWin* pStartWin, ObjectWin* pEndWin ); + USHORT AutoArrange( SolIdMapper* pIdMapper, ObjectList* pObjLst, ULONG nTopId, ULONG nBottmId, ULONG aObjID ); + USHORT OptimizePos( SolIdMapper* pIdMapper, ObjectList* pObjLst, ULONG nTopId, ULONG nBottmId, ULONG aObjID ); + virtual BOOL ViewContent( ByteString& rObjectName ); + virtual USHORT CloseWindow(); + virtual void ShowHelp(); + FloatingWindow* GetTaskBarFrame() { return &maTaskBarFrame; } + SoldepToolBox* GetSoldepToolBox() { return &maToolBox; } + + BOOL FindProject(); + void Resize(); +}; + +#endif diff --git a/soldep/inc/soldep/soldlg.hrc b/soldep/inc/soldep/soldlg.hrc new file mode 100644 index 000000000000..94a26514e5b2 --- /dev/null +++ b/soldep/inc/soldep/soldlg.hrc @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#define SOLDEPL_START 1000 + +#define BTN_OK (SOLDEPL_START+1) +#define BTN_CANCEL (SOLDEPL_START+2) + +#define FT_PRJNAME (SOLDEPL_START+3) +#define EDIT_PRJNAME (SOLDEPL_START+4) +#define FT_PRJSHORT (SOLDEPL_START+5) +#define EDIT_PRJSHORT (SOLDEPL_START+6) +#define FT_PRJDEPS (SOLDEPL_START+7) +#define EDIT_PRJDEPS (SOLDEPL_START+8) + + +#define FT_DIRNAME (SOLDEPL_START+9) +#define EDIT_DIRNAME (SOLDEPL_START+10) +#define FT_DIRFLAG (SOLDEPL_START+11) +#define EDIT_DIRFLAG (SOLDEPL_START+12) +#define FT_DIRDEPS (SOLDEPL_START+13) +#define EDIT_DIRDEPS (SOLDEPL_START+14) +#define FT_DIRACTION (SOLDEPL_START+15) +#define EDIT_DIRACTION (SOLDEPL_START+16) +#define FT_DIRENV (SOLDEPL_START+17) +#define EDIT_DIRENV (SOLDEPL_START+18) + +#define EDIT_HELP (SOLDEPL_START+19) + +#define DLG_VERSIONSELECT (SOLDEPL_START+20) +#define DLG_VERSIONSELECT_LISTBOX (SOLDEPL_START+21) +#define DLG_VERSIONSELECT_GROUP (SOLDEPL_START+22) +#define DLG_VERSIONSELECT_OK (SOLDEPL_START+23) +#define DLG_VERSIONSELECT_CANCEL (SOLDEPL_START+24) +#define DLG_MINORSELECT_EDIT (SOLDEPL_START+33) +#define DLG_MINORSELECT_GROUP (SOLDEPL_START+34) +#define DLG_AUTOARRANGE (SOLDEPL_START+25) +#define DLG_AUTOARRANGE_GROUP (SOLDEPL_START+26) +#define DLG_AUTOARRANGE_TEXT_MODULE (SOLDEPL_START+27) +#define DLG_AUTOARRANGE_TEXT_OVERALL (SOLDEPL_START+28) + +#define DLG_FIND_PROJECT (SOLDEPL_START+29) +#define DLG_FIND_PROJECT_OK (SOLDEPL_START+30) +#define DLG_FIND_PROJECT_CANCEL (SOLDEPL_START+31) +#define DLG_FIND_PROJECT_COMBOBOX (SOLDEPL_START+32) + +#define TID_SOLDEP_MAIN (SOLDEPL_START+20000) +#define TID_SOLDEP_OPEN (TID_SOLDEP_MAIN+1) +#define TID_SOLDEP_SAVE (TID_SOLDEP_MAIN+2) +#define TID_SOLDEP_FIND (TID_SOLDEP_MAIN+3) +#define TID_SOLDEP_HIDE_INDEPENDEND (TID_SOLDEP_MAIN+4) +#define TID_SOLDEP_SELECT_WORKSPACE (TID_SOLDEP_MAIN+5) +#define TID_SOLDEP_BACK (TID_SOLDEP_MAIN+6) +#define TID_SOLDEP_CREATEMETA (TID_SOLDEP_MAIN+7) +#define TID_SMALL_PIN_PINED (TID_SOLDEP_MAIN+100) +#define TID_SMALL_PIN_UNPINED (TID_SOLDEP_MAIN+101) diff --git a/soldep/inc/soldep/soldlg.hxx b/soldep/inc/soldep/soldlg.hxx new file mode 100644 index 000000000000..ef57908b6913 --- /dev/null +++ b/soldep/inc/soldep/soldlg.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FMRWRK_SOLDLG_HXX +#define _FMRWRK_SOLDLG_HXX + +#include <vcl/wintypes.hxx> +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/edit.hxx> +#include <svtools/svmedit.hxx> +#include <svtools/prgsbar.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/group.hxx> +#include <vcl/combobox.hxx> + +// forwards +class GenericInformationList; + +// +// class SolNewProjectDlg +// + +class SolNewProjectDlg : public ModalDialog +{ +public: + OKButton maOkButton; + CancelButton maCancelButton; + FixedText maFTName; + Edit maEName; + FixedText maFTShort; + Edit maEShort; + FixedText maFTDeps; + Edit maEDeps; + + SolNewProjectDlg( Window* pParent, const ResId& rResId ); + DECL_LINK( OkHdl, Button* pOkBtn ); + DECL_LINK( CancelHdl, Button* pCancelBtn ); +}; + +// +// SolNewDirectoryDlg +// + +class SolNewDirectoryDlg : public ModalDialog +{ +public: + OKButton maOkButton; + CancelButton maCancelButton; + FixedText maFTName; + Edit maEName; + FixedText maFTFlag; + Edit maEFlag; + FixedText maFTDeps; + Edit maEDeps; + FixedText maFTAction; + Edit maEAction; + FixedText maFTEnv; + Edit maEEnv; + + SolNewDirectoryDlg( Window* pParent, const ResId& rResId ); + DECL_LINK( OkHdl, Button* pOkBtn ); + DECL_LINK( CancelHdl, Button* pCancelBtn ); +}; + +// +// SolHelpDlg +// + +class SolHelpDlg : public ModalDialog +{ +public: + OKButton maOkButton; + MultiLineEdit maMLEHelp; + + SolHelpDlg( Window* pParent, const ResId& rResId ); + DECL_LINK( OkHdl, Button* pOkBtn ); +}; + +// +// class SolSelectVersionDlg +// + +class SolSelectVersionDlg : public ModalDialog +{ +private: + ListBox maVersionListBox; + GroupBox maVersionGroupBox; + Edit maMinorEditBox; + GroupBox maMinorGroupBox; + OKButton maOKButton; + CancelButton maCancelButton; + ByteString msVersionMajor; + ByteString msVersionMinor; + +public: + SolSelectVersionDlg( Window *pParent, GenericInformationList *pStandLst ); + ByteString GetVersionMajor(); + ByteString GetVersionMinor(); + DECL_LINK( DoubleClickHdl, ListBox * ); +}; + +class SolAutoarrangeDlg : public ModelessDialog +{ +private: + GroupBox maGroupBox; + FixedText maModuleText; + FixedText maOverallText; + ProgressBar maModuleBar; + ProgressBar maOverallBar; + +public: + SolAutoarrangeDlg( Window *pParent ); + + ProgressBar *GetSubBar() { return &maModuleBar; } + ProgressBar *GetMainBar() { return &maOverallBar; } + + FixedText *GetSubText() { return &maModuleText; } + FixedText *GetMainText() { return &maOverallText; } +}; + +class SolFindProjectDlg : public ModalDialog +{ +private: + ComboBox maCombobox; + OKButton maOKButton; + CancelButton maCancelButton; + +public: + SolFindProjectDlg( Window *pParent, ObjWinList* pObjList ); + ByteString GetProject(); +}; + +#endif // _FMRWRK_SOLDLG_HXX diff --git a/soldep/inc/soldep/tbox.hxx b/soldep/inc/soldep/tbox.hxx new file mode 100644 index 000000000000..69276895aad5 --- /dev/null +++ b/soldep/inc/soldep/tbox.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SOLDEPTBOX_HXX +#define _SOLDEPTBOX_HXX + +#include <vcl/toolbox.hxx> +#include <vcl/menu.hxx> + +class SoldepToolBox : public ToolBox +{ +protected: +// USHORT nBuildServerToolBoxId; + BOOL bDockable; + BOOL bCloseMode; + BOOL bOldFloatMode; + BOOL bBoxIsVisible; + BOOL bPin; + BOOL bPinable; + + PopupMenu aMenu; + + Rectangle aOutRect; + Rectangle aInRect; + + Link aResizeHdl; + Link aMouseDownHdl; + + Bitmap aPinedBitmap; + Bitmap aUnpinedBitmap; + + void InitContextMenu(); + +public: + SoldepToolBox( Window* pParent, const ResId& aId, BOOL bDAble = TRUE ); + ~SoldepToolBox(); + + virtual void Command( const CommandEvent& rCEvt); + virtual void CallContextMenu( Window *pWin, Point aPos ); + virtual void Paint( const Rectangle& rRect ); + virtual void MouseButtonDown(const MouseEvent& rEvent); + virtual void MouseButtonUp(const MouseEvent& rEvent); + virtual void MouseMove(const MouseEvent& rEvent); + + virtual void ToggleFloatingMode(); +// void SetFloatingWindow( FloatingWindow* pFW) { ToolBox::mpFloatWin = pFW; } + virtual void StartDocking(); + virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode ); + virtual BOOL Close(); + virtual void CloseDockingMode(); + + //Called when toolbar droped + virtual void Tracking( const TrackingEvent &rTEvt ) { Invalidate(); ToolBox::Tracking( rTEvt );} + + virtual void Move(); + + using DockingWindow::SetPosSizePixel; + void SetPosSizePixel( const Point& rNewPos, + const Size& rNewSize ); + + void SetDockingRects( const Rectangle& rOutRect, + const Rectangle& rInRect ); + + void SetMouseDownHdl(const Link& rLink) { aMouseDownHdl = rLink; } + Link GetMouseDownHdl() { return aMouseDownHdl; } + void SetResizeHdl(const Link& rLink) { aResizeHdl = rLink; } + + BOOL IsBoxVisible() { return bBoxIsVisible; } + + void EnablePin( BOOL bEnable = TRUE ) { bPinable = bEnable; Invalidate(); } + BOOL GetPin(); + void TogglePin(); + void SetPin(BOOL bP); + PopupMenu *GetContextMenu(); + DECL_LINK( MenuSelectHdl, Menu * ); +}; + +#endif |